From: maxious Date: Tue, 11 Oct 2011 08:40:07 +0000 Subject: Convert myway timeliness visualisations to new GTFS feed X-Git-Url: http://maxious.lambdacomplex.org/git/?p=busui.git&a=commitdiff&h=655b27a03981e120a52235ec7127943d37e7c5a3 --- Convert myway timeliness visualisations to new GTFS feed --- --- a/include/common.inc.php +++ b/include/common.inc.php @@ -57,7 +57,7 @@ function isDebugServer() { return php_sapi_name() == "cli" || isset($_SERVER['SERVER_NAME']) && ( $_SERVER['SERVER_NAME'] == "azusa" || $_SERVER['SERVER_NAME'] == "vanille" - || $_SERVER['SERVER_NAME'] == "localhost" || $_SERVER['SERVER_NAME'] == "127.0.0.1"); + || $_SERVER['SERVER_NAME'] == "localhost" || $_SERVER['SERVER_NAME'] == "127.0.0.1" || $_SERVER['SERVER_NAME'] == "192.168.1.8"); } include_once ("common-geo.inc.php"); --- a/include/db/route-dao.inc.php +++ b/include/db/route-dao.inc.php @@ -29,7 +29,19 @@ } return $query->fetch(PDO :: FETCH_ASSOC); } - +function getRoutesByShortName($routeShortName) { + global $conn; + $query = "Select * from routes where route_short_name = :routeShortName"; + debug($query, "database"); + $query = $conn->prepare($query); + $query->bindParam(":routeShortName", $routeShortName); + $query->execute(); + if (!$query) { + databaseError($conn->errorInfo()); + return Array(); + } + return $query->fetchAll(); +} function getRouteByFullName($routeFullName) { global $conn; $query = "Select * from routes where route_short_name||route_long_name = :routeFullName LIMIT 1"; --- a/include/db/stop-dao.inc.php +++ b/include/db/stop-dao.inc.php @@ -139,9 +139,9 @@ } function getStopRoutes($stopID, $service_period) { - if ($service_period == "") + if ($service_period == "") { $service_period = service_period(); - + } $service_ids = service_ids($service_period); $sidA = $service_ids[0]; $sidB = $service_ids[1]; @@ -164,9 +164,11 @@ } function getStopTrips($stopID, $service_period = "", $afterTime = "", $limit = "") { - if ($service_period == "") + if ($service_period == "") { $service_period = service_period(); + } $service_ids = service_ids($service_period); + $sidA = $service_ids[0]; $sidB = $service_ids[1]; if ($limit != "") --- a/index.php +++ b/index.php @@ -26,8 +26,7 @@ Launch Trip Planner... --- a/myway/index.php +++ b/myway/index.php @@ -16,7 +16,7 @@ */ include ('../include/common.inc.php'); -include_header("Busness R&D", "index"); +include_header("MyWay Balance and Timeliness Survey Results", "index"); if ($_SESSION['authed'] == true) { echo '