Completed
Push — master ( 8e145a...81727e )
by Yannick
06:52
created
require/class.Spotter.php 1 patch
Indentation   +1427 added lines, -1427 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);
@@ -8099,11 +8099,11 @@  discard block
 block discarded – undo
8099 8099
 	}
8100 8100
 	
8101 8101
 	/**
8102
-	* Gets all arrival airports by country of the airplanes that have flown over based on a pilot
8103
-	*
8104
-	* @return Array the airport list
8105
-	*
8106
-	*/
8102
+	 * Gets all arrival airports by country of the airplanes that have flown over based on a pilot
8103
+	 *
8104
+	 * @return Array the airport list
8105
+	 *
8106
+	 */
8107 8107
 	public function countAllArrivalAirportCountriesByPilot($pilot, $filters = array())
8108 8108
 	{
8109 8109
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8121,11 +8121,11 @@  discard block
 block discarded – undo
8121 8121
 	
8122 8122
 	
8123 8123
 	/**
8124
-	* Gets all arrival airports of the airplanes that have flown over based on a country
8125
-	*
8126
-	* @return Array the airport list
8127
-	*
8128
-	*/
8124
+	 * Gets all arrival airports of the airplanes that have flown over based on a country
8125
+	 *
8126
+	 * @return Array the airport list
8127
+	 *
8128
+	 */
8129 8129
 	public function countAllArrivalAirportsByCountry($country,$filters = array())
8130 8130
 	{
8131 8131
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8158,11 +8158,11 @@  discard block
 block discarded – undo
8158 8158
 	
8159 8159
 	
8160 8160
 	/**
8161
-	* Gets all arrival airports by country of the airplanes that have flown over based on a country
8162
-	*
8163
-	* @return Array the airport list
8164
-	*
8165
-	*/
8161
+	 * Gets all arrival airports by country of the airplanes that have flown over based on a country
8162
+	 *
8163
+	 * @return Array the airport list
8164
+	 *
8165
+	 */
8166 8166
 	public function countAllArrivalAirportCountriesByCountry($country,$filters = array())
8167 8167
 	{
8168 8168
 		global $globalDBdriver;
@@ -8194,11 +8194,11 @@  discard block
 block discarded – undo
8194 8194
 
8195 8195
 
8196 8196
 	/**
8197
-	* Counts all airport departure countries
8198
-	*
8199
-	* @return Array the airport departure list
8200
-	*
8201
-	*/
8197
+	 * Counts all airport departure countries
8198
+	 *
8199
+	 * @return Array the airport departure list
8200
+	 *
8201
+	 */
8202 8202
 	public function countAllDepartureCountries($filters = array(),$year = '',$month = '', $day = '')
8203 8203
 	{
8204 8204
 		global $globalDBdriver;
@@ -8257,11 +8257,11 @@  discard block
 block discarded – undo
8257 8257
 	
8258 8258
 	
8259 8259
 	/**
8260
-	* Counts all airport arrival countries
8261
-	*
8262
-	* @return Array the airport arrival list
8263
-	*
8264
-	*/
8260
+	 * Counts all airport arrival countries
8261
+	 *
8262
+	 * @return Array the airport arrival list
8263
+	 *
8264
+	 */
8265 8265
 	public function countAllArrivalCountries($limit = true,$filters = array(),$year = '',$month = '',$day = '')
8266 8266
 	{
8267 8267
 		global $globalDBdriver;
@@ -8323,11 +8323,11 @@  discard block
 block discarded – undo
8323 8323
 
8324 8324
 
8325 8325
 	/**
8326
-	* Gets all route combinations
8327
-	*
8328
-	* @return Array the route list
8329
-	*
8330
-	*/
8326
+	 * Gets all route combinations
8327
+	 *
8328
+	 * @return Array the route list
8329
+	 *
8330
+	 */
8331 8331
 	public function countAllRoutes($filters = array())
8332 8332
 	{
8333 8333
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8366,11 +8366,11 @@  discard block
 block discarded – undo
8366 8366
 	
8367 8367
 	
8368 8368
 	/**
8369
-	* Gets all route combinations based on an aircraft
8370
-	*
8371
-	* @return Array the route list
8372
-	*
8373
-	*/
8369
+	 * Gets all route combinations based on an aircraft
8370
+	 *
8371
+	 * @return Array the route list
8372
+	 *
8373
+	 */
8374 8374
 	public function countAllRoutesByAircraft($aircraft_icao,$filters = array())
8375 8375
 	{
8376 8376
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8406,11 +8406,11 @@  discard block
 block discarded – undo
8406 8406
 	
8407 8407
 	
8408 8408
 	/**
8409
-	* Gets all route combinations based on an aircraft registration
8410
-	*
8411
-	* @return Array the route list
8412
-	*
8413
-	*/
8409
+	 * Gets all route combinations based on an aircraft registration
8410
+	 *
8411
+	 * @return Array the route list
8412
+	 *
8413
+	 */
8414 8414
 	public function countAllRoutesByRegistration($registration, $filters = array())
8415 8415
 	{
8416 8416
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8448,11 +8448,11 @@  discard block
 block discarded – undo
8448 8448
 	
8449 8449
 	
8450 8450
 	/**
8451
-	* Gets all route combinations based on an airline
8452
-	*
8453
-	* @return Array the route list
8454
-	*
8455
-	*/
8451
+	 * Gets all route combinations based on an airline
8452
+	 *
8453
+	 * @return Array the route list
8454
+	 *
8455
+	 */
8456 8456
 	public function countAllRoutesByAirline($airline_icao, $filters = array())
8457 8457
 	{
8458 8458
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8490,11 +8490,11 @@  discard block
 block discarded – undo
8490 8490
 	
8491 8491
 	
8492 8492
 	/**
8493
-	* Gets all route combinations based on an airport
8494
-	*
8495
-	* @return Array the route list
8496
-	*
8497
-	*/
8493
+	 * Gets all route combinations based on an airport
8494
+	 *
8495
+	 * @return Array the route list
8496
+	 *
8497
+	 */
8498 8498
 	public function countAllRoutesByAirport($airport_icao, $filters = array())
8499 8499
 	{
8500 8500
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8531,11 +8531,11 @@  discard block
 block discarded – undo
8531 8531
 	
8532 8532
 	
8533 8533
 	/**
8534
-	* Gets all route combinations based on an country
8535
-	*
8536
-	* @return Array the route list
8537
-	*
8538
-	*/
8534
+	 * Gets all route combinations based on an country
8535
+	 *
8536
+	 * @return Array the route list
8537
+	 *
8538
+	 */
8539 8539
 	public function countAllRoutesByCountry($country, $filters = array())
8540 8540
 	{
8541 8541
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8571,11 +8571,11 @@  discard block
 block discarded – undo
8571 8571
 
8572 8572
 
8573 8573
 	/**
8574
-	* Gets all route combinations based on an date
8575
-	*
8576
-	* @return Array the route list
8577
-	*
8578
-	*/
8574
+	 * Gets all route combinations based on an date
8575
+	 *
8576
+	 * @return Array the route list
8577
+	 *
8578
+	 */
8579 8579
 	public function countAllRoutesByDate($date, $filters = array())
8580 8580
 	{
8581 8581
 		global $globalTimezone, $globalDBdriver;
@@ -8625,11 +8625,11 @@  discard block
 block discarded – undo
8625 8625
 	
8626 8626
 	
8627 8627
 	/**
8628
-	* Gets all route combinations based on an ident/callsign
8629
-	*
8630
-	* @return Array the route list
8631
-	*
8632
-	*/
8628
+	 * Gets all route combinations based on an ident/callsign
8629
+	 *
8630
+	 * @return Array the route list
8631
+	 *
8632
+	 */
8633 8633
 	public function countAllRoutesByIdent($ident, $filters = array())
8634 8634
 	{
8635 8635
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8665,11 +8665,11 @@  discard block
 block discarded – undo
8665 8665
 	}
8666 8666
 	
8667 8667
 	/**
8668
-	* Gets all route combinations based on an owner
8669
-	*
8670
-	* @return Array the route list
8671
-	*
8672
-	*/
8668
+	 * Gets all route combinations based on an owner
8669
+	 *
8670
+	 * @return Array the route list
8671
+	 *
8672
+	 */
8673 8673
 	public function countAllRoutesByOwner($owner,$filters = array())
8674 8674
 	{
8675 8675
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8705,11 +8705,11 @@  discard block
 block discarded – undo
8705 8705
 	}
8706 8706
 	
8707 8707
 	/**
8708
-	* Gets all route combinations based on a pilot
8709
-	*
8710
-	* @return Array the route list
8711
-	*
8712
-	*/
8708
+	 * Gets all route combinations based on a pilot
8709
+	 *
8710
+	 * @return Array the route list
8711
+	 *
8712
+	 */
8713 8713
 	public function countAllRoutesByPilot($pilot,$filters = array())
8714 8714
 	{
8715 8715
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8746,11 +8746,11 @@  discard block
 block discarded – undo
8746 8746
 	
8747 8747
 	
8748 8748
 	/**
8749
-	* Gets all route combinations based on an manufacturer
8750
-	*
8751
-	* @return Array the route list
8752
-	*
8753
-	*/
8749
+	 * Gets all route combinations based on an manufacturer
8750
+	 *
8751
+	 * @return Array the route list
8752
+	 *
8753
+	 */
8754 8754
 	public function countAllRoutesByManufacturer($aircraft_manufacturer, $filters = array())
8755 8755
 	{
8756 8756
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8788,11 +8788,11 @@  discard block
 block discarded – undo
8788 8788
 	
8789 8789
 	
8790 8790
 	/**
8791
-	* Gets all route combinations with waypoints
8792
-	*
8793
-	* @return Array the route list
8794
-	*
8795
-	*/
8791
+	 * Gets all route combinations with waypoints
8792
+	 *
8793
+	 * @return Array the route list
8794
+	 *
8795
+	 */
8796 8796
 	public function countAllRoutesWithWaypoints($filters = array())
8797 8797
 	{
8798 8798
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8829,11 +8829,11 @@  discard block
 block discarded – undo
8829 8829
 	}
8830 8830
 	
8831 8831
 	/**
8832
-	* Gets all callsigns that have flown over
8833
-	*
8834
-	* @return Array the callsign list
8835
-	*
8836
-	*/
8832
+	 * Gets all callsigns that have flown over
8833
+	 *
8834
+	 * @return Array the callsign list
8835
+	 *
8836
+	 */
8837 8837
 	public function countAllCallsigns($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array(),$year = '', $month = '', $day = '')
8838 8838
 	{
8839 8839
 		global $globalDBdriver;
@@ -8899,11 +8899,11 @@  discard block
 block discarded – undo
8899 8899
 	}
8900 8900
 
8901 8901
 	/**
8902
-	* Gets all callsigns that have flown over
8903
-	*
8904
-	* @return Array the callsign list
8905
-	*
8906
-	*/
8902
+	 * Gets all callsigns that have flown over
8903
+	 *
8904
+	 * @return Array the callsign list
8905
+	 *
8906
+	 */
8907 8907
 	public function countAllCallsignsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '', $filters = array())
8908 8908
 	{
8909 8909
 		global $globalDBdriver;
@@ -8944,11 +8944,11 @@  discard block
 block discarded – undo
8944 8944
 
8945 8945
 
8946 8946
 	/**
8947
-	* Counts all dates
8948
-	*
8949
-	* @return Array the date list
8950
-	*
8951
-	*/
8947
+	 * Counts all dates
8948
+	 *
8949
+	 * @return Array the date list
8950
+	 *
8951
+	 */
8952 8952
 	public function countAllDates($filters = array())
8953 8953
 	{
8954 8954
 		global $globalTimezone, $globalDBdriver;
@@ -8993,11 +8993,11 @@  discard block
 block discarded – undo
8993 8993
 	}
8994 8994
 	
8995 8995
 	/**
8996
-	* Counts all dates
8997
-	*
8998
-	* @return Array the date list
8999
-	*
9000
-	*/
8996
+	 * Counts all dates
8997
+	 *
8998
+	 * @return Array the date list
8999
+	 *
9000
+	 */
9001 9001
 	public function countAllDatesByAirlines($filters = array())
9002 9002
 	{
9003 9003
 		global $globalTimezone, $globalDBdriver;
@@ -9042,11 +9042,11 @@  discard block
 block discarded – undo
9042 9042
 	}	
9043 9043
 	
9044 9044
 	/**
9045
-	* Counts all dates during the last 7 days
9046
-	*
9047
-	* @return Array the date list
9048
-	*
9049
-	*/
9045
+	 * Counts all dates during the last 7 days
9046
+	 *
9047
+	 * @return Array the date list
9048
+	 *
9049
+	 */
9050 9050
 	public function countAllDatesLast7Days($filters = array())
9051 9051
 	{
9052 9052
 		global $globalTimezone, $globalDBdriver;
@@ -9068,7 +9068,7 @@  discard block
 block discarded – undo
9068 9068
 			$query .= " GROUP BY date_name 
9069 9069
 								ORDER BY date_name ASC";
9070 9070
 			$query_data = array(':offset' => $offset);
9071
-    		}
9071
+			}
9072 9072
 		
9073 9073
 		$sth = $this->db->prepare($query);
9074 9074
 		$sth->execute($query_data);
@@ -9088,11 +9088,11 @@  discard block
 block discarded – undo
9088 9088
 	}
9089 9089
 
9090 9090
 	/**
9091
-	* Counts all dates during the last month
9092
-	*
9093
-	* @return Array the date list
9094
-	*
9095
-	*/
9091
+	 * Counts all dates during the last month
9092
+	 *
9093
+	 * @return Array the date list
9094
+	 *
9095
+	 */
9096 9096
 	public function countAllDatesLastMonth($filters = array())
9097 9097
 	{
9098 9098
 		global $globalTimezone, $globalDBdriver;
@@ -9114,7 +9114,7 @@  discard block
 block discarded – undo
9114 9114
 			$query .= " GROUP BY date_name 
9115 9115
 								ORDER BY date_name ASC";
9116 9116
 			$query_data = array(':offset' => $offset);
9117
-    		}
9117
+			}
9118 9118
 		
9119 9119
 		$sth = $this->db->prepare($query);
9120 9120
 		$sth->execute($query_data);
@@ -9135,11 +9135,11 @@  discard block
 block discarded – undo
9135 9135
 
9136 9136
 
9137 9137
 	/**
9138
-	* Counts all dates during the last month
9139
-	*
9140
-	* @return Array the date list
9141
-	*
9142
-	*/
9138
+	 * Counts all dates during the last month
9139
+	 *
9140
+	 * @return Array the date list
9141
+	 *
9142
+	 */
9143 9143
 	public function countAllDatesLastMonthByAirlines($filters = array())
9144 9144
 	{
9145 9145
 		global $globalTimezone, $globalDBdriver;
@@ -9162,7 +9162,7 @@  discard block
 block discarded – undo
9162 9162
 								GROUP BY spotter_output.airline_icao, date_name 
9163 9163
 								ORDER BY date_name ASC";
9164 9164
 			$query_data = array(':offset' => $offset);
9165
-    		}
9165
+			}
9166 9166
 		
9167 9167
 		$sth = $this->db->prepare($query);
9168 9168
 		$sth->execute($query_data);
@@ -9184,11 +9184,11 @@  discard block
 block discarded – undo
9184 9184
 	
9185 9185
 
9186 9186
 	/**
9187
-	* Counts all month
9188
-	*
9189
-	* @return Array the month list
9190
-	*
9191
-	*/
9187
+	 * Counts all month
9188
+	 *
9189
+	 * @return Array the month list
9190
+	 *
9191
+	 */
9192 9192
 	public function countAllMonths($filters = array())
9193 9193
 	{
9194 9194
 		global $globalTimezone, $globalDBdriver;
@@ -9230,11 +9230,11 @@  discard block
 block discarded – undo
9230 9230
 	}
9231 9231
 
9232 9232
 	/**
9233
-	* Counts all month
9234
-	*
9235
-	* @return Array the month list
9236
-	*
9237
-	*/
9233
+	 * Counts all month
9234
+	 *
9235
+	 * @return Array the month list
9236
+	 *
9237
+	 */
9238 9238
 	public function countAllMonthsByAirlines($filters = array())
9239 9239
 	{
9240 9240
 		global $globalTimezone, $globalDBdriver;
@@ -9279,11 +9279,11 @@  discard block
 block discarded – undo
9279 9279
 	}
9280 9280
 
9281 9281
 	/**
9282
-	* Counts all military month
9283
-	*
9284
-	* @return Array the month list
9285
-	*
9286
-	*/
9282
+	 * Counts all military month
9283
+	 *
9284
+	 * @return Array the month list
9285
+	 *
9286
+	 */
9287 9287
 	public function countAllMilitaryMonths($filters = array())
9288 9288
 	{
9289 9289
 		global $globalTimezone, $globalDBdriver;
@@ -9324,11 +9324,11 @@  discard block
 block discarded – undo
9324 9324
 	}
9325 9325
 	
9326 9326
 	/**
9327
-	* Counts all month owners
9328
-	*
9329
-	* @return Array the month list
9330
-	*
9331
-	*/
9327
+	 * Counts all month owners
9328
+	 *
9329
+	 * @return Array the month list
9330
+	 *
9331
+	 */
9332 9332
 	public function countAllMonthsOwners($filters = array())
9333 9333
 	{
9334 9334
 		global $globalTimezone, $globalDBdriver;
@@ -9370,11 +9370,11 @@  discard block
 block discarded – undo
9370 9370
 	}
9371 9371
 	
9372 9372
 	/**
9373
-	* Counts all month owners
9374
-	*
9375
-	* @return Array the month list
9376
-	*
9377
-	*/
9373
+	 * Counts all month owners
9374
+	 *
9375
+	 * @return Array the month list
9376
+	 *
9377
+	 */
9378 9378
 	public function countAllMonthsOwnersByAirlines($filters = array())
9379 9379
 	{
9380 9380
 		global $globalTimezone, $globalDBdriver;
@@ -9417,11 +9417,11 @@  discard block
 block discarded – undo
9417 9417
 	}
9418 9418
 
9419 9419
 	/**
9420
-	* Counts all month pilot
9421
-	*
9422
-	* @return Array the month list
9423
-	*
9424
-	*/
9420
+	 * Counts all month pilot
9421
+	 *
9422
+	 * @return Array the month list
9423
+	 *
9424
+	 */
9425 9425
 	public function countAllMonthsPilots($filters = array())
9426 9426
 	{
9427 9427
 		global $globalTimezone, $globalDBdriver;
@@ -9463,11 +9463,11 @@  discard block
 block discarded – undo
9463 9463
 	}
9464 9464
 	
9465 9465
 	/**
9466
-	* Counts all month pilot
9467
-	*
9468
-	* @return Array the month list
9469
-	*
9470
-	*/
9466
+	 * Counts all month pilot
9467
+	 *
9468
+	 * @return Array the month list
9469
+	 *
9470
+	 */
9471 9471
 	public function countAllMonthsPilotsByAirlines($filters = array())
9472 9472
 	{
9473 9473
 		global $globalTimezone, $globalDBdriver;
@@ -9510,11 +9510,11 @@  discard block
 block discarded – undo
9510 9510
 	}
9511 9511
 
9512 9512
 	/**
9513
-	* Counts all month airline
9514
-	*
9515
-	* @return Array the month list
9516
-	*
9517
-	*/
9513
+	 * Counts all month airline
9514
+	 *
9515
+	 * @return Array the month list
9516
+	 *
9517
+	 */
9518 9518
 	public function countAllMonthsAirlines($filters = array())
9519 9519
 	{
9520 9520
 		global $globalTimezone, $globalDBdriver;
@@ -9556,11 +9556,11 @@  discard block
 block discarded – undo
9556 9556
 	}
9557 9557
 	
9558 9558
 	/**
9559
-	* Counts all month aircraft
9560
-	*
9561
-	* @return Array the month list
9562
-	*
9563
-	*/
9559
+	 * Counts all month aircraft
9560
+	 *
9561
+	 * @return Array the month list
9562
+	 *
9563
+	 */
9564 9564
 	public function countAllMonthsAircrafts($filters = array())
9565 9565
 	{
9566 9566
 		global $globalTimezone, $globalDBdriver;
@@ -9603,11 +9603,11 @@  discard block
 block discarded – undo
9603 9603
 	
9604 9604
 
9605 9605
 	/**
9606
-	* Counts all month aircraft
9607
-	*
9608
-	* @return Array the month list
9609
-	*
9610
-	*/
9606
+	 * Counts all month aircraft
9607
+	 *
9608
+	 * @return Array the month list
9609
+	 *
9610
+	 */
9611 9611
 	public function countAllMonthsAircraftsByAirlines($filters = array())
9612 9612
 	{
9613 9613
 		global $globalTimezone, $globalDBdriver;
@@ -9650,11 +9650,11 @@  discard block
 block discarded – undo
9650 9650
 	}
9651 9651
 
9652 9652
 	/**
9653
-	* Counts all month real arrival
9654
-	*
9655
-	* @return Array the month list
9656
-	*
9657
-	*/
9653
+	 * Counts all month real arrival
9654
+	 *
9655
+	 * @return Array the month list
9656
+	 *
9657
+	 */
9658 9658
 	public function countAllMonthsRealArrivals($filters = array())
9659 9659
 	{
9660 9660
 		global $globalTimezone, $globalDBdriver;
@@ -9697,11 +9697,11 @@  discard block
 block discarded – undo
9697 9697
 	
9698 9698
 
9699 9699
 	/**
9700
-	* Counts all month real arrival
9701
-	*
9702
-	* @return Array the month list
9703
-	*
9704
-	*/
9700
+	 * Counts all month real arrival
9701
+	 *
9702
+	 * @return Array the month list
9703
+	 *
9704
+	 */
9705 9705
 	public function countAllMonthsRealArrivalsByAirlines($filters = array())
9706 9706
 	{
9707 9707
 		global $globalTimezone, $globalDBdriver;
@@ -9745,11 +9745,11 @@  discard block
 block discarded – undo
9745 9745
 	
9746 9746
 
9747 9747
 	/**
9748
-	* Counts all dates during the last year
9749
-	*
9750
-	* @return Array the date list
9751
-	*
9752
-	*/
9748
+	 * Counts all dates during the last year
9749
+	 *
9750
+	 * @return Array the date list
9751
+	 *
9752
+	 */
9753 9753
 	public function countAllMonthsLastYear($filters)
9754 9754
 	{
9755 9755
 		global $globalTimezone, $globalDBdriver;
@@ -9771,7 +9771,7 @@  discard block
 block discarded – undo
9771 9771
 			$query .= " GROUP BY year_name, month_name
9772 9772
 								ORDER BY year_name, month_name ASC";
9773 9773
 			$query_data = array(':offset' => $offset);
9774
-    		}
9774
+			}
9775 9775
 		
9776 9776
 		$sth = $this->db->prepare($query);
9777 9777
 		$sth->execute($query_data);
@@ -9794,11 +9794,11 @@  discard block
 block discarded – undo
9794 9794
 	
9795 9795
 	
9796 9796
 	/**
9797
-	* Counts all hours
9798
-	*
9799
-	* @return Array the hour list
9800
-	*
9801
-	*/
9797
+	 * Counts all hours
9798
+	 *
9799
+	 * @return Array the hour list
9800
+	 *
9801
+	 */
9802 9802
 	public function countAllHours($orderby,$filters = array())
9803 9803
 	{
9804 9804
 		global $globalTimezone, $globalDBdriver;
@@ -9859,11 +9859,11 @@  discard block
 block discarded – undo
9859 9859
 	}
9860 9860
 	
9861 9861
 	/**
9862
-	* Counts all hours
9863
-	*
9864
-	* @return Array the hour list
9865
-	*
9866
-	*/
9862
+	 * Counts all hours
9863
+	 *
9864
+	 * @return Array the hour list
9865
+	 *
9866
+	 */
9867 9867
 	public function countAllHoursByAirlines($orderby, $filters = array())
9868 9868
 	{
9869 9869
 		global $globalTimezone, $globalDBdriver;
@@ -9926,11 +9926,11 @@  discard block
 block discarded – undo
9926 9926
 
9927 9927
 
9928 9928
 	/**
9929
-	* Counts all hours by airline
9930
-	*
9931
-	* @return Array the hour list
9932
-	*
9933
-	*/
9929
+	 * Counts all hours by airline
9930
+	 *
9931
+	 * @return Array the hour list
9932
+	 *
9933
+	 */
9934 9934
 	public function countAllHoursByAirline($airline_icao, $filters = array())
9935 9935
 	{
9936 9936
 		global $globalTimezone, $globalDBdriver;
@@ -9976,11 +9976,11 @@  discard block
 block discarded – undo
9976 9976
 	
9977 9977
 	
9978 9978
 	/**
9979
-	* Counts all hours by aircraft
9980
-	*
9981
-	* @return Array the hour list
9982
-	*
9983
-	*/
9979
+	 * Counts all hours by aircraft
9980
+	 *
9981
+	 * @return Array the hour list
9982
+	 *
9983
+	 */
9984 9984
 	public function countAllHoursByAircraft($aircraft_icao, $filters = array())
9985 9985
 	{
9986 9986
 		global $globalTimezone, $globalDBdriver;
@@ -10023,11 +10023,11 @@  discard block
 block discarded – undo
10023 10023
 	
10024 10024
 	
10025 10025
 	/**
10026
-	* Counts all hours by aircraft registration
10027
-	*
10028
-	* @return Array the hour list
10029
-	*
10030
-	*/
10026
+	 * Counts all hours by aircraft registration
10027
+	 *
10028
+	 * @return Array the hour list
10029
+	 *
10030
+	 */
10031 10031
 	public function countAllHoursByRegistration($registration, $filters = array())
10032 10032
 	{
10033 10033
 		global $globalTimezone, $globalDBdriver;
@@ -10070,11 +10070,11 @@  discard block
 block discarded – undo
10070 10070
 	
10071 10071
 	
10072 10072
 	/**
10073
-	* Counts all hours by airport
10074
-	*
10075
-	* @return Array the hour list
10076
-	*
10077
-	*/
10073
+	 * Counts all hours by airport
10074
+	 *
10075
+	 * @return Array the hour list
10076
+	 *
10077
+	 */
10078 10078
 	public function countAllHoursByAirport($airport_icao, $filters = array())
10079 10079
 	{
10080 10080
 		global $globalTimezone, $globalDBdriver;
@@ -10118,11 +10118,11 @@  discard block
 block discarded – undo
10118 10118
 	
10119 10119
 	
10120 10120
 	/**
10121
-	* Counts all hours by manufacturer
10122
-	*
10123
-	* @return Array the hour list
10124
-	*
10125
-	*/
10121
+	 * Counts all hours by manufacturer
10122
+	 *
10123
+	 * @return Array the hour list
10124
+	 *
10125
+	 */
10126 10126
 	public function countAllHoursByManufacturer($aircraft_manufacturer,$filters =array())
10127 10127
 	{
10128 10128
 		global $globalTimezone, $globalDBdriver;
@@ -10166,11 +10166,11 @@  discard block
 block discarded – undo
10166 10166
 	
10167 10167
 	
10168 10168
 	/**
10169
-	* Counts all hours by date
10170
-	*
10171
-	* @return Array the hour list
10172
-	*
10173
-	*/
10169
+	 * Counts all hours by date
10170
+	 *
10171
+	 * @return Array the hour list
10172
+	 *
10173
+	 */
10174 10174
 	public function countAllHoursByDate($date, $filters = array())
10175 10175
 	{
10176 10176
 		global $globalTimezone, $globalDBdriver;
@@ -10214,11 +10214,11 @@  discard block
 block discarded – undo
10214 10214
 	
10215 10215
 	
10216 10216
 	/**
10217
-	* Counts all hours by a ident/callsign
10218
-	*
10219
-	* @return Array the hour list
10220
-	*
10221
-	*/
10217
+	 * Counts all hours by a ident/callsign
10218
+	 *
10219
+	 * @return Array the hour list
10220
+	 *
10221
+	 */
10222 10222
 	public function countAllHoursByIdent($ident, $filters = array())
10223 10223
 	{
10224 10224
 		global $globalTimezone, $globalDBdriver;
@@ -10261,11 +10261,11 @@  discard block
 block discarded – undo
10261 10261
 	}
10262 10262
 	
10263 10263
 	/**
10264
-	* Counts all hours by a owner
10265
-	*
10266
-	* @return Array the hour list
10267
-	*
10268
-	*/
10264
+	 * Counts all hours by a owner
10265
+	 *
10266
+	 * @return Array the hour list
10267
+	 *
10268
+	 */
10269 10269
 	public function countAllHoursByOwner($owner, $filters = array())
10270 10270
 	{
10271 10271
 		global $globalTimezone, $globalDBdriver;
@@ -10308,11 +10308,11 @@  discard block
 block discarded – undo
10308 10308
 	}
10309 10309
 	
10310 10310
 	/**
10311
-	* Counts all hours by a pilot
10312
-	*
10313
-	* @return Array the hour list
10314
-	*
10315
-	*/
10311
+	 * Counts all hours by a pilot
10312
+	 *
10313
+	 * @return Array the hour list
10314
+	 *
10315
+	 */
10316 10316
 	public function countAllHoursByPilot($pilot, $filters = array())
10317 10317
 	{
10318 10318
 		global $globalTimezone, $globalDBdriver;
@@ -10357,11 +10357,11 @@  discard block
 block discarded – undo
10357 10357
 	
10358 10358
 	
10359 10359
 	/**
10360
-	* Counts all hours by route
10361
-	*
10362
-	* @return Array the hour list
10363
-	*
10364
-	*/
10360
+	 * Counts all hours by route
10361
+	 *
10362
+	 * @return Array the hour list
10363
+	 *
10364
+	 */
10365 10365
 	public function countAllHoursByRoute($departure_airport_icao, $arrival_airport_icao, $filters =array())
10366 10366
 	{
10367 10367
 		global $globalTimezone, $globalDBdriver;
@@ -10405,11 +10405,11 @@  discard block
 block discarded – undo
10405 10405
 	
10406 10406
 	
10407 10407
 	/**
10408
-	* Counts all hours by country
10409
-	*
10410
-	* @return Array the hour list
10411
-	*
10412
-	*/
10408
+	 * Counts all hours by country
10409
+	 *
10410
+	 * @return Array the hour list
10411
+	 *
10412
+	 */
10413 10413
 	public function countAllHoursByCountry($country, $filters = array())
10414 10414
 	{
10415 10415
 		global $globalTimezone, $globalDBdriver;
@@ -10454,11 +10454,11 @@  discard block
 block discarded – undo
10454 10454
 
10455 10455
 
10456 10456
 	/**
10457
-	* Counts all aircraft that have flown over
10458
-	*
10459
-	* @return Integer the number of aircrafts
10460
-	*
10461
-	*/
10457
+	 * Counts all aircraft that have flown over
10458
+	 *
10459
+	 * @return Integer the number of aircrafts
10460
+	 *
10461
+	 */
10462 10462
 	public function countOverallAircrafts($filters = array(),$year = '',$month = '')
10463 10463
 	{
10464 10464
 		global $globalDBdriver;
@@ -10491,11 +10491,11 @@  discard block
 block discarded – undo
10491 10491
 	}
10492 10492
 
10493 10493
 	/**
10494
-	* Counts all flight that really arrival
10495
-	*
10496
-	* @return Integer the number of aircrafts
10497
-	*
10498
-	*/
10494
+	 * Counts all flight that really arrival
10495
+	 *
10496
+	 * @return Integer the number of aircrafts
10497
+	 *
10498
+	 */
10499 10499
 	public function countOverallArrival($filters = array(),$year = '',$month = '')
10500 10500
 	{
10501 10501
 		global $globalDBdriver;
@@ -10528,11 +10528,11 @@  discard block
 block discarded – undo
10528 10528
 	}
10529 10529
 
10530 10530
 	/**
10531
-	* Counts all pilots that have flown over
10532
-	*
10533
-	* @return Integer the number of pilots
10534
-	*
10535
-	*/
10531
+	 * Counts all pilots that have flown over
10532
+	 *
10533
+	 * @return Integer the number of pilots
10534
+	 *
10535
+	 */
10536 10536
 	public function countOverallPilots($filters = array(),$year = '',$month = '')
10537 10537
 	{
10538 10538
 		global $globalDBdriver;
@@ -10564,11 +10564,11 @@  discard block
 block discarded – undo
10564 10564
 	}
10565 10565
 
10566 10566
 	/**
10567
-	* Counts all owners that have flown over
10568
-	*
10569
-	* @return Integer the number of owners
10570
-	*
10571
-	*/
10567
+	 * Counts all owners that have flown over
10568
+	 *
10569
+	 * @return Integer the number of owners
10570
+	 *
10571
+	 */
10572 10572
 	public function countOverallOwners($filters = array(),$year = '',$month = '')
10573 10573
 	{
10574 10574
 		global $globalDBdriver;
@@ -10601,11 +10601,11 @@  discard block
 block discarded – undo
10601 10601
 	
10602 10602
 	
10603 10603
 	/**
10604
-	* Counts all flights that have flown over
10605
-	*
10606
-	* @return Integer the number of flights
10607
-	*
10608
-	*/
10604
+	 * Counts all flights that have flown over
10605
+	 *
10606
+	 * @return Integer the number of flights
10607
+	 *
10608
+	 */
10609 10609
 	public function countOverallFlights($filters = array(),$year = '',$month = '')
10610 10610
 	{
10611 10611
 		global $globalDBdriver;
@@ -10640,11 +10640,11 @@  discard block
 block discarded – undo
10640 10640
 	}
10641 10641
 	
10642 10642
 	/**
10643
-	* Counts all military flights that have flown over
10644
-	*
10645
-	* @return Integer the number of flights
10646
-	*
10647
-	*/
10643
+	 * Counts all military flights that have flown over
10644
+	 *
10645
+	 * @return Integer the number of flights
10646
+	 *
10647
+	 */
10648 10648
 	public function countOverallMilitaryFlights($filters = array(),$year = '',$month = '')
10649 10649
 	{
10650 10650
 		global $globalDBdriver;
@@ -10679,11 +10679,11 @@  discard block
 block discarded – undo
10679 10679
 	
10680 10680
 	
10681 10681
 	/**
10682
-	* Counts all airlines that have flown over
10683
-	*
10684
-	* @return Integer the number of airlines
10685
-	*
10686
-	*/
10682
+	 * Counts all airlines that have flown over
10683
+	 *
10684
+	 * @return Integer the number of airlines
10685
+	 *
10686
+	 */
10687 10687
 	public function countOverallAirlines($filters = array(),$year = '',$month = '')
10688 10688
 	{
10689 10689
 		global $globalDBdriver;
@@ -10710,8 +10710,8 @@  discard block
 block discarded – undo
10710 10710
 				$query_values = array_merge($query_values,array(':month' => $month));
10711 10711
 			}
10712 10712
 		}
10713
-                if ($query == '') $queryi .= $this->getFilter($filters);
10714
-                else $queryi .= $this->getFilter($filters,true,true).substr($query,4);
10713
+				if ($query == '') $queryi .= $this->getFilter($filters);
10714
+				else $queryi .= $this->getFilter($filters,true,true).substr($query,4);
10715 10715
 
10716 10716
 
10717 10717
 		$sth = $this->db->prepare($queryi);
@@ -10721,11 +10721,11 @@  discard block
 block discarded – undo
10721 10721
 
10722 10722
   
10723 10723
 	/**
10724
-	* Counts all hours of today
10725
-	*
10726
-	* @return Array the hour list
10727
-	*
10728
-	*/
10724
+	 * Counts all hours of today
10725
+	 *
10726
+	 * @return Array the hour list
10727
+	 *
10728
+	 */
10729 10729
 	public function countAllHoursFromToday($filters = array())
10730 10730
 	{
10731 10731
 		global $globalTimezone, $globalDBdriver;
@@ -10765,11 +10765,11 @@  discard block
 block discarded – undo
10765 10765
 	}
10766 10766
     
10767 10767
 	/**
10768
-	* Gets all the spotter information based on calculated upcoming flights
10769
-	*
10770
-	* @return Array the spotter information
10771
-	*
10772
-	*/
10768
+	 * Gets all the spotter information based on calculated upcoming flights
10769
+	 *
10770
+	 * @return Array the spotter information
10771
+	 *
10772
+	 */
10773 10773
 	public function getUpcomingFlights($limit = '', $sort = '', $filters = array())
10774 10774
 	{
10775 10775
 		global $global_query, $globalDBdriver, $globalTimezone;
@@ -10844,12 +10844,12 @@  discard block
 block discarded – undo
10844 10844
 	}
10845 10845
     
10846 10846
     
10847
-     /**
10848
-	* Gets the Barrie Spotter ID based on the FlightAware ID
10849
-	*
10850
-	* @return Integer the Barrie Spotter ID
10847
+	 /**
10848
+	  * Gets the Barrie Spotter ID based on the FlightAware ID
10849
+	  *
10850
+	  * @return Integer the Barrie Spotter ID
10851 10851
 q	*
10852
-	*/
10852
+	  */
10853 10853
 	public function getSpotterIDBasedOnFlightAwareID($flightaware_id)
10854 10854
 	{
10855 10855
 		$flightaware_id = filter_var($flightaware_id,FILTER_SANITIZE_STRING);
@@ -10870,13 +10870,13 @@  discard block
 block discarded – undo
10870 10870
   
10871 10871
  
10872 10872
 	/**
10873
-	* Parses a date string
10874
-	*
10875
-	* @param String $dateString the date string
10876
-	* @param String $timezone the timezone of a user
10877
-	* @return Array the time information
10878
-	*
10879
-	*/
10873
+	 * Parses a date string
10874
+	 *
10875
+	 * @param String $dateString the date string
10876
+	 * @param String $timezone the timezone of a user
10877
+	 * @return Array the time information
10878
+	 *
10879
+	 */
10880 10880
 	public function parseDateString($dateString, $timezone = '')
10881 10881
 	{
10882 10882
 		$time_array = array();
@@ -10912,12 +10912,12 @@  discard block
 block discarded – undo
10912 10912
 	
10913 10913
 	
10914 10914
 	/**
10915
-	* Parses the direction degrees to working
10916
-	*
10917
-	* @param Float $direction the direction in degrees
10918
-	* @return Array the direction information
10919
-	*
10920
-	*/
10915
+	 * Parses the direction degrees to working
10916
+	 *
10917
+	 * @param Float $direction the direction in degrees
10918
+	 * @return Array the direction information
10919
+	 *
10920
+	 */
10921 10921
 	public function parseDirection($direction = 0)
10922 10922
 	{
10923 10923
 		if ($direction == '') $direction = 0;
@@ -10996,12 +10996,12 @@  discard block
 block discarded – undo
10996 10996
 	
10997 10997
 	
10998 10998
 	/**
10999
-	* Gets the aircraft registration
11000
-	*
11001
-	* @param String $flightaware_id the flight aware id
11002
-	* @return String the aircraft registration
11003
-	*
11004
-	*/
10999
+	 * Gets the aircraft registration
11000
+	 *
11001
+	 * @param String $flightaware_id the flight aware id
11002
+	 * @return String the aircraft registration
11003
+	 *
11004
+	 */
11005 11005
 	
11006 11006
 	public function getAircraftRegistration($flightaware_id)
11007 11007
 	{
@@ -11030,12 +11030,12 @@  discard block
 block discarded – undo
11030 11030
 
11031 11031
 
11032 11032
 	/**
11033
-	* Gets the aircraft registration from ModeS
11034
-	*
11035
-	* @param String $aircraft_modes the flight ModeS in hex
11036
-	* @return String the aircraft registration
11037
-	*
11038
-	*/
11033
+	 * Gets the aircraft registration from ModeS
11034
+	 *
11035
+	 * @param String $aircraft_modes the flight ModeS in hex
11036
+	 * @return String the aircraft registration
11037
+	 *
11038
+	 */
11039 11039
 	public function getAircraftRegistrationBymodeS($aircraft_modes)
11040 11040
 	{
11041 11041
 		$aircraft_modes = filter_var($aircraft_modes,FILTER_SANITIZE_STRING);
@@ -11048,19 +11048,19 @@  discard block
 block discarded – undo
11048 11048
 		$row = $sth->fetch(PDO::FETCH_ASSOC);
11049 11049
 		$sth->closeCursor();
11050 11050
 		if (count($row) > 0) {
11051
-		    //return $row['Registration'];
11052
-		    return $row['registration'];
11051
+			//return $row['Registration'];
11052
+			return $row['registration'];
11053 11053
 		} else return '';
11054 11054
 	
11055 11055
 	}
11056 11056
 
11057 11057
 	/**
11058
-	* Gets the aircraft type from ModeS
11059
-	*
11060
-	* @param String $aircraft_modes the flight ModeS in hex
11061
-	* @return String the aircraft type
11062
-	*
11063
-	*/
11058
+	 * Gets the aircraft type from ModeS
11059
+	 *
11060
+	 * @param String $aircraft_modes the flight ModeS in hex
11061
+	 * @return String the aircraft type
11062
+	 *
11063
+	 */
11064 11064
 	public function getAircraftTypeBymodeS($aircraft_modes)
11065 11065
 	{
11066 11066
 		$aircraft_modes = filter_var($aircraft_modes,FILTER_SANITIZE_STRING);
@@ -11073,19 +11073,19 @@  discard block
 block discarded – undo
11073 11073
 		$row = $sth->fetch(PDO::FETCH_ASSOC);
11074 11074
 		$sth->closeCursor();
11075 11075
 		if (count($row) > 0) {
11076
-		    if ($row['type_flight'] == null) return '';
11077
-		    else return $row['type_flight'];
11076
+			if ($row['type_flight'] == null) return '';
11077
+			else return $row['type_flight'];
11078 11078
 		} else return '';
11079 11079
 	
11080 11080
 	}
11081 11081
 
11082 11082
 	/**
11083
-	* Gets Country from latitude/longitude
11084
-	*
11085
-	* @param Float $latitude latitute of the flight
11086
-	* @param Float $longitude longitute of the flight
11087
-	* @return String the countrie
11088
-	*/
11083
+	 * Gets Country from latitude/longitude
11084
+	 *
11085
+	 * @param Float $latitude latitute of the flight
11086
+	 * @param Float $longitude longitute of the flight
11087
+	 * @return String the countrie
11088
+	 */
11089 11089
 	public function getCountryFromLatitudeLongitude($latitude,$longitude)
11090 11090
 	{
11091 11091
 		global $globalDBdriver, $globalDebug;
@@ -11122,11 +11122,11 @@  discard block
 block discarded – undo
11122 11122
 	}
11123 11123
 
11124 11124
 	/**
11125
-	* Gets Country from iso2
11126
-	*
11127
-	* @param String $iso2 ISO2 country code
11128
-	* @return String the countrie
11129
-	*/
11125
+	 * Gets Country from iso2
11126
+	 *
11127
+	 * @param String $iso2 ISO2 country code
11128
+	 * @return String the countrie
11129
+	 */
11130 11130
 	public function getCountryFromISO2($iso2)
11131 11131
 	{
11132 11132
 		global $globalDBdriver, $globalDebug;
@@ -11154,12 +11154,12 @@  discard block
 block discarded – undo
11154 11154
 	}
11155 11155
 
11156 11156
 	/**
11157
-	* converts the registration code using the country prefix
11158
-	*
11159
-	* @param String $registration the aircraft registration
11160
-	* @return String the aircraft registration
11161
-	*
11162
-	*/
11157
+	 * converts the registration code using the country prefix
11158
+	 *
11159
+	 * @param String $registration the aircraft registration
11160
+	 * @return String the aircraft registration
11161
+	 *
11162
+	 */
11163 11163
 	public function convertAircraftRegistration($registration)
11164 11164
 	{
11165 11165
 		$registration = filter_var($registration,FILTER_SANITIZE_STRING);
@@ -11211,12 +11211,12 @@  discard block
 block discarded – undo
11211 11211
 	}
11212 11212
 
11213 11213
 	/**
11214
-	* Country from the registration code
11215
-	*
11216
-	* @param String $registration the aircraft registration
11217
-	* @return String the country
11218
-	*
11219
-	*/
11214
+	 * Country from the registration code
11215
+	 *
11216
+	 * @param String $registration the aircraft registration
11217
+	 * @return String the country
11218
+	 *
11219
+	 */
11220 11220
 	public function countryFromAircraftRegistration($registration)
11221 11221
 	{
11222 11222
 		$registration = filter_var($registration,FILTER_SANITIZE_STRING);
@@ -11235,8 +11235,8 @@  discard block
 block discarded – undo
11235 11235
 				$country = $row['country'];
11236 11236
 			}
11237 11237
 		} else {
11238
-    			$registration_1 = substr($registration, 0, 1);
11239
-		        $registration_2 = substr($registration, 0, 2);
11238
+				$registration_1 = substr($registration, 0, 1);
11239
+				$registration_2 = substr($registration, 0, 2);
11240 11240
 
11241 11241
 			$country = '';
11242 11242
 			//first get the prefix based on two characters
@@ -11272,12 +11272,12 @@  discard block
 block discarded – undo
11272 11272
 	}
11273 11273
 
11274 11274
 	/**
11275
-	* Registration prefix from the registration code
11276
-	*
11277
-	* @param String $registration the aircraft registration
11278
-	* @return String the registration prefix
11279
-	*
11280
-	*/
11275
+	 * Registration prefix from the registration code
11276
+	 *
11277
+	 * @param String $registration the aircraft registration
11278
+	 * @return String the registration prefix
11279
+	 *
11280
+	 */
11281 11281
 	public function registrationPrefixFromAircraftRegistration($registration)
11282 11282
 	{
11283 11283
 		$registration = filter_var($registration,FILTER_SANITIZE_STRING);
@@ -11296,8 +11296,8 @@  discard block
 block discarded – undo
11296 11296
 				//$country = $row['country'];
11297 11297
 			}
11298 11298
 		} else {
11299
-    			$registration_1 = substr($registration, 0, 1);
11300
-		        $registration_2 = substr($registration, 0, 2);
11299
+				$registration_1 = substr($registration, 0, 1);
11300
+				$registration_2 = substr($registration, 0, 2);
11301 11301
 
11302 11302
 			//first get the prefix based on two characters
11303 11303
 			$query  = "SELECT aircraft_registration.registration_prefix, aircraft_registration.country FROM aircraft_registration WHERE registration_prefix = :registration_2 LIMIT 1";
@@ -11333,12 +11333,12 @@  discard block
 block discarded – undo
11333 11333
 
11334 11334
 
11335 11335
 	/**
11336
-	* Country from the registration code
11337
-	*
11338
-	* @param String $registration the aircraft registration
11339
-	* @return String the country
11340
-	*
11341
-	*/
11336
+	 * Country from the registration code
11337
+	 *
11338
+	 * @param String $registration the aircraft registration
11339
+	 * @return String the country
11340
+	 *
11341
+	 */
11342 11342
 	public function countryFromAircraftRegistrationCode($registration)
11343 11343
 	{
11344 11344
 		$registration = filter_var($registration,FILTER_SANITIZE_STRING);
@@ -11355,11 +11355,11 @@  discard block
 block discarded – undo
11355 11355
 	}
11356 11356
 	
11357 11357
 	/**
11358
-	* Set a new highlight value for a flight
11359
-	*
11360
-	* @param String $flightaware_id flightaware_id from spotter_output table
11361
-	* @param String $highlight New highlight value
11362
-	*/
11358
+	 * Set a new highlight value for a flight
11359
+	 *
11360
+	 * @param String $flightaware_id flightaware_id from spotter_output table
11361
+	 * @param String $highlight New highlight value
11362
+	 */
11363 11363
 	public function setHighlightFlight($flightaware_id,$highlight) {
11364 11364
 		
11365 11365
 		$query  = "UPDATE spotter_output SET highlight = :highlight WHERE flightaware_id = :flightaware_id";
@@ -11368,12 +11368,12 @@  discard block
 block discarded – undo
11368 11368
 	}
11369 11369
 
11370 11370
 	/**
11371
-	* Set a new highlight value for a flight by Registration
11372
-	*
11373
-	* @param String $registration Registration of the aircraft
11374
-	* @param String $date Date of spotted aircraft
11375
-	* @param String $highlight New highlight value
11376
-	*/
11371
+	 * Set a new highlight value for a flight by Registration
11372
+	 *
11373
+	 * @param String $registration Registration of the aircraft
11374
+	 * @param String $date Date of spotted aircraft
11375
+	 * @param String $highlight New highlight value
11376
+	 */
11377 11377
 	public function setHighlightFlightByRegistration($registration,$highlight, $date = '') {
11378 11378
 		if ($date == '') {
11379 11379
 			$query  = "UPDATE spotter_output SET highlight = :highlight WHERE spotter_id IN (SELECT MAX(spotter_id) FROM spotter_output WHERE registration = :registration)";
@@ -11387,12 +11387,12 @@  discard block
 block discarded – undo
11387 11387
 	}
11388 11388
 	
11389 11389
 	/**
11390
-	* Gets the short url from bit.ly
11391
-	*
11392
-	* @param String $url the full url
11393
-	* @return String the bit.ly url
11394
-	*
11395
-	*/
11390
+	 * Gets the short url from bit.ly
11391
+	 *
11392
+	 * @param String $url the full url
11393
+	 * @return String the bit.ly url
11394
+	 *
11395
+	 */
11396 11396
 	public function getBitlyURL($url)
11397 11397
 	{
11398 11398
 		global $globalBitlyAccessToken;
@@ -11681,11 +11681,11 @@  discard block
 block discarded – undo
11681 11681
 			$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 
11682 11682
 	                      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)) 
11683 11683
 	                      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;";
11684
-                } else {
11684
+				} else {
11685 11685
 			$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 
11686 11686
 	                      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)) 
11687 11687
 	                      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;";
11688
-    		}
11688
+			}
11689 11689
 		$sth = $this->db->prepare($query);
11690 11690
 		$sth->execute();
11691 11691
 		return $sth->fetchAll(PDO::FETCH_ASSOC);
Please login to merge, or discard this patch.