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 $sort = filter_input(INPUT_GET
,'sort',FILTER_SANITIZE_STRING
);
7 $registration = filter_input(INPUT_GET
,'registration',FILTER_SANITIZE_STRING
);
8 $spotter_array = $Spotter->getSpotterDataByRegistration($registration, "0,1", $sort);
9 $aircraft_array = $Spotter->getAircraftInfoByRegistration($registration);
12 if (!empty($spotter_array))
14 $title = sprintf(_("Most Common Routes from aircraft with registration %s"),$registration);
16 require_once('header.php');
17 print '<div class="info column">';
18 print '<h1>'.$registration.' - '.$aircraft_array[0]['aircraft_name'].' ('.$aircraft_array[0]['aircraft_icao'].')</h1>';
19 print '<div><span class="label">'._("Name").'</span><a href="'.$globalURL.'/aircraft/'.$aircraft_array[0]['aircraft_icao'].'">'.$aircraft_array[0]['aircraft_name'].'</a></div>';
20 print '<div><span class="label">'._("ICAO").'</span><a href="'.$globalURL.'/aircraft/'.$aircraft_array[0]['aircraft_icao'].'">'.$aircraft_array[0]['aircraft_icao'].'</a></div>';
21 print '<div><span class="label">'._("Manufacturer").'</span><a href="'.$globalURL.'/manufacturer/'.strtolower(str_replace(" ", "-", $aircraft_array[0]['aircraft_manufacturer'])).'">'.$aircraft_array[0]['aircraft_manufacturer'].'</a></div>';
24 include('registration-sub-menu.php');
25 print '<div class="column">';
26 print '<h2>'._("Most Common Routes").'</h2>';
27 print '<p>'.sprintf(_("The statistic below shows the most common routes of aircraft with registration <strong>%s</strong>."),$registration).'</p>';
29 $route_array = $Spotter->countAllRoutesByRegistration($registration);
30 if (!empty($route_array))
32 print '<div class="table-responsive">';
33 print '<table class="common-routes table-striped">';
36 print '<th>'._("Departure Airport").'</th>';
37 print '<th>'._("Arrival Airport").'</th>';
38 print '<th>'._("# of times").'</th>';
43 foreach($route_array as $route_item)
46 print '<td><strong>'.$i.'</strong></td>';
48 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>';
51 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>';
54 print $route_item['route_count'];
57 print '<a href="'.$globalURL.'/route/'.$route_item['airport_departure_icao'].'/'.$route_item['airport_arrival_icao'].'">'._("Route Profile").'</a>';
68 $title = _("Registration");
69 require_once('header.php');
70 print '<h1>'._("Error").'</h1>';
71 print '<p>'._("Sorry, this registration does not exist in this database. :(").'</p>';
74 require_once('footer.php');