--- a/include/common-template.inc.php
+++ b/include/common-template.inc.php
@@ -1,4 +1,20 @@
-
+
-
+ echo '
';
+ echo '
Back
-
' . $pageTitle . '
-
Home
+
' . $pageTitle . '
+
Home
';
- $overrides = getServiceOverride();
- if ($overrides['service_id']) {
- if ($overrides['service_id'] == "noservice") {
- echo '
';
- } else {
- echo '
';
- }
- }
- if ($GTFSREnabled) {
- $serviceAlerts = getServiceAlertsAsArray("agency", "0");
- foreach ($serviceAlerts['entity'] as $entity) {
- echo "
" . date("F j, g:i a", strtotime($entity['alert']['active_period'][0]['start'])) . " to " . date("F j, g:i a", strtotime($entity['alert']['active_period'][0]['end'])) . "{$entity['alert']['header_text']['translation'][0]['text']}
Warning: {$entity['alert']['description_text']['translation'][0]['text']}
-
Source ";
+ } else {
+ echo '
';
+ }
+ }
+ $serviceAlerts = Array();
+ $globalAlerts = getServiceAlertsAsArray("agency", "0");
+ if ($globalAlerts != null) {
+ // echo "getting alerts due to network wide";
+ $serviceAlerts = array_merge($serviceAlerts, $globalAlerts);
+ }
+ if (isset($stopid)) {
+ $stopAlerts = getServiceAlertsAsArray("stop", $stopid);
+ if ($stopAlerts != null) {
+ // echo "getting alerts due to stop $stopid";
+ $serviceAlerts = array_merge($serviceAlerts, $stopAlerts);
+ }
+ }
+ if (isset($routeid)) {
+ $routeAlerts = getServiceAlertsAsArray("route", $routeid);
+ if ($routeAlerts != null) {
+ // echo "getting alerts due to route $routeid";
+ $serviceAlerts = array_merge($serviceAlerts, $routeAlerts);
+ }
+ }
+ if (isset($serviceAlerts['entity']) && sizeof($serviceAlerts['entity']) > 0) {
+ foreach ($serviceAlerts['entity'] as $entity) {
+ echo "
{$entity['alert']['header_text']['translation'][0]['text']} "
+ . date("F jS Y, g:i a", $entity['alert']['active_period'][0]['start']) . " to "
+ . date("F jS Y, g:i a", $entity['alert']['active_period'][0]['end']) . "
+
Warning: {$entity['alert']['description_text']['translation'][0]['text']}
+
Source ";
+ }
}
}
}
@@ -174,7 +215,8 @@
function include_footer() {
global $basePath;
echo '';
+ echo '
+
This work is licensed under a Creative Commons Attribution 3.0 Australia License.';
if (isAnalyticsOn()) {
echo "";
$googleAnalyticsImageUrl = googleAnalyticsGetImageUrl();
- echo '
';
+ echo '
';
}
echo "\n
";
}
+function timeSettings() {
+ global $service_periods;
+ echo '
+
Change Time (' . (isset($_REQUEST['time']) ? $_REQUEST['time'] : "Current Time,") . ' ' . ucwords(service_period()) . ')...
+
+
';
+}
+
function placeSettings() {
- global $service_periods;
+
$geoerror = false;
$geoerror = !isset($_SESSION['lat']) || !isset($_SESSION['lat']) || $_SESSION['lat'] == "" || $_SESSION['lon'] == "";
@@ -222,5 +294,36 @@
}
}
-?>
-
+//stop list collapsing
+function stopCompare($stopName) {
+ return substr(trim(preg_replace("/\(Platform.*/", "", $stopName)), 0, 9);
+}
+
+function stopGroupTitle($stopName, $stopdesc) {
+ if (preg_match("/Dr |Cct |Cir |Av |St |Cr |Parade |Way |Bank /", $stopName)) {
+ $descParts = explode("
", $stopdesc);
+ return trim(str_replace("Street: ", "", $descParts[0]));
+ } else {
+ return trim(preg_replace("/\(Platform.*/", "", $stopName));
+ }
+}
+
+function viaPointNames($tripid, $stop_sequence = "") {
+ $viaPointNames = Array();
+ foreach (viaPoints($tripid, $stop_sequence) as $point) {
+ if (strstr($point['stop_name'], "Station")
+ || strstr($point['stop_name'], "Shops")
+ || strstr($point['stop_name'], "CIT")
+ || strstr($point['stop_name'], "School")
+ || strstr($point['stop_name'], "University")
+ ) {
+ $viaPointNames[] = $point['stop_name'];
+ }
+ }
+ if (sizeof($viaPointNames) > 0) {
+ return r_implode(", ", $viaPointNames);
+ } else {
+ return "";
+ }
+}
+