--- a/stop.php +++ b/stop.php @@ -98,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?
@@ -128,13 +130,33 @@ } 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 '
  • '; - - $destination = getTripDestination($trip['trip_id']); + + $destination = getTripDestination($trip['trip_id']); echo '

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

    "; $viaPoints = viaPointNames($trip['trip_id'], $trip['stop_sequence']); if ($viaPoints != "")