From 4cc8022c777cc44baf267b3b5ef736953ff90d19 Mon Sep 17 00:00:00 2001 From: ars Date: Sun, 11 Oct 2020 12:00:27 +0100 Subject: Fix typos, adjust comments. --- index.php | 12 ++++++++---- 1 file 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 '
Friday Only

'; // 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 ''; } 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 ''; } @@ -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 '

' . $meta['name']. '

'; } else { echo '

' . $meta['name']. ' | ' . $meta['from'] . ' - ' . $meta['to'] . '

'; } echo '

Service Updates:

'; + // print service updates foreach ($servUpdates as $update) { echo $update['content'] . '- Affected Routes: ' . implode(", ",$update['services']) . '

'; } + // print routes foreach ($routes as $route) { echo '

' . $route['service_number'] . ' - ' . $route['service_name'] . '

'; } -- cgit v1.2.3
' . $stop['departure_time'] . '----