Browse Source

api fix 4

master
memespring 17 years ago
parent
commit
9789ee5864
4 changed files with 16 additions and 3 deletions
  1. +1
    -1
      data/%%AD^AD7^AD71B708%%rss.tpl.php
  2. +12
    -0
      docs/api.php
  3. +1
    -0
      docs/include/application.php
  4. +2
    -2
      docs/templates/apihowto.tpl

+ 1
- 1
data/%%AD^AD7^AD71B708%%rss.tpl.php View File

@@ -1,4 +1,4 @@
<?php /* Smarty version 2.6.16, created on 2007-04-09 18:29:17
<?php /* Smarty version 2.6.16, created on 2007-04-09 18:50:08
compiled from rss.tpl */ ?> compiled from rss.tpl */ ?>
<?php echo '<?xml'; ?> <?php echo '<?xml'; ?>
version="1.0" encoding="UTF-8"<?php echo '?>'; ?> version="1.0" encoding="UTF-8"<?php echo '?>'; ?>


+ 12
- 0
docs/api.php View File

@@ -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); $this->applications = Applications::query_area($bottom_left_xy->easting, $bottom_left_xy->northing, $top_right_xy->easting, $top_right_xy->northing);
} }
break; 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: default:
$this->warnings = "No call type specified"; $this->warnings = "No call type specified";
} }


+ 1
- 0
docs/include/application.php View File

@@ -120,6 +120,7 @@ class Applications{
//by area //by area
function query_area($x1,$y1,$x2,$y2) { function query_area($x1,$y1,$x2,$y2) {

$db = DB::connect(DB_CONNECTION_STRING); $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 $sql = "select council_reference, address, postcode, description, info_url, comment_url, map_url, x, y, date_recieved, full_name
from application from application


+ 2
- 2
docs/templates/apihowto.tpl View File

@@ -65,8 +65,8 @@
http://www.planningalerts.com/api.php?<strong>call</strong>=area<br/>&<strong>bottom_left_lat</strong>=[some latitude]&<strong>bottom_left_lng</strong>=[some longitude]&<strong>top_right_lat</strong>=[some latitude]&<strong>top_right_lng</strong>=[some longitude] http://www.planningalerts.com/api.php?<strong>call</strong>=area<br/>&<strong>bottom_left_lat</strong>=[some latitude]&<strong>bottom_left_lng</strong>=[some longitude]&<strong>top_right_lat</strong>=[some latitude]&<strong>top_right_lng</strong>=[some longitude]
</code> </code>
<p class="apiexamples"> <p class="apiexamples">
<a href="http://www.planningalerts.com/api.php?lat=51.52277&lng=-0.067281&area_size=l">view example</a>
<a href="http://www.planningalerts.com/api.php?lat=51.52277&lng=-0.067281&area_size=l">view on a map</a>
<a href="http://www.planningalerts.com/api.php?call=area&bottom_left_lat=51.52277&bottom_left_lng=-0.067281&top_right_lat=52.52277&top_right_lng=15">view example</a>
<a href="http://maps.google.com/maps?f=q&hl=en&q=http://www.planningalerts.com/api.php%3Fcall%3Darea%26bottom_left_lat%3D51.52277%26bottom_left_lng%3D-0.067281%26top_right_lat%3D52.52277%26top_right_lng%3D15&layer=&ie=UTF8&z=8&om=1">view on a map</a>
</p> </p>
</div> </div>


Loading…
Cancel
Save