summaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'index.php')
-rw-r--r--index.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/index.php b/index.php
index 1fed29c..24e9d6c 100644
--- a/index.php
+++ b/index.php
@@ -52,7 +52,7 @@ function getData($type, $route, $direction, $day) {
}
}
-// function to $stopList by $stopList['order'] using usort
+// function to sort $stopList by $stopList['order'] using usort
function cmp($a, $b) {
return $a['order'] - $b['order'];
}
@@ -80,7 +80,7 @@ if (isset($_GET['route'])) {
}
}
- //print friday only gmp_legend
+ //print friday only legend
echo '<br><table align="left" border="1" cellpadding="3" style="background-color: #039DFF;"><tr><td>Friday Only</td><tr><table><br>';
// print timetables
@@ -118,7 +118,7 @@ if (isset($_GET['route'])) {
$found=False;
foreach ($trip['stops'] as $stop) {
if ($stop['stop_name'] == $rowStop['stop_name']) {
- // check if bus runs on friday only by checking another day (in this case thursday) and apply custom color to cells
+ // check if bus runs on Friday only by checking another day, in this case Monday, (it doesn't matter which as the only variation is Friday only busses) and apply custom color to cells
if (($day == 'mon_fri') && ($trip['days_of_operation']['mon'] == False)) {
echo '<td class="frionly">' . $stop['departure_time'] . '</td>';
} else {
@@ -127,7 +127,7 @@ if (isset($_GET['route'])) {
$found=True;
}
}
- // print something to show bus doesn't use this stop on this trip e.g. route variation
+ // print something to show bus doesn't use this stop on this trip e.g. during a route variation
if ($found != True) {
echo '<td>----</td>';
}
@@ -143,16 +143,20 @@ if (isset($_GET['route'])) {
// print landing page if no route is selected
else {
$routes = getData('routes', false, false, false);
+ // print timetable season and valid from/to dates
$meta = getData('meta', false, false, false);
+ // sometimes valid from/to dates aren't available so we don't print them
if ($meta['from'] == '-- --- ----') {
echo '<h3>' . $meta['name']. '</h3>';
} else {
echo '<h3>' . $meta['name']. ' | ' . $meta['from'] . ' - ' . $meta['to'] . '</h3>';
}
echo '<h4>Service Updates:</h4><p>';
+ // print service updates
foreach ($servUpdates as $update) {
echo $update['content'] . '- <b>Affected Routes: </b>' . implode(", ",$update['services']) . '<br><br>';
}
+ // print routes
foreach ($routes as $route) {
echo '<h4><a href="index.php?route=' . $route['service_number'] . '">' . $route['service_number'] . ' - ' . $route['service_name'] . '</a></h4>';
}