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 $ident = filter_input(INPUT_GET
,'ident',FILTER_SANITIZE_STRING
);
11 $sort = filter_input(INPUT_GET
,'sort',FILTER_SANITIZE_STRING
);
12 $spotter_array = $Spotter->getSpotterDataByIdent($ident,"0,1", $sort);
14 if (!empty($spotter_array))
16 $title = sprintf(_("Most Common Aircraft by Registration of %s"),$spotter_array[0]['ident']);
17 require_once('header.php');
18 print '<div class="info column">';
19 print '<h1>'.$spotter_array[0]['ident'].'</h1>';
20 print '<div><span class="label">'._("Ident").'</span>'.$spotter_array[0]['ident'].'</div>';
21 print '<div><span class="label">'._("Airline").'</span><a href="'.$globalURL.'/airline/'.$spotter_array[0]['airline_icao'].'">'.$spotter_array[0]['airline_name'].'</a></div>';
24 include('ident-sub-menu.php');
25 print '<div class="column">';
26 print '<h2>'._("Most Common Aircraft by Registration").'</h2>';
27 print '<p>'.sprintf(_("The statistic below shows the most common aircraft by Registration of flights using the ident/callsign <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>';
29 $aircraft_array = $Spotter->countAllAircraftRegistrationByIdent($ident);
31 if (!empty($aircraft_array))
33 print '<div class="table-responsive">';
34 print '<table class="common-type table-striped">';
38 print '<th>'._("Registration").'</th>';
39 print '<th>'._("Aircraft Type").'</th>';
40 print '<th>'._("# of times").'</th>';
45 foreach($aircraft_array as $aircraft_item)
48 print '<td><strong>'.$i.'</strong></td>';
49 if ($aircraft_item['image_thumbnail'] != "")
51 print '<td class="aircraft_thumbnail">';
52 if (isset($aircraft_item['aircraft_type'])) {
53 print '<a href="'.$globalURL.'/registration/'.$aircraft_item['registration'].'"><img src="'.$aircraft_item['image_thumbnail'].'" class="img-rounded" data-toggle="popover" title="'.$aircraft_item['registration'].' - '.$aircraft_item['aircraft_icao'].' - '.$aircraft_item['airline_name'].'" alt="'.$aircraft_item['registration'].' - '.$aircraft_item['aircraft_type'].' - '.$aircraft_item['airline_name'].'" data-content="'._("Registration:").' '.$aircraft_item['registration'].'<br />'._("Aircraft:").' '.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')<br />'._("Airline:").' '.$aircraft_item['airline_name'].'" data-html="true" width="100px" /></a>';
55 print '<a href="'.$globalURL.'/registration/'.$aircraft_item['registration'].'"><img src="'.$aircraft_item['image_thumbnail'].'" class="img-rounded" data-toggle="popover" title="'.$aircraft_item['registration'].' - '.$aircraft_item['aircraft_icao'].' - '.$aircraft_item['airline_name'].'" alt="'.$aircraft_item['registration'].' - '.$aircraft_item['airline_name'].'" data-content="'._("Registration:").' '.$aircraft_item['registration'].'<br />'._("Aircraft:").' '.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')<br />'._("Airline:").' '.$aircraft_item['airline_name'].'" data-html="true" width="100px" /></a>';
59 print '<td class="aircraft_thumbnail">';
60 if (isset($aircraft_item['aircraft_type'])) {
61 print '<a href="'.$globalURL.'/registration/'.$aircraft_item['registration'].'"><img src="'.$globalURL.'/images/placeholder_thumb.png" class="img-rounded" data-toggle="popover" title="'.$aircraft_item['registration'].' - '.$aircraft_item['aircraft_icao'].' - '.$aircraft_item['airline_name'].'" alt="'.$aircraft_item['registration'].' - '.$aircraft_item['aircraft_type'].' - '.$aircraft_item['airline_name'].'" data-content="'._("Registration:").' '.$aircraft_item['registration'].'<br />'._("Aircraft:").' '.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')<br />'._("Airline:").' '.$aircraft_item['airline_name'].'" data-html="true" width="100px" /></a>';
63 print '<a href="'.$globalURL.'/registration/'.$aircraft_item['registration'].'"><img src="'.$globalURL.'/images/placeholder_thumb.png" class="img-rounded" data-toggle="popover" title="'.$aircraft_item['registration'].' - '.$aircraft_item['aircraft_icao'].' - '.$aircraft_item['airline_name'].'" alt="'.$aircraft_item['registration'].' - '.$aircraft_item['airline_name'].'" data-content="'._("Registration:").' '.$aircraft_item['registration'].'<br />'._("Aircraft:").' '.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')<br />'._("Airline:").' '.$aircraft_item['airline_name'].'" data-html="true" width="100px" /></a>';
68 print '<a href="'.$globalURL.'/registration/'.$aircraft_item['registration'].'">'.$aircraft_item['registration'].'</a>';
71 print '<a href="'.$globalURL.'/aircraft/'.$aircraft_item['aircraft_icao'].'">'.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')</a>';
74 print $aircraft_item['registration_count'];
76 print '<td><a href="'.$globalURL.'/search?registration='.$aircraft_item['registration'].'&callsign='.$ident.'">'._("Search flights").'</a></td>';
87 require_once('header.php');
88 print '<h1>'._("Error").'</h1>';
89 print '<p>'._("Sorry, this ident/callsign is not in the database. :(").'</p>';
92 require_once('footer.php');