2 require_once('require/class.Connection.php');
3 require_once('require/class.Spotter.php');
4 require_once('require/class.Language.php');
5 if (!isset($_GET['ident'])) {
6 header('Location: '.$globalURL.'/ident');
9 $Spotter = new Spotter();
10 $sort = filter_input(INPUT_GET
,'sort',FILTER_SANITIZE_STRING
);
11 $ident = filter_input(INPUT_GET
,'ident',FILTER_SANITIZE_STRING
);
13 $spotter_array = $Spotter->getSpotterDataByIdent($ident,"0,1", $sort);
15 $spotter_array = $Spotter->getSpotterDataByIdent($ident,"0,1", '');
18 if (!empty($spotter_array))
20 $title = sprintf(_("Most Common Aircraft of %s"),$spotter_array[0]['ident']);
21 require_once('header.php');
22 print '<div class="info column">';
23 print '<h1>'.$spotter_array[0]['ident'].'</h1>';
24 print '<div><span class="label">'._("Ident").'</span>'.$spotter_array[0]['ident'].'</div>';
25 print '<div><span class="label">'._("Airline").'</span><a href="'.$globalURL.'/airline/'.$spotter_array[0]['airline_icao'].'">'.$spotter_array[0]['airline_name'].'</a></div>';
28 include('ident-sub-menu.php');
29 print '<div class="column">';
30 print '<h2>'._("Most Common Aircraft").'</h2>';
31 print '<p>'.sprintf(_("The statistic below shows the most common aircraft of flights using the ident/callsign <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>';
33 $aircraft_array = $Spotter->countAllAircraftTypesByIdent($ident);
34 if (!empty($aircraft_array))
36 print '<div class="table-responsive">';
37 print '<table class="common-type table-striped">';
40 print '<th>'._("Aircraft Type").'</th>';
41 print '<th>'._("# of times").'</th>';
46 foreach($aircraft_array as $aircraft_item)
49 print '<td><strong>'.$i.'</strong></td>';
51 print '<a href="'.$globalURL.'/aircraft/'.$aircraft_item['aircraft_icao'].'">'.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')</a>';
54 print $aircraft_item['aircraft_icao_count'];
56 print '<td><a href="'.$globalURL.'/search?aircraft='.$aircraft_item['aircraft_icao'].'&callsign='.$ident.'">'._("Search flights").'</a></td>';
67 require_once('header.php');
68 print '<h1>'._("Error").'</h1>';
69 print '<p>'._("Sorry, this ident/callsign is not in the database. :(").'</p>';
72 require_once('footer.php');