my_dict_list.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <?php
  2. require_once '../studio/index_head.php';
  3. ?>
  4. <body id="file_list_body" onLoad="course_list()">
  5. <script >
  6. var gCurrPage="term";
  7. </script>
  8. <style>
  9. #term {
  10. background-color: var(--btn-border-color);
  11. }
  12. #term: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. 术语百科
  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. }
  61. else{
  62. $iCurrPage=0;
  63. }
  64. $iOnePage=300;
  65. $dictFileName=_FILE_DB_TERM_;
  66. PDO_Connect("sqlite:$dictFileName");
  67. $query = "select count(*) as co from term where owner= ".$PDO->quote($USER_NAME);
  68. $allWord = PDO_FetchOne($query);
  69. $iCountWords=$allWord;
  70. if($iCountWords==0){
  71. echo "<div id='setting_user_dict_count'>您的术语字典中没有单词。</div>";
  72. }
  73. else{
  74. echo "<div id='setting_user_dict_count'>您的术语字典中已经有{$iCountWords}个单词。</div>";
  75. $iPages=ceil($iCountWords/$iOnePage);
  76. if($iCurrPage>$iPages){
  77. $iCurrPage=$iPages;
  78. }
  79. $begin=$iCurrPage*$iOnePage;
  80. $query = "select * from term where owner= ".$PDO->quote($USER_NAME);
  81. $allWords = PDO_FetchAll($query);
  82. echo '<div id="setting_user_dict_nav">';
  83. if($iCurrPage==0){
  84. echo "第一页 | ";
  85. echo "上一页";
  86. }
  87. else{
  88. echo "<a href=\"setting.php?item=term&page=0\">第一页</a>";
  89. $prevPage=$iCurrPage-1;
  90. echo "<a href=\"setting.php?item=term&page={$prevPage}\">上一页</a>";
  91. }
  92. echo "第<span style='display:inline-block;width:4em;'><input type=\"input\" value=\"".($iCurrPage+1)."\" size=\"4\" /></span>页";
  93. echo "共{$iPages}页";
  94. if($iCurrPage<$iPages-1){
  95. echo "<a href=\"setting.php?item=term&page=".($iCurrPage+1)."\">下一页</a>";
  96. echo "<a href=\"setting.php?item=term&page=".($iPages-1)."\">最后一页</a>";
  97. }
  98. else{
  99. echo "下一页 | 最后一页";
  100. }
  101. ?>
  102. </div>
  103. <div>
  104. <div style="display:flex;">
  105. <div style='max-width:2em;flex:1;'></div>
  106. <div style='flex:1;'>序号</div>
  107. <div style='flex:2;'>拼写</div>
  108. <div style='flex:2;'>意思</div>
  109. <div style='flex:2;'>第二个意思</div>
  110. <div style='flex:5;'>注解</div>
  111. <div style='flex:1;'>语言</div>
  112. </div>
  113. <?php
  114. foreach($allWords as $key => $word){
  115. echo '<div class="file_list_row" style="padding:5px;">';
  116. echo '<div style="max-width:2em;flex:1;"><input type="checkbox" /></div>';
  117. echo "<div style='flex:1;'>".($key+1)."</div>";
  118. echo "<div style='flex:2;'>{$word["word"]}</div>";
  119. echo "<div style='flex:2;'>{$word["meaning"]}</div>";
  120. echo "<div style='flex:2;'>{$word["other_meaning"]}</div>";
  121. echo "<div style='flex:5;'><textarea style='width:100%;'>{$word["note"]}</textarea></div>";
  122. echo "<div style='flex:1;'></div>";
  123. echo "</div>";
  124. }
  125. echo '</div>';
  126. }
  127. ?>
  128. </div>
  129. <?php
  130. require_once '../studio/index_foot.php';
  131. ?>