my_dict_list.php 4.6 KB

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