forked from Ysurac/FlightAirMap
/
statistics-route-waypoint.php
55 lines (51 loc) · 1.9 KB
/
statistics-route-waypoint.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
require('require/class.Connection.php');
require('require/class.Spotter.php');
$Spotter = new Spotter();
$title = "Statistic - Most common Route by Waypoint";
require('header.php');
include('statistics-sub-menu.php');
?>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<div class="info">
<h1>Most common Route by Waypoint</h1>
</div>
<p>Below are the <strong>Top 10</strong> most common routes, based on the waypoint data (as of May 1, 2014). Theoretically, since the waypoint data is the full 'planned flight route' this statistic would show the actual most common route.</p>
<?php
$route_array = $Spotter->countAllRoutesWithWaypoints();
if (!empty($route_array))
{
print '<div class="table-responsive">';
print '<table class="common-routes-waypoints table-striped">';
print '<thead>';
print '<th></th>';
print '<th>Departure Airport</th>';
print '<th>Arrival Airport</th>';
print '<th># of times</th>';
print '<th></th>';
print '</thead>';
print '<tbody>';
$i = 1;
foreach($route_array as $route_item)
{
print '<tr>';
print '<td><strong>'.$i.'</strong></td>';
print '<td>';
print '<a href="'.$globalURL.'/airport/'.$route_item['airport_departure_icao'].'">'.$route_item['airport_departure_city'].', '.$route_item['airport_departure_country'].' ('.$route_item['airport_departure_icao'].')</a>';
print '</td>';
print '<td>';
print '<a href="'.$globalURL.'/airport/'.$route_item['airport_arrival_icao'].'">'.$route_item['airport_arrival_city'].', '.$route_item['airport_arrival_country'].' ('.$route_item['airport_arrival_icao'].')</a>';
print '</td>';
print '<td>'.$route_item['route_count'].'</td>';
print '<td>';
print '<a href="'.$globalURL.'/flightid/'.$route_item['spotter_id'].'">Recent Flight on this route</a>';
print '</td>';
print '</tr>';
$i++;
}
print '<tbody>';
print '</table>';
print '</div>';
}
require('footer.php');
?>