'; echo $stopLinks; if (sizeof($stops) > 0) { - echo '

' . staticmap($stopPositions) . '

'; -} else { - echo '

' . staticmap(Array( - 0 => Array( - $stop[2], - $stop[3] - ) -)) . '

'; + echo '

' . staticmap($stopPositions) . '

'; +} +else { + echo '

' . staticmap(Array( + 0 => Array( + $stop[2], + $stop[3] + ) + )) . '

'; } echo '
    '; -$url = $APIurl . "/json/stoptrips?stop=" . $stopid . "&time=" . midnight_seconds() . "&service_period=" . service_period(); -$trips = json_decode(getPage($url)); +if (sizeof($allStopsTrips) > 0) { + $trips = $allStopsTrips; +} +else { + $url = $APIurl . "/json/stoptrips?stop=" . $stopid . "&time=" . midnight_seconds() . "&service_period=" . service_period(); + $trips = json_decode(getPage($url)); +} foreach ($trips as $row) { echo '
  • '; echo '

    ' . $row[1][1]; if (isFastDevice()) { $viaPoints = viaPointNames($row[1][0], $stopid); - if ($viaPoints != "") echo '
    Via: ' . $viaPoints . '

    '; + if ($viaPoints != "") echo '
    Via: ' . $viaPoints . ''; } + if (sizeof($tripStopNumbers) > 0) { + echo '
    Boarding At: '; + foreach ($tripStopNumbers[$row[1][0]] as $key) { + echo $stopNames[$key] .' '; + } + echo ''; + } + echo ''; echo '

    ' . midnight_seconds_to_time($row[0]) . '

    '; echo '
  • '; } --- a/stopList.php +++ b/stopList.php @@ -1,5 +1,8 @@ '; foreach ($suburbs as $suburb) { - echo '
  • ' . $suburb . '
  • '; + if (!isset($_REQUEST['firstLetter'])) { + foreach (range('A', 'Z') as $letter) { + echo "
  • $letter...
  • \n"; + } + } + else if (startsWith($suburb, $_REQUEST['firstLetter'])) { + echo '
  • ' . $suburb . '
  • '; + } } echo '
'; } else { // Timing Points / All stops if ($_REQUEST['allstops']) { + $listType = 'allstops=yes'; $url = $APIurl . "/json/stops"; include_header("All Stops", "stopList"); navbar(); timePlaceSettings(); } else if ($_REQUEST['nearby']) { + $listType = 'nearby=yes'; $url = $APIurl . "/json/neareststops?lat={$_SESSION['lat']}&lon={$_SESSION['lon']}&limit=15"; include_header("Nearby Stops", "stopList"); navbar(); @@ -39,6 +51,7 @@ } else if ($_REQUEST['suburb']) { $suburb = filter_var($_REQUEST['suburb'], FILTER_SANITIZE_STRING); + $listType = "suburb=$suburb"; $url = $APIurl . "/json/stopzonesearch?q=" . $suburb; include_header("Stops in " . ucwords($suburb) , "stopList"); if (isMetricsOn()) { @@ -63,73 +76,76 @@ navbar(); timePlaceSettings(); } - echo '
Go to letter: '; - foreach (range('A', 'Z') as $letter) { - echo "$letter "; - } - echo "
- "; echo ' '; + var_dump ($stopsGrouped); } include_footer(); ?>