--- a/busui/stopList.php
+++ b/busui/stopList.php
@@ -4,12 +4,22 @@
echo'
';
-
+// By suburb
+if (isset($_REQUEST['suburbs'])) {
+ echo ' ';
+ foreach ($suburbs as $suburb) {
+ echo '- '.$suburb.'
';
+ }
+echo '
';
+} else {
+// Timing Points / All stops
echo ' Go to letter: ';
foreach(range('A','Z') as $letter)
{
@@ -22,7 +32,8 @@
echo '
';
$url = $APIurl."/json/timingpoints";
if ($_REQUEST['allstops']) $url = $APIurl."/json/stops";
-if ($_REQUEST['lat'] && $_REQUEST['lon']) $url = $APIurl."/json/neareststops?lat={$_REQUEST['lat']}&lon={$_REQUEST['lon']}&limit=15";
+if ($_REQUEST['nearby']) $url = $APIurl."/json/neareststops?lat={$_REQUEST['lat']}&lon={$_REQUEST['lon']}&limit=15";
+if ($_REQUEST['suburb']) $url = $APIurl."/json/stopzonesearch?q={$_REQUEST['suburb']}";
$contents = json_decode(getPage($url));
debug(print_r($contents,true));
foreach ($contents as $key => $row) {
@@ -39,10 +50,10 @@
echo "";
$firstletter = substr($row[1],0,1);
}
- echo '- '.$row[1].'
';
+ echo '- '.bracketsMeanNewLine($row[1]).'
';
}
echo '
';
-
+}
include_footer();
?>