@@ -4,8 +4,8 @@ |
||
| 4 | 4 | require_once('require/class.Stats.php'); |
| 5 | 5 | require_once('require/class.Language.php'); |
| 6 | 6 | if (!isset($_GET['airport'])) { |
| 7 | - header('Location: '.$globalURL.'/airport'); |
|
| 8 | - die(); |
|
| 7 | + header('Location: '.$globalURL.'/airport'); |
|
| 8 | + die(); |
|
| 9 | 9 | } |
| 10 | 10 | $airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING); |
| 11 | 11 | $Spotter = new Spotter(); |
@@ -4,8 +4,8 @@ |
||
| 4 | 4 | require_once('require/class.Stats.php'); |
| 5 | 5 | require_once('require/class.Language.php'); |
| 6 | 6 | if (!isset($_GET['airport'])) { |
| 7 | - header('Location: '.$globalURL.'/airport'); |
|
| 8 | - die(); |
|
| 7 | + header('Location: '.$globalURL.'/airport'); |
|
| 8 | + die(); |
|
| 9 | 9 | } |
| 10 | 10 | $airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING); |
| 11 | 11 | $Spotter = new Spotter(); |
@@ -55,10 +55,10 @@ discard block |
||
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | /** |
| 58 | - * Get SQL query part for filter used |
|
| 59 | - * @param Array $filter the filter |
|
| 60 | - * @return Array the SQL part |
|
| 61 | - */ |
|
| 58 | + * Get SQL query part for filter used |
|
| 59 | + * @param Array $filter the filter |
|
| 60 | + * @return Array the SQL part |
|
| 61 | + */ |
|
| 62 | 62 | public function getFilter($filter = array(),$where = false,$and = false) { |
| 63 | 63 | global $globalFilter, $globalStatsFilters, $globalFilterName, $globalDBdriver; |
| 64 | 64 | $filters = array(); |
@@ -166,14 +166,14 @@ discard block |
||
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | /** |
| 169 | - * Executes the SQL statements to get the spotter information |
|
| 170 | - * |
|
| 171 | - * @param String $query the SQL query |
|
| 172 | - * @param Array $params parameter of the query |
|
| 173 | - * @param String $limitQuery the limit query |
|
| 174 | - * @return Array the spotter information |
|
| 175 | - * |
|
| 176 | - */ |
|
| 169 | + * Executes the SQL statements to get the spotter information |
|
| 170 | + * |
|
| 171 | + * @param String $query the SQL query |
|
| 172 | + * @param Array $params parameter of the query |
|
| 173 | + * @param String $limitQuery the limit query |
|
| 174 | + * @return Array the spotter information |
|
| 175 | + * |
|
| 176 | + */ |
|
| 177 | 177 | public function getDataFromDB($query, $params = array(), $limitQuery = '',$schedules = false) |
| 178 | 178 | { |
| 179 | 179 | global $globalSquawkCountry, $globalIVAO, $globalVATSIM, $globalphpVMS, $globalAirlinesSource, $globalVAM; |
@@ -342,11 +342,11 @@ discard block |
||
| 342 | 342 | if ($aircraft_array[0]['aircraft_shadow'] != NULL) { |
| 343 | 343 | $temp_array['aircraft_shadow'] = $aircraft_array[0]['aircraft_shadow']; |
| 344 | 344 | } else $temp_array['aircraft_shadow'] = 'default.png'; |
| 345 | - } else { |
|
| 346 | - $temp_array['aircraft_shadow'] = 'default.png'; |
|
| 345 | + } else { |
|
| 346 | + $temp_array['aircraft_shadow'] = 'default.png'; |
|
| 347 | 347 | $temp_array['aircraft_name'] = 'N/A'; |
| 348 | 348 | $temp_array['aircraft_manufacturer'] = 'N/A'; |
| 349 | - } |
|
| 349 | + } |
|
| 350 | 350 | } |
| 351 | 351 | $fromsource = NULL; |
| 352 | 352 | if (isset($globalAirlinesSource) && $globalAirlinesSource != '') $fromsource = $globalAirlinesSource; |
@@ -543,11 +543,11 @@ discard block |
||
| 543 | 543 | |
| 544 | 544 | |
| 545 | 545 | /** |
| 546 | - * Gets all the spotter information |
|
| 547 | - * |
|
| 548 | - * @return Array the spotter information |
|
| 549 | - * |
|
| 550 | - */ |
|
| 546 | + * Gets all the spotter information |
|
| 547 | + * |
|
| 548 | + * @return Array the spotter information |
|
| 549 | + * |
|
| 550 | + */ |
|
| 551 | 551 | 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()) |
| 552 | 552 | { |
| 553 | 553 | global $globalTimezone, $globalDBdriver; |
@@ -894,11 +894,11 @@ discard block |
||
| 894 | 894 | |
| 895 | 895 | |
| 896 | 896 | /** |
| 897 | - * Gets all the spotter information based on the latest data entry |
|
| 898 | - * |
|
| 899 | - * @return Array the spotter information |
|
| 900 | - * |
|
| 901 | - */ |
|
| 897 | + * Gets all the spotter information based on the latest data entry |
|
| 898 | + * |
|
| 899 | + * @return Array the spotter information |
|
| 900 | + * |
|
| 901 | + */ |
|
| 902 | 902 | public function getLatestSpotterData($limit = '', $sort = '', $filter = array()) |
| 903 | 903 | { |
| 904 | 904 | global $global_query; |
@@ -937,12 +937,12 @@ discard block |
||
| 937 | 937 | } |
| 938 | 938 | |
| 939 | 939 | |
| 940 | - /** |
|
| 941 | - * Gets all the spotter information based on a user's latitude and longitude |
|
| 942 | - * |
|
| 943 | - * @return Array the spotter information |
|
| 944 | - * |
|
| 945 | - */ |
|
| 940 | + /** |
|
| 941 | + * Gets all the spotter information based on a user's latitude and longitude |
|
| 942 | + * |
|
| 943 | + * @return Array the spotter information |
|
| 944 | + * |
|
| 945 | + */ |
|
| 946 | 946 | public function getLatestSpotterForLayar($lat, $lng, $radius, $interval) |
| 947 | 947 | { |
| 948 | 948 | date_default_timezone_set('UTC'); |
@@ -970,7 +970,7 @@ discard block |
||
| 970 | 970 | return false; |
| 971 | 971 | } |
| 972 | 972 | } |
| 973 | - $additional_query = ''; |
|
| 973 | + $additional_query = ''; |
|
| 974 | 974 | if ($interval != "") |
| 975 | 975 | { |
| 976 | 976 | if (!is_string($interval)) |
@@ -1010,12 +1010,12 @@ discard block |
||
| 1010 | 1010 | } |
| 1011 | 1011 | |
| 1012 | 1012 | |
| 1013 | - /** |
|
| 1014 | - * Gets all the spotter information sorted by the newest aircraft type |
|
| 1015 | - * |
|
| 1016 | - * @return Array the spotter information |
|
| 1017 | - * |
|
| 1018 | - */ |
|
| 1013 | + /** |
|
| 1014 | + * Gets all the spotter information sorted by the newest aircraft type |
|
| 1015 | + * |
|
| 1016 | + * @return Array the spotter information |
|
| 1017 | + * |
|
| 1018 | + */ |
|
| 1019 | 1019 | public function getNewestSpotterDataSortedByAircraftType($limit = '', $sort = '',$filter = array()) |
| 1020 | 1020 | { |
| 1021 | 1021 | global $global_query; |
@@ -1056,11 +1056,11 @@ discard block |
||
| 1056 | 1056 | |
| 1057 | 1057 | |
| 1058 | 1058 | /** |
| 1059 | - * Gets all the spotter information sorted by the newest aircraft registration |
|
| 1060 | - * |
|
| 1061 | - * @return Array the spotter information |
|
| 1062 | - * |
|
| 1063 | - */ |
|
| 1059 | + * Gets all the spotter information sorted by the newest aircraft registration |
|
| 1060 | + * |
|
| 1061 | + * @return Array the spotter information |
|
| 1062 | + * |
|
| 1063 | + */ |
|
| 1064 | 1064 | public function getNewestSpotterDataSortedByAircraftRegistration($limit = '', $sort = '', $filter = array()) |
| 1065 | 1065 | { |
| 1066 | 1066 | global $global_query; |
@@ -1100,11 +1100,11 @@ discard block |
||
| 1100 | 1100 | |
| 1101 | 1101 | |
| 1102 | 1102 | /** |
| 1103 | - * Gets all the spotter information sorted by the newest airline |
|
| 1104 | - * |
|
| 1105 | - * @return Array the spotter information |
|
| 1106 | - * |
|
| 1107 | - */ |
|
| 1103 | + * Gets all the spotter information sorted by the newest airline |
|
| 1104 | + * |
|
| 1105 | + * @return Array the spotter information |
|
| 1106 | + * |
|
| 1107 | + */ |
|
| 1108 | 1108 | public function getNewestSpotterDataSortedByAirline($limit = '', $sort = '',$filter = array()) |
| 1109 | 1109 | { |
| 1110 | 1110 | global $global_query; |
@@ -1143,12 +1143,12 @@ discard block |
||
| 1143 | 1143 | } |
| 1144 | 1144 | |
| 1145 | 1145 | |
| 1146 | - /** |
|
| 1147 | - * Gets all the spotter information sorted by the newest departure airport |
|
| 1148 | - * |
|
| 1149 | - * @return Array the spotter information |
|
| 1150 | - * |
|
| 1151 | - */ |
|
| 1146 | + /** |
|
| 1147 | + * Gets all the spotter information sorted by the newest departure airport |
|
| 1148 | + * |
|
| 1149 | + * @return Array the spotter information |
|
| 1150 | + * |
|
| 1151 | + */ |
|
| 1152 | 1152 | public function getNewestSpotterDataSortedByDepartureAirport($limit = '', $sort = '', $filter = array()) |
| 1153 | 1153 | { |
| 1154 | 1154 | global $global_query; |
@@ -1190,11 +1190,11 @@ discard block |
||
| 1190 | 1190 | |
| 1191 | 1191 | |
| 1192 | 1192 | /** |
| 1193 | - * Gets all the spotter information sorted by the newest arrival airport |
|
| 1194 | - * |
|
| 1195 | - * @return Array the spotter information |
|
| 1196 | - * |
|
| 1197 | - */ |
|
| 1193 | + * Gets all the spotter information sorted by the newest arrival airport |
|
| 1194 | + * |
|
| 1195 | + * @return Array the spotter information |
|
| 1196 | + * |
|
| 1197 | + */ |
|
| 1198 | 1198 | public function getNewestSpotterDataSortedByArrivalAirport($limit = '', $sort = '', $filter = array()) |
| 1199 | 1199 | { |
| 1200 | 1200 | global $global_query; |
@@ -1233,11 +1233,11 @@ discard block |
||
| 1233 | 1233 | |
| 1234 | 1234 | |
| 1235 | 1235 | /** |
| 1236 | - * Gets all the spotter information based on the spotter id |
|
| 1237 | - * |
|
| 1238 | - * @return Array the spotter information |
|
| 1239 | - * |
|
| 1240 | - */ |
|
| 1236 | + * Gets all the spotter information based on the spotter id |
|
| 1237 | + * |
|
| 1238 | + * @return Array the spotter information |
|
| 1239 | + * |
|
| 1240 | + */ |
|
| 1241 | 1241 | public function getSpotterDataByID($id = '') |
| 1242 | 1242 | { |
| 1243 | 1243 | global $global_query; |
@@ -1259,11 +1259,11 @@ discard block |
||
| 1259 | 1259 | |
| 1260 | 1260 | |
| 1261 | 1261 | /** |
| 1262 | - * Gets all the spotter information based on the callsign |
|
| 1263 | - * |
|
| 1264 | - * @return Array the spotter information |
|
| 1265 | - * |
|
| 1266 | - */ |
|
| 1262 | + * Gets all the spotter information based on the callsign |
|
| 1263 | + * |
|
| 1264 | + * @return Array the spotter information |
|
| 1265 | + * |
|
| 1266 | + */ |
|
| 1267 | 1267 | public function getSpotterDataByIdent($ident = '', $limit = '', $sort = '', $filter = array()) |
| 1268 | 1268 | { |
| 1269 | 1269 | global $global_query; |
@@ -1315,11 +1315,11 @@ discard block |
||
| 1315 | 1315 | } |
| 1316 | 1316 | |
| 1317 | 1317 | /** |
| 1318 | - * Gets all the spotter information based on the owner |
|
| 1319 | - * |
|
| 1320 | - * @return Array the spotter information |
|
| 1321 | - * |
|
| 1322 | - */ |
|
| 1318 | + * Gets all the spotter information based on the owner |
|
| 1319 | + * |
|
| 1320 | + * @return Array the spotter information |
|
| 1321 | + * |
|
| 1322 | + */ |
|
| 1323 | 1323 | public function getSpotterDataByOwner($owner = '', $limit = '', $sort = '', $filter = array()) |
| 1324 | 1324 | { |
| 1325 | 1325 | global $global_query; |
@@ -1372,11 +1372,11 @@ discard block |
||
| 1372 | 1372 | } |
| 1373 | 1373 | |
| 1374 | 1374 | /** |
| 1375 | - * Gets all the spotter information based on the pilot |
|
| 1376 | - * |
|
| 1377 | - * @return Array the spotter information |
|
| 1378 | - * |
|
| 1379 | - */ |
|
| 1375 | + * Gets all the spotter information based on the pilot |
|
| 1376 | + * |
|
| 1377 | + * @return Array the spotter information |
|
| 1378 | + * |
|
| 1379 | + */ |
|
| 1380 | 1380 | public function getSpotterDataByPilot($pilot = '', $limit = '', $sort = '', $filter = array()) |
| 1381 | 1381 | { |
| 1382 | 1382 | global $global_query; |
@@ -1425,11 +1425,11 @@ discard block |
||
| 1425 | 1425 | |
| 1426 | 1426 | |
| 1427 | 1427 | /** |
| 1428 | - * Gets all the spotter information based on the aircraft type |
|
| 1429 | - * |
|
| 1430 | - * @return Array the spotter information |
|
| 1431 | - * |
|
| 1432 | - */ |
|
| 1428 | + * Gets all the spotter information based on the aircraft type |
|
| 1429 | + * |
|
| 1430 | + * @return Array the spotter information |
|
| 1431 | + * |
|
| 1432 | + */ |
|
| 1433 | 1433 | public function getSpotterDataByAircraft($aircraft_type = '', $limit = '', $sort = '', $filter = array()) |
| 1434 | 1434 | { |
| 1435 | 1435 | global $global_query; |
@@ -1483,11 +1483,11 @@ discard block |
||
| 1483 | 1483 | |
| 1484 | 1484 | |
| 1485 | 1485 | /** |
| 1486 | - * Gets all the spotter information based on the aircraft registration |
|
| 1487 | - * |
|
| 1488 | - * @return Array the spotter information |
|
| 1489 | - * |
|
| 1490 | - */ |
|
| 1486 | + * Gets all the spotter information based on the aircraft registration |
|
| 1487 | + * |
|
| 1488 | + * @return Array the spotter information |
|
| 1489 | + * |
|
| 1490 | + */ |
|
| 1491 | 1491 | public function getSpotterDataByRegistration($registration = '', $limit = '', $sort = '', $filter = array()) |
| 1492 | 1492 | { |
| 1493 | 1493 | global $global_query; |
@@ -1544,11 +1544,11 @@ discard block |
||
| 1544 | 1544 | |
| 1545 | 1545 | |
| 1546 | 1546 | /** |
| 1547 | - * Gets all the spotter information based on the airline |
|
| 1548 | - * |
|
| 1549 | - * @return Array the spotter information |
|
| 1550 | - * |
|
| 1551 | - */ |
|
| 1547 | + * Gets all the spotter information based on the airline |
|
| 1548 | + * |
|
| 1549 | + * @return Array the spotter information |
|
| 1550 | + * |
|
| 1551 | + */ |
|
| 1552 | 1552 | public function getSpotterDataByAirline($airline = '', $limit = '', $sort = '',$filters = array()) |
| 1553 | 1553 | { |
| 1554 | 1554 | global $global_query; |
@@ -1601,11 +1601,11 @@ discard block |
||
| 1601 | 1601 | |
| 1602 | 1602 | |
| 1603 | 1603 | /** |
| 1604 | - * Gets all the spotter information based on the airport |
|
| 1605 | - * |
|
| 1606 | - * @return Array the spotter information |
|
| 1607 | - * |
|
| 1608 | - */ |
|
| 1604 | + * Gets all the spotter information based on the airport |
|
| 1605 | + * |
|
| 1606 | + * @return Array the spotter information |
|
| 1607 | + * |
|
| 1608 | + */ |
|
| 1609 | 1609 | public function getSpotterDataByAirport($airport = '', $limit = '', $sort = '',$filters = array()) |
| 1610 | 1610 | { |
| 1611 | 1611 | global $global_query; |
@@ -1659,11 +1659,11 @@ discard block |
||
| 1659 | 1659 | |
| 1660 | 1660 | |
| 1661 | 1661 | /** |
| 1662 | - * Gets all the spotter information based on the date |
|
| 1663 | - * |
|
| 1664 | - * @return Array the spotter information |
|
| 1665 | - * |
|
| 1666 | - */ |
|
| 1662 | + * Gets all the spotter information based on the date |
|
| 1663 | + * |
|
| 1664 | + * @return Array the spotter information |
|
| 1665 | + * |
|
| 1666 | + */ |
|
| 1667 | 1667 | public function getSpotterDataByDate($date = '', $limit = '', $sort = '',$filter = array()) |
| 1668 | 1668 | { |
| 1669 | 1669 | global $global_query, $globalTimezone, $globalDBdriver; |
@@ -1727,11 +1727,11 @@ discard block |
||
| 1727 | 1727 | |
| 1728 | 1728 | |
| 1729 | 1729 | /** |
| 1730 | - * Gets all the spotter information based on the country name |
|
| 1731 | - * |
|
| 1732 | - * @return Array the spotter information |
|
| 1733 | - * |
|
| 1734 | - */ |
|
| 1730 | + * Gets all the spotter information based on the country name |
|
| 1731 | + * |
|
| 1732 | + * @return Array the spotter information |
|
| 1733 | + * |
|
| 1734 | + */ |
|
| 1735 | 1735 | public function getSpotterDataByCountry($country = '', $limit = '', $sort = '',$filters = array()) |
| 1736 | 1736 | { |
| 1737 | 1737 | global $global_query; |
@@ -1785,11 +1785,11 @@ discard block |
||
| 1785 | 1785 | |
| 1786 | 1786 | |
| 1787 | 1787 | /** |
| 1788 | - * Gets all the spotter information based on the manufacturer name |
|
| 1789 | - * |
|
| 1790 | - * @return Array the spotter information |
|
| 1791 | - * |
|
| 1792 | - */ |
|
| 1788 | + * Gets all the spotter information based on the manufacturer name |
|
| 1789 | + * |
|
| 1790 | + * @return Array the spotter information |
|
| 1791 | + * |
|
| 1792 | + */ |
|
| 1793 | 1793 | public function getSpotterDataByManufacturer($aircraft_manufacturer = '', $limit = '', $sort = '', $filters = array()) |
| 1794 | 1794 | { |
| 1795 | 1795 | global $global_query; |
@@ -1845,13 +1845,13 @@ discard block |
||
| 1845 | 1845 | |
| 1846 | 1846 | |
| 1847 | 1847 | /** |
| 1848 | - * Gets a list of all aircraft that take a route |
|
| 1849 | - * |
|
| 1850 | - * @param String $departure_airport_icao ICAO code of departure airport |
|
| 1851 | - * @param String $arrival_airport_icao ICAO code of arrival airport |
|
| 1852 | - * @return Array the spotter information |
|
| 1853 | - * |
|
| 1854 | - */ |
|
| 1848 | + * Gets a list of all aircraft that take a route |
|
| 1849 | + * |
|
| 1850 | + * @param String $departure_airport_icao ICAO code of departure airport |
|
| 1851 | + * @param String $arrival_airport_icao ICAO code of arrival airport |
|
| 1852 | + * @return Array the spotter information |
|
| 1853 | + * |
|
| 1854 | + */ |
|
| 1855 | 1855 | public function getSpotterDataByRoute($departure_airport_icao = '', $arrival_airport_icao = '', $limit = '', $sort = '', $filters = array()) |
| 1856 | 1856 | { |
| 1857 | 1857 | global $global_query; |
@@ -1920,11 +1920,11 @@ discard block |
||
| 1920 | 1920 | |
| 1921 | 1921 | |
| 1922 | 1922 | /** |
| 1923 | - * Gets all the spotter information based on the special column in the table |
|
| 1924 | - * |
|
| 1925 | - * @return Array the spotter information |
|
| 1926 | - * |
|
| 1927 | - */ |
|
| 1923 | + * Gets all the spotter information based on the special column in the table |
|
| 1924 | + * |
|
| 1925 | + * @return Array the spotter information |
|
| 1926 | + * |
|
| 1927 | + */ |
|
| 1928 | 1928 | public function getSpotterDataByHighlight($limit = '', $sort = '', $filter = array()) |
| 1929 | 1929 | { |
| 1930 | 1930 | global $global_query; |
@@ -1963,11 +1963,11 @@ discard block |
||
| 1963 | 1963 | } |
| 1964 | 1964 | |
| 1965 | 1965 | /** |
| 1966 | - * Gets all the highlight based on a aircraft registration |
|
| 1967 | - * |
|
| 1968 | - * @return String the highlight text |
|
| 1969 | - * |
|
| 1970 | - */ |
|
| 1966 | + * Gets all the highlight based on a aircraft registration |
|
| 1967 | + * |
|
| 1968 | + * @return String the highlight text |
|
| 1969 | + * |
|
| 1970 | + */ |
|
| 1971 | 1971 | public function getHighlightByRegistration($registration,$filter = array()) |
| 1972 | 1972 | { |
| 1973 | 1973 | global $global_query; |
@@ -1989,13 +1989,13 @@ discard block |
||
| 1989 | 1989 | |
| 1990 | 1990 | |
| 1991 | 1991 | /** |
| 1992 | - * Gets the squawk usage from squawk code |
|
| 1993 | - * |
|
| 1994 | - * @param String $squawk squawk code |
|
| 1995 | - * @param String $country country |
|
| 1996 | - * @return String usage |
|
| 1997 | - * |
|
| 1998 | - */ |
|
| 1992 | + * Gets the squawk usage from squawk code |
|
| 1993 | + * |
|
| 1994 | + * @param String $squawk squawk code |
|
| 1995 | + * @param String $country country |
|
| 1996 | + * @return String usage |
|
| 1997 | + * |
|
| 1998 | + */ |
|
| 1999 | 1999 | public function getSquawkUsage($squawk = '',$country = 'FR') |
| 2000 | 2000 | { |
| 2001 | 2001 | |
@@ -2016,12 +2016,12 @@ discard block |
||
| 2016 | 2016 | } |
| 2017 | 2017 | |
| 2018 | 2018 | /** |
| 2019 | - * Gets the airport icao from the iata |
|
| 2020 | - * |
|
| 2021 | - * @param String $airport_iata the iata code of the airport |
|
| 2022 | - * @return String airport iata |
|
| 2023 | - * |
|
| 2024 | - */ |
|
| 2019 | + * Gets the airport icao from the iata |
|
| 2020 | + * |
|
| 2021 | + * @param String $airport_iata the iata code of the airport |
|
| 2022 | + * @return String airport iata |
|
| 2023 | + * |
|
| 2024 | + */ |
|
| 2025 | 2025 | public function getAirportIcao($airport_iata = '') |
| 2026 | 2026 | { |
| 2027 | 2027 | |
@@ -2041,14 +2041,14 @@ discard block |
||
| 2041 | 2041 | } |
| 2042 | 2042 | |
| 2043 | 2043 | /** |
| 2044 | - * Gets the airport distance |
|
| 2045 | - * |
|
| 2046 | - * @param String $airport_icao the icao code of the airport |
|
| 2047 | - * @param Float $latitude the latitude |
|
| 2048 | - * @param Float $longitude the longitude |
|
| 2049 | - * @return Float distance to the airport |
|
| 2050 | - * |
|
| 2051 | - */ |
|
| 2044 | + * Gets the airport distance |
|
| 2045 | + * |
|
| 2046 | + * @param String $airport_icao the icao code of the airport |
|
| 2047 | + * @param Float $latitude the latitude |
|
| 2048 | + * @param Float $longitude the longitude |
|
| 2049 | + * @return Float distance to the airport |
|
| 2050 | + * |
|
| 2051 | + */ |
|
| 2052 | 2052 | public function getAirportDistance($airport_icao,$latitude,$longitude) |
| 2053 | 2053 | { |
| 2054 | 2054 | |
@@ -2069,12 +2069,12 @@ discard block |
||
| 2069 | 2069 | } |
| 2070 | 2070 | |
| 2071 | 2071 | /** |
| 2072 | - * Gets the airport info based on the icao |
|
| 2073 | - * |
|
| 2074 | - * @param String $airport the icao code of the airport |
|
| 2075 | - * @return Array airport information |
|
| 2076 | - * |
|
| 2077 | - */ |
|
| 2072 | + * Gets the airport info based on the icao |
|
| 2073 | + * |
|
| 2074 | + * @param String $airport the icao code of the airport |
|
| 2075 | + * @return Array airport information |
|
| 2076 | + * |
|
| 2077 | + */ |
|
| 2078 | 2078 | public function getAllAirportInfo($airport = '') |
| 2079 | 2079 | { |
| 2080 | 2080 | |
@@ -2120,12 +2120,12 @@ discard block |
||
| 2120 | 2120 | } |
| 2121 | 2121 | |
| 2122 | 2122 | /** |
| 2123 | - * Gets the airport info based on the country |
|
| 2124 | - * |
|
| 2125 | - * @param Array $countries Airports countries |
|
| 2126 | - * @return Array airport information |
|
| 2127 | - * |
|
| 2128 | - */ |
|
| 2123 | + * Gets the airport info based on the country |
|
| 2124 | + * |
|
| 2125 | + * @param Array $countries Airports countries |
|
| 2126 | + * @return Array airport information |
|
| 2127 | + * |
|
| 2128 | + */ |
|
| 2129 | 2129 | public function getAllAirportInfobyCountry($countries) |
| 2130 | 2130 | { |
| 2131 | 2131 | $lst_countries = ''; |
@@ -2163,12 +2163,12 @@ discard block |
||
| 2163 | 2163 | } |
| 2164 | 2164 | |
| 2165 | 2165 | /** |
| 2166 | - * Gets airports info based on the coord |
|
| 2167 | - * |
|
| 2168 | - * @param Array $coord Airports longitude min,latitude min, longitude max, latitude max |
|
| 2169 | - * @return Array airport information |
|
| 2170 | - * |
|
| 2171 | - */ |
|
| 2166 | + * Gets airports info based on the coord |
|
| 2167 | + * |
|
| 2168 | + * @param Array $coord Airports longitude min,latitude min, longitude max, latitude max |
|
| 2169 | + * @return Array airport information |
|
| 2170 | + * |
|
| 2171 | + */ |
|
| 2172 | 2172 | public function getAllAirportInfobyCoord($coord) |
| 2173 | 2173 | { |
| 2174 | 2174 | global $globalDBdriver; |
@@ -2199,12 +2199,12 @@ discard block |
||
| 2199 | 2199 | } |
| 2200 | 2200 | |
| 2201 | 2201 | /** |
| 2202 | - * Gets waypoints info based on the coord |
|
| 2203 | - * |
|
| 2204 | - * @param Array $coord waypoints coord |
|
| 2205 | - * @return Array airport information |
|
| 2206 | - * |
|
| 2207 | - */ |
|
| 2202 | + * Gets waypoints info based on the coord |
|
| 2203 | + * |
|
| 2204 | + * @param Array $coord waypoints coord |
|
| 2205 | + * @return Array airport information |
|
| 2206 | + * |
|
| 2207 | + */ |
|
| 2208 | 2208 | public function getAllWaypointsInfobyCoord($coord) |
| 2209 | 2209 | { |
| 2210 | 2210 | if (is_array($coord)) { |
@@ -2238,12 +2238,12 @@ discard block |
||
| 2238 | 2238 | |
| 2239 | 2239 | |
| 2240 | 2240 | /** |
| 2241 | - * Gets the airline info based on the icao code or iata code |
|
| 2242 | - * |
|
| 2243 | - * @param String $airline_icao the iata code of the airport |
|
| 2244 | - * @return Array airport information |
|
| 2245 | - * |
|
| 2246 | - */ |
|
| 2241 | + * Gets the airline info based on the icao code or iata code |
|
| 2242 | + * |
|
| 2243 | + * @param String $airline_icao the iata code of the airport |
|
| 2244 | + * @return Array airport information |
|
| 2245 | + * |
|
| 2246 | + */ |
|
| 2247 | 2247 | public function getAllAirlineInfo($airline_icao, $fromsource = NULL) |
| 2248 | 2248 | { |
| 2249 | 2249 | global $globalUseRealAirlines; |
@@ -2274,7 +2274,7 @@ discard block |
||
| 2274 | 2274 | } else { |
| 2275 | 2275 | $sth->execute(array(':airline_icao' => $airline_icao,':fromsource' => $fromsource)); |
| 2276 | 2276 | } |
| 2277 | - /* |
|
| 2277 | + /* |
|
| 2278 | 2278 | $airline_array = array(); |
| 2279 | 2279 | $temp_array = array(); |
| 2280 | 2280 | |
@@ -2307,12 +2307,12 @@ discard block |
||
| 2307 | 2307 | } |
| 2308 | 2308 | |
| 2309 | 2309 | /** |
| 2310 | - * Gets the airline info based on the airline name |
|
| 2311 | - * |
|
| 2312 | - * @param String $airline_name the name of the airline |
|
| 2313 | - * @return Array airline information |
|
| 2314 | - * |
|
| 2315 | - */ |
|
| 2310 | + * Gets the airline info based on the airline name |
|
| 2311 | + * |
|
| 2312 | + * @param String $airline_name the name of the airline |
|
| 2313 | + * @return Array airline information |
|
| 2314 | + * |
|
| 2315 | + */ |
|
| 2316 | 2316 | public function getAllAirlineInfoByName($airline_name, $fromsource = NULL) |
| 2317 | 2317 | { |
| 2318 | 2318 | global $globalUseRealAirlines; |
@@ -2340,12 +2340,12 @@ discard block |
||
| 2340 | 2340 | |
| 2341 | 2341 | |
| 2342 | 2342 | /** |
| 2343 | - * Gets the aircraft info based on the aircraft type |
|
| 2344 | - * |
|
| 2345 | - * @param String $aircraft_type the aircraft type |
|
| 2346 | - * @return Array aircraft information |
|
| 2347 | - * |
|
| 2348 | - */ |
|
| 2343 | + * Gets the aircraft info based on the aircraft type |
|
| 2344 | + * |
|
| 2345 | + * @param String $aircraft_type the aircraft type |
|
| 2346 | + * @return Array aircraft information |
|
| 2347 | + * |
|
| 2348 | + */ |
|
| 2349 | 2349 | public function getAllAircraftInfo($aircraft_type) |
| 2350 | 2350 | { |
| 2351 | 2351 | $aircraft_type = filter_var($aircraft_type,FILTER_SANITIZE_STRING); |
@@ -2377,12 +2377,12 @@ discard block |
||
| 2377 | 2377 | } |
| 2378 | 2378 | |
| 2379 | 2379 | /** |
| 2380 | - * Gets the aircraft icao based on the aircraft name/type |
|
| 2381 | - * |
|
| 2382 | - * @param String $aircraft_type the aircraft type |
|
| 2383 | - * @return String aircraft information |
|
| 2384 | - * |
|
| 2385 | - */ |
|
| 2380 | + * Gets the aircraft icao based on the aircraft name/type |
|
| 2381 | + * |
|
| 2382 | + * @param String $aircraft_type the aircraft type |
|
| 2383 | + * @return String aircraft information |
|
| 2384 | + * |
|
| 2385 | + */ |
|
| 2386 | 2386 | public function getAircraftIcao($aircraft_type) |
| 2387 | 2387 | { |
| 2388 | 2388 | $aircraft_type = filter_var($aircraft_type,FILTER_SANITIZE_STRING); |
@@ -2407,12 +2407,12 @@ discard block |
||
| 2407 | 2407 | } |
| 2408 | 2408 | |
| 2409 | 2409 | /** |
| 2410 | - * Gets the aircraft info based on the aircraft modes |
|
| 2411 | - * |
|
| 2412 | - * @param String $aircraft_modes the aircraft ident (hex) |
|
| 2413 | - * @return String aircraft type |
|
| 2414 | - * |
|
| 2415 | - */ |
|
| 2410 | + * Gets the aircraft info based on the aircraft modes |
|
| 2411 | + * |
|
| 2412 | + * @param String $aircraft_modes the aircraft ident (hex) |
|
| 2413 | + * @return String aircraft type |
|
| 2414 | + * |
|
| 2415 | + */ |
|
| 2416 | 2416 | public function getAllAircraftType($aircraft_modes,$source_type = '') |
| 2417 | 2417 | { |
| 2418 | 2418 | $aircraft_modes = filter_var($aircraft_modes,FILTER_SANITIZE_STRING); |
@@ -2439,12 +2439,12 @@ discard block |
||
| 2439 | 2439 | } |
| 2440 | 2440 | |
| 2441 | 2441 | /** |
| 2442 | - * Gets the aircraft info based on the aircraft registration |
|
| 2443 | - * |
|
| 2444 | - * @param String $registration the aircraft registration |
|
| 2445 | - * @return String aircraft type |
|
| 2446 | - * |
|
| 2447 | - */ |
|
| 2442 | + * Gets the aircraft info based on the aircraft registration |
|
| 2443 | + * |
|
| 2444 | + * @param String $registration the aircraft registration |
|
| 2445 | + * @return String aircraft type |
|
| 2446 | + * |
|
| 2447 | + */ |
|
| 2448 | 2448 | public function getAllAircraftTypeByRegistration($registration) |
| 2449 | 2449 | { |
| 2450 | 2450 | $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
@@ -2462,12 +2462,12 @@ discard block |
||
| 2462 | 2462 | } |
| 2463 | 2463 | |
| 2464 | 2464 | /** |
| 2465 | - * Gets the spotter_id and flightaware_id based on the aircraft registration |
|
| 2466 | - * |
|
| 2467 | - * @param String $registration the aircraft registration |
|
| 2468 | - * @return Array spotter_id and flightaware_id |
|
| 2469 | - * |
|
| 2470 | - */ |
|
| 2465 | + * Gets the spotter_id and flightaware_id based on the aircraft registration |
|
| 2466 | + * |
|
| 2467 | + * @param String $registration the aircraft registration |
|
| 2468 | + * @return Array spotter_id and flightaware_id |
|
| 2469 | + * |
|
| 2470 | + */ |
|
| 2471 | 2471 | public function getAllIDByRegistration($registration) |
| 2472 | 2472 | { |
| 2473 | 2473 | $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
@@ -2486,12 +2486,12 @@ discard block |
||
| 2486 | 2486 | } |
| 2487 | 2487 | |
| 2488 | 2488 | /** |
| 2489 | - * Gets correct aircraft operator code |
|
| 2490 | - * |
|
| 2491 | - * @param String $operator the aircraft operator code (callsign) |
|
| 2492 | - * @return String aircraft operator code |
|
| 2493 | - * |
|
| 2494 | - */ |
|
| 2489 | + * Gets correct aircraft operator code |
|
| 2490 | + * |
|
| 2491 | + * @param String $operator the aircraft operator code (callsign) |
|
| 2492 | + * @return String aircraft operator code |
|
| 2493 | + * |
|
| 2494 | + */ |
|
| 2495 | 2495 | public function getOperator($operator) |
| 2496 | 2496 | { |
| 2497 | 2497 | $operator = filter_var($operator,FILTER_SANITIZE_STRING); |
@@ -2508,16 +2508,16 @@ discard block |
||
| 2508 | 2508 | } |
| 2509 | 2509 | |
| 2510 | 2510 | /** |
| 2511 | - * Gets the aircraft route based on the aircraft callsign |
|
| 2512 | - * |
|
| 2513 | - * @param String $callsign the aircraft callsign |
|
| 2514 | - * @return Array aircraft type |
|
| 2515 | - * |
|
| 2516 | - */ |
|
| 2511 | + * Gets the aircraft route based on the aircraft callsign |
|
| 2512 | + * |
|
| 2513 | + * @param String $callsign the aircraft callsign |
|
| 2514 | + * @return Array aircraft type |
|
| 2515 | + * |
|
| 2516 | + */ |
|
| 2517 | 2517 | public function getRouteInfo($callsign) |
| 2518 | 2518 | { |
| 2519 | 2519 | $callsign = filter_var($callsign,FILTER_SANITIZE_STRING); |
| 2520 | - if ($callsign == '') return array(); |
|
| 2520 | + if ($callsign == '') return array(); |
|
| 2521 | 2521 | $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"; |
| 2522 | 2522 | |
| 2523 | 2523 | $sth = $this->db->prepare($query); |
@@ -2531,12 +2531,12 @@ discard block |
||
| 2531 | 2531 | } |
| 2532 | 2532 | |
| 2533 | 2533 | /** |
| 2534 | - * Gets the aircraft info based on the aircraft registration |
|
| 2535 | - * |
|
| 2536 | - * @param String $registration the aircraft registration |
|
| 2537 | - * @return Array aircraft information |
|
| 2538 | - * |
|
| 2539 | - */ |
|
| 2534 | + * Gets the aircraft info based on the aircraft registration |
|
| 2535 | + * |
|
| 2536 | + * @param String $registration the aircraft registration |
|
| 2537 | + * @return Array aircraft information |
|
| 2538 | + * |
|
| 2539 | + */ |
|
| 2540 | 2540 | public function getAircraftInfoByRegistration($registration) |
| 2541 | 2541 | { |
| 2542 | 2542 | $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
@@ -2563,12 +2563,12 @@ discard block |
||
| 2563 | 2563 | } |
| 2564 | 2564 | |
| 2565 | 2565 | /** |
| 2566 | - * Gets the aircraft owner & base based on the aircraft registration |
|
| 2567 | - * |
|
| 2568 | - * @param String $registration the aircraft registration |
|
| 2569 | - * @return Array aircraft information |
|
| 2570 | - * |
|
| 2571 | - */ |
|
| 2566 | + * Gets the aircraft owner & base based on the aircraft registration |
|
| 2567 | + * |
|
| 2568 | + * @param String $registration the aircraft registration |
|
| 2569 | + * @return Array aircraft information |
|
| 2570 | + * |
|
| 2571 | + */ |
|
| 2572 | 2572 | public function getAircraftOwnerByRegistration($registration) |
| 2573 | 2573 | { |
| 2574 | 2574 | $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
@@ -2585,11 +2585,11 @@ discard block |
||
| 2585 | 2585 | |
| 2586 | 2586 | |
| 2587 | 2587 | /** |
| 2588 | - * Gets all flights (but with only little info) |
|
| 2589 | - * |
|
| 2590 | - * @return Array basic flight information |
|
| 2591 | - * |
|
| 2592 | - */ |
|
| 2588 | + * Gets all flights (but with only little info) |
|
| 2589 | + * |
|
| 2590 | + * @return Array basic flight information |
|
| 2591 | + * |
|
| 2592 | + */ |
|
| 2593 | 2593 | public function getAllFlightsforSitemap() |
| 2594 | 2594 | { |
| 2595 | 2595 | //$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 "; |
@@ -2597,7 +2597,7 @@ discard block |
||
| 2597 | 2597 | |
| 2598 | 2598 | $sth = $this->db->prepare($query); |
| 2599 | 2599 | $sth->execute(); |
| 2600 | - /* |
|
| 2600 | + /* |
|
| 2601 | 2601 | $flight_array = array(); |
| 2602 | 2602 | $temp_array = array(); |
| 2603 | 2603 | |
@@ -2619,11 +2619,11 @@ discard block |
||
| 2619 | 2619 | } |
| 2620 | 2620 | |
| 2621 | 2621 | /** |
| 2622 | - * Gets a list of all aircraft manufacturers |
|
| 2623 | - * |
|
| 2624 | - * @return Array list of aircraft types |
|
| 2625 | - * |
|
| 2626 | - */ |
|
| 2622 | + * Gets a list of all aircraft manufacturers |
|
| 2623 | + * |
|
| 2624 | + * @return Array list of aircraft types |
|
| 2625 | + * |
|
| 2626 | + */ |
|
| 2627 | 2627 | public function getAllManufacturers() |
| 2628 | 2628 | { |
| 2629 | 2629 | /* |
@@ -2652,11 +2652,11 @@ discard block |
||
| 2652 | 2652 | |
| 2653 | 2653 | |
| 2654 | 2654 | /** |
| 2655 | - * Gets a list of all aircraft types |
|
| 2656 | - * |
|
| 2657 | - * @return Array list of aircraft types |
|
| 2658 | - * |
|
| 2659 | - */ |
|
| 2655 | + * Gets a list of all aircraft types |
|
| 2656 | + * |
|
| 2657 | + * @return Array list of aircraft types |
|
| 2658 | + * |
|
| 2659 | + */ |
|
| 2660 | 2660 | public function getAllAircraftTypes($filters = array()) |
| 2661 | 2661 | { |
| 2662 | 2662 | /* |
@@ -2691,11 +2691,11 @@ discard block |
||
| 2691 | 2691 | |
| 2692 | 2692 | |
| 2693 | 2693 | /** |
| 2694 | - * Gets a list of all aircraft registrations |
|
| 2695 | - * |
|
| 2696 | - * @return Array list of aircraft registrations |
|
| 2697 | - * |
|
| 2698 | - */ |
|
| 2694 | + * Gets a list of all aircraft registrations |
|
| 2695 | + * |
|
| 2696 | + * @return Array list of aircraft registrations |
|
| 2697 | + * |
|
| 2698 | + */ |
|
| 2699 | 2699 | public function getAllAircraftRegistrations($filters = array()) |
| 2700 | 2700 | { |
| 2701 | 2701 | $filter_query = $this->getFilter($filters,true,true); |
@@ -2720,12 +2720,12 @@ discard block |
||
| 2720 | 2720 | } |
| 2721 | 2721 | |
| 2722 | 2722 | /** |
| 2723 | - * Gets all source name |
|
| 2724 | - * |
|
| 2725 | - * @param String type format of source |
|
| 2726 | - * @return Array list of source name |
|
| 2727 | - * |
|
| 2728 | - */ |
|
| 2723 | + * Gets all source name |
|
| 2724 | + * |
|
| 2725 | + * @param String type format of source |
|
| 2726 | + * @return Array list of source name |
|
| 2727 | + * |
|
| 2728 | + */ |
|
| 2729 | 2729 | public function getAllSourceName($type = '',$filters = array()) |
| 2730 | 2730 | { |
| 2731 | 2731 | $filter_query = $this->getFilter($filters,true,true); |
@@ -2756,11 +2756,11 @@ discard block |
||
| 2756 | 2756 | |
| 2757 | 2757 | |
| 2758 | 2758 | /** |
| 2759 | - * Gets a list of all airline names |
|
| 2760 | - * |
|
| 2761 | - * @return Array list of airline names |
|
| 2762 | - * |
|
| 2763 | - */ |
|
| 2759 | + * Gets a list of all airline names |
|
| 2760 | + * |
|
| 2761 | + * @return Array list of airline names |
|
| 2762 | + * |
|
| 2763 | + */ |
|
| 2764 | 2764 | public function getAllAirlineNames($airline_type = '',$forsource = NULL,$filters = array()) |
| 2765 | 2765 | { |
| 2766 | 2766 | global $globalAirlinesSource,$globalVATSIM, $globalIVAO; |
@@ -2809,11 +2809,11 @@ discard block |
||
| 2809 | 2809 | } |
| 2810 | 2810 | |
| 2811 | 2811 | /** |
| 2812 | - * Gets a list of all alliance names |
|
| 2813 | - * |
|
| 2814 | - * @return Array list of alliance names |
|
| 2815 | - * |
|
| 2816 | - */ |
|
| 2812 | + * Gets a list of all alliance names |
|
| 2813 | + * |
|
| 2814 | + * @return Array list of alliance names |
|
| 2815 | + * |
|
| 2816 | + */ |
|
| 2817 | 2817 | public function getAllAllianceNames($forsource = NULL,$filters = array()) |
| 2818 | 2818 | { |
| 2819 | 2819 | global $globalAirlinesSource,$globalVATSIM, $globalIVAO; |
@@ -2838,11 +2838,11 @@ discard block |
||
| 2838 | 2838 | } |
| 2839 | 2839 | |
| 2840 | 2840 | /** |
| 2841 | - * Gets a list of all airline countries |
|
| 2842 | - * |
|
| 2843 | - * @return Array list of airline countries |
|
| 2844 | - * |
|
| 2845 | - */ |
|
| 2841 | + * Gets a list of all airline countries |
|
| 2842 | + * |
|
| 2843 | + * @return Array list of airline countries |
|
| 2844 | + * |
|
| 2845 | + */ |
|
| 2846 | 2846 | public function getAllAirlineCountries($filters = array()) |
| 2847 | 2847 | { |
| 2848 | 2848 | $filter_query = $this->getFilter($filters,true,true); |
@@ -2870,11 +2870,11 @@ discard block |
||
| 2870 | 2870 | |
| 2871 | 2871 | |
| 2872 | 2872 | /** |
| 2873 | - * Gets a list of all departure & arrival names |
|
| 2874 | - * |
|
| 2875 | - * @return Array list of airport names |
|
| 2876 | - * |
|
| 2877 | - */ |
|
| 2873 | + * Gets a list of all departure & arrival names |
|
| 2874 | + * |
|
| 2875 | + * @return Array list of airport names |
|
| 2876 | + * |
|
| 2877 | + */ |
|
| 2878 | 2878 | public function getAllAirportNames($filters = array()) |
| 2879 | 2879 | { |
| 2880 | 2880 | $filter_query = $this->getFilter($filters,true,true); |
@@ -2922,11 +2922,11 @@ discard block |
||
| 2922 | 2922 | } |
| 2923 | 2923 | |
| 2924 | 2924 | /** |
| 2925 | - * Gets a list of all owner names |
|
| 2926 | - * |
|
| 2927 | - * @return Array list of owner names |
|
| 2928 | - * |
|
| 2929 | - */ |
|
| 2925 | + * Gets a list of all owner names |
|
| 2926 | + * |
|
| 2927 | + * @return Array list of owner names |
|
| 2928 | + * |
|
| 2929 | + */ |
|
| 2930 | 2930 | public function getAllOwnerNames($filters = array()) |
| 2931 | 2931 | { |
| 2932 | 2932 | $filter_query = $this->getFilter($filters,true,true); |
@@ -2940,11 +2940,11 @@ discard block |
||
| 2940 | 2940 | } |
| 2941 | 2941 | |
| 2942 | 2942 | /** |
| 2943 | - * Gets a list of all pilot names and pilot ids |
|
| 2944 | - * |
|
| 2945 | - * @return Array list of pilot names and pilot ids |
|
| 2946 | - * |
|
| 2947 | - */ |
|
| 2943 | + * Gets a list of all pilot names and pilot ids |
|
| 2944 | + * |
|
| 2945 | + * @return Array list of pilot names and pilot ids |
|
| 2946 | + * |
|
| 2947 | + */ |
|
| 2948 | 2948 | public function getAllPilotNames($filters = array()) |
| 2949 | 2949 | { |
| 2950 | 2950 | $filter_query = $this->getFilter($filters,true,true); |
@@ -2959,11 +2959,11 @@ discard block |
||
| 2959 | 2959 | |
| 2960 | 2960 | |
| 2961 | 2961 | /** |
| 2962 | - * Gets a list of all departure & arrival airport countries |
|
| 2963 | - * |
|
| 2964 | - * @return Array list of airport countries |
|
| 2965 | - * |
|
| 2966 | - */ |
|
| 2962 | + * Gets a list of all departure & arrival airport countries |
|
| 2963 | + * |
|
| 2964 | + * @return Array list of airport countries |
|
| 2965 | + * |
|
| 2966 | + */ |
|
| 2967 | 2967 | public function getAllAirportCountries($filters = array()) |
| 2968 | 2968 | { |
| 2969 | 2969 | $airport_array = array(); |
@@ -3011,11 +3011,11 @@ discard block |
||
| 3011 | 3011 | |
| 3012 | 3012 | |
| 3013 | 3013 | /** |
| 3014 | - * Gets a list of all countries (airline, departure airport & arrival airport) |
|
| 3015 | - * |
|
| 3016 | - * @return Array list of countries |
|
| 3017 | - * |
|
| 3018 | - */ |
|
| 3014 | + * Gets a list of all countries (airline, departure airport & arrival airport) |
|
| 3015 | + * |
|
| 3016 | + * @return Array list of countries |
|
| 3017 | + * |
|
| 3018 | + */ |
|
| 3019 | 3019 | public function getAllCountries($filters = array()) |
| 3020 | 3020 | { |
| 3021 | 3021 | $Connection= new Connection($this->db); |
@@ -3092,11 +3092,11 @@ discard block |
||
| 3092 | 3092 | |
| 3093 | 3093 | |
| 3094 | 3094 | /** |
| 3095 | - * Gets a list of all idents/callsigns |
|
| 3096 | - * |
|
| 3097 | - * @return Array list of ident/callsign names |
|
| 3098 | - * |
|
| 3099 | - */ |
|
| 3095 | + * Gets a list of all idents/callsigns |
|
| 3096 | + * |
|
| 3097 | + * @return Array list of ident/callsign names |
|
| 3098 | + * |
|
| 3099 | + */ |
|
| 3100 | 3100 | public function getAllIdents($filters = array()) |
| 3101 | 3101 | { |
| 3102 | 3102 | $filter_query = $this->getFilter($filters,true,true); |
@@ -3120,9 +3120,9 @@ discard block |
||
| 3120 | 3120 | } |
| 3121 | 3121 | |
| 3122 | 3122 | /** |
| 3123 | - * Get a list of flights from airport since 7 days |
|
| 3124 | - * @return Array number, icao, name and city of airports |
|
| 3125 | - */ |
|
| 3123 | + * Get a list of flights from airport since 7 days |
|
| 3124 | + * @return Array number, icao, name and city of airports |
|
| 3125 | + */ |
|
| 3126 | 3126 | |
| 3127 | 3127 | public function getLast7DaysAirportsDeparture($airport_icao = '',$filters = array()) { |
| 3128 | 3128 | global $globalTimezone, $globalDBdriver; |
@@ -3153,9 +3153,9 @@ discard block |
||
| 3153 | 3153 | } |
| 3154 | 3154 | |
| 3155 | 3155 | /** |
| 3156 | - * Get a list of flights from airport since 7 days |
|
| 3157 | - * @return Array number, icao, name and city of airports |
|
| 3158 | - */ |
|
| 3156 | + * Get a list of flights from airport since 7 days |
|
| 3157 | + * @return Array number, icao, name and city of airports |
|
| 3158 | + */ |
|
| 3159 | 3159 | |
| 3160 | 3160 | public function getLast7DaysAirportsDepartureByAirlines($airport_icao = '') { |
| 3161 | 3161 | global $globalTimezone, $globalDBdriver; |
@@ -3185,9 +3185,9 @@ discard block |
||
| 3185 | 3185 | } |
| 3186 | 3186 | |
| 3187 | 3187 | /** |
| 3188 | - * Get a list of flights from detected airport since 7 days |
|
| 3189 | - * @return Array number, icao, name and city of airports |
|
| 3190 | - */ |
|
| 3188 | + * Get a list of flights from detected airport since 7 days |
|
| 3189 | + * @return Array number, icao, name and city of airports |
|
| 3190 | + */ |
|
| 3191 | 3191 | |
| 3192 | 3192 | public function getLast7DaysDetectedAirportsDeparture($airport_icao = '', $filters = array()) { |
| 3193 | 3193 | global $globalTimezone, $globalDBdriver; |
@@ -3225,9 +3225,9 @@ discard block |
||
| 3225 | 3225 | } |
| 3226 | 3226 | |
| 3227 | 3227 | /** |
| 3228 | - * Get a list of flights from detected airport since 7 days |
|
| 3229 | - * @return Array number, icao, name and city of airports |
|
| 3230 | - */ |
|
| 3228 | + * Get a list of flights from detected airport since 7 days |
|
| 3229 | + * @return Array number, icao, name and city of airports |
|
| 3230 | + */ |
|
| 3231 | 3231 | |
| 3232 | 3232 | public function getLast7DaysDetectedAirportsDepartureByAirlines($airport_icao = '') { |
| 3233 | 3233 | global $globalTimezone, $globalDBdriver; |
@@ -3269,9 +3269,9 @@ discard block |
||
| 3269 | 3269 | |
| 3270 | 3270 | |
| 3271 | 3271 | /** |
| 3272 | - * Get a list of flights to airport since 7 days |
|
| 3273 | - * @return Array number, icao, name and city of airports |
|
| 3274 | - */ |
|
| 3272 | + * Get a list of flights to airport since 7 days |
|
| 3273 | + * @return Array number, icao, name and city of airports |
|
| 3274 | + */ |
|
| 3275 | 3275 | |
| 3276 | 3276 | public function getLast7DaysAirportsArrival($airport_icao = '', $filters = array()) { |
| 3277 | 3277 | global $globalTimezone, $globalDBdriver; |
@@ -3304,9 +3304,9 @@ discard block |
||
| 3304 | 3304 | |
| 3305 | 3305 | |
| 3306 | 3306 | /** |
| 3307 | - * Get a list of flights detected to airport since 7 days |
|
| 3308 | - * @return Array number, icao, name and city of airports |
|
| 3309 | - */ |
|
| 3307 | + * Get a list of flights detected to airport since 7 days |
|
| 3308 | + * @return Array number, icao, name and city of airports |
|
| 3309 | + */ |
|
| 3310 | 3310 | |
| 3311 | 3311 | public function getLast7DaysDetectedAirportsArrival($airport_icao = '',$filters = array()) { |
| 3312 | 3312 | global $globalTimezone, $globalDBdriver; |
@@ -3347,9 +3347,9 @@ discard block |
||
| 3347 | 3347 | |
| 3348 | 3348 | |
| 3349 | 3349 | /** |
| 3350 | - * Get a list of flights to airport since 7 days |
|
| 3351 | - * @return Array number, icao, name and city of airports |
|
| 3352 | - */ |
|
| 3350 | + * Get a list of flights to airport since 7 days |
|
| 3351 | + * @return Array number, icao, name and city of airports |
|
| 3352 | + */ |
|
| 3353 | 3353 | |
| 3354 | 3354 | public function getLast7DaysAirportsArrivalByAirlines($airport_icao = '') { |
| 3355 | 3355 | global $globalTimezone, $globalDBdriver; |
@@ -3381,9 +3381,9 @@ discard block |
||
| 3381 | 3381 | |
| 3382 | 3382 | |
| 3383 | 3383 | /** |
| 3384 | - * Get a list of flights detected to airport since 7 days |
|
| 3385 | - * @return Array number, icao, name and city of airports |
|
| 3386 | - */ |
|
| 3384 | + * Get a list of flights detected to airport since 7 days |
|
| 3385 | + * @return Array number, icao, name and city of airports |
|
| 3386 | + */ |
|
| 3387 | 3387 | |
| 3388 | 3388 | public function getLast7DaysDetectedAirportsArrivalByAirlines($airport_icao = '') { |
| 3389 | 3389 | global $globalTimezone, $globalDBdriver; |
@@ -3427,11 +3427,11 @@ discard block |
||
| 3427 | 3427 | |
| 3428 | 3428 | |
| 3429 | 3429 | /** |
| 3430 | - * Gets a list of all dates |
|
| 3431 | - * |
|
| 3432 | - * @return Array list of date names |
|
| 3433 | - * |
|
| 3434 | - */ |
|
| 3430 | + * Gets a list of all dates |
|
| 3431 | + * |
|
| 3432 | + * @return Array list of date names |
|
| 3433 | + * |
|
| 3434 | + */ |
|
| 3435 | 3435 | public function getAllDates() |
| 3436 | 3436 | { |
| 3437 | 3437 | global $globalTimezone, $globalDBdriver; |
@@ -3472,11 +3472,11 @@ discard block |
||
| 3472 | 3472 | |
| 3473 | 3473 | |
| 3474 | 3474 | /** |
| 3475 | - * Gets all route combinations |
|
| 3476 | - * |
|
| 3477 | - * @return Array the route list |
|
| 3478 | - * |
|
| 3479 | - */ |
|
| 3475 | + * Gets all route combinations |
|
| 3476 | + * |
|
| 3477 | + * @return Array the route list |
|
| 3478 | + * |
|
| 3479 | + */ |
|
| 3480 | 3480 | public function getAllRoutes() |
| 3481 | 3481 | { |
| 3482 | 3482 | $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 |
@@ -3502,13 +3502,13 @@ discard block |
||
| 3502 | 3502 | } |
| 3503 | 3503 | |
| 3504 | 3504 | /** |
| 3505 | - * Update ident spotter data |
|
| 3506 | - * |
|
| 3507 | - * @param String $flightaware_id the ID from flightaware |
|
| 3508 | - * @param String $ident the flight ident |
|
| 3509 | - * @return String success or false |
|
| 3510 | - * |
|
| 3511 | - */ |
|
| 3505 | + * Update ident spotter data |
|
| 3506 | + * |
|
| 3507 | + * @param String $flightaware_id the ID from flightaware |
|
| 3508 | + * @param String $ident the flight ident |
|
| 3509 | + * @return String success or false |
|
| 3510 | + * |
|
| 3511 | + */ |
|
| 3512 | 3512 | public function updateIdentSpotterData($flightaware_id = '', $ident = '',$fromsource = NULL) |
| 3513 | 3513 | { |
| 3514 | 3514 | if (!is_numeric(substr($ident, 0, 3))) |
@@ -3529,14 +3529,14 @@ discard block |
||
| 3529 | 3529 | } else { |
| 3530 | 3530 | $airline_array = $this->getAllAirlineInfo("NA"); |
| 3531 | 3531 | } |
| 3532 | - $airline_name = $airline_array[0]['name']; |
|
| 3533 | - $airline_icao = $airline_array[0]['icao']; |
|
| 3534 | - $airline_country = $airline_array[0]['country']; |
|
| 3535 | - $airline_type = $airline_array[0]['type']; |
|
| 3532 | + $airline_name = $airline_array[0]['name']; |
|
| 3533 | + $airline_icao = $airline_array[0]['icao']; |
|
| 3534 | + $airline_country = $airline_array[0]['country']; |
|
| 3535 | + $airline_type = $airline_array[0]['type']; |
|
| 3536 | 3536 | |
| 3537 | 3537 | |
| 3538 | 3538 | $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'; |
| 3539 | - $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); |
|
| 3539 | + $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); |
|
| 3540 | 3540 | |
| 3541 | 3541 | try { |
| 3542 | 3542 | $sth = $this->db->prepare($query); |
@@ -3549,19 +3549,19 @@ discard block |
||
| 3549 | 3549 | |
| 3550 | 3550 | } |
| 3551 | 3551 | /** |
| 3552 | - * Update latest spotter data |
|
| 3553 | - * |
|
| 3554 | - * @param String $flightaware_id the ID from flightaware |
|
| 3555 | - * @param String $ident the flight ident |
|
| 3556 | - * @param String $arrival_airport_icao the arrival airport |
|
| 3557 | - * @return String success or false |
|
| 3558 | - * |
|
| 3559 | - */ |
|
| 3552 | + * Update latest spotter data |
|
| 3553 | + * |
|
| 3554 | + * @param String $flightaware_id the ID from flightaware |
|
| 3555 | + * @param String $ident the flight ident |
|
| 3556 | + * @param String $arrival_airport_icao the arrival airport |
|
| 3557 | + * @return String success or false |
|
| 3558 | + * |
|
| 3559 | + */ |
|
| 3560 | 3560 | public function updateLatestSpotterData($flightaware_id = '', $ident = '', $latitude = '', $longitude = '', $altitude = '', $ground = false, $groundspeed = NULL, $date = '', $arrival_airport_icao = '',$arrival_airport_time = '') |
| 3561 | 3561 | { |
| 3562 | 3562 | if ($groundspeed == '') $groundspeed = NULL; |
| 3563 | 3563 | $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'; |
| 3564 | - $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); |
|
| 3564 | + $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); |
|
| 3565 | 3565 | |
| 3566 | 3566 | try { |
| 3567 | 3567 | $sth = $this->db->prepare($query); |
@@ -3575,32 +3575,32 @@ discard block |
||
| 3575 | 3575 | } |
| 3576 | 3576 | |
| 3577 | 3577 | /** |
| 3578 | - * Adds a new spotter data |
|
| 3579 | - * |
|
| 3580 | - * @param String $flightaware_id the ID from flightaware |
|
| 3581 | - * @param String $ident the flight ident |
|
| 3582 | - * @param String $aircraft_icao the aircraft type |
|
| 3583 | - * @param String $departure_airport_icao the departure airport |
|
| 3584 | - * @param String $arrival_airport_icao the arrival airport |
|
| 3585 | - * @param String $latitude latitude of flight |
|
| 3586 | - * @param String $longitude latitude of flight |
|
| 3587 | - * @param String $waypoints waypoints of flight |
|
| 3588 | - * @param String $altitude altitude of flight |
|
| 3589 | - * @param String $heading heading of flight |
|
| 3590 | - * @param String $groundspeed speed of flight |
|
| 3591 | - * @param String $date date of flight |
|
| 3592 | - * @param String $departure_airport_time departure time of flight |
|
| 3593 | - * @param String $arrival_airport_time arrival time of flight |
|
| 3594 | - * @param String $squawk squawk code of flight |
|
| 3595 | - * @param String $route_stop route stop of flight |
|
| 3596 | - * @param String $highlight highlight or not |
|
| 3597 | - * @param String $ModeS ModesS code of flight |
|
| 3598 | - * @param String $registration registration code of flight |
|
| 3599 | - * @param String $pilot_id pilot id of flight (for virtual airlines) |
|
| 3600 | - * @param String $pilot_name pilot name of flight (for virtual airlines) |
|
| 3601 | - * @param String $verticalrate vertival rate of flight |
|
| 3602 | - * @return String success or false |
|
| 3603 | - */ |
|
| 3578 | + * Adds a new spotter data |
|
| 3579 | + * |
|
| 3580 | + * @param String $flightaware_id the ID from flightaware |
|
| 3581 | + * @param String $ident the flight ident |
|
| 3582 | + * @param String $aircraft_icao the aircraft type |
|
| 3583 | + * @param String $departure_airport_icao the departure airport |
|
| 3584 | + * @param String $arrival_airport_icao the arrival airport |
|
| 3585 | + * @param String $latitude latitude of flight |
|
| 3586 | + * @param String $longitude latitude of flight |
|
| 3587 | + * @param String $waypoints waypoints of flight |
|
| 3588 | + * @param String $altitude altitude of flight |
|
| 3589 | + * @param String $heading heading of flight |
|
| 3590 | + * @param String $groundspeed speed of flight |
|
| 3591 | + * @param String $date date of flight |
|
| 3592 | + * @param String $departure_airport_time departure time of flight |
|
| 3593 | + * @param String $arrival_airport_time arrival time of flight |
|
| 3594 | + * @param String $squawk squawk code of flight |
|
| 3595 | + * @param String $route_stop route stop of flight |
|
| 3596 | + * @param String $highlight highlight or not |
|
| 3597 | + * @param String $ModeS ModesS code of flight |
|
| 3598 | + * @param String $registration registration code of flight |
|
| 3599 | + * @param String $pilot_id pilot id of flight (for virtual airlines) |
|
| 3600 | + * @param String $pilot_name pilot name of flight (for virtual airlines) |
|
| 3601 | + * @param String $verticalrate vertival rate of flight |
|
| 3602 | + * @return String success or false |
|
| 3603 | + */ |
|
| 3604 | 3604 | public function addSpotterData($flightaware_id = '', $ident = '', $aircraft_icao = '', $departure_airport_icao = '', $arrival_airport_icao = '', $latitude = '', $longitude = '', $waypoints = '', $altitude = '', $altitude_real = '',$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 = '',$source_type = '') |
| 3605 | 3605 | { |
| 3606 | 3606 | global $globalURL, $globalIVAO, $globalVATSIM, $globalphpVMS, $globalDebugTimeElapsed, $globalAirlinesSource, $globalVAM; |
@@ -3815,8 +3815,8 @@ discard block |
||
| 3815 | 3815 | |
| 3816 | 3816 | if (($globalIVAO || $globalVATSIM || $globalphpVMS || $globalVAM) && $aircraft_icao != '') |
| 3817 | 3817 | { |
| 3818 | - if (isset($airline_array[0]['icao'])) $airline_icao = $airline_array[0]['icao']; |
|
| 3819 | - else $airline_icao = ''; |
|
| 3818 | + if (isset($airline_array[0]['icao'])) $airline_icao = $airline_array[0]['icao']; |
|
| 3819 | + else $airline_icao = ''; |
|
| 3820 | 3820 | $image_array = $Image->getSpotterImage('',$aircraft_icao,$airline_icao); |
| 3821 | 3821 | if (!isset($image_array[0]['registration'])) |
| 3822 | 3822 | { |
@@ -3847,53 +3847,53 @@ discard block |
||
| 3847 | 3847 | |
| 3848 | 3848 | if (count($airline_array) == 0) |
| 3849 | 3849 | { |
| 3850 | - $airline_array = $this->getAllAirlineInfo('NA'); |
|
| 3851 | - } |
|
| 3852 | - if (count($aircraft_array) == 0) |
|
| 3853 | - { |
|
| 3854 | - $aircraft_array = $this->getAllAircraftInfo('NA'); |
|
| 3855 | - } |
|
| 3856 | - if (count($departure_airport_array) == 0 || $departure_airport_array[0]['icao'] == '' || $departure_airport_icao == '') |
|
| 3857 | - { |
|
| 3858 | - $departure_airport_array = $this->getAllAirportInfo('NA'); |
|
| 3859 | - } |
|
| 3860 | - if (count($arrival_airport_array) == 0 || $arrival_airport_array[0]['icao'] == '' || $arrival_airport_icao == '') |
|
| 3861 | - { |
|
| 3862 | - $arrival_airport_array = $this->getAllAirportInfo('NA'); |
|
| 3863 | - } |
|
| 3864 | - if ($registration == '') $registration = 'NA'; |
|
| 3865 | - if ($latitude == '' && $longitude == '') { |
|
| 3866 | - $latitude = 0; |
|
| 3867 | - $longitude = 0; |
|
| 3868 | - } |
|
| 3869 | - if ($squawk == '' || $Common->isInteger($squawk) === false) $squawk = NULL; |
|
| 3870 | - if ($verticalrate == '' || $Common->isInteger($verticalrate) === false) $verticalrate = NULL; |
|
| 3871 | - if ($heading == '' || $Common->isInteger($heading) === false) $heading = 0; |
|
| 3872 | - if ($groundspeed == '' || $Common->isInteger($groundspeed) === false) $groundspeed = 0; |
|
| 3873 | - if (!isset($aircraft_owner)) $aircraft_owner = NULL; |
|
| 3874 | - $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) |
|
| 3850 | + $airline_array = $this->getAllAirlineInfo('NA'); |
|
| 3851 | + } |
|
| 3852 | + if (count($aircraft_array) == 0) |
|
| 3853 | + { |
|
| 3854 | + $aircraft_array = $this->getAllAircraftInfo('NA'); |
|
| 3855 | + } |
|
| 3856 | + if (count($departure_airport_array) == 0 || $departure_airport_array[0]['icao'] == '' || $departure_airport_icao == '') |
|
| 3857 | + { |
|
| 3858 | + $departure_airport_array = $this->getAllAirportInfo('NA'); |
|
| 3859 | + } |
|
| 3860 | + if (count($arrival_airport_array) == 0 || $arrival_airport_array[0]['icao'] == '' || $arrival_airport_icao == '') |
|
| 3861 | + { |
|
| 3862 | + $arrival_airport_array = $this->getAllAirportInfo('NA'); |
|
| 3863 | + } |
|
| 3864 | + if ($registration == '') $registration = 'NA'; |
|
| 3865 | + if ($latitude == '' && $longitude == '') { |
|
| 3866 | + $latitude = 0; |
|
| 3867 | + $longitude = 0; |
|
| 3868 | + } |
|
| 3869 | + if ($squawk == '' || $Common->isInteger($squawk) === false) $squawk = NULL; |
|
| 3870 | + if ($verticalrate == '' || $Common->isInteger($verticalrate) === false) $verticalrate = NULL; |
|
| 3871 | + if ($heading == '' || $Common->isInteger($heading) === false) $heading = 0; |
|
| 3872 | + if ($groundspeed == '' || $Common->isInteger($groundspeed) === false) $groundspeed = 0; |
|
| 3873 | + if (!isset($aircraft_owner)) $aircraft_owner = NULL; |
|
| 3874 | + $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) |
|
| 3875 | 3875 | 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)"; |
| 3876 | 3876 | |
| 3877 | - $airline_name = $airline_array[0]['name']; |
|
| 3878 | - $airline_icao = $airline_array[0]['icao']; |
|
| 3879 | - $airline_country = $airline_array[0]['country']; |
|
| 3880 | - $airline_type = $airline_array[0]['type']; |
|
| 3877 | + $airline_name = $airline_array[0]['name']; |
|
| 3878 | + $airline_icao = $airline_array[0]['icao']; |
|
| 3879 | + $airline_country = $airline_array[0]['country']; |
|
| 3880 | + $airline_type = $airline_array[0]['type']; |
|
| 3881 | 3881 | if ($airline_type == '') { |
| 3882 | 3882 | $timeelapsed = microtime(true); |
| 3883 | 3883 | $airline_type = $this->getAircraftTypeBymodeS($ModeS); |
| 3884 | 3884 | if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftTypeBymodes : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
| 3885 | 3885 | } |
| 3886 | 3886 | if ($airline_type == null) $airline_type = ''; |
| 3887 | - $aircraft_type = $aircraft_array[0]['type']; |
|
| 3888 | - $aircraft_manufacturer = $aircraft_array[0]['manufacturer']; |
|
| 3889 | - $departure_airport_name = $departure_airport_array[0]['name']; |
|
| 3890 | - $departure_airport_city = $departure_airport_array[0]['city']; |
|
| 3891 | - $departure_airport_country = $departure_airport_array[0]['country']; |
|
| 3887 | + $aircraft_type = $aircraft_array[0]['type']; |
|
| 3888 | + $aircraft_manufacturer = $aircraft_array[0]['manufacturer']; |
|
| 3889 | + $departure_airport_name = $departure_airport_array[0]['name']; |
|
| 3890 | + $departure_airport_city = $departure_airport_array[0]['city']; |
|
| 3891 | + $departure_airport_country = $departure_airport_array[0]['country']; |
|
| 3892 | 3892 | |
| 3893 | - $arrival_airport_name = $arrival_airport_array[0]['name']; |
|
| 3894 | - $arrival_airport_city = $arrival_airport_array[0]['city']; |
|
| 3895 | - $arrival_airport_country = $arrival_airport_array[0]['country']; |
|
| 3896 | - $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); |
|
| 3893 | + $arrival_airport_name = $arrival_airport_array[0]['name']; |
|
| 3894 | + $arrival_airport_city = $arrival_airport_array[0]['city']; |
|
| 3895 | + $arrival_airport_country = $arrival_airport_array[0]['country']; |
|
| 3896 | + $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); |
|
| 3897 | 3897 | |
| 3898 | 3898 | try { |
| 3899 | 3899 | |
@@ -3901,7 +3901,7 @@ discard block |
||
| 3901 | 3901 | $sth->execute($query_values); |
| 3902 | 3902 | $this->db = null; |
| 3903 | 3903 | } catch (PDOException $e) { |
| 3904 | - return "error : ".$e->getMessage(); |
|
| 3904 | + return "error : ".$e->getMessage(); |
|
| 3905 | 3905 | } |
| 3906 | 3906 | |
| 3907 | 3907 | return "success"; |
@@ -3910,11 +3910,11 @@ discard block |
||
| 3910 | 3910 | |
| 3911 | 3911 | |
| 3912 | 3912 | /** |
| 3913 | - * Gets the aircraft ident within the last hour |
|
| 3914 | - * |
|
| 3915 | - * @return String the ident |
|
| 3916 | - * |
|
| 3917 | - */ |
|
| 3913 | + * Gets the aircraft ident within the last hour |
|
| 3914 | + * |
|
| 3915 | + * @return String the ident |
|
| 3916 | + * |
|
| 3917 | + */ |
|
| 3918 | 3918 | public function getIdentFromLastHour($ident) |
| 3919 | 3919 | { |
| 3920 | 3920 | global $globalDBdriver, $globalTimezone; |
@@ -3930,11 +3930,11 @@ discard block |
||
| 3930 | 3930 | AND spotter_output.date >= now() AT TIME ZONE 'UTC' - INTERVAL '1 HOURS' |
| 3931 | 3931 | AND spotter_output.date < now() AT TIME ZONE 'UTC'"; |
| 3932 | 3932 | $query_data = array(':ident' => $ident); |
| 3933 | - } |
|
| 3933 | + } |
|
| 3934 | 3934 | |
| 3935 | 3935 | $sth = $this->db->prepare($query); |
| 3936 | 3936 | $sth->execute($query_data); |
| 3937 | - $ident_result=''; |
|
| 3937 | + $ident_result=''; |
|
| 3938 | 3938 | while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
| 3939 | 3939 | { |
| 3940 | 3940 | $ident_result = $row['ident']; |
@@ -3945,11 +3945,11 @@ discard block |
||
| 3945 | 3945 | |
| 3946 | 3946 | |
| 3947 | 3947 | /** |
| 3948 | - * Gets the aircraft data from the last 20 seconds |
|
| 3949 | - * |
|
| 3950 | - * @return Array the spotter data |
|
| 3951 | - * |
|
| 3952 | - */ |
|
| 3948 | + * Gets the aircraft data from the last 20 seconds |
|
| 3949 | + * |
|
| 3950 | + * @return Array the spotter data |
|
| 3951 | + * |
|
| 3952 | + */ |
|
| 3953 | 3953 | public function getRealTimeData($q = '') |
| 3954 | 3954 | { |
| 3955 | 3955 | global $globalDBdriver; |
@@ -3993,11 +3993,11 @@ discard block |
||
| 3993 | 3993 | |
| 3994 | 3994 | |
| 3995 | 3995 | /** |
| 3996 | - * Gets all airlines that have flown over |
|
| 3997 | - * |
|
| 3998 | - * @return Array the airline list |
|
| 3999 | - * |
|
| 4000 | - */ |
|
| 3996 | + * Gets all airlines that have flown over |
|
| 3997 | + * |
|
| 3998 | + * @return Array the airline list |
|
| 3999 | + * |
|
| 4000 | + */ |
|
| 4001 | 4001 | public function countAllAirlines($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array(), $year = '', $month = '', $day = '') |
| 4002 | 4002 | { |
| 4003 | 4003 | global $globalDBdriver; |
@@ -4011,7 +4011,7 @@ discard block |
||
| 4011 | 4011 | $query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
| 4012 | 4012 | } |
| 4013 | 4013 | } |
| 4014 | - if ($sincedate != '') { |
|
| 4014 | + if ($sincedate != '') { |
|
| 4015 | 4015 | if ($globalDBdriver == 'mysql') { |
| 4016 | 4016 | $query .= " AND spotter_output.date > '".$sincedate."'"; |
| 4017 | 4017 | } else { |
@@ -4065,26 +4065,26 @@ discard block |
||
| 4065 | 4065 | } |
| 4066 | 4066 | |
| 4067 | 4067 | /** |
| 4068 | - * Gets all pilots that have flown over |
|
| 4069 | - * |
|
| 4070 | - * @return Array the pilots list |
|
| 4071 | - * |
|
| 4072 | - */ |
|
| 4068 | + * Gets all pilots that have flown over |
|
| 4069 | + * |
|
| 4070 | + * @return Array the pilots list |
|
| 4071 | + * |
|
| 4072 | + */ |
|
| 4073 | 4073 | public function countAllPilots($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array(),$year = '', $month = '',$day = '') |
| 4074 | 4074 | { |
| 4075 | 4075 | global $globalDBdriver; |
| 4076 | 4076 | $filter_query = $this->getFilter($filters,true,true); |
| 4077 | 4077 | $query = "SELECT DISTINCT spotter_output.pilot_id, s.pilot_name, COUNT(spotter_output.pilot_id) AS pilot_count, spotter_output.format_source |
| 4078 | 4078 | FROM spotter_output LEFT JOIN (SELECT DISTINCT pilot_id, pilot_name, max(date) as date FROM spotter_output GROUP BY pilot_id, pilot_name) s ON s.pilot_id = spotter_output.pilot_id".$filter_query." spotter_output.pilot_id <> ''"; |
| 4079 | - if ($olderthanmonths > 0) { |
|
| 4080 | - if ($globalDBdriver == 'mysql') { |
|
| 4079 | + if ($olderthanmonths > 0) { |
|
| 4080 | + if ($globalDBdriver == 'mysql') { |
|
| 4081 | 4081 | $query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)'; |
| 4082 | 4082 | } else { |
| 4083 | 4083 | $query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
| 4084 | 4084 | } |
| 4085 | 4085 | } |
| 4086 | - if ($sincedate != '') { |
|
| 4087 | - if ($globalDBdriver == 'mysql') { |
|
| 4086 | + if ($sincedate != '') { |
|
| 4087 | + if ($globalDBdriver == 'mysql') { |
|
| 4088 | 4088 | $query .= " AND spotter_output.date > '".$sincedate."'"; |
| 4089 | 4089 | } else { |
| 4090 | 4090 | $query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -4139,25 +4139,25 @@ discard block |
||
| 4139 | 4139 | } |
| 4140 | 4140 | |
| 4141 | 4141 | /** |
| 4142 | - * Gets all pilots that have flown over |
|
| 4143 | - * |
|
| 4144 | - * @return Array the pilots list |
|
| 4145 | - * |
|
| 4146 | - */ |
|
| 4142 | + * Gets all pilots that have flown over |
|
| 4143 | + * |
|
| 4144 | + * @return Array the pilots list |
|
| 4145 | + * |
|
| 4146 | + */ |
|
| 4147 | 4147 | public function countAllPilotsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '') |
| 4148 | 4148 | { |
| 4149 | 4149 | global $globalDBdriver; |
| 4150 | 4150 | $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 |
| 4151 | 4151 | FROM spotter_output WHERE spotter_output.pilot_id <> '' "; |
| 4152 | - if ($olderthanmonths > 0) { |
|
| 4153 | - if ($globalDBdriver == 'mysql') { |
|
| 4152 | + if ($olderthanmonths > 0) { |
|
| 4153 | + if ($globalDBdriver == 'mysql') { |
|
| 4154 | 4154 | $query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) '; |
| 4155 | 4155 | } else { |
| 4156 | 4156 | $query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
| 4157 | 4157 | } |
| 4158 | 4158 | } |
| 4159 | - if ($sincedate != '') { |
|
| 4160 | - if ($globalDBdriver == 'mysql') { |
|
| 4159 | + if ($sincedate != '') { |
|
| 4160 | + if ($globalDBdriver == 'mysql') { |
|
| 4161 | 4161 | $query .= "AND spotter_output.date > '".$sincedate."' "; |
| 4162 | 4162 | } else { |
| 4163 | 4163 | $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -4186,26 +4186,26 @@ discard block |
||
| 4186 | 4186 | } |
| 4187 | 4187 | |
| 4188 | 4188 | /** |
| 4189 | - * Gets all owner that have flown over |
|
| 4190 | - * |
|
| 4191 | - * @return Array the pilots list |
|
| 4192 | - * |
|
| 4193 | - */ |
|
| 4189 | + * Gets all owner that have flown over |
|
| 4190 | + * |
|
| 4191 | + * @return Array the pilots list |
|
| 4192 | + * |
|
| 4193 | + */ |
|
| 4194 | 4194 | public function countAllOwners($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array(),$year = '',$month = '',$day = '') |
| 4195 | 4195 | { |
| 4196 | 4196 | global $globalDBdriver; |
| 4197 | 4197 | $filter_query = $this->getFilter($filters,true,true); |
| 4198 | 4198 | $query = "SELECT DISTINCT spotter_output.owner_name, COUNT(spotter_output.owner_name) AS owner_count |
| 4199 | 4199 | FROM spotter_output".$filter_query." spotter_output.owner_name <> '' AND spotter_output.owner_name IS NOT NULL"; |
| 4200 | - if ($olderthanmonths > 0) { |
|
| 4201 | - if ($globalDBdriver == 'mysql') { |
|
| 4200 | + if ($olderthanmonths > 0) { |
|
| 4201 | + if ($globalDBdriver == 'mysql') { |
|
| 4202 | 4202 | $query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)'; |
| 4203 | 4203 | } else { |
| 4204 | 4204 | $query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
| 4205 | 4205 | } |
| 4206 | 4206 | } |
| 4207 | - if ($sincedate != '') { |
|
| 4208 | - if ($globalDBdriver == 'mysql') { |
|
| 4207 | + if ($sincedate != '') { |
|
| 4208 | + if ($globalDBdriver == 'mysql') { |
|
| 4209 | 4209 | $query .= " AND spotter_output.date > '".$sincedate."' "; |
| 4210 | 4210 | } else { |
| 4211 | 4211 | $query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -4256,26 +4256,26 @@ discard block |
||
| 4256 | 4256 | } |
| 4257 | 4257 | |
| 4258 | 4258 | /** |
| 4259 | - * Gets all owner that have flown over |
|
| 4260 | - * |
|
| 4261 | - * @return Array the pilots list |
|
| 4262 | - * |
|
| 4263 | - */ |
|
| 4259 | + * Gets all owner that have flown over |
|
| 4260 | + * |
|
| 4261 | + * @return Array the pilots list |
|
| 4262 | + * |
|
| 4263 | + */ |
|
| 4264 | 4264 | public function countAllOwnersByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array()) |
| 4265 | 4265 | { |
| 4266 | 4266 | global $globalDBdriver; |
| 4267 | 4267 | $filter_query = $this->getFilter($filters,true,true); |
| 4268 | 4268 | $query = "SELECT DISTINCT spotter_output.airline_icao, spotter_output.owner_name, COUNT(spotter_output.owner_name) AS owner_count |
| 4269 | 4269 | FROM spotter_output".$filter_query." spotter_output.owner_name <> '' AND spotter_output.owner_name IS NOT NULL "; |
| 4270 | - if ($olderthanmonths > 0) { |
|
| 4271 | - if ($globalDBdriver == 'mysql') { |
|
| 4270 | + if ($olderthanmonths > 0) { |
|
| 4271 | + if ($globalDBdriver == 'mysql') { |
|
| 4272 | 4272 | $query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) '; |
| 4273 | 4273 | } else { |
| 4274 | 4274 | $query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
| 4275 | 4275 | } |
| 4276 | 4276 | } |
| 4277 | - if ($sincedate != '') { |
|
| 4278 | - if ($globalDBdriver == 'mysql') { |
|
| 4277 | + if ($sincedate != '') { |
|
| 4278 | + if ($globalDBdriver == 'mysql') { |
|
| 4279 | 4279 | $query .= "AND spotter_output.date > '".$sincedate."' "; |
| 4280 | 4280 | } else { |
| 4281 | 4281 | $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -4302,11 +4302,11 @@ discard block |
||
| 4302 | 4302 | } |
| 4303 | 4303 | |
| 4304 | 4304 | /** |
| 4305 | - * Gets all airlines that have flown over by aircraft |
|
| 4306 | - * |
|
| 4307 | - * @return Array the airline list |
|
| 4308 | - * |
|
| 4309 | - */ |
|
| 4305 | + * Gets all airlines that have flown over by aircraft |
|
| 4306 | + * |
|
| 4307 | + * @return Array the airline list |
|
| 4308 | + * |
|
| 4309 | + */ |
|
| 4310 | 4310 | public function countAllAirlinesByAircraft($aircraft_icao,$filters = array()) |
| 4311 | 4311 | { |
| 4312 | 4312 | $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
@@ -4338,11 +4338,11 @@ discard block |
||
| 4338 | 4338 | |
| 4339 | 4339 | |
| 4340 | 4340 | /** |
| 4341 | - * Gets all airline countries that have flown over by aircraft |
|
| 4342 | - * |
|
| 4343 | - * @return Array the airline country list |
|
| 4344 | - * |
|
| 4345 | - */ |
|
| 4341 | + * Gets all airline countries that have flown over by aircraft |
|
| 4342 | + * |
|
| 4343 | + * @return Array the airline country list |
|
| 4344 | + * |
|
| 4345 | + */ |
|
| 4346 | 4346 | public function countAllAirlineCountriesByAircraft($aircraft_icao,$filters = array()) |
| 4347 | 4347 | { |
| 4348 | 4348 | $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
@@ -4375,11 +4375,11 @@ discard block |
||
| 4375 | 4375 | |
| 4376 | 4376 | |
| 4377 | 4377 | /** |
| 4378 | - * Gets all airlines that have flown over by airport |
|
| 4379 | - * |
|
| 4380 | - * @return Array the airline list |
|
| 4381 | - * |
|
| 4382 | - */ |
|
| 4378 | + * Gets all airlines that have flown over by airport |
|
| 4379 | + * |
|
| 4380 | + * @return Array the airline list |
|
| 4381 | + * |
|
| 4382 | + */ |
|
| 4383 | 4383 | public function countAllAirlinesByAirport($airport_icao,$filters = array()) |
| 4384 | 4384 | { |
| 4385 | 4385 | $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
@@ -4410,11 +4410,11 @@ discard block |
||
| 4410 | 4410 | |
| 4411 | 4411 | |
| 4412 | 4412 | /** |
| 4413 | - * Gets all airline countries that have flown over by airport icao |
|
| 4414 | - * |
|
| 4415 | - * @return Array the airline country list |
|
| 4416 | - * |
|
| 4417 | - */ |
|
| 4413 | + * Gets all airline countries that have flown over by airport icao |
|
| 4414 | + * |
|
| 4415 | + * @return Array the airline country list |
|
| 4416 | + * |
|
| 4417 | + */ |
|
| 4418 | 4418 | public function countAllAirlineCountriesByAirport($airport_icao,$filters = array()) |
| 4419 | 4419 | { |
| 4420 | 4420 | $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
@@ -4445,11 +4445,11 @@ discard block |
||
| 4445 | 4445 | |
| 4446 | 4446 | |
| 4447 | 4447 | /** |
| 4448 | - * Gets all airlines that have flown over by aircraft manufacturer |
|
| 4449 | - * |
|
| 4450 | - * @return Array the airline list |
|
| 4451 | - * |
|
| 4452 | - */ |
|
| 4448 | + * Gets all airlines that have flown over by aircraft manufacturer |
|
| 4449 | + * |
|
| 4450 | + * @return Array the airline list |
|
| 4451 | + * |
|
| 4452 | + */ |
|
| 4453 | 4453 | public function countAllAirlinesByManufacturer($aircraft_manufacturer,$filters = array()) |
| 4454 | 4454 | { |
| 4455 | 4455 | $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
@@ -4480,11 +4480,11 @@ discard block |
||
| 4480 | 4480 | |
| 4481 | 4481 | |
| 4482 | 4482 | /** |
| 4483 | - * Gets all airline countries that have flown over by aircraft manufacturer |
|
| 4484 | - * |
|
| 4485 | - * @return Array the airline country list |
|
| 4486 | - * |
|
| 4487 | - */ |
|
| 4483 | + * Gets all airline countries that have flown over by aircraft manufacturer |
|
| 4484 | + * |
|
| 4485 | + * @return Array the airline country list |
|
| 4486 | + * |
|
| 4487 | + */ |
|
| 4488 | 4488 | public function countAllAirlineCountriesByManufacturer($aircraft_manufacturer,$filters = array()) |
| 4489 | 4489 | { |
| 4490 | 4490 | $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
@@ -4513,11 +4513,11 @@ discard block |
||
| 4513 | 4513 | |
| 4514 | 4514 | |
| 4515 | 4515 | /** |
| 4516 | - * Gets all airlines that have flown over by date |
|
| 4517 | - * |
|
| 4518 | - * @return Array the airline list |
|
| 4519 | - * |
|
| 4520 | - */ |
|
| 4516 | + * Gets all airlines that have flown over by date |
|
| 4517 | + * |
|
| 4518 | + * @return Array the airline list |
|
| 4519 | + * |
|
| 4520 | + */ |
|
| 4521 | 4521 | public function countAllAirlinesByDate($date,$filters = array()) |
| 4522 | 4522 | { |
| 4523 | 4523 | global $globalTimezone, $globalDBdriver; |
@@ -4561,11 +4561,11 @@ discard block |
||
| 4561 | 4561 | |
| 4562 | 4562 | |
| 4563 | 4563 | /** |
| 4564 | - * Gets all airline countries that have flown over by date |
|
| 4565 | - * |
|
| 4566 | - * @return Array the airline country list |
|
| 4567 | - * |
|
| 4568 | - */ |
|
| 4564 | + * Gets all airline countries that have flown over by date |
|
| 4565 | + * |
|
| 4566 | + * @return Array the airline country list |
|
| 4567 | + * |
|
| 4568 | + */ |
|
| 4569 | 4569 | public function countAllAirlineCountriesByDate($date,$filters = array()) |
| 4570 | 4570 | { |
| 4571 | 4571 | global $globalTimezone, $globalDBdriver; |
@@ -4608,11 +4608,11 @@ discard block |
||
| 4608 | 4608 | |
| 4609 | 4609 | |
| 4610 | 4610 | /** |
| 4611 | - * Gets all airlines that have flown over by ident/callsign |
|
| 4612 | - * |
|
| 4613 | - * @return Array the airline list |
|
| 4614 | - * |
|
| 4615 | - */ |
|
| 4611 | + * Gets all airlines that have flown over by ident/callsign |
|
| 4612 | + * |
|
| 4613 | + * @return Array the airline list |
|
| 4614 | + * |
|
| 4615 | + */ |
|
| 4616 | 4616 | public function countAllAirlinesByIdent($ident,$filters = array()) |
| 4617 | 4617 | { |
| 4618 | 4618 | $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
@@ -4629,11 +4629,11 @@ discard block |
||
| 4629 | 4629 | } |
| 4630 | 4630 | |
| 4631 | 4631 | /** |
| 4632 | - * Gets all airlines by owner |
|
| 4633 | - * |
|
| 4634 | - * @return Array the airline list |
|
| 4635 | - * |
|
| 4636 | - */ |
|
| 4632 | + * Gets all airlines by owner |
|
| 4633 | + * |
|
| 4634 | + * @return Array the airline list |
|
| 4635 | + * |
|
| 4636 | + */ |
|
| 4637 | 4637 | public function countAllAirlinesByOwner($owner,$filters = array()) |
| 4638 | 4638 | { |
| 4639 | 4639 | $owner = filter_var($owner,FILTER_SANITIZE_STRING); |
@@ -4650,11 +4650,11 @@ discard block |
||
| 4650 | 4650 | } |
| 4651 | 4651 | |
| 4652 | 4652 | /** |
| 4653 | - * Gets flight duration by owner |
|
| 4654 | - * |
|
| 4655 | - * @return String Duration of all flights |
|
| 4656 | - * |
|
| 4657 | - */ |
|
| 4653 | + * Gets flight duration by owner |
|
| 4654 | + * |
|
| 4655 | + * @return String Duration of all flights |
|
| 4656 | + * |
|
| 4657 | + */ |
|
| 4658 | 4658 | public function getFlightDurationByOwner($owner,$filters = array(),$year = '',$month = '',$day = '') |
| 4659 | 4659 | { |
| 4660 | 4660 | global $globalDBdriver; |
@@ -4701,11 +4701,11 @@ discard block |
||
| 4701 | 4701 | } |
| 4702 | 4702 | |
| 4703 | 4703 | /** |
| 4704 | - * Count flights by owner |
|
| 4705 | - * |
|
| 4706 | - * @return String Duration of all flights |
|
| 4707 | - * |
|
| 4708 | - */ |
|
| 4704 | + * Count flights by owner |
|
| 4705 | + * |
|
| 4706 | + * @return String Duration of all flights |
|
| 4707 | + * |
|
| 4708 | + */ |
|
| 4709 | 4709 | public function countFlightsByOwner($owner,$filters = array()) |
| 4710 | 4710 | { |
| 4711 | 4711 | $owner = filter_var($owner,FILTER_SANITIZE_STRING); |
@@ -4721,11 +4721,11 @@ discard block |
||
| 4721 | 4721 | } |
| 4722 | 4722 | |
| 4723 | 4723 | /** |
| 4724 | - * Count flights by pilot |
|
| 4725 | - * |
|
| 4726 | - * @return String Duration of all flights |
|
| 4727 | - * |
|
| 4728 | - */ |
|
| 4724 | + * Count flights by pilot |
|
| 4725 | + * |
|
| 4726 | + * @return String Duration of all flights |
|
| 4727 | + * |
|
| 4728 | + */ |
|
| 4729 | 4729 | public function countFlightsByPilot($pilot,$filters = array()) |
| 4730 | 4730 | { |
| 4731 | 4731 | $pilot = filter_var($pilot,FILTER_SANITIZE_STRING); |
@@ -4741,11 +4741,11 @@ discard block |
||
| 4741 | 4741 | } |
| 4742 | 4742 | |
| 4743 | 4743 | /** |
| 4744 | - * Gets flight duration by pilot |
|
| 4745 | - * |
|
| 4746 | - * @return String Duration of all flights |
|
| 4747 | - * |
|
| 4748 | - */ |
|
| 4744 | + * Gets flight duration by pilot |
|
| 4745 | + * |
|
| 4746 | + * @return String Duration of all flights |
|
| 4747 | + * |
|
| 4748 | + */ |
|
| 4749 | 4749 | public function getFlightDurationByPilot($pilot,$filters = array(),$year = '',$month = '',$day = '') |
| 4750 | 4750 | { |
| 4751 | 4751 | global $globalDBdriver; |
@@ -4791,11 +4791,11 @@ discard block |
||
| 4791 | 4791 | } |
| 4792 | 4792 | |
| 4793 | 4793 | /** |
| 4794 | - * Gets all airlines used by pilot |
|
| 4795 | - * |
|
| 4796 | - * @return Array the airline list |
|
| 4797 | - * |
|
| 4798 | - */ |
|
| 4794 | + * Gets all airlines used by pilot |
|
| 4795 | + * |
|
| 4796 | + * @return Array the airline list |
|
| 4797 | + * |
|
| 4798 | + */ |
|
| 4799 | 4799 | public function countAllAirlinesByPilot($pilot,$filters = array()) |
| 4800 | 4800 | { |
| 4801 | 4801 | $pilot = filter_var($pilot,FILTER_SANITIZE_STRING); |
@@ -4812,11 +4812,11 @@ discard block |
||
| 4812 | 4812 | } |
| 4813 | 4813 | |
| 4814 | 4814 | /** |
| 4815 | - * Gets all airlines that have flown over by route |
|
| 4816 | - * |
|
| 4817 | - * @return Array the airline list |
|
| 4818 | - * |
|
| 4819 | - */ |
|
| 4815 | + * Gets all airlines that have flown over by route |
|
| 4816 | + * |
|
| 4817 | + * @return Array the airline list |
|
| 4818 | + * |
|
| 4819 | + */ |
|
| 4820 | 4820 | public function countAllAirlinesByRoute($departure_airport_icao, $arrival_airport_icao,$filters = array()) |
| 4821 | 4821 | { |
| 4822 | 4822 | $filter_query = $this->getFilter($filters,true,true); |
@@ -4848,11 +4848,11 @@ discard block |
||
| 4848 | 4848 | } |
| 4849 | 4849 | |
| 4850 | 4850 | /** |
| 4851 | - * Gets all airline countries that have flown over by route |
|
| 4852 | - * |
|
| 4853 | - * @return Array the airline country list |
|
| 4854 | - * |
|
| 4855 | - */ |
|
| 4851 | + * Gets all airline countries that have flown over by route |
|
| 4852 | + * |
|
| 4853 | + * @return Array the airline country list |
|
| 4854 | + * |
|
| 4855 | + */ |
|
| 4856 | 4856 | public function countAllAirlineCountriesByRoute($departure_airport_icao, $arrival_airport_icao,$filters= array()) |
| 4857 | 4857 | { |
| 4858 | 4858 | $filter_query = $this->getFilter($filters,true,true); |
@@ -4884,11 +4884,11 @@ discard block |
||
| 4884 | 4884 | |
| 4885 | 4885 | |
| 4886 | 4886 | /** |
| 4887 | - * Gets all airlines that have flown over by country |
|
| 4888 | - * |
|
| 4889 | - * @return Array the airline list |
|
| 4890 | - * |
|
| 4891 | - */ |
|
| 4887 | + * Gets all airlines that have flown over by country |
|
| 4888 | + * |
|
| 4889 | + * @return Array the airline list |
|
| 4890 | + * |
|
| 4891 | + */ |
|
| 4892 | 4892 | public function countAllAirlinesByCountry($country,$filters = array()) |
| 4893 | 4893 | { |
| 4894 | 4894 | $country = filter_var($country,FILTER_SANITIZE_STRING); |
@@ -4918,11 +4918,11 @@ discard block |
||
| 4918 | 4918 | |
| 4919 | 4919 | |
| 4920 | 4920 | /** |
| 4921 | - * Gets all airline countries that have flown over by country |
|
| 4922 | - * |
|
| 4923 | - * @return Array the airline country list |
|
| 4924 | - * |
|
| 4925 | - */ |
|
| 4921 | + * Gets all airline countries that have flown over by country |
|
| 4922 | + * |
|
| 4923 | + * @return Array the airline country list |
|
| 4924 | + * |
|
| 4925 | + */ |
|
| 4926 | 4926 | public function countAllAirlineCountriesByCountry($country,$filters = array()) |
| 4927 | 4927 | { |
| 4928 | 4928 | $filter_query = $this->getFilter($filters,true,true); |
@@ -4951,11 +4951,11 @@ discard block |
||
| 4951 | 4951 | |
| 4952 | 4952 | |
| 4953 | 4953 | /** |
| 4954 | - * Gets all airlines countries |
|
| 4955 | - * |
|
| 4956 | - * @return Array the airline country list |
|
| 4957 | - * |
|
| 4958 | - */ |
|
| 4954 | + * Gets all airlines countries |
|
| 4955 | + * |
|
| 4956 | + * @return Array the airline country list |
|
| 4957 | + * |
|
| 4958 | + */ |
|
| 4959 | 4959 | public function countAllAirlineCountries($limit = true, $filters = array(), $year = '', $month = '', $day = '') |
| 4960 | 4960 | { |
| 4961 | 4961 | global $globalDBdriver; |
@@ -5011,11 +5011,11 @@ discard block |
||
| 5011 | 5011 | } |
| 5012 | 5012 | |
| 5013 | 5013 | /** |
| 5014 | - * Gets all number of flight over countries |
|
| 5015 | - * |
|
| 5016 | - * @return Array the airline country list |
|
| 5017 | - * |
|
| 5018 | - */ |
|
| 5014 | + * Gets all number of flight over countries |
|
| 5015 | + * |
|
| 5016 | + * @return Array the airline country list |
|
| 5017 | + * |
|
| 5018 | + */ |
|
| 5019 | 5019 | public function countAllFlightOverCountries($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array()) |
| 5020 | 5020 | { |
| 5021 | 5021 | global $globalDBdriver; |
@@ -5037,15 +5037,15 @@ discard block |
||
| 5037 | 5037 | $SpotterLive = new SpotterLive(); |
| 5038 | 5038 | $filter_query = $SpotterLive->getFilter($filters,true,true); |
| 5039 | 5039 | $filter_query .= ' over_country IS NOT NULL'; |
| 5040 | - if ($olderthanmonths > 0) { |
|
| 5040 | + if ($olderthanmonths > 0) { |
|
| 5041 | 5041 | if ($globalDBdriver == 'mysql') { |
| 5042 | 5042 | $filter_query .= ' AND spotter_live.date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
| 5043 | 5043 | } else { |
| 5044 | 5044 | $filter_query .= " AND spotter_live.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
| 5045 | 5045 | } |
| 5046 | 5046 | } |
| 5047 | - if ($sincedate != '') { |
|
| 5048 | - if ($globalDBdriver == 'mysql') { |
|
| 5047 | + if ($sincedate != '') { |
|
| 5048 | + if ($globalDBdriver == 'mysql') { |
|
| 5049 | 5049 | $filter_query .= " AND spotter_live.date > '".$sincedate."' "; |
| 5050 | 5050 | } else { |
| 5051 | 5051 | $filter_query .= " AND spotter_live.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -5075,11 +5075,11 @@ discard block |
||
| 5075 | 5075 | |
| 5076 | 5076 | |
| 5077 | 5077 | /** |
| 5078 | - * Gets all aircraft types that have flown over |
|
| 5079 | - * |
|
| 5080 | - * @return Array the aircraft list |
|
| 5081 | - * |
|
| 5082 | - */ |
|
| 5078 | + * Gets all aircraft types that have flown over |
|
| 5079 | + * |
|
| 5080 | + * @return Array the aircraft list |
|
| 5081 | + * |
|
| 5082 | + */ |
|
| 5083 | 5083 | public function countAllAircraftTypes($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array(),$year = '',$month = '',$day = '') |
| 5084 | 5084 | { |
| 5085 | 5085 | global $globalDBdriver; |
@@ -5149,11 +5149,11 @@ discard block |
||
| 5149 | 5149 | } |
| 5150 | 5150 | |
| 5151 | 5151 | /** |
| 5152 | - * Gets all aircraft types that have flown over by airline |
|
| 5153 | - * |
|
| 5154 | - * @return Array the aircraft list |
|
| 5155 | - * |
|
| 5156 | - */ |
|
| 5152 | + * Gets all aircraft types that have flown over by airline |
|
| 5153 | + * |
|
| 5154 | + * @return Array the aircraft list |
|
| 5155 | + * |
|
| 5156 | + */ |
|
| 5157 | 5157 | public function countAllAircraftTypesByAirlines($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array(),$year = '',$month = '', $day = '') |
| 5158 | 5158 | { |
| 5159 | 5159 | global $globalDBdriver; |
@@ -5224,11 +5224,11 @@ discard block |
||
| 5224 | 5224 | } |
| 5225 | 5225 | |
| 5226 | 5226 | /** |
| 5227 | - * Gets all aircraft types that have flown over by months |
|
| 5228 | - * |
|
| 5229 | - * @return Array the aircraft list |
|
| 5230 | - * |
|
| 5231 | - */ |
|
| 5227 | + * Gets all aircraft types that have flown over by months |
|
| 5228 | + * |
|
| 5229 | + * @return Array the aircraft list |
|
| 5230 | + * |
|
| 5231 | + */ |
|
| 5232 | 5232 | public function countAllAircraftTypesByMonths($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array()) |
| 5233 | 5233 | { |
| 5234 | 5234 | global $globalDBdriver; |
@@ -5272,11 +5272,11 @@ discard block |
||
| 5272 | 5272 | |
| 5273 | 5273 | |
| 5274 | 5274 | /** |
| 5275 | - * Gets all aircraft registration that have flown over by aircaft icao |
|
| 5276 | - * |
|
| 5277 | - * @return Array the aircraft list |
|
| 5278 | - * |
|
| 5279 | - */ |
|
| 5275 | + * Gets all aircraft registration that have flown over by aircaft icao |
|
| 5276 | + * |
|
| 5277 | + * @return Array the aircraft list |
|
| 5278 | + * |
|
| 5279 | + */ |
|
| 5280 | 5280 | public function countAllAircraftRegistrationByAircraft($aircraft_icao,$filters = array()) |
| 5281 | 5281 | { |
| 5282 | 5282 | $Image = new Image($this->db); |
@@ -5315,11 +5315,11 @@ discard block |
||
| 5315 | 5315 | |
| 5316 | 5316 | |
| 5317 | 5317 | /** |
| 5318 | - * Gets all aircraft types that have flown over by airline icao |
|
| 5319 | - * |
|
| 5320 | - * @return Array the aircraft list |
|
| 5321 | - * |
|
| 5322 | - */ |
|
| 5318 | + * Gets all aircraft types that have flown over by airline icao |
|
| 5319 | + * |
|
| 5320 | + * @return Array the aircraft list |
|
| 5321 | + * |
|
| 5322 | + */ |
|
| 5323 | 5323 | public function countAllAircraftTypesByAirline($airline_icao,$filters = array()) |
| 5324 | 5324 | { |
| 5325 | 5325 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5348,11 +5348,11 @@ discard block |
||
| 5348 | 5348 | |
| 5349 | 5349 | |
| 5350 | 5350 | /** |
| 5351 | - * Gets all aircraft registration that have flown over by airline icao |
|
| 5352 | - * |
|
| 5353 | - * @return Array the aircraft list |
|
| 5354 | - * |
|
| 5355 | - */ |
|
| 5351 | + * Gets all aircraft registration that have flown over by airline icao |
|
| 5352 | + * |
|
| 5353 | + * @return Array the aircraft list |
|
| 5354 | + * |
|
| 5355 | + */ |
|
| 5356 | 5356 | public function countAllAircraftRegistrationByAirline($airline_icao,$filters = array()) |
| 5357 | 5357 | { |
| 5358 | 5358 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5390,11 +5390,11 @@ discard block |
||
| 5390 | 5390 | |
| 5391 | 5391 | |
| 5392 | 5392 | /** |
| 5393 | - * Gets all aircraft manufacturer that have flown over by airline icao |
|
| 5394 | - * |
|
| 5395 | - * @return Array the aircraft list |
|
| 5396 | - * |
|
| 5397 | - */ |
|
| 5393 | + * Gets all aircraft manufacturer that have flown over by airline icao |
|
| 5394 | + * |
|
| 5395 | + * @return Array the aircraft list |
|
| 5396 | + * |
|
| 5397 | + */ |
|
| 5398 | 5398 | public function countAllAircraftManufacturerByAirline($airline_icao,$filters = array()) |
| 5399 | 5399 | { |
| 5400 | 5400 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5422,11 +5422,11 @@ discard block |
||
| 5422 | 5422 | |
| 5423 | 5423 | |
| 5424 | 5424 | /** |
| 5425 | - * Gets all aircraft types that have flown over by airline icao |
|
| 5426 | - * |
|
| 5427 | - * @return Array the aircraft list |
|
| 5428 | - * |
|
| 5429 | - */ |
|
| 5425 | + * Gets all aircraft types that have flown over by airline icao |
|
| 5426 | + * |
|
| 5427 | + * @return Array the aircraft list |
|
| 5428 | + * |
|
| 5429 | + */ |
|
| 5430 | 5430 | public function countAllAircraftTypesByAirport($airport_icao,$filters = array()) |
| 5431 | 5431 | { |
| 5432 | 5432 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5455,11 +5455,11 @@ discard block |
||
| 5455 | 5455 | |
| 5456 | 5456 | |
| 5457 | 5457 | /** |
| 5458 | - * Gets all aircraft registration that have flown over by airport icao |
|
| 5459 | - * |
|
| 5460 | - * @return Array the aircraft list |
|
| 5461 | - * |
|
| 5462 | - */ |
|
| 5458 | + * Gets all aircraft registration that have flown over by airport icao |
|
| 5459 | + * |
|
| 5460 | + * @return Array the aircraft list |
|
| 5461 | + * |
|
| 5462 | + */ |
|
| 5463 | 5463 | public function countAllAircraftRegistrationByAirport($airport_icao,$filters = array()) |
| 5464 | 5464 | { |
| 5465 | 5465 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5496,11 +5496,11 @@ discard block |
||
| 5496 | 5496 | |
| 5497 | 5497 | |
| 5498 | 5498 | /** |
| 5499 | - * Gets all aircraft manufacturer that have flown over by airport icao |
|
| 5500 | - * |
|
| 5501 | - * @return Array the aircraft list |
|
| 5502 | - * |
|
| 5503 | - */ |
|
| 5499 | + * Gets all aircraft manufacturer that have flown over by airport icao |
|
| 5500 | + * |
|
| 5501 | + * @return Array the aircraft list |
|
| 5502 | + * |
|
| 5503 | + */ |
|
| 5504 | 5504 | public function countAllAircraftManufacturerByAirport($airport_icao,$filters = array()) |
| 5505 | 5505 | { |
| 5506 | 5506 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5526,11 +5526,11 @@ discard block |
||
| 5526 | 5526 | } |
| 5527 | 5527 | |
| 5528 | 5528 | /** |
| 5529 | - * Gets all aircraft types that have flown over by aircraft manufacturer |
|
| 5530 | - * |
|
| 5531 | - * @return Array the aircraft list |
|
| 5532 | - * |
|
| 5533 | - */ |
|
| 5529 | + * Gets all aircraft types that have flown over by aircraft manufacturer |
|
| 5530 | + * |
|
| 5531 | + * @return Array the aircraft list |
|
| 5532 | + * |
|
| 5533 | + */ |
|
| 5534 | 5534 | public function countAllAircraftTypesByManufacturer($aircraft_manufacturer,$filters = array()) |
| 5535 | 5535 | { |
| 5536 | 5536 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5557,11 +5557,11 @@ discard block |
||
| 5557 | 5557 | |
| 5558 | 5558 | |
| 5559 | 5559 | /** |
| 5560 | - * Gets all aircraft registration that have flown over by aircaft manufacturer |
|
| 5561 | - * |
|
| 5562 | - * @return Array the aircraft list |
|
| 5563 | - * |
|
| 5564 | - */ |
|
| 5560 | + * Gets all aircraft registration that have flown over by aircaft manufacturer |
|
| 5561 | + * |
|
| 5562 | + * @return Array the aircraft list |
|
| 5563 | + * |
|
| 5564 | + */ |
|
| 5565 | 5565 | public function countAllAircraftRegistrationByManufacturer($aircraft_manufacturer, $filters = array()) |
| 5566 | 5566 | { |
| 5567 | 5567 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5597,11 +5597,11 @@ discard block |
||
| 5597 | 5597 | } |
| 5598 | 5598 | |
| 5599 | 5599 | /** |
| 5600 | - * Gets all aircraft types that have flown over by date |
|
| 5601 | - * |
|
| 5602 | - * @return Array the aircraft list |
|
| 5603 | - * |
|
| 5604 | - */ |
|
| 5600 | + * Gets all aircraft types that have flown over by date |
|
| 5601 | + * |
|
| 5602 | + * @return Array the aircraft list |
|
| 5603 | + * |
|
| 5604 | + */ |
|
| 5605 | 5605 | public function countAllAircraftTypesByDate($date,$filters = array()) |
| 5606 | 5606 | { |
| 5607 | 5607 | global $globalTimezone, $globalDBdriver; |
@@ -5643,11 +5643,11 @@ discard block |
||
| 5643 | 5643 | |
| 5644 | 5644 | |
| 5645 | 5645 | /** |
| 5646 | - * Gets all aircraft registration that have flown over by date |
|
| 5647 | - * |
|
| 5648 | - * @return Array the aircraft list |
|
| 5649 | - * |
|
| 5650 | - */ |
|
| 5646 | + * Gets all aircraft registration that have flown over by date |
|
| 5647 | + * |
|
| 5648 | + * @return Array the aircraft list |
|
| 5649 | + * |
|
| 5650 | + */ |
|
| 5651 | 5651 | public function countAllAircraftRegistrationByDate($date,$filters = array()) |
| 5652 | 5652 | { |
| 5653 | 5653 | global $globalTimezone, $globalDBdriver; |
@@ -5698,11 +5698,11 @@ discard block |
||
| 5698 | 5698 | |
| 5699 | 5699 | |
| 5700 | 5700 | /** |
| 5701 | - * Gets all aircraft manufacturer that have flown over by date |
|
| 5702 | - * |
|
| 5703 | - * @return Array the aircraft manufacturer list |
|
| 5704 | - * |
|
| 5705 | - */ |
|
| 5701 | + * Gets all aircraft manufacturer that have flown over by date |
|
| 5702 | + * |
|
| 5703 | + * @return Array the aircraft manufacturer list |
|
| 5704 | + * |
|
| 5705 | + */ |
|
| 5706 | 5706 | public function countAllAircraftManufacturerByDate($date,$filters = array()) |
| 5707 | 5707 | { |
| 5708 | 5708 | global $globalTimezone, $globalDBdriver; |
@@ -5744,11 +5744,11 @@ discard block |
||
| 5744 | 5744 | |
| 5745 | 5745 | |
| 5746 | 5746 | /** |
| 5747 | - * Gets all aircraft types that have flown over by ident/callsign |
|
| 5748 | - * |
|
| 5749 | - * @return Array the aircraft list |
|
| 5750 | - * |
|
| 5751 | - */ |
|
| 5747 | + * Gets all aircraft types that have flown over by ident/callsign |
|
| 5748 | + * |
|
| 5749 | + * @return Array the aircraft list |
|
| 5750 | + * |
|
| 5751 | + */ |
|
| 5752 | 5752 | public function countAllAircraftTypesByIdent($ident,$filters = array()) |
| 5753 | 5753 | { |
| 5754 | 5754 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5776,11 +5776,11 @@ discard block |
||
| 5776 | 5776 | } |
| 5777 | 5777 | |
| 5778 | 5778 | /** |
| 5779 | - * Gets all aircraft types that have flown over by pilot |
|
| 5780 | - * |
|
| 5781 | - * @return Array the aircraft list |
|
| 5782 | - * |
|
| 5783 | - */ |
|
| 5779 | + * Gets all aircraft types that have flown over by pilot |
|
| 5780 | + * |
|
| 5781 | + * @return Array the aircraft list |
|
| 5782 | + * |
|
| 5783 | + */ |
|
| 5784 | 5784 | public function countAllAircraftTypesByPilot($pilot,$filters = array(),$year = '',$month = '',$day = '') |
| 5785 | 5785 | { |
| 5786 | 5786 | global $globalDBdriver; |
@@ -5826,11 +5826,11 @@ discard block |
||
| 5826 | 5826 | } |
| 5827 | 5827 | |
| 5828 | 5828 | /** |
| 5829 | - * Gets all aircraft types that have flown over by owner |
|
| 5830 | - * |
|
| 5831 | - * @return Array the aircraft list |
|
| 5832 | - * |
|
| 5833 | - */ |
|
| 5829 | + * Gets all aircraft types that have flown over by owner |
|
| 5830 | + * |
|
| 5831 | + * @return Array the aircraft list |
|
| 5832 | + * |
|
| 5833 | + */ |
|
| 5834 | 5834 | public function countAllAircraftTypesByOwner($owner,$filters = array(),$year = '',$month = '',$day = '') |
| 5835 | 5835 | { |
| 5836 | 5836 | global $globalDBdriver; |
@@ -5875,11 +5875,11 @@ discard block |
||
| 5875 | 5875 | } |
| 5876 | 5876 | |
| 5877 | 5877 | /** |
| 5878 | - * Gets all aircraft registration that have flown over by ident/callsign |
|
| 5879 | - * |
|
| 5880 | - * @return Array the aircraft list |
|
| 5881 | - * |
|
| 5882 | - */ |
|
| 5878 | + * Gets all aircraft registration that have flown over by ident/callsign |
|
| 5879 | + * |
|
| 5880 | + * @return Array the aircraft list |
|
| 5881 | + * |
|
| 5882 | + */ |
|
| 5883 | 5883 | public function countAllAircraftRegistrationByIdent($ident,$filters = array()) |
| 5884 | 5884 | { |
| 5885 | 5885 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5918,11 +5918,11 @@ discard block |
||
| 5918 | 5918 | } |
| 5919 | 5919 | |
| 5920 | 5920 | /** |
| 5921 | - * Gets all aircraft registration that have flown over by owner |
|
| 5922 | - * |
|
| 5923 | - * @return Array the aircraft list |
|
| 5924 | - * |
|
| 5925 | - */ |
|
| 5921 | + * Gets all aircraft registration that have flown over by owner |
|
| 5922 | + * |
|
| 5923 | + * @return Array the aircraft list |
|
| 5924 | + * |
|
| 5925 | + */ |
|
| 5926 | 5926 | public function countAllAircraftRegistrationByOwner($owner,$filters = array(),$year = '',$month = '',$day = '') |
| 5927 | 5927 | { |
| 5928 | 5928 | global $globalDBdriver; |
@@ -5993,11 +5993,11 @@ discard block |
||
| 5993 | 5993 | } |
| 5994 | 5994 | |
| 5995 | 5995 | /** |
| 5996 | - * Gets all aircraft registration that have flown over by pilot |
|
| 5997 | - * |
|
| 5998 | - * @return Array the aircraft list |
|
| 5999 | - * |
|
| 6000 | - */ |
|
| 5996 | + * Gets all aircraft registration that have flown over by pilot |
|
| 5997 | + * |
|
| 5998 | + * @return Array the aircraft list |
|
| 5999 | + * |
|
| 6000 | + */ |
|
| 6001 | 6001 | public function countAllAircraftRegistrationByPilot($pilot,$filters = array(),$year = '',$month = '',$day = '') |
| 6002 | 6002 | { |
| 6003 | 6003 | global $globalDBdriver; |
@@ -6069,11 +6069,11 @@ discard block |
||
| 6069 | 6069 | |
| 6070 | 6070 | |
| 6071 | 6071 | /** |
| 6072 | - * Gets all aircraft manufacturer that have flown over by ident/callsign |
|
| 6073 | - * |
|
| 6074 | - * @return Array the aircraft manufacturer list |
|
| 6075 | - * |
|
| 6076 | - */ |
|
| 6072 | + * Gets all aircraft manufacturer that have flown over by ident/callsign |
|
| 6073 | + * |
|
| 6074 | + * @return Array the aircraft manufacturer list |
|
| 6075 | + * |
|
| 6076 | + */ |
|
| 6077 | 6077 | public function countAllAircraftManufacturerByIdent($ident,$filters = array()) |
| 6078 | 6078 | { |
| 6079 | 6079 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6098,11 +6098,11 @@ discard block |
||
| 6098 | 6098 | } |
| 6099 | 6099 | |
| 6100 | 6100 | /** |
| 6101 | - * Gets all aircraft manufacturer that have flown over by owner |
|
| 6102 | - * |
|
| 6103 | - * @return Array the aircraft manufacturer list |
|
| 6104 | - * |
|
| 6105 | - */ |
|
| 6101 | + * Gets all aircraft manufacturer that have flown over by owner |
|
| 6102 | + * |
|
| 6103 | + * @return Array the aircraft manufacturer list |
|
| 6104 | + * |
|
| 6105 | + */ |
|
| 6106 | 6106 | public function countAllAircraftManufacturerByOwner($owner,$filters = array(),$year = '',$month = '',$day = '') |
| 6107 | 6107 | { |
| 6108 | 6108 | global $globalDBdriver; |
@@ -6150,11 +6150,11 @@ discard block |
||
| 6150 | 6150 | } |
| 6151 | 6151 | |
| 6152 | 6152 | /** |
| 6153 | - * Gets all aircraft manufacturer that have flown over by pilot |
|
| 6154 | - * |
|
| 6155 | - * @return Array the aircraft manufacturer list |
|
| 6156 | - * |
|
| 6157 | - */ |
|
| 6153 | + * Gets all aircraft manufacturer that have flown over by pilot |
|
| 6154 | + * |
|
| 6155 | + * @return Array the aircraft manufacturer list |
|
| 6156 | + * |
|
| 6157 | + */ |
|
| 6158 | 6158 | public function countAllAircraftManufacturerByPilot($pilot,$filters = array(),$year = '',$month = '',$day = '') |
| 6159 | 6159 | { |
| 6160 | 6160 | global $globalDBdriver; |
@@ -6203,11 +6203,11 @@ discard block |
||
| 6203 | 6203 | |
| 6204 | 6204 | |
| 6205 | 6205 | /** |
| 6206 | - * Gets all aircraft types that have flown over by route |
|
| 6207 | - * |
|
| 6208 | - * @return Array the aircraft list |
|
| 6209 | - * |
|
| 6210 | - */ |
|
| 6206 | + * Gets all aircraft types that have flown over by route |
|
| 6207 | + * |
|
| 6208 | + * @return Array the aircraft list |
|
| 6209 | + * |
|
| 6210 | + */ |
|
| 6211 | 6211 | public function countAllAircraftTypesByRoute($departure_airport_icao, $arrival_airport_icao,$filters = array()) |
| 6212 | 6212 | { |
| 6213 | 6213 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6236,11 +6236,11 @@ discard block |
||
| 6236 | 6236 | } |
| 6237 | 6237 | |
| 6238 | 6238 | /** |
| 6239 | - * Gets all aircraft registration that have flown over by route |
|
| 6240 | - * |
|
| 6241 | - * @return Array the aircraft list |
|
| 6242 | - * |
|
| 6243 | - */ |
|
| 6239 | + * Gets all aircraft registration that have flown over by route |
|
| 6240 | + * |
|
| 6241 | + * @return Array the aircraft list |
|
| 6242 | + * |
|
| 6243 | + */ |
|
| 6244 | 6244 | public function countAllAircraftRegistrationByRoute($departure_airport_icao, $arrival_airport_icao,$filters = array()) |
| 6245 | 6245 | { |
| 6246 | 6246 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6282,11 +6282,11 @@ discard block |
||
| 6282 | 6282 | |
| 6283 | 6283 | |
| 6284 | 6284 | /** |
| 6285 | - * Gets all aircraft manufacturer that have flown over by route |
|
| 6286 | - * |
|
| 6287 | - * @return Array the aircraft manufacturer list |
|
| 6288 | - * |
|
| 6289 | - */ |
|
| 6285 | + * Gets all aircraft manufacturer that have flown over by route |
|
| 6286 | + * |
|
| 6287 | + * @return Array the aircraft manufacturer list |
|
| 6288 | + * |
|
| 6289 | + */ |
|
| 6290 | 6290 | public function countAllAircraftManufacturerByRoute($departure_airport_icao, $arrival_airport_icao,$filters = array()) |
| 6291 | 6291 | { |
| 6292 | 6292 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6320,11 +6320,11 @@ discard block |
||
| 6320 | 6320 | |
| 6321 | 6321 | |
| 6322 | 6322 | /** |
| 6323 | - * Gets all aircraft types that have flown over by country |
|
| 6324 | - * |
|
| 6325 | - * @return Array the aircraft list |
|
| 6326 | - * |
|
| 6327 | - */ |
|
| 6323 | + * Gets all aircraft types that have flown over by country |
|
| 6324 | + * |
|
| 6325 | + * @return Array the aircraft list |
|
| 6326 | + * |
|
| 6327 | + */ |
|
| 6328 | 6328 | public function countAllAircraftTypesByCountry($country,$filters = array()) |
| 6329 | 6329 | { |
| 6330 | 6330 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6355,11 +6355,11 @@ discard block |
||
| 6355 | 6355 | |
| 6356 | 6356 | |
| 6357 | 6357 | /** |
| 6358 | - * Gets all aircraft registration that have flown over by country |
|
| 6359 | - * |
|
| 6360 | - * @return Array the aircraft list |
|
| 6361 | - * |
|
| 6362 | - */ |
|
| 6358 | + * Gets all aircraft registration that have flown over by country |
|
| 6359 | + * |
|
| 6360 | + * @return Array the aircraft list |
|
| 6361 | + * |
|
| 6362 | + */ |
|
| 6363 | 6363 | public function countAllAircraftRegistrationByCountry($country,$filters = array()) |
| 6364 | 6364 | { |
| 6365 | 6365 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6399,11 +6399,11 @@ discard block |
||
| 6399 | 6399 | |
| 6400 | 6400 | |
| 6401 | 6401 | /** |
| 6402 | - * Gets all aircraft manufacturer that have flown over by country |
|
| 6403 | - * |
|
| 6404 | - * @return Array the aircraft manufacturer list |
|
| 6405 | - * |
|
| 6406 | - */ |
|
| 6402 | + * Gets all aircraft manufacturer that have flown over by country |
|
| 6403 | + * |
|
| 6404 | + * @return Array the aircraft manufacturer list |
|
| 6405 | + * |
|
| 6406 | + */ |
|
| 6407 | 6407 | public function countAllAircraftManufacturerByCountry($country,$filters = array()) |
| 6408 | 6408 | { |
| 6409 | 6409 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6434,18 +6434,18 @@ discard block |
||
| 6434 | 6434 | |
| 6435 | 6435 | |
| 6436 | 6436 | /** |
| 6437 | - * Gets all aircraft manufacturers that have flown over |
|
| 6438 | - * |
|
| 6439 | - * @return Array the aircraft list |
|
| 6440 | - * |
|
| 6441 | - */ |
|
| 6437 | + * Gets all aircraft manufacturers that have flown over |
|
| 6438 | + * |
|
| 6439 | + * @return Array the aircraft list |
|
| 6440 | + * |
|
| 6441 | + */ |
|
| 6442 | 6442 | public function countAllAircraftManufacturers($filters = array(),$year = '',$month = '',$day = '') |
| 6443 | 6443 | { |
| 6444 | 6444 | global $globalDBdriver; |
| 6445 | 6445 | $filter_query = $this->getFilter($filters,true,true); |
| 6446 | 6446 | $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
| 6447 | 6447 | FROM spotter_output ".$filter_query." spotter_output.aircraft_manufacturer <> '' AND spotter_output.aircraft_manufacturer <> 'Not Available'"; |
| 6448 | - $query_values = array(); |
|
| 6448 | + $query_values = array(); |
|
| 6449 | 6449 | if ($year != '') { |
| 6450 | 6450 | if ($globalDBdriver == 'mysql') { |
| 6451 | 6451 | $query .= " AND YEAR(spotter_output.date) = :year"; |
@@ -6498,11 +6498,11 @@ discard block |
||
| 6498 | 6498 | |
| 6499 | 6499 | |
| 6500 | 6500 | /** |
| 6501 | - * Gets all aircraft registrations that have flown over |
|
| 6502 | - * |
|
| 6503 | - * @return Array the aircraft list |
|
| 6504 | - * |
|
| 6505 | - */ |
|
| 6501 | + * Gets all aircraft registrations that have flown over |
|
| 6502 | + * |
|
| 6503 | + * @return Array the aircraft list |
|
| 6504 | + * |
|
| 6505 | + */ |
|
| 6506 | 6506 | public function countAllAircraftRegistrations($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array(),$year = '', $month = '', $day = '') |
| 6507 | 6507 | { |
| 6508 | 6508 | global $globalDBdriver; |
@@ -6510,15 +6510,15 @@ discard block |
||
| 6510 | 6510 | $filter_query = $this->getFilter($filters,true,true); |
| 6511 | 6511 | $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 |
| 6512 | 6512 | FROM spotter_output ".$filter_query." spotter_output.registration <> '' AND spotter_output.registration <> 'NA'"; |
| 6513 | - if ($olderthanmonths > 0) { |
|
| 6514 | - if ($globalDBdriver == 'mysql') { |
|
| 6513 | + if ($olderthanmonths > 0) { |
|
| 6514 | + if ($globalDBdriver == 'mysql') { |
|
| 6515 | 6515 | $query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)'; |
| 6516 | 6516 | } else { |
| 6517 | 6517 | $query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
| 6518 | 6518 | } |
| 6519 | 6519 | } |
| 6520 | - if ($sincedate != '') { |
|
| 6521 | - if ($globalDBdriver == 'mysql') { |
|
| 6520 | + if ($sincedate != '') { |
|
| 6521 | + if ($globalDBdriver == 'mysql') { |
|
| 6522 | 6522 | $query .= " AND spotter_output.date > '".$sincedate."'"; |
| 6523 | 6523 | } else { |
| 6524 | 6524 | $query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -6583,11 +6583,11 @@ discard block |
||
| 6583 | 6583 | |
| 6584 | 6584 | |
| 6585 | 6585 | /** |
| 6586 | - * Gets all aircraft registrations that have flown over |
|
| 6587 | - * |
|
| 6588 | - * @return Array the aircraft list |
|
| 6589 | - * |
|
| 6590 | - */ |
|
| 6586 | + * Gets all aircraft registrations that have flown over |
|
| 6587 | + * |
|
| 6588 | + * @return Array the aircraft list |
|
| 6589 | + * |
|
| 6590 | + */ |
|
| 6591 | 6591 | public function countAllAircraftRegistrationsByAirlines($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array()) |
| 6592 | 6592 | { |
| 6593 | 6593 | global $globalDBdriver; |
@@ -6595,15 +6595,15 @@ discard block |
||
| 6595 | 6595 | $Image = new Image($this->db); |
| 6596 | 6596 | $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 |
| 6597 | 6597 | FROM spotter_output".$filter_query." spotter_output.airline_icao <> '' AND spotter_output.registration <> '' AND spotter_output.registration <> 'NA' "; |
| 6598 | - if ($olderthanmonths > 0) { |
|
| 6599 | - if ($globalDBdriver == 'mysql') { |
|
| 6598 | + if ($olderthanmonths > 0) { |
|
| 6599 | + if ($globalDBdriver == 'mysql') { |
|
| 6600 | 6600 | $query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) '; |
| 6601 | 6601 | } else { |
| 6602 | 6602 | $query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
| 6603 | 6603 | } |
| 6604 | 6604 | } |
| 6605 | - if ($sincedate != '') { |
|
| 6606 | - if ($globalDBdriver == 'mysql') { |
|
| 6605 | + if ($sincedate != '') { |
|
| 6606 | + if ($globalDBdriver == 'mysql') { |
|
| 6607 | 6607 | $query .= "AND spotter_output.date > '".$sincedate."' "; |
| 6608 | 6608 | } else { |
| 6609 | 6609 | $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -6612,7 +6612,7 @@ discard block |
||
| 6612 | 6612 | |
| 6613 | 6613 | // if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
| 6614 | 6614 | //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
| 6615 | - $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"; |
|
| 6615 | + $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"; |
|
| 6616 | 6616 | if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
| 6617 | 6617 | |
| 6618 | 6618 | $sth = $this->db->prepare($query); |
@@ -6644,26 +6644,26 @@ discard block |
||
| 6644 | 6644 | |
| 6645 | 6645 | |
| 6646 | 6646 | /** |
| 6647 | - * Gets all departure airports of the airplanes that have flown over |
|
| 6648 | - * |
|
| 6649 | - * @return Array the airport list |
|
| 6650 | - * |
|
| 6651 | - */ |
|
| 6647 | + * Gets all departure airports of the airplanes that have flown over |
|
| 6648 | + * |
|
| 6649 | + * @return Array the airport list |
|
| 6650 | + * |
|
| 6651 | + */ |
|
| 6652 | 6652 | public function countAllDepartureAirports($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array(),$year = '',$month = '',$day = '') |
| 6653 | 6653 | { |
| 6654 | 6654 | global $globalDBdriver; |
| 6655 | 6655 | $filter_query = $this->getFilter($filters,true,true); |
| 6656 | 6656 | $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, airport.latitude, airport.longitude |
| 6657 | 6657 | FROM airport, spotter_output".$filter_query." airport.icao = spotter_output.departure_airport_icao AND spotter_output.departure_airport_name <> '' AND spotter_output.departure_airport_icao <> 'NA' AND spotter_output.departure_airport_icao <> ''"; |
| 6658 | - if ($olderthanmonths > 0) { |
|
| 6659 | - if ($globalDBdriver == 'mysql') { |
|
| 6658 | + if ($olderthanmonths > 0) { |
|
| 6659 | + if ($globalDBdriver == 'mysql') { |
|
| 6660 | 6660 | $query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)'; |
| 6661 | 6661 | } else { |
| 6662 | 6662 | $query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
| 6663 | 6663 | } |
| 6664 | - } |
|
| 6665 | - if ($sincedate != '') { |
|
| 6666 | - if ($globalDBdriver == 'mysql') { |
|
| 6664 | + } |
|
| 6665 | + if ($sincedate != '') { |
|
| 6666 | + if ($globalDBdriver == 'mysql') { |
|
| 6667 | 6667 | $query .= " AND spotter_output.date > '".$sincedate."'"; |
| 6668 | 6668 | } else { |
| 6669 | 6669 | $query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -6697,7 +6697,7 @@ discard block |
||
| 6697 | 6697 | $query_values = array_merge($query_values,array(':day' => $day)); |
| 6698 | 6698 | } |
| 6699 | 6699 | } |
| 6700 | - $query .= " GROUP BY spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country, airport.latitude, airport.longitude |
|
| 6700 | + $query .= " GROUP BY spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country, airport.latitude, airport.longitude |
|
| 6701 | 6701 | ORDER BY airport_departure_icao_count DESC"; |
| 6702 | 6702 | if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
| 6703 | 6703 | |
@@ -6721,35 +6721,35 @@ discard block |
||
| 6721 | 6721 | } |
| 6722 | 6722 | |
| 6723 | 6723 | /** |
| 6724 | - * Gets all departure airports of the airplanes that have flown over |
|
| 6725 | - * |
|
| 6726 | - * @return Array the airport list |
|
| 6727 | - * |
|
| 6728 | - */ |
|
| 6724 | + * Gets all departure airports of the airplanes that have flown over |
|
| 6725 | + * |
|
| 6726 | + * @return Array the airport list |
|
| 6727 | + * |
|
| 6728 | + */ |
|
| 6729 | 6729 | public function countAllDepartureAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array()) |
| 6730 | 6730 | { |
| 6731 | 6731 | global $globalDBdriver; |
| 6732 | 6732 | $filter_query = $this->getFilter($filters,true,true); |
| 6733 | 6733 | $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 |
| 6734 | 6734 | FROM spotter_output".$filter_query." spotter_output.airline_icao <> '' AND spotter_output.departure_airport_name <> '' AND spotter_output.departure_airport_icao <> 'NA' AND spotter_output.departure_airport_icao <> '' "; |
| 6735 | - if ($olderthanmonths > 0) { |
|
| 6736 | - if ($globalDBdriver == 'mysql') { |
|
| 6735 | + if ($olderthanmonths > 0) { |
|
| 6736 | + if ($globalDBdriver == 'mysql') { |
|
| 6737 | 6737 | $query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) '; |
| 6738 | 6738 | } else { |
| 6739 | 6739 | $query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
| 6740 | 6740 | } |
| 6741 | - } |
|
| 6742 | - if ($sincedate != '') { |
|
| 6743 | - if ($globalDBdriver == 'mysql') { |
|
| 6741 | + } |
|
| 6742 | + if ($sincedate != '') { |
|
| 6743 | + if ($globalDBdriver == 'mysql') { |
|
| 6744 | 6744 | $query .= "AND spotter_output.date > '".$sincedate."' "; |
| 6745 | 6745 | } else { |
| 6746 | 6746 | $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
| 6747 | 6747 | } |
| 6748 | 6748 | } |
| 6749 | 6749 | |
| 6750 | - //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
| 6751 | - //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
| 6752 | - $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 |
|
| 6750 | + //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
| 6751 | + //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
| 6752 | + $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 |
|
| 6753 | 6753 | ORDER BY airport_departure_icao_count DESC"; |
| 6754 | 6754 | if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
| 6755 | 6755 | |
@@ -6774,26 +6774,26 @@ discard block |
||
| 6774 | 6774 | } |
| 6775 | 6775 | |
| 6776 | 6776 | /** |
| 6777 | - * Gets all detected departure airports of the airplanes that have flown over |
|
| 6778 | - * |
|
| 6779 | - * @return Array the airport list |
|
| 6780 | - * |
|
| 6781 | - */ |
|
| 6777 | + * Gets all detected departure airports of the airplanes that have flown over |
|
| 6778 | + * |
|
| 6779 | + * @return Array the airport list |
|
| 6780 | + * |
|
| 6781 | + */ |
|
| 6782 | 6782 | public function countAllDetectedDepartureAirports($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array(),$year = '',$month = '',$day = '') |
| 6783 | 6783 | { |
| 6784 | 6784 | global $globalDBdriver; |
| 6785 | 6785 | $filter_query = $this->getFilter($filters,true,true); |
| 6786 | 6786 | $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, airport.latitude as departure_airport_latitude, airport.longitude as departure_airport.longitude |
| 6787 | 6787 | 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"; |
| 6788 | - if ($olderthanmonths > 0) { |
|
| 6789 | - if ($globalDBdriver == 'mysql') { |
|
| 6788 | + if ($olderthanmonths > 0) { |
|
| 6789 | + if ($globalDBdriver == 'mysql') { |
|
| 6790 | 6790 | $query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)'; |
| 6791 | 6791 | } else { |
| 6792 | 6792 | $query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
| 6793 | 6793 | } |
| 6794 | - } |
|
| 6795 | - if ($sincedate != '') { |
|
| 6796 | - if ($globalDBdriver == 'mysql') { |
|
| 6794 | + } |
|
| 6795 | + if ($sincedate != '') { |
|
| 6796 | + if ($globalDBdriver == 'mysql') { |
|
| 6797 | 6797 | $query .= " AND spotter_output.date > '".$sincedate."'"; |
| 6798 | 6798 | } else { |
| 6799 | 6799 | $query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -6827,10 +6827,10 @@ discard block |
||
| 6827 | 6827 | $query_values = array_merge($query_values,array(':day' => $day)); |
| 6828 | 6828 | } |
| 6829 | 6829 | } |
| 6830 | - $query .= " GROUP BY spotter_output.real_departure_airport_icao, airport.name, airport.city, airport.country, airport.latitude, airport.longitude |
|
| 6830 | + $query .= " GROUP BY spotter_output.real_departure_airport_icao, airport.name, airport.city, airport.country, airport.latitude, airport.longitude |
|
| 6831 | 6831 | ORDER BY airport_departure_icao_count DESC"; |
| 6832 | 6832 | if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
| 6833 | - //echo $query; |
|
| 6833 | + //echo $query; |
|
| 6834 | 6834 | $sth = $this->db->prepare($query); |
| 6835 | 6835 | $sth->execute($query_values); |
| 6836 | 6836 | |
@@ -6853,35 +6853,35 @@ discard block |
||
| 6853 | 6853 | } |
| 6854 | 6854 | |
| 6855 | 6855 | /** |
| 6856 | - * Gets all detected departure airports of the airplanes that have flown over |
|
| 6857 | - * |
|
| 6858 | - * @return Array the airport list |
|
| 6859 | - * |
|
| 6860 | - */ |
|
| 6856 | + * Gets all detected departure airports of the airplanes that have flown over |
|
| 6857 | + * |
|
| 6858 | + * @return Array the airport list |
|
| 6859 | + * |
|
| 6860 | + */ |
|
| 6861 | 6861 | public function countAllDetectedDepartureAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array()) |
| 6862 | 6862 | { |
| 6863 | 6863 | global $globalDBdriver; |
| 6864 | 6864 | $filter_query = $this->getFilter($filters,true,true); |
| 6865 | 6865 | $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 |
| 6866 | 6866 | 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 "; |
| 6867 | - if ($olderthanmonths > 0) { |
|
| 6868 | - if ($globalDBdriver == 'mysql') { |
|
| 6867 | + if ($olderthanmonths > 0) { |
|
| 6868 | + if ($globalDBdriver == 'mysql') { |
|
| 6869 | 6869 | $query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) '; |
| 6870 | 6870 | } else { |
| 6871 | 6871 | $query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
| 6872 | 6872 | } |
| 6873 | - } |
|
| 6874 | - if ($sincedate != '') { |
|
| 6875 | - if ($globalDBdriver == 'mysql') { |
|
| 6873 | + } |
|
| 6874 | + if ($sincedate != '') { |
|
| 6875 | + if ($globalDBdriver == 'mysql') { |
|
| 6876 | 6876 | $query .= "AND spotter_output.date > '".$sincedate."' "; |
| 6877 | 6877 | } else { |
| 6878 | 6878 | $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP) "; |
| 6879 | 6879 | } |
| 6880 | 6880 | } |
| 6881 | 6881 | |
| 6882 | - //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
| 6883 | - //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
| 6884 | - $query .= "GROUP BY spotter_output.airline_icao, spotter_output.real_departure_airport_icao, airport.name, airport.city, airport.country |
|
| 6882 | + //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
| 6883 | + //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
| 6884 | + $query .= "GROUP BY spotter_output.airline_icao, spotter_output.real_departure_airport_icao, airport.name, airport.city, airport.country |
|
| 6885 | 6885 | ORDER BY airport_departure_icao_count DESC"; |
| 6886 | 6886 | if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
| 6887 | 6887 | |
@@ -6906,11 +6906,11 @@ discard block |
||
| 6906 | 6906 | } |
| 6907 | 6907 | |
| 6908 | 6908 | /** |
| 6909 | - * Gets all departure airports of the airplanes that have flown over based on an airline icao |
|
| 6910 | - * |
|
| 6911 | - * @return Array the airport list |
|
| 6912 | - * |
|
| 6913 | - */ |
|
| 6909 | + * Gets all departure airports of the airplanes that have flown over based on an airline icao |
|
| 6910 | + * |
|
| 6911 | + * @return Array the airport list |
|
| 6912 | + * |
|
| 6913 | + */ |
|
| 6914 | 6914 | public function countAllDepartureAirportsByAirline($airline_icao,$filters = array()) |
| 6915 | 6915 | { |
| 6916 | 6916 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6944,11 +6944,11 @@ discard block |
||
| 6944 | 6944 | |
| 6945 | 6945 | |
| 6946 | 6946 | /** |
| 6947 | - * Gets all departure airports by country of the airplanes that have flown over based on an airline icao |
|
| 6948 | - * |
|
| 6949 | - * @return Array the airport list |
|
| 6950 | - * |
|
| 6951 | - */ |
|
| 6947 | + * Gets all departure airports by country of the airplanes that have flown over based on an airline icao |
|
| 6948 | + * |
|
| 6949 | + * @return Array the airport list |
|
| 6950 | + * |
|
| 6951 | + */ |
|
| 6952 | 6952 | public function countAllDepartureAirportCountriesByAirline($airline_icao,$filters = array()) |
| 6953 | 6953 | { |
| 6954 | 6954 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6977,11 +6977,11 @@ discard block |
||
| 6977 | 6977 | |
| 6978 | 6978 | |
| 6979 | 6979 | /** |
| 6980 | - * Gets all departure airports of the airplanes that have flown over based on an aircraft icao |
|
| 6981 | - * |
|
| 6982 | - * @return Array the airport list |
|
| 6983 | - * |
|
| 6984 | - */ |
|
| 6980 | + * Gets all departure airports of the airplanes that have flown over based on an aircraft icao |
|
| 6981 | + * |
|
| 6982 | + * @return Array the airport list |
|
| 6983 | + * |
|
| 6984 | + */ |
|
| 6985 | 6985 | public function countAllDepartureAirportsByAircraft($aircraft_icao,$filters = array()) |
| 6986 | 6986 | { |
| 6987 | 6987 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7014,11 +7014,11 @@ discard block |
||
| 7014 | 7014 | |
| 7015 | 7015 | |
| 7016 | 7016 | /** |
| 7017 | - * Gets all departure airports by country of the airplanes that have flown over based on an aircraft icao |
|
| 7018 | - * |
|
| 7019 | - * @return Array the airport list |
|
| 7020 | - * |
|
| 7021 | - */ |
|
| 7017 | + * Gets all departure airports by country of the airplanes that have flown over based on an aircraft icao |
|
| 7018 | + * |
|
| 7019 | + * @return Array the airport list |
|
| 7020 | + * |
|
| 7021 | + */ |
|
| 7022 | 7022 | public function countAllDepartureAirportCountriesByAircraft($aircraft_icao,$filters = array()) |
| 7023 | 7023 | { |
| 7024 | 7024 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7048,11 +7048,11 @@ discard block |
||
| 7048 | 7048 | |
| 7049 | 7049 | |
| 7050 | 7050 | /** |
| 7051 | - * Gets all departure airports of the airplanes that have flown over based on an aircraft registration |
|
| 7052 | - * |
|
| 7053 | - * @return Array the airport list |
|
| 7054 | - * |
|
| 7055 | - */ |
|
| 7051 | + * Gets all departure airports of the airplanes that have flown over based on an aircraft registration |
|
| 7052 | + * |
|
| 7053 | + * @return Array the airport list |
|
| 7054 | + * |
|
| 7055 | + */ |
|
| 7056 | 7056 | public function countAllDepartureAirportsByRegistration($registration,$filters = array()) |
| 7057 | 7057 | { |
| 7058 | 7058 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7085,11 +7085,11 @@ discard block |
||
| 7085 | 7085 | |
| 7086 | 7086 | |
| 7087 | 7087 | /** |
| 7088 | - * Gets all departure airports by country of the airplanes that have flown over based on an aircraft registration |
|
| 7089 | - * |
|
| 7090 | - * @return Array the airport list |
|
| 7091 | - * |
|
| 7092 | - */ |
|
| 7088 | + * Gets all departure airports by country of the airplanes that have flown over based on an aircraft registration |
|
| 7089 | + * |
|
| 7090 | + * @return Array the airport list |
|
| 7091 | + * |
|
| 7092 | + */ |
|
| 7093 | 7093 | public function countAllDepartureAirportCountriesByRegistration($registration,$filters = array()) |
| 7094 | 7094 | { |
| 7095 | 7095 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7119,11 +7119,11 @@ discard block |
||
| 7119 | 7119 | |
| 7120 | 7120 | |
| 7121 | 7121 | /** |
| 7122 | - * Gets all departure airports of the airplanes that have flown over based on an arrivl airport icao |
|
| 7123 | - * |
|
| 7124 | - * @return Array the airport list |
|
| 7125 | - * |
|
| 7126 | - */ |
|
| 7122 | + * Gets all departure airports of the airplanes that have flown over based on an arrivl airport icao |
|
| 7123 | + * |
|
| 7124 | + * @return Array the airport list |
|
| 7125 | + * |
|
| 7126 | + */ |
|
| 7127 | 7127 | public function countAllDepartureAirportsByAirport($airport_icao,$filters = array()) |
| 7128 | 7128 | { |
| 7129 | 7129 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7156,11 +7156,11 @@ discard block |
||
| 7156 | 7156 | |
| 7157 | 7157 | |
| 7158 | 7158 | /** |
| 7159 | - * Gets all departure airports by country of the airplanes that have flown over based on an airport icao |
|
| 7160 | - * |
|
| 7161 | - * @return Array the airport list |
|
| 7162 | - * |
|
| 7163 | - */ |
|
| 7159 | + * Gets all departure airports by country of the airplanes that have flown over based on an airport icao |
|
| 7160 | + * |
|
| 7161 | + * @return Array the airport list |
|
| 7162 | + * |
|
| 7163 | + */ |
|
| 7164 | 7164 | public function countAllDepartureAirportCountriesByAirport($airport_icao,$filters = array()) |
| 7165 | 7165 | { |
| 7166 | 7166 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7189,11 +7189,11 @@ discard block |
||
| 7189 | 7189 | |
| 7190 | 7190 | |
| 7191 | 7191 | /** |
| 7192 | - * Gets all departure airports of the airplanes that have flown over based on an aircraft manufacturer |
|
| 7193 | - * |
|
| 7194 | - * @return Array the airport list |
|
| 7195 | - * |
|
| 7196 | - */ |
|
| 7192 | + * Gets all departure airports of the airplanes that have flown over based on an aircraft manufacturer |
|
| 7193 | + * |
|
| 7194 | + * @return Array the airport list |
|
| 7195 | + * |
|
| 7196 | + */ |
|
| 7197 | 7197 | public function countAllDepartureAirportsByManufacturer($aircraft_manufacturer,$filters = array()) |
| 7198 | 7198 | { |
| 7199 | 7199 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7226,11 +7226,11 @@ discard block |
||
| 7226 | 7226 | |
| 7227 | 7227 | |
| 7228 | 7228 | /** |
| 7229 | - * Gets all departure airports by country of the airplanes that have flown over based on an aircraft manufacturer |
|
| 7230 | - * |
|
| 7231 | - * @return Array the airport list |
|
| 7232 | - * |
|
| 7233 | - */ |
|
| 7229 | + * Gets all departure airports by country of the airplanes that have flown over based on an aircraft manufacturer |
|
| 7230 | + * |
|
| 7231 | + * @return Array the airport list |
|
| 7232 | + * |
|
| 7233 | + */ |
|
| 7234 | 7234 | public function countAllDepartureAirportCountriesByManufacturer($aircraft_manufacturer,$filters = array()) |
| 7235 | 7235 | { |
| 7236 | 7236 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7260,11 +7260,11 @@ discard block |
||
| 7260 | 7260 | |
| 7261 | 7261 | |
| 7262 | 7262 | /** |
| 7263 | - * Gets all departure airports of the airplanes that have flown over based on a date |
|
| 7264 | - * |
|
| 7265 | - * @return Array the airport list |
|
| 7266 | - * |
|
| 7267 | - */ |
|
| 7263 | + * Gets all departure airports of the airplanes that have flown over based on a date |
|
| 7264 | + * |
|
| 7265 | + * @return Array the airport list |
|
| 7266 | + * |
|
| 7267 | + */ |
|
| 7268 | 7268 | public function countAllDepartureAirportsByDate($date,$filters = array()) |
| 7269 | 7269 | { |
| 7270 | 7270 | global $globalTimezone, $globalDBdriver; |
@@ -7310,11 +7310,11 @@ discard block |
||
| 7310 | 7310 | |
| 7311 | 7311 | |
| 7312 | 7312 | /** |
| 7313 | - * Gets all departure airports by country of the airplanes that have flown over based on a date |
|
| 7314 | - * |
|
| 7315 | - * @return Array the airport list |
|
| 7316 | - * |
|
| 7317 | - */ |
|
| 7313 | + * Gets all departure airports by country of the airplanes that have flown over based on a date |
|
| 7314 | + * |
|
| 7315 | + * @return Array the airport list |
|
| 7316 | + * |
|
| 7317 | + */ |
|
| 7318 | 7318 | public function countAllDepartureAirportCountriesByDate($date,$filters = array()) |
| 7319 | 7319 | { |
| 7320 | 7320 | global $globalTimezone, $globalDBdriver; |
@@ -7357,11 +7357,11 @@ discard block |
||
| 7357 | 7357 | |
| 7358 | 7358 | |
| 7359 | 7359 | /** |
| 7360 | - * Gets all departure airports of the airplanes that have flown over based on a ident/callsign |
|
| 7361 | - * |
|
| 7362 | - * @return Array the airport list |
|
| 7363 | - * |
|
| 7364 | - */ |
|
| 7360 | + * Gets all departure airports of the airplanes that have flown over based on a ident/callsign |
|
| 7361 | + * |
|
| 7362 | + * @return Array the airport list |
|
| 7363 | + * |
|
| 7364 | + */ |
|
| 7365 | 7365 | public function countAllDepartureAirportsByIdent($ident,$filters = array()) |
| 7366 | 7366 | { |
| 7367 | 7367 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7393,11 +7393,11 @@ discard block |
||
| 7393 | 7393 | } |
| 7394 | 7394 | |
| 7395 | 7395 | /** |
| 7396 | - * Gets all departure airports of the airplanes that have flown over based on a owner |
|
| 7397 | - * |
|
| 7398 | - * @return Array the airport list |
|
| 7399 | - * |
|
| 7400 | - */ |
|
| 7396 | + * Gets all departure airports of the airplanes that have flown over based on a owner |
|
| 7397 | + * |
|
| 7398 | + * @return Array the airport list |
|
| 7399 | + * |
|
| 7400 | + */ |
|
| 7401 | 7401 | public function countAllDepartureAirportsByOwner($owner,$filters = array()) |
| 7402 | 7402 | { |
| 7403 | 7403 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7429,11 +7429,11 @@ discard block |
||
| 7429 | 7429 | } |
| 7430 | 7430 | |
| 7431 | 7431 | /** |
| 7432 | - * Gets all departure airports of the airplanes that have flown over based on a pilot |
|
| 7433 | - * |
|
| 7434 | - * @return Array the airport list |
|
| 7435 | - * |
|
| 7436 | - */ |
|
| 7432 | + * Gets all departure airports of the airplanes that have flown over based on a pilot |
|
| 7433 | + * |
|
| 7434 | + * @return Array the airport list |
|
| 7435 | + * |
|
| 7436 | + */ |
|
| 7437 | 7437 | public function countAllDepartureAirportsByPilot($pilot,$filters = array()) |
| 7438 | 7438 | { |
| 7439 | 7439 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7466,11 +7466,11 @@ discard block |
||
| 7466 | 7466 | |
| 7467 | 7467 | |
| 7468 | 7468 | /** |
| 7469 | - * Gets all departure airports by country of the airplanes that have flown over based on a callsign/ident |
|
| 7470 | - * |
|
| 7471 | - * @return Array the airport list |
|
| 7472 | - * |
|
| 7473 | - */ |
|
| 7469 | + * Gets all departure airports by country of the airplanes that have flown over based on a callsign/ident |
|
| 7470 | + * |
|
| 7471 | + * @return Array the airport list |
|
| 7472 | + * |
|
| 7473 | + */ |
|
| 7474 | 7474 | public function countAllDepartureAirportCountriesByIdent($ident,$filters = array()) |
| 7475 | 7475 | { |
| 7476 | 7476 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7499,11 +7499,11 @@ discard block |
||
| 7499 | 7499 | } |
| 7500 | 7500 | |
| 7501 | 7501 | /** |
| 7502 | - * Gets all departure airports by country of the airplanes that have flown over based on owner |
|
| 7503 | - * |
|
| 7504 | - * @return Array the airport list |
|
| 7505 | - * |
|
| 7506 | - */ |
|
| 7502 | + * Gets all departure airports by country of the airplanes that have flown over based on owner |
|
| 7503 | + * |
|
| 7504 | + * @return Array the airport list |
|
| 7505 | + * |
|
| 7506 | + */ |
|
| 7507 | 7507 | public function countAllDepartureAirportCountriesByOwner($owner,$filters = array()) |
| 7508 | 7508 | { |
| 7509 | 7509 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7519,11 +7519,11 @@ discard block |
||
| 7519 | 7519 | } |
| 7520 | 7520 | |
| 7521 | 7521 | /** |
| 7522 | - * Gets all departure airports by country of the airplanes that have flown over based on pilot |
|
| 7523 | - * |
|
| 7524 | - * @return Array the airport list |
|
| 7525 | - * |
|
| 7526 | - */ |
|
| 7522 | + * Gets all departure airports by country of the airplanes that have flown over based on pilot |
|
| 7523 | + * |
|
| 7524 | + * @return Array the airport list |
|
| 7525 | + * |
|
| 7526 | + */ |
|
| 7527 | 7527 | public function countAllDepartureAirportCountriesByPilot($pilot,$filters = array()) |
| 7528 | 7528 | { |
| 7529 | 7529 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7541,11 +7541,11 @@ discard block |
||
| 7541 | 7541 | |
| 7542 | 7542 | |
| 7543 | 7543 | /** |
| 7544 | - * Gets all departure airports of the airplanes that have flown over based on a country |
|
| 7545 | - * |
|
| 7546 | - * @return Array the airport list |
|
| 7547 | - * |
|
| 7548 | - */ |
|
| 7544 | + * Gets all departure airports of the airplanes that have flown over based on a country |
|
| 7545 | + * |
|
| 7546 | + * @return Array the airport list |
|
| 7547 | + * |
|
| 7548 | + */ |
|
| 7549 | 7549 | public function countAllDepartureAirportsByCountry($country,$filters = array()) |
| 7550 | 7550 | { |
| 7551 | 7551 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7579,11 +7579,11 @@ discard block |
||
| 7579 | 7579 | |
| 7580 | 7580 | |
| 7581 | 7581 | /** |
| 7582 | - * Gets all departure airports by country of the airplanes that have flown over based on an aircraft icao |
|
| 7583 | - * |
|
| 7584 | - * @return Array the airport list |
|
| 7585 | - * |
|
| 7586 | - */ |
|
| 7582 | + * Gets all departure airports by country of the airplanes that have flown over based on an aircraft icao |
|
| 7583 | + * |
|
| 7584 | + * @return Array the airport list |
|
| 7585 | + * |
|
| 7586 | + */ |
|
| 7587 | 7587 | public function countAllDepartureAirportCountriesByCountry($country,$filters = array()) |
| 7588 | 7588 | { |
| 7589 | 7589 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7613,31 +7613,31 @@ discard block |
||
| 7613 | 7613 | |
| 7614 | 7614 | |
| 7615 | 7615 | /** |
| 7616 | - * Gets all arrival airports of the airplanes that have flown over |
|
| 7617 | - * |
|
| 7618 | - * @param Boolean $limit Limit result to 10 or not |
|
| 7619 | - * @param Integer $olderthanmonths Only show result older than x months |
|
| 7620 | - * @param String $sincedate Only show result since x date |
|
| 7621 | - * @param Boolean $icaoaskey Show result by ICAO |
|
| 7622 | - * @param Array $filters Filter used here |
|
| 7623 | - * @return Array the airport list |
|
| 7624 | - * |
|
| 7625 | - */ |
|
| 7616 | + * Gets all arrival airports of the airplanes that have flown over |
|
| 7617 | + * |
|
| 7618 | + * @param Boolean $limit Limit result to 10 or not |
|
| 7619 | + * @param Integer $olderthanmonths Only show result older than x months |
|
| 7620 | + * @param String $sincedate Only show result since x date |
|
| 7621 | + * @param Boolean $icaoaskey Show result by ICAO |
|
| 7622 | + * @param Array $filters Filter used here |
|
| 7623 | + * @return Array the airport list |
|
| 7624 | + * |
|
| 7625 | + */ |
|
| 7626 | 7626 | public function countAllArrivalAirports($limit = true, $olderthanmonths = 0, $sincedate = '', $icaoaskey = false,$filters = array(),$year = '',$month = '',$day = '') |
| 7627 | 7627 | { |
| 7628 | 7628 | global $globalDBdriver; |
| 7629 | 7629 | $filter_query = $this->getFilter($filters,true,true); |
| 7630 | 7630 | $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, airport.latitude as arrival_airport_latitude, airport.longitude as arrival_airport_longitude |
| 7631 | 7631 | FROM airport, spotter_output".$filter_query." airport.icao = spotter_output.arrival_airport_icao AND spotter_output.arrival_airport_name <> '' AND spotter_output.arrival_airport_icao <> 'NA' AND spotter_output.arrival_airport_icao <> ''"; |
| 7632 | - if ($olderthanmonths > 0) { |
|
| 7633 | - if ($globalDBdriver == 'mysql') { |
|
| 7632 | + if ($olderthanmonths > 0) { |
|
| 7633 | + if ($globalDBdriver == 'mysql') { |
|
| 7634 | 7634 | $query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)'; |
| 7635 | 7635 | } else { |
| 7636 | 7636 | $query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
| 7637 | 7637 | } |
| 7638 | 7638 | } |
| 7639 | - if ($sincedate != '') { |
|
| 7640 | - if ($globalDBdriver == 'mysql') { |
|
| 7639 | + if ($sincedate != '') { |
|
| 7640 | + if ($globalDBdriver == 'mysql') { |
|
| 7641 | 7641 | $query .= " AND spotter_output.date > '".$sincedate."'"; |
| 7642 | 7642 | } else { |
| 7643 | 7643 | $query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -7671,7 +7671,7 @@ discard block |
||
| 7671 | 7671 | $query_values = array_merge($query_values,array(':day' => $day)); |
| 7672 | 7672 | } |
| 7673 | 7673 | } |
| 7674 | - $query .= " GROUP BY spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country, airport.latitude, airport.longitude |
|
| 7674 | + $query .= " GROUP BY spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country, airport.latitude, airport.longitude |
|
| 7675 | 7675 | ORDER BY airport_arrival_icao_count DESC"; |
| 7676 | 7676 | if ($limit) $query .= " LIMIT 10"; |
| 7677 | 7677 | |
@@ -7702,35 +7702,35 @@ discard block |
||
| 7702 | 7702 | } |
| 7703 | 7703 | |
| 7704 | 7704 | /** |
| 7705 | - * Gets all arrival airports of the airplanes that have flown over |
|
| 7706 | - * |
|
| 7707 | - * @return Array the airport list |
|
| 7708 | - * |
|
| 7709 | - */ |
|
| 7705 | + * Gets all arrival airports of the airplanes that have flown over |
|
| 7706 | + * |
|
| 7707 | + * @return Array the airport list |
|
| 7708 | + * |
|
| 7709 | + */ |
|
| 7710 | 7710 | public function countAllArrivalAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '', $icaoaskey = false,$filters = array()) |
| 7711 | 7711 | { |
| 7712 | 7712 | global $globalDBdriver; |
| 7713 | 7713 | $filter_query = $this->getFilter($filters,true,true); |
| 7714 | 7714 | $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, country.iso3 AS arrival_airport_country_iso3 |
| 7715 | 7715 | FROM countries,spotter_output".$filter_query." countries.name = spotter_output.arrival_airport_country AND spotter_output.airline_icao <> '' AND spotter_output.arrival_airport_name <> '' AND spotter_output.arrival_airport_icao <> 'NA' AND spotter_output.arrival_airport_icao <> '' "; |
| 7716 | - if ($olderthanmonths > 0) { |
|
| 7717 | - if ($globalDBdriver == 'mysql') { |
|
| 7716 | + if ($olderthanmonths > 0) { |
|
| 7717 | + if ($globalDBdriver == 'mysql') { |
|
| 7718 | 7718 | $query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) '; |
| 7719 | 7719 | } else { |
| 7720 | 7720 | $query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
| 7721 | 7721 | } |
| 7722 | 7722 | } |
| 7723 | - if ($sincedate != '') { |
|
| 7724 | - if ($globalDBdriver == 'mysql') { |
|
| 7723 | + if ($sincedate != '') { |
|
| 7724 | + if ($globalDBdriver == 'mysql') { |
|
| 7725 | 7725 | $query .= "AND spotter_output.date > '".$sincedate."' "; |
| 7726 | 7726 | } else { |
| 7727 | 7727 | $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
| 7728 | 7728 | } |
| 7729 | 7729 | } |
| 7730 | 7730 | |
| 7731 | - //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
| 7732 | - //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
| 7733 | - $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, countries.iso3 |
|
| 7731 | + //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
| 7732 | + //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
| 7733 | + $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, countries.iso3 |
|
| 7734 | 7734 | ORDER BY airport_arrival_icao_count DESC"; |
| 7735 | 7735 | if ($limit) $query .= " LIMIT 10"; |
| 7736 | 7736 | |
@@ -7762,26 +7762,26 @@ discard block |
||
| 7762 | 7762 | |
| 7763 | 7763 | |
| 7764 | 7764 | /** |
| 7765 | - * Gets all detected arrival airports of the airplanes that have flown over |
|
| 7766 | - * |
|
| 7767 | - * @return Array the airport list |
|
| 7768 | - * |
|
| 7769 | - */ |
|
| 7765 | + * Gets all detected arrival airports of the airplanes that have flown over |
|
| 7766 | + * |
|
| 7767 | + * @return Array the airport list |
|
| 7768 | + * |
|
| 7769 | + */ |
|
| 7770 | 7770 | public function countAllDetectedArrivalAirports($limit = true, $olderthanmonths = 0, $sincedate = '',$icaoaskey = false,$filters = array(),$year = '',$month = '',$day = '') |
| 7771 | 7771 | { |
| 7772 | 7772 | global $globalDBdriver; |
| 7773 | 7773 | $filter_query = $this->getFilter($filters,true,true); |
| 7774 | 7774 | $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, airport.latitude AS arrival_airport_latitude, airport.longitude AS arrival_airport_longitude |
| 7775 | 7775 | 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"; |
| 7776 | - if ($olderthanmonths > 0) { |
|
| 7777 | - if ($globalDBdriver == 'mysql') { |
|
| 7776 | + if ($olderthanmonths > 0) { |
|
| 7777 | + if ($globalDBdriver == 'mysql') { |
|
| 7778 | 7778 | $query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)'; |
| 7779 | 7779 | } else { |
| 7780 | 7780 | $query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
| 7781 | 7781 | } |
| 7782 | 7782 | } |
| 7783 | - if ($sincedate != '') { |
|
| 7784 | - if ($globalDBdriver == 'mysql') { |
|
| 7783 | + if ($sincedate != '') { |
|
| 7784 | + if ($globalDBdriver == 'mysql') { |
|
| 7785 | 7785 | $query .= " AND spotter_output.date > '".$sincedate."'"; |
| 7786 | 7786 | } else { |
| 7787 | 7787 | $query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -7843,35 +7843,35 @@ discard block |
||
| 7843 | 7843 | } |
| 7844 | 7844 | |
| 7845 | 7845 | /** |
| 7846 | - * Gets all detected arrival airports of the airplanes that have flown over |
|
| 7847 | - * |
|
| 7848 | - * @return Array the airport list |
|
| 7849 | - * |
|
| 7850 | - */ |
|
| 7846 | + * Gets all detected arrival airports of the airplanes that have flown over |
|
| 7847 | + * |
|
| 7848 | + * @return Array the airport list |
|
| 7849 | + * |
|
| 7850 | + */ |
|
| 7851 | 7851 | public function countAllDetectedArrivalAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '',$icaoaskey = false,$filters = array()) |
| 7852 | 7852 | { |
| 7853 | 7853 | global $globalDBdriver; |
| 7854 | 7854 | $filter_query = $this->getFilter($filters,true,true); |
| 7855 | 7855 | $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 |
| 7856 | 7856 | 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 "; |
| 7857 | - if ($olderthanmonths > 0) { |
|
| 7858 | - if ($globalDBdriver == 'mysql') { |
|
| 7857 | + if ($olderthanmonths > 0) { |
|
| 7858 | + if ($globalDBdriver == 'mysql') { |
|
| 7859 | 7859 | $query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) '; |
| 7860 | 7860 | } else { |
| 7861 | 7861 | $query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
| 7862 | 7862 | } |
| 7863 | 7863 | } |
| 7864 | - if ($sincedate != '') { |
|
| 7865 | - if ($globalDBdriver == 'mysql') { |
|
| 7864 | + if ($sincedate != '') { |
|
| 7865 | + if ($globalDBdriver == 'mysql') { |
|
| 7866 | 7866 | $query .= "AND spotter_output.date > '".$sincedate."' "; |
| 7867 | 7867 | } else { |
| 7868 | 7868 | $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
| 7869 | 7869 | } |
| 7870 | 7870 | } |
| 7871 | 7871 | |
| 7872 | - //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
| 7873 | - //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
| 7874 | - $query .= "GROUP BY spotter_output.airline_icao, spotter_output.real_arrival_airport_icao, airport.name, airport.city, airport.country |
|
| 7872 | + //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
| 7873 | + //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
| 7874 | + $query .= "GROUP BY spotter_output.airline_icao, spotter_output.real_arrival_airport_icao, airport.name, airport.city, airport.country |
|
| 7875 | 7875 | ORDER BY airport_arrival_icao_count DESC"; |
| 7876 | 7876 | if ($limit) $query .= " LIMIT 10"; |
| 7877 | 7877 | |
@@ -7901,11 +7901,11 @@ discard block |
||
| 7901 | 7901 | } |
| 7902 | 7902 | |
| 7903 | 7903 | /** |
| 7904 | - * Gets all arrival airports of the airplanes that have flown over based on an airline icao |
|
| 7905 | - * |
|
| 7906 | - * @return Array the airport list |
|
| 7907 | - * |
|
| 7908 | - */ |
|
| 7904 | + * Gets all arrival airports of the airplanes that have flown over based on an airline icao |
|
| 7905 | + * |
|
| 7906 | + * @return Array the airport list |
|
| 7907 | + * |
|
| 7908 | + */ |
|
| 7909 | 7909 | public function countAllArrivalAirportsByAirline($airline_icao, $filters = array()) |
| 7910 | 7910 | { |
| 7911 | 7911 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7937,11 +7937,11 @@ discard block |
||
| 7937 | 7937 | |
| 7938 | 7938 | |
| 7939 | 7939 | /** |
| 7940 | - * Gets all arrival airports by country of the airplanes that have flown over based on an airline icao |
|
| 7941 | - * |
|
| 7942 | - * @return Array the airport list |
|
| 7943 | - * |
|
| 7944 | - */ |
|
| 7940 | + * Gets all arrival airports by country of the airplanes that have flown over based on an airline icao |
|
| 7941 | + * |
|
| 7942 | + * @return Array the airport list |
|
| 7943 | + * |
|
| 7944 | + */ |
|
| 7945 | 7945 | public function countAllArrivalAirportCountriesByAirline($airline_icao,$filters = array()) |
| 7946 | 7946 | { |
| 7947 | 7947 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7971,11 +7971,11 @@ discard block |
||
| 7971 | 7971 | |
| 7972 | 7972 | |
| 7973 | 7973 | /** |
| 7974 | - * Gets all arrival airports of the airplanes that have flown over based on an aircraft icao |
|
| 7975 | - * |
|
| 7976 | - * @return Array the airport list |
|
| 7977 | - * |
|
| 7978 | - */ |
|
| 7974 | + * Gets all arrival airports of the airplanes that have flown over based on an aircraft icao |
|
| 7975 | + * |
|
| 7976 | + * @return Array the airport list |
|
| 7977 | + * |
|
| 7978 | + */ |
|
| 7979 | 7979 | public function countAllArrivalAirportsByAircraft($aircraft_icao,$filters = array()) |
| 7980 | 7980 | { |
| 7981 | 7981 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8009,11 +8009,11 @@ discard block |
||
| 8009 | 8009 | |
| 8010 | 8010 | |
| 8011 | 8011 | /** |
| 8012 | - * Gets all arrival airports by country of the airplanes that have flown over based on an aircraft icao |
|
| 8013 | - * |
|
| 8014 | - * @return Array the airport list |
|
| 8015 | - * |
|
| 8016 | - */ |
|
| 8012 | + * Gets all arrival airports by country of the airplanes that have flown over based on an aircraft icao |
|
| 8013 | + * |
|
| 8014 | + * @return Array the airport list |
|
| 8015 | + * |
|
| 8016 | + */ |
|
| 8017 | 8017 | public function countAllArrivalAirportCountriesByAircraft($aircraft_icao,$filters = array()) |
| 8018 | 8018 | { |
| 8019 | 8019 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8043,11 +8043,11 @@ discard block |
||
| 8043 | 8043 | |
| 8044 | 8044 | |
| 8045 | 8045 | /** |
| 8046 | - * Gets all arrival airports of the airplanes that have flown over based on an aircraft registration |
|
| 8047 | - * |
|
| 8048 | - * @return Array the airport list |
|
| 8049 | - * |
|
| 8050 | - */ |
|
| 8046 | + * Gets all arrival airports of the airplanes that have flown over based on an aircraft registration |
|
| 8047 | + * |
|
| 8048 | + * @return Array the airport list |
|
| 8049 | + * |
|
| 8050 | + */ |
|
| 8051 | 8051 | public function countAllArrivalAirportsByRegistration($registration,$filters = array()) |
| 8052 | 8052 | { |
| 8053 | 8053 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8081,11 +8081,11 @@ discard block |
||
| 8081 | 8081 | |
| 8082 | 8082 | |
| 8083 | 8083 | /** |
| 8084 | - * Gets all arrival airports by country of the airplanes that have flown over based on an aircraft registration |
|
| 8085 | - * |
|
| 8086 | - * @return Array the airport list |
|
| 8087 | - * |
|
| 8088 | - */ |
|
| 8084 | + * Gets all arrival airports by country of the airplanes that have flown over based on an aircraft registration |
|
| 8085 | + * |
|
| 8086 | + * @return Array the airport list |
|
| 8087 | + * |
|
| 8088 | + */ |
|
| 8089 | 8089 | public function countAllArrivalAirportCountriesByRegistration($registration,$filters = array()) |
| 8090 | 8090 | { |
| 8091 | 8091 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8116,11 +8116,11 @@ discard block |
||
| 8116 | 8116 | |
| 8117 | 8117 | |
| 8118 | 8118 | /** |
| 8119 | - * Gets all arrival airports of the airplanes that have flown over based on an departure airport |
|
| 8120 | - * |
|
| 8121 | - * @return Array the airport list |
|
| 8122 | - * |
|
| 8123 | - */ |
|
| 8119 | + * Gets all arrival airports of the airplanes that have flown over based on an departure airport |
|
| 8120 | + * |
|
| 8121 | + * @return Array the airport list |
|
| 8122 | + * |
|
| 8123 | + */ |
|
| 8124 | 8124 | public function countAllArrivalAirportsByAirport($airport_icao,$filters = array()) |
| 8125 | 8125 | { |
| 8126 | 8126 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8153,11 +8153,11 @@ discard block |
||
| 8153 | 8153 | |
| 8154 | 8154 | |
| 8155 | 8155 | /** |
| 8156 | - * Gets all arrival airports by country of the airplanes that have flown over based on an airport icao |
|
| 8157 | - * |
|
| 8158 | - * @return Array the airport list |
|
| 8159 | - * |
|
| 8160 | - */ |
|
| 8156 | + * Gets all arrival airports by country of the airplanes that have flown over based on an airport icao |
|
| 8157 | + * |
|
| 8158 | + * @return Array the airport list |
|
| 8159 | + * |
|
| 8160 | + */ |
|
| 8161 | 8161 | public function countAllArrivalAirportCountriesByAirport($airport_icao,$filters = array()) |
| 8162 | 8162 | { |
| 8163 | 8163 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8185,11 +8185,11 @@ discard block |
||
| 8185 | 8185 | |
| 8186 | 8186 | |
| 8187 | 8187 | /** |
| 8188 | - * Gets all arrival airports of the airplanes that have flown over based on a aircraft manufacturer |
|
| 8189 | - * |
|
| 8190 | - * @return Array the airport list |
|
| 8191 | - * |
|
| 8192 | - */ |
|
| 8188 | + * Gets all arrival airports of the airplanes that have flown over based on a aircraft manufacturer |
|
| 8189 | + * |
|
| 8190 | + * @return Array the airport list |
|
| 8191 | + * |
|
| 8192 | + */ |
|
| 8193 | 8193 | public function countAllArrivalAirportsByManufacturer($aircraft_manufacturer,$filters = array()) |
| 8194 | 8194 | { |
| 8195 | 8195 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8223,11 +8223,11 @@ discard block |
||
| 8223 | 8223 | |
| 8224 | 8224 | |
| 8225 | 8225 | /** |
| 8226 | - * Gets all arrival airports by country of the airplanes that have flown over based on a aircraft manufacturer |
|
| 8227 | - * |
|
| 8228 | - * @return Array the airport list |
|
| 8229 | - * |
|
| 8230 | - */ |
|
| 8226 | + * Gets all arrival airports by country of the airplanes that have flown over based on a aircraft manufacturer |
|
| 8227 | + * |
|
| 8228 | + * @return Array the airport list |
|
| 8229 | + * |
|
| 8230 | + */ |
|
| 8231 | 8231 | public function countAllArrivalAirportCountriesByManufacturer($aircraft_manufacturer,$filters = array()) |
| 8232 | 8232 | { |
| 8233 | 8233 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8258,11 +8258,11 @@ discard block |
||
| 8258 | 8258 | |
| 8259 | 8259 | |
| 8260 | 8260 | /** |
| 8261 | - * Gets all arrival airports of the airplanes that have flown over based on a date |
|
| 8262 | - * |
|
| 8263 | - * @return Array the airport list |
|
| 8264 | - * |
|
| 8265 | - */ |
|
| 8261 | + * Gets all arrival airports of the airplanes that have flown over based on a date |
|
| 8262 | + * |
|
| 8263 | + * @return Array the airport list |
|
| 8264 | + * |
|
| 8265 | + */ |
|
| 8266 | 8266 | public function countAllArrivalAirportsByDate($date,$filters = array()) |
| 8267 | 8267 | { |
| 8268 | 8268 | global $globalTimezone, $globalDBdriver; |
@@ -8308,11 +8308,11 @@ discard block |
||
| 8308 | 8308 | |
| 8309 | 8309 | |
| 8310 | 8310 | /** |
| 8311 | - * Gets all arrival airports by country of the airplanes that have flown over based on a date |
|
| 8312 | - * |
|
| 8313 | - * @return Array the airport list |
|
| 8314 | - * |
|
| 8315 | - */ |
|
| 8311 | + * Gets all arrival airports by country of the airplanes that have flown over based on a date |
|
| 8312 | + * |
|
| 8313 | + * @return Array the airport list |
|
| 8314 | + * |
|
| 8315 | + */ |
|
| 8316 | 8316 | public function countAllArrivalAirportCountriesByDate($date, $filters = array()) |
| 8317 | 8317 | { |
| 8318 | 8318 | global $globalTimezone, $globalDBdriver; |
@@ -8355,11 +8355,11 @@ discard block |
||
| 8355 | 8355 | |
| 8356 | 8356 | |
| 8357 | 8357 | /** |
| 8358 | - * Gets all arrival airports of the airplanes that have flown over based on a ident/callsign |
|
| 8359 | - * |
|
| 8360 | - * @return Array the airport list |
|
| 8361 | - * |
|
| 8362 | - */ |
|
| 8358 | + * Gets all arrival airports of the airplanes that have flown over based on a ident/callsign |
|
| 8359 | + * |
|
| 8360 | + * @return Array the airport list |
|
| 8361 | + * |
|
| 8362 | + */ |
|
| 8363 | 8363 | public function countAllArrivalAirportsByIdent($ident,$filters = array()) |
| 8364 | 8364 | { |
| 8365 | 8365 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8391,11 +8391,11 @@ discard block |
||
| 8391 | 8391 | } |
| 8392 | 8392 | |
| 8393 | 8393 | /** |
| 8394 | - * Gets all arrival airports of the airplanes that have flown over based on a owner |
|
| 8395 | - * |
|
| 8396 | - * @return Array the airport list |
|
| 8397 | - * |
|
| 8398 | - */ |
|
| 8394 | + * Gets all arrival airports of the airplanes that have flown over based on a owner |
|
| 8395 | + * |
|
| 8396 | + * @return Array the airport list |
|
| 8397 | + * |
|
| 8398 | + */ |
|
| 8399 | 8399 | public function countAllArrivalAirportsByOwner($owner,$filters = array()) |
| 8400 | 8400 | { |
| 8401 | 8401 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8426,11 +8426,11 @@ discard block |
||
| 8426 | 8426 | } |
| 8427 | 8427 | |
| 8428 | 8428 | /** |
| 8429 | - * Gets all arrival airports of the airplanes that have flown over based on a pilot |
|
| 8430 | - * |
|
| 8431 | - * @return Array the airport list |
|
| 8432 | - * |
|
| 8433 | - */ |
|
| 8429 | + * Gets all arrival airports of the airplanes that have flown over based on a pilot |
|
| 8430 | + * |
|
| 8431 | + * @return Array the airport list |
|
| 8432 | + * |
|
| 8433 | + */ |
|
| 8434 | 8434 | public function countAllArrivalAirportsByPilot($pilot,$filters = array()) |
| 8435 | 8435 | { |
| 8436 | 8436 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8461,11 +8461,11 @@ discard block |
||
| 8461 | 8461 | } |
| 8462 | 8462 | |
| 8463 | 8463 | /** |
| 8464 | - * Gets all arrival airports by country of the airplanes that have flown over based on a callsign/ident |
|
| 8465 | - * |
|
| 8466 | - * @return Array the airport list |
|
| 8467 | - * |
|
| 8468 | - */ |
|
| 8464 | + * Gets all arrival airports by country of the airplanes that have flown over based on a callsign/ident |
|
| 8465 | + * |
|
| 8466 | + * @return Array the airport list |
|
| 8467 | + * |
|
| 8468 | + */ |
|
| 8469 | 8469 | public function countAllArrivalAirportCountriesByIdent($ident, $filters = array()) |
| 8470 | 8470 | { |
| 8471 | 8471 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8494,11 +8494,11 @@ discard block |
||
| 8494 | 8494 | } |
| 8495 | 8495 | |
| 8496 | 8496 | /** |
| 8497 | - * Gets all arrival airports by country of the airplanes that have flown over based on a owner |
|
| 8498 | - * |
|
| 8499 | - * @return Array the airport list |
|
| 8500 | - * |
|
| 8501 | - */ |
|
| 8497 | + * Gets all arrival airports by country of the airplanes that have flown over based on a owner |
|
| 8498 | + * |
|
| 8499 | + * @return Array the airport list |
|
| 8500 | + * |
|
| 8501 | + */ |
|
| 8502 | 8502 | public function countAllArrivalAirportCountriesByOwner($owner, $filters = array()) |
| 8503 | 8503 | { |
| 8504 | 8504 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8514,11 +8514,11 @@ discard block |
||
| 8514 | 8514 | } |
| 8515 | 8515 | |
| 8516 | 8516 | /** |
| 8517 | - * Gets all arrival airports by country of the airplanes that have flown over based on a pilot |
|
| 8518 | - * |
|
| 8519 | - * @return Array the airport list |
|
| 8520 | - * |
|
| 8521 | - */ |
|
| 8517 | + * Gets all arrival airports by country of the airplanes that have flown over based on a pilot |
|
| 8518 | + * |
|
| 8519 | + * @return Array the airport list |
|
| 8520 | + * |
|
| 8521 | + */ |
|
| 8522 | 8522 | public function countAllArrivalAirportCountriesByPilot($pilot, $filters = array()) |
| 8523 | 8523 | { |
| 8524 | 8524 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8536,11 +8536,11 @@ discard block |
||
| 8536 | 8536 | |
| 8537 | 8537 | |
| 8538 | 8538 | /** |
| 8539 | - * Gets all arrival airports of the airplanes that have flown over based on a country |
|
| 8540 | - * |
|
| 8541 | - * @return Array the airport list |
|
| 8542 | - * |
|
| 8543 | - */ |
|
| 8539 | + * Gets all arrival airports of the airplanes that have flown over based on a country |
|
| 8540 | + * |
|
| 8541 | + * @return Array the airport list |
|
| 8542 | + * |
|
| 8543 | + */ |
|
| 8544 | 8544 | public function countAllArrivalAirportsByCountry($country,$filters = array()) |
| 8545 | 8545 | { |
| 8546 | 8546 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8573,11 +8573,11 @@ discard block |
||
| 8573 | 8573 | |
| 8574 | 8574 | |
| 8575 | 8575 | /** |
| 8576 | - * Gets all arrival airports by country of the airplanes that have flown over based on a country |
|
| 8577 | - * |
|
| 8578 | - * @return Array the airport list |
|
| 8579 | - * |
|
| 8580 | - */ |
|
| 8576 | + * Gets all arrival airports by country of the airplanes that have flown over based on a country |
|
| 8577 | + * |
|
| 8578 | + * @return Array the airport list |
|
| 8579 | + * |
|
| 8580 | + */ |
|
| 8581 | 8581 | public function countAllArrivalAirportCountriesByCountry($country,$filters = array()) |
| 8582 | 8582 | { |
| 8583 | 8583 | global $globalDBdriver; |
@@ -8609,11 +8609,11 @@ discard block |
||
| 8609 | 8609 | |
| 8610 | 8610 | |
| 8611 | 8611 | /** |
| 8612 | - * Counts all airport departure countries |
|
| 8613 | - * |
|
| 8614 | - * @return Array the airport departure list |
|
| 8615 | - * |
|
| 8616 | - */ |
|
| 8612 | + * Counts all airport departure countries |
|
| 8613 | + * |
|
| 8614 | + * @return Array the airport departure list |
|
| 8615 | + * |
|
| 8616 | + */ |
|
| 8617 | 8617 | public function countAllDepartureCountries($filters = array(),$year = '',$month = '', $day = '') |
| 8618 | 8618 | { |
| 8619 | 8619 | global $globalDBdriver; |
@@ -8672,11 +8672,11 @@ discard block |
||
| 8672 | 8672 | |
| 8673 | 8673 | |
| 8674 | 8674 | /** |
| 8675 | - * Counts all airport arrival countries |
|
| 8676 | - * |
|
| 8677 | - * @return Array the airport arrival list |
|
| 8678 | - * |
|
| 8679 | - */ |
|
| 8675 | + * Counts all airport arrival countries |
|
| 8676 | + * |
|
| 8677 | + * @return Array the airport arrival list |
|
| 8678 | + * |
|
| 8679 | + */ |
|
| 8680 | 8680 | public function countAllArrivalCountries($limit = true,$filters = array(),$year = '',$month = '',$day = '') |
| 8681 | 8681 | { |
| 8682 | 8682 | global $globalDBdriver; |
@@ -8739,11 +8739,11 @@ discard block |
||
| 8739 | 8739 | |
| 8740 | 8740 | |
| 8741 | 8741 | /** |
| 8742 | - * Gets all route combinations |
|
| 8743 | - * |
|
| 8744 | - * @return Array the route list |
|
| 8745 | - * |
|
| 8746 | - */ |
|
| 8742 | + * Gets all route combinations |
|
| 8743 | + * |
|
| 8744 | + * @return Array the route list |
|
| 8745 | + * |
|
| 8746 | + */ |
|
| 8747 | 8747 | public function countAllRoutes($filters = array()) |
| 8748 | 8748 | { |
| 8749 | 8749 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8782,11 +8782,11 @@ discard block |
||
| 8782 | 8782 | |
| 8783 | 8783 | |
| 8784 | 8784 | /** |
| 8785 | - * Gets all route combinations based on an aircraft |
|
| 8786 | - * |
|
| 8787 | - * @return Array the route list |
|
| 8788 | - * |
|
| 8789 | - */ |
|
| 8785 | + * Gets all route combinations based on an aircraft |
|
| 8786 | + * |
|
| 8787 | + * @return Array the route list |
|
| 8788 | + * |
|
| 8789 | + */ |
|
| 8790 | 8790 | public function countAllRoutesByAircraft($aircraft_icao,$filters = array()) |
| 8791 | 8791 | { |
| 8792 | 8792 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8822,11 +8822,11 @@ discard block |
||
| 8822 | 8822 | |
| 8823 | 8823 | |
| 8824 | 8824 | /** |
| 8825 | - * Gets all route combinations based on an aircraft registration |
|
| 8826 | - * |
|
| 8827 | - * @return Array the route list |
|
| 8828 | - * |
|
| 8829 | - */ |
|
| 8825 | + * Gets all route combinations based on an aircraft registration |
|
| 8826 | + * |
|
| 8827 | + * @return Array the route list |
|
| 8828 | + * |
|
| 8829 | + */ |
|
| 8830 | 8830 | public function countAllRoutesByRegistration($registration, $filters = array()) |
| 8831 | 8831 | { |
| 8832 | 8832 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8864,11 +8864,11 @@ discard block |
||
| 8864 | 8864 | |
| 8865 | 8865 | |
| 8866 | 8866 | /** |
| 8867 | - * Gets all route combinations based on an airline |
|
| 8868 | - * |
|
| 8869 | - * @return Array the route list |
|
| 8870 | - * |
|
| 8871 | - */ |
|
| 8867 | + * Gets all route combinations based on an airline |
|
| 8868 | + * |
|
| 8869 | + * @return Array the route list |
|
| 8870 | + * |
|
| 8871 | + */ |
|
| 8872 | 8872 | public function countAllRoutesByAirline($airline_icao, $filters = array()) |
| 8873 | 8873 | { |
| 8874 | 8874 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8906,11 +8906,11 @@ discard block |
||
| 8906 | 8906 | |
| 8907 | 8907 | |
| 8908 | 8908 | /** |
| 8909 | - * Gets all route combinations based on an airport |
|
| 8910 | - * |
|
| 8911 | - * @return Array the route list |
|
| 8912 | - * |
|
| 8913 | - */ |
|
| 8909 | + * Gets all route combinations based on an airport |
|
| 8910 | + * |
|
| 8911 | + * @return Array the route list |
|
| 8912 | + * |
|
| 8913 | + */ |
|
| 8914 | 8914 | public function countAllRoutesByAirport($airport_icao, $filters = array()) |
| 8915 | 8915 | { |
| 8916 | 8916 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8947,11 +8947,11 @@ discard block |
||
| 8947 | 8947 | |
| 8948 | 8948 | |
| 8949 | 8949 | /** |
| 8950 | - * Gets all route combinations based on an country |
|
| 8951 | - * |
|
| 8952 | - * @return Array the route list |
|
| 8953 | - * |
|
| 8954 | - */ |
|
| 8950 | + * Gets all route combinations based on an country |
|
| 8951 | + * |
|
| 8952 | + * @return Array the route list |
|
| 8953 | + * |
|
| 8954 | + */ |
|
| 8955 | 8955 | public function countAllRoutesByCountry($country, $filters = array()) |
| 8956 | 8956 | { |
| 8957 | 8957 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8987,11 +8987,11 @@ discard block |
||
| 8987 | 8987 | |
| 8988 | 8988 | |
| 8989 | 8989 | /** |
| 8990 | - * Gets all route combinations based on an date |
|
| 8991 | - * |
|
| 8992 | - * @return Array the route list |
|
| 8993 | - * |
|
| 8994 | - */ |
|
| 8990 | + * Gets all route combinations based on an date |
|
| 8991 | + * |
|
| 8992 | + * @return Array the route list |
|
| 8993 | + * |
|
| 8994 | + */ |
|
| 8995 | 8995 | public function countAllRoutesByDate($date, $filters = array()) |
| 8996 | 8996 | { |
| 8997 | 8997 | global $globalTimezone, $globalDBdriver; |
@@ -9041,11 +9041,11 @@ discard block |
||
| 9041 | 9041 | |
| 9042 | 9042 | |
| 9043 | 9043 | /** |
| 9044 | - * Gets all route combinations based on an ident/callsign |
|
| 9045 | - * |
|
| 9046 | - * @return Array the route list |
|
| 9047 | - * |
|
| 9048 | - */ |
|
| 9044 | + * Gets all route combinations based on an ident/callsign |
|
| 9045 | + * |
|
| 9046 | + * @return Array the route list |
|
| 9047 | + * |
|
| 9048 | + */ |
|
| 9049 | 9049 | public function countAllRoutesByIdent($ident, $filters = array()) |
| 9050 | 9050 | { |
| 9051 | 9051 | $filter_query = $this->getFilter($filters,true,true); |
@@ -9081,11 +9081,11 @@ discard block |
||
| 9081 | 9081 | } |
| 9082 | 9082 | |
| 9083 | 9083 | /** |
| 9084 | - * Gets all route combinations based on an owner |
|
| 9085 | - * |
|
| 9086 | - * @return Array the route list |
|
| 9087 | - * |
|
| 9088 | - */ |
|
| 9084 | + * Gets all route combinations based on an owner |
|
| 9085 | + * |
|
| 9086 | + * @return Array the route list |
|
| 9087 | + * |
|
| 9088 | + */ |
|
| 9089 | 9089 | public function countAllRoutesByOwner($owner,$filters = array()) |
| 9090 | 9090 | { |
| 9091 | 9091 | $filter_query = $this->getFilter($filters,true,true); |
@@ -9121,11 +9121,11 @@ discard block |
||
| 9121 | 9121 | } |
| 9122 | 9122 | |
| 9123 | 9123 | /** |
| 9124 | - * Gets all route combinations based on a pilot |
|
| 9125 | - * |
|
| 9126 | - * @return Array the route list |
|
| 9127 | - * |
|
| 9128 | - */ |
|
| 9124 | + * Gets all route combinations based on a pilot |
|
| 9125 | + * |
|
| 9126 | + * @return Array the route list |
|
| 9127 | + * |
|
| 9128 | + */ |
|
| 9129 | 9129 | public function countAllRoutesByPilot($pilot,$filters = array()) |
| 9130 | 9130 | { |
| 9131 | 9131 | $filter_query = $this->getFilter($filters,true,true); |
@@ -9162,11 +9162,11 @@ discard block |
||
| 9162 | 9162 | |
| 9163 | 9163 | |
| 9164 | 9164 | /** |
| 9165 | - * Gets all route combinations based on an manufacturer |
|
| 9166 | - * |
|
| 9167 | - * @return Array the route list |
|
| 9168 | - * |
|
| 9169 | - */ |
|
| 9165 | + * Gets all route combinations based on an manufacturer |
|
| 9166 | + * |
|
| 9167 | + * @return Array the route list |
|
| 9168 | + * |
|
| 9169 | + */ |
|
| 9170 | 9170 | public function countAllRoutesByManufacturer($aircraft_manufacturer, $filters = array()) |
| 9171 | 9171 | { |
| 9172 | 9172 | $filter_query = $this->getFilter($filters,true,true); |
@@ -9204,11 +9204,11 @@ discard block |
||
| 9204 | 9204 | |
| 9205 | 9205 | |
| 9206 | 9206 | /** |
| 9207 | - * Gets all route combinations with waypoints |
|
| 9208 | - * |
|
| 9209 | - * @return Array the route list |
|
| 9210 | - * |
|
| 9211 | - */ |
|
| 9207 | + * Gets all route combinations with waypoints |
|
| 9208 | + * |
|
| 9209 | + * @return Array the route list |
|
| 9210 | + * |
|
| 9211 | + */ |
|
| 9212 | 9212 | public function countAllRoutesWithWaypoints($filters = array()) |
| 9213 | 9213 | { |
| 9214 | 9214 | $filter_query = $this->getFilter($filters,true,true); |
@@ -9245,11 +9245,11 @@ discard block |
||
| 9245 | 9245 | } |
| 9246 | 9246 | |
| 9247 | 9247 | /** |
| 9248 | - * Gets all callsigns that have flown over |
|
| 9249 | - * |
|
| 9250 | - * @return Array the callsign list |
|
| 9251 | - * |
|
| 9252 | - */ |
|
| 9248 | + * Gets all callsigns that have flown over |
|
| 9249 | + * |
|
| 9250 | + * @return Array the callsign list |
|
| 9251 | + * |
|
| 9252 | + */ |
|
| 9253 | 9253 | public function countAllCallsigns($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array(),$year = '', $month = '', $day = '') |
| 9254 | 9254 | { |
| 9255 | 9255 | global $globalDBdriver; |
@@ -9315,11 +9315,11 @@ discard block |
||
| 9315 | 9315 | } |
| 9316 | 9316 | |
| 9317 | 9317 | /** |
| 9318 | - * Gets all callsigns that have flown over |
|
| 9319 | - * |
|
| 9320 | - * @return Array the callsign list |
|
| 9321 | - * |
|
| 9322 | - */ |
|
| 9318 | + * Gets all callsigns that have flown over |
|
| 9319 | + * |
|
| 9320 | + * @return Array the callsign list |
|
| 9321 | + * |
|
| 9322 | + */ |
|
| 9323 | 9323 | public function countAllCallsignsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '', $filters = array()) |
| 9324 | 9324 | { |
| 9325 | 9325 | global $globalDBdriver; |
@@ -9360,11 +9360,11 @@ discard block |
||
| 9360 | 9360 | |
| 9361 | 9361 | |
| 9362 | 9362 | /** |
| 9363 | - * Counts all dates |
|
| 9364 | - * |
|
| 9365 | - * @return Array the date list |
|
| 9366 | - * |
|
| 9367 | - */ |
|
| 9363 | + * Counts all dates |
|
| 9364 | + * |
|
| 9365 | + * @return Array the date list |
|
| 9366 | + * |
|
| 9367 | + */ |
|
| 9368 | 9368 | public function countAllDates($filters = array()) |
| 9369 | 9369 | { |
| 9370 | 9370 | global $globalTimezone, $globalDBdriver; |
@@ -9409,11 +9409,11 @@ discard block |
||
| 9409 | 9409 | } |
| 9410 | 9410 | |
| 9411 | 9411 | /** |
| 9412 | - * Counts all dates |
|
| 9413 | - * |
|
| 9414 | - * @return Array the date list |
|
| 9415 | - * |
|
| 9416 | - */ |
|
| 9412 | + * Counts all dates |
|
| 9413 | + * |
|
| 9414 | + * @return Array the date list |
|
| 9415 | + * |
|
| 9416 | + */ |
|
| 9417 | 9417 | public function countAllDatesByAirlines($filters = array()) |
| 9418 | 9418 | { |
| 9419 | 9419 | global $globalTimezone, $globalDBdriver; |
@@ -9458,11 +9458,11 @@ discard block |
||
| 9458 | 9458 | } |
| 9459 | 9459 | |
| 9460 | 9460 | /** |
| 9461 | - * Counts all dates during the last 7 days |
|
| 9462 | - * |
|
| 9463 | - * @return Array the date list |
|
| 9464 | - * |
|
| 9465 | - */ |
|
| 9461 | + * Counts all dates during the last 7 days |
|
| 9462 | + * |
|
| 9463 | + * @return Array the date list |
|
| 9464 | + * |
|
| 9465 | + */ |
|
| 9466 | 9466 | public function countAllDatesLast7Days($filters = array()) |
| 9467 | 9467 | { |
| 9468 | 9468 | global $globalTimezone, $globalDBdriver; |
@@ -9484,7 +9484,7 @@ discard block |
||
| 9484 | 9484 | $query .= " GROUP BY date_name |
| 9485 | 9485 | ORDER BY date_name ASC"; |
| 9486 | 9486 | $query_data = array(':offset' => $offset); |
| 9487 | - } |
|
| 9487 | + } |
|
| 9488 | 9488 | |
| 9489 | 9489 | $sth = $this->db->prepare($query); |
| 9490 | 9490 | $sth->execute($query_data); |
@@ -9504,11 +9504,11 @@ discard block |
||
| 9504 | 9504 | } |
| 9505 | 9505 | |
| 9506 | 9506 | /** |
| 9507 | - * Counts all dates during the last month |
|
| 9508 | - * |
|
| 9509 | - * @return Array the date list |
|
| 9510 | - * |
|
| 9511 | - */ |
|
| 9507 | + * Counts all dates during the last month |
|
| 9508 | + * |
|
| 9509 | + * @return Array the date list |
|
| 9510 | + * |
|
| 9511 | + */ |
|
| 9512 | 9512 | public function countAllDatesLastMonth($filters = array()) |
| 9513 | 9513 | { |
| 9514 | 9514 | global $globalTimezone, $globalDBdriver; |
@@ -9530,7 +9530,7 @@ discard block |
||
| 9530 | 9530 | $query .= " GROUP BY date_name |
| 9531 | 9531 | ORDER BY date_name ASC"; |
| 9532 | 9532 | $query_data = array(':offset' => $offset); |
| 9533 | - } |
|
| 9533 | + } |
|
| 9534 | 9534 | |
| 9535 | 9535 | $sth = $this->db->prepare($query); |
| 9536 | 9536 | $sth->execute($query_data); |
@@ -9551,11 +9551,11 @@ discard block |
||
| 9551 | 9551 | |
| 9552 | 9552 | |
| 9553 | 9553 | /** |
| 9554 | - * Counts all dates during the last month |
|
| 9555 | - * |
|
| 9556 | - * @return Array the date list |
|
| 9557 | - * |
|
| 9558 | - */ |
|
| 9554 | + * Counts all dates during the last month |
|
| 9555 | + * |
|
| 9556 | + * @return Array the date list |
|
| 9557 | + * |
|
| 9558 | + */ |
|
| 9559 | 9559 | public function countAllDatesLastMonthByAirlines($filters = array()) |
| 9560 | 9560 | { |
| 9561 | 9561 | global $globalTimezone, $globalDBdriver; |
@@ -9578,7 +9578,7 @@ discard block |
||
| 9578 | 9578 | GROUP BY spotter_output.airline_icao, date_name |
| 9579 | 9579 | ORDER BY date_name ASC"; |
| 9580 | 9580 | $query_data = array(':offset' => $offset); |
| 9581 | - } |
|
| 9581 | + } |
|
| 9582 | 9582 | |
| 9583 | 9583 | $sth = $this->db->prepare($query); |
| 9584 | 9584 | $sth->execute($query_data); |
@@ -9600,11 +9600,11 @@ discard block |
||
| 9600 | 9600 | |
| 9601 | 9601 | |
| 9602 | 9602 | /** |
| 9603 | - * Counts all month |
|
| 9604 | - * |
|
| 9605 | - * @return Array the month list |
|
| 9606 | - * |
|
| 9607 | - */ |
|
| 9603 | + * Counts all month |
|
| 9604 | + * |
|
| 9605 | + * @return Array the month list |
|
| 9606 | + * |
|
| 9607 | + */ |
|
| 9608 | 9608 | public function countAllMonths($filters = array()) |
| 9609 | 9609 | { |
| 9610 | 9610 | global $globalTimezone, $globalDBdriver; |
@@ -9646,11 +9646,11 @@ discard block |
||
| 9646 | 9646 | } |
| 9647 | 9647 | |
| 9648 | 9648 | /** |
| 9649 | - * Counts all month |
|
| 9650 | - * |
|
| 9651 | - * @return Array the month list |
|
| 9652 | - * |
|
| 9653 | - */ |
|
| 9649 | + * Counts all month |
|
| 9650 | + * |
|
| 9651 | + * @return Array the month list |
|
| 9652 | + * |
|
| 9653 | + */ |
|
| 9654 | 9654 | public function countAllMonthsByAirlines($filters = array()) |
| 9655 | 9655 | { |
| 9656 | 9656 | global $globalTimezone, $globalDBdriver; |
@@ -9695,11 +9695,11 @@ discard block |
||
| 9695 | 9695 | } |
| 9696 | 9696 | |
| 9697 | 9697 | /** |
| 9698 | - * Counts all military month |
|
| 9699 | - * |
|
| 9700 | - * @return Array the month list |
|
| 9701 | - * |
|
| 9702 | - */ |
|
| 9698 | + * Counts all military month |
|
| 9699 | + * |
|
| 9700 | + * @return Array the month list |
|
| 9701 | + * |
|
| 9702 | + */ |
|
| 9703 | 9703 | public function countAllMilitaryMonths($filters = array()) |
| 9704 | 9704 | { |
| 9705 | 9705 | global $globalTimezone, $globalDBdriver; |
@@ -9740,11 +9740,11 @@ discard block |
||
| 9740 | 9740 | } |
| 9741 | 9741 | |
| 9742 | 9742 | /** |
| 9743 | - * Counts all month owners |
|
| 9744 | - * |
|
| 9745 | - * @return Array the month list |
|
| 9746 | - * |
|
| 9747 | - */ |
|
| 9743 | + * Counts all month owners |
|
| 9744 | + * |
|
| 9745 | + * @return Array the month list |
|
| 9746 | + * |
|
| 9747 | + */ |
|
| 9748 | 9748 | public function countAllMonthsOwners($filters = array()) |
| 9749 | 9749 | { |
| 9750 | 9750 | global $globalTimezone, $globalDBdriver; |
@@ -9786,11 +9786,11 @@ discard block |
||
| 9786 | 9786 | } |
| 9787 | 9787 | |
| 9788 | 9788 | /** |
| 9789 | - * Counts all month owners |
|
| 9790 | - * |
|
| 9791 | - * @return Array the month list |
|
| 9792 | - * |
|
| 9793 | - */ |
|
| 9789 | + * Counts all month owners |
|
| 9790 | + * |
|
| 9791 | + * @return Array the month list |
|
| 9792 | + * |
|
| 9793 | + */ |
|
| 9794 | 9794 | public function countAllMonthsOwnersByAirlines($filters = array()) |
| 9795 | 9795 | { |
| 9796 | 9796 | global $globalTimezone, $globalDBdriver; |
@@ -9833,11 +9833,11 @@ discard block |
||
| 9833 | 9833 | } |
| 9834 | 9834 | |
| 9835 | 9835 | /** |
| 9836 | - * Counts all month pilot |
|
| 9837 | - * |
|
| 9838 | - * @return Array the month list |
|
| 9839 | - * |
|
| 9840 | - */ |
|
| 9836 | + * Counts all month pilot |
|
| 9837 | + * |
|
| 9838 | + * @return Array the month list |
|
| 9839 | + * |
|
| 9840 | + */ |
|
| 9841 | 9841 | public function countAllMonthsPilots($filters = array()) |
| 9842 | 9842 | { |
| 9843 | 9843 | global $globalTimezone, $globalDBdriver; |
@@ -9879,11 +9879,11 @@ discard block |
||
| 9879 | 9879 | } |
| 9880 | 9880 | |
| 9881 | 9881 | /** |
| 9882 | - * Counts all month pilot |
|
| 9883 | - * |
|
| 9884 | - * @return Array the month list |
|
| 9885 | - * |
|
| 9886 | - */ |
|
| 9882 | + * Counts all month pilot |
|
| 9883 | + * |
|
| 9884 | + * @return Array the month list |
|
| 9885 | + * |
|
| 9886 | + */ |
|
| 9887 | 9887 | public function countAllMonthsPilotsByAirlines($filters = array()) |
| 9888 | 9888 | { |
| 9889 | 9889 | global $globalTimezone, $globalDBdriver; |
@@ -9926,11 +9926,11 @@ discard block |
||
| 9926 | 9926 | } |
| 9927 | 9927 | |
| 9928 | 9928 | /** |
| 9929 | - * Counts all month airline |
|
| 9930 | - * |
|
| 9931 | - * @return Array the month list |
|
| 9932 | - * |
|
| 9933 | - */ |
|
| 9929 | + * Counts all month airline |
|
| 9930 | + * |
|
| 9931 | + * @return Array the month list |
|
| 9932 | + * |
|
| 9933 | + */ |
|
| 9934 | 9934 | public function countAllMonthsAirlines($filters = array()) |
| 9935 | 9935 | { |
| 9936 | 9936 | global $globalTimezone, $globalDBdriver; |
@@ -9972,11 +9972,11 @@ discard block |
||
| 9972 | 9972 | } |
| 9973 | 9973 | |
| 9974 | 9974 | /** |
| 9975 | - * Counts all month aircraft |
|
| 9976 | - * |
|
| 9977 | - * @return Array the month list |
|
| 9978 | - * |
|
| 9979 | - */ |
|
| 9975 | + * Counts all month aircraft |
|
| 9976 | + * |
|
| 9977 | + * @return Array the month list |
|
| 9978 | + * |
|
| 9979 | + */ |
|
| 9980 | 9980 | public function countAllMonthsAircrafts($filters = array()) |
| 9981 | 9981 | { |
| 9982 | 9982 | global $globalTimezone, $globalDBdriver; |
@@ -10019,11 +10019,11 @@ discard block |
||
| 10019 | 10019 | |
| 10020 | 10020 | |
| 10021 | 10021 | /** |
| 10022 | - * Counts all month aircraft |
|
| 10023 | - * |
|
| 10024 | - * @return Array the month list |
|
| 10025 | - * |
|
| 10026 | - */ |
|
| 10022 | + * Counts all month aircraft |
|
| 10023 | + * |
|
| 10024 | + * @return Array the month list |
|
| 10025 | + * |
|
| 10026 | + */ |
|
| 10027 | 10027 | public function countAllMonthsAircraftsByAirlines($filters = array()) |
| 10028 | 10028 | { |
| 10029 | 10029 | global $globalTimezone, $globalDBdriver; |
@@ -10066,11 +10066,11 @@ discard block |
||
| 10066 | 10066 | } |
| 10067 | 10067 | |
| 10068 | 10068 | /** |
| 10069 | - * Counts all month real arrival |
|
| 10070 | - * |
|
| 10071 | - * @return Array the month list |
|
| 10072 | - * |
|
| 10073 | - */ |
|
| 10069 | + * Counts all month real arrival |
|
| 10070 | + * |
|
| 10071 | + * @return Array the month list |
|
| 10072 | + * |
|
| 10073 | + */ |
|
| 10074 | 10074 | public function countAllMonthsRealArrivals($filters = array()) |
| 10075 | 10075 | { |
| 10076 | 10076 | global $globalTimezone, $globalDBdriver; |
@@ -10113,11 +10113,11 @@ discard block |
||
| 10113 | 10113 | |
| 10114 | 10114 | |
| 10115 | 10115 | /** |
| 10116 | - * Counts all month real arrival |
|
| 10117 | - * |
|
| 10118 | - * @return Array the month list |
|
| 10119 | - * |
|
| 10120 | - */ |
|
| 10116 | + * Counts all month real arrival |
|
| 10117 | + * |
|
| 10118 | + * @return Array the month list |
|
| 10119 | + * |
|
| 10120 | + */ |
|
| 10121 | 10121 | public function countAllMonthsRealArrivalsByAirlines($filters = array()) |
| 10122 | 10122 | { |
| 10123 | 10123 | global $globalTimezone, $globalDBdriver; |
@@ -10161,11 +10161,11 @@ discard block |
||
| 10161 | 10161 | |
| 10162 | 10162 | |
| 10163 | 10163 | /** |
| 10164 | - * Counts all dates during the last year |
|
| 10165 | - * |
|
| 10166 | - * @return Array the date list |
|
| 10167 | - * |
|
| 10168 | - */ |
|
| 10164 | + * Counts all dates during the last year |
|
| 10165 | + * |
|
| 10166 | + * @return Array the date list |
|
| 10167 | + * |
|
| 10168 | + */ |
|
| 10169 | 10169 | public function countAllMonthsLastYear($filters) |
| 10170 | 10170 | { |
| 10171 | 10171 | global $globalTimezone, $globalDBdriver; |
@@ -10187,7 +10187,7 @@ discard block |
||
| 10187 | 10187 | $query .= " GROUP BY year_name, month_name |
| 10188 | 10188 | ORDER BY year_name, month_name ASC"; |
| 10189 | 10189 | $query_data = array(':offset' => $offset); |
| 10190 | - } |
|
| 10190 | + } |
|
| 10191 | 10191 | |
| 10192 | 10192 | $sth = $this->db->prepare($query); |
| 10193 | 10193 | $sth->execute($query_data); |
@@ -10210,11 +10210,11 @@ discard block |
||
| 10210 | 10210 | |
| 10211 | 10211 | |
| 10212 | 10212 | /** |
| 10213 | - * Counts all hours |
|
| 10214 | - * |
|
| 10215 | - * @return Array the hour list |
|
| 10216 | - * |
|
| 10217 | - */ |
|
| 10213 | + * Counts all hours |
|
| 10214 | + * |
|
| 10215 | + * @return Array the hour list |
|
| 10216 | + * |
|
| 10217 | + */ |
|
| 10218 | 10218 | public function countAllHours($orderby,$filters = array()) |
| 10219 | 10219 | { |
| 10220 | 10220 | global $globalTimezone, $globalDBdriver; |
@@ -10275,11 +10275,11 @@ discard block |
||
| 10275 | 10275 | } |
| 10276 | 10276 | |
| 10277 | 10277 | /** |
| 10278 | - * Counts all hours |
|
| 10279 | - * |
|
| 10280 | - * @return Array the hour list |
|
| 10281 | - * |
|
| 10282 | - */ |
|
| 10278 | + * Counts all hours |
|
| 10279 | + * |
|
| 10280 | + * @return Array the hour list |
|
| 10281 | + * |
|
| 10282 | + */ |
|
| 10283 | 10283 | public function countAllHoursByAirlines($orderby, $filters = array()) |
| 10284 | 10284 | { |
| 10285 | 10285 | global $globalTimezone, $globalDBdriver; |
@@ -10342,11 +10342,11 @@ discard block |
||
| 10342 | 10342 | |
| 10343 | 10343 | |
| 10344 | 10344 | /** |
| 10345 | - * Counts all hours by airline |
|
| 10346 | - * |
|
| 10347 | - * @return Array the hour list |
|
| 10348 | - * |
|
| 10349 | - */ |
|
| 10345 | + * Counts all hours by airline |
|
| 10346 | + * |
|
| 10347 | + * @return Array the hour list |
|
| 10348 | + * |
|
| 10349 | + */ |
|
| 10350 | 10350 | public function countAllHoursByAirline($airline_icao, $filters = array()) |
| 10351 | 10351 | { |
| 10352 | 10352 | global $globalTimezone, $globalDBdriver; |
@@ -10392,11 +10392,11 @@ discard block |
||
| 10392 | 10392 | |
| 10393 | 10393 | |
| 10394 | 10394 | /** |
| 10395 | - * Counts all hours by aircraft |
|
| 10396 | - * |
|
| 10397 | - * @return Array the hour list |
|
| 10398 | - * |
|
| 10399 | - */ |
|
| 10395 | + * Counts all hours by aircraft |
|
| 10396 | + * |
|
| 10397 | + * @return Array the hour list |
|
| 10398 | + * |
|
| 10399 | + */ |
|
| 10400 | 10400 | public function countAllHoursByAircraft($aircraft_icao, $filters = array()) |
| 10401 | 10401 | { |
| 10402 | 10402 | global $globalTimezone, $globalDBdriver; |
@@ -10439,11 +10439,11 @@ discard block |
||
| 10439 | 10439 | |
| 10440 | 10440 | |
| 10441 | 10441 | /** |
| 10442 | - * Counts all hours by aircraft registration |
|
| 10443 | - * |
|
| 10444 | - * @return Array the hour list |
|
| 10445 | - * |
|
| 10446 | - */ |
|
| 10442 | + * Counts all hours by aircraft registration |
|
| 10443 | + * |
|
| 10444 | + * @return Array the hour list |
|
| 10445 | + * |
|
| 10446 | + */ |
|
| 10447 | 10447 | public function countAllHoursByRegistration($registration, $filters = array()) |
| 10448 | 10448 | { |
| 10449 | 10449 | global $globalTimezone, $globalDBdriver; |
@@ -10486,11 +10486,11 @@ discard block |
||
| 10486 | 10486 | |
| 10487 | 10487 | |
| 10488 | 10488 | /** |
| 10489 | - * Counts all hours by airport |
|
| 10490 | - * |
|
| 10491 | - * @return Array the hour list |
|
| 10492 | - * |
|
| 10493 | - */ |
|
| 10489 | + * Counts all hours by airport |
|
| 10490 | + * |
|
| 10491 | + * @return Array the hour list |
|
| 10492 | + * |
|
| 10493 | + */ |
|
| 10494 | 10494 | public function countAllHoursByAirport($airport_icao, $filters = array()) |
| 10495 | 10495 | { |
| 10496 | 10496 | global $globalTimezone, $globalDBdriver; |
@@ -10534,11 +10534,11 @@ discard block |
||
| 10534 | 10534 | |
| 10535 | 10535 | |
| 10536 | 10536 | /** |
| 10537 | - * Counts all hours by manufacturer |
|
| 10538 | - * |
|
| 10539 | - * @return Array the hour list |
|
| 10540 | - * |
|
| 10541 | - */ |
|
| 10537 | + * Counts all hours by manufacturer |
|
| 10538 | + * |
|
| 10539 | + * @return Array the hour list |
|
| 10540 | + * |
|
| 10541 | + */ |
|
| 10542 | 10542 | public function countAllHoursByManufacturer($aircraft_manufacturer,$filters =array()) |
| 10543 | 10543 | { |
| 10544 | 10544 | global $globalTimezone, $globalDBdriver; |
@@ -10582,11 +10582,11 @@ discard block |
||
| 10582 | 10582 | |
| 10583 | 10583 | |
| 10584 | 10584 | /** |
| 10585 | - * Counts all hours by date |
|
| 10586 | - * |
|
| 10587 | - * @return Array the hour list |
|
| 10588 | - * |
|
| 10589 | - */ |
|
| 10585 | + * Counts all hours by date |
|
| 10586 | + * |
|
| 10587 | + * @return Array the hour list |
|
| 10588 | + * |
|
| 10589 | + */ |
|
| 10590 | 10590 | public function countAllHoursByDate($date, $filters = array()) |
| 10591 | 10591 | { |
| 10592 | 10592 | global $globalTimezone, $globalDBdriver; |
@@ -10630,11 +10630,11 @@ discard block |
||
| 10630 | 10630 | |
| 10631 | 10631 | |
| 10632 | 10632 | /** |
| 10633 | - * Counts all hours by a ident/callsign |
|
| 10634 | - * |
|
| 10635 | - * @return Array the hour list |
|
| 10636 | - * |
|
| 10637 | - */ |
|
| 10633 | + * Counts all hours by a ident/callsign |
|
| 10634 | + * |
|
| 10635 | + * @return Array the hour list |
|
| 10636 | + * |
|
| 10637 | + */ |
|
| 10638 | 10638 | public function countAllHoursByIdent($ident, $filters = array()) |
| 10639 | 10639 | { |
| 10640 | 10640 | global $globalTimezone, $globalDBdriver; |
@@ -10677,11 +10677,11 @@ discard block |
||
| 10677 | 10677 | } |
| 10678 | 10678 | |
| 10679 | 10679 | /** |
| 10680 | - * Counts all hours by a owner |
|
| 10681 | - * |
|
| 10682 | - * @return Array the hour list |
|
| 10683 | - * |
|
| 10684 | - */ |
|
| 10680 | + * Counts all hours by a owner |
|
| 10681 | + * |
|
| 10682 | + * @return Array the hour list |
|
| 10683 | + * |
|
| 10684 | + */ |
|
| 10685 | 10685 | public function countAllHoursByOwner($owner, $filters = array()) |
| 10686 | 10686 | { |
| 10687 | 10687 | global $globalTimezone, $globalDBdriver; |
@@ -10724,11 +10724,11 @@ discard block |
||
| 10724 | 10724 | } |
| 10725 | 10725 | |
| 10726 | 10726 | /** |
| 10727 | - * Counts all hours by a pilot |
|
| 10728 | - * |
|
| 10729 | - * @return Array the hour list |
|
| 10730 | - * |
|
| 10731 | - */ |
|
| 10727 | + * Counts all hours by a pilot |
|
| 10728 | + * |
|
| 10729 | + * @return Array the hour list |
|
| 10730 | + * |
|
| 10731 | + */ |
|
| 10732 | 10732 | public function countAllHoursByPilot($pilot, $filters = array()) |
| 10733 | 10733 | { |
| 10734 | 10734 | global $globalTimezone, $globalDBdriver; |
@@ -10773,11 +10773,11 @@ discard block |
||
| 10773 | 10773 | |
| 10774 | 10774 | |
| 10775 | 10775 | /** |
| 10776 | - * Counts all hours by route |
|
| 10777 | - * |
|
| 10778 | - * @return Array the hour list |
|
| 10779 | - * |
|
| 10780 | - */ |
|
| 10776 | + * Counts all hours by route |
|
| 10777 | + * |
|
| 10778 | + * @return Array the hour list |
|
| 10779 | + * |
|
| 10780 | + */ |
|
| 10781 | 10781 | public function countAllHoursByRoute($departure_airport_icao, $arrival_airport_icao, $filters =array()) |
| 10782 | 10782 | { |
| 10783 | 10783 | global $globalTimezone, $globalDBdriver; |
@@ -10821,11 +10821,11 @@ discard block |
||
| 10821 | 10821 | |
| 10822 | 10822 | |
| 10823 | 10823 | /** |
| 10824 | - * Counts all hours by country |
|
| 10825 | - * |
|
| 10826 | - * @return Array the hour list |
|
| 10827 | - * |
|
| 10828 | - */ |
|
| 10824 | + * Counts all hours by country |
|
| 10825 | + * |
|
| 10826 | + * @return Array the hour list |
|
| 10827 | + * |
|
| 10828 | + */ |
|
| 10829 | 10829 | public function countAllHoursByCountry($country, $filters = array()) |
| 10830 | 10830 | { |
| 10831 | 10831 | global $globalTimezone, $globalDBdriver; |
@@ -10870,11 +10870,11 @@ discard block |
||
| 10870 | 10870 | |
| 10871 | 10871 | |
| 10872 | 10872 | /** |
| 10873 | - * Counts all aircraft that have flown over |
|
| 10874 | - * |
|
| 10875 | - * @return Integer the number of aircrafts |
|
| 10876 | - * |
|
| 10877 | - */ |
|
| 10873 | + * Counts all aircraft that have flown over |
|
| 10874 | + * |
|
| 10875 | + * @return Integer the number of aircrafts |
|
| 10876 | + * |
|
| 10877 | + */ |
|
| 10878 | 10878 | public function countOverallAircrafts($filters = array(),$year = '',$month = '') |
| 10879 | 10879 | { |
| 10880 | 10880 | global $globalDBdriver; |
@@ -10907,11 +10907,11 @@ discard block |
||
| 10907 | 10907 | } |
| 10908 | 10908 | |
| 10909 | 10909 | /** |
| 10910 | - * Counts all flight that really arrival |
|
| 10911 | - * |
|
| 10912 | - * @return Integer the number of aircrafts |
|
| 10913 | - * |
|
| 10914 | - */ |
|
| 10910 | + * Counts all flight that really arrival |
|
| 10911 | + * |
|
| 10912 | + * @return Integer the number of aircrafts |
|
| 10913 | + * |
|
| 10914 | + */ |
|
| 10915 | 10915 | public function countOverallArrival($filters = array(),$year = '',$month = '') |
| 10916 | 10916 | { |
| 10917 | 10917 | global $globalDBdriver; |
@@ -10944,11 +10944,11 @@ discard block |
||
| 10944 | 10944 | } |
| 10945 | 10945 | |
| 10946 | 10946 | /** |
| 10947 | - * Counts all pilots that have flown over |
|
| 10948 | - * |
|
| 10949 | - * @return Integer the number of pilots |
|
| 10950 | - * |
|
| 10951 | - */ |
|
| 10947 | + * Counts all pilots that have flown over |
|
| 10948 | + * |
|
| 10949 | + * @return Integer the number of pilots |
|
| 10950 | + * |
|
| 10951 | + */ |
|
| 10952 | 10952 | public function countOverallPilots($filters = array(),$year = '',$month = '') |
| 10953 | 10953 | { |
| 10954 | 10954 | global $globalDBdriver; |
@@ -10980,11 +10980,11 @@ discard block |
||
| 10980 | 10980 | } |
| 10981 | 10981 | |
| 10982 | 10982 | /** |
| 10983 | - * Counts all owners that have flown over |
|
| 10984 | - * |
|
| 10985 | - * @return Integer the number of owners |
|
| 10986 | - * |
|
| 10987 | - */ |
|
| 10983 | + * Counts all owners that have flown over |
|
| 10984 | + * |
|
| 10985 | + * @return Integer the number of owners |
|
| 10986 | + * |
|
| 10987 | + */ |
|
| 10988 | 10988 | public function countOverallOwners($filters = array(),$year = '',$month = '') |
| 10989 | 10989 | { |
| 10990 | 10990 | global $globalDBdriver; |
@@ -11017,11 +11017,11 @@ discard block |
||
| 11017 | 11017 | |
| 11018 | 11018 | |
| 11019 | 11019 | /** |
| 11020 | - * Counts all flights that have flown over |
|
| 11021 | - * |
|
| 11022 | - * @return Integer the number of flights |
|
| 11023 | - * |
|
| 11024 | - */ |
|
| 11020 | + * Counts all flights that have flown over |
|
| 11021 | + * |
|
| 11022 | + * @return Integer the number of flights |
|
| 11023 | + * |
|
| 11024 | + */ |
|
| 11025 | 11025 | public function countOverallFlights($filters = array(),$year = '',$month = '') |
| 11026 | 11026 | { |
| 11027 | 11027 | global $globalDBdriver; |
@@ -11055,11 +11055,11 @@ discard block |
||
| 11055 | 11055 | } |
| 11056 | 11056 | |
| 11057 | 11057 | /** |
| 11058 | - * Counts all military flights that have flown over |
|
| 11059 | - * |
|
| 11060 | - * @return Integer the number of flights |
|
| 11061 | - * |
|
| 11062 | - */ |
|
| 11058 | + * Counts all military flights that have flown over |
|
| 11059 | + * |
|
| 11060 | + * @return Integer the number of flights |
|
| 11061 | + * |
|
| 11062 | + */ |
|
| 11063 | 11063 | public function countOverallMilitaryFlights($filters = array(),$year = '',$month = '') |
| 11064 | 11064 | { |
| 11065 | 11065 | global $globalDBdriver; |
@@ -11094,11 +11094,11 @@ discard block |
||
| 11094 | 11094 | |
| 11095 | 11095 | |
| 11096 | 11096 | /** |
| 11097 | - * Counts all airlines that have flown over |
|
| 11098 | - * |
|
| 11099 | - * @return Integer the number of airlines |
|
| 11100 | - * |
|
| 11101 | - */ |
|
| 11097 | + * Counts all airlines that have flown over |
|
| 11098 | + * |
|
| 11099 | + * @return Integer the number of airlines |
|
| 11100 | + * |
|
| 11101 | + */ |
|
| 11102 | 11102 | public function countOverallAirlines($filters = array(),$year = '',$month = '') |
| 11103 | 11103 | { |
| 11104 | 11104 | global $globalDBdriver; |
@@ -11125,8 +11125,8 @@ discard block |
||
| 11125 | 11125 | $query_values = array_merge($query_values,array(':month' => $month)); |
| 11126 | 11126 | } |
| 11127 | 11127 | } |
| 11128 | - if ($query == '') $queryi .= $this->getFilter($filters); |
|
| 11129 | - else $queryi .= $this->getFilter($filters,true,true).substr($query,4); |
|
| 11128 | + if ($query == '') $queryi .= $this->getFilter($filters); |
|
| 11129 | + else $queryi .= $this->getFilter($filters,true,true).substr($query,4); |
|
| 11130 | 11130 | |
| 11131 | 11131 | |
| 11132 | 11132 | $sth = $this->db->prepare($queryi); |
@@ -11136,11 +11136,11 @@ discard block |
||
| 11136 | 11136 | |
| 11137 | 11137 | |
| 11138 | 11138 | /** |
| 11139 | - * Counts all hours of today |
|
| 11140 | - * |
|
| 11141 | - * @return Array the hour list |
|
| 11142 | - * |
|
| 11143 | - */ |
|
| 11139 | + * Counts all hours of today |
|
| 11140 | + * |
|
| 11141 | + * @return Array the hour list |
|
| 11142 | + * |
|
| 11143 | + */ |
|
| 11144 | 11144 | public function countAllHoursFromToday($filters = array()) |
| 11145 | 11145 | { |
| 11146 | 11146 | global $globalTimezone, $globalDBdriver; |
@@ -11180,11 +11180,11 @@ discard block |
||
| 11180 | 11180 | } |
| 11181 | 11181 | |
| 11182 | 11182 | /** |
| 11183 | - * Gets all the spotter information based on calculated upcoming flights |
|
| 11184 | - * |
|
| 11185 | - * @return Array the spotter information |
|
| 11186 | - * |
|
| 11187 | - */ |
|
| 11183 | + * Gets all the spotter information based on calculated upcoming flights |
|
| 11184 | + * |
|
| 11185 | + * @return Array the spotter information |
|
| 11186 | + * |
|
| 11187 | + */ |
|
| 11188 | 11188 | public function getUpcomingFlights($limit = '', $sort = '', $filters = array()) |
| 11189 | 11189 | { |
| 11190 | 11190 | global $global_query, $globalDBdriver, $globalTimezone; |
@@ -11259,12 +11259,12 @@ discard block |
||
| 11259 | 11259 | } |
| 11260 | 11260 | |
| 11261 | 11261 | |
| 11262 | - /** |
|
| 11263 | - * Gets the Barrie Spotter ID based on the FlightAware ID |
|
| 11264 | - * |
|
| 11265 | - * @return Integer the Barrie Spotter ID |
|
| 11262 | + /** |
|
| 11263 | + * Gets the Barrie Spotter ID based on the FlightAware ID |
|
| 11264 | + * |
|
| 11265 | + * @return Integer the Barrie Spotter ID |
|
| 11266 | 11266 | q * |
| 11267 | - */ |
|
| 11267 | + */ |
|
| 11268 | 11268 | public function getSpotterIDBasedOnFlightAwareID($flightaware_id) |
| 11269 | 11269 | { |
| 11270 | 11270 | $flightaware_id = filter_var($flightaware_id,FILTER_SANITIZE_STRING); |
@@ -11285,13 +11285,13 @@ discard block |
||
| 11285 | 11285 | |
| 11286 | 11286 | |
| 11287 | 11287 | /** |
| 11288 | - * Parses a date string |
|
| 11289 | - * |
|
| 11290 | - * @param String $dateString the date string |
|
| 11291 | - * @param String $timezone the timezone of a user |
|
| 11292 | - * @return Array the time information |
|
| 11293 | - * |
|
| 11294 | - */ |
|
| 11288 | + * Parses a date string |
|
| 11289 | + * |
|
| 11290 | + * @param String $dateString the date string |
|
| 11291 | + * @param String $timezone the timezone of a user |
|
| 11292 | + * @return Array the time information |
|
| 11293 | + * |
|
| 11294 | + */ |
|
| 11295 | 11295 | public function parseDateString($dateString, $timezone = '') |
| 11296 | 11296 | { |
| 11297 | 11297 | $time_array = array(); |
@@ -11327,12 +11327,12 @@ discard block |
||
| 11327 | 11327 | |
| 11328 | 11328 | |
| 11329 | 11329 | /** |
| 11330 | - * Parses the direction degrees to working |
|
| 11331 | - * |
|
| 11332 | - * @param Float $direction the direction in degrees |
|
| 11333 | - * @return Array the direction information |
|
| 11334 | - * |
|
| 11335 | - */ |
|
| 11330 | + * Parses the direction degrees to working |
|
| 11331 | + * |
|
| 11332 | + * @param Float $direction the direction in degrees |
|
| 11333 | + * @return Array the direction information |
|
| 11334 | + * |
|
| 11335 | + */ |
|
| 11336 | 11336 | public function parseDirection($direction = 0) |
| 11337 | 11337 | { |
| 11338 | 11338 | if ($direction == '') $direction = 0; |
@@ -11411,12 +11411,12 @@ discard block |
||
| 11411 | 11411 | |
| 11412 | 11412 | |
| 11413 | 11413 | /** |
| 11414 | - * Gets the aircraft registration |
|
| 11415 | - * |
|
| 11416 | - * @param String $flightaware_id the flight aware id |
|
| 11417 | - * @return String the aircraft registration |
|
| 11418 | - * |
|
| 11419 | - */ |
|
| 11414 | + * Gets the aircraft registration |
|
| 11415 | + * |
|
| 11416 | + * @param String $flightaware_id the flight aware id |
|
| 11417 | + * @return String the aircraft registration |
|
| 11418 | + * |
|
| 11419 | + */ |
|
| 11420 | 11420 | |
| 11421 | 11421 | public function getAircraftRegistration($flightaware_id) |
| 11422 | 11422 | { |
@@ -11445,12 +11445,12 @@ discard block |
||
| 11445 | 11445 | |
| 11446 | 11446 | |
| 11447 | 11447 | /** |
| 11448 | - * Gets the aircraft registration from ModeS |
|
| 11449 | - * |
|
| 11450 | - * @param String $aircraft_modes the flight ModeS in hex |
|
| 11451 | - * @return String the aircraft registration |
|
| 11452 | - * |
|
| 11453 | - */ |
|
| 11448 | + * Gets the aircraft registration from ModeS |
|
| 11449 | + * |
|
| 11450 | + * @param String $aircraft_modes the flight ModeS in hex |
|
| 11451 | + * @return String the aircraft registration |
|
| 11452 | + * |
|
| 11453 | + */ |
|
| 11454 | 11454 | public function getAircraftRegistrationBymodeS($aircraft_modes, $source_type = '') |
| 11455 | 11455 | { |
| 11456 | 11456 | $aircraft_modes = filter_var($aircraft_modes,FILTER_SANITIZE_STRING); |
@@ -11466,8 +11466,8 @@ discard block |
||
| 11466 | 11466 | $row = $sth->fetch(PDO::FETCH_ASSOC); |
| 11467 | 11467 | $sth->closeCursor(); |
| 11468 | 11468 | if (count($row) > 0) { |
| 11469 | - //return $row['Registration']; |
|
| 11470 | - return $row['registration']; |
|
| 11469 | + //return $row['Registration']; |
|
| 11470 | + return $row['registration']; |
|
| 11471 | 11471 | } elseif ($source_type == 'flarm') { |
| 11472 | 11472 | return $this->getAircraftRegistrationBymodeS($aircraft_modes); |
| 11473 | 11473 | } else return ''; |
@@ -11475,12 +11475,12 @@ discard block |
||
| 11475 | 11475 | } |
| 11476 | 11476 | |
| 11477 | 11477 | /** |
| 11478 | - * Gets the aircraft type from ModeS |
|
| 11479 | - * |
|
| 11480 | - * @param String $aircraft_modes the flight ModeS in hex |
|
| 11481 | - * @return String the aircraft type |
|
| 11482 | - * |
|
| 11483 | - */ |
|
| 11478 | + * Gets the aircraft type from ModeS |
|
| 11479 | + * |
|
| 11480 | + * @param String $aircraft_modes the flight ModeS in hex |
|
| 11481 | + * @return String the aircraft type |
|
| 11482 | + * |
|
| 11483 | + */ |
|
| 11484 | 11484 | public function getAircraftTypeBymodeS($aircraft_modes,$source_type = '') |
| 11485 | 11485 | { |
| 11486 | 11486 | $aircraft_modes = filter_var($aircraft_modes,FILTER_SANITIZE_STRING); |
@@ -11506,12 +11506,12 @@ discard block |
||
| 11506 | 11506 | } |
| 11507 | 11507 | |
| 11508 | 11508 | /** |
| 11509 | - * Gets Country from latitude/longitude |
|
| 11510 | - * |
|
| 11511 | - * @param Float $latitude latitute of the flight |
|
| 11512 | - * @param Float $longitude longitute of the flight |
|
| 11513 | - * @return String the countrie |
|
| 11514 | - */ |
|
| 11509 | + * Gets Country from latitude/longitude |
|
| 11510 | + * |
|
| 11511 | + * @param Float $latitude latitute of the flight |
|
| 11512 | + * @param Float $longitude longitute of the flight |
|
| 11513 | + * @return String the countrie |
|
| 11514 | + */ |
|
| 11515 | 11515 | public function getCountryFromLatitudeLongitude($latitude,$longitude) |
| 11516 | 11516 | { |
| 11517 | 11517 | global $globalDBdriver, $globalDebug; |
@@ -11548,11 +11548,11 @@ discard block |
||
| 11548 | 11548 | } |
| 11549 | 11549 | |
| 11550 | 11550 | /** |
| 11551 | - * Gets Country from iso2 |
|
| 11552 | - * |
|
| 11553 | - * @param String $iso2 ISO2 country code |
|
| 11554 | - * @return String the countrie |
|
| 11555 | - */ |
|
| 11551 | + * Gets Country from iso2 |
|
| 11552 | + * |
|
| 11553 | + * @param String $iso2 ISO2 country code |
|
| 11554 | + * @return String the countrie |
|
| 11555 | + */ |
|
| 11556 | 11556 | public function getCountryFromISO2($iso2) |
| 11557 | 11557 | { |
| 11558 | 11558 | global $globalDBdriver, $globalDebug; |
@@ -11580,12 +11580,12 @@ discard block |
||
| 11580 | 11580 | } |
| 11581 | 11581 | |
| 11582 | 11582 | /** |
| 11583 | - * converts the registration code using the country prefix |
|
| 11584 | - * |
|
| 11585 | - * @param String $registration the aircraft registration |
|
| 11586 | - * @return String the aircraft registration |
|
| 11587 | - * |
|
| 11588 | - */ |
|
| 11583 | + * converts the registration code using the country prefix |
|
| 11584 | + * |
|
| 11585 | + * @param String $registration the aircraft registration |
|
| 11586 | + * @return String the aircraft registration |
|
| 11587 | + * |
|
| 11588 | + */ |
|
| 11589 | 11589 | public function convertAircraftRegistration($registration) |
| 11590 | 11590 | { |
| 11591 | 11591 | $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
@@ -11637,12 +11637,12 @@ discard block |
||
| 11637 | 11637 | } |
| 11638 | 11638 | |
| 11639 | 11639 | /** |
| 11640 | - * Country from the registration code |
|
| 11641 | - * |
|
| 11642 | - * @param String $registration the aircraft registration |
|
| 11643 | - * @return String the country |
|
| 11644 | - * |
|
| 11645 | - */ |
|
| 11640 | + * Country from the registration code |
|
| 11641 | + * |
|
| 11642 | + * @param String $registration the aircraft registration |
|
| 11643 | + * @return String the country |
|
| 11644 | + * |
|
| 11645 | + */ |
|
| 11646 | 11646 | public function countryFromAircraftRegistration($registration) |
| 11647 | 11647 | { |
| 11648 | 11648 | $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
@@ -11661,8 +11661,8 @@ discard block |
||
| 11661 | 11661 | $country = $row['country']; |
| 11662 | 11662 | } |
| 11663 | 11663 | } else { |
| 11664 | - $registration_1 = substr($registration, 0, 1); |
|
| 11665 | - $registration_2 = substr($registration, 0, 2); |
|
| 11664 | + $registration_1 = substr($registration, 0, 1); |
|
| 11665 | + $registration_2 = substr($registration, 0, 2); |
|
| 11666 | 11666 | |
| 11667 | 11667 | $country = ''; |
| 11668 | 11668 | //first get the prefix based on two characters |
@@ -11698,12 +11698,12 @@ discard block |
||
| 11698 | 11698 | } |
| 11699 | 11699 | |
| 11700 | 11700 | /** |
| 11701 | - * Registration prefix from the registration code |
|
| 11702 | - * |
|
| 11703 | - * @param String $registration the aircraft registration |
|
| 11704 | - * @return String the registration prefix |
|
| 11705 | - * |
|
| 11706 | - */ |
|
| 11701 | + * Registration prefix from the registration code |
|
| 11702 | + * |
|
| 11703 | + * @param String $registration the aircraft registration |
|
| 11704 | + * @return String the registration prefix |
|
| 11705 | + * |
|
| 11706 | + */ |
|
| 11707 | 11707 | public function registrationPrefixFromAircraftRegistration($registration) |
| 11708 | 11708 | { |
| 11709 | 11709 | $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
@@ -11722,8 +11722,8 @@ discard block |
||
| 11722 | 11722 | //$country = $row['country']; |
| 11723 | 11723 | } |
| 11724 | 11724 | } else { |
| 11725 | - $registration_1 = substr($registration, 0, 1); |
|
| 11726 | - $registration_2 = substr($registration, 0, 2); |
|
| 11725 | + $registration_1 = substr($registration, 0, 1); |
|
| 11726 | + $registration_2 = substr($registration, 0, 2); |
|
| 11727 | 11727 | |
| 11728 | 11728 | //first get the prefix based on two characters |
| 11729 | 11729 | $query = "SELECT aircraft_registration.registration_prefix, aircraft_registration.country FROM aircraft_registration WHERE registration_prefix = :registration_2 LIMIT 1"; |
@@ -11759,12 +11759,12 @@ discard block |
||
| 11759 | 11759 | |
| 11760 | 11760 | |
| 11761 | 11761 | /** |
| 11762 | - * Country from the registration code |
|
| 11763 | - * |
|
| 11764 | - * @param String $registration the aircraft registration |
|
| 11765 | - * @return String the country |
|
| 11766 | - * |
|
| 11767 | - */ |
|
| 11762 | + * Country from the registration code |
|
| 11763 | + * |
|
| 11764 | + * @param String $registration the aircraft registration |
|
| 11765 | + * @return String the country |
|
| 11766 | + * |
|
| 11767 | + */ |
|
| 11768 | 11768 | public function countryFromAircraftRegistrationCode($registration) |
| 11769 | 11769 | { |
| 11770 | 11770 | $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
@@ -11781,11 +11781,11 @@ discard block |
||
| 11781 | 11781 | } |
| 11782 | 11782 | |
| 11783 | 11783 | /** |
| 11784 | - * Set a new highlight value for a flight |
|
| 11785 | - * |
|
| 11786 | - * @param String $flightaware_id flightaware_id from spotter_output table |
|
| 11787 | - * @param String $highlight New highlight value |
|
| 11788 | - */ |
|
| 11784 | + * Set a new highlight value for a flight |
|
| 11785 | + * |
|
| 11786 | + * @param String $flightaware_id flightaware_id from spotter_output table |
|
| 11787 | + * @param String $highlight New highlight value |
|
| 11788 | + */ |
|
| 11789 | 11789 | public function setHighlightFlight($flightaware_id,$highlight) { |
| 11790 | 11790 | |
| 11791 | 11791 | $query = "UPDATE spotter_output SET highlight = :highlight WHERE flightaware_id = :flightaware_id"; |
@@ -11794,12 +11794,12 @@ discard block |
||
| 11794 | 11794 | } |
| 11795 | 11795 | |
| 11796 | 11796 | /** |
| 11797 | - * Set a new highlight value for a flight by Registration |
|
| 11798 | - * |
|
| 11799 | - * @param String $registration Registration of the aircraft |
|
| 11800 | - * @param String $date Date of spotted aircraft |
|
| 11801 | - * @param String $highlight New highlight value |
|
| 11802 | - */ |
|
| 11797 | + * Set a new highlight value for a flight by Registration |
|
| 11798 | + * |
|
| 11799 | + * @param String $registration Registration of the aircraft |
|
| 11800 | + * @param String $date Date of spotted aircraft |
|
| 11801 | + * @param String $highlight New highlight value |
|
| 11802 | + */ |
|
| 11803 | 11803 | public function setHighlightFlightByRegistration($registration,$highlight, $date = '') { |
| 11804 | 11804 | if ($date == '') { |
| 11805 | 11805 | $query = "UPDATE spotter_output SET highlight = :highlight WHERE spotter_id IN (SELECT MAX(spotter_id) FROM spotter_output WHERE registration = :registration)"; |
@@ -11813,12 +11813,12 @@ discard block |
||
| 11813 | 11813 | } |
| 11814 | 11814 | |
| 11815 | 11815 | /** |
| 11816 | - * Gets the short url from bit.ly |
|
| 11817 | - * |
|
| 11818 | - * @param String $url the full url |
|
| 11819 | - * @return String the bit.ly url |
|
| 11820 | - * |
|
| 11821 | - */ |
|
| 11816 | + * Gets the short url from bit.ly |
|
| 11817 | + * |
|
| 11818 | + * @param String $url the full url |
|
| 11819 | + * @return String the bit.ly url |
|
| 11820 | + * |
|
| 11821 | + */ |
|
| 11822 | 11822 | public function getBitlyURL($url) |
| 11823 | 11823 | { |
| 11824 | 11824 | global $globalBitlyAccessToken; |
@@ -12107,11 +12107,11 @@ discard block |
||
| 12107 | 12107 | $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 |
| 12108 | 12108 | 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)) |
| 12109 | 12109 | 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;"; |
| 12110 | - } else { |
|
| 12110 | + } else { |
|
| 12111 | 12111 | $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 |
| 12112 | 12112 | 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)) |
| 12113 | 12113 | 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;"; |
| 12114 | - } |
|
| 12114 | + } |
|
| 12115 | 12115 | $sth = $this->db->prepare($query); |
| 12116 | 12116 | $sth->execute(); |
| 12117 | 12117 | return $sth->fetchAll(PDO::FETCH_ASSOC); |
@@ -72,7 +72,9 @@ discard block |
||
| 72 | 72 | if (isset($filter[0]['source'])) { |
| 73 | 73 | $filters = array_merge($filters,$filter); |
| 74 | 74 | } |
| 75 | - if (is_array($globalFilter)) $filter = array_merge($filter,$globalFilter); |
|
| 75 | + if (is_array($globalFilter)) { |
|
| 76 | + $filter = array_merge($filter,$globalFilter); |
|
| 77 | + } |
|
| 76 | 78 | $filter_query_join = ''; |
| 77 | 79 | $filter_query_where = ''; |
| 78 | 80 | foreach($filters as $flt) { |
@@ -156,8 +158,11 @@ discard block |
||
| 156 | 158 | $filter_query_where .= " AND EXTRACT(DAY FROM spotter_output.date) = '".$filter['day']."'"; |
| 157 | 159 | } |
| 158 | 160 | } |
| 159 | - if ($filter_query_where == '' && $where) $filter_query_where = ' WHERE'; |
|
| 160 | - elseif ($filter_query_where != '' && $and) $filter_query_where .= ' AND'; |
|
| 161 | + if ($filter_query_where == '' && $where) { |
|
| 162 | + $filter_query_where = ' WHERE'; |
|
| 163 | + } elseif ($filter_query_where != '' && $and) { |
|
| 164 | + $filter_query_where .= ' AND'; |
|
| 165 | + } |
|
| 161 | 166 | if ($filter_query_where != '') { |
| 162 | 167 | $filter_query_where = preg_replace('/^ AND/',' WHERE',$filter_query_where); |
| 163 | 168 | } |
@@ -180,10 +185,18 @@ discard block |
||
| 180 | 185 | $Image = new Image($this->db); |
| 181 | 186 | $Schedule = new Schedule($this->db); |
| 182 | 187 | $ACARS = new ACARS($this->db); |
| 183 | - if (!isset($globalIVAO)) $globalIVAO = FALSE; |
|
| 184 | - if (!isset($globalVATSIM)) $globalVATSIM = FALSE; |
|
| 185 | - if (!isset($globalphpVMS)) $globalphpVMS = FALSE; |
|
| 186 | - if (!isset($globalVAM)) $globalVAM = FALSE; |
|
| 188 | + if (!isset($globalIVAO)) { |
|
| 189 | + $globalIVAO = FALSE; |
|
| 190 | + } |
|
| 191 | + if (!isset($globalVATSIM)) { |
|
| 192 | + $globalVATSIM = FALSE; |
|
| 193 | + } |
|
| 194 | + if (!isset($globalphpVMS)) { |
|
| 195 | + $globalphpVMS = FALSE; |
|
| 196 | + } |
|
| 197 | + if (!isset($globalVAM)) { |
|
| 198 | + $globalVAM = FALSE; |
|
| 199 | + } |
|
| 187 | 200 | date_default_timezone_set('UTC'); |
| 188 | 201 | |
| 189 | 202 | if (!is_string($query)) |
@@ -230,21 +243,35 @@ discard block |
||
| 230 | 243 | } else { |
| 231 | 244 | $temp_array['spotter_id'] = ''; |
| 232 | 245 | } |
| 233 | - if (isset($row['flightaware_id'])) $temp_array['flightaware_id'] = $row['flightaware_id']; |
|
| 234 | - if (isset($row['modes'])) $temp_array['modes'] = $row['modes']; |
|
| 246 | + if (isset($row['flightaware_id'])) { |
|
| 247 | + $temp_array['flightaware_id'] = $row['flightaware_id']; |
|
| 248 | + } |
|
| 249 | + if (isset($row['modes'])) { |
|
| 250 | + $temp_array['modes'] = $row['modes']; |
|
| 251 | + } |
|
| 235 | 252 | $temp_array['ident'] = $row['ident']; |
| 236 | 253 | if (isset($row['registration']) && $row['registration'] != '') { |
| 237 | 254 | $temp_array['registration'] = $row['registration']; |
| 238 | 255 | } elseif (isset($temp_array['modes'])) { |
| 239 | 256 | $temp_array['registration'] = $this->getAircraftRegistrationBymodeS($temp_array['modes']); |
| 240 | - } else $temp_array['registration'] = ''; |
|
| 241 | - if (isset($row['aircraft_icao'])) $temp_array['aircraft_type'] = $row['aircraft_icao']; |
|
| 257 | + } else { |
|
| 258 | + $temp_array['registration'] = ''; |
|
| 259 | + } |
|
| 260 | + if (isset($row['aircraft_icao'])) { |
|
| 261 | + $temp_array['aircraft_type'] = $row['aircraft_icao']; |
|
| 262 | + } |
|
| 242 | 263 | |
| 243 | 264 | $temp_array['departure_airport'] = $row['departure_airport_icao']; |
| 244 | 265 | $temp_array['arrival_airport'] = $row['arrival_airport_icao']; |
| 245 | - if (isset($row['real_arrival_airport_icao']) && $row['real_arrival_airport_icao'] != NULL) $temp_array['real_arrival_airport'] = $row['real_arrival_airport_icao']; |
|
| 246 | - if (isset($row['latitude'])) $temp_array['latitude'] = $row['latitude']; |
|
| 247 | - if (isset($row['longitude'])) $temp_array['longitude'] = $row['longitude']; |
|
| 266 | + if (isset($row['real_arrival_airport_icao']) && $row['real_arrival_airport_icao'] != NULL) { |
|
| 267 | + $temp_array['real_arrival_airport'] = $row['real_arrival_airport_icao']; |
|
| 268 | + } |
|
| 269 | + if (isset($row['latitude'])) { |
|
| 270 | + $temp_array['latitude'] = $row['latitude']; |
|
| 271 | + } |
|
| 272 | + if (isset($row['longitude'])) { |
|
| 273 | + $temp_array['longitude'] = $row['longitude']; |
|
| 274 | + } |
|
| 248 | 275 | /* |
| 249 | 276 | if (Connection->tableExists('countries')) { |
| 250 | 277 | $country_info = $this->getCountryFromLatitudeLongitude($temp_array['latitude'],$temp_array['longitude']); |
@@ -254,8 +281,12 @@ discard block |
||
| 254 | 281 | } |
| 255 | 282 | } |
| 256 | 283 | */ |
| 257 | - if (isset($row['waypoints'])) $temp_array['waypoints'] = $row['waypoints']; |
|
| 258 | - if (isset($row['format_source'])) $temp_array['format_source'] = $row['format_source']; |
|
| 284 | + if (isset($row['waypoints'])) { |
|
| 285 | + $temp_array['waypoints'] = $row['waypoints']; |
|
| 286 | + } |
|
| 287 | + if (isset($row['format_source'])) { |
|
| 288 | + $temp_array['format_source'] = $row['format_source']; |
|
| 289 | + } |
|
| 259 | 290 | if (isset($row['route_stop']) && $row['route_stop'] != '') { |
| 260 | 291 | $temp_array['route_stop'] = $row['route_stop']; |
| 261 | 292 | $allroute = explode(' ',$row['route_stop']); |
@@ -271,13 +302,19 @@ discard block |
||
| 271 | 302 | } |
| 272 | 303 | } |
| 273 | 304 | } |
| 274 | - if (isset($row['altitude'])) $temp_array['altitude'] = $row['altitude']; |
|
| 305 | + if (isset($row['altitude'])) { |
|
| 306 | + $temp_array['altitude'] = $row['altitude']; |
|
| 307 | + } |
|
| 275 | 308 | if (isset($row['heading'])) { |
| 276 | 309 | $temp_array['heading'] = $row['heading']; |
| 277 | 310 | $heading_direction = $this->parseDirection($row['heading']); |
| 278 | - if (isset($heading_direction[0]['direction_fullname'])) $temp_array['heading_name'] = $heading_direction[0]['direction_fullname']; |
|
| 311 | + if (isset($heading_direction[0]['direction_fullname'])) { |
|
| 312 | + $temp_array['heading_name'] = $heading_direction[0]['direction_fullname']; |
|
| 313 | + } |
|
| 314 | + } |
|
| 315 | + if (isset($row['ground_speed'])) { |
|
| 316 | + $temp_array['ground_speed'] = $row['ground_speed']; |
|
| 279 | 317 | } |
| 280 | - if (isset($row['ground_speed'])) $temp_array['ground_speed'] = $row['ground_speed']; |
|
| 281 | 318 | $temp_array['image'] = ""; |
| 282 | 319 | $temp_array['image_thumbnail'] = ""; |
| 283 | 320 | $temp_array['image_source'] = ""; |
@@ -285,7 +322,9 @@ discard block |
||
| 285 | 322 | |
| 286 | 323 | if (isset($row['highlight'])) { |
| 287 | 324 | $temp_array['highlight'] = $row['highlight']; |
| 288 | - } else $temp_array['highlight'] = ''; |
|
| 325 | + } else { |
|
| 326 | + $temp_array['highlight'] = ''; |
|
| 327 | + } |
|
| 289 | 328 | |
| 290 | 329 | if (isset($row['date'])) { |
| 291 | 330 | $dateArray = $this->parseDateString($row['date']); |
@@ -341,7 +380,9 @@ discard block |
||
| 341 | 380 | |
| 342 | 381 | if ($aircraft_array[0]['aircraft_shadow'] != NULL) { |
| 343 | 382 | $temp_array['aircraft_shadow'] = $aircraft_array[0]['aircraft_shadow']; |
| 344 | - } else $temp_array['aircraft_shadow'] = 'default.png'; |
|
| 383 | + } else { |
|
| 384 | + $temp_array['aircraft_shadow'] = 'default.png'; |
|
| 385 | + } |
|
| 345 | 386 | } else { |
| 346 | 387 | $temp_array['aircraft_shadow'] = 'default.png'; |
| 347 | 388 | $temp_array['aircraft_name'] = 'N/A'; |
@@ -349,11 +390,17 @@ discard block |
||
| 349 | 390 | } |
| 350 | 391 | } |
| 351 | 392 | $fromsource = NULL; |
| 352 | - if (isset($globalAirlinesSource) && $globalAirlinesSource != '') $fromsource = $globalAirlinesSource; |
|
| 353 | - elseif (isset($row['format_source']) && $row['format_source'] == 'vatsimtxt') $fromsource = 'vatsim'; |
|
| 354 | - elseif (isset($row['format_source']) && $row['format_source'] == 'whazzup') $fromsource = 'ivao'; |
|
| 355 | - elseif (isset($globalVATSIM) && $globalVATSIM) $fromsource = 'vatsim'; |
|
| 356 | - elseif (isset($globalIVAO) && $globalIVAO) $fromsource = 'ivao'; |
|
| 393 | + if (isset($globalAirlinesSource) && $globalAirlinesSource != '') { |
|
| 394 | + $fromsource = $globalAirlinesSource; |
|
| 395 | + } elseif (isset($row['format_source']) && $row['format_source'] == 'vatsimtxt') { |
|
| 396 | + $fromsource = 'vatsim'; |
|
| 397 | + } elseif (isset($row['format_source']) && $row['format_source'] == 'whazzup') { |
|
| 398 | + $fromsource = 'ivao'; |
|
| 399 | + } elseif (isset($globalVATSIM) && $globalVATSIM) { |
|
| 400 | + $fromsource = 'vatsim'; |
|
| 401 | + } elseif (isset($globalIVAO) && $globalIVAO) { |
|
| 402 | + $fromsource = 'ivao'; |
|
| 403 | + } |
|
| 357 | 404 | if (!isset($row['airline_name']) || $row['airline_name'] == '') { |
| 358 | 405 | if (!is_numeric(substr($row['ident'], 0, 3))) { |
| 359 | 406 | if (is_numeric(substr($row['ident'], 2, 1))) { |
@@ -376,12 +423,18 @@ discard block |
||
| 376 | 423 | } |
| 377 | 424 | } else { |
| 378 | 425 | $temp_array['airline_icao'] = $row['airline_icao']; |
| 379 | - if (isset($row['airline_iata'])) $temp_array['airline_iata'] = $row['airline_iata']; |
|
| 380 | - else $temp_array['airline_iata'] = 'N/A'; |
|
| 426 | + if (isset($row['airline_iata'])) { |
|
| 427 | + $temp_array['airline_iata'] = $row['airline_iata']; |
|
| 428 | + } else { |
|
| 429 | + $temp_array['airline_iata'] = 'N/A'; |
|
| 430 | + } |
|
| 381 | 431 | $temp_array['airline_name'] = $row['airline_name']; |
| 382 | 432 | $temp_array['airline_country'] = $row['airline_country']; |
| 383 | - if (isset($row['airline_callsign'])) $temp_array['airline_callsign'] = $row['airline_callsign']; |
|
| 384 | - else $temp_array['airline_callsign'] = 'N/A'; |
|
| 433 | + if (isset($row['airline_callsign'])) { |
|
| 434 | + $temp_array['airline_callsign'] = $row['airline_callsign']; |
|
| 435 | + } else { |
|
| 436 | + $temp_array['airline_callsign'] = 'N/A'; |
|
| 437 | + } |
|
| 385 | 438 | $temp_array['airline_type'] = $row['airline_type']; |
| 386 | 439 | if ($temp_array['airline_icao'] != '' && $temp_array['airline_iata'] == 'N/A') { |
| 387 | 440 | $airline_array = $this->getAllAirlineInfo($temp_array['airline_icao']); |
@@ -408,7 +461,9 @@ discard block |
||
| 408 | 461 | } |
| 409 | 462 | if ($temp_array['registration'] != "" && !$globalIVAO && !$globalVATSIM && !$globalphpVMS && !$globalVAM && !isset($temp_array['aircraft_owner'])) { |
| 410 | 463 | $owner_info = $this->getAircraftOwnerByRegistration($temp_array['registration']); |
| 411 | - if ($owner_info['owner'] != '') $temp_array['aircraft_owner'] = ucwords(strtolower($owner_info['owner'])); |
|
| 464 | + if ($owner_info['owner'] != '') { |
|
| 465 | + $temp_array['aircraft_owner'] = ucwords(strtolower($owner_info['owner'])); |
|
| 466 | + } |
|
| 412 | 467 | $temp_array['aircraft_base'] = $owner_info['base']; |
| 413 | 468 | $temp_array['aircraft_date_first_reg'] = $owner_info['date_first_reg']; |
| 414 | 469 | } |
@@ -416,10 +471,16 @@ discard block |
||
| 416 | 471 | if($temp_array['registration'] != "" || (($globalIVAO || $globalVATSIM || $globalphpVMS || $globalVAM) && isset($temp_array['aircraft_type']) && $temp_array['aircraft_type'] != '')) |
| 417 | 472 | { |
| 418 | 473 | if ($globalIVAO) { |
| 419 | - if (isset($temp_array['airline_icao'])) $image_array = $Image->getSpotterImage('',$temp_array['aircraft_type'],$temp_array['airline_icao']); |
|
| 420 | - else $image_array = $Image->getSpotterImage('',$temp_array['aircraft_type']); |
|
| 421 | - } elseif (isset($temp_array['aircraft_type'])) $image_array = $Image->getSpotterImage($temp_array['registration'],$temp_array['aircraft_type']); |
|
| 422 | - else $image_array = $Image->getSpotterImage($temp_array['registration']); |
|
| 474 | + if (isset($temp_array['airline_icao'])) { |
|
| 475 | + $image_array = $Image->getSpotterImage('',$temp_array['aircraft_type'],$temp_array['airline_icao']); |
|
| 476 | + } else { |
|
| 477 | + $image_array = $Image->getSpotterImage('',$temp_array['aircraft_type']); |
|
| 478 | + } |
|
| 479 | + } elseif (isset($temp_array['aircraft_type'])) { |
|
| 480 | + $image_array = $Image->getSpotterImage($temp_array['registration'],$temp_array['aircraft_type']); |
|
| 481 | + } else { |
|
| 482 | + $image_array = $Image->getSpotterImage($temp_array['registration']); |
|
| 483 | + } |
|
| 423 | 484 | if (count($image_array) > 0) { |
| 424 | 485 | $temp_array['image'] = $image_array[0]['image']; |
| 425 | 486 | $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
@@ -471,7 +532,9 @@ discard block |
||
| 471 | 532 | //if ($row['departure_airport_icao'] != '' && $row['departure_airport_name'] == '') { |
| 472 | 533 | if ($row['departure_airport_icao'] != '') { |
| 473 | 534 | $departure_airport_array = $this->getAllAirportInfo($row['departure_airport_icao']); |
| 474 | - if (!isset($departure_airport_array[0]['name'])) $departure_airport_array = $this->getAllAirportInfo('NA'); |
|
| 535 | + if (!isset($departure_airport_array[0]['name'])) { |
|
| 536 | + $departure_airport_array = $this->getAllAirportInfo('NA'); |
|
| 537 | + } |
|
| 475 | 538 | /* |
| 476 | 539 | } elseif ($row['departure_airport_name'] != '') { |
| 477 | 540 | $temp_array['departure_airport_name'] = $row['departure_airport_name']; |
@@ -479,7 +542,9 @@ discard block |
||
| 479 | 542 | $temp_array['departure_airport_country'] = $row['departure_airport_country']; |
| 480 | 543 | $temp_array['departure_airport_icao'] = $row['departure_airport_icao']; |
| 481 | 544 | */ |
| 482 | - } else $departure_airport_array = $this->getAllAirportInfo('NA'); |
|
| 545 | + } else { |
|
| 546 | + $departure_airport_array = $this->getAllAirportInfo('NA'); |
|
| 547 | + } |
|
| 483 | 548 | if (isset($departure_airport_array[0]['name'])) { |
| 484 | 549 | $temp_array['departure_airport_name'] = $departure_airport_array[0]['name']; |
| 485 | 550 | $temp_array['departure_airport_city'] = $departure_airport_array[0]['city']; |
@@ -499,8 +564,12 @@ discard block |
||
| 499 | 564 | |
| 500 | 565 | if ($row['arrival_airport_icao'] != '') { |
| 501 | 566 | $arrival_airport_array = $this->getAllAirportInfo($row['arrival_airport_icao']); |
| 502 | - if (count($arrival_airport_array) == 0) $arrival_airport_array = $this->getAllAirportInfo('NA'); |
|
| 503 | - } else $arrival_airport_array = $this->getAllAirportInfo('NA'); |
|
| 567 | + if (count($arrival_airport_array) == 0) { |
|
| 568 | + $arrival_airport_array = $this->getAllAirportInfo('NA'); |
|
| 569 | + } |
|
| 570 | + } else { |
|
| 571 | + $arrival_airport_array = $this->getAllAirportInfo('NA'); |
|
| 572 | + } |
|
| 504 | 573 | if (isset($arrival_airport_array[0]['name'])) { |
| 505 | 574 | $temp_array['arrival_airport_name'] = $arrival_airport_array[0]['name']; |
| 506 | 575 | $temp_array['arrival_airport_city'] = $arrival_airport_array[0]['city']; |
@@ -516,27 +585,45 @@ discard block |
||
| 516 | 585 | $temp_array['arrival_airport_time'] = $row['arrival_airport_time']; |
| 517 | 586 | } |
| 518 | 587 | */ |
| 519 | - if (isset($row['pilot_id']) && $row['pilot_id'] != '') $temp_array['pilot_id'] = $row['pilot_id']; |
|
| 520 | - if (isset($row['pilot_name']) && $row['pilot_name'] != '') $temp_array['pilot_name'] = $row['pilot_name']; |
|
| 521 | - if (isset($row['source_name']) && $row['source_name'] != '') $temp_array['source_name'] = $row['source_name']; |
|
| 522 | - if (isset($row['over_country']) && $row['over_country'] != '') $temp_array['over_country'] = $row['over_country']; |
|
| 523 | - if (isset($row['distance']) && $row['distance'] != '') $temp_array['distance'] = $row['distance']; |
|
| 588 | + if (isset($row['pilot_id']) && $row['pilot_id'] != '') { |
|
| 589 | + $temp_array['pilot_id'] = $row['pilot_id']; |
|
| 590 | + } |
|
| 591 | + if (isset($row['pilot_name']) && $row['pilot_name'] != '') { |
|
| 592 | + $temp_array['pilot_name'] = $row['pilot_name']; |
|
| 593 | + } |
|
| 594 | + if (isset($row['source_name']) && $row['source_name'] != '') { |
|
| 595 | + $temp_array['source_name'] = $row['source_name']; |
|
| 596 | + } |
|
| 597 | + if (isset($row['over_country']) && $row['over_country'] != '') { |
|
| 598 | + $temp_array['over_country'] = $row['over_country']; |
|
| 599 | + } |
|
| 600 | + if (isset($row['distance']) && $row['distance'] != '') { |
|
| 601 | + $temp_array['distance'] = $row['distance']; |
|
| 602 | + } |
|
| 524 | 603 | if (isset($row['squawk'])) { |
| 525 | 604 | $temp_array['squawk'] = $row['squawk']; |
| 526 | 605 | if ($row['squawk'] != '' && isset($temp_array['country_iso2'])) { |
| 527 | 606 | $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'],$temp_array['country_iso2']); |
| 528 | - if ($temp_array['squawk_usage'] == '' && isset($globalSquawkCountry)) $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'],$globalSquawkCountry); |
|
| 607 | + if ($temp_array['squawk_usage'] == '' && isset($globalSquawkCountry)) { |
|
| 608 | + $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'],$globalSquawkCountry); |
|
| 609 | + } |
|
| 529 | 610 | } elseif ($row['squawk'] != '' && isset($temp_array['over_country'])) { |
| 530 | 611 | $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'],$temp_array['over_country']); |
| 531 | - if ($temp_array['squawk_usage'] == '' && isset($globalSquawkCountry)) $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'],$globalSquawkCountry); |
|
| 532 | - } elseif ($row['squawk'] != '' && isset($globalSquawkCountry)) $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'],$globalSquawkCountry); |
|
| 612 | + if ($temp_array['squawk_usage'] == '' && isset($globalSquawkCountry)) { |
|
| 613 | + $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'],$globalSquawkCountry); |
|
| 614 | + } |
|
| 615 | + } elseif ($row['squawk'] != '' && isset($globalSquawkCountry)) { |
|
| 616 | + $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'],$globalSquawkCountry); |
|
| 617 | + } |
|
| 533 | 618 | } |
| 534 | 619 | |
| 535 | 620 | $temp_array['query_number_rows'] = $num_rows; |
| 536 | 621 | |
| 537 | 622 | $spotter_array[] = $temp_array; |
| 538 | 623 | } |
| 539 | - if ($num_rows == 0) return array(); |
|
| 624 | + if ($num_rows == 0) { |
|
| 625 | + return array(); |
|
| 626 | + } |
|
| 540 | 627 | $spotter_array[0]['query_number_rows'] = $num_rows; |
| 541 | 628 | return $spotter_array; |
| 542 | 629 | } |
@@ -569,7 +656,9 @@ discard block |
||
| 569 | 656 | foreach ($q_array as $q_item){ |
| 570 | 657 | $q_item = filter_var($q_item,FILTER_SANITIZE_STRING); |
| 571 | 658 | $additional_query .= " AND ("; |
| 572 | - if (is_int($q_item)) $additional_query .= "(spotter_output.spotter_id like '%".$q_item."%') OR "; |
|
| 659 | + if (is_int($q_item)) { |
|
| 660 | + $additional_query .= "(spotter_output.spotter_id like '%".$q_item."%') OR "; |
|
| 661 | + } |
|
| 573 | 662 | $additional_query .= "(spotter_output.aircraft_icao like '%".$q_item."%') OR "; |
| 574 | 663 | $additional_query .= "(spotter_output.aircraft_name like '%".$q_item."%') OR "; |
| 575 | 664 | $additional_query .= "(spotter_output.aircraft_manufacturer like '%".$q_item."%') OR "; |
@@ -590,7 +679,9 @@ discard block |
||
| 590 | 679 | $additional_query .= "(spotter_output.pilot_name like '%".$q_item."%') OR "; |
| 591 | 680 | $additional_query .= "(spotter_output.ident like '%".$q_item."%') OR "; |
| 592 | 681 | $translate = $Translation->ident2icao($q_item); |
| 593 | - if ($translate != $q_item) $additional_query .= "(spotter_output.ident like '%".$translate."%') OR "; |
|
| 682 | + if ($translate != $q_item) { |
|
| 683 | + $additional_query .= "(spotter_output.ident like '%".$translate."%') OR "; |
|
| 684 | + } |
|
| 594 | 685 | $additional_query .= "(spotter_output.highlight like '%".$q_item."%')"; |
| 595 | 686 | $additional_query .= ")"; |
| 596 | 687 | } |
@@ -817,7 +908,9 @@ discard block |
||
| 817 | 908 | date_default_timezone_set($globalTimezone); |
| 818 | 909 | $datetime = new DateTime(); |
| 819 | 910 | $offset = $datetime->format('P'); |
| 820 | - } else $offset = '+00:00'; |
|
| 911 | + } else { |
|
| 912 | + $offset = '+00:00'; |
|
| 913 | + } |
|
| 821 | 914 | |
| 822 | 915 | if ($date_array[1] != "") |
| 823 | 916 | { |
@@ -849,8 +942,12 @@ discard block |
||
| 849 | 942 | { |
| 850 | 943 | //$limit_query = " LIMIT ".$limit_array[0].",".$limit_array[1]; |
| 851 | 944 | $limit_query = " LIMIT ".$limit_array[1]." OFFSET ".$limit_array[0]; |
| 852 | - } else $limit_query = ""; |
|
| 853 | - } else $limit_query = ""; |
|
| 945 | + } else { |
|
| 946 | + $limit_query = ""; |
|
| 947 | + } |
|
| 948 | + } else { |
|
| 949 | + $limit_query = ""; |
|
| 950 | + } |
|
| 854 | 951 | |
| 855 | 952 | |
| 856 | 953 | if ($sort != "") |
@@ -918,8 +1015,12 @@ discard block |
||
| 918 | 1015 | { |
| 919 | 1016 | //$limit_query = " LIMIT ".$limit_array[0].",".$limit_array[1]; |
| 920 | 1017 | $limit_query = " LIMIT ".$limit_array[1]." OFFSET ".$limit_array[0]; |
| 921 | - } else $limit_query = ""; |
|
| 922 | - } else $limit_query = ""; |
|
| 1018 | + } else { |
|
| 1019 | + $limit_query = ""; |
|
| 1020 | + } |
|
| 1021 | + } else { |
|
| 1022 | + $limit_query = ""; |
|
| 1023 | + } |
|
| 923 | 1024 | |
| 924 | 1025 | if ($sort != "") |
| 925 | 1026 | { |
@@ -1243,7 +1344,9 @@ discard block |
||
| 1243 | 1344 | global $global_query; |
| 1244 | 1345 | |
| 1245 | 1346 | date_default_timezone_set('UTC'); |
| 1246 | - if ($id == '') return array(); |
|
| 1347 | + if ($id == '') { |
|
| 1348 | + return array(); |
|
| 1349 | + } |
|
| 1247 | 1350 | $additional_query = "spotter_output.spotter_id = :id"; |
| 1248 | 1351 | $query_values = array(':id' => $id); |
| 1249 | 1352 | |
@@ -1358,8 +1461,11 @@ discard block |
||
| 1358 | 1461 | if ($sort != "") |
| 1359 | 1462 | { |
| 1360 | 1463 | $search_orderby_array = $this->getOrderBy(); |
| 1361 | - if (isset($search_orderby_array[$sort]['sql'])) $orderby_query = $search_orderby_array[$sort]['sql']; |
|
| 1362 | - else $orderby_query = " ORDER BY spotter_output.date DESC"; |
|
| 1464 | + if (isset($search_orderby_array[$sort]['sql'])) { |
|
| 1465 | + $orderby_query = $search_orderby_array[$sort]['sql']; |
|
| 1466 | + } else { |
|
| 1467 | + $orderby_query = " ORDER BY spotter_output.date DESC"; |
|
| 1468 | + } |
|
| 1363 | 1469 | } else { |
| 1364 | 1470 | $orderby_query = " ORDER BY spotter_output.date DESC"; |
| 1365 | 1471 | } |
@@ -1984,7 +2090,9 @@ discard block |
||
| 1984 | 2090 | { |
| 1985 | 2091 | $highlight = $row['highlight']; |
| 1986 | 2092 | } |
| 1987 | - if (isset($highlight)) return $highlight; |
|
| 2093 | + if (isset($highlight)) { |
|
| 2094 | + return $highlight; |
|
| 2095 | + } |
|
| 1988 | 2096 | } |
| 1989 | 2097 | |
| 1990 | 2098 | |
@@ -2012,7 +2120,9 @@ discard block |
||
| 2012 | 2120 | $sth->closeCursor(); |
| 2013 | 2121 | if (count($row) > 0) { |
| 2014 | 2122 | return $row['usage']; |
| 2015 | - } else return ''; |
|
| 2123 | + } else { |
|
| 2124 | + return ''; |
|
| 2125 | + } |
|
| 2016 | 2126 | } |
| 2017 | 2127 | |
| 2018 | 2128 | /** |
@@ -2037,7 +2147,9 @@ discard block |
||
| 2037 | 2147 | $sth->closeCursor(); |
| 2038 | 2148 | if (count($row) > 0) { |
| 2039 | 2149 | return $row['icao']; |
| 2040 | - } else return ''; |
|
| 2150 | + } else { |
|
| 2151 | + return ''; |
|
| 2152 | + } |
|
| 2041 | 2153 | } |
| 2042 | 2154 | |
| 2043 | 2155 | /** |
@@ -2065,7 +2177,9 @@ discard block |
||
| 2065 | 2177 | $airport_longitude = $row['longitude']; |
| 2066 | 2178 | $Common = new Common(); |
| 2067 | 2179 | return $Common->distance($latitude,$longitude,$airport_latitude,$airport_longitude); |
| 2068 | - } else return ''; |
|
| 2180 | + } else { |
|
| 2181 | + return ''; |
|
| 2182 | + } |
|
| 2069 | 2183 | } |
| 2070 | 2184 | |
| 2071 | 2185 | /** |
@@ -2177,7 +2291,9 @@ discard block |
||
| 2177 | 2291 | $minlat = filter_var($coord[1],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
| 2178 | 2292 | $maxlong = filter_var($coord[2],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
| 2179 | 2293 | $maxlat = filter_var($coord[3],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
| 2180 | - } else return array(); |
|
| 2294 | + } else { |
|
| 2295 | + return array(); |
|
| 2296 | + } |
|
| 2181 | 2297 | if ($globalDBdriver == 'mysql') { |
| 2182 | 2298 | $query = "SELECT airport.* FROM airport WHERE airport.latitude BETWEEN ".$minlat." AND ".$maxlat." AND airport.longitude BETWEEN ".$minlong." AND ".$maxlong." AND airport.type != 'closed'"; |
| 2183 | 2299 | } else { |
@@ -2212,7 +2328,9 @@ discard block |
||
| 2212 | 2328 | $minlat = filter_var($coord[1],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
| 2213 | 2329 | $maxlong = filter_var($coord[2],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
| 2214 | 2330 | $maxlat = filter_var($coord[3],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
| 2215 | - } else return array(); |
|
| 2331 | + } else { |
|
| 2332 | + return array(); |
|
| 2333 | + } |
|
| 2216 | 2334 | //$query = "SELECT waypoints.* FROM waypoints WHERE waypoints.latitude_begin BETWEEN ".$minlat." AND ".$maxlat." AND waypoints.longitude_begin BETWEEN ".$minlong." AND ".$maxlong; |
| 2217 | 2335 | $query = "SELECT waypoints.* FROM waypoints WHERE (waypoints.latitude_begin BETWEEN ".$minlat." AND ".$maxlat." AND waypoints.longitude_begin BETWEEN ".$minlong." AND ".$maxlong.") OR (waypoints.latitude_end BETWEEN ".$minlat." AND ".$maxlat." AND waypoints.longitude_end BETWEEN ".$minlong." AND ".$maxlong.")"; |
| 2218 | 2336 | //$query = "SELECT waypoints.* FROM waypoints"; |
@@ -2247,7 +2365,9 @@ discard block |
||
| 2247 | 2365 | public function getAllAirlineInfo($airline_icao, $fromsource = NULL) |
| 2248 | 2366 | { |
| 2249 | 2367 | global $globalUseRealAirlines; |
| 2250 | - if (isset($globalUseRealAirlines) && $globalUseRealAirlines) $fromsource = NULL; |
|
| 2368 | + if (isset($globalUseRealAirlines) && $globalUseRealAirlines) { |
|
| 2369 | + $fromsource = NULL; |
|
| 2370 | + } |
|
| 2251 | 2371 | $airline_icao = strtoupper(filter_var($airline_icao,FILTER_SANITIZE_STRING)); |
| 2252 | 2372 | if ($airline_icao == 'NA') { |
| 2253 | 2373 | $airline_array = array(); |
@@ -2316,7 +2436,9 @@ discard block |
||
| 2316 | 2436 | public function getAllAirlineInfoByName($airline_name, $fromsource = NULL) |
| 2317 | 2437 | { |
| 2318 | 2438 | global $globalUseRealAirlines; |
| 2319 | - if (isset($globalUseRealAirlines) && $globalUseRealAirlines) $fromsource = NULL; |
|
| 2439 | + if (isset($globalUseRealAirlines) && $globalUseRealAirlines) { |
|
| 2440 | + $fromsource = NULL; |
|
| 2441 | + } |
|
| 2320 | 2442 | $airline_name = strtolower(filter_var($airline_name,FILTER_SANITIZE_STRING)); |
| 2321 | 2443 | $query = "SELECT airlines.name, airlines.iata, airlines.icao, airlines.callsign, airlines.country, airlines.type FROM airlines WHERE lower(airlines.name) = :airline_name AND airlines.active = 'Y' AND airlines.forsource IS NULL LIMIT 1"; |
| 2322 | 2444 | $sth = $this->db->prepare($query); |
@@ -2332,7 +2454,9 @@ discard block |
||
| 2332 | 2454 | $sth->execute(array(':fromsource' => $fromsource)); |
| 2333 | 2455 | $row = $sth->fetch(PDO::FETCH_ASSOC); |
| 2334 | 2456 | $sth->closeCursor(); |
| 2335 | - if ($row['nb'] == 0) $result = $this->getAllAirlineInfoByName($airline_name); |
|
| 2457 | + if ($row['nb'] == 0) { |
|
| 2458 | + $result = $this->getAllAirlineInfoByName($airline_name); |
|
| 2459 | + } |
|
| 2336 | 2460 | } |
| 2337 | 2461 | return $result; |
| 2338 | 2462 | } |
@@ -2395,15 +2519,20 @@ discard block |
||
| 2395 | 2519 | 'A320-211' => 'A320', |
| 2396 | 2520 | '747-8i' => 'B748', |
| 2397 | 2521 | 'A380' => 'A388'); |
| 2398 | - if (isset($all_aircraft[$aircraft_type])) return $all_aircraft[$aircraft_type]; |
|
| 2522 | + if (isset($all_aircraft[$aircraft_type])) { |
|
| 2523 | + return $all_aircraft[$aircraft_type]; |
|
| 2524 | + } |
|
| 2399 | 2525 | |
| 2400 | 2526 | $query = "SELECT aircraft.icao FROM aircraft WHERE aircraft.type LIKE :saircraft_type OR aircraft.type = :aircraft_type OR aircraft.icao = :aircraft_type LIMIT 1"; |
| 2401 | 2527 | $aircraft_type = strtoupper($aircraft_type); |
| 2402 | 2528 | $sth = $this->db->prepare($query); |
| 2403 | 2529 | $sth->execute(array(':saircraft_type' => '%'.$aircraft_type.'%',':aircraft_type' => $aircraft_type,)); |
| 2404 | 2530 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
| 2405 | - if (isset($result[0]['icao'])) return $result[0]['icao']; |
|
| 2406 | - else return ''; |
|
| 2531 | + if (isset($result[0]['icao'])) { |
|
| 2532 | + return $result[0]['icao']; |
|
| 2533 | + } else { |
|
| 2534 | + return ''; |
|
| 2535 | + } |
|
| 2407 | 2536 | } |
| 2408 | 2537 | |
| 2409 | 2538 | /** |
@@ -2431,11 +2560,15 @@ discard block |
||
| 2431 | 2560 | $sth->closeCursor(); |
| 2432 | 2561 | if (isset($row['icaotypecode'])) { |
| 2433 | 2562 | $icao = $row['icaotypecode']; |
| 2434 | - if (isset($this->aircraft_correct_icaotype[$icao])) $icao = $this->aircraft_correct_icaotype[$icao]; |
|
| 2563 | + if (isset($this->aircraft_correct_icaotype[$icao])) { |
|
| 2564 | + $icao = $this->aircraft_correct_icaotype[$icao]; |
|
| 2565 | + } |
|
| 2435 | 2566 | return $icao; |
| 2436 | 2567 | } elseif ($source_type == 'flarm') { |
| 2437 | 2568 | return $this->getAllAircraftType($aircraft_modes); |
| 2438 | - } else return ''; |
|
| 2569 | + } else { |
|
| 2570 | + return ''; |
|
| 2571 | + } |
|
| 2439 | 2572 | } |
| 2440 | 2573 | |
| 2441 | 2574 | /** |
@@ -2458,7 +2591,9 @@ discard block |
||
| 2458 | 2591 | $sth->closeCursor(); |
| 2459 | 2592 | if (isset($row['icaotypecode'])) { |
| 2460 | 2593 | return $row['icaotypecode']; |
| 2461 | - } else return ''; |
|
| 2594 | + } else { |
|
| 2595 | + return ''; |
|
| 2596 | + } |
|
| 2462 | 2597 | } |
| 2463 | 2598 | |
| 2464 | 2599 | /** |
@@ -2504,7 +2639,9 @@ discard block |
||
| 2504 | 2639 | $sth->closeCursor(); |
| 2505 | 2640 | if (isset($row['operator_correct'])) { |
| 2506 | 2641 | return $row['operator_correct']; |
| 2507 | - } else return $operator; |
|
| 2642 | + } else { |
|
| 2643 | + return $operator; |
|
| 2644 | + } |
|
| 2508 | 2645 | } |
| 2509 | 2646 | |
| 2510 | 2647 | /** |
@@ -2517,7 +2654,9 @@ discard block |
||
| 2517 | 2654 | public function getRouteInfo($callsign) |
| 2518 | 2655 | { |
| 2519 | 2656 | $callsign = filter_var($callsign,FILTER_SANITIZE_STRING); |
| 2520 | - if ($callsign == '') return array(); |
|
| 2657 | + if ($callsign == '') { |
|
| 2658 | + return array(); |
|
| 2659 | + } |
|
| 2521 | 2660 | $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"; |
| 2522 | 2661 | |
| 2523 | 2662 | $sth = $this->db->prepare($query); |
@@ -2527,7 +2666,9 @@ discard block |
||
| 2527 | 2666 | $sth->closeCursor(); |
| 2528 | 2667 | if (count($row) > 0) { |
| 2529 | 2668 | return $row; |
| 2530 | - } else return array(); |
|
| 2669 | + } else { |
|
| 2670 | + return array(); |
|
| 2671 | + } |
|
| 2531 | 2672 | } |
| 2532 | 2673 | |
| 2533 | 2674 | /** |
@@ -2580,7 +2721,9 @@ discard block |
||
| 2580 | 2721 | $result = $sth->fetch(PDO::FETCH_ASSOC); |
| 2581 | 2722 | $sth->closeCursor(); |
| 2582 | 2723 | return $result; |
| 2583 | - } else return array(); |
|
| 2724 | + } else { |
|
| 2725 | + return array(); |
|
| 2726 | + } |
|
| 2584 | 2727 | } |
| 2585 | 2728 | |
| 2586 | 2729 | |
@@ -2739,8 +2882,11 @@ discard block |
||
| 2739 | 2882 | $query .= " ORDER BY spotter_output.source_name ASC"; |
| 2740 | 2883 | |
| 2741 | 2884 | $sth = $this->db->prepare($query); |
| 2742 | - if (!empty($query_values)) $sth->execute($query_values); |
|
| 2743 | - else $sth->execute(); |
|
| 2885 | + if (!empty($query_values)) { |
|
| 2886 | + $sth->execute($query_values); |
|
| 2887 | + } else { |
|
| 2888 | + $sth->execute(); |
|
| 2889 | + } |
|
| 2744 | 2890 | |
| 2745 | 2891 | $source_array = array(); |
| 2746 | 2892 | $temp_array = array(); |
@@ -2773,9 +2919,13 @@ discard block |
||
| 2773 | 2919 | WHERE spotter_output.airline_icao <> '' |
| 2774 | 2920 | ORDER BY spotter_output.airline_name ASC"; |
| 2775 | 2921 | */ |
| 2776 | - if (isset($globalAirlinesSource) && $globalAirlinesSource != '') $forsource = $globalAirlinesSource; |
|
| 2777 | - elseif (isset($globalVATSIM) && $globalVATSIM) $forsource = 'vatsim'; |
|
| 2778 | - elseif (isset($globalIVAO) && $globalIVAO) $forsource = 'ivao'; |
|
| 2922 | + if (isset($globalAirlinesSource) && $globalAirlinesSource != '') { |
|
| 2923 | + $forsource = $globalAirlinesSource; |
|
| 2924 | + } elseif (isset($globalVATSIM) && $globalVATSIM) { |
|
| 2925 | + $forsource = 'vatsim'; |
|
| 2926 | + } elseif (isset($globalIVAO) && $globalIVAO) { |
|
| 2927 | + $forsource = 'ivao'; |
|
| 2928 | + } |
|
| 2779 | 2929 | if ($forsource === NULL) { |
| 2780 | 2930 | $query = "SELECT DISTINCT icao AS airline_icao, name AS airline_name, type AS airline_type FROM airlines WHERE forsource IS NULL ORDER BY name ASC"; |
| 2781 | 2931 | $query_data = array(); |
@@ -2818,9 +2968,13 @@ discard block |
||
| 2818 | 2968 | { |
| 2819 | 2969 | global $globalAirlinesSource,$globalVATSIM, $globalIVAO; |
| 2820 | 2970 | $filter_query = $this->getFilter($filters,true,true); |
| 2821 | - if (isset($globalAirlinesSource) && $globalAirlinesSource != '') $forsource = $globalAirlinesSource; |
|
| 2822 | - elseif (isset($globalVATSIM) && $globalVATSIM) $forsource = 'vatsim'; |
|
| 2823 | - elseif (isset($globalIVAO) && $globalIVAO) $forsource = 'ivao'; |
|
| 2971 | + if (isset($globalAirlinesSource) && $globalAirlinesSource != '') { |
|
| 2972 | + $forsource = $globalAirlinesSource; |
|
| 2973 | + } elseif (isset($globalVATSIM) && $globalVATSIM) { |
|
| 2974 | + $forsource = 'vatsim'; |
|
| 2975 | + } elseif (isset($globalIVAO) && $globalIVAO) { |
|
| 2976 | + $forsource = 'ivao'; |
|
| 2977 | + } |
|
| 2824 | 2978 | if ($forsource === NULL) { |
| 2825 | 2979 | $query = "SELECT DISTINCT alliance FROM airlines WHERE alliance IS NOT NULL AND forsource IS NULL ORDER BY alliance ASC"; |
| 2826 | 2980 | $query_data = array(); |
@@ -3131,7 +3285,9 @@ discard block |
||
| 3131 | 3285 | date_default_timezone_set($globalTimezone); |
| 3132 | 3286 | $datetime = new DateTime(); |
| 3133 | 3287 | $offset = $datetime->format('P'); |
| 3134 | - } else $offset = '+00:00'; |
|
| 3288 | + } else { |
|
| 3289 | + $offset = '+00:00'; |
|
| 3290 | + } |
|
| 3135 | 3291 | if ($airport_icao == '') { |
| 3136 | 3292 | if ($globalDBdriver == 'mysql') { |
| 3137 | 3293 | $query = "SELECT COUNT(departure_airport_icao) AS departure_airport_count, departure_airport_icao, departure_airport_name, departure_airport_city, departure_airport_country, DATE_FORMAT(DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)),'%Y-%m-%d') as date FROM `spotter_output`".$filter_query." spotter_output.date >= DATE_SUB(UTC_TIMESTAMP(), INTERVAL 7 DAY) AND departure_airport_icao <> 'NA' AND departure_airport_icao <> '' GROUP BY departure_airport_icao, DATE_FORMAT(DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)),'%Y-%m-%d'), departure_airport_name, departure_airport_city, departure_airport_country ORDER BY departure_airport_count DESC"; |
@@ -3163,7 +3319,9 @@ discard block |
||
| 3163 | 3319 | date_default_timezone_set($globalTimezone); |
| 3164 | 3320 | $datetime = new DateTime(); |
| 3165 | 3321 | $offset = $datetime->format('P'); |
| 3166 | - } else $offset = '+00:00'; |
|
| 3322 | + } else { |
|
| 3323 | + $offset = '+00:00'; |
|
| 3324 | + } |
|
| 3167 | 3325 | if ($airport_icao == '') { |
| 3168 | 3326 | if ($globalDBdriver == 'mysql') { |
| 3169 | 3327 | $query = "SELECT spotter_output.airline_icao, COUNT(departure_airport_icao) AS departure_airport_count, departure_airport_icao, departure_airport_name, departure_airport_city, departure_airport_country, DATE_FORMAT(DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)),'%Y-%m-%d') as date FROM `spotter_output` WHERE spotter_output.date >= DATE_SUB(UTC_TIMESTAMP(), INTERVAL 7 DAY) AND departure_airport_icao <> 'NA' AND departure_airport_icao <> '' AND spotter_output.airline_icao <> '' GROUP BY spotter_output.airline_icao, departure_airport_icao, DATE_FORMAT(DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)),'%Y-%m-%d'), departure_airport_name, departure_airport_city, departure_airport_country ORDER BY departure_airport_count DESC"; |
@@ -3196,7 +3354,9 @@ discard block |
||
| 3196 | 3354 | date_default_timezone_set($globalTimezone); |
| 3197 | 3355 | $datetime = new DateTime(); |
| 3198 | 3356 | $offset = $datetime->format('P'); |
| 3199 | - } else $offset = '+00:00'; |
|
| 3357 | + } else { |
|
| 3358 | + $offset = '+00:00'; |
|
| 3359 | + } |
|
| 3200 | 3360 | if ($airport_icao == '') { |
| 3201 | 3361 | if ($globalDBdriver == 'mysql') { |
| 3202 | 3362 | $query = "SELECT COUNT(real_departure_airport_icao) AS departure_airport_count, real_departure_airport_icao AS departure_airport_icao, airport.name AS departure_airport_name, airport.city AS departure_airport_city, airport.country AS departure_airport_country, DATE_FORMAT(DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)),'%Y-%m-%d') as date |
@@ -3235,7 +3395,9 @@ discard block |
||
| 3235 | 3395 | date_default_timezone_set($globalTimezone); |
| 3236 | 3396 | $datetime = new DateTime(); |
| 3237 | 3397 | $offset = $datetime->format('P'); |
| 3238 | - } else $offset = '+00:00'; |
|
| 3398 | + } else { |
|
| 3399 | + $offset = '+00:00'; |
|
| 3400 | + } |
|
| 3239 | 3401 | if ($airport_icao == '') { |
| 3240 | 3402 | if ($globalDBdriver == 'mysql') { |
| 3241 | 3403 | $query = "SELECT spotter_output.airline_icao, COUNT(real_departure_airport_icao) AS departure_airport_count, real_departure_airport_icao AS departure_airport_icao, airport.name AS departure_airport_name, airport.city AS departure_airport_city, airport.country AS departure_airport_country, DATE_FORMAT(DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)),'%Y-%m-%d') as date |
@@ -3280,7 +3442,9 @@ discard block |
||
| 3280 | 3442 | date_default_timezone_set($globalTimezone); |
| 3281 | 3443 | $datetime = new DateTime(); |
| 3282 | 3444 | $offset = $datetime->format('P'); |
| 3283 | - } else $offset = '+00:00'; |
|
| 3445 | + } else { |
|
| 3446 | + $offset = '+00:00'; |
|
| 3447 | + } |
|
| 3284 | 3448 | if ($airport_icao == '') { |
| 3285 | 3449 | if ($globalDBdriver == 'mysql') { |
| 3286 | 3450 | $query = "SELECT COUNT(arrival_airport_icao) AS arrival_airport_count, arrival_airport_icao, arrival_airport_name, arrival_airport_city, arrival_airport_country, DATE_FORMAT(DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)),'%Y-%m-%d') as date FROM `spotter_output`".$filter_query." spotter_output.date >= DATE_SUB(UTC_TIMESTAMP(), INTERVAL 7 DAY) AND arrival_airport_icao <> 'NA' AND arrival_airport_icao <> '' GROUP BY arrival_airport_icao, DATE_FORMAT(DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)),'%Y-%m-%d'), arrival_airport_name, arrival_airport_city, arrival_airport_country ORDER BY arrival_airport_count DESC"; |
@@ -3315,7 +3479,9 @@ discard block |
||
| 3315 | 3479 | date_default_timezone_set($globalTimezone); |
| 3316 | 3480 | $datetime = new DateTime(); |
| 3317 | 3481 | $offset = $datetime->format('P'); |
| 3318 | - } else $offset = '+00:00'; |
|
| 3482 | + } else { |
|
| 3483 | + $offset = '+00:00'; |
|
| 3484 | + } |
|
| 3319 | 3485 | if ($airport_icao == '') { |
| 3320 | 3486 | if ($globalDBdriver == 'mysql') { |
| 3321 | 3487 | $query = "SELECT COUNT(real_arrival_airport_icao) AS arrival_airport_count, real_arrival_airport_icao AS arrival_airport_icao, airport.name AS arrival_airport_name, airport.city AS arrival_airport_city, airport.country AS arrival_airport_country, DATE_FORMAT(DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)),'%Y-%m-%d') as date |
@@ -3357,7 +3523,9 @@ discard block |
||
| 3357 | 3523 | date_default_timezone_set($globalTimezone); |
| 3358 | 3524 | $datetime = new DateTime(); |
| 3359 | 3525 | $offset = $datetime->format('P'); |
| 3360 | - } else $offset = '+00:00'; |
|
| 3526 | + } else { |
|
| 3527 | + $offset = '+00:00'; |
|
| 3528 | + } |
|
| 3361 | 3529 | if ($airport_icao == '') { |
| 3362 | 3530 | if ($globalDBdriver == 'mysql') { |
| 3363 | 3531 | $query = "SELECT spotter_output.airline_icao, COUNT(arrival_airport_icao) AS arrival_airport_count, arrival_airport_icao, arrival_airport_name, arrival_airport_city, arrival_airport_country, DATE_FORMAT(DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)),'%Y-%m-%d') as date FROM `spotter_output` WHERE spotter_output.date >= DATE_SUB(UTC_TIMESTAMP(), INTERVAL 7 DAY) AND arrival_airport_icao <> 'NA' AND arrival_airport_icao <> '' AND spotter_output.airline_icao <> '' GROUP BY spotter_output.airline_icao, arrival_airport_icao, DATE_FORMAT(DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)),'%Y-%m-%d'), arrival_airport_name, arrival_airport_city, arrival_airport_country ORDER BY arrival_airport_count DESC"; |
@@ -3391,7 +3559,9 @@ discard block |
||
| 3391 | 3559 | date_default_timezone_set($globalTimezone); |
| 3392 | 3560 | $datetime = new DateTime(); |
| 3393 | 3561 | $offset = $datetime->format('P'); |
| 3394 | - } else $offset = '+00:00'; |
|
| 3562 | + } else { |
|
| 3563 | + $offset = '+00:00'; |
|
| 3564 | + } |
|
| 3395 | 3565 | if ($airport_icao == '') { |
| 3396 | 3566 | if ($globalDBdriver == 'mysql') { |
| 3397 | 3567 | $query = "SELECT spotter_output.airline_icao, COUNT(real_arrival_airport_icao) AS arrival_airport_count, real_arrival_airport_icao AS arrival_airport_icao, airport.name AS arrival_airport_name, airport.city AS arrival_airport_city, airport.country AS arrival_airport_country, DATE_FORMAT(DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)),'%Y-%m-%d') as date |
@@ -3439,7 +3609,9 @@ discard block |
||
| 3439 | 3609 | date_default_timezone_set($globalTimezone); |
| 3440 | 3610 | $datetime = new DateTime(); |
| 3441 | 3611 | $offset = $datetime->format('P'); |
| 3442 | - } else $offset = '+00:00'; |
|
| 3612 | + } else { |
|
| 3613 | + $offset = '+00:00'; |
|
| 3614 | + } |
|
| 3443 | 3615 | |
| 3444 | 3616 | if ($globalDBdriver == 'mysql') { |
| 3445 | 3617 | $query = "SELECT DISTINCT DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) as date |
@@ -3559,7 +3731,9 @@ discard block |
||
| 3559 | 3731 | */ |
| 3560 | 3732 | public function updateLatestSpotterData($flightaware_id = '', $ident = '', $latitude = '', $longitude = '', $altitude = '', $ground = false, $groundspeed = NULL, $date = '', $arrival_airport_icao = '',$arrival_airport_time = '') |
| 3561 | 3733 | { |
| 3562 | - if ($groundspeed == '') $groundspeed = NULL; |
|
| 3734 | + if ($groundspeed == '') { |
|
| 3735 | + $groundspeed = NULL; |
|
| 3736 | + } |
|
| 3563 | 3737 | $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'; |
| 3564 | 3738 | $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); |
| 3565 | 3739 | |
@@ -3609,10 +3783,18 @@ discard block |
||
| 3609 | 3783 | $Image = new Image($this->db); |
| 3610 | 3784 | $Common = new Common(); |
| 3611 | 3785 | |
| 3612 | - if (!isset($globalIVAO)) $globalIVAO = FALSE; |
|
| 3613 | - if (!isset($globalVATSIM)) $globalVATSIM = FALSE; |
|
| 3614 | - if (!isset($globalphpVMS)) $globalphpVMS = FALSE; |
|
| 3615 | - if (!isset($globalVAM)) $globalVAM = FALSE; |
|
| 3786 | + if (!isset($globalIVAO)) { |
|
| 3787 | + $globalIVAO = FALSE; |
|
| 3788 | + } |
|
| 3789 | + if (!isset($globalVATSIM)) { |
|
| 3790 | + $globalVATSIM = FALSE; |
|
| 3791 | + } |
|
| 3792 | + if (!isset($globalphpVMS)) { |
|
| 3793 | + $globalphpVMS = FALSE; |
|
| 3794 | + } |
|
| 3795 | + if (!isset($globalVAM)) { |
|
| 3796 | + $globalVAM = FALSE; |
|
| 3797 | + } |
|
| 3616 | 3798 | date_default_timezone_set('UTC'); |
| 3617 | 3799 | |
| 3618 | 3800 | //getting the registration |
@@ -3625,23 +3807,33 @@ discard block |
||
| 3625 | 3807 | if ($ModeS != '') { |
| 3626 | 3808 | $timeelapsed = microtime(true); |
| 3627 | 3809 | $registration = $this->getAircraftRegistrationBymodeS($ModeS,$source_type); |
| 3628 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftRegistrationBymodes : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3810 | + if ($globalDebugTimeElapsed) { |
|
| 3811 | + echo 'ADD SPOTTER DATA : Time elapsed for getAircraftRegistrationBymodes : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3812 | + } |
|
| 3629 | 3813 | } else { |
| 3630 | 3814 | $myhex = explode('-',$flightaware_id); |
| 3631 | 3815 | if (count($myhex) > 0) { |
| 3632 | 3816 | $timeelapsed = microtime(true); |
| 3633 | 3817 | $registration = $this->getAircraftRegistrationBymodeS($myhex[0],$source_type); |
| 3634 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftRegistrationBymodes : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3818 | + if ($globalDebugTimeElapsed) { |
|
| 3819 | + echo 'ADD SPOTTER DATA : Time elapsed for getAircraftRegistrationBymodes : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3820 | + } |
|
| 3635 | 3821 | } |
| 3636 | 3822 | } |
| 3637 | 3823 | } |
| 3638 | 3824 | } |
| 3639 | 3825 | $fromsource = NULL; |
| 3640 | - if (isset($globalAirlinesSource) && $globalAirlinesSource != '') $fromsource = $globalAirlinesSource; |
|
| 3641 | - elseif ($format_source == 'vatsimtxt') $fromsource = 'vatsim'; |
|
| 3642 | - elseif ($format_source == 'whazzup') $fromsource = 'ivao'; |
|
| 3643 | - elseif (isset($globalVATSIM) && $globalVATSIM) $fromsource = 'vatsim'; |
|
| 3644 | - elseif (isset($globalIVAO) && $globalIVAO) $fromsource = 'ivao'; |
|
| 3826 | + if (isset($globalAirlinesSource) && $globalAirlinesSource != '') { |
|
| 3827 | + $fromsource = $globalAirlinesSource; |
|
| 3828 | + } elseif ($format_source == 'vatsimtxt') { |
|
| 3829 | + $fromsource = 'vatsim'; |
|
| 3830 | + } elseif ($format_source == 'whazzup') { |
|
| 3831 | + $fromsource = 'ivao'; |
|
| 3832 | + } elseif (isset($globalVATSIM) && $globalVATSIM) { |
|
| 3833 | + $fromsource = 'vatsim'; |
|
| 3834 | + } elseif (isset($globalIVAO) && $globalIVAO) { |
|
| 3835 | + $fromsource = 'ivao'; |
|
| 3836 | + } |
|
| 3645 | 3837 | //getting the airline information |
| 3646 | 3838 | if ($ident != "") |
| 3647 | 3839 | { |
@@ -3665,15 +3857,21 @@ discard block |
||
| 3665 | 3857 | if (!isset($airline_array[0]['icao']) || $airline_array[0]['icao'] == ""){ |
| 3666 | 3858 | $airline_array = $this->getAllAirlineInfo("NA"); |
| 3667 | 3859 | } |
| 3668 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAirlineInfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3860 | + if ($globalDebugTimeElapsed) { |
|
| 3861 | + echo 'ADD SPOTTER DATA : Time elapsed for getAirlineInfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3862 | + } |
|
| 3669 | 3863 | |
| 3670 | 3864 | } else { |
| 3671 | 3865 | $timeelapsed = microtime(true); |
| 3672 | 3866 | $airline_array = $this->getAllAirlineInfo("NA"); |
| 3673 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAirlineInfo(NA) : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3867 | + if ($globalDebugTimeElapsed) { |
|
| 3868 | + echo 'ADD SPOTTER DATA : Time elapsed for getAirlineInfo(NA) : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3869 | + } |
|
| 3674 | 3870 | } |
| 3675 | 3871 | } |
| 3676 | - } else $airline_array = array(); |
|
| 3872 | + } else { |
|
| 3873 | + $airline_array = array(); |
|
| 3874 | + } |
|
| 3677 | 3875 | |
| 3678 | 3876 | //getting the aircraft information |
| 3679 | 3877 | $aircraft_array = array(); |
@@ -3687,27 +3885,37 @@ discard block |
||
| 3687 | 3885 | { |
| 3688 | 3886 | $timeelapsed = microtime(true); |
| 3689 | 3887 | $aircraft_array = $this->getAllAircraftInfo("NA"); |
| 3690 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo(NA) : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3888 | + if ($globalDebugTimeElapsed) { |
|
| 3889 | + echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo(NA) : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3890 | + } |
|
| 3691 | 3891 | } else { |
| 3692 | 3892 | $timeelapsed = microtime(true); |
| 3693 | 3893 | $aircraft_array = $this->getAllAircraftInfo($aircraft_icao); |
| 3694 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3894 | + if ($globalDebugTimeElapsed) { |
|
| 3895 | + echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3896 | + } |
|
| 3695 | 3897 | } |
| 3696 | 3898 | } |
| 3697 | 3899 | } else { |
| 3698 | 3900 | if ($ModeS != '') { |
| 3699 | 3901 | $timeelapsed = microtime(true); |
| 3700 | 3902 | $aircraft_icao = $this->getAllAircraftType($ModeS,$source_type); |
| 3701 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAllAircraftType : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3903 | + if ($globalDebugTimeElapsed) { |
|
| 3904 | + echo 'ADD SPOTTER DATA : Time elapsed for getAllAircraftType : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3905 | + } |
|
| 3702 | 3906 | if ($aircraft_icao == "" || $aircraft_icao == "XXXX") |
| 3703 | 3907 | { |
| 3704 | 3908 | $timeelapsed = microtime(true); |
| 3705 | 3909 | $aircraft_array = $this->getAllAircraftInfo("NA"); |
| 3706 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo(NA) : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3910 | + if ($globalDebugTimeElapsed) { |
|
| 3911 | + echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo(NA) : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3912 | + } |
|
| 3707 | 3913 | } else { |
| 3708 | 3914 | $timeelapsed = microtime(true); |
| 3709 | 3915 | $aircraft_array = $this->getAllAircraftInfo($aircraft_icao); |
| 3710 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3916 | + if ($globalDebugTimeElapsed) { |
|
| 3917 | + echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3918 | + } |
|
| 3711 | 3919 | } |
| 3712 | 3920 | } |
| 3713 | 3921 | } |
@@ -3723,7 +3931,9 @@ discard block |
||
| 3723 | 3931 | } else { |
| 3724 | 3932 | $timeelapsed = microtime(true); |
| 3725 | 3933 | $departure_airport_array = $this->getAllAirportInfo($departure_airport_icao); |
| 3726 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAllAirportInfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3934 | + if ($globalDebugTimeElapsed) { |
|
| 3935 | + echo 'ADD SPOTTER DATA : Time elapsed for getAllAirportInfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3936 | + } |
|
| 3727 | 3937 | } |
| 3728 | 3938 | } |
| 3729 | 3939 | |
@@ -3738,7 +3948,9 @@ discard block |
||
| 3738 | 3948 | } else { |
| 3739 | 3949 | $timeelapsed = microtime(true); |
| 3740 | 3950 | $arrival_airport_array = $this->getAllAirportInfo($arrival_airport_icao); |
| 3741 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAllAirportInfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3951 | + if ($globalDebugTimeElapsed) { |
|
| 3952 | + echo 'ADD SPOTTER DATA : Time elapsed for getAllAirportInfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3953 | + } |
|
| 3742 | 3954 | } |
| 3743 | 3955 | } |
| 3744 | 3956 | |
@@ -3772,7 +3984,9 @@ discard block |
||
| 3772 | 3984 | { |
| 3773 | 3985 | return false; |
| 3774 | 3986 | } |
| 3775 | - } else $altitude = 0; |
|
| 3987 | + } else { |
|
| 3988 | + $altitude = 0; |
|
| 3989 | + } |
|
| 3776 | 3990 | |
| 3777 | 3991 | if ($heading != "") |
| 3778 | 3992 | { |
@@ -3801,7 +4015,9 @@ discard block |
||
| 3801 | 4015 | { |
| 3802 | 4016 | $timeelapsed = microtime(true); |
| 3803 | 4017 | $image_array = $Image->getSpotterImage($registration); |
| 3804 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getSpotterImage : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 4018 | + if ($globalDebugTimeElapsed) { |
|
| 4019 | + echo 'ADD SPOTTER DATA : Time elapsed for getSpotterImage : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 4020 | + } |
|
| 3805 | 4021 | if (!isset($image_array[0]['registration'])) |
| 3806 | 4022 | { |
| 3807 | 4023 | //echo "Add image !!!! \n"; |
@@ -3809,14 +4025,21 @@ discard block |
||
| 3809 | 4025 | } |
| 3810 | 4026 | $timeelapsed = microtime(true); |
| 3811 | 4027 | $owner_info = $this->getAircraftOwnerByRegistration($registration); |
| 3812 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftOwnerByRegistration : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3813 | - if ($owner_info['owner'] != '') $aircraft_owner = ucwords(strtolower($owner_info['owner'])); |
|
| 4028 | + if ($globalDebugTimeElapsed) { |
|
| 4029 | + echo 'ADD SPOTTER DATA : Time elapsed for getAircraftOwnerByRegistration : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 4030 | + } |
|
| 4031 | + if ($owner_info['owner'] != '') { |
|
| 4032 | + $aircraft_owner = ucwords(strtolower($owner_info['owner'])); |
|
| 4033 | + } |
|
| 3814 | 4034 | } |
| 3815 | 4035 | |
| 3816 | 4036 | if (($globalIVAO || $globalVATSIM || $globalphpVMS || $globalVAM) && $aircraft_icao != '') |
| 3817 | 4037 | { |
| 3818 | - if (isset($airline_array[0]['icao'])) $airline_icao = $airline_array[0]['icao']; |
|
| 3819 | - else $airline_icao = ''; |
|
| 4038 | + if (isset($airline_array[0]['icao'])) { |
|
| 4039 | + $airline_icao = $airline_array[0]['icao']; |
|
| 4040 | + } else { |
|
| 4041 | + $airline_icao = ''; |
|
| 4042 | + } |
|
| 3820 | 4043 | $image_array = $Image->getSpotterImage('',$aircraft_icao,$airline_icao); |
| 3821 | 4044 | if (!isset($image_array[0]['registration'])) |
| 3822 | 4045 | { |
@@ -3861,16 +4084,28 @@ discard block |
||
| 3861 | 4084 | { |
| 3862 | 4085 | $arrival_airport_array = $this->getAllAirportInfo('NA'); |
| 3863 | 4086 | } |
| 3864 | - if ($registration == '') $registration = 'NA'; |
|
| 4087 | + if ($registration == '') { |
|
| 4088 | + $registration = 'NA'; |
|
| 4089 | + } |
|
| 3865 | 4090 | if ($latitude == '' && $longitude == '') { |
| 3866 | 4091 | $latitude = 0; |
| 3867 | 4092 | $longitude = 0; |
| 3868 | 4093 | } |
| 3869 | - if ($squawk == '' || $Common->isInteger($squawk) === false) $squawk = NULL; |
|
| 3870 | - if ($verticalrate == '' || $Common->isInteger($verticalrate) === false) $verticalrate = NULL; |
|
| 3871 | - if ($heading == '' || $Common->isInteger($heading) === false) $heading = 0; |
|
| 3872 | - if ($groundspeed == '' || $Common->isInteger($groundspeed) === false) $groundspeed = 0; |
|
| 3873 | - if (!isset($aircraft_owner)) $aircraft_owner = NULL; |
|
| 4094 | + if ($squawk == '' || $Common->isInteger($squawk) === false) { |
|
| 4095 | + $squawk = NULL; |
|
| 4096 | + } |
|
| 4097 | + if ($verticalrate == '' || $Common->isInteger($verticalrate) === false) { |
|
| 4098 | + $verticalrate = NULL; |
|
| 4099 | + } |
|
| 4100 | + if ($heading == '' || $Common->isInteger($heading) === false) { |
|
| 4101 | + $heading = 0; |
|
| 4102 | + } |
|
| 4103 | + if ($groundspeed == '' || $Common->isInteger($groundspeed) === false) { |
|
| 4104 | + $groundspeed = 0; |
|
| 4105 | + } |
|
| 4106 | + if (!isset($aircraft_owner)) { |
|
| 4107 | + $aircraft_owner = NULL; |
|
| 4108 | + } |
|
| 3874 | 4109 | $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) |
| 3875 | 4110 | 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)"; |
| 3876 | 4111 | |
@@ -3881,9 +4116,13 @@ discard block |
||
| 3881 | 4116 | if ($airline_type == '') { |
| 3882 | 4117 | $timeelapsed = microtime(true); |
| 3883 | 4118 | $airline_type = $this->getAircraftTypeBymodeS($ModeS); |
| 3884 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftTypeBymodes : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 4119 | + if ($globalDebugTimeElapsed) { |
|
| 4120 | + echo 'ADD SPOTTER DATA : Time elapsed for getAircraftTypeBymodes : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 4121 | + } |
|
| 4122 | + } |
|
| 4123 | + if ($airline_type == null) { |
|
| 4124 | + $airline_type = ''; |
|
| 3885 | 4125 | } |
| 3886 | - if ($airline_type == null) $airline_type = ''; |
|
| 3887 | 4126 | $aircraft_type = $aircraft_array[0]['type']; |
| 3888 | 4127 | $aircraft_manufacturer = $aircraft_array[0]['manufacturer']; |
| 3889 | 4128 | $departure_airport_name = $departure_airport_array[0]['name']; |
@@ -4047,7 +4286,9 @@ discard block |
||
| 4047 | 4286 | } |
| 4048 | 4287 | } |
| 4049 | 4288 | $query .= " GROUP BY spotter_output.airline_name,spotter_output.airline_icao, spotter_output.airline_country ORDER BY airline_count DESC"; |
| 4050 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
| 4289 | + if ($limit) { |
|
| 4290 | + $query .= " LIMIT 10 OFFSET 0"; |
|
| 4291 | + } |
|
| 4051 | 4292 | |
| 4052 | 4293 | $sth = $this->db->prepare($query); |
| 4053 | 4294 | $sth->execute($query_values); |
@@ -4120,7 +4361,9 @@ discard block |
||
| 4120 | 4361 | } |
| 4121 | 4362 | |
| 4122 | 4363 | $query .= " GROUP BY spotter_output.pilot_id,s.pilot_name,spotter_output.format_source ORDER BY pilot_count DESC"; |
| 4123 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
| 4364 | + if ($limit) { |
|
| 4365 | + $query .= " LIMIT 10 OFFSET 0"; |
|
| 4366 | + } |
|
| 4124 | 4367 | |
| 4125 | 4368 | |
| 4126 | 4369 | $sth = $this->db->prepare($query); |
@@ -4164,7 +4407,9 @@ discard block |
||
| 4164 | 4407 | } |
| 4165 | 4408 | } |
| 4166 | 4409 | $query .= "GROUP BY spotter_output.airline_icao, spotter_output.pilot_id,spotter_output.pilot_name,spotter_output.format_source ORDER BY pilot_count DESC"; |
| 4167 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
| 4410 | + if ($limit) { |
|
| 4411 | + $query .= " LIMIT 10 OFFSET 0"; |
|
| 4412 | + } |
|
| 4168 | 4413 | |
| 4169 | 4414 | |
| 4170 | 4415 | $sth = $this->db->prepare($query); |
@@ -4240,7 +4485,9 @@ discard block |
||
| 4240 | 4485 | } |
| 4241 | 4486 | } |
| 4242 | 4487 | $query .= " GROUP BY spotter_output.owner_name ORDER BY owner_count DESC"; |
| 4243 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
| 4488 | + if ($limit) { |
|
| 4489 | + $query .= " LIMIT 10 OFFSET 0"; |
|
| 4490 | + } |
|
| 4244 | 4491 | |
| 4245 | 4492 | $sth = $this->db->prepare($query); |
| 4246 | 4493 | $sth->execute($query_values); |
@@ -4282,7 +4529,9 @@ discard block |
||
| 4282 | 4529 | } |
| 4283 | 4530 | } |
| 4284 | 4531 | $query .= "GROUP BY spotter_output.airline_icao, spotter_output.owner_name ORDER BY owner_count DESC"; |
| 4285 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
| 4532 | + if ($limit) { |
|
| 4533 | + $query .= " LIMIT 10 OFFSET 0"; |
|
| 4534 | + } |
|
| 4286 | 4535 | |
| 4287 | 4536 | |
| 4288 | 4537 | $sth = $this->db->prepare($query); |
@@ -4527,7 +4776,9 @@ discard block |
||
| 4527 | 4776 | date_default_timezone_set($globalTimezone); |
| 4528 | 4777 | $datetime = new DateTime($date); |
| 4529 | 4778 | $offset = $datetime->format('P'); |
| 4530 | - } else $offset = '+00:00'; |
|
| 4779 | + } else { |
|
| 4780 | + $offset = '+00:00'; |
|
| 4781 | + } |
|
| 4531 | 4782 | |
| 4532 | 4783 | if ($globalDBdriver == 'mysql') { |
| 4533 | 4784 | $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
@@ -4575,7 +4826,9 @@ discard block |
||
| 4575 | 4826 | date_default_timezone_set($globalTimezone); |
| 4576 | 4827 | $datetime = new DateTime($date); |
| 4577 | 4828 | $offset = $datetime->format('P'); |
| 4578 | - } else $offset = '+00:00'; |
|
| 4829 | + } else { |
|
| 4830 | + $offset = '+00:00'; |
|
| 4831 | + } |
|
| 4579 | 4832 | |
| 4580 | 4833 | if ($globalDBdriver == 'mysql') { |
| 4581 | 4834 | $query = "SELECT DISTINCT spotter_output.airline_country, COUNT(spotter_output.airline_country) AS airline_country_count |
@@ -4695,9 +4948,13 @@ discard block |
||
| 4695 | 4948 | $sth = $this->db->prepare($query); |
| 4696 | 4949 | $sth->execute($query_values); |
| 4697 | 4950 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
| 4698 | - if (is_numeric($result[0]['duration'])) return gmdate('H:i:s',$result[0]['duration']); |
|
| 4699 | - elseif ($result[0]['duration'] == '') return 0; |
|
| 4700 | - else return $result[0]['duration']; |
|
| 4951 | + if (is_numeric($result[0]['duration'])) { |
|
| 4952 | + return gmdate('H:i:s',$result[0]['duration']); |
|
| 4953 | + } elseif ($result[0]['duration'] == '') { |
|
| 4954 | + return 0; |
|
| 4955 | + } else { |
|
| 4956 | + return $result[0]['duration']; |
|
| 4957 | + } |
|
| 4701 | 4958 | } |
| 4702 | 4959 | |
| 4703 | 4960 | /** |
@@ -4786,8 +5043,11 @@ discard block |
||
| 4786 | 5043 | $sth = $this->db->prepare($query); |
| 4787 | 5044 | $sth->execute($query_values); |
| 4788 | 5045 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
| 4789 | - if (is_int($result[0]['duration'])) return gmdate('H:i:s',$result[0]['duration']); |
|
| 4790 | - else return $result[0]['duration']; |
|
| 5046 | + if (is_int($result[0]['duration'])) { |
|
| 5047 | + return gmdate('H:i:s',$result[0]['duration']); |
|
| 5048 | + } else { |
|
| 5049 | + return $result[0]['duration']; |
|
| 5050 | + } |
|
| 4791 | 5051 | } |
| 4792 | 5052 | |
| 4793 | 5053 | /** |
@@ -4992,7 +5252,9 @@ discard block |
||
| 4992 | 5252 | } |
| 4993 | 5253 | $query .= " GROUP BY spotter_output.airline_country, countries.iso3 |
| 4994 | 5254 | ORDER BY airline_country_count DESC"; |
| 4995 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
| 5255 | + if ($limit) { |
|
| 5256 | + $query .= " LIMIT 10 OFFSET 0"; |
|
| 5257 | + } |
|
| 4996 | 5258 | |
| 4997 | 5259 | $sth = $this->db->prepare($query); |
| 4998 | 5260 | $sth->execute($query_values); |
@@ -5021,7 +5283,9 @@ discard block |
||
| 5021 | 5283 | global $globalDBdriver; |
| 5022 | 5284 | //$filter_query = $this->getFilter($filters,true,true); |
| 5023 | 5285 | $Connection= new Connection($this->db); |
| 5024 | - if (!$Connection->tableExists('countries')) return array(); |
|
| 5286 | + if (!$Connection->tableExists('countries')) { |
|
| 5287 | + return array(); |
|
| 5288 | + } |
|
| 5025 | 5289 | /* |
| 5026 | 5290 | $query = "SELECT c.name, c.iso3, c.iso2, count(c.name) as nb |
| 5027 | 5291 | FROM countries c, spotter_output s |
@@ -5053,7 +5317,9 @@ discard block |
||
| 5053 | 5317 | } |
| 5054 | 5318 | $query = "SELECT c.name, c.iso3, c.iso2, count(c.name) as nb FROM countries c INNER JOIN (SELECT DISTINCT flightaware_id,over_country FROM spotter_live".$filter_query.") l ON c.iso2 = l.over_country "; |
| 5055 | 5319 | $query .= "GROUP BY c.name,c.iso3,c.iso2 ORDER BY nb DESC"; |
| 5056 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
| 5320 | + if ($limit) { |
|
| 5321 | + $query .= " LIMIT 10 OFFSET 0"; |
|
| 5322 | + } |
|
| 5057 | 5323 | |
| 5058 | 5324 | |
| 5059 | 5325 | $sth = $this->db->prepare($query); |
@@ -5130,7 +5396,9 @@ discard block |
||
| 5130 | 5396 | } |
| 5131 | 5397 | |
| 5132 | 5398 | $query .= " GROUP BY spotter_output.aircraft_icao, spotter_output.aircraft_name, spotter_output.aircraft_manufacturer ORDER BY aircraft_icao_count DESC"; |
| 5133 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
| 5399 | + if ($limit) { |
|
| 5400 | + $query .= " LIMIT 10 OFFSET 0"; |
|
| 5401 | + } |
|
| 5134 | 5402 | |
| 5135 | 5403 | $sth = $this->db->prepare($query); |
| 5136 | 5404 | $sth->execute($query_values); |
@@ -5204,7 +5472,9 @@ discard block |
||
| 5204 | 5472 | } |
| 5205 | 5473 | |
| 5206 | 5474 | $query .= " GROUP BY spotter_output.airline_icao, spotter_output.aircraft_icao, spotter_output.aircraft_name, spotter_output.aircraft_manufacturer ORDER BY aircraft_icao_count DESC"; |
| 5207 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
| 5475 | + if ($limit) { |
|
| 5476 | + $query .= " LIMIT 10 OFFSET 0"; |
|
| 5477 | + } |
|
| 5208 | 5478 | |
| 5209 | 5479 | $sth = $this->db->prepare($query); |
| 5210 | 5480 | $sth->execute($query_values); |
@@ -5251,7 +5521,9 @@ discard block |
||
| 5251 | 5521 | } |
| 5252 | 5522 | |
| 5253 | 5523 | $query .= "GROUP BY EXTRACT(month from spotter_output.date), EXTRACT(year from spotter_output.date), spotter_output.aircraft_icao, spotter_output.aircraft_name, spotter_output.aircraft_manufacturer ORDER BY aircraft_icao_count DESC"; |
| 5254 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
| 5524 | + if ($limit) { |
|
| 5525 | + $query .= " LIMIT 10 OFFSET 0"; |
|
| 5526 | + } |
|
| 5255 | 5527 | |
| 5256 | 5528 | $sth = $this->db->prepare($query); |
| 5257 | 5529 | $sth->execute(); |
@@ -5304,7 +5576,9 @@ discard block |
||
| 5304 | 5576 | if($row['registration'] != "") |
| 5305 | 5577 | { |
| 5306 | 5578 | $image_array = $Image->getSpotterImage($row['registration']); |
| 5307 | - if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
| 5579 | + if (isset($image_array[0]['image_thumbnail'])) { |
|
| 5580 | + $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
| 5581 | + } |
|
| 5308 | 5582 | } |
| 5309 | 5583 | $temp_array['registration_count'] = $row['registration_count']; |
| 5310 | 5584 | |
@@ -5379,7 +5653,9 @@ discard block |
||
| 5379 | 5653 | if($row['registration'] != "") |
| 5380 | 5654 | { |
| 5381 | 5655 | $image_array = $Image->getSpotterImage($row['registration']); |
| 5382 | - if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
| 5656 | + if (isset($image_array[0]['image_thumbnail'])) { |
|
| 5657 | + $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
| 5658 | + } |
|
| 5383 | 5659 | } |
| 5384 | 5660 | $temp_array['registration_count'] = $row['registration_count']; |
| 5385 | 5661 | |
@@ -5486,7 +5762,9 @@ discard block |
||
| 5486 | 5762 | if($row['registration'] != "") |
| 5487 | 5763 | { |
| 5488 | 5764 | $image_array = $Image->getSpotterImage($row['registration']); |
| 5489 | - if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
| 5765 | + if (isset($image_array[0]['image_thumbnail'])) { |
|
| 5766 | + $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
| 5767 | + } |
|
| 5490 | 5768 | } |
| 5491 | 5769 | $temp_array['registration_count'] = $row['registration_count']; |
| 5492 | 5770 | $aircraft_array[] = $temp_array; |
@@ -5611,7 +5889,9 @@ discard block |
||
| 5611 | 5889 | date_default_timezone_set($globalTimezone); |
| 5612 | 5890 | $datetime = new DateTime($date); |
| 5613 | 5891 | $offset = $datetime->format('P'); |
| 5614 | - } else $offset = '+00:00'; |
|
| 5892 | + } else { |
|
| 5893 | + $offset = '+00:00'; |
|
| 5894 | + } |
|
| 5615 | 5895 | |
| 5616 | 5896 | if ($globalDBdriver == 'mysql') { |
| 5617 | 5897 | $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name |
@@ -5658,7 +5938,9 @@ discard block |
||
| 5658 | 5938 | date_default_timezone_set($globalTimezone); |
| 5659 | 5939 | $datetime = new DateTime($date); |
| 5660 | 5940 | $offset = $datetime->format('P'); |
| 5661 | - } else $offset = '+00:00'; |
|
| 5941 | + } else { |
|
| 5942 | + $offset = '+00:00'; |
|
| 5943 | + } |
|
| 5662 | 5944 | |
| 5663 | 5945 | if ($globalDBdriver == 'mysql') { |
| 5664 | 5946 | $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.registration) AS registration_count, spotter_output.aircraft_name, spotter_output.registration, spotter_output.airline_name |
@@ -5687,7 +5969,9 @@ discard block |
||
| 5687 | 5969 | if($row['registration'] != "") |
| 5688 | 5970 | { |
| 5689 | 5971 | $image_array = $Image->getSpotterImage($row['registration']); |
| 5690 | - if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
| 5972 | + if (isset($image_array[0]['image_thumbnail'])) { |
|
| 5973 | + $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
| 5974 | + } |
|
| 5691 | 5975 | } |
| 5692 | 5976 | $temp_array['registration_count'] = $row['registration_count']; |
| 5693 | 5977 | |
@@ -5712,7 +5996,9 @@ discard block |
||
| 5712 | 5996 | date_default_timezone_set($globalTimezone); |
| 5713 | 5997 | $datetime = new DateTime($date); |
| 5714 | 5998 | $offset = $datetime->format('P'); |
| 5715 | - } else $offset = '+00:00'; |
|
| 5999 | + } else { |
|
| 6000 | + $offset = '+00:00'; |
|
| 6001 | + } |
|
| 5716 | 6002 | |
| 5717 | 6003 | if ($globalDBdriver == 'mysql') { |
| 5718 | 6004 | $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
@@ -5908,8 +6194,11 @@ discard block |
||
| 5908 | 6194 | if($row['registration'] != "") |
| 5909 | 6195 | { |
| 5910 | 6196 | $image_array = $Image->getSpotterImage($row['registration']); |
| 5911 | - if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
| 5912 | - else $temp_array['image_thumbnail'] = ''; |
|
| 6197 | + if (isset($image_array[0]['image_thumbnail'])) { |
|
| 6198 | + $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
| 6199 | + } else { |
|
| 6200 | + $temp_array['image_thumbnail'] = ''; |
|
| 6201 | + } |
|
| 5913 | 6202 | } |
| 5914 | 6203 | $temp_array['registration_count'] = $row['registration_count']; |
| 5915 | 6204 | $aircraft_array[] = $temp_array; |
@@ -5983,8 +6272,11 @@ discard block |
||
| 5983 | 6272 | if($row['registration'] != "") |
| 5984 | 6273 | { |
| 5985 | 6274 | $image_array = $Image->getSpotterImage($row['registration']); |
| 5986 | - if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
| 5987 | - else $temp_array['image_thumbnail'] = ''; |
|
| 6275 | + if (isset($image_array[0]['image_thumbnail'])) { |
|
| 6276 | + $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
| 6277 | + } else { |
|
| 6278 | + $temp_array['image_thumbnail'] = ''; |
|
| 6279 | + } |
|
| 5988 | 6280 | } |
| 5989 | 6281 | $temp_array['registration_count'] = $row['registration_count']; |
| 5990 | 6282 | $aircraft_array[] = $temp_array; |
@@ -6058,8 +6350,11 @@ discard block |
||
| 6058 | 6350 | if($row['registration'] != "") |
| 6059 | 6351 | { |
| 6060 | 6352 | $image_array = $Image->getSpotterImage($row['registration']); |
| 6061 | - if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
| 6062 | - else $temp_array['image_thumbnail'] = ''; |
|
| 6353 | + if (isset($image_array[0]['image_thumbnail'])) { |
|
| 6354 | + $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
| 6355 | + } else { |
|
| 6356 | + $temp_array['image_thumbnail'] = ''; |
|
| 6357 | + } |
|
| 6063 | 6358 | } |
| 6064 | 6359 | $temp_array['registration_count'] = $row['registration_count']; |
| 6065 | 6360 | $aircraft_array[] = $temp_array; |
@@ -6270,7 +6565,9 @@ discard block |
||
| 6270 | 6565 | if($row['registration'] != "") |
| 6271 | 6566 | { |
| 6272 | 6567 | $image_array = $Image->getSpotterImage($row['registration']); |
| 6273 | - if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
| 6568 | + if (isset($image_array[0]['image_thumbnail'])) { |
|
| 6569 | + $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
| 6570 | + } |
|
| 6274 | 6571 | } |
| 6275 | 6572 | $temp_array['registration_count'] = $row['registration_count']; |
| 6276 | 6573 | |
@@ -6387,7 +6684,9 @@ discard block |
||
| 6387 | 6684 | if($row['registration'] != "") |
| 6388 | 6685 | { |
| 6389 | 6686 | $image_array = $Image->getSpotterImage($row['registration']); |
| 6390 | - if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
| 6687 | + if (isset($image_array[0]['image_thumbnail'])) { |
|
| 6688 | + $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
| 6689 | + } |
|
| 6391 | 6690 | } |
| 6392 | 6691 | $temp_array['registration_count'] = $row['registration_count']; |
| 6393 | 6692 | |
@@ -6553,7 +6852,9 @@ discard block |
||
| 6553 | 6852 | } |
| 6554 | 6853 | } |
| 6555 | 6854 | $query .= " GROUP BY spotter_output.registration, spotter_output.aircraft_icao, spotter_output.aircraft_name, spotter_output.airline_name ORDER BY aircraft_registration_count DESC"; |
| 6556 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
| 6855 | + if ($limit) { |
|
| 6856 | + $query .= " LIMIT 10 OFFSET 0"; |
|
| 6857 | + } |
|
| 6557 | 6858 | |
| 6558 | 6859 | $sth = $this->db->prepare($query); |
| 6559 | 6860 | $sth->execute($query_values); |
@@ -6572,7 +6873,9 @@ discard block |
||
| 6572 | 6873 | if($row['registration'] != "") |
| 6573 | 6874 | { |
| 6574 | 6875 | $image_array = $Image->getSpotterImage($row['registration']); |
| 6575 | - if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
| 6876 | + if (isset($image_array[0]['image_thumbnail'])) { |
|
| 6877 | + $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
| 6878 | + } |
|
| 6576 | 6879 | } |
| 6577 | 6880 | |
| 6578 | 6881 | $aircraft_array[] = $temp_array; |
@@ -6613,7 +6916,9 @@ discard block |
||
| 6613 | 6916 | // if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
| 6614 | 6917 | //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
| 6615 | 6918 | $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"; |
| 6616 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
| 6919 | + if ($limit) { |
|
| 6920 | + $query .= " LIMIT 10 OFFSET 0"; |
|
| 6921 | + } |
|
| 6617 | 6922 | |
| 6618 | 6923 | $sth = $this->db->prepare($query); |
| 6619 | 6924 | $sth->execute(); |
@@ -6633,7 +6938,9 @@ discard block |
||
| 6633 | 6938 | if($row['registration'] != "") |
| 6634 | 6939 | { |
| 6635 | 6940 | $image_array = $Image->getSpotterImage($row['registration']); |
| 6636 | - if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
| 6941 | + if (isset($image_array[0]['image_thumbnail'])) { |
|
| 6942 | + $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
| 6943 | + } |
|
| 6637 | 6944 | } |
| 6638 | 6945 | |
| 6639 | 6946 | $aircraft_array[] = $temp_array; |
@@ -6699,7 +7006,9 @@ discard block |
||
| 6699 | 7006 | } |
| 6700 | 7007 | $query .= " GROUP BY spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country, airport.latitude, airport.longitude |
| 6701 | 7008 | ORDER BY airport_departure_icao_count DESC"; |
| 6702 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
| 7009 | + if ($limit) { |
|
| 7010 | + $query .= " LIMIT 10 OFFSET 0"; |
|
| 7011 | + } |
|
| 6703 | 7012 | |
| 6704 | 7013 | $sth = $this->db->prepare($query); |
| 6705 | 7014 | $sth->execute($query_values); |
@@ -6751,7 +7060,9 @@ discard block |
||
| 6751 | 7060 | //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
| 6752 | 7061 | $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 |
| 6753 | 7062 | ORDER BY airport_departure_icao_count DESC"; |
| 6754 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
| 7063 | + if ($limit) { |
|
| 7064 | + $query .= " LIMIT 10 OFFSET 0"; |
|
| 7065 | + } |
|
| 6755 | 7066 | |
| 6756 | 7067 | $sth = $this->db->prepare($query); |
| 6757 | 7068 | $sth->execute(); |
@@ -6829,7 +7140,9 @@ discard block |
||
| 6829 | 7140 | } |
| 6830 | 7141 | $query .= " GROUP BY spotter_output.real_departure_airport_icao, airport.name, airport.city, airport.country, airport.latitude, airport.longitude |
| 6831 | 7142 | ORDER BY airport_departure_icao_count DESC"; |
| 6832 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
| 7143 | + if ($limit) { |
|
| 7144 | + $query .= " LIMIT 10 OFFSET 0"; |
|
| 7145 | + } |
|
| 6833 | 7146 | //echo $query; |
| 6834 | 7147 | $sth = $this->db->prepare($query); |
| 6835 | 7148 | $sth->execute($query_values); |
@@ -6883,7 +7196,9 @@ discard block |
||
| 6883 | 7196 | //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
| 6884 | 7197 | $query .= "GROUP BY spotter_output.airline_icao, spotter_output.real_departure_airport_icao, airport.name, airport.city, airport.country |
| 6885 | 7198 | ORDER BY airport_departure_icao_count DESC"; |
| 6886 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
| 7199 | + if ($limit) { |
|
| 7200 | + $query .= " LIMIT 10 OFFSET 0"; |
|
| 7201 | + } |
|
| 6887 | 7202 | |
| 6888 | 7203 | $sth = $this->db->prepare($query); |
| 6889 | 7204 | $sth->execute(); |
@@ -7274,7 +7589,9 @@ discard block |
||
| 7274 | 7589 | date_default_timezone_set($globalTimezone); |
| 7275 | 7590 | $datetime = new DateTime($date); |
| 7276 | 7591 | $offset = $datetime->format('P'); |
| 7277 | - } else $offset = '+00:00'; |
|
| 7592 | + } else { |
|
| 7593 | + $offset = '+00:00'; |
|
| 7594 | + } |
|
| 7278 | 7595 | |
| 7279 | 7596 | if ($globalDBdriver == 'mysql') { |
| 7280 | 7597 | $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 |
@@ -7324,7 +7641,9 @@ discard block |
||
| 7324 | 7641 | date_default_timezone_set($globalTimezone); |
| 7325 | 7642 | $datetime = new DateTime($date); |
| 7326 | 7643 | $offset = $datetime->format('P'); |
| 7327 | - } else $offset = '+00:00'; |
|
| 7644 | + } else { |
|
| 7645 | + $offset = '+00:00'; |
|
| 7646 | + } |
|
| 7328 | 7647 | |
| 7329 | 7648 | if ($globalDBdriver == 'mysql') { |
| 7330 | 7649 | $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
@@ -7673,7 +7992,9 @@ discard block |
||
| 7673 | 7992 | } |
| 7674 | 7993 | $query .= " GROUP BY spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country, airport.latitude, airport.longitude |
| 7675 | 7994 | ORDER BY airport_arrival_icao_count DESC"; |
| 7676 | - if ($limit) $query .= " LIMIT 10"; |
|
| 7995 | + if ($limit) { |
|
| 7996 | + $query .= " LIMIT 10"; |
|
| 7997 | + } |
|
| 7677 | 7998 | |
| 7678 | 7999 | |
| 7679 | 8000 | $sth = $this->db->prepare($query); |
@@ -7695,7 +8016,9 @@ discard block |
||
| 7695 | 8016 | if ($icaoaskey) { |
| 7696 | 8017 | $icao = $row['arrival_airport_icao']; |
| 7697 | 8018 | $airport_array[$icao] = $temp_array; |
| 7698 | - } else $airport_array[] = $temp_array; |
|
| 8019 | + } else { |
|
| 8020 | + $airport_array[] = $temp_array; |
|
| 8021 | + } |
|
| 7699 | 8022 | } |
| 7700 | 8023 | |
| 7701 | 8024 | return $airport_array; |
@@ -7732,7 +8055,9 @@ discard block |
||
| 7732 | 8055 | //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
| 7733 | 8056 | $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, countries.iso3 |
| 7734 | 8057 | ORDER BY airport_arrival_icao_count DESC"; |
| 7735 | - if ($limit) $query .= " LIMIT 10"; |
|
| 8058 | + if ($limit) { |
|
| 8059 | + $query .= " LIMIT 10"; |
|
| 8060 | + } |
|
| 7736 | 8061 | |
| 7737 | 8062 | |
| 7738 | 8063 | $sth = $this->db->prepare($query); |
@@ -7754,7 +8079,9 @@ discard block |
||
| 7754 | 8079 | if ($icaoaskey) { |
| 7755 | 8080 | $icao = $row['arrival_airport_icao']; |
| 7756 | 8081 | $airport_array[$icao] = $temp_array; |
| 7757 | - } else $airport_array[] = $temp_array; |
|
| 8082 | + } else { |
|
| 8083 | + $airport_array[] = $temp_array; |
|
| 8084 | + } |
|
| 7758 | 8085 | } |
| 7759 | 8086 | |
| 7760 | 8087 | return $airport_array; |
@@ -7817,7 +8144,9 @@ discard block |
||
| 7817 | 8144 | } |
| 7818 | 8145 | $query .= " GROUP BY spotter_output.real_arrival_airport_icao, airport.name, airport.city, airport.country, airport.latitude, airport.longitude |
| 7819 | 8146 | ORDER BY airport_arrival_icao_count DESC"; |
| 7820 | - if ($limit) $query .= " LIMIT 10"; |
|
| 8147 | + if ($limit) { |
|
| 8148 | + $query .= " LIMIT 10"; |
|
| 8149 | + } |
|
| 7821 | 8150 | |
| 7822 | 8151 | |
| 7823 | 8152 | $sth = $this->db->prepare($query); |
@@ -7836,7 +8165,9 @@ discard block |
||
| 7836 | 8165 | if ($icaoaskey) { |
| 7837 | 8166 | $icao = $row['arrival_airport_icao']; |
| 7838 | 8167 | $airport_array[$icao] = $temp_array; |
| 7839 | - } else $airport_array[] = $temp_array; |
|
| 8168 | + } else { |
|
| 8169 | + $airport_array[] = $temp_array; |
|
| 8170 | + } |
|
| 7840 | 8171 | } |
| 7841 | 8172 | |
| 7842 | 8173 | return $airport_array; |
@@ -7873,7 +8204,9 @@ discard block |
||
| 7873 | 8204 | //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
| 7874 | 8205 | $query .= "GROUP BY spotter_output.airline_icao, spotter_output.real_arrival_airport_icao, airport.name, airport.city, airport.country |
| 7875 | 8206 | ORDER BY airport_arrival_icao_count DESC"; |
| 7876 | - if ($limit) $query .= " LIMIT 10"; |
|
| 8207 | + if ($limit) { |
|
| 8208 | + $query .= " LIMIT 10"; |
|
| 8209 | + } |
|
| 7877 | 8210 | |
| 7878 | 8211 | |
| 7879 | 8212 | $sth = $this->db->prepare($query); |
@@ -7894,7 +8227,9 @@ discard block |
||
| 7894 | 8227 | if ($icaoaskey) { |
| 7895 | 8228 | $icao = $row['arrival_airport_icao']; |
| 7896 | 8229 | $airport_array[$icao] = $temp_array; |
| 7897 | - } else $airport_array[] = $temp_array; |
|
| 8230 | + } else { |
|
| 8231 | + $airport_array[] = $temp_array; |
|
| 8232 | + } |
|
| 7898 | 8233 | } |
| 7899 | 8234 | |
| 7900 | 8235 | return $airport_array; |
@@ -8272,7 +8607,9 @@ discard block |
||
| 8272 | 8607 | date_default_timezone_set($globalTimezone); |
| 8273 | 8608 | $datetime = new DateTime($date); |
| 8274 | 8609 | $offset = $datetime->format('P'); |
| 8275 | - } else $offset = '+00:00'; |
|
| 8610 | + } else { |
|
| 8611 | + $offset = '+00:00'; |
|
| 8612 | + } |
|
| 8276 | 8613 | |
| 8277 | 8614 | if ($globalDBdriver == 'mysql') { |
| 8278 | 8615 | $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 |
@@ -8322,7 +8659,9 @@ discard block |
||
| 8322 | 8659 | date_default_timezone_set($globalTimezone); |
| 8323 | 8660 | $datetime = new DateTime($date); |
| 8324 | 8661 | $offset = $datetime->format('P'); |
| 8325 | - } else $offset = '+00:00'; |
|
| 8662 | + } else { |
|
| 8663 | + $offset = '+00:00'; |
|
| 8664 | + } |
|
| 8326 | 8665 | |
| 8327 | 8666 | if ($globalDBdriver == 'mysql') { |
| 8328 | 8667 | $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
@@ -8713,7 +9052,9 @@ discard block |
||
| 8713 | 9052 | } |
| 8714 | 9053 | $query .= " GROUP BY spotter_output.arrival_airport_country, countries.iso3 |
| 8715 | 9054 | ORDER BY airport_arrival_country_count DESC"; |
| 8716 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
| 9055 | + if ($limit) { |
|
| 9056 | + $query .= " LIMIT 10 OFFSET 0"; |
|
| 9057 | + } |
|
| 8717 | 9058 | |
| 8718 | 9059 | |
| 8719 | 9060 | $sth = $this->db->prepare($query); |
@@ -9001,7 +9342,9 @@ discard block |
||
| 9001 | 9342 | date_default_timezone_set($globalTimezone); |
| 9002 | 9343 | $datetime = new DateTime($date); |
| 9003 | 9344 | $offset = $datetime->format('P'); |
| 9004 | - } else $offset = '+00:00'; |
|
| 9345 | + } else { |
|
| 9346 | + $offset = '+00:00'; |
|
| 9347 | + } |
|
| 9005 | 9348 | |
| 9006 | 9349 | if ($globalDBdriver == 'mysql') { |
| 9007 | 9350 | $query = "SELECT DISTINCT concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao) AS route, count(concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao)) AS route_count, spotter_output.departure_airport_icao, spotter_output.departure_airport_name AS airport_departure_name, spotter_output.departure_airport_city AS airport_departure_city, spotter_output.departure_airport_country AS airport_departure_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name AS airport_arrival_name, spotter_output.arrival_airport_city AS airport_arrival_city, spotter_output.arrival_airport_country AS airport_arrival_country |
@@ -9257,12 +9600,18 @@ discard block |
||
| 9257 | 9600 | $query = "SELECT DISTINCT spotter_output.ident, COUNT(spotter_output.ident) AS callsign_icao_count, spotter_output.airline_name, spotter_output.airline_icao |
| 9258 | 9601 | FROM spotter_output".$filter_query." spotter_output.ident <> ''"; |
| 9259 | 9602 | if ($olderthanmonths > 0) { |
| 9260 | - if ($globalDBdriver == 'mysql') $query .= ' AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH)'; |
|
| 9261 | - else $query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
|
| 9603 | + if ($globalDBdriver == 'mysql') { |
|
| 9604 | + $query .= ' AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH)'; |
|
| 9605 | + } else { |
|
| 9606 | + $query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
|
| 9607 | + } |
|
| 9262 | 9608 | } |
| 9263 | 9609 | if ($sincedate != '') { |
| 9264 | - if ($globalDBdriver == 'mysql') $query .= " AND spotter_output.date > '".$sincedate."'"; |
|
| 9265 | - else $query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
|
| 9610 | + if ($globalDBdriver == 'mysql') { |
|
| 9611 | + $query .= " AND spotter_output.date > '".$sincedate."'"; |
|
| 9612 | + } else { |
|
| 9613 | + $query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
|
| 9614 | + } |
|
| 9266 | 9615 | } |
| 9267 | 9616 | $query_values = array(); |
| 9268 | 9617 | if ($year != '') { |
@@ -9293,7 +9642,9 @@ discard block |
||
| 9293 | 9642 | } |
| 9294 | 9643 | } |
| 9295 | 9644 | $query .= " GROUP BY spotter_output.ident, spotter_output.airline_name, spotter_output.airline_icao ORDER BY callsign_icao_count DESC"; |
| 9296 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
| 9645 | + if ($limit) { |
|
| 9646 | + $query .= " LIMIT 10 OFFSET 0"; |
|
| 9647 | + } |
|
| 9297 | 9648 | |
| 9298 | 9649 | $sth = $this->db->prepare($query); |
| 9299 | 9650 | $sth->execute($query_values); |
@@ -9327,15 +9678,23 @@ discard block |
||
| 9327 | 9678 | $query = "SELECT DISTINCT spotter_output.airline_icao, spotter_output.ident, COUNT(spotter_output.ident) AS callsign_icao_count, spotter_output.airline_name |
| 9328 | 9679 | FROM spotter_output".$filter_query." spotter_output.ident <> '' AND spotter_output.airline_icao <> '' "; |
| 9329 | 9680 | if ($olderthanmonths > 0) { |
| 9330 | - if ($globalDBdriver == 'mysql') $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
| 9331 | - else $query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
|
| 9681 | + if ($globalDBdriver == 'mysql') { |
|
| 9682 | + $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
| 9683 | + } else { |
|
| 9684 | + $query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
|
| 9685 | + } |
|
| 9332 | 9686 | } |
| 9333 | 9687 | if ($sincedate != '') { |
| 9334 | - if ($globalDBdriver == 'mysql') $query .= "AND spotter_output.date > '".$sincedate."' "; |
|
| 9335 | - else $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP) "; |
|
| 9688 | + if ($globalDBdriver == 'mysql') { |
|
| 9689 | + $query .= "AND spotter_output.date > '".$sincedate."' "; |
|
| 9690 | + } else { |
|
| 9691 | + $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP) "; |
|
| 9692 | + } |
|
| 9336 | 9693 | } |
| 9337 | 9694 | $query .= "GROUP BY spotter_output.airline_icao, spotter_output.ident, spotter_output.airline_name, spotter_output.airline_icao ORDER BY callsign_icao_count DESC"; |
| 9338 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
| 9695 | + if ($limit) { |
|
| 9696 | + $query .= " LIMIT 10 OFFSET 0"; |
|
| 9697 | + } |
|
| 9339 | 9698 | |
| 9340 | 9699 | $sth = $this->db->prepare($query); |
| 9341 | 9700 | $sth->execute(); |
@@ -9372,7 +9731,9 @@ discard block |
||
| 9372 | 9731 | date_default_timezone_set($globalTimezone); |
| 9373 | 9732 | $datetime = new DateTime(); |
| 9374 | 9733 | $offset = $datetime->format('P'); |
| 9375 | - } else $offset = '+00:00'; |
|
| 9734 | + } else { |
|
| 9735 | + $offset = '+00:00'; |
|
| 9736 | + } |
|
| 9376 | 9737 | |
| 9377 | 9738 | if ($globalDBdriver == 'mysql') { |
| 9378 | 9739 | $query = "SELECT DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS date_name, count(*) as date_count |
@@ -9421,7 +9782,9 @@ discard block |
||
| 9421 | 9782 | date_default_timezone_set($globalTimezone); |
| 9422 | 9783 | $datetime = new DateTime(); |
| 9423 | 9784 | $offset = $datetime->format('P'); |
| 9424 | - } else $offset = '+00:00'; |
|
| 9785 | + } else { |
|
| 9786 | + $offset = '+00:00'; |
|
| 9787 | + } |
|
| 9425 | 9788 | $filter_query = $this->getFilter($filters,true,true); |
| 9426 | 9789 | if ($globalDBdriver == 'mysql') { |
| 9427 | 9790 | $query = "SELECT spotter_output.airline_icao, DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS date_name, count(*) as date_count |
@@ -9470,7 +9833,9 @@ discard block |
||
| 9470 | 9833 | date_default_timezone_set($globalTimezone); |
| 9471 | 9834 | $datetime = new DateTime(); |
| 9472 | 9835 | $offset = $datetime->format('P'); |
| 9473 | - } else $offset = '+00:00'; |
|
| 9836 | + } else { |
|
| 9837 | + $offset = '+00:00'; |
|
| 9838 | + } |
|
| 9474 | 9839 | $filter_query = $this->getFilter($filters,true,true); |
| 9475 | 9840 | if ($globalDBdriver == 'mysql') { |
| 9476 | 9841 | $query = "SELECT DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS date_name, count(*) as date_count |
@@ -9516,7 +9881,9 @@ discard block |
||
| 9516 | 9881 | date_default_timezone_set($globalTimezone); |
| 9517 | 9882 | $datetime = new DateTime(); |
| 9518 | 9883 | $offset = $datetime->format('P'); |
| 9519 | - } else $offset = '+00:00'; |
|
| 9884 | + } else { |
|
| 9885 | + $offset = '+00:00'; |
|
| 9886 | + } |
|
| 9520 | 9887 | $filter_query = $this->getFilter($filters,true,true); |
| 9521 | 9888 | if ($globalDBdriver == 'mysql') { |
| 9522 | 9889 | $query = "SELECT DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS date_name, count(*) as date_count |
@@ -9564,7 +9931,9 @@ discard block |
||
| 9564 | 9931 | date_default_timezone_set($globalTimezone); |
| 9565 | 9932 | $datetime = new DateTime(); |
| 9566 | 9933 | $offset = $datetime->format('P'); |
| 9567 | - } else $offset = '+00:00'; |
|
| 9934 | + } else { |
|
| 9935 | + $offset = '+00:00'; |
|
| 9936 | + } |
|
| 9568 | 9937 | |
| 9569 | 9938 | if ($globalDBdriver == 'mysql') { |
| 9570 | 9939 | $query = "SELECT spotter_output.airline_icao, DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS date_name, count(*) as date_count |
@@ -9612,7 +9981,9 @@ discard block |
||
| 9612 | 9981 | date_default_timezone_set($globalTimezone); |
| 9613 | 9982 | $datetime = new DateTime(); |
| 9614 | 9983 | $offset = $datetime->format('P'); |
| 9615 | - } else $offset = '+00:00'; |
|
| 9984 | + } else { |
|
| 9985 | + $offset = '+00:00'; |
|
| 9986 | + } |
|
| 9616 | 9987 | |
| 9617 | 9988 | if ($globalDBdriver == 'mysql') { |
| 9618 | 9989 | $query = "SELECT YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(*) as date_count |
@@ -9659,7 +10030,9 @@ discard block |
||
| 9659 | 10030 | date_default_timezone_set($globalTimezone); |
| 9660 | 10031 | $datetime = new DateTime(); |
| 9661 | 10032 | $offset = $datetime->format('P'); |
| 9662 | - } else $offset = '+00:00'; |
|
| 10033 | + } else { |
|
| 10034 | + $offset = '+00:00'; |
|
| 10035 | + } |
|
| 9663 | 10036 | |
| 9664 | 10037 | if ($globalDBdriver == 'mysql') { |
| 9665 | 10038 | $query = "SELECT spotter_output.airline_icao, YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(*) as date_count |
@@ -9707,7 +10080,9 @@ discard block |
||
| 9707 | 10080 | date_default_timezone_set($globalTimezone); |
| 9708 | 10081 | $datetime = new DateTime(); |
| 9709 | 10082 | $offset = $datetime->format('P'); |
| 9710 | - } else $offset = '+00:00'; |
|
| 10083 | + } else { |
|
| 10084 | + $offset = '+00:00'; |
|
| 10085 | + } |
|
| 9711 | 10086 | $filter_query = $this->getFilter($filters,true,true); |
| 9712 | 10087 | if ($globalDBdriver == 'mysql') { |
| 9713 | 10088 | $query = "SELECT YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(*) as date_count |
@@ -9752,7 +10127,9 @@ discard block |
||
| 9752 | 10127 | date_default_timezone_set($globalTimezone); |
| 9753 | 10128 | $datetime = new DateTime(); |
| 9754 | 10129 | $offset = $datetime->format('P'); |
| 9755 | - } else $offset = '+00:00'; |
|
| 10130 | + } else { |
|
| 10131 | + $offset = '+00:00'; |
|
| 10132 | + } |
|
| 9756 | 10133 | $filter_query = $this->getFilter($filters,true,true); |
| 9757 | 10134 | |
| 9758 | 10135 | if ($globalDBdriver == 'mysql') { |
@@ -9799,7 +10176,9 @@ discard block |
||
| 9799 | 10176 | date_default_timezone_set($globalTimezone); |
| 9800 | 10177 | $datetime = new DateTime(); |
| 9801 | 10178 | $offset = $datetime->format('P'); |
| 9802 | - } else $offset = '+00:00'; |
|
| 10179 | + } else { |
|
| 10180 | + $offset = '+00:00'; |
|
| 10181 | + } |
|
| 9803 | 10182 | |
| 9804 | 10183 | if ($globalDBdriver == 'mysql') { |
| 9805 | 10184 | $query = "SELECT spotter_output.airline_icao, YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(distinct owner_name) as date_count |
@@ -9845,7 +10224,9 @@ discard block |
||
| 9845 | 10224 | date_default_timezone_set($globalTimezone); |
| 9846 | 10225 | $datetime = new DateTime(); |
| 9847 | 10226 | $offset = $datetime->format('P'); |
| 9848 | - } else $offset = '+00:00'; |
|
| 10227 | + } else { |
|
| 10228 | + $offset = '+00:00'; |
|
| 10229 | + } |
|
| 9849 | 10230 | $filter_query = $this->getFilter($filters,true,true); |
| 9850 | 10231 | |
| 9851 | 10232 | if ($globalDBdriver == 'mysql') { |
@@ -9892,7 +10273,9 @@ discard block |
||
| 9892 | 10273 | date_default_timezone_set($globalTimezone); |
| 9893 | 10274 | $datetime = new DateTime(); |
| 9894 | 10275 | $offset = $datetime->format('P'); |
| 9895 | - } else $offset = '+00:00'; |
|
| 10276 | + } else { |
|
| 10277 | + $offset = '+00:00'; |
|
| 10278 | + } |
|
| 9896 | 10279 | |
| 9897 | 10280 | if ($globalDBdriver == 'mysql') { |
| 9898 | 10281 | $query = "SELECT spotter_output.airline_icao, YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(distinct pilot_id) as date_count |
@@ -9939,7 +10322,9 @@ discard block |
||
| 9939 | 10322 | date_default_timezone_set($globalTimezone); |
| 9940 | 10323 | $datetime = new DateTime(); |
| 9941 | 10324 | $offset = $datetime->format('P'); |
| 9942 | - } else $offset = '+00:00'; |
|
| 10325 | + } else { |
|
| 10326 | + $offset = '+00:00'; |
|
| 10327 | + } |
|
| 9943 | 10328 | |
| 9944 | 10329 | if ($globalDBdriver == 'mysql') { |
| 9945 | 10330 | $query = "SELECT YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(distinct airline_icao) as date_count |
@@ -9984,7 +10369,9 @@ discard block |
||
| 9984 | 10369 | date_default_timezone_set($globalTimezone); |
| 9985 | 10370 | $datetime = new DateTime(); |
| 9986 | 10371 | $offset = $datetime->format('P'); |
| 9987 | - } else $offset = '+00:00'; |
|
| 10372 | + } else { |
|
| 10373 | + $offset = '+00:00'; |
|
| 10374 | + } |
|
| 9988 | 10375 | $filter_query = $this->getFilter($filters,true,true); |
| 9989 | 10376 | |
| 9990 | 10377 | if ($globalDBdriver == 'mysql') { |
@@ -10032,7 +10419,9 @@ discard block |
||
| 10032 | 10419 | date_default_timezone_set($globalTimezone); |
| 10033 | 10420 | $datetime = new DateTime(); |
| 10034 | 10421 | $offset = $datetime->format('P'); |
| 10035 | - } else $offset = '+00:00'; |
|
| 10422 | + } else { |
|
| 10423 | + $offset = '+00:00'; |
|
| 10424 | + } |
|
| 10036 | 10425 | |
| 10037 | 10426 | if ($globalDBdriver == 'mysql') { |
| 10038 | 10427 | $query = "SELECT spotter_output.airline_icao,YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(distinct aircraft_icao) as date_count |
@@ -10078,7 +10467,9 @@ discard block |
||
| 10078 | 10467 | date_default_timezone_set($globalTimezone); |
| 10079 | 10468 | $datetime = new DateTime(); |
| 10080 | 10469 | $offset = $datetime->format('P'); |
| 10081 | - } else $offset = '+00:00'; |
|
| 10470 | + } else { |
|
| 10471 | + $offset = '+00:00'; |
|
| 10472 | + } |
|
| 10082 | 10473 | $filter_query = $this->getFilter($filters,true,true); |
| 10083 | 10474 | |
| 10084 | 10475 | if ($globalDBdriver == 'mysql') { |
@@ -10126,7 +10517,9 @@ discard block |
||
| 10126 | 10517 | date_default_timezone_set($globalTimezone); |
| 10127 | 10518 | $datetime = new DateTime(); |
| 10128 | 10519 | $offset = $datetime->format('P'); |
| 10129 | - } else $offset = '+00:00'; |
|
| 10520 | + } else { |
|
| 10521 | + $offset = '+00:00'; |
|
| 10522 | + } |
|
| 10130 | 10523 | |
| 10131 | 10524 | if ($globalDBdriver == 'mysql') { |
| 10132 | 10525 | $query = "SELECT spotter_output.airline_icao, YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(real_arrival_airport_icao) as date_count |
@@ -10173,7 +10566,9 @@ discard block |
||
| 10173 | 10566 | date_default_timezone_set($globalTimezone); |
| 10174 | 10567 | $datetime = new DateTime(); |
| 10175 | 10568 | $offset = $datetime->format('P'); |
| 10176 | - } else $offset = '+00:00'; |
|
| 10569 | + } else { |
|
| 10570 | + $offset = '+00:00'; |
|
| 10571 | + } |
|
| 10177 | 10572 | $filter_query = $this->getFilter($filters,true,true); |
| 10178 | 10573 | if ($globalDBdriver == 'mysql') { |
| 10179 | 10574 | $query = "SELECT MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name, count(*) as date_count |
@@ -10222,7 +10617,9 @@ discard block |
||
| 10222 | 10617 | date_default_timezone_set($globalTimezone); |
| 10223 | 10618 | $datetime = new DateTime(); |
| 10224 | 10619 | $offset = $datetime->format('P'); |
| 10225 | - } else $offset = '+00:00'; |
|
| 10620 | + } else { |
|
| 10621 | + $offset = '+00:00'; |
|
| 10622 | + } |
|
| 10226 | 10623 | |
| 10227 | 10624 | $orderby_sql = ''; |
| 10228 | 10625 | if ($orderby == "hour") |
@@ -10288,7 +10685,9 @@ discard block |
||
| 10288 | 10685 | date_default_timezone_set($globalTimezone); |
| 10289 | 10686 | $datetime = new DateTime(); |
| 10290 | 10687 | $offset = $datetime->format('P'); |
| 10291 | - } else $offset = '+00:00'; |
|
| 10688 | + } else { |
|
| 10689 | + $offset = '+00:00'; |
|
| 10690 | + } |
|
| 10292 | 10691 | |
| 10293 | 10692 | $orderby_sql = ''; |
| 10294 | 10693 | if ($orderby == "hour") |
@@ -10355,7 +10754,9 @@ discard block |
||
| 10355 | 10754 | date_default_timezone_set($globalTimezone); |
| 10356 | 10755 | $datetime = new DateTime(); |
| 10357 | 10756 | $offset = $datetime->format('P'); |
| 10358 | - } else $offset = '+00:00'; |
|
| 10757 | + } else { |
|
| 10758 | + $offset = '+00:00'; |
|
| 10759 | + } |
|
| 10359 | 10760 | |
| 10360 | 10761 | $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING); |
| 10361 | 10762 | |
@@ -10406,7 +10807,9 @@ discard block |
||
| 10406 | 10807 | date_default_timezone_set($globalTimezone); |
| 10407 | 10808 | $datetime = new DateTime(); |
| 10408 | 10809 | $offset = $datetime->format('P'); |
| 10409 | - } else $offset = '+00:00'; |
|
| 10810 | + } else { |
|
| 10811 | + $offset = '+00:00'; |
|
| 10812 | + } |
|
| 10410 | 10813 | |
| 10411 | 10814 | if ($globalDBdriver == 'mysql') { |
| 10412 | 10815 | $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
@@ -10453,7 +10856,9 @@ discard block |
||
| 10453 | 10856 | date_default_timezone_set($globalTimezone); |
| 10454 | 10857 | $datetime = new DateTime(); |
| 10455 | 10858 | $offset = $datetime->format('P'); |
| 10456 | - } else $offset = '+00:00'; |
|
| 10859 | + } else { |
|
| 10860 | + $offset = '+00:00'; |
|
| 10861 | + } |
|
| 10457 | 10862 | |
| 10458 | 10863 | if ($globalDBdriver == 'mysql') { |
| 10459 | 10864 | $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
@@ -10500,7 +10905,9 @@ discard block |
||
| 10500 | 10905 | date_default_timezone_set($globalTimezone); |
| 10501 | 10906 | $datetime = new DateTime(); |
| 10502 | 10907 | $offset = $datetime->format('P'); |
| 10503 | - } else $offset = '+00:00'; |
|
| 10908 | + } else { |
|
| 10909 | + $offset = '+00:00'; |
|
| 10910 | + } |
|
| 10504 | 10911 | |
| 10505 | 10912 | if ($globalDBdriver == 'mysql') { |
| 10506 | 10913 | $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
@@ -10548,7 +10955,9 @@ discard block |
||
| 10548 | 10955 | date_default_timezone_set($globalTimezone); |
| 10549 | 10956 | $datetime = new DateTime(); |
| 10550 | 10957 | $offset = $datetime->format('P'); |
| 10551 | - } else $offset = '+00:00'; |
|
| 10958 | + } else { |
|
| 10959 | + $offset = '+00:00'; |
|
| 10960 | + } |
|
| 10552 | 10961 | |
| 10553 | 10962 | if ($globalDBdriver == 'mysql') { |
| 10554 | 10963 | $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
@@ -10596,7 +11005,9 @@ discard block |
||
| 10596 | 11005 | date_default_timezone_set($globalTimezone); |
| 10597 | 11006 | $datetime = new DateTime($date); |
| 10598 | 11007 | $offset = $datetime->format('P'); |
| 10599 | - } else $offset = '+00:00'; |
|
| 11008 | + } else { |
|
| 11009 | + $offset = '+00:00'; |
|
| 11010 | + } |
|
| 10600 | 11011 | |
| 10601 | 11012 | if ($globalDBdriver == 'mysql') { |
| 10602 | 11013 | $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
@@ -10644,7 +11055,9 @@ discard block |
||
| 10644 | 11055 | date_default_timezone_set($globalTimezone); |
| 10645 | 11056 | $datetime = new DateTime(); |
| 10646 | 11057 | $offset = $datetime->format('P'); |
| 10647 | - } else $offset = '+00:00'; |
|
| 11058 | + } else { |
|
| 11059 | + $offset = '+00:00'; |
|
| 11060 | + } |
|
| 10648 | 11061 | |
| 10649 | 11062 | if ($globalDBdriver == 'mysql') { |
| 10650 | 11063 | $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
@@ -10691,7 +11104,9 @@ discard block |
||
| 10691 | 11104 | date_default_timezone_set($globalTimezone); |
| 10692 | 11105 | $datetime = new DateTime(); |
| 10693 | 11106 | $offset = $datetime->format('P'); |
| 10694 | - } else $offset = '+00:00'; |
|
| 11107 | + } else { |
|
| 11108 | + $offset = '+00:00'; |
|
| 11109 | + } |
|
| 10695 | 11110 | |
| 10696 | 11111 | if ($globalDBdriver == 'mysql') { |
| 10697 | 11112 | $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
@@ -10738,7 +11153,9 @@ discard block |
||
| 10738 | 11153 | date_default_timezone_set($globalTimezone); |
| 10739 | 11154 | $datetime = new DateTime(); |
| 10740 | 11155 | $offset = $datetime->format('P'); |
| 10741 | - } else $offset = '+00:00'; |
|
| 11156 | + } else { |
|
| 11157 | + $offset = '+00:00'; |
|
| 11158 | + } |
|
| 10742 | 11159 | |
| 10743 | 11160 | if ($globalDBdriver == 'mysql') { |
| 10744 | 11161 | $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
@@ -10788,7 +11205,9 @@ discard block |
||
| 10788 | 11205 | date_default_timezone_set($globalTimezone); |
| 10789 | 11206 | $datetime = new DateTime(); |
| 10790 | 11207 | $offset = $datetime->format('P'); |
| 10791 | - } else $offset = '+00:00'; |
|
| 11208 | + } else { |
|
| 11209 | + $offset = '+00:00'; |
|
| 11210 | + } |
|
| 10792 | 11211 | |
| 10793 | 11212 | if ($globalDBdriver == 'mysql') { |
| 10794 | 11213 | $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
@@ -10835,7 +11254,9 @@ discard block |
||
| 10835 | 11254 | date_default_timezone_set($globalTimezone); |
| 10836 | 11255 | $datetime = new DateTime(); |
| 10837 | 11256 | $offset = $datetime->format('P'); |
| 10838 | - } else $offset = '+00:00'; |
|
| 11257 | + } else { |
|
| 11258 | + $offset = '+00:00'; |
|
| 11259 | + } |
|
| 10839 | 11260 | |
| 10840 | 11261 | if ($globalDBdriver == 'mysql') { |
| 10841 | 11262 | $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
@@ -11046,8 +11467,11 @@ discard block |
||
| 11046 | 11467 | $query_values = array_merge($query_values,array(':month' => $month)); |
| 11047 | 11468 | } |
| 11048 | 11469 | } |
| 11049 | - if (empty($query_values)) $queryi .= $this->getFilter($filters); |
|
| 11050 | - else $queryi .= $this->getFilter($filters,true,true).substr($query,4); |
|
| 11470 | + if (empty($query_values)) { |
|
| 11471 | + $queryi .= $this->getFilter($filters); |
|
| 11472 | + } else { |
|
| 11473 | + $queryi .= $this->getFilter($filters,true,true).substr($query,4); |
|
| 11474 | + } |
|
| 11051 | 11475 | |
| 11052 | 11476 | $sth = $this->db->prepare($queryi); |
| 11053 | 11477 | $sth->execute($query_values); |
@@ -11125,8 +11549,11 @@ discard block |
||
| 11125 | 11549 | $query_values = array_merge($query_values,array(':month' => $month)); |
| 11126 | 11550 | } |
| 11127 | 11551 | } |
| 11128 | - if ($query == '') $queryi .= $this->getFilter($filters); |
|
| 11129 | - else $queryi .= $this->getFilter($filters,true,true).substr($query,4); |
|
| 11552 | + if ($query == '') { |
|
| 11553 | + $queryi .= $this->getFilter($filters); |
|
| 11554 | + } else { |
|
| 11555 | + $queryi .= $this->getFilter($filters,true,true).substr($query,4); |
|
| 11556 | + } |
|
| 11130 | 11557 | |
| 11131 | 11558 | |
| 11132 | 11559 | $sth = $this->db->prepare($queryi); |
@@ -11149,7 +11576,9 @@ discard block |
||
| 11149 | 11576 | date_default_timezone_set($globalTimezone); |
| 11150 | 11577 | $datetime = new DateTime(); |
| 11151 | 11578 | $offset = $datetime->format('P'); |
| 11152 | - } else $offset = '+00:00'; |
|
| 11579 | + } else { |
|
| 11580 | + $offset = '+00:00'; |
|
| 11581 | + } |
|
| 11153 | 11582 | |
| 11154 | 11583 | if ($globalDBdriver == 'mysql') { |
| 11155 | 11584 | $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
@@ -11335,7 +11764,9 @@ discard block |
||
| 11335 | 11764 | */ |
| 11336 | 11765 | public function parseDirection($direction = 0) |
| 11337 | 11766 | { |
| 11338 | - if ($direction == '') $direction = 0; |
|
| 11767 | + if ($direction == '') { |
|
| 11768 | + $direction = 0; |
|
| 11769 | + } |
|
| 11339 | 11770 | $direction_array = array(); |
| 11340 | 11771 | $temp_array = array(); |
| 11341 | 11772 | |
@@ -11436,7 +11867,9 @@ discard block |
||
| 11436 | 11867 | if (isset($result->AirlineFlightInfoResult)) |
| 11437 | 11868 | { |
| 11438 | 11869 | $registration = $result->AirlineFlightInfoResult->tailnumber; |
| 11439 | - } else return ''; |
|
| 11870 | + } else { |
|
| 11871 | + return ''; |
|
| 11872 | + } |
|
| 11440 | 11873 | |
| 11441 | 11874 | $registration = $this->convertAircraftRegistration($registration); |
| 11442 | 11875 | |
@@ -11470,7 +11903,9 @@ discard block |
||
| 11470 | 11903 | return $row['registration']; |
| 11471 | 11904 | } elseif ($source_type == 'flarm') { |
| 11472 | 11905 | return $this->getAircraftRegistrationBymodeS($aircraft_modes); |
| 11473 | - } else return ''; |
|
| 11906 | + } else { |
|
| 11907 | + return ''; |
|
| 11908 | + } |
|
| 11474 | 11909 | |
| 11475 | 11910 | } |
| 11476 | 11911 | |
@@ -11497,11 +11932,16 @@ discard block |
||
| 11497 | 11932 | $row = $sth->fetch(PDO::FETCH_ASSOC); |
| 11498 | 11933 | $sth->closeCursor(); |
| 11499 | 11934 | if (count($row) > 0) { |
| 11500 | - if ($row['type_flight'] == null) return ''; |
|
| 11501 | - else return $row['type_flight']; |
|
| 11935 | + if ($row['type_flight'] == null) { |
|
| 11936 | + return ''; |
|
| 11937 | + } else { |
|
| 11938 | + return $row['type_flight']; |
|
| 11939 | + } |
|
| 11502 | 11940 | } elseif ($source_type == 'flarm') { |
| 11503 | 11941 | return $this->getAircraftTypeBymodeS($aircraft_modes); |
| 11504 | - } else return ''; |
|
| 11942 | + } else { |
|
| 11943 | + return ''; |
|
| 11944 | + } |
|
| 11505 | 11945 | |
| 11506 | 11946 | } |
| 11507 | 11947 | |
@@ -11519,7 +11959,9 @@ discard block |
||
| 11519 | 11959 | $longitude = filter_var($longitude,FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
| 11520 | 11960 | |
| 11521 | 11961 | $Connection = new Connection($this->db); |
| 11522 | - if (!$Connection->tableExists('countries')) return ''; |
|
| 11962 | + if (!$Connection->tableExists('countries')) { |
|
| 11963 | + return ''; |
|
| 11964 | + } |
|
| 11523 | 11965 | |
| 11524 | 11966 | try { |
| 11525 | 11967 | /* |
@@ -11539,9 +11981,13 @@ discard block |
||
| 11539 | 11981 | $sth->closeCursor(); |
| 11540 | 11982 | if (count($row) > 0) { |
| 11541 | 11983 | return $row; |
| 11542 | - } else return ''; |
|
| 11984 | + } else { |
|
| 11985 | + return ''; |
|
| 11986 | + } |
|
| 11543 | 11987 | } catch (PDOException $e) { |
| 11544 | - if (isset($globalDebug) && $globalDebug) echo 'Error : '.$e->getMessage()."\n"; |
|
| 11988 | + if (isset($globalDebug) && $globalDebug) { |
|
| 11989 | + echo 'Error : '.$e->getMessage()."\n"; |
|
| 11990 | + } |
|
| 11545 | 11991 | return ''; |
| 11546 | 11992 | } |
| 11547 | 11993 | |
@@ -11559,7 +12005,9 @@ discard block |
||
| 11559 | 12005 | $iso2 = filter_var($iso2,FILTER_SANITIZE_STRING); |
| 11560 | 12006 | |
| 11561 | 12007 | $Connection = new Connection($this->db); |
| 11562 | - if (!$Connection->tableExists('countries')) return ''; |
|
| 12008 | + if (!$Connection->tableExists('countries')) { |
|
| 12009 | + return ''; |
|
| 12010 | + } |
|
| 11563 | 12011 | |
| 11564 | 12012 | try { |
| 11565 | 12013 | $query = "SELECT name,iso2,iso3 FROM countries WHERE iso2 = :iso2 LIMIT 1"; |
@@ -11571,9 +12019,13 @@ discard block |
||
| 11571 | 12019 | $sth->closeCursor(); |
| 11572 | 12020 | if (count($row) > 0) { |
| 11573 | 12021 | return $row; |
| 11574 | - } else return ''; |
|
| 12022 | + } else { |
|
| 12023 | + return ''; |
|
| 12024 | + } |
|
| 11575 | 12025 | } catch (PDOException $e) { |
| 11576 | - if (isset($globalDebug) && $globalDebug) echo 'Error : '.$e->getMessage()."\n"; |
|
| 12026 | + if (isset($globalDebug) && $globalDebug) { |
|
| 12027 | + echo 'Error : '.$e->getMessage()."\n"; |
|
| 12028 | + } |
|
| 11577 | 12029 | return ''; |
| 11578 | 12030 | } |
| 11579 | 12031 | |
@@ -11823,7 +12275,9 @@ discard block |
||
| 11823 | 12275 | { |
| 11824 | 12276 | global $globalBitlyAccessToken; |
| 11825 | 12277 | |
| 11826 | - if ($globalBitlyAccessToken == '') return $url; |
|
| 12278 | + if ($globalBitlyAccessToken == '') { |
|
| 12279 | + return $url; |
|
| 12280 | + } |
|
| 11827 | 12281 | |
| 11828 | 12282 | $google_url = 'https://api-ssl.bitly.com/v3/shorten?access_token='.$globalBitlyAccessToken.'&longUrl='.$url; |
| 11829 | 12283 | |
@@ -11972,7 +12426,9 @@ discard block |
||
| 11972 | 12426 | |
| 11973 | 12427 | |
| 11974 | 12428 | // routes |
| 11975 | - if ($globalDebug) print "Routes...\n"; |
|
| 12429 | + if ($globalDebug) { |
|
| 12430 | + print "Routes...\n"; |
|
| 12431 | + } |
|
| 11976 | 12432 | if ($globalDBdriver == 'mysql') { |
| 11977 | 12433 | $query = "SELECT spotter_output.spotter_id, routes.FromAirport_ICAO, routes.ToAirport_ICAO FROM spotter_output, routes WHERE spotter_output.ident = routes.CallSign AND ( spotter_output.departure_airport_icao != routes.FromAirport_ICAO OR spotter_output.arrival_airport_icao != routes.ToAirport_ICAO) AND routes.FromAirport_ICAO != '' AND spotter_output.date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 15 DAY)"; |
| 11978 | 12434 | } else { |
@@ -11991,7 +12447,9 @@ discard block |
||
| 11991 | 12447 | } |
| 11992 | 12448 | } |
| 11993 | 12449 | |
| 11994 | - if ($globalDebug) print "Airlines...\n"; |
|
| 12450 | + if ($globalDebug) { |
|
| 12451 | + print "Airlines...\n"; |
|
| 12452 | + } |
|
| 11995 | 12453 | //airlines |
| 11996 | 12454 | if ($globalDBdriver == 'mysql') { |
| 11997 | 12455 | $query = "SELECT spotter_output.spotter_id, spotter_output.ident FROM spotter_output WHERE (spotter_output.airline_name = '' OR spotter_output.airline_name = 'Not Available') AND spotter_output.date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 15 DAY)"; |
@@ -12005,10 +12463,15 @@ discard block |
||
| 12005 | 12463 | if (is_numeric(substr($row['ident'], -1, 1))) |
| 12006 | 12464 | { |
| 12007 | 12465 | $fromsource = NULL; |
| 12008 | - if (isset($row['format_source']) && $row['format_source'] == 'vatsimtxt') $fromsource = 'vatsim'; |
|
| 12009 | - elseif (isset($row['format_source']) && $row['format_source'] == 'whazzup') $fromsource = 'ivao'; |
|
| 12010 | - elseif (isset($globalVATSIM) && $globalVATSIM) $fromsource = 'vatsim'; |
|
| 12011 | - elseif (isset($globalIVAO) && $globalIVAO) $fromsource = 'ivao'; |
|
| 12466 | + if (isset($row['format_source']) && $row['format_source'] == 'vatsimtxt') { |
|
| 12467 | + $fromsource = 'vatsim'; |
|
| 12468 | + } elseif (isset($row['format_source']) && $row['format_source'] == 'whazzup') { |
|
| 12469 | + $fromsource = 'ivao'; |
|
| 12470 | + } elseif (isset($globalVATSIM) && $globalVATSIM) { |
|
| 12471 | + $fromsource = 'vatsim'; |
|
| 12472 | + } elseif (isset($globalIVAO) && $globalIVAO) { |
|
| 12473 | + $fromsource = 'ivao'; |
|
| 12474 | + } |
|
| 12012 | 12475 | $airline_array = $this->getAllAirlineInfo(substr($row['ident'], 0, 3),$fromsource); |
| 12013 | 12476 | if (isset($airline_array[0]['name'])) { |
| 12014 | 12477 | $update_query = "UPDATE spotter_output SET spotter_output.airline_name = :airline_name, spotter_output.airline_icao = :airline_icao, spotter_output.airline_country = :airline_country, spotter_output.airline_type = :airline_type WHERE spotter_output.spotter_id = :spotter_id"; |
@@ -12018,13 +12481,17 @@ discard block |
||
| 12018 | 12481 | } |
| 12019 | 12482 | } |
| 12020 | 12483 | |
| 12021 | - if ($globalDebug) print "Remove Duplicate in aircraft_modes...\n"; |
|
| 12484 | + if ($globalDebug) { |
|
| 12485 | + print "Remove Duplicate in aircraft_modes...\n"; |
|
| 12486 | + } |
|
| 12022 | 12487 | //duplicate modes |
| 12023 | 12488 | $query = "DELETE aircraft_modes FROM aircraft_modes LEFT OUTER JOIN (SELECT max(`AircraftID`) as `AircraftID`,`ModeS` FROM `aircraft_modes` group by ModeS) as KeepRows ON aircraft_modes.AircraftID = KeepRows.AircraftID WHERE KeepRows.AircraftID IS NULL"; |
| 12024 | 12489 | $sth = $this->db->prepare($query); |
| 12025 | 12490 | $sth->execute(); |
| 12026 | 12491 | |
| 12027 | - if ($globalDebug) print "Aircraft...\n"; |
|
| 12492 | + if ($globalDebug) { |
|
| 12493 | + print "Aircraft...\n"; |
|
| 12494 | + } |
|
| 12028 | 12495 | //aircraft |
| 12029 | 12496 | if ($globalDBdriver == 'mysql') { |
| 12030 | 12497 | $query = "SELECT spotter_output.spotter_id, spotter_output.aircraft_icao, spotter_output.registration FROM spotter_output WHERE (spotter_output.aircraft_name = '' OR spotter_output.aircraft_name = 'Not Available') AND spotter_output.date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 7 DAY)"; |
@@ -12067,26 +12534,38 @@ discard block |
||
| 12067 | 12534 | if (isset($closestAirports[0])) { |
| 12068 | 12535 | if ($row['arrival_airport_icao'] == $closestAirports[0]['icao']) { |
| 12069 | 12536 | $airport_icao = $closestAirports[0]['icao']; |
| 12070 | - if ($globalDebug) echo "\o/ 1st ---++ Find arrival airport. airport_icao : ".$airport_icao."\n"; |
|
| 12537 | + if ($globalDebug) { |
|
| 12538 | + echo "\o/ 1st ---++ Find arrival airport. airport_icao : ".$airport_icao."\n"; |
|
| 12539 | + } |
|
| 12071 | 12540 | } elseif (count($closestAirports > 1) && $row['arrival_airport_icao'] != '' && $row['arrival_airport_icao'] != 'NA') { |
| 12072 | 12541 | foreach ($closestAirports as $airport) { |
| 12073 | 12542 | if ($row['arrival_airport_icao'] == $airport['icao']) { |
| 12074 | 12543 | $airport_icao = $airport['icao']; |
| 12075 | - if ($globalDebug) echo "\o/ try --++ Find arrival airport. airport_icao : ".$airport_icao."\n"; |
|
| 12544 | + if ($globalDebug) { |
|
| 12545 | + echo "\o/ try --++ Find arrival airport. airport_icao : ".$airport_icao."\n"; |
|
| 12546 | + } |
|
| 12076 | 12547 | break; |
| 12077 | 12548 | } |
| 12078 | 12549 | } |
| 12079 | 12550 | } elseif ($row['last_altitude'] == 0 || ($row['last_altitude'] != '' && ($closestAirports[0]['altitude'] <= $row['last_altitude']*100+1000 && $row['last_altitude']*100 < $closestAirports[0]['altitude']+5000))) { |
| 12080 | 12551 | $airport_icao = $closestAirports[0]['icao']; |
| 12081 | - if ($globalDebug) echo "\o/ NP --++ Find arrival airport. Airport ICAO : ".$airport_icao." ! Latitude : ".$row['last_latitude'].' - Longitude : '.$row['last_longitude'].' - MinDist : '.$globalClosestMinDist." - Airport altitude : ".$closestAirports[0]['altitude'].' - flight altitude : '.($row['last_altitude']*100)."\n"; |
|
| 12552 | + if ($globalDebug) { |
|
| 12553 | + echo "\o/ NP --++ Find arrival airport. Airport ICAO : ".$airport_icao." ! Latitude : ".$row['last_latitude'].' - Longitude : '.$row['last_longitude'].' - MinDist : '.$globalClosestMinDist." - Airport altitude : ".$closestAirports[0]['altitude'].' - flight altitude : '.($row['last_altitude']*100)."\n"; |
|
| 12554 | + } |
|
| 12082 | 12555 | } else { |
| 12083 | - if ($globalDebug) echo "----- Can't find arrival airport. Latitude : ".$row['last_latitude'].' - Longitude : '.$row['last_longitude'].' - MinDist : '.$globalClosestMinDist." - Airport altitude : ".$closestAirports[0]['altitude'].' - flight altitude : '.($row['last_altitude']*100)."\n"; |
|
| 12556 | + if ($globalDebug) { |
|
| 12557 | + echo "----- Can't find arrival airport. Latitude : ".$row['last_latitude'].' - Longitude : '.$row['last_longitude'].' - MinDist : '.$globalClosestMinDist." - Airport altitude : ".$closestAirports[0]['altitude'].' - flight altitude : '.($row['last_altitude']*100)."\n"; |
|
| 12558 | + } |
|
| 12084 | 12559 | } |
| 12085 | 12560 | } else { |
| 12086 | - if ($globalDebug) echo "----- No Airport near last coord. Latitude : ".$row['last_latitude'].' - Longitude : '.$row['last_longitude'].' - MinDist : '.$globalClosestMinDist."\n"; |
|
| 12561 | + if ($globalDebug) { |
|
| 12562 | + echo "----- No Airport near last coord. Latitude : ".$row['last_latitude'].' - Longitude : '.$row['last_longitude'].' - MinDist : '.$globalClosestMinDist."\n"; |
|
| 12563 | + } |
|
| 12087 | 12564 | } |
| 12088 | 12565 | if ($row['real_arrival_airport_icao'] != $airport_icao) { |
| 12089 | - if ($globalDebug) echo "Updating airport to ".$airport_icao."...\n"; |
|
| 12566 | + if ($globalDebug) { |
|
| 12567 | + echo "Updating airport to ".$airport_icao."...\n"; |
|
| 12568 | + } |
|
| 12090 | 12569 | $update_query="UPDATE spotter_output SET real_arrival_airport_icao = :airport_icao WHERE spotter_id = :spotter_id"; |
| 12091 | 12570 | $sthu = $this->db->prepare($update_query); |
| 12092 | 12571 | $sthu->execute(array(':airport_icao' => $airport_icao,':spotter_id' => $row['spotter_id'])); |
@@ -2,10 +2,10 @@ discard block |
||
| 2 | 2 | require_once(dirname(__FILE__).'/settings.php'); |
| 3 | 3 | require_once(dirname(__FILE__).'/class.Common.php'); |
| 4 | 4 | class aprs { |
| 5 | - private $socket; |
|
| 6 | - private $connected = false; |
|
| 5 | + private $socket; |
|
| 6 | + private $connected = false; |
|
| 7 | 7 | |
| 8 | - protected $symbols = array('!' => 'Police', |
|
| 8 | + protected $symbols = array('!' => 'Police', |
|
| 9 | 9 | '#' => 'DIGI', |
| 10 | 10 | '$' => 'Phone', |
| 11 | 11 | '%' => 'DX Cluster', |
@@ -89,13 +89,13 @@ discard block |
||
| 89 | 89 | 'y' => 'Yagi At QTH'); |
| 90 | 90 | |
| 91 | 91 | |
| 92 | - private function urshift($n, $s) { |
|
| 92 | + private function urshift($n, $s) { |
|
| 93 | 93 | return ($n >= 0) ? ($n >> $s) : |
| 94 | - (($n & 0x7fffffff) >> $s) | |
|
| 94 | + (($n & 0x7fffffff) >> $s) | |
|
| 95 | 95 | (0x40000000 >> ($s - 1)); |
| 96 | - } |
|
| 96 | + } |
|
| 97 | 97 | |
| 98 | - public function parse($input) { |
|
| 98 | + public function parse($input) { |
|
| 99 | 99 | global $globalDebug; |
| 100 | 100 | $debug = false; |
| 101 | 101 | $result = array(); |
@@ -107,8 +107,8 @@ discard block |
||
| 107 | 107 | |
| 108 | 108 | /* Check that end was found and body has at least one byte. */ |
| 109 | 109 | if ($splitpos == 0 || $splitpos + 1 == $input_len || $splitpos === FALSE) { |
| 110 | - if ($globalDebug) echo '!!! APRS invalid : '.$input."\n"; |
|
| 111 | - return false; |
|
| 110 | + if ($globalDebug) echo '!!! APRS invalid : '.$input."\n"; |
|
| 111 | + return false; |
|
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | if ($debug) echo 'input : '.$input."\n"; |
@@ -122,31 +122,31 @@ discard block |
||
| 122 | 122 | /* Parse source, target and path. */ |
| 123 | 123 | //FLRDF0A52>APRS,qAS,LSTB |
| 124 | 124 | if (preg_match('/^([A-Z0-9\\-]{1,9})>(.*)$/',$header,$matches)) { |
| 125 | - $ident = $matches[1]; |
|
| 126 | - $all_elements = $matches[2]; |
|
| 127 | - if ($ident == 'AIRCRAFT') { |
|
| 125 | + $ident = $matches[1]; |
|
| 126 | + $all_elements = $matches[2]; |
|
| 127 | + if ($ident == 'AIRCRAFT') { |
|
| 128 | 128 | $result['format_source'] = 'famaprs'; |
| 129 | 129 | $result['source_type'] = 'modes'; |
| 130 | - } elseif ($ident == 'MARINE') { |
|
| 130 | + } elseif ($ident == 'MARINE') { |
|
| 131 | 131 | $result['format_source'] = 'famaprs'; |
| 132 | 132 | $result['source_type'] = 'ais'; |
| 133 | - } else { |
|
| 133 | + } else { |
|
| 134 | 134 | if ($debug) echo 'ident : '.$ident."\n"; |
| 135 | 135 | $result['ident'] = $ident; |
| 136 | - } |
|
| 136 | + } |
|
| 137 | 137 | } else return false; |
| 138 | 138 | $elements = explode(',',$all_elements); |
| 139 | 139 | $source = end($elements); |
| 140 | 140 | $result['source'] = $source; |
| 141 | 141 | foreach ($elements as $element) { |
| 142 | - if (preg_match('/^([a-zA-Z0-9-]{1,9})([*]?)$/',$element)) { |
|
| 143 | - //echo "ok"; |
|
| 144 | - //if ($element == 'TCPIP*') return false; |
|
| 145 | - } elseif (!preg_match('/^([0-9A-F]{32})$/',$element)) { |
|
| 142 | + if (preg_match('/^([a-zA-Z0-9-]{1,9})([*]?)$/',$element)) { |
|
| 143 | + //echo "ok"; |
|
| 144 | + //if ($element == 'TCPIP*') return false; |
|
| 145 | + } elseif (!preg_match('/^([0-9A-F]{32})$/',$element)) { |
|
| 146 | 146 | if ($debug) echo 'element : '.$element."\n"; |
| 147 | 147 | return false; |
| 148 | - } |
|
| 149 | - /* |
|
| 148 | + } |
|
| 149 | + /* |
|
| 150 | 150 | } elseif (preg_match('/^([0-9A-F]{32})$/',$element)) { |
| 151 | 151 | //echo "ok"; |
| 152 | 152 | } else { |
@@ -171,49 +171,49 @@ discard block |
||
| 171 | 171 | $body_parse = substr($body,1); |
| 172 | 172 | //echo 'Body : '.$body."\n"; |
| 173 | 173 | if (preg_match('/^;(.){9}\*/',$body,$matches)) { |
| 174 | - $body_parse = substr($body_parse,10); |
|
| 175 | - $find = true; |
|
| 176 | - //echo $body_parse."\n"; |
|
| 174 | + $body_parse = substr($body_parse,10); |
|
| 175 | + $find = true; |
|
| 176 | + //echo $body_parse."\n"; |
|
| 177 | 177 | } |
| 178 | 178 | if (preg_match('/^`(.*)\//',$body,$matches)) { |
| 179 | - $body_parse = substr($body_parse,strlen($matches[1])-1); |
|
| 180 | - $find = true; |
|
| 181 | - //echo $body_parse."\n"; |
|
| 179 | + $body_parse = substr($body_parse,strlen($matches[1])-1); |
|
| 180 | + $find = true; |
|
| 181 | + //echo $body_parse."\n"; |
|
| 182 | 182 | } |
| 183 | 183 | if (preg_match("/^'(.*)\//",$body,$matches)) { |
| 184 | - $body_parse = substr($body_parse,strlen($matches[1])-1); |
|
| 185 | - $find = true; |
|
| 186 | - //echo $body_parse."\n"; |
|
| 184 | + $body_parse = substr($body_parse,strlen($matches[1])-1); |
|
| 185 | + $find = true; |
|
| 186 | + //echo $body_parse."\n"; |
|
| 187 | 187 | } |
| 188 | 188 | if (preg_match('/^([0-9]{2})([0-9]{2})([0-9]{2})([zh\\/])/',$body_parse,$matches)) { |
| 189 | - $find = true; |
|
| 190 | - //print_r($matches); |
|
| 191 | - $timestamp = $matches[0]; |
|
| 192 | - if ($matches[4] == 'h') { |
|
| 189 | + $find = true; |
|
| 190 | + //print_r($matches); |
|
| 191 | + $timestamp = $matches[0]; |
|
| 192 | + if ($matches[4] == 'h') { |
|
| 193 | 193 | $timestamp = strtotime($matches[1].':'.$matches[2].':'.$matches[3]); |
| 194 | 194 | //echo 'timestamp : '.$timestamp.' - now : '.time()."\n"; |
| 195 | 195 | /* |
| 196 | 196 | if (time() + 3900 < $timestamp) $timestamp -= 86400; |
| 197 | 197 | elseif (time() - 82500 > $timestamp) $timestamp += 86400; |
| 198 | 198 | */ |
| 199 | - } elseif ($matches[4] == 'z' || $matches[4] == '/') { |
|
| 199 | + } elseif ($matches[4] == 'z' || $matches[4] == '/') { |
|
| 200 | 200 | // This work or not ? |
| 201 | 201 | $timestamp = strtotime(date('Ym').$matches[1].' '.$matches[2].':'.$matches[3]); |
| 202 | - } |
|
| 203 | - $body_parse = substr($body_parse,7); |
|
| 204 | - $result['timestamp'] = $timestamp; |
|
| 205 | - //echo date('Ymd H:i:s',$timestamp); |
|
| 202 | + } |
|
| 203 | + $body_parse = substr($body_parse,7); |
|
| 204 | + $result['timestamp'] = $timestamp; |
|
| 205 | + //echo date('Ymd H:i:s',$timestamp); |
|
| 206 | 206 | } |
| 207 | 207 | if (preg_match('/^([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})/',$body_parse,$matches)) { |
| 208 | - $find = true; |
|
| 209 | - $timestamp = strtotime(date('Y').$matches[1].$matches[2].' '.$matches[3].':'.$matches[4]); |
|
| 210 | - $body_parse = substr($body_parse,8); |
|
| 211 | - $result['timestamp'] = $timestamp; |
|
| 212 | - //echo date('Ymd H:i:s',$timestamp); |
|
| 208 | + $find = true; |
|
| 209 | + $timestamp = strtotime(date('Y').$matches[1].$matches[2].' '.$matches[3].':'.$matches[4]); |
|
| 210 | + $body_parse = substr($body_parse,8); |
|
| 211 | + $result['timestamp'] = $timestamp; |
|
| 212 | + //echo date('Ymd H:i:s',$timestamp); |
|
| 213 | 213 | } |
| 214 | 214 | //if (strlen($body_parse) > 19) { |
| 215 | - if (preg_match('/^([0-9]{2})([0-7 ][0-9 ]\\.[0-9 ]{2})([NnSs])(.)([0-9]{3})([0-7 ][0-9 ]\\.[0-9 ]{2})([EeWw])(.)/',$body_parse,$matches)) { |
|
| 216 | - $find = true; |
|
| 215 | + if (preg_match('/^([0-9]{2})([0-7 ][0-9 ]\\.[0-9 ]{2})([NnSs])(.)([0-9]{3})([0-7 ][0-9 ]\\.[0-9 ]{2})([EeWw])(.)/',$body_parse,$matches)) { |
|
| 216 | + $find = true; |
|
| 217 | 217 | // 4658.70N/00707.78Ez |
| 218 | 218 | //print_r(str_split($body_parse)); |
| 219 | 219 | |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | $lon = intval($lon_deg); |
| 231 | 231 | if ($lat > 89 || $lon > 179) return false; |
| 232 | 232 | |
| 233 | - /* |
|
| 233 | + /* |
|
| 234 | 234 | $tmp_5b = str_replace('.','',$lat_min); |
| 235 | 235 | if (preg_match('/^([0-9]{0,4})( {0,4})$/',$tmp_5b,$matches)) { |
| 236 | 236 | print_r($matches); |
@@ -244,9 +244,9 @@ discard block |
||
| 244 | 244 | $result['longitude'] = $longitude; |
| 245 | 245 | $body_parse = substr($body_parse,18); |
| 246 | 246 | $body_parse_len = strlen($body_parse); |
| 247 | - } |
|
| 248 | - $body_parse_len = strlen($body_parse); |
|
| 249 | - if ($body_parse_len > 0) { |
|
| 247 | + } |
|
| 248 | + $body_parse_len = strlen($body_parse); |
|
| 249 | + if ($body_parse_len > 0) { |
|
| 250 | 250 | /* |
| 251 | 251 | if (!isset($result['timestamp']) && !isset($result['latitude'])) { |
| 252 | 252 | $body_split = str_split($body); |
@@ -276,89 +276,89 @@ discard block |
||
| 276 | 276 | if (isset($this->symbols[$symbol_code])) $result['symbol'] = $this->symbols[$symbol_code]; |
| 277 | 277 | if ($symbol_code != '_') { |
| 278 | 278 | } |
| 279 | - //$body_parse = substr($body_parse,1); |
|
| 280 | - //$body_parse = trim($body_parse); |
|
| 281 | - //$body_parse_len = strlen($body_parse); |
|
| 282 | - if ($body_parse_len >= 7) { |
|
| 279 | + //$body_parse = substr($body_parse,1); |
|
| 280 | + //$body_parse = trim($body_parse); |
|
| 281 | + //$body_parse_len = strlen($body_parse); |
|
| 282 | + if ($body_parse_len >= 7) { |
|
| 283 | 283 | |
| 284 | - if (preg_match('/^([0-9\\. ]{3})\\/([0-9\\. ]{3})/',$body_parse)) { |
|
| 285 | - $course = substr($body_parse,0,3); |
|
| 286 | - $tmp_s = intval($course); |
|
| 287 | - if ($tmp_s >= 1 && $tmp_s <= 360) $result['heading'] = intval($course); |
|
| 288 | - $speed = substr($body_parse,4,3); |
|
| 289 | - if ($speed != '...') { |
|
| 290 | - //$result['speed'] = round($speed*1.852); |
|
| 291 | - $result['speed'] = intval($speed); |
|
| 292 | - } |
|
| 293 | - $body_parse = substr($body_parse,7); |
|
| 294 | - } |
|
| 295 | - // Check PHGR, PHG, RNG |
|
| 296 | - } |
|
| 297 | - /* |
|
| 284 | + if (preg_match('/^([0-9\\. ]{3})\\/([0-9\\. ]{3})/',$body_parse)) { |
|
| 285 | + $course = substr($body_parse,0,3); |
|
| 286 | + $tmp_s = intval($course); |
|
| 287 | + if ($tmp_s >= 1 && $tmp_s <= 360) $result['heading'] = intval($course); |
|
| 288 | + $speed = substr($body_parse,4,3); |
|
| 289 | + if ($speed != '...') { |
|
| 290 | + //$result['speed'] = round($speed*1.852); |
|
| 291 | + $result['speed'] = intval($speed); |
|
| 292 | + } |
|
| 293 | + $body_parse = substr($body_parse,7); |
|
| 294 | + } |
|
| 295 | + // Check PHGR, PHG, RNG |
|
| 296 | + } |
|
| 297 | + /* |
|
| 298 | 298 | else if ($body_parse_len > 0) { |
| 299 | 299 | $rest = $body_parse; |
| 300 | 300 | } |
| 301 | 301 | */ |
| 302 | - if (strlen($body_parse) > 0) { |
|
| 303 | - if (preg_match('/\\/A=(-[0-9]{5}|[0-9]{6})/',$body_parse,$matches)) { |
|
| 304 | - $altitude = intval($matches[1]); |
|
| 305 | - //$result['altitude'] = round($altitude*0.3048); |
|
| 306 | - $result['altitude'] = $altitude; |
|
| 307 | - //$body_parse = trim(substr($body_parse,strlen($matches[0]))); |
|
| 308 | - $body_parse = trim(preg_replace('/\\/A=(-[0-9]{5}|[0-9]{6})/','',$body_parse)); |
|
| 309 | - } |
|
| 310 | - } |
|
| 302 | + if (strlen($body_parse) > 0) { |
|
| 303 | + if (preg_match('/\\/A=(-[0-9]{5}|[0-9]{6})/',$body_parse,$matches)) { |
|
| 304 | + $altitude = intval($matches[1]); |
|
| 305 | + //$result['altitude'] = round($altitude*0.3048); |
|
| 306 | + $result['altitude'] = $altitude; |
|
| 307 | + //$body_parse = trim(substr($body_parse,strlen($matches[0]))); |
|
| 308 | + $body_parse = trim(preg_replace('/\\/A=(-[0-9]{5}|[0-9]{6})/','',$body_parse)); |
|
| 309 | + } |
|
| 310 | + } |
|
| 311 | 311 | |
| 312 | - // Telemetry |
|
| 313 | - /* |
|
| 312 | + // Telemetry |
|
| 313 | + /* |
|
| 314 | 314 | if (preg_match('/^([0-9]+),(-?)([0-9]{1,6}|[0-9]+\\.[0-9]+|\\.[0-9]+)?,(-?)([0-9]{1,6}|[0-9]+\\.[0-9]+|\\.[0-9]+)?,(-?)([0-9]{1,6}|[0-9]+\\.[0-9]+|\\.[0-9]+)?,(-?)([0-9]{1,6}|[0-9]+\\.[0-9]+|\\.[0-9]+)?,(-?)([0-9]{1,6}|[0-9]+\\.[0-9]+|\\.[0-9]+)?,([01]{0,8})/',$body_parse,$matches)) { |
| 315 | 315 | // Nothing yet... |
| 316 | 316 | } |
| 317 | 317 | */ |
| 318 | - // DAO |
|
| 318 | + // DAO |
|
| 319 | 319 | |
| 320 | - if (preg_match('/^!([0-9A-Z]{3})/',$body_parse,$matches)) { |
|
| 320 | + if (preg_match('/^!([0-9A-Z]{3})/',$body_parse,$matches)) { |
|
| 321 | 321 | |
| 322 | - $dao = $matches[1]; |
|
| 323 | - if (preg_match('/^([A-Z])([0-9]{2})/',$dao)) { |
|
| 322 | + $dao = $matches[1]; |
|
| 323 | + if (preg_match('/^([A-Z])([0-9]{2})/',$dao)) { |
|
| 324 | 324 | $dao_split = str_split($dao); |
| 325 | - $lat_off = (($dao_split[1])-48.0)*0.001/60.0; |
|
| 326 | - $lon_off = (($dao_split[2])-48.0)*0.001/60.0; |
|
| 325 | + $lat_off = (($dao_split[1])-48.0)*0.001/60.0; |
|
| 326 | + $lon_off = (($dao_split[2])-48.0)*0.001/60.0; |
|
| 327 | 327 | |
| 328 | 328 | if ($result['latitude'] < 0) $result['latitude'] -= $lat_off; |
| 329 | 329 | else $result['latitude'] += $lat_off; |
| 330 | 330 | if ($result['longitude'] < 0) $result['longitude'] -= $lon_off; |
| 331 | 331 | else $result['longitude'] += $lon_off; |
| 332 | - } |
|
| 332 | + } |
|
| 333 | 333 | |
| 334 | - $body_parse = substr($body_parse,6); |
|
| 335 | - } |
|
| 334 | + $body_parse = substr($body_parse,6); |
|
| 335 | + } |
|
| 336 | 336 | |
| 337 | - if (preg_match('/CS=([0-9A-Z]*)/',$body_parse,$matches)) { |
|
| 337 | + if (preg_match('/CS=([0-9A-Z]*)/',$body_parse,$matches)) { |
|
| 338 | 338 | $result['ident'] = $matches[1]; |
| 339 | - } |
|
| 340 | - if (preg_match('/SQ=([0-9]{4})/',$body_parse,$matches)) { |
|
| 339 | + } |
|
| 340 | + if (preg_match('/SQ=([0-9]{4})/',$body_parse,$matches)) { |
|
| 341 | 341 | $result['squawk'] = $matches[1]; |
| 342 | - } |
|
| 343 | - if (preg_match('/AI=([0-9A-Z]{4})/',$body_parse,$matches)) { |
|
| 342 | + } |
|
| 343 | + if (preg_match('/AI=([0-9A-Z]{4})/',$body_parse,$matches)) { |
|
| 344 | 344 | $result['aircraft_icao'] = $matches[1]; |
| 345 | - } |
|
| 346 | - if (preg_match('/TI=([0-9]*)/',$body_parse,$matches)) { |
|
| 345 | + } |
|
| 346 | + if (preg_match('/TI=([0-9]*)/',$body_parse,$matches)) { |
|
| 347 | 347 | $result['typeid'] = $matches[1]; |
| 348 | - } |
|
| 349 | - if (preg_match('/IMO=([0-9]{7})/',$body_parse,$matches)) { |
|
| 348 | + } |
|
| 349 | + if (preg_match('/IMO=([0-9]{7})/',$body_parse,$matches)) { |
|
| 350 | 350 | $result['imo'] = $matches[1]; |
| 351 | - } |
|
| 352 | - if (preg_match('/AD=([0-9]*)/',$body_parse,$matches)) { |
|
| 351 | + } |
|
| 352 | + if (preg_match('/AD=([0-9]*)/',$body_parse,$matches)) { |
|
| 353 | 353 | $result['arrival_date'] = $matches[1]; |
| 354 | - } |
|
| 355 | - if (preg_match('/AC=([0-9A-Z]*)/',$body_parse,$matches)) { |
|
| 354 | + } |
|
| 355 | + if (preg_match('/AC=([0-9A-Z]*)/',$body_parse,$matches)) { |
|
| 356 | 356 | $result['arrival_code'] = $matches[1]; |
| 357 | - } |
|
| 358 | - // OGN comment |
|
| 357 | + } |
|
| 358 | + // OGN comment |
|
| 359 | 359 | // echo "Before OGN : ".$body_parse."\n"; |
| 360 | - //if (preg_match('/^id([0-9A-F]{8}) ([+-])([0-9]{3,4})fpm ([+-])([0-9.]{3,4})rot (.*)$/',$body_parse,$matches)) { |
|
| 361 | - if (preg_match('/^id([0-9A-F]{8})/',$body_parse,$matches)) { |
|
| 360 | + //if (preg_match('/^id([0-9A-F]{8}) ([+-])([0-9]{3,4})fpm ([+-])([0-9.]{3,4})rot (.*)$/',$body_parse,$matches)) { |
|
| 361 | + if (preg_match('/^id([0-9A-F]{8})/',$body_parse,$matches)) { |
|
| 362 | 362 | $id = $matches[1]; |
| 363 | 363 | //$mode = substr($id,0,2); |
| 364 | 364 | $address = substr($id,2); |
@@ -388,53 +388,53 @@ discard block |
||
| 388 | 388 | $stealth = (intval(substr($id,0,2), 16) & 0b10000000) != 0; |
| 389 | 389 | $result['stealth'] = $stealth; |
| 390 | 390 | $result['address'] = $address; |
| 391 | - } |
|
| 391 | + } |
|
| 392 | 392 | |
| 393 | - //Comment |
|
| 394 | - $result['comment'] = trim($body_parse); |
|
| 393 | + //Comment |
|
| 394 | + $result['comment'] = trim($body_parse); |
|
| 395 | 395 | } else { |
| 396 | - // parse weather |
|
| 397 | - //$body_parse = substr($body_parse,1); |
|
| 398 | - //$body_parse_len = strlen($body_parse); |
|
| 396 | + // parse weather |
|
| 397 | + //$body_parse = substr($body_parse,1); |
|
| 398 | + //$body_parse_len = strlen($body_parse); |
|
| 399 | 399 | |
| 400 | - if (preg_match('/^_{0,1}([0-9 \\.\\-]{3})\\/([0-9 \\.]{3})g([0-9 \\.]+)t(-{0,1}[0-9 \\.]+)/',$body_parse,$matches)) { |
|
| 401 | - $result['wind_dir'] = intval($matches[1]); |
|
| 402 | - $result['wind_speed'] = round(intval($matches[2])*1.60934,1); |
|
| 403 | - $result['wind_gust'] = round(intval($matches[3])*1.60934,1); |
|
| 404 | - $result['temp'] = round(5/9*((intval($matches[4]))-32),1); |
|
| 405 | - $body_parse = substr($body_parse,strlen($matches[0])+1); |
|
| 406 | - } elseif (preg_match('/^_{0,1}c([0-9 \\.\\-]{3})s([0-9 \\.]{3})g([0-9 \\.]+)t(-{0,1}[0-9 \\.]+)/',$body_parse,$matches)) { |
|
| 400 | + if (preg_match('/^_{0,1}([0-9 \\.\\-]{3})\\/([0-9 \\.]{3})g([0-9 \\.]+)t(-{0,1}[0-9 \\.]+)/',$body_parse,$matches)) { |
|
| 401 | + $result['wind_dir'] = intval($matches[1]); |
|
| 402 | + $result['wind_speed'] = round(intval($matches[2])*1.60934,1); |
|
| 403 | + $result['wind_gust'] = round(intval($matches[3])*1.60934,1); |
|
| 404 | + $result['temp'] = round(5/9*((intval($matches[4]))-32),1); |
|
| 405 | + $body_parse = substr($body_parse,strlen($matches[0])+1); |
|
| 406 | + } elseif (preg_match('/^_{0,1}c([0-9 \\.\\-]{3})s([0-9 \\.]{3})g([0-9 \\.]+)t(-{0,1}[0-9 \\.]+)/',$body_parse,$matches)) { |
|
| 407 | 407 | $result['wind_dir'] = intval($matches[1]); |
| 408 | 408 | $result['wind_speed'] = round($matches[2]*1.60934,1); |
| 409 | 409 | $result['wind_gust'] = round($matches[3]*1.60934,1); |
| 410 | 410 | $result['temp'] = round(5/9*(($matches[4])-32),1); |
| 411 | - $body_parse = substr($body_parse,strlen($matches[0])+1); |
|
| 412 | - } elseif (preg_match('/^_{0,1}([0-9 \\.\\-]{3})\\/([0-9 \\.]{3})t(-{0,1}[0-9 \\.]+)/',$body_parse,$matches)) { |
|
| 411 | + $body_parse = substr($body_parse,strlen($matches[0])+1); |
|
| 412 | + } elseif (preg_match('/^_{0,1}([0-9 \\.\\-]{3})\\/([0-9 \\.]{3})t(-{0,1}[0-9 \\.]+)/',$body_parse,$matches)) { |
|
| 413 | 413 | $result['wind_dir'] = intval($matches[1]); |
| 414 | 414 | $result['wind_speed'] = round($matches[2]*1.60934,1); |
| 415 | 415 | $result['wind_gust'] = round($matches[3]*1.60934,1); |
| 416 | - $body_parse = substr($body_parse,strlen($matches[0])+1); |
|
| 417 | - } elseif (preg_match('/^_{0,1}([0-9 \\.\\-]{3})\\/([0-9 \\.]{3})g([0-9 \\.]+)/',$body_parse,$matches)) { |
|
| 416 | + $body_parse = substr($body_parse,strlen($matches[0])+1); |
|
| 417 | + } elseif (preg_match('/^_{0,1}([0-9 \\.\\-]{3})\\/([0-9 \\.]{3})g([0-9 \\.]+)/',$body_parse,$matches)) { |
|
| 418 | 418 | $result['wind_dir'] = intval($matches[1]); |
| 419 | 419 | $result['wind_speed'] = round($matches[2]*1.60934,1); |
| 420 | 420 | $result['wind_gust'] = round($matches[3]*1.60934,1); |
| 421 | - $body_parse = substr($body_parse,strlen($matches[0])+1); |
|
| 422 | - } |
|
| 423 | - if (!isset($result['temp']) && strlen($body_parse) > 0 && preg_match('/^g([0-9]+)t(-?[0-9 \\.]{1,3})/',$body_parse,$matches)) { |
|
| 421 | + $body_parse = substr($body_parse,strlen($matches[0])+1); |
|
| 422 | + } |
|
| 423 | + if (!isset($result['temp']) && strlen($body_parse) > 0 && preg_match('/^g([0-9]+)t(-?[0-9 \\.]{1,3})/',$body_parse,$matches)) { |
|
| 424 | 424 | $result['temp'] = round(5/9*(($matches[1])-32),1); |
| 425 | - } |
|
| 425 | + } |
|
| 426 | 426 | } |
| 427 | 427 | } else $result['comment'] = trim($body_parse); |
| 428 | 428 | |
| 429 | - } |
|
| 429 | + } |
|
| 430 | 430 | //} |
| 431 | 431 | if (isset($result['latitude'])) $result['latitude'] = round($result['latitude'],4); |
| 432 | 432 | if (isset($result['longitude'])) $result['longitude'] = round($result['longitude'],4); |
| 433 | 433 | if ($debug) print_r($result); |
| 434 | 434 | return $result; |
| 435 | - } |
|
| 435 | + } |
|
| 436 | 436 | |
| 437 | - public function connect() { |
|
| 437 | + public function connect() { |
|
| 438 | 438 | global $globalAPRSversion, $globalServerAPRSssid, $globalServerAPRSpass,$globalName, $globalServerAPRShost, $globalServerAPRSport; |
| 439 | 439 | $aprs_connect = 0; |
| 440 | 440 | $aprs_keep = 120; |
@@ -457,32 +457,32 @@ discard block |
||
| 457 | 457 | $send = socket_send( $this->socket , $aprs_login , strlen($aprs_login) , 0 ); |
| 458 | 458 | while ($msgin = socket_read($this->socket, 1000,PHP_NORMAL_READ)) { |
| 459 | 459 | if (strpos($msgin, "$aprs_ssid verified") !== FALSE) { |
| 460 | - echo 'APRS user verified !'."\n"; |
|
| 461 | - $this->connected = true; |
|
| 462 | - return true; |
|
| 463 | - break; |
|
| 460 | + echo 'APRS user verified !'."\n"; |
|
| 461 | + $this->connected = true; |
|
| 462 | + return true; |
|
| 463 | + break; |
|
| 464 | 464 | } |
| 465 | 465 | if (time()-$authstart > 5) { |
| 466 | - echo 'APRS timeout'."\n"; |
|
| 467 | - break; |
|
| 466 | + echo 'APRS timeout'."\n"; |
|
| 467 | + break; |
|
| 468 | 468 | } |
| 469 | 469 | } |
| 470 | 470 | socket_set_option($this->socket,SOL_SOCKET,SO_KEEPALIVE); |
| 471 | 471 | } |
| 472 | - } |
|
| 472 | + } |
|
| 473 | 473 | |
| 474 | - public function disconnect() { |
|
| 474 | + public function disconnect() { |
|
| 475 | 475 | socket_close($this->socket); |
| 476 | - } |
|
| 476 | + } |
|
| 477 | 477 | |
| 478 | - public function send($data) { |
|
| 478 | + public function send($data) { |
|
| 479 | 479 | if ($this->connected === false) $this->connect(); |
| 480 | 480 | $send = socket_send( $this->socket , $data , strlen($data),0); |
| 481 | 481 | if ($send === FALSE) { |
| 482 | 482 | socket_close($this->socket); |
| 483 | 483 | $this->connect(); |
| 484 | 484 | } |
| 485 | - } |
|
| 485 | + } |
|
| 486 | 486 | } |
| 487 | 487 | |
| 488 | 488 | class APRSSpotter extends APRS { |
@@ -107,17 +107,23 @@ discard block |
||
| 107 | 107 | |
| 108 | 108 | /* Check that end was found and body has at least one byte. */ |
| 109 | 109 | if ($splitpos == 0 || $splitpos + 1 == $input_len || $splitpos === FALSE) { |
| 110 | - if ($globalDebug) echo '!!! APRS invalid : '.$input."\n"; |
|
| 110 | + if ($globalDebug) { |
|
| 111 | + echo '!!! APRS invalid : '.$input."\n"; |
|
| 112 | + } |
|
| 111 | 113 | return false; |
| 112 | 114 | } |
| 113 | 115 | |
| 114 | - if ($debug) echo 'input : '.$input."\n"; |
|
| 116 | + if ($debug) { |
|
| 117 | + echo 'input : '.$input."\n"; |
|
| 118 | + } |
|
| 115 | 119 | /* Save header and body. */ |
| 116 | 120 | $body = substr($input,$splitpos+1,$input_len); |
| 117 | 121 | $body_len = strlen($body); |
| 118 | 122 | $header = substr($input,0,$splitpos); |
| 119 | 123 | //$header_len = strlen($header); |
| 120 | - if ($debug) echo 'header : '.$header."\n"; |
|
| 124 | + if ($debug) { |
|
| 125 | + echo 'header : '.$header."\n"; |
|
| 126 | + } |
|
| 121 | 127 | |
| 122 | 128 | /* Parse source, target and path. */ |
| 123 | 129 | //FLRDF0A52>APRS,qAS,LSTB |
@@ -131,10 +137,14 @@ discard block |
||
| 131 | 137 | $result['format_source'] = 'famaprs'; |
| 132 | 138 | $result['source_type'] = 'ais'; |
| 133 | 139 | } else { |
| 134 | - if ($debug) echo 'ident : '.$ident."\n"; |
|
| 140 | + if ($debug) { |
|
| 141 | + echo 'ident : '.$ident."\n"; |
|
| 142 | + } |
|
| 135 | 143 | $result['ident'] = $ident; |
| 136 | 144 | } |
| 137 | - } else return false; |
|
| 145 | + } else { |
|
| 146 | + return false; |
|
| 147 | + } |
|
| 138 | 148 | $elements = explode(',',$all_elements); |
| 139 | 149 | $source = end($elements); |
| 140 | 150 | $result['source'] = $source; |
@@ -143,7 +153,9 @@ discard block |
||
| 143 | 153 | //echo "ok"; |
| 144 | 154 | //if ($element == 'TCPIP*') return false; |
| 145 | 155 | } elseif (!preg_match('/^([0-9A-F]{32})$/',$element)) { |
| 146 | - if ($debug) echo 'element : '.$element."\n"; |
|
| 156 | + if ($debug) { |
|
| 157 | + echo 'element : '.$element."\n"; |
|
| 158 | + } |
|
| 147 | 159 | return false; |
| 148 | 160 | } |
| 149 | 161 | /* |
@@ -156,11 +168,15 @@ discard block |
||
| 156 | 168 | } |
| 157 | 169 | |
| 158 | 170 | $type = substr($body,0,1); |
| 159 | - if ($debug) echo 'type : '.$type."\n"; |
|
| 171 | + if ($debug) { |
|
| 172 | + echo 'type : '.$type."\n"; |
|
| 173 | + } |
|
| 160 | 174 | if ($type == ';') { |
| 161 | 175 | if (isset($result['source_type']) && $result['source_type'] == 'modes') { |
| 162 | 176 | $result['address'] = trim(substr($body,1,9)); |
| 163 | - } else $result['ident'] = trim(substr($body,1,9)); |
|
| 177 | + } else { |
|
| 178 | + $result['ident'] = trim(substr($body,1,9)); |
|
| 179 | + } |
|
| 164 | 180 | } elseif ($type == ',') { |
| 165 | 181 | // Invalid data or test data |
| 166 | 182 | return false; |
@@ -228,7 +244,9 @@ discard block |
||
| 228 | 244 | //$symbol_table = $matches[4]; |
| 229 | 245 | $lat = intval($lat_deg); |
| 230 | 246 | $lon = intval($lon_deg); |
| 231 | - if ($lat > 89 || $lon > 179) return false; |
|
| 247 | + if ($lat > 89 || $lon > 179) { |
|
| 248 | + return false; |
|
| 249 | + } |
|
| 232 | 250 | |
| 233 | 251 | /* |
| 234 | 252 | $tmp_5b = str_replace('.','',$lat_min); |
@@ -238,8 +256,12 @@ discard block |
||
| 238 | 256 | */ |
| 239 | 257 | $latitude = $lat + floatval($lat_min)/60; |
| 240 | 258 | $longitude = $lon + floatval($lon_min)/60; |
| 241 | - if ($sind == 'S') $latitude = 0-$latitude; |
|
| 242 | - if ($wind == 'W') $longitude = 0-$longitude; |
|
| 259 | + if ($sind == 'S') { |
|
| 260 | + $latitude = 0-$latitude; |
|
| 261 | + } |
|
| 262 | + if ($wind == 'W') { |
|
| 263 | + $longitude = 0-$longitude; |
|
| 264 | + } |
|
| 243 | 265 | $result['latitude'] = $latitude; |
| 244 | 266 | $result['longitude'] = $longitude; |
| 245 | 267 | $body_parse = substr($body_parse,18); |
@@ -273,7 +295,9 @@ discard block |
||
| 273 | 295 | $body_parse = substr($body_parse,1); |
| 274 | 296 | $body_parse_len = strlen($body_parse); |
| 275 | 297 | $result['symbol_code'] = $symbol_code; |
| 276 | - if (isset($this->symbols[$symbol_code])) $result['symbol'] = $this->symbols[$symbol_code]; |
|
| 298 | + if (isset($this->symbols[$symbol_code])) { |
|
| 299 | + $result['symbol'] = $this->symbols[$symbol_code]; |
|
| 300 | + } |
|
| 277 | 301 | if ($symbol_code != '_') { |
| 278 | 302 | } |
| 279 | 303 | //$body_parse = substr($body_parse,1); |
@@ -284,7 +308,9 @@ discard block |
||
| 284 | 308 | if (preg_match('/^([0-9\\. ]{3})\\/([0-9\\. ]{3})/',$body_parse)) { |
| 285 | 309 | $course = substr($body_parse,0,3); |
| 286 | 310 | $tmp_s = intval($course); |
| 287 | - if ($tmp_s >= 1 && $tmp_s <= 360) $result['heading'] = intval($course); |
|
| 311 | + if ($tmp_s >= 1 && $tmp_s <= 360) { |
|
| 312 | + $result['heading'] = intval($course); |
|
| 313 | + } |
|
| 288 | 314 | $speed = substr($body_parse,4,3); |
| 289 | 315 | if ($speed != '...') { |
| 290 | 316 | //$result['speed'] = round($speed*1.852); |
@@ -325,10 +351,16 @@ discard block |
||
| 325 | 351 | $lat_off = (($dao_split[1])-48.0)*0.001/60.0; |
| 326 | 352 | $lon_off = (($dao_split[2])-48.0)*0.001/60.0; |
| 327 | 353 | |
| 328 | - if ($result['latitude'] < 0) $result['latitude'] -= $lat_off; |
|
| 329 | - else $result['latitude'] += $lat_off; |
|
| 330 | - if ($result['longitude'] < 0) $result['longitude'] -= $lon_off; |
|
| 331 | - else $result['longitude'] += $lon_off; |
|
| 354 | + if ($result['latitude'] < 0) { |
|
| 355 | + $result['latitude'] -= $lat_off; |
|
| 356 | + } else { |
|
| 357 | + $result['latitude'] += $lat_off; |
|
| 358 | + } |
|
| 359 | + if ($result['longitude'] < 0) { |
|
| 360 | + $result['longitude'] -= $lon_off; |
|
| 361 | + } else { |
|
| 362 | + $result['longitude'] += $lon_off; |
|
| 363 | + } |
|
| 332 | 364 | } |
| 333 | 365 | |
| 334 | 366 | $body_parse = substr($body_parse,6); |
@@ -364,27 +396,48 @@ discard block |
||
| 364 | 396 | $address = substr($id,2); |
| 365 | 397 | //print_r($matches); |
| 366 | 398 | $addressType = (intval(substr($id,0,2),16))&3; |
| 367 | - if ($addressType == 0) $result['addresstype'] = "RANDOM"; |
|
| 368 | - elseif ($addressType == 1) $result['addresstype'] = "ICAO"; |
|
| 369 | - elseif ($addressType == 2) $result['addresstype'] = "FLARM"; |
|
| 370 | - elseif ($addressType == 3) $result['addresstype'] = "OGN"; |
|
| 399 | + if ($addressType == 0) { |
|
| 400 | + $result['addresstype'] = "RANDOM"; |
|
| 401 | + } elseif ($addressType == 1) { |
|
| 402 | + $result['addresstype'] = "ICAO"; |
|
| 403 | + } elseif ($addressType == 2) { |
|
| 404 | + $result['addresstype'] = "FLARM"; |
|
| 405 | + } elseif ($addressType == 3) { |
|
| 406 | + $result['addresstype'] = "OGN"; |
|
| 407 | + } |
|
| 371 | 408 | $aircraftType = $this->urshift(((intval(substr($id,0,2),16)) & 0b1111100),2); |
| 372 | 409 | $result['aircrafttype_code'] = $aircraftType; |
| 373 | - if ($aircraftType == 0) $result['aircrafttype'] = "UNKNOWN"; |
|
| 374 | - elseif ($aircraftType == 1) $result['aircrafttype'] = "GLIDER"; |
|
| 375 | - elseif ($aircraftType == 2) $result['aircrafttype'] = "TOW_PLANE"; |
|
| 376 | - elseif ($aircraftType == 3) $result['aircrafttype'] = "HELICOPTER_ROTORCRAFT"; |
|
| 377 | - elseif ($aircraftType == 4) $result['aircrafttype'] = "PARACHUTE"; |
|
| 378 | - elseif ($aircraftType == 5) $result['aircrafttype'] = "DROP_PLANE"; |
|
| 379 | - elseif ($aircraftType == 6) $result['aircrafttype'] = "HANG_GLIDER"; |
|
| 380 | - elseif ($aircraftType == 7) $result['aircrafttype'] = "PARA_GLIDER"; |
|
| 381 | - elseif ($aircraftType == 8) $result['aircrafttype'] = "POWERED_AIRCRAFT"; |
|
| 382 | - elseif ($aircraftType == 9) $result['aircrafttype'] = "JET_AIRCRAFT"; |
|
| 383 | - elseif ($aircraftType == 10) $result['aircrafttype'] = "UFO"; |
|
| 384 | - elseif ($aircraftType == 11) $result['aircrafttype'] = "BALLOON"; |
|
| 385 | - elseif ($aircraftType == 12) $result['aircrafttype'] = "AIRSHIP"; |
|
| 386 | - elseif ($aircraftType == 13) $result['aircrafttype'] = "UAV"; |
|
| 387 | - elseif ($aircraftType == 15) $result['aircrafttype'] = "STATIC_OBJECT"; |
|
| 410 | + if ($aircraftType == 0) { |
|
| 411 | + $result['aircrafttype'] = "UNKNOWN"; |
|
| 412 | + } elseif ($aircraftType == 1) { |
|
| 413 | + $result['aircrafttype'] = "GLIDER"; |
|
| 414 | + } elseif ($aircraftType == 2) { |
|
| 415 | + $result['aircrafttype'] = "TOW_PLANE"; |
|
| 416 | + } elseif ($aircraftType == 3) { |
|
| 417 | + $result['aircrafttype'] = "HELICOPTER_ROTORCRAFT"; |
|
| 418 | + } elseif ($aircraftType == 4) { |
|
| 419 | + $result['aircrafttype'] = "PARACHUTE"; |
|
| 420 | + } elseif ($aircraftType == 5) { |
|
| 421 | + $result['aircrafttype'] = "DROP_PLANE"; |
|
| 422 | + } elseif ($aircraftType == 6) { |
|
| 423 | + $result['aircrafttype'] = "HANG_GLIDER"; |
|
| 424 | + } elseif ($aircraftType == 7) { |
|
| 425 | + $result['aircrafttype'] = "PARA_GLIDER"; |
|
| 426 | + } elseif ($aircraftType == 8) { |
|
| 427 | + $result['aircrafttype'] = "POWERED_AIRCRAFT"; |
|
| 428 | + } elseif ($aircraftType == 9) { |
|
| 429 | + $result['aircrafttype'] = "JET_AIRCRAFT"; |
|
| 430 | + } elseif ($aircraftType == 10) { |
|
| 431 | + $result['aircrafttype'] = "UFO"; |
|
| 432 | + } elseif ($aircraftType == 11) { |
|
| 433 | + $result['aircrafttype'] = "BALLOON"; |
|
| 434 | + } elseif ($aircraftType == 12) { |
|
| 435 | + $result['aircrafttype'] = "AIRSHIP"; |
|
| 436 | + } elseif ($aircraftType == 13) { |
|
| 437 | + $result['aircrafttype'] = "UAV"; |
|
| 438 | + } elseif ($aircraftType == 15) { |
|
| 439 | + $result['aircrafttype'] = "STATIC_OBJECT"; |
|
| 440 | + } |
|
| 388 | 441 | $stealth = (intval(substr($id,0,2), 16) & 0b10000000) != 0; |
| 389 | 442 | $result['stealth'] = $stealth; |
| 390 | 443 | $result['address'] = $address; |
@@ -424,13 +477,21 @@ discard block |
||
| 424 | 477 | $result['temp'] = round(5/9*(($matches[1])-32),1); |
| 425 | 478 | } |
| 426 | 479 | } |
| 427 | - } else $result['comment'] = trim($body_parse); |
|
| 480 | + } else { |
|
| 481 | + $result['comment'] = trim($body_parse); |
|
| 482 | + } |
|
| 428 | 483 | |
| 429 | 484 | } |
| 430 | 485 | //} |
| 431 | - if (isset($result['latitude'])) $result['latitude'] = round($result['latitude'],4); |
|
| 432 | - if (isset($result['longitude'])) $result['longitude'] = round($result['longitude'],4); |
|
| 433 | - if ($debug) print_r($result); |
|
| 486 | + if (isset($result['latitude'])) { |
|
| 487 | + $result['latitude'] = round($result['latitude'],4); |
|
| 488 | + } |
|
| 489 | + if (isset($result['longitude'])) { |
|
| 490 | + $result['longitude'] = round($result['longitude'],4); |
|
| 491 | + } |
|
| 492 | + if ($debug) { |
|
| 493 | + print_r($result); |
|
| 494 | + } |
|
| 434 | 495 | return $result; |
| 435 | 496 | } |
| 436 | 497 | |
@@ -439,12 +500,21 @@ discard block |
||
| 439 | 500 | $aprs_connect = 0; |
| 440 | 501 | $aprs_keep = 120; |
| 441 | 502 | $aprs_last_tx = time(); |
| 442 | - if (isset($globalAPRSversion)) $aprs_version = $globalAPRSversion; |
|
| 443 | - else $aprs_version = 'FlightAirMap '.str_replace(' ','_',$globalName); |
|
| 444 | - if (isset($globalServerAPRSssid)) $aprs_ssid = $globalServerAPRSssid; |
|
| 445 | - else $aprs_ssid = substr('FAM'.strtoupper(str_replace(' ','_',$globalName)),0,8); |
|
| 446 | - if (isset($globalServerAPRSpass)) $aprs_pass = $globalServerAPRSpass; |
|
| 447 | - else $aprs_pass = '-1'; |
|
| 503 | + if (isset($globalAPRSversion)) { |
|
| 504 | + $aprs_version = $globalAPRSversion; |
|
| 505 | + } else { |
|
| 506 | + $aprs_version = 'FlightAirMap '.str_replace(' ','_',$globalName); |
|
| 507 | + } |
|
| 508 | + if (isset($globalServerAPRSssid)) { |
|
| 509 | + $aprs_ssid = $globalServerAPRSssid; |
|
| 510 | + } else { |
|
| 511 | + $aprs_ssid = substr('FAM'.strtoupper(str_replace(' ','_',$globalName)),0,8); |
|
| 512 | + } |
|
| 513 | + if (isset($globalServerAPRSpass)) { |
|
| 514 | + $aprs_pass = $globalServerAPRSpass; |
|
| 515 | + } else { |
|
| 516 | + $aprs_pass = '-1'; |
|
| 517 | + } |
|
| 448 | 518 | |
| 449 | 519 | $aprs_filter = ''; |
| 450 | 520 | $aprs_login = "user {$aprs_ssid} pass {$aprs_pass} vers {$aprs_version}\n"; |
@@ -476,7 +546,9 @@ discard block |
||
| 476 | 546 | } |
| 477 | 547 | |
| 478 | 548 | public function send($data) { |
| 479 | - if ($this->connected === false) $this->connect(); |
|
| 549 | + if ($this->connected === false) { |
|
| 550 | + $this->connect(); |
|
| 551 | + } |
|
| 480 | 552 | $send = socket_send( $this->socket , $data , strlen($data),0); |
| 481 | 553 | if ($send === FALSE) { |
| 482 | 554 | socket_close($this->socket); |
@@ -498,18 +570,26 @@ discard block |
||
| 498 | 570 | //$w = '00'; |
| 499 | 571 | $custom = ''; |
| 500 | 572 | if ($ident != '') { |
| 501 | - if ($custom != '') $custom .= '/'; |
|
| 573 | + if ($custom != '') { |
|
| 574 | + $custom .= '/'; |
|
| 575 | + } |
|
| 502 | 576 | $custom .= 'CS='.$ident; |
| 503 | 577 | } |
| 504 | 578 | if ($squawk != '') { |
| 505 | - if ($custom != '') $custom .= '/'; |
|
| 579 | + if ($custom != '') { |
|
| 580 | + $custom .= '/'; |
|
| 581 | + } |
|
| 506 | 582 | $custom .= 'SQ='.$squawk; |
| 507 | 583 | } |
| 508 | 584 | if ($aircraft_icao != '' && $aircraft_icao != 'NA') { |
| 509 | - if ($custom != '') $custom .= '/'; |
|
| 585 | + if ($custom != '') { |
|
| 586 | + $custom .= '/'; |
|
| 587 | + } |
|
| 510 | 588 | $custom .= 'AI='.$aircraft_icao; |
| 511 | 589 | } |
| 512 | - if ($custom != '') $custom = ' '.$custom; |
|
| 590 | + if ($custom != '') { |
|
| 591 | + $custom = ' '.$custom; |
|
| 592 | + } |
|
| 513 | 593 | $this->send('AIRCRAFT>APRS,TCPIP*:;'.$hex.' *'.date('His',strtotime($datetime)).'h'.$coordinate.'^'.str_pad($heading,3,'0',STR_PAD_LEFT).'/'.str_pad($speed,3,'0',STR_PAD_LEFT).'/A='.str_pad($altitude_real,6,'0',STR_PAD_LEFT).' !W'.$w.'!'.$custom."\n"); |
| 514 | 594 | } |
| 515 | 595 | } |
@@ -527,26 +607,38 @@ discard block |
||
| 527 | 607 | //$w = '00'; |
| 528 | 608 | $custom = ''; |
| 529 | 609 | if ($ident != '') { |
| 530 | - if ($custom != '') $custom .= '/'; |
|
| 610 | + if ($custom != '') { |
|
| 611 | + $custom .= '/'; |
|
| 612 | + } |
|
| 531 | 613 | $custom .= 'CS='.$ident; |
| 532 | 614 | } |
| 533 | 615 | if ($typeid != '') { |
| 534 | - if ($custom != '') $custom .= '/'; |
|
| 616 | + if ($custom != '') { |
|
| 617 | + $custom .= '/'; |
|
| 618 | + } |
|
| 535 | 619 | $custom .= 'TI='.$typeid; |
| 536 | 620 | } |
| 537 | 621 | if ($imo != '') { |
| 538 | - if ($custom != '') $custom .= '/'; |
|
| 622 | + if ($custom != '') { |
|
| 623 | + $custom .= '/'; |
|
| 624 | + } |
|
| 539 | 625 | $custom .= 'IMO='.$imo; |
| 540 | 626 | } |
| 541 | 627 | if ($arrival_date != '') { |
| 542 | - if ($custom != '') $custom .= '/'; |
|
| 628 | + if ($custom != '') { |
|
| 629 | + $custom .= '/'; |
|
| 630 | + } |
|
| 543 | 631 | $custom .= 'AD='.strtotime($arrival_date); |
| 544 | 632 | } |
| 545 | 633 | if ($arrival_code != '') { |
| 546 | - if ($custom != '') $custom .= '/'; |
|
| 634 | + if ($custom != '') { |
|
| 635 | + $custom .= '/'; |
|
| 636 | + } |
|
| 547 | 637 | $custom .= 'AC='.$arrival_code; |
| 548 | 638 | } |
| 549 | - if ($custom != '') $custom = ' '.$custom; |
|
| 639 | + if ($custom != '') { |
|
| 640 | + $custom = ' '.$custom; |
|
| 641 | + } |
|
| 550 | 642 | $altitude = 0; |
| 551 | 643 | $this->send('MARINE>APRS,TCPIP*:;'.$mmsi.'*'.date('His',strtotime($datetime)).'h'.$coordinate.'s'.str_pad($heading,3,'0',STR_PAD_LEFT).'/'.str_pad($speed,3,'0',STR_PAD_LEFT).'/A='.str_pad($altitude,6,'0',STR_PAD_LEFT).' !W'.$w.'!'.$custom."\n"); |
| 552 | 644 | } |