group.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  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. }
  34. else{
  35. $list="group";
  36. }
  37. PDO_Connect("sqlite:"._FILE_DB_GROUP_);
  38. switch($list){
  39. case "group":
  40. echo "<div class='group_path'>Group</div>";
  41. $query="select * from \"group_member\" where user_id='{$UID}' ";
  42. $Fetch = PDO_FetchAll($query);
  43. $iFetch=count($Fetch);
  44. $sGroupId="('";
  45. if($iFetch>0){
  46. foreach($Fetch as $group_id){
  47. $sGroupId .= "{$group_id["group_id"]}','";
  48. }
  49. $sGroupId = substr($sGroupId,0,-2);
  50. $sGroupId .= ")";
  51. $query="select * from \"group_info\" where id in {$sGroupId} ";
  52. $Fetch = PDO_FetchAll($query);
  53. foreach($Fetch as $group){
  54. echo "<div><a href=\"group.php?list=project&group={$group["id"]}\">{$group["name"]}</a>";
  55. echo "<a href=\"group.php?list=group_info&group={$group["id"]}\"> [详情]</a></div>";
  56. }
  57. }
  58. break;
  59. case "group_info":
  60. echo "<div><a href=\"group.php?list=group\">返回Back</a></div>";
  61. if(isset($_GET["group"])){
  62. $group=$_GET["group"];
  63. }
  64. else{
  65. $group="0";
  66. }
  67. $query="select * from \"group_info\" where id = '{$group}' ";
  68. $Fetch = PDO_FetchAll($query);
  69. $group_name=$Fetch[0]["name"];
  70. if(count($Fetch)>0){
  71. echo "<H2>{$group_name}</H2>";
  72. echo "<table>";
  73. echo "<tr><td>建立Create Time</td><td>{$Fetch[0]["create_time"]}</td></tr>";
  74. echo "<tr><td>文件Files</td><td>{$Fetch[0]["file_number"]}</td></tr>";
  75. echo "<tr><td>成员Member</td><td>{$Fetch[0]["member_number"]}</td></tr>";
  76. $query="select user_id from \"group_member\" where group_id = '{$group}' ";
  77. $Fetch = PDO_FetchAll($query);
  78. $sUserId="('";
  79. foreach($Fetch as $user){
  80. $sUserId .= "{$user["user_id"]}','";
  81. }
  82. $sUserId = substr($sUserId,0,-2);
  83. $sUserId .= ")";
  84. $query="select nickname from \"user\" where id in {$sUserId} ";
  85. $userlist = PDO_FetchAll($query);
  86. echo "<tr><td></td><td>";
  87. foreach($userlist as $user){
  88. echo "{$user["nickname"]}<br>";
  89. }
  90. echo "</td></tr>";
  91. echo "</table>";
  92. }
  93. break;
  94. case "project";
  95. if(isset($_GET["group"])){
  96. $group=$_GET["group"];
  97. }
  98. else{
  99. $group="0";
  100. }
  101. $query="select group_name from \"group_member\" where group_id = \"{$group}\" AND user_id=\"{$UID}\"";
  102. $group_name = PDO_FetchOne($query);
  103. if($group_name == ""){
  104. $query="select name from \"group_info\" where group_id = \"{$group}\" ";
  105. $group_name = PDO_FetchOne($query);
  106. }
  107. echo "<div class='group_path'>";
  108. echo "<a href='group.php?list=group'>群组Group</a> >> {$group_name}";
  109. echo "</div>";
  110. $query="select file_id from \"group_file_power\" where group_id = \"{$group}\" AND user_id='{$UID}' group by file_id";
  111. $Fetch = PDO_FetchAll($query);
  112. $sFileId="('";
  113. foreach($Fetch as $file){
  114. $sFileId .= "{$file["file_id"]}','";
  115. }
  116. $sFileId = substr($sFileId,0,-2);
  117. $sFileId .= ")";
  118. $query="select project , count(*) as co from \"group_file\" where id in {$sFileId} group by project";
  119. $Fetch = PDO_FetchAll($query);
  120. echo "<table>";
  121. echo "<tr><td>Project</td><td>File Number</td></tr>";
  122. foreach($Fetch as $project){
  123. echo "<tr class='group_file_list'>";
  124. echo "<td ><a href=\"group.php?list=file&group={$group}&project={$project["project"]}\">{$project["project"]}</a></td>";
  125. echo "<td>{$project["co"]}</td> ";
  126. echo "</tr>";
  127. }
  128. echo "</table>";
  129. break;
  130. case "file":
  131. if(isset($_GET["group"])){
  132. $group=$_GET["group"];
  133. }
  134. else{
  135. $group="0";
  136. }
  137. if(isset($_GET["project"])){
  138. $project=$_GET["project"];
  139. }
  140. else{
  141. $project="0";
  142. }
  143. $query="select group_name from \"group_member\" where group_id = \"{$group}\" AND user_id=\"{$UID}\"";
  144. $group_name = PDO_FetchOne($query);
  145. if($group_name == ""){
  146. $query="select name from \"group_info\" where group_id = \"{$group}\" ";
  147. $group_name = PDO_FetchOne($query);
  148. }
  149. echo "<div class='group_path'>";
  150. echo "<a href='group.php?list=group'>群组Group</a> >> ";
  151. echo "<a href=\"group.php?list=project&group={$group}\">{$group_name}</a> >> ";
  152. echo "{$project}";
  153. echo "</div>";
  154. ?>
  155. <div id="file_filter">
  156. <div style="display:flex;justify-content: space-between;">
  157. <div>
  158. <select id="id_index_status" onchange="showUserFilaList()">
  159. <option value="all" >
  160. <?php echo $module_gui_str['editor_dictionary']['1018'];//全部?>
  161. </option>
  162. <option value="share" >
  163. <?php echo $module_gui_str['tools']['1017'];//已共享?>
  164. </option>
  165. <option value="recycle" >
  166. <?php echo $module_gui_str['tools']['1007'];//回收站?>
  167. </option>
  168. </select>
  169. </div>
  170. <div><?php echo $module_gui_str['editor']['1059'];//排序方式?>
  171. <select id="id_index_orderby" onchange="showUserFilaList()">
  172. <option value="accese_time" ><?php echo $module_gui_str['editor']['1060'];//訪問?></option>
  173. <option value="modify_time" ><?php echo $module_gui_str['editor']['1061'];//修改?></option>
  174. <option value="create_time" ><?php echo $module_gui_str['editor']['1062'];//創建?></option>
  175. <option value="title" ><?php echo $module_gui_str['editor']['1063'];//標題?></option>
  176. </select>
  177. <select id="id_index_order" onchange="showUserFilaList()">
  178. <option value="DESC" ><?php echo $module_gui_str['editor']['1111'];//降序?></option>
  179. <option value="ASC" ><?php echo $module_gui_str['editor']['1110'];//升序?></option>
  180. </select>
  181. <button id="file_select" onclick="mydoc_file_select(true)">
  182. 选择
  183. </button>
  184. </div>
  185. </div>
  186. <div>
  187. <input id="keyword" type="input" placeholder=<?php echo $module_gui_str['editor']['1114'].$module_gui_str['editor']['1115'];?> onkeyup="file_search_keyup()"/>
  188. </div>
  189. </div>
  190. <div id="file_tools" style="display:none;">
  191. <div style="display:flex;justify-content: space-between;">
  192. <div>
  193. <span id="button_group_nomal" >
  194. <button onclick="file_del()"><?php echo $module_gui_str['tools']['1009'];//刪除?></button>
  195. <button onclick="file_share(true)"><?php echo $module_gui_str['tools']['1008'];//共享?></button>
  196. <button onclick="file_share(false)"><?php echo $module_gui_str['tools']['1010'];//取消共享?></button>
  197. </span>
  198. <span id="button_group_recycle" style="dispaly:none">
  199. <button onclick="file_remove()" style="background-color:red;"><?php echo $module_gui_str['tools']['1016'];//彻底删除?></button>
  200. <button onclick="file_remove_all()"><?php echo $module_gui_str['tools']['1015'];//清空回收站?></button>
  201. </span>
  202. </div>
  203. <div>
  204. <button onclick="mydoc_file_select(false)"><?php echo $module_gui_str['editor']['1028'];//取消?></button>
  205. </div>
  206. </div>
  207. </div>
  208. <?php
  209. $query="select * from \"group_process\" where group_id = \"{$group}\" ";
  210. $stage = PDO_FetchAll($query);
  211. $aStage = array();
  212. echo "<button>全部All</button>";
  213. foreach($stage as $one){
  214. $aStage[$one["stage"]]=$one["name"];
  215. echo "<button>{$one["name"]}</button>";
  216. }
  217. $query="select file_id from \"group_file_power\" where group_id = \"{$group}\" AND user_id='{$UID}' group by file_id";
  218. $Fetch = PDO_FetchAll($query);
  219. $sFileId="('";
  220. foreach($Fetch as $file){
  221. $sFileId .= "{$file["file_id"]}','";
  222. }
  223. $sFileId = substr($sFileId,0,-2);
  224. $sFileId .= ")";
  225. $query="select * from \"group_file\" where id in {$sFileId} AND project = \"{$project}\"";
  226. $Fetch = PDO_FetchAll($query);
  227. echo "<table>";
  228. echo "<tr><td>Title</td><td>File Size</td><td>Date</td><td>Stage</td><td></td></tr>";
  229. foreach($Fetch as $file){
  230. echo "<tr class='group_file_list'>";
  231. echo "<td class='group_file_title'><a href=\"group.php?list=stage&file={$file["id"]}\">{$file["file_title"]}</a></td>";
  232. echo "<td>{$file["file_size"]}</td> ";
  233. echo "<td>{$file["modify_time"]}</td> ";
  234. $stage_name=$aStage["{$file["stage"]}"];
  235. echo "<td><span class='tag'>{$stage_name}</span></td>";
  236. echo "<td><a href=\"group.php?list=stage&file={$file["id"]}\">详情Details</a></td>";
  237. echo "</tr>";
  238. }
  239. echo "</table>";
  240. break;
  241. case "stage":
  242. if(isset($_GET["file"])){
  243. $file_id=$_GET["file"];
  244. }
  245. else{
  246. $file_id="0";
  247. }
  248. $query="select * from \"group_file\" where id = {$file_id} ";
  249. $Fetch = PDO_FetchAll($query);
  250. $group_id=$Fetch[0]["group_id"];
  251. $file_title=$Fetch[0]["file_title"];
  252. $project = $Fetch[0]["project"];
  253. $curr_stage=$Fetch[0]["stage"];
  254. $query="select name from \"group_info\" where id = \"{$group_id}\" ";
  255. $group_name = PDO_FetchOne($query);
  256. $query="select group_name from \"group_member\" where group_id = \"{$group_id}\" AND user_id='{$UID}' ";
  257. $my_group_name = PDO_FetchOne($query);
  258. if(empty($my_group_name)){
  259. $my_group_name = $group_name;
  260. }
  261. $query="select * from \"group_process\" where group_id = \"{$group_id}\" ";
  262. $stage = PDO_FetchAll($query);
  263. echo "<div class='group_path'>";
  264. echo "<a href=\"group.php?list=group\">群组Group</a> / ";
  265. echo "<a href=\"group.php?list=project&group={$group_id}\">{$my_group_name}</a> / ";
  266. echo "<a href=\"group.php?list=file&group={$group_id}&project={$project}\">{$project}</a>";
  267. echo "</div>";
  268. echo "<h2>{$file_title}</h2>";
  269. foreach($stage as $one){
  270. echo "<button>{$one["stage"]}</button>{$one["name"]}-";
  271. if($one["stage"]<$curr_stage){
  272. echo "<span style='color:green'>已经完成Done</span>";
  273. }
  274. else if($one["stage"]==$curr_stage){
  275. echo "正在进行Runing<button>完成Done</button>";
  276. }
  277. else{
  278. echo "尚未开始 Not Ready";
  279. }
  280. echo"<br>";
  281. }
  282. break;
  283. }
  284. ?>
  285. </div>
  286. </div>
  287. </div>
  288. <div class="foot_div">
  289. <?php echo $module_gui_str['editor']['1066'];?>
  290. </div>
  291. </body>
  292. </html>