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. $db_file = '../user/fileindex.db';
  135. PDO_Connect("sqlite:{$_file_db_group}");
  136. switch($list){
  137. case "group":
  138. echo "<div class='group_path'>Group</div>";
  139. $query="select * from \"group_member\" where user_id='{$UID}' ";
  140. $Fetch = PDO_FetchAll($query);
  141. $iFetch=count($Fetch);
  142. $sGroupId="('";
  143. if($iFetch>0){
  144. foreach($Fetch as $group_id){
  145. $sGroupId .= "{$group_id["group_id"]}','";
  146. }
  147. $sGroupId = substr($sGroupId,0,-2);
  148. $sGroupId .= ")";
  149. $query="select * from \"group_info\" where id in {$sGroupId} ";
  150. $Fetch = PDO_FetchAll($query);
  151. foreach($Fetch as $group){
  152. echo "<div><a href=\"group.php?list=project&group={$group["id"]}\">{$group["name"]}</a>";
  153. echo "<a href=\"group.php?list=group_info&group={$group["id"]}\"> [详情]</a></div>";
  154. }
  155. }
  156. break;
  157. case "group_info":
  158. echo "<div><a href=\"group.php?list=group\">返回Back</a></div>";
  159. if(isset($_GET["group"])){
  160. $group=$_GET["group"];
  161. }
  162. else{
  163. $group="0";
  164. }
  165. $query="select * from \"group_info\" where id = '{$group}' ";
  166. $Fetch = PDO_FetchAll($query);
  167. $group_name=$Fetch[0]["name"];
  168. if(count($Fetch)>0){
  169. echo "<H2>{$group_name}</H2>";
  170. echo "<table>";
  171. echo "<tr><td>建立Create Time</td><td>{$Fetch[0]["create_time"]}</td></tr>";
  172. echo "<tr><td>文件Files</td><td>{$Fetch[0]["file_number"]}</td></tr>";
  173. echo "<tr><td>成员Member</td><td>{$Fetch[0]["member_number"]}</td></tr>";
  174. $query="select user_id from \"group_member\" where group_id = '{$group}' ";
  175. $Fetch = PDO_FetchAll($query);
  176. $sUserId="('";
  177. foreach($Fetch as $user){
  178. $sUserId .= "{$user["user_id"]}','";
  179. }
  180. $sUserId = substr($sUserId,0,-2);
  181. $sUserId .= ")";
  182. $query="select nickname from \"user\" where id in {$sUserId} ";
  183. $userlist = PDO_FetchAll($query);
  184. echo "<tr><td></td><td>";
  185. foreach($userlist as $user){
  186. echo "{$user["nickname"]}<br>";
  187. }
  188. echo "</td></tr>";
  189. echo "</table>";
  190. }
  191. break;
  192. case "project";
  193. if(isset($_GET["group"])){
  194. $group=$_GET["group"];
  195. }
  196. else{
  197. $group="0";
  198. }
  199. $query="select group_name from \"group_member\" where group_id = \"{$group}\" AND user_id=\"{$UID}\"";
  200. $group_name = PDO_FetchOne($query);
  201. if($group_name == ""){
  202. $query="select name from \"group_info\" where group_id = \"{$group}\" ";
  203. $group_name = PDO_FetchOne($query);
  204. }
  205. echo "<div class='group_path'>";
  206. echo "<a href='group.php?list=group'>群组Group</a> >> {$group_name}";
  207. echo "</div>";
  208. $query="select file_id from \"group_file_power\" where group_id = \"{$group}\" AND user_id='{$UID}' group by file_id";
  209. $Fetch = PDO_FetchAll($query);
  210. $sFileId="('";
  211. foreach($Fetch as $file){
  212. $sFileId .= "{$file["file_id"]}','";
  213. }
  214. $sFileId = substr($sFileId,0,-2);
  215. $sFileId .= ")";
  216. $query="select project , count(*) as co from \"group_file\" where id in {$sFileId} group by project";
  217. $Fetch = PDO_FetchAll($query);
  218. echo "<table>";
  219. echo "<tr><td>Project</td><td>File Number</td></tr>";
  220. foreach($Fetch as $project){
  221. echo "<tr class='group_file_list'>";
  222. echo "<td ><a href=\"group.php?list=file&group={$group}&project={$project["project"]}\">{$project["project"]}</a></td>";
  223. echo "<td>{$project["co"]}</td> ";
  224. echo "</tr>";
  225. }
  226. echo "</table>";
  227. break;
  228. case "file":
  229. if(isset($_GET["group"])){
  230. $group=$_GET["group"];
  231. }
  232. else{
  233. $group="0";
  234. }
  235. if(isset($_GET["project"])){
  236. $project=$_GET["project"];
  237. }
  238. else{
  239. $project="0";
  240. }
  241. $query="select group_name from \"group_member\" where group_id = \"{$group}\" AND user_id=\"{$UID}\"";
  242. $group_name = PDO_FetchOne($query);
  243. if($group_name == ""){
  244. $query="select name from \"group_info\" where group_id = \"{$group}\" ";
  245. $group_name = PDO_FetchOne($query);
  246. }
  247. echo "<div class='group_path'>";
  248. echo "<a href='group.php?list=group'>群组Group</a> >> ";
  249. echo "<a href=\"group.php?list=project&group={$group}\">{$group_name}</a> >> ";
  250. echo "{$project}";
  251. echo "</div>";
  252. ?>
  253. <div id="file_filter">
  254. <div style="display:flex;justify-content: space-between;">
  255. <div>
  256. <select id="id_index_status" onchange="showUserFilaList()">
  257. <option value="all" >
  258. <?php echo $module_gui_str['editor_dictionary']['1018'];//全部?>
  259. </option>
  260. <option value="share" >
  261. <?php echo $module_gui_str['tools']['1017'];//已共享?>
  262. </option>
  263. <option value="recycle" >
  264. <?php echo $module_gui_str['tools']['1007'];//回收站?>
  265. </option>
  266. </select>
  267. </div>
  268. <div><?php echo $module_gui_str['editor']['1059'];//排序方式?>
  269. <select id="id_index_orderby" onchange="showUserFilaList()">
  270. <option value="accese_time" ><?php echo $module_gui_str['editor']['1060'];//訪問?></option>
  271. <option value="modify_time" ><?php echo $module_gui_str['editor']['1061'];//修改?></option>
  272. <option value="create_time" ><?php echo $module_gui_str['editor']['1062'];//創建?></option>
  273. <option value="title" ><?php echo $module_gui_str['editor']['1063'];//標題?></option>
  274. </select>
  275. <select id="id_index_order" onchange="showUserFilaList()">
  276. <option value="DESC" ><?php echo $module_gui_str['editor']['1111'];//降序?></option>
  277. <option value="ASC" ><?php echo $module_gui_str['editor']['1110'];//升序?></option>
  278. </select>
  279. <button id="file_select" onclick="mydoc_file_select(true)">
  280. 选择
  281. </button>
  282. </div>
  283. </div>
  284. <div>
  285. <input id="keyword" type="input" placeholder=<?php echo $module_gui_str['editor']['1114'].$module_gui_str['editor']['1115'];?> onkeyup="file_search_keyup()"/>
  286. </div>
  287. </div>
  288. <div id="file_tools" style="display:none;">
  289. <div style="display:flex;justify-content: space-between;">
  290. <div>
  291. <span id="button_group_nomal" >
  292. <button onclick="file_del()"><?php echo $module_gui_str['tools']['1009'];//刪除?></button>
  293. <button onclick="file_share(true)"><?php echo $module_gui_str['tools']['1008'];//共享?></button>
  294. <button onclick="file_share(false)"><?php echo $module_gui_str['tools']['1010'];//取消共享?></button>
  295. </span>
  296. <span id="button_group_recycle" style="dispaly:none">
  297. <button onclick="file_remove()" style="background-color:red;"><?php echo $module_gui_str['tools']['1016'];//彻底删除?></button>
  298. <button onclick="file_remove_all()"><?php echo $module_gui_str['tools']['1015'];//清空回收站?></button>
  299. </span>
  300. </div>
  301. <div>
  302. <button onclick="mydoc_file_select(false)"><?php echo $module_gui_str['editor']['1028'];//取消?></button>
  303. </div>
  304. </div>
  305. </div>
  306. <?php
  307. $query="select * from \"group_process\" where group_id = \"{$group}\" ";
  308. $stage = PDO_FetchAll($query);
  309. $aStage = array();
  310. echo "<button>全部All</button>";
  311. foreach($stage as $one){
  312. $aStage[$one["stage"]]=$one["name"];
  313. echo "<button>{$one["name"]}</button>";
  314. }
  315. $query="select file_id from \"group_file_power\" where group_id = \"{$group}\" AND user_id='{$UID}' group by file_id";
  316. $Fetch = PDO_FetchAll($query);
  317. $sFileId="('";
  318. foreach($Fetch as $file){
  319. $sFileId .= "{$file["file_id"]}','";
  320. }
  321. $sFileId = substr($sFileId,0,-2);
  322. $sFileId .= ")";
  323. $query="select * from \"group_file\" where id in {$sFileId} AND project = \"{$project}\"";
  324. $Fetch = PDO_FetchAll($query);
  325. echo "<table>";
  326. echo "<tr><td>Title</td><td>File Size</td><td>Date</td><td>Stage</td><td></td></tr>";
  327. foreach($Fetch as $file){
  328. echo "<tr class='group_file_list'>";
  329. echo "<td class='group_file_title'><a href=\"group.php?list=stage&file={$file["id"]}\">{$file["file_title"]}</a></td>";
  330. echo "<td>{$file["file_size"]}</td> ";
  331. echo "<td>{$file["modify_time"]}</td> ";
  332. $stage_name=$aStage["{$file["stage"]}"];
  333. echo "<td><span class='tag'>{$stage_name}</span></td>";
  334. echo "<td><a href=\"group.php?list=stage&file={$file["id"]}\">详情Details</a></td>";
  335. echo "</tr>";
  336. }
  337. echo "</table>";
  338. break;
  339. case "stage":
  340. if(isset($_GET["file"])){
  341. $file_id=$_GET["file"];
  342. }
  343. else{
  344. $file_id="0";
  345. }
  346. $query="select * from \"group_file\" where id = {$file_id} ";
  347. $Fetch = PDO_FetchAll($query);
  348. $group_id=$Fetch[0]["group_id"];
  349. $file_title=$Fetch[0]["file_title"];
  350. $project = $Fetch[0]["project"];
  351. $curr_stage=$Fetch[0]["stage"];
  352. $query="select name from \"group_info\" where id = \"{$group_id}\" ";
  353. $group_name = PDO_FetchOne($query);
  354. $query="select group_name from \"group_member\" where group_id = \"{$group_id}\" AND user_id='{$UID}' ";
  355. $my_group_name = PDO_FetchOne($query);
  356. if(empty($my_group_name)){
  357. $my_group_name = $group_name;
  358. }
  359. $query="select * from \"group_process\" where group_id = \"{$group_id}\" ";
  360. $stage = PDO_FetchAll($query);
  361. echo "<div class='group_path'>";
  362. echo "<a href=\"group.php?list=group\">群组Group</a> / ";
  363. echo "<a href=\"group.php?list=project&group={$group_id}\">{$my_group_name}</a> / ";
  364. echo "<a href=\"group.php?list=file&group={$group_id}&project={$project}\">{$project}</a>";
  365. echo "</div>";
  366. echo "<h2>{$file_title}</h2>";
  367. foreach($stage as $one){
  368. echo "<button>{$one["stage"]}</button>{$one["name"]}-";
  369. if($one["stage"]<$curr_stage){
  370. echo "<span style='color:green'>已经完成Done</span>";
  371. }
  372. else if($one["stage"]==$curr_stage){
  373. echo "正在进行Runing<button>完成Done</button>";
  374. }
  375. else{
  376. echo "尚未开始 Not Ready";
  377. }
  378. echo"<br>";
  379. }
  380. break;
  381. }
  382. ?>
  383. </div>
  384. </div>
  385. </div>
  386. <div class="foot_div">
  387. <?php echo $module_gui_str['editor']['1066'];?>
  388. </div>
  389. </body>
  390. </html>