@@ -14,7 +14,7 @@  | 
                                                    ||
| 14 | 14 | $limit_start = 0;  | 
                                                        
| 15 | 15 | $limit_end = 25;  | 
                                                        
| 16 | 16 | $absolute_difference = 25;  | 
                                                        
| 17 | -	}  else { | 
                                                        |
| 17 | +	} else { | 
                                                        |
| 18 | 18 |  		$limit_explode = explode(",", $_GET['limit']); | 
                                                        
| 19 | 19 | $limit_start = $limit_explode[0];  | 
                                                        
| 20 | 20 | $limit_end = $limit_explode[1];  | 
                                                        
@@ -1,20 +1,20 @@ discard block  | 
                                                    ||
| 1 | 1 | <?php  | 
                                                        
| 2 | 2 |  require_once('require/class.Connection.php'); | 
                                                        
| 3 | -require_once('require/class.Spotter.php');; | 
                                                        |
| 3 | +require_once('require/class.Spotter.php'); ; | 
                                                        |
| 4 | 4 |  require_once('require/class.Language.php'); | 
                                                        
| 5 | 5 | |
| 6 | -if (!isset($_GET['date'])){ | 
                                                        |
| 6 | +if (!isset($_GET['date'])) { | 
                                                        |
| 7 | 7 |  	header('Location: '.$globalURL.''); | 
                                                        
| 8 | 8 |  } else { | 
                                                        
| 9 | 9 | $Spotter = new Spotter();  | 
                                                        
| 10 | 10 | |
| 11 | 11 | //calculuation for the pagination  | 
                                                        
| 12 | - if(!isset($_GET['limit']))  | 
                                                        |
| 12 | + if (!isset($_GET['limit']))  | 
                                                        |
| 13 | 13 |  	{ | 
                                                        
| 14 | 14 | $limit_start = 0;  | 
                                                        
| 15 | 15 | $limit_end = 25;  | 
                                                        
| 16 | 16 | $absolute_difference = 25;  | 
                                                        
| 17 | -	}  else { | 
                                                        |
| 17 | +	} else { | 
                                                        |
| 18 | 18 |  		$limit_explode = explode(",", $_GET['limit']); | 
                                                        
| 19 | 19 | $limit_start = $limit_explode[0];  | 
                                                        
| 20 | 20 | $limit_end = $limit_explode[1];  | 
                                                        
@@ -28,22 +28,22 @@ discard block  | 
                                                    ||
| 28 | 28 | $limit_previous_1 = $limit_start - $absolute_difference;  | 
                                                        
| 29 | 29 | $limit_previous_2 = $limit_end - $absolute_difference;  | 
                                                        
| 30 | 30 | |
| 31 | - $date = filter_input(INPUT_GET,'date',FILTER_SANITIZE_STRING);  | 
                                                        |
| 31 | + $date = filter_input(INPUT_GET, 'date', FILTER_SANITIZE_STRING);  | 
                                                        |
| 32 | 32 | $page_url = $globalURL.'/date/'.$date;  | 
                                                        
| 33 | 33 | |
| 34 | - $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);  | 
                                                        |
| 34 | + $sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);  | 
                                                        |
| 35 | 35 | if ($sort != '')  | 
                                                        
| 36 | 36 |  	{ | 
                                                        
| 37 | - $spotter_array = $Spotter->getSpotterDataByDate($date,$limit_start.",".$absolute_difference, $sort);  | 
                                                        |
| 37 | + $spotter_array = $Spotter->getSpotterDataByDate($date, $limit_start.",".$absolute_difference, $sort);  | 
                                                        |
| 38 | 38 |  	} else { | 
                                                        
| 39 | - $spotter_array = $Spotter->getSpotterDataByDate($date,$limit_start.",".$absolute_difference);  | 
                                                        |
| 39 | + $spotter_array = $Spotter->getSpotterDataByDate($date, $limit_start.",".$absolute_difference);  | 
                                                        |
| 40 | 40 | }  | 
                                                        
| 41 | 41 | |
| 42 | 42 | |
| 43 | 43 | if (!empty($spotter_array))  | 
                                                        
| 44 | 44 |  	{ | 
                                                        
| 45 | 45 | date_default_timezone_set($globalTimezone);  | 
                                                        
| 46 | -		$title = sprintf(_("Detailed View for flights from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); | 
                                                        |
| 46 | +		$title = sprintf(_("Detailed View for flights from %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); | 
                                                        |
| 47 | 47 | |
| 48 | 48 |  		require_once('header.php'); | 
                                                        
| 49 | 49 | print '<div class="select-item">';  | 
                                                        
@@ -61,12 +61,12 @@ discard block  | 
                                                    ||
| 61 | 61 |  		print '<script type="text/javascript">$(function () { $("#datepicker").datetimepicker({ format: "YYYY-MM-DD", defaultDate: "'.$date.'" }); }); </script>'; | 
                                                        
| 62 | 62 | print '<br />';  | 
                                                        
| 63 | 63 | print '<div class="info column">';  | 
                                                        
| 64 | -		print '<h1>'.sprintf(_("Flights from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; | 
                                                        |
| 64 | +		print '<h1>'.sprintf(_("Flights from %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; | 
                                                        |
| 65 | 65 | print '</div>';  | 
                                                        
| 66 | 66 | |
| 67 | 67 |  		include('date-sub-menu.php'); | 
                                                        
| 68 | 68 | print '<div class="table column">';  | 
                                                        
| 69 | -		print '<p>'.sprintf(_("The table below shows the detailed information of all flights on <strong>%s</strong>."),date("l M j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; | 
                                                        |
| 69 | +		print '<p>'.sprintf(_("The table below shows the detailed information of all flights on <strong>%s</strong>."), date("l M j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; | 
                                                        |
| 70 | 70 | |
| 71 | 71 |  		include('table-output.php'); | 
                                                        
| 72 | 72 | print '<div class="pagination">';  | 
                                                        
@@ -7,8 +7,8 @@ discard block  | 
                                                    ||
| 7 | 7 | die();  | 
                                                        
| 8 | 8 | }  | 
                                                        
| 9 | 9 | $Spotter = new Spotter();  | 
                                                        
| 10 | -$country = ucwords(str_replace("-", " ", filter_input(INPUT_GET,'country',FILTER_SANITIZE_STRING))); | 
                                                        |
| 11 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);  | 
                                                        |
| 10 | +$country = ucwords(str_replace("-", " ", filter_input(INPUT_GET, 'country', FILTER_SANITIZE_STRING))); | 
                                                        |
| 11 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);  | 
                                                        |
| 12 | 12 | |
| 13 | 13 |  if (isset($_GET['sort'])) { | 
                                                        
| 14 | 14 | $spotter_array = $Spotter->getSpotterDataByCountry($country, "0,1", $sort);  | 
                                                        
@@ -18,16 +18,16 @@ discard block  | 
                                                    ||
| 18 | 18 | |
| 19 | 19 | if (!empty($spotter_array))  | 
                                                        
| 20 | 20 |  { | 
                                                        
| 21 | -	$title = sprintf(_("Most Common Time of Day from %s"),$country); | 
                                                        |
| 21 | +	$title = sprintf(_("Most Common Time of Day from %s"), $country); | 
                                                        |
| 22 | 22 |  	require_once('header.php'); | 
                                                        
| 23 | 23 | print '<div class="select-item">';  | 
                                                        
| 24 | 24 | print '<form action="'.$globalURL.'/country" method="post">';  | 
                                                        
| 25 | 25 | print '<select name="country" class="selectpicker" data-live-search="true">';  | 
                                                        
| 26 | 26 | print '<option></option>';  | 
                                                        
| 27 | 27 | $all_countries = $Spotter->getAllCountries();  | 
                                                        
| 28 | - foreach($all_countries as $all_country)  | 
                                                        |
| 28 | + foreach ($all_countries as $all_country)  | 
                                                        |
| 29 | 29 |  	{ | 
                                                        
| 30 | - if($country == $all_country['country'])  | 
                                                        |
| 30 | + if ($country == $all_country['country'])  | 
                                                        |
| 31 | 31 |  		{ | 
                                                        
| 32 | 32 |  			print '<option value="'.strtolower(str_replace(" ", "-", $all_country['country'])).'" selected="selected">'.$all_country['country'].'</option>'; | 
                                                        
| 33 | 33 |  		} else { | 
                                                        
@@ -42,7 +42,7 @@ discard block  | 
                                                    ||
| 42 | 42 | if ($_GET['country'] != "NA")  | 
                                                        
| 43 | 43 |  	{ | 
                                                        
| 44 | 44 | print '<div class="info column">';  | 
                                                        
| 45 | -		print '<h1>'.sprintf(_("Airports & Airlines from %s"),$country).'</h1>'; | 
                                                        |
| 45 | +		print '<h1>'.sprintf(_("Airports & Airlines from %s"), $country).'</h1>'; | 
                                                        |
| 46 | 46 | print '</div>';  | 
                                                        
| 47 | 47 |  	} else { | 
                                                        
| 48 | 48 |  		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>'; | 
                                                        
@@ -51,7 +51,7 @@ discard block  | 
                                                    ||
| 51 | 51 |  	include('country-sub-menu.php'); | 
                                                        
| 52 | 52 | print '<div class="column">';  | 
                                                        
| 53 | 53 |  	print '<h2>'._("Most Common Time of Day").'</h2>'; | 
                                                        
| 54 | -	print '<p>'.sprintf(_("The statistic below shows the most common time of day of airports & airlines from <strong>%s</strong>."),$country).'</p>'; | 
                                                        |
| 54 | +	print '<p>'.sprintf(_("The statistic below shows the most common time of day of airports & airlines from <strong>%s</strong>."), $country).'</p>'; | 
                                                        |
| 55 | 55 | $hour_array = $Spotter->countAllHoursByCountry($country);  | 
                                                        
| 56 | 56 | print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>';  | 
                                                        
| 57 | 57 | print '<div id="chartHour" class="chart" width="100%"></div>  | 
                                                        
@@ -62,7 +62,7 @@ discard block  | 
                                                    ||
| 62 | 62 | var data = google.visualization.arrayToDataTable([  | 
                                                        
| 63 | 63 |              	["'._("Hour").'", "'._("# of Flights").'"], '; | 
                                                        
| 64 | 64 | $hour_data = '';  | 
                                                        
| 65 | - foreach($hour_array as $hour_item)  | 
                                                        |
| 65 | + foreach ($hour_array as $hour_item)  | 
                                                        |
| 66 | 66 |  	{ | 
                                                        
| 67 | 67 |  		$hour_data .= '[ "'.date("ga", strtotime($hour_item['hour_name'].":00")).'",'.$hour_item['hour_count'].'],'; | 
                                                        
| 68 | 68 | }  | 
                                                        
@@ -8,14 +8,14 @@ discard block  | 
                                                    ||
| 8 | 8 |  require_once('require/class.Spotter.php'); | 
                                                        
| 9 | 9 |  require_once('require/class.Language.php'); | 
                                                        
| 10 | 10 | $Spotter = new Spotter();  | 
                                                        
| 11 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);  | 
                                                        |
| 11 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);  | 
                                                        |
| 12 | 12 |  if (isset($_GET['departure_airport']) && isset($_GET['arrival_airport'])) { | 
                                                        
| 13 | 13 | $spotter_array = $Spotter->getSpotterDataByRoute($_GET['departure_airport'], $_GET['arrival_airport'], "0,1", $sort);  | 
                                                        
| 14 | 14 | } else $spotter_array = array();  | 
                                                        
| 15 | 15 | |
| 16 | 16 | if (!empty($spotter_array))  | 
                                                        
| 17 | 17 |  { | 
                                                        
| 18 | -	$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']); | 
                                                        |
| 18 | +	$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']); | 
                                                        |
| 19 | 19 |  	require_once('header.php'); | 
                                                        
| 20 | 20 | print '<div class="info column">';  | 
                                                        
| 21 | 21 |  	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>'; | 
                                                        
@@ -26,7 +26,7 @@ discard block  | 
                                                    ||
| 26 | 26 |  	include('route-sub-menu.php'); | 
                                                        
| 27 | 27 | print '<div class="column">';  | 
                                                        
| 28 | 28 |  	print '<h2>'._("Most Common Airlines").'</h2>'; | 
                                                        
| 29 | -	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>'; | 
                                                        |
| 29 | +	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>'; | 
                                                        |
| 30 | 30 | $airline_array = $Spotter->countAllAirlinesByRoute($_GET['departure_airport'], $_GET['arrival_airport']);  | 
                                                        
| 31 | 31 | if (!empty($airline_array))  | 
                                                        
| 32 | 32 |  	{ | 
                                                        
@@ -42,7 +42,7 @@ discard block  | 
                                                    ||
| 42 | 42 | print '</thead>';  | 
                                                        
| 43 | 43 | print '<tbody>';  | 
                                                        
| 44 | 44 | $i = 1;  | 
                                                        
| 45 | - foreach($airline_array as $airline_item)  | 
                                                        |
| 45 | + foreach ($airline_array as $airline_item)  | 
                                                        |
| 46 | 46 |  		{ | 
                                                        
| 47 | 47 | print '<tr>';  | 
                                                        
| 48 | 48 | print '<td><strong>'.$i.'</strong></td>';  | 
                                                        
@@ -11,7 +11,9 @@  | 
                                                    ||
| 11 | 11 | $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);  | 
                                                        
| 12 | 12 |  if (isset($_GET['departure_airport']) && isset($_GET['arrival_airport'])) { | 
                                                        
| 13 | 13 | $spotter_array = $Spotter->getSpotterDataByRoute($_GET['departure_airport'], $_GET['arrival_airport'], "0,1", $sort);  | 
                                                        
| 14 | -} else $spotter_array = array();  | 
                                                        |
| 14 | +} else { | 
                                                        |
| 15 | + $spotter_array = array();  | 
                                                        |
| 16 | +}  | 
                                                        |
| 15 | 17 | |
| 16 | 18 | if (!empty($spotter_array))  | 
                                                        
| 17 | 19 |  { | 
                                                        
@@ -7,8 +7,8 @@ discard block  | 
                                                    ||
| 7 | 7 | die();  | 
                                                        
| 8 | 8 | }  | 
                                                        
| 9 | 9 | $Spotter = new Spotter();  | 
                                                        
| 10 | -$country = ucwords(str_replace("-", " ", filter_input(INPUT_GET,'country',FILTER_SANITIZE_STRING))); | 
                                                        |
| 11 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);  | 
                                                        |
| 10 | +$country = ucwords(str_replace("-", " ", filter_input(INPUT_GET, 'country', FILTER_SANITIZE_STRING))); | 
                                                        |
| 11 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);  | 
                                                        |
| 12 | 12 | |
| 13 | 13 |  if (isset($_GET['sort'])) { | 
                                                        
| 14 | 14 | $spotter_array = $Spotter->getSpotterDataByCountry($country, "0,1", $sort);  | 
                                                        
@@ -18,16 +18,16 @@ discard block  | 
                                                    ||
| 18 | 18 | |
| 19 | 19 | if (!empty($spotter_array))  | 
                                                        
| 20 | 20 |  { | 
                                                        
| 21 | -	$title = sprintf(_("Most Common Departure Airports from %s"),$country); | 
                                                        |
| 21 | +	$title = sprintf(_("Most Common Departure Airports from %s"), $country); | 
                                                        |
| 22 | 22 |  	require_once('header.php'); | 
                                                        
| 23 | 23 | print '<div class="select-item">';  | 
                                                        
| 24 | 24 | print '<form action="'.$globalURL.'/country" method="post">';  | 
                                                        
| 25 | 25 | print '<select name="country" class="selectpicker" data-live-search="true">';  | 
                                                        
| 26 | 26 | print '<option></option>';  | 
                                                        
| 27 | 27 | $all_countries = $Spotter->getAllCountries();  | 
                                                        
| 28 | - foreach($all_countries as $all_country)  | 
                                                        |
| 28 | + foreach ($all_countries as $all_country)  | 
                                                        |
| 29 | 29 |  	{ | 
                                                        
| 30 | - if($country == $all_country['country'])  | 
                                                        |
| 30 | + if ($country == $all_country['country'])  | 
                                                        |
| 31 | 31 |  		{ | 
                                                        
| 32 | 32 |  			print '<option value="'.strtolower(str_replace(" ", "-", $all_country['country'])).'" selected="selected">'.$all_country['country'].'</option>'; | 
                                                        
| 33 | 33 |  		} 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 Departure Airports").'</h2>'; | 
                                                        
| 53 | -	print '<p>'.sprintf(_("The statistic below shows all departure airports of flights of airports & airlines from <strong>%s</strong>."),$country).'</p>'; | 
                                                        |
| 53 | +	print '<p>'.sprintf(_("The statistic below shows all departure airports of flights of airports & airlines from <strong>%s</strong>."), $country).'</p>'; | 
                                                        |
| 54 | 54 | |
| 55 | 55 | $airport_airport_array = $Spotter->countAllDepartureAirportsByCountry($country);  | 
                                                        
| 56 | 56 | print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>  | 
                                                        
@@ -66,7 +66,7 @@ discard block  | 
                                                    ||
| 66 | 66 |          	["'._("Airport").'", "'._("# of times").'"],'; | 
                                                        
| 67 | 67 | |
| 68 | 68 | $airport_data = '';  | 
                                                        
| 69 | - foreach($airport_airport_array as $airport_item)  | 
                                                        |
| 69 | + foreach ($airport_airport_array as $airport_item)  | 
                                                        |
| 70 | 70 |  	{ | 
                                                        
| 71 | 71 |  		$name = $airport_item['airport_departure_city'].', '.$airport_item['airport_departure_country'].' ('.$airport_item['airport_departure_icao'].')'; | 
                                                        
| 72 | 72 |  		$name = str_replace("'", "", $name); | 
                                                        
@@ -104,7 +104,7 @@ discard block  | 
                                                    ||
| 104 | 104 | print '</thead>';  | 
                                                        
| 105 | 105 | print '<tbody>';  | 
                                                        
| 106 | 106 | $i = 1;  | 
                                                        
| 107 | - foreach($airport_airport_array as $airport_item)  | 
                                                        |
| 107 | + foreach ($airport_airport_array as $airport_item)  | 
                                                        |
| 108 | 108 |  	{ | 
                                                        
| 109 | 109 | print '<tr>';  | 
                                                        
| 110 | 110 | print '<td><strong>'.$i.'</strong></td>';  | 
                                                        
@@ -7,12 +7,12 @@ discard block  | 
                                                    ||
| 7 | 7 |  require_once('header.php'); | 
                                                        
| 8 | 8 | |
| 9 | 9 | //calculuation for the pagination  | 
                                                        
| 10 | -if(!isset($_GET['limit']))  | 
                                                        |
| 10 | +if (!isset($_GET['limit']))  | 
                                                        |
| 11 | 11 |  { | 
                                                        
| 12 | 12 | $limit_start = 0;  | 
                                                        
| 13 | 13 | $limit_end = 25;  | 
                                                        
| 14 | 14 | $absolute_difference = 25;  | 
                                                        
| 15 | -}  else { | 
                                                        |
| 15 | +} else { | 
                                                        |
| 16 | 16 |  	$limit_explode = explode(",", $_GET['limit']); | 
                                                        
| 17 | 17 | $limit_start = $limit_explode[0];  | 
                                                        
| 18 | 18 | $limit_end = $limit_explode[1];  | 
                                                        
@@ -34,10 +34,10 @@ discard block  | 
                                                    ||
| 34 | 34 | print '<div class="table column">';  | 
                                                        
| 35 | 35 |  print '<p>'._("The table below shows the detailed information of all recent flights.").'</p>'; | 
                                                        
| 36 | 36 | |
| 37 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);  | 
                                                        |
| 37 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);  | 
                                                        |
| 38 | 38 | $sql_begin = microtime(true);  | 
                                                        
| 39 | 39 | $spotter_array = $Spotter->getLatestSpotterData($limit_start.",".$absolute_difference, $sort);  | 
                                                        
| 40 | -$sql_time = microtime(true)-$sql_begin;  | 
                                                        |
| 40 | +$sql_time = microtime(true) - $sql_begin;  | 
                                                        |
| 41 | 41 | |
| 42 | 42 | $page_begin = microtime(true);  | 
                                                        
| 43 | 43 | if (!empty($spotter_array))  | 
                                                        
@@ -55,6 +55,6 @@ discard block  | 
                                                    ||
| 55 | 55 | print '</div>';  | 
                                                        
| 56 | 56 | print '</div>';  | 
                                                        
| 57 | 57 | }  | 
                                                        
| 58 | -$page_time = microtime(true)-$page_begin;  | 
                                                        |
| 58 | +$page_time = microtime(true) - $page_begin;  | 
                                                        |
| 59 | 59 |  require_once('footer.php'); | 
                                                        
| 60 | 60 | ?>  | 
                                                        
| 61 | 61 | \ No newline at end of file  | 
                                                        
@@ -12,7 +12,7 @@  | 
                                                    ||
| 12 | 12 | $limit_start = 0;  | 
                                                        
| 13 | 13 | $limit_end = 25;  | 
                                                        
| 14 | 14 | $absolute_difference = 25;  | 
                                                        
| 15 | -}  else { | 
                                                        |
| 15 | +} else { | 
                                                        |
| 16 | 16 |  	$limit_explode = explode(",", $_GET['limit']); | 
                                                        
| 17 | 17 | $limit_start = $limit_explode[0];  | 
                                                        
| 18 | 18 | $limit_end = $limit_explode[1];  | 
                                                        
@@ -29,7 +29,7 @@ discard block  | 
                                                    ||
| 29 | 29 | <?php  | 
                                                        
| 30 | 30 | if (isset($_GET['q']))  | 
                                                        
| 31 | 31 |  { | 
                                                        
| 32 | - $spotter_array = $Spotter->searchSpotterData($_GET['q'],"","","","","","","","","","","","","","","","","","0,10","","");  | 
                                                        |
| 32 | + $spotter_array = $Spotter->searchSpotterData($_GET['q'], "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "0,10", "", "");  | 
                                                        |
| 33 | 33 |  } else { | 
                                                        
| 34 | 34 |  	$spotter_array = $Spotter->getLatestSpotterData("0,10", ""); | 
                                                        
| 35 | 35 | }  | 
                                                        
@@ -37,7 +37,7 @@ discard block  | 
                                                    ||
| 37 | 37 | print '<div class="table-responsive">';  | 
                                                        
| 38 | 38 | print '<table id="table-tv">';  | 
                                                        
| 39 | 39 | print '<tbody>';  | 
                                                        
| 40 | -foreach($spotter_array as $spotter_item)  | 
                                                        |
| 40 | +foreach ($spotter_array as $spotter_item)  | 
                                                        |
| 41 | 41 |  { | 
                                                        
| 42 | 42 |  	if (isset($globalTimezone)) { | 
                                                        
| 43 | 43 | date_default_timezone_set($globalTimezone);  | 
                                                        
@@ -41,7 +41,9 @@ discard block  | 
                                                    ||
| 41 | 41 |  { | 
                                                        
| 42 | 42 |  	if (isset($globalTimezone)) { | 
                                                        
| 43 | 43 | date_default_timezone_set($globalTimezone);  | 
                                                        
| 44 | -	} else date_default_timezone_set('UTC'); | 
                                                        |
| 44 | +	} else { | 
                                                        |
| 45 | +		date_default_timezone_set('UTC'); | 
                                                        |
| 46 | + }  | 
                                                        |
| 45 | 47 | print '<tr>';  | 
                                                        
| 46 | 48 | if (isset($_GET['image']) && $_GET['image'] == "true")  | 
                                                        
| 47 | 49 |  	{ | 
                                                        
@@ -98,10 +100,14 @@ discard block  | 
                                                    ||
| 98 | 100 | print '</div>';  | 
                                                        
| 99 | 101 | print '<div class="other2">';  | 
                                                        
| 100 | 102 | print '<span><i class="fa fa-arrow-up"></i> '.$spotter_item['departure_airport_city'].', '.$spotter_item['departure_airport_name'].', '.$spotter_item['departure_airport_country'];  | 
                                                        
| 101 | -	if (isset($spotter_item['departure_airport_time']) && $spotter_item['departure_airport_time'] != '') print ' ('.$spotter_item['departure_airport_time'].')'; | 
                                                        |
| 103 | +	if (isset($spotter_item['departure_airport_time']) && $spotter_item['departure_airport_time'] != '') { | 
                                                        |
| 104 | +		print ' ('.$spotter_item['departure_airport_time'].')'; | 
                                                        |
| 105 | + }  | 
                                                        |
| 102 | 106 | print '</span>';  | 
                                                        
| 103 | 107 | print '<span><i class="fa fa-arrow-down"></i> '.$spotter_item['arrival_airport_city'].', '.$spotter_item['arrival_airport_name'].', '.$spotter_item['arrival_airport_country'];  | 
                                                        
| 104 | -	if (isset($spotter_item['arrival_airport_time']) && $spotter_item['arrival_airport_time'] != '') print ' ('.$spotter_item['arrival_airport_time'].')'; | 
                                                        |
| 108 | +	if (isset($spotter_item['arrival_airport_time']) && $spotter_item['arrival_airport_time'] != '') { | 
                                                        |
| 109 | +		print ' ('.$spotter_item['arrival_airport_time'].')'; | 
                                                        |
| 110 | + }  | 
                                                        |
| 105 | 111 | print '</span>';  | 
                                                        
| 106 | 112 | print '</div>';  | 
                                                        
| 107 | 113 | print '<div class="other3">';  | 
                                                        
@@ -7,8 +7,8 @@ discard block  | 
                                                    ||
| 7 | 7 | die();  | 
                                                        
| 8 | 8 | }  | 
                                                        
| 9 | 9 | $Spotter = new Spotter();  | 
                                                        
| 10 | -$country = ucwords(str_replace("-", " ", filter_input(INPUT_GET,'country',FILTER_SANITIZE_STRING))); | 
                                                        |
| 11 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);  | 
                                                        |
| 10 | +$country = ucwords(str_replace("-", " ", 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 Manufacturer from %s"),$country); | 
                                                        |
| 20 | +	$title = sprintf(_("Most Common Aircraft Manufacturer 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 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>'; | 
                                                        |
| 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 | 54 | $manufacturers_array = $Spotter->countAllAircraftManufacturerByCountry($country);  | 
                                                        
| 55 | 55 | if (!empty($manufacturers_array))  | 
                                                        
| 56 | 56 |  	{ | 
                                                        
@@ -63,7 +63,7 @@ discard block  | 
                                                    ||
| 63 | 63 | print '</thead>';  | 
                                                        
| 64 | 64 | print '<tbody>';  | 
                                                        
| 65 | 65 | $i = 1;  | 
                                                        
| 66 | - foreach($manufacturers_array as $manufacturer_item)  | 
                                                        |
| 66 | + foreach ($manufacturers_array as $manufacturer_item)  | 
                                                        |
| 67 | 67 |  		{ | 
                                                        
| 68 | 68 | print '<tr>';  | 
                                                        
| 69 | 69 | print '<td><strong>'.$i.'</strong></td>';  | 
                                                        
@@ -51,7 +51,9 @@ discard block  | 
                                                    ||
| 51 | 51 | |
| 52 | 52 |  		if (isset($globalTimezone)) { | 
                                                        
| 53 | 53 | date_default_timezone_set($globalTimezone);  | 
                                                        
| 54 | -		} else date_default_timezone_set('UTC'); | 
                                                        |
| 54 | +		} else { | 
                                                        |
| 55 | +			date_default_timezone_set('UTC'); | 
                                                        |
| 56 | + }  | 
                                                        |
| 55 | 57 | |
| 56 | 58 |  		//date_default_timezone_set('UTC'); | 
                                                        
| 57 | 59 |  		if (is_array($all_data) && count($all_data) > 0) { | 
                                                        
@@ -300,9 +302,13 @@ discard block  | 
                                                    ||
| 300 | 302 | print '<div>';  | 
                                                        
| 301 | 303 | if (isset($spotter_item['pilot_id']) && $spotter_item['pilot_id'] != "")  | 
                                                        
| 302 | 304 |  			{ | 
                                                        
| 303 | -				if ($spotter_item['format_source'] == 'whazzup') print '<a href="https://www.ivao.aero/Member.aspx?ID='.$spotter_item['pilot_id'].'">'.$spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')</a>'; | 
                                                        |
| 304 | -				elseif ($spotter_item['format_source'] == 'vatsimtxt') print '<a href="http://www.vataware.com/pilot/'.$spotter_item['pilot_id'].'">'.$spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')</a>'; | 
                                                        |
| 305 | -				else print $spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')'; | 
                                                        |
| 305 | +				if ($spotter_item['format_source'] == 'whazzup') { | 
                                                        |
| 306 | +					print '<a href="https://www.ivao.aero/Member.aspx?ID='.$spotter_item['pilot_id'].'">'.$spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')</a>'; | 
                                                        |
| 307 | +				} elseif ($spotter_item['format_source'] == 'vatsimtxt') { | 
                                                        |
| 308 | +					print '<a href="http://www.vataware.com/pilot/'.$spotter_item['pilot_id'].'">'.$spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')</a>'; | 
                                                        |
| 309 | +				} else { | 
                                                        |
| 310 | +					print $spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')'; | 
                                                        |
| 311 | + }  | 
                                                        |
| 306 | 312 |  			} else { | 
                                                        
| 307 | 313 | if (isset($spotter_item['pilot_name']) && $spotter_item['pilot_name'] != "")  | 
                                                        
| 308 | 314 |  				{ | 
                                                        
@@ -1,5 +1,5 @@ discard block  | 
                                                    ||
| 1 | 1 | <?php  | 
                                                        
| 2 | -$id = filter_input(INPUT_GET,'id',FILTER_SANITIZE_STRING);  | 
                                                        |
| 2 | +$id = filter_input(INPUT_GET, 'id', FILTER_SANITIZE_STRING);  | 
                                                        |
| 3 | 3 | if ($id == "")  | 
                                                        
| 4 | 4 |  { | 
                                                        
| 5 | 5 |  	header('Location: /'); | 
                                                        
@@ -16,30 +16,30 @@ discard block  | 
                                                    ||
| 16 | 16 | |
| 17 | 17 | if (!empty($spotter_array))  | 
                                                        
| 18 | 18 |  { | 
                                                        
| 19 | -	if(isset($spotter_array[0]['flightaware_id'])) { | 
                                                        |
| 19 | +	if (isset($spotter_array[0]['flightaware_id'])) { | 
                                                        |
| 20 | 20 | $flightaware_id = $spotter_array[0]['flightaware_id'];  | 
                                                        
| 21 | 21 | }  | 
                                                        
| 22 | -	if(isset($spotter_array[0]['last_latitude']) && $spotter_array[0]['last_latitude'] != '') { | 
                                                        |
| 22 | +	if (isset($spotter_array[0]['last_latitude']) && $spotter_array[0]['last_latitude'] != '') { | 
                                                        |
| 23 | 23 | $latitude = $spotter_array[0]['last_latitude'];  | 
                                                        
| 24 | -	} elseif(isset($spotter_array[0]['latitude'])) { | 
                                                        |
| 24 | +	} elseif (isset($spotter_array[0]['latitude'])) { | 
                                                        |
| 25 | 25 | $latitude = $spotter_array[0]['latitude'];  | 
                                                        
| 26 | 26 | }  | 
                                                        
| 27 | -	if(isset($spotter_array[0]['last_longitude']) && $spotter_array[0]['last_longitude'] != '') { | 
                                                        |
| 27 | +	if (isset($spotter_array[0]['last_longitude']) && $spotter_array[0]['last_longitude'] != '') { | 
                                                        |
| 28 | 28 | $longitude = $spotter_array[0]['last_longitude'];  | 
                                                        
| 29 | -	} elseif(isset($spotter_array[0]['longitude'])) { | 
                                                        |
| 29 | +	} elseif (isset($spotter_array[0]['longitude'])) { | 
                                                        |
| 30 | 30 | $longitude = $spotter_array[0]['longitude'];  | 
                                                        
| 31 | 31 | }  | 
                                                        
| 32 | 32 | $title = '';  | 
                                                        
| 33 | -	if(isset($spotter_array[0]['ident'])) { | 
                                                        |
| 33 | +	if (isset($spotter_array[0]['ident'])) { | 
                                                        |
| 34 | 34 | $title .= $spotter_array[0]['ident'];  | 
                                                        
| 35 | 35 | }  | 
                                                        
| 36 | -	if(isset($spotter_array[0]['airline_name'])) { | 
                                                        |
| 36 | +	if (isset($spotter_array[0]['airline_name'])) { | 
                                                        |
| 37 | 37 | $title .= ' - '.$spotter_array[0]['airline_name'];  | 
                                                        
| 38 | 38 | }  | 
                                                        
| 39 | -	if(isset($spotter_array[0]['aircraft_name']) && $spotter_array[0]['aircraft_name'] != 'Not Available') { | 
                                                        |
| 39 | +	if (isset($spotter_array[0]['aircraft_name']) && $spotter_array[0]['aircraft_name'] != 'Not Available') { | 
                                                        |
| 40 | 40 |  		$title .= ' - '.$spotter_array[0]['aircraft_name'].' ('.$spotter_array[0]['aircraft_type'].')'; | 
                                                        
| 41 | 41 | }  | 
                                                        
| 42 | -	if(isset($spotter_array[0]['registration']) && $spotter_array[0]['registration'] != 'NA' && $spotter_array[0]['registration'] != 'N/A') { | 
                                                        |
| 42 | +	if (isset($spotter_array[0]['registration']) && $spotter_array[0]['registration'] != 'NA' && $spotter_array[0]['registration'] != 'N/A') { | 
                                                        |
| 43 | 43 | $title .= ' - '.$spotter_array[0]['registration'];  | 
                                                        
| 44 | 44 | }  | 
                                                        
| 45 | 45 | //$facebook_meta_image = $spotter_array[0]['image'];  | 
                                                        
@@ -64,9 +64,9 @@ discard block  | 
                                                    ||
| 64 | 64 | var data = google.visualization.arrayToDataTable([  | 
                                                        
| 65 | 65 | ["Hour","Altitude","Speed"], ';  | 
                                                        
| 66 | 66 | $altitude_data = '';  | 
                                                        
| 67 | - foreach($all_data as $data)  | 
                                                        |
| 67 | + foreach ($all_data as $data)  | 
                                                        |
| 68 | 68 |  			{ | 
                                                        
| 69 | -				$altitude_data .= '[ "'.date("G:i",strtotime($data['date']." UTC")).'",'.$data['altitude'].','.$data['ground_speed'].'],'; | 
                                                        |
| 69 | +				$altitude_data .= '[ "'.date("G:i", strtotime($data['date']." UTC")).'",'.$data['altitude'].','.$data['ground_speed'].'],'; | 
                                                        |
| 70 | 70 | }  | 
                                                        
| 71 | 71 | $altitude_data = substr($altitude_data, 0, -1);  | 
                                                        
| 72 | 72 | print $altitude_data.']);  | 
                                                        
@@ -108,16 +108,16 @@ discard block  | 
                                                    ||
| 108 | 108 | print '<a href="'.$globalURL.'/airline/'.$spotter_array[0]['airline_icao'].'">'.$spotter_array[0]['airline_name'].'</a> ';  | 
                                                        
| 109 | 109 | }  | 
                                                        
| 110 | 110 | }  | 
                                                        
| 111 | -	if(isset($spotter_array[0]['ident'])) { | 
                                                        |
| 111 | +	if (isset($spotter_array[0]['ident'])) { | 
                                                        |
| 112 | 112 | print $spotter_array[0]['ident'];  | 
                                                        
| 113 | 113 | }  | 
                                                        
| 114 | -	if(isset($spotter_array[0]['airline_name'])) { | 
                                                        |
| 114 | +	if (isset($spotter_array[0]['airline_name'])) { | 
                                                        |
| 115 | 115 | print ' - '.$spotter_array[0]['airline_name'];  | 
                                                        
| 116 | 116 | }  | 
                                                        
| 117 | -	if(isset($spotter_array[0]['aircraft_name']) && $spotter_array[0]['aircraft_name'] != 'Not Available') { | 
                                                        |
| 117 | +	if (isset($spotter_array[0]['aircraft_name']) && $spotter_array[0]['aircraft_name'] != 'Not Available') { | 
                                                        |
| 118 | 118 |  		print ' - '.$spotter_array[0]['aircraft_name'].' ('.$spotter_array[0]['aircraft_type'].')'; | 
                                                        
| 119 | 119 | }  | 
                                                        
| 120 | -	if(isset($spotter_array[0]['registration']) && $spotter_array[0]['registration'] != 'NA') { | 
                                                        |
| 120 | +	if (isset($spotter_array[0]['registration']) && $spotter_array[0]['registration'] != 'NA') { | 
                                                        |
| 121 | 121 | print ' - '.$spotter_array[0]['registration'];  | 
                                                        
| 122 | 122 | }  | 
                                                        
| 123 | 123 | print '</h1>';  | 
                                                        
@@ -271,7 +271,7 @@ discard block  | 
                                                    ||
| 271 | 271 | print '</div>';  | 
                                                        
| 272 | 272 | */  | 
                                                        
| 273 | 273 | |
| 274 | - foreach($spotter_array as $spotter_item)  | 
                                                        |
| 274 | + foreach ($spotter_array as $spotter_item)  | 
                                                        |
| 275 | 275 |  	{ | 
                                                        
| 276 | 276 | print '<div class="details">';  | 
                                                        
| 277 | 277 | print '<h3>Flight Information</h3>';  | 
                                                        
@@ -371,7 +371,7 @@ discard block  | 
                                                    ||
| 371 | 371 |  			if (isset($spotter_item['departure_airport_time']) && $spotter_item['departure_airport_time'] != '') { | 
                                                        
| 372 | 372 |  				if ($spotter_item['departure_airport_time'] > 2460) { | 
                                                        
| 373 | 373 | print '<div class="time">';  | 
                                                        
| 374 | -					print 'at '.date('H:m',$spotter_item['departure_airport_time']); | 
                                                        |
| 374 | +					print 'at '.date('H:m', $spotter_item['departure_airport_time']); | 
                                                        |
| 375 | 375 | print '</div>';  | 
                                                        
| 376 | 376 |  				} else { | 
                                                        
| 377 | 377 | print '<div class="time">';  | 
                                                        
@@ -509,19 +509,19 @@ discard block  | 
                                                    ||
| 509 | 509 | $departure_airport_info = $Spotter->getAllAirportInfo($spotter_item['departure_airport']);  | 
                                                        
| 510 | 510 |  			if (isset($spotter_item['last_latitude']) && $spotter_item['last_latitude'] != '') { | 
                                                        
| 511 | 511 |  				if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { | 
                                                        
| 512 | - print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'nm').' nm';  | 
                                                        |
| 512 | + print $Common->distance($spotter_item['last_latitude'], $spotter_item['last_longitude'], $departure_airport_info[0]['latitude'], $departure_airport_info[0]['longitude'], 'nm').' nm';  | 
                                                        |
| 513 | 513 |  				} elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { | 
                                                        
| 514 | - print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'mi').' mi';  | 
                                                        |
| 514 | + print $Common->distance($spotter_item['last_latitude'], $spotter_item['last_longitude'], $departure_airport_info[0]['latitude'], $departure_airport_info[0]['longitude'], 'mi').' mi';  | 
                                                        |
| 515 | 515 |  				} else { | 
                                                        
| 516 | - print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'km').' km';  | 
                                                        |
| 516 | + print $Common->distance($spotter_item['last_latitude'], $spotter_item['last_longitude'], $departure_airport_info[0]['latitude'], $departure_airport_info[0]['longitude'], 'km').' km';  | 
                                                        |
| 517 | 517 | }  | 
                                                        
| 518 | 518 |  			} else { | 
                                                        
| 519 | 519 |  				if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { | 
                                                        
| 520 | - print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'nm').' nm';  | 
                                                        |
| 520 | + print $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $departure_airport_info[0]['latitude'], $departure_airport_info[0]['longitude'], 'nm').' nm';  | 
                                                        |
| 521 | 521 |  				} elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { | 
                                                        
| 522 | - print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'mi').' mi';  | 
                                                        |
| 522 | + print $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $departure_airport_info[0]['latitude'], $departure_airport_info[0]['longitude'], 'mi').' mi';  | 
                                                        |
| 523 | 523 |  				} else { | 
                                                        
| 524 | - print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'km').' km';  | 
                                                        |
| 524 | + print $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $departure_airport_info[0]['latitude'], $departure_airport_info[0]['longitude'], 'km').' km';  | 
                                                        |
| 525 | 525 | }  | 
                                                        
| 526 | 526 | }  | 
                                                        
| 527 | 527 | print '</div>';  | 
                                                        
@@ -535,19 +535,19 @@ discard block  | 
                                                    ||
| 535 | 535 | $arrival_airport_info = $Spotter->getAllAirportInfo($spotter_item['arrival_airport']);  | 
                                                        
| 536 | 536 |  			if (isset($spotter_item['last_latitude']) && $spotter_item['last_latitude'] != '') { | 
                                                        
| 537 | 537 |  				if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { | 
                                                        
| 538 | - print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'nm').' nm';  | 
                                                        |
| 538 | + print $Common->distance($spotter_item['last_latitude'], $spotter_item['last_longitude'], $arrival_airport_info[0]['latitude'], $arrival_airport_info[0]['longitude'], 'nm').' nm';  | 
                                                        |
| 539 | 539 |  				} elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { | 
                                                        
| 540 | - print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'mi').' mi';  | 
                                                        |
| 540 | + print $Common->distance($spotter_item['last_latitude'], $spotter_item['last_longitude'], $arrival_airport_info[0]['latitude'], $arrival_airport_info[0]['longitude'], 'mi').' mi';  | 
                                                        |
| 541 | 541 |  				} else { | 
                                                        
| 542 | - print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'km').' km';  | 
                                                        |
| 542 | + print $Common->distance($spotter_item['last_latitude'], $spotter_item['last_longitude'], $arrival_airport_info[0]['latitude'], $arrival_airport_info[0]['longitude'], 'km').' km';  | 
                                                        |
| 543 | 543 | }  | 
                                                        
| 544 | 544 |  			} else { | 
                                                        
| 545 | 545 |  				if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { | 
                                                        
| 546 | - print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'nm').' nm';  | 
                                                        |
| 546 | + print $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $arrival_airport_info[0]['latitude'], $arrival_airport_info[0]['longitude'], 'nm').' nm';  | 
                                                        |
| 547 | 547 |  				} elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { | 
                                                        
| 548 | - print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'mi').' mi';  | 
                                                        |
| 548 | + print $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $arrival_airport_info[0]['latitude'], $arrival_airport_info[0]['longitude'], 'mi').' mi';  | 
                                                        |
| 549 | 549 |  				} else { | 
                                                        
| 550 | - print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'km').' km';  | 
                                                        |
| 550 | + print $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $arrival_airport_info[0]['latitude'], $arrival_airport_info[0]['longitude'], 'km').' km';  | 
                                                        |
| 551 | 551 | }  | 
                                                        
| 552 | 552 | }  | 
                                                        
| 553 | 553 | print '</div>';  | 
                                                        
@@ -566,7 +566,7 @@ discard block  | 
                                                    ||
| 566 | 566 | print '<div class="last-flights">';  | 
                                                        
| 567 | 567 |  		print '<h3>Last 5 Flights of this Aircraft ('.$spotter_array[0]['registration'].')</h3>'; | 
                                                        
| 568 | 568 | $hide_th_links = true;  | 
                                                        
| 569 | - $spotter_array = $Spotter->getSpotterDataByRegistration($spotter_array[0]['registration'],"0,5", "");  | 
                                                        |
| 569 | + $spotter_array = $Spotter->getSpotterDataByRegistration($spotter_array[0]['registration'], "0,5", "");  | 
                                                        |
| 570 | 570 |  		include('table-output.php');  | 
                                                        
| 571 | 571 | print '<div class="more">';  | 
                                                        
| 572 | 572 | print '<a href="'.$globalURL.'/registration/'.$spotter_array[0]['registration'].'" class="btn btn-default btn" role="button">See all Flights»</a>';  | 
                                                        
@@ -8,7 +8,7 @@  | 
                                                    ||
| 8 | 8 | |
| 9 | 9 | $page_url = $globalURL.'/acars-latest';  | 
                                                        
| 10 | 10 | |
| 11 | -if(!isset($_GET['limit']))  | 
                                                        |
| 11 | +if (!isset($_GET['limit']))  | 
                                                        |
| 12 | 12 |  { | 
                                                        
| 13 | 13 | $limit_start = 0;  | 
                                                        
| 14 | 14 | $limit_end = 25;  | 
                                                        
@@ -38,8 +38,12 @@  | 
                                                    ||
| 38 | 38 |  if (!empty($spotter_array) && $spotter_array[0]['query_number_rows'] != 0) { | 
                                                        
| 39 | 39 |  	include('table-output.php'); | 
                                                        
| 40 | 40 | print '<div class="pagination">';  | 
                                                        
| 41 | -	if ($limit_previous_1 >= 0) print '<a href="'.$page_url.'/'.$limit_previous_1.','.$limit_previous_2.'">«'._("Previous Page").'</a>'; | 
                                                        |
| 42 | -	if ($spotter_array[0]['query_number_rows'] == $absolute_difference) print '<a href="'.$page_url.'/'.$limit_end.','.$limit_next.'">'._("Next Page").'»</a>'; | 
                                                        |
| 41 | +	if ($limit_previous_1 >= 0) { | 
                                                        |
| 42 | +		print '<a href="'.$page_url.'/'.$limit_previous_1.','.$limit_previous_2.'">«'._("Previous Page").'</a>'; | 
                                                        |
| 43 | + }  | 
                                                        |
| 44 | +	if ($spotter_array[0]['query_number_rows'] == $absolute_difference) { | 
                                                        |
| 45 | +		print '<a href="'.$page_url.'/'.$limit_end.','.$limit_next.'">'._("Next Page").'»</a>'; | 
                                                        |
| 46 | + }  | 
                                                        |
| 43 | 47 | print '</div>';  | 
                                                        
| 44 | 48 | }  | 
                                                        
| 45 | 49 | print '</div>';  |