--- a/include/common-template.inc.php +++ b/include/common-template.inc.php @@ -25,7 +25,7 @@ } function include_header($pageTitle, $pageType, $opendiv = true, $geolocate = false, $datepicker = false) { - global $labsPath; + global $labsPath,$serviceAlertsEnabled; echo ' @@ -98,8 +98,11 @@ function success(position) { $('#error').val('Location now detected. Please wait for data to load.'); $('#geolocate').val(position.coords.latitude+','+position.coords.longitude); -$.ajax({ url: \"include/common.inc.php?geolocate=yes&lat=\"+position.coords.latitude+\"&lon=\"+position.coords.longitude }); -location.reload(true); +$.ajax({ async: false, +success: function(){ + location.reload(true); + }, +url: \"include/common.inc.php?geolocate=yes&lat=\"+position.coords.latitude+\"&lon=\"+position.coords.longitude }); } function error(msg) { $('#error').val('Error: '+msg); @@ -156,6 +159,13 @@ echo '
Buses are running on an altered timetable today due to industrial action/public holiday. See http://www.action.act.gov.au for details.
'; } } + if ($serviceAlertsEnabled) { + $serviceAlerts = getServiceAlerts("network","network"); + foreach ($serviceAlerts['entities'] as $entity) { + echo "
".date("F j, g:i a",strtotime($entity['alert']['active_period']['start']))." to ". date("F j, g:i a", strtotime($entity['alert']['active_period']['end']))."
Warning: {$entity['alert']['description']['translation']} +
Source
"; + } + } } } function include_footer()