--- a/include/common-template.inc.php
+++ b/include/common-template.inc.php
@@ -1,138 +1,135 @@
-
+
-
-
-
' . $pageTitle . '
+ if ($opendiv) {
+ echo '
';
+ echo '
';
- }
-}
-function include_footer()
-{
- echo '';
- if (isAnalyticsOn()) {
- echo "";
- $googleAnalyticsImageUrl = googleAnalyticsGetImageUrl();
- echo '
';
- }
-}
-function timePlaceSettings($geolocate = false)
-{
- global $service_periods;
- $geoerror = false;
- if ($geolocate == true) {
- $geoerror = !isset($_SESSION['lat']) || !isset($_SESSION['lat']) || $_SESSION['lat'] == "" || $_SESSION['lon'] == "";
- }
- if ($geoerror) {
- echo '
Sorry, but your location could not currently be detected.
+ $googleAnalyticsImageUrl = googleAnalyticsGetImageUrl();
+ echo '
';
+ }
+ echo "\n
";
+}
+
+function timeSettings() {
+ global $service_periods;
+ echo '
+
Change Time (' . (isset($_REQUEST['time']) ? $_REQUEST['time'] : "Current Time,") . ' ' . ucwords(service_period()) . ')...
+
+
';
+}
+
+function placeSettings() {
+
+ $geoerror = false;
+ $geoerror = !isset($_SESSION['lat']) || !isset($_SESSION['lat']) || $_SESSION['lat'] == "" || $_SESSION['lon'] == "";
+
+ echo '
';
+ if ($geoerror) {
+ echo 'Sorry, but your location could not currently be detected.
Please allow location permission, wait for your location to be detected,
- or enter an address/co-ordinates in the box below.
';
- }
- echo '
-
Change Time/Place (' . (isset($_SESSION['time']) ? $_SESSION['time'] : "Current Time,") . ' ' . ucwords(service_period()) . ')...
- ';
+ echo '
';
-}
-function trackEvent($category, $action, $label = "", $value = -1) {
- if (isAnalyticsOn()) {
- echo "";
- }
-}
-?>
-
+
+
';
+}
+
+function trackEvent($category, $action, $label = "", $value = - 1) {
+ if (isAnalyticsOn()) {
+ echo "\n";
+ }
+}
+
+//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 "";
+ }
+}
+