get.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. }
  10. else{
  11. $result["error"]="no param";
  12. echo json_encode($result,JSON_UNESCAPED_UNICODE);
  13. exit;
  14. }
  15. if(isset($_GET["para"])){
  16. $para = $_GET["para"];
  17. }
  18. else{
  19. $result["error"]="no param";
  20. echo json_encode($result,JSON_UNESCAPED_UNICODE);
  21. exit;
  22. }
  23. if(isset($_GET["begin"])){
  24. $begin = $_GET["begin"];
  25. }
  26. else{
  27. $begin = 0;
  28. }
  29. if(isset($_GET["end"])){
  30. $end = $_GET["end"];
  31. }
  32. else{
  33. $end = 0;
  34. }
  35. add_edit_event(_FIND_IN_NISSAYA_,"{$book}-{$para}-{$begin}-{$end}");
  36. PDO_Connect("sqlite:"._FILE_DB_PAGE_INDEX_);
  37. $query = "SELECT * from m where book=? and para=?";
  38. $Fetch = PDO_FetchAll($query,array($book,$para));
  39. foreach ($Fetch as $key => $value){
  40. $query = "SELECT * from book_match where book_vri=? and vol=?";
  41. $Fetch_nsy_book = PDO_FetchRow($query,array($value["book"],$value["page1"]));
  42. if($Fetch_nsy_book){
  43. $prefix = $Fetch_nsy_book["table"];
  44. $query = "SELECT * from {$prefix}_pagematch where bookid=? and bookpagenumber=?";
  45. $Fetch_nsy_index = PDO_FetchRow($query,array($Fetch_nsy_book["bookid"],$value["page2"]));
  46. $Fetch_nsy_index["dir"]=$prefix;
  47. $result["data"][] = $Fetch_nsy_index;
  48. }
  49. else{
  50. $result["error"]= "error: in table book_match";
  51. }
  52. }
  53. echo json_encode($result,JSON_UNESCAPED_UNICODE);
  54. ?>