--- a/trip.php
+++ b/trip.php
@@ -24,7 +24,6 @@
$trip = getTrip($tripid);
$routeid = $trip["route_id"];
}
-
include_header("Stops on " . $trip['route_short_name'] . ' ' . $trip['route_long_name'], "trip");
trackEvent("Route/Trip View", "View Route", $trip['route_short_name'] . ' ' . $trip['route_long_name'], $routeid);
echo '';
@@ -66,13 +65,12 @@
echo "";
echo ' ';
$stopsGrouped = Array();
-$tripStopTimes = getTimeInterpolatedTrip($tripid);
+$tripStopTimes = getTripStopTimes($tripid);
echo '- ' . $tripStopTimes[0]['arrival_time'] . ' to ' . $tripStopTimes[sizeof($tripStopTimes) - 1]['arrival_time'] . ' ' . $trip['route_long_name'] . ' (' . ucwords($tripStopTimes[0]['service_id']) . ')
';
foreach ($tripStopTimes as $key => $tripStopTime) {
- if ($key + 1 > sizeof($tripStopTimes) || ($tripStopTimes[$key]["stop_name"] != $tripStopTimes[$key + 1]["stop_name"])) {
+ if ($key + 1 > sizeof($tripStopTimes) || stopCompare($tripStopTimes[$key]["stop_name"]) != stopCompare($tripStopTimes[$key + 1]["stop_name"])) {
echo '- ';
- if (!startsWith($tripStopTime['stop_code'], "Wj"))
- echo '';
+
if (sizeof($stopsGrouped) > 0) {
// print and empty grouped stops
// subsequent duplicates
@@ -84,7 +82,8 @@
echo '
' . distance($tripStopTime['stop_lat'], $tripStopTime['stop_lon'], $_SESSION['lat'], $_SESSION['lon'], true) . 'm away';
}
echo '
';
- echo bracketsMeanNewLine($tripStopTime["stop_name"]);
+ echo stopGroupTitle($tripStopTime['stop_name'],$tripStopTime['stop_desc']) . '
' . sizeof($stopsGrouped["stop_ids"]) . ' stops';
+
echo '';
flush();
@ob_flush();
@@ -97,17 +96,17 @@
echo '
' . distance($tripStopTime['stop_lat'], $tripStopTime['stop_lon'], $_SESSION['lat'], $_SESSION['lon'], true) . 'm away';
}
echo '';
- echo bracketsMeanNewLine($tripStopTime['stop_name']);
+ echo $tripStopTime['stop_name'];
echo '';
flush();
@ob_flush();
}
} else {
// this is a duplicated line item
- if ($key - 1 <= 0 || ($tripStopTimes[$key]['stop_name'] != $tripStopTimes[$key - 1]['stop_name'])) {
+ if ($key - 1 <= 0 || stopCompare($tripStopTimes[$key]['stop_name']) != stopCompare($tripStopTimes[$key - 1]['stop_name'])) {
// first duplicate
$stopsGrouped = Array(
- "name" => $tripStopTime['stop_name'],
+ "name" => trim(preg_replace("/\(Platform.*/", "", $stop['stop_name'])),
"startTime" => $tripStopTime['arrival_time'],
"stop_ids" => Array(
$tripStopTime['stop_id']