2 if ($_GET['departure_airport'] == "" ||
$_GET['arrival_airport'] == "")
7 require_once('require/class.Connection.php');
8 require_once('require/class.Spotter.php');
9 require_once('require/class.Language.php');
10 $Spotter = new Spotter();
11 $sort = filter_input(INPUT_GET
,'sort',FILTER_SANITIZE_STRING
);
12 $departure_airport = filter_input(INPUT_GET
,'departure_airport',FILTER_SANITIZE_STRING
);
13 $arrival_airport = filter_input(INPUT_GET
,'arrival_airport',FILTER_SANITIZE_STRING
);
14 if (isset($_GET['departure_airport']) && isset($_GET['arrival_airport'])) {
15 $spotter_array = $Spotter->getSpotterDataByRoute($departure_airport, $arrival_airport, "0,1", $sort);
16 } else $spotter_array = array();
18 if (!empty($spotter_array))
20 $title = sprintf(_("Most Common Airlines between %s (%s), %s - %s (%s), %s"),$spotter_array[0]['departure_airport_name'],$spotter_array[0]['departure_airport_icao'],$spotter_array[0]['departure_airport_country'],$spotter_array[0]['arrival_airport_name'],$spotter_array[0]['arrival_airport_icao'],$spotter_array[0]['arrival_airport_country']);
21 require_once('header.php');
22 print '<div class="info column">';
23 print '<h1>'._("Flights between").' '.$spotter_array[0]['departure_airport_name'].' ('.$spotter_array[0]['departure_airport_icao'].'), '.$spotter_array[0]['departure_airport_country'].' - '.$spotter_array[0]['arrival_airport_name'].' ('.$spotter_array[0]['arrival_airport_icao'].'), '.$spotter_array[0]['arrival_airport_country'].'</h1>';
24 print '<div><span class="label">'._("Coming From").'</span><a href="'.$globalURL.'/airport/'.$spotter_array[0]['departure_airport_icao'].'">'.$spotter_array[0]['departure_airport_name'].' ('.$spotter_array[0]['departure_airport_icao'].'), '.$spotter_array[0]['departure_airport_country'].'</a></div>';
25 print '<div><span class="label">'._("Flying To").'</span><a href="'.$globalURL.'/airport/'.$spotter_array[0]['arrival_airport_icao'].'">'.$spotter_array[0]['arrival_airport_name'].' ('.$spotter_array[0]['arrival_airport_icao'].'), '.$spotter_array[0]['arrival_airport_country'].'</a></div>';
28 include('route-sub-menu.php');
29 print '<div class="column">';
30 print '<h2>'._("Most Common Airlines").'</h2>';
31 print '<p>'.sprintf(_("The statistic below shows the most common airlines of flights between <strong>%s (%s), %s</strong> and <strong>%s (%s), %s</strong>."),$spotter_array[0]['departure_airport_name'],$spotter_array[0]['departure_airport_icao'],$spotter_array[0]['departure_airport_country'],$spotter_array[0]['arrival_airport_name'],$spotter_array[0]['arrival_airport_icao'],$spotter_array[0]['arrival_airport_country']).'</p>';
32 $airline_array = $Spotter->countAllAirlinesByRoute($departure_airport, $arrival_airport);
33 if (!empty($airline_array))
35 print '<div class="table-responsive">';
36 print '<table class="common-airline table-striped">';
40 print '<th>'._("Airline").'</th>';
41 print '<th>'._("Country").'</th>';
42 print '<th>'._("# of times").'</th>';
47 foreach($airline_array as $airline_item)
50 print '<td><strong>'.$i.'</strong></td>';
51 print '<td class="logo">';
52 print '<a href="'.$globalURL.'/airline/'.$airline_item['airline_icao'].'"><img src="';
53 if ($globalIVAO && @getimagesize
($globalURL.'/images/airlines/'.$airline_item['airline_icao'].'.gif'))
55 print $globalURL.'/images/airlines/'.$airline_item['airline_icao'].'.gif';
56 } elseif (@getimagesize
($globalURL.'/images/airlines/'.$airline_item['airline_icao'].'.png'))
58 print $globalURL.'/images/airlines/'.$airline_item['airline_icao'].'.png';
60 print $globalURL.'/images/airlines/placeholder.png';
65 print '<a href="'.$globalURL.'/airline/'.$airline_item['airline_icao'].'">'.$airline_item['airline_name'].' ('.$airline_item['airline_icao'].')</a>';
68 print '<a href="'.$globalURL.'/country/'.strtolower(str_replace(" ", "-", $airline_item['airline_country'])).'">'.$airline_item['airline_country'].'</a>';
71 print $airline_item['airline_count'];
73 print '<td><a href="'.$globalURL.'/search?airline='.$airline_item['airline_icao'].'&departure_airport_route='.$departure_airport.'&arrival_airport_route='.$arrival_airport.'">'._("Search flights").'</a></td>';
83 $title = _("Unknown Route");
84 require_once('header.php');
85 print '<h1>'._("Error").'</h1>';
86 print '<p>'._("Sorry, this route does not exist in this database. :(").'</p>';
88 require_once('footer.php');