Add page displaying positions of all buses.
This commit is contained in:
parent
94d3e491f2
commit
7f53fc7d1c
1 changed files with 45 additions and 0 deletions
45
BusPositions.php
Normal file
45
BusPositions.php
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>DataBus - Bus Positions</title>
|
||||||
|
<?php include 'modules/head.php'; ?>
|
||||||
|
<?php include 'modules/map.php'; ?>
|
||||||
|
<style type="text/css">
|
||||||
|
#mymap{
|
||||||
|
height:100%;
|
||||||
|
width:100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<?php include 'modules/nav.php'; ?>
|
||||||
|
|
||||||
|
<h1>Bus Positions</h1>
|
||||||
|
<p>This map displays the positions of every bus of every route.</p>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
include 'modules/libdata.php';
|
||||||
|
|
||||||
|
$positionsRed = array();
|
||||||
|
$positionsGreen = array();
|
||||||
|
foreach ($buspositions as $bus){
|
||||||
|
if($bus["direction"] == "go"){
|
||||||
|
array_push($positionsRed, array($bus['lat'], $bus['lon']));
|
||||||
|
}
|
||||||
|
if($bus["direction"] == "come"){
|
||||||
|
array_push($positionsGreen, array($bus['lat'], $bus['lon']));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ShowMap($positionsRed,$positionsGreen);
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
|
||||||
|
<?php include 'modules/foot.php'; ?>
|
||||||
|
</body>
|
||||||
|
</html
|
||||||
|
|
||||||
|
|
Reference in a new issue