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

'; -echo '
    '; +// change date/time/service_period +echo '
      '; $url = $APIurl."/json/stoptrips?stop=".$_REQUEST['stopid']."&time=".midnight_seconds()."&service_period=".service_period(); $trips = json_decode(getPage($url)); +debug(print_r($trips,true)); foreach ($trips as $row) { echo '
    • '; --- a/busui/stopList.php +++ b/busui/stopList.php @@ -4,27 +4,41 @@ echo' '; -echo '
        '; + + echo '
        Go to letter: '; +foreach(range('A','Z') as $letter) +{ + echo "$letter "; +} +echo "
        + "; +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"; $contents = json_decode(getPage($url)); +debug(print_r($contents,true)); 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 +// Sort the stops by name array_multisort($stopName, SORT_ASC, $contents); +$firstletter = ""; foreach ($contents as $row) { - + if (substr($row[1],0,1) != $firstletter){ + echo ""; + $firstletter = substr($row[1],0,1); + } echo '
        • '.$row[1].'
        • '; } echo '
        '; --- a/busui/trip.php +++ b/busui/trip.php @@ -4,6 +4,7 @@ if ($_REQUEST['routeid']) { $url = $APIurl."/json/routetrips?route_id=".$_REQUEST['routeid']; $trips = json_decode(getPage($url)); +debug(print_r($trips,true)); foreach ($trips as $trip) { if ($trip[0] < midnight_seconds()) { @@ -15,14 +16,15 @@ } $url = $APIurl."/json/triprows?trip=".$tripid; $trips = array_flatten(json_decode(getPage($url))); - +debug(print_r($trips,true)); include_header("Stops on ". $trips[1]->route_short_name . ' '. $trips[1]->route_long_name); -echo '
          '; +echo '
            '; $url = $APIurl."/json/tripstoptimes?trip=".$tripid; $json = json_decode(getPage($url)); +debug(print_r($json,true)); $stops = $json[0]; $times = $json[1]; foreach ($stops as $key => $row) --- a/busui/tripPlanner.php +++ b/busui/tripPlanner.php @@ -1,6 +1,6 @@ +