--- a/busui/stopList.php +++ b/busui/stopList.php @@ -1,23 +1,35 @@ -
-
-

GET Example

- AJAX -
-
- This page was loaded via AJAX. -
- -
-
-
-

Events test

- AJAX - Home -
-
- This is a test of live events. -
-
+'; +$url = $APIurl."/json/stops"; +if ($_REQUEST['lat'] && $_REQUEST['lon']) $url = $APIurl."/json/neareststops?lat={$_REQUEST['lat']}&lon={$_REQUEST['lon']}&limit=15"; +$contents = json_decode(getPage($url)); +foreach ($contents as $key => $row) { + $stopName[$key] = $row[1]; +} +// Sort the data with volume descending, edition ascending +// Add $data as the last parameter, to sort by the common key +array_multisort($stopName, SORT_ASC, $contents); + +foreach ($contents as $row) +{ + + echo '
  • '.$row[1].'
  • '; + } +echo ''; +/* +
    +
    + +
    +*/ +include_footer(); +?> + +