Added Other AP

This commit is contained in:
dev-chiefworks
2022-04-26 11:30:34 -04:00
parent 5e006a6a21
commit 47f4fad75c
251 changed files with 29298 additions and 4 deletions
@@ -0,0 +1,27 @@
<?php
class PopularDestinations {
public static function get($db, $country, $city, $limit=10) {
$city_id = (int)$city;
$country_code = pg_escape_string($country);
$q = "SELECT a.id AS attraction_id,a.attraction,a.active,a.address_id,a.city_id,b.* ";
$q.= " FROM tourist_attraction a, address b ";
$q.= " WHERE b.id=a.address_id AND b.country='SG' AND a.city_id=1 AND a.active='t' ";
$q.= " ORDER BY a.attraction";
$r = pg_query($db, $q);
if ($r && pg_num_rows($r)) {
$result = [];
while ($f=pg_fetch_assoc($r)) {
$result[] = $f;
}
return [$result, NULL];
}
return [NULL,pg_last_error()];
}
}
// vi:ts=2