summaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
authorars <asav1410@gmail.com>2020-10-13 10:46:30 +0100
committerars <asav1410@gmail.com>2020-10-13 10:46:30 +0100
commit62cc7a0427686277797e1fe7db12d89f38d3f9ae (patch)
treed58b6e9d0cbcf16b4c20c87bdbdbdb62d10a3bb2 /index.php
parent15769149ee4b12f69543c78045c6ca2a372a18a1 (diff)
Fix line breaks between | and above table. Don't show service updates on home page when there aren't any. Add link to home.
Diffstat (limited to 'index.php')
-rw-r--r--index.php13
1 files 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 '<a href="index.php">Home</a>';
$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 '<br><table align="left" border="1" cellpadding="3" style="background-color: #039DFF;"><tr><td>Friday Only</td><tr><table><br>';
+ echo '<table align="left" border="1" cellpadding="3" style="background-color: #039DFF;"><tr><td>Friday Only</td><tr><table>';
// 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 '&nbsp;';
echo '<h3>' . ucfirst($direction) . ' | ' . $displayDay . '</h3>';
echo '<table align="left" border="1" cellpadding="3" width="100%">';
// search for $stopList['stop_name'] in each trip and print time in row on table
@@ -149,9 +150,11 @@ else {
} else {
echo '<h3>' . $meta['name']. ' | ' . $meta['from'] . ' - ' . $meta['to'] . '</h3>';
}
- echo '<h4>Service Updates:</h4><p>';
- foreach ($servUpdates as $update) {
- echo $update['content'] . '- <b>Affected Routes: </b>' . implode(", ",$update['services']) . '<br><br>';
+ if (!empty($routeUpdates)) {
+ echo '<h4>Service Updates:</h4><p>';
+ foreach ($servUpdates as $update) {
+ echo $update['content'] . '- <b>Affected Routes: </b>' . implode(", ",$update['services']) . '<br><br>';
+ }
}
foreach ($routes as $route) {
echo '<h4><a href="index.php?route=' . $route['service_number'] . '">' . $route['service_number'] . ' - ' . $route['service_name'] . '</a></h4>';