Add page displaying positions of all buses.

This commit is contained in:
George Kaklamanos 2016-02-21 11:44:39 +02:00
parent 94d3e491f2
commit 7f53fc7d1c

45
BusPositions.php Normal file
View 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