--- a/tripPlanner.php
+++ b/tripPlanner.php
@@ -167,7 +167,11 @@
trackEvent("Trip Planner", "Plan Trip To", $to);
$tripplan = json_decode($page);
debug(print_r($tripplan, true));
+ if (isset ($tripplan->error->msg)) {
+ echo $tripplan->error->msg;
+ } else {
echo "
From: {$tripplan->plan->from->name} To: {$tripplan->plan->to->name}
";
+ echo $tripplan->plan->date;
echo " At: " . formatTime($tripplan->plan->date) . "
";
if (is_array($tripplan->plan->itineraries->itinerary)) {
echo '';
@@ -178,11 +182,104 @@
} else {
processItinerary(0, $tripplan->plan->itineraries->itinerary);
}
+ }
}
curl_close($ch);
}
} else {
+ $overrides = getServiceOverride();
+ if (isset($overrides['service_id'])) {
+ echo "Sorry, due to the modified timetable, this trip planner won't work correctly today. Instead, use the Google Maps one below:";
+ echo '
+
+
+
+
+
+';
+ } else {
tripPlanForm();
+ }
}
include_footer();
?>