Completed
Push — master ( 4407ee...8e145a )
by Yannick
06:51
created
owner-statistics-aircraft.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@
 block discarded – undo
3 3
 require_once('require/class.Spotter.php');
4 4
 require_once('require/class.Language.php');
5 5
 if (!isset($_GET['owner'])) {
6
-        header('Location: '.$globalURL.'/owner');
7
-        die();
6
+		header('Location: '.$globalURL.'/owner');
7
+		die();
8 8
 }
9 9
 $Spotter = new Spotter();
10 10
 $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
Please login to merge, or discard this patch.
owner-statistics-time.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@
 block discarded – undo
3 3
 require_once('require/class.Spotter.php');
4 4
 require_once('require/class.Language.php');
5 5
 if (!isset($_GET['owner'])) {
6
-        header('Location: '.$globalURL.'/owner');
7
-        die();
6
+		header('Location: '.$globalURL.'/owner');
7
+		die();
8 8
 }
9 9
 $Spotter = new Spotter();
10 10
 $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
Please login to merge, or discard this patch.
pilot-statistics-time.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@
 block discarded – undo
3 3
 require_once('require/class.Spotter.php');
4 4
 require_once('require/class.Language.php');
5 5
 if (!isset($_GET['pilot'])) {
6
-        header('Location: '.$globalURL.'/pilot');
7
-        die();
6
+		header('Location: '.$globalURL.'/pilot');
7
+		die();
8 8
 }
9 9
 $Spotter = new Spotter();
10 10
 $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
Please login to merge, or discard this patch.
pilot-statistics-airline.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@
 block discarded – undo
3 3
 require_once('require/class.Spotter.php');
4 4
 require_once('require/class.Language.php');
5 5
 if (!isset($_GET['pilot'])) {
6
-        header('Location: '.$globalURL.'/pilot');
7
-        die();
6
+		header('Location: '.$globalURL.'/pilot');
7
+		die();
8 8
 }
9 9
 $Spotter = new Spotter();
10 10
 $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
Please login to merge, or discard this patch.
owner-statistics-manufacturer.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@
 block discarded – undo
3 3
 require_once('require/class.Spotter.php');
4 4
 require_once('require/class.Language.php');
5 5
 if (!isset($_GET['owner'])) {
6
-        header('Location: '.$globalURL.'/owner');
7
-        die();
6
+		header('Location: '.$globalURL.'/owner');
7
+		die();
8 8
 }
9 9
 $Spotter = new Spotter();
10 10
 $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
Please login to merge, or discard this patch.
pilot-statistics-departure-airport-country.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@
 block discarded – undo
3 3
 require_once('require/class.Spotter.php');
4 4
 require_once('require/class.Language.php');
5 5
 if (!isset($_GET['pilot'])) {
6
-        header('Location: '.$globalURL.'/pilot');
7
-        die();
6
+		header('Location: '.$globalURL.'/pilot');
7
+		die();
8 8
 }
9 9
 $Spotter = new Spotter();
10 10
 $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
Please login to merge, or discard this patch.
owner-statistics-route.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@
 block discarded – undo
3 3
 require_once('require/class.Spotter.php');
4 4
 require_once('require/class.Language.php');
5 5
 if (!isset($_GET['owner'])) {
6
-        header('Location: '.$globalURL.'/owner');
7
-        die();
6
+		header('Location: '.$globalURL.'/owner');
7
+		die();
8 8
 }
9 9
 $Spotter = new Spotter();
10 10
 $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
Please login to merge, or discard this patch.
owner-statistics-registration.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@
 block discarded – undo
3 3
 require_once('require/class.Spotter.php');
4 4
 require_once('require/class.Language.php');
5 5
 if (!isset($_GET['owner'])) {
6
-        header('Location: '.$globalURL.'/owner');
7
-        die();
6
+		header('Location: '.$globalURL.'/owner');
7
+		die();
8 8
 }
9 9
 $Spotter = new Spotter();
10 10
 $owner = filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING);
Please login to merge, or discard this patch.
require/class.Spotter.php 2 patches
Indentation   +1422 added lines, -1422 removed lines patch added patch discarded remove patch
@@ -55,10 +55,10 @@  discard block
 block discarded – undo
55 55
 	}
56 56
 
57 57
 	/**
58
-	* Get SQL query part for filter used
59
-	* @param Array $filter the filter
60
-	* @return Array the SQL part
61
-	*/
58
+	 * Get SQL query part for filter used
59
+	 * @param Array $filter the filter
60
+	 * @return Array the SQL part
61
+	 */
62 62
 	public function getFilter($filter = array(),$where = false,$and = false) {
63 63
 		global $globalFilter, $globalStatsFilters, $globalFilterName;
64 64
 		$filters = array();
@@ -129,14 +129,14 @@  discard block
 block discarded – undo
129 129
 	}
130 130
 
131 131
 	/**
132
-	* Executes the SQL statements to get the spotter information
133
-	*
134
-	* @param String $query the SQL query
135
-	* @param Array $params parameter of the query
136
-	* @param String $limitQuery the limit query
137
-	* @return Array the spotter information
138
-	*
139
-	*/
132
+	 * Executes the SQL statements to get the spotter information
133
+	 *
134
+	 * @param String $query the SQL query
135
+	 * @param Array $params parameter of the query
136
+	 * @param String $limitQuery the limit query
137
+	 * @return Array the spotter information
138
+	 *
139
+	 */
140 140
 	public function getDataFromDB($query, $params = array(), $limitQuery = '',$schedules = false)
141 141
 	{
142 142
 		global $globalSquawkCountry, $globalIVAO, $globalVATSIM, $globalphpVMS, $globalAirlinesSource, $globalVAM;
@@ -300,11 +300,11 @@  discard block
 block discarded – undo
300 300
 					if ($aircraft_array[0]['aircraft_shadow'] != NULL) {
301 301
 						$temp_array['aircraft_shadow'] = $aircraft_array[0]['aircraft_shadow'];
302 302
 					} else $temp_array['aircraft_shadow'] = 'default.png';
303
-                                } else {
304
-                            		$temp_array['aircraft_shadow'] = 'default.png';
303
+								} else {
304
+									$temp_array['aircraft_shadow'] = 'default.png';
305 305
 					$temp_array['aircraft_name'] = 'N/A';
306 306
 					$temp_array['aircraft_manufacturer'] = 'N/A';
307
-                            	}
307
+								}
308 308
 			}
309 309
 			$fromsource = NULL;
310 310
 			if (isset($globalAirlinesSource) && $globalAirlinesSource != '') $fromsource = $globalAirlinesSource;
@@ -500,11 +500,11 @@  discard block
 block discarded – undo
500 500
 	
501 501
 	
502 502
 	/**
503
-	* Gets all the spotter information
504
-	*
505
-	* @return Array the spotter information
506
-	*
507
-	*/
503
+	 * Gets all the spotter information
504
+	 *
505
+	 * @return Array the spotter information
506
+	 *
507
+	 */
508 508
 	public function searchSpotterData($q = '', $registration = '', $aircraft_icao = '', $aircraft_manufacturer = '', $highlights = '', $airline_icao = '', $airline_country = '', $airline_type = '', $airport = '', $airport_country = '', $callsign = '', $departure_airport_route = '', $arrival_airport_route = '', $owner = '',$pilot_id = '',$pilot_name = '',$altitude = '', $date_posted = '', $limit = '', $sort = '', $includegeodata = '',$origLat = '',$origLon = '',$dist = '',$filters = array())
509 509
 	{
510 510
 		global $globalTimezone, $globalDBdriver;
@@ -851,11 +851,11 @@  discard block
 block discarded – undo
851 851
 	
852 852
 	
853 853
 	/**
854
-	* Gets all the spotter information based on the latest data entry
855
-	*
856
-	* @return Array the spotter information
857
-	*
858
-	*/
854
+	 * Gets all the spotter information based on the latest data entry
855
+	 *
856
+	 * @return Array the spotter information
857
+	 *
858
+	 */
859 859
 	public function getLatestSpotterData($limit = '', $sort = '', $filter = array())
860 860
 	{
861 861
 		global $global_query;
@@ -894,12 +894,12 @@  discard block
 block discarded – undo
894 894
 	}
895 895
     
896 896
     
897
-    /**
898
-	* Gets all the spotter information based on a user's latitude and longitude
899
-	*
900
-	* @return Array the spotter information
901
-	*
902
-	*/
897
+	/**
898
+	 * Gets all the spotter information based on a user's latitude and longitude
899
+	 *
900
+	 * @return Array the spotter information
901
+	 *
902
+	 */
903 903
 	public function getLatestSpotterForLayar($lat, $lng, $radius, $interval)
904 904
 	{
905 905
 		date_default_timezone_set('UTC');
@@ -927,7 +927,7 @@  discard block
 block discarded – undo
927 927
 				return false;
928 928
 			}
929 929
 		}
930
-    		$additional_query = '';
930
+			$additional_query = '';
931 931
 		if ($interval != "")
932 932
 		{
933 933
 			if (!is_string($interval))
@@ -967,12 +967,12 @@  discard block
 block discarded – undo
967 967
 	}
968 968
     
969 969
     
970
-    /**
971
-	* Gets all the spotter information sorted by the newest aircraft type
972
-	*
973
-	* @return Array the spotter information
974
-	*
975
-	*/
970
+	/**
971
+	 * Gets all the spotter information sorted by the newest aircraft type
972
+	 *
973
+	 * @return Array the spotter information
974
+	 *
975
+	 */
976 976
 	public function getNewestSpotterDataSortedByAircraftType($limit = '', $sort = '',$filter = array())
977 977
 	{
978 978
 		global $global_query;
@@ -1013,11 +1013,11 @@  discard block
 block discarded – undo
1013 1013
     
1014 1014
     
1015 1015
 	/**
1016
-	* Gets all the spotter information sorted by the newest aircraft registration
1017
-	*
1018
-	* @return Array the spotter information
1019
-	*
1020
-	*/
1016
+	 * Gets all the spotter information sorted by the newest aircraft registration
1017
+	 *
1018
+	 * @return Array the spotter information
1019
+	 *
1020
+	 */
1021 1021
 	public function getNewestSpotterDataSortedByAircraftRegistration($limit = '', $sort = '', $filter = array())
1022 1022
 	{
1023 1023
 		global $global_query;
@@ -1057,11 +1057,11 @@  discard block
 block discarded – undo
1057 1057
 
1058 1058
 
1059 1059
 	/**
1060
-	* Gets all the spotter information sorted by the newest airline
1061
-	*
1062
-	* @return Array the spotter information
1063
-	*
1064
-	*/
1060
+	 * Gets all the spotter information sorted by the newest airline
1061
+	 *
1062
+	 * @return Array the spotter information
1063
+	 *
1064
+	 */
1065 1065
 	public function getNewestSpotterDataSortedByAirline($limit = '', $sort = '',$filter = array())
1066 1066
 	{
1067 1067
 		global $global_query;
@@ -1100,12 +1100,12 @@  discard block
 block discarded – undo
1100 1100
 	}
1101 1101
     
1102 1102
     
1103
-    /**
1104
-	* Gets all the spotter information sorted by the newest departure airport
1105
-	*
1106
-	* @return Array the spotter information
1107
-	*
1108
-	*/
1103
+	/**
1104
+	 * Gets all the spotter information sorted by the newest departure airport
1105
+	 *
1106
+	 * @return Array the spotter information
1107
+	 *
1108
+	 */
1109 1109
 	public function getNewestSpotterDataSortedByDepartureAirport($limit = '', $sort = '', $filter = array())
1110 1110
 	{
1111 1111
 		global $global_query;
@@ -1147,11 +1147,11 @@  discard block
 block discarded – undo
1147 1147
 
1148 1148
 
1149 1149
 	/**
1150
-	* Gets all the spotter information sorted by the newest arrival airport
1151
-	*
1152
-	* @return Array the spotter information
1153
-	*
1154
-	*/
1150
+	 * Gets all the spotter information sorted by the newest arrival airport
1151
+	 *
1152
+	 * @return Array the spotter information
1153
+	 *
1154
+	 */
1155 1155
 	public function getNewestSpotterDataSortedByArrivalAirport($limit = '', $sort = '', $filter = array())
1156 1156
 	{
1157 1157
 		global $global_query;
@@ -1190,11 +1190,11 @@  discard block
 block discarded – undo
1190 1190
 	
1191 1191
 
1192 1192
 	/**
1193
-	* Gets all the spotter information based on the spotter id
1194
-	*
1195
-	* @return Array the spotter information
1196
-	*
1197
-	*/
1193
+	 * Gets all the spotter information based on the spotter id
1194
+	 *
1195
+	 * @return Array the spotter information
1196
+	 *
1197
+	 */
1198 1198
 	public function getSpotterDataByID($id = '')
1199 1199
 	{
1200 1200
 		global $global_query;
@@ -1216,11 +1216,11 @@  discard block
 block discarded – undo
1216 1216
 	
1217 1217
 	
1218 1218
 	/**
1219
-	* Gets all the spotter information based on the callsign
1220
-	*
1221
-	* @return Array the spotter information
1222
-	*
1223
-	*/
1219
+	 * Gets all the spotter information based on the callsign
1220
+	 *
1221
+	 * @return Array the spotter information
1222
+	 *
1223
+	 */
1224 1224
 	public function getSpotterDataByIdent($ident = '', $limit = '', $sort = '')
1225 1225
 	{
1226 1226
 		global $global_query;
@@ -1271,11 +1271,11 @@  discard block
 block discarded – undo
1271 1271
 	}
1272 1272
 	
1273 1273
 	/**
1274
-	* Gets all the spotter information based on the owner
1275
-	*
1276
-	* @return Array the spotter information
1277
-	*
1278
-	*/
1274
+	 * Gets all the spotter information based on the owner
1275
+	 *
1276
+	 * @return Array the spotter information
1277
+	 *
1278
+	 */
1279 1279
 	public function getSpotterDataByOwner($owner = '', $limit = '', $sort = '')
1280 1280
 	{
1281 1281
 		global $global_query;
@@ -1326,11 +1326,11 @@  discard block
 block discarded – undo
1326 1326
 	}
1327 1327
 	
1328 1328
 	/**
1329
-	* Gets all the spotter information based on the pilot
1330
-	*
1331
-	* @return Array the spotter information
1332
-	*
1333
-	*/
1329
+	 * Gets all the spotter information based on the pilot
1330
+	 *
1331
+	 * @return Array the spotter information
1332
+	 *
1333
+	 */
1334 1334
 	public function getSpotterDataByPilot($pilot = '', $limit = '', $sort = '')
1335 1335
 	{
1336 1336
 		global $global_query;
@@ -1378,11 +1378,11 @@  discard block
 block discarded – undo
1378 1378
 	
1379 1379
 	
1380 1380
 	/**
1381
-	* Gets all the spotter information based on the aircraft type
1382
-	*
1383
-	* @return Array the spotter information
1384
-	*
1385
-	*/
1381
+	 * Gets all the spotter information based on the aircraft type
1382
+	 *
1383
+	 * @return Array the spotter information
1384
+	 *
1385
+	 */
1386 1386
 	public function getSpotterDataByAircraft($aircraft_type = '', $limit = '', $sort = '', $filter = array())
1387 1387
 	{
1388 1388
 		global $global_query;
@@ -1436,11 +1436,11 @@  discard block
 block discarded – undo
1436 1436
 	
1437 1437
 	
1438 1438
 	/**
1439
-	* Gets all the spotter information based on the aircraft registration
1440
-	*
1441
-	* @return Array the spotter information
1442
-	*
1443
-	*/
1439
+	 * Gets all the spotter information based on the aircraft registration
1440
+	 *
1441
+	 * @return Array the spotter information
1442
+	 *
1443
+	 */
1444 1444
 	public function getSpotterDataByRegistration($registration = '', $limit = '', $sort = '', $filter = array())
1445 1445
 	{
1446 1446
 		global $global_query;
@@ -1497,11 +1497,11 @@  discard block
 block discarded – undo
1497 1497
 	
1498 1498
 	
1499 1499
 	/**
1500
-	* Gets all the spotter information based on the airline
1501
-	*
1502
-	* @return Array the spotter information
1503
-	*
1504
-	*/
1500
+	 * Gets all the spotter information based on the airline
1501
+	 *
1502
+	 * @return Array the spotter information
1503
+	 *
1504
+	 */
1505 1505
 	public function getSpotterDataByAirline($airline = '', $limit = '', $sort = '',$filters = array())
1506 1506
 	{
1507 1507
 		global $global_query;
@@ -1554,11 +1554,11 @@  discard block
 block discarded – undo
1554 1554
 	
1555 1555
 	
1556 1556
 	/**
1557
-	* Gets all the spotter information based on the airport
1558
-	*
1559
-	* @return Array the spotter information
1560
-	*
1561
-	*/
1557
+	 * Gets all the spotter information based on the airport
1558
+	 *
1559
+	 * @return Array the spotter information
1560
+	 *
1561
+	 */
1562 1562
 	public function getSpotterDataByAirport($airport = '', $limit = '', $sort = '',$filters = array())
1563 1563
 	{
1564 1564
 		global $global_query;
@@ -1612,11 +1612,11 @@  discard block
 block discarded – undo
1612 1612
 
1613 1613
 
1614 1614
 	/**
1615
-	* Gets all the spotter information based on the date
1616
-	*
1617
-	* @return Array the spotter information
1618
-	*
1619
-	*/
1615
+	 * Gets all the spotter information based on the date
1616
+	 *
1617
+	 * @return Array the spotter information
1618
+	 *
1619
+	 */
1620 1620
 	public function getSpotterDataByDate($date = '', $limit = '', $sort = '',$filter = array())
1621 1621
 	{
1622 1622
 		global $global_query, $globalTimezone, $globalDBdriver;
@@ -1680,11 +1680,11 @@  discard block
 block discarded – undo
1680 1680
 
1681 1681
 
1682 1682
 	/**
1683
-	* Gets all the spotter information based on the country name
1684
-	*
1685
-	* @return Array the spotter information
1686
-	*
1687
-	*/
1683
+	 * Gets all the spotter information based on the country name
1684
+	 *
1685
+	 * @return Array the spotter information
1686
+	 *
1687
+	 */
1688 1688
 	public function getSpotterDataByCountry($country = '', $limit = '', $sort = '',$filters = array())
1689 1689
 	{
1690 1690
 		global $global_query;
@@ -1738,11 +1738,11 @@  discard block
 block discarded – undo
1738 1738
 	
1739 1739
 	
1740 1740
 	/**
1741
-	* Gets all the spotter information based on the manufacturer name
1742
-	*
1743
-	* @return Array the spotter information
1744
-	*
1745
-	*/
1741
+	 * Gets all the spotter information based on the manufacturer name
1742
+	 *
1743
+	 * @return Array the spotter information
1744
+	 *
1745
+	 */
1746 1746
 	public function getSpotterDataByManufacturer($aircraft_manufacturer = '', $limit = '', $sort = '', $filters = array())
1747 1747
 	{
1748 1748
 		global $global_query;
@@ -1798,13 +1798,13 @@  discard block
 block discarded – undo
1798 1798
   
1799 1799
   
1800 1800
 	/**
1801
-	* Gets a list of all aircraft that take a route
1802
-	*
1803
-	* @param String $departure_airport_icao ICAO code of departure airport
1804
-	* @param String $arrival_airport_icao ICAO code of arrival airport
1805
-	* @return Array the spotter information
1806
-	*
1807
-	*/
1801
+	 * Gets a list of all aircraft that take a route
1802
+	 *
1803
+	 * @param String $departure_airport_icao ICAO code of departure airport
1804
+	 * @param String $arrival_airport_icao ICAO code of arrival airport
1805
+	 * @return Array the spotter information
1806
+	 *
1807
+	 */
1808 1808
 	public function getSpotterDataByRoute($departure_airport_icao = '', $arrival_airport_icao = '', $limit = '', $sort = '', $filters = array())
1809 1809
 	{
1810 1810
 		global $global_query;
@@ -1873,11 +1873,11 @@  discard block
 block discarded – undo
1873 1873
 	
1874 1874
 	
1875 1875
 	/**
1876
-	* Gets all the spotter information based on the special column in the table
1877
-	*
1878
-	* @return Array the spotter information
1879
-	*
1880
-	*/
1876
+	 * Gets all the spotter information based on the special column in the table
1877
+	 *
1878
+	 * @return Array the spotter information
1879
+	 *
1880
+	 */
1881 1881
 	public function getSpotterDataByHighlight($limit = '', $sort = '', $filter = array())
1882 1882
 	{
1883 1883
 		global $global_query;
@@ -1916,11 +1916,11 @@  discard block
 block discarded – undo
1916 1916
 	}
1917 1917
 
1918 1918
 	/**
1919
-	* Gets all the highlight based on a aircraft registration
1920
-	*
1921
-	* @return String the highlight text
1922
-	*
1923
-	*/
1919
+	 * Gets all the highlight based on a aircraft registration
1920
+	 *
1921
+	 * @return String the highlight text
1922
+	 *
1923
+	 */
1924 1924
 	public function getHighlightByRegistration($registration,$filter = array())
1925 1925
 	{
1926 1926
 		global $global_query;
@@ -1942,13 +1942,13 @@  discard block
 block discarded – undo
1942 1942
 
1943 1943
 	
1944 1944
 	/**
1945
-	* Gets the squawk usage from squawk code
1946
-	*
1947
-	* @param String $squawk squawk code
1948
-	* @param String $country country
1949
-	* @return String usage
1950
-	*
1951
-	*/
1945
+	 * Gets the squawk usage from squawk code
1946
+	 *
1947
+	 * @param String $squawk squawk code
1948
+	 * @param String $country country
1949
+	 * @return String usage
1950
+	 *
1951
+	 */
1952 1952
 	public function getSquawkUsage($squawk = '',$country = 'FR')
1953 1953
 	{
1954 1954
 		
@@ -1969,12 +1969,12 @@  discard block
 block discarded – undo
1969 1969
 	}
1970 1970
 
1971 1971
 	/**
1972
-	* Gets the airport icao from the iata
1973
-	*
1974
-	* @param String $airport_iata the iata code of the airport
1975
-	* @return String airport iata
1976
-	*
1977
-	*/
1972
+	 * Gets the airport icao from the iata
1973
+	 *
1974
+	 * @param String $airport_iata the iata code of the airport
1975
+	 * @return String airport iata
1976
+	 *
1977
+	 */
1978 1978
 	public function getAirportIcao($airport_iata = '')
1979 1979
 	{
1980 1980
 		
@@ -1994,14 +1994,14 @@  discard block
 block discarded – undo
1994 1994
 	}
1995 1995
 
1996 1996
 	/**
1997
-	* Gets the airport distance
1998
-	*
1999
-	* @param String $airport_icao the icao code of the airport
2000
-	* @param Float $latitude the latitude
2001
-	* @param Float $longitude the longitude
2002
-	* @return Float distance to the airport
2003
-	*
2004
-	*/
1997
+	 * Gets the airport distance
1998
+	 *
1999
+	 * @param String $airport_icao the icao code of the airport
2000
+	 * @param Float $latitude the latitude
2001
+	 * @param Float $longitude the longitude
2002
+	 * @return Float distance to the airport
2003
+	 *
2004
+	 */
2005 2005
 	public function getAirportDistance($airport_icao,$latitude,$longitude)
2006 2006
 	{
2007 2007
 		
@@ -2022,12 +2022,12 @@  discard block
 block discarded – undo
2022 2022
 	}
2023 2023
 	
2024 2024
 	/**
2025
-	* Gets the airport info based on the icao
2026
-	*
2027
-	* @param String $airport the icao code of the airport
2028
-	* @return Array airport information
2029
-	*
2030
-	*/
2025
+	 * Gets the airport info based on the icao
2026
+	 *
2027
+	 * @param String $airport the icao code of the airport
2028
+	 * @return Array airport information
2029
+	 *
2030
+	 */
2031 2031
 	public function getAllAirportInfo($airport = '')
2032 2032
 	{
2033 2033
 		
@@ -2073,12 +2073,12 @@  discard block
 block discarded – undo
2073 2073
 	}
2074 2074
 	
2075 2075
 	/**
2076
-	* Gets the airport info based on the country
2077
-	*
2078
-	* @param Array $countries Airports countries
2079
-	* @return Array airport information
2080
-	*
2081
-	*/
2076
+	 * Gets the airport info based on the country
2077
+	 *
2078
+	 * @param Array $countries Airports countries
2079
+	 * @return Array airport information
2080
+	 *
2081
+	 */
2082 2082
 	public function getAllAirportInfobyCountry($countries)
2083 2083
 	{
2084 2084
 		$lst_countries = '';
@@ -2116,12 +2116,12 @@  discard block
 block discarded – undo
2116 2116
 	}
2117 2117
 	
2118 2118
 	/**
2119
-	* Gets airports info based on the coord
2120
-	*
2121
-	* @param Array $coord Airports longitude min,latitude min, longitude max, latitude max
2122
-	* @return Array airport information
2123
-	*
2124
-	*/
2119
+	 * Gets airports info based on the coord
2120
+	 *
2121
+	 * @param Array $coord Airports longitude min,latitude min, longitude max, latitude max
2122
+	 * @return Array airport information
2123
+	 *
2124
+	 */
2125 2125
 	public function getAllAirportInfobyCoord($coord)
2126 2126
 	{
2127 2127
 		global $globalDBdriver;
@@ -2152,12 +2152,12 @@  discard block
 block discarded – undo
2152 2152
 	}
2153 2153
 
2154 2154
 	/**
2155
-	* Gets waypoints info based on the coord
2156
-	*
2157
-	* @param Array $coord waypoints coord
2158
-	* @return Array airport information
2159
-	*
2160
-	*/
2155
+	 * Gets waypoints info based on the coord
2156
+	 *
2157
+	 * @param Array $coord waypoints coord
2158
+	 * @return Array airport information
2159
+	 *
2160
+	 */
2161 2161
 	public function getAllWaypointsInfobyCoord($coord)
2162 2162
 	{
2163 2163
 		if (is_array($coord)) {
@@ -2191,12 +2191,12 @@  discard block
 block discarded – undo
2191 2191
 	
2192 2192
 	
2193 2193
 	/**
2194
-	* Gets the airline info based on the icao code or iata code
2195
-	*
2196
-	* @param String $airline_icao the iata code of the airport
2197
-	* @return Array airport information
2198
-	*
2199
-	*/
2194
+	 * Gets the airline info based on the icao code or iata code
2195
+	 *
2196
+	 * @param String $airline_icao the iata code of the airport
2197
+	 * @return Array airport information
2198
+	 *
2199
+	 */
2200 2200
 	public function getAllAirlineInfo($airline_icao, $fromsource = NULL)
2201 2201
 	{
2202 2202
 		global $globalUseRealAirlines;
@@ -2227,7 +2227,7 @@  discard block
 block discarded – undo
2227 2227
 			} else {
2228 2228
 				$sth->execute(array(':airline_icao' => $airline_icao,':fromsource' => $fromsource));
2229 2229
 			}
2230
-                        /*
2230
+						/*
2231 2231
 			$airline_array = array();
2232 2232
 			$temp_array = array();
2233 2233
 		
@@ -2260,12 +2260,12 @@  discard block
 block discarded – undo
2260 2260
 	}
2261 2261
 	
2262 2262
 	/**
2263
-	* Gets the airline info based on the airline name
2264
-	*
2265
-	* @param String $airline_name the name of the airline
2266
-	* @return Array airline information
2267
-	*
2268
-	*/
2263
+	 * Gets the airline info based on the airline name
2264
+	 *
2265
+	 * @param String $airline_name the name of the airline
2266
+	 * @return Array airline information
2267
+	 *
2268
+	 */
2269 2269
 	public function getAllAirlineInfoByName($airline_name, $fromsource = NULL)
2270 2270
 	{
2271 2271
 		global $globalUseRealAirlines;
@@ -2293,12 +2293,12 @@  discard block
 block discarded – undo
2293 2293
 	
2294 2294
 	
2295 2295
 	/**
2296
-	* Gets the aircraft info based on the aircraft type
2297
-	*
2298
-	* @param String $aircraft_type the aircraft type
2299
-	* @return Array aircraft information
2300
-	*
2301
-	*/
2296
+	 * Gets the aircraft info based on the aircraft type
2297
+	 *
2298
+	 * @param String $aircraft_type the aircraft type
2299
+	 * @return Array aircraft information
2300
+	 *
2301
+	 */
2302 2302
 	public function getAllAircraftInfo($aircraft_type)
2303 2303
 	{
2304 2304
 		$aircraft_type = filter_var($aircraft_type,FILTER_SANITIZE_STRING);
@@ -2330,12 +2330,12 @@  discard block
 block discarded – undo
2330 2330
 	}
2331 2331
 
2332 2332
 	/**
2333
-	* Gets the aircraft icao based on the aircraft name/type
2334
-	*
2335
-	* @param String $aircraft_type the aircraft type
2336
-	* @return String aircraft information
2337
-	*
2338
-	*/
2333
+	 * Gets the aircraft icao based on the aircraft name/type
2334
+	 *
2335
+	 * @param String $aircraft_type the aircraft type
2336
+	 * @return String aircraft information
2337
+	 *
2338
+	 */
2339 2339
 	public function getAircraftIcao($aircraft_type)
2340 2340
 	{
2341 2341
 		$aircraft_type = filter_var($aircraft_type,FILTER_SANITIZE_STRING);
@@ -2360,12 +2360,12 @@  discard block
 block discarded – undo
2360 2360
 	}
2361 2361
 	
2362 2362
 	/**
2363
-	* Gets the aircraft info based on the aircraft modes
2364
-	*
2365
-	* @param String $aircraft_modes the aircraft ident (hex)
2366
-	* @return String aircraft type
2367
-	*
2368
-	*/
2363
+	 * Gets the aircraft info based on the aircraft modes
2364
+	 *
2365
+	 * @param String $aircraft_modes the aircraft ident (hex)
2366
+	 * @return String aircraft type
2367
+	 *
2368
+	 */
2369 2369
 	public function getAllAircraftType($aircraft_modes)
2370 2370
 	{
2371 2371
 		$aircraft_modes = filter_var($aircraft_modes,FILTER_SANITIZE_STRING);
@@ -2385,12 +2385,12 @@  discard block
 block discarded – undo
2385 2385
 	}
2386 2386
 
2387 2387
 	/**
2388
-	* Gets the aircraft info based on the aircraft registration
2389
-	*
2390
-	* @param String $registration the aircraft registration
2391
-	* @return String aircraft type
2392
-	*
2393
-	*/
2388
+	 * Gets the aircraft info based on the aircraft registration
2389
+	 *
2390
+	 * @param String $registration the aircraft registration
2391
+	 * @return String aircraft type
2392
+	 *
2393
+	 */
2394 2394
 	public function getAllAircraftTypeByRegistration($registration)
2395 2395
 	{
2396 2396
 		$registration = filter_var($registration,FILTER_SANITIZE_STRING);
@@ -2408,12 +2408,12 @@  discard block
 block discarded – undo
2408 2408
 	}
2409 2409
 
2410 2410
 	/**
2411
-	* Gets the spotter_id and flightaware_id based on the aircraft registration
2412
-	*
2413
-	* @param String $registration the aircraft registration
2414
-	* @return Array spotter_id and flightaware_id
2415
-	*
2416
-	*/
2411
+	 * Gets the spotter_id and flightaware_id based on the aircraft registration
2412
+	 *
2413
+	 * @param String $registration the aircraft registration
2414
+	 * @return Array spotter_id and flightaware_id
2415
+	 *
2416
+	 */
2417 2417
 	public function getAllIDByRegistration($registration)
2418 2418
 	{
2419 2419
 		$registration = filter_var($registration,FILTER_SANITIZE_STRING);
@@ -2432,12 +2432,12 @@  discard block
 block discarded – undo
2432 2432
 	}
2433 2433
 
2434 2434
 	/**
2435
-	* Gets correct aircraft operator code
2436
-	*
2437
-	* @param String $operator the aircraft operator code (callsign)
2438
-	* @return String aircraft operator code
2439
-	*
2440
-	*/
2435
+	 * Gets correct aircraft operator code
2436
+	 *
2437
+	 * @param String $operator the aircraft operator code (callsign)
2438
+	 * @return String aircraft operator code
2439
+	 *
2440
+	 */
2441 2441
 	public function getOperator($operator)
2442 2442
 	{
2443 2443
 		$operator = filter_var($operator,FILTER_SANITIZE_STRING);
@@ -2454,16 +2454,16 @@  discard block
 block discarded – undo
2454 2454
 	}
2455 2455
 
2456 2456
 	/**
2457
-	* Gets the aircraft route based on the aircraft callsign
2458
-	*
2459
-	* @param String $callsign the aircraft callsign
2460
-	* @return Array aircraft type
2461
-	*
2462
-	*/
2457
+	 * Gets the aircraft route based on the aircraft callsign
2458
+	 *
2459
+	 * @param String $callsign the aircraft callsign
2460
+	 * @return Array aircraft type
2461
+	 *
2462
+	 */
2463 2463
 	public function getRouteInfo($callsign)
2464 2464
 	{
2465 2465
 		$callsign = filter_var($callsign,FILTER_SANITIZE_STRING);
2466
-                if ($callsign == '') return array();
2466
+				if ($callsign == '') return array();
2467 2467
 		$query  = "SELECT routes.Operator_ICAO, routes.FromAirport_ICAO, routes.ToAirport_ICAO, routes.RouteStop, routes.FromAirport_Time, routes.ToAirport_Time FROM routes WHERE CallSign = :callsign LIMIT 1";
2468 2468
 		
2469 2469
 		$sth = $this->db->prepare($query);
@@ -2477,12 +2477,12 @@  discard block
 block discarded – undo
2477 2477
 	}
2478 2478
 	
2479 2479
 	/**
2480
-	* Gets the aircraft info based on the aircraft registration
2481
-	*
2482
-	* @param String $registration the aircraft registration
2483
-	* @return Array aircraft information
2484
-	*
2485
-	*/
2480
+	 * Gets the aircraft info based on the aircraft registration
2481
+	 *
2482
+	 * @param String $registration the aircraft registration
2483
+	 * @return Array aircraft information
2484
+	 *
2485
+	 */
2486 2486
 	public function getAircraftInfoByRegistration($registration)
2487 2487
 	{
2488 2488
 		$registration = filter_var($registration,FILTER_SANITIZE_STRING);
@@ -2509,12 +2509,12 @@  discard block
 block discarded – undo
2509 2509
 	}
2510 2510
 	
2511 2511
 	/**
2512
-	* Gets the aircraft owner & base based on the aircraft registration
2513
-	*
2514
-	* @param String $registration the aircraft registration
2515
-	* @return Array aircraft information
2516
-	*
2517
-	*/
2512
+	 * Gets the aircraft owner & base based on the aircraft registration
2513
+	 *
2514
+	 * @param String $registration the aircraft registration
2515
+	 * @return Array aircraft information
2516
+	 *
2517
+	 */
2518 2518
 	public function getAircraftOwnerByRegistration($registration)
2519 2519
 	{
2520 2520
 		$registration = filter_var($registration,FILTER_SANITIZE_STRING);
@@ -2531,11 +2531,11 @@  discard block
 block discarded – undo
2531 2531
 	
2532 2532
   
2533 2533
   /**
2534
-	* Gets all flights (but with only little info)
2535
-	*
2536
-	* @return Array basic flight information
2537
-	*
2538
-	*/
2534
+   * Gets all flights (but with only little info)
2535
+   *
2536
+   * @return Array basic flight information
2537
+   *
2538
+   */
2539 2539
 	public function getAllFlightsforSitemap()
2540 2540
 	{
2541 2541
 		//$query  = "SELECT spotter_output.spotter_id, spotter_output.ident, spotter_output.airline_name, spotter_output.aircraft_name, spotter_output.aircraft_icao FROM spotter_output ORDER BY LIMIT ";
@@ -2543,7 +2543,7 @@  discard block
 block discarded – undo
2543 2543
 		
2544 2544
 		$sth = $this->db->prepare($query);
2545 2545
 		$sth->execute();
2546
-                  /*
2546
+				  /*
2547 2547
 		$flight_array = array();
2548 2548
 		$temp_array = array();
2549 2549
 		
@@ -2565,11 +2565,11 @@  discard block
 block discarded – undo
2565 2565
 	}
2566 2566
   
2567 2567
 	/**
2568
-	* Gets a list of all aircraft manufacturers
2569
-	*
2570
-	* @return Array list of aircraft types
2571
-	*
2572
-	*/
2568
+	 * Gets a list of all aircraft manufacturers
2569
+	 *
2570
+	 * @return Array list of aircraft types
2571
+	 *
2572
+	 */
2573 2573
 	public function getAllManufacturers()
2574 2574
 	{
2575 2575
 		/*
@@ -2598,11 +2598,11 @@  discard block
 block discarded – undo
2598 2598
   
2599 2599
   
2600 2600
   /**
2601
-	* Gets a list of all aircraft types
2602
-	*
2603
-	* @return Array list of aircraft types
2604
-	*
2605
-	*/
2601
+   * Gets a list of all aircraft types
2602
+   *
2603
+   * @return Array list of aircraft types
2604
+   *
2605
+   */
2606 2606
 	public function getAllAircraftTypes($filters = array())
2607 2607
 	{
2608 2608
 		/*
@@ -2637,11 +2637,11 @@  discard block
 block discarded – undo
2637 2637
 	
2638 2638
 	
2639 2639
 	/**
2640
-	* Gets a list of all aircraft registrations
2641
-	*
2642
-	* @return Array list of aircraft registrations
2643
-	*
2644
-	*/
2640
+	 * Gets a list of all aircraft registrations
2641
+	 *
2642
+	 * @return Array list of aircraft registrations
2643
+	 *
2644
+	 */
2645 2645
 	public function getAllAircraftRegistrations($filters = array())
2646 2646
 	{
2647 2647
 		$filter_query = $this->getFilter($filters,true,true);
@@ -2666,12 +2666,12 @@  discard block
 block discarded – undo
2666 2666
 	}
2667 2667
 
2668 2668
 	/**
2669
-	* Gets all source name
2670
-	*
2671
-	* @param String type format of source
2672
-	* @return Array list of source name
2673
-	*
2674
-	*/
2669
+	 * Gets all source name
2670
+	 *
2671
+	 * @param String type format of source
2672
+	 * @return Array list of source name
2673
+	 *
2674
+	 */
2675 2675
 	public function getAllSourceName($type = '',$filters = array())
2676 2676
 	{
2677 2677
 		$filter_query = $this->getFilter($filters,true,true);
@@ -2702,11 +2702,11 @@  discard block
 block discarded – undo
2702 2702
 
2703 2703
 
2704 2704
 	/**
2705
-	* Gets a list of all airline names
2706
-	*
2707
-	* @return Array list of airline names
2708
-	*
2709
-	*/
2705
+	 * Gets a list of all airline names
2706
+	 *
2707
+	 * @return Array list of airline names
2708
+	 *
2709
+	 */
2710 2710
 	public function getAllAirlineNames($airline_type = '',$forsource = NULL,$filters = array())
2711 2711
 	{
2712 2712
 		global $globalAirlinesSource,$globalVATSIM, $globalIVAO;
@@ -2755,11 +2755,11 @@  discard block
 block discarded – undo
2755 2755
 	}
2756 2756
 	
2757 2757
 	/**
2758
-	* Gets a list of all alliance names
2759
-	*
2760
-	* @return Array list of alliance names
2761
-	*
2762
-	*/
2758
+	 * Gets a list of all alliance names
2759
+	 *
2760
+	 * @return Array list of alliance names
2761
+	 *
2762
+	 */
2763 2763
 	public function getAllAllianceNames($forsource = NULL,$filters = array())
2764 2764
 	{
2765 2765
 		global $globalAirlinesSource,$globalVATSIM, $globalIVAO;
@@ -2784,11 +2784,11 @@  discard block
 block discarded – undo
2784 2784
 	}
2785 2785
 	
2786 2786
 	/**
2787
-	* Gets a list of all airline countries
2788
-	*
2789
-	* @return Array list of airline countries
2790
-	*
2791
-	*/
2787
+	 * Gets a list of all airline countries
2788
+	 *
2789
+	 * @return Array list of airline countries
2790
+	 *
2791
+	 */
2792 2792
 	public function getAllAirlineCountries($filters = array())
2793 2793
 	{
2794 2794
 		$filter_query = $this->getFilter($filters,true,true);
@@ -2816,11 +2816,11 @@  discard block
 block discarded – undo
2816 2816
 	
2817 2817
 	
2818 2818
 	/**
2819
-	* Gets a list of all departure & arrival names
2820
-	*
2821
-	* @return Array list of airport names
2822
-	*
2823
-	*/
2819
+	 * Gets a list of all departure & arrival names
2820
+	 *
2821
+	 * @return Array list of airport names
2822
+	 *
2823
+	 */
2824 2824
 	public function getAllAirportNames($filters = array())
2825 2825
 	{
2826 2826
 		$filter_query = $this->getFilter($filters,true,true);
@@ -2869,11 +2869,11 @@  discard block
 block discarded – undo
2869 2869
 	
2870 2870
 	
2871 2871
 	/**
2872
-	* Gets a list of all departure & arrival airport countries
2873
-	*
2874
-	* @return Array list of airport countries
2875
-	*
2876
-	*/
2872
+	 * Gets a list of all departure & arrival airport countries
2873
+	 *
2874
+	 * @return Array list of airport countries
2875
+	 *
2876
+	 */
2877 2877
 	public function getAllAirportCountries($filters = array())
2878 2878
 	{
2879 2879
 		$airport_array = array();
@@ -2921,11 +2921,11 @@  discard block
 block discarded – undo
2921 2921
 	
2922 2922
 	
2923 2923
 	/**
2924
-	* Gets a list of all countries (airline, departure airport & arrival airport)
2925
-	*
2926
-	* @return Array list of countries
2927
-	*
2928
-	*/
2924
+	 * Gets a list of all countries (airline, departure airport & arrival airport)
2925
+	 *
2926
+	 * @return Array list of countries
2927
+	 *
2928
+	 */
2929 2929
 	public function getAllCountries($filters = array())
2930 2930
 	{
2931 2931
 		$Connection= new Connection($this->db);
@@ -3002,11 +3002,11 @@  discard block
 block discarded – undo
3002 3002
 	
3003 3003
 	
3004 3004
 	/**
3005
-	* Gets a list of all idents/callsigns
3006
-	*
3007
-	* @return Array list of ident/callsign names
3008
-	*
3009
-	*/
3005
+	 * Gets a list of all idents/callsigns
3006
+	 *
3007
+	 * @return Array list of ident/callsign names
3008
+	 *
3009
+	 */
3010 3010
 	public function getAllIdents($filters = array())
3011 3011
 	{
3012 3012
 		$filter_query = $this->getFilter($filters,true,true);
@@ -3030,9 +3030,9 @@  discard block
 block discarded – undo
3030 3030
 	}
3031 3031
 
3032 3032
 	/**
3033
-	* Get a list of flights from airport since 7 days
3034
-	* @return Array number, icao, name and city of airports
3035
-	*/
3033
+	 * Get a list of flights from airport since 7 days
3034
+	 * @return Array number, icao, name and city of airports
3035
+	 */
3036 3036
 
3037 3037
 	public function getLast7DaysAirportsDeparture($airport_icao = '',$filters = array()) {
3038 3038
 		global $globalTimezone, $globalDBdriver;
@@ -3063,9 +3063,9 @@  discard block
 block discarded – undo
3063 3063
 	}
3064 3064
 
3065 3065
 	/**
3066
-	* Get a list of flights from airport since 7 days
3067
-	* @return Array number, icao, name and city of airports
3068
-	*/
3066
+	 * Get a list of flights from airport since 7 days
3067
+	 * @return Array number, icao, name and city of airports
3068
+	 */
3069 3069
 
3070 3070
 	public function getLast7DaysAirportsDepartureByAirlines($airport_icao = '') {
3071 3071
 		global $globalTimezone, $globalDBdriver;
@@ -3095,9 +3095,9 @@  discard block
 block discarded – undo
3095 3095
 	}
3096 3096
 
3097 3097
 	/**
3098
-	* Get a list of flights from detected airport since 7 days
3099
-	* @return Array number, icao, name and city of airports
3100
-	*/
3098
+	 * Get a list of flights from detected airport since 7 days
3099
+	 * @return Array number, icao, name and city of airports
3100
+	 */
3101 3101
 
3102 3102
 	public function getLast7DaysDetectedAirportsDeparture($airport_icao = '', $filters = array()) {
3103 3103
 		global $globalTimezone, $globalDBdriver;
@@ -3135,9 +3135,9 @@  discard block
 block discarded – undo
3135 3135
 	}
3136 3136
 
3137 3137
 	/**
3138
-	* Get a list of flights from detected airport since 7 days
3139
-	* @return Array number, icao, name and city of airports
3140
-	*/
3138
+	 * Get a list of flights from detected airport since 7 days
3139
+	 * @return Array number, icao, name and city of airports
3140
+	 */
3141 3141
 
3142 3142
 	public function getLast7DaysDetectedAirportsDepartureByAirlines($airport_icao = '') {
3143 3143
 		global $globalTimezone, $globalDBdriver;
@@ -3179,9 +3179,9 @@  discard block
 block discarded – undo
3179 3179
 
3180 3180
 
3181 3181
 	/**
3182
-	* Get a list of flights to airport since 7 days
3183
-	* @return Array number, icao, name and city of airports
3184
-	*/
3182
+	 * Get a list of flights to airport since 7 days
3183
+	 * @return Array number, icao, name and city of airports
3184
+	 */
3185 3185
 
3186 3186
 	public function getLast7DaysAirportsArrival($airport_icao = '', $filters = array()) {
3187 3187
 		global $globalTimezone, $globalDBdriver;
@@ -3214,9 +3214,9 @@  discard block
 block discarded – undo
3214 3214
 
3215 3215
 
3216 3216
 	/**
3217
-	* Get a list of flights detected to airport since 7 days
3218
-	* @return Array number, icao, name and city of airports
3219
-	*/
3217
+	 * Get a list of flights detected to airport since 7 days
3218
+	 * @return Array number, icao, name and city of airports
3219
+	 */
3220 3220
 
3221 3221
 	public function getLast7DaysDetectedAirportsArrival($airport_icao = '',$filters = array()) {
3222 3222
 		global $globalTimezone, $globalDBdriver;
@@ -3257,9 +3257,9 @@  discard block
 block discarded – undo
3257 3257
 
3258 3258
 
3259 3259
 	/**
3260
-	* Get a list of flights to airport since 7 days
3261
-	* @return Array number, icao, name and city of airports
3262
-	*/
3260
+	 * Get a list of flights to airport since 7 days
3261
+	 * @return Array number, icao, name and city of airports
3262
+	 */
3263 3263
 
3264 3264
 	public function getLast7DaysAirportsArrivalByAirlines($airport_icao = '') {
3265 3265
 		global $globalTimezone, $globalDBdriver;
@@ -3291,9 +3291,9 @@  discard block
 block discarded – undo
3291 3291
 
3292 3292
 
3293 3293
 	/**
3294
-	* Get a list of flights detected to airport since 7 days
3295
-	* @return Array number, icao, name and city of airports
3296
-	*/
3294
+	 * Get a list of flights detected to airport since 7 days
3295
+	 * @return Array number, icao, name and city of airports
3296
+	 */
3297 3297
 
3298 3298
 	public function getLast7DaysDetectedAirportsArrivalByAirlines($airport_icao = '') {
3299 3299
 		global $globalTimezone, $globalDBdriver;
@@ -3337,11 +3337,11 @@  discard block
 block discarded – undo
3337 3337
 
3338 3338
 
3339 3339
 	/**
3340
-	* Gets a list of all dates
3341
-	*
3342
-	* @return Array list of date names
3343
-	*
3344
-	*/
3340
+	 * Gets a list of all dates
3341
+	 *
3342
+	 * @return Array list of date names
3343
+	 *
3344
+	 */
3345 3345
 	public function getAllDates()
3346 3346
 	{
3347 3347
 		global $globalTimezone, $globalDBdriver;
@@ -3382,11 +3382,11 @@  discard block
 block discarded – undo
3382 3382
 	
3383 3383
 	
3384 3384
 	/**
3385
-	* Gets all route combinations
3386
-	*
3387
-	* @return Array the route list
3388
-	*
3389
-	*/
3385
+	 * Gets all route combinations
3386
+	 *
3387
+	 * @return Array the route list
3388
+	 *
3389
+	 */
3390 3390
 	public function getAllRoutes()
3391 3391
 	{
3392 3392
 		$query  = "SELECT DISTINCT concat(spotter_output.departure_airport_icao, ' - ',  spotter_output.arrival_airport_icao) AS route,  spotter_output.departure_airport_icao, spotter_output.arrival_airport_icao 
@@ -3412,13 +3412,13 @@  discard block
 block discarded – undo
3412 3412
 	}
3413 3413
 
3414 3414
 	/**
3415
-	* Update ident spotter data
3416
-	*
3417
-	* @param String $flightaware_id the ID from flightaware
3418
-	* @param String $ident the flight ident
3419
-	* @return String success or false
3420
-	*
3421
-	*/	
3415
+	 * Update ident spotter data
3416
+	 *
3417
+	 * @param String $flightaware_id the ID from flightaware
3418
+	 * @param String $ident the flight ident
3419
+	 * @return String success or false
3420
+	 *
3421
+	 */	
3422 3422
 	public function updateIdentSpotterData($flightaware_id = '', $ident = '',$fromsource = NULL)
3423 3423
 	{
3424 3424
 		if (!is_numeric(substr($ident, 0, 3)))
@@ -3439,14 +3439,14 @@  discard block
 block discarded – undo
3439 3439
 		} else {
3440 3440
 			$airline_array = $this->getAllAirlineInfo("NA");
3441 3441
 		}
3442
-                $airline_name = $airline_array[0]['name'];
3443
-                $airline_icao = $airline_array[0]['icao'];
3444
-                $airline_country = $airline_array[0]['country'];
3445
-                $airline_type = $airline_array[0]['type'];
3442
+				$airline_name = $airline_array[0]['name'];
3443
+				$airline_icao = $airline_array[0]['icao'];
3444
+				$airline_country = $airline_array[0]['country'];
3445
+				$airline_type = $airline_array[0]['type'];
3446 3446
 
3447 3447
 
3448 3448
 		$query = 'UPDATE spotter_output SET ident = :ident, airline_name = :airline_name, airline_icao = :airline_icao, airline_country = :airline_country, airline_type = :airline_type WHERE flightaware_id = :flightaware_id';
3449
-                $query_values = array(':flightaware_id' => $flightaware_id,':ident' => $ident,':airline_name' => $airline_name,':airline_icao' => $airline_icao,':airline_country' => $airline_country,':airline_type' => $airline_type);
3449
+				$query_values = array(':flightaware_id' => $flightaware_id,':ident' => $ident,':airline_name' => $airline_name,':airline_icao' => $airline_icao,':airline_country' => $airline_country,':airline_type' => $airline_type);
3450 3450
 
3451 3451
 		try {
3452 3452
 			$sth = $this->db->prepare($query);
@@ -3459,19 +3459,19 @@  discard block
 block discarded – undo
3459 3459
 
3460 3460
 	}
3461 3461
 	/**
3462
-	* Update latest spotter data
3463
-	*
3464
-	* @param String $flightaware_id the ID from flightaware
3465
-	* @param String $ident the flight ident
3466
-	* @param String $arrival_airport_icao the arrival airport
3467
-	* @return String success or false
3468
-	*
3469
-	*/	
3462
+	 * Update latest spotter data
3463
+	 *
3464
+	 * @param String $flightaware_id the ID from flightaware
3465
+	 * @param String $ident the flight ident
3466
+	 * @param String $arrival_airport_icao the arrival airport
3467
+	 * @return String success or false
3468
+	 *
3469
+	 */	
3470 3470
 	public function updateLatestSpotterData($flightaware_id = '', $ident = '', $latitude = '', $longitude = '', $altitude = '', $ground = false, $groundspeed = NULL, $date = '', $arrival_airport_icao = '',$arrival_airport_time = '')
3471 3471
 	{
3472 3472
 		if ($groundspeed == '') $groundspeed = NULL;
3473 3473
 		$query = 'UPDATE spotter_output SET ident = :ident, last_latitude = :last_latitude, last_longitude = :last_longitude, last_altitude = :last_altitude, last_ground = :last_ground, last_seen = :last_seen, real_arrival_airport_icao = :real_arrival_airport_icao, real_arrival_airport_time = :real_arrival_airport_time, last_ground_speed = :last_ground_speed WHERE flightaware_id = :flightaware_id';
3474
-                $query_values = array(':flightaware_id' => $flightaware_id,':real_arrival_airport_icao' => $arrival_airport_icao,':last_latitude' => $latitude,':last_longitude' => $longitude, ':last_altitude' => $altitude,':last_ground_speed' => $groundspeed,':last_seen' => $date,':real_arrival_airport_time' => $arrival_airport_time, ':last_ground' => $ground, ':ident' => $ident);
3474
+				$query_values = array(':flightaware_id' => $flightaware_id,':real_arrival_airport_icao' => $arrival_airport_icao,':last_latitude' => $latitude,':last_longitude' => $longitude, ':last_altitude' => $altitude,':last_ground_speed' => $groundspeed,':last_seen' => $date,':real_arrival_airport_time' => $arrival_airport_time, ':last_ground' => $ground, ':ident' => $ident);
3475 3475
 
3476 3476
 		try {
3477 3477
 			$sth = $this->db->prepare($query);
@@ -3485,32 +3485,32 @@  discard block
 block discarded – undo
3485 3485
 	}
3486 3486
 
3487 3487
 	/**
3488
-	* Adds a new spotter data
3489
-	*
3490
-	* @param String $flightaware_id the ID from flightaware
3491
-	* @param String $ident the flight ident
3492
-	* @param String $aircraft_icao the aircraft type
3493
-	* @param String $departure_airport_icao the departure airport
3494
-	* @param String $arrival_airport_icao the arrival airport
3495
-	* @param String $latitude latitude of flight
3496
-	* @param String $longitude latitude of flight
3497
-	* @param String $waypoints waypoints of flight
3498
-	* @param String $altitude altitude of flight
3499
-	* @param String $heading heading of flight
3500
-	* @param String $groundspeed speed of flight
3501
-	* @param String $date date of flight
3502
-	* @param String $departure_airport_time departure time of flight
3503
-	* @param String $arrival_airport_time arrival time of flight
3504
-	* @param String $squawk squawk code of flight
3505
-	* @param String $route_stop route stop of flight
3506
-	* @param String $highlight highlight or not
3507
-	* @param String $ModeS ModesS code of flight
3508
-	* @param String $registration registration code of flight
3509
-	* @param String $pilot_id pilot id of flight (for virtual airlines)
3510
-	* @param String $pilot_name pilot name of flight (for virtual airlines)
3511
-	* @param String $verticalrate vertival rate of flight
3512
-	* @return String success or false
3513
-	*/
3488
+	 * Adds a new spotter data
3489
+	 *
3490
+	 * @param String $flightaware_id the ID from flightaware
3491
+	 * @param String $ident the flight ident
3492
+	 * @param String $aircraft_icao the aircraft type
3493
+	 * @param String $departure_airport_icao the departure airport
3494
+	 * @param String $arrival_airport_icao the arrival airport
3495
+	 * @param String $latitude latitude of flight
3496
+	 * @param String $longitude latitude of flight
3497
+	 * @param String $waypoints waypoints of flight
3498
+	 * @param String $altitude altitude of flight
3499
+	 * @param String $heading heading of flight
3500
+	 * @param String $groundspeed speed of flight
3501
+	 * @param String $date date of flight
3502
+	 * @param String $departure_airport_time departure time of flight
3503
+	 * @param String $arrival_airport_time arrival time of flight
3504
+	 * @param String $squawk squawk code of flight
3505
+	 * @param String $route_stop route stop of flight
3506
+	 * @param String $highlight highlight or not
3507
+	 * @param String $ModeS ModesS code of flight
3508
+	 * @param String $registration registration code of flight
3509
+	 * @param String $pilot_id pilot id of flight (for virtual airlines)
3510
+	 * @param String $pilot_name pilot name of flight (for virtual airlines)
3511
+	 * @param String $verticalrate vertival rate of flight
3512
+	 * @return String success or false
3513
+	 */
3514 3514
 	public function addSpotterData($flightaware_id = '', $ident = '', $aircraft_icao = '', $departure_airport_icao = '', $arrival_airport_icao = '', $latitude = '', $longitude = '', $waypoints = '', $altitude = '', $heading = '', $groundspeed = '', $date = '', $departure_airport_time = '', $arrival_airport_time = '',$squawk = '', $route_stop = '', $highlight = '', $ModeS = '', $registration = '',$pilot_id = '', $pilot_name = '', $verticalrate = '', $ground = false,$format_source = '', $source_name = '')
3515 3515
 	{
3516 3516
 		global $globalURL, $globalIVAO, $globalVATSIM, $globalphpVMS, $globalDebugTimeElapsed, $globalAirlinesSource, $globalVAM;
@@ -3725,8 +3725,8 @@  discard block
 block discarded – undo
3725 3725
     
3726 3726
 		if ($globalIVAO && $aircraft_icao != '')
3727 3727
 		{
3728
-            		if (isset($airline_array[0]['icao'])) $airline_icao = $airline_array[0]['icao'];
3729
-            		else $airline_icao = '';
3728
+					if (isset($airline_array[0]['icao'])) $airline_icao = $airline_array[0]['icao'];
3729
+					else $airline_icao = '';
3730 3730
 			$image_array = $Image->getSpotterImage('',$aircraft_icao,$airline_icao);
3731 3731
 			if (!isset($image_array[0]['registration']))
3732 3732
 			{
@@ -3757,53 +3757,53 @@  discard block
 block discarded – undo
3757 3757
 	
3758 3758
 		if (count($airline_array) == 0) 
3759 3759
 		{
3760
-                        $airline_array = $this->getAllAirlineInfo('NA');
3761
-                }
3762
-                if (count($aircraft_array) == 0) 
3763
-                {
3764
-                        $aircraft_array = $this->getAllAircraftInfo('NA');
3765
-                }
3766
-                if (count($departure_airport_array) == 0 || $departure_airport_array[0]['icao'] == '' || $departure_airport_icao == '') 
3767
-                {
3768
-                        $departure_airport_array = $this->getAllAirportInfo('NA');
3769
-                }
3770
-                if (count($arrival_airport_array) == 0 || $arrival_airport_array[0]['icao'] == '' || $arrival_airport_icao == '') 
3771
-                {
3772
-                        $arrival_airport_array = $this->getAllAirportInfo('NA');
3773
-                }
3774
-                if ($registration == '') $registration = 'NA';
3775
-                if ($latitude == '' && $longitude == '') {
3776
-            		$latitude = 0;
3777
-            		$longitude = 0;
3778
-            	}
3779
-                if ($squawk == '' || $Common->isInteger($squawk) === false) $squawk = NULL;
3780
-                if ($verticalrate == '' || $Common->isInteger($verticalrate) === false) $verticalrate = NULL;
3781
-                if ($heading == '' || $Common->isInteger($heading) === false) $heading = 0;
3782
-                if ($groundspeed == '' || $Common->isInteger($groundspeed) === false) $groundspeed = 0;
3783
-                if (!isset($aircraft_owner)) $aircraft_owner = NULL;
3784
-                $query  = "INSERT INTO spotter_output (flightaware_id, ident, registration, airline_name, airline_icao, airline_country, airline_type, aircraft_icao, aircraft_name, aircraft_manufacturer, departure_airport_icao, departure_airport_name, departure_airport_city, departure_airport_country, arrival_airport_icao, arrival_airport_name, arrival_airport_city, arrival_airport_country, latitude, longitude, waypoints, altitude, heading, ground_speed, date, departure_airport_time, arrival_airport_time, squawk, route_stop,highlight,ModeS, pilot_id, pilot_name, verticalrate, owner_name, ground, format_source, source_name) 
3760
+						$airline_array = $this->getAllAirlineInfo('NA');
3761
+				}
3762
+				if (count($aircraft_array) == 0) 
3763
+				{
3764
+						$aircraft_array = $this->getAllAircraftInfo('NA');
3765
+				}
3766
+				if (count($departure_airport_array) == 0 || $departure_airport_array[0]['icao'] == '' || $departure_airport_icao == '') 
3767
+				{
3768
+						$departure_airport_array = $this->getAllAirportInfo('NA');
3769
+				}
3770
+				if (count($arrival_airport_array) == 0 || $arrival_airport_array[0]['icao'] == '' || $arrival_airport_icao == '') 
3771
+				{
3772
+						$arrival_airport_array = $this->getAllAirportInfo('NA');
3773
+				}
3774
+				if ($registration == '') $registration = 'NA';
3775
+				if ($latitude == '' && $longitude == '') {
3776
+					$latitude = 0;
3777
+					$longitude = 0;
3778
+				}
3779
+				if ($squawk == '' || $Common->isInteger($squawk) === false) $squawk = NULL;
3780
+				if ($verticalrate == '' || $Common->isInteger($verticalrate) === false) $verticalrate = NULL;
3781
+				if ($heading == '' || $Common->isInteger($heading) === false) $heading = 0;
3782
+				if ($groundspeed == '' || $Common->isInteger($groundspeed) === false) $groundspeed = 0;
3783
+				if (!isset($aircraft_owner)) $aircraft_owner = NULL;
3784
+				$query  = "INSERT INTO spotter_output (flightaware_id, ident, registration, airline_name, airline_icao, airline_country, airline_type, aircraft_icao, aircraft_name, aircraft_manufacturer, departure_airport_icao, departure_airport_name, departure_airport_city, departure_airport_country, arrival_airport_icao, arrival_airport_name, arrival_airport_city, arrival_airport_country, latitude, longitude, waypoints, altitude, heading, ground_speed, date, departure_airport_time, arrival_airport_time, squawk, route_stop,highlight,ModeS, pilot_id, pilot_name, verticalrate, owner_name, ground, format_source, source_name) 
3785 3785
                 VALUES (:flightaware_id,:ident,:registration,:airline_name,:airline_icao,:airline_country,:airline_type,:aircraft_icao,:aircraft_type,:aircraft_manufacturer,:departure_airport_icao,:departure_airport_name,:departure_airport_city,:departure_airport_country, :arrival_airport_icao, :arrival_airport_name, :arrival_airport_city, :arrival_airport_country, :latitude,:longitude,:waypoints,:altitude,:heading,:groundspeed,:date, :departure_airport_time, :arrival_airport_time, :squawk, :route_stop, :highlight, :ModeS, :pilot_id, :pilot_name, :verticalrate, :owner_name,:ground, :format_source, :source_name)";
3786 3786
 
3787
-                $airline_name = $airline_array[0]['name'];
3788
-                $airline_icao = $airline_array[0]['icao'];
3789
-                $airline_country = $airline_array[0]['country'];
3790
-                $airline_type = $airline_array[0]['type'];
3787
+				$airline_name = $airline_array[0]['name'];
3788
+				$airline_icao = $airline_array[0]['icao'];
3789
+				$airline_country = $airline_array[0]['country'];
3790
+				$airline_type = $airline_array[0]['type'];
3791 3791
 		if ($airline_type == '') {
3792 3792
 			$timeelapsed = microtime(true);
3793 3793
 			$airline_type = $this->getAircraftTypeBymodeS($ModeS);
3794 3794
 			if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftTypeBymodes : '.round(microtime(true)-$timeelapsed,2).'s'."\n";
3795 3795
 		}
3796 3796
 		if ($airline_type == null) $airline_type = '';
3797
-                $aircraft_type = $aircraft_array[0]['type'];
3798
-                $aircraft_manufacturer = $aircraft_array[0]['manufacturer'];
3799
-                $departure_airport_name = $departure_airport_array[0]['name'];
3800
-	        $departure_airport_city = $departure_airport_array[0]['city'];
3801
-            	$departure_airport_country = $departure_airport_array[0]['country'];
3797
+				$aircraft_type = $aircraft_array[0]['type'];
3798
+				$aircraft_manufacturer = $aircraft_array[0]['manufacturer'];
3799
+				$departure_airport_name = $departure_airport_array[0]['name'];
3800
+			$departure_airport_city = $departure_airport_array[0]['city'];
3801
+				$departure_airport_country = $departure_airport_array[0]['country'];
3802 3802
                 
3803
-                $arrival_airport_name = $arrival_airport_array[0]['name'];
3804
-                $arrival_airport_city = $arrival_airport_array[0]['city'];
3805
-                $arrival_airport_country = $arrival_airport_array[0]['country'];
3806
-                $query_values = array(':flightaware_id' => $flightaware_id,':ident' => $ident, ':registration' => $registration,':airline_name' => $airline_name,':airline_icao' => $airline_icao,':airline_country' => $airline_country,':airline_type' => $airline_type,':aircraft_icao' => $aircraft_icao,':aircraft_type' => $aircraft_type,':aircraft_manufacturer' => $aircraft_manufacturer,':departure_airport_icao' => $departure_airport_icao,':departure_airport_name' => $departure_airport_name,':departure_airport_city' => $departure_airport_city,':departure_airport_country' => $departure_airport_country,':arrival_airport_icao' => $arrival_airport_icao,':arrival_airport_name' => $arrival_airport_name,':arrival_airport_city' => $arrival_airport_city,':arrival_airport_country' => $arrival_airport_country,':latitude' => $latitude,':longitude' => $longitude, ':waypoints' => $waypoints,':altitude' => $altitude,':heading' => $heading,':groundspeed' => $groundspeed,':date' => $date,':departure_airport_time' => $departure_airport_time,':arrival_airport_time' => $arrival_airport_time, ':squawk' => $squawk, ':route_stop' => $route_stop, ':highlight' => $highlight, ':ModeS' => $ModeS, ':pilot_id' => $pilot_id, ':pilot_name' => $pilot_name, ':verticalrate' => $verticalrate, ':owner_name' => $aircraft_owner, ':format_source' => $format_source, ':ground' => $ground, ':source_name' => $source_name);
3803
+				$arrival_airport_name = $arrival_airport_array[0]['name'];
3804
+				$arrival_airport_city = $arrival_airport_array[0]['city'];
3805
+				$arrival_airport_country = $arrival_airport_array[0]['country'];
3806
+				$query_values = array(':flightaware_id' => $flightaware_id,':ident' => $ident, ':registration' => $registration,':airline_name' => $airline_name,':airline_icao' => $airline_icao,':airline_country' => $airline_country,':airline_type' => $airline_type,':aircraft_icao' => $aircraft_icao,':aircraft_type' => $aircraft_type,':aircraft_manufacturer' => $aircraft_manufacturer,':departure_airport_icao' => $departure_airport_icao,':departure_airport_name' => $departure_airport_name,':departure_airport_city' => $departure_airport_city,':departure_airport_country' => $departure_airport_country,':arrival_airport_icao' => $arrival_airport_icao,':arrival_airport_name' => $arrival_airport_name,':arrival_airport_city' => $arrival_airport_city,':arrival_airport_country' => $arrival_airport_country,':latitude' => $latitude,':longitude' => $longitude, ':waypoints' => $waypoints,':altitude' => $altitude,':heading' => $heading,':groundspeed' => $groundspeed,':date' => $date,':departure_airport_time' => $departure_airport_time,':arrival_airport_time' => $arrival_airport_time, ':squawk' => $squawk, ':route_stop' => $route_stop, ':highlight' => $highlight, ':ModeS' => $ModeS, ':pilot_id' => $pilot_id, ':pilot_name' => $pilot_name, ':verticalrate' => $verticalrate, ':owner_name' => $aircraft_owner, ':format_source' => $format_source, ':ground' => $ground, ':source_name' => $source_name);
3807 3807
 
3808 3808
 		try {
3809 3809
 		        
@@ -3811,7 +3811,7 @@  discard block
 block discarded – undo
3811 3811
 			$sth->execute($query_values);
3812 3812
 			$this->db = null;
3813 3813
 		} catch (PDOException $e) {
3814
-		    return "error : ".$e->getMessage();
3814
+			return "error : ".$e->getMessage();
3815 3815
 		}
3816 3816
 		
3817 3817
 		return "success";
@@ -3820,11 +3820,11 @@  discard block
 block discarded – undo
3820 3820
 	
3821 3821
   
3822 3822
 	/**
3823
-	* Gets the aircraft ident within the last hour
3824
-	*
3825
-	* @return String the ident
3826
-	*
3827
-	*/
3823
+	 * Gets the aircraft ident within the last hour
3824
+	 *
3825
+	 * @return String the ident
3826
+	 *
3827
+	 */
3828 3828
 	public function getIdentFromLastHour($ident)
3829 3829
 	{
3830 3830
 		global $globalDBdriver, $globalTimezone;
@@ -3840,11 +3840,11 @@  discard block
 block discarded – undo
3840 3840
 								AND spotter_output.date >= now() AT TIME ZONE 'UTC' - INTERVAL '1 HOURS'
3841 3841
 								AND spotter_output.date < now() AT TIME ZONE 'UTC'";
3842 3842
 			$query_data = array(':ident' => $ident);
3843
-    		}
3843
+			}
3844 3844
 		
3845 3845
 		$sth = $this->db->prepare($query);
3846 3846
 		$sth->execute($query_data);
3847
-    		$ident_result='';
3847
+			$ident_result='';
3848 3848
 		while($row = $sth->fetch(PDO::FETCH_ASSOC))
3849 3849
 		{
3850 3850
 			$ident_result = $row['ident'];
@@ -3855,11 +3855,11 @@  discard block
 block discarded – undo
3855 3855
 	
3856 3856
 	
3857 3857
 	/**
3858
-	* Gets the aircraft data from the last 20 seconds
3859
-	*
3860
-	* @return Array the spotter data
3861
-	*
3862
-	*/
3858
+	 * Gets the aircraft data from the last 20 seconds
3859
+	 *
3860
+	 * @return Array the spotter data
3861
+	 *
3862
+	 */
3863 3863
 	public function getRealTimeData($q = '')
3864 3864
 	{
3865 3865
 		global $globalDBdriver;
@@ -3903,11 +3903,11 @@  discard block
 block discarded – undo
3903 3903
 	
3904 3904
 	
3905 3905
 	 /**
3906
-	* Gets all airlines that have flown over
3907
-	*
3908
-	* @return Array the airline list
3909
-	*
3910
-	*/
3906
+	  * Gets all airlines that have flown over
3907
+	  *
3908
+	  * @return Array the airline list
3909
+	  *
3910
+	  */
3911 3911
 	public function countAllAirlines($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array(), $year = '', $month = '', $day = '')
3912 3912
 	{
3913 3913
 		global $globalDBdriver;
@@ -3921,7 +3921,7 @@  discard block
 block discarded – undo
3921 3921
 				$query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'";
3922 3922
 			}
3923 3923
 		}
3924
-                if ($sincedate != '') {
3924
+				if ($sincedate != '') {
3925 3925
 			if ($globalDBdriver == 'mysql') {
3926 3926
 				$query .= " AND spotter_output.date > '".$sincedate."'";
3927 3927
 			} else {
@@ -3975,26 +3975,26 @@  discard block
 block discarded – undo
3975 3975
 	}
3976 3976
 
3977 3977
 	 /**
3978
-	* Gets all pilots that have flown over
3979
-	*
3980
-	* @return Array the pilots list
3981
-	*
3982
-	*/
3978
+	  * Gets all pilots that have flown over
3979
+	  *
3980
+	  * @return Array the pilots list
3981
+	  *
3982
+	  */
3983 3983
 	public function countAllPilots($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array(),$year = '', $month = '',$day = '')
3984 3984
 	{
3985 3985
 		global $globalDBdriver;
3986 3986
 		$filter_query = $this->getFilter($filters,true,true);
3987 3987
 		$query  = "SELECT DISTINCT spotter_output.pilot_id, spotter_output.pilot_name, COUNT(spotter_output.pilot_id) AS pilot_count, spotter_output.format_source
3988 3988
 		 			FROM spotter_output".$filter_query." spotter_output.pilot_id <> '' ";
3989
-                if ($olderthanmonths > 0) {
3990
-            		if ($globalDBdriver == 'mysql') {
3989
+				if ($olderthanmonths > 0) {
3990
+					if ($globalDBdriver == 'mysql') {
3991 3991
 				$query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) ';
3992 3992
 			} else {
3993 3993
 				$query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' ";
3994 3994
 			}
3995 3995
 		}
3996
-                if ($sincedate != '') {
3997
-            		if ($globalDBdriver == 'mysql') {
3996
+				if ($sincedate != '') {
3997
+					if ($globalDBdriver == 'mysql') {
3998 3998
 				$query .= "AND spotter_output.date > '".$sincedate."' ";
3999 3999
 			} else {
4000 4000
 				$query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
@@ -4049,25 +4049,25 @@  discard block
 block discarded – undo
4049 4049
 	}
4050 4050
 	
4051 4051
 	/**
4052
-	* Gets all pilots that have flown over
4053
-	*
4054
-	* @return Array the pilots list
4055
-	*
4056
-	*/
4052
+	 * Gets all pilots that have flown over
4053
+	 *
4054
+	 * @return Array the pilots list
4055
+	 *
4056
+	 */
4057 4057
 	public function countAllPilotsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '')
4058 4058
 	{
4059 4059
 		global $globalDBdriver;
4060 4060
 		$query  = "SELECT DISTINCT spotter_output.airline_icao, spotter_output.pilot_id, spotter_output.pilot_name, COUNT(spotter_output.pilot_id) AS pilot_count, spotter_output.format_source
4061 4061
 		 			FROM spotter_output WHERE spotter_output.pilot_id <> '' ";
4062
-                if ($olderthanmonths > 0) {
4063
-            		if ($globalDBdriver == 'mysql') {
4062
+				if ($olderthanmonths > 0) {
4063
+					if ($globalDBdriver == 'mysql') {
4064 4064
 				$query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) ';
4065 4065
 			} else {
4066 4066
 				$query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' ";
4067 4067
 			}
4068 4068
 		}
4069
-                if ($sincedate != '') {
4070
-            		if ($globalDBdriver == 'mysql') {
4069
+				if ($sincedate != '') {
4070
+					if ($globalDBdriver == 'mysql') {
4071 4071
 				$query .= "AND spotter_output.date > '".$sincedate."' ";
4072 4072
 			} else {
4073 4073
 				$query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
@@ -4096,26 +4096,26 @@  discard block
 block discarded – undo
4096 4096
 	}
4097 4097
 	
4098 4098
 	 /**
4099
-	* Gets all owner that have flown over
4100
-	*
4101
-	* @return Array the pilots list
4102
-	*
4103
-	*/
4099
+	  * Gets all owner that have flown over
4100
+	  *
4101
+	  * @return Array the pilots list
4102
+	  *
4103
+	  */
4104 4104
 	public function countAllOwners($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array(),$year = '',$month = '',$day = '')
4105 4105
 	{
4106 4106
 		global $globalDBdriver;
4107 4107
 		$filter_query = $this->getFilter($filters,true,true);
4108 4108
 		$query  = "SELECT DISTINCT spotter_output.owner_name, COUNT(spotter_output.owner_name) AS owner_count
4109 4109
 					FROM spotter_output".$filter_query." spotter_output.owner_name <> '' AND spotter_output.owner_name IS NOT NULL";
4110
-                if ($olderthanmonths > 0) {
4111
-            		if ($globalDBdriver == 'mysql') {
4110
+				if ($olderthanmonths > 0) {
4111
+					if ($globalDBdriver == 'mysql') {
4112 4112
 				$query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)';
4113 4113
 			} else {
4114 4114
 				$query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'";
4115 4115
 			}
4116 4116
 		}
4117
-                if ($sincedate != '') {
4118
-            		if ($globalDBdriver == 'mysql') {
4117
+				if ($sincedate != '') {
4118
+					if ($globalDBdriver == 'mysql') {
4119 4119
 				$query .= "AND spotter_output.date > '".$sincedate."' ";
4120 4120
 			} else {
4121 4121
 				$query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
@@ -4166,26 +4166,26 @@  discard block
 block discarded – undo
4166 4166
 	}
4167 4167
 	
4168 4168
 	 /**
4169
-	* Gets all owner that have flown over
4170
-	*
4171
-	* @return Array the pilots list
4172
-	*
4173
-	*/
4169
+	  * Gets all owner that have flown over
4170
+	  *
4171
+	  * @return Array the pilots list
4172
+	  *
4173
+	  */
4174 4174
 	public function countAllOwnersByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array())
4175 4175
 	{
4176 4176
 		global $globalDBdriver;
4177 4177
 		$filter_query = $this->getFilter($filters,true,true);
4178 4178
 		$query  = "SELECT DISTINCT spotter_output.airline_icao, spotter_output.owner_name, COUNT(spotter_output.owner_name) AS owner_count
4179 4179
 		 			FROM spotter_output".$filter_query." spotter_output.owner_name <> '' AND spotter_output.owner_name IS NOT NULL ";
4180
-                if ($olderthanmonths > 0) {
4181
-            		if ($globalDBdriver == 'mysql') {
4180
+				if ($olderthanmonths > 0) {
4181
+					if ($globalDBdriver == 'mysql') {
4182 4182
 				$query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) ';
4183 4183
 			} else {
4184 4184
 				$query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' ";
4185 4185
 			}
4186 4186
 		}
4187
-                if ($sincedate != '') {
4188
-            		if ($globalDBdriver == 'mysql') {
4187
+				if ($sincedate != '') {
4188
+					if ($globalDBdriver == 'mysql') {
4189 4189
 				$query .= "AND spotter_output.date > '".$sincedate."' ";
4190 4190
 			} else {
4191 4191
 				$query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
@@ -4212,11 +4212,11 @@  discard block
 block discarded – undo
4212 4212
 	}
4213 4213
 
4214 4214
 	/**
4215
-	* Gets all airlines that have flown over by aircraft
4216
-	*
4217
-	* @return Array the airline list
4218
-	*
4219
-	*/
4215
+	 * Gets all airlines that have flown over by aircraft
4216
+	 *
4217
+	 * @return Array the airline list
4218
+	 *
4219
+	 */
4220 4220
 	public function countAllAirlinesByAircraft($aircraft_icao,$filters = array())
4221 4221
 	{
4222 4222
 		$aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING);
@@ -4248,11 +4248,11 @@  discard block
 block discarded – undo
4248 4248
 
4249 4249
 
4250 4250
 	/**
4251
-	* Gets all airline countries that have flown over by aircraft
4252
-	*
4253
-	* @return Array the airline country list
4254
-	*
4255
-	*/
4251
+	 * Gets all airline countries that have flown over by aircraft
4252
+	 *
4253
+	 * @return Array the airline country list
4254
+	 *
4255
+	 */
4256 4256
 	public function countAllAirlineCountriesByAircraft($aircraft_icao,$filters = array())
4257 4257
 	{
4258 4258
 		$aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING);
@@ -4284,11 +4284,11 @@  discard block
 block discarded – undo
4284 4284
 	
4285 4285
 	
4286 4286
 	/**
4287
-	* Gets all airlines that have flown over by airport
4288
-	*
4289
-	* @return Array the airline list
4290
-	*
4291
-	*/
4287
+	 * Gets all airlines that have flown over by airport
4288
+	 *
4289
+	 * @return Array the airline list
4290
+	 *
4291
+	 */
4292 4292
 	public function countAllAirlinesByAirport($airport_icao,$filters = array())
4293 4293
 	{
4294 4294
 		$airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING);
@@ -4319,11 +4319,11 @@  discard block
 block discarded – undo
4319 4319
 
4320 4320
 
4321 4321
 	/**
4322
-	* Gets all airline countries that have flown over by airport icao
4323
-	*
4324
-	* @return Array the airline country list
4325
-	*
4326
-	*/
4322
+	 * Gets all airline countries that have flown over by airport icao
4323
+	 *
4324
+	 * @return Array the airline country list
4325
+	 *
4326
+	 */
4327 4327
 	public function countAllAirlineCountriesByAirport($airport_icao,$filters = array())
4328 4328
 	{
4329 4329
 		$airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING);
@@ -4353,11 +4353,11 @@  discard block
 block discarded – undo
4353 4353
 
4354 4354
 
4355 4355
 	/**
4356
-	* Gets all airlines that have flown over by aircraft manufacturer
4357
-	*
4358
-	* @return Array the airline list
4359
-	*
4360
-	*/
4356
+	 * Gets all airlines that have flown over by aircraft manufacturer
4357
+	 *
4358
+	 * @return Array the airline list
4359
+	 *
4360
+	 */
4361 4361
 	public function countAllAirlinesByManufacturer($aircraft_manufacturer,$filters = array())
4362 4362
 	{
4363 4363
 		$aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING);
@@ -4388,11 +4388,11 @@  discard block
 block discarded – undo
4388 4388
 
4389 4389
 
4390 4390
 	/**
4391
-	* Gets all airline countries that have flown over by aircraft manufacturer
4392
-	*
4393
-	* @return Array the airline country list
4394
-	*
4395
-	*/
4391
+	 * Gets all airline countries that have flown over by aircraft manufacturer
4392
+	 *
4393
+	 * @return Array the airline country list
4394
+	 *
4395
+	 */
4396 4396
 	public function countAllAirlineCountriesByManufacturer($aircraft_manufacturer,$filters = array())
4397 4397
 	{
4398 4398
 		$aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING);
@@ -4421,11 +4421,11 @@  discard block
 block discarded – undo
4421 4421
 
4422 4422
 
4423 4423
 	/**
4424
-	* Gets all airlines that have flown over by date
4425
-	*
4426
-	* @return Array the airline list
4427
-	*
4428
-	*/
4424
+	 * Gets all airlines that have flown over by date
4425
+	 *
4426
+	 * @return Array the airline list
4427
+	 *
4428
+	 */
4429 4429
 	public function countAllAirlinesByDate($date,$filters = array())
4430 4430
 	{
4431 4431
 		global $globalTimezone, $globalDBdriver;
@@ -4469,11 +4469,11 @@  discard block
 block discarded – undo
4469 4469
 	
4470 4470
 	
4471 4471
 	/**
4472
-	* Gets all airline countries that have flown over by date
4473
-	*
4474
-	* @return Array the airline country list
4475
-	*
4476
-	*/
4472
+	 * Gets all airline countries that have flown over by date
4473
+	 *
4474
+	 * @return Array the airline country list
4475
+	 *
4476
+	 */
4477 4477
 	public function countAllAirlineCountriesByDate($date,$filters = array())
4478 4478
 	{
4479 4479
 		global $globalTimezone, $globalDBdriver;
@@ -4516,11 +4516,11 @@  discard block
 block discarded – undo
4516 4516
 
4517 4517
 
4518 4518
 	/**
4519
-	* Gets all airlines that have flown over by ident/callsign
4520
-	*
4521
-	* @return Array the airline list
4522
-	*
4523
-	*/
4519
+	 * Gets all airlines that have flown over by ident/callsign
4520
+	 *
4521
+	 * @return Array the airline list
4522
+	 *
4523
+	 */
4524 4524
 	public function countAllAirlinesByIdent($ident,$filters = array())
4525 4525
 	{
4526 4526
 		$ident = filter_var($ident,FILTER_SANITIZE_STRING);
@@ -4537,11 +4537,11 @@  discard block
 block discarded – undo
4537 4537
 	}
4538 4538
 
4539 4539
 	/**
4540
-	* Gets all airlines by owner
4541
-	*
4542
-	* @return Array the airline list
4543
-	*
4544
-	*/
4540
+	 * Gets all airlines by owner
4541
+	 *
4542
+	 * @return Array the airline list
4543
+	 *
4544
+	 */
4545 4545
 	public function countAllAirlinesByOwner($owner,$filters = array())
4546 4546
 	{
4547 4547
 		$owner = filter_var($owner,FILTER_SANITIZE_STRING);
@@ -4558,11 +4558,11 @@  discard block
 block discarded – undo
4558 4558
 	}
4559 4559
 
4560 4560
 	/**
4561
-	* Gets all airlines used by pilot
4562
-	*
4563
-	* @return Array the airline list
4564
-	*
4565
-	*/
4561
+	 * Gets all airlines used by pilot
4562
+	 *
4563
+	 * @return Array the airline list
4564
+	 *
4565
+	 */
4566 4566
 	public function countAllAirlinesByPilot($pilot,$filters = array())
4567 4567
 	{
4568 4568
 		$pilot = filter_var($pilot,FILTER_SANITIZE_STRING);
@@ -4579,11 +4579,11 @@  discard block
 block discarded – undo
4579 4579
 	}
4580 4580
 
4581 4581
 	/**
4582
-	* Gets all airlines that have flown over by route
4583
-	*
4584
-	* @return Array the airline list
4585
-	*
4586
-	*/
4582
+	 * Gets all airlines that have flown over by route
4583
+	 *
4584
+	 * @return Array the airline list
4585
+	 *
4586
+	 */
4587 4587
 	public function countAllAirlinesByRoute($departure_airport_icao, $arrival_airport_icao,$filters = array())
4588 4588
 	{
4589 4589
 		$filter_query = $this->getFilter($filters,true,true);
@@ -4615,11 +4615,11 @@  discard block
 block discarded – undo
4615 4615
 	}
4616 4616
 
4617 4617
 	/**
4618
-	* Gets all airline countries that have flown over by route
4619
-	*
4620
-	* @return Array the airline country list
4621
-	*
4622
-	*/
4618
+	 * Gets all airline countries that have flown over by route
4619
+	 *
4620
+	 * @return Array the airline country list
4621
+	 *
4622
+	 */
4623 4623
 	public function countAllAirlineCountriesByRoute($departure_airport_icao, $arrival_airport_icao,$filters= array())
4624 4624
 	{
4625 4625
 		$filter_query = $this->getFilter($filters,true,true);
@@ -4651,11 +4651,11 @@  discard block
 block discarded – undo
4651 4651
 
4652 4652
 
4653 4653
 	/**
4654
-	* Gets all airlines that have flown over by country
4655
-	*
4656
-	* @return Array the airline list
4657
-	*
4658
-	*/
4654
+	 * Gets all airlines that have flown over by country
4655
+	 *
4656
+	 * @return Array the airline list
4657
+	 *
4658
+	 */
4659 4659
 	public function countAllAirlinesByCountry($country,$filters = array())
4660 4660
 	{
4661 4661
 		$country = filter_var($country,FILTER_SANITIZE_STRING);
@@ -4685,11 +4685,11 @@  discard block
 block discarded – undo
4685 4685
 
4686 4686
 
4687 4687
 	/**
4688
-	* Gets all airline countries that have flown over by country
4689
-	*
4690
-	* @return Array the airline country list
4691
-	*
4692
-	*/
4688
+	 * Gets all airline countries that have flown over by country
4689
+	 *
4690
+	 * @return Array the airline country list
4691
+	 *
4692
+	 */
4693 4693
 	public function countAllAirlineCountriesByCountry($country,$filters = array())
4694 4694
 	{
4695 4695
 		$filter_query = $this->getFilter($filters,true,true);
@@ -4718,11 +4718,11 @@  discard block
 block discarded – undo
4718 4718
 
4719 4719
 
4720 4720
 	/**
4721
-	* Gets all airlines countries
4722
-	*
4723
-	* @return Array the airline country list
4724
-	*
4725
-	*/
4721
+	 * Gets all airlines countries
4722
+	 *
4723
+	 * @return Array the airline country list
4724
+	 *
4725
+	 */
4726 4726
 	public function countAllAirlineCountries($limit = true, $filters = array(), $year = '', $month = '', $day = '')
4727 4727
 	{
4728 4728
 		global $globalDBdriver;
@@ -4777,11 +4777,11 @@  discard block
 block discarded – undo
4777 4777
 	}
4778 4778
 
4779 4779
 	/**
4780
-	* Gets all number of flight over countries
4781
-	*
4782
-	* @return Array the airline country list
4783
-	*
4784
-	*/
4780
+	 * Gets all number of flight over countries
4781
+	 *
4782
+	 * @return Array the airline country list
4783
+	 *
4784
+	 */
4785 4785
 	public function countAllFlightOverCountries($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array())
4786 4786
 	{
4787 4787
 		global $globalDBdriver;
@@ -4803,15 +4803,15 @@  discard block
 block discarded – undo
4803 4803
 		$SpotterLive = new SpotterLive();
4804 4804
 		$filter_query = $SpotterLive->getFilter($filters,true,true);
4805 4805
 		$filter_query .= ' over_country IS NOT NULL';
4806
-                if ($olderthanmonths > 0) {
4806
+				if ($olderthanmonths > 0) {
4807 4807
 			if ($globalDBdriver == 'mysql') {
4808 4808
 				$filter_query .= ' AND spotter_live.date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
4809 4809
 			} else {
4810 4810
 				$filter_query .= " AND spotter_live.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'";
4811 4811
 			}
4812 4812
 		}
4813
-                if ($sincedate != '') {
4814
-            		if ($globalDBdriver == 'mysql') {
4813
+				if ($sincedate != '') {
4814
+					if ($globalDBdriver == 'mysql') {
4815 4815
 				$filter_query .= " AND spotter_live.date > '".$sincedate."' ";
4816 4816
 			} else {
4817 4817
 				$filter_query .= " AND spotter_live.date > CAST('".$sincedate."' AS TIMESTAMP)";
@@ -4841,11 +4841,11 @@  discard block
 block discarded – undo
4841 4841
 	
4842 4842
 	
4843 4843
 	/**
4844
-	* Gets all aircraft types that have flown over
4845
-	*
4846
-	* @return Array the aircraft list
4847
-	*
4848
-	*/
4844
+	 * Gets all aircraft types that have flown over
4845
+	 *
4846
+	 * @return Array the aircraft list
4847
+	 *
4848
+	 */
4849 4849
 	public function countAllAircraftTypes($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array(),$year = '',$month = '',$day = '')
4850 4850
 	{
4851 4851
 		global $globalDBdriver;
@@ -4915,11 +4915,11 @@  discard block
 block discarded – undo
4915 4915
 	}
4916 4916
 
4917 4917
 	/**
4918
-	* Gets all aircraft types that have flown over by airline
4919
-	*
4920
-	* @return Array the aircraft list
4921
-	*
4922
-	*/
4918
+	 * Gets all aircraft types that have flown over by airline
4919
+	 *
4920
+	 * @return Array the aircraft list
4921
+	 *
4922
+	 */
4923 4923
 	public function countAllAircraftTypesByAirlines($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array(),$year = '',$month = '', $day = '')
4924 4924
 	{
4925 4925
 		global $globalDBdriver;
@@ -4990,11 +4990,11 @@  discard block
 block discarded – undo
4990 4990
 	}
4991 4991
 
4992 4992
 	/**
4993
-	* Gets all aircraft types that have flown over by months
4994
-	*
4995
-	* @return Array the aircraft list
4996
-	*
4997
-	*/
4993
+	 * Gets all aircraft types that have flown over by months
4994
+	 *
4995
+	 * @return Array the aircraft list
4996
+	 *
4997
+	 */
4998 4998
 	public function countAllAircraftTypesByMonths($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array())
4999 4999
 	{
5000 5000
 		global $globalDBdriver;
@@ -5038,11 +5038,11 @@  discard block
 block discarded – undo
5038 5038
 
5039 5039
 
5040 5040
 	/**
5041
-	* Gets all aircraft registration that have flown over by aircaft icao
5042
-	*
5043
-	* @return Array the aircraft list
5044
-	*
5045
-	*/
5041
+	 * Gets all aircraft registration that have flown over by aircaft icao
5042
+	 *
5043
+	 * @return Array the aircraft list
5044
+	 *
5045
+	 */
5046 5046
 	public function countAllAircraftRegistrationByAircraft($aircraft_icao,$filters = array())
5047 5047
 	{
5048 5048
 		$Image = new Image($this->db);
@@ -5081,11 +5081,11 @@  discard block
 block discarded – undo
5081 5081
 
5082 5082
 
5083 5083
 	/**
5084
-	* Gets all aircraft types that have flown over by airline icao
5085
-	*
5086
-	* @return Array the aircraft list
5087
-	*
5088
-	*/
5084
+	 * Gets all aircraft types that have flown over by airline icao
5085
+	 *
5086
+	 * @return Array the aircraft list
5087
+	 *
5088
+	 */
5089 5089
 	public function countAllAircraftTypesByAirline($airline_icao,$filters = array())
5090 5090
 	{
5091 5091
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5114,11 +5114,11 @@  discard block
 block discarded – undo
5114 5114
 
5115 5115
 
5116 5116
 	/**
5117
-	* Gets all aircraft registration that have flown over by airline icao
5118
-	*
5119
-	* @return Array the aircraft list
5120
-	*
5121
-	*/
5117
+	 * Gets all aircraft registration that have flown over by airline icao
5118
+	 *
5119
+	 * @return Array the aircraft list
5120
+	 *
5121
+	 */
5122 5122
 	public function countAllAircraftRegistrationByAirline($airline_icao,$filters = array())
5123 5123
 	{
5124 5124
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5156,11 +5156,11 @@  discard block
 block discarded – undo
5156 5156
 
5157 5157
 
5158 5158
 	/**
5159
-	* Gets all aircraft manufacturer that have flown over by airline icao
5160
-	*
5161
-	* @return Array the aircraft list
5162
-	*
5163
-	*/
5159
+	 * Gets all aircraft manufacturer that have flown over by airline icao
5160
+	 *
5161
+	 * @return Array the aircraft list
5162
+	 *
5163
+	 */
5164 5164
 	public function countAllAircraftManufacturerByAirline($airline_icao,$filters = array())
5165 5165
 	{
5166 5166
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5188,11 +5188,11 @@  discard block
 block discarded – undo
5188 5188
 
5189 5189
 
5190 5190
 	/**
5191
-	* Gets all aircraft types that have flown over by airline icao
5192
-	*
5193
-	* @return Array the aircraft list
5194
-	*
5195
-	*/
5191
+	 * Gets all aircraft types that have flown over by airline icao
5192
+	 *
5193
+	 * @return Array the aircraft list
5194
+	 *
5195
+	 */
5196 5196
 	public function countAllAircraftTypesByAirport($airport_icao,$filters = array())
5197 5197
 	{
5198 5198
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5221,11 +5221,11 @@  discard block
 block discarded – undo
5221 5221
 
5222 5222
 
5223 5223
 	/**
5224
-	* Gets all aircraft registration that have flown over by airport icao
5225
-	*
5226
-	* @return Array the aircraft list
5227
-	*
5228
-	*/
5224
+	 * Gets all aircraft registration that have flown over by airport icao
5225
+	 *
5226
+	 * @return Array the aircraft list
5227
+	 *
5228
+	 */
5229 5229
 	public function countAllAircraftRegistrationByAirport($airport_icao,$filters = array())
5230 5230
 	{
5231 5231
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5262,11 +5262,11 @@  discard block
 block discarded – undo
5262 5262
 	
5263 5263
 	
5264 5264
 	/**
5265
-	* Gets all aircraft manufacturer that have flown over by airport icao
5266
-	*
5267
-	* @return Array the aircraft list
5268
-	*
5269
-	*/
5265
+	 * Gets all aircraft manufacturer that have flown over by airport icao
5266
+	 *
5267
+	 * @return Array the aircraft list
5268
+	 *
5269
+	 */
5270 5270
 	public function countAllAircraftManufacturerByAirport($airport_icao,$filters = array())
5271 5271
 	{
5272 5272
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5292,11 +5292,11 @@  discard block
 block discarded – undo
5292 5292
 	}
5293 5293
 
5294 5294
 	/**
5295
-	* Gets all aircraft types that have flown over by aircraft manufacturer
5296
-	*
5297
-	* @return Array the aircraft list
5298
-	*
5299
-	*/
5295
+	 * Gets all aircraft types that have flown over by aircraft manufacturer
5296
+	 *
5297
+	 * @return Array the aircraft list
5298
+	 *
5299
+	 */
5300 5300
 	public function countAllAircraftTypesByManufacturer($aircraft_manufacturer,$filters = array())
5301 5301
 	{
5302 5302
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5323,11 +5323,11 @@  discard block
 block discarded – undo
5323 5323
 
5324 5324
 
5325 5325
 	/**
5326
-	* Gets all aircraft registration that have flown over by aircaft manufacturer
5327
-	*
5328
-	* @return Array the aircraft list
5329
-	*
5330
-	*/
5326
+	 * Gets all aircraft registration that have flown over by aircaft manufacturer
5327
+	 *
5328
+	 * @return Array the aircraft list
5329
+	 *
5330
+	 */
5331 5331
 	public function countAllAircraftRegistrationByManufacturer($aircraft_manufacturer, $filters = array())
5332 5332
 	{
5333 5333
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5363,11 +5363,11 @@  discard block
 block discarded – undo
5363 5363
 	}
5364 5364
 
5365 5365
 	/**
5366
-	* Gets all aircraft types that have flown over by date
5367
-	*
5368
-	* @return Array the aircraft list
5369
-	*
5370
-	*/
5366
+	 * Gets all aircraft types that have flown over by date
5367
+	 *
5368
+	 * @return Array the aircraft list
5369
+	 *
5370
+	 */
5371 5371
 	public function countAllAircraftTypesByDate($date,$filters = array())
5372 5372
 	{
5373 5373
 		global $globalTimezone, $globalDBdriver;
@@ -5409,11 +5409,11 @@  discard block
 block discarded – undo
5409 5409
 
5410 5410
 
5411 5411
 	/**
5412
-	* Gets all aircraft registration that have flown over by date
5413
-	*
5414
-	* @return Array the aircraft list
5415
-	*
5416
-	*/
5412
+	 * Gets all aircraft registration that have flown over by date
5413
+	 *
5414
+	 * @return Array the aircraft list
5415
+	 *
5416
+	 */
5417 5417
 	public function countAllAircraftRegistrationByDate($date,$filters = array())
5418 5418
 	{
5419 5419
 		global $globalTimezone, $globalDBdriver;
@@ -5464,11 +5464,11 @@  discard block
 block discarded – undo
5464 5464
 
5465 5465
 
5466 5466
 	/**
5467
-	* Gets all aircraft manufacturer that have flown over by date
5468
-	*
5469
-	* @return Array the aircraft manufacturer list
5470
-	*
5471
-	*/
5467
+	 * Gets all aircraft manufacturer that have flown over by date
5468
+	 *
5469
+	 * @return Array the aircraft manufacturer list
5470
+	 *
5471
+	 */
5472 5472
 	public function countAllAircraftManufacturerByDate($date,$filters = array())
5473 5473
 	{
5474 5474
 		global $globalTimezone, $globalDBdriver;
@@ -5510,11 +5510,11 @@  discard block
 block discarded – undo
5510 5510
 
5511 5511
 
5512 5512
 	/**
5513
-	* Gets all aircraft types that have flown over by ident/callsign
5514
-	*
5515
-	* @return Array the aircraft list
5516
-	*
5517
-	*/
5513
+	 * Gets all aircraft types that have flown over by ident/callsign
5514
+	 *
5515
+	 * @return Array the aircraft list
5516
+	 *
5517
+	 */
5518 5518
 	public function countAllAircraftTypesByIdent($ident,$filters = array())
5519 5519
 	{
5520 5520
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5542,11 +5542,11 @@  discard block
 block discarded – undo
5542 5542
 	}
5543 5543
 
5544 5544
 	/**
5545
-	* Gets all aircraft types that have flown over by pilot
5546
-	*
5547
-	* @return Array the aircraft list
5548
-	*
5549
-	*/
5545
+	 * Gets all aircraft types that have flown over by pilot
5546
+	 *
5547
+	 * @return Array the aircraft list
5548
+	 *
5549
+	 */
5550 5550
 	public function countAllAircraftTypesByPilot($pilot,$filters = array())
5551 5551
 	{
5552 5552
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5562,11 +5562,11 @@  discard block
 block discarded – undo
5562 5562
 	}
5563 5563
 
5564 5564
 	/**
5565
-	* Gets all aircraft types that have flown over by owner
5566
-	*
5567
-	* @return Array the aircraft list
5568
-	*
5569
-	*/
5565
+	 * Gets all aircraft types that have flown over by owner
5566
+	 *
5567
+	 * @return Array the aircraft list
5568
+	 *
5569
+	 */
5570 5570
 	public function countAllAircraftTypesByOwner($owner,$filters = array())
5571 5571
 	{
5572 5572
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5583,11 +5583,11 @@  discard block
 block discarded – undo
5583 5583
 
5584 5584
 
5585 5585
 	/**
5586
-	* Gets all aircraft registration that have flown over by ident/callsign
5587
-	*
5588
-	* @return Array the aircraft list
5589
-	*
5590
-	*/
5586
+	 * Gets all aircraft registration that have flown over by ident/callsign
5587
+	 *
5588
+	 * @return Array the aircraft list
5589
+	 *
5590
+	 */
5591 5591
 	public function countAllAircraftRegistrationByIdent($ident,$filters = array())
5592 5592
 	{
5593 5593
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5626,11 +5626,11 @@  discard block
 block discarded – undo
5626 5626
 	}
5627 5627
 
5628 5628
 	/**
5629
-	* Gets all aircraft registration that have flown over by owner
5630
-	*
5631
-	* @return Array the aircraft list
5632
-	*
5633
-	*/
5629
+	 * Gets all aircraft registration that have flown over by owner
5630
+	 *
5631
+	 * @return Array the aircraft list
5632
+	 *
5633
+	 */
5634 5634
 	public function countAllAircraftRegistrationByOwner($owner,$filters = array())
5635 5635
 	{
5636 5636
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5670,11 +5670,11 @@  discard block
 block discarded – undo
5670 5670
 	}
5671 5671
 
5672 5672
 	/**
5673
-	* Gets all aircraft registration that have flown over by pilot
5674
-	*
5675
-	* @return Array the aircraft list
5676
-	*
5677
-	*/
5673
+	 * Gets all aircraft registration that have flown over by pilot
5674
+	 *
5675
+	 * @return Array the aircraft list
5676
+	 *
5677
+	 */
5678 5678
 	public function countAllAircraftRegistrationByPilot($pilot,$filters = array())
5679 5679
 	{
5680 5680
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5715,11 +5715,11 @@  discard block
 block discarded – undo
5715 5715
 
5716 5716
 
5717 5717
 	/**
5718
-	* Gets all aircraft manufacturer that have flown over by ident/callsign
5719
-	*
5720
-	* @return Array the aircraft manufacturer list
5721
-	*
5722
-	*/
5718
+	 * Gets all aircraft manufacturer that have flown over by ident/callsign
5719
+	 *
5720
+	 * @return Array the aircraft manufacturer list
5721
+	 *
5722
+	 */
5723 5723
 	public function countAllAircraftManufacturerByIdent($ident,$filters = array())
5724 5724
 	{
5725 5725
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5744,11 +5744,11 @@  discard block
 block discarded – undo
5744 5744
 	}
5745 5745
 
5746 5746
 	/**
5747
-	* Gets all aircraft manufacturer that have flown over by owner
5748
-	*
5749
-	* @return Array the aircraft manufacturer list
5750
-	*
5751
-	*/
5747
+	 * Gets all aircraft manufacturer that have flown over by owner
5748
+	 *
5749
+	 * @return Array the aircraft manufacturer list
5750
+	 *
5751
+	 */
5752 5752
 	public function countAllAircraftManufacturerByOwner($owner,$filters = array())
5753 5753
 	{
5754 5754
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5765,11 +5765,11 @@  discard block
 block discarded – undo
5765 5765
 	}
5766 5766
 
5767 5767
 	/**
5768
-	* Gets all aircraft manufacturer that have flown over by pilot
5769
-	*
5770
-	* @return Array the aircraft manufacturer list
5771
-	*
5772
-	*/
5768
+	 * Gets all aircraft manufacturer that have flown over by pilot
5769
+	 *
5770
+	 * @return Array the aircraft manufacturer list
5771
+	 *
5772
+	 */
5773 5773
 	public function countAllAircraftManufacturerByPilot($pilot,$filters = array())
5774 5774
 	{
5775 5775
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5787,11 +5787,11 @@  discard block
 block discarded – undo
5787 5787
 
5788 5788
 
5789 5789
 	/**
5790
-	* Gets all aircraft types that have flown over by route
5791
-	*
5792
-	* @return Array the aircraft list
5793
-	*
5794
-	*/
5790
+	 * Gets all aircraft types that have flown over by route
5791
+	 *
5792
+	 * @return Array the aircraft list
5793
+	 *
5794
+	 */
5795 5795
 	public function countAllAircraftTypesByRoute($departure_airport_icao, $arrival_airport_icao,$filters = array())
5796 5796
 	{
5797 5797
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5820,11 +5820,11 @@  discard block
 block discarded – undo
5820 5820
 	}
5821 5821
 
5822 5822
 	/**
5823
-	* Gets all aircraft registration that have flown over by route
5824
-	*
5825
-	* @return Array the aircraft list
5826
-	*
5827
-	*/
5823
+	 * Gets all aircraft registration that have flown over by route
5824
+	 *
5825
+	 * @return Array the aircraft list
5826
+	 *
5827
+	 */
5828 5828
 	public function countAllAircraftRegistrationByRoute($departure_airport_icao, $arrival_airport_icao,$filters = array())
5829 5829
 	{
5830 5830
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5866,11 +5866,11 @@  discard block
 block discarded – undo
5866 5866
 	
5867 5867
 	
5868 5868
 	/**
5869
-	* Gets all aircraft manufacturer that have flown over by route
5870
-	*
5871
-	* @return Array the aircraft manufacturer list
5872
-	*
5873
-	*/
5869
+	 * Gets all aircraft manufacturer that have flown over by route
5870
+	 *
5871
+	 * @return Array the aircraft manufacturer list
5872
+	 *
5873
+	 */
5874 5874
 	public function countAllAircraftManufacturerByRoute($departure_airport_icao, $arrival_airport_icao,$filters = array())
5875 5875
 	{
5876 5876
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5904,11 +5904,11 @@  discard block
 block discarded – undo
5904 5904
 	
5905 5905
 	
5906 5906
 	/**
5907
-	* Gets all aircraft types that have flown over by country
5908
-	*
5909
-	* @return Array the aircraft list
5910
-	*
5911
-	*/
5907
+	 * Gets all aircraft types that have flown over by country
5908
+	 *
5909
+	 * @return Array the aircraft list
5910
+	 *
5911
+	 */
5912 5912
 	public function countAllAircraftTypesByCountry($country,$filters = array())
5913 5913
 	{
5914 5914
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5939,11 +5939,11 @@  discard block
 block discarded – undo
5939 5939
 
5940 5940
 
5941 5941
 	/**
5942
-	* Gets all aircraft registration that have flown over by country
5943
-	*
5944
-	* @return Array the aircraft list
5945
-	*
5946
-	*/
5942
+	 * Gets all aircraft registration that have flown over by country
5943
+	 *
5944
+	 * @return Array the aircraft list
5945
+	 *
5946
+	 */
5947 5947
 	public function countAllAircraftRegistrationByCountry($country,$filters = array())
5948 5948
 	{
5949 5949
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5983,11 +5983,11 @@  discard block
 block discarded – undo
5983 5983
 	
5984 5984
 	
5985 5985
 	/**
5986
-	* Gets all aircraft manufacturer that have flown over by country
5987
-	*
5988
-	* @return Array the aircraft manufacturer list
5989
-	*
5990
-	*/
5986
+	 * Gets all aircraft manufacturer that have flown over by country
5987
+	 *
5988
+	 * @return Array the aircraft manufacturer list
5989
+	 *
5990
+	 */
5991 5991
 	public function countAllAircraftManufacturerByCountry($country,$filters = array())
5992 5992
 	{
5993 5993
 		$filter_query = $this->getFilter($filters,true,true);
@@ -6018,18 +6018,18 @@  discard block
 block discarded – undo
6018 6018
 	
6019 6019
 	
6020 6020
 	/**
6021
-	* Gets all aircraft manufacturers that have flown over
6022
-	*
6023
-	* @return Array the aircraft list
6024
-	*
6025
-	*/
6021
+	 * Gets all aircraft manufacturers that have flown over
6022
+	 *
6023
+	 * @return Array the aircraft list
6024
+	 *
6025
+	 */
6026 6026
 	public function countAllAircraftManufacturers($filters = array(),$year = '',$month = '',$day = '')
6027 6027
 	{
6028 6028
 		global $globalDBdriver;
6029 6029
 		$filter_query = $this->getFilter($filters,true,true);
6030 6030
 		$query  = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count  
6031 6031
                     FROM spotter_output ".$filter_query." spotter_output.aircraft_manufacturer <> '' AND spotter_output.aircraft_manufacturer <> 'Not Available'";
6032
-                $query_values = array();
6032
+				$query_values = array();
6033 6033
 		if ($year != '') {
6034 6034
 			if ($globalDBdriver == 'mysql') {
6035 6035
 				$query .= " AND YEAR(spotter_output.date) = :year";
@@ -6082,11 +6082,11 @@  discard block
 block discarded – undo
6082 6082
 	
6083 6083
 	
6084 6084
 	/**
6085
-	* Gets all aircraft registrations that have flown over
6086
-	*
6087
-	* @return Array the aircraft list
6088
-	*
6089
-	*/
6085
+	 * Gets all aircraft registrations that have flown over
6086
+	 *
6087
+	 * @return Array the aircraft list
6088
+	 *
6089
+	 */
6090 6090
 	public function countAllAircraftRegistrations($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array(),$year = '', $month = '', $day = '')
6091 6091
 	{
6092 6092
 		global $globalDBdriver;
@@ -6094,15 +6094,15 @@  discard block
 block discarded – undo
6094 6094
 		$filter_query = $this->getFilter($filters,true,true);
6095 6095
 		$query  = "SELECT DISTINCT spotter_output.registration, COUNT(spotter_output.registration) AS aircraft_registration_count, spotter_output.aircraft_icao,  spotter_output.aircraft_name, spotter_output.airline_name    
6096 6096
                     FROM spotter_output ".$filter_query." spotter_output.registration <> '' AND spotter_output.registration <> 'NA'";
6097
-                if ($olderthanmonths > 0) {
6098
-            		if ($globalDBdriver == 'mysql') {
6097
+				if ($olderthanmonths > 0) {
6098
+					if ($globalDBdriver == 'mysql') {
6099 6099
 				$query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)';
6100 6100
 			} else {
6101 6101
 				$query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'";
6102 6102
 			}
6103 6103
 		}
6104
-                if ($sincedate != '') {
6105
-            		if ($globalDBdriver == 'mysql') {
6104
+				if ($sincedate != '') {
6105
+					if ($globalDBdriver == 'mysql') {
6106 6106
 				$query .= " AND spotter_output.date > '".$sincedate."'";
6107 6107
 			} else {
6108 6108
 				$query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
@@ -6167,11 +6167,11 @@  discard block
 block discarded – undo
6167 6167
 
6168 6168
 
6169 6169
 	/**
6170
-	* Gets all aircraft registrations that have flown over
6171
-	*
6172
-	* @return Array the aircraft list
6173
-	*
6174
-	*/
6170
+	 * Gets all aircraft registrations that have flown over
6171
+	 *
6172
+	 * @return Array the aircraft list
6173
+	 *
6174
+	 */
6175 6175
 	public function countAllAircraftRegistrationsByAirlines($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array())
6176 6176
 	{
6177 6177
 		global $globalDBdriver;
@@ -6179,15 +6179,15 @@  discard block
 block discarded – undo
6179 6179
 		$Image = new Image($this->db);
6180 6180
 		$query  = "SELECT DISTINCT spotter_output.airline_icao, spotter_output.registration, COUNT(spotter_output.registration) AS aircraft_registration_count, spotter_output.aircraft_icao,  spotter_output.aircraft_name, spotter_output.airline_name    
6181 6181
                     FROM spotter_output".$filter_query." spotter_output.airline_icao <> '' AND spotter_output.registration <> '' AND spotter_output.registration <> 'NA' ";
6182
-                if ($olderthanmonths > 0) {
6183
-            		if ($globalDBdriver == 'mysql') {
6182
+				if ($olderthanmonths > 0) {
6183
+					if ($globalDBdriver == 'mysql') {
6184 6184
 				$query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) ';
6185 6185
 			} else {
6186 6186
 				$query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' ";
6187 6187
 			}
6188 6188
 		}
6189
-                if ($sincedate != '') {
6190
-            		if ($globalDBdriver == 'mysql') {
6189
+				if ($sincedate != '') {
6190
+					if ($globalDBdriver == 'mysql') {
6191 6191
 				$query .= "AND spotter_output.date > '".$sincedate."' ";
6192 6192
 			} else {
6193 6193
 				$query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
@@ -6196,7 +6196,7 @@  discard block
 block discarded – undo
6196 6196
 
6197 6197
 		// if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
6198 6198
 		//if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
6199
-                $query .= "GROUP BY spotter_output.airline_icao, spotter_output.registration, spotter_output.aircraft_icao, spotter_output.aircraft_name, spotter_output.airline_name ORDER BY aircraft_registration_count DESC";
6199
+				$query .= "GROUP BY spotter_output.airline_icao, spotter_output.registration, spotter_output.aircraft_icao, spotter_output.aircraft_name, spotter_output.airline_name ORDER BY aircraft_registration_count DESC";
6200 6200
 		if ($limit) $query .= " LIMIT 10 OFFSET 0";
6201 6201
 		
6202 6202
 		$sth = $this->db->prepare($query);
@@ -6228,26 +6228,26 @@  discard block
 block discarded – undo
6228 6228
 	
6229 6229
 	
6230 6230
 	/**
6231
-	* Gets all departure airports of the airplanes that have flown over
6232
-	*
6233
-	* @return Array the airport list
6234
-	*
6235
-	*/
6231
+	 * Gets all departure airports of the airplanes that have flown over
6232
+	 *
6233
+	 * @return Array the airport list
6234
+	 *
6235
+	 */
6236 6236
 	public function countAllDepartureAirports($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array(),$year = '',$month = '',$day = '')
6237 6237
 	{
6238 6238
 		global $globalDBdriver;
6239 6239
 		$filter_query = $this->getFilter($filters,true,true);
6240 6240
 		$query  = "SELECT DISTINCT spotter_output.departure_airport_icao, COUNT(spotter_output.departure_airport_icao) AS airport_departure_icao_count, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country 
6241 6241
 				FROM spotter_output".$filter_query." spotter_output.departure_airport_name <> '' AND spotter_output.departure_airport_icao <> 'NA' AND spotter_output.departure_airport_icao <> ''";
6242
-                if ($olderthanmonths > 0) {
6243
-            		if ($globalDBdriver == 'mysql') {
6242
+				if ($olderthanmonths > 0) {
6243
+					if ($globalDBdriver == 'mysql') {
6244 6244
 				$query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)';
6245 6245
 			} else {
6246 6246
 				$query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'";
6247 6247
 			}
6248
-                }
6249
-                if ($sincedate != '') {
6250
-            		if ($globalDBdriver == 'mysql') {
6248
+				}
6249
+				if ($sincedate != '') {
6250
+					if ($globalDBdriver == 'mysql') {
6251 6251
 				$query .= " AND spotter_output.date > '".$sincedate."'";
6252 6252
 			} else {
6253 6253
 				$query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
@@ -6281,7 +6281,7 @@  discard block
 block discarded – undo
6281 6281
 				$query_values = array_merge($query_values,array(':day' => $day));
6282 6282
 			}
6283 6283
 		}
6284
-                $query .= " GROUP BY spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country
6284
+				$query .= " GROUP BY spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country
6285 6285
 				ORDER BY airport_departure_icao_count DESC";
6286 6286
 		if ($limit) $query .= " LIMIT 10 OFFSET 0";
6287 6287
 
@@ -6304,35 +6304,35 @@  discard block
 block discarded – undo
6304 6304
 	}
6305 6305
 
6306 6306
 	/**
6307
-	* Gets all departure airports of the airplanes that have flown over
6308
-	*
6309
-	* @return Array the airport list
6310
-	*
6311
-	*/
6307
+	 * Gets all departure airports of the airplanes that have flown over
6308
+	 *
6309
+	 * @return Array the airport list
6310
+	 *
6311
+	 */
6312 6312
 	public function countAllDepartureAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array())
6313 6313
 	{
6314 6314
 		global $globalDBdriver;
6315 6315
 		$filter_query = $this->getFilter($filters,true,true);
6316 6316
 		$query  = "SELECT DISTINCT spotter_output.airline_icao, spotter_output.departure_airport_icao, COUNT(spotter_output.departure_airport_icao) AS airport_departure_icao_count, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country 
6317 6317
 			FROM spotter_output".$filter_query." spotter_output.airline_icao <> '' AND spotter_output.departure_airport_name <> '' AND spotter_output.departure_airport_icao <> 'NA' AND spotter_output.departure_airport_icao <> '' ";
6318
-                if ($olderthanmonths > 0) {
6319
-            		if ($globalDBdriver == 'mysql') {
6318
+				if ($olderthanmonths > 0) {
6319
+					if ($globalDBdriver == 'mysql') {
6320 6320
 				$query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) ';
6321 6321
 			} else {
6322 6322
 				$query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' ";
6323 6323
 			}
6324
-                }
6325
-                if ($sincedate != '') {
6326
-            		if ($globalDBdriver == 'mysql') {
6324
+				}
6325
+				if ($sincedate != '') {
6326
+					if ($globalDBdriver == 'mysql') {
6327 6327
 				$query .= "AND spotter_output.date > '".$sincedate."' ";
6328 6328
 			} else {
6329 6329
 				$query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
6330 6330
 			}
6331 6331
 		}
6332 6332
 
6333
-            	//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
6334
-                //if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
6335
-                $query .= "GROUP BY spotter_output.airline_icao, spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country
6333
+				//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
6334
+				//if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
6335
+				$query .= "GROUP BY spotter_output.airline_icao, spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country
6336 6336
 				ORDER BY airport_departure_icao_count DESC";
6337 6337
 		if ($limit) $query .= " LIMIT 10 OFFSET 0";
6338 6338
       
@@ -6357,26 +6357,26 @@  discard block
 block discarded – undo
6357 6357
 	}
6358 6358
 
6359 6359
 	/**
6360
-	* Gets all detected departure airports of the airplanes that have flown over
6361
-	*
6362
-	* @return Array the airport list
6363
-	*
6364
-	*/
6360
+	 * Gets all detected departure airports of the airplanes that have flown over
6361
+	 *
6362
+	 * @return Array the airport list
6363
+	 *
6364
+	 */
6365 6365
 	public function countAllDetectedDepartureAirports($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array(),$year = '',$month = '',$day = '')
6366 6366
 	{
6367 6367
 		global $globalDBdriver;
6368 6368
 		$filter_query = $this->getFilter($filters,true,true);
6369 6369
 		$query  = "SELECT DISTINCT spotter_output.real_departure_airport_icao AS departure_airport_icao, COUNT(spotter_output.real_departure_airport_icao) AS airport_departure_icao_count, airport.name as departure_airport_name, airport.city as departure_airport_city, airport.country as departure_airport_country
6370 6370
 				FROM airport, spotter_output".$filter_query." spotter_output.real_departure_airport_icao <> '' AND spotter_output.real_departure_airport_icao <> 'NA' AND airport.icao = spotter_output.real_departure_airport_icao";
6371
-                if ($olderthanmonths > 0) {
6372
-            		if ($globalDBdriver == 'mysql') {
6371
+				if ($olderthanmonths > 0) {
6372
+					if ($globalDBdriver == 'mysql') {
6373 6373
 				$query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)';
6374 6374
 			} else {
6375 6375
 				$query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'";
6376 6376
 			}
6377
-                }
6378
-                if ($sincedate != '') {
6379
-            		if ($globalDBdriver == 'mysql') {
6377
+				}
6378
+				if ($sincedate != '') {
6379
+					if ($globalDBdriver == 'mysql') {
6380 6380
 				$query .= " AND spotter_output.date > '".$sincedate."'";
6381 6381
 			} else {
6382 6382
 				$query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
@@ -6410,10 +6410,10 @@  discard block
 block discarded – undo
6410 6410
 				$query_values = array_merge($query_values,array(':day' => $day));
6411 6411
 			}
6412 6412
 		}
6413
-                $query .= " GROUP BY spotter_output.real_departure_airport_icao, airport.name, airport.city, airport.country
6413
+				$query .= " GROUP BY spotter_output.real_departure_airport_icao, airport.name, airport.city, airport.country
6414 6414
 				ORDER BY airport_departure_icao_count DESC";
6415 6415
 		if ($limit) $query .= " LIMIT 10 OFFSET 0";
6416
-    		//echo $query;
6416
+			//echo $query;
6417 6417
 		$sth = $this->db->prepare($query);
6418 6418
 		$sth->execute($query_values);
6419 6419
       
@@ -6434,35 +6434,35 @@  discard block
 block discarded – undo
6434 6434
 	}
6435 6435
 	
6436 6436
 	/**
6437
-	* Gets all detected departure airports of the airplanes that have flown over
6438
-	*
6439
-	* @return Array the airport list
6440
-	*
6441
-	*/
6437
+	 * Gets all detected departure airports of the airplanes that have flown over
6438
+	 *
6439
+	 * @return Array the airport list
6440
+	 *
6441
+	 */
6442 6442
 	public function countAllDetectedDepartureAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array())
6443 6443
 	{
6444 6444
 		global $globalDBdriver;
6445 6445
 		$filter_query = $this->getFilter($filters,true,true);
6446 6446
 		$query  = "SELECT DISTINCT spotter_output.airline_icao, spotter_output.real_departure_airport_icao AS departure_airport_icao, COUNT(spotter_output.real_departure_airport_icao) AS airport_departure_icao_count, airport.name as departure_airport_name, airport.city as departure_airport_city, airport.country as departure_airport_country
6447 6447
 				FROM airport, spotter_output".$filter_query." spotter_output.airline_icao <> '' AND spotter_output.real_departure_airport_icao <> '' AND spotter_output.real_departure_airport_icao <> 'NA' AND airport.icao = spotter_output.real_departure_airport_icao ";
6448
-                if ($olderthanmonths > 0) {
6449
-            		if ($globalDBdriver == 'mysql') {
6448
+				if ($olderthanmonths > 0) {
6449
+					if ($globalDBdriver == 'mysql') {
6450 6450
 				$query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) ';
6451 6451
 			} else {
6452 6452
 				$query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' ";
6453 6453
 			}
6454
-                }
6455
-                if ($sincedate != '') {
6456
-            		if ($globalDBdriver == 'mysql') {
6454
+				}
6455
+				if ($sincedate != '') {
6456
+					if ($globalDBdriver == 'mysql') {
6457 6457
 				$query .= "AND spotter_output.date > '".$sincedate."' ";
6458 6458
 			} else {
6459 6459
 				$query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP) ";
6460 6460
 			}
6461 6461
 		}
6462 6462
 
6463
-            	//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
6464
-                //if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
6465
-                $query .= "GROUP BY spotter_output.airline_icao, spotter_output.real_departure_airport_icao, airport.name, airport.city, airport.country
6463
+				//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
6464
+				//if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
6465
+				$query .= "GROUP BY spotter_output.airline_icao, spotter_output.real_departure_airport_icao, airport.name, airport.city, airport.country
6466 6466
 				ORDER BY airport_departure_icao_count DESC";
6467 6467
 		if ($limit) $query .= " LIMIT 10 OFFSET 0";
6468 6468
       
@@ -6487,11 +6487,11 @@  discard block
 block discarded – undo
6487 6487
 	}	
6488 6488
 	
6489 6489
 	/**
6490
-	* Gets all departure airports of the airplanes that have flown over based on an airline icao
6491
-	*
6492
-	* @return Array the airport list
6493
-	*
6494
-	*/
6490
+	 * Gets all departure airports of the airplanes that have flown over based on an airline icao
6491
+	 *
6492
+	 * @return Array the airport list
6493
+	 *
6494
+	 */
6495 6495
 	public function countAllDepartureAirportsByAirline($airline_icao,$filters = array())
6496 6496
 	{
6497 6497
 		$filter_query = $this->getFilter($filters,true,true);
@@ -6525,11 +6525,11 @@  discard block
 block discarded – undo
6525 6525
 	
6526 6526
 	
6527 6527
 	/**
6528
-	* Gets all departure airports by country of the airplanes that have flown over based on an airline icao
6529
-	*
6530
-	* @return Array the airport list
6531
-	*
6532
-	*/
6528
+	 * Gets all departure airports by country of the airplanes that have flown over based on an airline icao
6529
+	 *
6530
+	 * @return Array the airport list
6531
+	 *
6532
+	 */
6533 6533
 	public function countAllDepartureAirportCountriesByAirline($airline_icao,$filters = array())
6534 6534
 	{
6535 6535
 		$filter_query = $this->getFilter($filters,true,true);
@@ -6560,11 +6560,11 @@  discard block
 block discarded – undo
6560 6560
 	
6561 6561
 	
6562 6562
 	/**
6563
-	* Gets all departure airports of the airplanes that have flown over based on an aircraft icao
6564
-	*
6565
-	* @return Array the airport list
6566
-	*
6567
-	*/
6563
+	 * Gets all departure airports of the airplanes that have flown over based on an aircraft icao
6564
+	 *
6565
+	 * @return Array the airport list
6566
+	 *
6567
+	 */
6568 6568
 	public function countAllDepartureAirportsByAircraft($aircraft_icao,$filters = array())
6569 6569
 	{
6570 6570
 		$filter_query = $this->getFilter($filters,true,true);
@@ -6597,11 +6597,11 @@  discard block
 block discarded – undo
6597 6597
 	
6598 6598
 	
6599 6599
 	/**
6600
-	* Gets all departure airports by country of the airplanes that have flown over based on an aircraft icao
6601
-	*
6602
-	* @return Array the airport list
6603
-	*
6604
-	*/
6600
+	 * Gets all departure airports by country of the airplanes that have flown over based on an aircraft icao
6601
+	 *
6602
+	 * @return Array the airport list
6603
+	 *
6604
+	 */
6605 6605
 	public function countAllDepartureAirportCountriesByAircraft($aircraft_icao,$filters = array())
6606 6606
 	{
6607 6607
 		$filter_query = $this->getFilter($filters,true,true);
@@ -6631,11 +6631,11 @@  discard block
 block discarded – undo
6631 6631
 	
6632 6632
 	
6633 6633
 	/**
6634
-	* Gets all departure airports of the airplanes that have flown over based on an aircraft registration
6635
-	*
6636
-	* @return Array the airport list
6637
-	*
6638
-	*/
6634
+	 * Gets all departure airports of the airplanes that have flown over based on an aircraft registration
6635
+	 *
6636
+	 * @return Array the airport list
6637
+	 *
6638
+	 */
6639 6639
 	public function countAllDepartureAirportsByRegistration($registration,$filters = array())
6640 6640
 	{
6641 6641
 		$filter_query = $this->getFilter($filters,true,true);
@@ -6668,11 +6668,11 @@  discard block
 block discarded – undo
6668 6668
 	
6669 6669
 	
6670 6670
 	/**
6671
-	* Gets all departure airports by country of the airplanes that have flown over based on an aircraft registration
6672
-	*
6673
-	* @return Array the airport list
6674
-	*
6675
-	*/
6671
+	 * Gets all departure airports by country of the airplanes that have flown over based on an aircraft registration
6672
+	 *
6673
+	 * @return Array the airport list
6674
+	 *
6675
+	 */
6676 6676
 	public function countAllDepartureAirportCountriesByRegistration($registration,$filters = array())
6677 6677
 	{
6678 6678
 		$filter_query = $this->getFilter($filters,true,true);
@@ -6702,11 +6702,11 @@  discard block
 block discarded – undo
6702 6702
 	
6703 6703
 	
6704 6704
 	/**
6705
-	* Gets all departure airports of the airplanes that have flown over based on an arrivl airport icao
6706
-	*
6707
-	* @return Array the airport list
6708
-	*
6709
-	*/
6705
+	 * Gets all departure airports of the airplanes that have flown over based on an arrivl airport icao
6706
+	 *
6707
+	 * @return Array the airport list
6708
+	 *
6709
+	 */
6710 6710
 	public function countAllDepartureAirportsByAirport($airport_icao,$filters = array())
6711 6711
 	{
6712 6712
 		$filter_query = $this->getFilter($filters,true,true);
@@ -6739,11 +6739,11 @@  discard block
 block discarded – undo
6739 6739
 	
6740 6740
 	
6741 6741
 	/**
6742
-	* Gets all departure airports by country of the airplanes that have flown over based on an airport icao
6743
-	*
6744
-	* @return Array the airport list
6745
-	*
6746
-	*/
6742
+	 * Gets all departure airports by country of the airplanes that have flown over based on an airport icao
6743
+	 *
6744
+	 * @return Array the airport list
6745
+	 *
6746
+	 */
6747 6747
 	public function countAllDepartureAirportCountriesByAirport($airport_icao,$filters = array())
6748 6748
 	{
6749 6749
 		$filter_query = $this->getFilter($filters,true,true);
@@ -6774,11 +6774,11 @@  discard block
 block discarded – undo
6774 6774
 	
6775 6775
 	
6776 6776
 	/**
6777
-	* Gets all departure airports of the airplanes that have flown over based on an aircraft manufacturer
6778
-	*
6779
-	* @return Array the airport list
6780
-	*
6781
-	*/
6777
+	 * Gets all departure airports of the airplanes that have flown over based on an aircraft manufacturer
6778
+	 *
6779
+	 * @return Array the airport list
6780
+	 *
6781
+	 */
6782 6782
 	public function countAllDepartureAirportsByManufacturer($aircraft_manufacturer,$filters = array())
6783 6783
 	{
6784 6784
 		$filter_query = $this->getFilter($filters,true,true);
@@ -6811,11 +6811,11 @@  discard block
 block discarded – undo
6811 6811
 	
6812 6812
 	
6813 6813
 	/**
6814
-	* Gets all departure airports by country of the airplanes that have flown over based on an aircraft manufacturer
6815
-	*
6816
-	* @return Array the airport list
6817
-	*
6818
-	*/
6814
+	 * Gets all departure airports by country of the airplanes that have flown over based on an aircraft manufacturer
6815
+	 *
6816
+	 * @return Array the airport list
6817
+	 *
6818
+	 */
6819 6819
 	public function countAllDepartureAirportCountriesByManufacturer($aircraft_manufacturer,$filters = array())
6820 6820
 	{
6821 6821
 		$filter_query = $this->getFilter($filters,true,true);
@@ -6845,11 +6845,11 @@  discard block
 block discarded – undo
6845 6845
 	
6846 6846
 	
6847 6847
 	/**
6848
-	* Gets all departure airports of the airplanes that have flown over based on a date
6849
-	*
6850
-	* @return Array the airport list
6851
-	*
6852
-	*/
6848
+	 * Gets all departure airports of the airplanes that have flown over based on a date
6849
+	 *
6850
+	 * @return Array the airport list
6851
+	 *
6852
+	 */
6853 6853
 	public function countAllDepartureAirportsByDate($date,$filters = array())
6854 6854
 	{
6855 6855
 		global $globalTimezone, $globalDBdriver;
@@ -6895,11 +6895,11 @@  discard block
 block discarded – undo
6895 6895
 	
6896 6896
 	
6897 6897
 	/**
6898
-	* Gets all departure airports by country of the airplanes that have flown over based on a date
6899
-	*
6900
-	* @return Array the airport list
6901
-	*
6902
-	*/
6898
+	 * Gets all departure airports by country of the airplanes that have flown over based on a date
6899
+	 *
6900
+	 * @return Array the airport list
6901
+	 *
6902
+	 */
6903 6903
 	public function countAllDepartureAirportCountriesByDate($date,$filters = array())
6904 6904
 	{
6905 6905
 		global $globalTimezone, $globalDBdriver;
@@ -6942,11 +6942,11 @@  discard block
 block discarded – undo
6942 6942
 	
6943 6943
 	
6944 6944
 	/**
6945
-	* Gets all departure airports of the airplanes that have flown over based on a ident/callsign
6946
-	*
6947
-	* @return Array the airport list
6948
-	*
6949
-	*/
6945
+	 * Gets all departure airports of the airplanes that have flown over based on a ident/callsign
6946
+	 *
6947
+	 * @return Array the airport list
6948
+	 *
6949
+	 */
6950 6950
 	public function countAllDepartureAirportsByIdent($ident,$filters = array())
6951 6951
 	{
6952 6952
 		$filter_query = $this->getFilter($filters,true,true);
@@ -6978,11 +6978,11 @@  discard block
 block discarded – undo
6978 6978
 	}
6979 6979
 	
6980 6980
 	/**
6981
-	* Gets all departure airports of the airplanes that have flown over based on a owner
6982
-	*
6983
-	* @return Array the airport list
6984
-	*
6985
-	*/
6981
+	 * Gets all departure airports of the airplanes that have flown over based on a owner
6982
+	 *
6983
+	 * @return Array the airport list
6984
+	 *
6985
+	 */
6986 6986
 	public function countAllDepartureAirportsByOwner($owner,$filters = array())
6987 6987
 	{
6988 6988
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7014,11 +7014,11 @@  discard block
 block discarded – undo
7014 7014
 	}
7015 7015
 	
7016 7016
 	/**
7017
-	* Gets all departure airports of the airplanes that have flown over based on a pilot
7018
-	*
7019
-	* @return Array the airport list
7020
-	*
7021
-	*/
7017
+	 * Gets all departure airports of the airplanes that have flown over based on a pilot
7018
+	 *
7019
+	 * @return Array the airport list
7020
+	 *
7021
+	 */
7022 7022
 	public function countAllDepartureAirportsByPilot($pilot,$filters = array())
7023 7023
 	{
7024 7024
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7051,11 +7051,11 @@  discard block
 block discarded – undo
7051 7051
 	
7052 7052
 	
7053 7053
 	/**
7054
-	* Gets all departure airports by country of the airplanes that have flown over based on a callsign/ident
7055
-	*
7056
-	* @return Array the airport list
7057
-	*
7058
-	*/
7054
+	 * Gets all departure airports by country of the airplanes that have flown over based on a callsign/ident
7055
+	 *
7056
+	 * @return Array the airport list
7057
+	 *
7058
+	 */
7059 7059
 	public function countAllDepartureAirportCountriesByIdent($ident,$filters = array())
7060 7060
 	{
7061 7061
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7084,11 +7084,11 @@  discard block
 block discarded – undo
7084 7084
 	}
7085 7085
 	
7086 7086
 	/**
7087
-	* Gets all departure airports by country of the airplanes that have flown over based on owner
7088
-	*
7089
-	* @return Array the airport list
7090
-	*
7091
-	*/
7087
+	 * Gets all departure airports by country of the airplanes that have flown over based on owner
7088
+	 *
7089
+	 * @return Array the airport list
7090
+	 *
7091
+	 */
7092 7092
 	public function countAllDepartureAirportCountriesByOwner($owner,$filters = array())
7093 7093
 	{
7094 7094
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7104,11 +7104,11 @@  discard block
 block discarded – undo
7104 7104
 	}
7105 7105
 	
7106 7106
 	/**
7107
-	* Gets all departure airports by country of the airplanes that have flown over based on pilot
7108
-	*
7109
-	* @return Array the airport list
7110
-	*
7111
-	*/
7107
+	 * Gets all departure airports by country of the airplanes that have flown over based on pilot
7108
+	 *
7109
+	 * @return Array the airport list
7110
+	 *
7111
+	 */
7112 7112
 	public function countAllDepartureAirportCountriesByPilot($pilot,$filters = array())
7113 7113
 	{
7114 7114
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7126,11 +7126,11 @@  discard block
 block discarded – undo
7126 7126
 	
7127 7127
 	
7128 7128
 	/**
7129
-	* Gets all departure airports of the airplanes that have flown over based on a country
7130
-	*
7131
-	* @return Array the airport list
7132
-	*
7133
-	*/
7129
+	 * Gets all departure airports of the airplanes that have flown over based on a country
7130
+	 *
7131
+	 * @return Array the airport list
7132
+	 *
7133
+	 */
7134 7134
 	public function countAllDepartureAirportsByCountry($country,$filters = array())
7135 7135
 	{
7136 7136
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7164,11 +7164,11 @@  discard block
 block discarded – undo
7164 7164
 
7165 7165
 
7166 7166
 	/**
7167
-	* Gets all departure airports by country of the airplanes that have flown over based on an aircraft icao
7168
-	*
7169
-	* @return Array the airport list
7170
-	*
7171
-	*/
7167
+	 * Gets all departure airports by country of the airplanes that have flown over based on an aircraft icao
7168
+	 *
7169
+	 * @return Array the airport list
7170
+	 *
7171
+	 */
7172 7172
 	public function countAllDepartureAirportCountriesByCountry($country,$filters = array())
7173 7173
 	{
7174 7174
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7198,31 +7198,31 @@  discard block
 block discarded – undo
7198 7198
 	
7199 7199
 
7200 7200
 	/**
7201
-	* Gets all arrival airports of the airplanes that have flown over
7202
-	*
7203
-	* @param Boolean $limit Limit result to 10 or not
7204
-	* @param Integer $olderthanmonths Only show result older than x months
7205
-	* @param String $sincedate Only show result since x date
7206
-	* @param Boolean $icaoaskey Show result by ICAO
7207
-	* @param Array $filters Filter used here
7208
-	* @return Array the airport list
7209
-	*
7210
-	*/
7201
+	 * Gets all arrival airports of the airplanes that have flown over
7202
+	 *
7203
+	 * @param Boolean $limit Limit result to 10 or not
7204
+	 * @param Integer $olderthanmonths Only show result older than x months
7205
+	 * @param String $sincedate Only show result since x date
7206
+	 * @param Boolean $icaoaskey Show result by ICAO
7207
+	 * @param Array $filters Filter used here
7208
+	 * @return Array the airport list
7209
+	 *
7210
+	 */
7211 7211
 	public function countAllArrivalAirports($limit = true, $olderthanmonths = 0, $sincedate = '', $icaoaskey = false,$filters = array(),$year = '',$month = '',$day = '')
7212 7212
 	{
7213 7213
 		global $globalDBdriver;
7214 7214
 		$filter_query = $this->getFilter($filters,true,true);
7215 7215
 		$query  = "SELECT DISTINCT spotter_output.arrival_airport_icao, COUNT(spotter_output.arrival_airport_icao) AS airport_arrival_icao_count, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country 
7216 7216
 				FROM spotter_output".$filter_query." spotter_output.arrival_airport_name <> '' AND spotter_output.arrival_airport_icao <> 'NA' AND spotter_output.arrival_airport_icao <> ''";
7217
-                if ($olderthanmonths > 0) {
7218
-            		if ($globalDBdriver == 'mysql') {
7217
+				if ($olderthanmonths > 0) {
7218
+					if ($globalDBdriver == 'mysql') {
7219 7219
 				$query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)';
7220 7220
 			} else {
7221 7221
 				$query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'";
7222 7222
 			}
7223 7223
 		}
7224
-                if ($sincedate != '') {
7225
-            		if ($globalDBdriver == 'mysql') {
7224
+				if ($sincedate != '') {
7225
+					if ($globalDBdriver == 'mysql') {
7226 7226
 				$query .= " AND spotter_output.date > '".$sincedate."'";
7227 7227
 			} else {
7228 7228
 				$query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
@@ -7256,7 +7256,7 @@  discard block
 block discarded – undo
7256 7256
 				$query_values = array_merge($query_values,array(':day' => $day));
7257 7257
 			}
7258 7258
 		}
7259
-                $query .= " GROUP BY spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country
7259
+				$query .= " GROUP BY spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country
7260 7260
 					ORDER BY airport_arrival_icao_count DESC";
7261 7261
 		if ($limit) $query .= " LIMIT 10";
7262 7262
       
@@ -7285,35 +7285,35 @@  discard block
 block discarded – undo
7285 7285
 	}
7286 7286
 
7287 7287
 	/**
7288
-	* Gets all arrival airports of the airplanes that have flown over
7289
-	*
7290
-	* @return Array the airport list
7291
-	*
7292
-	*/
7288
+	 * Gets all arrival airports of the airplanes that have flown over
7289
+	 *
7290
+	 * @return Array the airport list
7291
+	 *
7292
+	 */
7293 7293
 	public function countAllArrivalAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '', $icaoaskey = false,$filters = array())
7294 7294
 	{
7295 7295
 		global $globalDBdriver;
7296 7296
 		$filter_query = $this->getFilter($filters,true,true);
7297 7297
 		$query  = "SELECT DISTINCT spotter_output.airline_icao, spotter_output.arrival_airport_icao, COUNT(spotter_output.arrival_airport_icao) AS airport_arrival_icao_count, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country 
7298 7298
 			FROM spotter_output".$filter_query." spotter_output.airline_icao <> '' AND spotter_output.arrival_airport_name <> '' AND spotter_output.arrival_airport_icao <> 'NA' AND spotter_output.arrival_airport_icao <> '' ";
7299
-                if ($olderthanmonths > 0) {
7300
-            		if ($globalDBdriver == 'mysql') {
7299
+				if ($olderthanmonths > 0) {
7300
+					if ($globalDBdriver == 'mysql') {
7301 7301
 				$query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) ';
7302 7302
 			} else {
7303 7303
 				$query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' ";
7304 7304
 			}
7305 7305
 		}
7306
-                if ($sincedate != '') {
7307
-            		if ($globalDBdriver == 'mysql') {
7306
+				if ($sincedate != '') {
7307
+					if ($globalDBdriver == 'mysql') {
7308 7308
 				$query .= "AND spotter_output.date > '".$sincedate."' ";
7309 7309
 			} else {
7310 7310
 				$query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
7311 7311
 			}
7312 7312
 		}
7313 7313
 
7314
-            	//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
7315
-                //if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
7316
-                $query .= "GROUP BY spotter_output.airline_icao,spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country
7314
+				//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
7315
+				//if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
7316
+				$query .= "GROUP BY spotter_output.airline_icao,spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country
7317 7317
 					ORDER BY airport_arrival_icao_count DESC";
7318 7318
 		if ($limit) $query .= " LIMIT 10";
7319 7319
       
@@ -7344,26 +7344,26 @@  discard block
 block discarded – undo
7344 7344
 
7345 7345
 
7346 7346
 	/**
7347
-	* Gets all detected arrival airports of the airplanes that have flown over
7348
-	*
7349
-	* @return Array the airport list
7350
-	*
7351
-	*/
7347
+	 * Gets all detected arrival airports of the airplanes that have flown over
7348
+	 *
7349
+	 * @return Array the airport list
7350
+	 *
7351
+	 */
7352 7352
 	public function countAllDetectedArrivalAirports($limit = true, $olderthanmonths = 0, $sincedate = '',$icaoaskey = false,$filters = array(),$year = '',$month = '',$day = '')
7353 7353
 	{
7354 7354
 		global $globalDBdriver;
7355 7355
 		$filter_query = $this->getFilter($filters,true,true);
7356 7356
 		$query  = "SELECT DISTINCT spotter_output.real_arrival_airport_icao as arrival_airport_icao, COUNT(spotter_output.real_arrival_airport_icao) AS airport_arrival_icao_count, airport.name AS arrival_airport_name, airport.city AS arrival_airport_city, airport.country AS arrival_airport_country 
7357 7357
 			FROM airport,spotter_output".$filter_query." spotter_output.real_arrival_airport_icao <> '' AND spotter_output.real_arrival_airport_icao <> 'NA' AND airport.icao = spotter_output.real_arrival_airport_icao";
7358
-                if ($olderthanmonths > 0) {
7359
-            		if ($globalDBdriver == 'mysql') {
7358
+				if ($olderthanmonths > 0) {
7359
+					if ($globalDBdriver == 'mysql') {
7360 7360
 				$query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)';
7361 7361
 			} else {
7362 7362
 				$query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'";
7363 7363
 			}
7364 7364
 		}
7365
-                if ($sincedate != '') {
7366
-            		if ($globalDBdriver == 'mysql') {
7365
+				if ($sincedate != '') {
7366
+					if ($globalDBdriver == 'mysql') {
7367 7367
 				$query .= " AND spotter_output.date > '".$sincedate."'";
7368 7368
 			} else {
7369 7369
 				$query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
@@ -7397,7 +7397,7 @@  discard block
 block discarded – undo
7397 7397
 				$query_values = array_merge($query_values,array(':day' => $day));
7398 7398
 			}
7399 7399
 		}
7400
-                $query .= " GROUP BY spotter_output.real_arrival_airport_icao, airport.name, airport.city, airport.country
7400
+				$query .= " GROUP BY spotter_output.real_arrival_airport_icao, airport.name, airport.city, airport.country
7401 7401
 					ORDER BY airport_arrival_icao_count DESC";
7402 7402
 		if ($limit) $query .= " LIMIT 10";
7403 7403
       
@@ -7425,35 +7425,35 @@  discard block
 block discarded – undo
7425 7425
 	}
7426 7426
 	
7427 7427
 	/**
7428
-	* Gets all detected arrival airports of the airplanes that have flown over
7429
-	*
7430
-	* @return Array the airport list
7431
-	*
7432
-	*/
7428
+	 * Gets all detected arrival airports of the airplanes that have flown over
7429
+	 *
7430
+	 * @return Array the airport list
7431
+	 *
7432
+	 */
7433 7433
 	public function countAllDetectedArrivalAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '',$icaoaskey = false,$filters = array())
7434 7434
 	{
7435 7435
 		global $globalDBdriver;
7436 7436
 		$filter_query = $this->getFilter($filters,true,true);
7437 7437
 		$query  = "SELECT DISTINCT spotter_output.airline_icao, spotter_output.real_arrival_airport_icao as arrival_airport_icao, COUNT(spotter_output.real_arrival_airport_icao) AS airport_arrival_icao_count, airport.name AS arrival_airport_name, airport.city AS arrival_airport_city, airport.country AS arrival_airport_country 
7438 7438
 			FROM airport,spotter_output".$filter_query." spotter_output.airline_icao <> '' AND spotter_output.real_arrival_airport_icao <> '' AND spotter_output.real_arrival_airport_icao <> 'NA' AND airport.icao = spotter_output.real_arrival_airport_icao ";
7439
-                if ($olderthanmonths > 0) {
7440
-            		if ($globalDBdriver == 'mysql') {
7439
+				if ($olderthanmonths > 0) {
7440
+					if ($globalDBdriver == 'mysql') {
7441 7441
 				$query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) ';
7442 7442
 			} else {
7443 7443
 				$query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' ";
7444 7444
 			}
7445 7445
 		}
7446
-                if ($sincedate != '') {
7447
-            		if ($globalDBdriver == 'mysql') {
7446
+				if ($sincedate != '') {
7447
+					if ($globalDBdriver == 'mysql') {
7448 7448
 				$query .= "AND spotter_output.date > '".$sincedate."' ";
7449 7449
 			} else {
7450 7450
 				$query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
7451 7451
 			}
7452 7452
 		}
7453 7453
 
7454
-            	//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
7455
-                //if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
7456
-                $query .= "GROUP BY spotter_output.airline_icao, spotter_output.real_arrival_airport_icao, airport.name, airport.city, airport.country
7454
+				//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
7455
+				//if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
7456
+				$query .= "GROUP BY spotter_output.airline_icao, spotter_output.real_arrival_airport_icao, airport.name, airport.city, airport.country
7457 7457
 					ORDER BY airport_arrival_icao_count DESC";
7458 7458
 		if ($limit) $query .= " LIMIT 10";
7459 7459
       
@@ -7483,11 +7483,11 @@  discard block
 block discarded – undo
7483 7483
 	}	
7484 7484
 	
7485 7485
 	/**
7486
-	* Gets all arrival airports of the airplanes that have flown over based on an airline icao
7487
-	*
7488
-	* @return Array the airport list
7489
-	*
7490
-	*/
7486
+	 * Gets all arrival airports of the airplanes that have flown over based on an airline icao
7487
+	 *
7488
+	 * @return Array the airport list
7489
+	 *
7490
+	 */
7491 7491
 	public function countAllArrivalAirportsByAirline($airline_icao, $filters = array())
7492 7492
 	{
7493 7493
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7519,11 +7519,11 @@  discard block
 block discarded – undo
7519 7519
 	
7520 7520
 	
7521 7521
 	/**
7522
-	* Gets all arrival airports by country of the airplanes that have flown over based on an airline icao
7523
-	*
7524
-	* @return Array the airport list
7525
-	*
7526
-	*/
7522
+	 * Gets all arrival airports by country of the airplanes that have flown over based on an airline icao
7523
+	 *
7524
+	 * @return Array the airport list
7525
+	 *
7526
+	 */
7527 7527
 	public function countAllArrivalAirportCountriesByAirline($airline_icao,$filters = array())
7528 7528
 	{
7529 7529
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7554,11 +7554,11 @@  discard block
 block discarded – undo
7554 7554
 	
7555 7555
 	
7556 7556
 	/**
7557
-	* Gets all arrival airports of the airplanes that have flown over based on an aircraft icao
7558
-	*
7559
-	* @return Array the airport list
7560
-	*
7561
-	*/
7557
+	 * Gets all arrival airports of the airplanes that have flown over based on an aircraft icao
7558
+	 *
7559
+	 * @return Array the airport list
7560
+	 *
7561
+	 */
7562 7562
 	public function countAllArrivalAirportsByAircraft($aircraft_icao,$filters = array())
7563 7563
 	{
7564 7564
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7592,11 +7592,11 @@  discard block
 block discarded – undo
7592 7592
 	
7593 7593
 	
7594 7594
 	/**
7595
-	* Gets all arrival airports by country of the airplanes that have flown over based on an aircraft icao
7596
-	*
7597
-	* @return Array the airport list
7598
-	*
7599
-	*/
7595
+	 * Gets all arrival airports by country of the airplanes that have flown over based on an aircraft icao
7596
+	 *
7597
+	 * @return Array the airport list
7598
+	 *
7599
+	 */
7600 7600
 	public function countAllArrivalAirportCountriesByAircraft($aircraft_icao,$filters = array())
7601 7601
 	{
7602 7602
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7626,11 +7626,11 @@  discard block
 block discarded – undo
7626 7626
 	
7627 7627
 	
7628 7628
 	/**
7629
-	* Gets all arrival airports of the airplanes that have flown over based on an aircraft registration
7630
-	*
7631
-	* @return Array the airport list
7632
-	*
7633
-	*/
7629
+	 * Gets all arrival airports of the airplanes that have flown over based on an aircraft registration
7630
+	 *
7631
+	 * @return Array the airport list
7632
+	 *
7633
+	 */
7634 7634
 	public function countAllArrivalAirportsByRegistration($registration,$filters = array())
7635 7635
 	{
7636 7636
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7664,11 +7664,11 @@  discard block
 block discarded – undo
7664 7664
 	
7665 7665
 	
7666 7666
 	/**
7667
-	* Gets all arrival airports by country of the airplanes that have flown over based on an aircraft registration
7668
-	*
7669
-	* @return Array the airport list
7670
-	*
7671
-	*/
7667
+	 * Gets all arrival airports by country of the airplanes that have flown over based on an aircraft registration
7668
+	 *
7669
+	 * @return Array the airport list
7670
+	 *
7671
+	 */
7672 7672
 	public function countAllArrivalAirportCountriesByRegistration($registration,$filters = array())
7673 7673
 	{
7674 7674
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7699,11 +7699,11 @@  discard block
 block discarded – undo
7699 7699
 	
7700 7700
 	
7701 7701
 	/**
7702
-	* Gets all arrival airports of the airplanes that have flown over based on an departure airport
7703
-	*
7704
-	* @return Array the airport list
7705
-	*
7706
-	*/
7702
+	 * Gets all arrival airports of the airplanes that have flown over based on an departure airport
7703
+	 *
7704
+	 * @return Array the airport list
7705
+	 *
7706
+	 */
7707 7707
 	public function countAllArrivalAirportsByAirport($airport_icao,$filters = array())
7708 7708
 	{
7709 7709
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7736,11 +7736,11 @@  discard block
 block discarded – undo
7736 7736
 	
7737 7737
 	
7738 7738
 	/**
7739
-	* Gets all arrival airports by country of the airplanes that have flown over based on an airport icao
7740
-	*
7741
-	* @return Array the airport list
7742
-	*
7743
-	*/
7739
+	 * Gets all arrival airports by country of the airplanes that have flown over based on an airport icao
7740
+	 *
7741
+	 * @return Array the airport list
7742
+	 *
7743
+	 */
7744 7744
 	public function countAllArrivalAirportCountriesByAirport($airport_icao,$filters = array())
7745 7745
 	{
7746 7746
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7770,11 +7770,11 @@  discard block
 block discarded – undo
7770 7770
 	
7771 7771
 	
7772 7772
 	/**
7773
-	* Gets all arrival airports of the airplanes that have flown over based on a aircraft manufacturer
7774
-	*
7775
-	* @return Array the airport list
7776
-	*
7777
-	*/
7773
+	 * Gets all arrival airports of the airplanes that have flown over based on a aircraft manufacturer
7774
+	 *
7775
+	 * @return Array the airport list
7776
+	 *
7777
+	 */
7778 7778
 	public function countAllArrivalAirportsByManufacturer($aircraft_manufacturer,$filters = array())
7779 7779
 	{
7780 7780
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7808,11 +7808,11 @@  discard block
 block discarded – undo
7808 7808
 	
7809 7809
 	
7810 7810
 	/**
7811
-	* Gets all arrival airports by country of the airplanes that have flown over based on a aircraft manufacturer
7812
-	*
7813
-	* @return Array the airport list
7814
-	*
7815
-	*/
7811
+	 * Gets all arrival airports by country of the airplanes that have flown over based on a aircraft manufacturer
7812
+	 *
7813
+	 * @return Array the airport list
7814
+	 *
7815
+	 */
7816 7816
 	public function countAllArrivalAirportCountriesByManufacturer($aircraft_manufacturer,$filters = array())
7817 7817
 	{
7818 7818
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7843,11 +7843,11 @@  discard block
 block discarded – undo
7843 7843
 	
7844 7844
 	
7845 7845
 	/**
7846
-	* Gets all arrival airports of the airplanes that have flown over based on a date
7847
-	*
7848
-	* @return Array the airport list
7849
-	*
7850
-	*/
7846
+	 * Gets all arrival airports of the airplanes that have flown over based on a date
7847
+	 *
7848
+	 * @return Array the airport list
7849
+	 *
7850
+	 */
7851 7851
 	public function countAllArrivalAirportsByDate($date,$filters = array())
7852 7852
 	{
7853 7853
 		global $globalTimezone, $globalDBdriver;
@@ -7893,11 +7893,11 @@  discard block
 block discarded – undo
7893 7893
 	
7894 7894
 	
7895 7895
 	/**
7896
-	* Gets all arrival airports by country of the airplanes that have flown over based on a date
7897
-	*
7898
-	* @return Array the airport list
7899
-	*
7900
-	*/
7896
+	 * Gets all arrival airports by country of the airplanes that have flown over based on a date
7897
+	 *
7898
+	 * @return Array the airport list
7899
+	 *
7900
+	 */
7901 7901
 	public function countAllArrivalAirportCountriesByDate($date, $filters = array())
7902 7902
 	{
7903 7903
 		global $globalTimezone, $globalDBdriver;
@@ -7940,11 +7940,11 @@  discard block
 block discarded – undo
7940 7940
 	
7941 7941
 	
7942 7942
 	/**
7943
-	* Gets all arrival airports of the airplanes that have flown over based on a ident/callsign
7944
-	*
7945
-	* @return Array the airport list
7946
-	*
7947
-	*/
7943
+	 * Gets all arrival airports of the airplanes that have flown over based on a ident/callsign
7944
+	 *
7945
+	 * @return Array the airport list
7946
+	 *
7947
+	 */
7948 7948
 	public function countAllArrivalAirportsByIdent($ident,$filters = array())
7949 7949
 	{
7950 7950
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7976,11 +7976,11 @@  discard block
 block discarded – undo
7976 7976
 	}
7977 7977
 	
7978 7978
 	/**
7979
-	* Gets all arrival airports of the airplanes that have flown over based on a owner
7980
-	*
7981
-	* @return Array the airport list
7982
-	*
7983
-	*/
7979
+	 * Gets all arrival airports of the airplanes that have flown over based on a owner
7980
+	 *
7981
+	 * @return Array the airport list
7982
+	 *
7983
+	 */
7984 7984
 	public function countAllArrivalAirportsByOwner($owner,$filters = array())
7985 7985
 	{
7986 7986
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8011,11 +8011,11 @@  discard block
 block discarded – undo
8011 8011
 	}
8012 8012
 
8013 8013
 	/**
8014
-	* Gets all arrival airports of the airplanes that have flown over based on a pilot
8015
-	*
8016
-	* @return Array the airport list
8017
-	*
8018
-	*/
8014
+	 * Gets all arrival airports of the airplanes that have flown over based on a pilot
8015
+	 *
8016
+	 * @return Array the airport list
8017
+	 *
8018
+	 */
8019 8019
 	public function countAllArrivalAirportsByPilot($pilot,$filters = array())
8020 8020
 	{
8021 8021
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8046,11 +8046,11 @@  discard block
 block discarded – undo
8046 8046
 	}
8047 8047
 	
8048 8048
 	/**
8049
-	* Gets all arrival airports by country of the airplanes that have flown over based on a callsign/ident
8050
-	*
8051
-	* @return Array the airport list
8052
-	*
8053
-	*/
8049
+	 * Gets all arrival airports by country of the airplanes that have flown over based on a callsign/ident
8050
+	 *
8051
+	 * @return Array the airport list
8052
+	 *
8053
+	 */
8054 8054
 	public function countAllArrivalAirportCountriesByIdent($ident, $filters = array())
8055 8055
 	{
8056 8056
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8079,11 +8079,11 @@  discard block
 block discarded – undo
8079 8079
 	}
8080 8080
 	
8081 8081
 	/**
8082
-	* Gets all arrival airports by country of the airplanes that have flown over based on a owner
8083
-	*
8084
-	* @return Array the airport list
8085
-	*
8086
-	*/
8082
+	 * Gets all arrival airports by country of the airplanes that have flown over based on a owner
8083
+	 *
8084
+	 * @return Array the airport list
8085
+	 *
8086
+	 */
8087 8087
 	public function countAllArrivalAirportCountriesByOwner($owner, $filters = array())
8088 8088
 	{
8089 8089
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8101,11 +8101,11 @@  discard block
 block discarded – undo
8101 8101
 	
8102 8102
 	
8103 8103
 	/**
8104
-	* Gets all arrival airports of the airplanes that have flown over based on a country
8105
-	*
8106
-	* @return Array the airport list
8107
-	*
8108
-	*/
8104
+	 * Gets all arrival airports of the airplanes that have flown over based on a country
8105
+	 *
8106
+	 * @return Array the airport list
8107
+	 *
8108
+	 */
8109 8109
 	public function countAllArrivalAirportsByCountry($country,$filters = array())
8110 8110
 	{
8111 8111
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8138,11 +8138,11 @@  discard block
 block discarded – undo
8138 8138
 	
8139 8139
 	
8140 8140
 	/**
8141
-	* Gets all arrival airports by country of the airplanes that have flown over based on a country
8142
-	*
8143
-	* @return Array the airport list
8144
-	*
8145
-	*/
8141
+	 * Gets all arrival airports by country of the airplanes that have flown over based on a country
8142
+	 *
8143
+	 * @return Array the airport list
8144
+	 *
8145
+	 */
8146 8146
 	public function countAllArrivalAirportCountriesByCountry($country,$filters = array())
8147 8147
 	{
8148 8148
 		global $globalDBdriver;
@@ -8174,11 +8174,11 @@  discard block
 block discarded – undo
8174 8174
 
8175 8175
 
8176 8176
 	/**
8177
-	* Counts all airport departure countries
8178
-	*
8179
-	* @return Array the airport departure list
8180
-	*
8181
-	*/
8177
+	 * Counts all airport departure countries
8178
+	 *
8179
+	 * @return Array the airport departure list
8180
+	 *
8181
+	 */
8182 8182
 	public function countAllDepartureCountries($filters = array(),$year = '',$month = '', $day = '')
8183 8183
 	{
8184 8184
 		global $globalDBdriver;
@@ -8237,11 +8237,11 @@  discard block
 block discarded – undo
8237 8237
 	
8238 8238
 	
8239 8239
 	/**
8240
-	* Counts all airport arrival countries
8241
-	*
8242
-	* @return Array the airport arrival list
8243
-	*
8244
-	*/
8240
+	 * Counts all airport arrival countries
8241
+	 *
8242
+	 * @return Array the airport arrival list
8243
+	 *
8244
+	 */
8245 8245
 	public function countAllArrivalCountries($limit = true,$filters = array(),$year = '',$month = '',$day = '')
8246 8246
 	{
8247 8247
 		global $globalDBdriver;
@@ -8303,11 +8303,11 @@  discard block
 block discarded – undo
8303 8303
 
8304 8304
 
8305 8305
 	/**
8306
-	* Gets all route combinations
8307
-	*
8308
-	* @return Array the route list
8309
-	*
8310
-	*/
8306
+	 * Gets all route combinations
8307
+	 *
8308
+	 * @return Array the route list
8309
+	 *
8310
+	 */
8311 8311
 	public function countAllRoutes($filters = array())
8312 8312
 	{
8313 8313
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8346,11 +8346,11 @@  discard block
 block discarded – undo
8346 8346
 	
8347 8347
 	
8348 8348
 	/**
8349
-	* Gets all route combinations based on an aircraft
8350
-	*
8351
-	* @return Array the route list
8352
-	*
8353
-	*/
8349
+	 * Gets all route combinations based on an aircraft
8350
+	 *
8351
+	 * @return Array the route list
8352
+	 *
8353
+	 */
8354 8354
 	public function countAllRoutesByAircraft($aircraft_icao,$filters = array())
8355 8355
 	{
8356 8356
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8386,11 +8386,11 @@  discard block
 block discarded – undo
8386 8386
 	
8387 8387
 	
8388 8388
 	/**
8389
-	* Gets all route combinations based on an aircraft registration
8390
-	*
8391
-	* @return Array the route list
8392
-	*
8393
-	*/
8389
+	 * Gets all route combinations based on an aircraft registration
8390
+	 *
8391
+	 * @return Array the route list
8392
+	 *
8393
+	 */
8394 8394
 	public function countAllRoutesByRegistration($registration, $filters = array())
8395 8395
 	{
8396 8396
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8428,11 +8428,11 @@  discard block
 block discarded – undo
8428 8428
 	
8429 8429
 	
8430 8430
 	/**
8431
-	* Gets all route combinations based on an airline
8432
-	*
8433
-	* @return Array the route list
8434
-	*
8435
-	*/
8431
+	 * Gets all route combinations based on an airline
8432
+	 *
8433
+	 * @return Array the route list
8434
+	 *
8435
+	 */
8436 8436
 	public function countAllRoutesByAirline($airline_icao, $filters = array())
8437 8437
 	{
8438 8438
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8470,11 +8470,11 @@  discard block
 block discarded – undo
8470 8470
 	
8471 8471
 	
8472 8472
 	/**
8473
-	* Gets all route combinations based on an airport
8474
-	*
8475
-	* @return Array the route list
8476
-	*
8477
-	*/
8473
+	 * Gets all route combinations based on an airport
8474
+	 *
8475
+	 * @return Array the route list
8476
+	 *
8477
+	 */
8478 8478
 	public function countAllRoutesByAirport($airport_icao, $filters = array())
8479 8479
 	{
8480 8480
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8511,11 +8511,11 @@  discard block
 block discarded – undo
8511 8511
 	
8512 8512
 	
8513 8513
 	/**
8514
-	* Gets all route combinations based on an country
8515
-	*
8516
-	* @return Array the route list
8517
-	*
8518
-	*/
8514
+	 * Gets all route combinations based on an country
8515
+	 *
8516
+	 * @return Array the route list
8517
+	 *
8518
+	 */
8519 8519
 	public function countAllRoutesByCountry($country, $filters = array())
8520 8520
 	{
8521 8521
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8551,11 +8551,11 @@  discard block
 block discarded – undo
8551 8551
 
8552 8552
 
8553 8553
 	/**
8554
-	* Gets all route combinations based on an date
8555
-	*
8556
-	* @return Array the route list
8557
-	*
8558
-	*/
8554
+	 * Gets all route combinations based on an date
8555
+	 *
8556
+	 * @return Array the route list
8557
+	 *
8558
+	 */
8559 8559
 	public function countAllRoutesByDate($date, $filters = array())
8560 8560
 	{
8561 8561
 		global $globalTimezone, $globalDBdriver;
@@ -8605,11 +8605,11 @@  discard block
 block discarded – undo
8605 8605
 	
8606 8606
 	
8607 8607
 	/**
8608
-	* Gets all route combinations based on an ident/callsign
8609
-	*
8610
-	* @return Array the route list
8611
-	*
8612
-	*/
8608
+	 * Gets all route combinations based on an ident/callsign
8609
+	 *
8610
+	 * @return Array the route list
8611
+	 *
8612
+	 */
8613 8613
 	public function countAllRoutesByIdent($ident, $filters = array())
8614 8614
 	{
8615 8615
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8645,11 +8645,11 @@  discard block
 block discarded – undo
8645 8645
 	}
8646 8646
 	
8647 8647
 	/**
8648
-	* Gets all route combinations based on an owner
8649
-	*
8650
-	* @return Array the route list
8651
-	*
8652
-	*/
8648
+	 * Gets all route combinations based on an owner
8649
+	 *
8650
+	 * @return Array the route list
8651
+	 *
8652
+	 */
8653 8653
 	public function countAllRoutesByOwner($owner,$filters = array())
8654 8654
 	{
8655 8655
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8685,11 +8685,11 @@  discard block
 block discarded – undo
8685 8685
 	}
8686 8686
 	
8687 8687
 	/**
8688
-	* Gets all route combinations based on a pilot
8689
-	*
8690
-	* @return Array the route list
8691
-	*
8692
-	*/
8688
+	 * Gets all route combinations based on a pilot
8689
+	 *
8690
+	 * @return Array the route list
8691
+	 *
8692
+	 */
8693 8693
 	public function countAllRoutesByPilot($pilot,$filters = array())
8694 8694
 	{
8695 8695
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8726,11 +8726,11 @@  discard block
 block discarded – undo
8726 8726
 	
8727 8727
 	
8728 8728
 	/**
8729
-	* Gets all route combinations based on an manufacturer
8730
-	*
8731
-	* @return Array the route list
8732
-	*
8733
-	*/
8729
+	 * Gets all route combinations based on an manufacturer
8730
+	 *
8731
+	 * @return Array the route list
8732
+	 *
8733
+	 */
8734 8734
 	public function countAllRoutesByManufacturer($aircraft_manufacturer, $filters = array())
8735 8735
 	{
8736 8736
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8768,11 +8768,11 @@  discard block
 block discarded – undo
8768 8768
 	
8769 8769
 	
8770 8770
 	/**
8771
-	* Gets all route combinations with waypoints
8772
-	*
8773
-	* @return Array the route list
8774
-	*
8775
-	*/
8771
+	 * Gets all route combinations with waypoints
8772
+	 *
8773
+	 * @return Array the route list
8774
+	 *
8775
+	 */
8776 8776
 	public function countAllRoutesWithWaypoints($filters = array())
8777 8777
 	{
8778 8778
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8809,11 +8809,11 @@  discard block
 block discarded – undo
8809 8809
 	}
8810 8810
 	
8811 8811
 	/**
8812
-	* Gets all callsigns that have flown over
8813
-	*
8814
-	* @return Array the callsign list
8815
-	*
8816
-	*/
8812
+	 * Gets all callsigns that have flown over
8813
+	 *
8814
+	 * @return Array the callsign list
8815
+	 *
8816
+	 */
8817 8817
 	public function countAllCallsigns($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array(),$year = '', $month = '', $day = '')
8818 8818
 	{
8819 8819
 		global $globalDBdriver;
@@ -8879,11 +8879,11 @@  discard block
 block discarded – undo
8879 8879
 	}
8880 8880
 
8881 8881
 	/**
8882
-	* Gets all callsigns that have flown over
8883
-	*
8884
-	* @return Array the callsign list
8885
-	*
8886
-	*/
8882
+	 * Gets all callsigns that have flown over
8883
+	 *
8884
+	 * @return Array the callsign list
8885
+	 *
8886
+	 */
8887 8887
 	public function countAllCallsignsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '', $filters = array())
8888 8888
 	{
8889 8889
 		global $globalDBdriver;
@@ -8924,11 +8924,11 @@  discard block
 block discarded – undo
8924 8924
 
8925 8925
 
8926 8926
 	/**
8927
-	* Counts all dates
8928
-	*
8929
-	* @return Array the date list
8930
-	*
8931
-	*/
8927
+	 * Counts all dates
8928
+	 *
8929
+	 * @return Array the date list
8930
+	 *
8931
+	 */
8932 8932
 	public function countAllDates($filters = array())
8933 8933
 	{
8934 8934
 		global $globalTimezone, $globalDBdriver;
@@ -8973,11 +8973,11 @@  discard block
 block discarded – undo
8973 8973
 	}
8974 8974
 	
8975 8975
 	/**
8976
-	* Counts all dates
8977
-	*
8978
-	* @return Array the date list
8979
-	*
8980
-	*/
8976
+	 * Counts all dates
8977
+	 *
8978
+	 * @return Array the date list
8979
+	 *
8980
+	 */
8981 8981
 	public function countAllDatesByAirlines($filters = array())
8982 8982
 	{
8983 8983
 		global $globalTimezone, $globalDBdriver;
@@ -9022,11 +9022,11 @@  discard block
 block discarded – undo
9022 9022
 	}	
9023 9023
 	
9024 9024
 	/**
9025
-	* Counts all dates during the last 7 days
9026
-	*
9027
-	* @return Array the date list
9028
-	*
9029
-	*/
9025
+	 * Counts all dates during the last 7 days
9026
+	 *
9027
+	 * @return Array the date list
9028
+	 *
9029
+	 */
9030 9030
 	public function countAllDatesLast7Days($filters = array())
9031 9031
 	{
9032 9032
 		global $globalTimezone, $globalDBdriver;
@@ -9048,7 +9048,7 @@  discard block
 block discarded – undo
9048 9048
 			$query .= " GROUP BY date_name 
9049 9049
 								ORDER BY date_name ASC";
9050 9050
 			$query_data = array(':offset' => $offset);
9051
-    		}
9051
+			}
9052 9052
 		
9053 9053
 		$sth = $this->db->prepare($query);
9054 9054
 		$sth->execute($query_data);
@@ -9068,11 +9068,11 @@  discard block
 block discarded – undo
9068 9068
 	}
9069 9069
 
9070 9070
 	/**
9071
-	* Counts all dates during the last month
9072
-	*
9073
-	* @return Array the date list
9074
-	*
9075
-	*/
9071
+	 * Counts all dates during the last month
9072
+	 *
9073
+	 * @return Array the date list
9074
+	 *
9075
+	 */
9076 9076
 	public function countAllDatesLastMonth($filters = array())
9077 9077
 	{
9078 9078
 		global $globalTimezone, $globalDBdriver;
@@ -9094,7 +9094,7 @@  discard block
 block discarded – undo
9094 9094
 			$query .= " GROUP BY date_name 
9095 9095
 								ORDER BY date_name ASC";
9096 9096
 			$query_data = array(':offset' => $offset);
9097
-    		}
9097
+			}
9098 9098
 		
9099 9099
 		$sth = $this->db->prepare($query);
9100 9100
 		$sth->execute($query_data);
@@ -9115,11 +9115,11 @@  discard block
 block discarded – undo
9115 9115
 
9116 9116
 
9117 9117
 	/**
9118
-	* Counts all dates during the last month
9119
-	*
9120
-	* @return Array the date list
9121
-	*
9122
-	*/
9118
+	 * Counts all dates during the last month
9119
+	 *
9120
+	 * @return Array the date list
9121
+	 *
9122
+	 */
9123 9123
 	public function countAllDatesLastMonthByAirlines($filters = array())
9124 9124
 	{
9125 9125
 		global $globalTimezone, $globalDBdriver;
@@ -9142,7 +9142,7 @@  discard block
 block discarded – undo
9142 9142
 								GROUP BY spotter_output.airline_icao, date_name 
9143 9143
 								ORDER BY date_name ASC";
9144 9144
 			$query_data = array(':offset' => $offset);
9145
-    		}
9145
+			}
9146 9146
 		
9147 9147
 		$sth = $this->db->prepare($query);
9148 9148
 		$sth->execute($query_data);
@@ -9164,11 +9164,11 @@  discard block
 block discarded – undo
9164 9164
 	
9165 9165
 
9166 9166
 	/**
9167
-	* Counts all month
9168
-	*
9169
-	* @return Array the month list
9170
-	*
9171
-	*/
9167
+	 * Counts all month
9168
+	 *
9169
+	 * @return Array the month list
9170
+	 *
9171
+	 */
9172 9172
 	public function countAllMonths($filters = array())
9173 9173
 	{
9174 9174
 		global $globalTimezone, $globalDBdriver;
@@ -9210,11 +9210,11 @@  discard block
 block discarded – undo
9210 9210
 	}
9211 9211
 
9212 9212
 	/**
9213
-	* Counts all month
9214
-	*
9215
-	* @return Array the month list
9216
-	*
9217
-	*/
9213
+	 * Counts all month
9214
+	 *
9215
+	 * @return Array the month list
9216
+	 *
9217
+	 */
9218 9218
 	public function countAllMonthsByAirlines($filters = array())
9219 9219
 	{
9220 9220
 		global $globalTimezone, $globalDBdriver;
@@ -9259,11 +9259,11 @@  discard block
 block discarded – undo
9259 9259
 	}
9260 9260
 
9261 9261
 	/**
9262
-	* Counts all military month
9263
-	*
9264
-	* @return Array the month list
9265
-	*
9266
-	*/
9262
+	 * Counts all military month
9263
+	 *
9264
+	 * @return Array the month list
9265
+	 *
9266
+	 */
9267 9267
 	public function countAllMilitaryMonths($filters = array())
9268 9268
 	{
9269 9269
 		global $globalTimezone, $globalDBdriver;
@@ -9304,11 +9304,11 @@  discard block
 block discarded – undo
9304 9304
 	}
9305 9305
 	
9306 9306
 	/**
9307
-	* Counts all month owners
9308
-	*
9309
-	* @return Array the month list
9310
-	*
9311
-	*/
9307
+	 * Counts all month owners
9308
+	 *
9309
+	 * @return Array the month list
9310
+	 *
9311
+	 */
9312 9312
 	public function countAllMonthsOwners($filters = array())
9313 9313
 	{
9314 9314
 		global $globalTimezone, $globalDBdriver;
@@ -9350,11 +9350,11 @@  discard block
 block discarded – undo
9350 9350
 	}
9351 9351
 	
9352 9352
 	/**
9353
-	* Counts all month owners
9354
-	*
9355
-	* @return Array the month list
9356
-	*
9357
-	*/
9353
+	 * Counts all month owners
9354
+	 *
9355
+	 * @return Array the month list
9356
+	 *
9357
+	 */
9358 9358
 	public function countAllMonthsOwnersByAirlines($filters = array())
9359 9359
 	{
9360 9360
 		global $globalTimezone, $globalDBdriver;
@@ -9397,11 +9397,11 @@  discard block
 block discarded – undo
9397 9397
 	}
9398 9398
 
9399 9399
 	/**
9400
-	* Counts all month pilot
9401
-	*
9402
-	* @return Array the month list
9403
-	*
9404
-	*/
9400
+	 * Counts all month pilot
9401
+	 *
9402
+	 * @return Array the month list
9403
+	 *
9404
+	 */
9405 9405
 	public function countAllMonthsPilots($filters = array())
9406 9406
 	{
9407 9407
 		global $globalTimezone, $globalDBdriver;
@@ -9443,11 +9443,11 @@  discard block
 block discarded – undo
9443 9443
 	}
9444 9444
 	
9445 9445
 	/**
9446
-	* Counts all month pilot
9447
-	*
9448
-	* @return Array the month list
9449
-	*
9450
-	*/
9446
+	 * Counts all month pilot
9447
+	 *
9448
+	 * @return Array the month list
9449
+	 *
9450
+	 */
9451 9451
 	public function countAllMonthsPilotsByAirlines($filters = array())
9452 9452
 	{
9453 9453
 		global $globalTimezone, $globalDBdriver;
@@ -9490,11 +9490,11 @@  discard block
 block discarded – undo
9490 9490
 	}
9491 9491
 
9492 9492
 	/**
9493
-	* Counts all month airline
9494
-	*
9495
-	* @return Array the month list
9496
-	*
9497
-	*/
9493
+	 * Counts all month airline
9494
+	 *
9495
+	 * @return Array the month list
9496
+	 *
9497
+	 */
9498 9498
 	public function countAllMonthsAirlines($filters = array())
9499 9499
 	{
9500 9500
 		global $globalTimezone, $globalDBdriver;
@@ -9536,11 +9536,11 @@  discard block
 block discarded – undo
9536 9536
 	}
9537 9537
 	
9538 9538
 	/**
9539
-	* Counts all month aircraft
9540
-	*
9541
-	* @return Array the month list
9542
-	*
9543
-	*/
9539
+	 * Counts all month aircraft
9540
+	 *
9541
+	 * @return Array the month list
9542
+	 *
9543
+	 */
9544 9544
 	public function countAllMonthsAircrafts($filters = array())
9545 9545
 	{
9546 9546
 		global $globalTimezone, $globalDBdriver;
@@ -9583,11 +9583,11 @@  discard block
 block discarded – undo
9583 9583
 	
9584 9584
 
9585 9585
 	/**
9586
-	* Counts all month aircraft
9587
-	*
9588
-	* @return Array the month list
9589
-	*
9590
-	*/
9586
+	 * Counts all month aircraft
9587
+	 *
9588
+	 * @return Array the month list
9589
+	 *
9590
+	 */
9591 9591
 	public function countAllMonthsAircraftsByAirlines($filters = array())
9592 9592
 	{
9593 9593
 		global $globalTimezone, $globalDBdriver;
@@ -9630,11 +9630,11 @@  discard block
 block discarded – undo
9630 9630
 	}
9631 9631
 
9632 9632
 	/**
9633
-	* Counts all month real arrival
9634
-	*
9635
-	* @return Array the month list
9636
-	*
9637
-	*/
9633
+	 * Counts all month real arrival
9634
+	 *
9635
+	 * @return Array the month list
9636
+	 *
9637
+	 */
9638 9638
 	public function countAllMonthsRealArrivals($filters = array())
9639 9639
 	{
9640 9640
 		global $globalTimezone, $globalDBdriver;
@@ -9677,11 +9677,11 @@  discard block
 block discarded – undo
9677 9677
 	
9678 9678
 
9679 9679
 	/**
9680
-	* Counts all month real arrival
9681
-	*
9682
-	* @return Array the month list
9683
-	*
9684
-	*/
9680
+	 * Counts all month real arrival
9681
+	 *
9682
+	 * @return Array the month list
9683
+	 *
9684
+	 */
9685 9685
 	public function countAllMonthsRealArrivalsByAirlines($filters = array())
9686 9686
 	{
9687 9687
 		global $globalTimezone, $globalDBdriver;
@@ -9725,11 +9725,11 @@  discard block
 block discarded – undo
9725 9725
 	
9726 9726
 
9727 9727
 	/**
9728
-	* Counts all dates during the last year
9729
-	*
9730
-	* @return Array the date list
9731
-	*
9732
-	*/
9728
+	 * Counts all dates during the last year
9729
+	 *
9730
+	 * @return Array the date list
9731
+	 *
9732
+	 */
9733 9733
 	public function countAllMonthsLastYear($filters)
9734 9734
 	{
9735 9735
 		global $globalTimezone, $globalDBdriver;
@@ -9751,7 +9751,7 @@  discard block
 block discarded – undo
9751 9751
 			$query .= " GROUP BY year_name, month_name
9752 9752
 								ORDER BY year_name, month_name ASC";
9753 9753
 			$query_data = array(':offset' => $offset);
9754
-    		}
9754
+			}
9755 9755
 		
9756 9756
 		$sth = $this->db->prepare($query);
9757 9757
 		$sth->execute($query_data);
@@ -9774,11 +9774,11 @@  discard block
 block discarded – undo
9774 9774
 	
9775 9775
 	
9776 9776
 	/**
9777
-	* Counts all hours
9778
-	*
9779
-	* @return Array the hour list
9780
-	*
9781
-	*/
9777
+	 * Counts all hours
9778
+	 *
9779
+	 * @return Array the hour list
9780
+	 *
9781
+	 */
9782 9782
 	public function countAllHours($orderby,$filters = array())
9783 9783
 	{
9784 9784
 		global $globalTimezone, $globalDBdriver;
@@ -9839,11 +9839,11 @@  discard block
 block discarded – undo
9839 9839
 	}
9840 9840
 	
9841 9841
 	/**
9842
-	* Counts all hours
9843
-	*
9844
-	* @return Array the hour list
9845
-	*
9846
-	*/
9842
+	 * Counts all hours
9843
+	 *
9844
+	 * @return Array the hour list
9845
+	 *
9846
+	 */
9847 9847
 	public function countAllHoursByAirlines($orderby, $filters = array())
9848 9848
 	{
9849 9849
 		global $globalTimezone, $globalDBdriver;
@@ -9906,11 +9906,11 @@  discard block
 block discarded – undo
9906 9906
 
9907 9907
 
9908 9908
 	/**
9909
-	* Counts all hours by airline
9910
-	*
9911
-	* @return Array the hour list
9912
-	*
9913
-	*/
9909
+	 * Counts all hours by airline
9910
+	 *
9911
+	 * @return Array the hour list
9912
+	 *
9913
+	 */
9914 9914
 	public function countAllHoursByAirline($airline_icao, $filters = array())
9915 9915
 	{
9916 9916
 		global $globalTimezone, $globalDBdriver;
@@ -9956,11 +9956,11 @@  discard block
 block discarded – undo
9956 9956
 	
9957 9957
 	
9958 9958
 	/**
9959
-	* Counts all hours by aircraft
9960
-	*
9961
-	* @return Array the hour list
9962
-	*
9963
-	*/
9959
+	 * Counts all hours by aircraft
9960
+	 *
9961
+	 * @return Array the hour list
9962
+	 *
9963
+	 */
9964 9964
 	public function countAllHoursByAircraft($aircraft_icao, $filters = array())
9965 9965
 	{
9966 9966
 		global $globalTimezone, $globalDBdriver;
@@ -10003,11 +10003,11 @@  discard block
 block discarded – undo
10003 10003
 	
10004 10004
 	
10005 10005
 	/**
10006
-	* Counts all hours by aircraft registration
10007
-	*
10008
-	* @return Array the hour list
10009
-	*
10010
-	*/
10006
+	 * Counts all hours by aircraft registration
10007
+	 *
10008
+	 * @return Array the hour list
10009
+	 *
10010
+	 */
10011 10011
 	public function countAllHoursByRegistration($registration, $filters = array())
10012 10012
 	{
10013 10013
 		global $globalTimezone, $globalDBdriver;
@@ -10050,11 +10050,11 @@  discard block
 block discarded – undo
10050 10050
 	
10051 10051
 	
10052 10052
 	/**
10053
-	* Counts all hours by airport
10054
-	*
10055
-	* @return Array the hour list
10056
-	*
10057
-	*/
10053
+	 * Counts all hours by airport
10054
+	 *
10055
+	 * @return Array the hour list
10056
+	 *
10057
+	 */
10058 10058
 	public function countAllHoursByAirport($airport_icao, $filters = array())
10059 10059
 	{
10060 10060
 		global $globalTimezone, $globalDBdriver;
@@ -10098,11 +10098,11 @@  discard block
 block discarded – undo
10098 10098
 	
10099 10099
 	
10100 10100
 	/**
10101
-	* Counts all hours by manufacturer
10102
-	*
10103
-	* @return Array the hour list
10104
-	*
10105
-	*/
10101
+	 * Counts all hours by manufacturer
10102
+	 *
10103
+	 * @return Array the hour list
10104
+	 *
10105
+	 */
10106 10106
 	public function countAllHoursByManufacturer($aircraft_manufacturer,$filters =array())
10107 10107
 	{
10108 10108
 		global $globalTimezone, $globalDBdriver;
@@ -10146,11 +10146,11 @@  discard block
 block discarded – undo
10146 10146
 	
10147 10147
 	
10148 10148
 	/**
10149
-	* Counts all hours by date
10150
-	*
10151
-	* @return Array the hour list
10152
-	*
10153
-	*/
10149
+	 * Counts all hours by date
10150
+	 *
10151
+	 * @return Array the hour list
10152
+	 *
10153
+	 */
10154 10154
 	public function countAllHoursByDate($date, $filters = array())
10155 10155
 	{
10156 10156
 		global $globalTimezone, $globalDBdriver;
@@ -10194,11 +10194,11 @@  discard block
 block discarded – undo
10194 10194
 	
10195 10195
 	
10196 10196
 	/**
10197
-	* Counts all hours by a ident/callsign
10198
-	*
10199
-	* @return Array the hour list
10200
-	*
10201
-	*/
10197
+	 * Counts all hours by a ident/callsign
10198
+	 *
10199
+	 * @return Array the hour list
10200
+	 *
10201
+	 */
10202 10202
 	public function countAllHoursByIdent($ident, $filters = array())
10203 10203
 	{
10204 10204
 		global $globalTimezone, $globalDBdriver;
@@ -10241,11 +10241,11 @@  discard block
 block discarded – undo
10241 10241
 	}
10242 10242
 	
10243 10243
 	/**
10244
-	* Counts all hours by a owner
10245
-	*
10246
-	* @return Array the hour list
10247
-	*
10248
-	*/
10244
+	 * Counts all hours by a owner
10245
+	 *
10246
+	 * @return Array the hour list
10247
+	 *
10248
+	 */
10249 10249
 	public function countAllHoursByOwner($owner, $filters = array())
10250 10250
 	{
10251 10251
 		global $globalTimezone, $globalDBdriver;
@@ -10288,11 +10288,11 @@  discard block
 block discarded – undo
10288 10288
 	}
10289 10289
 	
10290 10290
 	/**
10291
-	* Counts all hours by a pilot
10292
-	*
10293
-	* @return Array the hour list
10294
-	*
10295
-	*/
10291
+	 * Counts all hours by a pilot
10292
+	 *
10293
+	 * @return Array the hour list
10294
+	 *
10295
+	 */
10296 10296
 	public function countAllHoursByPilot($pilot, $filters = array())
10297 10297
 	{
10298 10298
 		global $globalTimezone, $globalDBdriver;
@@ -10337,11 +10337,11 @@  discard block
 block discarded – undo
10337 10337
 	
10338 10338
 	
10339 10339
 	/**
10340
-	* Counts all hours by route
10341
-	*
10342
-	* @return Array the hour list
10343
-	*
10344
-	*/
10340
+	 * Counts all hours by route
10341
+	 *
10342
+	 * @return Array the hour list
10343
+	 *
10344
+	 */
10345 10345
 	public function countAllHoursByRoute($departure_airport_icao, $arrival_airport_icao, $filters =array())
10346 10346
 	{
10347 10347
 		global $globalTimezone, $globalDBdriver;
@@ -10385,11 +10385,11 @@  discard block
 block discarded – undo
10385 10385
 	
10386 10386
 	
10387 10387
 	/**
10388
-	* Counts all hours by country
10389
-	*
10390
-	* @return Array the hour list
10391
-	*
10392
-	*/
10388
+	 * Counts all hours by country
10389
+	 *
10390
+	 * @return Array the hour list
10391
+	 *
10392
+	 */
10393 10393
 	public function countAllHoursByCountry($country, $filters = array())
10394 10394
 	{
10395 10395
 		global $globalTimezone, $globalDBdriver;
@@ -10434,11 +10434,11 @@  discard block
 block discarded – undo
10434 10434
 
10435 10435
 
10436 10436
 	/**
10437
-	* Counts all aircraft that have flown over
10438
-	*
10439
-	* @return Integer the number of aircrafts
10440
-	*
10441
-	*/
10437
+	 * Counts all aircraft that have flown over
10438
+	 *
10439
+	 * @return Integer the number of aircrafts
10440
+	 *
10441
+	 */
10442 10442
 	public function countOverallAircrafts($filters = array(),$year = '',$month = '')
10443 10443
 	{
10444 10444
 		global $globalDBdriver;
@@ -10471,11 +10471,11 @@  discard block
 block discarded – undo
10471 10471
 	}
10472 10472
 
10473 10473
 	/**
10474
-	* Counts all flight that really arrival
10475
-	*
10476
-	* @return Integer the number of aircrafts
10477
-	*
10478
-	*/
10474
+	 * Counts all flight that really arrival
10475
+	 *
10476
+	 * @return Integer the number of aircrafts
10477
+	 *
10478
+	 */
10479 10479
 	public function countOverallArrival($filters = array(),$year = '',$month = '')
10480 10480
 	{
10481 10481
 		global $globalDBdriver;
@@ -10508,11 +10508,11 @@  discard block
 block discarded – undo
10508 10508
 	}
10509 10509
 
10510 10510
 	/**
10511
-	* Counts all pilots that have flown over
10512
-	*
10513
-	* @return Integer the number of pilots
10514
-	*
10515
-	*/
10511
+	 * Counts all pilots that have flown over
10512
+	 *
10513
+	 * @return Integer the number of pilots
10514
+	 *
10515
+	 */
10516 10516
 	public function countOverallPilots($filters = array(),$year = '',$month = '')
10517 10517
 	{
10518 10518
 		global $globalDBdriver;
@@ -10544,11 +10544,11 @@  discard block
 block discarded – undo
10544 10544
 	}
10545 10545
 
10546 10546
 	/**
10547
-	* Counts all owners that have flown over
10548
-	*
10549
-	* @return Integer the number of owners
10550
-	*
10551
-	*/
10547
+	 * Counts all owners that have flown over
10548
+	 *
10549
+	 * @return Integer the number of owners
10550
+	 *
10551
+	 */
10552 10552
 	public function countOverallOwners($filters = array(),$year = '',$month = '')
10553 10553
 	{
10554 10554
 		global $globalDBdriver;
@@ -10581,11 +10581,11 @@  discard block
 block discarded – undo
10581 10581
 	
10582 10582
 	
10583 10583
 	/**
10584
-	* Counts all flights that have flown over
10585
-	*
10586
-	* @return Integer the number of flights
10587
-	*
10588
-	*/
10584
+	 * Counts all flights that have flown over
10585
+	 *
10586
+	 * @return Integer the number of flights
10587
+	 *
10588
+	 */
10589 10589
 	public function countOverallFlights($filters = array(),$year = '',$month = '')
10590 10590
 	{
10591 10591
 		global $globalDBdriver;
@@ -10620,11 +10620,11 @@  discard block
 block discarded – undo
10620 10620
 	}
10621 10621
 	
10622 10622
 	/**
10623
-	* Counts all military flights that have flown over
10624
-	*
10625
-	* @return Integer the number of flights
10626
-	*
10627
-	*/
10623
+	 * Counts all military flights that have flown over
10624
+	 *
10625
+	 * @return Integer the number of flights
10626
+	 *
10627
+	 */
10628 10628
 	public function countOverallMilitaryFlights($filters = array(),$year = '',$month = '')
10629 10629
 	{
10630 10630
 		global $globalDBdriver;
@@ -10659,11 +10659,11 @@  discard block
 block discarded – undo
10659 10659
 	
10660 10660
 	
10661 10661
 	/**
10662
-	* Counts all airlines that have flown over
10663
-	*
10664
-	* @return Integer the number of airlines
10665
-	*
10666
-	*/
10662
+	 * Counts all airlines that have flown over
10663
+	 *
10664
+	 * @return Integer the number of airlines
10665
+	 *
10666
+	 */
10667 10667
 	public function countOverallAirlines($filters = array(),$year = '',$month = '')
10668 10668
 	{
10669 10669
 		global $globalDBdriver;
@@ -10690,8 +10690,8 @@  discard block
 block discarded – undo
10690 10690
 				$query_values = array_merge($query_values,array(':month' => $month));
10691 10691
 			}
10692 10692
 		}
10693
-                if ($query == '') $queryi .= $this->getFilter($filters);
10694
-                else $queryi .= $this->getFilter($filters,true,true).substr($query,4);
10693
+				if ($query == '') $queryi .= $this->getFilter($filters);
10694
+				else $queryi .= $this->getFilter($filters,true,true).substr($query,4);
10695 10695
 
10696 10696
 
10697 10697
 		$sth = $this->db->prepare($queryi);
@@ -10701,11 +10701,11 @@  discard block
 block discarded – undo
10701 10701
 
10702 10702
   
10703 10703
 	/**
10704
-	* Counts all hours of today
10705
-	*
10706
-	* @return Array the hour list
10707
-	*
10708
-	*/
10704
+	 * Counts all hours of today
10705
+	 *
10706
+	 * @return Array the hour list
10707
+	 *
10708
+	 */
10709 10709
 	public function countAllHoursFromToday($filters = array())
10710 10710
 	{
10711 10711
 		global $globalTimezone, $globalDBdriver;
@@ -10745,11 +10745,11 @@  discard block
 block discarded – undo
10745 10745
 	}
10746 10746
     
10747 10747
 	/**
10748
-	* Gets all the spotter information based on calculated upcoming flights
10749
-	*
10750
-	* @return Array the spotter information
10751
-	*
10752
-	*/
10748
+	 * Gets all the spotter information based on calculated upcoming flights
10749
+	 *
10750
+	 * @return Array the spotter information
10751
+	 *
10752
+	 */
10753 10753
 	public function getUpcomingFlights($limit = '', $sort = '', $filters = array())
10754 10754
 	{
10755 10755
 		global $global_query, $globalDBdriver, $globalTimezone;
@@ -10824,12 +10824,12 @@  discard block
 block discarded – undo
10824 10824
 	}
10825 10825
     
10826 10826
     
10827
-     /**
10828
-	* Gets the Barrie Spotter ID based on the FlightAware ID
10829
-	*
10830
-	* @return Integer the Barrie Spotter ID
10827
+	 /**
10828
+	  * Gets the Barrie Spotter ID based on the FlightAware ID
10829
+	  *
10830
+	  * @return Integer the Barrie Spotter ID
10831 10831
 q	*
10832
-	*/
10832
+	  */
10833 10833
 	public function getSpotterIDBasedOnFlightAwareID($flightaware_id)
10834 10834
 	{
10835 10835
 		$flightaware_id = filter_var($flightaware_id,FILTER_SANITIZE_STRING);
@@ -10850,13 +10850,13 @@  discard block
 block discarded – undo
10850 10850
   
10851 10851
  
10852 10852
 	/**
10853
-	* Parses a date string
10854
-	*
10855
-	* @param String $dateString the date string
10856
-	* @param String $timezone the timezone of a user
10857
-	* @return Array the time information
10858
-	*
10859
-	*/
10853
+	 * Parses a date string
10854
+	 *
10855
+	 * @param String $dateString the date string
10856
+	 * @param String $timezone the timezone of a user
10857
+	 * @return Array the time information
10858
+	 *
10859
+	 */
10860 10860
 	public function parseDateString($dateString, $timezone = '')
10861 10861
 	{
10862 10862
 		$time_array = array();
@@ -10892,12 +10892,12 @@  discard block
 block discarded – undo
10892 10892
 	
10893 10893
 	
10894 10894
 	/**
10895
-	* Parses the direction degrees to working
10896
-	*
10897
-	* @param Float $direction the direction in degrees
10898
-	* @return Array the direction information
10899
-	*
10900
-	*/
10895
+	 * Parses the direction degrees to working
10896
+	 *
10897
+	 * @param Float $direction the direction in degrees
10898
+	 * @return Array the direction information
10899
+	 *
10900
+	 */
10901 10901
 	public function parseDirection($direction = 0)
10902 10902
 	{
10903 10903
 		if ($direction == '') $direction = 0;
@@ -10976,12 +10976,12 @@  discard block
 block discarded – undo
10976 10976
 	
10977 10977
 	
10978 10978
 	/**
10979
-	* Gets the aircraft registration
10980
-	*
10981
-	* @param String $flightaware_id the flight aware id
10982
-	* @return String the aircraft registration
10983
-	*
10984
-	*/
10979
+	 * Gets the aircraft registration
10980
+	 *
10981
+	 * @param String $flightaware_id the flight aware id
10982
+	 * @return String the aircraft registration
10983
+	 *
10984
+	 */
10985 10985
 	
10986 10986
 	public function getAircraftRegistration($flightaware_id)
10987 10987
 	{
@@ -11010,12 +11010,12 @@  discard block
 block discarded – undo
11010 11010
 
11011 11011
 
11012 11012
 	/**
11013
-	* Gets the aircraft registration from ModeS
11014
-	*
11015
-	* @param String $aircraft_modes the flight ModeS in hex
11016
-	* @return String the aircraft registration
11017
-	*
11018
-	*/
11013
+	 * Gets the aircraft registration from ModeS
11014
+	 *
11015
+	 * @param String $aircraft_modes the flight ModeS in hex
11016
+	 * @return String the aircraft registration
11017
+	 *
11018
+	 */
11019 11019
 	public function getAircraftRegistrationBymodeS($aircraft_modes)
11020 11020
 	{
11021 11021
 		$aircraft_modes = filter_var($aircraft_modes,FILTER_SANITIZE_STRING);
@@ -11028,19 +11028,19 @@  discard block
 block discarded – undo
11028 11028
 		$row = $sth->fetch(PDO::FETCH_ASSOC);
11029 11029
 		$sth->closeCursor();
11030 11030
 		if (count($row) > 0) {
11031
-		    //return $row['Registration'];
11032
-		    return $row['registration'];
11031
+			//return $row['Registration'];
11032
+			return $row['registration'];
11033 11033
 		} else return '';
11034 11034
 	
11035 11035
 	}
11036 11036
 
11037 11037
 	/**
11038
-	* Gets the aircraft type from ModeS
11039
-	*
11040
-	* @param String $aircraft_modes the flight ModeS in hex
11041
-	* @return String the aircraft type
11042
-	*
11043
-	*/
11038
+	 * Gets the aircraft type from ModeS
11039
+	 *
11040
+	 * @param String $aircraft_modes the flight ModeS in hex
11041
+	 * @return String the aircraft type
11042
+	 *
11043
+	 */
11044 11044
 	public function getAircraftTypeBymodeS($aircraft_modes)
11045 11045
 	{
11046 11046
 		$aircraft_modes = filter_var($aircraft_modes,FILTER_SANITIZE_STRING);
@@ -11053,19 +11053,19 @@  discard block
 block discarded – undo
11053 11053
 		$row = $sth->fetch(PDO::FETCH_ASSOC);
11054 11054
 		$sth->closeCursor();
11055 11055
 		if (count($row) > 0) {
11056
-		    if ($row['type_flight'] == null) return '';
11057
-		    else return $row['type_flight'];
11056
+			if ($row['type_flight'] == null) return '';
11057
+			else return $row['type_flight'];
11058 11058
 		} else return '';
11059 11059
 	
11060 11060
 	}
11061 11061
 
11062 11062
 	/**
11063
-	* Gets Country from latitude/longitude
11064
-	*
11065
-	* @param Float $latitude latitute of the flight
11066
-	* @param Float $longitude longitute of the flight
11067
-	* @return String the countrie
11068
-	*/
11063
+	 * Gets Country from latitude/longitude
11064
+	 *
11065
+	 * @param Float $latitude latitute of the flight
11066
+	 * @param Float $longitude longitute of the flight
11067
+	 * @return String the countrie
11068
+	 */
11069 11069
 	public function getCountryFromLatitudeLongitude($latitude,$longitude)
11070 11070
 	{
11071 11071
 		global $globalDBdriver, $globalDebug;
@@ -11102,11 +11102,11 @@  discard block
 block discarded – undo
11102 11102
 	}
11103 11103
 
11104 11104
 	/**
11105
-	* Gets Country from iso2
11106
-	*
11107
-	* @param String $iso2 ISO2 country code
11108
-	* @return String the countrie
11109
-	*/
11105
+	 * Gets Country from iso2
11106
+	 *
11107
+	 * @param String $iso2 ISO2 country code
11108
+	 * @return String the countrie
11109
+	 */
11110 11110
 	public function getCountryFromISO2($iso2)
11111 11111
 	{
11112 11112
 		global $globalDBdriver, $globalDebug;
@@ -11134,12 +11134,12 @@  discard block
 block discarded – undo
11134 11134
 	}
11135 11135
 
11136 11136
 	/**
11137
-	* converts the registration code using the country prefix
11138
-	*
11139
-	* @param String $registration the aircraft registration
11140
-	* @return String the aircraft registration
11141
-	*
11142
-	*/
11137
+	 * converts the registration code using the country prefix
11138
+	 *
11139
+	 * @param String $registration the aircraft registration
11140
+	 * @return String the aircraft registration
11141
+	 *
11142
+	 */
11143 11143
 	public function convertAircraftRegistration($registration)
11144 11144
 	{
11145 11145
 		$registration = filter_var($registration,FILTER_SANITIZE_STRING);
@@ -11191,12 +11191,12 @@  discard block
 block discarded – undo
11191 11191
 	}
11192 11192
 
11193 11193
 	/**
11194
-	* Country from the registration code
11195
-	*
11196
-	* @param String $registration the aircraft registration
11197
-	* @return String the country
11198
-	*
11199
-	*/
11194
+	 * Country from the registration code
11195
+	 *
11196
+	 * @param String $registration the aircraft registration
11197
+	 * @return String the country
11198
+	 *
11199
+	 */
11200 11200
 	public function countryFromAircraftRegistration($registration)
11201 11201
 	{
11202 11202
 		$registration = filter_var($registration,FILTER_SANITIZE_STRING);
@@ -11215,8 +11215,8 @@  discard block
 block discarded – undo
11215 11215
 				$country = $row['country'];
11216 11216
 			}
11217 11217
 		} else {
11218
-    			$registration_1 = substr($registration, 0, 1);
11219
-		        $registration_2 = substr($registration, 0, 2);
11218
+				$registration_1 = substr($registration, 0, 1);
11219
+				$registration_2 = substr($registration, 0, 2);
11220 11220
 
11221 11221
 			$country = '';
11222 11222
 			//first get the prefix based on two characters
@@ -11252,12 +11252,12 @@  discard block
 block discarded – undo
11252 11252
 	}
11253 11253
 
11254 11254
 	/**
11255
-	* Registration prefix from the registration code
11256
-	*
11257
-	* @param String $registration the aircraft registration
11258
-	* @return String the registration prefix
11259
-	*
11260
-	*/
11255
+	 * Registration prefix from the registration code
11256
+	 *
11257
+	 * @param String $registration the aircraft registration
11258
+	 * @return String the registration prefix
11259
+	 *
11260
+	 */
11261 11261
 	public function registrationPrefixFromAircraftRegistration($registration)
11262 11262
 	{
11263 11263
 		$registration = filter_var($registration,FILTER_SANITIZE_STRING);
@@ -11276,8 +11276,8 @@  discard block
 block discarded – undo
11276 11276
 				//$country = $row['country'];
11277 11277
 			}
11278 11278
 		} else {
11279
-    			$registration_1 = substr($registration, 0, 1);
11280
-		        $registration_2 = substr($registration, 0, 2);
11279
+				$registration_1 = substr($registration, 0, 1);
11280
+				$registration_2 = substr($registration, 0, 2);
11281 11281
 
11282 11282
 			//first get the prefix based on two characters
11283 11283
 			$query  = "SELECT aircraft_registration.registration_prefix, aircraft_registration.country FROM aircraft_registration WHERE registration_prefix = :registration_2 LIMIT 1";
@@ -11313,12 +11313,12 @@  discard block
 block discarded – undo
11313 11313
 
11314 11314
 
11315 11315
 	/**
11316
-	* Country from the registration code
11317
-	*
11318
-	* @param String $registration the aircraft registration
11319
-	* @return String the country
11320
-	*
11321
-	*/
11316
+	 * Country from the registration code
11317
+	 *
11318
+	 * @param String $registration the aircraft registration
11319
+	 * @return String the country
11320
+	 *
11321
+	 */
11322 11322
 	public function countryFromAircraftRegistrationCode($registration)
11323 11323
 	{
11324 11324
 		$registration = filter_var($registration,FILTER_SANITIZE_STRING);
@@ -11335,11 +11335,11 @@  discard block
 block discarded – undo
11335 11335
 	}
11336 11336
 	
11337 11337
 	/**
11338
-	* Set a new highlight value for a flight
11339
-	*
11340
-	* @param String $flightaware_id flightaware_id from spotter_output table
11341
-	* @param String $highlight New highlight value
11342
-	*/
11338
+	 * Set a new highlight value for a flight
11339
+	 *
11340
+	 * @param String $flightaware_id flightaware_id from spotter_output table
11341
+	 * @param String $highlight New highlight value
11342
+	 */
11343 11343
 	public function setHighlightFlight($flightaware_id,$highlight) {
11344 11344
 		
11345 11345
 		$query  = "UPDATE spotter_output SET highlight = :highlight WHERE flightaware_id = :flightaware_id";
@@ -11348,12 +11348,12 @@  discard block
 block discarded – undo
11348 11348
 	}
11349 11349
 
11350 11350
 	/**
11351
-	* Set a new highlight value for a flight by Registration
11352
-	*
11353
-	* @param String $registration Registration of the aircraft
11354
-	* @param String $date Date of spotted aircraft
11355
-	* @param String $highlight New highlight value
11356
-	*/
11351
+	 * Set a new highlight value for a flight by Registration
11352
+	 *
11353
+	 * @param String $registration Registration of the aircraft
11354
+	 * @param String $date Date of spotted aircraft
11355
+	 * @param String $highlight New highlight value
11356
+	 */
11357 11357
 	public function setHighlightFlightByRegistration($registration,$highlight, $date = '') {
11358 11358
 		if ($date == '') {
11359 11359
 			$query  = "UPDATE spotter_output SET highlight = :highlight WHERE spotter_id IN (SELECT MAX(spotter_id) FROM spotter_output WHERE registration = :registration)";
@@ -11367,12 +11367,12 @@  discard block
 block discarded – undo
11367 11367
 	}
11368 11368
 	
11369 11369
 	/**
11370
-	* Gets the short url from bit.ly
11371
-	*
11372
-	* @param String $url the full url
11373
-	* @return String the bit.ly url
11374
-	*
11375
-	*/
11370
+	 * Gets the short url from bit.ly
11371
+	 *
11372
+	 * @param String $url the full url
11373
+	 * @return String the bit.ly url
11374
+	 *
11375
+	 */
11376 11376
 	public function getBitlyURL($url)
11377 11377
 	{
11378 11378
 		global $globalBitlyAccessToken;
@@ -11661,11 +11661,11 @@  discard block
 block discarded – undo
11661 11661
 			$query="SELECT name, icao, latitude, longitude, altitude, 3956 * 2 * ASIN(SQRT( POWER(SIN(($origLat - latitude)*pi()/180/2),2)+COS( $origLat *pi()/180)*COS(latitude*pi()/180)*POWER(SIN(($origLon-longitude)*pi()/180/2),2))) as distance 
11662 11662
 	                      FROM airport WHERE longitude between ($origLon-$dist/cos(radians($origLat))*69) and ($origLon+$dist/cos(radians($origLat)*69)) and latitude between ($origLat-($dist/69)) and ($origLat+($dist/69)) 
11663 11663
 	                      AND (3956 * 2 * ASIN(SQRT( POWER(SIN(($origLat - latitude)*pi()/180/2),2)+COS( $origLat *pi()/180)*COS(latitude*pi()/180)*POWER(SIN(($origLon-longitude)*pi()/180/2),2)))) < $dist ORDER BY distance limit 100;";
11664
-                } else {
11664
+				} else {
11665 11665
 			$query="SELECT name, icao, latitude, longitude, altitude, 3956 * 2 * ASIN(SQRT( POWER(SIN(($origLat - CAST(latitude as double precision))*pi()/180/2),2)+COS( $origLat *pi()/180)*COS(CAST(latitude as double precision)*pi()/180)*POWER(SIN(($origLon-CAST(longitude as double precision))*pi()/180/2),2))) as distance 
11666 11666
 	                      FROM airport WHERE CAST(longitude as double precision) between ($origLon-$dist/cos(radians($origLat))*69) and ($origLon+$dist/cos(radians($origLat))*69) and CAST(latitude as double precision) between ($origLat-($dist/69)) and ($origLat+($dist/69)) 
11667 11667
 	                      AND (3956 * 2 * ASIN(SQRT( POWER(SIN(($origLat - CAST(latitude as double precision))*pi()/180/2),2)+COS( $origLat *pi()/180)*COS(CAST(latitude as double precision)*pi()/180)*POWER(SIN(($origLon-CAST(longitude as double precision))*pi()/180/2),2)))) < $dist ORDER BY distance limit 100;";
11668
-    		}
11668
+			}
11669 11669
 		$sth = $this->db->prepare($query);
11670 11670
 		$sth->execute();
11671 11671
 		return $sth->fetchAll(PDO::FETCH_ASSOC);
Please login to merge, or discard this patch.
Braces   +718 added lines, -250 removed lines patch added patch discarded remove patch
@@ -69,7 +69,9 @@  discard block
 block discarded – undo
69 69
 				$filter = array_merge($filter,$globalStatsFilters[$globalFilterName]);
70 70
 			}
71 71
 		}
72
-		if (is_array($globalFilter)) $filter = array_merge($filter,$globalFilter);
72
+		if (is_array($globalFilter)) {
73
+			$filter = array_merge($filter,$globalFilter);
74
+		}
73 75
 		$filter_query_join = '';
74 76
 		$filter_query_where = '';
75 77
 		foreach($filters as $flt) {
@@ -122,8 +124,11 @@  discard block
 block discarded – undo
122 124
 				$filter_query_where .= " AND format_source = 'aprs' AND source_name IN ('".implode("','",$filter['source_aprs'])."')";
123 125
 			}
124 126
 		}
125
-		if ($filter_query_where == '' && $where) $filter_query_where = ' WHERE';
126
-		elseif ($filter_query_where != '' && $and) $filter_query_where .= ' AND';
127
+		if ($filter_query_where == '' && $where) {
128
+			$filter_query_where = ' WHERE';
129
+		} elseif ($filter_query_where != '' && $and) {
130
+			$filter_query_where .= ' AND';
131
+		}
127 132
 		$filter_query = $filter_query_join.$filter_query_where;
128 133
 		return $filter_query;
129 134
 	}
@@ -143,10 +148,18 @@  discard block
 block discarded – undo
143 148
 		$Image = new Image($this->db);
144 149
 		$Schedule = new Schedule($this->db);
145 150
 		$ACARS = new ACARS($this->db);
146
-		if (!isset($globalIVAO)) $globalIVAO = FALSE;
147
-		if (!isset($globalVATSIM)) $globalVATSIM = FALSE;
148
-		if (!isset($globalphpVMS)) $globalphpVMS = FALSE;
149
-		if (!isset($globalVAM)) $globalVAM = FALSE;
151
+		if (!isset($globalIVAO)) {
152
+			$globalIVAO = FALSE;
153
+		}
154
+		if (!isset($globalVATSIM)) {
155
+			$globalVATSIM = FALSE;
156
+		}
157
+		if (!isset($globalphpVMS)) {
158
+			$globalphpVMS = FALSE;
159
+		}
160
+		if (!isset($globalVAM)) {
161
+			$globalVAM = FALSE;
162
+		}
150 163
 		date_default_timezone_set('UTC');
151 164
 		
152 165
 		if (!is_string($query))
@@ -193,21 +206,35 @@  discard block
 block discarded – undo
193 206
 			} else {
194 207
 				$temp_array['spotter_id'] = '';
195 208
 			}
196
-			if (isset($row['flightaware_id'])) $temp_array['flightaware_id'] = $row['flightaware_id'];
197
-			if (isset($row['modes'])) $temp_array['modes'] = $row['modes'];
209
+			if (isset($row['flightaware_id'])) {
210
+				$temp_array['flightaware_id'] = $row['flightaware_id'];
211
+			}
212
+			if (isset($row['modes'])) {
213
+				$temp_array['modes'] = $row['modes'];
214
+			}
198 215
 			$temp_array['ident'] = $row['ident'];
199 216
 			if (isset($row['registration']) && $row['registration'] != '') {
200 217
 				$temp_array['registration'] = $row['registration'];
201 218
 			} elseif (isset($temp_array['modes'])) {
202 219
 				$temp_array['registration'] = $this->getAircraftRegistrationBymodeS($temp_array['modes']);
203
-			} else $temp_array['registration'] = '';
204
-			if (isset($row['aircraft_icao'])) $temp_array['aircraft_type'] = $row['aircraft_icao'];
220
+			} else {
221
+				$temp_array['registration'] = '';
222
+			}
223
+			if (isset($row['aircraft_icao'])) {
224
+				$temp_array['aircraft_type'] = $row['aircraft_icao'];
225
+			}
205 226
 			
206 227
 			$temp_array['departure_airport'] = $row['departure_airport_icao'];
207 228
 			$temp_array['arrival_airport'] = $row['arrival_airport_icao'];
208
-			if (isset($row['real_arrival_airport_icao']) && $row['real_arrival_airport_icao'] != NULL) $temp_array['real_arrival_airport'] = $row['real_arrival_airport_icao'];
209
-			if (isset($row['latitude'])) $temp_array['latitude'] = $row['latitude'];
210
-			if (isset($row['longitude'])) $temp_array['longitude'] = $row['longitude'];
229
+			if (isset($row['real_arrival_airport_icao']) && $row['real_arrival_airport_icao'] != NULL) {
230
+				$temp_array['real_arrival_airport'] = $row['real_arrival_airport_icao'];
231
+			}
232
+			if (isset($row['latitude'])) {
233
+				$temp_array['latitude'] = $row['latitude'];
234
+			}
235
+			if (isset($row['longitude'])) {
236
+				$temp_array['longitude'] = $row['longitude'];
237
+			}
211 238
 			/*
212 239
 			if (Connection->tableExists('countries')) {
213 240
 				$country_info = $this->getCountryFromLatitudeLongitude($temp_array['latitude'],$temp_array['longitude']);
@@ -217,8 +244,12 @@  discard block
 block discarded – undo
217 244
 				}
218 245
 			}
219 246
 			*/
220
-			if (isset($row['waypoints'])) $temp_array['waypoints'] = $row['waypoints'];
221
-			if (isset($row['format_source'])) $temp_array['format_source'] = $row['format_source'];
247
+			if (isset($row['waypoints'])) {
248
+				$temp_array['waypoints'] = $row['waypoints'];
249
+			}
250
+			if (isset($row['format_source'])) {
251
+				$temp_array['format_source'] = $row['format_source'];
252
+			}
222 253
 			if (isset($row['route_stop'])) {
223 254
 				$temp_array['route_stop'] = $row['route_stop'];
224 255
 				if ($row['route_stop'] != '') {
@@ -237,13 +268,19 @@  discard block
 block discarded – undo
237 268
 					}
238 269
 				}
239 270
 			}
240
-			if (isset($row['altitude'])) $temp_array['altitude'] = $row['altitude'];
271
+			if (isset($row['altitude'])) {
272
+				$temp_array['altitude'] = $row['altitude'];
273
+			}
241 274
 			if (isset($row['heading'])) {
242 275
 				$temp_array['heading'] = $row['heading'];
243 276
 				$heading_direction = $this->parseDirection($row['heading']);
244
-				if (isset($heading_direction[0]['direction_fullname'])) $temp_array['heading_name'] = $heading_direction[0]['direction_fullname'];
277
+				if (isset($heading_direction[0]['direction_fullname'])) {
278
+					$temp_array['heading_name'] = $heading_direction[0]['direction_fullname'];
279
+				}
280
+			}
281
+			if (isset($row['ground_speed'])) {
282
+				$temp_array['ground_speed'] = $row['ground_speed'];
245 283
 			}
246
-			if (isset($row['ground_speed'])) $temp_array['ground_speed'] = $row['ground_speed'];
247 284
 			$temp_array['image'] = "";
248 285
 			$temp_array['image_thumbnail'] = "";
249 286
 			$temp_array['image_source'] = "";
@@ -251,7 +288,9 @@  discard block
 block discarded – undo
251 288
  
252 289
 			if (isset($row['highlight'])) {
253 290
 				$temp_array['highlight'] = $row['highlight'];
254
-			} else $temp_array['highlight'] = '';
291
+			} else {
292
+				$temp_array['highlight'] = '';
293
+			}
255 294
 			
256 295
 			if (isset($row['date'])) {
257 296
 				$dateArray = $this->parseDateString($row['date']);
@@ -299,7 +338,9 @@  discard block
 block discarded – undo
299 338
 				
300 339
 					if ($aircraft_array[0]['aircraft_shadow'] != NULL) {
301 340
 						$temp_array['aircraft_shadow'] = $aircraft_array[0]['aircraft_shadow'];
302
-					} else $temp_array['aircraft_shadow'] = 'default.png';
341
+					} else {
342
+						$temp_array['aircraft_shadow'] = 'default.png';
343
+					}
303 344
                                 } else {
304 345
                             		$temp_array['aircraft_shadow'] = 'default.png';
305 346
 					$temp_array['aircraft_name'] = 'N/A';
@@ -307,11 +348,17 @@  discard block
 block discarded – undo
307 348
                             	}
308 349
 			}
309 350
 			$fromsource = NULL;
310
-			if (isset($globalAirlinesSource) && $globalAirlinesSource != '') $fromsource = $globalAirlinesSource;
311
-			elseif (isset($row['format_source']) && $row['format_source'] == 'vatsimtxt') $fromsource = 'vatsim';
312
-			elseif (isset($row['format_source']) && $row['format_source'] == 'whazzup') $fromsource = 'ivao';
313
-			elseif (isset($globalVATSIM) && $globalVATSIM) $fromsource = 'vatsim';
314
-			elseif (isset($globalIVAO) && $globalIVAO) $fromsource = 'ivao';
351
+			if (isset($globalAirlinesSource) && $globalAirlinesSource != '') {
352
+				$fromsource = $globalAirlinesSource;
353
+			} elseif (isset($row['format_source']) && $row['format_source'] == 'vatsimtxt') {
354
+				$fromsource = 'vatsim';
355
+			} elseif (isset($row['format_source']) && $row['format_source'] == 'whazzup') {
356
+				$fromsource = 'ivao';
357
+			} elseif (isset($globalVATSIM) && $globalVATSIM) {
358
+				$fromsource = 'vatsim';
359
+			} elseif (isset($globalIVAO) && $globalIVAO) {
360
+				$fromsource = 'ivao';
361
+			}
315 362
 			if (!isset($row['airline_name']) || $row['airline_name'] == '') {
316 363
 				if (!is_numeric(substr($row['ident'], 0, 3))) {
317 364
 					if (is_numeric(substr($row['ident'], 2, 1))) {
@@ -334,12 +381,18 @@  discard block
 block discarded – undo
334 381
 				}
335 382
 			} else {
336 383
 				$temp_array['airline_icao'] = $row['airline_icao'];
337
-				if (isset($row['airline_iata'])) $temp_array['airline_iata'] = $row['airline_iata'];
338
-				else $temp_array['airline_iata'] = 'N/A';
384
+				if (isset($row['airline_iata'])) {
385
+					$temp_array['airline_iata'] = $row['airline_iata'];
386
+				} else {
387
+					$temp_array['airline_iata'] = 'N/A';
388
+				}
339 389
 				$temp_array['airline_name'] = $row['airline_name'];
340 390
 				$temp_array['airline_country'] = $row['airline_country'];
341
-				if (isset($row['airline_callsign'])) $temp_array['airline_callsign'] = $row['airline_callsign'];
342
-				else $temp_array['airline_callsign'] = 'N/A';
391
+				if (isset($row['airline_callsign'])) {
392
+					$temp_array['airline_callsign'] = $row['airline_callsign'];
393
+				} else {
394
+					$temp_array['airline_callsign'] = 'N/A';
395
+				}
343 396
 				$temp_array['airline_type'] = $row['airline_type'];
344 397
 				if ($temp_array['airline_icao'] != '' && $temp_array['airline_iata'] == 'N/A') {
345 398
 					$airline_array = $this->getAllAirlineInfo($temp_array['airline_icao']);
@@ -366,7 +419,9 @@  discard block
 block discarded – undo
366 419
 			}
367 420
 			if ($temp_array['registration'] != "" && !$globalIVAO && !$globalVATSIM && !$globalphpVMS && !$globalVAM && !isset($temp_array['aircraft_owner'])) {
368 421
 				$owner_info = $this->getAircraftOwnerByRegistration($temp_array['registration']);
369
-				if ($owner_info['owner'] != '') $temp_array['aircraft_owner'] = ucwords(strtolower($owner_info['owner']));
422
+				if ($owner_info['owner'] != '') {
423
+					$temp_array['aircraft_owner'] = ucwords(strtolower($owner_info['owner']));
424
+				}
370 425
 				$temp_array['aircraft_base'] = $owner_info['base'];
371 426
 				$temp_array['aircraft_date_first_reg'] = $owner_info['date_first_reg'];
372 427
 			}
@@ -374,9 +429,14 @@  discard block
 block discarded – undo
374 429
 			if($temp_array['registration'] != "" || ($globalIVAO && isset($temp_array['aircraft_type']) && $temp_array['aircraft_type'] != ''))
375 430
 			{
376 431
 				if ($globalIVAO) {
377
-					if (isset($temp_array['airline_icao']))	$image_array = $Image->getSpotterImage('',$temp_array['aircraft_type'],$temp_array['airline_icao']);
378
-					else $image_array = $Image->getSpotterImage('',$temp_array['aircraft_type']);
379
-				} else $image_array = $Image->getSpotterImage($temp_array['registration']);
432
+					if (isset($temp_array['airline_icao'])) {
433
+						$image_array = $Image->getSpotterImage('',$temp_array['aircraft_type'],$temp_array['airline_icao']);
434
+					} else {
435
+						$image_array = $Image->getSpotterImage('',$temp_array['aircraft_type']);
436
+					}
437
+				} else {
438
+					$image_array = $Image->getSpotterImage($temp_array['registration']);
439
+				}
380 440
 				if (count($image_array) > 0) {
381 441
 					$temp_array['image'] = $image_array[0]['image'];
382 442
 					$temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail'];
@@ -428,7 +488,9 @@  discard block
 block discarded – undo
428 488
 			//if ($row['departure_airport_icao'] != '' && $row['departure_airport_name'] == '') {
429 489
 			if ($row['departure_airport_icao'] != '') {
430 490
 				$departure_airport_array = $this->getAllAirportInfo($row['departure_airport_icao']);
431
-				if (!isset($departure_airport_array[0]['name'])) $departure_airport_array = $this->getAllAirportInfo('NA');
491
+				if (!isset($departure_airport_array[0]['name'])) {
492
+					$departure_airport_array = $this->getAllAirportInfo('NA');
493
+				}
432 494
 			/*
433 495
 			} elseif ($row['departure_airport_name'] != '') {
434 496
 				$temp_array['departure_airport_name'] = $row['departure_airport_name'];
@@ -436,7 +498,9 @@  discard block
 block discarded – undo
436 498
 				$temp_array['departure_airport_country'] = $row['departure_airport_country'];
437 499
 				$temp_array['departure_airport_icao'] = $row['departure_airport_icao'];
438 500
 			*/
439
-			} else $departure_airport_array = $this->getAllAirportInfo('NA');
501
+			} else {
502
+				$departure_airport_array = $this->getAllAirportInfo('NA');
503
+			}
440 504
 			if (isset($departure_airport_array[0]['name'])) {
441 505
 				$temp_array['departure_airport_name'] = $departure_airport_array[0]['name'];
442 506
 				$temp_array['departure_airport_city'] = $departure_airport_array[0]['city'];
@@ -456,8 +520,12 @@  discard block
 block discarded – undo
456 520
 			
457 521
 			if ($row['arrival_airport_icao'] != '') {
458 522
 				$arrival_airport_array = $this->getAllAirportInfo($row['arrival_airport_icao']);
459
-				if (count($arrival_airport_array) == 0) $arrival_airport_array = $this->getAllAirportInfo('NA');
460
-			} else $arrival_airport_array = $this->getAllAirportInfo('NA');
523
+				if (count($arrival_airport_array) == 0) {
524
+					$arrival_airport_array = $this->getAllAirportInfo('NA');
525
+				}
526
+			} else {
527
+				$arrival_airport_array = $this->getAllAirportInfo('NA');
528
+			}
461 529
 			if (isset($arrival_airport_array[0]['name'])) {
462 530
 				$temp_array['arrival_airport_name'] = $arrival_airport_array[0]['name'];
463 531
 				$temp_array['arrival_airport_city'] = $arrival_airport_array[0]['city'];
@@ -473,27 +541,45 @@  discard block
 block discarded – undo
473 541
 				$temp_array['arrival_airport_time'] = $row['arrival_airport_time'];
474 542
 			}
475 543
 			*/
476
-			if (isset($row['pilot_id']) && $row['pilot_id'] != '') $temp_array['pilot_id'] = $row['pilot_id'];
477
-			if (isset($row['pilot_name']) && $row['pilot_name'] != '') $temp_array['pilot_name'] = $row['pilot_name'];
478
-			if (isset($row['source_name']) && $row['source_name'] != '') $temp_array['source_name'] = $row['source_name'];
479
-			if (isset($row['over_country']) && $row['over_country'] != '') $temp_array['over_country'] = $row['over_country'];
480
-			if (isset($row['distance']) && $row['distance'] != '') $temp_array['distance'] = $row['distance'];
544
+			if (isset($row['pilot_id']) && $row['pilot_id'] != '') {
545
+				$temp_array['pilot_id'] = $row['pilot_id'];
546
+			}
547
+			if (isset($row['pilot_name']) && $row['pilot_name'] != '') {
548
+				$temp_array['pilot_name'] = $row['pilot_name'];
549
+			}
550
+			if (isset($row['source_name']) && $row['source_name'] != '') {
551
+				$temp_array['source_name'] = $row['source_name'];
552
+			}
553
+			if (isset($row['over_country']) && $row['over_country'] != '') {
554
+				$temp_array['over_country'] = $row['over_country'];
555
+			}
556
+			if (isset($row['distance']) && $row['distance'] != '') {
557
+				$temp_array['distance'] = $row['distance'];
558
+			}
481 559
 			if (isset($row['squawk'])) {
482 560
 				$temp_array['squawk'] = $row['squawk'];
483 561
 				if ($row['squawk'] != '' && isset($temp_array['country_iso2'])) {
484 562
 					$temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'],$temp_array['country_iso2']);
485
-					if ($temp_array['squawk_usage'] == '' && isset($globalSquawkCountry)) $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'],$globalSquawkCountry);
563
+					if ($temp_array['squawk_usage'] == '' && isset($globalSquawkCountry)) {
564
+						$temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'],$globalSquawkCountry);
565
+					}
486 566
 				} elseif ($row['squawk'] != '' && isset($temp_array['over_country'])) {
487 567
 					$temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'],$temp_array['over_country']);
488
-					if ($temp_array['squawk_usage'] == '' && isset($globalSquawkCountry)) $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'],$globalSquawkCountry);
489
-				} elseif ($row['squawk'] != '' && isset($globalSquawkCountry)) $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'],$globalSquawkCountry);
568
+					if ($temp_array['squawk_usage'] == '' && isset($globalSquawkCountry)) {
569
+						$temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'],$globalSquawkCountry);
570
+					}
571
+				} elseif ($row['squawk'] != '' && isset($globalSquawkCountry)) {
572
+					$temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'],$globalSquawkCountry);
573
+				}
490 574
 			}
491 575
     			
492 576
 			$temp_array['query_number_rows'] = $num_rows;
493 577
 			
494 578
 			$spotter_array[] = $temp_array;
495 579
 		}
496
-		if ($num_rows == 0) return array();
580
+		if ($num_rows == 0) {
581
+			return array();
582
+		}
497 583
 		$spotter_array[0]['query_number_rows'] = $num_rows;
498 584
 		return $spotter_array;
499 585
 	}	
@@ -526,7 +612,9 @@  discard block
 block discarded – undo
526 612
 				foreach ($q_array as $q_item){
527 613
 					$q_item = filter_var($q_item,FILTER_SANITIZE_STRING);
528 614
 					$additional_query .= " AND (";
529
-					if (is_int($q_item)) $additional_query .= "(spotter_output.spotter_id like '%".$q_item."%') OR ";
615
+					if (is_int($q_item)) {
616
+						$additional_query .= "(spotter_output.spotter_id like '%".$q_item."%') OR ";
617
+					}
530 618
 					$additional_query .= "(spotter_output.aircraft_icao like '%".$q_item."%') OR ";
531 619
 					$additional_query .= "(spotter_output.aircraft_name like '%".$q_item."%') OR ";
532 620
 					$additional_query .= "(spotter_output.aircraft_manufacturer like '%".$q_item."%') OR ";
@@ -547,7 +635,9 @@  discard block
 block discarded – undo
547 635
 					$additional_query .= "(spotter_output.pilot_name like '%".$q_item."%') OR ";
548 636
 					$additional_query .= "(spotter_output.ident like '%".$q_item."%') OR ";
549 637
 					$translate = $Translation->ident2icao($q_item);
550
-					if ($translate != $q_item) $additional_query .= "(spotter_output.ident like '%".$translate."%') OR ";
638
+					if ($translate != $q_item) {
639
+						$additional_query .= "(spotter_output.ident like '%".$translate."%') OR ";
640
+					}
551 641
 					$additional_query .= "(spotter_output.highlight like '%".$q_item."%')";
552 642
 					$additional_query .= ")";
553 643
 				}
@@ -774,7 +864,9 @@  discard block
 block discarded – undo
774 864
 				date_default_timezone_set($globalTimezone);
775 865
 				$datetime = new DateTime();
776 866
 				$offset = $datetime->format('P');
777
-			} else $offset = '+00:00';
867
+			} else {
868
+				$offset = '+00:00';
869
+			}
778 870
 
779 871
 			if ($date_array[1] != "")
780 872
 			{
@@ -806,8 +898,12 @@  discard block
 block discarded – undo
806 898
 			{
807 899
 				//$limit_query = " LIMIT ".$limit_array[0].",".$limit_array[1];
808 900
 				$limit_query = " LIMIT ".$limit_array[1]." OFFSET ".$limit_array[0];
809
-			} else $limit_query = "";
810
-		} else $limit_query = "";
901
+			} else {
902
+				$limit_query = "";
903
+			}
904
+		} else {
905
+			$limit_query = "";
906
+		}
811 907
 
812 908
 
813 909
 		if ($sort != "")
@@ -875,8 +971,12 @@  discard block
 block discarded – undo
875 971
 			{
876 972
 				//$limit_query = " LIMIT ".$limit_array[0].",".$limit_array[1];
877 973
 				$limit_query = " LIMIT ".$limit_array[1]." OFFSET ".$limit_array[0];
878
-			} else $limit_query = "";
879
-		} else $limit_query = "";
974
+			} else {
975
+				$limit_query = "";
976
+			}
977
+		} else {
978
+			$limit_query = "";
979
+		}
880 980
 		
881 981
 		if ($sort != "")
882 982
 		{
@@ -1200,7 +1300,9 @@  discard block
 block discarded – undo
1200 1300
 		global $global_query;
1201 1301
 		
1202 1302
 		date_default_timezone_set('UTC');
1203
-		if ($id == '') return array();
1303
+		if ($id == '') {
1304
+			return array();
1305
+		}
1204 1306
 		$additional_query = "spotter_output.spotter_id = :id";
1205 1307
 		$query_values = array(':id' => $id);
1206 1308
 
@@ -1937,7 +2039,9 @@  discard block
 block discarded – undo
1937 2039
 		{
1938 2040
 			$highlight = $row['highlight'];
1939 2041
 		}
1940
-		if (isset($highlight)) return $highlight;
2042
+		if (isset($highlight)) {
2043
+			return $highlight;
2044
+		}
1941 2045
 	}
1942 2046
 
1943 2047
 	
@@ -1965,7 +2069,9 @@  discard block
 block discarded – undo
1965 2069
 		$sth->closeCursor();
1966 2070
 		if (count($row) > 0) {
1967 2071
 			return $row['usage'];
1968
-		} else return '';
2072
+		} else {
2073
+			return '';
2074
+		}
1969 2075
 	}
1970 2076
 
1971 2077
 	/**
@@ -1990,7 +2096,9 @@  discard block
 block discarded – undo
1990 2096
 		$sth->closeCursor();
1991 2097
 		if (count($row) > 0) {
1992 2098
 			return $row['icao'];
1993
-		} else return '';
2099
+		} else {
2100
+			return '';
2101
+		}
1994 2102
 	}
1995 2103
 
1996 2104
 	/**
@@ -2018,7 +2126,9 @@  discard block
 block discarded – undo
2018 2126
 			$airport_longitude = $row['longitude'];
2019 2127
 			$Common = new Common();
2020 2128
 			return $Common->distance($latitude,$longitude,$airport_latitude,$airport_longitude);
2021
-		} else return '';
2129
+		} else {
2130
+			return '';
2131
+		}
2022 2132
 	}
2023 2133
 	
2024 2134
 	/**
@@ -2130,7 +2240,9 @@  discard block
 block discarded – undo
2130 2240
 			$minlat = filter_var($coord[1],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
2131 2241
 			$maxlong = filter_var($coord[2],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
2132 2242
 			$maxlat = filter_var($coord[3],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
2133
-		} else return array();
2243
+		} else {
2244
+			return array();
2245
+		}
2134 2246
 		if ($globalDBdriver == 'mysql') {
2135 2247
 			$query  = "SELECT airport.* FROM airport WHERE airport.latitude BETWEEN ".$minlat." AND ".$maxlat." AND airport.longitude BETWEEN ".$minlong." AND ".$maxlong." AND airport.type != 'closed'";
2136 2248
 		} else {
@@ -2165,7 +2277,9 @@  discard block
 block discarded – undo
2165 2277
 			$minlat = filter_var($coord[1],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
2166 2278
 			$maxlong = filter_var($coord[2],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
2167 2279
 			$maxlat = filter_var($coord[3],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
2168
-		} else return array();
2280
+		} else {
2281
+			return array();
2282
+		}
2169 2283
 		//$query  = "SELECT waypoints.* FROM waypoints WHERE waypoints.latitude_begin BETWEEN ".$minlat." AND ".$maxlat." AND waypoints.longitude_begin BETWEEN ".$minlong." AND ".$maxlong;
2170 2284
 		$query  = "SELECT waypoints.* FROM waypoints WHERE (waypoints.latitude_begin BETWEEN ".$minlat." AND ".$maxlat." AND waypoints.longitude_begin BETWEEN ".$minlong." AND ".$maxlong.") OR (waypoints.latitude_end BETWEEN ".$minlat." AND ".$maxlat." AND waypoints.longitude_end BETWEEN ".$minlong." AND ".$maxlong.")";
2171 2285
 		//$query  = "SELECT waypoints.* FROM waypoints";
@@ -2200,7 +2314,9 @@  discard block
 block discarded – undo
2200 2314
 	public function getAllAirlineInfo($airline_icao, $fromsource = NULL)
2201 2315
 	{
2202 2316
 		global $globalUseRealAirlines;
2203
-		if (isset($globalUseRealAirlines) && $globalUseRealAirlines) $fromsource = NULL;
2317
+		if (isset($globalUseRealAirlines) && $globalUseRealAirlines) {
2318
+			$fromsource = NULL;
2319
+		}
2204 2320
 		$airline_icao = strtoupper(filter_var($airline_icao,FILTER_SANITIZE_STRING));
2205 2321
 		if ($airline_icao == 'NA') {
2206 2322
 			$airline_array = array();
@@ -2269,7 +2385,9 @@  discard block
 block discarded – undo
2269 2385
 	public function getAllAirlineInfoByName($airline_name, $fromsource = NULL)
2270 2386
 	{
2271 2387
 		global $globalUseRealAirlines;
2272
-		if (isset($globalUseRealAirlines) && $globalUseRealAirlines) $fromsource = NULL;
2388
+		if (isset($globalUseRealAirlines) && $globalUseRealAirlines) {
2389
+			$fromsource = NULL;
2390
+		}
2273 2391
 		$airline_name = strtolower(filter_var($airline_name,FILTER_SANITIZE_STRING));
2274 2392
 		$query  = "SELECT airlines.name, airlines.iata, airlines.icao, airlines.callsign, airlines.country, airlines.type FROM airlines WHERE lower(airlines.name) = :airline_name AND airlines.active = 'Y' AND airlines.forsource IS NULL LIMIT 1";
2275 2393
 		$sth = $this->db->prepare($query);
@@ -2285,7 +2403,9 @@  discard block
 block discarded – undo
2285 2403
 			$sth->execute(array(':fromsource' => $fromsource));
2286 2404
 			$row = $sth->fetch(PDO::FETCH_ASSOC);
2287 2405
 			$sth->closeCursor();
2288
-			if ($row['nb'] == 0) $result = $this->getAllAirlineInfoByName($airline_name);
2406
+			if ($row['nb'] == 0) {
2407
+				$result = $this->getAllAirlineInfoByName($airline_name);
2408
+			}
2289 2409
 		}
2290 2410
 		return $result;
2291 2411
 	}
@@ -2348,15 +2468,20 @@  discard block
 block discarded – undo
2348 2468
 				'A320-211' => 'A320',
2349 2469
 				'747-8i' => 'B748',
2350 2470
 				'A380' => 'A388');
2351
-		if (isset($all_aircraft[$aircraft_type])) return $all_aircraft[$aircraft_type];
2471
+		if (isset($all_aircraft[$aircraft_type])) {
2472
+			return $all_aircraft[$aircraft_type];
2473
+		}
2352 2474
 
2353 2475
 		$query  = "SELECT aircraft.icao FROM aircraft WHERE aircraft.type LIKE :saircraft_type OR aircraft.type = :aircraft_type OR aircraft.icao = :aircraft_type LIMIT 1";
2354 2476
 		$aircraft_type = strtoupper($aircraft_type);
2355 2477
 		$sth = $this->db->prepare($query);
2356 2478
 		$sth->execute(array(':saircraft_type' => '%'.$aircraft_type.'%',':aircraft_type' => $aircraft_type,));
2357 2479
 		$result = $sth->fetchAll(PDO::FETCH_ASSOC);
2358
-		if (isset($result[0]['icao'])) return $result[0]['icao'];
2359
-		else return '';
2480
+		if (isset($result[0]['icao'])) {
2481
+			return $result[0]['icao'];
2482
+		} else {
2483
+			return '';
2484
+		}
2360 2485
 	}
2361 2486
 	
2362 2487
 	/**
@@ -2379,9 +2504,13 @@  discard block
 block discarded – undo
2379 2504
 		$sth->closeCursor();
2380 2505
 		if (isset($row['icaotypecode'])) {
2381 2506
 			$icao = $row['icaotypecode'];
2382
-			if (isset($this->aircraft_correct_icaotype[$icao])) $icao = $this->aircraft_correct_icaotype[$icao];
2507
+			if (isset($this->aircraft_correct_icaotype[$icao])) {
2508
+				$icao = $this->aircraft_correct_icaotype[$icao];
2509
+			}
2383 2510
 			return $icao;
2384
-		} else return '';
2511
+		} else {
2512
+			return '';
2513
+		}
2385 2514
 	}
2386 2515
 
2387 2516
 	/**
@@ -2404,7 +2533,9 @@  discard block
 block discarded – undo
2404 2533
 		$sth->closeCursor();
2405 2534
 		if (isset($row['icaotypecode'])) {
2406 2535
 			return $row['icaotypecode'];
2407
-		} else return '';
2536
+		} else {
2537
+			return '';
2538
+		}
2408 2539
 	}
2409 2540
 
2410 2541
 	/**
@@ -2450,7 +2581,9 @@  discard block
 block discarded – undo
2450 2581
 		$sth->closeCursor();
2451 2582
 		if (isset($row['operator_correct'])) {
2452 2583
 			return $row['operator_correct'];
2453
-		} else return $operator;
2584
+		} else {
2585
+			return $operator;
2586
+		}
2454 2587
 	}
2455 2588
 
2456 2589
 	/**
@@ -2463,7 +2596,9 @@  discard block
 block discarded – undo
2463 2596
 	public function getRouteInfo($callsign)
2464 2597
 	{
2465 2598
 		$callsign = filter_var($callsign,FILTER_SANITIZE_STRING);
2466
-                if ($callsign == '') return array();
2599
+                if ($callsign == '') {
2600
+                	return array();
2601
+                }
2467 2602
 		$query  = "SELECT routes.Operator_ICAO, routes.FromAirport_ICAO, routes.ToAirport_ICAO, routes.RouteStop, routes.FromAirport_Time, routes.ToAirport_Time FROM routes WHERE CallSign = :callsign LIMIT 1";
2468 2603
 		
2469 2604
 		$sth = $this->db->prepare($query);
@@ -2473,7 +2608,9 @@  discard block
 block discarded – undo
2473 2608
 		$sth->closeCursor();
2474 2609
 		if (count($row) > 0) {
2475 2610
 			return $row;
2476
-		} else return array();
2611
+		} else {
2612
+			return array();
2613
+		}
2477 2614
 	}
2478 2615
 	
2479 2616
 	/**
@@ -2526,7 +2663,9 @@  discard block
 block discarded – undo
2526 2663
 			$result = $sth->fetch(PDO::FETCH_ASSOC);
2527 2664
 			$sth->closeCursor();
2528 2665
 			return $result;
2529
-		} else return array();
2666
+		} else {
2667
+			return array();
2668
+		}
2530 2669
 	}
2531 2670
 	
2532 2671
   
@@ -2685,8 +2824,11 @@  discard block
 block discarded – undo
2685 2824
 		$query .= " ORDER BY spotter_output.source_name ASC";
2686 2825
 
2687 2826
 		$sth = $this->db->prepare($query);
2688
-		if (!empty($query_values)) $sth->execute($query_values);
2689
-		else $sth->execute();
2827
+		if (!empty($query_values)) {
2828
+			$sth->execute($query_values);
2829
+		} else {
2830
+			$sth->execute();
2831
+		}
2690 2832
 
2691 2833
 		$source_array = array();
2692 2834
 		$temp_array = array();
@@ -2719,9 +2861,13 @@  discard block
 block discarded – undo
2719 2861
 								WHERE spotter_output.airline_icao <> '' 
2720 2862
 								ORDER BY spotter_output.airline_name ASC";
2721 2863
 			*/
2722
-			if (isset($globalAirlinesSource) && $globalAirlinesSource != '') $forsource = $globalAirlinesSource;
2723
-			elseif (isset($globalVATSIM) && $globalVATSIM) $forsource = 'vatsim';
2724
-			elseif (isset($globalIVAO) && $globalIVAO) $forsource = 'ivao';
2864
+			if (isset($globalAirlinesSource) && $globalAirlinesSource != '') {
2865
+				$forsource = $globalAirlinesSource;
2866
+			} elseif (isset($globalVATSIM) && $globalVATSIM) {
2867
+				$forsource = 'vatsim';
2868
+			} elseif (isset($globalIVAO) && $globalIVAO) {
2869
+				$forsource = 'ivao';
2870
+			}
2725 2871
 			if ($forsource === NULL) {
2726 2872
 				$query = "SELECT DISTINCT icao AS airline_icao, name AS airline_name, type AS airline_type FROM airlines WHERE forsource IS NULL ORDER BY name ASC";
2727 2873
 				$query_data = array();
@@ -2764,9 +2910,13 @@  discard block
 block discarded – undo
2764 2910
 	{
2765 2911
 		global $globalAirlinesSource,$globalVATSIM, $globalIVAO;
2766 2912
 		$filter_query = $this->getFilter($filters,true,true);
2767
-		if (isset($globalAirlinesSource) && $globalAirlinesSource != '') $forsource = $globalAirlinesSource;
2768
-		elseif (isset($globalVATSIM) && $globalVATSIM) $forsource = 'vatsim';
2769
-		elseif (isset($globalIVAO) && $globalIVAO) $forsource = 'ivao';
2913
+		if (isset($globalAirlinesSource) && $globalAirlinesSource != '') {
2914
+			$forsource = $globalAirlinesSource;
2915
+		} elseif (isset($globalVATSIM) && $globalVATSIM) {
2916
+			$forsource = 'vatsim';
2917
+		} elseif (isset($globalIVAO) && $globalIVAO) {
2918
+			$forsource = 'ivao';
2919
+		}
2770 2920
 		if ($forsource === NULL) {
2771 2921
 			$query = "SELECT DISTINCT alliance FROM airlines WHERE alliance IS NOT NULL AND forsource IS NULL ORDER BY alliance ASC";
2772 2922
 			$query_data = array();
@@ -3041,7 +3191,9 @@  discard block
 block discarded – undo
3041 3191
 			date_default_timezone_set($globalTimezone);
3042 3192
 			$datetime = new DateTime();
3043 3193
 			$offset = $datetime->format('P');
3044
-		} else $offset = '+00:00';
3194
+		} else {
3195
+			$offset = '+00:00';
3196
+		}
3045 3197
 		if ($airport_icao == '') {
3046 3198
 			if ($globalDBdriver == 'mysql') {
3047 3199
 				$query = "SELECT COUNT(departure_airport_icao) AS departure_airport_count, departure_airport_icao, departure_airport_name, departure_airport_city, departure_airport_country, DATE_FORMAT(DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)),'%Y-%m-%d') as date FROM `spotter_output`".$filter_query." spotter_output.date >= DATE_SUB(UTC_TIMESTAMP(), INTERVAL 7 DAY) AND departure_airport_icao <> 'NA' AND departure_airport_icao <> '' GROUP BY departure_airport_icao, DATE_FORMAT(DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)),'%Y-%m-%d'), departure_airport_name, departure_airport_city, departure_airport_country ORDER BY departure_airport_count DESC";
@@ -3073,7 +3225,9 @@  discard block
 block discarded – undo
3073 3225
 			date_default_timezone_set($globalTimezone);
3074 3226
 			$datetime = new DateTime();
3075 3227
 			$offset = $datetime->format('P');
3076
-		} else $offset = '+00:00';
3228
+		} else {
3229
+			$offset = '+00:00';
3230
+		}
3077 3231
 		if ($airport_icao == '') {
3078 3232
 			if ($globalDBdriver == 'mysql') {
3079 3233
 				$query = "SELECT spotter_output.airline_icao, COUNT(departure_airport_icao) AS departure_airport_count, departure_airport_icao, departure_airport_name, departure_airport_city, departure_airport_country, DATE_FORMAT(DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)),'%Y-%m-%d') as date FROM `spotter_output` WHERE spotter_output.date >= DATE_SUB(UTC_TIMESTAMP(), INTERVAL 7 DAY) AND departure_airport_icao <> 'NA' AND departure_airport_icao <> '' AND spotter_output.airline_icao <> '' GROUP BY spotter_output.airline_icao, departure_airport_icao, DATE_FORMAT(DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)),'%Y-%m-%d'), departure_airport_name, departure_airport_city, departure_airport_country ORDER BY departure_airport_count DESC";
@@ -3106,7 +3260,9 @@  discard block
 block discarded – undo
3106 3260
 			date_default_timezone_set($globalTimezone);
3107 3261
 			$datetime = new DateTime();
3108 3262
 			$offset = $datetime->format('P');
3109
-		} else $offset = '+00:00';
3263
+		} else {
3264
+			$offset = '+00:00';
3265
+		}
3110 3266
 		if ($airport_icao == '') {
3111 3267
 			if ($globalDBdriver == 'mysql') {
3112 3268
 				$query = "SELECT COUNT(real_departure_airport_icao) AS departure_airport_count, real_departure_airport_icao AS departure_airport_icao, airport.name AS departure_airport_name, airport.city AS departure_airport_city, airport.country AS departure_airport_country, DATE_FORMAT(DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)),'%Y-%m-%d') as date 
@@ -3145,7 +3301,9 @@  discard block
 block discarded – undo
3145 3301
 			date_default_timezone_set($globalTimezone);
3146 3302
 			$datetime = new DateTime();
3147 3303
 			$offset = $datetime->format('P');
3148
-		} else $offset = '+00:00';
3304
+		} else {
3305
+			$offset = '+00:00';
3306
+		}
3149 3307
 		if ($airport_icao == '') {
3150 3308
 			if ($globalDBdriver == 'mysql') {
3151 3309
 				$query = "SELECT spotter_output.airline_icao, COUNT(real_departure_airport_icao) AS departure_airport_count, real_departure_airport_icao AS departure_airport_icao, airport.name AS departure_airport_name, airport.city AS departure_airport_city, airport.country AS departure_airport_country, DATE_FORMAT(DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)),'%Y-%m-%d') as date 
@@ -3190,7 +3348,9 @@  discard block
 block discarded – undo
3190 3348
 			date_default_timezone_set($globalTimezone);
3191 3349
 			$datetime = new DateTime();
3192 3350
 			$offset = $datetime->format('P');
3193
-		} else $offset = '+00:00';
3351
+		} else {
3352
+			$offset = '+00:00';
3353
+		}
3194 3354
 		if ($airport_icao == '') {
3195 3355
 			if ($globalDBdriver == 'mysql') {
3196 3356
 				$query = "SELECT COUNT(arrival_airport_icao) AS arrival_airport_count, arrival_airport_icao, arrival_airport_name, arrival_airport_city, arrival_airport_country, DATE_FORMAT(DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)),'%Y-%m-%d') as date FROM `spotter_output`".$filter_query." spotter_output.date >= DATE_SUB(UTC_TIMESTAMP(), INTERVAL 7 DAY) AND arrival_airport_icao <> 'NA' AND arrival_airport_icao <> '' GROUP BY arrival_airport_icao, DATE_FORMAT(DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)),'%Y-%m-%d'), arrival_airport_name, arrival_airport_city, arrival_airport_country ORDER BY arrival_airport_count DESC";
@@ -3225,7 +3385,9 @@  discard block
 block discarded – undo
3225 3385
 			date_default_timezone_set($globalTimezone);
3226 3386
 			$datetime = new DateTime();
3227 3387
 			$offset = $datetime->format('P');
3228
-		} else $offset = '+00:00';
3388
+		} else {
3389
+			$offset = '+00:00';
3390
+		}
3229 3391
 		if ($airport_icao == '') {
3230 3392
 			if ($globalDBdriver == 'mysql') {
3231 3393
 				$query = "SELECT COUNT(real_arrival_airport_icao) AS arrival_airport_count, real_arrival_airport_icao AS arrival_airport_icao, airport.name AS arrival_airport_name, airport.city AS arrival_airport_city, airport.country AS arrival_airport_country, DATE_FORMAT(DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)),'%Y-%m-%d') as date 
@@ -3267,7 +3429,9 @@  discard block
 block discarded – undo
3267 3429
 			date_default_timezone_set($globalTimezone);
3268 3430
 			$datetime = new DateTime();
3269 3431
 			$offset = $datetime->format('P');
3270
-		} else $offset = '+00:00';
3432
+		} else {
3433
+			$offset = '+00:00';
3434
+		}
3271 3435
 		if ($airport_icao == '') {
3272 3436
 			if ($globalDBdriver == 'mysql') {
3273 3437
 				$query = "SELECT spotter_output.airline_icao, COUNT(arrival_airport_icao) AS arrival_airport_count, arrival_airport_icao, arrival_airport_name, arrival_airport_city, arrival_airport_country, DATE_FORMAT(DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)),'%Y-%m-%d') as date FROM `spotter_output` WHERE spotter_output.date >= DATE_SUB(UTC_TIMESTAMP(), INTERVAL 7 DAY) AND arrival_airport_icao <> 'NA' AND arrival_airport_icao <> '' AND spotter_output.airline_icao <> '' GROUP BY spotter_output.airline_icao, arrival_airport_icao, DATE_FORMAT(DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)),'%Y-%m-%d'), arrival_airport_name, arrival_airport_city, arrival_airport_country ORDER BY arrival_airport_count DESC";
@@ -3301,7 +3465,9 @@  discard block
 block discarded – undo
3301 3465
 			date_default_timezone_set($globalTimezone);
3302 3466
 			$datetime = new DateTime();
3303 3467
 			$offset = $datetime->format('P');
3304
-		} else $offset = '+00:00';
3468
+		} else {
3469
+			$offset = '+00:00';
3470
+		}
3305 3471
 		if ($airport_icao == '') {
3306 3472
 			if ($globalDBdriver == 'mysql') {
3307 3473
 				$query = "SELECT spotter_output.airline_icao, COUNT(real_arrival_airport_icao) AS arrival_airport_count, real_arrival_airport_icao AS arrival_airport_icao, airport.name AS arrival_airport_name, airport.city AS arrival_airport_city, airport.country AS arrival_airport_country, DATE_FORMAT(DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)),'%Y-%m-%d') as date 
@@ -3349,7 +3515,9 @@  discard block
 block discarded – undo
3349 3515
 			date_default_timezone_set($globalTimezone);
3350 3516
 			$datetime = new DateTime();
3351 3517
 			$offset = $datetime->format('P');
3352
-		} else $offset = '+00:00';
3518
+		} else {
3519
+			$offset = '+00:00';
3520
+		}
3353 3521
 
3354 3522
 		if ($globalDBdriver == 'mysql') {
3355 3523
 			$query  = "SELECT DISTINCT DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) as date
@@ -3469,7 +3637,9 @@  discard block
 block discarded – undo
3469 3637
 	*/	
3470 3638
 	public function updateLatestSpotterData($flightaware_id = '', $ident = '', $latitude = '', $longitude = '', $altitude = '', $ground = false, $groundspeed = NULL, $date = '', $arrival_airport_icao = '',$arrival_airport_time = '')
3471 3639
 	{
3472
-		if ($groundspeed == '') $groundspeed = NULL;
3640
+		if ($groundspeed == '') {
3641
+			$groundspeed = NULL;
3642
+		}
3473 3643
 		$query = 'UPDATE spotter_output SET ident = :ident, last_latitude = :last_latitude, last_longitude = :last_longitude, last_altitude = :last_altitude, last_ground = :last_ground, last_seen = :last_seen, real_arrival_airport_icao = :real_arrival_airport_icao, real_arrival_airport_time = :real_arrival_airport_time, last_ground_speed = :last_ground_speed WHERE flightaware_id = :flightaware_id';
3474 3644
                 $query_values = array(':flightaware_id' => $flightaware_id,':real_arrival_airport_icao' => $arrival_airport_icao,':last_latitude' => $latitude,':last_longitude' => $longitude, ':last_altitude' => $altitude,':last_ground_speed' => $groundspeed,':last_seen' => $date,':real_arrival_airport_time' => $arrival_airport_time, ':last_ground' => $ground, ':ident' => $ident);
3475 3645
 
@@ -3519,10 +3689,18 @@  discard block
 block discarded – undo
3519 3689
 		$Image = new Image($this->db);
3520 3690
 		$Common = new Common();
3521 3691
 		
3522
-		if (!isset($globalIVAO)) $globalIVAO = FALSE;
3523
-		if (!isset($globalVATSIM)) $globalVATSIM = FALSE;
3524
-		if (!isset($globalphpVMS)) $globalphpVMS = FALSE;
3525
-		if (!isset($globalVAM)) $globalVAM = FALSE;
3692
+		if (!isset($globalIVAO)) {
3693
+			$globalIVAO = FALSE;
3694
+		}
3695
+		if (!isset($globalVATSIM)) {
3696
+			$globalVATSIM = FALSE;
3697
+		}
3698
+		if (!isset($globalphpVMS)) {
3699
+			$globalphpVMS = FALSE;
3700
+		}
3701
+		if (!isset($globalVAM)) {
3702
+			$globalVAM = FALSE;
3703
+		}
3526 3704
 		date_default_timezone_set('UTC');
3527 3705
 		
3528 3706
 		//getting the registration
@@ -3535,23 +3713,33 @@  discard block
 block discarded – undo
3535 3713
 				if ($ModeS != '') {
3536 3714
 					$timeelapsed = microtime(true);
3537 3715
 					$registration = $this->getAircraftRegistrationBymodeS($ModeS);
3538
-					if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftRegistrationBymodes : '.round(microtime(true)-$timeelapsed,2).'s'."\n";
3716
+					if ($globalDebugTimeElapsed) {
3717
+						echo 'ADD SPOTTER DATA : Time elapsed for getAircraftRegistrationBymodes : '.round(microtime(true)-$timeelapsed,2).'s'."\n";
3718
+					}
3539 3719
 				} else {
3540 3720
 					$myhex = explode('-',$flightaware_id);
3541 3721
 					if (count($myhex) > 0) {
3542 3722
 						$timeelapsed = microtime(true);
3543 3723
 						$registration = $this->getAircraftRegistrationBymodeS($myhex[0]);
3544
-						if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftRegistrationBymodes : '.round(microtime(true)-$timeelapsed,2).'s'."\n";
3724
+						if ($globalDebugTimeElapsed) {
3725
+							echo 'ADD SPOTTER DATA : Time elapsed for getAircraftRegistrationBymodes : '.round(microtime(true)-$timeelapsed,2).'s'."\n";
3726
+						}
3545 3727
 					}
3546 3728
 				}
3547 3729
 			}
3548 3730
 		}
3549 3731
 		$fromsource = NULL;
3550
-		if (isset($globalAirlinesSource) && $globalAirlinesSource != '') $fromsource = $globalAirlinesSource;
3551
-		elseif ($format_source == 'vatsimtxt') $fromsource = 'vatsim';
3552
-		elseif ($format_source == 'whazzup') $fromsource = 'ivao';
3553
-		elseif (isset($globalVATSIM) && $globalVATSIM) $fromsource = 'vatsim';
3554
-		elseif (isset($globalIVAO) && $globalIVAO) $fromsource = 'ivao';
3732
+		if (isset($globalAirlinesSource) && $globalAirlinesSource != '') {
3733
+			$fromsource = $globalAirlinesSource;
3734
+		} elseif ($format_source == 'vatsimtxt') {
3735
+			$fromsource = 'vatsim';
3736
+		} elseif ($format_source == 'whazzup') {
3737
+			$fromsource = 'ivao';
3738
+		} elseif (isset($globalVATSIM) && $globalVATSIM) {
3739
+			$fromsource = 'vatsim';
3740
+		} elseif (isset($globalIVAO) && $globalIVAO) {
3741
+			$fromsource = 'ivao';
3742
+		}
3555 3743
 		//getting the airline information
3556 3744
 		if ($ident != "")
3557 3745
 		{
@@ -3575,15 +3763,21 @@  discard block
 block discarded – undo
3575 3763
 					if (!isset($airline_array[0]['icao']) || $airline_array[0]['icao'] == ""){
3576 3764
 						$airline_array = $this->getAllAirlineInfo("NA");
3577 3765
 					}
3578
-					if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAirlineInfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n";
3766
+					if ($globalDebugTimeElapsed) {
3767
+						echo 'ADD SPOTTER DATA : Time elapsed for getAirlineInfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n";
3768
+					}
3579 3769
 
3580 3770
 				} else {
3581 3771
 					$timeelapsed = microtime(true);
3582 3772
 					$airline_array = $this->getAllAirlineInfo("NA");
3583
-					if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAirlineInfo(NA) : '.round(microtime(true)-$timeelapsed,2).'s'."\n";
3773
+					if ($globalDebugTimeElapsed) {
3774
+						echo 'ADD SPOTTER DATA : Time elapsed for getAirlineInfo(NA) : '.round(microtime(true)-$timeelapsed,2).'s'."\n";
3775
+					}
3584 3776
 				}
3585 3777
 			}
3586
-		} else $airline_array = array();
3778
+		} else {
3779
+			$airline_array = array();
3780
+		}
3587 3781
 		
3588 3782
 		//getting the aircraft information
3589 3783
 		$aircraft_array = array();
@@ -3597,27 +3791,37 @@  discard block
 block discarded – undo
3597 3791
 				{
3598 3792
 					$timeelapsed = microtime(true);
3599 3793
 					$aircraft_array = $this->getAllAircraftInfo("NA");
3600
-					if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo(NA) : '.round(microtime(true)-$timeelapsed,2).'s'."\n";
3794
+					if ($globalDebugTimeElapsed) {
3795
+						echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo(NA) : '.round(microtime(true)-$timeelapsed,2).'s'."\n";
3796
+					}
3601 3797
 				} else {
3602 3798
 					$timeelapsed = microtime(true);
3603 3799
 					$aircraft_array = $this->getAllAircraftInfo($aircraft_icao);
3604
-					if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n";
3800
+					if ($globalDebugTimeElapsed) {
3801
+						echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n";
3802
+					}
3605 3803
 				}
3606 3804
 			}
3607 3805
 		} else {
3608 3806
 			if ($ModeS != '') {
3609 3807
 				$timeelapsed = microtime(true);
3610 3808
 				$aircraft_icao = $this->getAllAircraftType($ModeS);
3611
-				if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAllAircraftType : '.round(microtime(true)-$timeelapsed,2).'s'."\n";
3809
+				if ($globalDebugTimeElapsed) {
3810
+					echo 'ADD SPOTTER DATA : Time elapsed for getAllAircraftType : '.round(microtime(true)-$timeelapsed,2).'s'."\n";
3811
+				}
3612 3812
 				if ($aircraft_icao == "" || $aircraft_icao == "XXXX")
3613 3813
 				{
3614 3814
 					$timeelapsed = microtime(true);
3615 3815
 					$aircraft_array = $this->getAllAircraftInfo("NA");
3616
-					if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo(NA) : '.round(microtime(true)-$timeelapsed,2).'s'."\n";
3816
+					if ($globalDebugTimeElapsed) {
3817
+						echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo(NA) : '.round(microtime(true)-$timeelapsed,2).'s'."\n";
3818
+					}
3617 3819
 				} else {
3618 3820
 					$timeelapsed = microtime(true);
3619 3821
 					$aircraft_array = $this->getAllAircraftInfo($aircraft_icao);
3620
-					if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n";
3822
+					if ($globalDebugTimeElapsed) {
3823
+						echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n";
3824
+					}
3621 3825
 				}
3622 3826
 			}
3623 3827
 		}
@@ -3633,7 +3837,9 @@  discard block
 block discarded – undo
3633 3837
 			} else {
3634 3838
 				$timeelapsed = microtime(true);
3635 3839
 				$departure_airport_array = $this->getAllAirportInfo($departure_airport_icao);
3636
-				if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAllAirportInfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n";
3840
+				if ($globalDebugTimeElapsed) {
3841
+					echo 'ADD SPOTTER DATA : Time elapsed for getAllAirportInfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n";
3842
+				}
3637 3843
 			}
3638 3844
 		}
3639 3845
 		
@@ -3648,7 +3854,9 @@  discard block
 block discarded – undo
3648 3854
 			} else {
3649 3855
 				$timeelapsed = microtime(true);
3650 3856
 				$arrival_airport_array = $this->getAllAirportInfo($arrival_airport_icao);
3651
-				if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAllAirportInfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n";
3857
+				if ($globalDebugTimeElapsed) {
3858
+					echo 'ADD SPOTTER DATA : Time elapsed for getAllAirportInfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n";
3859
+				}
3652 3860
 			}
3653 3861
 		}
3654 3862
 
@@ -3682,7 +3890,9 @@  discard block
 block discarded – undo
3682 3890
 			{
3683 3891
 				return false;
3684 3892
 			}
3685
-		} else $altitude = 0;
3893
+		} else {
3894
+			$altitude = 0;
3895
+		}
3686 3896
 		
3687 3897
 		if ($heading != "")
3688 3898
 		{
@@ -3711,7 +3921,9 @@  discard block
 block discarded – undo
3711 3921
 		{
3712 3922
 			$timeelapsed = microtime(true);
3713 3923
 			$image_array = $Image->getSpotterImage($registration);
3714
-			if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getSpotterImage : '.round(microtime(true)-$timeelapsed,2).'s'."\n";
3924
+			if ($globalDebugTimeElapsed) {
3925
+				echo 'ADD SPOTTER DATA : Time elapsed for getSpotterImage : '.round(microtime(true)-$timeelapsed,2).'s'."\n";
3926
+			}
3715 3927
 			if (!isset($image_array[0]['registration']))
3716 3928
 			{
3717 3929
 				//echo "Add image !!!! \n";
@@ -3719,14 +3931,21 @@  discard block
 block discarded – undo
3719 3931
 			}
3720 3932
 			$timeelapsed = microtime(true);
3721 3933
 			$owner_info = $this->getAircraftOwnerByRegistration($registration);
3722
-			if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftOwnerByRegistration : '.round(microtime(true)-$timeelapsed,2).'s'."\n";
3723
-			if ($owner_info['owner'] != '') $aircraft_owner = ucwords(strtolower($owner_info['owner']));
3934
+			if ($globalDebugTimeElapsed) {
3935
+				echo 'ADD SPOTTER DATA : Time elapsed for getAircraftOwnerByRegistration : '.round(microtime(true)-$timeelapsed,2).'s'."\n";
3936
+			}
3937
+			if ($owner_info['owner'] != '') {
3938
+				$aircraft_owner = ucwords(strtolower($owner_info['owner']));
3939
+			}
3724 3940
 		}
3725 3941
     
3726 3942
 		if ($globalIVAO && $aircraft_icao != '')
3727 3943
 		{
3728
-            		if (isset($airline_array[0]['icao'])) $airline_icao = $airline_array[0]['icao'];
3729
-            		else $airline_icao = '';
3944
+            		if (isset($airline_array[0]['icao'])) {
3945
+            			$airline_icao = $airline_array[0]['icao'];
3946
+            		} else {
3947
+            			$airline_icao = '';
3948
+            		}
3730 3949
 			$image_array = $Image->getSpotterImage('',$aircraft_icao,$airline_icao);
3731 3950
 			if (!isset($image_array[0]['registration']))
3732 3951
 			{
@@ -3771,16 +3990,28 @@  discard block
 block discarded – undo
3771 3990
                 {
3772 3991
                         $arrival_airport_array = $this->getAllAirportInfo('NA');
3773 3992
                 }
3774
-                if ($registration == '') $registration = 'NA';
3993
+                if ($registration == '') {
3994
+                	$registration = 'NA';
3995
+                }
3775 3996
                 if ($latitude == '' && $longitude == '') {
3776 3997
             		$latitude = 0;
3777 3998
             		$longitude = 0;
3778 3999
             	}
3779
-                if ($squawk == '' || $Common->isInteger($squawk) === false) $squawk = NULL;
3780
-                if ($verticalrate == '' || $Common->isInteger($verticalrate) === false) $verticalrate = NULL;
3781
-                if ($heading == '' || $Common->isInteger($heading) === false) $heading = 0;
3782
-                if ($groundspeed == '' || $Common->isInteger($groundspeed) === false) $groundspeed = 0;
3783
-                if (!isset($aircraft_owner)) $aircraft_owner = NULL;
4000
+                if ($squawk == '' || $Common->isInteger($squawk) === false) {
4001
+                	$squawk = NULL;
4002
+                }
4003
+                if ($verticalrate == '' || $Common->isInteger($verticalrate) === false) {
4004
+                	$verticalrate = NULL;
4005
+                }
4006
+                if ($heading == '' || $Common->isInteger($heading) === false) {
4007
+                	$heading = 0;
4008
+                }
4009
+                if ($groundspeed == '' || $Common->isInteger($groundspeed) === false) {
4010
+                	$groundspeed = 0;
4011
+                }
4012
+                if (!isset($aircraft_owner)) {
4013
+                	$aircraft_owner = NULL;
4014
+                }
3784 4015
                 $query  = "INSERT INTO spotter_output (flightaware_id, ident, registration, airline_name, airline_icao, airline_country, airline_type, aircraft_icao, aircraft_name, aircraft_manufacturer, departure_airport_icao, departure_airport_name, departure_airport_city, departure_airport_country, arrival_airport_icao, arrival_airport_name, arrival_airport_city, arrival_airport_country, latitude, longitude, waypoints, altitude, heading, ground_speed, date, departure_airport_time, arrival_airport_time, squawk, route_stop,highlight,ModeS, pilot_id, pilot_name, verticalrate, owner_name, ground, format_source, source_name) 
3785 4016
                 VALUES (:flightaware_id,:ident,:registration,:airline_name,:airline_icao,:airline_country,:airline_type,:aircraft_icao,:aircraft_type,:aircraft_manufacturer,:departure_airport_icao,:departure_airport_name,:departure_airport_city,:departure_airport_country, :arrival_airport_icao, :arrival_airport_name, :arrival_airport_city, :arrival_airport_country, :latitude,:longitude,:waypoints,:altitude,:heading,:groundspeed,:date, :departure_airport_time, :arrival_airport_time, :squawk, :route_stop, :highlight, :ModeS, :pilot_id, :pilot_name, :verticalrate, :owner_name,:ground, :format_source, :source_name)";
3786 4017
 
@@ -3791,9 +4022,13 @@  discard block
 block discarded – undo
3791 4022
 		if ($airline_type == '') {
3792 4023
 			$timeelapsed = microtime(true);
3793 4024
 			$airline_type = $this->getAircraftTypeBymodeS($ModeS);
3794
-			if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftTypeBymodes : '.round(microtime(true)-$timeelapsed,2).'s'."\n";
4025
+			if ($globalDebugTimeElapsed) {
4026
+				echo 'ADD SPOTTER DATA : Time elapsed for getAircraftTypeBymodes : '.round(microtime(true)-$timeelapsed,2).'s'."\n";
4027
+			}
4028
+		}
4029
+		if ($airline_type == null) {
4030
+			$airline_type = '';
3795 4031
 		}
3796
-		if ($airline_type == null) $airline_type = '';
3797 4032
                 $aircraft_type = $aircraft_array[0]['type'];
3798 4033
                 $aircraft_manufacturer = $aircraft_array[0]['manufacturer'];
3799 4034
                 $departure_airport_name = $departure_airport_array[0]['name'];
@@ -3957,7 +4192,9 @@  discard block
 block discarded – undo
3957 4192
 			}
3958 4193
 		}
3959 4194
 		$query .= " GROUP BY spotter_output.airline_name,spotter_output.airline_icao, spotter_output.airline_country ORDER BY airline_count DESC";
3960
-		if ($limit) $query .= " LIMIT 10 OFFSET 0";
4195
+		if ($limit) {
4196
+			$query .= " LIMIT 10 OFFSET 0";
4197
+		}
3961 4198
 
3962 4199
 		$sth = $this->db->prepare($query);
3963 4200
 		$sth->execute($query_values);
@@ -4030,7 +4267,9 @@  discard block
 block discarded – undo
4030 4267
 		}
4031 4268
 		
4032 4269
 		$query .= "GROUP BY spotter_output.pilot_id,spotter_output.pilot_name,spotter_output.format_source ORDER BY pilot_count DESC";
4033
-		if ($limit) $query .= " LIMIT 10 OFFSET 0";
4270
+		if ($limit) {
4271
+			$query .= " LIMIT 10 OFFSET 0";
4272
+		}
4034 4273
       
4035 4274
 		
4036 4275
 		$sth = $this->db->prepare($query);
@@ -4074,7 +4313,9 @@  discard block
 block discarded – undo
4074 4313
 			}
4075 4314
 		}
4076 4315
 		$query .= "GROUP BY spotter_output.airline_icao, spotter_output.pilot_id,spotter_output.pilot_name,spotter_output.format_source ORDER BY pilot_count DESC";
4077
-		if ($limit) $query .= " LIMIT 10 OFFSET 0";
4316
+		if ($limit) {
4317
+			$query .= " LIMIT 10 OFFSET 0";
4318
+		}
4078 4319
       
4079 4320
 		
4080 4321
 		$sth = $this->db->prepare($query);
@@ -4150,7 +4391,9 @@  discard block
 block discarded – undo
4150 4391
 			}
4151 4392
 		}
4152 4393
 		$query .= " GROUP BY spotter_output.owner_name ORDER BY owner_count DESC";
4153
-		if ($limit) $query .= " LIMIT 10 OFFSET 0";
4394
+		if ($limit) {
4395
+			$query .= " LIMIT 10 OFFSET 0";
4396
+		}
4154 4397
 		
4155 4398
 		$sth = $this->db->prepare($query);
4156 4399
 		$sth->execute($query_values);
@@ -4192,7 +4435,9 @@  discard block
 block discarded – undo
4192 4435
 			}
4193 4436
 		}
4194 4437
 		$query .= "GROUP BY spotter_output.airline_icao, spotter_output.owner_name ORDER BY owner_count DESC";
4195
-		if ($limit) $query .= " LIMIT 10 OFFSET 0";
4438
+		if ($limit) {
4439
+			$query .= " LIMIT 10 OFFSET 0";
4440
+		}
4196 4441
       
4197 4442
 		
4198 4443
 		$sth = $this->db->prepare($query);
@@ -4435,7 +4680,9 @@  discard block
 block discarded – undo
4435 4680
 			date_default_timezone_set($globalTimezone);
4436 4681
 			$datetime = new DateTime($date);
4437 4682
 			$offset = $datetime->format('P');
4438
-		} else $offset = '+00:00';
4683
+		} else {
4684
+			$offset = '+00:00';
4685
+		}
4439 4686
 
4440 4687
 		if ($globalDBdriver == 'mysql') {
4441 4688
 			$query  = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count
@@ -4483,7 +4730,9 @@  discard block
 block discarded – undo
4483 4730
 			date_default_timezone_set($globalTimezone);
4484 4731
 			$datetime = new DateTime($date);
4485 4732
 			$offset = $datetime->format('P');
4486
-		} else $offset = '+00:00';
4733
+		} else {
4734
+			$offset = '+00:00';
4735
+		}
4487 4736
 		
4488 4737
 		if ($globalDBdriver == 'mysql') {
4489 4738
 			$query  = "SELECT DISTINCT spotter_output.airline_country, COUNT(spotter_output.airline_country) AS airline_country_count
@@ -4759,7 +5008,9 @@  discard block
 block discarded – undo
4759 5008
 		}
4760 5009
 		$query .= " GROUP BY spotter_output.airline_country
4761 5010
 					ORDER BY airline_country_count DESC";
4762
-		if ($limit) $query .= " LIMIT 10 OFFSET 0";
5011
+		if ($limit) {
5012
+			$query .= " LIMIT 10 OFFSET 0";
5013
+		}
4763 5014
       
4764 5015
 		$sth = $this->db->prepare($query);
4765 5016
 		$sth->execute($query_values);
@@ -4787,7 +5038,9 @@  discard block
 block discarded – undo
4787 5038
 		global $globalDBdriver;
4788 5039
 		//$filter_query = $this->getFilter($filters,true,true);
4789 5040
 		$Connection= new Connection($this->db);
4790
-		if (!$Connection->tableExists('countries')) return array();
5041
+		if (!$Connection->tableExists('countries')) {
5042
+			return array();
5043
+		}
4791 5044
 		/*
4792 5045
 		$query = "SELECT c.name, c.iso3, c.iso2, count(c.name) as nb 
4793 5046
 					FROM countries c, spotter_output s
@@ -4819,7 +5072,9 @@  discard block
 block discarded – undo
4819 5072
 		}
4820 5073
 		$query = "SELECT c.name, c.iso3, c.iso2, count(c.name) as nb FROM countries c INNER JOIN (SELECT DISTINCT flightaware_id,over_country FROM spotter_live".$filter_query.") l ON c.iso2 = l.over_country ";
4821 5074
 		$query .= "GROUP BY c.name,c.iso3,c.iso2 ORDER BY nb DESC";
4822
-		if ($limit) $query .= " LIMIT 10 OFFSET 0";
5075
+		if ($limit) {
5076
+			$query .= " LIMIT 10 OFFSET 0";
5077
+		}
4823 5078
       
4824 5079
 		
4825 5080
 		$sth = $this->db->prepare($query);
@@ -4896,7 +5151,9 @@  discard block
 block discarded – undo
4896 5151
 		}
4897 5152
 
4898 5153
 		$query .= " GROUP BY spotter_output.aircraft_icao, spotter_output.aircraft_name, spotter_output.aircraft_manufacturer ORDER BY aircraft_icao_count DESC";
4899
-		if ($limit) $query .= " LIMIT 10 OFFSET 0";
5154
+		if ($limit) {
5155
+			$query .= " LIMIT 10 OFFSET 0";
5156
+		}
4900 5157
  
4901 5158
 		$sth = $this->db->prepare($query);
4902 5159
 		$sth->execute($query_values);
@@ -4970,7 +5227,9 @@  discard block
 block discarded – undo
4970 5227
 		}
4971 5228
 
4972 5229
 		$query .= "GROUP BY spotter_output.airline_icao, spotter_output.aircraft_icao, spotter_output.aircraft_name, spotter_output.aircraft_manufacturer ORDER BY aircraft_icao_count DESC";
4973
-		if ($limit) $query .= " LIMIT 10 OFFSET 0";
5230
+		if ($limit) {
5231
+			$query .= " LIMIT 10 OFFSET 0";
5232
+		}
4974 5233
  
4975 5234
 		$sth = $this->db->prepare($query);
4976 5235
 		$sth->execute($query_values);
@@ -5017,7 +5276,9 @@  discard block
 block discarded – undo
5017 5276
 		}
5018 5277
 
5019 5278
 		$query .= "GROUP BY EXTRACT(month from spotter_output.date), EXTRACT(year from spotter_output.date), spotter_output.aircraft_icao, spotter_output.aircraft_name, spotter_output.aircraft_manufacturer ORDER BY aircraft_icao_count DESC";
5020
-		if ($limit) $query .= " LIMIT 10 OFFSET 0";
5279
+		if ($limit) {
5280
+			$query .= " LIMIT 10 OFFSET 0";
5281
+		}
5021 5282
  
5022 5283
 		$sth = $this->db->prepare($query);
5023 5284
 		$sth->execute();
@@ -5070,7 +5331,9 @@  discard block
 block discarded – undo
5070 5331
 			if($row['registration'] != "")
5071 5332
 			{
5072 5333
 				$image_array = $Image->getSpotterImage($row['registration']);
5073
-				if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail'];
5334
+				if (isset($image_array[0]['image_thumbnail'])) {
5335
+					$temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail'];
5336
+				}
5074 5337
 			}
5075 5338
 			$temp_array['registration_count'] = $row['registration_count'];
5076 5339
 
@@ -5145,7 +5408,9 @@  discard block
 block discarded – undo
5145 5408
 			if($row['registration'] != "")
5146 5409
 			{
5147 5410
 				$image_array = $Image->getSpotterImage($row['registration']);
5148
-				if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail'];
5411
+				if (isset($image_array[0]['image_thumbnail'])) {
5412
+					$temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail'];
5413
+				}
5149 5414
 			}
5150 5415
 			$temp_array['registration_count'] = $row['registration_count'];
5151 5416
 
@@ -5252,7 +5517,9 @@  discard block
 block discarded – undo
5252 5517
 			if($row['registration'] != "")
5253 5518
 			{
5254 5519
 				$image_array = $Image->getSpotterImage($row['registration']);
5255
-				if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail'];
5520
+				if (isset($image_array[0]['image_thumbnail'])) {
5521
+					$temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail'];
5522
+				}
5256 5523
 			}
5257 5524
 			$temp_array['registration_count'] = $row['registration_count'];
5258 5525
 			$aircraft_array[] = $temp_array;
@@ -5377,7 +5644,9 @@  discard block
 block discarded – undo
5377 5644
 			date_default_timezone_set($globalTimezone);
5378 5645
 			$datetime = new DateTime($date);
5379 5646
 			$offset = $datetime->format('P');
5380
-		} else $offset = '+00:00';
5647
+		} else {
5648
+			$offset = '+00:00';
5649
+		}
5381 5650
 
5382 5651
 		if ($globalDBdriver == 'mysql') {
5383 5652
 			$query  = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name  
@@ -5424,7 +5693,9 @@  discard block
 block discarded – undo
5424 5693
 			date_default_timezone_set($globalTimezone);
5425 5694
 			$datetime = new DateTime($date);
5426 5695
 			$offset = $datetime->format('P');
5427
-		} else $offset = '+00:00';
5696
+		} else {
5697
+			$offset = '+00:00';
5698
+		}
5428 5699
 
5429 5700
 		if ($globalDBdriver == 'mysql') {
5430 5701
 			$query  = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.registration) AS registration_count, spotter_output.aircraft_name, spotter_output.registration, spotter_output.airline_name 
@@ -5453,7 +5724,9 @@  discard block
 block discarded – undo
5453 5724
 			if($row['registration'] != "")
5454 5725
 			{
5455 5726
 				$image_array = $Image->getSpotterImage($row['registration']);
5456
-				if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail'];
5727
+				if (isset($image_array[0]['image_thumbnail'])) {
5728
+					$temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail'];
5729
+				}
5457 5730
 			}
5458 5731
 			$temp_array['registration_count'] = $row['registration_count'];
5459 5732
  
@@ -5478,7 +5751,9 @@  discard block
 block discarded – undo
5478 5751
 			date_default_timezone_set($globalTimezone);
5479 5752
 			$datetime = new DateTime($date);
5480 5753
 			$offset = $datetime->format('P');
5481
-		} else $offset = '+00:00';
5754
+		} else {
5755
+			$offset = '+00:00';
5756
+		}
5482 5757
 
5483 5758
 		if ($globalDBdriver == 'mysql') {
5484 5759
 			$query  = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count  
@@ -5616,8 +5891,11 @@  discard block
 block discarded – undo
5616 5891
 			if($row['registration'] != "")
5617 5892
 			{
5618 5893
 				$image_array = $Image->getSpotterImage($row['registration']);
5619
-				if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail'];
5620
-				else $temp_array['image_thumbnail'] = '';
5894
+				if (isset($image_array[0]['image_thumbnail'])) {
5895
+					$temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail'];
5896
+				} else {
5897
+					$temp_array['image_thumbnail'] = '';
5898
+				}
5621 5899
 			}
5622 5900
 			$temp_array['registration_count'] = $row['registration_count'];
5623 5901
 			$aircraft_array[] = $temp_array;
@@ -5660,8 +5938,11 @@  discard block
 block discarded – undo
5660 5938
 			if($row['registration'] != "")
5661 5939
 			{
5662 5940
 				$image_array = $Image->getSpotterImage($row['registration']);
5663
-				if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail'];
5664
-				else $temp_array['image_thumbnail'] = '';
5941
+				if (isset($image_array[0]['image_thumbnail'])) {
5942
+					$temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail'];
5943
+				} else {
5944
+					$temp_array['image_thumbnail'] = '';
5945
+				}
5665 5946
 			}
5666 5947
 			$temp_array['registration_count'] = $row['registration_count'];
5667 5948
 			$aircraft_array[] = $temp_array;
@@ -5704,8 +5985,11 @@  discard block
 block discarded – undo
5704 5985
 			if($row['registration'] != "")
5705 5986
 			{
5706 5987
 				$image_array = $Image->getSpotterImage($row['registration']);
5707
-				if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail'];
5708
-				else $temp_array['image_thumbnail'] = '';
5988
+				if (isset($image_array[0]['image_thumbnail'])) {
5989
+					$temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail'];
5990
+				} else {
5991
+					$temp_array['image_thumbnail'] = '';
5992
+				}
5709 5993
 			}
5710 5994
 			$temp_array['registration_count'] = $row['registration_count'];
5711 5995
 			$aircraft_array[] = $temp_array;
@@ -5854,7 +6138,9 @@  discard block
 block discarded – undo
5854 6138
 			if($row['registration'] != "")
5855 6139
 			{
5856 6140
 				$image_array = $Image->getSpotterImage($row['registration']);
5857
-				if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail'];
6141
+				if (isset($image_array[0]['image_thumbnail'])) {
6142
+					$temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail'];
6143
+				}
5858 6144
 			}
5859 6145
 			$temp_array['registration_count'] = $row['registration_count'];
5860 6146
           
@@ -5971,7 +6257,9 @@  discard block
 block discarded – undo
5971 6257
 			if($row['registration'] != "")
5972 6258
 			{
5973 6259
 				$image_array = $Image->getSpotterImage($row['registration']);
5974
-				if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail'];
6260
+				if (isset($image_array[0]['image_thumbnail'])) {
6261
+					$temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail'];
6262
+				}
5975 6263
 			}
5976 6264
 			$temp_array['registration_count'] = $row['registration_count'];
5977 6265
           
@@ -6137,7 +6425,9 @@  discard block
 block discarded – undo
6137 6425
 			}
6138 6426
 		}
6139 6427
 		$query .= " GROUP BY spotter_output.registration, spotter_output.aircraft_icao, spotter_output.aircraft_name, spotter_output.airline_name ORDER BY aircraft_registration_count DESC";
6140
-		if ($limit) $query .= " LIMIT 10 OFFSET 0";
6428
+		if ($limit) {
6429
+			$query .= " LIMIT 10 OFFSET 0";
6430
+		}
6141 6431
 		
6142 6432
 		$sth = $this->db->prepare($query);
6143 6433
 		$sth->execute($query_values);
@@ -6156,7 +6446,9 @@  discard block
 block discarded – undo
6156 6446
 			if($row['registration'] != "")
6157 6447
 			{
6158 6448
 				$image_array = $Image->getSpotterImage($row['registration']);
6159
-				if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail'];
6449
+				if (isset($image_array[0]['image_thumbnail'])) {
6450
+					$temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail'];
6451
+				}
6160 6452
 			}
6161 6453
           
6162 6454
 			$aircraft_array[] = $temp_array;
@@ -6197,7 +6489,9 @@  discard block
 block discarded – undo
6197 6489
 		// if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
6198 6490
 		//if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
6199 6491
                 $query .= "GROUP BY spotter_output.airline_icao, spotter_output.registration, spotter_output.aircraft_icao, spotter_output.aircraft_name, spotter_output.airline_name ORDER BY aircraft_registration_count DESC";
6200
-		if ($limit) $query .= " LIMIT 10 OFFSET 0";
6492
+		if ($limit) {
6493
+			$query .= " LIMIT 10 OFFSET 0";
6494
+		}
6201 6495
 		
6202 6496
 		$sth = $this->db->prepare($query);
6203 6497
 		$sth->execute();
@@ -6217,7 +6511,9 @@  discard block
 block discarded – undo
6217 6511
 			if($row['registration'] != "")
6218 6512
 			{
6219 6513
 				$image_array = $Image->getSpotterImage($row['registration']);
6220
-				if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail'];
6514
+				if (isset($image_array[0]['image_thumbnail'])) {
6515
+					$temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail'];
6516
+				}
6221 6517
 			}
6222 6518
           
6223 6519
 			$aircraft_array[] = $temp_array;
@@ -6283,7 +6579,9 @@  discard block
 block discarded – undo
6283 6579
 		}
6284 6580
                 $query .= " GROUP BY spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country
6285 6581
 				ORDER BY airport_departure_icao_count DESC";
6286
-		if ($limit) $query .= " LIMIT 10 OFFSET 0";
6582
+		if ($limit) {
6583
+			$query .= " LIMIT 10 OFFSET 0";
6584
+		}
6287 6585
 
6288 6586
 		$sth = $this->db->prepare($query);
6289 6587
 		$sth->execute($query_values);
@@ -6334,7 +6632,9 @@  discard block
 block discarded – undo
6334 6632
                 //if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
6335 6633
                 $query .= "GROUP BY spotter_output.airline_icao, spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country
6336 6634
 				ORDER BY airport_departure_icao_count DESC";
6337
-		if ($limit) $query .= " LIMIT 10 OFFSET 0";
6635
+		if ($limit) {
6636
+			$query .= " LIMIT 10 OFFSET 0";
6637
+		}
6338 6638
       
6339 6639
 		$sth = $this->db->prepare($query);
6340 6640
 		$sth->execute();
@@ -6412,7 +6712,9 @@  discard block
 block discarded – undo
6412 6712
 		}
6413 6713
                 $query .= " GROUP BY spotter_output.real_departure_airport_icao, airport.name, airport.city, airport.country
6414 6714
 				ORDER BY airport_departure_icao_count DESC";
6415
-		if ($limit) $query .= " LIMIT 10 OFFSET 0";
6715
+		if ($limit) {
6716
+			$query .= " LIMIT 10 OFFSET 0";
6717
+		}
6416 6718
     		//echo $query;
6417 6719
 		$sth = $this->db->prepare($query);
6418 6720
 		$sth->execute($query_values);
@@ -6464,7 +6766,9 @@  discard block
 block discarded – undo
6464 6766
                 //if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
6465 6767
                 $query .= "GROUP BY spotter_output.airline_icao, spotter_output.real_departure_airport_icao, airport.name, airport.city, airport.country
6466 6768
 				ORDER BY airport_departure_icao_count DESC";
6467
-		if ($limit) $query .= " LIMIT 10 OFFSET 0";
6769
+		if ($limit) {
6770
+			$query .= " LIMIT 10 OFFSET 0";
6771
+		}
6468 6772
       
6469 6773
 		$sth = $this->db->prepare($query);
6470 6774
 		$sth->execute();
@@ -6859,7 +7163,9 @@  discard block
 block discarded – undo
6859 7163
 			date_default_timezone_set($globalTimezone);
6860 7164
 			$datetime = new DateTime($date);
6861 7165
 			$offset = $datetime->format('P');
6862
-		} else $offset = '+00:00';
7166
+		} else {
7167
+			$offset = '+00:00';
7168
+		}
6863 7169
 
6864 7170
 		if ($globalDBdriver == 'mysql') {
6865 7171
 			$query  = "SELECT DISTINCT spotter_output.departure_airport_icao, COUNT(spotter_output.departure_airport_icao) AS airport_departure_icao_count, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country 
@@ -6909,7 +7215,9 @@  discard block
 block discarded – undo
6909 7215
 			date_default_timezone_set($globalTimezone);
6910 7216
 			$datetime = new DateTime($date);
6911 7217
 			$offset = $datetime->format('P');
6912
-		} else $offset = '+00:00';
7218
+		} else {
7219
+			$offset = '+00:00';
7220
+		}
6913 7221
 
6914 7222
 		if ($globalDBdriver == 'mysql') {
6915 7223
 			$query  = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count 
@@ -7258,7 +7566,9 @@  discard block
 block discarded – undo
7258 7566
 		}
7259 7567
                 $query .= " GROUP BY spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country
7260 7568
 					ORDER BY airport_arrival_icao_count DESC";
7261
-		if ($limit) $query .= " LIMIT 10";
7569
+		if ($limit) {
7570
+			$query .= " LIMIT 10";
7571
+		}
7262 7572
       
7263 7573
 		
7264 7574
 		$sth = $this->db->prepare($query);
@@ -7278,7 +7588,9 @@  discard block
 block discarded – undo
7278 7588
 			if ($icaoaskey) {
7279 7589
 				$icao = $row['arrival_airport_icao'];
7280 7590
 				$airport_array[$icao] = $temp_array;
7281
-			} else $airport_array[] = $temp_array;
7591
+			} else {
7592
+				$airport_array[] = $temp_array;
7593
+			}
7282 7594
 		}
7283 7595
 
7284 7596
 		return $airport_array;
@@ -7315,7 +7627,9 @@  discard block
 block discarded – undo
7315 7627
                 //if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
7316 7628
                 $query .= "GROUP BY spotter_output.airline_icao,spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country
7317 7629
 					ORDER BY airport_arrival_icao_count DESC";
7318
-		if ($limit) $query .= " LIMIT 10";
7630
+		if ($limit) {
7631
+			$query .= " LIMIT 10";
7632
+		}
7319 7633
       
7320 7634
 		
7321 7635
 		$sth = $this->db->prepare($query);
@@ -7336,7 +7650,9 @@  discard block
 block discarded – undo
7336 7650
 			if ($icaoaskey) {
7337 7651
 				$icao = $row['arrival_airport_icao'];
7338 7652
 				$airport_array[$icao] = $temp_array;
7339
-			} else $airport_array[] = $temp_array;
7653
+			} else {
7654
+				$airport_array[] = $temp_array;
7655
+			}
7340 7656
 		}
7341 7657
 
7342 7658
 		return $airport_array;
@@ -7399,7 +7715,9 @@  discard block
 block discarded – undo
7399 7715
 		}
7400 7716
                 $query .= " GROUP BY spotter_output.real_arrival_airport_icao, airport.name, airport.city, airport.country
7401 7717
 					ORDER BY airport_arrival_icao_count DESC";
7402
-		if ($limit) $query .= " LIMIT 10";
7718
+		if ($limit) {
7719
+			$query .= " LIMIT 10";
7720
+		}
7403 7721
       
7404 7722
 		
7405 7723
 		$sth = $this->db->prepare($query);
@@ -7418,7 +7736,9 @@  discard block
 block discarded – undo
7418 7736
 			if ($icaoaskey) {
7419 7737
 				$icao = $row['arrival_airport_icao'];
7420 7738
 				$airport_array[$icao] = $temp_array;
7421
-			} else $airport_array[] = $temp_array;
7739
+			} else {
7740
+				$airport_array[] = $temp_array;
7741
+			}
7422 7742
 		}
7423 7743
 
7424 7744
 		return $airport_array;
@@ -7455,7 +7775,9 @@  discard block
 block discarded – undo
7455 7775
                 //if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
7456 7776
                 $query .= "GROUP BY spotter_output.airline_icao, spotter_output.real_arrival_airport_icao, airport.name, airport.city, airport.country
7457 7777
 					ORDER BY airport_arrival_icao_count DESC";
7458
-		if ($limit) $query .= " LIMIT 10";
7778
+		if ($limit) {
7779
+			$query .= " LIMIT 10";
7780
+		}
7459 7781
       
7460 7782
 		
7461 7783
 		$sth = $this->db->prepare($query);
@@ -7476,7 +7798,9 @@  discard block
 block discarded – undo
7476 7798
 			if ($icaoaskey) {
7477 7799
 				$icao = $row['arrival_airport_icao'];
7478 7800
 				$airport_array[$icao] = $temp_array;
7479
-			} else $airport_array[] = $temp_array;
7801
+			} else {
7802
+				$airport_array[] = $temp_array;
7803
+			}
7480 7804
 		}
7481 7805
 
7482 7806
 		return $airport_array;
@@ -7857,7 +8181,9 @@  discard block
 block discarded – undo
7857 8181
 			date_default_timezone_set($globalTimezone);
7858 8182
 			$datetime = new DateTime($date);
7859 8183
 			$offset = $datetime->format('P');
7860
-		} else $offset = '+00:00';
8184
+		} else {
8185
+			$offset = '+00:00';
8186
+		}
7861 8187
 
7862 8188
 		if ($globalDBdriver == 'mysql') {
7863 8189
 			$query  = "SELECT DISTINCT spotter_output.arrival_airport_icao, COUNT(spotter_output.arrival_airport_icao) AS airport_arrival_icao_count, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country 
@@ -7907,7 +8233,9 @@  discard block
 block discarded – undo
7907 8233
 			date_default_timezone_set($globalTimezone);
7908 8234
 			$datetime = new DateTime($date);
7909 8235
 			$offset = $datetime->format('P');
7910
-		} else $offset = '+00:00';
8236
+		} else {
8237
+			$offset = '+00:00';
8238
+		}
7911 8239
 
7912 8240
 		if ($globalDBdriver == 'mysql') {
7913 8241
 			$query  = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count 
@@ -8278,7 +8606,9 @@  discard block
 block discarded – undo
8278 8606
 		}
8279 8607
 		$query .= " GROUP BY spotter_output.arrival_airport_country
8280 8608
 					ORDER BY airport_arrival_country_count DESC";
8281
-		if ($limit) $query .= " LIMIT 10 OFFSET 0";
8609
+		if ($limit) {
8610
+			$query .= " LIMIT 10 OFFSET 0";
8611
+		}
8282 8612
       
8283 8613
 		
8284 8614
 		$sth = $this->db->prepare($query);
@@ -8565,7 +8895,9 @@  discard block
 block discarded – undo
8565 8895
 			date_default_timezone_set($globalTimezone);
8566 8896
 			$datetime = new DateTime($date);
8567 8897
 			$offset = $datetime->format('P');
8568
-		} else $offset = '+00:00';
8898
+		} else {
8899
+			$offset = '+00:00';
8900
+		}
8569 8901
 		
8570 8902
 		if ($globalDBdriver == 'mysql') {
8571 8903
 			$query  = "SELECT DISTINCT concat(spotter_output.departure_airport_icao, ' - ',  spotter_output.arrival_airport_icao) AS route, count(concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao)) AS route_count, spotter_output.departure_airport_icao, spotter_output.departure_airport_name AS airport_departure_name, spotter_output.departure_airport_city AS airport_departure_city, spotter_output.departure_airport_country AS airport_departure_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name AS airport_arrival_name, spotter_output.arrival_airport_city AS airport_arrival_city, spotter_output.arrival_airport_country AS airport_arrival_country
@@ -8821,12 +9153,18 @@  discard block
 block discarded – undo
8821 9153
 		$query  = "SELECT DISTINCT spotter_output.ident, COUNT(spotter_output.ident) AS callsign_icao_count, spotter_output.airline_name, spotter_output.airline_icao  
8822 9154
                     FROM spotter_output".$filter_query." spotter_output.ident <> '' ";
8823 9155
 		 if ($olderthanmonths > 0) {
8824
-			if ($globalDBdriver == 'mysql') $query .= ' AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH)';
8825
-			else $query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'";
9156
+			if ($globalDBdriver == 'mysql') {
9157
+				$query .= ' AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH)';
9158
+			} else {
9159
+				$query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'";
9160
+			}
8826 9161
 		}
8827 9162
 		if ($sincedate != '') {
8828
-			if ($globalDBdriver == 'mysql') $query .= " AND spotter_output.date > '".$sincedate."'";
8829
-			else $query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
9163
+			if ($globalDBdriver == 'mysql') {
9164
+				$query .= " AND spotter_output.date > '".$sincedate."'";
9165
+			} else {
9166
+				$query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
9167
+			}
8830 9168
 		}
8831 9169
 		$query_values = array();
8832 9170
 		if ($year != '') {
@@ -8857,7 +9195,9 @@  discard block
 block discarded – undo
8857 9195
 			}
8858 9196
 		}
8859 9197
 		$query .= " GROUP BY spotter_output.ident, spotter_output.airline_name, spotter_output.airline_icao ORDER BY callsign_icao_count DESC";
8860
-		if ($limit) $query .= " LIMIT 10 OFFSET 0";
9198
+		if ($limit) {
9199
+			$query .= " LIMIT 10 OFFSET 0";
9200
+		}
8861 9201
       		
8862 9202
 		$sth = $this->db->prepare($query);
8863 9203
 		$sth->execute($query_values);
@@ -8891,15 +9231,23 @@  discard block
 block discarded – undo
8891 9231
 		$query  = "SELECT DISTINCT spotter_output.airline_icao, spotter_output.ident, COUNT(spotter_output.ident) AS callsign_icao_count, spotter_output.airline_name  
8892 9232
                     FROM spotter_output".$filter_query." spotter_output.ident <> ''  AND spotter_output.airline_icao <> '' ";
8893 9233
 		 if ($olderthanmonths > 0) {
8894
-			if ($globalDBdriver == 'mysql') $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
8895
-			else $query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' ";
9234
+			if ($globalDBdriver == 'mysql') {
9235
+				$query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
9236
+			} else {
9237
+				$query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' ";
9238
+			}
8896 9239
 		}
8897 9240
 		if ($sincedate != '') {
8898
-			if ($globalDBdriver == 'mysql') $query .= "AND spotter_output.date > '".$sincedate."' ";
8899
-			else $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP) ";
9241
+			if ($globalDBdriver == 'mysql') {
9242
+				$query .= "AND spotter_output.date > '".$sincedate."' ";
9243
+			} else {
9244
+				$query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP) ";
9245
+			}
8900 9246
 		}
8901 9247
 		$query .= "GROUP BY spotter_output.airline_icao, spotter_output.ident, spotter_output.airline_name, spotter_output.airline_icao ORDER BY callsign_icao_count DESC";
8902
-		if ($limit) $query .= " LIMIT 10 OFFSET 0";
9248
+		if ($limit) {
9249
+			$query .= " LIMIT 10 OFFSET 0";
9250
+		}
8903 9251
       		
8904 9252
 		$sth = $this->db->prepare($query);
8905 9253
 		$sth->execute();
@@ -8936,7 +9284,9 @@  discard block
 block discarded – undo
8936 9284
 			date_default_timezone_set($globalTimezone);
8937 9285
 			$datetime = new DateTime();
8938 9286
 			$offset = $datetime->format('P');
8939
-		} else $offset = '+00:00';
9287
+		} else {
9288
+			$offset = '+00:00';
9289
+		}
8940 9290
 
8941 9291
 		if ($globalDBdriver == 'mysql') {
8942 9292
 			$query  = "SELECT DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS date_name, count(*) as date_count
@@ -8985,7 +9335,9 @@  discard block
 block discarded – undo
8985 9335
 			date_default_timezone_set($globalTimezone);
8986 9336
 			$datetime = new DateTime();
8987 9337
 			$offset = $datetime->format('P');
8988
-		} else $offset = '+00:00';
9338
+		} else {
9339
+			$offset = '+00:00';
9340
+		}
8989 9341
 		$filter_query = $this->getFilter($filters,true,true);
8990 9342
 		if ($globalDBdriver == 'mysql') {
8991 9343
 			$query  = "SELECT spotter_output.airline_icao, DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS date_name, count(*) as date_count
@@ -9034,7 +9386,9 @@  discard block
 block discarded – undo
9034 9386
 			date_default_timezone_set($globalTimezone);
9035 9387
 			$datetime = new DateTime();
9036 9388
 			$offset = $datetime->format('P');
9037
-		} else $offset = '+00:00';
9389
+		} else {
9390
+			$offset = '+00:00';
9391
+		}
9038 9392
 		$filter_query = $this->getFilter($filters,true,true);
9039 9393
 		if ($globalDBdriver == 'mysql') {
9040 9394
 			$query  = "SELECT DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS date_name, count(*) as date_count
@@ -9080,7 +9434,9 @@  discard block
 block discarded – undo
9080 9434
 			date_default_timezone_set($globalTimezone);
9081 9435
 			$datetime = new DateTime();
9082 9436
 			$offset = $datetime->format('P');
9083
-		} else $offset = '+00:00';
9437
+		} else {
9438
+			$offset = '+00:00';
9439
+		}
9084 9440
 		$filter_query = $this->getFilter($filters,true,true);
9085 9441
 		if ($globalDBdriver == 'mysql') {
9086 9442
 			$query  = "SELECT DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS date_name, count(*) as date_count
@@ -9128,7 +9484,9 @@  discard block
 block discarded – undo
9128 9484
 			date_default_timezone_set($globalTimezone);
9129 9485
 			$datetime = new DateTime();
9130 9486
 			$offset = $datetime->format('P');
9131
-		} else $offset = '+00:00';
9487
+		} else {
9488
+			$offset = '+00:00';
9489
+		}
9132 9490
 		
9133 9491
 		if ($globalDBdriver == 'mysql') {
9134 9492
 			$query  = "SELECT spotter_output.airline_icao, DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS date_name, count(*) as date_count
@@ -9176,7 +9534,9 @@  discard block
 block discarded – undo
9176 9534
 			date_default_timezone_set($globalTimezone);
9177 9535
 			$datetime = new DateTime();
9178 9536
 			$offset = $datetime->format('P');
9179
-		} else $offset = '+00:00';
9537
+		} else {
9538
+			$offset = '+00:00';
9539
+		}
9180 9540
 
9181 9541
 		if ($globalDBdriver == 'mysql') {
9182 9542
 			$query  = "SELECT YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(*) as date_count
@@ -9223,7 +9583,9 @@  discard block
 block discarded – undo
9223 9583
 			date_default_timezone_set($globalTimezone);
9224 9584
 			$datetime = new DateTime();
9225 9585
 			$offset = $datetime->format('P');
9226
-		} else $offset = '+00:00';
9586
+		} else {
9587
+			$offset = '+00:00';
9588
+		}
9227 9589
 
9228 9590
 		if ($globalDBdriver == 'mysql') {
9229 9591
 			$query  = "SELECT spotter_output.airline_icao, YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(*) as date_count
@@ -9271,7 +9633,9 @@  discard block
 block discarded – undo
9271 9633
 			date_default_timezone_set($globalTimezone);
9272 9634
 			$datetime = new DateTime();
9273 9635
 			$offset = $datetime->format('P');
9274
-		} else $offset = '+00:00';
9636
+		} else {
9637
+			$offset = '+00:00';
9638
+		}
9275 9639
 		$filter_query = $this->getFilter($filters,true,true);
9276 9640
 		if ($globalDBdriver == 'mysql') {
9277 9641
 			$query  = "SELECT YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(*) as date_count
@@ -9316,7 +9680,9 @@  discard block
 block discarded – undo
9316 9680
 			date_default_timezone_set($globalTimezone);
9317 9681
 			$datetime = new DateTime();
9318 9682
 			$offset = $datetime->format('P');
9319
-		} else $offset = '+00:00';
9683
+		} else {
9684
+			$offset = '+00:00';
9685
+		}
9320 9686
 		$filter_query = $this->getFilter($filters,true,true);
9321 9687
 
9322 9688
 		if ($globalDBdriver == 'mysql') {
@@ -9363,7 +9729,9 @@  discard block
 block discarded – undo
9363 9729
 			date_default_timezone_set($globalTimezone);
9364 9730
 			$datetime = new DateTime();
9365 9731
 			$offset = $datetime->format('P');
9366
-		} else $offset = '+00:00';
9732
+		} else {
9733
+			$offset = '+00:00';
9734
+		}
9367 9735
 
9368 9736
 		if ($globalDBdriver == 'mysql') {
9369 9737
 			$query  = "SELECT spotter_output.airline_icao, YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(distinct owner_name) as date_count
@@ -9409,7 +9777,9 @@  discard block
 block discarded – undo
9409 9777
 			date_default_timezone_set($globalTimezone);
9410 9778
 			$datetime = new DateTime();
9411 9779
 			$offset = $datetime->format('P');
9412
-		} else $offset = '+00:00';
9780
+		} else {
9781
+			$offset = '+00:00';
9782
+		}
9413 9783
 		$filter_query = $this->getFilter($filters,true,true);
9414 9784
 
9415 9785
 		if ($globalDBdriver == 'mysql') {
@@ -9456,7 +9826,9 @@  discard block
 block discarded – undo
9456 9826
 			date_default_timezone_set($globalTimezone);
9457 9827
 			$datetime = new DateTime();
9458 9828
 			$offset = $datetime->format('P');
9459
-		} else $offset = '+00:00';
9829
+		} else {
9830
+			$offset = '+00:00';
9831
+		}
9460 9832
 
9461 9833
 		if ($globalDBdriver == 'mysql') {
9462 9834
 			$query  = "SELECT spotter_output.airline_icao, YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(distinct pilot_id) as date_count
@@ -9503,7 +9875,9 @@  discard block
 block discarded – undo
9503 9875
 			date_default_timezone_set($globalTimezone);
9504 9876
 			$datetime = new DateTime();
9505 9877
 			$offset = $datetime->format('P');
9506
-		} else $offset = '+00:00';
9878
+		} else {
9879
+			$offset = '+00:00';
9880
+		}
9507 9881
 
9508 9882
 		if ($globalDBdriver == 'mysql') {
9509 9883
 			$query  = "SELECT YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(distinct airline_icao) as date_count
@@ -9548,7 +9922,9 @@  discard block
 block discarded – undo
9548 9922
 			date_default_timezone_set($globalTimezone);
9549 9923
 			$datetime = new DateTime();
9550 9924
 			$offset = $datetime->format('P');
9551
-		} else $offset = '+00:00';
9925
+		} else {
9926
+			$offset = '+00:00';
9927
+		}
9552 9928
 		$filter_query = $this->getFilter($filters,true,true);
9553 9929
 
9554 9930
 		if ($globalDBdriver == 'mysql') {
@@ -9596,7 +9972,9 @@  discard block
 block discarded – undo
9596 9972
 			date_default_timezone_set($globalTimezone);
9597 9973
 			$datetime = new DateTime();
9598 9974
 			$offset = $datetime->format('P');
9599
-		} else $offset = '+00:00';
9975
+		} else {
9976
+			$offset = '+00:00';
9977
+		}
9600 9978
 
9601 9979
 		if ($globalDBdriver == 'mysql') {
9602 9980
 			$query  = "SELECT spotter_output.airline_icao,YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(distinct aircraft_icao) as date_count
@@ -9642,7 +10020,9 @@  discard block
 block discarded – undo
9642 10020
 			date_default_timezone_set($globalTimezone);
9643 10021
 			$datetime = new DateTime();
9644 10022
 			$offset = $datetime->format('P');
9645
-		} else $offset = '+00:00';
10023
+		} else {
10024
+			$offset = '+00:00';
10025
+		}
9646 10026
 		$filter_query = $this->getFilter($filters,true,true);
9647 10027
 
9648 10028
 		if ($globalDBdriver == 'mysql') {
@@ -9690,7 +10070,9 @@  discard block
 block discarded – undo
9690 10070
 			date_default_timezone_set($globalTimezone);
9691 10071
 			$datetime = new DateTime();
9692 10072
 			$offset = $datetime->format('P');
9693
-		} else $offset = '+00:00';
10073
+		} else {
10074
+			$offset = '+00:00';
10075
+		}
9694 10076
 
9695 10077
 		if ($globalDBdriver == 'mysql') {
9696 10078
 			$query  = "SELECT spotter_output.airline_icao, YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(real_arrival_airport_icao) as date_count
@@ -9737,7 +10119,9 @@  discard block
 block discarded – undo
9737 10119
 			date_default_timezone_set($globalTimezone);
9738 10120
 			$datetime = new DateTime();
9739 10121
 			$offset = $datetime->format('P');
9740
-		} else $offset = '+00:00';
10122
+		} else {
10123
+			$offset = '+00:00';
10124
+		}
9741 10125
 		$filter_query = $this->getFilter($filters,true,true);
9742 10126
 		if ($globalDBdriver == 'mysql') {
9743 10127
 			$query  = "SELECT MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name, count(*) as date_count
@@ -9786,7 +10170,9 @@  discard block
 block discarded – undo
9786 10170
 			date_default_timezone_set($globalTimezone);
9787 10171
 			$datetime = new DateTime();
9788 10172
 			$offset = $datetime->format('P');
9789
-		} else $offset = '+00:00';
10173
+		} else {
10174
+			$offset = '+00:00';
10175
+		}
9790 10176
 
9791 10177
 		$orderby_sql = '';
9792 10178
 		if ($orderby == "hour")
@@ -9852,7 +10238,9 @@  discard block
 block discarded – undo
9852 10238
 			date_default_timezone_set($globalTimezone);
9853 10239
 			$datetime = new DateTime();
9854 10240
 			$offset = $datetime->format('P');
9855
-		} else $offset = '+00:00';
10241
+		} else {
10242
+			$offset = '+00:00';
10243
+		}
9856 10244
 
9857 10245
 		$orderby_sql = '';
9858 10246
 		if ($orderby == "hour")
@@ -9919,7 +10307,9 @@  discard block
 block discarded – undo
9919 10307
 			date_default_timezone_set($globalTimezone);
9920 10308
 			$datetime = new DateTime();
9921 10309
 			$offset = $datetime->format('P');
9922
-		} else $offset = '+00:00';
10310
+		} else {
10311
+			$offset = '+00:00';
10312
+		}
9923 10313
 
9924 10314
 		$airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING);
9925 10315
 
@@ -9970,7 +10360,9 @@  discard block
 block discarded – undo
9970 10360
 			date_default_timezone_set($globalTimezone);
9971 10361
 			$datetime = new DateTime();
9972 10362
 			$offset = $datetime->format('P');
9973
-		} else $offset = '+00:00';
10363
+		} else {
10364
+			$offset = '+00:00';
10365
+		}
9974 10366
 
9975 10367
 		if ($globalDBdriver == 'mysql') {
9976 10368
 			$query  = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count
@@ -10017,7 +10409,9 @@  discard block
 block discarded – undo
10017 10409
 			date_default_timezone_set($globalTimezone);
10018 10410
 			$datetime = new DateTime();
10019 10411
 			$offset = $datetime->format('P');
10020
-		} else $offset = '+00:00';
10412
+		} else {
10413
+			$offset = '+00:00';
10414
+		}
10021 10415
 
10022 10416
 		if ($globalDBdriver == 'mysql') {
10023 10417
 			$query  = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count
@@ -10064,7 +10458,9 @@  discard block
 block discarded – undo
10064 10458
 			date_default_timezone_set($globalTimezone);
10065 10459
 			$datetime = new DateTime();
10066 10460
 			$offset = $datetime->format('P');
10067
-		} else $offset = '+00:00';
10461
+		} else {
10462
+			$offset = '+00:00';
10463
+		}
10068 10464
 
10069 10465
 		if ($globalDBdriver == 'mysql') {
10070 10466
 			$query  = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count
@@ -10112,7 +10508,9 @@  discard block
 block discarded – undo
10112 10508
 			date_default_timezone_set($globalTimezone);
10113 10509
 			$datetime = new DateTime();
10114 10510
 			$offset = $datetime->format('P');
10115
-		} else $offset = '+00:00';
10511
+		} else {
10512
+			$offset = '+00:00';
10513
+		}
10116 10514
 
10117 10515
 		if ($globalDBdriver == 'mysql') {
10118 10516
 			$query  = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count
@@ -10160,7 +10558,9 @@  discard block
 block discarded – undo
10160 10558
 			date_default_timezone_set($globalTimezone);
10161 10559
 			$datetime = new DateTime($date);
10162 10560
 			$offset = $datetime->format('P');
10163
-		} else $offset = '+00:00';
10561
+		} else {
10562
+			$offset = '+00:00';
10563
+		}
10164 10564
 
10165 10565
 		if ($globalDBdriver == 'mysql') {
10166 10566
 			$query  = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count
@@ -10208,7 +10608,9 @@  discard block
 block discarded – undo
10208 10608
 			date_default_timezone_set($globalTimezone);
10209 10609
 			$datetime = new DateTime();
10210 10610
 			$offset = $datetime->format('P');
10211
-		} else $offset = '+00:00';
10611
+		} else {
10612
+			$offset = '+00:00';
10613
+		}
10212 10614
 
10213 10615
 		if ($globalDBdriver == 'mysql') {
10214 10616
 			$query  = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count
@@ -10255,7 +10657,9 @@  discard block
 block discarded – undo
10255 10657
 			date_default_timezone_set($globalTimezone);
10256 10658
 			$datetime = new DateTime();
10257 10659
 			$offset = $datetime->format('P');
10258
-		} else $offset = '+00:00';
10660
+		} else {
10661
+			$offset = '+00:00';
10662
+		}
10259 10663
 
10260 10664
 		if ($globalDBdriver == 'mysql') {
10261 10665
 			$query  = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count
@@ -10302,7 +10706,9 @@  discard block
 block discarded – undo
10302 10706
 			date_default_timezone_set($globalTimezone);
10303 10707
 			$datetime = new DateTime();
10304 10708
 			$offset = $datetime->format('P');
10305
-		} else $offset = '+00:00';
10709
+		} else {
10710
+			$offset = '+00:00';
10711
+		}
10306 10712
 
10307 10713
 		if ($globalDBdriver == 'mysql') {
10308 10714
 			$query  = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count
@@ -10352,7 +10758,9 @@  discard block
 block discarded – undo
10352 10758
 			date_default_timezone_set($globalTimezone);
10353 10759
 			$datetime = new DateTime();
10354 10760
 			$offset = $datetime->format('P');
10355
-		} else $offset = '+00:00';
10761
+		} else {
10762
+			$offset = '+00:00';
10763
+		}
10356 10764
 
10357 10765
 		if ($globalDBdriver == 'mysql') {
10358 10766
 			$query  = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count
@@ -10399,7 +10807,9 @@  discard block
 block discarded – undo
10399 10807
 			date_default_timezone_set($globalTimezone);
10400 10808
 			$datetime = new DateTime();
10401 10809
 			$offset = $datetime->format('P');
10402
-		} else $offset = '+00:00';
10810
+		} else {
10811
+			$offset = '+00:00';
10812
+		}
10403 10813
 
10404 10814
 		if ($globalDBdriver == 'mysql') {
10405 10815
 			$query  = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count
@@ -10610,8 +11020,11 @@  discard block
 block discarded – undo
10610 11020
 				$query_values = array_merge($query_values,array(':month' => $month));
10611 11021
 			}
10612 11022
 		}
10613
-		if (empty($query_values)) $queryi .= $this->getFilter($filters);
10614
-		else $queryi .= $this->getFilter($filters,true,true).substr($query,4);
11023
+		if (empty($query_values)) {
11024
+			$queryi .= $this->getFilter($filters);
11025
+		} else {
11026
+			$queryi .= $this->getFilter($filters,true,true).substr($query,4);
11027
+		}
10615 11028
 		
10616 11029
 		//echo $query;
10617 11030
 		$sth = $this->db->prepare($queryi);
@@ -10690,8 +11103,11 @@  discard block
 block discarded – undo
10690 11103
 				$query_values = array_merge($query_values,array(':month' => $month));
10691 11104
 			}
10692 11105
 		}
10693
-                if ($query == '') $queryi .= $this->getFilter($filters);
10694
-                else $queryi .= $this->getFilter($filters,true,true).substr($query,4);
11106
+                if ($query == '') {
11107
+                	$queryi .= $this->getFilter($filters);
11108
+                } else {
11109
+                	$queryi .= $this->getFilter($filters,true,true).substr($query,4);
11110
+                }
10695 11111
 
10696 11112
 
10697 11113
 		$sth = $this->db->prepare($queryi);
@@ -10714,7 +11130,9 @@  discard block
 block discarded – undo
10714 11130
 			date_default_timezone_set($globalTimezone);
10715 11131
 			$datetime = new DateTime();
10716 11132
 			$offset = $datetime->format('P');
10717
-		} else $offset = '+00:00';
11133
+		} else {
11134
+			$offset = '+00:00';
11135
+		}
10718 11136
 
10719 11137
 		if ($globalDBdriver == 'mysql') {
10720 11138
 			$query  = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count
@@ -10900,7 +11318,9 @@  discard block
 block discarded – undo
10900 11318
 	*/
10901 11319
 	public function parseDirection($direction = 0)
10902 11320
 	{
10903
-		if ($direction == '') $direction = 0;
11321
+		if ($direction == '') {
11322
+			$direction = 0;
11323
+		}
10904 11324
 		$direction_array = array();
10905 11325
 		$temp_array = array();
10906 11326
 
@@ -11001,7 +11421,9 @@  discard block
 block discarded – undo
11001 11421
 		if (isset($result->AirlineFlightInfoResult))
11002 11422
 		{
11003 11423
 			$registration = $result->AirlineFlightInfoResult->tailnumber;
11004
-		} else return '';
11424
+		} else {
11425
+			return '';
11426
+		}
11005 11427
 		
11006 11428
 		$registration = $this->convertAircraftRegistration($registration);
11007 11429
 		
@@ -11030,7 +11452,9 @@  discard block
 block discarded – undo
11030 11452
 		if (count($row) > 0) {
11031 11453
 		    //return $row['Registration'];
11032 11454
 		    return $row['registration'];
11033
-		} else return '';
11455
+		} else {
11456
+			return '';
11457
+		}
11034 11458
 	
11035 11459
 	}
11036 11460
 
@@ -11053,9 +11477,14 @@  discard block
 block discarded – undo
11053 11477
 		$row = $sth->fetch(PDO::FETCH_ASSOC);
11054 11478
 		$sth->closeCursor();
11055 11479
 		if (count($row) > 0) {
11056
-		    if ($row['type_flight'] == null) return '';
11057
-		    else return $row['type_flight'];
11058
-		} else return '';
11480
+		    if ($row['type_flight'] == null) {
11481
+		    	return '';
11482
+		    } else {
11483
+		    	return $row['type_flight'];
11484
+		    }
11485
+		} else {
11486
+			return '';
11487
+		}
11059 11488
 	
11060 11489
 	}
11061 11490
 
@@ -11073,7 +11502,9 @@  discard block
 block discarded – undo
11073 11502
 		$longitude = filter_var($longitude,FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
11074 11503
 	
11075 11504
 		$Connection = new Connection($this->db);
11076
-		if (!$Connection->tableExists('countries')) return '';
11505
+		if (!$Connection->tableExists('countries')) {
11506
+			return '';
11507
+		}
11077 11508
 	
11078 11509
 		try {
11079 11510
 			/*
@@ -11093,9 +11524,13 @@  discard block
 block discarded – undo
11093 11524
 			$sth->closeCursor();
11094 11525
 			if (count($row) > 0) {
11095 11526
 				return $row;
11096
-			} else return '';
11527
+			} else {
11528
+				return '';
11529
+			}
11097 11530
 		} catch (PDOException $e) {
11098
-			if (isset($globalDebug) && $globalDebug) echo 'Error : '.$e->getMessage()."\n";
11531
+			if (isset($globalDebug) && $globalDebug) {
11532
+				echo 'Error : '.$e->getMessage()."\n";
11533
+			}
11099 11534
 			return '';
11100 11535
 		}
11101 11536
 	
@@ -11113,7 +11548,9 @@  discard block
 block discarded – undo
11113 11548
 		$iso2 = filter_var($iso2,FILTER_SANITIZE_STRING);
11114 11549
 	
11115 11550
 		$Connection = new Connection($this->db);
11116
-		if (!$Connection->tableExists('countries')) return '';
11551
+		if (!$Connection->tableExists('countries')) {
11552
+			return '';
11553
+		}
11117 11554
 	
11118 11555
 		try {
11119 11556
 			$query = "SELECT name,iso2,iso3 FROM countries WHERE iso2 = :iso2 LIMIT 1";
@@ -11125,9 +11562,13 @@  discard block
 block discarded – undo
11125 11562
 			$sth->closeCursor();
11126 11563
 			if (count($row) > 0) {
11127 11564
 				return $row;
11128
-			} else return '';
11565
+			} else {
11566
+				return '';
11567
+			}
11129 11568
 		} catch (PDOException $e) {
11130
-			if (isset($globalDebug) && $globalDebug) echo 'Error : '.$e->getMessage()."\n";
11569
+			if (isset($globalDebug) && $globalDebug) {
11570
+				echo 'Error : '.$e->getMessage()."\n";
11571
+			}
11131 11572
 			return '';
11132 11573
 		}
11133 11574
 	
@@ -11377,7 +11818,9 @@  discard block
 block discarded – undo
11377 11818
 	{
11378 11819
 		global $globalBitlyAccessToken;
11379 11820
 		
11380
-		if ($globalBitlyAccessToken == '') return $url;
11821
+		if ($globalBitlyAccessToken == '') {
11822
+			return $url;
11823
+		}
11381 11824
         
11382 11825
 		$google_url = 'https://api-ssl.bitly.com/v3/shorten?access_token='.$globalBitlyAccessToken.'&longUrl='.$url;
11383 11826
 		
@@ -11526,7 +11969,9 @@  discard block
 block discarded – undo
11526 11969
 		
11527 11970
 
11528 11971
 		// routes
11529
-		if ($globalDebug) print "Routes...\n";
11972
+		if ($globalDebug) {
11973
+			print "Routes...\n";
11974
+		}
11530 11975
 		if ($globalDBdriver == 'mysql') {
11531 11976
 			$query = "SELECT spotter_output.spotter_id, routes.FromAirport_ICAO, routes.ToAirport_ICAO FROM spotter_output, routes WHERE spotter_output.ident = routes.CallSign AND ( spotter_output.departure_airport_icao != routes.FromAirport_ICAO OR spotter_output.arrival_airport_icao != routes.ToAirport_ICAO) AND routes.FromAirport_ICAO != '' AND spotter_output.date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 15 DAY)";
11532 11977
 		} else {
@@ -11545,7 +11990,9 @@  discard block
 block discarded – undo
11545 11990
 			}
11546 11991
 		}
11547 11992
 		
11548
-		if ($globalDebug) print "Airlines...\n";
11993
+		if ($globalDebug) {
11994
+			print "Airlines...\n";
11995
+		}
11549 11996
 		//airlines
11550 11997
 		if ($globalDBdriver == 'mysql') {
11551 11998
 			$query  = "SELECT spotter_output.spotter_id, spotter_output.ident FROM spotter_output WHERE (spotter_output.airline_name = '' OR spotter_output.airline_name = 'Not Available') AND spotter_output.date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 15 DAY)";
@@ -11559,10 +12006,15 @@  discard block
 block discarded – undo
11559 12006
 			if (is_numeric(substr($row['ident'], -1, 1)))
11560 12007
 			{
11561 12008
 				$fromsource = NULL;
11562
-				if (isset($row['format_source']) && $row['format_source'] == 'vatsimtxt') $fromsource = 'vatsim';
11563
-				elseif (isset($row['format_source']) && $row['format_source'] == 'whazzup') $fromsource = 'ivao';
11564
-				elseif (isset($globalVATSIM) && $globalVATSIM) $fromsource = 'vatsim';
11565
-				elseif (isset($globalIVAO) && $globalIVAO) $fromsource = 'ivao';
12009
+				if (isset($row['format_source']) && $row['format_source'] == 'vatsimtxt') {
12010
+					$fromsource = 'vatsim';
12011
+				} elseif (isset($row['format_source']) && $row['format_source'] == 'whazzup') {
12012
+					$fromsource = 'ivao';
12013
+				} elseif (isset($globalVATSIM) && $globalVATSIM) {
12014
+					$fromsource = 'vatsim';
12015
+				} elseif (isset($globalIVAO) && $globalIVAO) {
12016
+					$fromsource = 'ivao';
12017
+				}
11566 12018
 				$airline_array = $this->getAllAirlineInfo(substr($row['ident'], 0, 3),$fromsource);
11567 12019
 				if (isset($airline_array[0]['name'])) {
11568 12020
 					$update_query  = "UPDATE spotter_output SET spotter_output.airline_name = :airline_name, spotter_output.airline_icao = :airline_icao, spotter_output.airline_country = :airline_country, spotter_output.airline_type = :airline_type WHERE spotter_output.spotter_id = :spotter_id";
@@ -11572,13 +12024,17 @@  discard block
 block discarded – undo
11572 12024
 			}
11573 12025
 		}
11574 12026
 
11575
-		if ($globalDebug) print "Remove Duplicate in aircraft_modes...\n";
12027
+		if ($globalDebug) {
12028
+			print "Remove Duplicate in aircraft_modes...\n";
12029
+		}
11576 12030
 		//duplicate modes
11577 12031
 		$query = "DELETE aircraft_modes FROM aircraft_modes LEFT OUTER JOIN (SELECT max(`AircraftID`) as `AircraftID`,`ModeS` FROM `aircraft_modes` group by ModeS) as KeepRows ON aircraft_modes.AircraftID = KeepRows.AircraftID WHERE KeepRows.AircraftID IS NULL";
11578 12032
 		$sth = $this->db->prepare($query);
11579 12033
 		$sth->execute();
11580 12034
 		
11581
-		if ($globalDebug) print "Aircraft...\n";
12035
+		if ($globalDebug) {
12036
+			print "Aircraft...\n";
12037
+		}
11582 12038
 		//aircraft
11583 12039
 		if ($globalDBdriver == 'mysql') {
11584 12040
 			$query  = "SELECT spotter_output.spotter_id, spotter_output.aircraft_icao, spotter_output.registration FROM spotter_output WHERE (spotter_output.aircraft_name = '' OR spotter_output.aircraft_name = 'Not Available') AND spotter_output.date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 7 DAY)";
@@ -11621,26 +12077,38 @@  discard block
 block discarded – undo
11621 12077
 				 if (isset($closestAirports[0])) {
11622 12078
 					if ($row['arrival_airport_icao'] == $closestAirports[0]['icao']) {
11623 12079
 						$airport_icao = $closestAirports[0]['icao'];
11624
-						if ($globalDebug) echo "\o/ 1st ---++ Find arrival airport. airport_icao : ".$airport_icao."\n";
12080
+						if ($globalDebug) {
12081
+							echo "\o/ 1st ---++ Find arrival airport. airport_icao : ".$airport_icao."\n";
12082
+						}
11625 12083
 					} elseif (count($closestAirports > 1) && $row['arrival_airport_icao'] != '' && $row['arrival_airport_icao'] != 'NA') {
11626 12084
 						foreach ($closestAirports as $airport) {
11627 12085
 							if ($row['arrival_airport_icao'] == $airport['icao']) {
11628 12086
 								$airport_icao = $airport['icao'];
11629
-								if ($globalDebug) echo "\o/ try --++ Find arrival airport. airport_icao : ".$airport_icao."\n";
12087
+								if ($globalDebug) {
12088
+									echo "\o/ try --++ Find arrival airport. airport_icao : ".$airport_icao."\n";
12089
+								}
11630 12090
 								break;
11631 12091
 							}
11632 12092
 						}
11633 12093
 					} elseif ($row['last_altitude'] == 0 || ($row['last_altitude'] != '' && ($closestAirports[0]['altitude'] <= $row['last_altitude']*100+1000 && $row['last_altitude']*100 < $closestAirports[0]['altitude']+5000))) {
11634 12094
 						$airport_icao = $closestAirports[0]['icao'];
11635
-						if ($globalDebug) echo "\o/ NP --++ Find arrival airport. Airport ICAO : ".$airport_icao." !  Latitude : ".$row['last_latitude'].' - Longitude : '.$row['last_longitude'].' - MinDist : '.$globalClosestMinDist." - Airport altitude : ".$closestAirports[0]['altitude'].' - flight altitude : '.($row['last_altitude']*100)."\n";
12095
+						if ($globalDebug) {
12096
+							echo "\o/ NP --++ Find arrival airport. Airport ICAO : ".$airport_icao." !  Latitude : ".$row['last_latitude'].' - Longitude : '.$row['last_longitude'].' - MinDist : '.$globalClosestMinDist." - Airport altitude : ".$closestAirports[0]['altitude'].' - flight altitude : '.($row['last_altitude']*100)."\n";
12097
+						}
11636 12098
 					} else {
11637
-						if ($globalDebug) echo "----- Can't find arrival airport. Latitude : ".$row['last_latitude'].' - Longitude : '.$row['last_longitude'].' - MinDist : '.$globalClosestMinDist." - Airport altitude : ".$closestAirports[0]['altitude'].' - flight altitude : '.($row['last_altitude']*100)."\n";
12099
+						if ($globalDebug) {
12100
+							echo "----- Can't find arrival airport. Latitude : ".$row['last_latitude'].' - Longitude : '.$row['last_longitude'].' - MinDist : '.$globalClosestMinDist." - Airport altitude : ".$closestAirports[0]['altitude'].' - flight altitude : '.($row['last_altitude']*100)."\n";
12101
+						}
11638 12102
 					}
11639 12103
 				} else {
11640
-					if ($globalDebug) echo "----- No Airport near last coord. Latitude : ".$row['last_latitude'].' - Longitude : '.$row['last_longitude'].' - MinDist : '.$globalClosestMinDist."\n";
12104
+					if ($globalDebug) {
12105
+						echo "----- No Airport near last coord. Latitude : ".$row['last_latitude'].' - Longitude : '.$row['last_longitude'].' - MinDist : '.$globalClosestMinDist."\n";
12106
+					}
11641 12107
 				}
11642 12108
 				if ($row['real_arrival_airport_icao'] != $airport_icao) {
11643
-					if ($globalDebug) echo "Updating airport to ".$airport_icao."...\n";
12109
+					if ($globalDebug) {
12110
+						echo "Updating airport to ".$airport_icao."...\n";
12111
+					}
11644 12112
 					$update_query="UPDATE spotter_output SET real_arrival_airport_icao = :airport_icao WHERE spotter_id = :spotter_id";
11645 12113
 					$sthu = $this->db->prepare($update_query);
11646 12114
 					$sthu->execute(array(':airport_icao' => $airport_icao,':spotter_id' => $row['spotter_id']));
Please login to merge, or discard this patch.