my_dict_list.php 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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. </style>
  21. <?php
  22. require_once '../studio/index_tool_bar.php';
  23. ?>
  24. <div class="index_inner" style=" margin-left: 18em;margin-top: 5em;">
  25. <div id="word_list" class="file_list_block">
  26. <div class="tool_bar">
  27. <div>
  28. <?php echo $_local->gui->userdict; ?>
  29. </div>
  30. <div>
  31. <span class="icon_btn_div">
  32. <span class="icon_btn_tip"><?php echo $_local->gui->add; ?></span>
  33. <button id="file_add" type="button" class="icon_btn" title=" ">
  34. <a href="../course/my_channal_new.php">
  35. <svg class="icon">
  36. <use xlink:href="../studio/svg/icon.svg#ic_add_circle"></use>
  37. </svg>
  38. </a>
  39. </button>
  40. </span>
  41. <span class="icon_btn_div">
  42. <span class="icon_btn_tip"><?php echo $_local->gui->recycle_bin; ?></span>
  43. <button id="to_recycle" type="button" class="icon_btn" onclick="file_del()" title=" ">
  44. <svg class="icon">
  45. <use xlink:href="../studio/svg/icon.svg#ic_delete"></use>
  46. </svg>
  47. </button>
  48. </span>
  49. </div>
  50. </div>
  51. <div id="userfilelist">
  52. <?php
  53. //
  54. require_once "../path.php";
  55. require_once "../public/_pdo.php";
  56. require_once '../public/load_lang.php';
  57. require_once '../ucenter/function.php';
  58. if (isset($_GET["page"])) {
  59. $iCurrPage = $_GET["page"];
  60. } else {
  61. $iCurrPage = 0;
  62. }
  63. $iOnePage = 300;
  64. PDO_Connect(_FILE_DB_WBW_);
  65. $query = "select count(word_index) as co from user_index where user_id={$UID}";
  66. $allWord = PDO_FetchOne($query);
  67. $iCountWords = $allWord;
  68. if ($iCountWords == 0) {
  69. echo "<div id='setting_user_dict_count'>您的用户字典中没有单词。</div>";
  70. } else {
  71. echo "<div>search:<span style='display:inline-block;width:20em;'><input type='input' /></span></div>";
  72. $iPages = ceil($iCountWords / $iOnePage);
  73. if ($iCurrPage > $iPages) {
  74. $iCurrPage = $iPages;
  75. }
  76. $begin = $iCurrPage * $iOnePage;
  77. $query = "select word_index from user_index where user_id={$UID} order by id DESC limit {$begin},{$iOnePage} ";
  78. $allWord = PDO_FetchAll($query);
  79. $strQuery = "('";
  80. foreach ($allWord as $one) {
  81. $strQuery .= $one["word_index"] . "','";
  82. }
  83. $strQuery = substr($strQuery, 0, strlen($strQuery) - 2);
  84. $strQuery .= ")";
  85. $query = "select * from dict where id in {$strQuery} order by time DESC";
  86. $allWords = PDO_FetchAll($query);
  87. ?>
  88. <div id="setting_user_dict_nav" style="backgroud-color:gray">
  89. <?php
  90. if ($iCurrPage == 0) {
  91. echo "第一页 | ";
  92. echo "上一页";
  93. } else {
  94. echo "<a href=\"../udict/my_dict_list.phpphp?page=0\">第一页</a>";
  95. $prevPage = $iCurrPage - 1;
  96. echo "<a href=\"../udict/my_dict_list.php?page={$prevPage}\">上一页</a>";
  97. }
  98. echo "第<span style='display:inline-block;width:4em;'><input type=\"input\" value=\"" . ($iCurrPage + 1) . "\" size=\"4\" /></span>页";
  99. echo "共{$iPages}页";
  100. if ($iCurrPage < $iPages - 1) {
  101. echo "<a href=\"../udict/my_dict_list.php?page=" . ($iCurrPage + 1) . "\">下一页</a>";
  102. echo "<a href=\"../udict/my_dict_list.php?page=" . ($iPages - 1) . "\">最后一页</a>";
  103. } else {
  104. echo "下一页 | 最后一页";
  105. }
  106. echo "<span id='setting_user_dict_count'>总计{$iCountWords}</span>";
  107. ?>
  108. </div>
  109. <div>
  110. <div style="display:flex;">
  111. <div><input type="checkbox" /></div>
  112. <div>拼写</div>
  113. <div>类型</div>
  114. <div>语法</div>
  115. <div>意思</div>
  116. <div>语基</div>
  117. <div>状态</div>
  118. <div>引用</div>
  119. <div></div>
  120. </div>
  121. <?php
  122. foreach ($allWords as $word) {
  123. echo '<div class="file_list_row" style="padding:5px;">';
  124. echo "<div style='flex:1;'><input type=\"checkbox\" /></div>";
  125. echo "<div style='flex:3;'>{$word["pali"]}</div>";
  126. echo "<div style='flex:1;'>{$word["type"]}</div>";
  127. echo "<div style='flex:1;'>{$word["gramma"]}</div>";
  128. echo "<div style='flex:3;'>{$word["mean"]}</div>";
  129. echo "<div style='flex:3;'>{$word["parent"]}</div>";
  130. if ($word["creator"] == $UID) {
  131. echo "<div style='flex:1;'>原创</div>";
  132. } else {
  133. echo "<div style='flex:1;'>引用</div>";
  134. }
  135. echo "<div style='flex:1;'>{$word["ref_counter"]}</div>";
  136. echo "<div style='width:1em;;'>...</div>";
  137. echo "</div>";
  138. }
  139. }
  140. ?>
  141. </div>
  142. <?php
  143. require_once '../studio/index_foot.php';
  144. ?>