Mercurial > hg > ywww
comparison php/read/getBookDetails.php @ 49:a67bf725e87b
put both paths in include_path and depend on that
author | Charlie Root |
---|---|
date | Wed, 16 Jan 2019 13:42:15 -0500 |
parents | da133c130c1d |
children | dd93cb4b77ad |
comparison
equal
deleted
inserted
replaced
48:da133c130c1d | 49:a67bf725e87b |
---|---|
1 <?php | 1 <?php |
2 include_once "ywww/dlog.php"; | 2 include_once "dlog.php"; |
3 | 3 |
4 include_once "private/web.php"; | 4 include_once "web.php"; |
5 function findGenre($browseNode, &$ID, &$gen) | 5 function findGenre($browseNode, &$ID, &$gen) |
6 { | 6 { |
7 if($browseNode->Name == "Subjects") | 7 if($browseNode->Name == "Subjects") |
8 { | 8 { |
9 return true; | 9 return true; |
59 | 59 |
60 $output .= "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; | 60 $output .= "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; |
61 $output .= "<BookDetails>"; | 61 $output .= "<BookDetails>"; |
62 | 62 |
63 $proceed = true; | 63 $proceed = true; |
64 include "private/db.php"; | 64 include "db.php"; |
65 | 65 |
66 $query = "CALL b_getBookInfo('$isbn', $loc)"; | 66 $query = "CALL b_getBookInfo('$isbn', $loc)"; |
67 //select Timestamp,Title,Author,Binding,DeweyDecimal,ImageURL,SalesRank,PublicationDate,Publisher,Genre1,Genre2,Genre3 from books where ISBN = '$isbn'"; | 67 //select Timestamp,Title,Author,Binding,DeweyDecimal,ImageURL,SalesRank,PublicationDate,Publisher,Genre1,Genre2,Genre3 from books where ISBN = '$isbn'"; |
68 //echo $query; | 68 //echo $query; |
69 $res = my_query($query,'gbd1'); | 69 $res = my_query($query,'gbd1'); |
105 } | 105 } |
106 | 106 |
107 if($proceed == true) | 107 if($proceed == true) |
108 { | 108 { |
109 include "aws_signed_request.php"; | 109 include "aws_signed_request.php"; |
110 include_once "ywww/xml/doAmazonRequest.php"; | 110 include_once "xml/doAmazonRequest.php"; |
111 | 111 |
112 //book does not exist already so look up all the info from browse nodes.... | 112 //book does not exist already so look up all the info from browse nodes.... |
113 | 113 |
114 $Adefault=array( | 114 $Adefault=array( |
115 'language' =>'en', //what language to render the page in | 115 'language' =>'en', //what language to render the page in |
152 set_error_handler(function () { | 152 set_error_handler(function () { |
153 global $out,$isbn; | 153 global $out,$isbn; |
154 dl("Caught one bd: $isbn\n"); | 154 dl("Caught one bd: $isbn\n"); |
155 dl(print_r($out, TRUE)."\n"); | 155 dl(print_r($out, TRUE)."\n"); |
156 } ); | 156 } ); |
157 include "private/db.php"; | 157 include "db.php"; |
158 | 158 |
159 $title=""; | 159 $title=""; |
160 $author=""; | 160 $author=""; |
161 $binding=""; | 161 $binding=""; |
162 $dewey=""; | 162 $dewey=""; |
260 | 260 |
261 if($salesRank == "") | 261 if($salesRank == "") |
262 $salesRank = "null"; | 262 $salesRank = "null"; |
263 | 263 |
264 mysqli_close($link); //do not remove. reset is needed otherwise mysqli_fetch_array doesn't work after first loop | 264 mysqli_close($link); //do not remove. reset is needed otherwise mysqli_fetch_array doesn't work after first loop |
265 include "private/db.php"; | 265 include "db.php"; |
266 | 266 |
267 $title = strtr($title, '"', "'"); | 267 $title = strtr($title, '"', "'"); |
268 $queryInsert = "CALL b_addNewBook(\"$isbn\",\"$title\", \"$author\",\"$binding\",\"$imageURL\", $dewey, $salesRank,$pubDate,\"$publisher\",$g1,$g2,$g3,$loc)"; | 268 $queryInsert = "CALL b_addNewBook(\"$isbn\",\"$title\", \"$author\",\"$binding\",\"$imageURL\", $dewey, $salesRank,$pubDate,\"$publisher\",$g1,$g2,$g3,$loc)"; |
269 //echo $queryInsert; | 269 //echo $queryInsert; |
270 | 270 |