@@ -7,22 +7,22 @@ discard block  | 
                                                    ||
| 7 | 7 |  	header('Location: '.$globalURL.'/airline'); | 
                                                        
| 8 | 8 | die();  | 
                                                        
| 9 | 9 | }  | 
                                                        
| 10 | -$airline = urldecode(filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING));  | 
                                                        |
| 10 | +$airline = urldecode(filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING));  | 
                                                        |
| 11 | 11 | $Spotter = new Spotter();  | 
                                                        
| 12 | 12 | $alliance = false;  | 
                                                        
| 13 | -if (strpos($airline,'alliance_') !== FALSE) { | 
                                                        |
| 13 | +if (strpos($airline, 'alliance_') !== FALSE) { | 
                                                        |
| 14 | 14 |  //	$spotter_array = $Spotter->getSpotterDataByAirline('',"0,1","",array('alliance' => str_replace('_',' ',str_replace('alliance_','',$airline)))); | 
                                                        
| 15 | 15 | $alliance = true;  | 
                                                        
| 16 | 16 |  } else { | 
                                                        
| 17 | - $spotter_array = $Spotter->getSpotterDataByAirline($airline,"0,1","");  | 
                                                        |
| 17 | + $spotter_array = $Spotter->getSpotterDataByAirline($airline, "0,1", "");  | 
                                                        |
| 18 | 18 | }  | 
                                                        
| 19 | 19 | |
| 20 | 20 | if (!empty($spotter_array) || $alliance === true)  | 
                                                        
| 21 | 21 |  { | 
                                                        
| 22 | 22 |  	if ($alliance) { | 
                                                        
| 23 | -		$title = sprintf(_("Most Common Aircraft from %s"),str_replace('_',' ',str_replace('alliance_','',$airline))); | 
                                                        |
| 23 | +		$title = sprintf(_("Most Common Aircraft from %s"), str_replace('_', ' ', str_replace('alliance_', '', $airline))); | 
                                                        |
| 24 | 24 |  	} else { | 
                                                        
| 25 | -		$title = sprintf(_("Most Common Aircraft from %s (%s)"),$spotter_array[0]['airline_name'],$spotter_array[0]['airline_icao']); | 
                                                        |
| 25 | +		$title = sprintf(_("Most Common Aircraft from %s (%s)"), $spotter_array[0]['airline_name'], $spotter_array[0]['airline_icao']); | 
                                                        |
| 26 | 26 | }  | 
                                                        
| 27 | 27 |  	require_once('header.php'); | 
                                                        
| 28 | 28 | print '<div class="select-item">';  | 
                                                        
@@ -32,10 +32,10 @@ discard block  | 
                                                    ||
| 32 | 32 | $alliances = $Spotter->getAllAllianceNames();  | 
                                                        
| 33 | 33 |  	if (!empty($alliances)) { | 
                                                        
| 34 | 34 |  		foreach ($alliances as $al) { | 
                                                        
| 35 | -			if ($alliance && str_replace('_',' ',str_replace('alliance_','',$airline)) == $al['alliance']) { | 
                                                        |
| 36 | -				print '<option value="'.str_replace(' ','_',$al['alliance']).'" selected>'.$al['alliance'].'</option>'; | 
                                                        |
| 35 | +			if ($alliance && str_replace('_', ' ', str_replace('alliance_', '', $airline)) == $al['alliance']) { | 
                                                        |
| 36 | +				print '<option value="'.str_replace(' ', '_', $al['alliance']).'" selected>'.$al['alliance'].'</option>'; | 
                                                        |
| 37 | 37 |  			} else { | 
                                                        
| 38 | -				print '<option value="'.str_replace(' ','_',$al['alliance']).'">'.$al['alliance'].'</option>'; | 
                                                        |
| 38 | +				print '<option value="'.str_replace(' ', '_', $al['alliance']).'">'.$al['alliance'].'</option>'; | 
                                                        |
| 39 | 39 | }  | 
                                                        
| 40 | 40 | }  | 
                                                        
| 41 | 41 | print '<option disabled>────────────────</option>';  | 
                                                        
@@ -43,9 +43,9 @@ discard block  | 
                                                    ||
| 43 | 43 | $Stats = new Stats();  | 
                                                        
| 44 | 44 | $airline_names = $Stats->getAllAirlineNames();  | 
                                                        
| 45 | 45 | if (empty($airline_names)) $airline_names = $Spotter->getAllAirlineNames();  | 
                                                        
| 46 | - foreach($airline_names as $airline_name)  | 
                                                        |
| 46 | + foreach ($airline_names as $airline_name)  | 
                                                        |
| 47 | 47 |  	{ | 
                                                        
| 48 | - if($airline == $airline_name['airline_icao'])  | 
                                                        |
| 48 | + if ($airline == $airline_name['airline_icao'])  | 
                                                        |
| 49 | 49 |  		{ | 
                                                        
| 50 | 50 |  			print '<option value="'.$airline_name['airline_icao'].'" selected="selected">'.$airline_name['airline_name'].' ('.$airline_name['airline_icao'].')</option>'; | 
                                                        
| 51 | 51 |  		} else { | 
                                                        
@@ -79,12 +79,12 @@ discard block  | 
                                                    ||
| 79 | 79 | print '</div>';  | 
                                                        
| 80 | 80 |  		} else { | 
                                                        
| 81 | 81 | print '<div class="info column">';  | 
                                                        
| 82 | -			print '<h1>'.str_replace('_',' ',str_replace('alliance_','',$airline)).'</h1>'; | 
                                                        |
| 83 | -			if (@getimagesize($globalURL.'/images/airlines/'.str_replace('alliance_','',$airline).'.png') || @getimagesize('images/airlines/'.str_replace('alliance_','',$airline).'.png')) | 
                                                        |
| 82 | +			print '<h1>'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'</h1>'; | 
                                                        |
| 83 | +			if (@getimagesize($globalURL.'/images/airlines/'.str_replace('alliance_', '', $airline).'.png') || @getimagesize('images/airlines/'.str_replace('alliance_', '', $airline).'.png')) | 
                                                        |
| 84 | 84 |  			{ | 
                                                        
| 85 | -				print '<img src="'.$globalURL.'/images/airlines/'.str_replace('alliance_','',$airline).'.png" alt="'.str_replace('_',' ',str_replace('alliance_','',$airline)).'" title="'.str_replace('_',' ',str_replace('alliance_','',$airline)).'" class="logo" />'; | 
                                                        |
| 85 | +				print '<img src="'.$globalURL.'/images/airlines/'.str_replace('alliance_', '', $airline).'.png" alt="'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'" title="'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'" class="logo" />'; | 
                                                        |
| 86 | 86 | }  | 
                                                        
| 87 | -			print '<div><span class="label">'._("Name").'</span>'.str_replace('_',' ',str_replace('alliance_','',$airline)).'</div>'; | 
                                                        |
| 87 | +			print '<div><span class="label">'._("Name").'</span>'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'</div>'; | 
                                                        |
| 88 | 88 | print '</div>';  | 
                                                        
| 89 | 89 | }  | 
                                                        
| 90 | 90 |  	} else { | 
                                                        
@@ -95,9 +95,9 @@ discard block  | 
                                                    ||
| 95 | 95 | print '<div class="column">';  | 
                                                        
| 96 | 96 |  	print '<h2>'._("Most Common Aircraft").'</h2>'; | 
                                                        
| 97 | 97 |  	if ($alliance === false) { | 
                                                        
| 98 | -		print '<p>'.sprintf(_("The statistic below shows the most common aircrafts of flights from <strong>%s</strong>."),$spotter_array[0]['airline_name']).'</p>'; | 
                                                        |
| 98 | +		print '<p>'.sprintf(_("The statistic below shows the most common aircrafts of flights from <strong>%s</strong>."), $spotter_array[0]['airline_name']).'</p>'; | 
                                                        |
| 99 | 99 |  	} else { | 
                                                        
| 100 | -		print '<p>'.sprintf(_("The statistic below shows the most common aircrafts of flights from <strong>%s</strong>."),str_replace('_',' ',str_replace('alliance_','',$airline))).'</p>'; | 
                                                        |
| 100 | +		print '<p>'.sprintf(_("The statistic below shows the most common aircrafts of flights from <strong>%s</strong>."), str_replace('_', ' ', str_replace('alliance_', '', $airline))).'</p>'; | 
                                                        |
| 101 | 101 | }  | 
                                                        
| 102 | 102 | |
| 103 | 103 | /*  | 
                                                        
@@ -107,7 +107,7 @@ discard block  | 
                                                    ||
| 107 | 107 | $aircraft_array = $Spotter->countAllAircraftTypesByAirline($airline);  | 
                                                        
| 108 | 108 | }  | 
                                                        
| 109 | 109 | */  | 
                                                        
| 110 | - $aircraft_array = $Stats->countAllAircraftTypes(true,$airline);  | 
                                                        |
| 110 | + $aircraft_array = $Stats->countAllAircraftTypes(true, $airline);  | 
                                                        |
| 111 | 111 | if (!empty($aircraft_array))  | 
                                                        
| 112 | 112 |  	{ | 
                                                        
| 113 | 113 | print '<div class="table-responsive">';  | 
                                                        
@@ -120,7 +120,7 @@ discard block  | 
                                                    ||
| 120 | 120 | print '</thead>';  | 
                                                        
| 121 | 121 | print '<tbody>';  | 
                                                        
| 122 | 122 | $i = 1;  | 
                                                        
| 123 | - foreach($aircraft_array as $aircraft_item)  | 
                                                        |
| 123 | + foreach ($aircraft_array as $aircraft_item)  | 
                                                        |
| 124 | 124 |  		{ | 
                                                        
| 125 | 125 | print '<tr>';  | 
                                                        
| 126 | 126 | print '<td><strong>'.$i.'</strong></td>';  | 
                                                        
@@ -3,17 +3,17 @@ discard block  | 
                                                    ||
| 3 | 3 |  require_once('require/class.Spotter.php'); | 
                                                        
| 4 | 4 |  require_once('require/class.Language.php'); | 
                                                        
| 5 | 5 | |
| 6 | -if (!isset($_GET['country'])){ | 
                                                        |
| 6 | +if (!isset($_GET['country'])) { | 
                                                        |
| 7 | 7 |  	header('Location: '.$globalURL.''); | 
                                                        
| 8 | 8 |  } else { | 
                                                        
| 9 | 9 | $Spotter = new Spotter();  | 
                                                        
| 10 | 10 | //calculuation for the pagination  | 
                                                        
| 11 | - if(!isset($_GET['limit']))  | 
                                                        |
| 11 | + if (!isset($_GET['limit']))  | 
                                                        |
| 12 | 12 |  	{ | 
                                                        
| 13 | 13 | $limit_start = 0;  | 
                                                        
| 14 | 14 | $limit_end = 25;  | 
                                                        
| 15 | 15 | $absolute_difference = 25;  | 
                                                        
| 16 | -	}  else { | 
                                                        |
| 16 | +	} else { | 
                                                        |
| 17 | 17 |  		$limit_explode = explode(",", $_GET['limit']); | 
                                                        
| 18 | 18 | $limit_start = $limit_explode[0];  | 
                                                        
| 19 | 19 | $limit_end = $limit_explode[1];  | 
                                                        
@@ -27,10 +27,10 @@ discard block  | 
                                                    ||
| 27 | 27 | $limit_previous_1 = $limit_start - $absolute_difference;  | 
                                                        
| 28 | 28 | $limit_previous_2 = $limit_end - $absolute_difference;  | 
                                                        
| 29 | 29 | |
| 30 | -	$country = ucwords(str_replace("-", " ", urldecode(filter_input(INPUT_GET,'country',FILTER_SANITIZE_STRING)))); | 
                                                        |
| 30 | +	$country = ucwords(str_replace("-", " ", urldecode(filter_input(INPUT_GET, 'country', FILTER_SANITIZE_STRING)))); | 
                                                        |
| 31 | 31 | |
| 32 | 32 | $page_url = $globalURL.'/country/'.$_GET['country'];  | 
                                                        
| 33 | - $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);  | 
                                                        |
| 33 | + $sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);  | 
                                                        |
| 34 | 34 |  	if ($country == 'Na') { | 
                                                        
| 35 | 35 | $spotter_array = array();  | 
                                                        
| 36 | 36 |  	} else { | 
                                                        
@@ -43,7 +43,7 @@ discard block  | 
                                                    ||
| 43 | 43 | |
| 44 | 44 | if (!empty($spotter_array))  | 
                                                        
| 45 | 45 |  	{ | 
                                                        
| 46 | -		$title = sprintf(_("Detailed View for Airports & Airlines from %s"),$country); | 
                                                        |
| 46 | +		$title = sprintf(_("Detailed View for Airports & Airlines from %s"), $country); | 
                                                        |
| 47 | 47 | |
| 48 | 48 |  		require_once('header.php'); | 
                                                        
| 49 | 49 | print '<div class="select-item">';  | 
                                                        
@@ -51,9 +51,9 @@ discard block  | 
                                                    ||
| 51 | 51 | print '<select name="country" class="selectpicker" data-live-search="true">';  | 
                                                        
| 52 | 52 | print '<option></option>';  | 
                                                        
| 53 | 53 | $all_countries = $Spotter->getAllCountries();  | 
                                                        
| 54 | - foreach($all_countries as $all_country)  | 
                                                        |
| 54 | + foreach ($all_countries as $all_country)  | 
                                                        |
| 55 | 55 |  		{ | 
                                                        
| 56 | - if($country == $all_country['country'])  | 
                                                        |
| 56 | + if ($country == $all_country['country'])  | 
                                                        |
| 57 | 57 |  			{ | 
                                                        
| 58 | 58 |  				print '<option value="'.strtolower(str_replace(" ", "-", $all_country['country'])).'" selected="selected">'.$all_country['country'].'</option>'; | 
                                                        
| 59 | 59 |  			} else { | 
                                                        
@@ -68,7 +68,7 @@ discard block  | 
                                                    ||
| 68 | 68 | if ($_GET['country'] != "NA")  | 
                                                        
| 69 | 69 |  		{ | 
                                                        
| 70 | 70 | print '<div class="info column">';  | 
                                                        
| 71 | -			print '<h1>'.sprintf(_("Airports & Airlines from %s"),$country).'</h1>'; | 
                                                        |
| 71 | +			print '<h1>'.sprintf(_("Airports & Airlines from %s"), $country).'</h1>'; | 
                                                        |
| 72 | 72 | print '</div>';  | 
                                                        
| 73 | 73 |  		} else { | 
                                                        
| 74 | 74 |  			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>'; | 
                                                        
@@ -76,7 +76,7 @@ discard block  | 
                                                    ||
| 76 | 76 | |
| 77 | 77 |  		include('country-sub-menu.php'); | 
                                                        
| 78 | 78 | print '<div class="table column">';  | 
                                                        
| 79 | -		print '<p>'.sprintf(_("The table below shows the detailed information of all flights of airports (both departure & arrival) OR airlines from <strong>%s</strong>."),$country).'</p>'; | 
                                                        |
| 79 | +		print '<p>'.sprintf(_("The table below shows the detailed information of all flights of airports (both departure & arrival) OR airlines from <strong>%s</strong>."), $country).'</p>'; | 
                                                        |
| 80 | 80 | |
| 81 | 81 |  		include('table-output.php'); | 
                                                        
| 82 | 82 | print '<div class="pagination">';  | 
                                                        
@@ -7,18 +7,18 @@ discard block  | 
                                                    ||
| 7 | 7 | die();  | 
                                                        
| 8 | 8 | }  | 
                                                        
| 9 | 9 | $Spotter = new Spotter();  | 
                                                        
| 10 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);  | 
                                                        |
| 11 | -$owner = urldecode(filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING));  | 
                                                        |
| 12 | -$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);  | 
                                                        |
| 13 | -$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT);  | 
                                                        |
| 10 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);  | 
                                                        |
| 11 | +$owner = urldecode(filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING));  | 
                                                        |
| 12 | +$year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT);  | 
                                                        |
| 13 | +$month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT);  | 
                                                        |
| 14 | 14 | $filter = array();  | 
                                                        
| 15 | -if ($year != '') $filter = array_merge($filter,array('year' => $year)); | 
                                                        |
| 16 | -if ($month != '') $filter = array_merge($filter,array('month' => $month)); | 
                                                        |
| 17 | -$spotter_array = $Spotter->getSpotterDataByOwner($owner,"0,1", $sort,$filter);  | 
                                                        |
| 15 | +if ($year != '') $filter = array_merge($filter, array('year' => $year)); | 
                                                        |
| 16 | +if ($month != '') $filter = array_merge($filter, array('month' => $month)); | 
                                                        |
| 17 | +$spotter_array = $Spotter->getSpotterDataByOwner($owner, "0,1", $sort, $filter);  | 
                                                        |
| 18 | 18 | |
| 19 | 19 | if (!empty($spotter_array))  | 
                                                        
| 20 | 20 |  { | 
                                                        
| 21 | -	$title = sprintf(_("Most Common Departure Airports by Owner of %s"),$spotter_array[0]['aircraft_owner']); | 
                                                        |
| 21 | +	$title = sprintf(_("Most Common Departure Airports by Owner of %s"), $spotter_array[0]['aircraft_owner']); | 
                                                        |
| 22 | 22 |  	require_once('header.php'); | 
                                                        
| 23 | 23 | print '<div class="info column">';  | 
                                                        
| 24 | 24 | print '<h1>'.$spotter_array[0]['aircraft_owner'].'</h1>';  | 
                                                        
@@ -28,16 +28,16 @@ discard block  | 
                                                    ||
| 28 | 28 |  	include('owner-sub-menu.php'); | 
                                                        
| 29 | 29 | print '<div class="column">';  | 
                                                        
| 30 | 30 |  	print '<h2>'._("Most Common Departure Airports by Country").'</h2>'; | 
                                                        
| 31 | -	print '<p>'.sprintf(_("The statistic below shows all departure airports by Country of origin of flights owned by <strong>%s</strong>."),$spotter_array[0]['aircraft_owner']).'</p>'; | 
                                                        |
| 31 | +	print '<p>'.sprintf(_("The statistic below shows all departure airports by Country of origin of flights owned by <strong>%s</strong>."), $spotter_array[0]['aircraft_owner']).'</p>'; | 
                                                        |
| 32 | 32 | |
| 33 | - $airport_country_array = $Spotter->countAllDepartureAirportCountriesByOwner($owner,$filter);  | 
                                                        |
| 33 | + $airport_country_array = $Spotter->countAllDepartureAirportCountriesByOwner($owner, $filter);  | 
                                                        |
| 34 | 34 | print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>';  | 
                                                        
| 35 | 35 | print '<script type="text/javascript" src="'.$globalURL.'/js/topojson.v2.min.js"></script>';  | 
                                                        
| 36 | 36 | print '<script type="text/javascript" src="'.$globalURL.'/js/datamaps.world.min.js"></script>';  | 
                                                        
| 37 | 37 | print '<div id="chartCountry" class="chart" width="100%"></div><script>';  | 
                                                        
| 38 | 38 | print 'var series = [';  | 
                                                        
| 39 | 39 | $country_data = '';  | 
                                                        
| 40 | - foreach($airport_country_array as $airport_item)  | 
                                                        |
| 40 | + foreach ($airport_country_array as $airport_item)  | 
                                                        |
| 41 | 41 |  	{ | 
                                                        
| 42 | 42 | $country_data .= '[ "'.$airport_item['airport_departure_country_iso3'].'",'.$airport_item['airport_departure_country_count'].'],';  | 
                                                        
| 43 | 43 | }  | 
                                                        
@@ -84,7 +84,7 @@ discard block  | 
                                                    ||
| 84 | 84 | print '</thead>';  | 
                                                        
| 85 | 85 | print '<tbody>';  | 
                                                        
| 86 | 86 | $i = 1;  | 
                                                        
| 87 | - foreach($airport_country_array as $airport_item)  | 
                                                        |
| 87 | + foreach ($airport_country_array as $airport_item)  | 
                                                        |
| 88 | 88 |  		{ | 
                                                        
| 89 | 89 | print '<tr>';  | 
                                                        
| 90 | 90 | print '<td><strong>'.$i.'</strong></td>';  | 
                                                        
@@ -7,21 +7,21 @@ discard block  | 
                                                    ||
| 7 | 7 |  	header('Location: '.$globalURL.'/airline'); | 
                                                        
| 8 | 8 | die();  | 
                                                        
| 9 | 9 | }  | 
                                                        
| 10 | -$airline = urldecode(filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING));  | 
                                                        |
| 10 | +$airline = urldecode(filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING));  | 
                                                        |
| 11 | 11 | $Spotter = new Spotter();  | 
                                                        
| 12 | 12 | $alliance = false;  | 
                                                        
| 13 | -if (strpos($airline,'alliance_') !== FALSE) { | 
                                                        |
| 13 | +if (strpos($airline, 'alliance_') !== FALSE) { | 
                                                        |
| 14 | 14 | $alliance = true;  | 
                                                        
| 15 | 15 |  } else { | 
                                                        
| 16 | - $spotter_array = $Spotter->getSpotterDataByAirline($airline,"0,1","");  | 
                                                        |
| 16 | + $spotter_array = $Spotter->getSpotterDataByAirline($airline, "0,1", "");  | 
                                                        |
| 17 | 17 | }  | 
                                                        
| 18 | 18 | |
| 19 | 19 | if (!empty($spotter_array) || $alliance === true)  | 
                                                        
| 20 | 20 |  { | 
                                                        
| 21 | 21 |  	if ($alliance) { | 
                                                        
| 22 | -		$title = sprintf(_("Most Common Routes from %s"),str_replace('_',' ',str_replace('alliance_','',$airline))); | 
                                                        |
| 22 | +		$title = sprintf(_("Most Common Routes from %s"), str_replace('_', ' ', str_replace('alliance_', '', $airline))); | 
                                                        |
| 23 | 23 |  	} else { | 
                                                        
| 24 | -		$title = sprintf(_("Most Common Routes from %s (%s)"),$spotter_array[0]['airline_name'],$spotter_array[0]['airline_icao']); | 
                                                        |
| 24 | +		$title = sprintf(_("Most Common Routes from %s (%s)"), $spotter_array[0]['airline_name'], $spotter_array[0]['airline_icao']); | 
                                                        |
| 25 | 25 | }  | 
                                                        
| 26 | 26 |  	require_once('header.php'); | 
                                                        
| 27 | 27 | print '<div class="select-item">';  | 
                                                        
@@ -31,10 +31,10 @@ discard block  | 
                                                    ||
| 31 | 31 | $alliances = $Spotter->getAllAllianceNames();  | 
                                                        
| 32 | 32 |  	if (!empty($alliances)) { | 
                                                        
| 33 | 33 |  		foreach ($alliances as $al) { | 
                                                        
| 34 | -			if ($alliance && str_replace('_',' ',str_replace('alliance_','',$airline)) == $al['alliance']) { | 
                                                        |
| 35 | -				print '<option value="'.str_replace(' ','_',$al['alliance']).'" selected>'.$al['alliance'].'</option>'; | 
                                                        |
| 34 | +			if ($alliance && str_replace('_', ' ', str_replace('alliance_', '', $airline)) == $al['alliance']) { | 
                                                        |
| 35 | +				print '<option value="'.str_replace(' ', '_', $al['alliance']).'" selected>'.$al['alliance'].'</option>'; | 
                                                        |
| 36 | 36 |  			} else { | 
                                                        
| 37 | -				print '<option value="'.str_replace(' ','_',$al['alliance']).'">'.$al['alliance'].'</option>'; | 
                                                        |
| 37 | +				print '<option value="'.str_replace(' ', '_', $al['alliance']).'">'.$al['alliance'].'</option>'; | 
                                                        |
| 38 | 38 | }  | 
                                                        
| 39 | 39 | }  | 
                                                        
| 40 | 40 | print '<option disabled>───────────────────</option>';  | 
                                                        
@@ -42,9 +42,9 @@ discard block  | 
                                                    ||
| 42 | 42 | $Stats = new Stats();  | 
                                                        
| 43 | 43 | $airline_names = $Stats->getAllAirlineNames();  | 
                                                        
| 44 | 44 | if (empty($airline_names)) $airline_names = $Spotter->getAllAirlineNames();  | 
                                                        
| 45 | - foreach($airline_names as $airline_name)  | 
                                                        |
| 45 | + foreach ($airline_names as $airline_name)  | 
                                                        |
| 46 | 46 |  	{ | 
                                                        
| 47 | - if($airline == $airline_name['airline_icao'])  | 
                                                        |
| 47 | + if ($airline == $airline_name['airline_icao'])  | 
                                                        |
| 48 | 48 |  		{ | 
                                                        
| 49 | 49 |  			print '<option value="'.$airline_name['airline_icao'].'" selected="selected">'.$airline_name['airline_name'].' ('.$airline_name['airline_icao'].')</option>'; | 
                                                        
| 50 | 50 |  		} else { | 
                                                        
@@ -78,12 +78,12 @@ discard block  | 
                                                    ||
| 78 | 78 | print '</div>';  | 
                                                        
| 79 | 79 |  		} else { | 
                                                        
| 80 | 80 | print '<div class="info column">';  | 
                                                        
| 81 | -			print '<h1>'.str_replace('_',' ',str_replace('alliance_','',$airline)).'</h1>'; | 
                                                        |
| 82 | -			if (@getimagesize($globalURL.'/images/airlines/'.str_replace('alliance_','',$airline).'.png') || @getimagesize('images/airlines/'.str_replace('alliance_','',$airline).'.png')) | 
                                                        |
| 81 | +			print '<h1>'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'</h1>'; | 
                                                        |
| 82 | +			if (@getimagesize($globalURL.'/images/airlines/'.str_replace('alliance_', '', $airline).'.png') || @getimagesize('images/airlines/'.str_replace('alliance_', '', $airline).'.png')) | 
                                                        |
| 83 | 83 |  			{ | 
                                                        
| 84 | -				print '<img src="'.$globalURL.'/images/airlines/'.str_replace('alliance_','',$airline).'.png" alt="'.str_replace('_',' ',str_replace('alliance_','',$airline)).'" title="'.str_replace('_',' ',str_replace('alliance_','',$airline)).'" class="logo" />'; | 
                                                        |
| 84 | +				print '<img src="'.$globalURL.'/images/airlines/'.str_replace('alliance_', '', $airline).'.png" alt="'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'" title="'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'" class="logo" />'; | 
                                                        |
| 85 | 85 | }  | 
                                                        
| 86 | -			print '<div><span class="label">'._("Name").'</span>'.str_replace('_',' ',str_replace('alliance_','',$airline)).'</div>'; | 
                                                        |
| 86 | +			print '<div><span class="label">'._("Name").'</span>'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'</div>'; | 
                                                        |
| 87 | 87 | print '</div>';  | 
                                                        
| 88 | 88 | }  | 
                                                        
| 89 | 89 |  	} else { | 
                                                        
@@ -94,12 +94,12 @@ discard block  | 
                                                    ||
| 94 | 94 | print '<div class="column">';  | 
                                                        
| 95 | 95 |  	print '<h2>'._("Most Common Routes").'</h2>'; | 
                                                        
| 96 | 96 |  	if ($alliance) { | 
                                                        
| 97 | -		print '<p>'.sprintf(_("The statistic below shows the most common routes from <strong>%s</strong>."),str_replace('_',' ',str_replace('alliance_','',$airline))).'</p>'; | 
                                                        |
| 97 | +		print '<p>'.sprintf(_("The statistic below shows the most common routes from <strong>%s</strong>."), str_replace('_', ' ', str_replace('alliance_', '', $airline))).'</p>'; | 
                                                        |
| 98 | 98 |  	} else { | 
                                                        
| 99 | -		print '<p>'.sprintf(_("The statistic below shows the most common routes from <strong>%s</strong>."),$spotter_array[0]['airline_name']).'</p>'; | 
                                                        |
| 99 | +		print '<p>'.sprintf(_("The statistic below shows the most common routes from <strong>%s</strong>."), $spotter_array[0]['airline_name']).'</p>'; | 
                                                        |
| 100 | 100 | }  | 
                                                        
| 101 | 101 |  	if ($alliance) { | 
                                                        
| 102 | -		$route_array = $Spotter->countAllRoutesByAirline('',array('alliance' => str_replace('_',' ',str_replace('alliance_','',$airline)))); | 
                                                        |
| 102 | +		$route_array = $Spotter->countAllRoutesByAirline('', array('alliance' => str_replace('_', ' ', str_replace('alliance_', '', $airline)))); | 
                                                        |
| 103 | 103 |  	} else { | 
                                                        
| 104 | 104 | $route_array = $Spotter->countAllRoutesByAirline($airline);  | 
                                                        
| 105 | 105 | }  | 
                                                        
@@ -117,7 +117,7 @@ discard block  | 
                                                    ||
| 117 | 117 | print '</thead>';  | 
                                                        
| 118 | 118 | print '<tbody>';  | 
                                                        
| 119 | 119 | $i = 1;  | 
                                                        
| 120 | - foreach($route_array as $route_item)  | 
                                                        |
| 120 | + foreach ($route_array as $route_item)  | 
                                                        |
| 121 | 121 |  		{ | 
                                                        
| 122 | 122 | print '<tr>';  | 
                                                        
| 123 | 123 | print '<td><strong>'.$i.'</strong></td>';  | 
                                                        
@@ -3,8 +3,8 @@  | 
                                                    ||
| 3 | 3 |  require_once('require/class.Spotter.php'); | 
                                                        
| 4 | 4 |  require_once('require/class.Language.php'); | 
                                                        
| 5 | 5 |  if (!isset($_GET['country'])) { | 
                                                        
| 6 | -        header('Location: '.$globalURL.'/country'); | 
                                                        |
| 7 | - die();  | 
                                                        |
| 6 | +		header('Location: '.$globalURL.'/country'); | 
                                                        |
| 7 | + die();  | 
                                                        |
| 8 | 8 | }  | 
                                                        
| 9 | 9 | $Spotter = new Spotter();  | 
                                                        
| 10 | 10 |  $country = ucwords(str_replace("-", " ", urldecode(filter_input(INPUT_GET,'country',FILTER_SANITIZE_STRING)))); | 
                                                        
@@ -7,8 +7,8 @@ discard block  | 
                                                    ||
| 7 | 7 | die();  | 
                                                        
| 8 | 8 | }  | 
                                                        
| 9 | 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);  | 
                                                        |
| 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 | 12 |  if (isset($_GET['sort'])) { | 
                                                        
| 13 | 13 | $spotter_array = $Spotter->getSpotterDataByCountry($country, "0,1", $sort);  | 
                                                        
| 14 | 14 |  } else { | 
                                                        
@@ -17,16 +17,16 @@ discard block  | 
                                                    ||
| 17 | 17 | |
| 18 | 18 | if (!empty($spotter_array))  | 
                                                        
| 19 | 19 |  { | 
                                                        
| 20 | -	$title = sprintf(_("Most Common Aircraft by registration from %s"),$country); | 
                                                        |
| 20 | +	$title = sprintf(_("Most Common Aircraft by registration from %s"), $country); | 
                                                        |
| 21 | 21 |  	require_once('header.php'); | 
                                                        
| 22 | 22 | print '<div class="select-item">';  | 
                                                        
| 23 | 23 | print '<form action="'.$globalURL.'/country" method="post">';  | 
                                                        
| 24 | 24 | print '<select name="country" class="selectpicker" data-live-search="true">';  | 
                                                        
| 25 | 25 | print '<option></option>';  | 
                                                        
| 26 | 26 | $all_countries = $Spotter->getAllCountries();  | 
                                                        
| 27 | - foreach($all_countries as $all_country)  | 
                                                        |
| 27 | + foreach ($all_countries as $all_country)  | 
                                                        |
| 28 | 28 |  	{ | 
                                                        
| 29 | - if($country == $all_country['country'])  | 
                                                        |
| 29 | + if ($country == $all_country['country'])  | 
                                                        |
| 30 | 30 |  		{ | 
                                                        
| 31 | 31 |  			print '<option value="'.strtolower(str_replace(" ", "-", $all_country['country'])).'" selected="selected">'.$all_country['country'].'</option>'; | 
                                                        
| 32 | 32 |  		} else { | 
                                                        
@@ -41,7 +41,7 @@ discard block  | 
                                                    ||
| 41 | 41 | if ($_GET['country'] != "NA")  | 
                                                        
| 42 | 42 |  	{ | 
                                                        
| 43 | 43 | print '<div class="info column">';  | 
                                                        
| 44 | -		print '<h1>'.sprintf(_("Airports & Airlines from %s"),$country).'</h1>'; | 
                                                        |
| 44 | +		print '<h1>'.sprintf(_("Airports & Airlines from %s"), $country).'</h1>'; | 
                                                        |
| 45 | 45 | print '</div>';  | 
                                                        
| 46 | 46 |  	} else { | 
                                                        
| 47 | 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,7 +50,7 @@ discard block  | 
                                                    ||
| 50 | 50 |  	include('country-sub-menu.php'); | 
                                                        
| 51 | 51 | print '<div class="column">';  | 
                                                        
| 52 | 52 |  	print '<h2>'._("Most Common Aircraft by Registration").'</h2>'; | 
                                                        
| 53 | -	print '<p>'.sprintf(_("The statistic below shows the most common aircraft by registration of airlines or departure/arrival airports from <strong>%s</strong>."),$country).'</p>'; | 
                                                        |
| 53 | +	print '<p>'.sprintf(_("The statistic below shows the most common aircraft by registration of airlines or departure/arrival airports from <strong>%s</strong>."), $country).'</p>'; | 
                                                        |
| 54 | 54 | $aircraft_array = $Spotter->countAllAircraftRegistrationByCountry($country);  | 
                                                        
| 55 | 55 | if (!empty($aircraft_array))  | 
                                                        
| 56 | 56 |  	{ | 
                                                        
@@ -65,7 +65,7 @@ discard block  | 
                                                    ||
| 65 | 65 | print '</thead>';  | 
                                                        
| 66 | 66 | print '<tbody>';  | 
                                                        
| 67 | 67 | $i = 1;  | 
                                                        
| 68 | - foreach($aircraft_array as $aircraft_item)  | 
                                                        |
| 68 | + foreach ($aircraft_array as $aircraft_item)  | 
                                                        |
| 69 | 69 |  		{ | 
                                                        
| 70 | 70 | print '<tr>';  | 
                                                        
| 71 | 71 | print '<td><strong>'.$i.'</strong></td>';  | 
                                                        
@@ -15,9 +15,9 @@ discard block  | 
                                                    ||
| 15 | 15 | </span>  | 
                                                        
| 16 | 16 | <div class="sub-menu sub-menu-container">  | 
                                                        
| 17 | 17 | <ul class="nav nav-pills">  | 
                                                        
| 18 | -		<li><a href="<?php print $globalURL; ?>/registration/<?php print $_GET['registration']; ?>" <?php if (strtolower($current_page) == "registration-detailed"){ print 'class="active"'; } ?>><?php echo _("Detailed"); ?></a></li> | 
                                                        |
| 18 | +		<li><a href="<?php print $globalURL; ?>/registration/<?php print $_GET['registration']; ?>" <?php if (strtolower($current_page) == "registration-detailed") { print 'class="active"'; } ?>><?php echo _("Detailed"); ?></a></li> | 
                                                        |
| 19 | 19 | <li class="dropdown">  | 
                                                        
| 20 | -		    <a class="dropdown-toggle <?php if(strtolower($current_page) == "registration-statistics-departure-airport" || strtolower($current_page) == "registration-statistics-departure-airport-country" || strtolower($current_page) == "registration-statistics-arrival-airport" || strtolower($current_page) == "registration-statistics-arrival-airport-country"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> | 
                                                        |
| 20 | +		    <a class="dropdown-toggle <?php if (strtolower($current_page) == "registration-statistics-departure-airport" || strtolower($current_page) == "registration-statistics-departure-airport-country" || strtolower($current_page) == "registration-statistics-arrival-airport" || strtolower($current_page) == "registration-statistics-arrival-airport-country") { print 'active'; } ?>" data-toggle="dropdown" href="#"> | 
                                                        |
| 21 | 21 |  		      <?php _("Airport"); ?> <span class="caret"></span> | 
                                                        
| 22 | 22 | </a>  | 
                                                        
| 23 | 23 | <ul class="dropdown-menu" role="menu">  | 
                                                        
@@ -27,7 +27,7 @@ discard block  | 
                                                    ||
| 27 | 27 |  			  <li><a href="<?php print $globalURL; ?>/registration/statistics/arrival-airport-country/<?php print $registration; ?>"><?php echo _("Arrival Airport by Country"); ?></a></li> | 
                                                        
| 28 | 28 | </ul>  | 
                                                        
| 29 | 29 | </li>  | 
                                                        
| 30 | -		<li><a href="<?php print $globalURL; ?>/registration/statistics/route/<?php print $registration; ?>" <?php if (strtolower($current_page) == "registration-statistics-route"){ print 'class="active"'; } ?>><?php echo _("Route"); ?></a></li> | 
                                                        |
| 31 | -		<li><a href="<?php print $globalURL; ?>/registration/statistics/time/<?php print $registration; ?>" <?php if (strtolower($current_page) == "registration-statistics-time"){ print 'class="active"'; } ?>><?php echo _("Time"); ?></a></li> | 
                                                        |
| 30 | +		<li><a href="<?php print $globalURL; ?>/registration/statistics/route/<?php print $registration; ?>" <?php if (strtolower($current_page) == "registration-statistics-route") { print 'class="active"'; } ?>><?php echo _("Route"); ?></a></li> | 
                                                        |
| 31 | +		<li><a href="<?php print $globalURL; ?>/registration/statistics/time/<?php print $registration; ?>" <?php if (strtolower($current_page) == "registration-statistics-time") { print 'class="active"'; } ?>><?php echo _("Time"); ?></a></li> | 
                                                        |
| 32 | 32 | </ul>  | 
                                                        
| 33 | 33 | </div>  | 
                                                        
| 34 | 34 | \ No newline at end of file  | 
                                                        
@@ -147,18 +147,18 @@  | 
                                                    ||
| 147 | 147 | |
| 148 | 148 | <?php  | 
                                                        
| 149 | 149 |  	if (isset($_GET['image']) && isset($_GET['q'])) { | 
                                                        
| 150 | - $image = filter_input(INPUT_GET,'image',FILTER_SANITIZE_STRING);  | 
                                                        |
| 151 | - $q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING);  | 
                                                        |
| 150 | + $image = filter_input(INPUT_GET, 'image', FILTER_SANITIZE_STRING);  | 
                                                        |
| 151 | + $q = filter_input(INPUT_GET, 'q', FILTER_SANITIZE_STRING);  | 
                                                        |
| 152 | 152 | ?>  | 
                                                        
| 153 | 153 |     $.getJSON( "<?php print $globalURL; ?>/getLatestData-tv.php?other_i="+other_i+"&image=<?php print $image; ?>&q=<?php print $q; ?>", function( data ) { | 
                                                        
| 154 | 154 | <?php  | 
                                                        
| 155 | 155 |  	} elseif (isset($_GET['image'])) { | 
                                                        
| 156 | - $image = filter_input(INPUT_GET,'image',FILTER_SANITIZE_STRING);  | 
                                                        |
| 156 | + $image = filter_input(INPUT_GET, 'image', FILTER_SANITIZE_STRING);  | 
                                                        |
| 157 | 157 | ?>  | 
                                                        
| 158 | 158 |     $.getJSON( "<?php print $globalURL; ?>/getLatestData-tv.php?other_i="+other_i+"&image=<?php print $image; ?>", function( data ) { | 
                                                        
| 159 | 159 | <?php  | 
                                                        
| 160 | 160 |  	} elseif (isset($_GET['q'])) { | 
                                                        
| 161 | - $q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING);  | 
                                                        |
| 161 | + $q = filter_input(INPUT_GET, 'q', FILTER_SANITIZE_STRING);  | 
                                                        |
| 162 | 162 | ?>  | 
                                                        
| 163 | 163 |     $.getJSON( "<?php print $globalURL; ?>/getLatestData-tv.php?other_i="+other_i+"&q=<?php print $q; ?>", function( data ) { | 
                                                        
| 164 | 164 | <?php  | 
                                                        
@@ -8,13 +8,13 @@ discard block  | 
                                                    ||
| 8 | 8 | }  | 
                                                        
| 9 | 9 | $Spotter = new Spotter();  | 
                                                        
| 10 | 10 | |
| 11 | -$country = ucwords(str_replace("-", " ", urldecode(filter_input(INPUT_GET,'country',FILTER_SANITIZE_STRING)))); | 
                                                        |
| 12 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);  | 
                                                        |
| 11 | +$country = ucwords(str_replace("-", " ", urldecode(filter_input(INPUT_GET, 'country', FILTER_SANITIZE_STRING)))); | 
                                                        |
| 12 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);  | 
                                                        |
| 13 | 13 | $spotter_array = $Spotter->getSpotterDataByCountry($country, "0,1", $sort);  | 
                                                        
| 14 | 14 | |
| 15 | 15 | if (!empty($spotter_array))  | 
                                                        
| 16 | 16 |  { | 
                                                        
| 17 | -	$title = sprintf(_("Most Common Aircraft from %s"),$country); | 
                                                        |
| 17 | +	$title = sprintf(_("Most Common Aircraft from %s"), $country); | 
                                                        |
| 18 | 18 | |
| 19 | 19 |  	require_once('header.php'); | 
                                                        
| 20 | 20 | print '<div class="select-item">';  | 
                                                        
@@ -22,9 +22,9 @@ discard block  | 
                                                    ||
| 22 | 22 | print '<select name="country" class="selectpicker" data-live-search="true">';  | 
                                                        
| 23 | 23 | print '<option></option>';  | 
                                                        
| 24 | 24 | $all_countries = $Spotter->getAllCountries();  | 
                                                        
| 25 | - foreach($all_countries as $all_country)  | 
                                                        |
| 25 | + foreach ($all_countries as $all_country)  | 
                                                        |
| 26 | 26 |  	{ | 
                                                        
| 27 | - if($country == $all_country['country'])  | 
                                                        |
| 27 | + if ($country == $all_country['country'])  | 
                                                        |
| 28 | 28 |  		{ | 
                                                        
| 29 | 29 |  			print '<option value="'.strtolower(str_replace(" ", "-", $all_country['country'])).'" selected="selected">'.$all_country['country'].'</option>'; | 
                                                        
| 30 | 30 |  		} else { | 
                                                        
@@ -39,7 +39,7 @@ discard block  | 
                                                    ||
| 39 | 39 | if ($_GET['country'] != "NA")  | 
                                                        
| 40 | 40 |  	{ | 
                                                        
| 41 | 41 | print '<div class="info column">';  | 
                                                        
| 42 | -		print '<h1>'.sprintf(_("Airports & Airlines from %s"),$country).'</h1>'; | 
                                                        |
| 42 | +		print '<h1>'.sprintf(_("Airports & Airlines from %s"), $country).'</h1>'; | 
                                                        |
| 43 | 43 | print '</div>';  | 
                                                        
| 44 | 44 |  	} else { | 
                                                        
| 45 | 45 |  		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>'; | 
                                                        
@@ -48,7 +48,7 @@ discard block  | 
                                                    ||
| 48 | 48 |  	include('country-sub-menu.php'); | 
                                                        
| 49 | 49 | print '<div class="column">';  | 
                                                        
| 50 | 50 |  	print '<h2>'._("Most Common Aircraft").'</h2>'; | 
                                                        
| 51 | -	print '<p>'.sprintf(_("The statistic below shows the most common aircrafts of flights from <strong>%s</strong>."),$country).'</p>'; | 
                                                        |
| 51 | +	print '<p>'.sprintf(_("The statistic below shows the most common aircrafts of flights from <strong>%s</strong>."), $country).'</p>'; | 
                                                        |
| 52 | 52 | |
| 53 | 53 | $aircraft_array = $Spotter->countAllAircraftTypesByCountry($country);  | 
                                                        
| 54 | 54 | if (!empty($aircraft_array))  | 
                                                        
@@ -62,7 +62,7 @@ discard block  | 
                                                    ||
| 62 | 62 | print '</thead>';  | 
                                                        
| 63 | 63 | print '<tbody>';  | 
                                                        
| 64 | 64 | $i = 1;  | 
                                                        
| 65 | - foreach($aircraft_array as $aircraft_item)  | 
                                                        |
| 65 | + foreach ($aircraft_array as $aircraft_item)  | 
                                                        |
| 66 | 66 |  		{ | 
                                                        
| 67 | 67 | print '<tr>';  | 
                                                        
| 68 | 68 | print '<td><strong>'.$i.'</strong></td>';  | 
                                                        
@@ -4,8 +4,8 @@  | 
                                                    ||
| 4 | 4 |  require_once('require/class.Stats.php'); | 
                                                        
| 5 | 5 |  require_once('require/class.Language.php'); | 
                                                        
| 6 | 6 |  if (!isset($_GET['airline'])) { | 
                                                        
| 7 | -        header('Location: '.$globalURL.'/airline'); | 
                                                        |
| 8 | - die();  | 
                                                        |
| 7 | +		header('Location: '.$globalURL.'/airline'); | 
                                                        |
| 8 | + die();  | 
                                                        |
| 9 | 9 | }  | 
                                                        
| 10 | 10 | $airline = urldecode(filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING));  | 
                                                        
| 11 | 11 | $Spotter = new Spotter();  | 
                                                        
@@ -7,21 +7,21 @@ discard block  | 
                                                    ||
| 7 | 7 |          header('Location: '.$globalURL.'/airline'); | 
                                                        
| 8 | 8 | die();  | 
                                                        
| 9 | 9 | }  | 
                                                        
| 10 | -$airline = urldecode(filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING));  | 
                                                        |
| 10 | +$airline = urldecode(filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING));  | 
                                                        |
| 11 | 11 | $Spotter = new Spotter();  | 
                                                        
| 12 | 12 | $alliance = false;  | 
                                                        
| 13 | -if (strpos($airline,'alliance_') !== FALSE) { | 
                                                        |
| 13 | +if (strpos($airline, 'alliance_') !== FALSE) { | 
                                                        |
| 14 | 14 | $alliance = true;  | 
                                                        
| 15 | 15 |  } else { | 
                                                        
| 16 | - $spotter_array = $Spotter->getSpotterDataByAirline($airline,"0,1","");  | 
                                                        |
| 16 | + $spotter_array = $Spotter->getSpotterDataByAirline($airline, "0,1", "");  | 
                                                        |
| 17 | 17 | }  | 
                                                        
| 18 | 18 | |
| 19 | 19 | if (!empty($spotter_array) || $alliance === true)  | 
                                                        
| 20 | 20 |  { | 
                                                        
| 21 | 21 |  	if ($alliance) { | 
                                                        
| 22 | -		$title = sprintf(_("Most Common Arrival Airports by Country from %s"),str_replace('_',' ',str_replace('alliance_','',$airline))); | 
                                                        |
| 22 | +		$title = sprintf(_("Most Common Arrival Airports by Country from %s"), str_replace('_', ' ', str_replace('alliance_', '', $airline))); | 
                                                        |
| 23 | 23 |  	} else { | 
                                                        
| 24 | -		$title = sprintf(_("Most Common Arrival Airports by Country from %s (%s)"),$spotter_array[0]['airline_name'],$spotter_array[0]['airline_icao']); | 
                                                        |
| 24 | +		$title = sprintf(_("Most Common Arrival Airports by Country from %s (%s)"), $spotter_array[0]['airline_name'], $spotter_array[0]['airline_icao']); | 
                                                        |
| 25 | 25 | }  | 
                                                        
| 26 | 26 |  	require_once('header.php'); | 
                                                        
| 27 | 27 | print '<div class="select-item">';  | 
                                                        
@@ -31,10 +31,10 @@ discard block  | 
                                                    ||
| 31 | 31 | $alliances = $Spotter->getAllAllianceNames();  | 
                                                        
| 32 | 32 |  	if (!empty($alliances)) { | 
                                                        
| 33 | 33 |  		foreach ($alliances as $al) { | 
                                                        
| 34 | -			if ($alliance && str_replace('_',' ',str_replace('alliance_','',$airline)) == $al['alliance']) { | 
                                                        |
| 35 | -				print '<option value="'.str_replace(' ','_',$al['alliance']).'" selected>'.$al['alliance'].'</option>'; | 
                                                        |
| 34 | +			if ($alliance && str_replace('_', ' ', str_replace('alliance_', '', $airline)) == $al['alliance']) { | 
                                                        |
| 35 | +				print '<option value="'.str_replace(' ', '_', $al['alliance']).'" selected>'.$al['alliance'].'</option>'; | 
                                                        |
| 36 | 36 |  			} else { | 
                                                        
| 37 | -				print '<option value="'.str_replace(' ','_',$al['alliance']).'">'.$al['alliance'].'</option>'; | 
                                                        |
| 37 | +				print '<option value="'.str_replace(' ', '_', $al['alliance']).'">'.$al['alliance'].'</option>'; | 
                                                        |
| 38 | 38 | }  | 
                                                        
| 39 | 39 | }  | 
                                                        
| 40 | 40 | print '<option disabled>─────────────────</option>';  | 
                                                        
@@ -42,9 +42,9 @@ discard block  | 
                                                    ||
| 42 | 42 | $Stats = new Stats();  | 
                                                        
| 43 | 43 | $airline_names = $Stats->getAllAirlineNames();  | 
                                                        
| 44 | 44 | if (empty($airline_names)) $airline_names = $Spotter->getAllAirlineNames();  | 
                                                        
| 45 | - foreach($airline_names as $airline_name)  | 
                                                        |
| 45 | + foreach ($airline_names as $airline_name)  | 
                                                        |
| 46 | 46 |  	{ | 
                                                        
| 47 | - if($_GET['airline'] == $airline_name['airline_icao'])  | 
                                                        |
| 47 | + if ($_GET['airline'] == $airline_name['airline_icao'])  | 
                                                        |
| 48 | 48 |  		{ | 
                                                        
| 49 | 49 |  			print '<option value="'.$airline_name['airline_icao'].'" selected="selected">'.$airline_name['airline_name'].' ('.$airline_name['airline_icao'].')</option>'; | 
                                                        
| 50 | 50 |  		} else { | 
                                                        
@@ -78,12 +78,12 @@ discard block  | 
                                                    ||
| 78 | 78 | print '</div>';  | 
                                                        
| 79 | 79 |  		} else { | 
                                                        
| 80 | 80 | print '<div class="info column">';  | 
                                                        
| 81 | -			print '<h1>'.str_replace('_',' ',str_replace('alliance_','',$airline)).'</h1>'; | 
                                                        |
| 82 | -			if (@getimagesize($globalURL.'/images/airlines/'.str_replace('alliance_','',$airline).'.png') || @getimagesize('images/airlines/'.str_replace('alliance_','',$airline).'.png')) | 
                                                        |
| 81 | +			print '<h1>'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'</h1>'; | 
                                                        |
| 82 | +			if (@getimagesize($globalURL.'/images/airlines/'.str_replace('alliance_', '', $airline).'.png') || @getimagesize('images/airlines/'.str_replace('alliance_', '', $airline).'.png')) | 
                                                        |
| 83 | 83 |  			{ | 
                                                        
| 84 | -				print '<img src="'.$globalURL.'/images/airlines/'.str_replace('alliance_','',$airline).'.png" alt="'.str_replace('_',' ',str_replace('alliance_','',$airline)).'" title="'.str_replace('_',' ',str_replace('alliance_','',$airline)).'" class="logo" />'; | 
                                                        |
| 84 | +				print '<img src="'.$globalURL.'/images/airlines/'.str_replace('alliance_', '', $airline).'.png" alt="'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'" title="'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'" class="logo" />'; | 
                                                        |
| 85 | 85 | }  | 
                                                        
| 86 | -			print '<div><span class="label">'._("Name").'</span>'.str_replace('_',' ',str_replace('alliance_','',$airline)).'</div>'; | 
                                                        |
| 86 | +			print '<div><span class="label">'._("Name").'</span>'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'</div>'; | 
                                                        |
| 87 | 87 | print '</div>';  | 
                                                        
| 88 | 88 | }  | 
                                                        
| 89 | 89 |  	} else { | 
                                                        
@@ -94,9 +94,9 @@ discard block  | 
                                                    ||
| 94 | 94 | print '<div class="column">';  | 
                                                        
| 95 | 95 |  	print '<h2>'._("Most Common Arrival Airports by Country").'</h2>'; | 
                                                        
| 96 | 96 |  	if ($alliance) { | 
                                                        
| 97 | -		print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights from <strong>%s</strong>."),str_replace('_',' ',str_replace('alliance_','',$airline))).'</p>'; | 
                                                        |
| 97 | +		print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights from <strong>%s</strong>."), str_replace('_', ' ', str_replace('alliance_', '', $airline))).'</p>'; | 
                                                        |
| 98 | 98 |  	} else { | 
                                                        
| 99 | -		print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights from <strong>%s</strong>."),$spotter_array[0]['airline_name']).'</p>'; | 
                                                        |
| 99 | +		print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights from <strong>%s</strong>."), $spotter_array[0]['airline_name']).'</p>'; | 
                                                        |
| 100 | 100 | }  | 
                                                        
| 101 | 101 | /*  | 
                                                        
| 102 | 102 |  	if ($alliance) { | 
                                                        
@@ -105,14 +105,14 @@ discard block  | 
                                                    ||
| 105 | 105 | $airport_country_array = $Spotter->countAllArrivalAirportCountriesByAirline($airline);  | 
                                                        
| 106 | 106 | }  | 
                                                        
| 107 | 107 | */  | 
                                                        
| 108 | - $airport_country_array = $Stats->countAllArrivalCountries(true,$airline);  | 
                                                        |
| 108 | + $airport_country_array = $Stats->countAllArrivalCountries(true, $airline);  | 
                                                        |
| 109 | 109 | print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>';  | 
                                                        
| 110 | 110 | print '<script type="text/javascript" src="'.$globalURL.'/js/topojson.v2.min.js"></script>';  | 
                                                        
| 111 | 111 | print '<script type="text/javascript" src="'.$globalURL.'/js/datamaps.world.min.js"></script>';  | 
                                                        
| 112 | 112 | print '<div id="chartCountry" class="chart" width="100%"></div><script>';  | 
                                                        
| 113 | 113 | print 'var series = [';  | 
                                                        
| 114 | 114 | $country_data = '';  | 
                                                        
| 115 | - foreach($airport_country_array as $airport_item)  | 
                                                        |
| 115 | + foreach ($airport_country_array as $airport_item)  | 
                                                        |
| 116 | 116 |  	{ | 
                                                        
| 117 | 117 | $country_data .= '[ "'.$airport_item['arrival_airport_country_iso3'].'",'.$airport_item['airport_arrival_country_count'].'],';  | 
                                                        
| 118 | 118 | }  | 
                                                        
@@ -160,7 +160,7 @@ discard block  | 
                                                    ||
| 160 | 160 | print '</thead>';  | 
                                                        
| 161 | 161 | print '<tbody>';  | 
                                                        
| 162 | 162 | $i = 1;  | 
                                                        
| 163 | - foreach($airport_country_array as $airport_item)  | 
                                                        |
| 163 | + foreach ($airport_country_array as $airport_item)  | 
                                                        |
| 164 | 164 |  		{ | 
                                                        
| 165 | 165 | print '<tr>';  | 
                                                        
| 166 | 166 | print '<td><strong>'.$i.'</strong></td>';  |