my_dict_list.php 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <?php
  2. require_once '../studio/index_head.php';
  3. ?>
  4. <body id="file_list_body" onLoad="my_term_onload()">
  5. <script src="../term/my_term.js"></script>
  6. <script src="../term/term_edit_dlg.js"></script>
  7. <link type="text/css" rel="stylesheet" href="../term/term_edit_dlg.css"/>
  8. <script >
  9. var gCurrPage="term";
  10. </script>
  11. <style>
  12. #term {
  13. background-color: var(--btn-border-color);
  14. }
  15. #term:hover{
  16. background-color: var(--btn-border-color);
  17. color: var(--btn-color);
  18. cursor:auto;
  19. }
  20. #word_list{
  21. width:unset;
  22. }
  23. </style>
  24. <?php
  25. require_once '../studio/index_tool_bar.php';
  26. ?>
  27. <div class="index_inner" style=" margin-left: 18em;margin-top: 5em;">
  28. <div id="word_list" class="file_list_block">
  29. <div class="tool_bar">
  30. <div>
  31. <?php echo $_local->gui->terms_system; ?>
  32. </div>
  33. <div>
  34. <span class="icon_btn_div">
  35. <span class="icon_btn_tip"><?php echo $_local->gui->add; ?></span>
  36. <button id="file_add" type="button" class="icon_btn" title=" " onclick="term_edit_dlg_open()">
  37. <svg class="icon">
  38. <use xlink:href="../studio/svg/icon.svg#ic_add_circle"></use>
  39. </svg>
  40. </button>
  41. </span>
  42. <span class="icon_btn_div">
  43. <span class="icon_btn_tip"><?php echo $_local->gui->recycle_bin; ?></span>
  44. <button id="to_recycle" type="button" class="icon_btn" onclick="file_del()" title=" ">
  45. <svg class="icon">
  46. <use xlink:href="../studio/svg/icon.svg#ic_delete"></use>
  47. </svg>
  48. </button>
  49. </span>
  50. </div>
  51. </div>
  52. <div id="userfilelist">
  53. <?php
  54. //
  55. require_once "../path.php";
  56. require_once "../public/_pdo.php";
  57. require_once '../public/load_lang.php';
  58. require_once '../ucenter/function.php';
  59. if (isset($_GET["page"])) {
  60. $iCurrPage = $_GET["page"];
  61. } else {
  62. $iCurrPage = 0;
  63. }
  64. $iOnePage = 300;
  65. PDO_Connect(_FILE_DB_TERM_);
  66. $query = "select count(*) as co from term where owner= ? ";
  67. $allWord = PDO_FetchOne($query, array($_COOKIE["userid"]));
  68. $iCountWords = $allWord;
  69. if ($iCountWords == 0) {
  70. echo "<div id='setting_user_dict_count'>您的术语字典中没有单词。</div>";
  71. } else {
  72. echo "<div id='setting_user_dict_count'>" . $_local->gui->my_term . "&nbsp;" . $_local->gui->include . "{$iCountWords}" . $_local->gui->words . "</div>";
  73. $iPages = ceil($iCountWords / $iOnePage);
  74. if ($iCurrPage > $iPages) {
  75. $iCurrPage = $iPages;
  76. }
  77. $begin = $iCurrPage * $iOnePage;
  78. $query = "select * from term where owner= ? ";
  79. $allWords = PDO_FetchAll($query, array($_COOKIE["userid"]));
  80. echo '<div id="setting_user_dict_nav">';
  81. if ($iCurrPage == 0) {
  82. echo "第一页 | ";
  83. echo "上一页";
  84. } else {
  85. echo "<a href=\"setting.php?item=term&page=0\">第一页</a>";
  86. $prevPage = $iCurrPage - 1;
  87. echo "<a href=\"setting.php?item=term&page={$prevPage}\">上一页</a>";
  88. }
  89. echo "第<span style='display:inline-block;width:4em;'><input type=\"input\" value=\"" . ($iCurrPage + 1) . "\" size=\"4\" /></span>页";
  90. echo "共{$iPages}页";
  91. if ($iCurrPage < $iPages - 1) {
  92. echo "<a href=\"setting.php?item=term&page=" . ($iCurrPage + 1) . "\">下一页</a>";
  93. echo "<a href=\"setting.php?item=term&page=" . ($iPages - 1) . "\">最后一页</a>";
  94. } else {
  95. echo "下一页 | 最后一页";
  96. }
  97. ?>
  98. </div>
  99. <div>
  100. <div style="display:flex;">
  101. <div style='max-width:2em;flex:1;'></div>
  102. <div style='flex:1;'>Sn</div>
  103. <div style='flex:2;'>Spell</div>
  104. <div style='flex:2;'>Meaning</div>
  105. <div style='flex:2;'>Meaning2</div>
  106. <div style='flex:4;'>Note</div>
  107. <div style='flex:1;'>Language</div>
  108. <div style='flex:1;'>Channal</div>
  109. <div style='flex:1;'></div>
  110. </div>
  111. <?php
  112. foreach ($allWords as $key => $word) {
  113. echo '<div class="file_list_row" style="padding:5px;">';
  114. echo '<div style="max-width:2em;flex:1;"><input type="checkbox" /></div>';
  115. echo "<div style='flex:1;'>" . ($key + 1) . "</div>";
  116. echo "<div style='flex:2;'>{$word["word"]}</div>";
  117. echo "<div style='flex:2;'>{$word["meaning"]}</div>";
  118. echo "<div style='flex:2;'>{$word["other_meaning"]}</div>";
  119. echo "<div style='flex:4;'><textarea style='width:100%;'>{$word["note"]}</textarea></div>";
  120. echo "<div style='flex:1;'>{$word["language"]}</div>";
  121. echo "<div style='flex:1;'>{$word["channal"]}</div>";
  122. echo "<div style='flex:1;'><button onclick=\"term_edit_dlg_open('{$word["guid"]}')\">edit</button></div>";
  123. echo "</div>";
  124. }
  125. echo '</div>';
  126. }
  127. ?>
  128. </div>
  129. <?php
  130. require_once '../studio/index_foot.php';
  131. ?>