Completed
Push — master ( d56a2b...17d606 )
by Yannick
05:33
created
require/class.Spotter.php 1 patch
Indentation   +1275 added lines, -1275 removed lines patch added patch discarded remove patch
@@ -13,10 +13,10 @@  discard block
 block discarded – undo
13 13
 	}
14 14
 
15 15
 	/**
16
-	* Get SQL query part for filter used
17
-	* @param Array $filter the filter
18
-	* @return Array the SQL part
19
-	*/
16
+	 * Get SQL query part for filter used
17
+	 * @param Array $filter the filter
18
+	 * @return Array the SQL part
19
+	 */
20 20
 	public function getFilter($filter = array(),$where = false,$and = false) {
21 21
 		global $globalFilter, $globalStatsFilters, $globalFilterName;
22 22
 		$filters = array();
@@ -84,14 +84,14 @@  discard block
 block discarded – undo
84 84
 	}
85 85
 
86 86
 	/**
87
-	* Executes the SQL statements to get the spotter information
88
-	*
89
-	* @param String $query the SQL query
90
-	* @param Array $params parameter of the query
91
-	* @param String $limitQuery the limit query
92
-	* @return Array the spotter information
93
-	*
94
-	*/
87
+	 * Executes the SQL statements to get the spotter information
88
+	 *
89
+	 * @param String $query the SQL query
90
+	 * @param Array $params parameter of the query
91
+	 * @param String $limitQuery the limit query
92
+	 * @return Array the spotter information
93
+	 *
94
+	 */
95 95
 	public function getDataFromDB($query, $params = array(), $limitQuery = '',$schedules = false)
96 96
 	{
97 97
 		global $globalSquawkCountry, $globalIVAO, $globalVATSIM, $globalphpVMS, $globalAirlinesSource, $globalVAM;
@@ -255,11 +255,11 @@  discard block
 block discarded – undo
255 255
 					if ($aircraft_array[0]['aircraft_shadow'] != NULL) {
256 256
 						$temp_array['aircraft_shadow'] = $aircraft_array[0]['aircraft_shadow'];
257 257
 					} else $temp_array['aircraft_shadow'] = 'default.png';
258
-                                } else {
259
-                            		$temp_array['aircraft_shadow'] = 'default.png';
258
+								} else {
259
+									$temp_array['aircraft_shadow'] = 'default.png';
260 260
 					$temp_array['aircraft_name'] = 'N/A';
261 261
 					$temp_array['aircraft_manufacturer'] = 'N/A';
262
-                            	}
262
+								}
263 263
 			}
264 264
 			$fromsource = NULL;
265 265
 			if (isset($globalAirlinesSource) && $globalAirlinesSource != '') $fromsource = $globalAirlinesSource;
@@ -454,11 +454,11 @@  discard block
 block discarded – undo
454 454
 	
455 455
 	
456 456
 	/**
457
-	* Gets all the spotter information
458
-	*
459
-	* @return Array the spotter information
460
-	*
461
-	*/
457
+	 * Gets all the spotter information
458
+	 *
459
+	 * @return Array the spotter information
460
+	 *
461
+	 */
462 462
 	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())
463 463
 	{
464 464
 		global $globalTimezone, $globalDBdriver;
@@ -805,11 +805,11 @@  discard block
 block discarded – undo
805 805
 	
806 806
 	
807 807
 	/**
808
-	* Gets all the spotter information based on the latest data entry
809
-	*
810
-	* @return Array the spotter information
811
-	*
812
-	*/
808
+	 * Gets all the spotter information based on the latest data entry
809
+	 *
810
+	 * @return Array the spotter information
811
+	 *
812
+	 */
813 813
 	public function getLatestSpotterData($limit = '', $sort = '', $filter = array())
814 814
 	{
815 815
 		global $global_query;
@@ -848,12 +848,12 @@  discard block
 block discarded – undo
848 848
 	}
849 849
     
850 850
     
851
-    /**
852
-	* Gets all the spotter information based on a user's latitude and longitude
853
-	*
854
-	* @return Array the spotter information
855
-	*
856
-	*/
851
+	/**
852
+	 * Gets all the spotter information based on a user's latitude and longitude
853
+	 *
854
+	 * @return Array the spotter information
855
+	 *
856
+	 */
857 857
 	public function getLatestSpotterForLayar($lat, $lng, $radius, $interval)
858 858
 	{
859 859
 		date_default_timezone_set('UTC');
@@ -881,7 +881,7 @@  discard block
 block discarded – undo
881 881
 				return false;
882 882
 			}
883 883
 		}
884
-    		$additional_query = '';
884
+			$additional_query = '';
885 885
 		if ($interval != "")
886 886
 		{
887 887
 			if (!is_string($interval))
@@ -921,12 +921,12 @@  discard block
 block discarded – undo
921 921
 	}
922 922
     
923 923
     
924
-    /**
925
-	* Gets all the spotter information sorted by the newest aircraft type
926
-	*
927
-	* @return Array the spotter information
928
-	*
929
-	*/
924
+	/**
925
+	 * Gets all the spotter information sorted by the newest aircraft type
926
+	 *
927
+	 * @return Array the spotter information
928
+	 *
929
+	 */
930 930
 	public function getNewestSpotterDataSortedByAircraftType($limit = '', $sort = '',$filter = array())
931 931
 	{
932 932
 		global $global_query;
@@ -967,11 +967,11 @@  discard block
 block discarded – undo
967 967
     
968 968
     
969 969
 	/**
970
-	* Gets all the spotter information sorted by the newest aircraft registration
971
-	*
972
-	* @return Array the spotter information
973
-	*
974
-	*/
970
+	 * Gets all the spotter information sorted by the newest aircraft registration
971
+	 *
972
+	 * @return Array the spotter information
973
+	 *
974
+	 */
975 975
 	public function getNewestSpotterDataSortedByAircraftRegistration($limit = '', $sort = '', $filter = array())
976 976
 	{
977 977
 		global $global_query;
@@ -1011,11 +1011,11 @@  discard block
 block discarded – undo
1011 1011
 
1012 1012
 
1013 1013
 	/**
1014
-	* Gets all the spotter information sorted by the newest airline
1015
-	*
1016
-	* @return Array the spotter information
1017
-	*
1018
-	*/
1014
+	 * Gets all the spotter information sorted by the newest airline
1015
+	 *
1016
+	 * @return Array the spotter information
1017
+	 *
1018
+	 */
1019 1019
 	public function getNewestSpotterDataSortedByAirline($limit = '', $sort = '',$filter = array())
1020 1020
 	{
1021 1021
 		global $global_query;
@@ -1054,12 +1054,12 @@  discard block
 block discarded – undo
1054 1054
 	}
1055 1055
     
1056 1056
     
1057
-    /**
1058
-	* Gets all the spotter information sorted by the newest departure airport
1059
-	*
1060
-	* @return Array the spotter information
1061
-	*
1062
-	*/
1057
+	/**
1058
+	 * Gets all the spotter information sorted by the newest departure airport
1059
+	 *
1060
+	 * @return Array the spotter information
1061
+	 *
1062
+	 */
1063 1063
 	public function getNewestSpotterDataSortedByDepartureAirport($limit = '', $sort = '', $filter = array())
1064 1064
 	{
1065 1065
 		global $global_query;
@@ -1101,11 +1101,11 @@  discard block
 block discarded – undo
1101 1101
 
1102 1102
 
1103 1103
 	/**
1104
-	* Gets all the spotter information sorted by the newest arrival airport
1105
-	*
1106
-	* @return Array the spotter information
1107
-	*
1108
-	*/
1104
+	 * Gets all the spotter information sorted by the newest arrival airport
1105
+	 *
1106
+	 * @return Array the spotter information
1107
+	 *
1108
+	 */
1109 1109
 	public function getNewestSpotterDataSortedByArrivalAirport($limit = '', $sort = '', $filter = array())
1110 1110
 	{
1111 1111
 		global $global_query;
@@ -1144,11 +1144,11 @@  discard block
 block discarded – undo
1144 1144
 	
1145 1145
 
1146 1146
 	/**
1147
-	* Gets all the spotter information based on the spotter id
1148
-	*
1149
-	* @return Array the spotter information
1150
-	*
1151
-	*/
1147
+	 * Gets all the spotter information based on the spotter id
1148
+	 *
1149
+	 * @return Array the spotter information
1150
+	 *
1151
+	 */
1152 1152
 	public function getSpotterDataByID($id = '')
1153 1153
 	{
1154 1154
 		global $global_query;
@@ -1170,11 +1170,11 @@  discard block
 block discarded – undo
1170 1170
 	
1171 1171
 	
1172 1172
 	/**
1173
-	* Gets all the spotter information based on the callsign
1174
-	*
1175
-	* @return Array the spotter information
1176
-	*
1177
-	*/
1173
+	 * Gets all the spotter information based on the callsign
1174
+	 *
1175
+	 * @return Array the spotter information
1176
+	 *
1177
+	 */
1178 1178
 	public function getSpotterDataByIdent($ident = '', $limit = '', $sort = '')
1179 1179
 	{
1180 1180
 		global $global_query;
@@ -1227,11 +1227,11 @@  discard block
 block discarded – undo
1227 1227
 	
1228 1228
 	
1229 1229
 	/**
1230
-	* Gets all the spotter information based on the aircraft type
1231
-	*
1232
-	* @return Array the spotter information
1233
-	*
1234
-	*/
1230
+	 * Gets all the spotter information based on the aircraft type
1231
+	 *
1232
+	 * @return Array the spotter information
1233
+	 *
1234
+	 */
1235 1235
 	public function getSpotterDataByAircraft($aircraft_type = '', $limit = '', $sort = '', $filter = array())
1236 1236
 	{
1237 1237
 		global $global_query;
@@ -1285,11 +1285,11 @@  discard block
 block discarded – undo
1285 1285
 	
1286 1286
 	
1287 1287
 	/**
1288
-	* Gets all the spotter information based on the aircraft registration
1289
-	*
1290
-	* @return Array the spotter information
1291
-	*
1292
-	*/
1288
+	 * Gets all the spotter information based on the aircraft registration
1289
+	 *
1290
+	 * @return Array the spotter information
1291
+	 *
1292
+	 */
1293 1293
 	public function getSpotterDataByRegistration($registration = '', $limit = '', $sort = '', $filter = array())
1294 1294
 	{
1295 1295
 		global $global_query;
@@ -1346,11 +1346,11 @@  discard block
 block discarded – undo
1346 1346
 	
1347 1347
 	
1348 1348
 	/**
1349
-	* Gets all the spotter information based on the airline
1350
-	*
1351
-	* @return Array the spotter information
1352
-	*
1353
-	*/
1349
+	 * Gets all the spotter information based on the airline
1350
+	 *
1351
+	 * @return Array the spotter information
1352
+	 *
1353
+	 */
1354 1354
 	public function getSpotterDataByAirline($airline = '', $limit = '', $sort = '',$filters = array())
1355 1355
 	{
1356 1356
 		global $global_query;
@@ -1403,11 +1403,11 @@  discard block
 block discarded – undo
1403 1403
 	
1404 1404
 	
1405 1405
 	/**
1406
-	* Gets all the spotter information based on the airport
1407
-	*
1408
-	* @return Array the spotter information
1409
-	*
1410
-	*/
1406
+	 * Gets all the spotter information based on the airport
1407
+	 *
1408
+	 * @return Array the spotter information
1409
+	 *
1410
+	 */
1411 1411
 	public function getSpotterDataByAirport($airport = '', $limit = '', $sort = '',$filters = array())
1412 1412
 	{
1413 1413
 		global $global_query;
@@ -1461,11 +1461,11 @@  discard block
 block discarded – undo
1461 1461
 
1462 1462
 
1463 1463
 	/**
1464
-	* Gets all the spotter information based on the date
1465
-	*
1466
-	* @return Array the spotter information
1467
-	*
1468
-	*/
1464
+	 * Gets all the spotter information based on the date
1465
+	 *
1466
+	 * @return Array the spotter information
1467
+	 *
1468
+	 */
1469 1469
 	public function getSpotterDataByDate($date = '', $limit = '', $sort = '',$filter = array())
1470 1470
 	{
1471 1471
 		global $global_query, $globalTimezone, $globalDBdriver;
@@ -1526,11 +1526,11 @@  discard block
 block discarded – undo
1526 1526
 
1527 1527
 
1528 1528
 	/**
1529
-	* Gets all the spotter information based on the country name
1530
-	*
1531
-	* @return Array the spotter information
1532
-	*
1533
-	*/
1529
+	 * Gets all the spotter information based on the country name
1530
+	 *
1531
+	 * @return Array the spotter information
1532
+	 *
1533
+	 */
1534 1534
 	public function getSpotterDataByCountry($country = '', $limit = '', $sort = '',$filters = array())
1535 1535
 	{
1536 1536
 		global $global_query;
@@ -1584,11 +1584,11 @@  discard block
 block discarded – undo
1584 1584
 	
1585 1585
 	
1586 1586
 	/**
1587
-	* Gets all the spotter information based on the manufacturer name
1588
-	*
1589
-	* @return Array the spotter information
1590
-	*
1591
-	*/
1587
+	 * Gets all the spotter information based on the manufacturer name
1588
+	 *
1589
+	 * @return Array the spotter information
1590
+	 *
1591
+	 */
1592 1592
 	public function getSpotterDataByManufacturer($aircraft_manufacturer = '', $limit = '', $sort = '', $filters = array())
1593 1593
 	{
1594 1594
 		global $global_query;
@@ -1644,13 +1644,13 @@  discard block
 block discarded – undo
1644 1644
   
1645 1645
   
1646 1646
 	/**
1647
-	* Gets a list of all aircraft that take a route
1648
-	*
1649
-	* @param String $departure_airport_icao ICAO code of departure airport
1650
-	* @param String $arrival_airport_icao ICAO code of arrival airport
1651
-	* @return Array the spotter information
1652
-	*
1653
-	*/
1647
+	 * Gets a list of all aircraft that take a route
1648
+	 *
1649
+	 * @param String $departure_airport_icao ICAO code of departure airport
1650
+	 * @param String $arrival_airport_icao ICAO code of arrival airport
1651
+	 * @return Array the spotter information
1652
+	 *
1653
+	 */
1654 1654
 	public function getSpotterDataByRoute($departure_airport_icao = '', $arrival_airport_icao = '', $limit = '', $sort = '', $filters = array())
1655 1655
 	{
1656 1656
 		global $global_query;
@@ -1717,11 +1717,11 @@  discard block
 block discarded – undo
1717 1717
 	
1718 1718
 	
1719 1719
 	/**
1720
-	* Gets all the spotter information based on the special column in the table
1721
-	*
1722
-	* @return Array the spotter information
1723
-	*
1724
-	*/
1720
+	 * Gets all the spotter information based on the special column in the table
1721
+	 *
1722
+	 * @return Array the spotter information
1723
+	 *
1724
+	 */
1725 1725
 	public function getSpotterDataByHighlight($limit = '', $sort = '', $filter = array())
1726 1726
 	{
1727 1727
 		global $global_query;
@@ -1760,11 +1760,11 @@  discard block
 block discarded – undo
1760 1760
 	}
1761 1761
 
1762 1762
 	/**
1763
-	* Gets all the highlight based on a aircraft registration
1764
-	*
1765
-	* @return String the highlight text
1766
-	*
1767
-	*/
1763
+	 * Gets all the highlight based on a aircraft registration
1764
+	 *
1765
+	 * @return String the highlight text
1766
+	 *
1767
+	 */
1768 1768
 	public function getHighlightByRegistration($registration,$filter = array())
1769 1769
 	{
1770 1770
 		global $global_query;
@@ -1786,13 +1786,13 @@  discard block
 block discarded – undo
1786 1786
 
1787 1787
 	
1788 1788
 	/**
1789
-	* Gets the squawk usage from squawk code
1790
-	*
1791
-	* @param String $squawk squawk code
1792
-	* @param String $country country
1793
-	* @return String usage
1794
-	*
1795
-	*/
1789
+	 * Gets the squawk usage from squawk code
1790
+	 *
1791
+	 * @param String $squawk squawk code
1792
+	 * @param String $country country
1793
+	 * @return String usage
1794
+	 *
1795
+	 */
1796 1796
 	public function getSquawkUsage($squawk = '',$country = 'FR')
1797 1797
 	{
1798 1798
 		
@@ -1813,12 +1813,12 @@  discard block
 block discarded – undo
1813 1813
 	}
1814 1814
 
1815 1815
 	/**
1816
-	* Gets the airport icao from the iata
1817
-	*
1818
-	* @param String $airport_iata the iata code of the airport
1819
-	* @return String airport iata
1820
-	*
1821
-	*/
1816
+	 * Gets the airport icao from the iata
1817
+	 *
1818
+	 * @param String $airport_iata the iata code of the airport
1819
+	 * @return String airport iata
1820
+	 *
1821
+	 */
1822 1822
 	public function getAirportIcao($airport_iata = '')
1823 1823
 	{
1824 1824
 		
@@ -1838,14 +1838,14 @@  discard block
 block discarded – undo
1838 1838
 	}
1839 1839
 
1840 1840
 	/**
1841
-	* Gets the airport distance
1842
-	*
1843
-	* @param String $airport_icao the icao code of the airport
1844
-	* @param Float $latitude the latitude
1845
-	* @param Float $longitude the longitude
1846
-	* @return Float distance to the airport
1847
-	*
1848
-	*/
1841
+	 * Gets the airport distance
1842
+	 *
1843
+	 * @param String $airport_icao the icao code of the airport
1844
+	 * @param Float $latitude the latitude
1845
+	 * @param Float $longitude the longitude
1846
+	 * @return Float distance to the airport
1847
+	 *
1848
+	 */
1849 1849
 	public function getAirportDistance($airport_icao,$latitude,$longitude)
1850 1850
 	{
1851 1851
 		
@@ -1866,12 +1866,12 @@  discard block
 block discarded – undo
1866 1866
 	}
1867 1867
 	
1868 1868
 	/**
1869
-	* Gets the airport info based on the icao
1870
-	*
1871
-	* @param String $airport the icao code of the airport
1872
-	* @return Array airport information
1873
-	*
1874
-	*/
1869
+	 * Gets the airport info based on the icao
1870
+	 *
1871
+	 * @param String $airport the icao code of the airport
1872
+	 * @return Array airport information
1873
+	 *
1874
+	 */
1875 1875
 	public function getAllAirportInfo($airport = '')
1876 1876
 	{
1877 1877
 		
@@ -1917,12 +1917,12 @@  discard block
 block discarded – undo
1917 1917
 	}
1918 1918
 	
1919 1919
 	/**
1920
-	* Gets the airport info based on the country
1921
-	*
1922
-	* @param Array $countries Airports countries
1923
-	* @return Array airport information
1924
-	*
1925
-	*/
1920
+	 * Gets the airport info based on the country
1921
+	 *
1922
+	 * @param Array $countries Airports countries
1923
+	 * @return Array airport information
1924
+	 *
1925
+	 */
1926 1926
 	public function getAllAirportInfobyCountry($countries)
1927 1927
 	{
1928 1928
 		$lst_countries = '';
@@ -1960,12 +1960,12 @@  discard block
 block discarded – undo
1960 1960
 	}
1961 1961
 	
1962 1962
 	/**
1963
-	* Gets airports info based on the coord
1964
-	*
1965
-	* @param Array $coord Airports longitude min,latitude min, longitude max, latitude max
1966
-	* @return Array airport information
1967
-	*
1968
-	*/
1963
+	 * Gets airports info based on the coord
1964
+	 *
1965
+	 * @param Array $coord Airports longitude min,latitude min, longitude max, latitude max
1966
+	 * @return Array airport information
1967
+	 *
1968
+	 */
1969 1969
 	public function getAllAirportInfobyCoord($coord)
1970 1970
 	{
1971 1971
 		global $globalDBdriver;
@@ -1996,12 +1996,12 @@  discard block
 block discarded – undo
1996 1996
 	}
1997 1997
 
1998 1998
 	/**
1999
-	* Gets waypoints info based on the coord
2000
-	*
2001
-	* @param Array $coord waypoints coord
2002
-	* @return Array airport information
2003
-	*
2004
-	*/
1999
+	 * Gets waypoints info based on the coord
2000
+	 *
2001
+	 * @param Array $coord waypoints coord
2002
+	 * @return Array airport information
2003
+	 *
2004
+	 */
2005 2005
 	public function getAllWaypointsInfobyCoord($coord)
2006 2006
 	{
2007 2007
 		if (is_array($coord)) {
@@ -2035,12 +2035,12 @@  discard block
 block discarded – undo
2035 2035
 	
2036 2036
 	
2037 2037
 	/**
2038
-	* Gets the airline info based on the icao code or iata code
2039
-	*
2040
-	* @param String $airline_icao the iata code of the airport
2041
-	* @return Array airport information
2042
-	*
2043
-	*/
2038
+	 * Gets the airline info based on the icao code or iata code
2039
+	 *
2040
+	 * @param String $airline_icao the iata code of the airport
2041
+	 * @return Array airport information
2042
+	 *
2043
+	 */
2044 2044
 	public function getAllAirlineInfo($airline_icao, $fromsource = NULL)
2045 2045
 	{
2046 2046
 		global $globalUseRealAirlines;
@@ -2071,7 +2071,7 @@  discard block
 block discarded – undo
2071 2071
 			} else {
2072 2072
 				$sth->execute(array(':airline_icao' => $airline_icao,':fromsource' => $fromsource));
2073 2073
 			}
2074
-                        /*
2074
+						/*
2075 2075
 			$airline_array = array();
2076 2076
 			$temp_array = array();
2077 2077
 		
@@ -2103,12 +2103,12 @@  discard block
 block discarded – undo
2103 2103
 	
2104 2104
 	
2105 2105
 	/**
2106
-	* Gets the aircraft info based on the aircraft type
2107
-	*
2108
-	* @param String $aircraft_type the aircraft type
2109
-	* @return Array aircraft information
2110
-	*
2111
-	*/
2106
+	 * Gets the aircraft info based on the aircraft type
2107
+	 *
2108
+	 * @param String $aircraft_type the aircraft type
2109
+	 * @return Array aircraft information
2110
+	 *
2111
+	 */
2112 2112
 	public function getAllAircraftInfo($aircraft_type)
2113 2113
 	{
2114 2114
 		$aircraft_type = filter_var($aircraft_type,FILTER_SANITIZE_STRING);
@@ -2140,12 +2140,12 @@  discard block
 block discarded – undo
2140 2140
 	}
2141 2141
 
2142 2142
 	/**
2143
-	* Gets the aircraft icao based on the aircraft name/type
2144
-	*
2145
-	* @param String $aircraft_type the aircraft type
2146
-	* @return String aircraft information
2147
-	*
2148
-	*/
2143
+	 * Gets the aircraft icao based on the aircraft name/type
2144
+	 *
2145
+	 * @param String $aircraft_type the aircraft type
2146
+	 * @return String aircraft information
2147
+	 *
2148
+	 */
2149 2149
 	public function getAircraftIcao($aircraft_type)
2150 2150
 	{
2151 2151
 		$aircraft_type = filter_var($aircraft_type,FILTER_SANITIZE_STRING);
@@ -2170,12 +2170,12 @@  discard block
 block discarded – undo
2170 2170
 	}
2171 2171
 	
2172 2172
 	/**
2173
-	* Gets the aircraft info based on the aircraft ident
2174
-	*
2175
-	* @param String $aircraft_modes the aircraft ident (hex)
2176
-	* @return String aircraft type
2177
-	*
2178
-	*/
2173
+	 * Gets the aircraft info based on the aircraft ident
2174
+	 *
2175
+	 * @param String $aircraft_modes the aircraft ident (hex)
2176
+	 * @return String aircraft type
2177
+	 *
2178
+	 */
2179 2179
 	public function getAllAircraftType($aircraft_modes)
2180 2180
 	{
2181 2181
 		$aircraft_modes = filter_var($aircraft_modes,FILTER_SANITIZE_STRING);
@@ -2193,12 +2193,12 @@  discard block
 block discarded – undo
2193 2193
 	}
2194 2194
 
2195 2195
 	/**
2196
-	* Gets correct aircraft operator corde
2197
-	*
2198
-	* @param String $operator the aircraft operator code (callsign)
2199
-	* @return String aircraft operator code
2200
-	*
2201
-	*/
2196
+	 * Gets correct aircraft operator corde
2197
+	 *
2198
+	 * @param String $operator the aircraft operator code (callsign)
2199
+	 * @return String aircraft operator code
2200
+	 *
2201
+	 */
2202 2202
 	public function getOperator($operator)
2203 2203
 	{
2204 2204
 		$operator = filter_var($operator,FILTER_SANITIZE_STRING);
@@ -2215,16 +2215,16 @@  discard block
 block discarded – undo
2215 2215
 	}
2216 2216
 
2217 2217
 	/**
2218
-	* Gets the aircraft route based on the aircraft callsign
2219
-	*
2220
-	* @param String $callsign the aircraft callsign
2221
-	* @return Array aircraft type
2222
-	*
2223
-	*/
2218
+	 * Gets the aircraft route based on the aircraft callsign
2219
+	 *
2220
+	 * @param String $callsign the aircraft callsign
2221
+	 * @return Array aircraft type
2222
+	 *
2223
+	 */
2224 2224
 	public function getRouteInfo($callsign)
2225 2225
 	{
2226 2226
 		$callsign = filter_var($callsign,FILTER_SANITIZE_STRING);
2227
-                if ($callsign == '') return array();
2227
+				if ($callsign == '') return array();
2228 2228
 		$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";
2229 2229
 		
2230 2230
 		$sth = $this->db->prepare($query);
@@ -2238,12 +2238,12 @@  discard block
 block discarded – undo
2238 2238
 	}
2239 2239
 	
2240 2240
 	/**
2241
-	* Gets the aircraft info based on the aircraft registration
2242
-	*
2243
-	* @param String $registration the aircraft registration
2244
-	* @return Array aircraft information
2245
-	*
2246
-	*/
2241
+	 * Gets the aircraft info based on the aircraft registration
2242
+	 *
2243
+	 * @param String $registration the aircraft registration
2244
+	 * @return Array aircraft information
2245
+	 *
2246
+	 */
2247 2247
 	public function getAircraftInfoByRegistration($registration)
2248 2248
 	{
2249 2249
 		$registration = filter_var($registration,FILTER_SANITIZE_STRING);
@@ -2270,12 +2270,12 @@  discard block
 block discarded – undo
2270 2270
 	}
2271 2271
 	
2272 2272
 	/**
2273
-	* Gets the aircraft owner & base based on the aircraft registration
2274
-	*
2275
-	* @param String $registration the aircraft registration
2276
-	* @return Array aircraft information
2277
-	*
2278
-	*/
2273
+	 * Gets the aircraft owner & base based on the aircraft registration
2274
+	 *
2275
+	 * @param String $registration the aircraft registration
2276
+	 * @return Array aircraft information
2277
+	 *
2278
+	 */
2279 2279
 	public function getAircraftOwnerByRegistration($registration)
2280 2280
 	{
2281 2281
 		$registration = filter_var($registration,FILTER_SANITIZE_STRING);
@@ -2292,11 +2292,11 @@  discard block
 block discarded – undo
2292 2292
 	
2293 2293
   
2294 2294
   /**
2295
-	* Gets all flights (but with only little info)
2296
-	*
2297
-	* @return Array basic flight information
2298
-	*
2299
-	*/
2295
+   * Gets all flights (but with only little info)
2296
+   *
2297
+   * @return Array basic flight information
2298
+   *
2299
+   */
2300 2300
 	public function getAllFlightsforSitemap()
2301 2301
 	{
2302 2302
 		//$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 ";
@@ -2304,7 +2304,7 @@  discard block
 block discarded – undo
2304 2304
 		
2305 2305
 		$sth = $this->db->prepare($query);
2306 2306
 		$sth->execute();
2307
-                  /*
2307
+				  /*
2308 2308
 		$flight_array = array();
2309 2309
 		$temp_array = array();
2310 2310
 		
@@ -2326,11 +2326,11 @@  discard block
 block discarded – undo
2326 2326
 	}
2327 2327
   
2328 2328
 	/**
2329
-	* Gets a list of all aircraft manufacturers
2330
-	*
2331
-	* @return Array list of aircraft types
2332
-	*
2333
-	*/
2329
+	 * Gets a list of all aircraft manufacturers
2330
+	 *
2331
+	 * @return Array list of aircraft types
2332
+	 *
2333
+	 */
2334 2334
 	public function getAllManufacturers()
2335 2335
 	{
2336 2336
 		/*
@@ -2359,11 +2359,11 @@  discard block
 block discarded – undo
2359 2359
   
2360 2360
   
2361 2361
   /**
2362
-	* Gets a list of all aircraft types
2363
-	*
2364
-	* @return Array list of aircraft types
2365
-	*
2366
-	*/
2362
+   * Gets a list of all aircraft types
2363
+   *
2364
+   * @return Array list of aircraft types
2365
+   *
2366
+   */
2367 2367
 	public function getAllAircraftTypes($filters = array())
2368 2368
 	{
2369 2369
 		/*
@@ -2396,11 +2396,11 @@  discard block
 block discarded – undo
2396 2396
 	
2397 2397
 	
2398 2398
 	/**
2399
-	* Gets a list of all aircraft registrations
2400
-	*
2401
-	* @return Array list of aircraft registrations
2402
-	*
2403
-	*/
2399
+	 * Gets a list of all aircraft registrations
2400
+	 *
2401
+	 * @return Array list of aircraft registrations
2402
+	 *
2403
+	 */
2404 2404
 	public function getAllAircraftRegistrations($filters = array())
2405 2405
 	{
2406 2406
 		$filter_query = $this->getFilter($filters,true,true);
@@ -2425,12 +2425,12 @@  discard block
 block discarded – undo
2425 2425
 	}
2426 2426
 
2427 2427
 	/**
2428
-	* Gets all source name
2429
-	*
2430
-	* @param String type format of source
2431
-	* @return Array list of source name
2432
-	*
2433
-	*/
2428
+	 * Gets all source name
2429
+	 *
2430
+	 * @param String type format of source
2431
+	 * @return Array list of source name
2432
+	 *
2433
+	 */
2434 2434
 	public function getAllSourceName($type = '',$filters = array())
2435 2435
 	{
2436 2436
 		$filter_query = $this->getFilter($filters,true,true);
@@ -2461,11 +2461,11 @@  discard block
 block discarded – undo
2461 2461
 
2462 2462
 
2463 2463
 	/**
2464
-	* Gets a list of all airline names
2465
-	*
2466
-	* @return Array list of airline names
2467
-	*
2468
-	*/
2464
+	 * Gets a list of all airline names
2465
+	 *
2466
+	 * @return Array list of airline names
2467
+	 *
2468
+	 */
2469 2469
 	public function getAllAirlineNames($airline_type = '',$forsource = NULL,$filters = array())
2470 2470
 	{
2471 2471
 		global $globalAirlinesSource,$globalVATSIM, $globalIVAO;
@@ -2515,11 +2515,11 @@  discard block
 block discarded – undo
2515 2515
 	
2516 2516
 	
2517 2517
 	/**
2518
-	* Gets a list of all airline countries
2519
-	*
2520
-	* @return Array list of airline countries
2521
-	*
2522
-	*/
2518
+	 * Gets a list of all airline countries
2519
+	 *
2520
+	 * @return Array list of airline countries
2521
+	 *
2522
+	 */
2523 2523
 	public function getAllAirlineCountries($filters = array())
2524 2524
 	{
2525 2525
 		$filter_query = $this->getFilter($filters,true,true);
@@ -2547,11 +2547,11 @@  discard block
 block discarded – undo
2547 2547
 	
2548 2548
 	
2549 2549
 	/**
2550
-	* Gets a list of all departure & arrival names
2551
-	*
2552
-	* @return Array list of airport names
2553
-	*
2554
-	*/
2550
+	 * Gets a list of all departure & arrival names
2551
+	 *
2552
+	 * @return Array list of airport names
2553
+	 *
2554
+	 */
2555 2555
 	public function getAllAirportNames($filters = array())
2556 2556
 	{
2557 2557
 		$filter_query = $this->getFilter($filters,true,true);
@@ -2600,11 +2600,11 @@  discard block
 block discarded – undo
2600 2600
 	
2601 2601
 	
2602 2602
 	/**
2603
-	* Gets a list of all departure & arrival airport countries
2604
-	*
2605
-	* @return Array list of airport countries
2606
-	*
2607
-	*/
2603
+	 * Gets a list of all departure & arrival airport countries
2604
+	 *
2605
+	 * @return Array list of airport countries
2606
+	 *
2607
+	 */
2608 2608
 	public function getAllAirportCountries($filters = array())
2609 2609
 	{
2610 2610
 		$airport_array = array();
@@ -2652,11 +2652,11 @@  discard block
 block discarded – undo
2652 2652
 	
2653 2653
 	
2654 2654
 	/**
2655
-	* Gets a list of all countries (airline, departure airport & arrival airport)
2656
-	*
2657
-	* @return Array list of countries
2658
-	*
2659
-	*/
2655
+	 * Gets a list of all countries (airline, departure airport & arrival airport)
2656
+	 *
2657
+	 * @return Array list of countries
2658
+	 *
2659
+	 */
2660 2660
 	public function getAllCountries($filters = array())
2661 2661
 	{
2662 2662
 		$Connection= new Connection($this->db);
@@ -2733,11 +2733,11 @@  discard block
 block discarded – undo
2733 2733
 	
2734 2734
 	
2735 2735
 	/**
2736
-	* Gets a list of all idents/callsigns
2737
-	*
2738
-	* @return Array list of ident/callsign names
2739
-	*
2740
-	*/
2736
+	 * Gets a list of all idents/callsigns
2737
+	 *
2738
+	 * @return Array list of ident/callsign names
2739
+	 *
2740
+	 */
2741 2741
 	public function getAllIdents($filters = array())
2742 2742
 	{
2743 2743
 		$filter_query = $this->getFilter($filters,true,true);
@@ -2761,9 +2761,9 @@  discard block
 block discarded – undo
2761 2761
 	}
2762 2762
 
2763 2763
 	/**
2764
-	* Get a list of flights from airport since 7 days
2765
-	* @return Array number, icao, name and city of airports
2766
-	*/
2764
+	 * Get a list of flights from airport since 7 days
2765
+	 * @return Array number, icao, name and city of airports
2766
+	 */
2767 2767
 
2768 2768
 	public function getLast7DaysAirportsDeparture($airport_icao = '',$filters = array()) {
2769 2769
 		global $globalTimezone, $globalDBdriver;
@@ -2794,9 +2794,9 @@  discard block
 block discarded – undo
2794 2794
 	}
2795 2795
 
2796 2796
 	/**
2797
-	* Get a list of flights from airport since 7 days
2798
-	* @return Array number, icao, name and city of airports
2799
-	*/
2797
+	 * Get a list of flights from airport since 7 days
2798
+	 * @return Array number, icao, name and city of airports
2799
+	 */
2800 2800
 
2801 2801
 	public function getLast7DaysAirportsDepartureByAirlines($airport_icao = '') {
2802 2802
 		global $globalTimezone, $globalDBdriver;
@@ -2826,9 +2826,9 @@  discard block
 block discarded – undo
2826 2826
 	}
2827 2827
 
2828 2828
 	/**
2829
-	* Get a list of flights from detected airport since 7 days
2830
-	* @return Array number, icao, name and city of airports
2831
-	*/
2829
+	 * Get a list of flights from detected airport since 7 days
2830
+	 * @return Array number, icao, name and city of airports
2831
+	 */
2832 2832
 
2833 2833
 	public function getLast7DaysDetectedAirportsDeparture($airport_icao = '', $filters = array()) {
2834 2834
 		global $globalTimezone, $globalDBdriver;
@@ -2866,9 +2866,9 @@  discard block
 block discarded – undo
2866 2866
 	}
2867 2867
 
2868 2868
 	/**
2869
-	* Get a list of flights from detected airport since 7 days
2870
-	* @return Array number, icao, name and city of airports
2871
-	*/
2869
+	 * Get a list of flights from detected airport since 7 days
2870
+	 * @return Array number, icao, name and city of airports
2871
+	 */
2872 2872
 
2873 2873
 	public function getLast7DaysDetectedAirportsDepartureByAirlines($airport_icao = '') {
2874 2874
 		global $globalTimezone, $globalDBdriver;
@@ -2910,9 +2910,9 @@  discard block
 block discarded – undo
2910 2910
 
2911 2911
 
2912 2912
 	/**
2913
-	* Get a list of flights to airport since 7 days
2914
-	* @return Array number, icao, name and city of airports
2915
-	*/
2913
+	 * Get a list of flights to airport since 7 days
2914
+	 * @return Array number, icao, name and city of airports
2915
+	 */
2916 2916
 
2917 2917
 	public function getLast7DaysAirportsArrival($airport_icao = '', $filters = array()) {
2918 2918
 		global $globalTimezone, $globalDBdriver;
@@ -2945,9 +2945,9 @@  discard block
 block discarded – undo
2945 2945
 
2946 2946
 
2947 2947
 	/**
2948
-	* Get a list of flights detected to airport since 7 days
2949
-	* @return Array number, icao, name and city of airports
2950
-	*/
2948
+	 * Get a list of flights detected to airport since 7 days
2949
+	 * @return Array number, icao, name and city of airports
2950
+	 */
2951 2951
 
2952 2952
 	public function getLast7DaysDetectedAirportsArrival($airport_icao = '',$filters = array()) {
2953 2953
 		global $globalTimezone, $globalDBdriver;
@@ -2988,9 +2988,9 @@  discard block
 block discarded – undo
2988 2988
 
2989 2989
 
2990 2990
 	/**
2991
-	* Get a list of flights to airport since 7 days
2992
-	* @return Array number, icao, name and city of airports
2993
-	*/
2991
+	 * Get a list of flights to airport since 7 days
2992
+	 * @return Array number, icao, name and city of airports
2993
+	 */
2994 2994
 
2995 2995
 	public function getLast7DaysAirportsArrivalByAirlines($airport_icao = '') {
2996 2996
 		global $globalTimezone, $globalDBdriver;
@@ -3022,9 +3022,9 @@  discard block
 block discarded – undo
3022 3022
 
3023 3023
 
3024 3024
 	/**
3025
-	* Get a list of flights detected to airport since 7 days
3026
-	* @return Array number, icao, name and city of airports
3027
-	*/
3025
+	 * Get a list of flights detected to airport since 7 days
3026
+	 * @return Array number, icao, name and city of airports
3027
+	 */
3028 3028
 
3029 3029
 	public function getLast7DaysDetectedAirportsArrivalByAirlines($airport_icao = '') {
3030 3030
 		global $globalTimezone, $globalDBdriver;
@@ -3068,11 +3068,11 @@  discard block
 block discarded – undo
3068 3068
 
3069 3069
 
3070 3070
 	/**
3071
-	* Gets a list of all dates
3072
-	*
3073
-	* @return Array list of date names
3074
-	*
3075
-	*/
3071
+	 * Gets a list of all dates
3072
+	 *
3073
+	 * @return Array list of date names
3074
+	 *
3075
+	 */
3076 3076
 	public function getAllDates()
3077 3077
 	{
3078 3078
 		global $globalTimezone, $globalDBdriver;
@@ -3113,11 +3113,11 @@  discard block
 block discarded – undo
3113 3113
 	
3114 3114
 	
3115 3115
 	/**
3116
-	* Gets all route combinations
3117
-	*
3118
-	* @return Array the route list
3119
-	*
3120
-	*/
3116
+	 * Gets all route combinations
3117
+	 *
3118
+	 * @return Array the route list
3119
+	 *
3120
+	 */
3121 3121
 	public function getAllRoutes()
3122 3122
 	{
3123 3123
 		$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 
@@ -3143,13 +3143,13 @@  discard block
 block discarded – undo
3143 3143
 	}
3144 3144
 
3145 3145
 	/**
3146
-	* Update ident spotter data
3147
-	*
3148
-	* @param String $flightaware_id the ID from flightaware
3149
-	* @param String $ident the flight ident
3150
-	* @return String success or false
3151
-	*
3152
-	*/	
3146
+	 * Update ident spotter data
3147
+	 *
3148
+	 * @param String $flightaware_id the ID from flightaware
3149
+	 * @param String $ident the flight ident
3150
+	 * @return String success or false
3151
+	 *
3152
+	 */	
3153 3153
 	public function updateIdentSpotterData($flightaware_id = '', $ident = '',$fromsource = NULL)
3154 3154
 	{
3155 3155
 		if (!is_numeric(substr($ident, 0, 3)))
@@ -3170,14 +3170,14 @@  discard block
 block discarded – undo
3170 3170
 		} else {
3171 3171
 			$airline_array = $this->getAllAirlineInfo("NA");
3172 3172
 		}
3173
-                $airline_name = $airline_array[0]['name'];
3174
-                $airline_icao = $airline_array[0]['icao'];
3175
-                $airline_country = $airline_array[0]['country'];
3176
-                $airline_type = $airline_array[0]['type'];
3173
+				$airline_name = $airline_array[0]['name'];
3174
+				$airline_icao = $airline_array[0]['icao'];
3175
+				$airline_country = $airline_array[0]['country'];
3176
+				$airline_type = $airline_array[0]['type'];
3177 3177
 
3178 3178
 
3179 3179
 		$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';
3180
-                $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);
3180
+				$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);
3181 3181
 
3182 3182
 		try {
3183 3183
 			$sth = $this->db->prepare($query);
@@ -3190,19 +3190,19 @@  discard block
 block discarded – undo
3190 3190
 
3191 3191
 	}
3192 3192
 	/**
3193
-	* Update latest spotter data
3194
-	*
3195
-	* @param String $flightaware_id the ID from flightaware
3196
-	* @param String $ident the flight ident
3197
-	* @param String $arrival_airport_icao the arrival airport
3198
-	* @return String success or false
3199
-	*
3200
-	*/	
3193
+	 * Update latest spotter data
3194
+	 *
3195
+	 * @param String $flightaware_id the ID from flightaware
3196
+	 * @param String $ident the flight ident
3197
+	 * @param String $arrival_airport_icao the arrival airport
3198
+	 * @return String success or false
3199
+	 *
3200
+	 */	
3201 3201
 	public function updateLatestSpotterData($flightaware_id = '', $ident = '', $latitude = '', $longitude = '', $altitude = '', $ground = false, $groundspeed = NULL, $date = '', $arrival_airport_icao = '',$arrival_airport_time = '')
3202 3202
 	{
3203 3203
 		if ($groundspeed == '') $groundspeed = NULL;
3204 3204
 		$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';
3205
-                $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);
3205
+				$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);
3206 3206
 
3207 3207
 		try {
3208 3208
 			$sth = $this->db->prepare($query);
@@ -3216,32 +3216,32 @@  discard block
 block discarded – undo
3216 3216
 	}
3217 3217
 
3218 3218
 	/**
3219
-	* Adds a new spotter data
3220
-	*
3221
-	* @param String $flightaware_id the ID from flightaware
3222
-	* @param String $ident the flight ident
3223
-	* @param String $aircraft_icao the aircraft type
3224
-	* @param String $departure_airport_icao the departure airport
3225
-	* @param String $arrival_airport_icao the arrival airport
3226
-	* @param String $latitude latitude of flight
3227
-	* @param String $longitude latitude of flight
3228
-	* @param String $waypoints waypoints of flight
3229
-	* @param String $altitude altitude of flight
3230
-	* @param String $heading heading of flight
3231
-	* @param String $groundspeed speed of flight
3232
-	* @param String $date date of flight
3233
-	* @param String $departure_airport_time departure time of flight
3234
-	* @param String $arrival_airport_time arrival time of flight
3235
-	* @param String $squawk squawk code of flight
3236
-	* @param String $route_stop route stop of flight
3237
-	* @param String $highlight highlight or not
3238
-	* @param String $ModeS ModesS code of flight
3239
-	* @param String $registration registration code of flight
3240
-	* @param String $pilot_id pilot id of flight (for virtual airlines)
3241
-	* @param String $pilot_name pilot name of flight (for virtual airlines)
3242
-	* @param String $verticalrate vertival rate of flight
3243
-	* @return String success or false
3244
-	*/
3219
+	 * Adds a new spotter data
3220
+	 *
3221
+	 * @param String $flightaware_id the ID from flightaware
3222
+	 * @param String $ident the flight ident
3223
+	 * @param String $aircraft_icao the aircraft type
3224
+	 * @param String $departure_airport_icao the departure airport
3225
+	 * @param String $arrival_airport_icao the arrival airport
3226
+	 * @param String $latitude latitude of flight
3227
+	 * @param String $longitude latitude of flight
3228
+	 * @param String $waypoints waypoints of flight
3229
+	 * @param String $altitude altitude of flight
3230
+	 * @param String $heading heading of flight
3231
+	 * @param String $groundspeed speed of flight
3232
+	 * @param String $date date of flight
3233
+	 * @param String $departure_airport_time departure time of flight
3234
+	 * @param String $arrival_airport_time arrival time of flight
3235
+	 * @param String $squawk squawk code of flight
3236
+	 * @param String $route_stop route stop of flight
3237
+	 * @param String $highlight highlight or not
3238
+	 * @param String $ModeS ModesS code of flight
3239
+	 * @param String $registration registration code of flight
3240
+	 * @param String $pilot_id pilot id of flight (for virtual airlines)
3241
+	 * @param String $pilot_name pilot name of flight (for virtual airlines)
3242
+	 * @param String $verticalrate vertival rate of flight
3243
+	 * @return String success or false
3244
+	 */
3245 3245
 	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 = '')
3246 3246
 	{
3247 3247
 		global $globalURL, $globalIVAO, $globalVATSIM, $globalphpVMS, $globalDebugTimeElapsed, $globalAirlinesSource, $globalVAM;
@@ -3455,8 +3455,8 @@  discard block
 block discarded – undo
3455 3455
     
3456 3456
 		if ($globalIVAO && $aircraft_icao != '')
3457 3457
 		{
3458
-            		if (isset($airline_array[0]['icao'])) $airline_icao = $airline_array[0]['icao'];
3459
-            		else $airline_icao = '';
3458
+					if (isset($airline_array[0]['icao'])) $airline_icao = $airline_array[0]['icao'];
3459
+					else $airline_icao = '';
3460 3460
 			$image_array = $Image->getSpotterImage('',$aircraft_icao,$airline_icao);
3461 3461
 			if (!isset($image_array[0]['registration']))
3462 3462
 			{
@@ -3487,52 +3487,52 @@  discard block
 block discarded – undo
3487 3487
 	
3488 3488
 		if (count($airline_array) == 0) 
3489 3489
 		{
3490
-                        $airline_array = $this->getAllAirlineInfo('NA');
3491
-                }
3492
-                if (count($aircraft_array) == 0) 
3493
-                {
3494
-                        $aircraft_array = $this->getAllAircraftInfo('NA');
3495
-                }
3496
-                if (count($departure_airport_array) == 0) 
3497
-                {
3498
-                        $departure_airport_array = $this->getAllAirportInfo('NA');
3499
-                }
3500
-                if (count($arrival_airport_array) == 0) 
3501
-                {
3502
-                        $arrival_airport_array = $this->getAllAirportInfo('NA');
3503
-                }
3504
-                if ($registration == '') $registration = 'NA';
3505
-                if ($latitude == '' && $longitude == '') {
3506
-            		$latitude = 0;
3507
-            		$longitude = 0;
3508
-            	}
3509
-                if ($squawk == '' || $Common->isInteger($squawk) === false) $squawk = NULL;
3510
-                if ($verticalrate == '' || $Common->isInteger($verticalrate) === false) $verticalrate = NULL;
3511
-                if ($heading == '' || $Common->isInteger($heading) === false) $heading = 0;
3512
-                if ($groundspeed == '' || $Common->isInteger($groundspeed) === false) $groundspeed = 0;
3513
-                if (!isset($aircraft_owner)) $aircraft_owner = NULL;
3514
-                $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) 
3490
+						$airline_array = $this->getAllAirlineInfo('NA');
3491
+				}
3492
+				if (count($aircraft_array) == 0) 
3493
+				{
3494
+						$aircraft_array = $this->getAllAircraftInfo('NA');
3495
+				}
3496
+				if (count($departure_airport_array) == 0) 
3497
+				{
3498
+						$departure_airport_array = $this->getAllAirportInfo('NA');
3499
+				}
3500
+				if (count($arrival_airport_array) == 0) 
3501
+				{
3502
+						$arrival_airport_array = $this->getAllAirportInfo('NA');
3503
+				}
3504
+				if ($registration == '') $registration = 'NA';
3505
+				if ($latitude == '' && $longitude == '') {
3506
+					$latitude = 0;
3507
+					$longitude = 0;
3508
+				}
3509
+				if ($squawk == '' || $Common->isInteger($squawk) === false) $squawk = NULL;
3510
+				if ($verticalrate == '' || $Common->isInteger($verticalrate) === false) $verticalrate = NULL;
3511
+				if ($heading == '' || $Common->isInteger($heading) === false) $heading = 0;
3512
+				if ($groundspeed == '' || $Common->isInteger($groundspeed) === false) $groundspeed = 0;
3513
+				if (!isset($aircraft_owner)) $aircraft_owner = NULL;
3514
+				$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) 
3515 3515
                 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)";
3516 3516
 
3517
-                $airline_name = $airline_array[0]['name'];
3518
-                $airline_icao = $airline_array[0]['icao'];
3519
-                $airline_country = $airline_array[0]['country'];
3520
-                $airline_type = $airline_array[0]['type'];
3517
+				$airline_name = $airline_array[0]['name'];
3518
+				$airline_icao = $airline_array[0]['icao'];
3519
+				$airline_country = $airline_array[0]['country'];
3520
+				$airline_type = $airline_array[0]['type'];
3521 3521
 		if ($airline_type == '') {
3522 3522
 			$timeelapsed = microtime(true);
3523 3523
 			$airline_type = $this->getAircraftTypeBymodeS($ModeS);
3524 3524
 			if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftTypeBymodes : '.round(microtime(true)-$timeelapsed,2).'s'."\n";
3525 3525
 		}
3526 3526
 		if ($airline_type == null) $airline_type = '';
3527
-                $aircraft_type = $aircraft_array[0]['type'];
3528
-                $aircraft_manufacturer = $aircraft_array[0]['manufacturer'];
3529
-                $departure_airport_name = $departure_airport_array[0]['name'];
3530
-                $departure_airport_city = $departure_airport_array[0]['city'];
3531
-                $departure_airport_country = $departure_airport_array[0]['country'];
3532
-                $arrival_airport_name = $arrival_airport_array[0]['name'];
3533
-                $arrival_airport_city = $arrival_airport_array[0]['city'];
3534
-                $arrival_airport_country = $arrival_airport_array[0]['country'];
3535
-                $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);
3527
+				$aircraft_type = $aircraft_array[0]['type'];
3528
+				$aircraft_manufacturer = $aircraft_array[0]['manufacturer'];
3529
+				$departure_airport_name = $departure_airport_array[0]['name'];
3530
+				$departure_airport_city = $departure_airport_array[0]['city'];
3531
+				$departure_airport_country = $departure_airport_array[0]['country'];
3532
+				$arrival_airport_name = $arrival_airport_array[0]['name'];
3533
+				$arrival_airport_city = $arrival_airport_array[0]['city'];
3534
+				$arrival_airport_country = $arrival_airport_array[0]['country'];
3535
+				$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);
3536 3536
 
3537 3537
 		try {
3538 3538
 		        
@@ -3540,7 +3540,7 @@  discard block
 block discarded – undo
3540 3540
 			$sth->execute($query_values);
3541 3541
 			$this->db = null;
3542 3542
 		} catch (PDOException $e) {
3543
-		    return "error : ".$e->getMessage();
3543
+			return "error : ".$e->getMessage();
3544 3544
 		}
3545 3545
 		
3546 3546
 		return "success";
@@ -3549,11 +3549,11 @@  discard block
 block discarded – undo
3549 3549
 	
3550 3550
   
3551 3551
 	/**
3552
-	* Gets the aircraft ident within the last hour
3553
-	*
3554
-	* @return String the ident
3555
-	*
3556
-	*/
3552
+	 * Gets the aircraft ident within the last hour
3553
+	 *
3554
+	 * @return String the ident
3555
+	 *
3556
+	 */
3557 3557
 	public function getIdentFromLastHour($ident)
3558 3558
 	{
3559 3559
 		global $globalDBdriver, $globalTimezone;
@@ -3569,11 +3569,11 @@  discard block
 block discarded – undo
3569 3569
 								AND spotter_output.date >= now() AT TIME ZONE 'UTC' - INTERVAL '1 HOURS'
3570 3570
 								AND spotter_output.date < now() AT TIME ZONE 'UTC'";
3571 3571
 			$query_data = array(':ident' => $ident);
3572
-    		}
3572
+			}
3573 3573
 		
3574 3574
 		$sth = $this->db->prepare($query);
3575 3575
 		$sth->execute($query_data);
3576
-    		$ident_result='';
3576
+			$ident_result='';
3577 3577
 		while($row = $sth->fetch(PDO::FETCH_ASSOC))
3578 3578
 		{
3579 3579
 			$ident_result = $row['ident'];
@@ -3584,11 +3584,11 @@  discard block
 block discarded – undo
3584 3584
 	
3585 3585
 	
3586 3586
 	/**
3587
-	* Gets the aircraft data from the last 20 seconds
3588
-	*
3589
-	* @return Array the spotter data
3590
-	*
3591
-	*/
3587
+	 * Gets the aircraft data from the last 20 seconds
3588
+	 *
3589
+	 * @return Array the spotter data
3590
+	 *
3591
+	 */
3592 3592
 	public function getRealTimeData($q = '')
3593 3593
 	{
3594 3594
 		global $globalDBdriver;
@@ -3632,11 +3632,11 @@  discard block
 block discarded – undo
3632 3632
 	
3633 3633
 	
3634 3634
 	 /**
3635
-	* Gets all airlines that have flown over
3636
-	*
3637
-	* @return Array the airline list
3638
-	*
3639
-	*/
3635
+	  * Gets all airlines that have flown over
3636
+	  *
3637
+	  * @return Array the airline list
3638
+	  *
3639
+	  */
3640 3640
 	public function countAllAirlines($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array())
3641 3641
 	{
3642 3642
 		global $globalDBdriver;
@@ -3650,7 +3650,7 @@  discard block
 block discarded – undo
3650 3650
 				$query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' ";
3651 3651
 			}
3652 3652
 		}
3653
-                if ($sincedate != '') {
3653
+				if ($sincedate != '') {
3654 3654
 			if ($globalDBdriver == 'mysql') {
3655 3655
 				$query .= "AND spotter_output.date > '".$sincedate."' ";
3656 3656
 			} else {
@@ -3677,26 +3677,26 @@  discard block
 block discarded – undo
3677 3677
 	}
3678 3678
 
3679 3679
 	 /**
3680
-	* Gets all pilots that have flown over
3681
-	*
3682
-	* @return Array the pilots list
3683
-	*
3684
-	*/
3680
+	  * Gets all pilots that have flown over
3681
+	  *
3682
+	  * @return Array the pilots list
3683
+	  *
3684
+	  */
3685 3685
 	public function countAllPilots($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array())
3686 3686
 	{
3687 3687
 		global $globalDBdriver;
3688 3688
 		$filter_query = $this->getFilter($filters,true,true);
3689 3689
 		$query  = "SELECT DISTINCT spotter_output.pilot_id, spotter_output.pilot_name, COUNT(spotter_output.pilot_id) AS pilot_count, spotter_output.format_source
3690 3690
 		 			FROM spotter_output".$filter_query." spotter_output.pilot_id <> '' ";
3691
-                if ($olderthanmonths > 0) {
3692
-            		if ($globalDBdriver == 'mysql') {
3691
+				if ($olderthanmonths > 0) {
3692
+					if ($globalDBdriver == 'mysql') {
3693 3693
 				$query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) ';
3694 3694
 			} else {
3695 3695
 				$query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' ";
3696 3696
 			}
3697 3697
 		}
3698
-                if ($sincedate != '') {
3699
-            		if ($globalDBdriver == 'mysql') {
3698
+				if ($sincedate != '') {
3699
+					if ($globalDBdriver == 'mysql') {
3700 3700
 				$query .= "AND spotter_output.date > '".$sincedate."' ";
3701 3701
 			} else {
3702 3702
 				$query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
@@ -3724,25 +3724,25 @@  discard block
 block discarded – undo
3724 3724
 	}
3725 3725
 	
3726 3726
 		 /**
3727
-	* Gets all pilots that have flown over
3728
-	*
3729
-	* @return Array the pilots list
3730
-	*
3731
-	*/
3727
+		  * Gets all pilots that have flown over
3728
+		  *
3729
+		  * @return Array the pilots list
3730
+		  *
3731
+		  */
3732 3732
 	public function countAllPilotsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '')
3733 3733
 	{
3734 3734
 		global $globalDBdriver;
3735 3735
 		$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
3736 3736
 		 			FROM spotter_output WHERE spotter_output.pilot_id <> '' ";
3737
-                if ($olderthanmonths > 0) {
3738
-            		if ($globalDBdriver == 'mysql') {
3737
+				if ($olderthanmonths > 0) {
3738
+					if ($globalDBdriver == 'mysql') {
3739 3739
 				$query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) ';
3740 3740
 			} else {
3741 3741
 				$query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' ";
3742 3742
 			}
3743 3743
 		}
3744
-                if ($sincedate != '') {
3745
-            		if ($globalDBdriver == 'mysql') {
3744
+				if ($sincedate != '') {
3745
+					if ($globalDBdriver == 'mysql') {
3746 3746
 				$query .= "AND spotter_output.date > '".$sincedate."' ";
3747 3747
 			} else {
3748 3748
 				$query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
@@ -3771,26 +3771,26 @@  discard block
 block discarded – undo
3771 3771
 	}
3772 3772
 	
3773 3773
 	 /**
3774
-	* Gets all owner that have flown over
3775
-	*
3776
-	* @return Array the pilots list
3777
-	*
3778
-	*/
3774
+	  * Gets all owner that have flown over
3775
+	  *
3776
+	  * @return Array the pilots list
3777
+	  *
3778
+	  */
3779 3779
 	public function countAllOwners($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array())
3780 3780
 	{
3781 3781
 		global $globalDBdriver;
3782 3782
 		$filter_query = $this->getFilter($filters,true,true);
3783 3783
 		$query  = "SELECT DISTINCT spotter_output.owner_name, COUNT(spotter_output.owner_name) AS owner_count
3784 3784
 		 			FROM spotter_output".$filter_query." spotter_output.owner_name <> '' AND spotter_output.owner_name IS NOT NULL ";
3785
-                if ($olderthanmonths > 0) {
3786
-            		if ($globalDBdriver == 'mysql') {
3785
+				if ($olderthanmonths > 0) {
3786
+					if ($globalDBdriver == 'mysql') {
3787 3787
 				$query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) ';
3788 3788
 			} else {
3789 3789
 				$query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' ";
3790 3790
 			}
3791 3791
 		}
3792
-                if ($sincedate != '') {
3793
-            		if ($globalDBdriver == 'mysql') {
3792
+				if ($sincedate != '') {
3793
+					if ($globalDBdriver == 'mysql') {
3794 3794
 				$query .= "AND spotter_output.date > '".$sincedate."' ";
3795 3795
 			} else {
3796 3796
 				$query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
@@ -3816,26 +3816,26 @@  discard block
 block discarded – undo
3816 3816
 	}
3817 3817
 	
3818 3818
 	 /**
3819
-	* Gets all owner that have flown over
3820
-	*
3821
-	* @return Array the pilots list
3822
-	*
3823
-	*/
3819
+	  * Gets all owner that have flown over
3820
+	  *
3821
+	  * @return Array the pilots list
3822
+	  *
3823
+	  */
3824 3824
 	public function countAllOwnersByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array())
3825 3825
 	{
3826 3826
 		global $globalDBdriver;
3827 3827
 		$filter_query = $this->getFilter($filters,true,true);
3828 3828
 		$query  = "SELECT DISTINCT spotter_output.airline_icao, spotter_output.owner_name, COUNT(spotter_output.owner_name) AS owner_count
3829 3829
 		 			FROM spotter_output".$filter_query." spotter_output.owner_name <> '' AND spotter_output.owner_name IS NOT NULL ";
3830
-                if ($olderthanmonths > 0) {
3831
-            		if ($globalDBdriver == 'mysql') {
3830
+				if ($olderthanmonths > 0) {
3831
+					if ($globalDBdriver == 'mysql') {
3832 3832
 				$query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) ';
3833 3833
 			} else {
3834 3834
 				$query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' ";
3835 3835
 			}
3836 3836
 		}
3837
-                if ($sincedate != '') {
3838
-            		if ($globalDBdriver == 'mysql') {
3837
+				if ($sincedate != '') {
3838
+					if ($globalDBdriver == 'mysql') {
3839 3839
 				$query .= "AND spotter_output.date > '".$sincedate."' ";
3840 3840
 			} else {
3841 3841
 				$query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
@@ -3862,11 +3862,11 @@  discard block
 block discarded – undo
3862 3862
 	}
3863 3863
 
3864 3864
 	/**
3865
-	* Gets all airlines that have flown over by aircraft
3866
-	*
3867
-	* @return Array the airline list
3868
-	*
3869
-	*/
3865
+	 * Gets all airlines that have flown over by aircraft
3866
+	 *
3867
+	 * @return Array the airline list
3868
+	 *
3869
+	 */
3870 3870
 	public function countAllAirlinesByAircraft($aircraft_icao,$filters = array())
3871 3871
 	{
3872 3872
 		$aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING);
@@ -3898,11 +3898,11 @@  discard block
 block discarded – undo
3898 3898
 
3899 3899
 
3900 3900
 	/**
3901
-	* Gets all airline countries that have flown over by aircraft
3902
-	*
3903
-	* @return Array the airline country list
3904
-	*
3905
-	*/
3901
+	 * Gets all airline countries that have flown over by aircraft
3902
+	 *
3903
+	 * @return Array the airline country list
3904
+	 *
3905
+	 */
3906 3906
 	public function countAllAirlineCountriesByAircraft($aircraft_icao,$filters = array())
3907 3907
 	{
3908 3908
 		$aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING);
@@ -3934,11 +3934,11 @@  discard block
 block discarded – undo
3934 3934
 	
3935 3935
 	
3936 3936
 	/**
3937
-	* Gets all airlines that have flown over by airport
3938
-	*
3939
-	* @return Array the airline list
3940
-	*
3941
-	*/
3937
+	 * Gets all airlines that have flown over by airport
3938
+	 *
3939
+	 * @return Array the airline list
3940
+	 *
3941
+	 */
3942 3942
 	public function countAllAirlinesByAirport($airport_icao,$filters = array())
3943 3943
 	{
3944 3944
 		$airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING);
@@ -3969,11 +3969,11 @@  discard block
 block discarded – undo
3969 3969
 
3970 3970
 
3971 3971
 	/**
3972
-	* Gets all airline countries that have flown over by airport icao
3973
-	*
3974
-	* @return Array the airline country list
3975
-	*
3976
-	*/
3972
+	 * Gets all airline countries that have flown over by airport icao
3973
+	 *
3974
+	 * @return Array the airline country list
3975
+	 *
3976
+	 */
3977 3977
 	public function countAllAirlineCountriesByAirport($airport_icao,$filters = array())
3978 3978
 	{
3979 3979
 		$airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING);
@@ -4003,11 +4003,11 @@  discard block
 block discarded – undo
4003 4003
 
4004 4004
 
4005 4005
 	/**
4006
-	* Gets all airlines that have flown over by aircraft manufacturer
4007
-	*
4008
-	* @return Array the airline list
4009
-	*
4010
-	*/
4006
+	 * Gets all airlines that have flown over by aircraft manufacturer
4007
+	 *
4008
+	 * @return Array the airline list
4009
+	 *
4010
+	 */
4011 4011
 	public function countAllAirlinesByManufacturer($aircraft_manufacturer,$filters = array())
4012 4012
 	{
4013 4013
 		$aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING);
@@ -4038,11 +4038,11 @@  discard block
 block discarded – undo
4038 4038
 
4039 4039
 
4040 4040
 	/**
4041
-	* Gets all airline countries that have flown over by aircraft manufacturer
4042
-	*
4043
-	* @return Array the airline country list
4044
-	*
4045
-	*/
4041
+	 * Gets all airline countries that have flown over by aircraft manufacturer
4042
+	 *
4043
+	 * @return Array the airline country list
4044
+	 *
4045
+	 */
4046 4046
 	public function countAllAirlineCountriesByManufacturer($aircraft_manufacturer,$filters = array())
4047 4047
 	{
4048 4048
 		$aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING);
@@ -4071,11 +4071,11 @@  discard block
 block discarded – undo
4071 4071
 
4072 4072
 
4073 4073
 	/**
4074
-	* Gets all airlines that have flown over by date
4075
-	*
4076
-	* @return Array the airline list
4077
-	*
4078
-	*/
4074
+	 * Gets all airlines that have flown over by date
4075
+	 *
4076
+	 * @return Array the airline list
4077
+	 *
4078
+	 */
4079 4079
 	public function countAllAirlinesByDate($date,$filters = array())
4080 4080
 	{
4081 4081
 		global $globalTimezone, $globalDBdriver;
@@ -4119,11 +4119,11 @@  discard block
 block discarded – undo
4119 4119
 	
4120 4120
 	
4121 4121
 	/**
4122
-	* Gets all airline countries that have flown over by date
4123
-	*
4124
-	* @return Array the airline country list
4125
-	*
4126
-	*/
4122
+	 * Gets all airline countries that have flown over by date
4123
+	 *
4124
+	 * @return Array the airline country list
4125
+	 *
4126
+	 */
4127 4127
 	public function countAllAirlineCountriesByDate($date,$filters = array())
4128 4128
 	{
4129 4129
 		global $globalTimezone, $globalDBdriver;
@@ -4166,11 +4166,11 @@  discard block
 block discarded – undo
4166 4166
 
4167 4167
 
4168 4168
 	/**
4169
-	* Gets all airlines that have flown over by ident/callsign
4170
-	*
4171
-	* @return Array the airline list
4172
-	*
4173
-	*/
4169
+	 * Gets all airlines that have flown over by ident/callsign
4170
+	 *
4171
+	 * @return Array the airline list
4172
+	 *
4173
+	 */
4174 4174
 	public function countAllAirlinesByIdent($ident,$filters = array())
4175 4175
 	{
4176 4176
 		$ident = filter_var($ident,FILTER_SANITIZE_STRING);
@@ -4200,11 +4200,11 @@  discard block
 block discarded – undo
4200 4200
 	}
4201 4201
 
4202 4202
 	/**
4203
-	* Gets all airlines that have flown over by route
4204
-	*
4205
-	* @return Array the airline list
4206
-	*
4207
-	*/
4203
+	 * Gets all airlines that have flown over by route
4204
+	 *
4205
+	 * @return Array the airline list
4206
+	 *
4207
+	 */
4208 4208
 	public function countAllAirlinesByRoute($departure_airport_icao, $arrival_airport_icao,$filters = array())
4209 4209
 	{
4210 4210
 		$filter_query = $this->getFilter($filters,true,true);
@@ -4236,11 +4236,11 @@  discard block
 block discarded – undo
4236 4236
 	}
4237 4237
 
4238 4238
 	/**
4239
-	* Gets all airline countries that have flown over by route
4240
-	*
4241
-	* @return Array the airline country list
4242
-	*
4243
-	*/
4239
+	 * Gets all airline countries that have flown over by route
4240
+	 *
4241
+	 * @return Array the airline country list
4242
+	 *
4243
+	 */
4244 4244
 	public function countAllAirlineCountriesByRoute($departure_airport_icao, $arrival_airport_icao,$filters= array())
4245 4245
 	{
4246 4246
 		$filter_query = $this->getFilter($filters,true,true);
@@ -4272,11 +4272,11 @@  discard block
 block discarded – undo
4272 4272
 
4273 4273
 
4274 4274
 	/**
4275
-	* Gets all airlines that have flown over by country
4276
-	*
4277
-	* @return Array the airline list
4278
-	*
4279
-	*/
4275
+	 * Gets all airlines that have flown over by country
4276
+	 *
4277
+	 * @return Array the airline list
4278
+	 *
4279
+	 */
4280 4280
 	public function countAllAirlinesByCountry($country,$filters = array())
4281 4281
 	{
4282 4282
 		$country = filter_var($country,FILTER_SANITIZE_STRING);
@@ -4306,11 +4306,11 @@  discard block
 block discarded – undo
4306 4306
 
4307 4307
 
4308 4308
 	/**
4309
-	* Gets all airline countries that have flown over by country
4310
-	*
4311
-	* @return Array the airline country list
4312
-	*
4313
-	*/
4309
+	 * Gets all airline countries that have flown over by country
4310
+	 *
4311
+	 * @return Array the airline country list
4312
+	 *
4313
+	 */
4314 4314
 	public function countAllAirlineCountriesByCountry($country,$filters = array())
4315 4315
 	{
4316 4316
 		$filter_query = $this->getFilter($filters,true,true);
@@ -4339,11 +4339,11 @@  discard block
 block discarded – undo
4339 4339
 
4340 4340
 
4341 4341
 	/**
4342
-	* Gets all airlines countries
4343
-	*
4344
-	* @return Array the airline country list
4345
-	*
4346
-	*/
4342
+	 * Gets all airlines countries
4343
+	 *
4344
+	 * @return Array the airline country list
4345
+	 *
4346
+	 */
4347 4347
 	public function countAllAirlineCountries($limit = true, $filters = array())
4348 4348
 	{
4349 4349
 		$filter_query = $this->getFilter($filters,true,true);
@@ -4369,11 +4369,11 @@  discard block
 block discarded – undo
4369 4369
 	}
4370 4370
 
4371 4371
 	/**
4372
-	* Gets all number of flight over countries
4373
-	*
4374
-	* @return Array the airline country list
4375
-	*
4376
-	*/
4372
+	 * Gets all number of flight over countries
4373
+	 *
4374
+	 * @return Array the airline country list
4375
+	 *
4376
+	 */
4377 4377
 	public function countAllFlightOverCountries($limit = true,$olderthanmonths = 0,$sincedate = '')
4378 4378
 	{
4379 4379
 		global $globalDBdriver;
@@ -4388,15 +4388,15 @@  discard block
 block discarded – undo
4388 4388
 		$query = "SELECT c.name, c.iso3, c.iso2, count(c.name) as nb 
4389 4389
 					FROM countries c, spotter_live s
4390 4390
 					WHERE c.iso2 = s.over_country ";
4391
-                if ($olderthanmonths > 0) {
4391
+				if ($olderthanmonths > 0) {
4392 4392
 			if ($globalDBdriver == 'mysql') {
4393 4393
 				$query .= 'AND spotter_live.date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
4394 4394
 			} else {
4395 4395
 				$query .= "AND spotter_live.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'";
4396 4396
 			}
4397 4397
 		}
4398
-                if ($sincedate != '') {
4399
-            		if ($globalDBdriver == 'mysql') {
4398
+				if ($sincedate != '') {
4399
+					if ($globalDBdriver == 'mysql') {
4400 4400
 				$query .= "AND spotter_live.date > '".$sincedate."' ";
4401 4401
 			} else {
4402 4402
 				$query .= "AND spotter_live.date > CAST('".$sincedate."' AS TIMESTAMP)";
@@ -4426,11 +4426,11 @@  discard block
 block discarded – undo
4426 4426
 	
4427 4427
 	
4428 4428
 	/**
4429
-	* Gets all aircraft types that have flown over
4430
-	*
4431
-	* @return Array the aircraft list
4432
-	*
4433
-	*/
4429
+	 * Gets all aircraft types that have flown over
4430
+	 *
4431
+	 * @return Array the aircraft list
4432
+	 *
4433
+	 */
4434 4434
 	public function countAllAircraftTypes($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array())
4435 4435
 	{
4436 4436
 		global $globalDBdriver;
@@ -4473,11 +4473,11 @@  discard block
 block discarded – undo
4473 4473
 	}
4474 4474
 
4475 4475
 	/**
4476
-	* Gets all aircraft types that have flown over by airline
4477
-	*
4478
-	* @return Array the aircraft list
4479
-	*
4480
-	*/
4476
+	 * Gets all aircraft types that have flown over by airline
4477
+	 *
4478
+	 * @return Array the aircraft list
4479
+	 *
4480
+	 */
4481 4481
 	public function countAllAircraftTypesByAirlines($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array())
4482 4482
 	{
4483 4483
 		global $globalDBdriver;
@@ -4520,11 +4520,11 @@  discard block
 block discarded – undo
4520 4520
 	}
4521 4521
 
4522 4522
 	/**
4523
-	* Gets all aircraft types that have flown over by months
4524
-	*
4525
-	* @return Array the aircraft list
4526
-	*
4527
-	*/
4523
+	 * Gets all aircraft types that have flown over by months
4524
+	 *
4525
+	 * @return Array the aircraft list
4526
+	 *
4527
+	 */
4528 4528
 	public function countAllAircraftTypesByMonths($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array())
4529 4529
 	{
4530 4530
 		global $globalDBdriver;
@@ -4568,11 +4568,11 @@  discard block
 block discarded – undo
4568 4568
 
4569 4569
 
4570 4570
 	/**
4571
-	* Gets all aircraft registration that have flown over by aircaft icao
4572
-	*
4573
-	* @return Array the aircraft list
4574
-	*
4575
-	*/
4571
+	 * Gets all aircraft registration that have flown over by aircaft icao
4572
+	 *
4573
+	 * @return Array the aircraft list
4574
+	 *
4575
+	 */
4576 4576
 	public function countAllAircraftRegistrationByAircraft($aircraft_icao,$filters = array())
4577 4577
 	{
4578 4578
 		$Image = new Image($this->db);
@@ -4611,11 +4611,11 @@  discard block
 block discarded – undo
4611 4611
 
4612 4612
 
4613 4613
 	/**
4614
-	* Gets all aircraft types that have flown over by airline icao
4615
-	*
4616
-	* @return Array the aircraft list
4617
-	*
4618
-	*/
4614
+	 * Gets all aircraft types that have flown over by airline icao
4615
+	 *
4616
+	 * @return Array the aircraft list
4617
+	 *
4618
+	 */
4619 4619
 	public function countAllAircraftTypesByAirline($airline_icao,$filters = array())
4620 4620
 	{
4621 4621
 		$filter_query = $this->getFilter($filters,true,true);
@@ -4644,11 +4644,11 @@  discard block
 block discarded – undo
4644 4644
 
4645 4645
 
4646 4646
 	/**
4647
-	* Gets all aircraft registration that have flown over by airline icao
4648
-	*
4649
-	* @return Array the aircraft list
4650
-	*
4651
-	*/
4647
+	 * Gets all aircraft registration that have flown over by airline icao
4648
+	 *
4649
+	 * @return Array the aircraft list
4650
+	 *
4651
+	 */
4652 4652
 	public function countAllAircraftRegistrationByAirline($airline_icao,$filters = array())
4653 4653
 	{
4654 4654
 		$filter_query = $this->getFilter($filters,true,true);
@@ -4686,11 +4686,11 @@  discard block
 block discarded – undo
4686 4686
 
4687 4687
 
4688 4688
 	/**
4689
-	* Gets all aircraft manufacturer that have flown over by airline icao
4690
-	*
4691
-	* @return Array the aircraft list
4692
-	*
4693
-	*/
4689
+	 * Gets all aircraft manufacturer that have flown over by airline icao
4690
+	 *
4691
+	 * @return Array the aircraft list
4692
+	 *
4693
+	 */
4694 4694
 	public function countAllAircraftManufacturerByAirline($airline_icao,$filters = array())
4695 4695
 	{
4696 4696
 		$filter_query = $this->getFilter($filters,true,true);
@@ -4718,11 +4718,11 @@  discard block
 block discarded – undo
4718 4718
 
4719 4719
 
4720 4720
 	/**
4721
-	* Gets all aircraft types that have flown over by airline icao
4722
-	*
4723
-	* @return Array the aircraft list
4724
-	*
4725
-	*/
4721
+	 * Gets all aircraft types that have flown over by airline icao
4722
+	 *
4723
+	 * @return Array the aircraft list
4724
+	 *
4725
+	 */
4726 4726
 	public function countAllAircraftTypesByAirport($airport_icao,$filters = array())
4727 4727
 	{
4728 4728
 		$filter_query = $this->getFilter($filters,true,true);
@@ -4751,11 +4751,11 @@  discard block
 block discarded – undo
4751 4751
 
4752 4752
 
4753 4753
 	/**
4754
-	* Gets all aircraft registration that have flown over by airport icao
4755
-	*
4756
-	* @return Array the aircraft list
4757
-	*
4758
-	*/
4754
+	 * Gets all aircraft registration that have flown over by airport icao
4755
+	 *
4756
+	 * @return Array the aircraft list
4757
+	 *
4758
+	 */
4759 4759
 	public function countAllAircraftRegistrationByAirport($airport_icao,$filters = array())
4760 4760
 	{
4761 4761
 		$filter_query = $this->getFilter($filters,true,true);
@@ -4792,11 +4792,11 @@  discard block
 block discarded – undo
4792 4792
 	
4793 4793
 	
4794 4794
 	/**
4795
-	* Gets all aircraft manufacturer that have flown over by airport icao
4796
-	*
4797
-	* @return Array the aircraft list
4798
-	*
4799
-	*/
4795
+	 * Gets all aircraft manufacturer that have flown over by airport icao
4796
+	 *
4797
+	 * @return Array the aircraft list
4798
+	 *
4799
+	 */
4800 4800
 	public function countAllAircraftManufacturerByAirport($airport_icao,$filters = array())
4801 4801
 	{
4802 4802
 		$filter_query = $this->getFilter($filters,true,true);
@@ -4822,11 +4822,11 @@  discard block
 block discarded – undo
4822 4822
 	}
4823 4823
 
4824 4824
 	/**
4825
-	* Gets all aircraft types that have flown over by aircraft manufacturer
4826
-	*
4827
-	* @return Array the aircraft list
4828
-	*
4829
-	*/
4825
+	 * Gets all aircraft types that have flown over by aircraft manufacturer
4826
+	 *
4827
+	 * @return Array the aircraft list
4828
+	 *
4829
+	 */
4830 4830
 	public function countAllAircraftTypesByManufacturer($aircraft_manufacturer,$filters = array())
4831 4831
 	{
4832 4832
 		$filter_query = $this->getFilter($filters,true,true);
@@ -4853,11 +4853,11 @@  discard block
 block discarded – undo
4853 4853
 
4854 4854
 
4855 4855
 	/**
4856
-	* Gets all aircraft registration that have flown over by aircaft manufacturer
4857
-	*
4858
-	* @return Array the aircraft list
4859
-	*
4860
-	*/
4856
+	 * Gets all aircraft registration that have flown over by aircaft manufacturer
4857
+	 *
4858
+	 * @return Array the aircraft list
4859
+	 *
4860
+	 */
4861 4861
 	public function countAllAircraftRegistrationByManufacturer($aircraft_manufacturer, $filters = array())
4862 4862
 	{
4863 4863
 		$filter_query = $this->getFilter($filters,true,true);
@@ -4893,11 +4893,11 @@  discard block
 block discarded – undo
4893 4893
 	}
4894 4894
 
4895 4895
 	/**
4896
-	* Gets all aircraft types that have flown over by date
4897
-	*
4898
-	* @return Array the aircraft list
4899
-	*
4900
-	*/
4896
+	 * Gets all aircraft types that have flown over by date
4897
+	 *
4898
+	 * @return Array the aircraft list
4899
+	 *
4900
+	 */
4901 4901
 	public function countAllAircraftTypesByDate($date,$filters = array())
4902 4902
 	{
4903 4903
 		global $globalTimezone, $globalDBdriver;
@@ -4939,11 +4939,11 @@  discard block
 block discarded – undo
4939 4939
 
4940 4940
 
4941 4941
 	/**
4942
-	* Gets all aircraft registration that have flown over by date
4943
-	*
4944
-	* @return Array the aircraft list
4945
-	*
4946
-	*/
4942
+	 * Gets all aircraft registration that have flown over by date
4943
+	 *
4944
+	 * @return Array the aircraft list
4945
+	 *
4946
+	 */
4947 4947
 	public function countAllAircraftRegistrationByDate($date,$filters = array())
4948 4948
 	{
4949 4949
 		global $globalTimezone, $globalDBdriver;
@@ -4994,11 +4994,11 @@  discard block
 block discarded – undo
4994 4994
 
4995 4995
 
4996 4996
 	/**
4997
-	* Gets all aircraft manufacturer that have flown over by date
4998
-	*
4999
-	* @return Array the aircraft manufacturer list
5000
-	*
5001
-	*/
4997
+	 * Gets all aircraft manufacturer that have flown over by date
4998
+	 *
4999
+	 * @return Array the aircraft manufacturer list
5000
+	 *
5001
+	 */
5002 5002
 	public function countAllAircraftManufacturerByDate($date,$filters = array())
5003 5003
 	{
5004 5004
 		global $globalTimezone, $globalDBdriver;
@@ -5040,11 +5040,11 @@  discard block
 block discarded – undo
5040 5040
 
5041 5041
 
5042 5042
 	/**
5043
-	* Gets all aircraft types that have flown over by ident/callsign
5044
-	*
5045
-	* @return Array the aircraft list
5046
-	*
5047
-	*/
5043
+	 * Gets all aircraft types that have flown over by ident/callsign
5044
+	 *
5045
+	 * @return Array the aircraft list
5046
+	 *
5047
+	 */
5048 5048
 	public function countAllAircraftTypesByIdent($ident,$filters = array())
5049 5049
 	{
5050 5050
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5073,11 +5073,11 @@  discard block
 block discarded – undo
5073 5073
 
5074 5074
 
5075 5075
 	/**
5076
-	* Gets all aircraft registration that have flown over by ident/callsign
5077
-	*
5078
-	* @return Array the aircraft list
5079
-	*
5080
-	*/
5076
+	 * Gets all aircraft registration that have flown over by ident/callsign
5077
+	 *
5078
+	 * @return Array the aircraft list
5079
+	 *
5080
+	 */
5081 5081
 	public function countAllAircraftRegistrationByIdent($ident,$filters = array())
5082 5082
 	{
5083 5083
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5117,11 +5117,11 @@  discard block
 block discarded – undo
5117 5117
 
5118 5118
 
5119 5119
 	/**
5120
-	* Gets all aircraft manufacturer that have flown over by ident/callsign
5121
-	*
5122
-	* @return Array the aircraft manufacturer list
5123
-	*
5124
-	*/
5120
+	 * Gets all aircraft manufacturer that have flown over by ident/callsign
5121
+	 *
5122
+	 * @return Array the aircraft manufacturer list
5123
+	 *
5124
+	 */
5125 5125
 	public function countAllAircraftManufacturerByIdent($ident,$filters = array())
5126 5126
 	{
5127 5127
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5147,11 +5147,11 @@  discard block
 block discarded – undo
5147 5147
 
5148 5148
 
5149 5149
 	/**
5150
-	* Gets all aircraft types that have flown over by route
5151
-	*
5152
-	* @return Array the aircraft list
5153
-	*
5154
-	*/
5150
+	 * Gets all aircraft types that have flown over by route
5151
+	 *
5152
+	 * @return Array the aircraft list
5153
+	 *
5154
+	 */
5155 5155
 	public function countAllAircraftTypesByRoute($departure_airport_icao, $arrival_airport_icao,$filters = array())
5156 5156
 	{
5157 5157
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5180,11 +5180,11 @@  discard block
 block discarded – undo
5180 5180
 	}
5181 5181
 
5182 5182
 	/**
5183
-	* Gets all aircraft registration that have flown over by route
5184
-	*
5185
-	* @return Array the aircraft list
5186
-	*
5187
-	*/
5183
+	 * Gets all aircraft registration that have flown over by route
5184
+	 *
5185
+	 * @return Array the aircraft list
5186
+	 *
5187
+	 */
5188 5188
 	public function countAllAircraftRegistrationByRoute($departure_airport_icao, $arrival_airport_icao,$filters = array())
5189 5189
 	{
5190 5190
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5226,11 +5226,11 @@  discard block
 block discarded – undo
5226 5226
 	
5227 5227
 	
5228 5228
 	/**
5229
-	* Gets all aircraft manufacturer that have flown over by route
5230
-	*
5231
-	* @return Array the aircraft manufacturer list
5232
-	*
5233
-	*/
5229
+	 * Gets all aircraft manufacturer that have flown over by route
5230
+	 *
5231
+	 * @return Array the aircraft manufacturer list
5232
+	 *
5233
+	 */
5234 5234
 	public function countAllAircraftManufacturerByRoute($departure_airport_icao, $arrival_airport_icao,$filters = array())
5235 5235
 	{
5236 5236
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5264,11 +5264,11 @@  discard block
 block discarded – undo
5264 5264
 	
5265 5265
 	
5266 5266
 	/**
5267
-	* Gets all aircraft types that have flown over by country
5268
-	*
5269
-	* @return Array the aircraft list
5270
-	*
5271
-	*/
5267
+	 * Gets all aircraft types that have flown over by country
5268
+	 *
5269
+	 * @return Array the aircraft list
5270
+	 *
5271
+	 */
5272 5272
 	public function countAllAircraftTypesByCountry($country,$filters = array())
5273 5273
 	{
5274 5274
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5299,11 +5299,11 @@  discard block
 block discarded – undo
5299 5299
 
5300 5300
 
5301 5301
 	/**
5302
-	* Gets all aircraft registration that have flown over by country
5303
-	*
5304
-	* @return Array the aircraft list
5305
-	*
5306
-	*/
5302
+	 * Gets all aircraft registration that have flown over by country
5303
+	 *
5304
+	 * @return Array the aircraft list
5305
+	 *
5306
+	 */
5307 5307
 	public function countAllAircraftRegistrationByCountry($country,$filters = array())
5308 5308
 	{
5309 5309
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5343,11 +5343,11 @@  discard block
 block discarded – undo
5343 5343
 	
5344 5344
 	
5345 5345
 	/**
5346
-	* Gets all aircraft manufacturer that have flown over by country
5347
-	*
5348
-	* @return Array the aircraft manufacturer list
5349
-	*
5350
-	*/
5346
+	 * Gets all aircraft manufacturer that have flown over by country
5347
+	 *
5348
+	 * @return Array the aircraft manufacturer list
5349
+	 *
5350
+	 */
5351 5351
 	public function countAllAircraftManufacturerByCountry($country,$filters = array())
5352 5352
 	{
5353 5353
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5378,17 +5378,17 @@  discard block
 block discarded – undo
5378 5378
 	
5379 5379
 	
5380 5380
 	/**
5381
-	* Gets all aircraft manufacturers that have flown over
5382
-	*
5383
-	* @return Array the aircraft list
5384
-	*
5385
-	*/
5381
+	 * Gets all aircraft manufacturers that have flown over
5382
+	 *
5383
+	 * @return Array the aircraft list
5384
+	 *
5385
+	 */
5386 5386
 	public function countAllAircraftManufacturers($filters = array())
5387 5387
 	{
5388 5388
 		$filter_query = $this->getFilter($filters,true,true);
5389 5389
 		$query  = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count  
5390 5390
                     FROM spotter_output ".$filter_query." spotter_output.aircraft_manufacturer <> '' AND spotter_output.aircraft_manufacturer <> 'Not Available'";
5391
-                $query .= " GROUP BY spotter_output.aircraft_manufacturer
5391
+				$query .= " GROUP BY spotter_output.aircraft_manufacturer
5392 5392
 					ORDER BY aircraft_manufacturer_count DESC
5393 5393
 					LIMIT 10";
5394 5394
       
@@ -5413,11 +5413,11 @@  discard block
 block discarded – undo
5413 5413
 	
5414 5414
 	
5415 5415
 	/**
5416
-	* Gets all aircraft registrations that have flown over
5417
-	*
5418
-	* @return Array the aircraft list
5419
-	*
5420
-	*/
5416
+	 * Gets all aircraft registrations that have flown over
5417
+	 *
5418
+	 * @return Array the aircraft list
5419
+	 *
5420
+	 */
5421 5421
 	public function countAllAircraftRegistrations($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array())
5422 5422
 	{
5423 5423
 		global $globalDBdriver;
@@ -5425,15 +5425,15 @@  discard block
 block discarded – undo
5425 5425
 		$filter_query = $this->getFilter($filters,true,true);
5426 5426
 		$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    
5427 5427
                     FROM spotter_output ".$filter_query." spotter_output.registration <> '' AND spotter_output.registration <> 'NA'";
5428
-                if ($olderthanmonths > 0) {
5429
-            		if ($globalDBdriver == 'mysql') {
5428
+				if ($olderthanmonths > 0) {
5429
+					if ($globalDBdriver == 'mysql') {
5430 5430
 				$query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)';
5431 5431
 			} else {
5432 5432
 				$query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'";
5433 5433
 			}
5434 5434
 		}
5435
-                if ($sincedate != '') {
5436
-            		if ($globalDBdriver == 'mysql') {
5435
+				if ($sincedate != '') {
5436
+					if ($globalDBdriver == 'mysql') {
5437 5437
 				$query .= " AND spotter_output.date > '".$sincedate."'";
5438 5438
 			} else {
5439 5439
 				$query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
@@ -5442,7 +5442,7 @@  discard block
 block discarded – undo
5442 5442
 
5443 5443
 		// if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
5444 5444
 		//if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
5445
-                $query .= " GROUP BY spotter_output.registration, spotter_output.aircraft_icao, spotter_output.aircraft_name, spotter_output.airline_name ORDER BY aircraft_registration_count DESC";
5445
+				$query .= " GROUP BY spotter_output.registration, spotter_output.aircraft_icao, spotter_output.aircraft_name, spotter_output.airline_name ORDER BY aircraft_registration_count DESC";
5446 5446
 		if ($limit) $query .= " LIMIT 10 OFFSET 0";
5447 5447
 		
5448 5448
 		$sth = $this->db->prepare($query);
@@ -5473,11 +5473,11 @@  discard block
 block discarded – undo
5473 5473
 
5474 5474
 
5475 5475
 	/**
5476
-	* Gets all aircraft registrations that have flown over
5477
-	*
5478
-	* @return Array the aircraft list
5479
-	*
5480
-	*/
5476
+	 * Gets all aircraft registrations that have flown over
5477
+	 *
5478
+	 * @return Array the aircraft list
5479
+	 *
5480
+	 */
5481 5481
 	public function countAllAircraftRegistrationsByAirlines($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array())
5482 5482
 	{
5483 5483
 		global $globalDBdriver;
@@ -5485,15 +5485,15 @@  discard block
 block discarded – undo
5485 5485
 		$Image = new Image($this->db);
5486 5486
 		$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    
5487 5487
                     FROM spotter_output".$filter_query." spotter_output.airline_icao <> '' AND spotter_output.registration <> '' AND spotter_output.registration <> 'NA' ";
5488
-                if ($olderthanmonths > 0) {
5489
-            		if ($globalDBdriver == 'mysql') {
5488
+				if ($olderthanmonths > 0) {
5489
+					if ($globalDBdriver == 'mysql') {
5490 5490
 				$query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) ';
5491 5491
 			} else {
5492 5492
 				$query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' ";
5493 5493
 			}
5494 5494
 		}
5495
-                if ($sincedate != '') {
5496
-            		if ($globalDBdriver == 'mysql') {
5495
+				if ($sincedate != '') {
5496
+					if ($globalDBdriver == 'mysql') {
5497 5497
 				$query .= "AND spotter_output.date > '".$sincedate."' ";
5498 5498
 			} else {
5499 5499
 				$query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
@@ -5502,7 +5502,7 @@  discard block
 block discarded – undo
5502 5502
 
5503 5503
 		// if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
5504 5504
 		//if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
5505
-                $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";
5505
+				$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";
5506 5506
 		if ($limit) $query .= " LIMIT 10 OFFSET 0";
5507 5507
 		
5508 5508
 		$sth = $this->db->prepare($query);
@@ -5534,35 +5534,35 @@  discard block
 block discarded – undo
5534 5534
 	
5535 5535
 	
5536 5536
 	/**
5537
-	* Gets all departure airports of the airplanes that have flown over
5538
-	*
5539
-	* @return Array the airport list
5540
-	*
5541
-	*/
5537
+	 * Gets all departure airports of the airplanes that have flown over
5538
+	 *
5539
+	 * @return Array the airport list
5540
+	 *
5541
+	 */
5542 5542
 	public function countAllDepartureAirports($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array())
5543 5543
 	{
5544 5544
 		global $globalDBdriver;
5545 5545
 		$filter_query = $this->getFilter($filters,true,true);
5546 5546
 		$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 
5547 5547
 				FROM spotter_output".$filter_query." spotter_output.departure_airport_name <> '' AND spotter_output.departure_airport_icao <> 'NA'";
5548
-                if ($olderthanmonths > 0) {
5549
-            		if ($globalDBdriver == 'mysql') {
5548
+				if ($olderthanmonths > 0) {
5549
+					if ($globalDBdriver == 'mysql') {
5550 5550
 				$query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)';
5551 5551
 			} else {
5552 5552
 				$query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'";
5553 5553
 			}
5554
-                }
5555
-                if ($sincedate != '') {
5556
-            		if ($globalDBdriver == 'mysql') {
5554
+				}
5555
+				if ($sincedate != '') {
5556
+					if ($globalDBdriver == 'mysql') {
5557 5557
 				$query .= " AND spotter_output.date > '".$sincedate."'";
5558 5558
 			} else {
5559 5559
 				$query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
5560 5560
 			}
5561 5561
 		}
5562 5562
 
5563
-            	//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
5564
-                //if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
5565
-                $query .= " GROUP BY spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country
5563
+				//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
5564
+				//if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
5565
+				$query .= " GROUP BY spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country
5566 5566
 				ORDER BY airport_departure_icao_count DESC";
5567 5567
 		if ($limit) $query .= " LIMIT 10 OFFSET 0";
5568 5568
       
@@ -5586,35 +5586,35 @@  discard block
 block discarded – undo
5586 5586
 	}
5587 5587
 
5588 5588
 	/**
5589
-	* Gets all departure airports of the airplanes that have flown over
5590
-	*
5591
-	* @return Array the airport list
5592
-	*
5593
-	*/
5589
+	 * Gets all departure airports of the airplanes that have flown over
5590
+	 *
5591
+	 * @return Array the airport list
5592
+	 *
5593
+	 */
5594 5594
 	public function countAllDepartureAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array())
5595 5595
 	{
5596 5596
 		global $globalDBdriver;
5597 5597
 		$filter_query = $this->getFilter($filters,true,true);
5598 5598
 		$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 
5599 5599
 			FROM spotter_output".$filter_query." spotter_output.airline_icao <> '' AND spotter_output.departure_airport_name <> '' AND spotter_output.departure_airport_icao <> 'NA' ";
5600
-                if ($olderthanmonths > 0) {
5601
-            		if ($globalDBdriver == 'mysql') {
5600
+				if ($olderthanmonths > 0) {
5601
+					if ($globalDBdriver == 'mysql') {
5602 5602
 				$query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) ';
5603 5603
 			} else {
5604 5604
 				$query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' ";
5605 5605
 			}
5606
-                }
5607
-                if ($sincedate != '') {
5608
-            		if ($globalDBdriver == 'mysql') {
5606
+				}
5607
+				if ($sincedate != '') {
5608
+					if ($globalDBdriver == 'mysql') {
5609 5609
 				$query .= "AND spotter_output.date > '".$sincedate."' ";
5610 5610
 			} else {
5611 5611
 				$query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
5612 5612
 			}
5613 5613
 		}
5614 5614
 
5615
-            	//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
5616
-                //if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
5617
-                $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
5615
+				//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
5616
+				//if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
5617
+				$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
5618 5618
 				ORDER BY airport_departure_icao_count DESC";
5619 5619
 		if ($limit) $query .= " LIMIT 10 OFFSET 0";
5620 5620
       
@@ -5639,37 +5639,37 @@  discard block
 block discarded – undo
5639 5639
 	}
5640 5640
 
5641 5641
 	/**
5642
-	* Gets all detected departure airports of the airplanes that have flown over
5643
-	*
5644
-	* @return Array the airport list
5645
-	*
5646
-	*/
5642
+	 * Gets all detected departure airports of the airplanes that have flown over
5643
+	 *
5644
+	 * @return Array the airport list
5645
+	 *
5646
+	 */
5647 5647
 	public function countAllDetectedDepartureAirports($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array())
5648 5648
 	{
5649 5649
 		global $globalDBdriver;
5650 5650
 		$filter_query = $this->getFilter($filters,true,true);
5651 5651
 		$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
5652 5652
 				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";
5653
-                if ($olderthanmonths > 0) {
5654
-            		if ($globalDBdriver == 'mysql') {
5653
+				if ($olderthanmonths > 0) {
5654
+					if ($globalDBdriver == 'mysql') {
5655 5655
 				$query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)';
5656 5656
 			} else {
5657 5657
 				$query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'";
5658 5658
 			}
5659
-                }
5660
-                if ($sincedate != '') {
5661
-            		if ($globalDBdriver == 'mysql') {
5659
+				}
5660
+				if ($sincedate != '') {
5661
+					if ($globalDBdriver == 'mysql') {
5662 5662
 				$query .= " AND spotter_output.date > '".$sincedate."'";
5663 5663
 			} else {
5664 5664
 				$query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
5665 5665
 			}
5666 5666
 		}
5667
-            	//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
5668
-                //if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
5669
-                $query .= " GROUP BY spotter_output.real_departure_airport_icao, airport.name, airport.city, airport.country
5667
+				//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
5668
+				//if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
5669
+				$query .= " GROUP BY spotter_output.real_departure_airport_icao, airport.name, airport.city, airport.country
5670 5670
 				ORDER BY airport_departure_icao_count DESC";
5671 5671
 		if ($limit) $query .= " LIMIT 10 OFFSET 0";
5672
-    		//echo $query;
5672
+			//echo $query;
5673 5673
 		$sth = $this->db->prepare($query);
5674 5674
 		$sth->execute();
5675 5675
       
@@ -5690,35 +5690,35 @@  discard block
 block discarded – undo
5690 5690
 	}
5691 5691
 	
5692 5692
 	/**
5693
-	* Gets all detected departure airports of the airplanes that have flown over
5694
-	*
5695
-	* @return Array the airport list
5696
-	*
5697
-	*/
5693
+	 * Gets all detected departure airports of the airplanes that have flown over
5694
+	 *
5695
+	 * @return Array the airport list
5696
+	 *
5697
+	 */
5698 5698
 	public function countAllDetectedDepartureAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array())
5699 5699
 	{
5700 5700
 		global $globalDBdriver;
5701 5701
 		$filter_query = $this->getFilter($filters,true,true);
5702 5702
 		$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
5703 5703
 				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 ";
5704
-                if ($olderthanmonths > 0) {
5705
-            		if ($globalDBdriver == 'mysql') {
5704
+				if ($olderthanmonths > 0) {
5705
+					if ($globalDBdriver == 'mysql') {
5706 5706
 				$query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) ';
5707 5707
 			} else {
5708 5708
 				$query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' ";
5709 5709
 			}
5710
-                }
5711
-                if ($sincedate != '') {
5712
-            		if ($globalDBdriver == 'mysql') {
5710
+				}
5711
+				if ($sincedate != '') {
5712
+					if ($globalDBdriver == 'mysql') {
5713 5713
 				$query .= "AND spotter_output.date > '".$sincedate."' ";
5714 5714
 			} else {
5715 5715
 				$query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP) ";
5716 5716
 			}
5717 5717
 		}
5718 5718
 
5719
-            	//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
5720
-                //if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
5721
-                $query .= "GROUP BY spotter_output.airline_icao, spotter_output.real_departure_airport_icao, airport.name, airport.city, airport.country
5719
+				//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
5720
+				//if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
5721
+				$query .= "GROUP BY spotter_output.airline_icao, spotter_output.real_departure_airport_icao, airport.name, airport.city, airport.country
5722 5722
 				ORDER BY airport_departure_icao_count DESC";
5723 5723
 		if ($limit) $query .= " LIMIT 10 OFFSET 0";
5724 5724
       
@@ -5743,11 +5743,11 @@  discard block
 block discarded – undo
5743 5743
 	}	
5744 5744
 	
5745 5745
 	/**
5746
-	* Gets all departure airports of the airplanes that have flown over based on an airline icao
5747
-	*
5748
-	* @return Array the airport list
5749
-	*
5750
-	*/
5746
+	 * Gets all departure airports of the airplanes that have flown over based on an airline icao
5747
+	 *
5748
+	 * @return Array the airport list
5749
+	 *
5750
+	 */
5751 5751
 	public function countAllDepartureAirportsByAirline($airline_icao,$filters = array())
5752 5752
 	{
5753 5753
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5781,11 +5781,11 @@  discard block
 block discarded – undo
5781 5781
 	
5782 5782
 	
5783 5783
 	/**
5784
-	* Gets all departure airports by country of the airplanes that have flown over based on an airline icao
5785
-	*
5786
-	* @return Array the airport list
5787
-	*
5788
-	*/
5784
+	 * Gets all departure airports by country of the airplanes that have flown over based on an airline icao
5785
+	 *
5786
+	 * @return Array the airport list
5787
+	 *
5788
+	 */
5789 5789
 	public function countAllDepartureAirportCountriesByAirline($airline_icao,$filters = array())
5790 5790
 	{
5791 5791
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5816,11 +5816,11 @@  discard block
 block discarded – undo
5816 5816
 	
5817 5817
 	
5818 5818
 	/**
5819
-	* Gets all departure airports of the airplanes that have flown over based on an aircraft icao
5820
-	*
5821
-	* @return Array the airport list
5822
-	*
5823
-	*/
5819
+	 * Gets all departure airports of the airplanes that have flown over based on an aircraft icao
5820
+	 *
5821
+	 * @return Array the airport list
5822
+	 *
5823
+	 */
5824 5824
 	public function countAllDepartureAirportsByAircraft($aircraft_icao,$filters = array())
5825 5825
 	{
5826 5826
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5853,11 +5853,11 @@  discard block
 block discarded – undo
5853 5853
 	
5854 5854
 	
5855 5855
 	/**
5856
-	* Gets all departure airports by country of the airplanes that have flown over based on an aircraft icao
5857
-	*
5858
-	* @return Array the airport list
5859
-	*
5860
-	*/
5856
+	 * Gets all departure airports by country of the airplanes that have flown over based on an aircraft icao
5857
+	 *
5858
+	 * @return Array the airport list
5859
+	 *
5860
+	 */
5861 5861
 	public function countAllDepartureAirportCountriesByAircraft($aircraft_icao,$filters = array())
5862 5862
 	{
5863 5863
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5887,11 +5887,11 @@  discard block
 block discarded – undo
5887 5887
 	
5888 5888
 	
5889 5889
 	/**
5890
-	* Gets all departure airports of the airplanes that have flown over based on an aircraft registration
5891
-	*
5892
-	* @return Array the airport list
5893
-	*
5894
-	*/
5890
+	 * Gets all departure airports of the airplanes that have flown over based on an aircraft registration
5891
+	 *
5892
+	 * @return Array the airport list
5893
+	 *
5894
+	 */
5895 5895
 	public function countAllDepartureAirportsByRegistration($registration,$filters = array())
5896 5896
 	{
5897 5897
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5924,11 +5924,11 @@  discard block
 block discarded – undo
5924 5924
 	
5925 5925
 	
5926 5926
 	/**
5927
-	* Gets all departure airports by country of the airplanes that have flown over based on an aircraft registration
5928
-	*
5929
-	* @return Array the airport list
5930
-	*
5931
-	*/
5927
+	 * Gets all departure airports by country of the airplanes that have flown over based on an aircraft registration
5928
+	 *
5929
+	 * @return Array the airport list
5930
+	 *
5931
+	 */
5932 5932
 	public function countAllDepartureAirportCountriesByRegistration($registration,$filters = array())
5933 5933
 	{
5934 5934
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5958,11 +5958,11 @@  discard block
 block discarded – undo
5958 5958
 	
5959 5959
 	
5960 5960
 	/**
5961
-	* Gets all departure airports of the airplanes that have flown over based on an arrivl airport icao
5962
-	*
5963
-	* @return Array the airport list
5964
-	*
5965
-	*/
5961
+	 * Gets all departure airports of the airplanes that have flown over based on an arrivl airport icao
5962
+	 *
5963
+	 * @return Array the airport list
5964
+	 *
5965
+	 */
5966 5966
 	public function countAllDepartureAirportsByAirport($airport_icao,$filters = array())
5967 5967
 	{
5968 5968
 		$filter_query = $this->getFilter($filters,true,true);
@@ -5995,11 +5995,11 @@  discard block
 block discarded – undo
5995 5995
 	
5996 5996
 	
5997 5997
 	/**
5998
-	* Gets all departure airports by country of the airplanes that have flown over based on an airport icao
5999
-	*
6000
-	* @return Array the airport list
6001
-	*
6002
-	*/
5998
+	 * Gets all departure airports by country of the airplanes that have flown over based on an airport icao
5999
+	 *
6000
+	 * @return Array the airport list
6001
+	 *
6002
+	 */
6003 6003
 	public function countAllDepartureAirportCountriesByAirport($airport_icao,$filters = array())
6004 6004
 	{
6005 6005
 		$filter_query = $this->getFilter($filters,true,true);
@@ -6030,11 +6030,11 @@  discard block
 block discarded – undo
6030 6030
 	
6031 6031
 	
6032 6032
 	/**
6033
-	* Gets all departure airports of the airplanes that have flown over based on an aircraft manufacturer
6034
-	*
6035
-	* @return Array the airport list
6036
-	*
6037
-	*/
6033
+	 * Gets all departure airports of the airplanes that have flown over based on an aircraft manufacturer
6034
+	 *
6035
+	 * @return Array the airport list
6036
+	 *
6037
+	 */
6038 6038
 	public function countAllDepartureAirportsByManufacturer($aircraft_manufacturer,$filters = array())
6039 6039
 	{
6040 6040
 		$filter_query = $this->getFilter($filters,true,true);
@@ -6067,11 +6067,11 @@  discard block
 block discarded – undo
6067 6067
 	
6068 6068
 	
6069 6069
 	/**
6070
-	* Gets all departure airports by country of the airplanes that have flown over based on an aircraft manufacturer
6071
-	*
6072
-	* @return Array the airport list
6073
-	*
6074
-	*/
6070
+	 * Gets all departure airports by country of the airplanes that have flown over based on an aircraft manufacturer
6071
+	 *
6072
+	 * @return Array the airport list
6073
+	 *
6074
+	 */
6075 6075
 	public function countAllDepartureAirportCountriesByManufacturer($aircraft_manufacturer,$filters = array())
6076 6076
 	{
6077 6077
 		$filter_query = $this->getFilter($filters,true,true);
@@ -6101,11 +6101,11 @@  discard block
 block discarded – undo
6101 6101
 	
6102 6102
 	
6103 6103
 	/**
6104
-	* Gets all departure airports of the airplanes that have flown over based on a date
6105
-	*
6106
-	* @return Array the airport list
6107
-	*
6108
-	*/
6104
+	 * Gets all departure airports of the airplanes that have flown over based on a date
6105
+	 *
6106
+	 * @return Array the airport list
6107
+	 *
6108
+	 */
6109 6109
 	public function countAllDepartureAirportsByDate($date,$filters = array())
6110 6110
 	{
6111 6111
 		global $globalTimezone, $globalDBdriver;
@@ -6151,11 +6151,11 @@  discard block
 block discarded – undo
6151 6151
 	
6152 6152
 	
6153 6153
 	/**
6154
-	* Gets all departure airports by country of the airplanes that have flown over based on a date
6155
-	*
6156
-	* @return Array the airport list
6157
-	*
6158
-	*/
6154
+	 * Gets all departure airports by country of the airplanes that have flown over based on a date
6155
+	 *
6156
+	 * @return Array the airport list
6157
+	 *
6158
+	 */
6159 6159
 	public function countAllDepartureAirportCountriesByDate($date,$filters = array())
6160 6160
 	{
6161 6161
 		global $globalTimezone, $globalDBdriver;
@@ -6198,11 +6198,11 @@  discard block
 block discarded – undo
6198 6198
 	
6199 6199
 	
6200 6200
 	/**
6201
-	* Gets all departure airports of the airplanes that have flown over based on a ident/callsign
6202
-	*
6203
-	* @return Array the airport list
6204
-	*
6205
-	*/
6201
+	 * Gets all departure airports of the airplanes that have flown over based on a ident/callsign
6202
+	 *
6203
+	 * @return Array the airport list
6204
+	 *
6205
+	 */
6206 6206
 	public function countAllDepartureAirportsByIdent($ident,$filters = array())
6207 6207
 	{
6208 6208
 		$filter_query = $this->getFilter($filters,true,true);
@@ -6236,11 +6236,11 @@  discard block
 block discarded – undo
6236 6236
 	
6237 6237
 	
6238 6238
 	/**
6239
-	* Gets all departure airports by country of the airplanes that have flown over based on a callsign/ident
6240
-	*
6241
-	* @return Array the airport list
6242
-	*
6243
-	*/
6239
+	 * Gets all departure airports by country of the airplanes that have flown over based on a callsign/ident
6240
+	 *
6241
+	 * @return Array the airport list
6242
+	 *
6243
+	 */
6244 6244
 	public function countAllDepartureAirportCountriesByIdent($ident,$filters = array())
6245 6245
 	{
6246 6246
 		$filter_query = $this->getFilter($filters,true,true);
@@ -6271,11 +6271,11 @@  discard block
 block discarded – undo
6271 6271
 	
6272 6272
 	
6273 6273
 	/**
6274
-	* Gets all departure airports of the airplanes that have flown over based on a country
6275
-	*
6276
-	* @return Array the airport list
6277
-	*
6278
-	*/
6274
+	 * Gets all departure airports of the airplanes that have flown over based on a country
6275
+	 *
6276
+	 * @return Array the airport list
6277
+	 *
6278
+	 */
6279 6279
 	public function countAllDepartureAirportsByCountry($country,$filters = array())
6280 6280
 	{
6281 6281
 		$filter_query = $this->getFilter($filters,true,true);
@@ -6309,11 +6309,11 @@  discard block
 block discarded – undo
6309 6309
 
6310 6310
 
6311 6311
 	/**
6312
-	* Gets all departure airports by country of the airplanes that have flown over based on an aircraft icao
6313
-	*
6314
-	* @return Array the airport list
6315
-	*
6316
-	*/
6312
+	 * Gets all departure airports by country of the airplanes that have flown over based on an aircraft icao
6313
+	 *
6314
+	 * @return Array the airport list
6315
+	 *
6316
+	 */
6317 6317
 	public function countAllDepartureAirportCountriesByCountry($country,$filters = array())
6318 6318
 	{
6319 6319
 		$filter_query = $this->getFilter($filters,true,true);
@@ -6343,40 +6343,40 @@  discard block
 block discarded – undo
6343 6343
 	
6344 6344
 
6345 6345
 	/**
6346
-	* Gets all arrival airports of the airplanes that have flown over
6347
-	*
6348
-	* @return Array the airport list
6349
-	*
6350
-	*/
6346
+	 * Gets all arrival airports of the airplanes that have flown over
6347
+	 *
6348
+	 * @return Array the airport list
6349
+	 *
6350
+	 */
6351 6351
 	public function countAllArrivalAirports($limit = true, $olderthanmonths = 0, $sincedate = '', $icaoaskey = false,$filters = array())
6352 6352
 	{
6353 6353
 		global $globalDBdriver;
6354 6354
 		$filter_query = $this->getFilter($filters,true,true);
6355 6355
 		$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 
6356 6356
 				FROM spotter_output".$filter_query." spotter_output.arrival_airport_name <> '' AND spotter_output.arrival_airport_icao <> 'NA'";
6357
-                if ($olderthanmonths > 0) {
6358
-            		if ($globalDBdriver == 'mysql') {
6357
+				if ($olderthanmonths > 0) {
6358
+					if ($globalDBdriver == 'mysql') {
6359 6359
 				$query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)';
6360 6360
 			} else {
6361 6361
 				$query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'";
6362 6362
 			}
6363
-                if ($sincedate != '') {
6364
-            		if ($globalDBdriver == 'mysql') {
6363
+				if ($sincedate != '') {
6364
+					if ($globalDBdriver == 'mysql') {
6365 6365
 				$query .= " AND spotter_output.date > '".$sincedate."'";
6366 6366
 			} else {
6367 6367
 				$query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
6368 6368
 			}
6369 6369
 		}
6370
-            		if ($globalDBdriver == 'mysql') {
6370
+					if ($globalDBdriver == 'mysql') {
6371 6371
 				$query .= " AND spotter_output.date > '".$sincedate."'";
6372 6372
 			} else {
6373 6373
 				$query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
6374 6374
 			}
6375 6375
 		}
6376 6376
 
6377
-            	//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
6378
-                //if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
6379
-                $query .= " GROUP BY spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country
6377
+				//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
6378
+				//if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
6379
+				$query .= " GROUP BY spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country
6380 6380
 					ORDER BY airport_arrival_icao_count DESC";
6381 6381
 		if ($limit) $query .= " LIMIT 10";
6382 6382
       
@@ -6405,40 +6405,40 @@  discard block
 block discarded – undo
6405 6405
 	}
6406 6406
 
6407 6407
 	/**
6408
-	* Gets all arrival airports of the airplanes that have flown over
6409
-	*
6410
-	* @return Array the airport list
6411
-	*
6412
-	*/
6408
+	 * Gets all arrival airports of the airplanes that have flown over
6409
+	 *
6410
+	 * @return Array the airport list
6411
+	 *
6412
+	 */
6413 6413
 	public function countAllArrivalAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '', $icaoaskey = false,$filters = array())
6414 6414
 	{
6415 6415
 		global $globalDBdriver;
6416 6416
 		$filter_query = $this->getFilter($filters,true,true);
6417 6417
 		$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 
6418 6418
 			FROM spotter_output".$filter_query." spotter_output.airline_icao <> '' AND spotter_output.arrival_airport_name <> '' AND spotter_output.arrival_airport_icao <> 'NA' ";
6419
-                if ($olderthanmonths > 0) {
6420
-            		if ($globalDBdriver == 'mysql') {
6419
+				if ($olderthanmonths > 0) {
6420
+					if ($globalDBdriver == 'mysql') {
6421 6421
 				$query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) ';
6422 6422
 			} else {
6423 6423
 				$query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' ";
6424 6424
 			}
6425
-                if ($sincedate != '') {
6426
-            		if ($globalDBdriver == 'mysql') {
6425
+				if ($sincedate != '') {
6426
+					if ($globalDBdriver == 'mysql') {
6427 6427
 				$query .= "AND spotter_output.date > '".$sincedate."' ";
6428 6428
 			} else {
6429 6429
 				$query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
6430 6430
 			}
6431 6431
 		}
6432
-            		if ($globalDBdriver == 'mysql') {
6432
+					if ($globalDBdriver == 'mysql') {
6433 6433
 				$query .= "AND spotter_output.date > '".$sincedate."' ";
6434 6434
 			} else {
6435 6435
 				$query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
6436 6436
 			}
6437 6437
 		}
6438 6438
 
6439
-            	//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
6440
-                //if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
6441
-                $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
6439
+				//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
6440
+				//if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
6441
+				$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
6442 6442
 					ORDER BY airport_arrival_icao_count DESC";
6443 6443
 		if ($limit) $query .= " LIMIT 10";
6444 6444
       
@@ -6469,39 +6469,39 @@  discard block
 block discarded – undo
6469 6469
 
6470 6470
 
6471 6471
 	/**
6472
-	* Gets all detected arrival airports of the airplanes that have flown over
6473
-	*
6474
-	* @return Array the airport list
6475
-	*
6476
-	*/
6472
+	 * Gets all detected arrival airports of the airplanes that have flown over
6473
+	 *
6474
+	 * @return Array the airport list
6475
+	 *
6476
+	 */
6477 6477
 	public function countAllDetectedArrivalAirports($limit = true, $olderthanmonths = 0, $sincedate = '',$icaoaskey = false,$filters = array())
6478 6478
 	{
6479 6479
 		global $globalDBdriver;
6480 6480
 		$filter_query = $this->getFilter($filters,true,true);
6481 6481
 		$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 
6482 6482
 			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";
6483
-                if ($olderthanmonths > 0) {
6484
-            		if ($globalDBdriver == 'mysql') {
6483
+				if ($olderthanmonths > 0) {
6484
+					if ($globalDBdriver == 'mysql') {
6485 6485
 				$query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)';
6486 6486
 			} else {
6487 6487
 				$query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'";
6488 6488
 			}
6489
-                if ($sincedate != '') {
6490
-            		if ($globalDBdriver == 'mysql') {
6489
+				if ($sincedate != '') {
6490
+					if ($globalDBdriver == 'mysql') {
6491 6491
 				$query .= " AND spotter_output.date > '".$sincedate."'";
6492 6492
 			} else {
6493 6493
 				$query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
6494 6494
 			}
6495 6495
 		}
6496
-            		if ($globalDBdriver == 'mysql') {
6496
+					if ($globalDBdriver == 'mysql') {
6497 6497
 				$query .= " AND spotter_output.date > '".$sincedate."'";
6498 6498
 			} else {
6499 6499
 				$query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
6500 6500
 			}
6501 6501
 		}
6502
-            	//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
6503
-                //if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
6504
-                $query .= " GROUP BY spotter_output.real_arrival_airport_icao, airport.name, airport.city, airport.country
6502
+				//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
6503
+				//if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
6504
+				$query .= " GROUP BY spotter_output.real_arrival_airport_icao, airport.name, airport.city, airport.country
6505 6505
 					ORDER BY airport_arrival_icao_count DESC";
6506 6506
 		if ($limit) $query .= " LIMIT 10";
6507 6507
       
@@ -6530,40 +6530,40 @@  discard block
 block discarded – undo
6530 6530
 	}
6531 6531
 	
6532 6532
 	/**
6533
-	* Gets all detected arrival airports of the airplanes that have flown over
6534
-	*
6535
-	* @return Array the airport list
6536
-	*
6537
-	*/
6533
+	 * Gets all detected arrival airports of the airplanes that have flown over
6534
+	 *
6535
+	 * @return Array the airport list
6536
+	 *
6537
+	 */
6538 6538
 	public function countAllDetectedArrivalAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '',$icaoaskey = false,$filters = array())
6539 6539
 	{
6540 6540
 		global $globalDBdriver;
6541 6541
 		$filter_query = $this->getFilter($filters,true,true);
6542 6542
 		$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 
6543 6543
 			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 ";
6544
-                if ($olderthanmonths > 0) {
6545
-            		if ($globalDBdriver == 'mysql') {
6544
+				if ($olderthanmonths > 0) {
6545
+					if ($globalDBdriver == 'mysql') {
6546 6546
 				$query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) ';
6547 6547
 			} else {
6548 6548
 				$query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' ";
6549 6549
 			}
6550
-                if ($sincedate != '') {
6551
-            		if ($globalDBdriver == 'mysql') {
6550
+				if ($sincedate != '') {
6551
+					if ($globalDBdriver == 'mysql') {
6552 6552
 				$query .= "AND spotter_output.date > '".$sincedate."' ";
6553 6553
 			} else {
6554 6554
 				$query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
6555 6555
 			}
6556 6556
 		}
6557
-            		if ($globalDBdriver == 'mysql') {
6557
+					if ($globalDBdriver == 'mysql') {
6558 6558
 				$query .= "AND spotter_output.date > '".$sincedate."' ";
6559 6559
 			} else {
6560 6560
 				$query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
6561 6561
 			}
6562 6562
 		}
6563 6563
 
6564
-            	//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
6565
-                //if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
6566
-                $query .= "GROUP BY spotter_output.airline_icao, spotter_output.real_arrival_airport_icao, airport.name, airport.city, airport.country
6564
+				//if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
6565
+				//if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
6566
+				$query .= "GROUP BY spotter_output.airline_icao, spotter_output.real_arrival_airport_icao, airport.name, airport.city, airport.country
6567 6567
 					ORDER BY airport_arrival_icao_count DESC";
6568 6568
 		if ($limit) $query .= " LIMIT 10";
6569 6569
       
@@ -6593,11 +6593,11 @@  discard block
 block discarded – undo
6593 6593
 	}	
6594 6594
 	
6595 6595
 	/**
6596
-	* Gets all arrival airports of the airplanes that have flown over based on an airline icao
6597
-	*
6598
-	* @return Array the airport list
6599
-	*
6600
-	*/
6596
+	 * Gets all arrival airports of the airplanes that have flown over based on an airline icao
6597
+	 *
6598
+	 * @return Array the airport list
6599
+	 *
6600
+	 */
6601 6601
 	public function countAllArrivalAirportsByAirline($airline_icao, $filters = array())
6602 6602
 	{
6603 6603
 		$filter_query = $this->getFilter($filters,true,true);
@@ -6629,11 +6629,11 @@  discard block
 block discarded – undo
6629 6629
 	
6630 6630
 	
6631 6631
 	/**
6632
-	* Gets all arrival airports by country of the airplanes that have flown over based on an airline icao
6633
-	*
6634
-	* @return Array the airport list
6635
-	*
6636
-	*/
6632
+	 * Gets all arrival airports by country of the airplanes that have flown over based on an airline icao
6633
+	 *
6634
+	 * @return Array the airport list
6635
+	 *
6636
+	 */
6637 6637
 	public function countAllArrivalAirportCountriesByAirline($airline_icao,$filters = array())
6638 6638
 	{
6639 6639
 		$filter_query = $this->getFilter($filters,true,true);
@@ -6664,11 +6664,11 @@  discard block
 block discarded – undo
6664 6664
 	
6665 6665
 	
6666 6666
 	/**
6667
-	* Gets all arrival airports of the airplanes that have flown over based on an aircraft icao
6668
-	*
6669
-	* @return Array the airport list
6670
-	*
6671
-	*/
6667
+	 * Gets all arrival airports of the airplanes that have flown over based on an aircraft icao
6668
+	 *
6669
+	 * @return Array the airport list
6670
+	 *
6671
+	 */
6672 6672
 	public function countAllArrivalAirportsByAircraft($aircraft_icao,$filters = array())
6673 6673
 	{
6674 6674
 		$filter_query = $this->getFilter($filters,true,true);
@@ -6702,11 +6702,11 @@  discard block
 block discarded – undo
6702 6702
 	
6703 6703
 	
6704 6704
 	/**
6705
-	* Gets all arrival airports by country of the airplanes that have flown over based on an aircraft icao
6706
-	*
6707
-	* @return Array the airport list
6708
-	*
6709
-	*/
6705
+	 * Gets all arrival airports by country of the airplanes that have flown over based on an aircraft icao
6706
+	 *
6707
+	 * @return Array the airport list
6708
+	 *
6709
+	 */
6710 6710
 	public function countAllArrivalAirportCountriesByAircraft($aircraft_icao,$filters = array())
6711 6711
 	{
6712 6712
 		$filter_query = $this->getFilter($filters,true,true);
@@ -6736,11 +6736,11 @@  discard block
 block discarded – undo
6736 6736
 	
6737 6737
 	
6738 6738
 	/**
6739
-	* Gets all arrival airports of the airplanes that have flown over based on an aircraft registration
6740
-	*
6741
-	* @return Array the airport list
6742
-	*
6743
-	*/
6739
+	 * Gets all arrival airports of the airplanes that have flown over based on an aircraft registration
6740
+	 *
6741
+	 * @return Array the airport list
6742
+	 *
6743
+	 */
6744 6744
 	public function countAllArrivalAirportsByRegistration($registration,$filters = array())
6745 6745
 	{
6746 6746
 		$filter_query = $this->getFilter($filters,true,true);
@@ -6774,11 +6774,11 @@  discard block
 block discarded – undo
6774 6774
 	
6775 6775
 	
6776 6776
 	/**
6777
-	* Gets all arrival airports by country of the airplanes that have flown over based on an aircraft registration
6778
-	*
6779
-	* @return Array the airport list
6780
-	*
6781
-	*/
6777
+	 * Gets all arrival airports by country of the airplanes that have flown over based on an aircraft registration
6778
+	 *
6779
+	 * @return Array the airport list
6780
+	 *
6781
+	 */
6782 6782
 	public function countAllArrivalAirportCountriesByRegistration($registration,$filters = array())
6783 6783
 	{
6784 6784
 		$filter_query = $this->getFilter($filters,true,true);
@@ -6809,11 +6809,11 @@  discard block
 block discarded – undo
6809 6809
 	
6810 6810
 	
6811 6811
 	/**
6812
-	* Gets all arrival airports of the airplanes that have flown over based on an departure airport
6813
-	*
6814
-	* @return Array the airport list
6815
-	*
6816
-	*/
6812
+	 * Gets all arrival airports of the airplanes that have flown over based on an departure airport
6813
+	 *
6814
+	 * @return Array the airport list
6815
+	 *
6816
+	 */
6817 6817
 	public function countAllArrivalAirportsByAirport($airport_icao,$filters = array())
6818 6818
 	{
6819 6819
 		$filter_query = $this->getFilter($filters,true,true);
@@ -6846,11 +6846,11 @@  discard block
 block discarded – undo
6846 6846
 	
6847 6847
 	
6848 6848
 	/**
6849
-	* Gets all arrival airports by country of the airplanes that have flown over based on an airport icao
6850
-	*
6851
-	* @return Array the airport list
6852
-	*
6853
-	*/
6849
+	 * Gets all arrival airports by country of the airplanes that have flown over based on an airport icao
6850
+	 *
6851
+	 * @return Array the airport list
6852
+	 *
6853
+	 */
6854 6854
 	public function countAllArrivalAirportCountriesByAirport($airport_icao,$filters = array())
6855 6855
 	{
6856 6856
 		$filter_query = $this->getFilter($filters,true,true);
@@ -6880,11 +6880,11 @@  discard block
 block discarded – undo
6880 6880
 	
6881 6881
 	
6882 6882
 	/**
6883
-	* Gets all arrival airports of the airplanes that have flown over based on a aircraft manufacturer
6884
-	*
6885
-	* @return Array the airport list
6886
-	*
6887
-	*/
6883
+	 * Gets all arrival airports of the airplanes that have flown over based on a aircraft manufacturer
6884
+	 *
6885
+	 * @return Array the airport list
6886
+	 *
6887
+	 */
6888 6888
 	public function countAllArrivalAirportsByManufacturer($aircraft_manufacturer,$filters = array())
6889 6889
 	{
6890 6890
 		$filter_query = $this->getFilter($filters,true,true);
@@ -6918,11 +6918,11 @@  discard block
 block discarded – undo
6918 6918
 	
6919 6919
 	
6920 6920
 	/**
6921
-	* Gets all arrival airports by country of the airplanes that have flown over based on a aircraft manufacturer
6922
-	*
6923
-	* @return Array the airport list
6924
-	*
6925
-	*/
6921
+	 * Gets all arrival airports by country of the airplanes that have flown over based on a aircraft manufacturer
6922
+	 *
6923
+	 * @return Array the airport list
6924
+	 *
6925
+	 */
6926 6926
 	public function countAllArrivalAirportCountriesByManufacturer($aircraft_manufacturer,$filters = array())
6927 6927
 	{
6928 6928
 		$filter_query = $this->getFilter($filters,true,true);
@@ -6953,11 +6953,11 @@  discard block
 block discarded – undo
6953 6953
 	
6954 6954
 	
6955 6955
 	/**
6956
-	* Gets all arrival airports of the airplanes that have flown over based on a date
6957
-	*
6958
-	* @return Array the airport list
6959
-	*
6960
-	*/
6956
+	 * Gets all arrival airports of the airplanes that have flown over based on a date
6957
+	 *
6958
+	 * @return Array the airport list
6959
+	 *
6960
+	 */
6961 6961
 	public function countAllArrivalAirportsByDate($date,$filters = array())
6962 6962
 	{
6963 6963
 		global $globalTimezone, $globalDBdriver;
@@ -7003,11 +7003,11 @@  discard block
 block discarded – undo
7003 7003
 	
7004 7004
 	
7005 7005
 	/**
7006
-	* Gets all arrival airports by country of the airplanes that have flown over based on a date
7007
-	*
7008
-	* @return Array the airport list
7009
-	*
7010
-	*/
7006
+	 * Gets all arrival airports by country of the airplanes that have flown over based on a date
7007
+	 *
7008
+	 * @return Array the airport list
7009
+	 *
7010
+	 */
7011 7011
 	public function countAllArrivalAirportCountriesByDate($date, $filters = array())
7012 7012
 	{
7013 7013
 		global $globalTimezone, $globalDBdriver;
@@ -7050,11 +7050,11 @@  discard block
 block discarded – undo
7050 7050
 	
7051 7051
 	
7052 7052
 	/**
7053
-	* Gets all arrival airports of the airplanes that have flown over based on a ident/callsign
7054
-	*
7055
-	* @return Array the airport list
7056
-	*
7057
-	*/
7053
+	 * Gets all arrival airports of the airplanes that have flown over based on a ident/callsign
7054
+	 *
7055
+	 * @return Array the airport list
7056
+	 *
7057
+	 */
7058 7058
 	public function countAllArrivalAirportsByIdent($ident,$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 arrival 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 arrival 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 countAllArrivalAirportCountriesByIdent($ident, $filters = array())
7096 7096
 	{
7097 7097
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7122,11 +7122,11 @@  discard block
 block discarded – undo
7122 7122
 	
7123 7123
 	
7124 7124
 	/**
7125
-	* Gets all arrival airports of the airplanes that have flown over based on a country
7126
-	*
7127
-	* @return Array the airport list
7128
-	*
7129
-	*/
7125
+	 * Gets all arrival airports of the airplanes that have flown over based on a country
7126
+	 *
7127
+	 * @return Array the airport list
7128
+	 *
7129
+	 */
7130 7130
 	public function countAllArrivalAirportsByCountry($country,$filters = array())
7131 7131
 	{
7132 7132
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7159,11 +7159,11 @@  discard block
 block discarded – undo
7159 7159
 	
7160 7160
 	
7161 7161
 	/**
7162
-	* Gets all arrival airports by country of the airplanes that have flown over based on a country
7163
-	*
7164
-	* @return Array the airport list
7165
-	*
7166
-	*/
7162
+	 * Gets all arrival airports by country of the airplanes that have flown over based on a country
7163
+	 *
7164
+	 * @return Array the airport list
7165
+	 *
7166
+	 */
7167 7167
 	public function countAllArrivalAirportCountriesByCountry($country,$filters = array())
7168 7168
 	{
7169 7169
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7194,11 +7194,11 @@  discard block
 block discarded – undo
7194 7194
 
7195 7195
 
7196 7196
 	/**
7197
-	* Counts all airport departure countries
7198
-	*
7199
-	* @return Array the airport departure list
7200
-	*
7201
-	*/
7197
+	 * Counts all airport departure countries
7198
+	 *
7199
+	 * @return Array the airport departure list
7200
+	 *
7201
+	 */
7202 7202
 	public function countAllDepartureCountries($filters = array())
7203 7203
 	{
7204 7204
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7228,11 +7228,11 @@  discard block
 block discarded – undo
7228 7228
 	
7229 7229
 	
7230 7230
 	/**
7231
-	* Counts all airport arrival countries
7232
-	*
7233
-	* @return Array the airport arrival list
7234
-	*
7235
-	*/
7231
+	 * Counts all airport arrival countries
7232
+	 *
7233
+	 * @return Array the airport arrival list
7234
+	 *
7235
+	 */
7236 7236
 	public function countAllArrivalCountries($limit = true,$filters = array())
7237 7237
 	{
7238 7238
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7265,11 +7265,11 @@  discard block
 block discarded – undo
7265 7265
 
7266 7266
 
7267 7267
 	/**
7268
-	* Gets all route combinations
7269
-	*
7270
-	* @return Array the route list
7271
-	*
7272
-	*/
7268
+	 * Gets all route combinations
7269
+	 *
7270
+	 * @return Array the route list
7271
+	 *
7272
+	 */
7273 7273
 	public function countAllRoutes($filters = array())
7274 7274
 	{
7275 7275
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7308,11 +7308,11 @@  discard block
 block discarded – undo
7308 7308
 	
7309 7309
 	
7310 7310
 	/**
7311
-	* Gets all route combinations based on an aircraft
7312
-	*
7313
-	* @return Array the route list
7314
-	*
7315
-	*/
7311
+	 * Gets all route combinations based on an aircraft
7312
+	 *
7313
+	 * @return Array the route list
7314
+	 *
7315
+	 */
7316 7316
 	public function countAllRoutesByAircraft($aircraft_icao,$filters = array())
7317 7317
 	{
7318 7318
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7348,11 +7348,11 @@  discard block
 block discarded – undo
7348 7348
 	
7349 7349
 	
7350 7350
 	/**
7351
-	* Gets all route combinations based on an aircraft registration
7352
-	*
7353
-	* @return Array the route list
7354
-	*
7355
-	*/
7351
+	 * Gets all route combinations based on an aircraft registration
7352
+	 *
7353
+	 * @return Array the route list
7354
+	 *
7355
+	 */
7356 7356
 	public function countAllRoutesByRegistration($registration, $filters = array())
7357 7357
 	{
7358 7358
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7390,11 +7390,11 @@  discard block
 block discarded – undo
7390 7390
 	
7391 7391
 	
7392 7392
 	/**
7393
-	* Gets all route combinations based on an airline
7394
-	*
7395
-	* @return Array the route list
7396
-	*
7397
-	*/
7393
+	 * Gets all route combinations based on an airline
7394
+	 *
7395
+	 * @return Array the route list
7396
+	 *
7397
+	 */
7398 7398
 	public function countAllRoutesByAirline($airline_icao, $filters = array())
7399 7399
 	{
7400 7400
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7432,11 +7432,11 @@  discard block
 block discarded – undo
7432 7432
 	
7433 7433
 	
7434 7434
 	/**
7435
-	* Gets all route combinations based on an airport
7436
-	*
7437
-	* @return Array the route list
7438
-	*
7439
-	*/
7435
+	 * Gets all route combinations based on an airport
7436
+	 *
7437
+	 * @return Array the route list
7438
+	 *
7439
+	 */
7440 7440
 	public function countAllRoutesByAirport($airport_icao, $filters = array())
7441 7441
 	{
7442 7442
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7473,11 +7473,11 @@  discard block
 block discarded – undo
7473 7473
 	
7474 7474
 	
7475 7475
 	/**
7476
-	* Gets all route combinations based on an country
7477
-	*
7478
-	* @return Array the route list
7479
-	*
7480
-	*/
7476
+	 * Gets all route combinations based on an country
7477
+	 *
7478
+	 * @return Array the route list
7479
+	 *
7480
+	 */
7481 7481
 	public function countAllRoutesByCountry($country, $filters = array())
7482 7482
 	{
7483 7483
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7513,11 +7513,11 @@  discard block
 block discarded – undo
7513 7513
 
7514 7514
 
7515 7515
 	/**
7516
-	* Gets all route combinations based on an date
7517
-	*
7518
-	* @return Array the route list
7519
-	*
7520
-	*/
7516
+	 * Gets all route combinations based on an date
7517
+	 *
7518
+	 * @return Array the route list
7519
+	 *
7520
+	 */
7521 7521
 	public function countAllRoutesByDate($date, $filters = array())
7522 7522
 	{
7523 7523
 		global $globalTimezone, $globalDBdriver;
@@ -7567,11 +7567,11 @@  discard block
 block discarded – undo
7567 7567
 	
7568 7568
 	
7569 7569
 	/**
7570
-	* Gets all route combinations based on an ident/callsign
7571
-	*
7572
-	* @return Array the route list
7573
-	*
7574
-	*/
7570
+	 * Gets all route combinations based on an ident/callsign
7571
+	 *
7572
+	 * @return Array the route list
7573
+	 *
7574
+	 */
7575 7575
 	public function countAllRoutesByIdent($ident, $filters = array())
7576 7576
 	{
7577 7577
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7608,11 +7608,11 @@  discard block
 block discarded – undo
7608 7608
 	
7609 7609
 	
7610 7610
 	/**
7611
-	* Gets all route combinations based on an manufacturer
7612
-	*
7613
-	* @return Array the route list
7614
-	*
7615
-	*/
7611
+	 * Gets all route combinations based on an manufacturer
7612
+	 *
7613
+	 * @return Array the route list
7614
+	 *
7615
+	 */
7616 7616
 	public function countAllRoutesByManufacturer($aircraft_manufacturer, $filters = array())
7617 7617
 	{
7618 7618
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7650,11 +7650,11 @@  discard block
 block discarded – undo
7650 7650
 	
7651 7651
 	
7652 7652
 	/**
7653
-	* Gets all route combinations with waypoints
7654
-	*
7655
-	* @return Array the route list
7656
-	*
7657
-	*/
7653
+	 * Gets all route combinations with waypoints
7654
+	 *
7655
+	 * @return Array the route list
7656
+	 *
7657
+	 */
7658 7658
 	public function countAllRoutesWithWaypoints($filters = array())
7659 7659
 	{
7660 7660
 		$filter_query = $this->getFilter($filters,true,true);
@@ -7691,11 +7691,11 @@  discard block
 block discarded – undo
7691 7691
 	}
7692 7692
 	
7693 7693
 	/**
7694
-	* Gets all callsigns that have flown over
7695
-	*
7696
-	* @return Array the callsign list
7697
-	*
7698
-	*/
7694
+	 * Gets all callsigns that have flown over
7695
+	 *
7696
+	 * @return Array the callsign list
7697
+	 *
7698
+	 */
7699 7699
 	public function countAllCallsigns($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array())
7700 7700
 	{
7701 7701
 		global $globalDBdriver;
@@ -7733,11 +7733,11 @@  discard block
 block discarded – undo
7733 7733
 	}
7734 7734
 
7735 7735
 	/**
7736
-	* Gets all callsigns that have flown over
7737
-	*
7738
-	* @return Array the callsign list
7739
-	*
7740
-	*/
7736
+	 * Gets all callsigns that have flown over
7737
+	 *
7738
+	 * @return Array the callsign list
7739
+	 *
7740
+	 */
7741 7741
 	public function countAllCallsignsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '', $filters = array())
7742 7742
 	{
7743 7743
 		global $globalDBdriver;
@@ -7778,11 +7778,11 @@  discard block
 block discarded – undo
7778 7778
 
7779 7779
 
7780 7780
 	/**
7781
-	* Counts all dates
7782
-	*
7783
-	* @return Array the date list
7784
-	*
7785
-	*/
7781
+	 * Counts all dates
7782
+	 *
7783
+	 * @return Array the date list
7784
+	 *
7785
+	 */
7786 7786
 	public function countAllDates($filters = array())
7787 7787
 	{
7788 7788
 		global $globalTimezone, $globalDBdriver;
@@ -7827,11 +7827,11 @@  discard block
 block discarded – undo
7827 7827
 	}
7828 7828
 	
7829 7829
 	/**
7830
-	* Counts all dates
7831
-	*
7832
-	* @return Array the date list
7833
-	*
7834
-	*/
7830
+	 * Counts all dates
7831
+	 *
7832
+	 * @return Array the date list
7833
+	 *
7834
+	 */
7835 7835
 	public function countAllDatesByAirlines($filters = array())
7836 7836
 	{
7837 7837
 		global $globalTimezone, $globalDBdriver;
@@ -7876,11 +7876,11 @@  discard block
 block discarded – undo
7876 7876
 	}	
7877 7877
 	
7878 7878
 	/**
7879
-	* Counts all dates during the last 7 days
7880
-	*
7881
-	* @return Array the date list
7882
-	*
7883
-	*/
7879
+	 * Counts all dates during the last 7 days
7880
+	 *
7881
+	 * @return Array the date list
7882
+	 *
7883
+	 */
7884 7884
 	public function countAllDatesLast7Days($filters = array())
7885 7885
 	{
7886 7886
 		global $globalTimezone, $globalDBdriver;
@@ -7902,7 +7902,7 @@  discard block
 block discarded – undo
7902 7902
 			$query .= " GROUP BY date_name 
7903 7903
 								ORDER BY date_name ASC";
7904 7904
 			$query_data = array(':offset' => $offset);
7905
-    		}
7905
+			}
7906 7906
 		
7907 7907
 		$sth = $this->db->prepare($query);
7908 7908
 		$sth->execute($query_data);
@@ -7922,11 +7922,11 @@  discard block
 block discarded – undo
7922 7922
 	}
7923 7923
 
7924 7924
 	/**
7925
-	* Counts all dates during the last month
7926
-	*
7927
-	* @return Array the date list
7928
-	*
7929
-	*/
7925
+	 * Counts all dates during the last month
7926
+	 *
7927
+	 * @return Array the date list
7928
+	 *
7929
+	 */
7930 7930
 	public function countAllDatesLastMonth($filters = array())
7931 7931
 	{
7932 7932
 		global $globalTimezone, $globalDBdriver;
@@ -7948,7 +7948,7 @@  discard block
 block discarded – undo
7948 7948
 			$query .= " GROUP BY date_name 
7949 7949
 								ORDER BY date_name ASC";
7950 7950
 			$query_data = array(':offset' => $offset);
7951
-    		}
7951
+			}
7952 7952
 		
7953 7953
 		$sth = $this->db->prepare($query);
7954 7954
 		$sth->execute($query_data);
@@ -7969,11 +7969,11 @@  discard block
 block discarded – undo
7969 7969
 
7970 7970
 
7971 7971
 	/**
7972
-	* Counts all dates during the last month
7973
-	*
7974
-	* @return Array the date list
7975
-	*
7976
-	*/
7972
+	 * Counts all dates during the last month
7973
+	 *
7974
+	 * @return Array the date list
7975
+	 *
7976
+	 */
7977 7977
 	public function countAllDatesLastMonthByAirlines($filters = array())
7978 7978
 	{
7979 7979
 		global $globalTimezone, $globalDBdriver;
@@ -7996,7 +7996,7 @@  discard block
 block discarded – undo
7996 7996
 								GROUP BY spotter_output.airline_icao, date_name 
7997 7997
 								ORDER BY date_name ASC";
7998 7998
 			$query_data = array(':offset' => $offset);
7999
-    		}
7999
+			}
8000 8000
 		
8001 8001
 		$sth = $this->db->prepare($query);
8002 8002
 		$sth->execute($query_data);
@@ -8018,11 +8018,11 @@  discard block
 block discarded – undo
8018 8018
 	
8019 8019
 
8020 8020
 	/**
8021
-	* Counts all month
8022
-	*
8023
-	* @return Array the month list
8024
-	*
8025
-	*/
8021
+	 * Counts all month
8022
+	 *
8023
+	 * @return Array the month list
8024
+	 *
8025
+	 */
8026 8026
 	public function countAllMonths($filters = array())
8027 8027
 	{
8028 8028
 		global $globalTimezone, $globalDBdriver;
@@ -8064,11 +8064,11 @@  discard block
 block discarded – undo
8064 8064
 	}
8065 8065
 
8066 8066
 	/**
8067
-	* Counts all month
8068
-	*
8069
-	* @return Array the month list
8070
-	*
8071
-	*/
8067
+	 * Counts all month
8068
+	 *
8069
+	 * @return Array the month list
8070
+	 *
8071
+	 */
8072 8072
 	public function countAllMonthsByAirlines($filters = array())
8073 8073
 	{
8074 8074
 		global $globalTimezone, $globalDBdriver;
@@ -8113,11 +8113,11 @@  discard block
 block discarded – undo
8113 8113
 	}
8114 8114
 
8115 8115
 	/**
8116
-	* Counts all military month
8117
-	*
8118
-	* @return Array the month list
8119
-	*
8120
-	*/
8116
+	 * Counts all military month
8117
+	 *
8118
+	 * @return Array the month list
8119
+	 *
8120
+	 */
8121 8121
 	public function countAllMilitaryMonths($filters = array())
8122 8122
 	{
8123 8123
 		global $globalTimezone, $globalDBdriver;
@@ -8158,11 +8158,11 @@  discard block
 block discarded – undo
8158 8158
 	}
8159 8159
 	
8160 8160
 	/**
8161
-	* Counts all month owners
8162
-	*
8163
-	* @return Array the month list
8164
-	*
8165
-	*/
8161
+	 * Counts all month owners
8162
+	 *
8163
+	 * @return Array the month list
8164
+	 *
8165
+	 */
8166 8166
 	public function countAllMonthsOwners($filters = array())
8167 8167
 	{
8168 8168
 		global $globalTimezone, $globalDBdriver;
@@ -8204,11 +8204,11 @@  discard block
 block discarded – undo
8204 8204
 	}
8205 8205
 	
8206 8206
 	/**
8207
-	* Counts all month owners
8208
-	*
8209
-	* @return Array the month list
8210
-	*
8211
-	*/
8207
+	 * Counts all month owners
8208
+	 *
8209
+	 * @return Array the month list
8210
+	 *
8211
+	 */
8212 8212
 	public function countAllMonthsOwnersByAirlines($filters = array())
8213 8213
 	{
8214 8214
 		global $globalTimezone, $globalDBdriver;
@@ -8251,11 +8251,11 @@  discard block
 block discarded – undo
8251 8251
 	}
8252 8252
 
8253 8253
 	/**
8254
-	* Counts all month pilot
8255
-	*
8256
-	* @return Array the month list
8257
-	*
8258
-	*/
8254
+	 * Counts all month pilot
8255
+	 *
8256
+	 * @return Array the month list
8257
+	 *
8258
+	 */
8259 8259
 	public function countAllMonthsPilots($filters = array())
8260 8260
 	{
8261 8261
 		global $globalTimezone, $globalDBdriver;
@@ -8297,11 +8297,11 @@  discard block
 block discarded – undo
8297 8297
 	}
8298 8298
 	
8299 8299
 	/**
8300
-	* Counts all month pilot
8301
-	*
8302
-	* @return Array the month list
8303
-	*
8304
-	*/
8300
+	 * Counts all month pilot
8301
+	 *
8302
+	 * @return Array the month list
8303
+	 *
8304
+	 */
8305 8305
 	public function countAllMonthsPilotsByAirlines($filters = array())
8306 8306
 	{
8307 8307
 		global $globalTimezone, $globalDBdriver;
@@ -8344,11 +8344,11 @@  discard block
 block discarded – undo
8344 8344
 	}
8345 8345
 
8346 8346
 	/**
8347
-	* Counts all month airline
8348
-	*
8349
-	* @return Array the month list
8350
-	*
8351
-	*/
8347
+	 * Counts all month airline
8348
+	 *
8349
+	 * @return Array the month list
8350
+	 *
8351
+	 */
8352 8352
 	public function countAllMonthsAirlines($filters = array())
8353 8353
 	{
8354 8354
 		global $globalTimezone, $globalDBdriver;
@@ -8390,11 +8390,11 @@  discard block
 block discarded – undo
8390 8390
 	}
8391 8391
 	
8392 8392
 	/**
8393
-	* Counts all month aircraft
8394
-	*
8395
-	* @return Array the month list
8396
-	*
8397
-	*/
8393
+	 * Counts all month aircraft
8394
+	 *
8395
+	 * @return Array the month list
8396
+	 *
8397
+	 */
8398 8398
 	public function countAllMonthsAircrafts($filters = array())
8399 8399
 	{
8400 8400
 		global $globalTimezone, $globalDBdriver;
@@ -8437,11 +8437,11 @@  discard block
 block discarded – undo
8437 8437
 	
8438 8438
 
8439 8439
 	/**
8440
-	* Counts all month aircraft
8441
-	*
8442
-	* @return Array the month list
8443
-	*
8444
-	*/
8440
+	 * Counts all month aircraft
8441
+	 *
8442
+	 * @return Array the month list
8443
+	 *
8444
+	 */
8445 8445
 	public function countAllMonthsAircraftsByAirlines($filters = array())
8446 8446
 	{
8447 8447
 		global $globalTimezone, $globalDBdriver;
@@ -8484,11 +8484,11 @@  discard block
 block discarded – undo
8484 8484
 	}
8485 8485
 
8486 8486
 	/**
8487
-	* Counts all month real arrival
8488
-	*
8489
-	* @return Array the month list
8490
-	*
8491
-	*/
8487
+	 * Counts all month real arrival
8488
+	 *
8489
+	 * @return Array the month list
8490
+	 *
8491
+	 */
8492 8492
 	public function countAllMonthsRealArrivals($filters = array())
8493 8493
 	{
8494 8494
 		global $globalTimezone, $globalDBdriver;
@@ -8531,11 +8531,11 @@  discard block
 block discarded – undo
8531 8531
 	
8532 8532
 
8533 8533
 	/**
8534
-	* Counts all month real arrival
8535
-	*
8536
-	* @return Array the month list
8537
-	*
8538
-	*/
8534
+	 * Counts all month real arrival
8535
+	 *
8536
+	 * @return Array the month list
8537
+	 *
8538
+	 */
8539 8539
 	public function countAllMonthsRealArrivalsByAirlines($filters = array())
8540 8540
 	{
8541 8541
 		global $globalTimezone, $globalDBdriver;
@@ -8579,11 +8579,11 @@  discard block
 block discarded – undo
8579 8579
 	
8580 8580
 
8581 8581
 	/**
8582
-	* Counts all dates during the last year
8583
-	*
8584
-	* @return Array the date list
8585
-	*
8586
-	*/
8582
+	 * Counts all dates during the last year
8583
+	 *
8584
+	 * @return Array the date list
8585
+	 *
8586
+	 */
8587 8587
 	public function countAllMonthsLastYear($filters)
8588 8588
 	{
8589 8589
 		global $globalTimezone, $globalDBdriver;
@@ -8605,7 +8605,7 @@  discard block
 block discarded – undo
8605 8605
 			$query .= " GROUP BY year_name, month_name
8606 8606
 								ORDER BY year_name, month_name ASC";
8607 8607
 			$query_data = array(':offset' => $offset);
8608
-    		}
8608
+			}
8609 8609
 		
8610 8610
 		$sth = $this->db->prepare($query);
8611 8611
 		$sth->execute($query_data);
@@ -8628,11 +8628,11 @@  discard block
 block discarded – undo
8628 8628
 	
8629 8629
 	
8630 8630
 	/**
8631
-	* Counts all hours
8632
-	*
8633
-	* @return Array the hour list
8634
-	*
8635
-	*/
8631
+	 * Counts all hours
8632
+	 *
8633
+	 * @return Array the hour list
8634
+	 *
8635
+	 */
8636 8636
 	public function countAllHours($orderby,$filters = array())
8637 8637
 	{
8638 8638
 		global $globalTimezone, $globalDBdriver;
@@ -8693,11 +8693,11 @@  discard block
 block discarded – undo
8693 8693
 	}
8694 8694
 	
8695 8695
 	/**
8696
-	* Counts all hours
8697
-	*
8698
-	* @return Array the hour list
8699
-	*
8700
-	*/
8696
+	 * Counts all hours
8697
+	 *
8698
+	 * @return Array the hour list
8699
+	 *
8700
+	 */
8701 8701
 	public function countAllHoursByAirlines($orderby, $filters = array())
8702 8702
 	{
8703 8703
 		global $globalTimezone, $globalDBdriver;
@@ -8760,11 +8760,11 @@  discard block
 block discarded – undo
8760 8760
 
8761 8761
 
8762 8762
 	/**
8763
-	* Counts all hours by airline
8764
-	*
8765
-	* @return Array the hour list
8766
-	*
8767
-	*/
8763
+	 * Counts all hours by airline
8764
+	 *
8765
+	 * @return Array the hour list
8766
+	 *
8767
+	 */
8768 8768
 	public function countAllHoursByAirline($airline_icao, $filters = array())
8769 8769
 	{
8770 8770
 		global $globalTimezone, $globalDBdriver;
@@ -8810,11 +8810,11 @@  discard block
 block discarded – undo
8810 8810
 	
8811 8811
 	
8812 8812
 	/**
8813
-	* Counts all hours by aircraft
8814
-	*
8815
-	* @return Array the hour list
8816
-	*
8817
-	*/
8813
+	 * Counts all hours by aircraft
8814
+	 *
8815
+	 * @return Array the hour list
8816
+	 *
8817
+	 */
8818 8818
 	public function countAllHoursByAircraft($aircraft_icao, $filters = array())
8819 8819
 	{
8820 8820
 		global $globalTimezone, $globalDBdriver;
@@ -8857,11 +8857,11 @@  discard block
 block discarded – undo
8857 8857
 	
8858 8858
 	
8859 8859
 	/**
8860
-	* Counts all hours by aircraft registration
8861
-	*
8862
-	* @return Array the hour list
8863
-	*
8864
-	*/
8860
+	 * Counts all hours by aircraft registration
8861
+	 *
8862
+	 * @return Array the hour list
8863
+	 *
8864
+	 */
8865 8865
 	public function countAllHoursByRegistration($registration, $filters = array())
8866 8866
 	{
8867 8867
 		global $globalTimezone, $globalDBdriver;
@@ -8904,11 +8904,11 @@  discard block
 block discarded – undo
8904 8904
 	
8905 8905
 	
8906 8906
 	/**
8907
-	* Counts all hours by airport
8908
-	*
8909
-	* @return Array the hour list
8910
-	*
8911
-	*/
8907
+	 * Counts all hours by airport
8908
+	 *
8909
+	 * @return Array the hour list
8910
+	 *
8911
+	 */
8912 8912
 	public function countAllHoursByAirport($airport_icao, $filters = array())
8913 8913
 	{
8914 8914
 		global $globalTimezone, $globalDBdriver;
@@ -8952,11 +8952,11 @@  discard block
 block discarded – undo
8952 8952
 	
8953 8953
 	
8954 8954
 	/**
8955
-	* Counts all hours by manufacturer
8956
-	*
8957
-	* @return Array the hour list
8958
-	*
8959
-	*/
8955
+	 * Counts all hours by manufacturer
8956
+	 *
8957
+	 * @return Array the hour list
8958
+	 *
8959
+	 */
8960 8960
 	public function countAllHoursByManufacturer($aircraft_manufacturer,$filters =array())
8961 8961
 	{
8962 8962
 		global $globalTimezone, $globalDBdriver;
@@ -9000,11 +9000,11 @@  discard block
 block discarded – undo
9000 9000
 	
9001 9001
 	
9002 9002
 	/**
9003
-	* Counts all hours by date
9004
-	*
9005
-	* @return Array the hour list
9006
-	*
9007
-	*/
9003
+	 * Counts all hours by date
9004
+	 *
9005
+	 * @return Array the hour list
9006
+	 *
9007
+	 */
9008 9008
 	public function countAllHoursByDate($date, $filters = array())
9009 9009
 	{
9010 9010
 		global $globalTimezone, $globalDBdriver;
@@ -9048,11 +9048,11 @@  discard block
 block discarded – undo
9048 9048
 	
9049 9049
 	
9050 9050
 	/**
9051
-	* Counts all hours by a ident/callsign
9052
-	*
9053
-	* @return Array the hour list
9054
-	*
9055
-	*/
9051
+	 * Counts all hours by a ident/callsign
9052
+	 *
9053
+	 * @return Array the hour list
9054
+	 *
9055
+	 */
9056 9056
 	public function countAllHoursByIdent($ident, $filters = array())
9057 9057
 	{
9058 9058
 		global $globalTimezone, $globalDBdriver;
@@ -9097,11 +9097,11 @@  discard block
 block discarded – undo
9097 9097
 	
9098 9098
 	
9099 9099
 	/**
9100
-	* Counts all hours by route
9101
-	*
9102
-	* @return Array the hour list
9103
-	*
9104
-	*/
9100
+	 * Counts all hours by route
9101
+	 *
9102
+	 * @return Array the hour list
9103
+	 *
9104
+	 */
9105 9105
 	public function countAllHoursByRoute($departure_airport_icao, $arrival_airport_icao, $filters =array())
9106 9106
 	{
9107 9107
 		global $globalTimezone, $globalDBdriver;
@@ -9145,11 +9145,11 @@  discard block
 block discarded – undo
9145 9145
 	
9146 9146
 	
9147 9147
 	/**
9148
-	* Counts all hours by country
9149
-	*
9150
-	* @return Array the hour list
9151
-	*
9152
-	*/
9148
+	 * Counts all hours by country
9149
+	 *
9150
+	 * @return Array the hour list
9151
+	 *
9152
+	 */
9153 9153
 	public function countAllHoursByCountry($country, $filters = array())
9154 9154
 	{
9155 9155
 		global $globalTimezone, $globalDBdriver;
@@ -9194,11 +9194,11 @@  discard block
 block discarded – undo
9194 9194
 
9195 9195
 
9196 9196
 	/**
9197
-	* Counts all aircraft that have flown over
9198
-	*
9199
-	* @return Integer the number of aircrafts
9200
-	*
9201
-	*/
9197
+	 * Counts all aircraft that have flown over
9198
+	 *
9199
+	 * @return Integer the number of aircrafts
9200
+	 *
9201
+	 */
9202 9202
 	public function countOverallAircrafts($filters = array())
9203 9203
 	{
9204 9204
 		$filter_query = $this->getFilter($filters,true,true);
@@ -9210,11 +9210,11 @@  discard block
 block discarded – undo
9210 9210
 	}
9211 9211
 
9212 9212
 	/**
9213
-	* Counts all flight that really arrival
9214
-	*
9215
-	* @return Integer the number of aircrafts
9216
-	*
9217
-	*/
9213
+	 * Counts all flight that really arrival
9214
+	 *
9215
+	 * @return Integer the number of aircrafts
9216
+	 *
9217
+	 */
9218 9218
 	public function countOverallArrival($filters = array())
9219 9219
 	{
9220 9220
 		$filter_query = $this->getFilter($filters,true,true);
@@ -9227,11 +9227,11 @@  discard block
 block discarded – undo
9227 9227
 	}
9228 9228
 
9229 9229
 	/**
9230
-	* Counts all pilots that have flown over
9231
-	*
9232
-	* @return Integer the number of pilots
9233
-	*
9234
-	*/
9230
+	 * Counts all pilots that have flown over
9231
+	 *
9232
+	 * @return Integer the number of pilots
9233
+	 *
9234
+	 */
9235 9235
 	public function countOverallPilots($filters = array())
9236 9236
 	{
9237 9237
 		$filter_query = $this->getFilter($filters,true,true);
@@ -9243,11 +9243,11 @@  discard block
 block discarded – undo
9243 9243
 	}
9244 9244
 
9245 9245
 	/**
9246
-	* Counts all owners that have flown over
9247
-	*
9248
-	* @return Integer the number of owners
9249
-	*
9250
-	*/
9246
+	 * Counts all owners that have flown over
9247
+	 *
9248
+	 * @return Integer the number of owners
9249
+	 *
9250
+	 */
9251 9251
 	public function countOverallOwners($filters = array())
9252 9252
 	{
9253 9253
 		$filter_query = $this->getFilter($filters,true,true);
@@ -9260,11 +9260,11 @@  discard block
 block discarded – undo
9260 9260
 	
9261 9261
 	
9262 9262
 	/**
9263
-	* Counts all flights that have flown over
9264
-	*
9265
-	* @return Integer the number of flights
9266
-	*
9267
-	*/
9263
+	 * Counts all flights that have flown over
9264
+	 *
9265
+	 * @return Integer the number of flights
9266
+	 *
9267
+	 */
9268 9268
 	public function countOverallFlights($filters = array())
9269 9269
 	{
9270 9270
 		$query  = "SELECT COUNT(spotter_output.spotter_id) AS flight_count  
@@ -9277,11 +9277,11 @@  discard block
 block discarded – undo
9277 9277
 	}
9278 9278
 	
9279 9279
 	/**
9280
-	* Counts all military flights that have flown over
9281
-	*
9282
-	* @return Integer the number of flights
9283
-	*
9284
-	*/
9280
+	 * Counts all military flights that have flown over
9281
+	 *
9282
+	 * @return Integer the number of flights
9283
+	 *
9284
+	 */
9285 9285
 	public function countOverallMilitaryFlights($filters = array())
9286 9286
 	{
9287 9287
 		$filter_query = $this->getFilter($filters,true,true);
@@ -9296,11 +9296,11 @@  discard block
 block discarded – undo
9296 9296
 	
9297 9297
 	
9298 9298
 	/**
9299
-	* Counts all airlines that have flown over
9300
-	*
9301
-	* @return Integer the number of airlines
9302
-	*
9303
-	*/
9299
+	 * Counts all airlines that have flown over
9300
+	 *
9301
+	 * @return Integer the number of airlines
9302
+	 *
9303
+	 */
9304 9304
 	public function countOverallAirlines($filters = array())
9305 9305
 	{
9306 9306
 		$query  = "SELECT COUNT(DISTINCT spotter_output.airline_name) AS airline_count 
@@ -9314,11 +9314,11 @@  discard block
 block discarded – undo
9314 9314
 
9315 9315
   
9316 9316
 	/**
9317
-	* Counts all hours of today
9318
-	*
9319
-	* @return Array the hour list
9320
-	*
9321
-	*/
9317
+	 * Counts all hours of today
9318
+	 *
9319
+	 * @return Array the hour list
9320
+	 *
9321
+	 */
9322 9322
 	public function countAllHoursFromToday($filters = array())
9323 9323
 	{
9324 9324
 		global $globalTimezone, $globalDBdriver;
@@ -9358,11 +9358,11 @@  discard block
 block discarded – undo
9358 9358
 	}
9359 9359
     
9360 9360
 	/**
9361
-	* Gets all the spotter information based on calculated upcoming flights
9362
-	*
9363
-	* @return Array the spotter information
9364
-	*
9365
-	*/
9361
+	 * Gets all the spotter information based on calculated upcoming flights
9362
+	 *
9363
+	 * @return Array the spotter information
9364
+	 *
9365
+	 */
9366 9366
 	public function getUpcomingFlights($limit = '', $sort = '', $filters = array())
9367 9367
 	{
9368 9368
 		global $global_query, $globalDBdriver, $globalTimezone;
@@ -9437,12 +9437,12 @@  discard block
 block discarded – undo
9437 9437
 	}
9438 9438
     
9439 9439
     
9440
-     /**
9441
-	* Gets the Barrie Spotter ID based on the FlightAware ID
9442
-	*
9443
-	* @return Integer the Barrie Spotter ID
9440
+	 /**
9441
+	  * Gets the Barrie Spotter ID based on the FlightAware ID
9442
+	  *
9443
+	  * @return Integer the Barrie Spotter ID
9444 9444
 q	*
9445
-	*/
9445
+	  */
9446 9446
 	public function getSpotterIDBasedOnFlightAwareID($flightaware_id)
9447 9447
 	{
9448 9448
 		$flightaware_id = filter_var($flightaware_id,FILTER_SANITIZE_STRING);
@@ -9463,13 +9463,13 @@  discard block
 block discarded – undo
9463 9463
   
9464 9464
  
9465 9465
 	/**
9466
-	* Parses a date string
9467
-	*
9468
-	* @param String $dateString the date string
9469
-	* @param String $timezone the timezone of a user
9470
-	* @return Array the time information
9471
-	*
9472
-	*/
9466
+	 * Parses a date string
9467
+	 *
9468
+	 * @param String $dateString the date string
9469
+	 * @param String $timezone the timezone of a user
9470
+	 * @return Array the time information
9471
+	 *
9472
+	 */
9473 9473
 	public function parseDateString($dateString, $timezone = '')
9474 9474
 	{
9475 9475
 		$time_array = array();
@@ -9505,12 +9505,12 @@  discard block
 block discarded – undo
9505 9505
 	
9506 9506
 	
9507 9507
 	/**
9508
-	* Parses the direction degrees to working
9509
-	*
9510
-	* @param Float $direction the direction in degrees
9511
-	* @return Array the direction information
9512
-	*
9513
-	*/
9508
+	 * Parses the direction degrees to working
9509
+	 *
9510
+	 * @param Float $direction the direction in degrees
9511
+	 * @return Array the direction information
9512
+	 *
9513
+	 */
9514 9514
 	public function parseDirection($direction = 0)
9515 9515
 	{
9516 9516
 		if ($direction == '') $direction = 0;
@@ -9589,12 +9589,12 @@  discard block
 block discarded – undo
9589 9589
 	
9590 9590
 	
9591 9591
 	/**
9592
-	* Gets the aircraft registration
9593
-	*
9594
-	* @param String $flightaware_id the flight aware id
9595
-	* @return String the aircraft registration
9596
-	*
9597
-	*/
9592
+	 * Gets the aircraft registration
9593
+	 *
9594
+	 * @param String $flightaware_id the flight aware id
9595
+	 * @return String the aircraft registration
9596
+	 *
9597
+	 */
9598 9598
 	
9599 9599
 	public function getAircraftRegistration($flightaware_id)
9600 9600
 	{
@@ -9623,12 +9623,12 @@  discard block
 block discarded – undo
9623 9623
 
9624 9624
 
9625 9625
 	/**
9626
-	* Gets the aircraft registration from ModeS
9627
-	*
9628
-	* @param String $aircraft_modes the flight ModeS in hex
9629
-	* @return String the aircraft registration
9630
-	*
9631
-	*/
9626
+	 * Gets the aircraft registration from ModeS
9627
+	 *
9628
+	 * @param String $aircraft_modes the flight ModeS in hex
9629
+	 * @return String the aircraft registration
9630
+	 *
9631
+	 */
9632 9632
 	public function getAircraftRegistrationBymodeS($aircraft_modes)
9633 9633
 	{
9634 9634
 		$aircraft_modes = filter_var($aircraft_modes,FILTER_SANITIZE_STRING);
@@ -9641,19 +9641,19 @@  discard block
 block discarded – undo
9641 9641
 		$row = $sth->fetch(PDO::FETCH_ASSOC);
9642 9642
 		$sth->closeCursor();
9643 9643
 		if (count($row) > 0) {
9644
-		    //return $row['Registration'];
9645
-		    return $row['registration'];
9644
+			//return $row['Registration'];
9645
+			return $row['registration'];
9646 9646
 		} else return '';
9647 9647
 	
9648 9648
 	}
9649 9649
 
9650 9650
 	/**
9651
-	* Gets the aircraft type from ModeS
9652
-	*
9653
-	* @param String $aircraft_modes the flight ModeS in hex
9654
-	* @return String the aircraft type
9655
-	*
9656
-	*/
9651
+	 * Gets the aircraft type from ModeS
9652
+	 *
9653
+	 * @param String $aircraft_modes the flight ModeS in hex
9654
+	 * @return String the aircraft type
9655
+	 *
9656
+	 */
9657 9657
 	public function getAircraftTypeBymodeS($aircraft_modes)
9658 9658
 	{
9659 9659
 		$aircraft_modes = filter_var($aircraft_modes,FILTER_SANITIZE_STRING);
@@ -9666,19 +9666,19 @@  discard block
 block discarded – undo
9666 9666
 		$row = $sth->fetch(PDO::FETCH_ASSOC);
9667 9667
 		$sth->closeCursor();
9668 9668
 		if (count($row) > 0) {
9669
-		    if ($row['type_flight'] == null) return '';
9670
-		    else return $row['type_flight'];
9669
+			if ($row['type_flight'] == null) return '';
9670
+			else return $row['type_flight'];
9671 9671
 		} else return '';
9672 9672
 	
9673 9673
 	}
9674 9674
 
9675 9675
 	/**
9676
-	* Gets Countrie from latitude/longitude
9677
-	*
9678
-	* @param Float $latitude latitute of the flight
9679
-	* @param Float $longitude longitute of the flight
9680
-	* @return String the countrie
9681
-	*/
9676
+	 * Gets Countrie from latitude/longitude
9677
+	 *
9678
+	 * @param Float $latitude latitute of the flight
9679
+	 * @param Float $longitude longitute of the flight
9680
+	 * @return String the countrie
9681
+	 */
9682 9682
 	public function getCountryFromLatitudeLongitude($latitude,$longitude)
9683 9683
 	{
9684 9684
 		global $globalDBdriver, $globalDebug;
@@ -9715,12 +9715,12 @@  discard block
 block discarded – undo
9715 9715
 	}
9716 9716
 
9717 9717
 	/**
9718
-	* converts the registration code using the country prefix
9719
-	*
9720
-	* @param String $registration the aircraft registration
9721
-	* @return String the aircraft registration
9722
-	*
9723
-	*/
9718
+	 * converts the registration code using the country prefix
9719
+	 *
9720
+	 * @param String $registration the aircraft registration
9721
+	 * @return String the aircraft registration
9722
+	 *
9723
+	 */
9724 9724
 	public function convertAircraftRegistration($registration)
9725 9725
 	{
9726 9726
 		$registration = filter_var($registration,FILTER_SANITIZE_STRING);
@@ -9772,12 +9772,12 @@  discard block
 block discarded – undo
9772 9772
 	}
9773 9773
 
9774 9774
 	/**
9775
-	* Country from the registration code
9776
-	*
9777
-	* @param String $registration the aircraft registration
9778
-	* @return String the country
9779
-	*
9780
-	*/
9775
+	 * Country from the registration code
9776
+	 *
9777
+	 * @param String $registration the aircraft registration
9778
+	 * @return String the country
9779
+	 *
9780
+	 */
9781 9781
 	public function countryFromAircraftRegistration($registration)
9782 9782
 	{
9783 9783
 		$registration = filter_var($registration,FILTER_SANITIZE_STRING);
@@ -9796,8 +9796,8 @@  discard block
 block discarded – undo
9796 9796
 				$country = $row['country'];
9797 9797
 			}
9798 9798
 		} else {
9799
-    			$registration_1 = substr($registration, 0, 1);
9800
-		        $registration_2 = substr($registration, 0, 2);
9799
+				$registration_1 = substr($registration, 0, 1);
9800
+				$registration_2 = substr($registration, 0, 2);
9801 9801
 
9802 9802
 			$country = '';
9803 9803
 			//first get the prefix based on two characters
@@ -9833,11 +9833,11 @@  discard block
 block discarded – undo
9833 9833
 	}
9834 9834
 	
9835 9835
 	/**
9836
-	* Set a new highlight value for a flight
9837
-	*
9838
-	* @param String $flightaware_id flightaware_id from spotter_output table
9839
-	* @param String $highlight New highlight value
9840
-	*/
9836
+	 * Set a new highlight value for a flight
9837
+	 *
9838
+	 * @param String $flightaware_id flightaware_id from spotter_output table
9839
+	 * @param String $highlight New highlight value
9840
+	 */
9841 9841
 	public function setHighlightFlight($flightaware_id,$highlight) {
9842 9842
 		
9843 9843
 		$query  = "UPDATE spotter_output SET highlight = :highlight WHERE flightaware_id = :flightaware_id";
@@ -9846,12 +9846,12 @@  discard block
 block discarded – undo
9846 9846
 	}
9847 9847
 	
9848 9848
 	/**
9849
-	* Gets the short url from bit.ly
9850
-	*
9851
-	* @param String $url the full url
9852
-	* @return String the bit.ly url
9853
-	*
9854
-	*/
9849
+	 * Gets the short url from bit.ly
9850
+	 *
9851
+	 * @param String $url the full url
9852
+	 * @return String the bit.ly url
9853
+	 *
9854
+	 */
9855 9855
 	public function getBitlyURL($url)
9856 9856
 	{
9857 9857
 		global $globalBitlyAccessToken;
@@ -10140,11 +10140,11 @@  discard block
 block discarded – undo
10140 10140
 			$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 
10141 10141
 	                      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)) 
10142 10142
 	                      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;";
10143
-                } else {
10143
+				} else {
10144 10144
 			$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 
10145 10145
 	                      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)) 
10146 10146
 	                      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;";
10147
-    		}
10147
+			}
10148 10148
 		$sth = $this->db->prepare($query);
10149 10149
 		$sth->execute();
10150 10150
 		return $sth->fetchAll(PDO::FETCH_ASSOC);
Please login to merge, or discard this patch.
statistics.php 1 patch
Indentation   +222 added lines, -222 removed lines patch added patch discarded remove patch
@@ -39,11 +39,11 @@  discard block
 block discarded – undo
39 39
 		if (isset($globalTimezone) && $globalTimezone != '') date_default_timezone_set($globalTimezone);
40 40
 		print '<i>Last update: '.date('Y-m-d G:i:s',$lastupdate).'</i>';
41 41
 	}
42
-    ?>
42
+	?>
43 43
     </div>
44 44
     <?php    
45 45
 	// print_r($Stats->getAllAirlineNames()); 
46
-    ?>
46
+	?>
47 47
     <?php include('statistics-sub-menu.php'); ?>
48 48
     <p class="global-stats">
49 49
         <span><span class="badge"><?php print number_format($Stats->countOverallFlights($airline_icao,$filter_name)); ?></span> <?php echo _("Flights"); ?></span>
@@ -51,23 +51,23 @@  discard block
 block discarded – undo
51 51
         <span><span class="badge"><?php print number_format($Stats->countOverallArrival($airline_icao,$filter_name)); ?></span> <?php echo _("Arrivals seen"); ?></span>
52 52
         <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
53 53
 	<?php
54
-	    if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) {
54
+		if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) {
55 55
 	?>
56 56
     	    <span><span class="badge"><?php print number_format($Stats->countOverallPilots($airline_icao,$filter_name)); ?></span> <?php echo _("Pilots"); ?></span>
57 57
 	    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
58 58
         <?php
59
-    	    } else {
60
-    	?>
59
+			} else {
60
+		?>
61 61
     	    <span><span class="badge"><?php print number_format($Stats->countOverallOwners($airline_icao,$filter_name)); ?></span> <?php echo _("Owners"); ?></span>
62 62
 	    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
63 63
     	<?php
64
-    	    }
65
-    	?>
64
+			}
65
+		?>
66 66
         <span><span class="badge"><?php print number_format($Stats->countOverallAircrafts($airline_icao,$filter_name)); ?></span> <?php echo _("Aircrafts"); ?></span>
67 67
         <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
68 68
         <?php
69
-    		if ($airline_icao == '') {
70
-    	?>
69
+			if ($airline_icao == '') {
70
+		?>
71 71
         <span><span class="badge"><?php print number_format($Stats->countOverallAirlines($filter_name)); ?></span> <?php echo _("Airlines"); ?></span>
72 72
 	<!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
73 73
 	<?php
@@ -88,25 +88,25 @@  discard block
 block discarded – undo
88 88
             <div class="col-md-6">
89 89
                 <h2><?php echo _("Top 10 Most Common Aircraft Type"); ?></h2>
90 90
                  <?php
91
-                  $aircraft_array = $Stats->countAllAircraftTypes(true,$airline_icao,$filter_name);
92
-		    if (count($aircraft_array) == 0) print _("No data available");
93
-		    else {
91
+				  $aircraft_array = $Stats->countAllAircraftTypes(true,$airline_icao,$filter_name);
92
+			if (count($aircraft_array) == 0) print _("No data available");
93
+			else {
94 94
 
95
-                    print '<div id="chart1" class="chart" width="100%"></div>
95
+					print '<div id="chart1" class="chart" width="100%"></div>
96 96
                     <script> 
97 97
                         google.load("visualization", "1", {packages:["corechart"]});
98 98
                       google.setOnLoadCallback(drawChart1);
99 99
                       function drawChart1() {
100 100
                         var data = google.visualization.arrayToDataTable([
101 101
                             ["'._("Aircraft").'", "'._("# of times").'"], ';
102
-                            $aircraft_data = '';
103
-                          foreach($aircraft_array as $aircraft_item)
104
-                                    {
105
-                                            $aircraft_data .= '[ "'.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],';
106
-                                    }
107
-                                    $aircraft_data = substr($aircraft_data, 0, -1);
108
-                                    print $aircraft_data;
109
-                        print ']);
102
+							$aircraft_data = '';
103
+						  foreach($aircraft_array as $aircraft_item)
104
+									{
105
+											$aircraft_data .= '[ "'.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],';
106
+									}
107
+									$aircraft_data = substr($aircraft_data, 0, -1);
108
+									print $aircraft_data;
109
+						print ']);
110 110
 
111 111
                         var options = {
112 112
                             chartArea: {"width": "80%", "height": "60%"},
@@ -121,8 +121,8 @@  discard block
 block discarded – undo
121 121
                               drawChart1();
122 122
                             });
123 123
                   </script>';
124
-                  }
125
-                  ?>
124
+				  }
125
+				  ?>
126 126
                 <div class="more">
127 127
                     <a href="<?php print $globalURL; ?>/statistics/aircraft" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
128 128
                 </div>
@@ -130,27 +130,27 @@  discard block
 block discarded – undo
130 130
     <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
131 131
 <?php
132 132
 //    echo $airline_icao;
133
-    if ($airline_icao == '' || $airline_icao == 'all') {
133
+	if ($airline_icao == '' || $airline_icao == 'all') {
134 134
 	$airline_array = $Stats->countAllAirlines(true,$filter_name);
135 135
 	if (count($airline_array) == 0) print _("No data available");
136 136
 	else {
137
-            print '<div class="col-md-6">';
138
-	    print '<h2>'._("Top 10 Most Common Airline").'</h2>';
139
-	    print '<div id="chart2" class="chart" width="100%"></div>
137
+			print '<div class="col-md-6">';
138
+		print '<h2>'._("Top 10 Most Common Airline").'</h2>';
139
+		print '<div id="chart2" class="chart" width="100%"></div>
140 140
                     <script> 
141 141
                         google.load("visualization", "1", {packages:["corechart"]});
142 142
                       google.setOnLoadCallback(drawChart2);
143 143
                       function drawChart2() {
144 144
                         var data = google.visualization.arrayToDataTable([
145 145
                             ["'._("Airline").'", "'._("# of times").'"], ';
146
-	    $airline_data = '';
147
-	    foreach($airline_array as $airline_item)
148
-	    {
146
+		$airline_data = '';
147
+		foreach($airline_array as $airline_item)
148
+		{
149 149
 		$airline_data .= '[ "'.$airline_item['airline_name'].' ('.$airline_item['airline_icao'].')",'.$airline_item['airline_count'].'],';
150
-	    }
151
-	    $airline_data = substr($airline_data, 0, -1);
152
-	    print $airline_data;
153
-	    print ']);
150
+		}
151
+		$airline_data = substr($airline_data, 0, -1);
152
+		print $airline_data;
153
+		print ']);
154 154
 
155 155
                         var options = {
156 156
                             chartArea: {"width": "80%", "height": "60%"},
@@ -165,51 +165,51 @@  discard block
 block discarded – undo
165 165
                               drawChart2();
166 166
                             });
167 167
                   </script>';
168
-	    print '<div class="more"><a href="'.$globalURL.'/statistics/airline" class="btn btn-default btn" role="button">'._("See full statistic").'&raquo;</a></div>';
169
-    	    print '</div>';
168
+		print '<div class="more"><a href="'.$globalURL.'/statistics/airline" class="btn btn-default btn" role="button">'._("See full statistic").'&raquo;</a></div>';
169
+			print '</div>';
170 170
 	}
171 171
 ?>
172 172
         </div>
173 173
     <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
174 174
 <?php
175
-    }
175
+	}
176 176
 ?>
177 177
         <div class="row column">
178 178
 
179 179
 	    <?php
180
-                 $flightover_array = $Stats->countAllFlightOverCountries($airline_icao,$filter_name);
180
+				 $flightover_array = $Stats->countAllFlightOverCountries($airline_icao,$filter_name);
181 181
 		if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) {
182
-		    if (empty($flightover_array)) {
183
-	    ?>
182
+			if (empty($flightover_array)) {
183
+		?>
184 184
             <div class="col-md-12">
185 185
             <?php
186
-        	    } else {
187
-            ?>
186
+				} else {
187
+			?>
188 188
             <div class="col-md-6">
189 189
             <?php
190
-            	    }
191
-            ?>
190
+					}
191
+			?>
192 192
                 <h2><?php echo _("Top 10 Most Common Pilots"); ?></h2>
193 193
                  <?php
194
-                  $pilot_array = $Stats->countAllPilots(true,$airline_icao,$filter_name);
195
-		    if (count($pilot_array) == 0) print _("No data available");
196
-		    else {
194
+				  $pilot_array = $Stats->countAllPilots(true,$airline_icao,$filter_name);
195
+			if (count($pilot_array) == 0) print _("No data available");
196
+			else {
197 197
 
198
-                  print '<div id="chart7" class="chart" width="100%"></div>
198
+				  print '<div id="chart7" class="chart" width="100%"></div>
199 199
                     <script> 
200 200
                         google.load("visualization", "1", {packages:["corechart"]});
201 201
                       google.setOnLoadCallback(drawChart7);
202 202
                       function drawChart7() {
203 203
                         var data = google.visualization.arrayToDataTable([
204 204
                             ["'._("Pilots").'", "'._("# of times").'"], ';
205
-                            $pilot_data = '';
206
-                          foreach($pilot_array as $pilot_item)
207
-                                    {
208
-                                            $pilot_data .= '[ "'.$pilot_item['pilot_name'].' ('.$pilot_item['pilot_id'].')",'.$pilot_item['pilot_count'].'],';
209
-                                    }
210
-                                    $pilot_data = substr($pilot_data, 0, -1);
211
-                                    print $pilot_data;
212
-                        print ']);
205
+							$pilot_data = '';
206
+						  foreach($pilot_array as $pilot_item)
207
+									{
208
+											$pilot_data .= '[ "'.$pilot_item['pilot_name'].' ('.$pilot_item['pilot_id'].')",'.$pilot_item['pilot_count'].'],';
209
+									}
210
+									$pilot_data = substr($pilot_data, 0, -1);
211
+									print $pilot_data;
212
+						print ']);
213 213
 
214 214
                         var options = {
215 215
                             chartArea: {"width": "80%", "height": "60%"},
@@ -224,8 +224,8 @@  discard block
 block discarded – undo
224 224
                               drawChart7();
225 225
                             });
226 226
                   </script>';
227
-                  }
228
-                  ?>
227
+				  }
228
+				  ?>
229 229
                 <div class="more">
230 230
                     <a href="<?php print $globalURL; ?>/statistics/pilot" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
231 231
                 </div>
@@ -233,30 +233,30 @@  discard block
 block discarded – undo
233 233
         
234 234
     <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
235 235
         <?php
236
-    	    } else {
237
-    	?>
236
+			} else {
237
+		?>
238 238
             <div class="col-md-6">
239 239
                 <h2><?php echo _("Top 10 Most Common Owners"); ?></h2>
240 240
                  <?php
241
-                  $owner_array = $Stats->countAllOwners(true,$airline_icao,$filter_name);
242
-		    if (count($owner_array) == 0) print _("No data available");
243
-		    else {
241
+				  $owner_array = $Stats->countAllOwners(true,$airline_icao,$filter_name);
242
+			if (count($owner_array) == 0) print _("No data available");
243
+			else {
244 244
 
245
-                  print '<div id="chart7" class="chart" width="100%"></div>
245
+				  print '<div id="chart7" class="chart" width="100%"></div>
246 246
                     <script> 
247 247
                         google.load("visualization", "1", {packages:["corechart"]});
248 248
                       google.setOnLoadCallback(drawChart7);
249 249
                       function drawChart7() {
250 250
                         var data = google.visualization.arrayToDataTable([
251 251
                             ["'._("Owner").'", "'._("# of times").'"], ';
252
-                            $owner_data = '';
253
-                          foreach($owner_array as $owner_item)
254
-                                    {
255
-                                            $owner_data .= '[ "'.$owner_item['owner_name'].'",'.$owner_item['owner_count'].'],';
256
-                                    }
257
-                                    $owner_data = substr($owner_data, 0, -1);
258
-                                    print $owner_data;
259
-                        print ']);
252
+							$owner_data = '';
253
+						  foreach($owner_array as $owner_item)
254
+									{
255
+											$owner_data .= '[ "'.$owner_item['owner_name'].'",'.$owner_item['owner_count'].'],';
256
+									}
257
+									$owner_data = substr($owner_data, 0, -1);
258
+									print $owner_data;
259
+						print ']);
260 260
 
261 261
                         var options = {
262 262
                             chartArea: {"width": "80%", "height": "60%"},
@@ -271,8 +271,8 @@  discard block
 block discarded – undo
271 271
                               drawChart7();
272 272
                             });
273 273
                   </script>';
274
-                  }
275
-                  ?>
274
+				  }
275
+				  ?>
276 276
                 <div class="more">
277 277
                     <a href="<?php print $globalURL; ?>/statistics/owner" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
278 278
                 </div>
@@ -280,32 +280,32 @@  discard block
 block discarded – undo
280 280
         
281 281
     <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
282 282
         <?php
283
-    	    }
284
-    	    if (!empty($flightover_array)) {
285
-    	?>
283
+			}
284
+			if (!empty($flightover_array)) {
285
+		?>
286 286
     	
287 287
             <div class="col-md-6">
288 288
                 <h2><?php echo _("Top 20 Most Common Country a Flight was Over"); ?></h2>
289 289
                  <?php
290
-                  //$flightover_array = $Stats->countAllFlightOverCountries();
291
-		    if (count($flightover_array) == 0) print _("No data available");
292
-		    else {
290
+				  //$flightover_array = $Stats->countAllFlightOverCountries();
291
+			if (count($flightover_array) == 0) print _("No data available");
292
+			else {
293 293
 
294
-                  print '<div id="chart10" class="chart" width="100%"></div>
294
+				  print '<div id="chart10" class="chart" width="100%"></div>
295 295
                     <script> 
296 296
                         google.load("visualization", "1", {packages:["corechart"]});
297 297
                       google.setOnLoadCallback(drawChart10);
298 298
                       function drawChart10() {
299 299
                         var data = google.visualization.arrayToDataTable([
300 300
                             ["'._("Country").'", "'._("# of times").'"], ';
301
-                            $flightover_data = '';
302
-                          foreach($flightover_array as $flightover_item)
303
-                                    {
304
-                                            $flightover_data .= '[ "'.$flightover_item['flight_country'].' ('.$flightover_item['flight_country_iso2'].')",'.$flightover_item['flight_count'].'],';
305
-                                    }
306
-                                    $flightover_data = substr($flightover_data, 0, -1);
307
-                                    print $flightover_data;
308
-                        print ']);
301
+							$flightover_data = '';
302
+						  foreach($flightover_array as $flightover_item)
303
+									{
304
+											$flightover_data .= '[ "'.$flightover_item['flight_country'].' ('.$flightover_item['flight_country_iso2'].')",'.$flightover_item['flight_count'].'],';
305
+									}
306
+									$flightover_data = substr($flightover_data, 0, -1);
307
+									print $flightover_data;
308
+						print ']);
309 309
 
310 310
                         var options = {
311 311
                             chartArea: {"width": "80%", "height": "60%"},
@@ -322,15 +322,15 @@  discard block
 block discarded – undo
322 322
                               drawChart10();
323 323
                             });
324 324
                   </script>';
325
-                  }
326
-                  ?>
325
+				  }
326
+				  ?>
327 327
                 <div class="more">
328 328
                     <a href="<?php print $globalURL; ?>/statistics/country" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
329 329
                 </div>
330 330
             </div>
331 331
         <?php
332
-            }
333
-        ?>
332
+			}
333
+		?>
334 334
         </div>
335 335
     <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
336 336
 
@@ -340,11 +340,11 @@  discard block
 block discarded – undo
340 340
             <div class="col-md-6">
341 341
                 <h2><?php echo _("Top 10 Most Common Departure Airports"); ?></h2>
342 342
                 <?php
343
-                $airport_airport_array = $Stats->countAllDepartureAirports(true,$airline_icao,$filter_name);
344
-		    if (count($airport_airport_array) == 0) print _("No data available");
345
-		    else {
343
+				$airport_airport_array = $Stats->countAllDepartureAirports(true,$airline_icao,$filter_name);
344
+			if (count($airport_airport_array) == 0) print _("No data available");
345
+			else {
346 346
 
347
-                 print '<div id="chart3" class="chart" width="100%"></div>
347
+				 print '<div id="chart3" class="chart" width="100%"></div>
348 348
                 <script>
349 349
                 google.load("visualization", "1", {packages:["geochart"]});
350 350
                 google.setOnLoadCallback(drawCharts3);
@@ -355,17 +355,17 @@  discard block
 block discarded – undo
355 355
 
356 356
                 var data = google.visualization.arrayToDataTable([ 
357 357
                     ["'._("Airport").'", "'._("# of times").'"],';
358
-                    $airport_data = '';
359
-                  foreach($airport_airport_array as $airport_item)
360
-                        {
361
-                            $name = $airport_item['airport_departure_city'].', '.$airport_item['airport_departure_country'].' ('.$airport_item['airport_departure_icao'].')';
362
-                            $name = str_replace("'", "", $name);
363
-                            $name = str_replace('"', "", $name);
364
-                            $airport_data .= '[ "'.$name.'",'.$airport_item['airport_departure_icao_count'].'],';
365
-                        }
366
-                        $airport_data = substr($airport_data, 0, -1);
367
-                        print $airport_data;
368
-                print ']);
358
+					$airport_data = '';
359
+				  foreach($airport_airport_array as $airport_item)
360
+						{
361
+							$name = $airport_item['airport_departure_city'].', '.$airport_item['airport_departure_country'].' ('.$airport_item['airport_departure_icao'].')';
362
+							$name = str_replace("'", "", $name);
363
+							$name = str_replace('"', "", $name);
364
+							$airport_data .= '[ "'.$name.'",'.$airport_item['airport_departure_icao_count'].'],';
365
+						}
366
+						$airport_data = substr($airport_data, 0, -1);
367
+						print $airport_data;
368
+				print ']);
369 369
 
370 370
                 var options = {
371 371
                     legend: {position: "none"},
@@ -379,8 +379,8 @@  discard block
 block discarded – undo
379 379
                 chart.draw(data, options);
380 380
               }
381 381
                 </script>';
382
-                }
383
-              ?>
382
+				}
383
+			  ?>
384 384
               <div class="more">
385 385
                 <a href="<?php print $globalURL; ?>/statistics/airport-departure" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
386 386
               </div>
@@ -390,11 +390,11 @@  discard block
 block discarded – undo
390 390
             <div class="col-md-6">
391 391
                 <h2><?php echo _("Top 10 Most Common Arrival Airports"); ?></h2>
392 392
                 <?php
393
-                $airport_airport_array2 = $Stats->countAllArrivalAirports(true,$airline_icao,$filter_name);
394
-		    if (count($airport_airport_array2) == 0) print _("No data available");
395
-		    else {
393
+				$airport_airport_array2 = $Stats->countAllArrivalAirports(true,$airline_icao,$filter_name);
394
+			if (count($airport_airport_array2) == 0) print _("No data available");
395
+			else {
396 396
 
397
-                print '<div id="chart4" class="chart" width="100%"></div>
397
+				print '<div id="chart4" class="chart" width="100%"></div>
398 398
                 <script>
399 399
                 google.load("visualization", "1", {packages:["geochart"]});
400 400
                 google.setOnLoadCallback(drawCharts4);
@@ -405,17 +405,17 @@  discard block
 block discarded – undo
405 405
 
406 406
                 var data = google.visualization.arrayToDataTable([ 
407 407
                     ["'._("Airport").'", "'._("# of times").'"],';
408
-                    $airport_data2 = '';
409
-                  foreach($airport_airport_array2 as $airport_item2)
410
-                        {
411
-                            $name2 = $airport_item2['airport_arrival_city'].', '.$airport_item2['airport_arrival_country'].' ('.$airport_item2['airport_arrival_icao'].')';
412
-                            $name2 = str_replace("'", "", $name2);
413
-                            $name2 = str_replace('"', "", $name2);
414
-                            $airport_data2 .= '[ "'.$name2.'",'.$airport_item2['airport_arrival_icao_count'].'],';
415
-                        }
416
-                        $airport_data2 = substr($airport_data2, 0, -1);
417
-                        print $airport_data2;
418
-                print ']);
408
+					$airport_data2 = '';
409
+				  foreach($airport_airport_array2 as $airport_item2)
410
+						{
411
+							$name2 = $airport_item2['airport_arrival_city'].', '.$airport_item2['airport_arrival_country'].' ('.$airport_item2['airport_arrival_icao'].')';
412
+							$name2 = str_replace("'", "", $name2);
413
+							$name2 = str_replace('"', "", $name2);
414
+							$airport_data2 .= '[ "'.$name2.'",'.$airport_item2['airport_arrival_icao_count'].'],';
415
+						}
416
+						$airport_data2 = substr($airport_data2, 0, -1);
417
+						print $airport_data2;
418
+				print ']);
419 419
 
420 420
                 var options = {
421 421
                     legend: {position: "none"},
@@ -429,8 +429,8 @@  discard block
 block discarded – undo
429 429
                 chart.draw(data, options);
430 430
               }
431 431
                 </script>';
432
-                }
433
-              ?>
432
+				}
433
+			  ?>
434 434
               <div class="more">
435 435
                 <a href="<?php print $globalURL; ?>/statistics/airport-arrival" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
436 436
               </div>
@@ -442,24 +442,24 @@  discard block
 block discarded – undo
442 442
             <div class="col-md-6">
443 443
                 <h2><?php echo _("Busiest Months of the last 12 Months"); ?></h2>
444 444
                 <?php
445
-                  $year_array = $Stats->countAllMonthsLastYear(true,$airline_icao,$filter_name);
446
-		    if (count($year_array) == 0) print _("No data available");
447
-		    else {
448
-                  print '<div id="chart8" class="chart" width="100%"></div>
445
+				  $year_array = $Stats->countAllMonthsLastYear(true,$airline_icao,$filter_name);
446
+			if (count($year_array) == 0) print _("No data available");
447
+			else {
448
+				  print '<div id="chart8" class="chart" width="100%"></div>
449 449
                     <script> 
450 450
                         google.load("visualization", "1", {packages:["corechart"]});
451 451
                       google.setOnLoadCallback(drawChart8);
452 452
                       function drawChart8() {
453 453
                         var data = google.visualization.arrayToDataTable([
454 454
                             ["'._("Month").'", "'._("# of Flights").'"], ';
455
-                            $year_data = '';
456
-                          foreach($year_array as $year_item)
457
-                                    {
458
-                                        $year_data .= '[ "'.date('F, Y',strtotime($year_item['year_name'].'-'.$year_item['month_name'].'-01')).'",'.$year_item['date_count'].'],';
459
-                                    }
460
-                                    $year_data = substr($year_data, 0, -1);
461
-                                    print $year_data;
462
-                        print ']);
455
+							$year_data = '';
456
+						  foreach($year_array as $year_item)
457
+									{
458
+										$year_data .= '[ "'.date('F, Y',strtotime($year_item['year_name'].'-'.$year_item['month_name'].'-01')).'",'.$year_item['date_count'].'],';
459
+									}
460
+									$year_data = substr($year_data, 0, -1);
461
+									print $year_data;
462
+						print ']);
463 463
 
464 464
                         var options = {
465 465
                             legend: {position: "none"},
@@ -477,8 +477,8 @@  discard block
 block discarded – undo
477 477
                               drawChart8();
478 478
                             });
479 479
                   </script>';
480
-                  }
481
-                  ?>
480
+				  }
481
+				  ?>
482 482
                 <div class="more">
483 483
                     <a href="<?php print $globalURL; ?>/statistics/year" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
484 484
                 </div>
@@ -488,24 +488,24 @@  discard block
 block discarded – undo
488 488
             <div class="col-md-6">
489 489
                 <h2><?php echo _("Busiest Day in the last Month"); ?></h2>
490 490
                 <?php
491
-                  $month_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name);
492
-		    if (count($month_array) == 0) print _("No data available");
493
-		    else {
494
-                  print '<div id="chart9" class="chart" width="100%"></div>
491
+				  $month_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name);
492
+			if (count($month_array) == 0) print _("No data available");
493
+			else {
494
+				  print '<div id="chart9" class="chart" width="100%"></div>
495 495
                     <script> 
496 496
                         google.load("visualization", "1", {packages:["corechart"]});
497 497
                       google.setOnLoadCallback(drawChart9);
498 498
                       function drawChart9() {
499 499
                         var data = google.visualization.arrayToDataTable([
500 500
                             ["'._("Day").'", "'._("# of Flights").'"], ';
501
-                            $month_data = '';
502
-                          foreach($month_array as $month_item)
503
-                                    {
504
-                                        $month_data .= '[ "'.date('F j, Y',strtotime($month_item['date_name'])).'",'.$month_item['date_count'].'],';
505
-                                    }
506
-                                    $month_data = substr($month_data, 0, -1);
507
-                                    print $month_data;
508
-                        print ']);
501
+							$month_data = '';
502
+						  foreach($month_array as $month_item)
503
+									{
504
+										$month_data .= '[ "'.date('F j, Y',strtotime($month_item['date_name'])).'",'.$month_item['date_count'].'],';
505
+									}
506
+									$month_data = substr($month_data, 0, -1);
507
+									print $month_data;
508
+						print ']);
509 509
 
510 510
                         var options = {
511 511
                             legend: {position: "none"},
@@ -523,8 +523,8 @@  discard block
 block discarded – undo
523 523
                               drawChart9();
524 524
                             });
525 525
                   </script>';
526
-                  }
527
-                  ?>
526
+				  }
527
+				  ?>
528 528
                 <div class="more">
529 529
                     <a href="<?php print $globalURL; ?>/statistics/month" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
530 530
                 </div>
@@ -534,25 +534,25 @@  discard block
 block discarded – undo
534 534
             <div class="col-md-6">
535 535
                 <h2><?php echo _("Busiest Day in the last 7 Days"); ?></h2>
536 536
                 <?php
537
-                    $date_array = $Stats->countAllDatesLast7Days($airline_icao,$filter_name);
538
-		    if (empty($date_array)) print _("No data available");
539
-		    else {
540
-                  print '<div id="chart5" class="chart" width="100%"></div>
537
+					$date_array = $Stats->countAllDatesLast7Days($airline_icao,$filter_name);
538
+			if (empty($date_array)) print _("No data available");
539
+			else {
540
+				  print '<div id="chart5" class="chart" width="100%"></div>
541 541
                     <script> 
542 542
                         google.load("visualization", "1", {packages:["corechart"]});
543 543
                       google.setOnLoadCallback(drawChart5);
544 544
                       function drawChart5() {
545 545
                         var data = google.visualization.arrayToDataTable([
546 546
                             ["'._("Date").'", "'._("# of Flights").'"], ';
547
-                            $date_data = '';
547
+							$date_data = '';
548 548
                         
549
-                          foreach($date_array as $date_item)
550
-                                    {
551
-                                        $date_data .= '[ "'.date("F j, Y", strtotime($date_item['date_name'])).'",'.$date_item['date_count'].'],';
552
-                                    }
553
-                                    $date_data = substr($date_data, 0, -1);
554
-                                    print $date_data;
555
-                        print ']);
549
+						  foreach($date_array as $date_item)
550
+									{
551
+										$date_data .= '[ "'.date("F j, Y", strtotime($date_item['date_name'])).'",'.$date_item['date_count'].'],';
552
+									}
553
+									$date_data = substr($date_data, 0, -1);
554
+									print $date_data;
555
+						print ']);
556 556
 
557 557
                         var options = {
558 558
                             legend: {position: "none"},
@@ -570,8 +570,8 @@  discard block
 block discarded – undo
570 570
                               drawChart5();
571 571
                             });
572 572
                   </script>';
573
-                  }
574
-                  ?>
573
+				  }
574
+				  ?>
575 575
                 <div class="more">
576 576
                     <a href="<?php print $globalURL; ?>/statistics/date" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
577 577
                 </div>
@@ -581,25 +581,25 @@  discard block
 block discarded – undo
581 581
             <div class="col-md-6">
582 582
                 <h2><?php echo _("Busiest Time of the Day"); ?></h2>
583 583
                 <?php
584
-                  $hour_array = $Stats->countAllHours('hour',true,$airline_icao,$filter_name);
585
-		    if (empty($hour_array)) print _("No data available");
586
-		    else {
584
+				  $hour_array = $Stats->countAllHours('hour',true,$airline_icao,$filter_name);
585
+			if (empty($hour_array)) print _("No data available");
586
+			else {
587 587
 
588
-                  print '<div id="chart6" class="chart" width="100%"></div>
588
+				  print '<div id="chart6" class="chart" width="100%"></div>
589 589
                     <script> 
590 590
                         google.load("visualization", "1", {packages:["corechart"]});
591 591
                       google.setOnLoadCallback(drawChart6);
592 592
                       function drawChart6() {
593 593
                         var data = google.visualization.arrayToDataTable([
594 594
                             ["'._("Hour").'", "'._("# of Flights").'"], ';
595
-                            $hour_data = '';
596
-                          foreach($hour_array as $hour_item)
597
-                                    {
598
-                                        $hour_data .= '[ "'.$hour_item['hour_name'].':00",'.$hour_item['hour_count'].'],';
599
-                                    }
600
-                                    $hour_data = substr($hour_data, 0, -1);
601
-                                    print $hour_data;
602
-                        print ']);
595
+							$hour_data = '';
596
+						  foreach($hour_array as $hour_item)
597
+									{
598
+										$hour_data .= '[ "'.$hour_item['hour_name'].':00",'.$hour_item['hour_count'].'],';
599
+									}
600
+									$hour_data = substr($hour_data, 0, -1);
601
+									print $hour_data;
602
+						print ']);
603 603
 
604 604
                         var options = {
605 605
                             legend: {position: "none"},
@@ -617,8 +617,8 @@  discard block
 block discarded – undo
617 617
                               drawChart6();
618 618
                             });
619 619
                   </script>';
620
-                  }
621
-                ?>
620
+				  }
621
+				?>
622 622
                 <div class="more">
623 623
                     <a href="<?php print $globalURL; ?>/statistics/time" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>&raquo;</a>
624 624
                 </div>
@@ -626,21 +626,21 @@  discard block
 block discarded – undo
626 626
     <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
627 627
         </div>
628 628
 <?php
629
-    if (($airline_icao == '' || $airline_icao == 'all') && $filter_name == '') {
629
+	if (($airline_icao == '' || $airline_icao == 'all') && $filter_name == '') {
630 630
 ?>
631 631
         <div class="row column">
632 632
         	<?php
633
-        	    $polar = $Stats->getStatsSource(date('Y-m-d'),'polar');
634
-        	    if (!empty($polar)) {
635
-            		print '<h2>'._("Coverage pattern").'</h2>';
636
-        		foreach ($polar as $eachpolar) {
637
-        		    unset($polar_data);
638
-	        	    $Spotter = new Spotter();
639
-        		    $data = json_decode($eachpolar['source_data']);
640
-        		    foreach($data as $value => $key) {
641
-        			$direction = $Spotter->parseDirection(($value*22.5));
642
-        			$distance = $key;
643
-        			$unit = 'km';
633
+				$polar = $Stats->getStatsSource(date('Y-m-d'),'polar');
634
+				if (!empty($polar)) {
635
+					print '<h2>'._("Coverage pattern").'</h2>';
636
+				foreach ($polar as $eachpolar) {
637
+					unset($polar_data);
638
+					$Spotter = new Spotter();
639
+					$data = json_decode($eachpolar['source_data']);
640
+					foreach($data as $value => $key) {
641
+					$direction = $Spotter->parseDirection(($value*22.5));
642
+					$distance = $key;
643
+					$unit = 'km';
644 644
 				if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) {
645 645
 					$distance = round($distance*0.539957);
646 646
 					$unit = 'nm';
@@ -651,10 +651,10 @@  discard block
 block discarded – undo
651 651
 					$distance = $distance;
652 652
 					$unit = 'km';
653 653
 				}
654
-        			if (!isset($polar_data)) $polar_data = '{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}';
655
-        	    		else $polar_data = $polar_data.',{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}';
656
-        		    }
657
-        	?>
654
+					if (!isset($polar_data)) $polar_data = '{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}';
655
+						else $polar_data = $polar_data.',{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}';
656
+					}
657
+			?>
658 658
             <div class="col-md-6">
659 659
                 <h4><?php print $eachpolar['source_name']; ?></h4>
660 660
         	<div id="polar-<?php print str_replace(' ','_',strtolower($eachpolar['source_name'])); ?>" class="chart" width="100%"></div>
@@ -686,22 +686,22 @@  discard block
 block discarded – undo
686 686
 		</script>
687 687
             </div>
688 688
             <?php
689
-        	    }
690
-        	}
691
-            ?>
689
+				}
690
+			}
691
+			?>
692 692
         </div>
693 693
         <div class="row column">
694 694
             <div class="col-md-6">
695 695
         	<?php
696
-        	    $msg = $Stats->getStatsSource(date('Y-m-d'),'msg');
697
-        	    if (!empty($msg)) {
698
-            		print '<h2>'._("Messages received").'</h2>';
699
-        		foreach ($msg as $eachmsg) {
700
-        		    //$eachmsg = $msg[0];
701
-        		    $data = $eachmsg['source_data'];
702
-        		    if ($data > 500) $max = (round(($data+100)/100))*100;
703
-        		    else $max = 500;
704
-        	?>
696
+				$msg = $Stats->getStatsSource(date('Y-m-d'),'msg');
697
+				if (!empty($msg)) {
698
+					print '<h2>'._("Messages received").'</h2>';
699
+				foreach ($msg as $eachmsg) {
700
+					//$eachmsg = $msg[0];
701
+					$data = $eachmsg['source_data'];
702
+					if ($data > 500) $max = (round(($data+100)/100))*100;
703
+					else $max = 500;
704
+			?>
705 705
         	<div id="msg-<?php print str_replace(' ','_',strtolower($eachmsg['source_name'])); ?>" class="col-md-4"></div>
706 706
         	<script>
707 707
 		      var g = new JustGage({
@@ -717,9 +717,9 @@  discard block
 block discarded – undo
717 717
 			  });
718 718
 		</script>
719 719
             <?php
720
-        	   }
721
-        	}
722
-            ?>
720
+			   }
721
+			}
722
+			?>
723 723
             </div>
724 724
         </div>
725 725
         <div class="row column">
@@ -746,19 +746,19 @@  discard block
 block discarded – undo
746 746
 				$hist_data .= '[ "'.$distance.'",'.$nb.'],';
747 747
 			}
748 748
 			$hist_data = substr($hist_data, 0, -1);
749
-            ?>
749
+			?>
750 750
             <div class="col-md-6">
751 751
                 <h2><?php echo sprintf(_("Flights Distance for %s"),$source); ?></h2>
752 752
                 <?php
753
-                  print '<div id="charthist-'.str_replace(' ','_',strtolower($source)).'" class="chart" width="100%"></div>
753
+				  print '<div id="charthist-'.str_replace(' ','_',strtolower($source)).'" class="chart" width="100%"></div>
754 754
                     <script> 
755 755
                         google.load("visualization", "1", {packages:["corechart"]});
756 756
                       google.setOnLoadCallback(drawCharthist_'.str_replace(' ','_',strtolower($source)).');
757 757
                       function drawCharthist_'.str_replace(' ','_',strtolower($source)).'() {
758 758
                         var data = google.visualization.arrayToDataTable([
759 759
                             ["'._("Distance").'", "'._("# of Flights").'"], ';
760
-                            print $hist_data;
761
-                        print ']);
760
+							print $hist_data;
761
+						print ']);
762 762
 
763 763
                         var options = {
764 764
                             legend: {position: "none"},
@@ -776,15 +776,15 @@  discard block
 block discarded – undo
776 776
                               drawCharthist_'.str_replace(' ','_',strtolower($source)).'();
777 777
                             });
778 778
                   </script>';
779
-        	?>
779
+			?>
780 780
     	    </div>
781 781
 	    <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> -->
782 782
         	<?php
783
-                  }
784
-                ?>
783
+				  }
784
+				?>
785 785
         </div>
786 786
 <?php
787
-    }
787
+	}
788 788
 ?>
789 789
     </div>
790 790
 </div>  
Please login to merge, or discard this patch.