Merge pull request #456 from Struart88/patch-2
[FlightAirMap.git] / statistics-route-waypoint.php
blob2b8edbc1d3edf30d92e867636df73b7bc1fcea44
1 <?php
2 require_once('require/class.Connection.php');
3 require_once('require/class.Spotter.php');
4 require_once('require/class.Language.php');
5 $Spotter = new Spotter();
6 $title = _("Statistics").' - '._("Most common Route by Waypoint");
7 require_once('header.php');
8 if (!isset($filter_name)) $filter_name = '';
9 include('statistics-sub-menu.php');
11 print '<div class="info">
12 <h1>'._("Most common Route by Waypoint").'</h1>
13 </div>
14 <p>'._("Below are the <strong>Top 10</strong> most common routes, based on the waypoint data. Theoretically, since the waypoint data is the full 'planned flight route' this statistic would show the actual most common route.").'</p>';
16 $route_array = $Spotter->countAllRoutesWithWaypoints();
17 if (!empty($route_array))
19 print '<div class="table-responsive">';
20 print '<table class="common-routes-waypoints table-striped">';
21 print '<thead>';
22 print '<th></th>';
23 print '<th>'._("Departure Airport").'</th>';
24 print '<th>'._("Arrival Airport").'</th>';
25 print '<th>'._("# of times").'</th>';
26 print '<th></th>';
27 print '</thead>';
28 print '<tbody>';
29 $i = 1;
30 foreach($route_array as $route_item)
32 print '<tr>';
33 print '<td><strong>'.$i.'</strong></td>';
34 print '<td>';
35 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>';
36 print '</td>';
37 print '<td>';
38 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>';
39 print '</td>';
40 print '<td>'.$route_item['route_count'].'</td>';
41 print '<td>';
42 print '<a href="'.$globalURL.'/flightid/'.$route_item['spotter_id'].'">'._("Recent Flight on this route").'</a>';
43 print '</td>';
44 print '</tr>';
45 $i++;
47 print '<tbody>';
48 print '</table>';
49 print '</div>';
52 require_once('footer.php');