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['country'])) {
6 header('Location: '.$globalURL.'/country');
9 $Spotter = new Spotter();
10 $country = ucwords(str_replace("-", " ", urldecode(filter_input(INPUT_GET
,'country',FILTER_SANITIZE_STRING
))));
11 $sort = filter_input(INPUT_GET
,'sort',FILTER_SANITIZE_STRING
);
12 if (isset($_GET['sort'])) {
13 $spotter_array = $Spotter->getSpotterDataByCountry($country, "0,1", $sort);
15 $spotter_array = $Spotter->getSpotterDataByCountry($country, "0,1", '');
18 if (!empty($spotter_array))
20 $title = sprintf(_("Most Common Aircraft Manufacturer from %s"),$country);
21 require_once('header.php');
22 print '<div class="select-item">';
23 print '<form action="'.$globalURL.'/country" method="post">';
24 print '<select name="country" class="selectpicker" data-live-search="true">';
25 print '<option></option>';
26 $all_countries = $Spotter->getAllCountries();
27 foreach($all_countries as $all_country)
29 if($country == $all_country['country'])
31 print '<option value="'.strtolower(str_replace(" ", "-", $all_country['country'])).'" selected="selected">'.$all_country['country'].'</option>';
33 print '<option value="'.strtolower(str_replace(" ", "-", $all_country['country'])).'">'.$all_country['country'].'</option>';
37 print '<button type="submit"><i class="fa fa-angle-double-right"></i></button>';
41 if ($_GET['country'] != "NA")
43 print '<div class="info column">';
44 print '<h1>'.sprintf(_("Airports & Airlines from %s"),$country).'</h1>';
47 print '<div class="alert alert-warning">'._("This special country profile shows all flights that do <u>not</u> have a country of a airline or departure/arrival airport associated with them.").'</div>';
50 include('country-sub-menu.php');
51 print '<div class="column">';
52 print '<h2>'._("Most Common Aircraft Manufacturer").'</h2>';
53 print '<p>'.sprintf(_("The statistic below shows the most common Aircraft Manufacturer of airlines or departure/arrival airports from <strong>%s</strong>."),$country).'</p>';
54 $manufacturers_array = $Spotter->countAllAircraftManufacturerByCountry($country);
55 if (!empty($manufacturers_array))
57 print '<div class="table-responsive">';
58 print '<table class="common-manufacturer table-striped">';
61 print '<th>'._("Aircraft Manufacturer").'</th>';
62 print '<th>'._("# of times").'</th>';
66 foreach($manufacturers_array as $manufacturer_item)
69 print '<td><strong>'.$i.'</strong></td>';
71 print '<a href="'.$globalURL.'/manufacturer/'.strtolower(str_replace(" ", "-", $manufacturer_item['aircraft_manufacturer'])).'">'.$manufacturer_item['aircraft_manufacturer'].'</a>';
74 print $manufacturer_item['aircraft_manufacturer_count'];
85 $title = _("Country");
86 require_once('header.php');
87 print '<h1>'._("Error").'</h1>';
88 print '<p>'._("Sorry, the country does not exist in this database. :(").'</p>';
91 require_once('footer.php');