--- a/routeList.php +++ b/routeList.php @@ -32,62 +32,62 @@ echo ''; } else if ($_REQUEST['nearby'] || $_REQUEST['suburb']) { + $routes = Array(); if ($_REQUEST['suburb']) { $suburb = filter_var($_REQUEST['suburb'], FILTER_SANITIZE_STRING); - $url = $APIurl . "/json/stopzonesearch?q=" . $suburb; - include_header("Routes by Suburb", "routeList"); - trackEvent("Route Lists", "Routes By Suburb", $suburb); + include_header($suburb ." - ".ucwords(service_period()), "routeList"); + navbar(); + timePlaceSettings(); + trackEvent("Route Lists", "Routes By Suburb", $suburb); + $routes = getRoutesBySuburb($suburb); + } if ($_REQUEST['nearby']) { - $url = $APIurl . "/json/neareststops?lat={$_SESSION['lat']}&lon={$_SESSION['lon']}&limit=15"; include_header("Routes Nearby", "routeList", true, true); - timePlaceSettings(true); + trackEvent("Route Lists", "Routes Nearby", $_SESSION['lat'].",".$_SESSION['lon']); + navbar(); + timePlaceSettings(true); if (!isset($_SESSION['lat']) || !isset($_SESSION['lat']) || $_SESSION['lat'] == "" || $_SESSION['lon'] == "") { include_footer(); die(); } + $routes = getRoutesNearby($_SESSION['lat'],$_SESSION['lon']); } - $stops = json_decode(getPage($url)); - $routes = Array(); - foreach ($stops as $stop) { - $url = $APIurl . "/json/stoproutes?stop=" . $stop[0]; - $stoproutes = json_decode(getPage($url)); - foreach ($stoproutes as $route) { - if (!isset($routes[$route[0]])) $routes[$route[0]] = $route; + + echo '