Added page with unique line numbers.
This commit is contained in:
parent
3cda5b78c0
commit
3a6060f458
3 changed files with 60 additions and 0 deletions
42
Lines.php
Normal file
42
Lines.php
Normal file
|
@ -0,0 +1,42 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>DataBus - Lines</title>
|
||||
<?php include 'modules/head.php'; ?>
|
||||
</head>
|
||||
<body>
|
||||
<?php include 'modules/nav.php'; ?>
|
||||
|
||||
<h1>Lines</h1>
|
||||
<p>This is a table of all the routes. Click on a route's name to see a list of
|
||||
its bus stops and the position of the bus on the map. Click on a line number
|
||||
to see a list of routes that have this line number</p>
|
||||
<table class="table table-striped table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Line #</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
|
||||
<?php
|
||||
include 'modules/libdata.php';
|
||||
|
||||
foreach (getLines() as $line){
|
||||
echo '<tr>';
|
||||
echo '<td><a href="ShowLine.php?line=' . $line . '">' . $line . '</a></td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
<?php include 'modules/foot.php'; ?>
|
||||
</body>
|
||||
</html
|
||||
|
||||
|
|
@ -95,4 +95,21 @@ function getLabelOfDir($dir){
|
|||
}
|
||||
}
|
||||
|
||||
function getLines(){
|
||||
global $routes;
|
||||
$lines = array();
|
||||
foreach ($routes as $r){
|
||||
$found = false;
|
||||
foreach($lines as $l){
|
||||
if($r["line"] == $l){
|
||||
$found=true;
|
||||
}
|
||||
}
|
||||
if(!$found){
|
||||
array_push($lines, $r["id"]);
|
||||
}
|
||||
}
|
||||
return $lines;
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
<div class="navbar-collapse collapse" >
|
||||
<ul class="nav navbar-nav">
|
||||
<li class="<?php echo isActive("Routes.php");?>" ><a href="Routes.php">Routes</a></li>
|
||||
<li class="<?php echo isActive("Lines.php");?>" ><a href="Lines.php">Lines</a></li>
|
||||
<li class="<?php echo isActive("Stops.php");?>"><a href="Stops.php">Stops</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
Reference in a new issue