From: Maxious Date: Thu, 19 Apr 2012 07:44:05 +0000 Subject: OTP changes X-Git-Url: https://maxious.lambdacomplex.org/git/?p=busui.git&a=commitdiff&h=3f70f54c530fc56c8c02a5711a0f87db98ebc13d --- OTP changes --- --- a/include/common.inc.php +++ b/include/common.inc.php @@ -21,28 +21,14 @@ 'session', 'json', 'phperror', - 'awsotp', - //'squallotp', - //'vanilleotp', 'database', 'other' ); $GTFSREnabled = true; $cloudmadeAPIkey = 'daa03470bb8740298d4b10e3f03d63e6'; $googleMapsAPIkey = 'ABQIAAAA95XYXN0cki3Yj_Sb71CFvBTPaLd08ONybQDjcH_VdYtHHLgZvRTw2INzI_m17_IoOUqH3RNNmlTk1Q'; -$otpAPIurl = 'http://localhost:8080/opentripplanner-api-webapp/'; -if (isDebug('awsotp') || php_uname('n') == 'maxious.xen.prgmr.com' || strstr(php_uname('n'),'actbus')) { - $otpAPIurl = 'http://bus-main.lambdacomplex.org:8080/opentripplanner-api-webapp/'; -} -if (isDebug('dotcloudotp') || php_uname('n') == 'actbus-www') { - $otpAPIurl = 'http://otp.actbus.dotcloud.com/opentripplanner-api-webapp/'; -} -if (isDebug('squallotp')) { - $otpAPIurl = 'http://10.0.1.108:5080/opentripplanner-api-webapp/'; -} -if (isDebug('vanilleotp')) { - $otpAPIurl = 'http://10.0.1.135:8080/opentripplanner-api-webapp/'; -} +$otpAPIurl = 'http://localhost:9080/opentripplanner-api-webapp/'; + if (isDebug('phperror')) error_reporting(E_ALL ^ E_NOTICE); --- 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 '
'; @@ -177,6 +181,7 @@ echo "
"; } else { processItinerary(0, $tripplan->plan->itineraries->itinerary); + } } } curl_close($ch);