2
0

group.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  1. <?php
  2. require_once '../studio/index_head.php';
  3. require_once '../public/_pdo.php';
  4. ?>
  5. <body class="indexbody" >
  6. <script >
  7. var gCurrPage="group_index";
  8. </script>
  9. <style>
  10. #group_index {
  11. background-color: var(--btn-border-color);
  12. }
  13. #group_index:hover{
  14. background-color: var(--btn-border-color);
  15. color: var(--btn-color);
  16. cursor:auto;
  17. }
  18. </style>
  19. <!-- tool bar begin-->
  20. <?php
  21. require_once '../studio/index_tool_bar.php';
  22. ?>
  23. <!--tool bar end -->
  24. <script>
  25. document.getElementById("id_language").value="<?php echo ($currLanguage); ?>";
  26. </script>
  27. <div class="index_inner">
  28. <div class="fun_block">
  29. <div id="userfilelist">
  30. <?php
  31. if (isset($_GET["list"])) {
  32. $list = $_GET["list"];
  33. } else {
  34. $list = "group";
  35. }
  36. PDO_Connect("" . _FILE_DB_GROUP_);
  37. switch ($list) {
  38. case "group":
  39. echo "<div class='group_path'>Group</div>";
  40. $query = "select * from \"group_member\" where user_id='{$UID}' ";
  41. $Fetch = PDO_FetchAll($query);
  42. $iFetch = count($Fetch);
  43. $sGroupId = "('";
  44. if ($iFetch > 0) {
  45. foreach ($Fetch as $group_id) {
  46. $sGroupId .= "{$group_id["group_id"]}','";
  47. }
  48. $sGroupId = substr($sGroupId, 0, -2);
  49. $sGroupId .= ")";
  50. $query = "select * from \"group_info\" where id in {$sGroupId} ";
  51. $Fetch = PDO_FetchAll($query);
  52. foreach ($Fetch as $group) {
  53. echo "<div><a href=\"group.php?list=project&group={$group["id"]}\">{$group["name"]}</a>";
  54. echo "<a href=\"group.php?list=group_info&group={$group["id"]}\"> [详情]</a></div>";
  55. }
  56. }
  57. break;
  58. case "group_info":
  59. echo "<div><a href=\"group.php?list=group\">返回Back</a></div>";
  60. if (isset($_GET["group"])) {
  61. $group = $_GET["group"];
  62. } else {
  63. $group = "0";
  64. }
  65. $query = "select * from \"group_info\" where id = '{$group}' ";
  66. $Fetch = PDO_FetchAll($query);
  67. $group_name = $Fetch[0]["name"];
  68. if (count($Fetch) > 0) {
  69. echo "<H2>{$group_name}</H2>";
  70. echo "<table>";
  71. echo "<tr><td>建立Create Time</td><td>{$Fetch[0]["create_time"]}</td></tr>";
  72. echo "<tr><td>文件Files</td><td>{$Fetch[0]["file_number"]}</td></tr>";
  73. echo "<tr><td>成员Member</td><td>{$Fetch[0]["member_number"]}</td></tr>";
  74. $query = "select user_id from \"group_member\" where group_id = '{$group}' ";
  75. $Fetch = PDO_FetchAll($query);
  76. $sUserId = "('";
  77. foreach ($Fetch as $user) {
  78. $sUserId .= "{$user["user_id"]}','";
  79. }
  80. $sUserId = substr($sUserId, 0, -2);
  81. $sUserId .= ")";
  82. $query = "select nickname from \"user\" where id in {$sUserId} ";
  83. $userlist = PDO_FetchAll($query);
  84. echo "<tr><td></td><td>";
  85. foreach ($userlist as $user) {
  86. echo "{$user["nickname"]}<br>";
  87. }
  88. echo "</td></tr>";
  89. echo "</table>";
  90. }
  91. break;
  92. case "project";
  93. if (isset($_GET["group"])) {
  94. $group = $_GET["group"];
  95. } else {
  96. $group = "0";
  97. }
  98. $query = "select group_name from \"group_member\" where group_id = \"{$group}\" AND user_id=\"{$UID}\"";
  99. $group_name = PDO_FetchOne($query);
  100. if ($group_name == "") {
  101. $query = "select name from \"group_info\" where group_id = \"{$group}\" ";
  102. $group_name = PDO_FetchOne($query);
  103. }
  104. echo "<div class='group_path'>";
  105. echo "<a href='group.php?list=group'>群组Group</a> >> {$group_name}";
  106. echo "</div>";
  107. $query = "select file_id from \"group_file_power\" where group_id = \"{$group}\" AND user_id='{$UID}' group by file_id";
  108. $Fetch = PDO_FetchAll($query);
  109. $sFileId = "('";
  110. foreach ($Fetch as $file) {
  111. $sFileId .= "{$file["file_id"]}','";
  112. }
  113. $sFileId = substr($sFileId, 0, -2);
  114. $sFileId .= ")";
  115. $query = "select project , count(*) as co from \"group_file\" where id in {$sFileId} group by project";
  116. $Fetch = PDO_FetchAll($query);
  117. echo "<table>";
  118. echo "<tr><td>Project</td><td>File Number</td></tr>";
  119. foreach ($Fetch as $project) {
  120. echo "<tr class='group_file_list'>";
  121. echo "<td ><a href=\"group.php?list=file&group={$group}&project={$project["project"]}\">{$project["project"]}</a></td>";
  122. echo "<td>{$project["co"]}</td> ";
  123. echo "</tr>";
  124. }
  125. echo "</table>";
  126. break;
  127. case "file":
  128. if (isset($_GET["group"])) {
  129. $group = $_GET["group"];
  130. } else {
  131. $group = "0";
  132. }
  133. if (isset($_GET["project"])) {
  134. $project = $_GET["project"];
  135. } else {
  136. $project = "0";
  137. }
  138. $query = "select group_name from \"group_member\" where group_id = \"{$group}\" AND user_id=\"{$UID}\"";
  139. $group_name = PDO_FetchOne($query);
  140. if ($group_name == "") {
  141. $query = "select name from \"group_info\" where group_id = \"{$group}\" ";
  142. $group_name = PDO_FetchOne($query);
  143. }
  144. echo "<div class='group_path'>";
  145. echo "<a href='group.php?list=group'>群组Group</a> >> ";
  146. echo "<a href=\"group.php?list=project&group={$group}\">{$group_name}</a> >> ";
  147. echo "{$project}";
  148. echo "</div>";
  149. ?>
  150. <div id="file_filter">
  151. <div style="display:flex;justify-content: space-between;">
  152. <div>
  153. <select id="id_index_status" onchange="showUserFilaList()">
  154. <option value="all" >
  155. <?php echo $_local->gui->all; //全部 ?>
  156. </option>
  157. <option value="share" >
  158. <?php echo $_local->gui->shared; //已共享 ?>
  159. </option>
  160. <option value="recycle" >
  161. <?php echo $_local->gui->recycle_bin; //回收站 ?>
  162. </option>
  163. </select>
  164. </div>
  165. <div><?php echo $_local->gui->order_by; //排序方式 ?>
  166. <select id="id_index_orderby" onchange="showUserFilaList()">
  167. <option value="accese_time" ><?php echo $_local->gui->accessed; //訪問 ?></option>
  168. <option value="modify_time" ><?php echo $_local->gui->modified; //修改 ?></option>
  169. <option value="create_time" ><?php echo $_local->gui->created; //創建 ?></option>
  170. <option value="title" ><?php echo $_local->gui->title; //標題 ?></option>
  171. </select>
  172. <select id="id_index_order" onchange="showUserFilaList()">
  173. <option value="DESC" ><?php echo $_local->gui->desc; //降序 ?></option>
  174. <option value="ASC" ><?php echo $_local->gui->asc; //升序 ?></option>
  175. </select>
  176. <button id="file_select" onclick="mydoc_file_select(true)">
  177. 选择
  178. </button>
  179. </div>
  180. </div>
  181. <div>
  182. <input id="keyword" type="input" placeholder=<?php echo $_local->gui->title . $_local->gui->search; ?> onkeyup="file_search_keyup()"/>
  183. </div>
  184. </div>
  185. <div id="file_tools" style="display:none;">
  186. <div style="display:flex;justify-content: space-between;">
  187. <div>
  188. <span id="button_group_nomal" >
  189. <button onclick="file_del()"><?php echo $_local->gui->delete; //刪除 ?></button>
  190. <button onclick="file_share(true)"><?php echo $_local->gui->share; //共享 ?></button>
  191. <button onclick="file_share(false)"><?php echo $_local->gui->undo_shared; //取消共享 ?></button>
  192. </span>
  193. <span id="button_group_recycle" style="dispaly:none">
  194. <button onclick="file_remove()" style="background-color:red;"><?php echo $_local->gui->completely_delete; //彻底删除 ?></button>
  195. <button onclick="file_remove_all()"><?php echo $_local->gui->empty_the_recycle_bin; //清空回收站 ?></button>
  196. </span>
  197. </div>
  198. <div>
  199. <button onclick="mydoc_file_select(false)"><?php echo $_local->gui->cancel; //取消 ?></button>
  200. </div>
  201. </div>
  202. </div>
  203. <?php
  204. $query = "select * from \"group_process\" where group_id = \"{$group}\" ";
  205. $stage = PDO_FetchAll($query);
  206. $aStage = array();
  207. echo "<button>全部All</button>";
  208. foreach ($stage as $one) {
  209. $aStage[$one["stage"]] = $one["name"];
  210. echo "<button>{$one["name"]}</button>";
  211. }
  212. $query = "select file_id from \"group_file_power\" where group_id = \"{$group}\" AND user_id='{$UID}' group by file_id";
  213. $Fetch = PDO_FetchAll($query);
  214. $sFileId = "('";
  215. foreach ($Fetch as $file) {
  216. $sFileId .= "{$file["file_id"]}','";
  217. }
  218. $sFileId = substr($sFileId, 0, -2);
  219. $sFileId .= ")";
  220. $query = "select * from \"group_file\" where id in {$sFileId} AND project = \"{$project}\"";
  221. $Fetch = PDO_FetchAll($query);
  222. echo "<table>";
  223. echo "<tr><td>Title</td><td>File Size</td><td>Date</td><td>Stage</td><td></td></tr>";
  224. foreach ($Fetch as $file) {
  225. echo "<tr class='group_file_list'>";
  226. echo "<td class='group_file_title'><a href=\"group.php?list=stage&file={$file["id"]}\">{$file["file_title"]}</a></td>";
  227. echo "<td>{$file["file_size"]}</td> ";
  228. echo "<td>{$file["modify_time"]}</td> ";
  229. $stage_name = $aStage["{$file["stage"]}"];
  230. echo "<td><span class='tag'>{$stage_name}</span></td>";
  231. echo "<td><a href=\"group.php?list=stage&file={$file["id"]}\">详情Details</a></td>";
  232. echo "</tr>";
  233. }
  234. echo "</table>";
  235. break;
  236. case "stage":
  237. if (isset($_GET["file"])) {
  238. $file_id = $_GET["file"];
  239. } else {
  240. $file_id = "0";
  241. }
  242. $query = "select * from \"group_file\" where id = {$file_id} ";
  243. $Fetch = PDO_FetchAll($query);
  244. $group_id = $Fetch[0]["group_id"];
  245. $file_title = $Fetch[0]["file_title"];
  246. $project = $Fetch[0]["project"];
  247. $curr_stage = $Fetch[0]["stage"];
  248. $query = "select name from \"group_info\" where id = \"{$group_id}\" ";
  249. $group_name = PDO_FetchOne($query);
  250. $query = "select group_name from \"group_member\" where group_id = \"{$group_id}\" AND user_id='{$UID}' ";
  251. $my_group_name = PDO_FetchOne($query);
  252. if (empty($my_group_name)) {
  253. $my_group_name = $group_name;
  254. }
  255. $query = "select * from \"group_process\" where group_id = \"{$group_id}\" ";
  256. $stage = PDO_FetchAll($query);
  257. echo "<div class='group_path'>";
  258. echo "<a href=\"group.php?list=group\">群组Group</a> / ";
  259. echo "<a href=\"group.php?list=project&group={$group_id}\">{$my_group_name}</a> / ";
  260. echo "<a href=\"group.php?list=file&group={$group_id}&project={$project}\">{$project}</a>";
  261. echo "</div>";
  262. echo "<h2>{$file_title}</h2>";
  263. foreach ($stage as $one) {
  264. echo "<button>{$one["stage"]}</button>{$one["name"]}-";
  265. if ($one["stage"] < $curr_stage) {
  266. echo "<span style='color:green'>{$_local->gui->already_over}</span>";
  267. } else if ($one["stage"] == $curr_stage) {
  268. echo "{$_local->gui->in_progress}<button>完成Done</button>";
  269. } else {
  270. echo "尚未开始 Not Ready";
  271. }
  272. echo "<br>";
  273. }
  274. break;
  275. }
  276. ?>
  277. </div>
  278. </div>
  279. </div>
  280. <div class="foot_div">
  281. <?php echo $_local->gui->poweredby; ?>
  282. </div>
  283. </body>
  284. </html>