my_dict_list.php 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. <?php
  2. require_once '../studio/index_head.php';
  3. ?>
  4. <body id="file_list_body" onLoad="course_list()">
  5. <script >
  6. var gCurrPage="udict";
  7. </script>
  8. <style>
  9. #udict {
  10. background-color: var(--btn-border-color);
  11. }
  12. #udict:hover{
  13. background-color: var(--btn-border-color);
  14. color: var(--btn-color);
  15. cursor:auto;
  16. }
  17. #word_list{
  18. width:unset;
  19. }
  20. #setting_user_dict_nav{
  21. width:95%;
  22. display:inline-flex;
  23. justify-content: space-between;
  24. }
  25. }
  26. </style>
  27. <?php
  28. require_once '../studio/index_tool_bar.php';
  29. ?>
  30. <div class="index_inner" style=" margin-left: 18em;margin-top: 5em;">
  31. <div id="word_list" class="file_list_block">
  32. <div class="tool_bar">
  33. <div>
  34. <?php echo $_local->gui->userdict; ?>
  35. </div>
  36. <div>
  37. <span class="icon_btn_div">
  38. <span class="icon_btn_tip"><?php echo $_local->gui->add; ?></span>
  39. <button id="file_add" type="button" class="icon_btn" title=" ">
  40. <a href="../course/my_channal_new.php">
  41. <svg class="icon">
  42. <use xlink:href="../studio/svg/icon.svg#ic_add_circle"></use>
  43. </svg>
  44. </a>
  45. </button>
  46. </span>
  47. <span class="icon_btn_div">
  48. <span class="icon_btn_tip"><?php echo $_local->gui->recycle_bin; ?></span>
  49. <button id="to_recycle" type="button" class="icon_btn" onclick="file_del()" title=" ">
  50. <svg class="icon">
  51. <use xlink:href="../studio/svg/icon.svg#ic_delete"></use>
  52. </svg>
  53. </button>
  54. </span>
  55. </div>
  56. </div>
  57. <div id="userfilelist">
  58. <?php
  59. //
  60. require_once "../path.php";
  61. require_once "../public/_pdo.php";
  62. require_once '../public/load_lang.php';
  63. require_once '../ucenter/function.php';
  64. if (isset($_GET["page"])) {
  65. $iCurrPage = $_GET["page"];
  66. } else {
  67. $iCurrPage = 0;
  68. }
  69. $iOnePage = 300;
  70. PDO_Connect(_FILE_DB_WBW_);
  71. $query = "select count(word_index) as co from user_index where user_id={$UID}";
  72. $allWord = PDO_FetchOne($query);
  73. $iCountWords = $allWord;
  74. if ($iCountWords == 0) {
  75. echo "<div id='setting_user_dict_count'>您的用户字典中没有单词。</div>";
  76. } else {
  77. echo "<div>{$_local->gui->search}<span style='display:inline-block;width:20em;'><input type='input' /></span></div>";
  78. $iPages = ceil($iCountWords / $iOnePage);
  79. if ($iCurrPage > $iPages) {
  80. $iCurrPage = $iPages;
  81. }
  82. $begin = $iCurrPage * $iOnePage;
  83. $query = "select word_index from user_index where user_id={$UID} order by id DESC limit {$begin},{$iOnePage} ";
  84. $allWord = PDO_FetchAll($query);
  85. $strQuery = "('";
  86. foreach ($allWord as $one) {
  87. $strQuery .= $one["word_index"] . "','";
  88. }
  89. $strQuery = substr($strQuery, 0, strlen($strQuery) - 2);
  90. $strQuery .= ")";
  91. $query = "select * from dict where id in {$strQuery} order by time DESC";
  92. $allWords = PDO_FetchAll($query);
  93. ?>
  94. <div id="setting_user_dict_nav">
  95. <?php
  96. if ($iCurrPage == 0) {
  97. echo "<span>{$_local->gui->first_page}</span>";
  98. echo "<span>{$_local->gui->previous_page}</span>";
  99. } else {
  100. echo "<span><a href=\"../udict/my_dict_list.php?page=0\">{$_local->gui->first_page}</a></span>";
  101. $prevPage = $iCurrPage - 1;
  102. echo "<span><a href=\"../udict/my_dict_list.php?page={$prevPage}\">{$_local->gui->previous_page}</a></span>";
  103. }
  104. echo "<span style='display:inline-block;white-space: nowrap;'>{$_local->gui->page_num}<input type=\"input\" value=\"" . ($iCurrPage + 1) . "\" style='width:3em;height:1em;'/>/{$iPages}</span>";
  105. if ($iCurrPage < $iPages - 1) {
  106. echo "<span><a href=\"../udict/my_dict_list.php?page=" . ($iCurrPage + 1) . "\">{$_local->gui->next_page}</a></span>";
  107. echo "<span><a href=\"../udict/my_dict_list.php?page=" . ($iPages - 1) . "\">{$_local->gui->last_page}</a></span>";
  108. } else {
  109. echo "<span>{$_local->gui->next_page}</span><span>{$_local->gui->last_page}</span>";
  110. }
  111. echo "<span id='setting_user_dict_count'>{$_local->gui->vocabulary}:{$iCountWords}</span>";
  112. ?>
  113. </div>
  114. <table style="width:95%;">
  115. <tr style="padding:5px;font-weight: bold;">
  116. <td style=''><input type="checkbox" /></td>
  117. <td style=''><?php echo $_local->gui->spell; //拼写?></td>
  118. <td style=''><?php echo $_local->gui->wordtype; //单词类型?></td>
  119. <td style=''><?php echo $_local->gui->gramma; //语法?></td>
  120. <td style=''><?php echo $_local->gui->g_mean; //意思?></td>
  121. <td style=''><?php echo $_local->gui->parent; //语基?></td>
  122. <td style=''><?php echo $_local->gui->dictsouce; //词条来源?></td>
  123. <td style=''><?php echo $_local->gui->citations; //引用数?></td>
  124. <td style=''></td>
  125. </tr>
  126. <?php
  127. foreach ($allWords as $word) {
  128. echo '<tr style="padding:5px;">';
  129. echo "<td style=''><input type=\"checkbox\" /></td>";
  130. echo "<td style='max-width:12vw; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;'>{$word["pali"]}</td>";
  131. echo "<td style=''>".$word["type"]."</td>";
  132. echo "<td style=''>{$word["gramma"]}</td>";
  133. echo "<td style='max-width:12vw; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;'>{$word["mean"]}</td>";
  134. echo "<td style='max-width:12vw; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;'>{$word["parent"]}</td>";
  135. if ($word["creator"] == $UID) {
  136. echo "<td style=''>{$_local->gui->original}</td>";
  137. } else {
  138. echo "<td style=''>{$_local->gui->reference}</td>";
  139. }
  140. echo "<td style=''>{$word["ref_counter"]}</td>";
  141. echo "<td style=''>...</td>";
  142. echo "</tr>";
  143. }
  144. }
  145. ?>
  146. </table>
  147. <?php
  148. require_once '../studio/index_foot.php';
  149. ?>