Completed
Push — master ( 5bb40b...bd4c06 )
by Yannick
05:56
created
require/class.Spotter.php 1 patch
Indentation   +1437 added lines, -1437 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);
@@ -2868,11 +2868,11 @@  discard block
 block discarded – undo
2868 2868
 	} 
2869 2869
 
2870 2870
 	/**
2871
-	* Gets a list of all owner names
2872
-	*
2873
-	* @return Array list of owner names
2874
-	*
2875
-	*/
2871
+	 * Gets a list of all owner names
2872
+	 *
2873
+	 * @return Array list of owner names
2874
+	 *
2875
+	 */
2876 2876
 	public function getAllOwnerNames($filters = array())
2877 2877
 	{
2878 2878
 		$filter_query = $this->getFilter($filters,true,true);
@@ -2886,11 +2886,11 @@  discard block
 block discarded – undo
2886 2886
 	} 
2887 2887
 
2888 2888
 	/**
2889
-	* Gets a list of all pilot names and pilot ids
2890
-	*
2891
-	* @return Array list of pilot names and pilot ids
2892
-	*
2893
-	*/
2889
+	 * Gets a list of all pilot names and pilot ids
2890
+	 *
2891
+	 * @return Array list of pilot names and pilot ids
2892
+	 *
2893
+	 */
2894 2894
 	public function getAllPilotNames($filters = array())
2895 2895
 	{
2896 2896
 		$filter_query = $this->getFilter($filters,true,true);
@@ -2905,11 +2905,11 @@  discard block
 block discarded – undo
2905 2905
 	
2906 2906
 	
2907 2907
 	/**
2908
-	* Gets a list of all departure & arrival airport countries
2909
-	*
2910
-	* @return Array list of airport countries
2911
-	*
2912
-	*/
2908
+	 * Gets a list of all departure & arrival airport countries
2909
+	 *
2910
+	 * @return Array list of airport countries
2911
+	 *
2912
+	 */
2913 2913
 	public function getAllAirportCountries($filters = array())
2914 2914
 	{
2915 2915
 		$airport_array = array();
@@ -2957,11 +2957,11 @@  discard block
 block discarded – undo
2957 2957
 	
2958 2958
 	
2959 2959
 	/**
2960
-	* Gets a list of all countries (airline, departure airport & arrival airport)
2961
-	*
2962
-	* @return Array list of countries
2963
-	*
2964
-	*/
2960
+	 * Gets a list of all countries (airline, departure airport & arrival airport)
2961
+	 *
2962
+	 * @return Array list of countries
2963
+	 *
2964
+	 */
2965 2965
 	public function getAllCountries($filters = array())
2966 2966
 	{
2967 2967
 		$Connection= new Connection($this->db);
@@ -3038,11 +3038,11 @@  discard block
 block discarded – undo
3038 3038
 	
3039 3039
 	
3040 3040
 	/**
3041
-	* Gets a list of all idents/callsigns
3042
-	*
3043
-	* @return Array list of ident/callsign names
3044
-	*
3045
-	*/
3041
+	 * Gets a list of all idents/callsigns
3042
+	 *
3043
+	 * @return Array list of ident/callsign names
3044
+	 *
3045
+	 */
3046 3046
 	public function getAllIdents($filters = array())
3047 3047
 	{
3048 3048
 		$filter_query = $this->getFilter($filters,true,true);
@@ -3066,9 +3066,9 @@  discard block
 block discarded – undo
3066 3066
 	}
3067 3067
 
3068 3068
 	/**
3069
-	* Get a list of flights from airport since 7 days
3070
-	* @return Array number, icao, name and city of airports
3071
-	*/
3069
+	 * Get a list of flights from airport since 7 days
3070
+	 * @return Array number, icao, name and city of airports
3071
+	 */
3072 3072
 
3073 3073
 	public function getLast7DaysAirportsDeparture($airport_icao = '',$filters = array()) {
3074 3074
 		global $globalTimezone, $globalDBdriver;
@@ -3099,9 +3099,9 @@  discard block
 block discarded – undo
3099 3099
 	}
3100 3100
 
3101 3101
 	/**
3102
-	* Get a list of flights from airport since 7 days
3103
-	* @return Array number, icao, name and city of airports
3104
-	*/
3102
+	 * Get a list of flights from airport since 7 days
3103
+	 * @return Array number, icao, name and city of airports
3104
+	 */
3105 3105
 
3106 3106
 	public function getLast7DaysAirportsDepartureByAirlines($airport_icao = '') {
3107 3107
 		global $globalTimezone, $globalDBdriver;
@@ -3131,9 +3131,9 @@  discard block
 block discarded – undo
3131 3131
 	}
3132 3132
 
3133 3133
 	/**
3134
-	* Get a list of flights from detected airport since 7 days
3135
-	* @return Array number, icao, name and city of airports
3136
-	*/
3134
+	 * Get a list of flights from detected airport since 7 days
3135
+	 * @return Array number, icao, name and city of airports
3136
+	 */
3137 3137
 
3138 3138
 	public function getLast7DaysDetectedAirportsDeparture($airport_icao = '', $filters = array()) {
3139 3139
 		global $globalTimezone, $globalDBdriver;
@@ -3171,9 +3171,9 @@  discard block
 block discarded – undo
3171 3171
 	}
3172 3172
 
3173 3173
 	/**
3174
-	* Get a list of flights from detected airport since 7 days
3175
-	* @return Array number, icao, name and city of airports
3176
-	*/
3174
+	 * Get a list of flights from detected airport since 7 days
3175
+	 * @return Array number, icao, name and city of airports
3176
+	 */
3177 3177
 
3178 3178
 	public function getLast7DaysDetectedAirportsDepartureByAirlines($airport_icao = '') {
3179 3179
 		global $globalTimezone, $globalDBdriver;
@@ -3215,9 +3215,9 @@  discard block
 block discarded – undo
3215 3215
 
3216 3216
 
3217 3217
 	/**
3218
-	* Get a list of flights to airport since 7 days
3219
-	* @return Array number, icao, name and city of airports
3220
-	*/
3218
+	 * Get a list of flights to airport since 7 days
3219
+	 * @return Array number, icao, name and city of airports
3220
+	 */
3221 3221
 
3222 3222
 	public function getLast7DaysAirportsArrival($airport_icao = '', $filters = array()) {
3223 3223
 		global $globalTimezone, $globalDBdriver;
@@ -3250,9 +3250,9 @@  discard block
 block discarded – undo
3250 3250
 
3251 3251
 
3252 3252
 	/**
3253
-	* Get a list of flights detected to airport since 7 days
3254
-	* @return Array number, icao, name and city of airports
3255
-	*/
3253
+	 * Get a list of flights detected to airport since 7 days
3254
+	 * @return Array number, icao, name and city of airports
3255
+	 */
3256 3256
 
3257 3257
 	public function getLast7DaysDetectedAirportsArrival($airport_icao = '',$filters = array()) {
3258 3258
 		global $globalTimezone, $globalDBdriver;
@@ -3293,9 +3293,9 @@  discard block
 block discarded – undo
3293 3293
 
3294 3294
 
3295 3295
 	/**
3296
-	* Get a list of flights to airport since 7 days
3297
-	* @return Array number, icao, name and city of airports
3298
-	*/
3296
+	 * Get a list of flights to airport since 7 days
3297
+	 * @return Array number, icao, name and city of airports
3298
+	 */
3299 3299
 
3300 3300
 	public function getLast7DaysAirportsArrivalByAirlines($airport_icao = '') {
3301 3301
 		global $globalTimezone, $globalDBdriver;
@@ -3327,9 +3327,9 @@  discard block
 block discarded – undo
3327 3327
 
3328 3328
 
3329 3329
 	/**
3330
-	* Get a list of flights detected to airport since 7 days
3331
-	* @return Array number, icao, name and city of airports
3332
-	*/
3330
+	 * Get a list of flights detected to airport since 7 days
3331
+	 * @return Array number, icao, name and city of airports
3332
+	 */
3333 3333
 
3334 3334
 	public function getLast7DaysDetectedAirportsArrivalByAirlines($airport_icao = '') {
3335 3335
 		global $globalTimezone, $globalDBdriver;
@@ -3373,11 +3373,11 @@  discard block
 block discarded – undo
3373 3373
 
3374 3374
 
3375 3375
 	/**
3376
-	* Gets a list of all dates
3377
-	*
3378
-	* @return Array list of date names
3379
-	*
3380
-	*/
3376
+	 * Gets a list of all dates
3377
+	 *
3378
+	 * @return Array list of date names
3379
+	 *
3380
+	 */
3381 3381
 	public function getAllDates()
3382 3382
 	{
3383 3383
 		global $globalTimezone, $globalDBdriver;
@@ -3418,11 +3418,11 @@  discard block
 block discarded – undo
3418 3418
 	
3419 3419
 	
3420 3420
 	/**
3421
-	* Gets all route combinations
3422
-	*
3423
-	* @return Array the route list
3424
-	*
3425
-	*/
3421
+	 * Gets all route combinations
3422
+	 *
3423
+	 * @return Array the route list
3424
+	 *
3425
+	 */
3426 3426
 	public function getAllRoutes()
3427 3427
 	{
3428 3428
 		$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 
@@ -3448,13 +3448,13 @@  discard block
 block discarded – undo
3448 3448
 	}
3449 3449
 
3450 3450
 	/**
3451
-	* Update ident spotter data
3452
-	*
3453
-	* @param String $flightaware_id the ID from flightaware
3454
-	* @param String $ident the flight ident
3455
-	* @return String success or false
3456
-	*
3457
-	*/	
3451
+	 * Update ident spotter data
3452
+	 *
3453
+	 * @param String $flightaware_id the ID from flightaware
3454
+	 * @param String $ident the flight ident
3455
+	 * @return String success or false
3456
+	 *
3457
+	 */	
3458 3458
 	public function updateIdentSpotterData($flightaware_id = '', $ident = '',$fromsource = NULL)
3459 3459
 	{
3460 3460
 		if (!is_numeric(substr($ident, 0, 3)))
@@ -3475,14 +3475,14 @@  discard block
 block discarded – undo
3475 3475
 		} else {
3476 3476
 			$airline_array = $this->getAllAirlineInfo("NA");
3477 3477
 		}
3478
-                $airline_name = $airline_array[0]['name'];
3479
-                $airline_icao = $airline_array[0]['icao'];
3480
-                $airline_country = $airline_array[0]['country'];
3481
-                $airline_type = $airline_array[0]['type'];
3478
+				$airline_name = $airline_array[0]['name'];
3479
+				$airline_icao = $airline_array[0]['icao'];
3480
+				$airline_country = $airline_array[0]['country'];
3481
+				$airline_type = $airline_array[0]['type'];
3482 3482
 
3483 3483
 
3484 3484
 		$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';
3485
-                $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);
3485
+				$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);
3486 3486
 
3487 3487
 		try {
3488 3488
 			$sth = $this->db->prepare($query);
@@ -3495,19 +3495,19 @@  discard block
 block discarded – undo
3495 3495
 
3496 3496
 	}
3497 3497
 	/**
3498
-	* Update latest spotter data
3499
-	*
3500
-	* @param String $flightaware_id the ID from flightaware
3501
-	* @param String $ident the flight ident
3502
-	* @param String $arrival_airport_icao the arrival airport
3503
-	* @return String success or false
3504
-	*
3505
-	*/	
3498
+	 * Update latest spotter data
3499
+	 *
3500
+	 * @param String $flightaware_id the ID from flightaware
3501
+	 * @param String $ident the flight ident
3502
+	 * @param String $arrival_airport_icao the arrival airport
3503
+	 * @return String success or false
3504
+	 *
3505
+	 */	
3506 3506
 	public function updateLatestSpotterData($flightaware_id = '', $ident = '', $latitude = '', $longitude = '', $altitude = '', $ground = false, $groundspeed = NULL, $date = '', $arrival_airport_icao = '',$arrival_airport_time = '')
3507 3507
 	{
3508 3508
 		if ($groundspeed == '') $groundspeed = NULL;
3509 3509
 		$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';
3510
-                $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);
3510
+				$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);
3511 3511
 
3512 3512
 		try {
3513 3513
 			$sth = $this->db->prepare($query);
@@ -3521,32 +3521,32 @@  discard block
 block discarded – undo
3521 3521
 	}
3522 3522
 
3523 3523
 	/**
3524
-	* Adds a new spotter data
3525
-	*
3526
-	* @param String $flightaware_id the ID from flightaware
3527
-	* @param String $ident the flight ident
3528
-	* @param String $aircraft_icao the aircraft type
3529
-	* @param String $departure_airport_icao the departure airport
3530
-	* @param String $arrival_airport_icao the arrival airport
3531
-	* @param String $latitude latitude of flight
3532
-	* @param String $longitude latitude of flight
3533
-	* @param String $waypoints waypoints of flight
3534
-	* @param String $altitude altitude of flight
3535
-	* @param String $heading heading of flight
3536
-	* @param String $groundspeed speed of flight
3537
-	* @param String $date date of flight
3538
-	* @param String $departure_airport_time departure time of flight
3539
-	* @param String $arrival_airport_time arrival time of flight
3540
-	* @param String $squawk squawk code of flight
3541
-	* @param String $route_stop route stop of flight
3542
-	* @param String $highlight highlight or not
3543
-	* @param String $ModeS ModesS code of flight
3544
-	* @param String $registration registration code of flight
3545
-	* @param String $pilot_id pilot id of flight (for virtual airlines)
3546
-	* @param String $pilot_name pilot name of flight (for virtual airlines)
3547
-	* @param String $verticalrate vertival rate of flight
3548
-	* @return String success or false
3549
-	*/
3524
+	 * Adds a new spotter data
3525
+	 *
3526
+	 * @param String $flightaware_id the ID from flightaware
3527
+	 * @param String $ident the flight ident
3528
+	 * @param String $aircraft_icao the aircraft type
3529
+	 * @param String $departure_airport_icao the departure airport
3530
+	 * @param String $arrival_airport_icao the arrival airport
3531
+	 * @param String $latitude latitude of flight
3532
+	 * @param String $longitude latitude of flight
3533
+	 * @param String $waypoints waypoints of flight
3534
+	 * @param String $altitude altitude of flight
3535
+	 * @param String $heading heading of flight
3536
+	 * @param String $groundspeed speed of flight
3537
+	 * @param String $date date of flight
3538
+	 * @param String $departure_airport_time departure time of flight
3539
+	 * @param String $arrival_airport_time arrival time of flight
3540
+	 * @param String $squawk squawk code of flight
3541
+	 * @param String $route_stop route stop of flight
3542
+	 * @param String $highlight highlight or not
3543
+	 * @param String $ModeS ModesS code of flight
3544
+	 * @param String $registration registration code of flight
3545
+	 * @param String $pilot_id pilot id of flight (for virtual airlines)
3546
+	 * @param String $pilot_name pilot name of flight (for virtual airlines)
3547
+	 * @param String $verticalrate vertival rate of flight
3548
+	 * @return String success or false
3549
+	 */
3550 3550
 	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 = '')
3551 3551
 	{
3552 3552
 		global $globalURL, $globalIVAO, $globalVATSIM, $globalphpVMS, $globalDebugTimeElapsed, $globalAirlinesSource, $globalVAM;
@@ -3761,8 +3761,8 @@  discard block
 block discarded – undo
3761 3761
     
3762 3762
 		if ($globalIVAO && $aircraft_icao != '')
3763 3763
 		{
3764
-            		if (isset($airline_array[0]['icao'])) $airline_icao = $airline_array[0]['icao'];
3765
-            		else $airline_icao = '';
3764
+					if (isset($airline_array[0]['icao'])) $airline_icao = $airline_array[0]['icao'];
3765
+					else $airline_icao = '';
3766 3766
 			$image_array = $Image->getSpotterImage('',$aircraft_icao,$airline_icao);
3767 3767
 			if (!isset($image_array[0]['registration']))
3768 3768
 			{
@@ -3793,53 +3793,53 @@  discard block
 block discarded – undo
3793 3793
 	
3794 3794
 		if (count($airline_array) == 0) 
3795 3795
 		{
3796
-                        $airline_array = $this->getAllAirlineInfo('NA');
3797
-                }
3798
-                if (count($aircraft_array) == 0) 
3799
-                {
3800
-                        $aircraft_array = $this->getAllAircraftInfo('NA');
3801
-                }
3802
-                if (count($departure_airport_array) == 0 || $departure_airport_array[0]['icao'] == '' || $departure_airport_icao == '') 
3803
-                {
3804
-                        $departure_airport_array = $this->getAllAirportInfo('NA');
3805
-                }
3806
-                if (count($arrival_airport_array) == 0 || $arrival_airport_array[0]['icao'] == '' || $arrival_airport_icao == '') 
3807
-                {
3808
-                        $arrival_airport_array = $this->getAllAirportInfo('NA');
3809
-                }
3810
-                if ($registration == '') $registration = 'NA';
3811
-                if ($latitude == '' && $longitude == '') {
3812
-            		$latitude = 0;
3813
-            		$longitude = 0;
3814
-            	}
3815
-                if ($squawk == '' || $Common->isInteger($squawk) === false) $squawk = NULL;
3816
-                if ($verticalrate == '' || $Common->isInteger($verticalrate) === false) $verticalrate = NULL;
3817
-                if ($heading == '' || $Common->isInteger($heading) === false) $heading = 0;
3818
-                if ($groundspeed == '' || $Common->isInteger($groundspeed) === false) $groundspeed = 0;
3819
-                if (!isset($aircraft_owner)) $aircraft_owner = NULL;
3820
-                $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) 
3796
+						$airline_array = $this->getAllAirlineInfo('NA');
3797
+				}
3798
+				if (count($aircraft_array) == 0) 
3799
+				{
3800
+						$aircraft_array = $this->getAllAircraftInfo('NA');
3801
+				}
3802
+				if (count($departure_airport_array) == 0 || $departure_airport_array[0]['icao'] == '' || $departure_airport_icao == '') 
3803
+				{
3804
+						$departure_airport_array = $this->getAllAirportInfo('NA');
3805
+				}
3806
+				if (count($arrival_airport_array) == 0 || $arrival_airport_array[0]['icao'] == '' || $arrival_airport_icao == '') 
3807
+				{
3808
+						$arrival_airport_array = $this->getAllAirportInfo('NA');
3809
+				}
3810
+				if ($registration == '') $registration = 'NA';
3811
+				if ($latitude == '' && $longitude == '') {
3812
+					$latitude = 0;
3813
+					$longitude = 0;
3814
+				}
3815
+				if ($squawk == '' || $Common->isInteger($squawk) === false) $squawk = NULL;
3816
+				if ($verticalrate == '' || $Common->isInteger($verticalrate) === false) $verticalrate = NULL;
3817
+				if ($heading == '' || $Common->isInteger($heading) === false) $heading = 0;
3818
+				if ($groundspeed == '' || $Common->isInteger($groundspeed) === false) $groundspeed = 0;
3819
+				if (!isset($aircraft_owner)) $aircraft_owner = NULL;
3820
+				$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) 
3821 3821
                 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)";
3822 3822
 
3823
-                $airline_name = $airline_array[0]['name'];
3824
-                $airline_icao = $airline_array[0]['icao'];
3825
-                $airline_country = $airline_array[0]['country'];
3826
-                $airline_type = $airline_array[0]['type'];
3823
+				$airline_name = $airline_array[0]['name'];
3824
+				$airline_icao = $airline_array[0]['icao'];
3825
+				$airline_country = $airline_array[0]['country'];
3826
+				$airline_type = $airline_array[0]['type'];
3827 3827
 		if ($airline_type == '') {
3828 3828
 			$timeelapsed = microtime(true);
3829 3829
 			$airline_type = $this->getAircraftTypeBymodeS($ModeS);
3830 3830
 			if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftTypeBymodes : '.round(microtime(true)-$timeelapsed,2).'s'."\n";
3831 3831
 		}
3832 3832
 		if ($airline_type == null) $airline_type = '';
3833
-                $aircraft_type = $aircraft_array[0]['type'];
3834
-                $aircraft_manufacturer = $aircraft_array[0]['manufacturer'];
3835
-                $departure_airport_name = $departure_airport_array[0]['name'];
3836
-	        $departure_airport_city = $departure_airport_array[0]['city'];
3837
-            	$departure_airport_country = $departure_airport_array[0]['country'];
3833
+				$aircraft_type = $aircraft_array[0]['type'];
3834
+				$aircraft_manufacturer = $aircraft_array[0]['manufacturer'];
3835
+				$departure_airport_name = $departure_airport_array[0]['name'];
3836
+			$departure_airport_city = $departure_airport_array[0]['city'];
3837
+				$departure_airport_country = $departure_airport_array[0]['country'];
3838 3838
                 
3839
-                $arrival_airport_name = $arrival_airport_array[0]['name'];
3840
-                $arrival_airport_city = $arrival_airport_array[0]['city'];
3841
-                $arrival_airport_country = $arrival_airport_array[0]['country'];
3842
-                $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);
3839
+				$arrival_airport_name = $arrival_airport_array[0]['name'];
3840
+				$arrival_airport_city = $arrival_airport_array[0]['city'];
3841
+				$arrival_airport_country = $arrival_airport_array[0]['country'];
3842
+				$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);
3843 3843
 
3844 3844
 		try {
3845 3845
 		        
@@ -3847,7 +3847,7 @@  discard block
 block discarded – undo
3847 3847
 			$sth->execute($query_values);
3848 3848
 			$this->db = null;
3849 3849
 		} catch (PDOException $e) {
3850
-		    return "error : ".$e->getMessage();
3850
+			return "error : ".$e->getMessage();
3851 3851
 		}
3852 3852
 		
3853 3853
 		return "success";
@@ -3856,11 +3856,11 @@  discard block
 block discarded – undo
3856 3856
 	
3857 3857
   
3858 3858
 	/**
3859
-	* Gets the aircraft ident within the last hour
3860
-	*
3861
-	* @return String the ident
3862
-	*
3863
-	*/
3859
+	 * Gets the aircraft ident within the last hour
3860
+	 *
3861
+	 * @return String the ident
3862
+	 *
3863
+	 */
3864 3864
 	public function getIdentFromLastHour($ident)
3865 3865
 	{
3866 3866
 		global $globalDBdriver, $globalTimezone;
@@ -3876,11 +3876,11 @@  discard block
 block discarded – undo
3876 3876
 								AND spotter_output.date >= now() AT TIME ZONE 'UTC' - INTERVAL '1 HOURS'
3877 3877
 								AND spotter_output.date < now() AT TIME ZONE 'UTC'";
3878 3878
 			$query_data = array(':ident' => $ident);
3879
-    		}
3879
+			}
3880 3880
 		
3881 3881
 		$sth = $this->db->prepare($query);
3882 3882
 		$sth->execute($query_data);
3883
-    		$ident_result='';
3883
+			$ident_result='';
3884 3884
 		while($row = $sth->fetch(PDO::FETCH_ASSOC))
3885 3885
 		{
3886 3886
 			$ident_result = $row['ident'];
@@ -3891,11 +3891,11 @@  discard block
 block discarded – undo
3891 3891
 	
3892 3892
 	
3893 3893
 	/**
3894
-	* Gets the aircraft data from the last 20 seconds
3895
-	*
3896
-	* @return Array the spotter data
3897
-	*
3898
-	*/
3894
+	 * Gets the aircraft data from the last 20 seconds
3895
+	 *
3896
+	 * @return Array the spotter data
3897
+	 *
3898
+	 */
3899 3899
 	public function getRealTimeData($q = '')
3900 3900
 	{
3901 3901
 		global $globalDBdriver;
@@ -3939,11 +3939,11 @@  discard block
 block discarded – undo
3939 3939
 	
3940 3940
 	
3941 3941
 	 /**
3942
-	* Gets all airlines that have flown over
3943
-	*
3944
-	* @return Array the airline list
3945
-	*
3946
-	*/
3942
+	  * Gets all airlines that have flown over
3943
+	  *
3944
+	  * @return Array the airline list
3945
+	  *
3946
+	  */
3947 3947
 	public function countAllAirlines($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array(), $year = '', $month = '', $day = '')
3948 3948
 	{
3949 3949
 		global $globalDBdriver;
@@ -3957,7 +3957,7 @@  discard block
 block discarded – undo
3957 3957
 				$query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'";
3958 3958
 			}
3959 3959
 		}
3960
-                if ($sincedate != '') {
3960
+				if ($sincedate != '') {
3961 3961
 			if ($globalDBdriver == 'mysql') {
3962 3962
 				$query .= " AND spotter_output.date > '".$sincedate."'";
3963 3963
 			} else {
@@ -4011,26 +4011,26 @@  discard block
 block discarded – undo
4011 4011
 	}
4012 4012
 
4013 4013
 	 /**
4014
-	* Gets all pilots that have flown over
4015
-	*
4016
-	* @return Array the pilots list
4017
-	*
4018
-	*/
4014
+	  * Gets all pilots that have flown over
4015
+	  *
4016
+	  * @return Array the pilots list
4017
+	  *
4018
+	  */
4019 4019
 	public function countAllPilots($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array(),$year = '', $month = '',$day = '')
4020 4020
 	{
4021 4021
 		global $globalDBdriver;
4022 4022
 		$filter_query = $this->getFilter($filters,true,true);
4023 4023
 		$query  = "SELECT DISTINCT spotter_output.pilot_id, spotter_output.pilot_name, COUNT(spotter_output.pilot_id) AS pilot_count, spotter_output.format_source
4024 4024
 		 			FROM spotter_output".$filter_query." spotter_output.pilot_id <> ''";
4025
-                if ($olderthanmonths > 0) {
4026
-            		if ($globalDBdriver == 'mysql') {
4025
+				if ($olderthanmonths > 0) {
4026
+					if ($globalDBdriver == 'mysql') {
4027 4027
 				$query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)';
4028 4028
 			} else {
4029 4029
 				$query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'";
4030 4030
 			}
4031 4031
 		}
4032
-                if ($sincedate != '') {
4033
-            		if ($globalDBdriver == 'mysql') {
4032
+				if ($sincedate != '') {
4033
+					if ($globalDBdriver == 'mysql') {
4034 4034
 				$query .= " AND spotter_output.date > '".$sincedate."'";
4035 4035
 			} else {
4036 4036
 				$query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
@@ -4085,25 +4085,25 @@  discard block
 block discarded – undo
4085 4085
 	}
4086 4086
 	
4087 4087
 	/**
4088
-	* Gets all pilots that have flown over
4089
-	*
4090
-	* @return Array the pilots list
4091
-	*
4092
-	*/
4088
+	 * Gets all pilots that have flown over
4089
+	 *
4090
+	 * @return Array the pilots list
4091
+	 *
4092
+	 */
4093 4093
 	public function countAllPilotsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '')
4094 4094
 	{
4095 4095
 		global $globalDBdriver;
4096 4096
 		$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
4097 4097
 		 			FROM spotter_output WHERE spotter_output.pilot_id <> '' ";
4098
-                if ($olderthanmonths > 0) {
4099
-            		if ($globalDBdriver == 'mysql') {
4098
+				if ($olderthanmonths > 0) {
4099
+					if ($globalDBdriver == 'mysql') {
4100 4100
 				$query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) ';
4101 4101
 			} else {
4102 4102
 				$query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' ";
4103 4103
 			}
4104 4104
 		}
4105
-                if ($sincedate != '') {
4106
-            		if ($globalDBdriver == 'mysql') {
4105
+				if ($sincedate != '') {
4106
+					if ($globalDBdriver == 'mysql') {
4107 4107
 				$query .= "AND spotter_output.date > '".$sincedate."' ";
4108 4108
 			} else {
4109 4109
 				$query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
@@ -4132,26 +4132,26 @@  discard block
 block discarded – undo
4132 4132
 	}
4133 4133
 	
4134 4134
 	 /**
4135
-	* Gets all owner that have flown over
4136
-	*
4137
-	* @return Array the pilots list
4138
-	*
4139
-	*/
4135
+	  * Gets all owner that have flown over
4136
+	  *
4137
+	  * @return Array the pilots list
4138
+	  *
4139
+	  */
4140 4140
 	public function countAllOwners($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array(),$year = '',$month = '',$day = '')
4141 4141
 	{
4142 4142
 		global $globalDBdriver;
4143 4143
 		$filter_query = $this->getFilter($filters,true,true);
4144 4144
 		$query  = "SELECT DISTINCT spotter_output.owner_name, COUNT(spotter_output.owner_name) AS owner_count
4145 4145
 					FROM spotter_output".$filter_query." spotter_output.owner_name <> '' AND spotter_output.owner_name IS NOT NULL";
4146
-                if ($olderthanmonths > 0) {
4147
-            		if ($globalDBdriver == 'mysql') {
4146
+				if ($olderthanmonths > 0) {
4147
+					if ($globalDBdriver == 'mysql') {
4148 4148
 				$query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)';
4149 4149
 			} else {
4150 4150
 				$query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'";
4151 4151
 			}
4152 4152
 		}
4153
-                if ($sincedate != '') {
4154
-            		if ($globalDBdriver == 'mysql') {
4153
+				if ($sincedate != '') {
4154
+					if ($globalDBdriver == 'mysql') {
4155 4155
 				$query .= " AND spotter_output.date > '".$sincedate."' ";
4156 4156
 			} else {
4157 4157
 				$query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
@@ -4202,26 +4202,26 @@  discard block
 block discarded – undo
4202 4202
 	}
4203 4203
 	
4204 4204
 	 /**
4205
-	* Gets all owner that have flown over
4206
-	*
4207
-	* @return Array the pilots list
4208
-	*
4209
-	*/
4205
+	  * Gets all owner that have flown over
4206
+	  *
4207
+	  * @return Array the pilots list
4208
+	  *
4209
+	  */
4210 4210
 	public function countAllOwnersByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array())
4211 4211
 	{
4212 4212
 		global $globalDBdriver;
4213 4213
 		$filter_query = $this->getFilter($filters,true,true);
4214 4214
 		$query  = "SELECT DISTINCT spotter_output.airline_icao, spotter_output.owner_name, COUNT(spotter_output.owner_name) AS owner_count
4215 4215
 		 			FROM spotter_output".$filter_query." spotter_output.owner_name <> '' AND spotter_output.owner_name IS NOT NULL ";
4216
-                if ($olderthanmonths > 0) {
4217
-            		if ($globalDBdriver == 'mysql') {
4216
+				if ($olderthanmonths > 0) {
4217
+					if ($globalDBdriver == 'mysql') {
4218 4218
 				$query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) ';
4219 4219
 			} else {
4220 4220
 				$query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' ";
4221 4221
 			}
4222 4222
 		}
4223
-                if ($sincedate != '') {
4224
-            		if ($globalDBdriver == 'mysql') {
4223
+				if ($sincedate != '') {
4224
+					if ($globalDBdriver == 'mysql') {
4225 4225
 				$query .= "AND spotter_output.date > '".$sincedate."' ";
4226 4226
 			} else {
4227 4227
 				$query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
@@ -4248,11 +4248,11 @@  discard block
 block discarded – undo
4248 4248
 	}
4249 4249
 
4250 4250
 	/**
4251
-	* Gets all airlines that have flown over by aircraft
4252
-	*
4253
-	* @return Array the airline list
4254
-	*
4255
-	*/
4251
+	 * Gets all airlines that have flown over by aircraft
4252
+	 *
4253
+	 * @return Array the airline list
4254
+	 *
4255
+	 */
4256 4256
 	public function countAllAirlinesByAircraft($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 airline countries that have flown over by aircraft
4288
-	*
4289
-	* @return Array the airline country list
4290
-	*
4291
-	*/
4287
+	 * Gets all airline countries that have flown over by aircraft
4288
+	 *
4289
+	 * @return Array the airline country list
4290
+	 *
4291
+	 */
4292 4292
 	public function countAllAirlineCountriesByAircraft($aircraft_icao,$filters = array())
4293 4293
 	{
4294 4294
 		$aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING);
@@ -4320,11 +4320,11 @@  discard block
 block discarded – undo
4320 4320
 	
4321 4321
 	
4322 4322
 	/**
4323
-	* Gets all airlines that have flown over by airport
4324
-	*
4325
-	* @return Array the airline list
4326
-	*
4327
-	*/
4323
+	 * Gets all airlines that have flown over by airport
4324
+	 *
4325
+	 * @return Array the airline list
4326
+	 *
4327
+	 */
4328 4328
 	public function countAllAirlinesByAirport($airport_icao,$filters = array())
4329 4329
 	{
4330 4330
 		$airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING);
@@ -4355,11 +4355,11 @@  discard block
 block discarded – undo
4355 4355
 
4356 4356
 
4357 4357
 	/**
4358
-	* Gets all airline countries that have flown over by airport icao
4359
-	*
4360
-	* @return Array the airline country list
4361
-	*
4362
-	*/
4358
+	 * Gets all airline countries that have flown over by airport icao
4359
+	 *
4360
+	 * @return Array the airline country list
4361
+	 *
4362
+	 */
4363 4363
 	public function countAllAirlineCountriesByAirport($airport_icao,$filters = array())
4364 4364
 	{
4365 4365
 		$airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING);
@@ -4389,11 +4389,11 @@  discard block
 block discarded – undo
4389 4389
 
4390 4390
 
4391 4391
 	/**
4392
-	* Gets all airlines that have flown over by aircraft manufacturer
4393
-	*
4394
-	* @return Array the airline list
4395
-	*
4396
-	*/
4392
+	 * Gets all airlines that have flown over by aircraft manufacturer
4393
+	 *
4394
+	 * @return Array the airline list
4395
+	 *
4396
+	 */
4397 4397
 	public function countAllAirlinesByManufacturer($aircraft_manufacturer,$filters = array())
4398 4398
 	{
4399 4399
 		$aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING);
@@ -4424,11 +4424,11 @@  discard block
 block discarded – undo
4424 4424
 
4425 4425
 
4426 4426
 	/**
4427
-	* Gets all airline countries that have flown over by aircraft manufacturer
4428
-	*
4429
-	* @return Array the airline country list
4430
-	*
4431
-	*/
4427
+	 * Gets all airline countries that have flown over by aircraft manufacturer
4428
+	 *
4429
+	 * @return Array the airline country list
4430
+	 *
4431
+	 */
4432 4432
 	public function countAllAirlineCountriesByManufacturer($aircraft_manufacturer,$filters = array())
4433 4433
 	{
4434 4434
 		$aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING);
@@ -4457,11 +4457,11 @@  discard block
 block discarded – undo
4457 4457
 
4458 4458
 
4459 4459
 	/**
4460
-	* Gets all airlines that have flown over by date
4461
-	*
4462
-	* @return Array the airline list
4463
-	*
4464
-	*/
4460
+	 * Gets all airlines that have flown over by date
4461
+	 *
4462
+	 * @return Array the airline list
4463
+	 *
4464
+	 */
4465 4465
 	public function countAllAirlinesByDate($date,$filters = array())
4466 4466
 	{
4467 4467
 		global $globalTimezone, $globalDBdriver;
@@ -4505,11 +4505,11 @@  discard block
 block discarded – undo
4505 4505
 	
4506 4506
 	
4507 4507
 	/**
4508
-	* Gets all airline countries that have flown over by date
4509
-	*
4510
-	* @return Array the airline country list
4511
-	*
4512
-	*/
4508
+	 * Gets all airline countries that have flown over by date
4509
+	 *
4510
+	 * @return Array the airline country list
4511
+	 *
4512
+	 */
4513 4513
 	public function countAllAirlineCountriesByDate($date,$filters = array())
4514 4514
 	{
4515 4515
 		global $globalTimezone, $globalDBdriver;
@@ -4552,11 +4552,11 @@  discard block
 block discarded – undo
4552 4552
 
4553 4553
 
4554 4554
 	/**
4555
-	* Gets all airlines that have flown over by ident/callsign
4556
-	*
4557
-	* @return Array the airline list
4558
-	*
4559
-	*/
4555
+	 * Gets all airlines that have flown over by ident/callsign
4556
+	 *
4557
+	 * @return Array the airline list
4558
+	 *
4559
+	 */
4560 4560
 	public function countAllAirlinesByIdent($ident,$filters = array())
4561 4561
 	{
4562 4562
 		$ident = filter_var($ident,FILTER_SANITIZE_STRING);
@@ -4573,11 +4573,11 @@  discard block
 block discarded – undo
4573 4573
 	}
4574 4574
 
4575 4575
 	/**
4576
-	* Gets all airlines by owner
4577
-	*
4578
-	* @return Array the airline list
4579
-	*
4580
-	*/
4576
+	 * Gets all airlines by owner
4577
+	 *
4578
+	 * @return Array the airline list
4579
+	 *
4580
+	 */
4581 4581
 	public function countAllAirlinesByOwner($owner,$filters = array())
4582 4582
 	{
4583 4583
 		$owner = filter_var($owner,FILTER_SANITIZE_STRING);
@@ -4594,11 +4594,11 @@  discard block
 block discarded – undo
4594 4594
 	}
4595 4595
 
4596 4596
 	/**
4597
-	* Gets all airlines used by pilot
4598
-	*
4599
-	* @return Array the airline list
4600
-	*
4601
-	*/
4597
+	 * Gets all airlines used by pilot
4598
+	 *
4599
+	 * @return Array the airline list
4600
+	 *
4601
+	 */
4602 4602
 	public function countAllAirlinesByPilot($pilot,$filters = array())
4603 4603
 	{
4604 4604
 		$pilot = filter_var($pilot,FILTER_SANITIZE_STRING);
@@ -4615,11 +4615,11 @@  discard block
 block discarded – undo
4615 4615
 	}
4616 4616
 
4617 4617
 	/**
4618
-	* Gets all airlines that have flown over by route
4619
-	*
4620
-	* @return Array the airline list
4621
-	*
4622
-	*/
4618
+	 * Gets all airlines that have flown over by route
4619
+	 *
4620
+	 * @return Array the airline list
4621
+	 *
4622
+	 */
4623 4623
 	public function countAllAirlinesByRoute($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 airline countries that have flown over by route
4655
-	*
4656
-	* @return Array the airline country list
4657
-	*
4658
-	*/
4654
+	 * Gets all airline countries that have flown over by route
4655
+	 *
4656
+	 * @return Array the airline country list
4657
+	 *
4658
+	 */
4659 4659
 	public function countAllAirlineCountriesByRoute($departure_airport_icao, $arrival_airport_icao,$filters= array())
4660 4660
 	{
4661 4661
 		$filter_query = $this->getFilter($filters,true,true);
@@ -4687,11 +4687,11 @@  discard block
 block discarded – undo
4687 4687
 
4688 4688
 
4689 4689
 	/**
4690
-	* Gets all airlines that have flown over by country
4691
-	*
4692
-	* @return Array the airline list
4693
-	*
4694
-	*/
4690
+	 * Gets all airlines that have flown over by country
4691
+	 *
4692
+	 * @return Array the airline list
4693
+	 *
4694
+	 */
4695 4695
 	public function countAllAirlinesByCountry($country,$filters = array())
4696 4696
 	{
4697 4697
 		$country = filter_var($country,FILTER_SANITIZE_STRING);
@@ -4721,11 +4721,11 @@  discard block
 block discarded – undo
4721 4721
 
4722 4722
 
4723 4723
 	/**
4724
-	* Gets all airline countries that have flown over by country
4725
-	*
4726
-	* @return Array the airline country list
4727
-	*
4728
-	*/
4724
+	 * Gets all airline countries that have flown over by country
4725
+	 *
4726
+	 * @return Array the airline country list
4727
+	 *
4728
+	 */
4729 4729
 	public function countAllAirlineCountriesByCountry($country,$filters = array())
4730 4730
 	{
4731 4731
 		$filter_query = $this->getFilter($filters,true,true);
@@ -4754,11 +4754,11 @@  discard block
 block discarded – undo
4754 4754
 
4755 4755
 
4756 4756
 	/**
4757
-	* Gets all airlines countries
4758
-	*
4759
-	* @return Array the airline country list
4760
-	*
4761
-	*/
4757
+	 * Gets all airlines countries
4758
+	 *
4759
+	 * @return Array the airline country list
4760
+	 *
4761
+	 */
4762 4762
 	public function countAllAirlineCountries($limit = true, $filters = array(), $year = '', $month = '', $day = '')
4763 4763
 	{
4764 4764
 		global $globalDBdriver;
@@ -4813,11 +4813,11 @@  discard block
 block discarded – undo
4813 4813
 	}
4814 4814
 
4815 4815
 	/**
4816
-	* Gets all number of flight over countries
4817
-	*
4818
-	* @return Array the airline country list
4819
-	*
4820
-	*/
4816
+	 * Gets all number of flight over countries
4817
+	 *
4818
+	 * @return Array the airline country list
4819
+	 *
4820
+	 */
4821 4821
 	public function countAllFlightOverCountries($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array())
4822 4822
 	{
4823 4823
 		global $globalDBdriver;
@@ -4839,15 +4839,15 @@  discard block
 block discarded – undo
4839 4839
 		$SpotterLive = new SpotterLive();
4840 4840
 		$filter_query = $SpotterLive->getFilter($filters,true,true);
4841 4841
 		$filter_query .= ' over_country IS NOT NULL';
4842
-                if ($olderthanmonths > 0) {
4842
+				if ($olderthanmonths > 0) {
4843 4843
 			if ($globalDBdriver == 'mysql') {
4844 4844
 				$filter_query .= ' AND spotter_live.date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
4845 4845
 			} else {
4846 4846
 				$filter_query .= " AND spotter_live.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'";
4847 4847
 			}
4848 4848
 		}
4849
-                if ($sincedate != '') {
4850
-            		if ($globalDBdriver == 'mysql') {
4849
+				if ($sincedate != '') {
4850
+					if ($globalDBdriver == 'mysql') {
4851 4851
 				$filter_query .= " AND spotter_live.date > '".$sincedate."' ";
4852 4852
 			} else {
4853 4853
 				$filter_query .= " AND spotter_live.date > CAST('".$sincedate."' AS TIMESTAMP)";
@@ -4877,11 +4877,11 @@  discard block
 block discarded – undo
4877 4877
 	
4878 4878
 	
4879 4879
 	/**
4880
-	* Gets all aircraft types that have flown over
4881
-	*
4882
-	* @return Array the aircraft list
4883
-	*
4884
-	*/
4880
+	 * Gets all aircraft types that have flown over
4881
+	 *
4882
+	 * @return Array the aircraft list
4883
+	 *
4884
+	 */
4885 4885
 	public function countAllAircraftTypes($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array(),$year = '',$month = '',$day = '')
4886 4886
 	{
4887 4887
 		global $globalDBdriver;
@@ -4951,11 +4951,11 @@  discard block
 block discarded – undo
4951 4951
 	}
4952 4952
 
4953 4953
 	/**
4954
-	* Gets all aircraft types that have flown over by airline
4955
-	*
4956
-	* @return Array the aircraft list
4957
-	*
4958
-	*/
4954
+	 * Gets all aircraft types that have flown over by airline
4955
+	 *
4956
+	 * @return Array the aircraft list
4957
+	 *
4958
+	 */
4959 4959
 	public function countAllAircraftTypesByAirlines($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array(),$year = '',$month = '', $day = '')
4960 4960
 	{
4961 4961
 		global $globalDBdriver;
@@ -5026,11 +5026,11 @@  discard block
 block discarded – undo
5026 5026
 	}
5027 5027
 
5028 5028
 	/**
5029
-	* Gets all aircraft types that have flown over by months
5030
-	*
5031
-	* @return Array the aircraft list
5032
-	*
5033
-	*/
5029
+	 * Gets all aircraft types that have flown over by months
5030
+	 *
5031
+	 * @return Array the aircraft list
5032
+	 *
5033
+	 */
5034 5034
 	public function countAllAircraftTypesByMonths($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array())
5035 5035
 	{
5036 5036
 		global $globalDBdriver;
@@ -5074,11 +5074,11 @@  discard block
 block discarded – undo
5074 5074
 
5075 5075
 
5076 5076
 	/**
5077
-	* Gets all aircraft registration that have flown over by aircaft icao
5078
-	*
5079
-	* @return Array the aircraft list
5080
-	*
5081
-	*/
5077
+	 * Gets all aircraft registration that have flown over by aircaft icao
5078
+	 *
5079
+	 * @return Array the aircraft list
5080
+	 *
5081
+	 */
5082 5082
 	public function countAllAircraftRegistrationByAircraft($aircraft_icao,$filters = array())
5083 5083
 	{
5084 5084
 		$Image = new Image($this->db);
@@ -5117,11 +5117,11 @@  discard block
 block discarded – undo
5117 5117
 
5118 5118
 
5119 5119
 	/**
5120
-	* Gets all aircraft types that have flown over by airline icao
5121
-	*
5122
-	* @return Array the aircraft list
5123
-	*
5124
-	*/
5120
+	 * Gets all aircraft types that have flown over by airline icao
5121
+	 *
5122
+	 * @return Array the aircraft list
5123
+	 *
5124
+	 */
5125 5125
 	public function countAllAircraftTypesByAirline($airline_icao,$filters = array())
5126 5126
 	{
5127 5127
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5150,11 +5150,11 @@  discard block
 block discarded – undo
5150 5150
 
5151 5151
 
5152 5152
 	/**
5153
-	* Gets all aircraft registration that have flown over by airline icao
5154
-	*
5155
-	* @return Array the aircraft list
5156
-	*
5157
-	*/
5153
+	 * Gets all aircraft registration that have flown over by airline icao
5154
+	 *
5155
+	 * @return Array the aircraft list
5156
+	 *
5157
+	 */
5158 5158
 	public function countAllAircraftRegistrationByAirline($airline_icao,$filters = array())
5159 5159
 	{
5160 5160
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5192,11 +5192,11 @@  discard block
 block discarded – undo
5192 5192
 
5193 5193
 
5194 5194
 	/**
5195
-	* Gets all aircraft manufacturer that have flown over by airline icao
5196
-	*
5197
-	* @return Array the aircraft list
5198
-	*
5199
-	*/
5195
+	 * Gets all aircraft manufacturer that have flown over by airline icao
5196
+	 *
5197
+	 * @return Array the aircraft list
5198
+	 *
5199
+	 */
5200 5200
 	public function countAllAircraftManufacturerByAirline($airline_icao,$filters = array())
5201 5201
 	{
5202 5202
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5224,11 +5224,11 @@  discard block
 block discarded – undo
5224 5224
 
5225 5225
 
5226 5226
 	/**
5227
-	* Gets all aircraft types that have flown over by airline icao
5228
-	*
5229
-	* @return Array the aircraft list
5230
-	*
5231
-	*/
5227
+	 * Gets all aircraft types that have flown over by airline icao
5228
+	 *
5229
+	 * @return Array the aircraft list
5230
+	 *
5231
+	 */
5232 5232
 	public function countAllAircraftTypesByAirport($airport_icao,$filters = array())
5233 5233
 	{
5234 5234
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5257,11 +5257,11 @@  discard block
 block discarded – undo
5257 5257
 
5258 5258
 
5259 5259
 	/**
5260
-	* Gets all aircraft registration that have flown over by airport icao
5261
-	*
5262
-	* @return Array the aircraft list
5263
-	*
5264
-	*/
5260
+	 * Gets all aircraft registration that have flown over by airport icao
5261
+	 *
5262
+	 * @return Array the aircraft list
5263
+	 *
5264
+	 */
5265 5265
 	public function countAllAircraftRegistrationByAirport($airport_icao,$filters = array())
5266 5266
 	{
5267 5267
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5298,11 +5298,11 @@  discard block
 block discarded – undo
5298 5298
 	
5299 5299
 	
5300 5300
 	/**
5301
-	* Gets all aircraft manufacturer that have flown over by airport icao
5302
-	*
5303
-	* @return Array the aircraft list
5304
-	*
5305
-	*/
5301
+	 * Gets all aircraft manufacturer that have flown over by airport icao
5302
+	 *
5303
+	 * @return Array the aircraft list
5304
+	 *
5305
+	 */
5306 5306
 	public function countAllAircraftManufacturerByAirport($airport_icao,$filters = array())
5307 5307
 	{
5308 5308
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5328,11 +5328,11 @@  discard block
 block discarded – undo
5328 5328
 	}
5329 5329
 
5330 5330
 	/**
5331
-	* Gets all aircraft types that have flown over by aircraft manufacturer
5332
-	*
5333
-	* @return Array the aircraft list
5334
-	*
5335
-	*/
5331
+	 * Gets all aircraft types that have flown over by aircraft manufacturer
5332
+	 *
5333
+	 * @return Array the aircraft list
5334
+	 *
5335
+	 */
5336 5336
 	public function countAllAircraftTypesByManufacturer($aircraft_manufacturer,$filters = array())
5337 5337
 	{
5338 5338
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5359,11 +5359,11 @@  discard block
 block discarded – undo
5359 5359
 
5360 5360
 
5361 5361
 	/**
5362
-	* Gets all aircraft registration that have flown over by aircaft manufacturer
5363
-	*
5364
-	* @return Array the aircraft list
5365
-	*
5366
-	*/
5362
+	 * Gets all aircraft registration that have flown over by aircaft manufacturer
5363
+	 *
5364
+	 * @return Array the aircraft list
5365
+	 *
5366
+	 */
5367 5367
 	public function countAllAircraftRegistrationByManufacturer($aircraft_manufacturer, $filters = array())
5368 5368
 	{
5369 5369
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5399,11 +5399,11 @@  discard block
 block discarded – undo
5399 5399
 	}
5400 5400
 
5401 5401
 	/**
5402
-	* Gets all aircraft types that have flown over by date
5403
-	*
5404
-	* @return Array the aircraft list
5405
-	*
5406
-	*/
5402
+	 * Gets all aircraft types that have flown over by date
5403
+	 *
5404
+	 * @return Array the aircraft list
5405
+	 *
5406
+	 */
5407 5407
 	public function countAllAircraftTypesByDate($date,$filters = array())
5408 5408
 	{
5409 5409
 		global $globalTimezone, $globalDBdriver;
@@ -5445,11 +5445,11 @@  discard block
 block discarded – undo
5445 5445
 
5446 5446
 
5447 5447
 	/**
5448
-	* Gets all aircraft registration that have flown over by date
5449
-	*
5450
-	* @return Array the aircraft list
5451
-	*
5452
-	*/
5448
+	 * Gets all aircraft registration that have flown over by date
5449
+	 *
5450
+	 * @return Array the aircraft list
5451
+	 *
5452
+	 */
5453 5453
 	public function countAllAircraftRegistrationByDate($date,$filters = array())
5454 5454
 	{
5455 5455
 		global $globalTimezone, $globalDBdriver;
@@ -5500,11 +5500,11 @@  discard block
 block discarded – undo
5500 5500
 
5501 5501
 
5502 5502
 	/**
5503
-	* Gets all aircraft manufacturer that have flown over by date
5504
-	*
5505
-	* @return Array the aircraft manufacturer list
5506
-	*
5507
-	*/
5503
+	 * Gets all aircraft manufacturer that have flown over by date
5504
+	 *
5505
+	 * @return Array the aircraft manufacturer list
5506
+	 *
5507
+	 */
5508 5508
 	public function countAllAircraftManufacturerByDate($date,$filters = array())
5509 5509
 	{
5510 5510
 		global $globalTimezone, $globalDBdriver;
@@ -5546,11 +5546,11 @@  discard block
 block discarded – undo
5546 5546
 
5547 5547
 
5548 5548
 	/**
5549
-	* Gets all aircraft types that have flown over by ident/callsign
5550
-	*
5551
-	* @return Array the aircraft list
5552
-	*
5553
-	*/
5549
+	 * Gets all aircraft types that have flown over by ident/callsign
5550
+	 *
5551
+	 * @return Array the aircraft list
5552
+	 *
5553
+	 */
5554 5554
 	public function countAllAircraftTypesByIdent($ident,$filters = array())
5555 5555
 	{
5556 5556
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5578,11 +5578,11 @@  discard block
 block discarded – undo
5578 5578
 	}
5579 5579
 
5580 5580
 	/**
5581
-	* Gets all aircraft types that have flown over by pilot
5582
-	*
5583
-	* @return Array the aircraft list
5584
-	*
5585
-	*/
5581
+	 * Gets all aircraft types that have flown over by pilot
5582
+	 *
5583
+	 * @return Array the aircraft list
5584
+	 *
5585
+	 */
5586 5586
 	public function countAllAircraftTypesByPilot($pilot,$filters = array())
5587 5587
 	{
5588 5588
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5598,11 +5598,11 @@  discard block
 block discarded – undo
5598 5598
 	}
5599 5599
 
5600 5600
 	/**
5601
-	* Gets all aircraft types that have flown over by owner
5602
-	*
5603
-	* @return Array the aircraft list
5604
-	*
5605
-	*/
5601
+	 * Gets all aircraft types that have flown over by owner
5602
+	 *
5603
+	 * @return Array the aircraft list
5604
+	 *
5605
+	 */
5606 5606
 	public function countAllAircraftTypesByOwner($owner,$filters = array())
5607 5607
 	{
5608 5608
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5619,11 +5619,11 @@  discard block
 block discarded – undo
5619 5619
 
5620 5620
 
5621 5621
 	/**
5622
-	* Gets all aircraft registration that have flown over by ident/callsign
5623
-	*
5624
-	* @return Array the aircraft list
5625
-	*
5626
-	*/
5622
+	 * Gets all aircraft registration that have flown over by ident/callsign
5623
+	 *
5624
+	 * @return Array the aircraft list
5625
+	 *
5626
+	 */
5627 5627
 	public function countAllAircraftRegistrationByIdent($ident,$filters = array())
5628 5628
 	{
5629 5629
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5662,11 +5662,11 @@  discard block
 block discarded – undo
5662 5662
 	}
5663 5663
 
5664 5664
 	/**
5665
-	* Gets all aircraft registration that have flown over by owner
5666
-	*
5667
-	* @return Array the aircraft list
5668
-	*
5669
-	*/
5665
+	 * Gets all aircraft registration that have flown over by owner
5666
+	 *
5667
+	 * @return Array the aircraft list
5668
+	 *
5669
+	 */
5670 5670
 	public function countAllAircraftRegistrationByOwner($owner,$filters = array())
5671 5671
 	{
5672 5672
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5706,11 +5706,11 @@  discard block
 block discarded – undo
5706 5706
 	}
5707 5707
 
5708 5708
 	/**
5709
-	* Gets all aircraft registration that have flown over by pilot
5710
-	*
5711
-	* @return Array the aircraft list
5712
-	*
5713
-	*/
5709
+	 * Gets all aircraft registration that have flown over by pilot
5710
+	 *
5711
+	 * @return Array the aircraft list
5712
+	 *
5713
+	 */
5714 5714
 	public function countAllAircraftRegistrationByPilot($pilot,$filters = array())
5715 5715
 	{
5716 5716
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5751,11 +5751,11 @@  discard block
 block discarded – undo
5751 5751
 
5752 5752
 
5753 5753
 	/**
5754
-	* Gets all aircraft manufacturer that have flown over by ident/callsign
5755
-	*
5756
-	* @return Array the aircraft manufacturer list
5757
-	*
5758
-	*/
5754
+	 * Gets all aircraft manufacturer that have flown over by ident/callsign
5755
+	 *
5756
+	 * @return Array the aircraft manufacturer list
5757
+	 *
5758
+	 */
5759 5759
 	public function countAllAircraftManufacturerByIdent($ident,$filters = array())
5760 5760
 	{
5761 5761
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5780,11 +5780,11 @@  discard block
 block discarded – undo
5780 5780
 	}
5781 5781
 
5782 5782
 	/**
5783
-	* Gets all aircraft manufacturer that have flown over by owner
5784
-	*
5785
-	* @return Array the aircraft manufacturer list
5786
-	*
5787
-	*/
5783
+	 * Gets all aircraft manufacturer that have flown over by owner
5784
+	 *
5785
+	 * @return Array the aircraft manufacturer list
5786
+	 *
5787
+	 */
5788 5788
 	public function countAllAircraftManufacturerByOwner($owner,$filters = array())
5789 5789
 	{
5790 5790
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5801,11 +5801,11 @@  discard block
 block discarded – undo
5801 5801
 	}
5802 5802
 
5803 5803
 	/**
5804
-	* Gets all aircraft manufacturer that have flown over by pilot
5805
-	*
5806
-	* @return Array the aircraft manufacturer list
5807
-	*
5808
-	*/
5804
+	 * Gets all aircraft manufacturer that have flown over by pilot
5805
+	 *
5806
+	 * @return Array the aircraft manufacturer list
5807
+	 *
5808
+	 */
5809 5809
 	public function countAllAircraftManufacturerByPilot($pilot,$filters = array())
5810 5810
 	{
5811 5811
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5823,11 +5823,11 @@  discard block
 block discarded – undo
5823 5823
 
5824 5824
 
5825 5825
 	/**
5826
-	* Gets all aircraft types that have flown over by route
5827
-	*
5828
-	* @return Array the aircraft list
5829
-	*
5830
-	*/
5826
+	 * Gets all aircraft types that have flown over by route
5827
+	 *
5828
+	 * @return Array the aircraft list
5829
+	 *
5830
+	 */
5831 5831
 	public function countAllAircraftTypesByRoute($departure_airport_icao, $arrival_airport_icao,$filters = array())
5832 5832
 	{
5833 5833
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5856,11 +5856,11 @@  discard block
 block discarded – undo
5856 5856
 	}
5857 5857
 
5858 5858
 	/**
5859
-	* Gets all aircraft registration that have flown over by route
5860
-	*
5861
-	* @return Array the aircraft list
5862
-	*
5863
-	*/
5859
+	 * Gets all aircraft registration that have flown over by route
5860
+	 *
5861
+	 * @return Array the aircraft list
5862
+	 *
5863
+	 */
5864 5864
 	public function countAllAircraftRegistrationByRoute($departure_airport_icao, $arrival_airport_icao,$filters = array())
5865 5865
 	{
5866 5866
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5902,11 +5902,11 @@  discard block
 block discarded – undo
5902 5902
 	
5903 5903
 	
5904 5904
 	/**
5905
-	* Gets all aircraft manufacturer that have flown over by route
5906
-	*
5907
-	* @return Array the aircraft manufacturer list
5908
-	*
5909
-	*/
5905
+	 * Gets all aircraft manufacturer that have flown over by route
5906
+	 *
5907
+	 * @return Array the aircraft manufacturer list
5908
+	 *
5909
+	 */
5910 5910
 	public function countAllAircraftManufacturerByRoute($departure_airport_icao, $arrival_airport_icao,$filters = array())
5911 5911
 	{
5912 5912
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5940,11 +5940,11 @@  discard block
 block discarded – undo
5940 5940
 	
5941 5941
 	
5942 5942
 	/**
5943
-	* Gets all aircraft types that have flown over by country
5944
-	*
5945
-	* @return Array the aircraft list
5946
-	*
5947
-	*/
5943
+	 * Gets all aircraft types that have flown over by country
5944
+	 *
5945
+	 * @return Array the aircraft list
5946
+	 *
5947
+	 */
5948 5948
 	public function countAllAircraftTypesByCountry($country,$filters = array())
5949 5949
 	{
5950 5950
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5975,11 +5975,11 @@  discard block
 block discarded – undo
5975 5975
 
5976 5976
 
5977 5977
 	/**
5978
-	* Gets all aircraft registration that have flown over by country
5979
-	*
5980
-	* @return Array the aircraft list
5981
-	*
5982
-	*/
5978
+	 * Gets all aircraft registration that have flown over by country
5979
+	 *
5980
+	 * @return Array the aircraft list
5981
+	 *
5982
+	 */
5983 5983
 	public function countAllAircraftRegistrationByCountry($country,$filters = array())
5984 5984
 	{
5985 5985
 		$filter_query = $this->getFilter($filters,true,true);
@@ -6019,11 +6019,11 @@  discard block
 block discarded – undo
6019 6019
 	
6020 6020
 	
6021 6021
 	/**
6022
-	* Gets all aircraft manufacturer that have flown over by country
6023
-	*
6024
-	* @return Array the aircraft manufacturer list
6025
-	*
6026
-	*/
6022
+	 * Gets all aircraft manufacturer that have flown over by country
6023
+	 *
6024
+	 * @return Array the aircraft manufacturer list
6025
+	 *
6026
+	 */
6027 6027
 	public function countAllAircraftManufacturerByCountry($country,$filters = array())
6028 6028
 	{
6029 6029
 		$filter_query = $this->getFilter($filters,true,true);
@@ -6054,18 +6054,18 @@  discard block
 block discarded – undo
6054 6054
 	
6055 6055
 	
6056 6056
 	/**
6057
-	* Gets all aircraft manufacturers that have flown over
6058
-	*
6059
-	* @return Array the aircraft list
6060
-	*
6061
-	*/
6057
+	 * Gets all aircraft manufacturers that have flown over
6058
+	 *
6059
+	 * @return Array the aircraft list
6060
+	 *
6061
+	 */
6062 6062
 	public function countAllAircraftManufacturers($filters = array(),$year = '',$month = '',$day = '')
6063 6063
 	{
6064 6064
 		global $globalDBdriver;
6065 6065
 		$filter_query = $this->getFilter($filters,true,true);
6066 6066
 		$query  = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count  
6067 6067
                     FROM spotter_output ".$filter_query." spotter_output.aircraft_manufacturer <> '' AND spotter_output.aircraft_manufacturer <> 'Not Available'";
6068
-                $query_values = array();
6068
+				$query_values = array();
6069 6069
 		if ($year != '') {
6070 6070
 			if ($globalDBdriver == 'mysql') {
6071 6071
 				$query .= " AND YEAR(spotter_output.date) = :year";
@@ -6118,11 +6118,11 @@  discard block
 block discarded – undo
6118 6118
 	
6119 6119
 	
6120 6120
 	/**
6121
-	* Gets all aircraft registrations that have flown over
6122
-	*
6123
-	* @return Array the aircraft list
6124
-	*
6125
-	*/
6121
+	 * Gets all aircraft registrations that have flown over
6122
+	 *
6123
+	 * @return Array the aircraft list
6124
+	 *
6125
+	 */
6126 6126
 	public function countAllAircraftRegistrations($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array(),$year = '', $month = '', $day = '')
6127 6127
 	{
6128 6128
 		global $globalDBdriver;
@@ -6130,15 +6130,15 @@  discard block
 block discarded – undo
6130 6130
 		$filter_query = $this->getFilter($filters,true,true);
6131 6131
 		$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    
6132 6132
                     FROM spotter_output ".$filter_query." spotter_output.registration <> '' AND spotter_output.registration <> 'NA'";
6133
-                if ($olderthanmonths > 0) {
6134
-            		if ($globalDBdriver == 'mysql') {
6133
+				if ($olderthanmonths > 0) {
6134
+					if ($globalDBdriver == 'mysql') {
6135 6135
 				$query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)';
6136 6136
 			} else {
6137 6137
 				$query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'";
6138 6138
 			}
6139 6139
 		}
6140
-                if ($sincedate != '') {
6141
-            		if ($globalDBdriver == 'mysql') {
6140
+				if ($sincedate != '') {
6141
+					if ($globalDBdriver == 'mysql') {
6142 6142
 				$query .= " AND spotter_output.date > '".$sincedate."'";
6143 6143
 			} else {
6144 6144
 				$query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
@@ -6203,11 +6203,11 @@  discard block
 block discarded – undo
6203 6203
 
6204 6204
 
6205 6205
 	/**
6206
-	* Gets all aircraft registrations that have flown over
6207
-	*
6208
-	* @return Array the aircraft list
6209
-	*
6210
-	*/
6206
+	 * Gets all aircraft registrations that have flown over
6207
+	 *
6208
+	 * @return Array the aircraft list
6209
+	 *
6210
+	 */
6211 6211
 	public function countAllAircraftRegistrationsByAirlines($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array())
6212 6212
 	{
6213 6213
 		global $globalDBdriver;
@@ -6215,15 +6215,15 @@  discard block
 block discarded – undo
6215 6215
 		$Image = new Image($this->db);
6216 6216
 		$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    
6217 6217
                     FROM spotter_output".$filter_query." spotter_output.airline_icao <> '' AND spotter_output.registration <> '' AND spotter_output.registration <> 'NA' ";
6218
-                if ($olderthanmonths > 0) {
6219
-            		if ($globalDBdriver == 'mysql') {
6218
+				if ($olderthanmonths > 0) {
6219
+					if ($globalDBdriver == 'mysql') {
6220 6220
 				$query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) ';
6221 6221
 			} else {
6222 6222
 				$query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' ";
6223 6223
 			}
6224 6224
 		}
6225
-                if ($sincedate != '') {
6226
-            		if ($globalDBdriver == 'mysql') {
6225
+				if ($sincedate != '') {
6226
+					if ($globalDBdriver == 'mysql') {
6227 6227
 				$query .= "AND spotter_output.date > '".$sincedate."' ";
6228 6228
 			} else {
6229 6229
 				$query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
@@ -6232,7 +6232,7 @@  discard block
 block discarded – undo
6232 6232
 
6233 6233
 		// if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
6234 6234
 		//if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
6235
-                $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";
6235
+				$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";
6236 6236
 		if ($limit) $query .= " LIMIT 10 OFFSET 0";
6237 6237
 		
6238 6238
 		$sth = $this->db->prepare($query);
@@ -6264,26 +6264,26 @@  discard block
 block discarded – undo
6264 6264
 	
6265 6265
 	
6266 6266
 	/**
6267
-	* Gets all departure airports of the airplanes that have flown over
6268
-	*
6269
-	* @return Array the airport list
6270
-	*
6271
-	*/
6267
+	 * Gets all departure airports of the airplanes that have flown over
6268
+	 *
6269
+	 * @return Array the airport list
6270
+	 *
6271
+	 */
6272 6272
 	public function countAllDepartureAirports($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array(),$year = '',$month = '',$day = '')
6273 6273
 	{
6274 6274
 		global $globalDBdriver;
6275 6275
 		$filter_query = $this->getFilter($filters,true,true);
6276 6276
 		$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 
6277 6277
 				FROM spotter_output".$filter_query." spotter_output.departure_airport_name <> '' AND spotter_output.departure_airport_icao <> 'NA' AND spotter_output.departure_airport_icao <> ''";
6278
-                if ($olderthanmonths > 0) {
6279
-            		if ($globalDBdriver == 'mysql') {
6278
+				if ($olderthanmonths > 0) {
6279
+					if ($globalDBdriver == 'mysql') {
6280 6280
 				$query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)';
6281 6281
 			} else {
6282 6282
 				$query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'";
6283 6283
 			}
6284
-                }
6285
-                if ($sincedate != '') {
6286
-            		if ($globalDBdriver == 'mysql') {
6284
+				}
6285
+				if ($sincedate != '') {
6286
+					if ($globalDBdriver == 'mysql') {
6287 6287
 				$query .= " AND spotter_output.date > '".$sincedate."'";
6288 6288
 			} else {
6289 6289
 				$query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
@@ -6317,7 +6317,7 @@  discard block
 block discarded – undo
6317 6317
 				$query_values = array_merge($query_values,array(':day' => $day));
6318 6318
 			}
6319 6319
 		}
6320
-                $query .= " GROUP BY spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country
6320
+				$query .= " GROUP BY spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country
6321 6321
 				ORDER BY airport_departure_icao_count DESC";
6322 6322
 		if ($limit) $query .= " LIMIT 10 OFFSET 0";
6323 6323
 
@@ -6340,35 +6340,35 @@  discard block
 block discarded – undo
6340 6340
 	}
6341 6341
 
6342 6342
 	/**
6343
-	* Gets all departure airports of the airplanes that have flown over
6344
-	*
6345
-	* @return Array the airport list
6346
-	*
6347
-	*/
6343
+	 * Gets all departure airports of the airplanes that have flown over
6344
+	 *
6345
+	 * @return Array the airport list
6346
+	 *
6347
+	 */
6348 6348
 	public function countAllDepartureAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array())
6349 6349
 	{
6350 6350
 		global $globalDBdriver;
6351 6351
 		$filter_query = $this->getFilter($filters,true,true);
6352 6352
 		$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 
6353 6353
 			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 <> '' ";
6354
-                if ($olderthanmonths > 0) {
6355
-            		if ($globalDBdriver == 'mysql') {
6354
+				if ($olderthanmonths > 0) {
6355
+					if ($globalDBdriver == 'mysql') {
6356 6356
 				$query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) ';
6357 6357
 			} else {
6358 6358
 				$query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' ";
6359 6359
 			}
6360
-                }
6361
-                if ($sincedate != '') {
6362
-            		if ($globalDBdriver == 'mysql') {
6360
+				}
6361
+				if ($sincedate != '') {
6362
+					if ($globalDBdriver == 'mysql') {
6363 6363
 				$query .= "AND spotter_output.date > '".$sincedate."' ";
6364 6364
 			} else {
6365 6365
 				$query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
6366 6366
 			}
6367 6367
 		}
6368 6368
 
6369
-            	//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
6370
-                //if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
6371
-                $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
6369
+				//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
6370
+				//if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
6371
+				$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
6372 6372
 				ORDER BY airport_departure_icao_count DESC";
6373 6373
 		if ($limit) $query .= " LIMIT 10 OFFSET 0";
6374 6374
       
@@ -6393,26 +6393,26 @@  discard block
 block discarded – undo
6393 6393
 	}
6394 6394
 
6395 6395
 	/**
6396
-	* Gets all detected departure airports of the airplanes that have flown over
6397
-	*
6398
-	* @return Array the airport list
6399
-	*
6400
-	*/
6396
+	 * Gets all detected departure airports of the airplanes that have flown over
6397
+	 *
6398
+	 * @return Array the airport list
6399
+	 *
6400
+	 */
6401 6401
 	public function countAllDetectedDepartureAirports($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array(),$year = '',$month = '',$day = '')
6402 6402
 	{
6403 6403
 		global $globalDBdriver;
6404 6404
 		$filter_query = $this->getFilter($filters,true,true);
6405 6405
 		$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
6406 6406
 				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";
6407
-                if ($olderthanmonths > 0) {
6408
-            		if ($globalDBdriver == 'mysql') {
6407
+				if ($olderthanmonths > 0) {
6408
+					if ($globalDBdriver == 'mysql') {
6409 6409
 				$query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)';
6410 6410
 			} else {
6411 6411
 				$query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'";
6412 6412
 			}
6413
-                }
6414
-                if ($sincedate != '') {
6415
-            		if ($globalDBdriver == 'mysql') {
6413
+				}
6414
+				if ($sincedate != '') {
6415
+					if ($globalDBdriver == 'mysql') {
6416 6416
 				$query .= " AND spotter_output.date > '".$sincedate."'";
6417 6417
 			} else {
6418 6418
 				$query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
@@ -6446,10 +6446,10 @@  discard block
 block discarded – undo
6446 6446
 				$query_values = array_merge($query_values,array(':day' => $day));
6447 6447
 			}
6448 6448
 		}
6449
-                $query .= " GROUP BY spotter_output.real_departure_airport_icao, airport.name, airport.city, airport.country
6449
+				$query .= " GROUP BY spotter_output.real_departure_airport_icao, airport.name, airport.city, airport.country
6450 6450
 				ORDER BY airport_departure_icao_count DESC";
6451 6451
 		if ($limit) $query .= " LIMIT 10 OFFSET 0";
6452
-    		//echo $query;
6452
+			//echo $query;
6453 6453
 		$sth = $this->db->prepare($query);
6454 6454
 		$sth->execute($query_values);
6455 6455
       
@@ -6470,35 +6470,35 @@  discard block
 block discarded – undo
6470 6470
 	}
6471 6471
 	
6472 6472
 	/**
6473
-	* Gets all detected departure airports of the airplanes that have flown over
6474
-	*
6475
-	* @return Array the airport list
6476
-	*
6477
-	*/
6473
+	 * Gets all detected departure airports of the airplanes that have flown over
6474
+	 *
6475
+	 * @return Array the airport list
6476
+	 *
6477
+	 */
6478 6478
 	public function countAllDetectedDepartureAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array())
6479 6479
 	{
6480 6480
 		global $globalDBdriver;
6481 6481
 		$filter_query = $this->getFilter($filters,true,true);
6482 6482
 		$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
6483 6483
 				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 ";
6484
-                if ($olderthanmonths > 0) {
6485
-            		if ($globalDBdriver == 'mysql') {
6484
+				if ($olderthanmonths > 0) {
6485
+					if ($globalDBdriver == 'mysql') {
6486 6486
 				$query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) ';
6487 6487
 			} else {
6488 6488
 				$query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' ";
6489 6489
 			}
6490
-                }
6491
-                if ($sincedate != '') {
6492
-            		if ($globalDBdriver == 'mysql') {
6490
+				}
6491
+				if ($sincedate != '') {
6492
+					if ($globalDBdriver == 'mysql') {
6493 6493
 				$query .= "AND spotter_output.date > '".$sincedate."' ";
6494 6494
 			} else {
6495 6495
 				$query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP) ";
6496 6496
 			}
6497 6497
 		}
6498 6498
 
6499
-            	//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
6500
-                //if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
6501
-                $query .= "GROUP BY spotter_output.airline_icao, spotter_output.real_departure_airport_icao, airport.name, airport.city, airport.country
6499
+				//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
6500
+				//if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
6501
+				$query .= "GROUP BY spotter_output.airline_icao, spotter_output.real_departure_airport_icao, airport.name, airport.city, airport.country
6502 6502
 				ORDER BY airport_departure_icao_count DESC";
6503 6503
 		if ($limit) $query .= " LIMIT 10 OFFSET 0";
6504 6504
       
@@ -6523,11 +6523,11 @@  discard block
 block discarded – undo
6523 6523
 	}	
6524 6524
 	
6525 6525
 	/**
6526
-	* Gets all departure airports of the airplanes that have flown over based on an airline icao
6527
-	*
6528
-	* @return Array the airport list
6529
-	*
6530
-	*/
6526
+	 * Gets all departure airports of the airplanes that have flown over based on an airline icao
6527
+	 *
6528
+	 * @return Array the airport list
6529
+	 *
6530
+	 */
6531 6531
 	public function countAllDepartureAirportsByAirline($airline_icao,$filters = array())
6532 6532
 	{
6533 6533
 		$filter_query = $this->getFilter($filters,true,true);
@@ -6561,11 +6561,11 @@  discard block
 block discarded – undo
6561 6561
 	
6562 6562
 	
6563 6563
 	/**
6564
-	* Gets all departure airports by country of the airplanes that have flown over based on an airline icao
6565
-	*
6566
-	* @return Array the airport list
6567
-	*
6568
-	*/
6564
+	 * Gets all departure airports by country of the airplanes that have flown over based on an airline icao
6565
+	 *
6566
+	 * @return Array the airport list
6567
+	 *
6568
+	 */
6569 6569
 	public function countAllDepartureAirportCountriesByAirline($airline_icao,$filters = array())
6570 6570
 	{
6571 6571
 		$filter_query = $this->getFilter($filters,true,true);
@@ -6596,11 +6596,11 @@  discard block
 block discarded – undo
6596 6596
 	
6597 6597
 	
6598 6598
 	/**
6599
-	* Gets all departure airports of the airplanes that have flown over based on an aircraft icao
6600
-	*
6601
-	* @return Array the airport list
6602
-	*
6603
-	*/
6599
+	 * Gets all departure airports of the airplanes that have flown over based on an aircraft icao
6600
+	 *
6601
+	 * @return Array the airport list
6602
+	 *
6603
+	 */
6604 6604
 	public function countAllDepartureAirportsByAircraft($aircraft_icao,$filters = array())
6605 6605
 	{
6606 6606
 		$filter_query = $this->getFilter($filters,true,true);
@@ -6633,11 +6633,11 @@  discard block
 block discarded – undo
6633 6633
 	
6634 6634
 	
6635 6635
 	/**
6636
-	* Gets all departure airports by country of the airplanes that have flown over based on an aircraft icao
6637
-	*
6638
-	* @return Array the airport list
6639
-	*
6640
-	*/
6636
+	 * Gets all departure airports by country of the airplanes that have flown over based on an aircraft icao
6637
+	 *
6638
+	 * @return Array the airport list
6639
+	 *
6640
+	 */
6641 6641
 	public function countAllDepartureAirportCountriesByAircraft($aircraft_icao,$filters = array())
6642 6642
 	{
6643 6643
 		$filter_query = $this->getFilter($filters,true,true);
@@ -6667,11 +6667,11 @@  discard block
 block discarded – undo
6667 6667
 	
6668 6668
 	
6669 6669
 	/**
6670
-	* Gets all departure airports of the airplanes that have flown over based on an aircraft registration
6671
-	*
6672
-	* @return Array the airport list
6673
-	*
6674
-	*/
6670
+	 * Gets all departure airports of the airplanes that have flown over based on an aircraft registration
6671
+	 *
6672
+	 * @return Array the airport list
6673
+	 *
6674
+	 */
6675 6675
 	public function countAllDepartureAirportsByRegistration($registration,$filters = array())
6676 6676
 	{
6677 6677
 		$filter_query = $this->getFilter($filters,true,true);
@@ -6704,11 +6704,11 @@  discard block
 block discarded – undo
6704 6704
 	
6705 6705
 	
6706 6706
 	/**
6707
-	* Gets all departure airports by country of the airplanes that have flown over based on an aircraft registration
6708
-	*
6709
-	* @return Array the airport list
6710
-	*
6711
-	*/
6707
+	 * Gets all departure airports by country of the airplanes that have flown over based on an aircraft registration
6708
+	 *
6709
+	 * @return Array the airport list
6710
+	 *
6711
+	 */
6712 6712
 	public function countAllDepartureAirportCountriesByRegistration($registration,$filters = array())
6713 6713
 	{
6714 6714
 		$filter_query = $this->getFilter($filters,true,true);
@@ -6738,11 +6738,11 @@  discard block
 block discarded – undo
6738 6738
 	
6739 6739
 	
6740 6740
 	/**
6741
-	* Gets all departure airports of the airplanes that have flown over based on an arrivl airport icao
6742
-	*
6743
-	* @return Array the airport list
6744
-	*
6745
-	*/
6741
+	 * Gets all departure airports of the airplanes that have flown over based on an arrivl airport icao
6742
+	 *
6743
+	 * @return Array the airport list
6744
+	 *
6745
+	 */
6746 6746
 	public function countAllDepartureAirportsByAirport($airport_icao,$filters = array())
6747 6747
 	{
6748 6748
 		$filter_query = $this->getFilter($filters,true,true);
@@ -6775,11 +6775,11 @@  discard block
 block discarded – undo
6775 6775
 	
6776 6776
 	
6777 6777
 	/**
6778
-	* Gets all departure airports by country of the airplanes that have flown over based on an airport icao
6779
-	*
6780
-	* @return Array the airport list
6781
-	*
6782
-	*/
6778
+	 * Gets all departure airports by country of the airplanes that have flown over based on an airport icao
6779
+	 *
6780
+	 * @return Array the airport list
6781
+	 *
6782
+	 */
6783 6783
 	public function countAllDepartureAirportCountriesByAirport($airport_icao,$filters = array())
6784 6784
 	{
6785 6785
 		$filter_query = $this->getFilter($filters,true,true);
@@ -6810,11 +6810,11 @@  discard block
 block discarded – undo
6810 6810
 	
6811 6811
 	
6812 6812
 	/**
6813
-	* Gets all departure airports of the airplanes that have flown over based on an aircraft manufacturer
6814
-	*
6815
-	* @return Array the airport list
6816
-	*
6817
-	*/
6813
+	 * Gets all departure airports of the airplanes that have flown over based on an aircraft manufacturer
6814
+	 *
6815
+	 * @return Array the airport list
6816
+	 *
6817
+	 */
6818 6818
 	public function countAllDepartureAirportsByManufacturer($aircraft_manufacturer,$filters = array())
6819 6819
 	{
6820 6820
 		$filter_query = $this->getFilter($filters,true,true);
@@ -6847,11 +6847,11 @@  discard block
 block discarded – undo
6847 6847
 	
6848 6848
 	
6849 6849
 	/**
6850
-	* Gets all departure airports by country of the airplanes that have flown over based on an aircraft manufacturer
6851
-	*
6852
-	* @return Array the airport list
6853
-	*
6854
-	*/
6850
+	 * Gets all departure airports by country of the airplanes that have flown over based on an aircraft manufacturer
6851
+	 *
6852
+	 * @return Array the airport list
6853
+	 *
6854
+	 */
6855 6855
 	public function countAllDepartureAirportCountriesByManufacturer($aircraft_manufacturer,$filters = array())
6856 6856
 	{
6857 6857
 		$filter_query = $this->getFilter($filters,true,true);
@@ -6881,11 +6881,11 @@  discard block
 block discarded – undo
6881 6881
 	
6882 6882
 	
6883 6883
 	/**
6884
-	* Gets all departure airports of the airplanes that have flown over based on a date
6885
-	*
6886
-	* @return Array the airport list
6887
-	*
6888
-	*/
6884
+	 * Gets all departure airports of the airplanes that have flown over based on a date
6885
+	 *
6886
+	 * @return Array the airport list
6887
+	 *
6888
+	 */
6889 6889
 	public function countAllDepartureAirportsByDate($date,$filters = array())
6890 6890
 	{
6891 6891
 		global $globalTimezone, $globalDBdriver;
@@ -6931,11 +6931,11 @@  discard block
 block discarded – undo
6931 6931
 	
6932 6932
 	
6933 6933
 	/**
6934
-	* Gets all departure airports by country of the airplanes that have flown over based on a date
6935
-	*
6936
-	* @return Array the airport list
6937
-	*
6938
-	*/
6934
+	 * Gets all departure airports by country of the airplanes that have flown over based on a date
6935
+	 *
6936
+	 * @return Array the airport list
6937
+	 *
6938
+	 */
6939 6939
 	public function countAllDepartureAirportCountriesByDate($date,$filters = array())
6940 6940
 	{
6941 6941
 		global $globalTimezone, $globalDBdriver;
@@ -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 ident/callsign
6982
-	*
6983
-	* @return Array the airport list
6984
-	*
6985
-	*/
6981
+	 * Gets all departure airports of the airplanes that have flown over based on a ident/callsign
6982
+	 *
6983
+	 * @return Array the airport list
6984
+	 *
6985
+	 */
6986 6986
 	public function countAllDepartureAirportsByIdent($ident,$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 owner
7018
-	*
7019
-	* @return Array the airport list
7020
-	*
7021
-	*/
7017
+	 * Gets all departure airports of the airplanes that have flown over based on a owner
7018
+	 *
7019
+	 * @return Array the airport list
7020
+	 *
7021
+	 */
7022 7022
 	public function countAllDepartureAirportsByOwner($owner,$filters = array())
7023 7023
 	{
7024 7024
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7050,11 +7050,11 @@  discard block
 block discarded – undo
7050 7050
 	}
7051 7051
 	
7052 7052
 	/**
7053
-	* Gets all departure airports of the airplanes that have flown over based on a pilot
7054
-	*
7055
-	* @return Array the airport list
7056
-	*
7057
-	*/
7053
+	 * Gets all departure airports of the airplanes that have flown over based on a pilot
7054
+	 *
7055
+	 * @return Array the airport list
7056
+	 *
7057
+	 */
7058 7058
 	public function countAllDepartureAirportsByPilot($pilot,$filters = array())
7059 7059
 	{
7060 7060
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7087,11 +7087,11 @@  discard block
 block discarded – undo
7087 7087
 	
7088 7088
 	
7089 7089
 	/**
7090
-	* Gets all departure airports by country of the airplanes that have flown over based on a callsign/ident
7091
-	*
7092
-	* @return Array the airport list
7093
-	*
7094
-	*/
7090
+	 * Gets all departure airports by country of the airplanes that have flown over based on a callsign/ident
7091
+	 *
7092
+	 * @return Array the airport list
7093
+	 *
7094
+	 */
7095 7095
 	public function countAllDepartureAirportCountriesByIdent($ident,$filters = array())
7096 7096
 	{
7097 7097
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7120,11 +7120,11 @@  discard block
 block discarded – undo
7120 7120
 	}
7121 7121
 	
7122 7122
 	/**
7123
-	* Gets all departure airports by country of the airplanes that have flown over based on owner
7124
-	*
7125
-	* @return Array the airport list
7126
-	*
7127
-	*/
7123
+	 * Gets all departure airports by country of the airplanes that have flown over based on owner
7124
+	 *
7125
+	 * @return Array the airport list
7126
+	 *
7127
+	 */
7128 7128
 	public function countAllDepartureAirportCountriesByOwner($owner,$filters = array())
7129 7129
 	{
7130 7130
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7140,11 +7140,11 @@  discard block
 block discarded – undo
7140 7140
 	}
7141 7141
 	
7142 7142
 	/**
7143
-	* Gets all departure airports by country of the airplanes that have flown over based on pilot
7144
-	*
7145
-	* @return Array the airport list
7146
-	*
7147
-	*/
7143
+	 * Gets all departure airports by country of the airplanes that have flown over based on pilot
7144
+	 *
7145
+	 * @return Array the airport list
7146
+	 *
7147
+	 */
7148 7148
 	public function countAllDepartureAirportCountriesByPilot($pilot,$filters = array())
7149 7149
 	{
7150 7150
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7162,11 +7162,11 @@  discard block
 block discarded – undo
7162 7162
 	
7163 7163
 	
7164 7164
 	/**
7165
-	* Gets all departure airports of the airplanes that have flown over based on a country
7166
-	*
7167
-	* @return Array the airport list
7168
-	*
7169
-	*/
7165
+	 * Gets all departure airports of the airplanes that have flown over based on a country
7166
+	 *
7167
+	 * @return Array the airport list
7168
+	 *
7169
+	 */
7170 7170
 	public function countAllDepartureAirportsByCountry($country,$filters = array())
7171 7171
 	{
7172 7172
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7200,11 +7200,11 @@  discard block
 block discarded – undo
7200 7200
 
7201 7201
 
7202 7202
 	/**
7203
-	* Gets all departure airports by country of the airplanes that have flown over based on an aircraft icao
7204
-	*
7205
-	* @return Array the airport list
7206
-	*
7207
-	*/
7203
+	 * Gets all departure airports by country of the airplanes that have flown over based on an aircraft icao
7204
+	 *
7205
+	 * @return Array the airport list
7206
+	 *
7207
+	 */
7208 7208
 	public function countAllDepartureAirportCountriesByCountry($country,$filters = array())
7209 7209
 	{
7210 7210
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7234,31 +7234,31 @@  discard block
 block discarded – undo
7234 7234
 	
7235 7235
 
7236 7236
 	/**
7237
-	* Gets all arrival airports of the airplanes that have flown over
7238
-	*
7239
-	* @param Boolean $limit Limit result to 10 or not
7240
-	* @param Integer $olderthanmonths Only show result older than x months
7241
-	* @param String $sincedate Only show result since x date
7242
-	* @param Boolean $icaoaskey Show result by ICAO
7243
-	* @param Array $filters Filter used here
7244
-	* @return Array the airport list
7245
-	*
7246
-	*/
7237
+	 * Gets all arrival airports of the airplanes that have flown over
7238
+	 *
7239
+	 * @param Boolean $limit Limit result to 10 or not
7240
+	 * @param Integer $olderthanmonths Only show result older than x months
7241
+	 * @param String $sincedate Only show result since x date
7242
+	 * @param Boolean $icaoaskey Show result by ICAO
7243
+	 * @param Array $filters Filter used here
7244
+	 * @return Array the airport list
7245
+	 *
7246
+	 */
7247 7247
 	public function countAllArrivalAirports($limit = true, $olderthanmonths = 0, $sincedate = '', $icaoaskey = false,$filters = array(),$year = '',$month = '',$day = '')
7248 7248
 	{
7249 7249
 		global $globalDBdriver;
7250 7250
 		$filter_query = $this->getFilter($filters,true,true);
7251 7251
 		$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 
7252 7252
 				FROM spotter_output".$filter_query." spotter_output.arrival_airport_name <> '' AND spotter_output.arrival_airport_icao <> 'NA' AND spotter_output.arrival_airport_icao <> ''";
7253
-                if ($olderthanmonths > 0) {
7254
-            		if ($globalDBdriver == 'mysql') {
7253
+				if ($olderthanmonths > 0) {
7254
+					if ($globalDBdriver == 'mysql') {
7255 7255
 				$query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)';
7256 7256
 			} else {
7257 7257
 				$query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'";
7258 7258
 			}
7259 7259
 		}
7260
-                if ($sincedate != '') {
7261
-            		if ($globalDBdriver == 'mysql') {
7260
+				if ($sincedate != '') {
7261
+					if ($globalDBdriver == 'mysql') {
7262 7262
 				$query .= " AND spotter_output.date > '".$sincedate."'";
7263 7263
 			} else {
7264 7264
 				$query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
@@ -7292,7 +7292,7 @@  discard block
 block discarded – undo
7292 7292
 				$query_values = array_merge($query_values,array(':day' => $day));
7293 7293
 			}
7294 7294
 		}
7295
-                $query .= " GROUP BY spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country
7295
+				$query .= " GROUP BY spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country
7296 7296
 					ORDER BY airport_arrival_icao_count DESC";
7297 7297
 		if ($limit) $query .= " LIMIT 10";
7298 7298
       
@@ -7321,35 +7321,35 @@  discard block
 block discarded – undo
7321 7321
 	}
7322 7322
 
7323 7323
 	/**
7324
-	* Gets all arrival airports of the airplanes that have flown over
7325
-	*
7326
-	* @return Array the airport list
7327
-	*
7328
-	*/
7324
+	 * Gets all arrival airports of the airplanes that have flown over
7325
+	 *
7326
+	 * @return Array the airport list
7327
+	 *
7328
+	 */
7329 7329
 	public function countAllArrivalAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '', $icaoaskey = false,$filters = array())
7330 7330
 	{
7331 7331
 		global $globalDBdriver;
7332 7332
 		$filter_query = $this->getFilter($filters,true,true);
7333 7333
 		$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 
7334 7334
 			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 <> '' ";
7335
-                if ($olderthanmonths > 0) {
7336
-            		if ($globalDBdriver == 'mysql') {
7335
+				if ($olderthanmonths > 0) {
7336
+					if ($globalDBdriver == 'mysql') {
7337 7337
 				$query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) ';
7338 7338
 			} else {
7339 7339
 				$query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' ";
7340 7340
 			}
7341 7341
 		}
7342
-                if ($sincedate != '') {
7343
-            		if ($globalDBdriver == 'mysql') {
7342
+				if ($sincedate != '') {
7343
+					if ($globalDBdriver == 'mysql') {
7344 7344
 				$query .= "AND spotter_output.date > '".$sincedate."' ";
7345 7345
 			} else {
7346 7346
 				$query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
7347 7347
 			}
7348 7348
 		}
7349 7349
 
7350
-            	//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
7351
-                //if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
7352
-                $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
7350
+				//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
7351
+				//if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
7352
+				$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
7353 7353
 					ORDER BY airport_arrival_icao_count DESC";
7354 7354
 		if ($limit) $query .= " LIMIT 10";
7355 7355
       
@@ -7380,26 +7380,26 @@  discard block
 block discarded – undo
7380 7380
 
7381 7381
 
7382 7382
 	/**
7383
-	* Gets all detected arrival airports of the airplanes that have flown over
7384
-	*
7385
-	* @return Array the airport list
7386
-	*
7387
-	*/
7383
+	 * Gets all detected arrival airports of the airplanes that have flown over
7384
+	 *
7385
+	 * @return Array the airport list
7386
+	 *
7387
+	 */
7388 7388
 	public function countAllDetectedArrivalAirports($limit = true, $olderthanmonths = 0, $sincedate = '',$icaoaskey = false,$filters = array(),$year = '',$month = '',$day = '')
7389 7389
 	{
7390 7390
 		global $globalDBdriver;
7391 7391
 		$filter_query = $this->getFilter($filters,true,true);
7392 7392
 		$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 
7393 7393
 			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";
7394
-                if ($olderthanmonths > 0) {
7395
-            		if ($globalDBdriver == 'mysql') {
7394
+				if ($olderthanmonths > 0) {
7395
+					if ($globalDBdriver == 'mysql') {
7396 7396
 				$query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)';
7397 7397
 			} else {
7398 7398
 				$query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'";
7399 7399
 			}
7400 7400
 		}
7401
-                if ($sincedate != '') {
7402
-            		if ($globalDBdriver == 'mysql') {
7401
+				if ($sincedate != '') {
7402
+					if ($globalDBdriver == 'mysql') {
7403 7403
 				$query .= " AND spotter_output.date > '".$sincedate."'";
7404 7404
 			} else {
7405 7405
 				$query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
@@ -7433,7 +7433,7 @@  discard block
 block discarded – undo
7433 7433
 				$query_values = array_merge($query_values,array(':day' => $day));
7434 7434
 			}
7435 7435
 		}
7436
-                $query .= " GROUP BY spotter_output.real_arrival_airport_icao, airport.name, airport.city, airport.country
7436
+				$query .= " GROUP BY spotter_output.real_arrival_airport_icao, airport.name, airport.city, airport.country
7437 7437
 					ORDER BY airport_arrival_icao_count DESC";
7438 7438
 		if ($limit) $query .= " LIMIT 10";
7439 7439
       
@@ -7461,35 +7461,35 @@  discard block
 block discarded – undo
7461 7461
 	}
7462 7462
 	
7463 7463
 	/**
7464
-	* Gets all detected arrival airports of the airplanes that have flown over
7465
-	*
7466
-	* @return Array the airport list
7467
-	*
7468
-	*/
7464
+	 * Gets all detected arrival airports of the airplanes that have flown over
7465
+	 *
7466
+	 * @return Array the airport list
7467
+	 *
7468
+	 */
7469 7469
 	public function countAllDetectedArrivalAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '',$icaoaskey = false,$filters = array())
7470 7470
 	{
7471 7471
 		global $globalDBdriver;
7472 7472
 		$filter_query = $this->getFilter($filters,true,true);
7473 7473
 		$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 
7474 7474
 			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 ";
7475
-                if ($olderthanmonths > 0) {
7476
-            		if ($globalDBdriver == 'mysql') {
7475
+				if ($olderthanmonths > 0) {
7476
+					if ($globalDBdriver == 'mysql') {
7477 7477
 				$query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) ';
7478 7478
 			} else {
7479 7479
 				$query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' ";
7480 7480
 			}
7481 7481
 		}
7482
-                if ($sincedate != '') {
7483
-            		if ($globalDBdriver == 'mysql') {
7482
+				if ($sincedate != '') {
7483
+					if ($globalDBdriver == 'mysql') {
7484 7484
 				$query .= "AND spotter_output.date > '".$sincedate."' ";
7485 7485
 			} else {
7486 7486
 				$query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
7487 7487
 			}
7488 7488
 		}
7489 7489
 
7490
-            	//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
7491
-                //if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
7492
-                $query .= "GROUP BY spotter_output.airline_icao, spotter_output.real_arrival_airport_icao, airport.name, airport.city, airport.country
7490
+				//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
7491
+				//if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
7492
+				$query .= "GROUP BY spotter_output.airline_icao, spotter_output.real_arrival_airport_icao, airport.name, airport.city, airport.country
7493 7493
 					ORDER BY airport_arrival_icao_count DESC";
7494 7494
 		if ($limit) $query .= " LIMIT 10";
7495 7495
       
@@ -7519,11 +7519,11 @@  discard block
 block discarded – undo
7519 7519
 	}	
7520 7520
 	
7521 7521
 	/**
7522
-	* Gets all arrival airports 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 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 countAllArrivalAirportsByAirline($airline_icao, $filters = array())
7528 7528
 	{
7529 7529
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7555,11 +7555,11 @@  discard block
 block discarded – undo
7555 7555
 	
7556 7556
 	
7557 7557
 	/**
7558
-	* Gets all arrival airports by country of the airplanes that have flown over based on an airline icao
7559
-	*
7560
-	* @return Array the airport list
7561
-	*
7562
-	*/
7558
+	 * Gets all arrival airports by country of the airplanes that have flown over based on an airline icao
7559
+	 *
7560
+	 * @return Array the airport list
7561
+	 *
7562
+	 */
7563 7563
 	public function countAllArrivalAirportCountriesByAirline($airline_icao,$filters = array())
7564 7564
 	{
7565 7565
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7590,11 +7590,11 @@  discard block
 block discarded – undo
7590 7590
 	
7591 7591
 	
7592 7592
 	/**
7593
-	* Gets all arrival airports of the airplanes that have flown over based on an aircraft icao
7594
-	*
7595
-	* @return Array the airport list
7596
-	*
7597
-	*/
7593
+	 * Gets all arrival airports of the airplanes that have flown over based on an aircraft icao
7594
+	 *
7595
+	 * @return Array the airport list
7596
+	 *
7597
+	 */
7598 7598
 	public function countAllArrivalAirportsByAircraft($aircraft_icao,$filters = array())
7599 7599
 	{
7600 7600
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7628,11 +7628,11 @@  discard block
 block discarded – undo
7628 7628
 	
7629 7629
 	
7630 7630
 	/**
7631
-	* Gets all arrival airports by country of the airplanes that have flown over based on an aircraft icao
7632
-	*
7633
-	* @return Array the airport list
7634
-	*
7635
-	*/
7631
+	 * Gets all arrival airports by country of the airplanes that have flown over based on an aircraft icao
7632
+	 *
7633
+	 * @return Array the airport list
7634
+	 *
7635
+	 */
7636 7636
 	public function countAllArrivalAirportCountriesByAircraft($aircraft_icao,$filters = array())
7637 7637
 	{
7638 7638
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7662,11 +7662,11 @@  discard block
 block discarded – undo
7662 7662
 	
7663 7663
 	
7664 7664
 	/**
7665
-	* Gets all arrival airports of the airplanes that have flown over based on an aircraft registration
7666
-	*
7667
-	* @return Array the airport list
7668
-	*
7669
-	*/
7665
+	 * Gets all arrival airports of the airplanes that have flown over based on an aircraft registration
7666
+	 *
7667
+	 * @return Array the airport list
7668
+	 *
7669
+	 */
7670 7670
 	public function countAllArrivalAirportsByRegistration($registration,$filters = array())
7671 7671
 	{
7672 7672
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7700,11 +7700,11 @@  discard block
 block discarded – undo
7700 7700
 	
7701 7701
 	
7702 7702
 	/**
7703
-	* Gets all arrival airports by country of the airplanes that have flown over based on an aircraft registration
7704
-	*
7705
-	* @return Array the airport list
7706
-	*
7707
-	*/
7703
+	 * Gets all arrival airports by country of the airplanes that have flown over based on an aircraft registration
7704
+	 *
7705
+	 * @return Array the airport list
7706
+	 *
7707
+	 */
7708 7708
 	public function countAllArrivalAirportCountriesByRegistration($registration,$filters = array())
7709 7709
 	{
7710 7710
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7735,11 +7735,11 @@  discard block
 block discarded – undo
7735 7735
 	
7736 7736
 	
7737 7737
 	/**
7738
-	* Gets all arrival airports of the airplanes that have flown over based on an departure airport
7739
-	*
7740
-	* @return Array the airport list
7741
-	*
7742
-	*/
7738
+	 * Gets all arrival airports of the airplanes that have flown over based on an departure airport
7739
+	 *
7740
+	 * @return Array the airport list
7741
+	 *
7742
+	 */
7743 7743
 	public function countAllArrivalAirportsByAirport($airport_icao,$filters = array())
7744 7744
 	{
7745 7745
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7772,11 +7772,11 @@  discard block
 block discarded – undo
7772 7772
 	
7773 7773
 	
7774 7774
 	/**
7775
-	* Gets all arrival airports by country of the airplanes that have flown over based on an airport icao
7776
-	*
7777
-	* @return Array the airport list
7778
-	*
7779
-	*/
7775
+	 * Gets all arrival airports by country of the airplanes that have flown over based on an airport icao
7776
+	 *
7777
+	 * @return Array the airport list
7778
+	 *
7779
+	 */
7780 7780
 	public function countAllArrivalAirportCountriesByAirport($airport_icao,$filters = array())
7781 7781
 	{
7782 7782
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7806,11 +7806,11 @@  discard block
 block discarded – undo
7806 7806
 	
7807 7807
 	
7808 7808
 	/**
7809
-	* Gets all arrival airports of the airplanes that have flown over based on a aircraft manufacturer
7810
-	*
7811
-	* @return Array the airport list
7812
-	*
7813
-	*/
7809
+	 * Gets all arrival airports of the airplanes that have flown over based on a aircraft manufacturer
7810
+	 *
7811
+	 * @return Array the airport list
7812
+	 *
7813
+	 */
7814 7814
 	public function countAllArrivalAirportsByManufacturer($aircraft_manufacturer,$filters = array())
7815 7815
 	{
7816 7816
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7844,11 +7844,11 @@  discard block
 block discarded – undo
7844 7844
 	
7845 7845
 	
7846 7846
 	/**
7847
-	* Gets all arrival airports by country of the airplanes that have flown over based on a aircraft manufacturer
7848
-	*
7849
-	* @return Array the airport list
7850
-	*
7851
-	*/
7847
+	 * Gets all arrival airports by country of the airplanes that have flown over based on a aircraft manufacturer
7848
+	 *
7849
+	 * @return Array the airport list
7850
+	 *
7851
+	 */
7852 7852
 	public function countAllArrivalAirportCountriesByManufacturer($aircraft_manufacturer,$filters = array())
7853 7853
 	{
7854 7854
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7879,11 +7879,11 @@  discard block
 block discarded – undo
7879 7879
 	
7880 7880
 	
7881 7881
 	/**
7882
-	* Gets all arrival airports of the airplanes that have flown over based on a date
7883
-	*
7884
-	* @return Array the airport list
7885
-	*
7886
-	*/
7882
+	 * Gets all arrival airports of the airplanes that have flown over based on a date
7883
+	 *
7884
+	 * @return Array the airport list
7885
+	 *
7886
+	 */
7887 7887
 	public function countAllArrivalAirportsByDate($date,$filters = array())
7888 7888
 	{
7889 7889
 		global $globalTimezone, $globalDBdriver;
@@ -7929,11 +7929,11 @@  discard block
 block discarded – undo
7929 7929
 	
7930 7930
 	
7931 7931
 	/**
7932
-	* Gets all arrival airports by country of the airplanes that have flown over based on a date
7933
-	*
7934
-	* @return Array the airport list
7935
-	*
7936
-	*/
7932
+	 * Gets all arrival airports by country of the airplanes that have flown over based on a date
7933
+	 *
7934
+	 * @return Array the airport list
7935
+	 *
7936
+	 */
7937 7937
 	public function countAllArrivalAirportCountriesByDate($date, $filters = array())
7938 7938
 	{
7939 7939
 		global $globalTimezone, $globalDBdriver;
@@ -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 ident/callsign
7980
-	*
7981
-	* @return Array the airport list
7982
-	*
7983
-	*/
7979
+	 * Gets all arrival airports of the airplanes that have flown over based on a ident/callsign
7980
+	 *
7981
+	 * @return Array the airport list
7982
+	 *
7983
+	 */
7984 7984
 	public function countAllArrivalAirportsByIdent($ident,$filters = array())
7985 7985
 	{
7986 7986
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8012,11 +8012,11 @@  discard block
 block discarded – undo
8012 8012
 	}
8013 8013
 	
8014 8014
 	/**
8015
-	* Gets all arrival airports of the airplanes that have flown over based on a owner
8016
-	*
8017
-	* @return Array the airport list
8018
-	*
8019
-	*/
8015
+	 * Gets all arrival airports of the airplanes that have flown over based on a owner
8016
+	 *
8017
+	 * @return Array the airport list
8018
+	 *
8019
+	 */
8020 8020
 	public function countAllArrivalAirportsByOwner($owner,$filters = array())
8021 8021
 	{
8022 8022
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8047,11 +8047,11 @@  discard block
 block discarded – undo
8047 8047
 	}
8048 8048
 
8049 8049
 	/**
8050
-	* Gets all arrival airports of the airplanes that have flown over based on a pilot
8051
-	*
8052
-	* @return Array the airport list
8053
-	*
8054
-	*/
8050
+	 * Gets all arrival airports of the airplanes that have flown over based on a pilot
8051
+	 *
8052
+	 * @return Array the airport list
8053
+	 *
8054
+	 */
8055 8055
 	public function countAllArrivalAirportsByPilot($pilot,$filters = array())
8056 8056
 	{
8057 8057
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8082,11 +8082,11 @@  discard block
 block discarded – undo
8082 8082
 	}
8083 8083
 	
8084 8084
 	/**
8085
-	* Gets all arrival airports by country of the airplanes that have flown over based on a callsign/ident
8086
-	*
8087
-	* @return Array the airport list
8088
-	*
8089
-	*/
8085
+	 * Gets all arrival airports by country of the airplanes that have flown over based on a callsign/ident
8086
+	 *
8087
+	 * @return Array the airport list
8088
+	 *
8089
+	 */
8090 8090
 	public function countAllArrivalAirportCountriesByIdent($ident, $filters = array())
8091 8091
 	{
8092 8092
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8115,11 +8115,11 @@  discard block
 block discarded – undo
8115 8115
 	}
8116 8116
 	
8117 8117
 	/**
8118
-	* Gets all arrival airports by country of the airplanes that have flown over based on a owner
8119
-	*
8120
-	* @return Array the airport list
8121
-	*
8122
-	*/
8118
+	 * Gets all arrival airports by country of the airplanes that have flown over based on a owner
8119
+	 *
8120
+	 * @return Array the airport list
8121
+	 *
8122
+	 */
8123 8123
 	public function countAllArrivalAirportCountriesByOwner($owner, $filters = array())
8124 8124
 	{
8125 8125
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8135,11 +8135,11 @@  discard block
 block discarded – undo
8135 8135
 	}
8136 8136
 	
8137 8137
 	/**
8138
-	* Gets all arrival airports by country of the airplanes that have flown over based on a pilot
8139
-	*
8140
-	* @return Array the airport list
8141
-	*
8142
-	*/
8138
+	 * Gets all arrival airports by country of the airplanes that have flown over based on a pilot
8139
+	 *
8140
+	 * @return Array the airport list
8141
+	 *
8142
+	 */
8143 8143
 	public function countAllArrivalAirportCountriesByPilot($pilot, $filters = array())
8144 8144
 	{
8145 8145
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8157,11 +8157,11 @@  discard block
 block discarded – undo
8157 8157
 	
8158 8158
 	
8159 8159
 	/**
8160
-	* Gets all arrival airports of the airplanes that have flown over based on a country
8161
-	*
8162
-	* @return Array the airport list
8163
-	*
8164
-	*/
8160
+	 * Gets all arrival airports of the airplanes that have flown over based on a country
8161
+	 *
8162
+	 * @return Array the airport list
8163
+	 *
8164
+	 */
8165 8165
 	public function countAllArrivalAirportsByCountry($country,$filters = array())
8166 8166
 	{
8167 8167
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8194,11 +8194,11 @@  discard block
 block discarded – undo
8194 8194
 	
8195 8195
 	
8196 8196
 	/**
8197
-	* Gets all arrival airports by country of the airplanes that have flown over based on a country
8198
-	*
8199
-	* @return Array the airport list
8200
-	*
8201
-	*/
8197
+	 * Gets all arrival airports by country of the airplanes that have flown over based on a country
8198
+	 *
8199
+	 * @return Array the airport list
8200
+	 *
8201
+	 */
8202 8202
 	public function countAllArrivalAirportCountriesByCountry($country,$filters = array())
8203 8203
 	{
8204 8204
 		global $globalDBdriver;
@@ -8230,11 +8230,11 @@  discard block
 block discarded – undo
8230 8230
 
8231 8231
 
8232 8232
 	/**
8233
-	* Counts all airport departure countries
8234
-	*
8235
-	* @return Array the airport departure list
8236
-	*
8237
-	*/
8233
+	 * Counts all airport departure countries
8234
+	 *
8235
+	 * @return Array the airport departure list
8236
+	 *
8237
+	 */
8238 8238
 	public function countAllDepartureCountries($filters = array(),$year = '',$month = '', $day = '')
8239 8239
 	{
8240 8240
 		global $globalDBdriver;
@@ -8293,11 +8293,11 @@  discard block
 block discarded – undo
8293 8293
 	
8294 8294
 	
8295 8295
 	/**
8296
-	* Counts all airport arrival countries
8297
-	*
8298
-	* @return Array the airport arrival list
8299
-	*
8300
-	*/
8296
+	 * Counts all airport arrival countries
8297
+	 *
8298
+	 * @return Array the airport arrival list
8299
+	 *
8300
+	 */
8301 8301
 	public function countAllArrivalCountries($limit = true,$filters = array(),$year = '',$month = '',$day = '')
8302 8302
 	{
8303 8303
 		global $globalDBdriver;
@@ -8359,11 +8359,11 @@  discard block
 block discarded – undo
8359 8359
 
8360 8360
 
8361 8361
 	/**
8362
-	* Gets all route combinations
8363
-	*
8364
-	* @return Array the route list
8365
-	*
8366
-	*/
8362
+	 * Gets all route combinations
8363
+	 *
8364
+	 * @return Array the route list
8365
+	 *
8366
+	 */
8367 8367
 	public function countAllRoutes($filters = array())
8368 8368
 	{
8369 8369
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8402,11 +8402,11 @@  discard block
 block discarded – undo
8402 8402
 	
8403 8403
 	
8404 8404
 	/**
8405
-	* Gets all route combinations based on an aircraft
8406
-	*
8407
-	* @return Array the route list
8408
-	*
8409
-	*/
8405
+	 * Gets all route combinations based on an aircraft
8406
+	 *
8407
+	 * @return Array the route list
8408
+	 *
8409
+	 */
8410 8410
 	public function countAllRoutesByAircraft($aircraft_icao,$filters = array())
8411 8411
 	{
8412 8412
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8442,11 +8442,11 @@  discard block
 block discarded – undo
8442 8442
 	
8443 8443
 	
8444 8444
 	/**
8445
-	* Gets all route combinations based on an aircraft registration
8446
-	*
8447
-	* @return Array the route list
8448
-	*
8449
-	*/
8445
+	 * Gets all route combinations based on an aircraft registration
8446
+	 *
8447
+	 * @return Array the route list
8448
+	 *
8449
+	 */
8450 8450
 	public function countAllRoutesByRegistration($registration, $filters = array())
8451 8451
 	{
8452 8452
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8484,11 +8484,11 @@  discard block
 block discarded – undo
8484 8484
 	
8485 8485
 	
8486 8486
 	/**
8487
-	* Gets all route combinations based on an airline
8488
-	*
8489
-	* @return Array the route list
8490
-	*
8491
-	*/
8487
+	 * Gets all route combinations based on an airline
8488
+	 *
8489
+	 * @return Array the route list
8490
+	 *
8491
+	 */
8492 8492
 	public function countAllRoutesByAirline($airline_icao, $filters = array())
8493 8493
 	{
8494 8494
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8526,11 +8526,11 @@  discard block
 block discarded – undo
8526 8526
 	
8527 8527
 	
8528 8528
 	/**
8529
-	* Gets all route combinations based on an airport
8530
-	*
8531
-	* @return Array the route list
8532
-	*
8533
-	*/
8529
+	 * Gets all route combinations based on an airport
8530
+	 *
8531
+	 * @return Array the route list
8532
+	 *
8533
+	 */
8534 8534
 	public function countAllRoutesByAirport($airport_icao, $filters = array())
8535 8535
 	{
8536 8536
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8567,11 +8567,11 @@  discard block
 block discarded – undo
8567 8567
 	
8568 8568
 	
8569 8569
 	/**
8570
-	* Gets all route combinations based on an country
8571
-	*
8572
-	* @return Array the route list
8573
-	*
8574
-	*/
8570
+	 * Gets all route combinations based on an country
8571
+	 *
8572
+	 * @return Array the route list
8573
+	 *
8574
+	 */
8575 8575
 	public function countAllRoutesByCountry($country, $filters = array())
8576 8576
 	{
8577 8577
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8607,11 +8607,11 @@  discard block
 block discarded – undo
8607 8607
 
8608 8608
 
8609 8609
 	/**
8610
-	* Gets all route combinations based on an date
8611
-	*
8612
-	* @return Array the route list
8613
-	*
8614
-	*/
8610
+	 * Gets all route combinations based on an date
8611
+	 *
8612
+	 * @return Array the route list
8613
+	 *
8614
+	 */
8615 8615
 	public function countAllRoutesByDate($date, $filters = array())
8616 8616
 	{
8617 8617
 		global $globalTimezone, $globalDBdriver;
@@ -8661,11 +8661,11 @@  discard block
 block discarded – undo
8661 8661
 	
8662 8662
 	
8663 8663
 	/**
8664
-	* Gets all route combinations based on an ident/callsign
8665
-	*
8666
-	* @return Array the route list
8667
-	*
8668
-	*/
8664
+	 * Gets all route combinations based on an ident/callsign
8665
+	 *
8666
+	 * @return Array the route list
8667
+	 *
8668
+	 */
8669 8669
 	public function countAllRoutesByIdent($ident, $filters = array())
8670 8670
 	{
8671 8671
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8701,11 +8701,11 @@  discard block
 block discarded – undo
8701 8701
 	}
8702 8702
 	
8703 8703
 	/**
8704
-	* Gets all route combinations based on an owner
8705
-	*
8706
-	* @return Array the route list
8707
-	*
8708
-	*/
8704
+	 * Gets all route combinations based on an owner
8705
+	 *
8706
+	 * @return Array the route list
8707
+	 *
8708
+	 */
8709 8709
 	public function countAllRoutesByOwner($owner,$filters = array())
8710 8710
 	{
8711 8711
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8741,11 +8741,11 @@  discard block
 block discarded – undo
8741 8741
 	}
8742 8742
 	
8743 8743
 	/**
8744
-	* Gets all route combinations based on a pilot
8745
-	*
8746
-	* @return Array the route list
8747
-	*
8748
-	*/
8744
+	 * Gets all route combinations based on a pilot
8745
+	 *
8746
+	 * @return Array the route list
8747
+	 *
8748
+	 */
8749 8749
 	public function countAllRoutesByPilot($pilot,$filters = array())
8750 8750
 	{
8751 8751
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8782,11 +8782,11 @@  discard block
 block discarded – undo
8782 8782
 	
8783 8783
 	
8784 8784
 	/**
8785
-	* Gets all route combinations based on an manufacturer
8786
-	*
8787
-	* @return Array the route list
8788
-	*
8789
-	*/
8785
+	 * Gets all route combinations based on an manufacturer
8786
+	 *
8787
+	 * @return Array the route list
8788
+	 *
8789
+	 */
8790 8790
 	public function countAllRoutesByManufacturer($aircraft_manufacturer, $filters = array())
8791 8791
 	{
8792 8792
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8824,11 +8824,11 @@  discard block
 block discarded – undo
8824 8824
 	
8825 8825
 	
8826 8826
 	/**
8827
-	* Gets all route combinations with waypoints
8828
-	*
8829
-	* @return Array the route list
8830
-	*
8831
-	*/
8827
+	 * Gets all route combinations with waypoints
8828
+	 *
8829
+	 * @return Array the route list
8830
+	 *
8831
+	 */
8832 8832
 	public function countAllRoutesWithWaypoints($filters = array())
8833 8833
 	{
8834 8834
 		$filter_query = $this->getFilter($filters,true,true);
@@ -8865,11 +8865,11 @@  discard block
 block discarded – undo
8865 8865
 	}
8866 8866
 	
8867 8867
 	/**
8868
-	* Gets all callsigns that have flown over
8869
-	*
8870
-	* @return Array the callsign list
8871
-	*
8872
-	*/
8868
+	 * Gets all callsigns that have flown over
8869
+	 *
8870
+	 * @return Array the callsign list
8871
+	 *
8872
+	 */
8873 8873
 	public function countAllCallsigns($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array(),$year = '', $month = '', $day = '')
8874 8874
 	{
8875 8875
 		global $globalDBdriver;
@@ -8935,11 +8935,11 @@  discard block
 block discarded – undo
8935 8935
 	}
8936 8936
 
8937 8937
 	/**
8938
-	* Gets all callsigns that have flown over
8939
-	*
8940
-	* @return Array the callsign list
8941
-	*
8942
-	*/
8938
+	 * Gets all callsigns that have flown over
8939
+	 *
8940
+	 * @return Array the callsign list
8941
+	 *
8942
+	 */
8943 8943
 	public function countAllCallsignsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '', $filters = array())
8944 8944
 	{
8945 8945
 		global $globalDBdriver;
@@ -8980,11 +8980,11 @@  discard block
 block discarded – undo
8980 8980
 
8981 8981
 
8982 8982
 	/**
8983
-	* Counts all dates
8984
-	*
8985
-	* @return Array the date list
8986
-	*
8987
-	*/
8983
+	 * Counts all dates
8984
+	 *
8985
+	 * @return Array the date list
8986
+	 *
8987
+	 */
8988 8988
 	public function countAllDates($filters = array())
8989 8989
 	{
8990 8990
 		global $globalTimezone, $globalDBdriver;
@@ -9029,11 +9029,11 @@  discard block
 block discarded – undo
9029 9029
 	}
9030 9030
 	
9031 9031
 	/**
9032
-	* Counts all dates
9033
-	*
9034
-	* @return Array the date list
9035
-	*
9036
-	*/
9032
+	 * Counts all dates
9033
+	 *
9034
+	 * @return Array the date list
9035
+	 *
9036
+	 */
9037 9037
 	public function countAllDatesByAirlines($filters = array())
9038 9038
 	{
9039 9039
 		global $globalTimezone, $globalDBdriver;
@@ -9078,11 +9078,11 @@  discard block
 block discarded – undo
9078 9078
 	}	
9079 9079
 	
9080 9080
 	/**
9081
-	* Counts all dates during the last 7 days
9082
-	*
9083
-	* @return Array the date list
9084
-	*
9085
-	*/
9081
+	 * Counts all dates during the last 7 days
9082
+	 *
9083
+	 * @return Array the date list
9084
+	 *
9085
+	 */
9086 9086
 	public function countAllDatesLast7Days($filters = array())
9087 9087
 	{
9088 9088
 		global $globalTimezone, $globalDBdriver;
@@ -9104,7 +9104,7 @@  discard block
 block discarded – undo
9104 9104
 			$query .= " GROUP BY date_name 
9105 9105
 								ORDER BY date_name ASC";
9106 9106
 			$query_data = array(':offset' => $offset);
9107
-    		}
9107
+			}
9108 9108
 		
9109 9109
 		$sth = $this->db->prepare($query);
9110 9110
 		$sth->execute($query_data);
@@ -9124,11 +9124,11 @@  discard block
 block discarded – undo
9124 9124
 	}
9125 9125
 
9126 9126
 	/**
9127
-	* Counts all dates during the last month
9128
-	*
9129
-	* @return Array the date list
9130
-	*
9131
-	*/
9127
+	 * Counts all dates during the last month
9128
+	 *
9129
+	 * @return Array the date list
9130
+	 *
9131
+	 */
9132 9132
 	public function countAllDatesLastMonth($filters = array())
9133 9133
 	{
9134 9134
 		global $globalTimezone, $globalDBdriver;
@@ -9150,7 +9150,7 @@  discard block
 block discarded – undo
9150 9150
 			$query .= " GROUP BY date_name 
9151 9151
 								ORDER BY date_name ASC";
9152 9152
 			$query_data = array(':offset' => $offset);
9153
-    		}
9153
+			}
9154 9154
 		
9155 9155
 		$sth = $this->db->prepare($query);
9156 9156
 		$sth->execute($query_data);
@@ -9171,11 +9171,11 @@  discard block
 block discarded – undo
9171 9171
 
9172 9172
 
9173 9173
 	/**
9174
-	* Counts all dates during the last month
9175
-	*
9176
-	* @return Array the date list
9177
-	*
9178
-	*/
9174
+	 * Counts all dates during the last month
9175
+	 *
9176
+	 * @return Array the date list
9177
+	 *
9178
+	 */
9179 9179
 	public function countAllDatesLastMonthByAirlines($filters = array())
9180 9180
 	{
9181 9181
 		global $globalTimezone, $globalDBdriver;
@@ -9198,7 +9198,7 @@  discard block
 block discarded – undo
9198 9198
 								GROUP BY spotter_output.airline_icao, date_name 
9199 9199
 								ORDER BY date_name ASC";
9200 9200
 			$query_data = array(':offset' => $offset);
9201
-    		}
9201
+			}
9202 9202
 		
9203 9203
 		$sth = $this->db->prepare($query);
9204 9204
 		$sth->execute($query_data);
@@ -9220,11 +9220,11 @@  discard block
 block discarded – undo
9220 9220
 	
9221 9221
 
9222 9222
 	/**
9223
-	* Counts all month
9224
-	*
9225
-	* @return Array the month list
9226
-	*
9227
-	*/
9223
+	 * Counts all month
9224
+	 *
9225
+	 * @return Array the month list
9226
+	 *
9227
+	 */
9228 9228
 	public function countAllMonths($filters = array())
9229 9229
 	{
9230 9230
 		global $globalTimezone, $globalDBdriver;
@@ -9266,11 +9266,11 @@  discard block
 block discarded – undo
9266 9266
 	}
9267 9267
 
9268 9268
 	/**
9269
-	* Counts all month
9270
-	*
9271
-	* @return Array the month list
9272
-	*
9273
-	*/
9269
+	 * Counts all month
9270
+	 *
9271
+	 * @return Array the month list
9272
+	 *
9273
+	 */
9274 9274
 	public function countAllMonthsByAirlines($filters = array())
9275 9275
 	{
9276 9276
 		global $globalTimezone, $globalDBdriver;
@@ -9315,11 +9315,11 @@  discard block
 block discarded – undo
9315 9315
 	}
9316 9316
 
9317 9317
 	/**
9318
-	* Counts all military month
9319
-	*
9320
-	* @return Array the month list
9321
-	*
9322
-	*/
9318
+	 * Counts all military month
9319
+	 *
9320
+	 * @return Array the month list
9321
+	 *
9322
+	 */
9323 9323
 	public function countAllMilitaryMonths($filters = array())
9324 9324
 	{
9325 9325
 		global $globalTimezone, $globalDBdriver;
@@ -9360,11 +9360,11 @@  discard block
 block discarded – undo
9360 9360
 	}
9361 9361
 	
9362 9362
 	/**
9363
-	* Counts all month owners
9364
-	*
9365
-	* @return Array the month list
9366
-	*
9367
-	*/
9363
+	 * Counts all month owners
9364
+	 *
9365
+	 * @return Array the month list
9366
+	 *
9367
+	 */
9368 9368
 	public function countAllMonthsOwners($filters = array())
9369 9369
 	{
9370 9370
 		global $globalTimezone, $globalDBdriver;
@@ -9406,11 +9406,11 @@  discard block
 block discarded – undo
9406 9406
 	}
9407 9407
 	
9408 9408
 	/**
9409
-	* Counts all month owners
9410
-	*
9411
-	* @return Array the month list
9412
-	*
9413
-	*/
9409
+	 * Counts all month owners
9410
+	 *
9411
+	 * @return Array the month list
9412
+	 *
9413
+	 */
9414 9414
 	public function countAllMonthsOwnersByAirlines($filters = array())
9415 9415
 	{
9416 9416
 		global $globalTimezone, $globalDBdriver;
@@ -9453,11 +9453,11 @@  discard block
 block discarded – undo
9453 9453
 	}
9454 9454
 
9455 9455
 	/**
9456
-	* Counts all month pilot
9457
-	*
9458
-	* @return Array the month list
9459
-	*
9460
-	*/
9456
+	 * Counts all month pilot
9457
+	 *
9458
+	 * @return Array the month list
9459
+	 *
9460
+	 */
9461 9461
 	public function countAllMonthsPilots($filters = array())
9462 9462
 	{
9463 9463
 		global $globalTimezone, $globalDBdriver;
@@ -9499,11 +9499,11 @@  discard block
 block discarded – undo
9499 9499
 	}
9500 9500
 	
9501 9501
 	/**
9502
-	* Counts all month pilot
9503
-	*
9504
-	* @return Array the month list
9505
-	*
9506
-	*/
9502
+	 * Counts all month pilot
9503
+	 *
9504
+	 * @return Array the month list
9505
+	 *
9506
+	 */
9507 9507
 	public function countAllMonthsPilotsByAirlines($filters = array())
9508 9508
 	{
9509 9509
 		global $globalTimezone, $globalDBdriver;
@@ -9546,11 +9546,11 @@  discard block
 block discarded – undo
9546 9546
 	}
9547 9547
 
9548 9548
 	/**
9549
-	* Counts all month airline
9550
-	*
9551
-	* @return Array the month list
9552
-	*
9553
-	*/
9549
+	 * Counts all month airline
9550
+	 *
9551
+	 * @return Array the month list
9552
+	 *
9553
+	 */
9554 9554
 	public function countAllMonthsAirlines($filters = array())
9555 9555
 	{
9556 9556
 		global $globalTimezone, $globalDBdriver;
@@ -9592,11 +9592,11 @@  discard block
 block discarded – undo
9592 9592
 	}
9593 9593
 	
9594 9594
 	/**
9595
-	* Counts all month aircraft
9596
-	*
9597
-	* @return Array the month list
9598
-	*
9599
-	*/
9595
+	 * Counts all month aircraft
9596
+	 *
9597
+	 * @return Array the month list
9598
+	 *
9599
+	 */
9600 9600
 	public function countAllMonthsAircrafts($filters = array())
9601 9601
 	{
9602 9602
 		global $globalTimezone, $globalDBdriver;
@@ -9639,11 +9639,11 @@  discard block
 block discarded – undo
9639 9639
 	
9640 9640
 
9641 9641
 	/**
9642
-	* Counts all month aircraft
9643
-	*
9644
-	* @return Array the month list
9645
-	*
9646
-	*/
9642
+	 * Counts all month aircraft
9643
+	 *
9644
+	 * @return Array the month list
9645
+	 *
9646
+	 */
9647 9647
 	public function countAllMonthsAircraftsByAirlines($filters = array())
9648 9648
 	{
9649 9649
 		global $globalTimezone, $globalDBdriver;
@@ -9686,11 +9686,11 @@  discard block
 block discarded – undo
9686 9686
 	}
9687 9687
 
9688 9688
 	/**
9689
-	* Counts all month real arrival
9690
-	*
9691
-	* @return Array the month list
9692
-	*
9693
-	*/
9689
+	 * Counts all month real arrival
9690
+	 *
9691
+	 * @return Array the month list
9692
+	 *
9693
+	 */
9694 9694
 	public function countAllMonthsRealArrivals($filters = array())
9695 9695
 	{
9696 9696
 		global $globalTimezone, $globalDBdriver;
@@ -9733,11 +9733,11 @@  discard block
 block discarded – undo
9733 9733
 	
9734 9734
 
9735 9735
 	/**
9736
-	* Counts all month real arrival
9737
-	*
9738
-	* @return Array the month list
9739
-	*
9740
-	*/
9736
+	 * Counts all month real arrival
9737
+	 *
9738
+	 * @return Array the month list
9739
+	 *
9740
+	 */
9741 9741
 	public function countAllMonthsRealArrivalsByAirlines($filters = array())
9742 9742
 	{
9743 9743
 		global $globalTimezone, $globalDBdriver;
@@ -9781,11 +9781,11 @@  discard block
 block discarded – undo
9781 9781
 	
9782 9782
 
9783 9783
 	/**
9784
-	* Counts all dates during the last year
9785
-	*
9786
-	* @return Array the date list
9787
-	*
9788
-	*/
9784
+	 * Counts all dates during the last year
9785
+	 *
9786
+	 * @return Array the date list
9787
+	 *
9788
+	 */
9789 9789
 	public function countAllMonthsLastYear($filters)
9790 9790
 	{
9791 9791
 		global $globalTimezone, $globalDBdriver;
@@ -9807,7 +9807,7 @@  discard block
 block discarded – undo
9807 9807
 			$query .= " GROUP BY year_name, month_name
9808 9808
 								ORDER BY year_name, month_name ASC";
9809 9809
 			$query_data = array(':offset' => $offset);
9810
-    		}
9810
+			}
9811 9811
 		
9812 9812
 		$sth = $this->db->prepare($query);
9813 9813
 		$sth->execute($query_data);
@@ -9830,11 +9830,11 @@  discard block
 block discarded – undo
9830 9830
 	
9831 9831
 	
9832 9832
 	/**
9833
-	* Counts all hours
9834
-	*
9835
-	* @return Array the hour list
9836
-	*
9837
-	*/
9833
+	 * Counts all hours
9834
+	 *
9835
+	 * @return Array the hour list
9836
+	 *
9837
+	 */
9838 9838
 	public function countAllHours($orderby,$filters = array())
9839 9839
 	{
9840 9840
 		global $globalTimezone, $globalDBdriver;
@@ -9895,11 +9895,11 @@  discard block
 block discarded – undo
9895 9895
 	}
9896 9896
 	
9897 9897
 	/**
9898
-	* Counts all hours
9899
-	*
9900
-	* @return Array the hour list
9901
-	*
9902
-	*/
9898
+	 * Counts all hours
9899
+	 *
9900
+	 * @return Array the hour list
9901
+	 *
9902
+	 */
9903 9903
 	public function countAllHoursByAirlines($orderby, $filters = array())
9904 9904
 	{
9905 9905
 		global $globalTimezone, $globalDBdriver;
@@ -9962,11 +9962,11 @@  discard block
 block discarded – undo
9962 9962
 
9963 9963
 
9964 9964
 	/**
9965
-	* Counts all hours by airline
9966
-	*
9967
-	* @return Array the hour list
9968
-	*
9969
-	*/
9965
+	 * Counts all hours by airline
9966
+	 *
9967
+	 * @return Array the hour list
9968
+	 *
9969
+	 */
9970 9970
 	public function countAllHoursByAirline($airline_icao, $filters = array())
9971 9971
 	{
9972 9972
 		global $globalTimezone, $globalDBdriver;
@@ -10012,11 +10012,11 @@  discard block
 block discarded – undo
10012 10012
 	
10013 10013
 	
10014 10014
 	/**
10015
-	* Counts all hours by aircraft
10016
-	*
10017
-	* @return Array the hour list
10018
-	*
10019
-	*/
10015
+	 * Counts all hours by aircraft
10016
+	 *
10017
+	 * @return Array the hour list
10018
+	 *
10019
+	 */
10020 10020
 	public function countAllHoursByAircraft($aircraft_icao, $filters = array())
10021 10021
 	{
10022 10022
 		global $globalTimezone, $globalDBdriver;
@@ -10059,11 +10059,11 @@  discard block
 block discarded – undo
10059 10059
 	
10060 10060
 	
10061 10061
 	/**
10062
-	* Counts all hours by aircraft registration
10063
-	*
10064
-	* @return Array the hour list
10065
-	*
10066
-	*/
10062
+	 * Counts all hours by aircraft registration
10063
+	 *
10064
+	 * @return Array the hour list
10065
+	 *
10066
+	 */
10067 10067
 	public function countAllHoursByRegistration($registration, $filters = array())
10068 10068
 	{
10069 10069
 		global $globalTimezone, $globalDBdriver;
@@ -10106,11 +10106,11 @@  discard block
 block discarded – undo
10106 10106
 	
10107 10107
 	
10108 10108
 	/**
10109
-	* Counts all hours by airport
10110
-	*
10111
-	* @return Array the hour list
10112
-	*
10113
-	*/
10109
+	 * Counts all hours by airport
10110
+	 *
10111
+	 * @return Array the hour list
10112
+	 *
10113
+	 */
10114 10114
 	public function countAllHoursByAirport($airport_icao, $filters = array())
10115 10115
 	{
10116 10116
 		global $globalTimezone, $globalDBdriver;
@@ -10154,11 +10154,11 @@  discard block
 block discarded – undo
10154 10154
 	
10155 10155
 	
10156 10156
 	/**
10157
-	* Counts all hours by manufacturer
10158
-	*
10159
-	* @return Array the hour list
10160
-	*
10161
-	*/
10157
+	 * Counts all hours by manufacturer
10158
+	 *
10159
+	 * @return Array the hour list
10160
+	 *
10161
+	 */
10162 10162
 	public function countAllHoursByManufacturer($aircraft_manufacturer,$filters =array())
10163 10163
 	{
10164 10164
 		global $globalTimezone, $globalDBdriver;
@@ -10202,11 +10202,11 @@  discard block
 block discarded – undo
10202 10202
 	
10203 10203
 	
10204 10204
 	/**
10205
-	* Counts all hours by date
10206
-	*
10207
-	* @return Array the hour list
10208
-	*
10209
-	*/
10205
+	 * Counts all hours by date
10206
+	 *
10207
+	 * @return Array the hour list
10208
+	 *
10209
+	 */
10210 10210
 	public function countAllHoursByDate($date, $filters = array())
10211 10211
 	{
10212 10212
 		global $globalTimezone, $globalDBdriver;
@@ -10250,11 +10250,11 @@  discard block
 block discarded – undo
10250 10250
 	
10251 10251
 	
10252 10252
 	/**
10253
-	* Counts all hours by a ident/callsign
10254
-	*
10255
-	* @return Array the hour list
10256
-	*
10257
-	*/
10253
+	 * Counts all hours by a ident/callsign
10254
+	 *
10255
+	 * @return Array the hour list
10256
+	 *
10257
+	 */
10258 10258
 	public function countAllHoursByIdent($ident, $filters = array())
10259 10259
 	{
10260 10260
 		global $globalTimezone, $globalDBdriver;
@@ -10297,11 +10297,11 @@  discard block
 block discarded – undo
10297 10297
 	}
10298 10298
 	
10299 10299
 	/**
10300
-	* Counts all hours by a owner
10301
-	*
10302
-	* @return Array the hour list
10303
-	*
10304
-	*/
10300
+	 * Counts all hours by a owner
10301
+	 *
10302
+	 * @return Array the hour list
10303
+	 *
10304
+	 */
10305 10305
 	public function countAllHoursByOwner($owner, $filters = array())
10306 10306
 	{
10307 10307
 		global $globalTimezone, $globalDBdriver;
@@ -10344,11 +10344,11 @@  discard block
 block discarded – undo
10344 10344
 	}
10345 10345
 	
10346 10346
 	/**
10347
-	* Counts all hours by a pilot
10348
-	*
10349
-	* @return Array the hour list
10350
-	*
10351
-	*/
10347
+	 * Counts all hours by a pilot
10348
+	 *
10349
+	 * @return Array the hour list
10350
+	 *
10351
+	 */
10352 10352
 	public function countAllHoursByPilot($pilot, $filters = array())
10353 10353
 	{
10354 10354
 		global $globalTimezone, $globalDBdriver;
@@ -10393,11 +10393,11 @@  discard block
 block discarded – undo
10393 10393
 	
10394 10394
 	
10395 10395
 	/**
10396
-	* Counts all hours by route
10397
-	*
10398
-	* @return Array the hour list
10399
-	*
10400
-	*/
10396
+	 * Counts all hours by route
10397
+	 *
10398
+	 * @return Array the hour list
10399
+	 *
10400
+	 */
10401 10401
 	public function countAllHoursByRoute($departure_airport_icao, $arrival_airport_icao, $filters =array())
10402 10402
 	{
10403 10403
 		global $globalTimezone, $globalDBdriver;
@@ -10441,11 +10441,11 @@  discard block
 block discarded – undo
10441 10441
 	
10442 10442
 	
10443 10443
 	/**
10444
-	* Counts all hours by country
10445
-	*
10446
-	* @return Array the hour list
10447
-	*
10448
-	*/
10444
+	 * Counts all hours by country
10445
+	 *
10446
+	 * @return Array the hour list
10447
+	 *
10448
+	 */
10449 10449
 	public function countAllHoursByCountry($country, $filters = array())
10450 10450
 	{
10451 10451
 		global $globalTimezone, $globalDBdriver;
@@ -10490,11 +10490,11 @@  discard block
 block discarded – undo
10490 10490
 
10491 10491
 
10492 10492
 	/**
10493
-	* Counts all aircraft that have flown over
10494
-	*
10495
-	* @return Integer the number of aircrafts
10496
-	*
10497
-	*/
10493
+	 * Counts all aircraft that have flown over
10494
+	 *
10495
+	 * @return Integer the number of aircrafts
10496
+	 *
10497
+	 */
10498 10498
 	public function countOverallAircrafts($filters = array(),$year = '',$month = '')
10499 10499
 	{
10500 10500
 		global $globalDBdriver;
@@ -10527,11 +10527,11 @@  discard block
 block discarded – undo
10527 10527
 	}
10528 10528
 
10529 10529
 	/**
10530
-	* Counts all flight that really arrival
10531
-	*
10532
-	* @return Integer the number of aircrafts
10533
-	*
10534
-	*/
10530
+	 * Counts all flight that really arrival
10531
+	 *
10532
+	 * @return Integer the number of aircrafts
10533
+	 *
10534
+	 */
10535 10535
 	public function countOverallArrival($filters = array(),$year = '',$month = '')
10536 10536
 	{
10537 10537
 		global $globalDBdriver;
@@ -10564,11 +10564,11 @@  discard block
 block discarded – undo
10564 10564
 	}
10565 10565
 
10566 10566
 	/**
10567
-	* Counts all pilots that have flown over
10568
-	*
10569
-	* @return Integer the number of pilots
10570
-	*
10571
-	*/
10567
+	 * Counts all pilots that have flown over
10568
+	 *
10569
+	 * @return Integer the number of pilots
10570
+	 *
10571
+	 */
10572 10572
 	public function countOverallPilots($filters = array(),$year = '',$month = '')
10573 10573
 	{
10574 10574
 		global $globalDBdriver;
@@ -10600,11 +10600,11 @@  discard block
 block discarded – undo
10600 10600
 	}
10601 10601
 
10602 10602
 	/**
10603
-	* Counts all owners that have flown over
10604
-	*
10605
-	* @return Integer the number of owners
10606
-	*
10607
-	*/
10603
+	 * Counts all owners that have flown over
10604
+	 *
10605
+	 * @return Integer the number of owners
10606
+	 *
10607
+	 */
10608 10608
 	public function countOverallOwners($filters = array(),$year = '',$month = '')
10609 10609
 	{
10610 10610
 		global $globalDBdriver;
@@ -10637,11 +10637,11 @@  discard block
 block discarded – undo
10637 10637
 	
10638 10638
 	
10639 10639
 	/**
10640
-	* Counts all flights that have flown over
10641
-	*
10642
-	* @return Integer the number of flights
10643
-	*
10644
-	*/
10640
+	 * Counts all flights that have flown over
10641
+	 *
10642
+	 * @return Integer the number of flights
10643
+	 *
10644
+	 */
10645 10645
 	public function countOverallFlights($filters = array(),$year = '',$month = '')
10646 10646
 	{
10647 10647
 		global $globalDBdriver;
@@ -10676,11 +10676,11 @@  discard block
 block discarded – undo
10676 10676
 	}
10677 10677
 	
10678 10678
 	/**
10679
-	* Counts all military flights that have flown over
10680
-	*
10681
-	* @return Integer the number of flights
10682
-	*
10683
-	*/
10679
+	 * Counts all military flights that have flown over
10680
+	 *
10681
+	 * @return Integer the number of flights
10682
+	 *
10683
+	 */
10684 10684
 	public function countOverallMilitaryFlights($filters = array(),$year = '',$month = '')
10685 10685
 	{
10686 10686
 		global $globalDBdriver;
@@ -10715,11 +10715,11 @@  discard block
 block discarded – undo
10715 10715
 	
10716 10716
 	
10717 10717
 	/**
10718
-	* Counts all airlines that have flown over
10719
-	*
10720
-	* @return Integer the number of airlines
10721
-	*
10722
-	*/
10718
+	 * Counts all airlines that have flown over
10719
+	 *
10720
+	 * @return Integer the number of airlines
10721
+	 *
10722
+	 */
10723 10723
 	public function countOverallAirlines($filters = array(),$year = '',$month = '')
10724 10724
 	{
10725 10725
 		global $globalDBdriver;
@@ -10746,8 +10746,8 @@  discard block
 block discarded – undo
10746 10746
 				$query_values = array_merge($query_values,array(':month' => $month));
10747 10747
 			}
10748 10748
 		}
10749
-                if ($query == '') $queryi .= $this->getFilter($filters);
10750
-                else $queryi .= $this->getFilter($filters,true,true).substr($query,4);
10749
+				if ($query == '') $queryi .= $this->getFilter($filters);
10750
+				else $queryi .= $this->getFilter($filters,true,true).substr($query,4);
10751 10751
 
10752 10752
 
10753 10753
 		$sth = $this->db->prepare($queryi);
@@ -10757,11 +10757,11 @@  discard block
 block discarded – undo
10757 10757
 
10758 10758
   
10759 10759
 	/**
10760
-	* Counts all hours of today
10761
-	*
10762
-	* @return Array the hour list
10763
-	*
10764
-	*/
10760
+	 * Counts all hours of today
10761
+	 *
10762
+	 * @return Array the hour list
10763
+	 *
10764
+	 */
10765 10765
 	public function countAllHoursFromToday($filters = array())
10766 10766
 	{
10767 10767
 		global $globalTimezone, $globalDBdriver;
@@ -10801,11 +10801,11 @@  discard block
 block discarded – undo
10801 10801
 	}
10802 10802
     
10803 10803
 	/**
10804
-	* Gets all the spotter information based on calculated upcoming flights
10805
-	*
10806
-	* @return Array the spotter information
10807
-	*
10808
-	*/
10804
+	 * Gets all the spotter information based on calculated upcoming flights
10805
+	 *
10806
+	 * @return Array the spotter information
10807
+	 *
10808
+	 */
10809 10809
 	public function getUpcomingFlights($limit = '', $sort = '', $filters = array())
10810 10810
 	{
10811 10811
 		global $global_query, $globalDBdriver, $globalTimezone;
@@ -10880,12 +10880,12 @@  discard block
 block discarded – undo
10880 10880
 	}
10881 10881
     
10882 10882
     
10883
-     /**
10884
-	* Gets the Barrie Spotter ID based on the FlightAware ID
10885
-	*
10886
-	* @return Integer the Barrie Spotter ID
10883
+	 /**
10884
+	  * Gets the Barrie Spotter ID based on the FlightAware ID
10885
+	  *
10886
+	  * @return Integer the Barrie Spotter ID
10887 10887
 q	*
10888
-	*/
10888
+	  */
10889 10889
 	public function getSpotterIDBasedOnFlightAwareID($flightaware_id)
10890 10890
 	{
10891 10891
 		$flightaware_id = filter_var($flightaware_id,FILTER_SANITIZE_STRING);
@@ -10906,13 +10906,13 @@  discard block
 block discarded – undo
10906 10906
   
10907 10907
  
10908 10908
 	/**
10909
-	* Parses a date string
10910
-	*
10911
-	* @param String $dateString the date string
10912
-	* @param String $timezone the timezone of a user
10913
-	* @return Array the time information
10914
-	*
10915
-	*/
10909
+	 * Parses a date string
10910
+	 *
10911
+	 * @param String $dateString the date string
10912
+	 * @param String $timezone the timezone of a user
10913
+	 * @return Array the time information
10914
+	 *
10915
+	 */
10916 10916
 	public function parseDateString($dateString, $timezone = '')
10917 10917
 	{
10918 10918
 		$time_array = array();
@@ -10948,12 +10948,12 @@  discard block
 block discarded – undo
10948 10948
 	
10949 10949
 	
10950 10950
 	/**
10951
-	* Parses the direction degrees to working
10952
-	*
10953
-	* @param Float $direction the direction in degrees
10954
-	* @return Array the direction information
10955
-	*
10956
-	*/
10951
+	 * Parses the direction degrees to working
10952
+	 *
10953
+	 * @param Float $direction the direction in degrees
10954
+	 * @return Array the direction information
10955
+	 *
10956
+	 */
10957 10957
 	public function parseDirection($direction = 0)
10958 10958
 	{
10959 10959
 		if ($direction == '') $direction = 0;
@@ -11032,12 +11032,12 @@  discard block
 block discarded – undo
11032 11032
 	
11033 11033
 	
11034 11034
 	/**
11035
-	* Gets the aircraft registration
11036
-	*
11037
-	* @param String $flightaware_id the flight aware id
11038
-	* @return String the aircraft registration
11039
-	*
11040
-	*/
11035
+	 * Gets the aircraft registration
11036
+	 *
11037
+	 * @param String $flightaware_id the flight aware id
11038
+	 * @return String the aircraft registration
11039
+	 *
11040
+	 */
11041 11041
 	
11042 11042
 	public function getAircraftRegistration($flightaware_id)
11043 11043
 	{
@@ -11066,12 +11066,12 @@  discard block
 block discarded – undo
11066 11066
 
11067 11067
 
11068 11068
 	/**
11069
-	* Gets the aircraft registration from ModeS
11070
-	*
11071
-	* @param String $aircraft_modes the flight ModeS in hex
11072
-	* @return String the aircraft registration
11073
-	*
11074
-	*/
11069
+	 * Gets the aircraft registration from ModeS
11070
+	 *
11071
+	 * @param String $aircraft_modes the flight ModeS in hex
11072
+	 * @return String the aircraft registration
11073
+	 *
11074
+	 */
11075 11075
 	public function getAircraftRegistrationBymodeS($aircraft_modes)
11076 11076
 	{
11077 11077
 		$aircraft_modes = filter_var($aircraft_modes,FILTER_SANITIZE_STRING);
@@ -11084,19 +11084,19 @@  discard block
 block discarded – undo
11084 11084
 		$row = $sth->fetch(PDO::FETCH_ASSOC);
11085 11085
 		$sth->closeCursor();
11086 11086
 		if (count($row) > 0) {
11087
-		    //return $row['Registration'];
11088
-		    return $row['registration'];
11087
+			//return $row['Registration'];
11088
+			return $row['registration'];
11089 11089
 		} else return '';
11090 11090
 	
11091 11091
 	}
11092 11092
 
11093 11093
 	/**
11094
-	* Gets the aircraft type from ModeS
11095
-	*
11096
-	* @param String $aircraft_modes the flight ModeS in hex
11097
-	* @return String the aircraft type
11098
-	*
11099
-	*/
11094
+	 * Gets the aircraft type from ModeS
11095
+	 *
11096
+	 * @param String $aircraft_modes the flight ModeS in hex
11097
+	 * @return String the aircraft type
11098
+	 *
11099
+	 */
11100 11100
 	public function getAircraftTypeBymodeS($aircraft_modes)
11101 11101
 	{
11102 11102
 		$aircraft_modes = filter_var($aircraft_modes,FILTER_SANITIZE_STRING);
@@ -11109,19 +11109,19 @@  discard block
 block discarded – undo
11109 11109
 		$row = $sth->fetch(PDO::FETCH_ASSOC);
11110 11110
 		$sth->closeCursor();
11111 11111
 		if (count($row) > 0) {
11112
-		    if ($row['type_flight'] == null) return '';
11113
-		    else return $row['type_flight'];
11112
+			if ($row['type_flight'] == null) return '';
11113
+			else return $row['type_flight'];
11114 11114
 		} else return '';
11115 11115
 	
11116 11116
 	}
11117 11117
 
11118 11118
 	/**
11119
-	* Gets Country from latitude/longitude
11120
-	*
11121
-	* @param Float $latitude latitute of the flight
11122
-	* @param Float $longitude longitute of the flight
11123
-	* @return String the countrie
11124
-	*/
11119
+	 * Gets Country from latitude/longitude
11120
+	 *
11121
+	 * @param Float $latitude latitute of the flight
11122
+	 * @param Float $longitude longitute of the flight
11123
+	 * @return String the countrie
11124
+	 */
11125 11125
 	public function getCountryFromLatitudeLongitude($latitude,$longitude)
11126 11126
 	{
11127 11127
 		global $globalDBdriver, $globalDebug;
@@ -11158,11 +11158,11 @@  discard block
 block discarded – undo
11158 11158
 	}
11159 11159
 
11160 11160
 	/**
11161
-	* Gets Country from iso2
11162
-	*
11163
-	* @param String $iso2 ISO2 country code
11164
-	* @return String the countrie
11165
-	*/
11161
+	 * Gets Country from iso2
11162
+	 *
11163
+	 * @param String $iso2 ISO2 country code
11164
+	 * @return String the countrie
11165
+	 */
11166 11166
 	public function getCountryFromISO2($iso2)
11167 11167
 	{
11168 11168
 		global $globalDBdriver, $globalDebug;
@@ -11190,12 +11190,12 @@  discard block
 block discarded – undo
11190 11190
 	}
11191 11191
 
11192 11192
 	/**
11193
-	* converts the registration code using the country prefix
11194
-	*
11195
-	* @param String $registration the aircraft registration
11196
-	* @return String the aircraft registration
11197
-	*
11198
-	*/
11193
+	 * converts the registration code using the country prefix
11194
+	 *
11195
+	 * @param String $registration the aircraft registration
11196
+	 * @return String the aircraft registration
11197
+	 *
11198
+	 */
11199 11199
 	public function convertAircraftRegistration($registration)
11200 11200
 	{
11201 11201
 		$registration = filter_var($registration,FILTER_SANITIZE_STRING);
@@ -11247,12 +11247,12 @@  discard block
 block discarded – undo
11247 11247
 	}
11248 11248
 
11249 11249
 	/**
11250
-	* Country from the registration code
11251
-	*
11252
-	* @param String $registration the aircraft registration
11253
-	* @return String the country
11254
-	*
11255
-	*/
11250
+	 * Country from the registration code
11251
+	 *
11252
+	 * @param String $registration the aircraft registration
11253
+	 * @return String the country
11254
+	 *
11255
+	 */
11256 11256
 	public function countryFromAircraftRegistration($registration)
11257 11257
 	{
11258 11258
 		$registration = filter_var($registration,FILTER_SANITIZE_STRING);
@@ -11271,8 +11271,8 @@  discard block
 block discarded – undo
11271 11271
 				$country = $row['country'];
11272 11272
 			}
11273 11273
 		} else {
11274
-    			$registration_1 = substr($registration, 0, 1);
11275
-		        $registration_2 = substr($registration, 0, 2);
11274
+				$registration_1 = substr($registration, 0, 1);
11275
+				$registration_2 = substr($registration, 0, 2);
11276 11276
 
11277 11277
 			$country = '';
11278 11278
 			//first get the prefix based on two characters
@@ -11308,12 +11308,12 @@  discard block
 block discarded – undo
11308 11308
 	}
11309 11309
 
11310 11310
 	/**
11311
-	* Registration prefix from the registration code
11312
-	*
11313
-	* @param String $registration the aircraft registration
11314
-	* @return String the registration prefix
11315
-	*
11316
-	*/
11311
+	 * Registration prefix from the registration code
11312
+	 *
11313
+	 * @param String $registration the aircraft registration
11314
+	 * @return String the registration prefix
11315
+	 *
11316
+	 */
11317 11317
 	public function registrationPrefixFromAircraftRegistration($registration)
11318 11318
 	{
11319 11319
 		$registration = filter_var($registration,FILTER_SANITIZE_STRING);
@@ -11332,8 +11332,8 @@  discard block
 block discarded – undo
11332 11332
 				//$country = $row['country'];
11333 11333
 			}
11334 11334
 		} else {
11335
-    			$registration_1 = substr($registration, 0, 1);
11336
-		        $registration_2 = substr($registration, 0, 2);
11335
+				$registration_1 = substr($registration, 0, 1);
11336
+				$registration_2 = substr($registration, 0, 2);
11337 11337
 
11338 11338
 			//first get the prefix based on two characters
11339 11339
 			$query  = "SELECT aircraft_registration.registration_prefix, aircraft_registration.country FROM aircraft_registration WHERE registration_prefix = :registration_2 LIMIT 1";
@@ -11369,12 +11369,12 @@  discard block
 block discarded – undo
11369 11369
 
11370 11370
 
11371 11371
 	/**
11372
-	* Country from the registration code
11373
-	*
11374
-	* @param String $registration the aircraft registration
11375
-	* @return String the country
11376
-	*
11377
-	*/
11372
+	 * Country from the registration code
11373
+	 *
11374
+	 * @param String $registration the aircraft registration
11375
+	 * @return String the country
11376
+	 *
11377
+	 */
11378 11378
 	public function countryFromAircraftRegistrationCode($registration)
11379 11379
 	{
11380 11380
 		$registration = filter_var($registration,FILTER_SANITIZE_STRING);
@@ -11391,11 +11391,11 @@  discard block
 block discarded – undo
11391 11391
 	}
11392 11392
 	
11393 11393
 	/**
11394
-	* Set a new highlight value for a flight
11395
-	*
11396
-	* @param String $flightaware_id flightaware_id from spotter_output table
11397
-	* @param String $highlight New highlight value
11398
-	*/
11394
+	 * Set a new highlight value for a flight
11395
+	 *
11396
+	 * @param String $flightaware_id flightaware_id from spotter_output table
11397
+	 * @param String $highlight New highlight value
11398
+	 */
11399 11399
 	public function setHighlightFlight($flightaware_id,$highlight) {
11400 11400
 		
11401 11401
 		$query  = "UPDATE spotter_output SET highlight = :highlight WHERE flightaware_id = :flightaware_id";
@@ -11404,12 +11404,12 @@  discard block
 block discarded – undo
11404 11404
 	}
11405 11405
 
11406 11406
 	/**
11407
-	* Set a new highlight value for a flight by Registration
11408
-	*
11409
-	* @param String $registration Registration of the aircraft
11410
-	* @param String $date Date of spotted aircraft
11411
-	* @param String $highlight New highlight value
11412
-	*/
11407
+	 * Set a new highlight value for a flight by Registration
11408
+	 *
11409
+	 * @param String $registration Registration of the aircraft
11410
+	 * @param String $date Date of spotted aircraft
11411
+	 * @param String $highlight New highlight value
11412
+	 */
11413 11413
 	public function setHighlightFlightByRegistration($registration,$highlight, $date = '') {
11414 11414
 		if ($date == '') {
11415 11415
 			$query  = "UPDATE spotter_output SET highlight = :highlight WHERE spotter_id IN (SELECT MAX(spotter_id) FROM spotter_output WHERE registration = :registration)";
@@ -11423,12 +11423,12 @@  discard block
 block discarded – undo
11423 11423
 	}
11424 11424
 	
11425 11425
 	/**
11426
-	* Gets the short url from bit.ly
11427
-	*
11428
-	* @param String $url the full url
11429
-	* @return String the bit.ly url
11430
-	*
11431
-	*/
11426
+	 * Gets the short url from bit.ly
11427
+	 *
11428
+	 * @param String $url the full url
11429
+	 * @return String the bit.ly url
11430
+	 *
11431
+	 */
11432 11432
 	public function getBitlyURL($url)
11433 11433
 	{
11434 11434
 		global $globalBitlyAccessToken;
@@ -11717,11 +11717,11 @@  discard block
 block discarded – undo
11717 11717
 			$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 
11718 11718
 	                      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)) 
11719 11719
 	                      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;";
11720
-                } else {
11720
+				} else {
11721 11721
 			$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 
11722 11722
 	                      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)) 
11723 11723
 	                      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;";
11724
-    		}
11724
+			}
11725 11725
 		$sth = $this->db->prepare($query);
11726 11726
 		$sth->execute();
11727 11727
 		return $sth->fetchAll(PDO::FETCH_ASSOC);
Please login to merge, or discard this patch.