From 62cc7a0427686277797e1fe7db12d89f38d3f9ae Mon Sep 17 00:00:00 2001 From: ars Date: Tue, 13 Oct 2020 10:46:30 +0100 Subject: Fix line breaks between | and above table. Don't show service updates on home page when there aren't any. Add link to home. --- index.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/index.php b/index.php index 1fed29c..ac19989 100644 --- a/index.php +++ b/index.php @@ -60,6 +60,7 @@ function cmp($a, $b) { $servUpdates = getData('service', false, false, false); if (isset($_GET['route'])) { + echo 'Home'; $route = $_GET['route']; $days = array('mon_fri', 'sat', 'sun'); $directions = array('outbound', 'inbound'); @@ -81,7 +82,7 @@ if (isset($_GET['route'])) { } //print friday only gmp_legend - echo '
Friday Only

'; + echo '
Friday Only
'; // print timetables foreach ($days as $day) { @@ -108,7 +109,7 @@ if (isset($_GET['route'])) { usort($stopList,"cmp"); $trips = getData('trips', $route, $direction, $day); // print timetable info while setting display friendly case for directions - // TODO: add linebreaks between end of table and next table title + echo ' '; echo '

' . ucfirst($direction) . ' | ' . $displayDay . '

'; echo '
'; // search for $stopList['stop_name'] in each trip and print time in row on table @@ -149,9 +150,11 @@ else { } else { echo '

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

'; } - echo '

Service Updates:

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

'; + if (!empty($routeUpdates)) { + echo '

Service Updates:

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

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

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

'; -- cgit v1.2.3