Add a column that shows the direction of the route when it passes from a stop

This commit is contained in:
George Kaklamanos 2015-07-17 15:15:20 +03:00
parent ceca55c188
commit 59c9a37e91

View file

@ -27,14 +27,15 @@ if (isValidStop($_GET["stop"])){
function PrintRoutes($stp){ function PrintRoutes($stp){
global $routes; global $routes;
echo '<table class="table table-striped table-bordered"><thead><tr>'; echo '<table class="table table-striped table-bordered"><thead><tr>';
echo '<th>Line #</th><th>Route Name</th>'; echo '<th>Line #</th><th>Route Name</th><th>Direction</th>';
echo '</tr></thead><tbody>'; echo '</tr></thead><tbody>';
foreach ($routes as $route){ foreach ($routes as $route){
foreach ($route['stops'] as $direction){ foreach ($route['stops'] as $direction => $stops){
foreach ($direction as $stop){ foreach ($stops as $stop){
if ($stop == $stp){ if ($stop == $stp){
echo '<tr><td>' . $route['line'] . '</td>'; echo '<tr><td>' . $route['line'] . '</td>';
echo '<td><a href="ShowRoute.php?route=' . $route['id'] . '">' . $route['name'] . '</a></td></tr>'; echo '<td><a href="ShowRoute.php?route=' . $route['id'] . '">' . $route['name'] . '</a></td>';
echo '<td>' . getLabelOfDir($direction) . '</td></tr>';
} }
} }