group.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422
  1. <?php
  2. require_once 'checklogin.inc';
  3. require_once '../public/config.php';
  4. require_once '../public/load_lang.php';
  5. require_once "../public/_pdo.php";
  6. //load language file
  7. if(file_exists($dir_language.$currLanguage.".php")){
  8. require $dir_language.$currLanguage.".php";
  9. }
  10. else{
  11. include $dir_language."default.php";
  12. }
  13. if(isset($_GET["device"])){
  14. $currDevice=$_GET["device"];
  15. }
  16. else{
  17. if(isset($_COOKIE["device"])){
  18. $currDevice=$_COOKIE["device"];
  19. }
  20. else{
  21. $currDevice="computer";
  22. }
  23. }
  24. ?>
  25. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  26. <html>
  27. <head>
  28. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  29. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  30. <link type="text/css" rel="stylesheet" href="css/style.css"/>
  31. <link type="text/css" rel="stylesheet" href="css/color_day.css" id="colorchange" />
  32. <title><?php echo $_local->gui->pcd_studio; ?></title>
  33. <script language="javascript" src="js/common.js"></script>
  34. <script language="javascript" src="js/filenew.js"></script>
  35. <script language="javascript" src="js/index_mydoc.js"></script>
  36. <script src="js/jquery-3.3.1.min.js"></script>
  37. <script src="../public/js/jquery.js"></script>
  38. <script src="js/fixedsticky.js"></script>
  39. <script type="text/javascript">
  40. <?php require_once '../public/load_lang_js.php';//加载js语言包?>
  41. var g_device = "computer";
  42. var strSertch = location.search;
  43. if(strSertch.length>0){
  44. strSertch = strSertch.substr(1);
  45. var sertchList=strSertch.split('&');
  46. for ( i in sertchList){
  47. var item = sertchList[i].split('=');
  48. if(item[0]=="device"){
  49. g_device=item[1];
  50. }
  51. }
  52. }
  53. if(g_device=="mobile"){
  54. g_is_mobile=true;
  55. }
  56. else{
  57. g_is_mobile=false;
  58. }
  59. var g_langrage="en";
  60. function menuLangrage(obj){
  61. g_langrage=obj.value;
  62. setCookie('language',g_langrage,365);
  63. window.location.assign("index.php?language="+g_langrage);
  64. }
  65. </script>
  66. </head>
  67. <body class="indexbody" >
  68. <!-- tool bar begin-->
  69. <div class='index_toolbar'>
  70. <div id="index_nav">
  71. <button><?php echo $_local->gui->recent_scan;?></button>
  72. <button><a href="index_pc.php?language=<?php echo $currLanguage; ?>"><?php echo $_local->gui->pali_canon;?></a></button>
  73. <button class="selected" ><a href="group.php?language=<?php echo $currLanguage; ?>">Group</a></button>
  74. <button><a href="filenew.php?language=<?php echo $currLanguage; ?>"><?php echo $_local->gui->new_project;?></a></button>
  75. <button><a href="index_tools.php?language=<?php echo $currLanguage; ?>"><?php echo $_local->gui->tools;?></a></button>
  76. </div>
  77. <div>
  78. </div>
  79. <div class="toolgroup1">
  80. <span><?php echo $_local->gui->language;?></span>
  81. <select id="id_language" name="menu" onchange="menuLangrage(this)">
  82. <option value="en" >English</option>
  83. <option value="si" >සිංහල</option>
  84. <option value="my" >myanmar</option>
  85. <option value="zh-cn" >简体中文</option>
  86. <option value="zh-tw" >繁體中文</option>
  87. </select>
  88. <?php
  89. echo $_local->gui->welcome;
  90. echo "<a href=\"setting.php?item=account\">";
  91. echo urldecode($_COOKIE["nickname"]);
  92. echo "</a>";
  93. echo $_local->gui->to_the_dhamma;
  94. echo "<a href='login.php?op=logout'>";
  95. echo $_local->gui->logout;
  96. echo "</a>";;
  97. ?>
  98. <button class="icon_btn" id="file_select" >
  99. <a href="setting.php" target='_blank'>
  100. <svg class="icon">
  101. <use xlink:href="svg/icon.svg#ic_settings"></use>
  102. </svg>
  103. </a>
  104. </button>
  105. </div>
  106. </div>
  107. <!--tool bar end -->
  108. <script>
  109. document.getElementById("id_language").value="<?php echo($currLanguage); ?>";
  110. </script>
  111. <div class="index_inner">
  112. <div id="id_app_name"><?php echo $module_gui_str['editor']['1051'];?>
  113. <span style="font-size: 70%;">1.6</span><br />
  114. <?php if($currLanguage=="en"){ ?>
  115. <span style="font-size: 70%;">Pali Cannon Database Studio</span>
  116. <?php
  117. }
  118. else{
  119. ?>
  120. <span style="font-size: 70%;">PCD Studio</span>
  121. <?php
  122. }
  123. ?>
  124. </div>
  125. <div class="fun_block">
  126. <div id="userfilelist">
  127. <?php
  128. if(isset($_GET["list"])){
  129. $list=$_GET["list"];
  130. }
  131. else{
  132. $list="group";
  133. }
  134. PDO_Connect("sqlite:"._FILE_DB_FILEINDEX_);
  135. switch($list){
  136. case "group":
  137. echo "<div class='group_path'>Group</div>";
  138. $query="select * from \"group_member\" where user_id='{$UID}' ";
  139. $Fetch = PDO_FetchAll($query);
  140. $iFetch=count($Fetch);
  141. $sGroupId="('";
  142. if($iFetch>0){
  143. foreach($Fetch as $group_id){
  144. $sGroupId .= "{$group_id["group_id"]}','";
  145. }
  146. $sGroupId = substr($sGroupId,0,-2);
  147. $sGroupId .= ")";
  148. $query="select * from \"group_info\" where id in {$sGroupId} ";
  149. $Fetch = PDO_FetchAll($query);
  150. foreach($Fetch as $group){
  151. echo "<div><a href=\"group.php?list=project&group={$group["id"]}\">{$group["name"]}</a>";
  152. echo "<a href=\"group.php?list=group_info&group={$group["id"]}\"> [详情]</a></div>";
  153. }
  154. }
  155. break;
  156. case "group_info":
  157. echo "<div><a href=\"group.php?list=group\">返回Back</a></div>";
  158. if(isset($_GET["group"])){
  159. $group=$_GET["group"];
  160. }
  161. else{
  162. $group="0";
  163. }
  164. $query="select * from \"group_info\" where id = '{$group}' ";
  165. $Fetch = PDO_FetchAll($query);
  166. $group_name=$Fetch[0]["name"];
  167. if(count($Fetch)>0){
  168. echo "<H2>{$group_name}</H2>";
  169. echo "<table>";
  170. echo "<tr><td>建立Create Time</td><td>{$Fetch[0]["create_time"]}</td></tr>";
  171. echo "<tr><td>文件Files</td><td>{$Fetch[0]["file_number"]}</td></tr>";
  172. echo "<tr><td>成员Member</td><td>{$Fetch[0]["member_number"]}</td></tr>";
  173. $query="select user_id from \"group_member\" where group_id = '{$group}' ";
  174. $Fetch = PDO_FetchAll($query);
  175. $sUserId="('";
  176. foreach($Fetch as $user){
  177. $sUserId .= "{$user["user_id"]}','";
  178. }
  179. $sUserId = substr($sUserId,0,-2);
  180. $sUserId .= ")";
  181. $query="select nickname from \"user\" where id in {$sUserId} ";
  182. $userlist = PDO_FetchAll($query);
  183. echo "<tr><td></td><td>";
  184. foreach($userlist as $user){
  185. echo "{$user["nickname"]}<br>";
  186. }
  187. echo "</td></tr>";
  188. echo "</table>";
  189. }
  190. break;
  191. case "project";
  192. if(isset($_GET["group"])){
  193. $group=$_GET["group"];
  194. }
  195. else{
  196. $group="0";
  197. }
  198. $query="select group_name from \"group_member\" where group_id = \"{$group}\" AND user_id=\"{$UID}\"";
  199. $group_name = PDO_FetchOne($query);
  200. if($group_name == ""){
  201. $query="select name from \"group_info\" where group_id = \"{$group}\" ";
  202. $group_name = PDO_FetchOne($query);
  203. }
  204. echo "<div class='group_path'>";
  205. echo "<a href='group.php?list=group'>群组Group</a> >> {$group_name}";
  206. echo "</div>";
  207. $query="select file_id from \"group_file_power\" where group_id = \"{$group}\" AND user_id='{$UID}' group by file_id";
  208. $Fetch = PDO_FetchAll($query);
  209. $sFileId="('";
  210. foreach($Fetch as $file){
  211. $sFileId .= "{$file["file_id"]}','";
  212. }
  213. $sFileId = substr($sFileId,0,-2);
  214. $sFileId .= ")";
  215. $query="select project , count(*) as co from \"group_file\" where id in {$sFileId} group by project";
  216. $Fetch = PDO_FetchAll($query);
  217. echo "<table>";
  218. echo "<tr><td>Project</td><td>File Number</td></tr>";
  219. foreach($Fetch as $project){
  220. echo "<tr class='group_file_list'>";
  221. echo "<td ><a href=\"group.php?list=file&group={$group}&project={$project["project"]}\">{$project["project"]}</a></td>";
  222. echo "<td>{$project["co"]}</td> ";
  223. echo "</tr>";
  224. }
  225. echo "</table>";
  226. break;
  227. case "file":
  228. if(isset($_GET["group"])){
  229. $group=$_GET["group"];
  230. }
  231. else{
  232. $group="0";
  233. }
  234. if(isset($_GET["project"])){
  235. $project=$_GET["project"];
  236. }
  237. else{
  238. $project="0";
  239. }
  240. $query="select group_name from \"group_member\" where group_id = \"{$group}\" AND user_id=\"{$UID}\"";
  241. $group_name = PDO_FetchOne($query);
  242. if($group_name == ""){
  243. $query="select name from \"group_info\" where group_id = \"{$group}\" ";
  244. $group_name = PDO_FetchOne($query);
  245. }
  246. echo "<div class='group_path'>";
  247. echo "<a href='group.php?list=group'>群组Group</a> >> ";
  248. echo "<a href=\"group.php?list=project&group={$group}\">{$group_name}</a> >> ";
  249. echo "{$project}";
  250. echo "</div>";
  251. ?>
  252. <div id="file_filter">
  253. <div style="display:flex;justify-content: space-between;">
  254. <div>
  255. <select id="id_index_status" onchange="showUserFilaList()">
  256. <option value="all" >
  257. <?php echo $module_gui_str['editor_dictionary']['1018'];//全部?>
  258. </option>
  259. <option value="share" >
  260. <?php echo $module_gui_str['tools']['1017'];//已共享?>
  261. </option>
  262. <option value="recycle" >
  263. <?php echo $module_gui_str['tools']['1007'];//回收站?>
  264. </option>
  265. </select>
  266. </div>
  267. <div><?php echo $module_gui_str['editor']['1059'];//排序方式?>
  268. <select id="id_index_orderby" onchange="showUserFilaList()">
  269. <option value="accese_time" ><?php echo $module_gui_str['editor']['1060'];//訪問?></option>
  270. <option value="modify_time" ><?php echo $module_gui_str['editor']['1061'];//修改?></option>
  271. <option value="create_time" ><?php echo $module_gui_str['editor']['1062'];//創建?></option>
  272. <option value="title" ><?php echo $module_gui_str['editor']['1063'];//標題?></option>
  273. </select>
  274. <select id="id_index_order" onchange="showUserFilaList()">
  275. <option value="DESC" ><?php echo $module_gui_str['editor']['1111'];//降序?></option>
  276. <option value="ASC" ><?php echo $module_gui_str['editor']['1110'];//升序?></option>
  277. </select>
  278. <button id="file_select" onclick="mydoc_file_select(true)">
  279. 选择
  280. </button>
  281. </div>
  282. </div>
  283. <div>
  284. <input id="keyword" type="input" placeholder=<?php echo $module_gui_str['editor']['1114'].$module_gui_str['editor']['1115'];?> onkeyup="file_search_keyup()"/>
  285. </div>
  286. </div>
  287. <div id="file_tools" style="display:none;">
  288. <div style="display:flex;justify-content: space-between;">
  289. <div>
  290. <span id="button_group_nomal" >
  291. <button onclick="file_del()"><?php echo $module_gui_str['tools']['1009'];//刪除?></button>
  292. <button onclick="file_share(true)"><?php echo $module_gui_str['tools']['1008'];//共享?></button>
  293. <button onclick="file_share(false)"><?php echo $module_gui_str['tools']['1010'];//取消共享?></button>
  294. </span>
  295. <span id="button_group_recycle" style="dispaly:none">
  296. <button onclick="file_remove()" style="background-color:red;"><?php echo $module_gui_str['tools']['1016'];//彻底删除?></button>
  297. <button onclick="file_remove_all()"><?php echo $module_gui_str['tools']['1015'];//清空回收站?></button>
  298. </span>
  299. </div>
  300. <div>
  301. <button onclick="mydoc_file_select(false)"><?php echo $module_gui_str['editor']['1028'];//取消?></button>
  302. </div>
  303. </div>
  304. </div>
  305. <?php
  306. $query="select * from \"group_process\" where group_id = \"{$group}\" ";
  307. $stage = PDO_FetchAll($query);
  308. $aStage = array();
  309. echo "<button>全部All</button>";
  310. foreach($stage as $one){
  311. $aStage[$one["stage"]]=$one["name"];
  312. echo "<button>{$one["name"]}</button>";
  313. }
  314. $query="select file_id from \"group_file_power\" where group_id = \"{$group}\" AND user_id='{$UID}' group by file_id";
  315. $Fetch = PDO_FetchAll($query);
  316. $sFileId="('";
  317. foreach($Fetch as $file){
  318. $sFileId .= "{$file["file_id"]}','";
  319. }
  320. $sFileId = substr($sFileId,0,-2);
  321. $sFileId .= ")";
  322. $query="select * from \"group_file\" where id in {$sFileId} AND project = \"{$project}\"";
  323. $Fetch = PDO_FetchAll($query);
  324. echo "<table>";
  325. echo "<tr><td>Title</td><td>File Size</td><td>Date</td><td>Stage</td><td></td></tr>";
  326. foreach($Fetch as $file){
  327. echo "<tr class='group_file_list'>";
  328. echo "<td class='group_file_title'><a href=\"group.php?list=stage&file={$file["id"]}\">{$file["file_title"]}</a></td>";
  329. echo "<td>{$file["file_size"]}</td> ";
  330. echo "<td>{$file["modify_time"]}</td> ";
  331. $stage_name=$aStage["{$file["stage"]}"];
  332. echo "<td><span class='tag'>{$stage_name}</span></td>";
  333. echo "<td><a href=\"group.php?list=stage&file={$file["id"]}\">详情Details</a></td>";
  334. echo "</tr>";
  335. }
  336. echo "</table>";
  337. break;
  338. case "stage":
  339. if(isset($_GET["file"])){
  340. $file_id=$_GET["file"];
  341. }
  342. else{
  343. $file_id="0";
  344. }
  345. $query="select * from \"group_file\" where id = {$file_id} ";
  346. $Fetch = PDO_FetchAll($query);
  347. $group_id=$Fetch[0]["group_id"];
  348. $file_title=$Fetch[0]["file_title"];
  349. $project = $Fetch[0]["project"];
  350. $curr_stage=$Fetch[0]["stage"];
  351. $query="select name from \"group_info\" where id = \"{$group_id}\" ";
  352. $group_name = PDO_FetchOne($query);
  353. $query="select group_name from \"group_member\" where group_id = \"{$group_id}\" AND user_id='{$UID}' ";
  354. $my_group_name = PDO_FetchOne($query);
  355. if(empty($my_group_name)){
  356. $my_group_name = $group_name;
  357. }
  358. $query="select * from \"group_process\" where group_id = \"{$group_id}\" ";
  359. $stage = PDO_FetchAll($query);
  360. echo "<div class='group_path'>";
  361. echo "<a href=\"group.php?list=group\">群组Group</a> / ";
  362. echo "<a href=\"group.php?list=project&group={$group_id}\">{$my_group_name}</a> / ";
  363. echo "<a href=\"group.php?list=file&group={$group_id}&project={$project}\">{$project}</a>";
  364. echo "</div>";
  365. echo "<h2>{$file_title}</h2>";
  366. foreach($stage as $one){
  367. echo "<button>{$one["stage"]}</button>{$one["name"]}-";
  368. if($one["stage"]<$curr_stage){
  369. echo "<span style='color:green'>已经完成Done</span>";
  370. }
  371. else if($one["stage"]==$curr_stage){
  372. echo "正在进行Runing<button>完成Done</button>";
  373. }
  374. else{
  375. echo "尚未开始 Not Ready";
  376. }
  377. echo"<br>";
  378. }
  379. break;
  380. }
  381. ?>
  382. </div>
  383. </div>
  384. </div>
  385. <div class="foot_div">
  386. <?php echo $module_gui_str['editor']['1066'];?>
  387. </div>
  388. </body>
  389. </html>