my_dict_list.php 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  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. Term
  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. }
  62. else{
  63. $iCurrPage=0;
  64. }
  65. $iOnePage=300;
  66. $dictFileName=_FILE_DB_TERM_;
  67. PDO_Connect("sqlite:$dictFileName");
  68. $query = "select count(*) as co from term where owner= ? ";
  69. $allWord = PDO_FetchOne($query,array($_COOKIE["userid"]));
  70. $iCountWords=$allWord;
  71. if($iCountWords==0){
  72. echo "<div id='setting_user_dict_count'>您的术语字典中没有单词。</div>";
  73. }
  74. else{
  75. echo "<div id='setting_user_dict_count'>您的术语字典中已经有{$iCountWords}个单词。</div>";
  76. $iPages=ceil($iCountWords/$iOnePage);
  77. if($iCurrPage>$iPages){
  78. $iCurrPage=$iPages;
  79. }
  80. $begin=$iCurrPage*$iOnePage;
  81. $query = "select * from term where owner= ? ";
  82. $allWords = PDO_FetchAll($query,array($_COOKIE["userid"]));
  83. echo '<div id="setting_user_dict_nav">';
  84. if($iCurrPage==0){
  85. echo "第一页 | ";
  86. echo "上一页";
  87. }
  88. else{
  89. echo "<a href=\"setting.php?item=term&page=0\">第一页</a>";
  90. $prevPage=$iCurrPage-1;
  91. echo "<a href=\"setting.php?item=term&page={$prevPage}\">上一页</a>";
  92. }
  93. echo "第<span style='display:inline-block;width:4em;'><input type=\"input\" value=\"".($iCurrPage+1)."\" size=\"4\" /></span>页";
  94. echo "共{$iPages}页";
  95. if($iCurrPage<$iPages-1){
  96. echo "<a href=\"setting.php?item=term&page=".($iCurrPage+1)."\">下一页</a>";
  97. echo "<a href=\"setting.php?item=term&page=".($iPages-1)."\">最后一页</a>";
  98. }
  99. else{
  100. echo "下一页 | 最后一页";
  101. }
  102. ?>
  103. </div>
  104. <div>
  105. <div style="display:flex;">
  106. <div style='max-width:2em;flex:1;'></div>
  107. <div style='flex:1;'>Sn</div>
  108. <div style='flex:2;'>Spell</div>
  109. <div style='flex:2;'>Meaning</div>
  110. <div style='flex:2;'>Meaning2</div>
  111. <div style='flex:4;'>Note</div>
  112. <div style='flex:1;'>Language</div>
  113. <div style='flex:1;'>Channal</div>
  114. <div style='flex:1;'></div>
  115. </div>
  116. <?php
  117. foreach($allWords as $key => $word){
  118. echo '<div class="file_list_row" style="padding:5px;">';
  119. echo '<div style="max-width:2em;flex:1;"><input type="checkbox" /></div>';
  120. echo "<div style='flex:1;'>".($key+1)."</div>";
  121. echo "<div style='flex:2;'>{$word["word"]}</div>";
  122. echo "<div style='flex:2;'>{$word["meaning"]}</div>";
  123. echo "<div style='flex:2;'>{$word["other_meaning"]}</div>";
  124. echo "<div style='flex:4;'><textarea style='width:100%;'>{$word["note"]}</textarea></div>";
  125. echo "<div style='flex:1;'>{$word["language"]}</div>";
  126. echo "<div style='flex:1;'>{$word["channal"]}</div>";
  127. echo "<div style='flex:1;'><button onclick=\"term_edit_dlg_open('{$word["guid"]}')\">edit</button></div>";
  128. echo "</div>";
  129. }
  130. echo '</div>';
  131. }
  132. ?>
  133. </div>
  134. <?php
  135. require_once '../studio/index_foot.php';
  136. ?>