@@ -1,4 +1,4 @@ | |||||
<?php /* Smarty version 2.6.16, created on 2007-04-09 17:38:29 | |||||
<?php /* Smarty version 2.6.16, created on 2007-04-09 17:58:56 | |||||
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 '?>'; ?> | ||||
@@ -1,4 +1,4 @@ | |||||
<?php /* Smarty version 2.6.16, created on 2007-04-09 17:37:29 | |||||
<?php /* Smarty version 2.6.16, created on 2007-04-09 17:57:48 | |||||
compiled from header.tpl */ ?> | compiled from header.tpl */ ?> | ||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | ||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||||
@@ -30,7 +30,6 @@ class api { | |||||
//get the call type | //get the call type | ||||
$call = $_GET['call']; | $call = $_GET['call']; | ||||
switch ($call) { | switch ($call) { | ||||
case "postcode": | case "postcode": | ||||
@@ -78,7 +77,7 @@ class api { | |||||
} | } | ||||
//all good, get the data | //all good, get the data | ||||
if(sizeof($this->warnings) == 0){ | if(sizeof($this->warnings) == 0){ | ||||
$this->applications = Applications::query($_GET['easting'], $_GET['$northing'], alert_size_to_meters($_GET['area_size'])); | |||||
$this->applications = Applications::query($_GET['easting'], $_GET['northing'], alert_size_to_meters($_GET['area_size'])); | |||||
} | } | ||||
break; | break; | ||||
case "authority": | case "authority": | ||||
@@ -101,9 +100,9 @@ class api { | |||||
//all good, get the data | //all good, get the data | ||||
if(sizeof($this->warnings) == 0){ | if(sizeof($this->warnings) == 0){ | ||||
$bottom_left_latlng = new LatLng($_GET['bottom_left_lat'], $_GET['bottom_left_lng']); | $bottom_left_latlng = new LatLng($_GET['bottom_left_lat'], $_GET['bottom_left_lng']); | ||||
$bottom_left_xy = $latlng->toOSRef(); | |||||
$bottom_left_xy = $bottom_left_latlng->toOSRef(); | |||||
$top_right_latlng = new LatLng($_GET['bottom_left_lat'], $_GET['bottom_left_lng']); | $top_right_latlng = new LatLng($_GET['bottom_left_lat'], $_GET['bottom_left_lng']); | ||||
$top_right_xy = $latlng->toOSRef(); | |||||
$top_right_xy = $top_right_latlng->toOSRef(); | |||||
$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); | ||||
} | } | ||||
@@ -114,7 +114,7 @@ class Applications{ | |||||
where application.x > " . $db->quote($x - $d) . " and application.x < " . $db->quote($x + $d) . | where application.x > " . $db->quote($x - $d) . " and application.x < " . $db->quote($x + $d) . | ||||
" and application.y > " . $db->quote($y - $d) . " and application.y < " . $db->quote($y + $d) . | " and application.y > " . $db->quote($y - $d) . " and application.y < " . $db->quote($y + $d) . | ||||
" order by date_scraped desc limit 100"; | " order by date_scraped desc limit 100"; | ||||
print $sql; exit; | |||||
$application_results = $db->getAll($sql); | $application_results = $db->getAll($sql); | ||||
return applications::load_applications($application_results); | return applications::load_applications($application_results); | ||||
} | } | ||||
@@ -128,7 +128,6 @@ class Applications{ | |||||
where application.x > " . $db->quote($x1) . " and application.x < " . $db->quote($x2) . | where application.x > " . $db->quote($x1) . " and application.x < " . $db->quote($x2) . | ||||
" and application.y > " . $db->quote($y1) . " and application.y < " . $db->quote($y2) . | " and application.y > " . $db->quote($y1) . " and application.y < " . $db->quote($y2) . | ||||
" order by date_scraped desc limit 100"; | " order by date_scraped desc limit 100"; | ||||
$application_results = $db->getAll($sql); | $application_results = $db->getAll($sql); | ||||
return applications::load_applications($application_results); | return applications::load_applications($application_results); | ||||
} | } | ||||
@@ -20,8 +20,8 @@ | |||||
http://www.planningalerts.com/api.php?<strong>call</strong>=postcode<br/>&<strong>postcode</strong>=[some postcode]&<strong>area_size</strong>=['s' 'm' or 'l']</em> | http://www.planningalerts.com/api.php?<strong>call</strong>=postcode<br/>&<strong>postcode</strong>=[some postcode]&<strong>area_size</strong>=['s' 'm' or 'l']</em> | ||||
</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=postcode&postcode=sw98jx&area_size=l">view example</a> | |||||
<a href="http://www.planningalerts.com/api.php?call=postcode&postcode=sw98jx&area_size=l">view on a map</a> | |||||
</p> | </p> | ||||
</div> | </div> | ||||
@@ -35,8 +35,8 @@ | |||||
http://www.planningalerts.com/api.php?<strong>call</strong>=point<br/>&<strong>lat</strong>=[some latitude]&<strong>lng</strong>=[some longitude]<strong>area_size</strong>=['s' 'm' or 'l'] | http://www.planningalerts.com/api.php?<strong>call</strong>=point<br/>&<strong>lat</strong>=[some latitude]&<strong>lng</strong>=[some longitude]<strong>area_size</strong>=['s' 'm' or 'l'] | ||||
</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=point&lat=51.52277&lng=-0.067281&area_size=l">view example</a> | |||||
<a href="http://maps.google.com/maps?f=q&hl=en&q=http://www.planningalerts.com/api.php%3Fcall%3Dpoint%26lat%3D51.52277%26lng%3D-0.067281%26area_size%3Dl&layer=&ie=UTF8&z=13&om=1">view on a map</a> | |||||
</p> | </p> | ||||
</div> | </div> | ||||
@@ -50,8 +50,8 @@ | |||||
http://www.planningalerts.com/api.php?<strong>call</strong>=pointos<br/>&<strong>easting</strong>=[some easting]&<strong>northing</strong>=[some northing]<strong>area_size</strong>=['s' 'm' or 'l'] | http://www.planningalerts.com/api.php?<strong>call</strong>=pointos<br/>&<strong>easting</strong>=[some easting]&<strong>northing</strong>=[some northing]<strong>area_size</strong>=['s' 'm' or 'l'] | ||||
</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=pointos&easting=383480&northing=398000&area_size=m">view example</a> | |||||
<a href="http://maps.google.com/maps?f=q&hl=en&q=http://www.planningalerts.com/api.php%3Fcall%3Dpointos%26easting%3D383480%26northing%3D398000%26area_size%3Dm&layer=&ie=UTF8&z=15&om=1">view on a map</a> | |||||
</p> | </p> | ||||
</div> | </div> | ||||