get.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. require_once "../public/_pdo.php";
  3. require_once "../config.php";
  4. require_once "../ucenter/active.php";
  5. $result["error"] = "";
  6. $result["data"] = array();
  7. if (isset($_GET["book"])) {
  8. $book = $_GET["book"];
  9. } else {
  10. $result["error"] = "no param";
  11. echo json_encode($result, JSON_UNESCAPED_UNICODE);
  12. exit;
  13. }
  14. if (isset($_GET["para"])) {
  15. $para = $_GET["para"];
  16. } else {
  17. $result["error"] = "no param";
  18. echo json_encode($result, JSON_UNESCAPED_UNICODE);
  19. exit;
  20. }
  21. if (isset($_GET["begin"])) {
  22. $begin = $_GET["begin"];
  23. } else {
  24. $begin = 0;
  25. }
  26. if (isset($_GET["end"])) {
  27. $end = $_GET["end"];
  28. } else {
  29. $end = 0;
  30. }
  31. if (isset($_GET["nsyid"])) {
  32. $nsyid = substr($_GET["nsyid"],1) ;
  33. } else {
  34. $nsyid = '';
  35. }
  36. add_edit_event(_NISSAYA_FIND_, "{$book}-{$para}-{$begin}-{$end}");
  37. PDO_Connect("" . _FILE_DB_PAGE_INDEX_);
  38. $query = "SELECT * from m where book=? and para=?";
  39. $Fetch = PDO_FetchAll($query, array($book, $para));
  40. foreach ($Fetch as $key => $value) {
  41. $query = "SELECT * from book_match where book_vri=? and vol=?";
  42. $Fetch_nsy_book = PDO_FetchRow($query, array($value["book"], $value["page1"]));
  43. if ($Fetch_nsy_book) {
  44. $prefix = $Fetch_nsy_book["table"];
  45. $query = "SELECT * from {$prefix}_pagematch where bookid=? and bookpagenumber=? and nsyid = ?";
  46. $Fetch_nsy_index = PDO_FetchRow($query, array($Fetch_nsy_book["bookid"], $value["page2"],$nsyid ));
  47. $Fetch_nsy_index["dir"] = $prefix;
  48. $result["data"][] = $Fetch_nsy_index;
  49. } else {
  50. $result["error"] = "error: in table book_match";
  51. }
  52. }
  53. echo json_encode($result, JSON_UNESCAPED_UNICODE);