setting.php 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. <?php
  2. require_once '../config.php';
  3. require_once "../public/_pdo.php";
  4. if (isset($_GET["language"])) {$currLanguage = $_GET["language"];} else { $currLanguage = "en";}
  5. if (isset($_GET["device"])) {$currDevice = $_GET["device"];} else { $currDevice = "computer";}
  6. if (isset($_GET["item"])) {$currSettingItem = $_GET["item"];} else { $currSettingItem = "local_gramma";}
  7. $album_power["15"] = "超级管理员";
  8. $album_power["1"] = "管理员";
  9. $album_power["2"] = "编辑";
  10. ?>
  11. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  12. <html>
  13. <head>
  14. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  15. <link type="text/css" rel="stylesheet" href="../app/css/main.css"/>
  16. <link type="text/css" rel="stylesheet" href="../app/css/setting.css"/>
  17. <title>PCD Studio</title>
  18. <script language="javascript" src="js/common.js"></script>
  19. <script>
  20. g_device="computor";
  21. </script>
  22. </head>
  23. <body class="mainbody" id="mbody">
  24. <div class="main">
  25. <!-- content begin-->
  26. <div id="leftmenuinner">
  27. <div class="toolgroup1">
  28. </div>
  29. <div >
  30. <h1>Setting</h1>
  31. </div>
  32. <div class='toc' id='leftmenuinnerinner'>
  33. <ul class="setting_item">
  34. <li><a href="setting.php?item=general">General</a></li>
  35. <li><a href="setting.php?item=studio">Studio</a></li>
  36. <li><a href="setting.php?item=liberay">Liberay</a></li>
  37. <li><a href="setting.php?item=dictionary">Dictionary</a></li>
  38. <li><a href="setting.php?item=userdict">User Dictionary</a></li>
  39. <li><a href="setting.php?item=term">Term</a></li>
  40. <li><a href="setting.php?item=message">Message</a></li>
  41. <li><a href="setting.php?item=album">Album</a></li>
  42. <li><a href="setting.php?item=share">Share</a></li>
  43. <li><a href="setting.php?item=account">Accont</a></li>
  44. </ul>
  45. </div>
  46. </div>
  47. <div id="setting_main_view" class="mainview">
  48. <div class="tool_bar">
  49. <div >
  50. <?php
  51. switch ($currSettingItem) {
  52. case "account":
  53. break;
  54. case "album":
  55. if (isset($_GET["id"])) {
  56. echo "<a href='setting.php?item=album'>返回</a>";
  57. }
  58. break;
  59. }
  60. ?>
  61. </div>
  62. <div>
  63. <span>Language</span>
  64. <select id="id_language" name="menu" >
  65. <option value="en" >English</option>
  66. <option value="sinhala" >සින‍්හල</option>
  67. <option value="zh" >简体中文</option>
  68. <option value="tw" >正體中文</option>
  69. </select>
  70. </div>
  71. </div>
  72. <?php
  73. switch ($currSettingItem) {
  74. case "account":
  75. PDO_Connect("" . _FILE_DB_USERINFO_);
  76. $query = "SELECT * from 'user' where 1 limit 0,1000";
  77. $user_info = PDO_FetchAll($query);
  78. echo "<table>";
  79. echo "<tr><th>id</th><th>user name</th><th>nick name</th></tr>";
  80. foreach ($user_info as $user) {
  81. echo "<tr>";
  82. echo "<td>{$user["id"]}</td>";
  83. echo "<td>{$user["username"]}</td>";
  84. echo "<td>{$user["nickname"]}</td>";
  85. echo "</tr>";
  86. }
  87. echo "</table>";
  88. break;
  89. case "album":
  90. $db_file = _FILE_DB_RES_INDEX_;
  91. PDO_Connect("$db_file");
  92. echo "<h2>Album</h2>";
  93. $query = "SELECT * from 'album' where 1 limit 0,1000";
  94. $Fetch = PDO_FetchAll($query);
  95. ?>
  96. <table>
  97. <tr>
  98. <th>Book</th><th>Title</th><th>Author</th><th>语言</th><th>媒体</th><th></th><th></th>
  99. </tr>
  100. <?php
  101. foreach ($Fetch as $album) {
  102. echo "<tr><td>{$album["book"]}</td>
  103. <td>{$album["title"]}</td>
  104. <td>{$album["author"]}</td>
  105. <td>{$album["language"]}</td>
  106. <td>{$album["type"]}</td>
  107. <td><a href=\"../app/album.php?op=show_info&album_id={$album["id"]}\" target='_blank'>详情</a></td>
  108. <td><a href=\"../app/album.php?op=export&album_id={$album["id"]}\" target='_blank'>导出</a></td>
  109. </tr>";
  110. }
  111. echo "</table>";
  112. break;
  113. case "share":
  114. PDO_Connect(_FILE_DB_FILEINDEX_);
  115. $query = "SELECT count(*) from "._TABLE_FILEINDEX_." where share=1";
  116. $file_count = PDO_FetchOne($query);
  117. echo "共计:{$file_count} 个共享文件";
  118. $query = "SELECT * from "._TABLE_FILEINDEX_." where share=1 limit 100";
  119. $file_share = PDO_FetchAll($query);
  120. echo "<table>";
  121. echo "<tr><th>id</th><th>user id</th><th>Title</th><th>Size</th><th></th></tr>";
  122. foreach ($file_share as $file) {
  123. echo "<tr>";
  124. echo "<td>{$file["id"]}</td>";
  125. echo "<td>{$file["user_id"]}</td>";
  126. echo "<td>{$file["title"]}</td>";
  127. echo "<td>{$file["file_size"]}</td>";
  128. echo "<td>详情</td>";
  129. echo "</tr>";
  130. }
  131. echo "</table>";
  132. break;
  133. }
  134. ?>
  135. </div>
  136. </div>
  137. </body>
  138. </html>