get.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. require_once "../public/_pdo.php";
  3. require_once "../path.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. add_edit_event(_NISSAYA_FIND_, "{$book}-{$para}-{$begin}-{$end}");
  32. PDO_Connect("" . _FILE_DB_PAGE_INDEX_);
  33. $query = "SELECT * from m where book=? and para=?";
  34. $Fetch = PDO_FetchAll($query, array($book, $para));
  35. foreach ($Fetch as $key => $value) {
  36. $query = "SELECT * from book_match where book_vri=? and vol=?";
  37. $Fetch_nsy_book = PDO_FetchRow($query, array($value["book"], $value["page1"]));
  38. if ($Fetch_nsy_book) {
  39. $prefix = $Fetch_nsy_book["table"];
  40. $query = "SELECT * from {$prefix}_pagematch where bookid=? and bookpagenumber=?";
  41. $Fetch_nsy_index = PDO_FetchRow($query, array($Fetch_nsy_book["bookid"], $value["page2"]));
  42. $Fetch_nsy_index["dir"] = $prefix;
  43. $result["data"][] = $Fetch_nsy_index;
  44. } else {
  45. $result["error"] = "error: in table book_match";
  46. }
  47. }
  48. echo json_encode($result, JSON_UNESCAPED_UNICODE);