--- a/stop.php +++ b/stop.php @@ -43,16 +43,12 @@ } $stop = $stops[0]; $stopid = $stops[0]["stop_id"]; - $stopLinks.= "Individual stop pages: "; + $stopLinks.= "Individual stop pages:
"; foreach ($stops as $key => $sub_stop) { - // $stopNames[$key] = $sub_stop[1] . ' Stop #' . ($key + 1); - if (strpos($stop["stop_name"], "Station")) { - $stopNames[$key] = 'Platform ' . ($key + 1); - $stopLinks.= '' . $sub_stop["stop_name"] . ' '; - } else { - $stopNames[$key] = '#' . ($key + 1); - $stopLinks.= '' . $sub_stop["stop_name"] . ' Stop #' . ($key + 1) . ' '; - } + + $stopNames[$key] = $sub_stop["stop_name"]; + $stopLinks.= '' . $sub_stop["stop_name"] . ' '; + $stopPositions[$key] = Array( $sub_stop["stop_lat"], $sub_stop["stop_lon"] @@ -102,12 +98,14 @@ // time settings echo '
-

Change Time (' . (isset($_SESSION['time']) ? $_SESSION['time'] : "Current Time,") . ' ' . ucwords(service_period()) . ')...

-
+

Change Time (' . (isset($_REQUEST['time']) ? $_REQUEST['time'] : "Current Time,") . ' ' . ucwords(service_period()) . ')...

+ + +
- + Current Time?
@@ -132,19 +130,45 @@ } else { $trips = getStopTripsWithTimes($stopid); } +echo "
"; +// later/earlier button setup +if (sizeof($trips) == 0) { + $time = isset($_REQUEST['time']) ? strtotime($_REQUEST['time']) : time(); + $earlierTime = $time - (90 * 60); + $laterTime = $time + (90 * 60); +} else { + $earlierTime = strtotime($trips[0]['arrival_time']) - (90 * 60); + $laterTime = strtotime($trips[sizeof($trips) - 1]['arrival_time']) - 60; +} +if (sizeof($stopids) > 0) { + $stopidurl = "stopids=" . implode(",", $stopids); +} else { + $stopidurl = "stopid=$stopid"; +} +if (sizeof($trips) > 10) { + echo 'Later Trips'; +} +echo 'Earlier Trips'; +echo "
"; if (sizeof($trips) == 0) { echo "
  • No trips in the near future.
  • "; } else { foreach ($trips as $trip) { echo '
  • '; - echo '

    ' . $trip['route_short_name'] . " " . $trip['route_long_name'] . "

    "; + + $destination = getTripDestination($trip['trip_id']); + echo '

    ' . $trip['route_short_name'] . " towards " . $destination['stop_name'] . "

    "; $viaPoints = viaPointNames($trip['trip_id'], $trip['stop_sequence']); if ($viaPoints != "") echo '
    Via: ' . $viaPoints . ''; if (sizeof($tripStopNumbers) > 0) { echo '
    Boarding At: '; - foreach ($tripStopNumbers[$trip['trip_id']] as $key) { - echo $stopNames[$key] . ' '; + if (sizeof($tripStopNumbers[$trip['trip_id']]) == sizeof($stopids)) { + echo "All Stops"; + } else { + foreach ($tripStopNumbers[$trip['trip_id']] as $key) { + echo $stopNames[$key] . ', '; + } } echo ''; }