get.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. //查询group 列表
  3. require_once "../config.php";
  4. require_once "../public/_pdo.php";
  5. require_once '../public/function.php';
  6. require_once '../ucenter/function.php';
  7. require_once '../share/function.php';
  8. $output = array();
  9. if (isset($_GET["id"])) {
  10. PDO_Connect("" . _FILE_DB_GROUP_);
  11. $id = $_GET["id"];
  12. $query = "SELECT * FROM group_info WHERE id = ? ";
  13. $Fetch = PDO_FetchRow($query, array($id));
  14. if ($Fetch) {
  15. $output["info"] = $Fetch;
  16. if ($Fetch["parent"] == 0) {
  17. #顶级组 列出小组
  18. $query = "SELECT * FROM group_info WHERE parent = ? ";
  19. $FetchList = PDO_FetchAll($query, array($id));
  20. $output["children"] = $FetchList;
  21. } else {
  22. $output["children"] = array();
  23. $query = "SELECT * FROM group_info WHERE id = ? ";
  24. $parent_group = PDO_FetchRow($query, array($Fetch["parent"]));
  25. $output["parent"] = $parent_group;
  26. }
  27. #列出组共享资源
  28. {
  29. /*
  30. PDO_Connect("" . _FILE_DB_FILEINDEX_);
  31. $query = "SELECT * FROM power WHERE user = ? ";
  32. $fileList = PDO_FetchAll($query, array($id));
  33. foreach ($fileList as $key => $value) {
  34. # code...
  35. $query = "SELECT title FROM fileindex WHERE id = ? ";
  36. $file = PDO_FetchRow($query, array($value["doc_id"]));
  37. if ($file) {
  38. $fileList[$key]["title"] = $file["title"];
  39. } else {
  40. $fileList[$key]["title"] = "";
  41. }
  42. }
  43. $output["file"] = $fileList;
  44. */
  45. $output["file"] =share_res_list_get($id);
  46. }
  47. }
  48. }
  49. echo json_encode($output, JSON_UNESCAPED_UNICODE);