diff --git a/data/%%AD^AD7^AD71B708%%rss.tpl.php b/data/%%AD^AD7^AD71B708%%rss.tpl.php index dd29a9c..7f66a6b 100644 --- a/data/%%AD^AD7^AD71B708%%rss.tpl.php +++ b/data/%%AD^AD7^AD71B708%%rss.tpl.php @@ -1,4 +1,4 @@ - version="1.0" encoding="UTF-8"'; ?> diff --git a/docs/api.php b/docs/api.php index 21f937c..690d287 100644 --- a/docs/api.php +++ b/docs/api.php @@ -107,6 +107,18 @@ class api { $this->applications = Applications::query_area($bottom_left_xy->easting, $bottom_left_xy->northing, $top_right_xy->easting, $top_right_xy->northing); } break; + case "areaos": + //validation + if(!isset($_GET['bottom_left_easting']) || !isset($_GET['bottom_left_northing']) || !isset($_GET['top_right_easting']) || !isset($_GET['top_right_northing'])){ + array_push($this->warnings, "Bounding box was not specified"); + } + + //all good, get the data + if(sizeof($this->warnings) == 0){ + $this->applications = Applications::query_area($_GET['bottom_left_easting'], $_GET['bottom_left_northing'], $_GET['top_right_easting'], $_GET['top_right_easting']); + } + break; + default: $this->warnings = "No call type specified"; } diff --git a/docs/include/application.php b/docs/include/application.php index 2101a27..0bc3b60 100644 --- a/docs/include/application.php +++ b/docs/include/application.php @@ -120,6 +120,7 @@ class Applications{ //by area function query_area($x1,$y1,$x2,$y2) { + $db = DB::connect(DB_CONNECTION_STRING); $sql = "select council_reference, address, postcode, description, info_url, comment_url, map_url, x, y, date_recieved, full_name from application diff --git a/docs/templates/apihowto.tpl b/docs/templates/apihowto.tpl index dc486ea..951c7db 100644 --- a/docs/templates/apihowto.tpl +++ b/docs/templates/apihowto.tpl @@ -65,8 +65,8 @@ http://www.planningalerts.com/api.php?call=area
&bottom_left_lat=[some latitude]&bottom_left_lng=[some longitude]&top_right_lat=[some latitude]&top_right_lng=[some longitude]

- view example - view on a map + view example + view on a map