From: maxious Date: Fri, 15 Apr 2011 14:08:30 +0000 Subject: Service warnings for changed timetable days X-Git-Url: http://maxious.lambdacomplex.org/git/?p=busui.git&a=commitdiff&h=a0bda5d898199a4d51fd890589fa3d284a72ba43 --- Service warnings for changed timetable days --- --- a/feedback.php +++ b/feedback.php @@ -48,7 +48,7 @@ if you click on feedback from a stop page, these will get filled in automatically. else describe the location/street of the stop in one of these boxes
Suggested Stop Location (lat/long or words):
- if your device supports javascript, you can pick a location from the map above
+ --- a/include/common-template.inc.php +++ b/include/common-template.inc.php @@ -74,14 +74,14 @@ .ui-listview-filter { margin: 0 !important; } - .ui-icon-navigation { + .ui-icon-navigation { background-image: url(css/images/113-navigation.png); background-position: 1px 0; } - .ui-icon-beaker { + .ui-icon-beaker { background-image: url(css/images/91-beaker-2.png); background-position: 1px 0; - } + } #footer { text-size: 0.75em; text-align: center; @@ -102,6 +102,14 @@ #extrainfo { visibility: hidden; display: none; + } + #servicewarning { + padding: 1em; + margin-bottom: 0.5em; + text-size: 0.2em; + background-color: #FF9; + -moz-border-radius: 15px; +border-radius: 15px; } // source http://webaim.org/techniques/skipnav/ #skip a, #skip a:hover, #skip a:visited @@ -180,6 +188,12 @@
'; + if (!$_SESSION['service_id']) { + $overrides = getServiceOverride(); + if ($overrides['service_id']){ + echo '
Buses are running on an altered timetable today due to industrial action/public holiday. See http://www.action.act.gov.au for details.
'; + } + } } } function include_footer() --- a/include/common-transit.inc.php +++ b/include/common-transit.inc.php @@ -4,9 +4,26 @@ 'saturday', 'weekday' ); +function getServiceOverride() { + global $conn; + $query = "Select * from calendar_dates where date = '".date("Ymd")."' and exception_type = '1'"; + debug($query,"database"); + $result = pg_query($conn, $query); + if (!$result) { + databaseError(pg_result_error($result)); + return Array(); + } + return pg_fetch_assoc($result); +} function service_period() { + if (isset($_SESSION['service_period'])) return $_SESSION['service_period']; + $override = getServiceOverride(); + if ($override['service_id']){ + return $override['service_id']; + } + switch (date('w')) { case 0: return 'sunday'; --- a/readme.txt +++ b/readme.txt @@ -5,10 +5,19 @@ Uses jQuery Mobile, PHP, PostgreSQL, OpenTripPlanner, OpenLayers, OpenStreetMap, Cloudmade Geocoder and Tile Service -See aws/awsStartup.sh for example startup steps +See aws/awsStartup.sh for example startup steps. You need to load the included database dump; +for other transit networks you can use the updatedb.php script to load. -For static maps, may have to do +For openstreetmap static maps, may have to do /usr/sbin/setsebool -P httpd_can_network_connect=1 -on fedora +on Fedora and other SELinux systems. + +To enter a service override, you can use the psql tool. eg. +transitdata=# COPY calendar_dates (service_id, date, exception_type) FROM stdin; +Enter data to be copied [spaced with tabs] followed by a newline. +End with a backslash and a period on a line by itself. +>> saturday 20110416 2 +>> sunday 20110416 1 +>> \.