@@ -2913,10 +2913,6 @@ discard block |
||
| 2913 | 2913 | * |
| 2914 | 2914 | * @param String $flightaware_id the ID from flightaware |
| 2915 | 2915 | * @param String $ident the flight ident |
| 2916 | - * @param String $aircraft_icao the aircraft type |
|
| 2917 | - * @param String $departure_airport_icao the departure airport |
|
| 2918 | - * @param String $arrival_airport_icao the arrival airport |
|
| 2919 | - * @return String success or false |
|
| 2920 | 2916 | * |
| 2921 | 2917 | */ |
| 2922 | 2918 | public function updateLatestSpotterData($flightaware_id = '', $ident = '', $latitude = '', $longitude = '', $altitude = '', $ground = false, $groundspeed = NULL, $date = '', $arrival_airport_icao = '',$arrival_airport_time = '') |
@@ -7567,6 +7563,7 @@ discard block |
||
| 7567 | 7563 | /** |
| 7568 | 7564 | * Counts all hours |
| 7569 | 7565 | * |
| 7566 | + * @param string $orderby |
|
| 7570 | 7567 | * @return Array the hour list |
| 7571 | 7568 | * |
| 7572 | 7569 | */ |
@@ -8381,7 +8378,7 @@ discard block |
||
| 8381 | 8378 | /** |
| 8382 | 8379 | * Parses the direction degrees to working |
| 8383 | 8380 | * |
| 8384 | - * @param Float $direction the direction in degrees |
|
| 8381 | + * @param integer $direction the direction in degrees |
|
| 8385 | 8382 | * @return Array the direction information |
| 8386 | 8383 | * |
| 8387 | 8384 | */ |
@@ -13,14 +13,14 @@ discard block |
||
| 13 | 13 | } |
| 14 | 14 | |
| 15 | 15 | /** |
| 16 | - * Executes the SQL statements to get the spotter information |
|
| 17 | - * |
|
| 18 | - * @param String $query the SQL query |
|
| 19 | - * @param Array $params parameter of the query |
|
| 20 | - * @param String $limitQuery the limit query |
|
| 21 | - * @return Array the spotter information |
|
| 22 | - * |
|
| 23 | - */ |
|
| 16 | + * Executes the SQL statements to get the spotter information |
|
| 17 | + * |
|
| 18 | + * @param String $query the SQL query |
|
| 19 | + * @param Array $params parameter of the query |
|
| 20 | + * @param String $limitQuery the limit query |
|
| 21 | + * @return Array the spotter information |
|
| 22 | + * |
|
| 23 | + */ |
|
| 24 | 24 | public function getDataFromDB($query, $params = array(), $limitQuery = '') |
| 25 | 25 | { |
| 26 | 26 | global $globalSquawkCountry, $globalIVAO, $globalVATSIM, $globalphpVMS; |
@@ -179,11 +179,11 @@ discard block |
||
| 179 | 179 | if ($aircraft_array[0]['aircraft_shadow'] != NULL) { |
| 180 | 180 | $temp_array['aircraft_shadow'] = $aircraft_array[0]['aircraft_shadow']; |
| 181 | 181 | } else $temp_array['aircraft_shadow'] = 'default.png'; |
| 182 | - } else { |
|
| 183 | - $temp_array['aircraft_shadow'] = 'default.png'; |
|
| 182 | + } else { |
|
| 183 | + $temp_array['aircraft_shadow'] = 'default.png'; |
|
| 184 | 184 | $temp_array['aircraft_name'] = 'N/A'; |
| 185 | 185 | $temp_array['aircraft_manufacturer'] = 'N/A'; |
| 186 | - } |
|
| 186 | + } |
|
| 187 | 187 | } |
| 188 | 188 | if (!isset($row['airline_name']) || $row['airline_name'] == '') { |
| 189 | 189 | if (!is_numeric(substr($row['ident'], 0, 3))) { |
@@ -360,11 +360,11 @@ discard block |
||
| 360 | 360 | |
| 361 | 361 | |
| 362 | 362 | /** |
| 363 | - * Gets all the spotter information |
|
| 364 | - * |
|
| 365 | - * @return Array the spotter information |
|
| 366 | - * |
|
| 367 | - */ |
|
| 363 | + * Gets all the spotter information |
|
| 364 | + * |
|
| 365 | + * @return Array the spotter information |
|
| 366 | + * |
|
| 367 | + */ |
|
| 368 | 368 | 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 = '') |
| 369 | 369 | { |
| 370 | 370 | global $globalTimezone, $globalDBdriver; |
@@ -711,11 +711,11 @@ discard block |
||
| 711 | 711 | |
| 712 | 712 | |
| 713 | 713 | /** |
| 714 | - * Gets all the spotter information based on the latest data entry |
|
| 715 | - * |
|
| 716 | - * @return Array the spotter information |
|
| 717 | - * |
|
| 718 | - */ |
|
| 714 | + * Gets all the spotter information based on the latest data entry |
|
| 715 | + * |
|
| 716 | + * @return Array the spotter information |
|
| 717 | + * |
|
| 718 | + */ |
|
| 719 | 719 | public function getLatestSpotterData($limit = '', $sort = '') |
| 720 | 720 | { |
| 721 | 721 | global $global_query; |
@@ -752,12 +752,12 @@ discard block |
||
| 752 | 752 | } |
| 753 | 753 | |
| 754 | 754 | |
| 755 | - /** |
|
| 756 | - * Gets all the spotter information based on a user's latitude and longitude |
|
| 757 | - * |
|
| 758 | - * @return Array the spotter information |
|
| 759 | - * |
|
| 760 | - */ |
|
| 755 | + /** |
|
| 756 | + * Gets all the spotter information based on a user's latitude and longitude |
|
| 757 | + * |
|
| 758 | + * @return Array the spotter information |
|
| 759 | + * |
|
| 760 | + */ |
|
| 761 | 761 | public function getLatestSpotterForLayar($lat, $lng, $radius, $interval) |
| 762 | 762 | { |
| 763 | 763 | date_default_timezone_set('UTC'); |
@@ -785,7 +785,7 @@ discard block |
||
| 785 | 785 | return false; |
| 786 | 786 | } |
| 787 | 787 | } |
| 788 | - $additional_query = ''; |
|
| 788 | + $additional_query = ''; |
|
| 789 | 789 | if ($interval != "") |
| 790 | 790 | { |
| 791 | 791 | if (!is_string($interval)) |
@@ -825,12 +825,12 @@ discard block |
||
| 825 | 825 | } |
| 826 | 826 | |
| 827 | 827 | |
| 828 | - /** |
|
| 829 | - * Gets all the spotter information sorted by the newest aircraft type |
|
| 830 | - * |
|
| 831 | - * @return Array the spotter information |
|
| 832 | - * |
|
| 833 | - */ |
|
| 828 | + /** |
|
| 829 | + * Gets all the spotter information sorted by the newest aircraft type |
|
| 830 | + * |
|
| 831 | + * @return Array the spotter information |
|
| 832 | + * |
|
| 833 | + */ |
|
| 834 | 834 | public function getNewestSpotterDataSortedByAircraftType($limit = '', $sort = '') |
| 835 | 835 | { |
| 836 | 836 | global $global_query; |
@@ -867,12 +867,12 @@ discard block |
||
| 867 | 867 | } |
| 868 | 868 | |
| 869 | 869 | |
| 870 | - /** |
|
| 871 | - * Gets all the spotter information sorted by the newest aircraft registration |
|
| 872 | - * |
|
| 873 | - * @return Array the spotter information |
|
| 874 | - * |
|
| 875 | - */ |
|
| 870 | + /** |
|
| 871 | + * Gets all the spotter information sorted by the newest aircraft registration |
|
| 872 | + * |
|
| 873 | + * @return Array the spotter information |
|
| 874 | + * |
|
| 875 | + */ |
|
| 876 | 876 | public function getNewestSpotterDataSortedByAircraftRegistration($limit = '', $sort = '') |
| 877 | 877 | { |
| 878 | 878 | global $global_query; |
@@ -910,12 +910,12 @@ discard block |
||
| 910 | 910 | } |
| 911 | 911 | |
| 912 | 912 | |
| 913 | - /** |
|
| 914 | - * Gets all the spotter information sorted by the newest airline |
|
| 915 | - * |
|
| 916 | - * @return Array the spotter information |
|
| 917 | - * |
|
| 918 | - */ |
|
| 913 | + /** |
|
| 914 | + * Gets all the spotter information sorted by the newest airline |
|
| 915 | + * |
|
| 916 | + * @return Array the spotter information |
|
| 917 | + * |
|
| 918 | + */ |
|
| 919 | 919 | public function getNewestSpotterDataSortedByAirline($limit = '', $sort = '') |
| 920 | 920 | { |
| 921 | 921 | global $global_query; |
@@ -952,12 +952,12 @@ discard block |
||
| 952 | 952 | } |
| 953 | 953 | |
| 954 | 954 | |
| 955 | - /** |
|
| 956 | - * Gets all the spotter information sorted by the newest departure airport |
|
| 957 | - * |
|
| 958 | - * @return Array the spotter information |
|
| 959 | - * |
|
| 960 | - */ |
|
| 955 | + /** |
|
| 956 | + * Gets all the spotter information sorted by the newest departure airport |
|
| 957 | + * |
|
| 958 | + * @return Array the spotter information |
|
| 959 | + * |
|
| 960 | + */ |
|
| 961 | 961 | public function getNewestSpotterDataSortedByDepartureAirport($limit = '', $sort = '') |
| 962 | 962 | { |
| 963 | 963 | global $global_query; |
@@ -995,12 +995,12 @@ discard block |
||
| 995 | 995 | } |
| 996 | 996 | |
| 997 | 997 | |
| 998 | - /** |
|
| 999 | - * Gets all the spotter information sorted by the newest arrival airport |
|
| 1000 | - * |
|
| 1001 | - * @return Array the spotter information |
|
| 1002 | - * |
|
| 1003 | - */ |
|
| 998 | + /** |
|
| 999 | + * Gets all the spotter information sorted by the newest arrival airport |
|
| 1000 | + * |
|
| 1001 | + * @return Array the spotter information |
|
| 1002 | + * |
|
| 1003 | + */ |
|
| 1004 | 1004 | public function getNewestSpotterDataSortedByArrivalAirport($limit = '', $sort = '') |
| 1005 | 1005 | { |
| 1006 | 1006 | global $global_query; |
@@ -1039,11 +1039,11 @@ discard block |
||
| 1039 | 1039 | |
| 1040 | 1040 | |
| 1041 | 1041 | /** |
| 1042 | - * Gets all the spotter information based on the spotter id |
|
| 1043 | - * |
|
| 1044 | - * @return Array the spotter information |
|
| 1045 | - * |
|
| 1046 | - */ |
|
| 1042 | + * Gets all the spotter information based on the spotter id |
|
| 1043 | + * |
|
| 1044 | + * @return Array the spotter information |
|
| 1045 | + * |
|
| 1046 | + */ |
|
| 1047 | 1047 | public function getSpotterDataByID($id = '') |
| 1048 | 1048 | { |
| 1049 | 1049 | global $global_query; |
@@ -1073,11 +1073,11 @@ discard block |
||
| 1073 | 1073 | |
| 1074 | 1074 | |
| 1075 | 1075 | /** |
| 1076 | - * Gets all the spotter information based on the callsign |
|
| 1077 | - * |
|
| 1078 | - * @return Array the spotter information |
|
| 1079 | - * |
|
| 1080 | - */ |
|
| 1076 | + * Gets all the spotter information based on the callsign |
|
| 1077 | + * |
|
| 1078 | + * @return Array the spotter information |
|
| 1079 | + * |
|
| 1080 | + */ |
|
| 1081 | 1081 | public function getSpotterDataByIdent($ident = '', $limit = '', $sort = '') |
| 1082 | 1082 | { |
| 1083 | 1083 | global $global_query; |
@@ -1130,11 +1130,11 @@ discard block |
||
| 1130 | 1130 | |
| 1131 | 1131 | |
| 1132 | 1132 | /** |
| 1133 | - * Gets all the spotter information based on the aircraft type |
|
| 1134 | - * |
|
| 1135 | - * @return Array the spotter information |
|
| 1136 | - * |
|
| 1137 | - */ |
|
| 1133 | + * Gets all the spotter information based on the aircraft type |
|
| 1134 | + * |
|
| 1135 | + * @return Array the spotter information |
|
| 1136 | + * |
|
| 1137 | + */ |
|
| 1138 | 1138 | public function getSpotterDataByAircraft($aircraft_type = '', $limit = '', $sort = '') |
| 1139 | 1139 | { |
| 1140 | 1140 | global $global_query; |
@@ -1187,11 +1187,11 @@ discard block |
||
| 1187 | 1187 | |
| 1188 | 1188 | |
| 1189 | 1189 | /** |
| 1190 | - * Gets all the spotter information based on the aircraft registration |
|
| 1191 | - * |
|
| 1192 | - * @return Array the spotter information |
|
| 1193 | - * |
|
| 1194 | - */ |
|
| 1190 | + * Gets all the spotter information based on the aircraft registration |
|
| 1191 | + * |
|
| 1192 | + * @return Array the spotter information |
|
| 1193 | + * |
|
| 1194 | + */ |
|
| 1195 | 1195 | public function getSpotterDataByRegistration($registration = '', $limit = '', $sort = '') |
| 1196 | 1196 | { |
| 1197 | 1197 | global $global_query; |
@@ -1246,11 +1246,11 @@ discard block |
||
| 1246 | 1246 | |
| 1247 | 1247 | |
| 1248 | 1248 | /** |
| 1249 | - * Gets all the spotter information based on the airline |
|
| 1250 | - * |
|
| 1251 | - * @return Array the spotter information |
|
| 1252 | - * |
|
| 1253 | - */ |
|
| 1249 | + * Gets all the spotter information based on the airline |
|
| 1250 | + * |
|
| 1251 | + * @return Array the spotter information |
|
| 1252 | + * |
|
| 1253 | + */ |
|
| 1254 | 1254 | public function getSpotterDataByAirline($airline = '', $limit = '', $sort = '') |
| 1255 | 1255 | { |
| 1256 | 1256 | global $global_query; |
@@ -1302,11 +1302,11 @@ discard block |
||
| 1302 | 1302 | |
| 1303 | 1303 | |
| 1304 | 1304 | /** |
| 1305 | - * Gets all the spotter information based on the airport |
|
| 1306 | - * |
|
| 1307 | - * @return Array the spotter information |
|
| 1308 | - * |
|
| 1309 | - */ |
|
| 1305 | + * Gets all the spotter information based on the airport |
|
| 1306 | + * |
|
| 1307 | + * @return Array the spotter information |
|
| 1308 | + * |
|
| 1309 | + */ |
|
| 1310 | 1310 | public function getSpotterDataByAirport($airport = '', $limit = '', $sort = '') |
| 1311 | 1311 | { |
| 1312 | 1312 | global $global_query; |
@@ -1359,11 +1359,11 @@ discard block |
||
| 1359 | 1359 | |
| 1360 | 1360 | |
| 1361 | 1361 | /** |
| 1362 | - * Gets all the spotter information based on the date |
|
| 1363 | - * |
|
| 1364 | - * @return Array the spotter information |
|
| 1365 | - * |
|
| 1366 | - */ |
|
| 1362 | + * Gets all the spotter information based on the date |
|
| 1363 | + * |
|
| 1364 | + * @return Array the spotter information |
|
| 1365 | + * |
|
| 1366 | + */ |
|
| 1367 | 1367 | public function getSpotterDataByDate($date = '', $limit = '', $sort = '') |
| 1368 | 1368 | { |
| 1369 | 1369 | global $global_query, $globalTimezone, $globalDBdriver; |
@@ -1424,11 +1424,11 @@ discard block |
||
| 1424 | 1424 | |
| 1425 | 1425 | |
| 1426 | 1426 | /** |
| 1427 | - * Gets all the spotter information based on the country name |
|
| 1428 | - * |
|
| 1429 | - * @return Array the spotter information |
|
| 1430 | - * |
|
| 1431 | - */ |
|
| 1427 | + * Gets all the spotter information based on the country name |
|
| 1428 | + * |
|
| 1429 | + * @return Array the spotter information |
|
| 1430 | + * |
|
| 1431 | + */ |
|
| 1432 | 1432 | public function getSpotterDataByCountry($country = '', $limit = '', $sort = '') |
| 1433 | 1433 | { |
| 1434 | 1434 | global $global_query; |
@@ -1481,11 +1481,11 @@ discard block |
||
| 1481 | 1481 | |
| 1482 | 1482 | |
| 1483 | 1483 | /** |
| 1484 | - * Gets all the spotter information based on the manufacturer name |
|
| 1485 | - * |
|
| 1486 | - * @return Array the spotter information |
|
| 1487 | - * |
|
| 1488 | - */ |
|
| 1484 | + * Gets all the spotter information based on the manufacturer name |
|
| 1485 | + * |
|
| 1486 | + * @return Array the spotter information |
|
| 1487 | + * |
|
| 1488 | + */ |
|
| 1489 | 1489 | public function getSpotterDataByManufacturer($aircraft_manufacturer = '', $limit = '', $sort = '') |
| 1490 | 1490 | { |
| 1491 | 1491 | global $global_query; |
@@ -1540,13 +1540,13 @@ discard block |
||
| 1540 | 1540 | |
| 1541 | 1541 | |
| 1542 | 1542 | /** |
| 1543 | - * Gets a list of all aircraft that take a route |
|
| 1544 | - * |
|
| 1545 | - * @param String $departure_airport_icao ICAO code of departure airport |
|
| 1546 | - * @param String $arrival_airport_icao ICAO code of arrival airport |
|
| 1547 | - * @return Array the spotter information |
|
| 1548 | - * |
|
| 1549 | - */ |
|
| 1543 | + * Gets a list of all aircraft that take a route |
|
| 1544 | + * |
|
| 1545 | + * @param String $departure_airport_icao ICAO code of departure airport |
|
| 1546 | + * @param String $arrival_airport_icao ICAO code of arrival airport |
|
| 1547 | + * @return Array the spotter information |
|
| 1548 | + * |
|
| 1549 | + */ |
|
| 1550 | 1550 | public function getSpotterDataByRoute($departure_airport_icao = '', $arrival_airport_icao = '', $limit = '', $sort = '') |
| 1551 | 1551 | { |
| 1552 | 1552 | global $global_query; |
@@ -1612,11 +1612,11 @@ discard block |
||
| 1612 | 1612 | |
| 1613 | 1613 | |
| 1614 | 1614 | /** |
| 1615 | - * Gets all the spotter information based on the special column in the table |
|
| 1616 | - * |
|
| 1617 | - * @return Array the spotter information |
|
| 1618 | - * |
|
| 1619 | - */ |
|
| 1615 | + * Gets all the spotter information based on the special column in the table |
|
| 1616 | + * |
|
| 1617 | + * @return Array the spotter information |
|
| 1618 | + * |
|
| 1619 | + */ |
|
| 1620 | 1620 | public function getSpotterDataByHighlight($limit = '', $sort = '') |
| 1621 | 1621 | { |
| 1622 | 1622 | global $global_query; |
@@ -1655,12 +1655,12 @@ discard block |
||
| 1655 | 1655 | |
| 1656 | 1656 | |
| 1657 | 1657 | |
| 1658 | - /** |
|
| 1659 | - * Gets all the highlight based on a aircraft registration |
|
| 1660 | - * |
|
| 1661 | - * @return String the highlight text |
|
| 1662 | - * |
|
| 1663 | - */ |
|
| 1658 | + /** |
|
| 1659 | + * Gets all the highlight based on a aircraft registration |
|
| 1660 | + * |
|
| 1661 | + * @return String the highlight text |
|
| 1662 | + * |
|
| 1663 | + */ |
|
| 1664 | 1664 | public function getHighlightByRegistration($registration) |
| 1665 | 1665 | { |
| 1666 | 1666 | global $global_query; |
@@ -1683,13 +1683,13 @@ discard block |
||
| 1683 | 1683 | |
| 1684 | 1684 | |
| 1685 | 1685 | /** |
| 1686 | - * Gets the squawk usage from squawk code |
|
| 1687 | - * |
|
| 1688 | - * @param String $squawk squawk code |
|
| 1689 | - * @param String $country country |
|
| 1690 | - * @return String usage |
|
| 1691 | - * |
|
| 1692 | - */ |
|
| 1686 | + * Gets the squawk usage from squawk code |
|
| 1687 | + * |
|
| 1688 | + * @param String $squawk squawk code |
|
| 1689 | + * @param String $country country |
|
| 1690 | + * @return String usage |
|
| 1691 | + * |
|
| 1692 | + */ |
|
| 1693 | 1693 | public function getSquawkUsage($squawk = '',$country = 'FR') |
| 1694 | 1694 | { |
| 1695 | 1695 | |
@@ -1709,12 +1709,12 @@ discard block |
||
| 1709 | 1709 | } |
| 1710 | 1710 | |
| 1711 | 1711 | /** |
| 1712 | - * Gets the airport icao from the iata |
|
| 1713 | - * |
|
| 1714 | - * @param String $airport_iata the iata code of the airport |
|
| 1715 | - * @return String airport iata |
|
| 1716 | - * |
|
| 1717 | - */ |
|
| 1712 | + * Gets the airport icao from the iata |
|
| 1713 | + * |
|
| 1714 | + * @param String $airport_iata the iata code of the airport |
|
| 1715 | + * @return String airport iata |
|
| 1716 | + * |
|
| 1717 | + */ |
|
| 1718 | 1718 | public function getAirportIcao($airport_iata = '') |
| 1719 | 1719 | { |
| 1720 | 1720 | |
@@ -1733,14 +1733,14 @@ discard block |
||
| 1733 | 1733 | } |
| 1734 | 1734 | |
| 1735 | 1735 | /** |
| 1736 | - * Gets the airport distance |
|
| 1737 | - * |
|
| 1738 | - * @param String $airport_icao the icao code of the airport |
|
| 1739 | - * @param Float $latitude the latitude |
|
| 1740 | - * @param Float $longitude the longitude |
|
| 1741 | - * @return Float distance to the airport |
|
| 1742 | - * |
|
| 1743 | - */ |
|
| 1736 | + * Gets the airport distance |
|
| 1737 | + * |
|
| 1738 | + * @param String $airport_icao the icao code of the airport |
|
| 1739 | + * @param Float $latitude the latitude |
|
| 1740 | + * @param Float $longitude the longitude |
|
| 1741 | + * @return Float distance to the airport |
|
| 1742 | + * |
|
| 1743 | + */ |
|
| 1744 | 1744 | public function getAirportDistance($airport_icao,$latitude,$longitude) |
| 1745 | 1745 | { |
| 1746 | 1746 | |
@@ -1760,12 +1760,12 @@ discard block |
||
| 1760 | 1760 | } |
| 1761 | 1761 | |
| 1762 | 1762 | /** |
| 1763 | - * Gets the airport info based on the icao |
|
| 1764 | - * |
|
| 1765 | - * @param String $airport the icao code of the airport |
|
| 1766 | - * @return Array airport information |
|
| 1767 | - * |
|
| 1768 | - */ |
|
| 1763 | + * Gets the airport info based on the icao |
|
| 1764 | + * |
|
| 1765 | + * @param String $airport the icao code of the airport |
|
| 1766 | + * @return Array airport information |
|
| 1767 | + * |
|
| 1768 | + */ |
|
| 1769 | 1769 | public function getAllAirportInfo($airport = '') |
| 1770 | 1770 | { |
| 1771 | 1771 | |
@@ -1811,12 +1811,12 @@ discard block |
||
| 1811 | 1811 | } |
| 1812 | 1812 | |
| 1813 | 1813 | /** |
| 1814 | - * Gets the airport info based on the country |
|
| 1815 | - * |
|
| 1816 | - * @param Array $countries Airports countries |
|
| 1817 | - * @return Array airport information |
|
| 1818 | - * |
|
| 1819 | - */ |
|
| 1814 | + * Gets the airport info based on the country |
|
| 1815 | + * |
|
| 1816 | + * @param Array $countries Airports countries |
|
| 1817 | + * @return Array airport information |
|
| 1818 | + * |
|
| 1819 | + */ |
|
| 1820 | 1820 | public function getAllAirportInfobyCountry($countries) |
| 1821 | 1821 | { |
| 1822 | 1822 | $lst_countries = ''; |
@@ -1854,12 +1854,12 @@ discard block |
||
| 1854 | 1854 | } |
| 1855 | 1855 | |
| 1856 | 1856 | /** |
| 1857 | - * Gets airports info based on the coord |
|
| 1858 | - * |
|
| 1859 | - * @param Array $coord Airports longitude min,latitude min, longitude max, latitude max |
|
| 1860 | - * @return Array airport information |
|
| 1861 | - * |
|
| 1862 | - */ |
|
| 1857 | + * Gets airports info based on the coord |
|
| 1858 | + * |
|
| 1859 | + * @param Array $coord Airports longitude min,latitude min, longitude max, latitude max |
|
| 1860 | + * @return Array airport information |
|
| 1861 | + * |
|
| 1862 | + */ |
|
| 1863 | 1863 | public function getAllAirportInfobyCoord($coord) |
| 1864 | 1864 | { |
| 1865 | 1865 | global $globalDBdriver; |
@@ -1890,12 +1890,12 @@ discard block |
||
| 1890 | 1890 | } |
| 1891 | 1891 | |
| 1892 | 1892 | /** |
| 1893 | - * Gets waypoints info based on the coord |
|
| 1894 | - * |
|
| 1895 | - * @param Array $coord waypoints coord |
|
| 1896 | - * @return Array airport information |
|
| 1897 | - * |
|
| 1898 | - */ |
|
| 1893 | + * Gets waypoints info based on the coord |
|
| 1894 | + * |
|
| 1895 | + * @param Array $coord waypoints coord |
|
| 1896 | + * @return Array airport information |
|
| 1897 | + * |
|
| 1898 | + */ |
|
| 1899 | 1899 | public function getAllWaypointsInfobyCoord($coord) |
| 1900 | 1900 | { |
| 1901 | 1901 | if (is_array($coord)) { |
@@ -1929,12 +1929,12 @@ discard block |
||
| 1929 | 1929 | |
| 1930 | 1930 | |
| 1931 | 1931 | /** |
| 1932 | - * Gets the airline info based on the icao code or iata code |
|
| 1933 | - * |
|
| 1934 | - * @param String $airline_icao the iata code of the airport |
|
| 1935 | - * @return Array airport information |
|
| 1936 | - * |
|
| 1937 | - */ |
|
| 1932 | + * Gets the airline info based on the icao code or iata code |
|
| 1933 | + * |
|
| 1934 | + * @param String $airline_icao the iata code of the airport |
|
| 1935 | + * @return Array airport information |
|
| 1936 | + * |
|
| 1937 | + */ |
|
| 1938 | 1938 | public function getAllAirlineInfo($airline_icao) |
| 1939 | 1939 | { |
| 1940 | 1940 | $airline_icao = strtoupper(filter_var($airline_icao,FILTER_SANITIZE_STRING)); |
@@ -1951,7 +1951,7 @@ discard block |
||
| 1951 | 1951 | |
| 1952 | 1952 | $sth = $this->db->prepare($query); |
| 1953 | 1953 | $sth->execute(array(':airline_icao' => $airline_icao)); |
| 1954 | - /* |
|
| 1954 | + /* |
|
| 1955 | 1955 | $airline_array = array(); |
| 1956 | 1956 | $temp_array = array(); |
| 1957 | 1957 | |
@@ -1974,12 +1974,12 @@ discard block |
||
| 1974 | 1974 | |
| 1975 | 1975 | |
| 1976 | 1976 | /** |
| 1977 | - * Gets the aircraft info based on the aircraft type |
|
| 1978 | - * |
|
| 1979 | - * @param String $aircraft_type the aircraft type |
|
| 1980 | - * @return Array aircraft information |
|
| 1981 | - * |
|
| 1982 | - */ |
|
| 1977 | + * Gets the aircraft info based on the aircraft type |
|
| 1978 | + * |
|
| 1979 | + * @param String $aircraft_type the aircraft type |
|
| 1980 | + * @return Array aircraft information |
|
| 1981 | + * |
|
| 1982 | + */ |
|
| 1983 | 1983 | public function getAllAircraftInfo($aircraft_type) |
| 1984 | 1984 | { |
| 1985 | 1985 | $aircraft_type = filter_var($aircraft_type,FILTER_SANITIZE_STRING); |
@@ -2011,12 +2011,12 @@ discard block |
||
| 2011 | 2011 | } |
| 2012 | 2012 | |
| 2013 | 2013 | /** |
| 2014 | - * Gets the aircraft icao based on the aircraft name/type |
|
| 2015 | - * |
|
| 2016 | - * @param String $aircraft_type the aircraft type |
|
| 2017 | - * @return String aircraft information |
|
| 2018 | - * |
|
| 2019 | - */ |
|
| 2014 | + * Gets the aircraft icao based on the aircraft name/type |
|
| 2015 | + * |
|
| 2016 | + * @param String $aircraft_type the aircraft type |
|
| 2017 | + * @return String aircraft information |
|
| 2018 | + * |
|
| 2019 | + */ |
|
| 2020 | 2020 | public function getAircraftIcao($aircraft_type) |
| 2021 | 2021 | { |
| 2022 | 2022 | $aircraft_type = filter_var($aircraft_type,FILTER_SANITIZE_STRING); |
@@ -2041,12 +2041,12 @@ discard block |
||
| 2041 | 2041 | } |
| 2042 | 2042 | |
| 2043 | 2043 | /** |
| 2044 | - * Gets the aircraft info based on the aircraft ident |
|
| 2045 | - * |
|
| 2046 | - * @param String $aircraft_modes the aircraft ident (hex) |
|
| 2047 | - * @return String aircraft type |
|
| 2048 | - * |
|
| 2049 | - */ |
|
| 2044 | + * Gets the aircraft info based on the aircraft ident |
|
| 2045 | + * |
|
| 2046 | + * @param String $aircraft_modes the aircraft ident (hex) |
|
| 2047 | + * @return String aircraft type |
|
| 2048 | + * |
|
| 2049 | + */ |
|
| 2050 | 2050 | public function getAllAircraftType($aircraft_modes) |
| 2051 | 2051 | { |
| 2052 | 2052 | $aircraft_modes = filter_var($aircraft_modes,FILTER_SANITIZE_STRING); |
@@ -2063,12 +2063,12 @@ discard block |
||
| 2063 | 2063 | } |
| 2064 | 2064 | |
| 2065 | 2065 | /** |
| 2066 | - * Gets correct aircraft operator corde |
|
| 2067 | - * |
|
| 2068 | - * @param String $operator the aircraft operator code (callsign) |
|
| 2069 | - * @return String aircraft operator code |
|
| 2070 | - * |
|
| 2071 | - */ |
|
| 2066 | + * Gets correct aircraft operator corde |
|
| 2067 | + * |
|
| 2068 | + * @param String $operator the aircraft operator code (callsign) |
|
| 2069 | + * @return String aircraft operator code |
|
| 2070 | + * |
|
| 2071 | + */ |
|
| 2072 | 2072 | public function getOperator($operator) |
| 2073 | 2073 | { |
| 2074 | 2074 | $operator = filter_var($operator,FILTER_SANITIZE_STRING); |
@@ -2084,16 +2084,16 @@ discard block |
||
| 2084 | 2084 | } |
| 2085 | 2085 | |
| 2086 | 2086 | /** |
| 2087 | - * Gets the aircraft route based on the aircraft callsign |
|
| 2088 | - * |
|
| 2089 | - * @param String $callsign the aircraft callsign |
|
| 2090 | - * @return Array aircraft type |
|
| 2091 | - * |
|
| 2092 | - */ |
|
| 2087 | + * Gets the aircraft route based on the aircraft callsign |
|
| 2088 | + * |
|
| 2089 | + * @param String $callsign the aircraft callsign |
|
| 2090 | + * @return Array aircraft type |
|
| 2091 | + * |
|
| 2092 | + */ |
|
| 2093 | 2093 | public function getRouteInfo($callsign) |
| 2094 | 2094 | { |
| 2095 | 2095 | $callsign = filter_var($callsign,FILTER_SANITIZE_STRING); |
| 2096 | - if ($callsign == '') return array(); |
|
| 2096 | + if ($callsign == '') return array(); |
|
| 2097 | 2097 | $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"; |
| 2098 | 2098 | |
| 2099 | 2099 | $sth = $this->db->prepare($query); |
@@ -2106,12 +2106,12 @@ discard block |
||
| 2106 | 2106 | } |
| 2107 | 2107 | |
| 2108 | 2108 | /** |
| 2109 | - * Gets the aircraft info based on the aircraft registration |
|
| 2110 | - * |
|
| 2111 | - * @param String $registration the aircraft registration |
|
| 2112 | - * @return Array aircraft information |
|
| 2113 | - * |
|
| 2114 | - */ |
|
| 2109 | + * Gets the aircraft info based on the aircraft registration |
|
| 2110 | + * |
|
| 2111 | + * @param String $registration the aircraft registration |
|
| 2112 | + * @return Array aircraft information |
|
| 2113 | + * |
|
| 2114 | + */ |
|
| 2115 | 2115 | public function getAircraftInfoByRegistration($registration) |
| 2116 | 2116 | { |
| 2117 | 2117 | $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
@@ -2138,12 +2138,12 @@ discard block |
||
| 2138 | 2138 | } |
| 2139 | 2139 | |
| 2140 | 2140 | /** |
| 2141 | - * Gets the aircraft owner & base based on the aircraft registration |
|
| 2142 | - * |
|
| 2143 | - * @param String $registration the aircraft registration |
|
| 2144 | - * @return Array aircraft information |
|
| 2145 | - * |
|
| 2146 | - */ |
|
| 2141 | + * Gets the aircraft owner & base based on the aircraft registration |
|
| 2142 | + * |
|
| 2143 | + * @param String $registration the aircraft registration |
|
| 2144 | + * @return Array aircraft information |
|
| 2145 | + * |
|
| 2146 | + */ |
|
| 2147 | 2147 | public function getAircraftOwnerByRegistration($registration) |
| 2148 | 2148 | { |
| 2149 | 2149 | $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
@@ -2159,11 +2159,11 @@ discard block |
||
| 2159 | 2159 | |
| 2160 | 2160 | |
| 2161 | 2161 | /** |
| 2162 | - * Gets all flights (but with only little info) |
|
| 2163 | - * |
|
| 2164 | - * @return Array basic flight information |
|
| 2165 | - * |
|
| 2166 | - */ |
|
| 2162 | + * Gets all flights (but with only little info) |
|
| 2163 | + * |
|
| 2164 | + * @return Array basic flight information |
|
| 2165 | + * |
|
| 2166 | + */ |
|
| 2167 | 2167 | public function getAllFlightsforSitemap() |
| 2168 | 2168 | { |
| 2169 | 2169 | //$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 "; |
@@ -2171,7 +2171,7 @@ discard block |
||
| 2171 | 2171 | |
| 2172 | 2172 | $sth = $this->db->prepare($query); |
| 2173 | 2173 | $sth->execute(); |
| 2174 | - /* |
|
| 2174 | + /* |
|
| 2175 | 2175 | $flight_array = array(); |
| 2176 | 2176 | $temp_array = array(); |
| 2177 | 2177 | |
@@ -2193,11 +2193,11 @@ discard block |
||
| 2193 | 2193 | } |
| 2194 | 2194 | |
| 2195 | 2195 | /** |
| 2196 | - * Gets a list of all aircraft manufacturers |
|
| 2197 | - * |
|
| 2198 | - * @return Array list of aircraft types |
|
| 2199 | - * |
|
| 2200 | - */ |
|
| 2196 | + * Gets a list of all aircraft manufacturers |
|
| 2197 | + * |
|
| 2198 | + * @return Array list of aircraft types |
|
| 2199 | + * |
|
| 2200 | + */ |
|
| 2201 | 2201 | public function getAllManufacturers() |
| 2202 | 2202 | { |
| 2203 | 2203 | /* |
@@ -2226,11 +2226,11 @@ discard block |
||
| 2226 | 2226 | |
| 2227 | 2227 | |
| 2228 | 2228 | /** |
| 2229 | - * Gets a list of all aircraft types |
|
| 2230 | - * |
|
| 2231 | - * @return Array list of aircraft types |
|
| 2232 | - * |
|
| 2233 | - */ |
|
| 2229 | + * Gets a list of all aircraft types |
|
| 2230 | + * |
|
| 2231 | + * @return Array list of aircraft types |
|
| 2232 | + * |
|
| 2233 | + */ |
|
| 2234 | 2234 | public function getAllAircraftTypes() |
| 2235 | 2235 | { |
| 2236 | 2236 | /* |
@@ -2262,11 +2262,11 @@ discard block |
||
| 2262 | 2262 | |
| 2263 | 2263 | |
| 2264 | 2264 | /** |
| 2265 | - * Gets a list of all aircraft registrations |
|
| 2266 | - * |
|
| 2267 | - * @return Array list of aircraft registrations |
|
| 2268 | - * |
|
| 2269 | - */ |
|
| 2265 | + * Gets a list of all aircraft registrations |
|
| 2266 | + * |
|
| 2267 | + * @return Array list of aircraft registrations |
|
| 2268 | + * |
|
| 2269 | + */ |
|
| 2270 | 2270 | public function getAllAircraftRegistrations() |
| 2271 | 2271 | { |
| 2272 | 2272 | $query = "SELECT DISTINCT spotter_output.registration |
@@ -2291,12 +2291,12 @@ discard block |
||
| 2291 | 2291 | } |
| 2292 | 2292 | |
| 2293 | 2293 | /** |
| 2294 | - * Gets all source name |
|
| 2295 | - * |
|
| 2296 | - * @param String type format of source |
|
| 2297 | - * @return Array list of source name |
|
| 2298 | - * |
|
| 2299 | - */ |
|
| 2294 | + * Gets all source name |
|
| 2295 | + * |
|
| 2296 | + * @param String type format of source |
|
| 2297 | + * @return Array list of source name |
|
| 2298 | + * |
|
| 2299 | + */ |
|
| 2300 | 2300 | public function getAllSourceName($type = '') |
| 2301 | 2301 | { |
| 2302 | 2302 | $query_values = array(); |
@@ -2327,11 +2327,11 @@ discard block |
||
| 2327 | 2327 | |
| 2328 | 2328 | |
| 2329 | 2329 | /** |
| 2330 | - * Gets a list of all airline names |
|
| 2331 | - * |
|
| 2332 | - * @return Array list of airline names |
|
| 2333 | - * |
|
| 2334 | - */ |
|
| 2330 | + * Gets a list of all airline names |
|
| 2331 | + * |
|
| 2332 | + * @return Array list of airline names |
|
| 2333 | + * |
|
| 2334 | + */ |
|
| 2335 | 2335 | public function getAllAirlineNames($airline_type = '') |
| 2336 | 2336 | { |
| 2337 | 2337 | $airline_type = filter_var($airline_type,FILTER_SANITIZE_STRING); |
@@ -2374,11 +2374,11 @@ discard block |
||
| 2374 | 2374 | |
| 2375 | 2375 | |
| 2376 | 2376 | /** |
| 2377 | - * Gets a list of all airline countries |
|
| 2378 | - * |
|
| 2379 | - * @return Array list of airline countries |
|
| 2380 | - * |
|
| 2381 | - */ |
|
| 2377 | + * Gets a list of all airline countries |
|
| 2378 | + * |
|
| 2379 | + * @return Array list of airline countries |
|
| 2380 | + * |
|
| 2381 | + */ |
|
| 2382 | 2382 | public function getAllAirlineCountries() |
| 2383 | 2383 | { |
| 2384 | 2384 | |
@@ -2407,11 +2407,11 @@ discard block |
||
| 2407 | 2407 | |
| 2408 | 2408 | |
| 2409 | 2409 | /** |
| 2410 | - * Gets a list of all departure & arrival names |
|
| 2411 | - * |
|
| 2412 | - * @return Array list of airport names |
|
| 2413 | - * |
|
| 2414 | - */ |
|
| 2410 | + * Gets a list of all departure & arrival names |
|
| 2411 | + * |
|
| 2412 | + * @return Array list of airport names |
|
| 2413 | + * |
|
| 2414 | + */ |
|
| 2415 | 2415 | public function getAllAirportNames() |
| 2416 | 2416 | { |
| 2417 | 2417 | $airport_array = array(); |
@@ -2462,11 +2462,11 @@ discard block |
||
| 2462 | 2462 | |
| 2463 | 2463 | |
| 2464 | 2464 | /** |
| 2465 | - * Gets a list of all departure & arrival airport countries |
|
| 2466 | - * |
|
| 2467 | - * @return Array list of airport countries |
|
| 2468 | - * |
|
| 2469 | - */ |
|
| 2465 | + * Gets a list of all departure & arrival airport countries |
|
| 2466 | + * |
|
| 2467 | + * @return Array list of airport countries |
|
| 2468 | + * |
|
| 2469 | + */ |
|
| 2470 | 2470 | public function getAllAirportCountries() |
| 2471 | 2471 | { |
| 2472 | 2472 | $airport_array = array(); |
@@ -2515,11 +2515,11 @@ discard block |
||
| 2515 | 2515 | |
| 2516 | 2516 | |
| 2517 | 2517 | /** |
| 2518 | - * Gets a list of all countries (airline, departure airport & arrival airport) |
|
| 2519 | - * |
|
| 2520 | - * @return Array list of countries |
|
| 2521 | - * |
|
| 2522 | - */ |
|
| 2518 | + * Gets a list of all countries (airline, departure airport & arrival airport) |
|
| 2519 | + * |
|
| 2520 | + * @return Array list of countries |
|
| 2521 | + * |
|
| 2522 | + */ |
|
| 2523 | 2523 | public function getAllCountries() |
| 2524 | 2524 | { |
| 2525 | 2525 | $Connection= new Connection($this->db); |
@@ -2604,11 +2604,11 @@ discard block |
||
| 2604 | 2604 | |
| 2605 | 2605 | |
| 2606 | 2606 | /** |
| 2607 | - * Gets a list of all idents/callsigns |
|
| 2608 | - * |
|
| 2609 | - * @return Array list of ident/callsign names |
|
| 2610 | - * |
|
| 2611 | - */ |
|
| 2607 | + * Gets a list of all idents/callsigns |
|
| 2608 | + * |
|
| 2609 | + * @return Array list of ident/callsign names |
|
| 2610 | + * |
|
| 2611 | + */ |
|
| 2612 | 2612 | public function getAllIdents() |
| 2613 | 2613 | { |
| 2614 | 2614 | $query = "SELECT DISTINCT spotter_output.ident |
@@ -2632,9 +2632,9 @@ discard block |
||
| 2632 | 2632 | } |
| 2633 | 2633 | |
| 2634 | 2634 | /** |
| 2635 | - * Get a list of flights from airport since 7 days |
|
| 2636 | - * @return Array number, icao, name and city of airports |
|
| 2637 | - */ |
|
| 2635 | + * Get a list of flights from airport since 7 days |
|
| 2636 | + * @return Array number, icao, name and city of airports |
|
| 2637 | + */ |
|
| 2638 | 2638 | |
| 2639 | 2639 | public function getLast7DaysAirportsDeparture($airport_icao = '') { |
| 2640 | 2640 | global $globalTimezone, $globalDBdriver; |
@@ -2664,9 +2664,9 @@ discard block |
||
| 2664 | 2664 | } |
| 2665 | 2665 | |
| 2666 | 2666 | /** |
| 2667 | - * Get a list of flights from detected airport since 7 days |
|
| 2668 | - * @return Array number, icao, name and city of airports |
|
| 2669 | - */ |
|
| 2667 | + * Get a list of flights from detected airport since 7 days |
|
| 2668 | + * @return Array number, icao, name and city of airports |
|
| 2669 | + */ |
|
| 2670 | 2670 | |
| 2671 | 2671 | public function getLast7DaysDetectedAirportsDeparture($airport_icao = '') { |
| 2672 | 2672 | global $globalTimezone, $globalDBdriver; |
@@ -2707,9 +2707,9 @@ discard block |
||
| 2707 | 2707 | } |
| 2708 | 2708 | |
| 2709 | 2709 | /** |
| 2710 | - * Get a list of flights to airport since 7 days |
|
| 2711 | - * @return Array number, icao, name and city of airports |
|
| 2712 | - */ |
|
| 2710 | + * Get a list of flights to airport since 7 days |
|
| 2711 | + * @return Array number, icao, name and city of airports |
|
| 2712 | + */ |
|
| 2713 | 2713 | |
| 2714 | 2714 | public function getLast7DaysAirportsArrival($airport_icao = '') { |
| 2715 | 2715 | global $globalTimezone, $globalDBdriver; |
@@ -2741,9 +2741,9 @@ discard block |
||
| 2741 | 2741 | |
| 2742 | 2742 | |
| 2743 | 2743 | /** |
| 2744 | - * Get a list of flights detected to airport since 7 days |
|
| 2745 | - * @return Array number, icao, name and city of airports |
|
| 2746 | - */ |
|
| 2744 | + * Get a list of flights detected to airport since 7 days |
|
| 2745 | + * @return Array number, icao, name and city of airports |
|
| 2746 | + */ |
|
| 2747 | 2747 | |
| 2748 | 2748 | public function getLast7DaysDetectedAirportsArrival($airport_icao = '') { |
| 2749 | 2749 | global $globalTimezone, $globalDBdriver; |
@@ -2787,11 +2787,11 @@ discard block |
||
| 2787 | 2787 | |
| 2788 | 2788 | |
| 2789 | 2789 | /** |
| 2790 | - * Gets a list of all dates |
|
| 2791 | - * |
|
| 2792 | - * @return Array list of date names |
|
| 2793 | - * |
|
| 2794 | - */ |
|
| 2790 | + * Gets a list of all dates |
|
| 2791 | + * |
|
| 2792 | + * @return Array list of date names |
|
| 2793 | + * |
|
| 2794 | + */ |
|
| 2795 | 2795 | public function getAllDates() |
| 2796 | 2796 | { |
| 2797 | 2797 | global $globalTimezone, $globalDBdriver; |
@@ -2832,11 +2832,11 @@ discard block |
||
| 2832 | 2832 | |
| 2833 | 2833 | |
| 2834 | 2834 | /** |
| 2835 | - * Gets all route combinations |
|
| 2836 | - * |
|
| 2837 | - * @return Array the route list |
|
| 2838 | - * |
|
| 2839 | - */ |
|
| 2835 | + * Gets all route combinations |
|
| 2836 | + * |
|
| 2837 | + * @return Array the route list |
|
| 2838 | + * |
|
| 2839 | + */ |
|
| 2840 | 2840 | public function getAllRoutes() |
| 2841 | 2841 | { |
| 2842 | 2842 | $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 |
@@ -2862,13 +2862,13 @@ discard block |
||
| 2862 | 2862 | } |
| 2863 | 2863 | |
| 2864 | 2864 | /** |
| 2865 | - * Update ident spotter data |
|
| 2866 | - * |
|
| 2867 | - * @param String $flightaware_id the ID from flightaware |
|
| 2868 | - * @param String $ident the flight ident |
|
| 2869 | - * @return String success or false |
|
| 2870 | - * |
|
| 2871 | - */ |
|
| 2865 | + * Update ident spotter data |
|
| 2866 | + * |
|
| 2867 | + * @param String $flightaware_id the ID from flightaware |
|
| 2868 | + * @param String $ident the flight ident |
|
| 2869 | + * @return String success or false |
|
| 2870 | + * |
|
| 2871 | + */ |
|
| 2872 | 2872 | public function updateIdentSpotterData($flightaware_id = '', $ident = '') |
| 2873 | 2873 | { |
| 2874 | 2874 | if (!is_numeric(substr($ident, 0, 3))) |
@@ -2889,14 +2889,14 @@ discard block |
||
| 2889 | 2889 | } else { |
| 2890 | 2890 | $airline_array = $this->getAllAirlineInfo("NA"); |
| 2891 | 2891 | } |
| 2892 | - $airline_name = $airline_array[0]['name']; |
|
| 2893 | - $airline_icao = $airline_array[0]['icao']; |
|
| 2894 | - $airline_country = $airline_array[0]['country']; |
|
| 2895 | - $airline_type = $airline_array[0]['type']; |
|
| 2892 | + $airline_name = $airline_array[0]['name']; |
|
| 2893 | + $airline_icao = $airline_array[0]['icao']; |
|
| 2894 | + $airline_country = $airline_array[0]['country']; |
|
| 2895 | + $airline_type = $airline_array[0]['type']; |
|
| 2896 | 2896 | |
| 2897 | 2897 | |
| 2898 | 2898 | $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'; |
| 2899 | - $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); |
|
| 2899 | + $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); |
|
| 2900 | 2900 | |
| 2901 | 2901 | try { |
| 2902 | 2902 | $sth = $this->db->prepare($query); |
@@ -2909,21 +2909,21 @@ discard block |
||
| 2909 | 2909 | |
| 2910 | 2910 | } |
| 2911 | 2911 | /** |
| 2912 | - * Update latest spotter data |
|
| 2913 | - * |
|
| 2914 | - * @param String $flightaware_id the ID from flightaware |
|
| 2915 | - * @param String $ident the flight ident |
|
| 2916 | - * @param String $aircraft_icao the aircraft type |
|
| 2917 | - * @param String $departure_airport_icao the departure airport |
|
| 2918 | - * @param String $arrival_airport_icao the arrival airport |
|
| 2919 | - * @return String success or false |
|
| 2920 | - * |
|
| 2921 | - */ |
|
| 2912 | + * Update latest spotter data |
|
| 2913 | + * |
|
| 2914 | + * @param String $flightaware_id the ID from flightaware |
|
| 2915 | + * @param String $ident the flight ident |
|
| 2916 | + * @param String $aircraft_icao the aircraft type |
|
| 2917 | + * @param String $departure_airport_icao the departure airport |
|
| 2918 | + * @param String $arrival_airport_icao the arrival airport |
|
| 2919 | + * @return String success or false |
|
| 2920 | + * |
|
| 2921 | + */ |
|
| 2922 | 2922 | public function updateLatestSpotterData($flightaware_id = '', $ident = '', $latitude = '', $longitude = '', $altitude = '', $ground = false, $groundspeed = NULL, $date = '', $arrival_airport_icao = '',$arrival_airport_time = '') |
| 2923 | 2923 | { |
| 2924 | 2924 | if ($groundspeed == '') $groundspeed = NULL; |
| 2925 | 2925 | $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'; |
| 2926 | - $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); |
|
| 2926 | + $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); |
|
| 2927 | 2927 | |
| 2928 | 2928 | try { |
| 2929 | 2929 | $sth = $this->db->prepare($query); |
@@ -2937,32 +2937,32 @@ discard block |
||
| 2937 | 2937 | } |
| 2938 | 2938 | |
| 2939 | 2939 | /** |
| 2940 | - * Adds a new spotter data |
|
| 2941 | - * |
|
| 2942 | - * @param String $flightaware_id the ID from flightaware |
|
| 2943 | - * @param String $ident the flight ident |
|
| 2944 | - * @param String $aircraft_icao the aircraft type |
|
| 2945 | - * @param String $departure_airport_icao the departure airport |
|
| 2946 | - * @param String $arrival_airport_icao the arrival airport |
|
| 2947 | - * @param String $latitude latitude of flight |
|
| 2948 | - * @param String $longitude latitude of flight |
|
| 2949 | - * @param String $waypoints waypoints of flight |
|
| 2950 | - * @param String $altitude altitude of flight |
|
| 2951 | - * @param String $heading heading of flight |
|
| 2952 | - * @param String $groundspeed speed of flight |
|
| 2953 | - * @param String $date date of flight |
|
| 2954 | - * @param String $departure_airport_time departure time of flight |
|
| 2955 | - * @param String $arrival_airport_time arrival time of flight |
|
| 2956 | - * @param String $squawk squawk code of flight |
|
| 2957 | - * @param String $route_stop route stop of flight |
|
| 2958 | - * @param String $highlight highlight or not |
|
| 2959 | - * @param String $ModeS ModesS code of flight |
|
| 2960 | - * @param String $registration registration code of flight |
|
| 2961 | - * @param String $pilot_id pilot id of flight (for virtual airlines) |
|
| 2962 | - * @param String $pilot_name pilot name of flight (for virtual airlines) |
|
| 2963 | - * @param String $verticalrate vertival rate of flight |
|
| 2964 | - * @return String success or false |
|
| 2965 | - */ |
|
| 2940 | + * Adds a new spotter data |
|
| 2941 | + * |
|
| 2942 | + * @param String $flightaware_id the ID from flightaware |
|
| 2943 | + * @param String $ident the flight ident |
|
| 2944 | + * @param String $aircraft_icao the aircraft type |
|
| 2945 | + * @param String $departure_airport_icao the departure airport |
|
| 2946 | + * @param String $arrival_airport_icao the arrival airport |
|
| 2947 | + * @param String $latitude latitude of flight |
|
| 2948 | + * @param String $longitude latitude of flight |
|
| 2949 | + * @param String $waypoints waypoints of flight |
|
| 2950 | + * @param String $altitude altitude of flight |
|
| 2951 | + * @param String $heading heading of flight |
|
| 2952 | + * @param String $groundspeed speed of flight |
|
| 2953 | + * @param String $date date of flight |
|
| 2954 | + * @param String $departure_airport_time departure time of flight |
|
| 2955 | + * @param String $arrival_airport_time arrival time of flight |
|
| 2956 | + * @param String $squawk squawk code of flight |
|
| 2957 | + * @param String $route_stop route stop of flight |
|
| 2958 | + * @param String $highlight highlight or not |
|
| 2959 | + * @param String $ModeS ModesS code of flight |
|
| 2960 | + * @param String $registration registration code of flight |
|
| 2961 | + * @param String $pilot_id pilot id of flight (for virtual airlines) |
|
| 2962 | + * @param String $pilot_name pilot name of flight (for virtual airlines) |
|
| 2963 | + * @param String $verticalrate vertival rate of flight |
|
| 2964 | + * @return String success or false |
|
| 2965 | + */ |
|
| 2966 | 2966 | public function addSpotterData($flightaware_id = '', $ident = '', $aircraft_icao = '', $departure_airport_icao = '', $arrival_airport_icao = '', $latitude = '', $longitude = '', $waypoints = '', $altitude = '', $heading = '', $groundspeed = '', $date = '', $departure_airport_time = '', $arrival_airport_time = '',$squawk = '', $route_stop = '', $highlight = '', $ModeS = '', $registration = '',$pilot_id = '', $pilot_name = '', $verticalrate = '', $ground = false,$format_source = '', $source_name = '') |
| 2967 | 2967 | { |
| 2968 | 2968 | global $globalURL, $globalIVAO, $globalVATSIM, $globalphpVMS, $globalDebugTimeElapsed; |
@@ -3170,8 +3170,8 @@ discard block |
||
| 3170 | 3170 | |
| 3171 | 3171 | if ($globalIVAO && $aircraft_icao != '') |
| 3172 | 3172 | { |
| 3173 | - if (isset($airline_array[0]['icao'])) $airline_icao = $airline_array[0]['icao']; |
|
| 3174 | - else $airline_icao = ''; |
|
| 3173 | + if (isset($airline_array[0]['icao'])) $airline_icao = $airline_array[0]['icao']; |
|
| 3174 | + else $airline_icao = ''; |
|
| 3175 | 3175 | $image_array = $Image->getSpotterImage('',$aircraft_icao,$airline_icao); |
| 3176 | 3176 | if (!isset($image_array[0]['registration'])) |
| 3177 | 3177 | { |
@@ -3202,48 +3202,48 @@ discard block |
||
| 3202 | 3202 | |
| 3203 | 3203 | if (count($airline_array) == 0) |
| 3204 | 3204 | { |
| 3205 | - $airline_array = $this->getAllAirlineInfo('NA'); |
|
| 3206 | - } |
|
| 3207 | - if (count($aircraft_array) == 0) |
|
| 3208 | - { |
|
| 3209 | - $aircraft_array = $this->getAllAircraftInfo('NA'); |
|
| 3210 | - } |
|
| 3211 | - if (count($departure_airport_array) == 0) |
|
| 3212 | - { |
|
| 3213 | - $departure_airport_array = $this->getAllAirportInfo('NA'); |
|
| 3214 | - } |
|
| 3215 | - if (count($arrival_airport_array) == 0) |
|
| 3216 | - { |
|
| 3217 | - $arrival_airport_array = $this->getAllAirportInfo('NA'); |
|
| 3218 | - } |
|
| 3219 | - if ($registration == '') $registration = 'NA'; |
|
| 3220 | - if ($squawk == '' || $Common->isInteger($squawk) === false) $squawk = NULL; |
|
| 3221 | - if ($verticalrate == '' || $Common->isInteger($verticalrate) === false) $verticalrate = NULL; |
|
| 3222 | - if ($heading == '' || $Common->isInteger($heading) == false) $heading = 0; |
|
| 3223 | - if ($groundspeed == '' || $Common->isInteger($groundspeed) === false) $groundspeed = 0; |
|
| 3224 | - if (!isset($aircraft_owner)) $aircraft_owner = NULL; |
|
| 3225 | - $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) |
|
| 3205 | + $airline_array = $this->getAllAirlineInfo('NA'); |
|
| 3206 | + } |
|
| 3207 | + if (count($aircraft_array) == 0) |
|
| 3208 | + { |
|
| 3209 | + $aircraft_array = $this->getAllAircraftInfo('NA'); |
|
| 3210 | + } |
|
| 3211 | + if (count($departure_airport_array) == 0) |
|
| 3212 | + { |
|
| 3213 | + $departure_airport_array = $this->getAllAirportInfo('NA'); |
|
| 3214 | + } |
|
| 3215 | + if (count($arrival_airport_array) == 0) |
|
| 3216 | + { |
|
| 3217 | + $arrival_airport_array = $this->getAllAirportInfo('NA'); |
|
| 3218 | + } |
|
| 3219 | + if ($registration == '') $registration = 'NA'; |
|
| 3220 | + if ($squawk == '' || $Common->isInteger($squawk) === false) $squawk = NULL; |
|
| 3221 | + if ($verticalrate == '' || $Common->isInteger($verticalrate) === false) $verticalrate = NULL; |
|
| 3222 | + if ($heading == '' || $Common->isInteger($heading) == false) $heading = 0; |
|
| 3223 | + if ($groundspeed == '' || $Common->isInteger($groundspeed) === false) $groundspeed = 0; |
|
| 3224 | + if (!isset($aircraft_owner)) $aircraft_owner = NULL; |
|
| 3225 | + $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) |
|
| 3226 | 3226 | 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)"; |
| 3227 | 3227 | |
| 3228 | - $airline_name = $airline_array[0]['name']; |
|
| 3229 | - $airline_icao = $airline_array[0]['icao']; |
|
| 3230 | - $airline_country = $airline_array[0]['country']; |
|
| 3231 | - $airline_type = $airline_array[0]['type']; |
|
| 3228 | + $airline_name = $airline_array[0]['name']; |
|
| 3229 | + $airline_icao = $airline_array[0]['icao']; |
|
| 3230 | + $airline_country = $airline_array[0]['country']; |
|
| 3231 | + $airline_type = $airline_array[0]['type']; |
|
| 3232 | 3232 | if ($airline_type == '') { |
| 3233 | 3233 | $timeelapsed = microtime(true); |
| 3234 | 3234 | $airline_type = $this->getAircraftTypeBymodeS($ModeS); |
| 3235 | 3235 | if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftTypeBymodes : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
| 3236 | 3236 | } |
| 3237 | 3237 | if ($airline_type == null) $airline_type = ''; |
| 3238 | - $aircraft_type = $aircraft_array[0]['type']; |
|
| 3239 | - $aircraft_manufacturer = $aircraft_array[0]['manufacturer']; |
|
| 3240 | - $departure_airport_name = $departure_airport_array[0]['name']; |
|
| 3241 | - $departure_airport_city = $departure_airport_array[0]['city']; |
|
| 3242 | - $departure_airport_country = $departure_airport_array[0]['country']; |
|
| 3243 | - $arrival_airport_name = $arrival_airport_array[0]['name']; |
|
| 3244 | - $arrival_airport_city = $arrival_airport_array[0]['city']; |
|
| 3245 | - $arrival_airport_country = $arrival_airport_array[0]['country']; |
|
| 3246 | - $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); |
|
| 3238 | + $aircraft_type = $aircraft_array[0]['type']; |
|
| 3239 | + $aircraft_manufacturer = $aircraft_array[0]['manufacturer']; |
|
| 3240 | + $departure_airport_name = $departure_airport_array[0]['name']; |
|
| 3241 | + $departure_airport_city = $departure_airport_array[0]['city']; |
|
| 3242 | + $departure_airport_country = $departure_airport_array[0]['country']; |
|
| 3243 | + $arrival_airport_name = $arrival_airport_array[0]['name']; |
|
| 3244 | + $arrival_airport_city = $arrival_airport_array[0]['city']; |
|
| 3245 | + $arrival_airport_country = $arrival_airport_array[0]['country']; |
|
| 3246 | + $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); |
|
| 3247 | 3247 | |
| 3248 | 3248 | try { |
| 3249 | 3249 | |
@@ -3251,7 +3251,7 @@ discard block |
||
| 3251 | 3251 | $sth->execute($query_values); |
| 3252 | 3252 | $this->db = null; |
| 3253 | 3253 | } catch (PDOException $e) { |
| 3254 | - return "error : ".$e->getMessage(); |
|
| 3254 | + return "error : ".$e->getMessage(); |
|
| 3255 | 3255 | } |
| 3256 | 3256 | |
| 3257 | 3257 | return "success"; |
@@ -3260,11 +3260,11 @@ discard block |
||
| 3260 | 3260 | |
| 3261 | 3261 | |
| 3262 | 3262 | /** |
| 3263 | - * Gets the aircraft ident within the last hour |
|
| 3264 | - * |
|
| 3265 | - * @return String the ident |
|
| 3266 | - * |
|
| 3267 | - */ |
|
| 3263 | + * Gets the aircraft ident within the last hour |
|
| 3264 | + * |
|
| 3265 | + * @return String the ident |
|
| 3266 | + * |
|
| 3267 | + */ |
|
| 3268 | 3268 | public function getIdentFromLastHour($ident) |
| 3269 | 3269 | { |
| 3270 | 3270 | global $globalDBdriver, $globalTimezone; |
@@ -3280,11 +3280,11 @@ discard block |
||
| 3280 | 3280 | AND spotter_output.date >= now() AT TIME ZONE 'UTC' - INTERVAL '1 HOURS' |
| 3281 | 3281 | AND spotter_output.date < now() AT TIME ZONE 'UTC'"; |
| 3282 | 3282 | $query_data = array(':ident' => $ident); |
| 3283 | - } |
|
| 3283 | + } |
|
| 3284 | 3284 | |
| 3285 | 3285 | $sth = $this->db->prepare($query); |
| 3286 | 3286 | $sth->execute($query_data); |
| 3287 | - $ident_result=''; |
|
| 3287 | + $ident_result=''; |
|
| 3288 | 3288 | while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
| 3289 | 3289 | { |
| 3290 | 3290 | $ident_result = $row['ident']; |
@@ -3295,11 +3295,11 @@ discard block |
||
| 3295 | 3295 | |
| 3296 | 3296 | |
| 3297 | 3297 | /** |
| 3298 | - * Gets the aircraft data from the last 20 seconds |
|
| 3299 | - * |
|
| 3300 | - * @return Array the spotter data |
|
| 3301 | - * |
|
| 3302 | - */ |
|
| 3298 | + * Gets the aircraft data from the last 20 seconds |
|
| 3299 | + * |
|
| 3300 | + * @return Array the spotter data |
|
| 3301 | + * |
|
| 3302 | + */ |
|
| 3303 | 3303 | public function getRealTimeData($q = '') |
| 3304 | 3304 | { |
| 3305 | 3305 | global $globalDBdriver; |
@@ -3343,11 +3343,11 @@ discard block |
||
| 3343 | 3343 | |
| 3344 | 3344 | |
| 3345 | 3345 | /** |
| 3346 | - * Gets all airlines that have flown over |
|
| 3347 | - * |
|
| 3348 | - * @return Array the airline list |
|
| 3349 | - * |
|
| 3350 | - */ |
|
| 3346 | + * Gets all airlines that have flown over |
|
| 3347 | + * |
|
| 3348 | + * @return Array the airline list |
|
| 3349 | + * |
|
| 3350 | + */ |
|
| 3351 | 3351 | public function countAllAirlines($limit = true, $olderthanmonths = 0, $sincedate = '') |
| 3352 | 3352 | { |
| 3353 | 3353 | global $globalDBdriver; |
@@ -3361,7 +3361,7 @@ discard block |
||
| 3361 | 3361 | $query .= "AND date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
| 3362 | 3362 | } |
| 3363 | 3363 | } |
| 3364 | - if ($sincedate != '') { |
|
| 3364 | + if ($sincedate != '') { |
|
| 3365 | 3365 | if ($globalDBdriver == 'mysql') { |
| 3366 | 3366 | $query .= "AND date > '".$sincedate."' "; |
| 3367 | 3367 | } else { |
@@ -3388,26 +3388,26 @@ discard block |
||
| 3388 | 3388 | } |
| 3389 | 3389 | |
| 3390 | 3390 | /** |
| 3391 | - * Gets all pilots that have flown over |
|
| 3392 | - * |
|
| 3393 | - * @return Array the pilots list |
|
| 3394 | - * |
|
| 3395 | - */ |
|
| 3391 | + * Gets all pilots that have flown over |
|
| 3392 | + * |
|
| 3393 | + * @return Array the pilots list |
|
| 3394 | + * |
|
| 3395 | + */ |
|
| 3396 | 3396 | public function countAllPilots($limit = true, $olderthanmonths = 0, $sincedate = '') |
| 3397 | 3397 | { |
| 3398 | 3398 | global $globalDBdriver; |
| 3399 | 3399 | $query = "SELECT DISTINCT spotter_output.pilot_id, spotter_output.pilot_name, COUNT(spotter_output.pilot_id) AS pilot_count |
| 3400 | 3400 | FROM spotter_output |
| 3401 | 3401 | WHERE spotter_output.pilot_id <> '' "; |
| 3402 | - if ($olderthanmonths > 0) { |
|
| 3403 | - if ($globalDBdriver == 'mysql') { |
|
| 3402 | + if ($olderthanmonths > 0) { |
|
| 3403 | + if ($globalDBdriver == 'mysql') { |
|
| 3404 | 3404 | $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) '; |
| 3405 | 3405 | } else { |
| 3406 | 3406 | $query .= "AND date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
| 3407 | 3407 | } |
| 3408 | 3408 | } |
| 3409 | - if ($sincedate != '') { |
|
| 3410 | - if ($globalDBdriver == 'mysql') { |
|
| 3409 | + if ($sincedate != '') { |
|
| 3410 | + if ($globalDBdriver == 'mysql') { |
|
| 3411 | 3411 | $query .= "AND date > '".$sincedate."' "; |
| 3412 | 3412 | } else { |
| 3413 | 3413 | $query .= "AND date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -3434,26 +3434,26 @@ discard block |
||
| 3434 | 3434 | } |
| 3435 | 3435 | |
| 3436 | 3436 | /** |
| 3437 | - * Gets all owner that have flown over |
|
| 3438 | - * |
|
| 3439 | - * @return Array the pilots list |
|
| 3440 | - * |
|
| 3441 | - */ |
|
| 3437 | + * Gets all owner that have flown over |
|
| 3438 | + * |
|
| 3439 | + * @return Array the pilots list |
|
| 3440 | + * |
|
| 3441 | + */ |
|
| 3442 | 3442 | public function countAllOwners($limit = true, $olderthanmonths = 0, $sincedate = '') |
| 3443 | 3443 | { |
| 3444 | 3444 | global $globalDBdriver; |
| 3445 | 3445 | $query = "SELECT DISTINCT spotter_output.owner_name, COUNT(spotter_output.owner_name) AS owner_count |
| 3446 | 3446 | FROM spotter_output |
| 3447 | 3447 | WHERE spotter_output.owner_name <> '' AND spotter_output.owner_name IS NOT NULL "; |
| 3448 | - if ($olderthanmonths > 0) { |
|
| 3449 | - if ($globalDBdriver == 'mysql') { |
|
| 3448 | + if ($olderthanmonths > 0) { |
|
| 3449 | + if ($globalDBdriver == 'mysql') { |
|
| 3450 | 3450 | $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) '; |
| 3451 | 3451 | } else { |
| 3452 | 3452 | $query .= "AND date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
| 3453 | 3453 | } |
| 3454 | 3454 | } |
| 3455 | - if ($sincedate != '') { |
|
| 3456 | - if ($globalDBdriver == 'mysql') { |
|
| 3455 | + if ($sincedate != '') { |
|
| 3456 | + if ($globalDBdriver == 'mysql') { |
|
| 3457 | 3457 | $query .= "AND date > '".$sincedate."' "; |
| 3458 | 3458 | } else { |
| 3459 | 3459 | $query .= "AND date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -3480,11 +3480,11 @@ discard block |
||
| 3480 | 3480 | |
| 3481 | 3481 | |
| 3482 | 3482 | /** |
| 3483 | - * Gets all airlines that have flown over by aircraft |
|
| 3484 | - * |
|
| 3485 | - * @return Array the airline list |
|
| 3486 | - * |
|
| 3487 | - */ |
|
| 3483 | + * Gets all airlines that have flown over by aircraft |
|
| 3484 | + * |
|
| 3485 | + * @return Array the airline list |
|
| 3486 | + * |
|
| 3487 | + */ |
|
| 3488 | 3488 | public function countAllAirlinesByAircraft($aircraft_icao) |
| 3489 | 3489 | { |
| 3490 | 3490 | $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
@@ -3517,11 +3517,11 @@ discard block |
||
| 3517 | 3517 | |
| 3518 | 3518 | |
| 3519 | 3519 | /** |
| 3520 | - * Gets all airline countries that have flown over by aircraft |
|
| 3521 | - * |
|
| 3522 | - * @return Array the airline country list |
|
| 3523 | - * |
|
| 3524 | - */ |
|
| 3520 | + * Gets all airline countries that have flown over by aircraft |
|
| 3521 | + * |
|
| 3522 | + * @return Array the airline country list |
|
| 3523 | + * |
|
| 3524 | + */ |
|
| 3525 | 3525 | public function countAllAirlineCountriesByAircraft($aircraft_icao) |
| 3526 | 3526 | { |
| 3527 | 3527 | $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
@@ -3554,11 +3554,11 @@ discard block |
||
| 3554 | 3554 | |
| 3555 | 3555 | |
| 3556 | 3556 | /** |
| 3557 | - * Gets all airlines that have flown over by airport |
|
| 3558 | - * |
|
| 3559 | - * @return Array the airline list |
|
| 3560 | - * |
|
| 3561 | - */ |
|
| 3557 | + * Gets all airlines that have flown over by airport |
|
| 3558 | + * |
|
| 3559 | + * @return Array the airline list |
|
| 3560 | + * |
|
| 3561 | + */ |
|
| 3562 | 3562 | public function countAllAirlinesByAirport($airport_icao) |
| 3563 | 3563 | { |
| 3564 | 3564 | $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
@@ -3590,11 +3590,11 @@ discard block |
||
| 3590 | 3590 | |
| 3591 | 3591 | |
| 3592 | 3592 | /** |
| 3593 | - * Gets all airline countries that have flown over by airport icao |
|
| 3594 | - * |
|
| 3595 | - * @return Array the airline country list |
|
| 3596 | - * |
|
| 3597 | - */ |
|
| 3593 | + * Gets all airline countries that have flown over by airport icao |
|
| 3594 | + * |
|
| 3595 | + * @return Array the airline country list |
|
| 3596 | + * |
|
| 3597 | + */ |
|
| 3598 | 3598 | public function countAllAirlineCountriesByAirport($airport_icao) |
| 3599 | 3599 | { |
| 3600 | 3600 | $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
@@ -3625,11 +3625,11 @@ discard block |
||
| 3625 | 3625 | |
| 3626 | 3626 | |
| 3627 | 3627 | /** |
| 3628 | - * Gets all airlines that have flown over by aircraft manufacturer |
|
| 3629 | - * |
|
| 3630 | - * @return Array the airline list |
|
| 3631 | - * |
|
| 3632 | - */ |
|
| 3628 | + * Gets all airlines that have flown over by aircraft manufacturer |
|
| 3629 | + * |
|
| 3630 | + * @return Array the airline list |
|
| 3631 | + * |
|
| 3632 | + */ |
|
| 3633 | 3633 | public function countAllAirlinesByManufacturer($aircraft_manufacturer) |
| 3634 | 3634 | { |
| 3635 | 3635 | $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
@@ -3661,11 +3661,11 @@ discard block |
||
| 3661 | 3661 | |
| 3662 | 3662 | |
| 3663 | 3663 | /** |
| 3664 | - * Gets all airline countries that have flown over by aircraft manufacturer |
|
| 3665 | - * |
|
| 3666 | - * @return Array the airline country list |
|
| 3667 | - * |
|
| 3668 | - */ |
|
| 3664 | + * Gets all airline countries that have flown over by aircraft manufacturer |
|
| 3665 | + * |
|
| 3666 | + * @return Array the airline country list |
|
| 3667 | + * |
|
| 3668 | + */ |
|
| 3669 | 3669 | public function countAllAirlineCountriesByManufacturer($aircraft_manufacturer) |
| 3670 | 3670 | { |
| 3671 | 3671 | $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
@@ -3695,11 +3695,11 @@ discard block |
||
| 3695 | 3695 | |
| 3696 | 3696 | |
| 3697 | 3697 | /** |
| 3698 | - * Gets all airlines that have flown over by date |
|
| 3699 | - * |
|
| 3700 | - * @return Array the airline list |
|
| 3701 | - * |
|
| 3702 | - */ |
|
| 3698 | + * Gets all airlines that have flown over by date |
|
| 3699 | + * |
|
| 3700 | + * @return Array the airline list |
|
| 3701 | + * |
|
| 3702 | + */ |
|
| 3703 | 3703 | public function countAllAirlinesByDate($date) |
| 3704 | 3704 | { |
| 3705 | 3705 | global $globalTimezone, $globalDBdriver; |
@@ -3745,11 +3745,11 @@ discard block |
||
| 3745 | 3745 | |
| 3746 | 3746 | |
| 3747 | 3747 | /** |
| 3748 | - * Gets all airline countries that have flown over by date |
|
| 3749 | - * |
|
| 3750 | - * @return Array the airline country list |
|
| 3751 | - * |
|
| 3752 | - */ |
|
| 3748 | + * Gets all airline countries that have flown over by date |
|
| 3749 | + * |
|
| 3750 | + * @return Array the airline country list |
|
| 3751 | + * |
|
| 3752 | + */ |
|
| 3753 | 3753 | public function countAllAirlineCountriesByDate($date) |
| 3754 | 3754 | { |
| 3755 | 3755 | global $globalTimezone, $globalDBdriver; |
@@ -3793,11 +3793,11 @@ discard block |
||
| 3793 | 3793 | |
| 3794 | 3794 | |
| 3795 | 3795 | /** |
| 3796 | - * Gets all airlines that have flown over by ident/callsign |
|
| 3797 | - * |
|
| 3798 | - * @return Array the airline list |
|
| 3799 | - * |
|
| 3800 | - */ |
|
| 3796 | + * Gets all airlines that have flown over by ident/callsign |
|
| 3797 | + * |
|
| 3798 | + * @return Array the airline list |
|
| 3799 | + * |
|
| 3800 | + */ |
|
| 3801 | 3801 | public function countAllAirlinesByIdent($ident) |
| 3802 | 3802 | { |
| 3803 | 3803 | $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
@@ -3828,11 +3828,11 @@ discard block |
||
| 3828 | 3828 | } |
| 3829 | 3829 | |
| 3830 | 3830 | /** |
| 3831 | - * Gets all airlines that have flown over by route |
|
| 3832 | - * |
|
| 3833 | - * @return Array the airline list |
|
| 3834 | - * |
|
| 3835 | - */ |
|
| 3831 | + * Gets all airlines that have flown over by route |
|
| 3832 | + * |
|
| 3833 | + * @return Array the airline list |
|
| 3834 | + * |
|
| 3835 | + */ |
|
| 3836 | 3836 | public function countAllAirlinesByRoute($departure_airport_icao, $arrival_airport_icao) |
| 3837 | 3837 | { |
| 3838 | 3838 | $departure_airport_icao = filter_var($departure_airport_icao,FILTER_SANITIZE_STRING); |
@@ -3864,11 +3864,11 @@ discard block |
||
| 3864 | 3864 | } |
| 3865 | 3865 | |
| 3866 | 3866 | /** |
| 3867 | - * Gets all airline countries that have flown over by route |
|
| 3868 | - * |
|
| 3869 | - * @return Array the airline country list |
|
| 3870 | - * |
|
| 3871 | - */ |
|
| 3867 | + * Gets all airline countries that have flown over by route |
|
| 3868 | + * |
|
| 3869 | + * @return Array the airline country list |
|
| 3870 | + * |
|
| 3871 | + */ |
|
| 3872 | 3872 | public function countAllAirlineCountriesByRoute($departure_airport_icao, $arrival_airport_icao) |
| 3873 | 3873 | { |
| 3874 | 3874 | $departure_airport_icao = filter_var($departure_airport_icao,FILTER_SANITIZE_STRING); |
@@ -3900,11 +3900,11 @@ discard block |
||
| 3900 | 3900 | |
| 3901 | 3901 | |
| 3902 | 3902 | /** |
| 3903 | - * Gets all airlines that have flown over by country |
|
| 3904 | - * |
|
| 3905 | - * @return Array the airline list |
|
| 3906 | - * |
|
| 3907 | - */ |
|
| 3903 | + * Gets all airlines that have flown over by country |
|
| 3904 | + * |
|
| 3905 | + * @return Array the airline list |
|
| 3906 | + * |
|
| 3907 | + */ |
|
| 3908 | 3908 | public function countAllAirlinesByCountry($country) |
| 3909 | 3909 | { |
| 3910 | 3910 | $country = filter_var($country,FILTER_SANITIZE_STRING); |
@@ -3935,11 +3935,11 @@ discard block |
||
| 3935 | 3935 | |
| 3936 | 3936 | |
| 3937 | 3937 | /** |
| 3938 | - * Gets all airline countries that have flown over by country |
|
| 3939 | - * |
|
| 3940 | - * @return Array the airline country list |
|
| 3941 | - * |
|
| 3942 | - */ |
|
| 3938 | + * Gets all airline countries that have flown over by country |
|
| 3939 | + * |
|
| 3940 | + * @return Array the airline country list |
|
| 3941 | + * |
|
| 3942 | + */ |
|
| 3943 | 3943 | public function countAllAirlineCountriesByCountry($country) |
| 3944 | 3944 | { |
| 3945 | 3945 | $country = filter_var($country,FILTER_SANITIZE_STRING); |
@@ -3969,11 +3969,11 @@ discard block |
||
| 3969 | 3969 | |
| 3970 | 3970 | |
| 3971 | 3971 | /** |
| 3972 | - * Gets all airlines countries |
|
| 3973 | - * |
|
| 3974 | - * @return Array the airline country list |
|
| 3975 | - * |
|
| 3976 | - */ |
|
| 3972 | + * Gets all airlines countries |
|
| 3973 | + * |
|
| 3974 | + * @return Array the airline country list |
|
| 3975 | + * |
|
| 3976 | + */ |
|
| 3977 | 3977 | public function countAllAirlineCountries($limit = true) |
| 3978 | 3978 | { |
| 3979 | 3979 | $query = "SELECT DISTINCT spotter_output.airline_country, COUNT(spotter_output.airline_country) AS airline_country_count |
@@ -3999,11 +3999,11 @@ discard block |
||
| 3999 | 3999 | } |
| 4000 | 4000 | |
| 4001 | 4001 | /** |
| 4002 | - * Gets all number of flight over countries |
|
| 4003 | - * |
|
| 4004 | - * @return Array the airline country list |
|
| 4005 | - * |
|
| 4006 | - */ |
|
| 4002 | + * Gets all number of flight over countries |
|
| 4003 | + * |
|
| 4004 | + * @return Array the airline country list |
|
| 4005 | + * |
|
| 4006 | + */ |
|
| 4007 | 4007 | public function countAllFlightOverCountries($limit = true,$olderthanmonths = 0,$sincedate = '') |
| 4008 | 4008 | { |
| 4009 | 4009 | global $globalDBdriver; |
@@ -4015,14 +4015,14 @@ discard block |
||
| 4015 | 4015 | $query = "SELECT c.name, c.iso3, c.iso2, count(c.name) as nb |
| 4016 | 4016 | FROM countries c, spotter_live s |
| 4017 | 4017 | WHERE c.iso2 = s.over_country "; |
| 4018 | - if ($olderthanmonths > 0) { |
|
| 4018 | + if ($olderthanmonths > 0) { |
|
| 4019 | 4019 | if ($globalDBdriver == 'mysql') { |
| 4020 | 4020 | $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
| 4021 | 4021 | } else { |
| 4022 | 4022 | $query .= "AND date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
| 4023 | 4023 | } |
| 4024 | 4024 | } |
| 4025 | - if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
| 4025 | + if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
| 4026 | 4026 | $query .= "GROUP BY c.name ORDER BY nb DESC"; |
| 4027 | 4027 | if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
| 4028 | 4028 | |
@@ -4046,35 +4046,35 @@ discard block |
||
| 4046 | 4046 | |
| 4047 | 4047 | |
| 4048 | 4048 | /** |
| 4049 | - * Gets all aircraft types that have flown over |
|
| 4050 | - * |
|
| 4051 | - * @return Array the aircraft list |
|
| 4052 | - * |
|
| 4053 | - */ |
|
| 4049 | + * Gets all aircraft types that have flown over |
|
| 4050 | + * |
|
| 4051 | + * @return Array the aircraft list |
|
| 4052 | + * |
|
| 4053 | + */ |
|
| 4054 | 4054 | public function countAllAircraftTypes($limit = true,$olderthanmonths = 0,$sincedate = '') |
| 4055 | 4055 | { |
| 4056 | 4056 | global $globalDBdriver; |
| 4057 | 4057 | $query = "SELECT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name |
| 4058 | 4058 | FROM spotter_output |
| 4059 | 4059 | WHERE spotter_output.aircraft_name <> '' AND spotter_output.aircraft_icao <> '' "; |
| 4060 | - if ($olderthanmonths > 0) { |
|
| 4061 | - if ($globalDBdriver == 'mysql') { |
|
| 4060 | + if ($olderthanmonths > 0) { |
|
| 4061 | + if ($globalDBdriver == 'mysql') { |
|
| 4062 | 4062 | $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) '; |
| 4063 | 4063 | } else { |
| 4064 | 4064 | $query .= "AND date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
| 4065 | 4065 | } |
| 4066 | - } |
|
| 4067 | - if ($sincedate != '') { |
|
| 4068 | - if ($globalDBdriver == 'mysql') { |
|
| 4066 | + } |
|
| 4067 | + if ($sincedate != '') { |
|
| 4068 | + if ($globalDBdriver == 'mysql') { |
|
| 4069 | 4069 | $query .= "AND date > '".$sincedate."' "; |
| 4070 | 4070 | } else { |
| 4071 | 4071 | $query .= "AND date > CAST('".$sincedate."' AS TIMESTAMP)"; |
| 4072 | 4072 | } |
| 4073 | 4073 | } |
| 4074 | 4074 | |
| 4075 | - //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
| 4076 | - //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
| 4077 | - $query .= "GROUP BY spotter_output.aircraft_icao, spotter_output.aircraft_name ORDER BY aircraft_icao_count DESC"; |
|
| 4075 | + //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
| 4076 | + //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
| 4077 | + $query .= "GROUP BY spotter_output.aircraft_icao, spotter_output.aircraft_name ORDER BY aircraft_icao_count DESC"; |
|
| 4078 | 4078 | if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
| 4079 | 4079 | |
| 4080 | 4080 | |
@@ -4097,11 +4097,11 @@ discard block |
||
| 4097 | 4097 | |
| 4098 | 4098 | |
| 4099 | 4099 | /** |
| 4100 | - * Gets all aircraft registration that have flown over by aircaft icao |
|
| 4101 | - * |
|
| 4102 | - * @return Array the aircraft list |
|
| 4103 | - * |
|
| 4104 | - */ |
|
| 4100 | + * Gets all aircraft registration that have flown over by aircaft icao |
|
| 4101 | + * |
|
| 4102 | + * @return Array the aircraft list |
|
| 4103 | + * |
|
| 4104 | + */ |
|
| 4105 | 4105 | public function countAllAircraftRegistrationByAircraft($aircraft_icao) |
| 4106 | 4106 | { |
| 4107 | 4107 | $Image = new Image($this->db); |
@@ -4140,11 +4140,11 @@ discard block |
||
| 4140 | 4140 | |
| 4141 | 4141 | |
| 4142 | 4142 | /** |
| 4143 | - * Gets all aircraft types that have flown over by airline icao |
|
| 4144 | - * |
|
| 4145 | - * @return Array the aircraft list |
|
| 4146 | - * |
|
| 4147 | - */ |
|
| 4143 | + * Gets all aircraft types that have flown over by airline icao |
|
| 4144 | + * |
|
| 4145 | + * @return Array the aircraft list |
|
| 4146 | + * |
|
| 4147 | + */ |
|
| 4148 | 4148 | public function countAllAircraftTypesByAirline($airline_icao) |
| 4149 | 4149 | { |
| 4150 | 4150 | $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING); |
@@ -4174,11 +4174,11 @@ discard block |
||
| 4174 | 4174 | |
| 4175 | 4175 | |
| 4176 | 4176 | /** |
| 4177 | - * Gets all aircraft registration that have flown over by airline icao |
|
| 4178 | - * |
|
| 4179 | - * @return Array the aircraft list |
|
| 4180 | - * |
|
| 4181 | - */ |
|
| 4177 | + * Gets all aircraft registration that have flown over by airline icao |
|
| 4178 | + * |
|
| 4179 | + * @return Array the aircraft list |
|
| 4180 | + * |
|
| 4181 | + */ |
|
| 4182 | 4182 | public function countAllAircraftRegistrationByAirline($airline_icao) |
| 4183 | 4183 | { |
| 4184 | 4184 | $Image = new Image($this->db); |
@@ -4216,11 +4216,11 @@ discard block |
||
| 4216 | 4216 | |
| 4217 | 4217 | |
| 4218 | 4218 | /** |
| 4219 | - * Gets all aircraft manufacturer that have flown over by airline icao |
|
| 4220 | - * |
|
| 4221 | - * @return Array the aircraft list |
|
| 4222 | - * |
|
| 4223 | - */ |
|
| 4219 | + * Gets all aircraft manufacturer that have flown over by airline icao |
|
| 4220 | + * |
|
| 4221 | + * @return Array the aircraft list |
|
| 4222 | + * |
|
| 4223 | + */ |
|
| 4224 | 4224 | public function countAllAircraftManufacturerByAirline($airline_icao) |
| 4225 | 4225 | { |
| 4226 | 4226 | $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING); |
@@ -4249,11 +4249,11 @@ discard block |
||
| 4249 | 4249 | |
| 4250 | 4250 | |
| 4251 | 4251 | /** |
| 4252 | - * Gets all aircraft types that have flown over by airline icao |
|
| 4253 | - * |
|
| 4254 | - * @return Array the aircraft list |
|
| 4255 | - * |
|
| 4256 | - */ |
|
| 4252 | + * Gets all aircraft types that have flown over by airline icao |
|
| 4253 | + * |
|
| 4254 | + * @return Array the aircraft list |
|
| 4255 | + * |
|
| 4256 | + */ |
|
| 4257 | 4257 | public function countAllAircraftTypesByAirport($airport_icao) |
| 4258 | 4258 | { |
| 4259 | 4259 | $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
@@ -4282,11 +4282,11 @@ discard block |
||
| 4282 | 4282 | |
| 4283 | 4283 | |
| 4284 | 4284 | /** |
| 4285 | - * Gets all aircraft registration that have flown over by airport icao |
|
| 4286 | - * |
|
| 4287 | - * @return Array the aircraft list |
|
| 4288 | - * |
|
| 4289 | - */ |
|
| 4285 | + * Gets all aircraft registration that have flown over by airport icao |
|
| 4286 | + * |
|
| 4287 | + * @return Array the aircraft list |
|
| 4288 | + * |
|
| 4289 | + */ |
|
| 4290 | 4290 | public function countAllAircraftRegistrationByAirport($airport_icao) |
| 4291 | 4291 | { |
| 4292 | 4292 | $Image = new Image($this->db); |
@@ -4324,11 +4324,11 @@ discard block |
||
| 4324 | 4324 | |
| 4325 | 4325 | |
| 4326 | 4326 | /** |
| 4327 | - * Gets all aircraft manufacturer that have flown over by airport icao |
|
| 4328 | - * |
|
| 4329 | - * @return Array the aircraft list |
|
| 4330 | - * |
|
| 4331 | - */ |
|
| 4327 | + * Gets all aircraft manufacturer that have flown over by airport icao |
|
| 4328 | + * |
|
| 4329 | + * @return Array the aircraft list |
|
| 4330 | + * |
|
| 4331 | + */ |
|
| 4332 | 4332 | public function countAllAircraftManufacturerByAirport($airport_icao) |
| 4333 | 4333 | { |
| 4334 | 4334 | $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
@@ -4355,11 +4355,11 @@ discard block |
||
| 4355 | 4355 | } |
| 4356 | 4356 | |
| 4357 | 4357 | /** |
| 4358 | - * Gets all aircraft types that have flown over by aircraft manufacturer |
|
| 4359 | - * |
|
| 4360 | - * @return Array the aircraft list |
|
| 4361 | - * |
|
| 4362 | - */ |
|
| 4358 | + * Gets all aircraft types that have flown over by aircraft manufacturer |
|
| 4359 | + * |
|
| 4360 | + * @return Array the aircraft list |
|
| 4361 | + * |
|
| 4362 | + */ |
|
| 4363 | 4363 | public function countAllAircraftTypesByManufacturer($aircraft_manufacturer) |
| 4364 | 4364 | { |
| 4365 | 4365 | $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
@@ -4386,11 +4386,11 @@ discard block |
||
| 4386 | 4386 | |
| 4387 | 4387 | |
| 4388 | 4388 | /** |
| 4389 | - * Gets all aircraft registration that have flown over by aircaft manufacturer |
|
| 4390 | - * |
|
| 4391 | - * @return Array the aircraft list |
|
| 4392 | - * |
|
| 4393 | - */ |
|
| 4389 | + * Gets all aircraft registration that have flown over by aircaft manufacturer |
|
| 4390 | + * |
|
| 4391 | + * @return Array the aircraft list |
|
| 4392 | + * |
|
| 4393 | + */ |
|
| 4394 | 4394 | public function countAllAircraftRegistrationByManufacturer($aircraft_manufacturer) |
| 4395 | 4395 | { |
| 4396 | 4396 | $Image = new Image($this->db); |
@@ -4426,11 +4426,11 @@ discard block |
||
| 4426 | 4426 | } |
| 4427 | 4427 | |
| 4428 | 4428 | /** |
| 4429 | - * Gets all aircraft types that have flown over by date |
|
| 4430 | - * |
|
| 4431 | - * @return Array the aircraft list |
|
| 4432 | - * |
|
| 4433 | - */ |
|
| 4429 | + * Gets all aircraft types that have flown over by date |
|
| 4430 | + * |
|
| 4431 | + * @return Array the aircraft list |
|
| 4432 | + * |
|
| 4433 | + */ |
|
| 4434 | 4434 | public function countAllAircraftTypesByDate($date) |
| 4435 | 4435 | { |
| 4436 | 4436 | global $globalTimezone, $globalDBdriver; |
@@ -4473,11 +4473,11 @@ discard block |
||
| 4473 | 4473 | |
| 4474 | 4474 | |
| 4475 | 4475 | /** |
| 4476 | - * Gets all aircraft registration that have flown over by date |
|
| 4477 | - * |
|
| 4478 | - * @return Array the aircraft list |
|
| 4479 | - * |
|
| 4480 | - */ |
|
| 4476 | + * Gets all aircraft registration that have flown over by date |
|
| 4477 | + * |
|
| 4478 | + * @return Array the aircraft list |
|
| 4479 | + * |
|
| 4480 | + */ |
|
| 4481 | 4481 | public function countAllAircraftRegistrationByDate($date) |
| 4482 | 4482 | { |
| 4483 | 4483 | global $globalTimezone, $globalDBdriver; |
@@ -4529,11 +4529,11 @@ discard block |
||
| 4529 | 4529 | |
| 4530 | 4530 | |
| 4531 | 4531 | /** |
| 4532 | - * Gets all aircraft manufacturer that have flown over by date |
|
| 4533 | - * |
|
| 4534 | - * @return Array the aircraft manufacturer list |
|
| 4535 | - * |
|
| 4536 | - */ |
|
| 4532 | + * Gets all aircraft manufacturer that have flown over by date |
|
| 4533 | + * |
|
| 4534 | + * @return Array the aircraft manufacturer list |
|
| 4535 | + * |
|
| 4536 | + */ |
|
| 4537 | 4537 | public function countAllAircraftManufacturerByDate($date) |
| 4538 | 4538 | { |
| 4539 | 4539 | global $globalTimezone, $globalDBdriver; |
@@ -4576,11 +4576,11 @@ discard block |
||
| 4576 | 4576 | |
| 4577 | 4577 | |
| 4578 | 4578 | /** |
| 4579 | - * Gets all aircraft types that have flown over by ident/callsign |
|
| 4580 | - * |
|
| 4581 | - * @return Array the aircraft list |
|
| 4582 | - * |
|
| 4583 | - */ |
|
| 4579 | + * Gets all aircraft types that have flown over by ident/callsign |
|
| 4580 | + * |
|
| 4581 | + * @return Array the aircraft list |
|
| 4582 | + * |
|
| 4583 | + */ |
|
| 4584 | 4584 | public function countAllAircraftTypesByIdent($ident) |
| 4585 | 4585 | { |
| 4586 | 4586 | $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
@@ -4610,11 +4610,11 @@ discard block |
||
| 4610 | 4610 | |
| 4611 | 4611 | |
| 4612 | 4612 | /** |
| 4613 | - * Gets all aircraft registration that have flown over by ident/callsign |
|
| 4614 | - * |
|
| 4615 | - * @return Array the aircraft list |
|
| 4616 | - * |
|
| 4617 | - */ |
|
| 4613 | + * Gets all aircraft registration that have flown over by ident/callsign |
|
| 4614 | + * |
|
| 4615 | + * @return Array the aircraft list |
|
| 4616 | + * |
|
| 4617 | + */ |
|
| 4618 | 4618 | public function countAllAircraftRegistrationByIdent($ident) |
| 4619 | 4619 | { |
| 4620 | 4620 | $Image = new Image($this->db); |
@@ -4654,11 +4654,11 @@ discard block |
||
| 4654 | 4654 | |
| 4655 | 4655 | |
| 4656 | 4656 | /** |
| 4657 | - * Gets all aircraft manufacturer that have flown over by ident/callsign |
|
| 4658 | - * |
|
| 4659 | - * @return Array the aircraft manufacturer list |
|
| 4660 | - * |
|
| 4661 | - */ |
|
| 4657 | + * Gets all aircraft manufacturer that have flown over by ident/callsign |
|
| 4658 | + * |
|
| 4659 | + * @return Array the aircraft manufacturer list |
|
| 4660 | + * |
|
| 4661 | + */ |
|
| 4662 | 4662 | public function countAllAircraftManufacturerByIdent($ident) |
| 4663 | 4663 | { |
| 4664 | 4664 | $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
@@ -4685,11 +4685,11 @@ discard block |
||
| 4685 | 4685 | |
| 4686 | 4686 | |
| 4687 | 4687 | /** |
| 4688 | - * Gets all aircraft types that have flown over by route |
|
| 4689 | - * |
|
| 4690 | - * @return Array the aircraft list |
|
| 4691 | - * |
|
| 4692 | - */ |
|
| 4688 | + * Gets all aircraft types that have flown over by route |
|
| 4689 | + * |
|
| 4690 | + * @return Array the aircraft list |
|
| 4691 | + * |
|
| 4692 | + */ |
|
| 4693 | 4693 | public function countAllAircraftTypesByRoute($departure_airport_icao, $arrival_airport_icao) |
| 4694 | 4694 | { |
| 4695 | 4695 | $departure_airport_icao = filter_var($departure_airport_icao,FILTER_SANITIZE_STRING); |
@@ -4718,11 +4718,11 @@ discard block |
||
| 4718 | 4718 | } |
| 4719 | 4719 | |
| 4720 | 4720 | /** |
| 4721 | - * Gets all aircraft registration that have flown over by route |
|
| 4722 | - * |
|
| 4723 | - * @return Array the aircraft list |
|
| 4724 | - * |
|
| 4725 | - */ |
|
| 4721 | + * Gets all aircraft registration that have flown over by route |
|
| 4722 | + * |
|
| 4723 | + * @return Array the aircraft list |
|
| 4724 | + * |
|
| 4725 | + */ |
|
| 4726 | 4726 | public function countAllAircraftRegistrationByRoute($departure_airport_icao, $arrival_airport_icao) |
| 4727 | 4727 | { |
| 4728 | 4728 | $Image = new Image($this->db); |
@@ -4764,11 +4764,11 @@ discard block |
||
| 4764 | 4764 | |
| 4765 | 4765 | |
| 4766 | 4766 | /** |
| 4767 | - * Gets all aircraft manufacturer that have flown over by route |
|
| 4768 | - * |
|
| 4769 | - * @return Array the aircraft manufacturer list |
|
| 4770 | - * |
|
| 4771 | - */ |
|
| 4767 | + * Gets all aircraft manufacturer that have flown over by route |
|
| 4768 | + * |
|
| 4769 | + * @return Array the aircraft manufacturer list |
|
| 4770 | + * |
|
| 4771 | + */ |
|
| 4772 | 4772 | public function countAllAircraftManufacturerByRoute($departure_airport_icao, $arrival_airport_icao) |
| 4773 | 4773 | { |
| 4774 | 4774 | $departure_airport_icao = filter_var($departure_airport_icao,FILTER_SANITIZE_STRING); |
@@ -4802,11 +4802,11 @@ discard block |
||
| 4802 | 4802 | |
| 4803 | 4803 | |
| 4804 | 4804 | /** |
| 4805 | - * Gets all aircraft types that have flown over by country |
|
| 4806 | - * |
|
| 4807 | - * @return Array the aircraft list |
|
| 4808 | - * |
|
| 4809 | - */ |
|
| 4805 | + * Gets all aircraft types that have flown over by country |
|
| 4806 | + * |
|
| 4807 | + * @return Array the aircraft list |
|
| 4808 | + * |
|
| 4809 | + */ |
|
| 4810 | 4810 | public function countAllAircraftTypesByCountry($country) |
| 4811 | 4811 | { |
| 4812 | 4812 | $country = filter_var($country,FILTER_SANITIZE_STRING); |
@@ -4838,11 +4838,11 @@ discard block |
||
| 4838 | 4838 | |
| 4839 | 4839 | |
| 4840 | 4840 | /** |
| 4841 | - * Gets all aircraft registration that have flown over by country |
|
| 4842 | - * |
|
| 4843 | - * @return Array the aircraft list |
|
| 4844 | - * |
|
| 4845 | - */ |
|
| 4841 | + * Gets all aircraft registration that have flown over by country |
|
| 4842 | + * |
|
| 4843 | + * @return Array the aircraft list |
|
| 4844 | + * |
|
| 4845 | + */ |
|
| 4846 | 4846 | public function countAllAircraftRegistrationByCountry($country) |
| 4847 | 4847 | { |
| 4848 | 4848 | $Image = new Image($this->db); |
@@ -4883,11 +4883,11 @@ discard block |
||
| 4883 | 4883 | |
| 4884 | 4884 | |
| 4885 | 4885 | /** |
| 4886 | - * Gets all aircraft manufacturer that have flown over by country |
|
| 4887 | - * |
|
| 4888 | - * @return Array the aircraft manufacturer list |
|
| 4889 | - * |
|
| 4890 | - */ |
|
| 4886 | + * Gets all aircraft manufacturer that have flown over by country |
|
| 4887 | + * |
|
| 4888 | + * @return Array the aircraft manufacturer list |
|
| 4889 | + * |
|
| 4890 | + */ |
|
| 4891 | 4891 | public function countAllAircraftManufacturerByCountry($country) |
| 4892 | 4892 | { |
| 4893 | 4893 | $country = filter_var($country,FILTER_SANITIZE_STRING); |
@@ -4919,11 +4919,11 @@ discard block |
||
| 4919 | 4919 | |
| 4920 | 4920 | |
| 4921 | 4921 | /** |
| 4922 | - * Gets all aircraft manufacturers that have flown over |
|
| 4923 | - * |
|
| 4924 | - * @return Array the aircraft list |
|
| 4925 | - * |
|
| 4926 | - */ |
|
| 4922 | + * Gets all aircraft manufacturers that have flown over |
|
| 4923 | + * |
|
| 4924 | + * @return Array the aircraft list |
|
| 4925 | + * |
|
| 4926 | + */ |
|
| 4927 | 4927 | public function countAllAircraftManufacturers() |
| 4928 | 4928 | { |
| 4929 | 4929 | $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
@@ -4954,11 +4954,11 @@ discard block |
||
| 4954 | 4954 | |
| 4955 | 4955 | |
| 4956 | 4956 | /** |
| 4957 | - * Gets all aircraft registrations that have flown over |
|
| 4958 | - * |
|
| 4959 | - * @return Array the aircraft list |
|
| 4960 | - * |
|
| 4961 | - */ |
|
| 4957 | + * Gets all aircraft registrations that have flown over |
|
| 4958 | + * |
|
| 4959 | + * @return Array the aircraft list |
|
| 4960 | + * |
|
| 4961 | + */ |
|
| 4962 | 4962 | public function countAllAircraftRegistrations($limit = true,$olderthanmonths = 0,$sincedate = '') |
| 4963 | 4963 | { |
| 4964 | 4964 | global $globalDBdriver; |
@@ -4966,15 +4966,15 @@ discard block |
||
| 4966 | 4966 | $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 |
| 4967 | 4967 | FROM spotter_output |
| 4968 | 4968 | WHERE spotter_output.registration <> '' AND spotter_output.registration <> 'NA' "; |
| 4969 | - if ($olderthanmonths > 0) { |
|
| 4970 | - if ($globalDBdriver == 'mysql') { |
|
| 4969 | + if ($olderthanmonths > 0) { |
|
| 4970 | + if ($globalDBdriver == 'mysql') { |
|
| 4971 | 4971 | $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) '; |
| 4972 | 4972 | } else { |
| 4973 | 4973 | $query .= "AND date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
| 4974 | 4974 | } |
| 4975 | 4975 | } |
| 4976 | - if ($sincedate != '') { |
|
| 4977 | - if ($globalDBdriver == 'mysql') { |
|
| 4976 | + if ($sincedate != '') { |
|
| 4977 | + if ($globalDBdriver == 'mysql') { |
|
| 4978 | 4978 | $query .= "AND date > '".$sincedate."' "; |
| 4979 | 4979 | } else { |
| 4980 | 4980 | $query .= "AND date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -4983,7 +4983,7 @@ discard block |
||
| 4983 | 4983 | |
| 4984 | 4984 | // if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
| 4985 | 4985 | //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
| 4986 | - $query .= "GROUP BY spotter_output.registration, spotter_output.aircraft_icao, spotter_output.aircraft_name, spotter_output.airline_name ORDER BY aircraft_registration_count DESC"; |
|
| 4986 | + $query .= "GROUP BY spotter_output.registration, spotter_output.aircraft_icao, spotter_output.aircraft_name, spotter_output.airline_name ORDER BY aircraft_registration_count DESC"; |
|
| 4987 | 4987 | if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
| 4988 | 4988 | |
| 4989 | 4989 | $sth = $this->db->prepare($query); |
@@ -5016,35 +5016,35 @@ discard block |
||
| 5016 | 5016 | |
| 5017 | 5017 | |
| 5018 | 5018 | /** |
| 5019 | - * Gets all departure airports of the airplanes that have flown over |
|
| 5020 | - * |
|
| 5021 | - * @return Array the airport list |
|
| 5022 | - * |
|
| 5023 | - */ |
|
| 5019 | + * Gets all departure airports of the airplanes that have flown over |
|
| 5020 | + * |
|
| 5021 | + * @return Array the airport list |
|
| 5022 | + * |
|
| 5023 | + */ |
|
| 5024 | 5024 | public function countAllDepartureAirports($limit = true, $olderthanmonths = 0, $sincedate = '') |
| 5025 | 5025 | { |
| 5026 | 5026 | global $globalDBdriver; |
| 5027 | 5027 | $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 |
| 5028 | 5028 | FROM spotter_output |
| 5029 | 5029 | WHERE spotter_output.departure_airport_name <> '' AND spotter_output.departure_airport_icao <> 'NA' "; |
| 5030 | - if ($olderthanmonths > 0) { |
|
| 5031 | - if ($globalDBdriver == 'mysql') { |
|
| 5030 | + if ($olderthanmonths > 0) { |
|
| 5031 | + if ($globalDBdriver == 'mysql') { |
|
| 5032 | 5032 | $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) '; |
| 5033 | 5033 | } else { |
| 5034 | 5034 | $query .= "AND date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
| 5035 | 5035 | } |
| 5036 | - } |
|
| 5037 | - if ($sincedate != '') { |
|
| 5038 | - if ($globalDBdriver == 'mysql') { |
|
| 5036 | + } |
|
| 5037 | + if ($sincedate != '') { |
|
| 5038 | + if ($globalDBdriver == 'mysql') { |
|
| 5039 | 5039 | $query .= "AND date > '".$sincedate."' "; |
| 5040 | 5040 | } else { |
| 5041 | 5041 | $query .= "AND date > CAST('".$sincedate."' AS TIMESTAMP)"; |
| 5042 | 5042 | } |
| 5043 | 5043 | } |
| 5044 | 5044 | |
| 5045 | - //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
| 5046 | - //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
| 5047 | - $query .= "GROUP BY spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country |
|
| 5045 | + //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
| 5046 | + //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
| 5047 | + $query .= "GROUP BY spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country |
|
| 5048 | 5048 | ORDER BY airport_departure_icao_count DESC"; |
| 5049 | 5049 | if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
| 5050 | 5050 | |
@@ -5068,35 +5068,35 @@ discard block |
||
| 5068 | 5068 | } |
| 5069 | 5069 | |
| 5070 | 5070 | /** |
| 5071 | - * Gets all detected departure airports of the airplanes that have flown over |
|
| 5072 | - * |
|
| 5073 | - * @return Array the airport list |
|
| 5074 | - * |
|
| 5075 | - */ |
|
| 5071 | + * Gets all detected departure airports of the airplanes that have flown over |
|
| 5072 | + * |
|
| 5073 | + * @return Array the airport list |
|
| 5074 | + * |
|
| 5075 | + */ |
|
| 5076 | 5076 | public function countAllDetectedDepartureAirports($limit = true, $olderthanmonths = 0, $sincedate = '') |
| 5077 | 5077 | { |
| 5078 | 5078 | global $globalDBdriver; |
| 5079 | 5079 | $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 |
| 5080 | 5080 | FROM spotter_output, airport |
| 5081 | 5081 | WHERE spotter_output.real_departure_airport_icao <> '' AND spotter_output.real_departure_airport_icao <> 'NA' AND airport.icao = spotter_output.real_departure_airport_icao "; |
| 5082 | - if ($olderthanmonths > 0) { |
|
| 5083 | - if ($globalDBdriver == 'mysql') { |
|
| 5082 | + if ($olderthanmonths > 0) { |
|
| 5083 | + if ($globalDBdriver == 'mysql') { |
|
| 5084 | 5084 | $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) '; |
| 5085 | 5085 | } else { |
| 5086 | 5086 | $query .= "AND date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
| 5087 | 5087 | } |
| 5088 | - } |
|
| 5089 | - if ($sincedate != '') { |
|
| 5090 | - if ($globalDBdriver == 'mysql') { |
|
| 5088 | + } |
|
| 5089 | + if ($sincedate != '') { |
|
| 5090 | + if ($globalDBdriver == 'mysql') { |
|
| 5091 | 5091 | $query .= "AND date > '".$sincedate."' "; |
| 5092 | 5092 | } else { |
| 5093 | 5093 | $query .= "AND date > CAST('".$sincedate."' AS TIMESTAMP)"; |
| 5094 | 5094 | } |
| 5095 | 5095 | } |
| 5096 | 5096 | |
| 5097 | - //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
| 5098 | - //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
| 5099 | - $query .= "GROUP BY spotter_output.real_departure_airport_icao, airport.name, airport.city, airport.country |
|
| 5097 | + //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
| 5098 | + //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
| 5099 | + $query .= "GROUP BY spotter_output.real_departure_airport_icao, airport.name, airport.city, airport.country |
|
| 5100 | 5100 | ORDER BY airport_departure_icao_count DESC"; |
| 5101 | 5101 | if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
| 5102 | 5102 | |
@@ -5122,11 +5122,11 @@ discard block |
||
| 5122 | 5122 | |
| 5123 | 5123 | |
| 5124 | 5124 | /** |
| 5125 | - * Gets all departure airports of the airplanes that have flown over based on an airline icao |
|
| 5126 | - * |
|
| 5127 | - * @return Array the airport list |
|
| 5128 | - * |
|
| 5129 | - */ |
|
| 5125 | + * Gets all departure airports of the airplanes that have flown over based on an airline icao |
|
| 5126 | + * |
|
| 5127 | + * @return Array the airport list |
|
| 5128 | + * |
|
| 5129 | + */ |
|
| 5130 | 5130 | public function countAllDepartureAirportsByAirline($airline_icao) |
| 5131 | 5131 | { |
| 5132 | 5132 | $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING); |
@@ -5161,11 +5161,11 @@ discard block |
||
| 5161 | 5161 | |
| 5162 | 5162 | |
| 5163 | 5163 | /** |
| 5164 | - * Gets all departure airports by country of the airplanes that have flown over based on an airline icao |
|
| 5165 | - * |
|
| 5166 | - * @return Array the airport list |
|
| 5167 | - * |
|
| 5168 | - */ |
|
| 5164 | + * Gets all departure airports by country of the airplanes that have flown over based on an airline icao |
|
| 5165 | + * |
|
| 5166 | + * @return Array the airport list |
|
| 5167 | + * |
|
| 5168 | + */ |
|
| 5169 | 5169 | public function countAllDepartureAirportCountriesByAirline($airline_icao) |
| 5170 | 5170 | { |
| 5171 | 5171 | $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING); |
@@ -5197,11 +5197,11 @@ discard block |
||
| 5197 | 5197 | |
| 5198 | 5198 | |
| 5199 | 5199 | /** |
| 5200 | - * Gets all departure airports of the airplanes that have flown over based on an aircraft icao |
|
| 5201 | - * |
|
| 5202 | - * @return Array the airport list |
|
| 5203 | - * |
|
| 5204 | - */ |
|
| 5200 | + * Gets all departure airports of the airplanes that have flown over based on an aircraft icao |
|
| 5201 | + * |
|
| 5202 | + * @return Array the airport list |
|
| 5203 | + * |
|
| 5204 | + */ |
|
| 5205 | 5205 | public function countAllDepartureAirportsByAircraft($aircraft_icao) |
| 5206 | 5206 | { |
| 5207 | 5207 | $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
@@ -5235,11 +5235,11 @@ discard block |
||
| 5235 | 5235 | |
| 5236 | 5236 | |
| 5237 | 5237 | /** |
| 5238 | - * Gets all departure airports by country of the airplanes that have flown over based on an aircraft icao |
|
| 5239 | - * |
|
| 5240 | - * @return Array the airport list |
|
| 5241 | - * |
|
| 5242 | - */ |
|
| 5238 | + * Gets all departure airports by country of the airplanes that have flown over based on an aircraft icao |
|
| 5239 | + * |
|
| 5240 | + * @return Array the airport list |
|
| 5241 | + * |
|
| 5242 | + */ |
|
| 5243 | 5243 | public function countAllDepartureAirportCountriesByAircraft($aircraft_icao) |
| 5244 | 5244 | { |
| 5245 | 5245 | $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
@@ -5270,11 +5270,11 @@ discard block |
||
| 5270 | 5270 | |
| 5271 | 5271 | |
| 5272 | 5272 | /** |
| 5273 | - * Gets all departure airports of the airplanes that have flown over based on an aircraft registration |
|
| 5274 | - * |
|
| 5275 | - * @return Array the airport list |
|
| 5276 | - * |
|
| 5277 | - */ |
|
| 5273 | + * Gets all departure airports of the airplanes that have flown over based on an aircraft registration |
|
| 5274 | + * |
|
| 5275 | + * @return Array the airport list |
|
| 5276 | + * |
|
| 5277 | + */ |
|
| 5278 | 5278 | public function countAllDepartureAirportsByRegistration($registration) |
| 5279 | 5279 | { |
| 5280 | 5280 | $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
@@ -5308,11 +5308,11 @@ discard block |
||
| 5308 | 5308 | |
| 5309 | 5309 | |
| 5310 | 5310 | /** |
| 5311 | - * Gets all departure airports by country of the airplanes that have flown over based on an aircraft registration |
|
| 5312 | - * |
|
| 5313 | - * @return Array the airport list |
|
| 5314 | - * |
|
| 5315 | - */ |
|
| 5311 | + * Gets all departure airports by country of the airplanes that have flown over based on an aircraft registration |
|
| 5312 | + * |
|
| 5313 | + * @return Array the airport list |
|
| 5314 | + * |
|
| 5315 | + */ |
|
| 5316 | 5316 | public function countAllDepartureAirportCountriesByRegistration($registration) |
| 5317 | 5317 | { |
| 5318 | 5318 | $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
@@ -5343,11 +5343,11 @@ discard block |
||
| 5343 | 5343 | |
| 5344 | 5344 | |
| 5345 | 5345 | /** |
| 5346 | - * Gets all departure airports of the airplanes that have flown over based on an arrivl airport icao |
|
| 5347 | - * |
|
| 5348 | - * @return Array the airport list |
|
| 5349 | - * |
|
| 5350 | - */ |
|
| 5346 | + * Gets all departure airports of the airplanes that have flown over based on an arrivl airport icao |
|
| 5347 | + * |
|
| 5348 | + * @return Array the airport list |
|
| 5349 | + * |
|
| 5350 | + */ |
|
| 5351 | 5351 | public function countAllDepartureAirportsByAirport($airport_icao) |
| 5352 | 5352 | { |
| 5353 | 5353 | $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
@@ -5381,11 +5381,11 @@ discard block |
||
| 5381 | 5381 | |
| 5382 | 5382 | |
| 5383 | 5383 | /** |
| 5384 | - * Gets all departure airports by country of the airplanes that have flown over based on an airport icao |
|
| 5385 | - * |
|
| 5386 | - * @return Array the airport list |
|
| 5387 | - * |
|
| 5388 | - */ |
|
| 5384 | + * Gets all departure airports by country of the airplanes that have flown over based on an airport icao |
|
| 5385 | + * |
|
| 5386 | + * @return Array the airport list |
|
| 5387 | + * |
|
| 5388 | + */ |
|
| 5389 | 5389 | public function countAllDepartureAirportCountriesByAirport($airport_icao) |
| 5390 | 5390 | { |
| 5391 | 5391 | $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
@@ -5417,11 +5417,11 @@ discard block |
||
| 5417 | 5417 | |
| 5418 | 5418 | |
| 5419 | 5419 | /** |
| 5420 | - * Gets all departure airports of the airplanes that have flown over based on an aircraft manufacturer |
|
| 5421 | - * |
|
| 5422 | - * @return Array the airport list |
|
| 5423 | - * |
|
| 5424 | - */ |
|
| 5420 | + * Gets all departure airports of the airplanes that have flown over based on an aircraft manufacturer |
|
| 5421 | + * |
|
| 5422 | + * @return Array the airport list |
|
| 5423 | + * |
|
| 5424 | + */ |
|
| 5425 | 5425 | public function countAllDepartureAirportsByManufacturer($aircraft_manufacturer) |
| 5426 | 5426 | { |
| 5427 | 5427 | $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
@@ -5455,11 +5455,11 @@ discard block |
||
| 5455 | 5455 | |
| 5456 | 5456 | |
| 5457 | 5457 | /** |
| 5458 | - * Gets all departure airports by country of the airplanes that have flown over based on an aircraft manufacturer |
|
| 5459 | - * |
|
| 5460 | - * @return Array the airport list |
|
| 5461 | - * |
|
| 5462 | - */ |
|
| 5458 | + * Gets all departure airports by country of the airplanes that have flown over based on an aircraft manufacturer |
|
| 5459 | + * |
|
| 5460 | + * @return Array the airport list |
|
| 5461 | + * |
|
| 5462 | + */ |
|
| 5463 | 5463 | public function countAllDepartureAirportCountriesByManufacturer($aircraft_manufacturer) |
| 5464 | 5464 | { |
| 5465 | 5465 | $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
@@ -5490,11 +5490,11 @@ discard block |
||
| 5490 | 5490 | |
| 5491 | 5491 | |
| 5492 | 5492 | /** |
| 5493 | - * Gets all departure airports of the airplanes that have flown over based on a date |
|
| 5494 | - * |
|
| 5495 | - * @return Array the airport list |
|
| 5496 | - * |
|
| 5497 | - */ |
|
| 5493 | + * Gets all departure airports of the airplanes that have flown over based on a date |
|
| 5494 | + * |
|
| 5495 | + * @return Array the airport list |
|
| 5496 | + * |
|
| 5497 | + */ |
|
| 5498 | 5498 | public function countAllDepartureAirportsByDate($date) |
| 5499 | 5499 | { |
| 5500 | 5500 | global $globalTimezone, $globalDBdriver; |
@@ -5542,11 +5542,11 @@ discard block |
||
| 5542 | 5542 | |
| 5543 | 5543 | |
| 5544 | 5544 | /** |
| 5545 | - * Gets all departure airports by country of the airplanes that have flown over based on a date |
|
| 5546 | - * |
|
| 5547 | - * @return Array the airport list |
|
| 5548 | - * |
|
| 5549 | - */ |
|
| 5545 | + * Gets all departure airports by country of the airplanes that have flown over based on a date |
|
| 5546 | + * |
|
| 5547 | + * @return Array the airport list |
|
| 5548 | + * |
|
| 5549 | + */ |
|
| 5550 | 5550 | public function countAllDepartureAirportCountriesByDate($date) |
| 5551 | 5551 | { |
| 5552 | 5552 | global $globalTimezone, $globalDBdriver; |
@@ -5590,11 +5590,11 @@ discard block |
||
| 5590 | 5590 | |
| 5591 | 5591 | |
| 5592 | 5592 | /** |
| 5593 | - * Gets all departure airports of the airplanes that have flown over based on a ident/callsign |
|
| 5594 | - * |
|
| 5595 | - * @return Array the airport list |
|
| 5596 | - * |
|
| 5597 | - */ |
|
| 5593 | + * Gets all departure airports of the airplanes that have flown over based on a ident/callsign |
|
| 5594 | + * |
|
| 5595 | + * @return Array the airport list |
|
| 5596 | + * |
|
| 5597 | + */ |
|
| 5598 | 5598 | public function countAllDepartureAirportsByIdent($ident) |
| 5599 | 5599 | { |
| 5600 | 5600 | $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
@@ -5629,11 +5629,11 @@ discard block |
||
| 5629 | 5629 | |
| 5630 | 5630 | |
| 5631 | 5631 | /** |
| 5632 | - * Gets all departure airports by country of the airplanes that have flown over based on a callsign/ident |
|
| 5633 | - * |
|
| 5634 | - * @return Array the airport list |
|
| 5635 | - * |
|
| 5636 | - */ |
|
| 5632 | + * Gets all departure airports by country of the airplanes that have flown over based on a callsign/ident |
|
| 5633 | + * |
|
| 5634 | + * @return Array the airport list |
|
| 5635 | + * |
|
| 5636 | + */ |
|
| 5637 | 5637 | public function countAllDepartureAirportCountriesByIdent($ident) |
| 5638 | 5638 | { |
| 5639 | 5639 | $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
@@ -5665,11 +5665,11 @@ discard block |
||
| 5665 | 5665 | |
| 5666 | 5666 | |
| 5667 | 5667 | /** |
| 5668 | - * Gets all departure airports of the airplanes that have flown over based on a country |
|
| 5669 | - * |
|
| 5670 | - * @return Array the airport list |
|
| 5671 | - * |
|
| 5672 | - */ |
|
| 5668 | + * Gets all departure airports of the airplanes that have flown over based on a country |
|
| 5669 | + * |
|
| 5670 | + * @return Array the airport list |
|
| 5671 | + * |
|
| 5672 | + */ |
|
| 5673 | 5673 | public function countAllDepartureAirportsByCountry($country) |
| 5674 | 5674 | { |
| 5675 | 5675 | $country = filter_var($country,FILTER_SANITIZE_STRING); |
@@ -5703,11 +5703,11 @@ discard block |
||
| 5703 | 5703 | |
| 5704 | 5704 | |
| 5705 | 5705 | /** |
| 5706 | - * Gets all departure airports by country of the airplanes that have flown over based on an aircraft icao |
|
| 5707 | - * |
|
| 5708 | - * @return Array the airport list |
|
| 5709 | - * |
|
| 5710 | - */ |
|
| 5706 | + * Gets all departure airports by country of the airplanes that have flown over based on an aircraft icao |
|
| 5707 | + * |
|
| 5708 | + * @return Array the airport list |
|
| 5709 | + * |
|
| 5710 | + */ |
|
| 5711 | 5711 | public function countAllDepartureAirportCountriesByCountry($country) |
| 5712 | 5712 | { |
| 5713 | 5713 | $country = filter_var($country,FILTER_SANITIZE_STRING); |
@@ -5738,40 +5738,40 @@ discard block |
||
| 5738 | 5738 | |
| 5739 | 5739 | |
| 5740 | 5740 | /** |
| 5741 | - * Gets all arrival airports of the airplanes that have flown over |
|
| 5742 | - * |
|
| 5743 | - * @return Array the airport list |
|
| 5744 | - * |
|
| 5745 | - */ |
|
| 5741 | + * Gets all arrival airports of the airplanes that have flown over |
|
| 5742 | + * |
|
| 5743 | + * @return Array the airport list |
|
| 5744 | + * |
|
| 5745 | + */ |
|
| 5746 | 5746 | public function countAllArrivalAirports($limit = true, $olderthanmonths = 0, $sincedate = '', $icaoaskey = false) |
| 5747 | 5747 | { |
| 5748 | 5748 | global $globalDBdriver; |
| 5749 | 5749 | $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 |
| 5750 | 5750 | FROM spotter_output |
| 5751 | 5751 | WHERE spotter_output.arrival_airport_name <> '' AND spotter_output.arrival_airport_icao <> 'NA' "; |
| 5752 | - if ($olderthanmonths > 0) { |
|
| 5753 | - if ($globalDBdriver == 'mysql') { |
|
| 5752 | + if ($olderthanmonths > 0) { |
|
| 5753 | + if ($globalDBdriver == 'mysql') { |
|
| 5754 | 5754 | $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) '; |
| 5755 | 5755 | } else { |
| 5756 | 5756 | $query .= "AND date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
| 5757 | 5757 | } |
| 5758 | - if ($sincedate != '') { |
|
| 5759 | - if ($globalDBdriver == 'mysql') { |
|
| 5758 | + if ($sincedate != '') { |
|
| 5759 | + if ($globalDBdriver == 'mysql') { |
|
| 5760 | 5760 | $query .= "AND date > '".$sincedate."' "; |
| 5761 | 5761 | } else { |
| 5762 | 5762 | $query .= "AND date > CAST('".$sincedate."' AS TIMESTAMP)"; |
| 5763 | 5763 | } |
| 5764 | 5764 | } |
| 5765 | - if ($globalDBdriver == 'mysql') { |
|
| 5765 | + if ($globalDBdriver == 'mysql') { |
|
| 5766 | 5766 | $query .= "AND date > '".$sincedate."' "; |
| 5767 | 5767 | } else { |
| 5768 | 5768 | $query .= "AND date > CAST('".$sincedate."' AS TIMESTAMP)"; |
| 5769 | 5769 | } |
| 5770 | 5770 | } |
| 5771 | 5771 | |
| 5772 | - //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
| 5773 | - //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
| 5774 | - $query .= "GROUP BY spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
|
| 5772 | + //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
| 5773 | + //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
| 5774 | + $query .= "GROUP BY spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
|
| 5775 | 5775 | ORDER BY airport_arrival_icao_count DESC"; |
| 5776 | 5776 | if ($limit) $query .= " LIMIT 10"; |
| 5777 | 5777 | |
@@ -5800,40 +5800,40 @@ discard block |
||
| 5800 | 5800 | } |
| 5801 | 5801 | |
| 5802 | 5802 | /** |
| 5803 | - * Gets all detected arrival airports of the airplanes that have flown over |
|
| 5804 | - * |
|
| 5805 | - * @return Array the airport list |
|
| 5806 | - * |
|
| 5807 | - */ |
|
| 5803 | + * Gets all detected arrival airports of the airplanes that have flown over |
|
| 5804 | + * |
|
| 5805 | + * @return Array the airport list |
|
| 5806 | + * |
|
| 5807 | + */ |
|
| 5808 | 5808 | public function countAllDetectedArrivalAirports($limit = true, $olderthanmonths = 0, $sincedate = '',$icaoaskey = false) |
| 5809 | 5809 | { |
| 5810 | 5810 | global $globalDBdriver; |
| 5811 | 5811 | $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 |
| 5812 | 5812 | FROM spotter_output, airport |
| 5813 | 5813 | WHERE spotter_output.real_arrival_airport_icao <> '' AND spotter_output.real_arrival_airport_icao <> 'NA' AND airport.icao = spotter_output.real_arrival_airport_icao "; |
| 5814 | - if ($olderthanmonths > 0) { |
|
| 5815 | - if ($globalDBdriver == 'mysql') { |
|
| 5814 | + if ($olderthanmonths > 0) { |
|
| 5815 | + if ($globalDBdriver == 'mysql') { |
|
| 5816 | 5816 | $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) '; |
| 5817 | 5817 | } else { |
| 5818 | 5818 | $query .= "AND date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
| 5819 | 5819 | } |
| 5820 | - if ($sincedate != '') { |
|
| 5821 | - if ($globalDBdriver == 'mysql') { |
|
| 5820 | + if ($sincedate != '') { |
|
| 5821 | + if ($globalDBdriver == 'mysql') { |
|
| 5822 | 5822 | $query .= "AND date > '".$sincedate."' "; |
| 5823 | 5823 | } else { |
| 5824 | 5824 | $query .= "AND date > CAST('".$sincedate."' AS TIMESTAMP)"; |
| 5825 | 5825 | } |
| 5826 | 5826 | } |
| 5827 | - if ($globalDBdriver == 'mysql') { |
|
| 5827 | + if ($globalDBdriver == 'mysql') { |
|
| 5828 | 5828 | $query .= "AND date > '".$sincedate."' "; |
| 5829 | 5829 | } else { |
| 5830 | 5830 | $query .= "AND date > CAST('".$sincedate."' AS TIMESTAMP)"; |
| 5831 | 5831 | } |
| 5832 | 5832 | } |
| 5833 | 5833 | |
| 5834 | - //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
| 5835 | - //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
| 5836 | - $query .= "GROUP BY spotter_output.real_arrival_airport_icao, airport.name, airport.city, airport.country |
|
| 5834 | + //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
| 5835 | + //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
| 5836 | + $query .= "GROUP BY spotter_output.real_arrival_airport_icao, airport.name, airport.city, airport.country |
|
| 5837 | 5837 | ORDER BY airport_arrival_icao_count DESC"; |
| 5838 | 5838 | if ($limit) $query .= " LIMIT 10"; |
| 5839 | 5839 | |
@@ -5864,11 +5864,11 @@ discard block |
||
| 5864 | 5864 | |
| 5865 | 5865 | |
| 5866 | 5866 | /** |
| 5867 | - * Gets all arrival airports of the airplanes that have flown over based on an airline icao |
|
| 5868 | - * |
|
| 5869 | - * @return Array the airport list |
|
| 5870 | - * |
|
| 5871 | - */ |
|
| 5867 | + * Gets all arrival airports of the airplanes that have flown over based on an airline icao |
|
| 5868 | + * |
|
| 5869 | + * @return Array the airport list |
|
| 5870 | + * |
|
| 5871 | + */ |
|
| 5872 | 5872 | public function countAllArrivalAirportsByAirline($airline_icao) |
| 5873 | 5873 | { |
| 5874 | 5874 | $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING); |
@@ -5902,11 +5902,11 @@ discard block |
||
| 5902 | 5902 | |
| 5903 | 5903 | |
| 5904 | 5904 | /** |
| 5905 | - * Gets all arrival airports by country of the airplanes that have flown over based on an airline icao |
|
| 5906 | - * |
|
| 5907 | - * @return Array the airport list |
|
| 5908 | - * |
|
| 5909 | - */ |
|
| 5905 | + * Gets all arrival airports by country of the airplanes that have flown over based on an airline icao |
|
| 5906 | + * |
|
| 5907 | + * @return Array the airport list |
|
| 5908 | + * |
|
| 5909 | + */ |
|
| 5910 | 5910 | public function countAllArrivalAirportCountriesByAirline($airline_icao) |
| 5911 | 5911 | { |
| 5912 | 5912 | $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING); |
@@ -5937,11 +5937,11 @@ discard block |
||
| 5937 | 5937 | |
| 5938 | 5938 | |
| 5939 | 5939 | /** |
| 5940 | - * Gets all arrival airports of the airplanes that have flown over based on an aircraft icao |
|
| 5941 | - * |
|
| 5942 | - * @return Array the airport list |
|
| 5943 | - * |
|
| 5944 | - */ |
|
| 5940 | + * Gets all arrival airports of the airplanes that have flown over based on an aircraft icao |
|
| 5941 | + * |
|
| 5942 | + * @return Array the airport list |
|
| 5943 | + * |
|
| 5944 | + */ |
|
| 5945 | 5945 | public function countAllArrivalAirportsByAircraft($aircraft_icao) |
| 5946 | 5946 | { |
| 5947 | 5947 | $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
@@ -5976,11 +5976,11 @@ discard block |
||
| 5976 | 5976 | |
| 5977 | 5977 | |
| 5978 | 5978 | /** |
| 5979 | - * Gets all arrival airports by country of the airplanes that have flown over based on an aircraft icao |
|
| 5980 | - * |
|
| 5981 | - * @return Array the airport list |
|
| 5982 | - * |
|
| 5983 | - */ |
|
| 5979 | + * Gets all arrival airports by country of the airplanes that have flown over based on an aircraft icao |
|
| 5980 | + * |
|
| 5981 | + * @return Array the airport list |
|
| 5982 | + * |
|
| 5983 | + */ |
|
| 5984 | 5984 | public function countAllArrivalAirportCountriesByAircraft($aircraft_icao) |
| 5985 | 5985 | { |
| 5986 | 5986 | $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
@@ -6011,11 +6011,11 @@ discard block |
||
| 6011 | 6011 | |
| 6012 | 6012 | |
| 6013 | 6013 | /** |
| 6014 | - * Gets all arrival airports of the airplanes that have flown over based on an aircraft registration |
|
| 6015 | - * |
|
| 6016 | - * @return Array the airport list |
|
| 6017 | - * |
|
| 6018 | - */ |
|
| 6014 | + * Gets all arrival airports of the airplanes that have flown over based on an aircraft registration |
|
| 6015 | + * |
|
| 6016 | + * @return Array the airport list |
|
| 6017 | + * |
|
| 6018 | + */ |
|
| 6019 | 6019 | public function countAllArrivalAirportsByRegistration($registration) |
| 6020 | 6020 | { |
| 6021 | 6021 | $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
@@ -6049,11 +6049,11 @@ discard block |
||
| 6049 | 6049 | |
| 6050 | 6050 | |
| 6051 | 6051 | /** |
| 6052 | - * Gets all arrival airports by country of the airplanes that have flown over based on an aircraft registration |
|
| 6053 | - * |
|
| 6054 | - * @return Array the airport list |
|
| 6055 | - * |
|
| 6056 | - */ |
|
| 6052 | + * Gets all arrival airports by country of the airplanes that have flown over based on an aircraft registration |
|
| 6053 | + * |
|
| 6054 | + * @return Array the airport list |
|
| 6055 | + * |
|
| 6056 | + */ |
|
| 6057 | 6057 | public function countAllArrivalAirportCountriesByRegistration($registration) |
| 6058 | 6058 | { |
| 6059 | 6059 | $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
@@ -6085,11 +6085,11 @@ discard block |
||
| 6085 | 6085 | |
| 6086 | 6086 | |
| 6087 | 6087 | /** |
| 6088 | - * Gets all arrival airports of the airplanes that have flown over based on an departure airport |
|
| 6089 | - * |
|
| 6090 | - * @return Array the airport list |
|
| 6091 | - * |
|
| 6092 | - */ |
|
| 6088 | + * Gets all arrival airports of the airplanes that have flown over based on an departure airport |
|
| 6089 | + * |
|
| 6090 | + * @return Array the airport list |
|
| 6091 | + * |
|
| 6092 | + */ |
|
| 6093 | 6093 | public function countAllArrivalAirportsByAirport($airport_icao) |
| 6094 | 6094 | { |
| 6095 | 6095 | $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
@@ -6123,11 +6123,11 @@ discard block |
||
| 6123 | 6123 | |
| 6124 | 6124 | |
| 6125 | 6125 | /** |
| 6126 | - * Gets all arrival airports by country of the airplanes that have flown over based on an airport icao |
|
| 6127 | - * |
|
| 6128 | - * @return Array the airport list |
|
| 6129 | - * |
|
| 6130 | - */ |
|
| 6126 | + * Gets all arrival airports by country of the airplanes that have flown over based on an airport icao |
|
| 6127 | + * |
|
| 6128 | + * @return Array the airport list |
|
| 6129 | + * |
|
| 6130 | + */ |
|
| 6131 | 6131 | public function countAllArrivalAirportCountriesByAirport($airport_icao) |
| 6132 | 6132 | { |
| 6133 | 6133 | $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
@@ -6158,11 +6158,11 @@ discard block |
||
| 6158 | 6158 | |
| 6159 | 6159 | |
| 6160 | 6160 | /** |
| 6161 | - * Gets all arrival airports of the airplanes that have flown over based on a aircraft manufacturer |
|
| 6162 | - * |
|
| 6163 | - * @return Array the airport list |
|
| 6164 | - * |
|
| 6165 | - */ |
|
| 6161 | + * Gets all arrival airports of the airplanes that have flown over based on a aircraft manufacturer |
|
| 6162 | + * |
|
| 6163 | + * @return Array the airport list |
|
| 6164 | + * |
|
| 6165 | + */ |
|
| 6166 | 6166 | public function countAllArrivalAirportsByManufacturer($aircraft_manufacturer) |
| 6167 | 6167 | { |
| 6168 | 6168 | $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
@@ -6197,11 +6197,11 @@ discard block |
||
| 6197 | 6197 | |
| 6198 | 6198 | |
| 6199 | 6199 | /** |
| 6200 | - * Gets all arrival airports by country of the airplanes that have flown over based on a aircraft manufacturer |
|
| 6201 | - * |
|
| 6202 | - * @return Array the airport list |
|
| 6203 | - * |
|
| 6204 | - */ |
|
| 6200 | + * Gets all arrival airports by country of the airplanes that have flown over based on a aircraft manufacturer |
|
| 6201 | + * |
|
| 6202 | + * @return Array the airport list |
|
| 6203 | + * |
|
| 6204 | + */ |
|
| 6205 | 6205 | public function countAllArrivalAirportCountriesByManufacturer($aircraft_manufacturer) |
| 6206 | 6206 | { |
| 6207 | 6207 | $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
@@ -6233,11 +6233,11 @@ discard block |
||
| 6233 | 6233 | |
| 6234 | 6234 | |
| 6235 | 6235 | /** |
| 6236 | - * Gets all arrival airports of the airplanes that have flown over based on a date |
|
| 6237 | - * |
|
| 6238 | - * @return Array the airport list |
|
| 6239 | - * |
|
| 6240 | - */ |
|
| 6236 | + * Gets all arrival airports of the airplanes that have flown over based on a date |
|
| 6237 | + * |
|
| 6238 | + * @return Array the airport list |
|
| 6239 | + * |
|
| 6240 | + */ |
|
| 6241 | 6241 | public function countAllArrivalAirportsByDate($date) |
| 6242 | 6242 | { |
| 6243 | 6243 | global $globalTimezone, $globalDBdriver; |
@@ -6284,11 +6284,11 @@ discard block |
||
| 6284 | 6284 | |
| 6285 | 6285 | |
| 6286 | 6286 | /** |
| 6287 | - * Gets all arrival airports by country of the airplanes that have flown over based on a date |
|
| 6288 | - * |
|
| 6289 | - * @return Array the airport list |
|
| 6290 | - * |
|
| 6291 | - */ |
|
| 6287 | + * Gets all arrival airports by country of the airplanes that have flown over based on a date |
|
| 6288 | + * |
|
| 6289 | + * @return Array the airport list |
|
| 6290 | + * |
|
| 6291 | + */ |
|
| 6292 | 6292 | public function countAllArrivalAirportCountriesByDate($date) |
| 6293 | 6293 | { |
| 6294 | 6294 | global $globalTimezone, $globalDBdriver; |
@@ -6332,11 +6332,11 @@ discard block |
||
| 6332 | 6332 | |
| 6333 | 6333 | |
| 6334 | 6334 | /** |
| 6335 | - * Gets all arrival airports of the airplanes that have flown over based on a ident/callsign |
|
| 6336 | - * |
|
| 6337 | - * @return Array the airport list |
|
| 6338 | - * |
|
| 6339 | - */ |
|
| 6335 | + * Gets all arrival airports of the airplanes that have flown over based on a ident/callsign |
|
| 6336 | + * |
|
| 6337 | + * @return Array the airport list |
|
| 6338 | + * |
|
| 6339 | + */ |
|
| 6340 | 6340 | public function countAllArrivalAirportsByIdent($ident) |
| 6341 | 6341 | { |
| 6342 | 6342 | $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
@@ -6370,11 +6370,11 @@ discard block |
||
| 6370 | 6370 | |
| 6371 | 6371 | |
| 6372 | 6372 | /** |
| 6373 | - * Gets all arrival airports by country of the airplanes that have flown over based on a callsign/ident |
|
| 6374 | - * |
|
| 6375 | - * @return Array the airport list |
|
| 6376 | - * |
|
| 6377 | - */ |
|
| 6373 | + * Gets all arrival airports by country of the airplanes that have flown over based on a callsign/ident |
|
| 6374 | + * |
|
| 6375 | + * @return Array the airport list |
|
| 6376 | + * |
|
| 6377 | + */ |
|
| 6378 | 6378 | public function countAllArrivalAirportCountriesByIdent($ident) |
| 6379 | 6379 | { |
| 6380 | 6380 | $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
@@ -6406,11 +6406,11 @@ discard block |
||
| 6406 | 6406 | |
| 6407 | 6407 | |
| 6408 | 6408 | /** |
| 6409 | - * Gets all arrival airports of the airplanes that have flown over based on a country |
|
| 6410 | - * |
|
| 6411 | - * @return Array the airport list |
|
| 6412 | - * |
|
| 6413 | - */ |
|
| 6409 | + * Gets all arrival airports of the airplanes that have flown over based on a country |
|
| 6410 | + * |
|
| 6411 | + * @return Array the airport list |
|
| 6412 | + * |
|
| 6413 | + */ |
|
| 6414 | 6414 | public function countAllArrivalAirportsByCountry($country) |
| 6415 | 6415 | { |
| 6416 | 6416 | $country = filter_var($country,FILTER_SANITIZE_STRING); |
@@ -6444,11 +6444,11 @@ discard block |
||
| 6444 | 6444 | |
| 6445 | 6445 | |
| 6446 | 6446 | /** |
| 6447 | - * Gets all arrival airports by country of the airplanes that have flown over based on a country |
|
| 6448 | - * |
|
| 6449 | - * @return Array the airport list |
|
| 6450 | - * |
|
| 6451 | - */ |
|
| 6447 | + * Gets all arrival airports by country of the airplanes that have flown over based on a country |
|
| 6448 | + * |
|
| 6449 | + * @return Array the airport list |
|
| 6450 | + * |
|
| 6451 | + */ |
|
| 6452 | 6452 | public function countAllArrivalAirportCountriesByCountry($country) |
| 6453 | 6453 | { |
| 6454 | 6454 | $country = filter_var($country,FILTER_SANITIZE_STRING); |
@@ -6480,11 +6480,11 @@ discard block |
||
| 6480 | 6480 | |
| 6481 | 6481 | |
| 6482 | 6482 | /** |
| 6483 | - * Counts all airport departure countries |
|
| 6484 | - * |
|
| 6485 | - * @return Array the airport departure list |
|
| 6486 | - * |
|
| 6487 | - */ |
|
| 6483 | + * Counts all airport departure countries |
|
| 6484 | + * |
|
| 6485 | + * @return Array the airport departure list |
|
| 6486 | + * |
|
| 6487 | + */ |
|
| 6488 | 6488 | public function countAllDepartureCountries() |
| 6489 | 6489 | { |
| 6490 | 6490 | $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
@@ -6514,11 +6514,11 @@ discard block |
||
| 6514 | 6514 | |
| 6515 | 6515 | |
| 6516 | 6516 | /** |
| 6517 | - * Counts all airport arrival countries |
|
| 6518 | - * |
|
| 6519 | - * @return Array the airport arrival list |
|
| 6520 | - * |
|
| 6521 | - */ |
|
| 6517 | + * Counts all airport arrival countries |
|
| 6518 | + * |
|
| 6519 | + * @return Array the airport arrival list |
|
| 6520 | + * |
|
| 6521 | + */ |
|
| 6522 | 6522 | public function countAllArrivalCountries($limit = true) |
| 6523 | 6523 | { |
| 6524 | 6524 | $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
@@ -6551,11 +6551,11 @@ discard block |
||
| 6551 | 6551 | |
| 6552 | 6552 | |
| 6553 | 6553 | /** |
| 6554 | - * Gets all route combinations |
|
| 6555 | - * |
|
| 6556 | - * @return Array the route list |
|
| 6557 | - * |
|
| 6558 | - */ |
|
| 6554 | + * Gets all route combinations |
|
| 6555 | + * |
|
| 6556 | + * @return Array the route list |
|
| 6557 | + * |
|
| 6558 | + */ |
|
| 6559 | 6559 | public function countAllRoutes() |
| 6560 | 6560 | { |
| 6561 | 6561 | |
@@ -6595,11 +6595,11 @@ discard block |
||
| 6595 | 6595 | |
| 6596 | 6596 | |
| 6597 | 6597 | /** |
| 6598 | - * Gets all route combinations based on an aircraft |
|
| 6599 | - * |
|
| 6600 | - * @return Array the route list |
|
| 6601 | - * |
|
| 6602 | - */ |
|
| 6598 | + * Gets all route combinations based on an aircraft |
|
| 6599 | + * |
|
| 6600 | + * @return Array the route list |
|
| 6601 | + * |
|
| 6602 | + */ |
|
| 6603 | 6603 | public function countAllRoutesByAircraft($aircraft_icao) |
| 6604 | 6604 | { |
| 6605 | 6605 | $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
@@ -6637,11 +6637,11 @@ discard block |
||
| 6637 | 6637 | |
| 6638 | 6638 | |
| 6639 | 6639 | /** |
| 6640 | - * Gets all route combinations based on an aircraft registration |
|
| 6641 | - * |
|
| 6642 | - * @return Array the route list |
|
| 6643 | - * |
|
| 6644 | - */ |
|
| 6640 | + * Gets all route combinations based on an aircraft registration |
|
| 6641 | + * |
|
| 6642 | + * @return Array the route list |
|
| 6643 | + * |
|
| 6644 | + */ |
|
| 6645 | 6645 | public function countAllRoutesByRegistration($registration) |
| 6646 | 6646 | { |
| 6647 | 6647 | $registration = filter_var($registration, FILTER_SANITIZE_STRING); |
@@ -6680,11 +6680,11 @@ discard block |
||
| 6680 | 6680 | |
| 6681 | 6681 | |
| 6682 | 6682 | /** |
| 6683 | - * Gets all route combinations based on an airline |
|
| 6684 | - * |
|
| 6685 | - * @return Array the route list |
|
| 6686 | - * |
|
| 6687 | - */ |
|
| 6683 | + * Gets all route combinations based on an airline |
|
| 6684 | + * |
|
| 6685 | + * @return Array the route list |
|
| 6686 | + * |
|
| 6687 | + */ |
|
| 6688 | 6688 | public function countAllRoutesByAirline($airline_icao) |
| 6689 | 6689 | { |
| 6690 | 6690 | $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING); |
@@ -6723,11 +6723,11 @@ discard block |
||
| 6723 | 6723 | |
| 6724 | 6724 | |
| 6725 | 6725 | /** |
| 6726 | - * Gets all route combinations based on an airport |
|
| 6727 | - * |
|
| 6728 | - * @return Array the route list |
|
| 6729 | - * |
|
| 6730 | - */ |
|
| 6726 | + * Gets all route combinations based on an airport |
|
| 6727 | + * |
|
| 6728 | + * @return Array the route list |
|
| 6729 | + * |
|
| 6730 | + */ |
|
| 6731 | 6731 | public function countAllRoutesByAirport($airport_icao) |
| 6732 | 6732 | { |
| 6733 | 6733 | $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
@@ -6766,11 +6766,11 @@ discard block |
||
| 6766 | 6766 | |
| 6767 | 6767 | |
| 6768 | 6768 | /** |
| 6769 | - * Gets all route combinations based on an country |
|
| 6770 | - * |
|
| 6771 | - * @return Array the route list |
|
| 6772 | - * |
|
| 6773 | - */ |
|
| 6769 | + * Gets all route combinations based on an country |
|
| 6770 | + * |
|
| 6771 | + * @return Array the route list |
|
| 6772 | + * |
|
| 6773 | + */ |
|
| 6774 | 6774 | public function countAllRoutesByCountry($country) |
| 6775 | 6775 | { |
| 6776 | 6776 | $country = filter_var($country,FILTER_SANITIZE_STRING); |
@@ -6808,11 +6808,11 @@ discard block |
||
| 6808 | 6808 | |
| 6809 | 6809 | |
| 6810 | 6810 | /** |
| 6811 | - * Gets all route combinations based on an date |
|
| 6812 | - * |
|
| 6813 | - * @return Array the route list |
|
| 6814 | - * |
|
| 6815 | - */ |
|
| 6811 | + * Gets all route combinations based on an date |
|
| 6812 | + * |
|
| 6813 | + * @return Array the route list |
|
| 6814 | + * |
|
| 6815 | + */ |
|
| 6816 | 6816 | public function countAllRoutesByDate($date) |
| 6817 | 6817 | { |
| 6818 | 6818 | global $globalTimezone, $globalDBdriver; |
@@ -6863,11 +6863,11 @@ discard block |
||
| 6863 | 6863 | |
| 6864 | 6864 | |
| 6865 | 6865 | /** |
| 6866 | - * Gets all route combinations based on an ident/callsign |
|
| 6867 | - * |
|
| 6868 | - * @return Array the route list |
|
| 6869 | - * |
|
| 6870 | - */ |
|
| 6866 | + * Gets all route combinations based on an ident/callsign |
|
| 6867 | + * |
|
| 6868 | + * @return Array the route list |
|
| 6869 | + * |
|
| 6870 | + */ |
|
| 6871 | 6871 | public function countAllRoutesByIdent($ident) |
| 6872 | 6872 | { |
| 6873 | 6873 | $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
@@ -6905,11 +6905,11 @@ discard block |
||
| 6905 | 6905 | |
| 6906 | 6906 | |
| 6907 | 6907 | /** |
| 6908 | - * Gets all route combinations based on an manufacturer |
|
| 6909 | - * |
|
| 6910 | - * @return Array the route list |
|
| 6911 | - * |
|
| 6912 | - */ |
|
| 6908 | + * Gets all route combinations based on an manufacturer |
|
| 6909 | + * |
|
| 6910 | + * @return Array the route list |
|
| 6911 | + * |
|
| 6912 | + */ |
|
| 6913 | 6913 | public function countAllRoutesByManufacturer($aircraft_manufacturer) |
| 6914 | 6914 | { |
| 6915 | 6915 | $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
@@ -6948,11 +6948,11 @@ discard block |
||
| 6948 | 6948 | |
| 6949 | 6949 | |
| 6950 | 6950 | /** |
| 6951 | - * Gets all route combinations with waypoints |
|
| 6952 | - * |
|
| 6953 | - * @return Array the route list |
|
| 6954 | - * |
|
| 6955 | - */ |
|
| 6951 | + * Gets all route combinations with waypoints |
|
| 6952 | + * |
|
| 6953 | + * @return Array the route list |
|
| 6954 | + * |
|
| 6955 | + */ |
|
| 6956 | 6956 | public function countAllRoutesWithWaypoints() |
| 6957 | 6957 | { |
| 6958 | 6958 | $query = "SELECT DISTINCT spotter_output.waypoints AS route, count(spotter_output.waypoints) AS route_count, spotter_output.spotter_id, 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 |
@@ -6992,11 +6992,11 @@ discard block |
||
| 6992 | 6992 | |
| 6993 | 6993 | |
| 6994 | 6994 | /** |
| 6995 | - * Gets all callsigns that have flown over |
|
| 6996 | - * |
|
| 6997 | - * @return Array the callsign list |
|
| 6998 | - * |
|
| 6999 | - */ |
|
| 6995 | + * Gets all callsigns that have flown over |
|
| 6996 | + * |
|
| 6997 | + * @return Array the callsign list |
|
| 6998 | + * |
|
| 6999 | + */ |
|
| 7000 | 7000 | public function countAllCallsigns($limit = true, $olderthanmonths = 0, $sincedate = '') |
| 7001 | 7001 | { |
| 7002 | 7002 | global $globalDBdriver; |
@@ -7037,11 +7037,11 @@ discard block |
||
| 7037 | 7037 | |
| 7038 | 7038 | |
| 7039 | 7039 | /** |
| 7040 | - * Counts all dates |
|
| 7041 | - * |
|
| 7042 | - * @return Array the date list |
|
| 7043 | - * |
|
| 7044 | - */ |
|
| 7040 | + * Counts all dates |
|
| 7041 | + * |
|
| 7042 | + * @return Array the date list |
|
| 7043 | + * |
|
| 7044 | + */ |
|
| 7045 | 7045 | public function countAllDates() |
| 7046 | 7046 | { |
| 7047 | 7047 | global $globalTimezone, $globalDBdriver; |
@@ -7086,11 +7086,11 @@ discard block |
||
| 7086 | 7086 | |
| 7087 | 7087 | |
| 7088 | 7088 | /** |
| 7089 | - * Counts all dates during the last 7 days |
|
| 7090 | - * |
|
| 7091 | - * @return Array the date list |
|
| 7092 | - * |
|
| 7093 | - */ |
|
| 7089 | + * Counts all dates during the last 7 days |
|
| 7090 | + * |
|
| 7091 | + * @return Array the date list |
|
| 7092 | + * |
|
| 7093 | + */ |
|
| 7094 | 7094 | public function countAllDatesLast7Days() |
| 7095 | 7095 | { |
| 7096 | 7096 | global $globalTimezone, $globalDBdriver; |
@@ -7114,7 +7114,7 @@ discard block |
||
| 7114 | 7114 | GROUP BY date_name |
| 7115 | 7115 | ORDER BY date_name ASC"; |
| 7116 | 7116 | $query_data = array(':offset' => $offset); |
| 7117 | - } |
|
| 7117 | + } |
|
| 7118 | 7118 | |
| 7119 | 7119 | $sth = $this->db->prepare($query); |
| 7120 | 7120 | $sth->execute($query_data); |
@@ -7134,11 +7134,11 @@ discard block |
||
| 7134 | 7134 | } |
| 7135 | 7135 | |
| 7136 | 7136 | /** |
| 7137 | - * Counts all dates during the last month |
|
| 7138 | - * |
|
| 7139 | - * @return Array the date list |
|
| 7140 | - * |
|
| 7141 | - */ |
|
| 7137 | + * Counts all dates during the last month |
|
| 7138 | + * |
|
| 7139 | + * @return Array the date list |
|
| 7140 | + * |
|
| 7141 | + */ |
|
| 7142 | 7142 | public function countAllDatesLastMonth() |
| 7143 | 7143 | { |
| 7144 | 7144 | global $globalTimezone, $globalDBdriver; |
@@ -7162,7 +7162,7 @@ discard block |
||
| 7162 | 7162 | GROUP BY date_name |
| 7163 | 7163 | ORDER BY date_name ASC"; |
| 7164 | 7164 | $query_data = array(':offset' => $offset); |
| 7165 | - } |
|
| 7165 | + } |
|
| 7166 | 7166 | |
| 7167 | 7167 | $sth = $this->db->prepare($query); |
| 7168 | 7168 | $sth->execute($query_data); |
@@ -7182,11 +7182,11 @@ discard block |
||
| 7182 | 7182 | } |
| 7183 | 7183 | |
| 7184 | 7184 | /** |
| 7185 | - * Counts all month |
|
| 7186 | - * |
|
| 7187 | - * @return Array the month list |
|
| 7188 | - * |
|
| 7189 | - */ |
|
| 7185 | + * Counts all month |
|
| 7186 | + * |
|
| 7187 | + * @return Array the month list |
|
| 7188 | + * |
|
| 7189 | + */ |
|
| 7190 | 7190 | public function countAllMonths() |
| 7191 | 7191 | { |
| 7192 | 7192 | global $globalTimezone, $globalDBdriver; |
@@ -7228,11 +7228,11 @@ discard block |
||
| 7228 | 7228 | } |
| 7229 | 7229 | |
| 7230 | 7230 | /** |
| 7231 | - * Counts all military month |
|
| 7232 | - * |
|
| 7233 | - * @return Array the month list |
|
| 7234 | - * |
|
| 7235 | - */ |
|
| 7231 | + * Counts all military month |
|
| 7232 | + * |
|
| 7233 | + * @return Array the month list |
|
| 7234 | + * |
|
| 7235 | + */ |
|
| 7236 | 7236 | public function countAllMilitaryMonths() |
| 7237 | 7237 | { |
| 7238 | 7238 | global $globalTimezone, $globalDBdriver; |
@@ -7275,11 +7275,11 @@ discard block |
||
| 7275 | 7275 | } |
| 7276 | 7276 | |
| 7277 | 7277 | /** |
| 7278 | - * Counts all month owners |
|
| 7279 | - * |
|
| 7280 | - * @return Array the month list |
|
| 7281 | - * |
|
| 7282 | - */ |
|
| 7278 | + * Counts all month owners |
|
| 7279 | + * |
|
| 7280 | + * @return Array the month list |
|
| 7281 | + * |
|
| 7282 | + */ |
|
| 7283 | 7283 | public function countAllMonthsOwners() |
| 7284 | 7284 | { |
| 7285 | 7285 | global $globalTimezone, $globalDBdriver; |
@@ -7322,11 +7322,11 @@ discard block |
||
| 7322 | 7322 | } |
| 7323 | 7323 | |
| 7324 | 7324 | /** |
| 7325 | - * Counts all month pilot |
|
| 7326 | - * |
|
| 7327 | - * @return Array the month list |
|
| 7328 | - * |
|
| 7329 | - */ |
|
| 7325 | + * Counts all month pilot |
|
| 7326 | + * |
|
| 7327 | + * @return Array the month list |
|
| 7328 | + * |
|
| 7329 | + */ |
|
| 7330 | 7330 | public function countAllMonthsPilots() |
| 7331 | 7331 | { |
| 7332 | 7332 | global $globalTimezone, $globalDBdriver; |
@@ -7370,11 +7370,11 @@ discard block |
||
| 7370 | 7370 | |
| 7371 | 7371 | |
| 7372 | 7372 | /** |
| 7373 | - * Counts all month airline |
|
| 7374 | - * |
|
| 7375 | - * @return Array the month list |
|
| 7376 | - * |
|
| 7377 | - */ |
|
| 7373 | + * Counts all month airline |
|
| 7374 | + * |
|
| 7375 | + * @return Array the month list |
|
| 7376 | + * |
|
| 7377 | + */ |
|
| 7378 | 7378 | public function countAllMonthsAirlines() |
| 7379 | 7379 | { |
| 7380 | 7380 | global $globalTimezone, $globalDBdriver; |
@@ -7417,11 +7417,11 @@ discard block |
||
| 7417 | 7417 | } |
| 7418 | 7418 | |
| 7419 | 7419 | /** |
| 7420 | - * Counts all month aircraft |
|
| 7421 | - * |
|
| 7422 | - * @return Array the month list |
|
| 7423 | - * |
|
| 7424 | - */ |
|
| 7420 | + * Counts all month aircraft |
|
| 7421 | + * |
|
| 7422 | + * @return Array the month list |
|
| 7423 | + * |
|
| 7424 | + */ |
|
| 7425 | 7425 | public function countAllMonthsAircrafts() |
| 7426 | 7426 | { |
| 7427 | 7427 | global $globalTimezone, $globalDBdriver; |
@@ -7465,11 +7465,11 @@ discard block |
||
| 7465 | 7465 | |
| 7466 | 7466 | |
| 7467 | 7467 | /** |
| 7468 | - * Counts all month real arrival |
|
| 7469 | - * |
|
| 7470 | - * @return Array the month list |
|
| 7471 | - * |
|
| 7472 | - */ |
|
| 7468 | + * Counts all month real arrival |
|
| 7469 | + * |
|
| 7470 | + * @return Array the month list |
|
| 7471 | + * |
|
| 7472 | + */ |
|
| 7473 | 7473 | public function countAllMonthsRealArrivals() |
| 7474 | 7474 | { |
| 7475 | 7475 | global $globalTimezone, $globalDBdriver; |
@@ -7514,11 +7514,11 @@ discard block |
||
| 7514 | 7514 | |
| 7515 | 7515 | |
| 7516 | 7516 | /** |
| 7517 | - * Counts all dates during the last year |
|
| 7518 | - * |
|
| 7519 | - * @return Array the date list |
|
| 7520 | - * |
|
| 7521 | - */ |
|
| 7517 | + * Counts all dates during the last year |
|
| 7518 | + * |
|
| 7519 | + * @return Array the date list |
|
| 7520 | + * |
|
| 7521 | + */ |
|
| 7522 | 7522 | public function countAllMonthsLastYear() |
| 7523 | 7523 | { |
| 7524 | 7524 | global $globalTimezone, $globalDBdriver; |
@@ -7542,7 +7542,7 @@ discard block |
||
| 7542 | 7542 | GROUP BY year_name, month_name |
| 7543 | 7543 | ORDER BY year_name, month_name ASC"; |
| 7544 | 7544 | $query_data = array(':offset' => $offset); |
| 7545 | - } |
|
| 7545 | + } |
|
| 7546 | 7546 | |
| 7547 | 7547 | $sth = $this->db->prepare($query); |
| 7548 | 7548 | $sth->execute($query_data); |
@@ -7565,11 +7565,11 @@ discard block |
||
| 7565 | 7565 | |
| 7566 | 7566 | |
| 7567 | 7567 | /** |
| 7568 | - * Counts all hours |
|
| 7569 | - * |
|
| 7570 | - * @return Array the hour list |
|
| 7571 | - * |
|
| 7572 | - */ |
|
| 7568 | + * Counts all hours |
|
| 7569 | + * |
|
| 7570 | + * @return Array the hour list |
|
| 7571 | + * |
|
| 7572 | + */ |
|
| 7573 | 7573 | public function countAllHours($orderby) |
| 7574 | 7574 | { |
| 7575 | 7575 | global $globalTimezone, $globalDBdriver; |
@@ -7629,11 +7629,11 @@ discard block |
||
| 7629 | 7629 | |
| 7630 | 7630 | |
| 7631 | 7631 | /** |
| 7632 | - * Counts all hours by airline |
|
| 7633 | - * |
|
| 7634 | - * @return Array the hour list |
|
| 7635 | - * |
|
| 7636 | - */ |
|
| 7632 | + * Counts all hours by airline |
|
| 7633 | + * |
|
| 7634 | + * @return Array the hour list |
|
| 7635 | + * |
|
| 7636 | + */ |
|
| 7637 | 7637 | public function countAllHoursByAirline($airline_icao) |
| 7638 | 7638 | { |
| 7639 | 7639 | global $globalTimezone, $globalDBdriver; |
@@ -7680,11 +7680,11 @@ discard block |
||
| 7680 | 7680 | |
| 7681 | 7681 | |
| 7682 | 7682 | /** |
| 7683 | - * Counts all hours by aircraft |
|
| 7684 | - * |
|
| 7685 | - * @return Array the hour list |
|
| 7686 | - * |
|
| 7687 | - */ |
|
| 7683 | + * Counts all hours by aircraft |
|
| 7684 | + * |
|
| 7685 | + * @return Array the hour list |
|
| 7686 | + * |
|
| 7687 | + */ |
|
| 7688 | 7688 | public function countAllHoursByAircraft($aircraft_icao) |
| 7689 | 7689 | { |
| 7690 | 7690 | global $globalTimezone, $globalDBdriver; |
@@ -7728,11 +7728,11 @@ discard block |
||
| 7728 | 7728 | |
| 7729 | 7729 | |
| 7730 | 7730 | /** |
| 7731 | - * Counts all hours by aircraft registration |
|
| 7732 | - * |
|
| 7733 | - * @return Array the hour list |
|
| 7734 | - * |
|
| 7735 | - */ |
|
| 7731 | + * Counts all hours by aircraft registration |
|
| 7732 | + * |
|
| 7733 | + * @return Array the hour list |
|
| 7734 | + * |
|
| 7735 | + */ |
|
| 7736 | 7736 | public function countAllHoursByRegistration($registration) |
| 7737 | 7737 | { |
| 7738 | 7738 | global $globalTimezone, $globalDBdriver; |
@@ -7776,11 +7776,11 @@ discard block |
||
| 7776 | 7776 | |
| 7777 | 7777 | |
| 7778 | 7778 | /** |
| 7779 | - * Counts all hours by airport |
|
| 7780 | - * |
|
| 7781 | - * @return Array the hour list |
|
| 7782 | - * |
|
| 7783 | - */ |
|
| 7779 | + * Counts all hours by airport |
|
| 7780 | + * |
|
| 7781 | + * @return Array the hour list |
|
| 7782 | + * |
|
| 7783 | + */ |
|
| 7784 | 7784 | public function countAllHoursByAirport($airport_icao) |
| 7785 | 7785 | { |
| 7786 | 7786 | global $globalTimezone, $globalDBdriver; |
@@ -7825,11 +7825,11 @@ discard block |
||
| 7825 | 7825 | |
| 7826 | 7826 | |
| 7827 | 7827 | /** |
| 7828 | - * Counts all hours by manufacturer |
|
| 7829 | - * |
|
| 7830 | - * @return Array the hour list |
|
| 7831 | - * |
|
| 7832 | - */ |
|
| 7828 | + * Counts all hours by manufacturer |
|
| 7829 | + * |
|
| 7830 | + * @return Array the hour list |
|
| 7831 | + * |
|
| 7832 | + */ |
|
| 7833 | 7833 | public function countAllHoursByManufacturer($aircraft_manufacturer) |
| 7834 | 7834 | { |
| 7835 | 7835 | global $globalTimezone, $globalDBdriver; |
@@ -7874,11 +7874,11 @@ discard block |
||
| 7874 | 7874 | |
| 7875 | 7875 | |
| 7876 | 7876 | /** |
| 7877 | - * Counts all hours by date |
|
| 7878 | - * |
|
| 7879 | - * @return Array the hour list |
|
| 7880 | - * |
|
| 7881 | - */ |
|
| 7877 | + * Counts all hours by date |
|
| 7878 | + * |
|
| 7879 | + * @return Array the hour list |
|
| 7880 | + * |
|
| 7881 | + */ |
|
| 7882 | 7882 | public function countAllHoursByDate($date) |
| 7883 | 7883 | { |
| 7884 | 7884 | global $globalTimezone, $globalDBdriver; |
@@ -7923,11 +7923,11 @@ discard block |
||
| 7923 | 7923 | |
| 7924 | 7924 | |
| 7925 | 7925 | /** |
| 7926 | - * Counts all hours by a ident/callsign |
|
| 7927 | - * |
|
| 7928 | - * @return Array the hour list |
|
| 7929 | - * |
|
| 7930 | - */ |
|
| 7926 | + * Counts all hours by a ident/callsign |
|
| 7927 | + * |
|
| 7928 | + * @return Array the hour list |
|
| 7929 | + * |
|
| 7930 | + */ |
|
| 7931 | 7931 | public function countAllHoursByIdent($ident) |
| 7932 | 7932 | { |
| 7933 | 7933 | global $globalTimezone, $globalDBdriver; |
@@ -7973,11 +7973,11 @@ discard block |
||
| 7973 | 7973 | |
| 7974 | 7974 | |
| 7975 | 7975 | /** |
| 7976 | - * Counts all hours by route |
|
| 7977 | - * |
|
| 7978 | - * @return Array the hour list |
|
| 7979 | - * |
|
| 7980 | - */ |
|
| 7976 | + * Counts all hours by route |
|
| 7977 | + * |
|
| 7978 | + * @return Array the hour list |
|
| 7979 | + * |
|
| 7980 | + */ |
|
| 7981 | 7981 | public function countAllHoursByRoute($departure_airport_icao, $arrival_airport_icao) |
| 7982 | 7982 | { |
| 7983 | 7983 | global $globalTimezone, $globalDBdriver; |
@@ -8022,11 +8022,11 @@ discard block |
||
| 8022 | 8022 | |
| 8023 | 8023 | |
| 8024 | 8024 | /** |
| 8025 | - * Counts all hours by country |
|
| 8026 | - * |
|
| 8027 | - * @return Array the hour list |
|
| 8028 | - * |
|
| 8029 | - */ |
|
| 8025 | + * Counts all hours by country |
|
| 8026 | + * |
|
| 8027 | + * @return Array the hour list |
|
| 8028 | + * |
|
| 8029 | + */ |
|
| 8030 | 8030 | public function countAllHoursByCountry($country) |
| 8031 | 8031 | { |
| 8032 | 8032 | global $globalTimezone, $globalDBdriver; |
@@ -8072,11 +8072,11 @@ discard block |
||
| 8072 | 8072 | |
| 8073 | 8073 | |
| 8074 | 8074 | /** |
| 8075 | - * Counts all aircraft that have flown over |
|
| 8076 | - * |
|
| 8077 | - * @return Integer the number of aircrafts |
|
| 8078 | - * |
|
| 8079 | - */ |
|
| 8075 | + * Counts all aircraft that have flown over |
|
| 8076 | + * |
|
| 8077 | + * @return Integer the number of aircrafts |
|
| 8078 | + * |
|
| 8079 | + */ |
|
| 8080 | 8080 | public function countOverallAircrafts() |
| 8081 | 8081 | { |
| 8082 | 8082 | $query = "SELECT COUNT(DISTINCT spotter_output.aircraft_icao) AS aircraft_count |
@@ -8090,11 +8090,11 @@ discard block |
||
| 8090 | 8090 | } |
| 8091 | 8091 | |
| 8092 | 8092 | /** |
| 8093 | - * Counts all flight that really arrival |
|
| 8094 | - * |
|
| 8095 | - * @return Integer the number of aircrafts |
|
| 8096 | - * |
|
| 8097 | - */ |
|
| 8093 | + * Counts all flight that really arrival |
|
| 8094 | + * |
|
| 8095 | + * @return Integer the number of aircrafts |
|
| 8096 | + * |
|
| 8097 | + */ |
|
| 8098 | 8098 | public function countOverallArrival() |
| 8099 | 8099 | { |
| 8100 | 8100 | $query = "SELECT COUNT(spotter_output.real_arrival_airport_icao) AS arrival_count |
@@ -8108,11 +8108,11 @@ discard block |
||
| 8108 | 8108 | } |
| 8109 | 8109 | |
| 8110 | 8110 | /** |
| 8111 | - * Counts all pilots that have flown over |
|
| 8112 | - * |
|
| 8113 | - * @return Integer the number of pilots |
|
| 8114 | - * |
|
| 8115 | - */ |
|
| 8111 | + * Counts all pilots that have flown over |
|
| 8112 | + * |
|
| 8113 | + * @return Integer the number of pilots |
|
| 8114 | + * |
|
| 8115 | + */ |
|
| 8116 | 8116 | public function countOverallPilots() |
| 8117 | 8117 | { |
| 8118 | 8118 | $query = "SELECT COUNT(DISTINCT spotter_output.pilot_id) AS pilot_count |
@@ -8126,11 +8126,11 @@ discard block |
||
| 8126 | 8126 | } |
| 8127 | 8127 | |
| 8128 | 8128 | /** |
| 8129 | - * Counts all owners that have flown over |
|
| 8130 | - * |
|
| 8131 | - * @return Integer the number of owners |
|
| 8132 | - * |
|
| 8133 | - */ |
|
| 8129 | + * Counts all owners that have flown over |
|
| 8130 | + * |
|
| 8131 | + * @return Integer the number of owners |
|
| 8132 | + * |
|
| 8133 | + */ |
|
| 8134 | 8134 | public function countOverallOwners() |
| 8135 | 8135 | { |
| 8136 | 8136 | $query = "SELECT COUNT(DISTINCT spotter_output.owner_name) AS owner_count |
@@ -8145,11 +8145,11 @@ discard block |
||
| 8145 | 8145 | |
| 8146 | 8146 | |
| 8147 | 8147 | /** |
| 8148 | - * Counts all flights that have flown over |
|
| 8149 | - * |
|
| 8150 | - * @return Integer the number of flights |
|
| 8151 | - * |
|
| 8152 | - */ |
|
| 8148 | + * Counts all flights that have flown over |
|
| 8149 | + * |
|
| 8150 | + * @return Integer the number of flights |
|
| 8151 | + * |
|
| 8152 | + */ |
|
| 8153 | 8153 | public function countOverallFlights() |
| 8154 | 8154 | { |
| 8155 | 8155 | $query = "SELECT COUNT(spotter_output.spotter_id) AS flight_count |
@@ -8162,11 +8162,11 @@ discard block |
||
| 8162 | 8162 | } |
| 8163 | 8163 | |
| 8164 | 8164 | /** |
| 8165 | - * Counts all military flights that have flown over |
|
| 8166 | - * |
|
| 8167 | - * @return Integer the number of flights |
|
| 8168 | - * |
|
| 8169 | - */ |
|
| 8165 | + * Counts all military flights that have flown over |
|
| 8166 | + * |
|
| 8167 | + * @return Integer the number of flights |
|
| 8168 | + * |
|
| 8169 | + */ |
|
| 8170 | 8170 | public function countOverallMilitaryFlights() |
| 8171 | 8171 | { |
| 8172 | 8172 | $query = "SELECT COUNT(s.spotter_id) AS flight_count |
@@ -8181,11 +8181,11 @@ discard block |
||
| 8181 | 8181 | |
| 8182 | 8182 | |
| 8183 | 8183 | /** |
| 8184 | - * Counts all airlines that have flown over |
|
| 8185 | - * |
|
| 8186 | - * @return Integer the number of airlines |
|
| 8187 | - * |
|
| 8188 | - */ |
|
| 8184 | + * Counts all airlines that have flown over |
|
| 8185 | + * |
|
| 8186 | + * @return Integer the number of airlines |
|
| 8187 | + * |
|
| 8188 | + */ |
|
| 8189 | 8189 | public function countOverallAirlines() |
| 8190 | 8190 | { |
| 8191 | 8191 | $query = "SELECT COUNT(DISTINCT spotter_output.airline_name) AS airline_count |
@@ -8199,11 +8199,11 @@ discard block |
||
| 8199 | 8199 | |
| 8200 | 8200 | |
| 8201 | 8201 | /** |
| 8202 | - * Counts all hours of today |
|
| 8203 | - * |
|
| 8204 | - * @return Array the hour list |
|
| 8205 | - * |
|
| 8206 | - */ |
|
| 8202 | + * Counts all hours of today |
|
| 8203 | + * |
|
| 8204 | + * @return Array the hour list |
|
| 8205 | + * |
|
| 8206 | + */ |
|
| 8207 | 8207 | public function countAllHoursFromToday() |
| 8208 | 8208 | { |
| 8209 | 8209 | global $globalTimezone, $globalDBdriver; |
@@ -8244,11 +8244,11 @@ discard block |
||
| 8244 | 8244 | } |
| 8245 | 8245 | |
| 8246 | 8246 | /** |
| 8247 | - * Gets all the spotter information based on calculated upcoming flights |
|
| 8248 | - * |
|
| 8249 | - * @return Array the spotter information |
|
| 8250 | - * |
|
| 8251 | - */ |
|
| 8247 | + * Gets all the spotter information based on calculated upcoming flights |
|
| 8248 | + * |
|
| 8249 | + * @return Array the spotter information |
|
| 8250 | + * |
|
| 8251 | + */ |
|
| 8252 | 8252 | public function getUpcomingFlights($limit = '', $sort = '') |
| 8253 | 8253 | { |
| 8254 | 8254 | global $global_query, $globalDBdriver, $globalTimezone; |
@@ -8311,12 +8311,12 @@ discard block |
||
| 8311 | 8311 | } |
| 8312 | 8312 | |
| 8313 | 8313 | |
| 8314 | - /** |
|
| 8315 | - * Gets the Barrie Spotter ID based on the FlightAware ID |
|
| 8316 | - * |
|
| 8317 | - * @return Integer the Barrie Spotter ID |
|
| 8318 | - * |
|
| 8319 | - */ |
|
| 8314 | + /** |
|
| 8315 | + * Gets the Barrie Spotter ID based on the FlightAware ID |
|
| 8316 | + * |
|
| 8317 | + * @return Integer the Barrie Spotter ID |
|
| 8318 | + * |
|
| 8319 | + */ |
|
| 8320 | 8320 | public function getSpotterIDBasedOnFlightAwareID($flightaware_id) |
| 8321 | 8321 | { |
| 8322 | 8322 | $flightaware_id = filter_var($flightaware_id,FILTER_SANITIZE_STRING); |
@@ -8337,13 +8337,13 @@ discard block |
||
| 8337 | 8337 | |
| 8338 | 8338 | |
| 8339 | 8339 | /** |
| 8340 | - * Parses a date string |
|
| 8341 | - * |
|
| 8342 | - * @param String $dateString the date string |
|
| 8343 | - * @param String $timezone the timezone of a user |
|
| 8344 | - * @return Array the time information |
|
| 8345 | - * |
|
| 8346 | - */ |
|
| 8340 | + * Parses a date string |
|
| 8341 | + * |
|
| 8342 | + * @param String $dateString the date string |
|
| 8343 | + * @param String $timezone the timezone of a user |
|
| 8344 | + * @return Array the time information |
|
| 8345 | + * |
|
| 8346 | + */ |
|
| 8347 | 8347 | public function parseDateString($dateString, $timezone = '') |
| 8348 | 8348 | { |
| 8349 | 8349 | $time_array = array(); |
@@ -8379,12 +8379,12 @@ discard block |
||
| 8379 | 8379 | |
| 8380 | 8380 | |
| 8381 | 8381 | /** |
| 8382 | - * Parses the direction degrees to working |
|
| 8383 | - * |
|
| 8384 | - * @param Float $direction the direction in degrees |
|
| 8385 | - * @return Array the direction information |
|
| 8386 | - * |
|
| 8387 | - */ |
|
| 8382 | + * Parses the direction degrees to working |
|
| 8383 | + * |
|
| 8384 | + * @param Float $direction the direction in degrees |
|
| 8385 | + * @return Array the direction information |
|
| 8386 | + * |
|
| 8387 | + */ |
|
| 8388 | 8388 | public function parseDirection($direction = 0) |
| 8389 | 8389 | { |
| 8390 | 8390 | if ($direction == '') $direction = 0; |
@@ -8463,12 +8463,12 @@ discard block |
||
| 8463 | 8463 | |
| 8464 | 8464 | |
| 8465 | 8465 | /** |
| 8466 | - * Gets the aircraft registration |
|
| 8467 | - * |
|
| 8468 | - * @param String $flightaware_id the flight aware id |
|
| 8469 | - * @return String the aircraft registration |
|
| 8470 | - * |
|
| 8471 | - */ |
|
| 8466 | + * Gets the aircraft registration |
|
| 8467 | + * |
|
| 8468 | + * @param String $flightaware_id the flight aware id |
|
| 8469 | + * @return String the aircraft registration |
|
| 8470 | + * |
|
| 8471 | + */ |
|
| 8472 | 8472 | |
| 8473 | 8473 | public function getAircraftRegistration($flightaware_id) |
| 8474 | 8474 | { |
@@ -8497,12 +8497,12 @@ discard block |
||
| 8497 | 8497 | |
| 8498 | 8498 | |
| 8499 | 8499 | /** |
| 8500 | - * Gets the aircraft registration from ModeS |
|
| 8501 | - * |
|
| 8502 | - * @param String $aircraft_modes the flight ModeS in hex |
|
| 8503 | - * @return String the aircraft registration |
|
| 8504 | - * |
|
| 8505 | - */ |
|
| 8500 | + * Gets the aircraft registration from ModeS |
|
| 8501 | + * |
|
| 8502 | + * @param String $aircraft_modes the flight ModeS in hex |
|
| 8503 | + * @return String the aircraft registration |
|
| 8504 | + * |
|
| 8505 | + */ |
|
| 8506 | 8506 | public function getAircraftRegistrationBymodeS($aircraft_modes) |
| 8507 | 8507 | { |
| 8508 | 8508 | $aircraft_modes = filter_var($aircraft_modes,FILTER_SANITIZE_STRING); |
@@ -8514,19 +8514,19 @@ discard block |
||
| 8514 | 8514 | |
| 8515 | 8515 | $row = $sth->fetch(PDO::FETCH_ASSOC); |
| 8516 | 8516 | if (count($row) > 0) { |
| 8517 | - //return $row['Registration']; |
|
| 8518 | - return $row['registration']; |
|
| 8517 | + //return $row['Registration']; |
|
| 8518 | + return $row['registration']; |
|
| 8519 | 8519 | } else return ''; |
| 8520 | 8520 | |
| 8521 | 8521 | } |
| 8522 | 8522 | |
| 8523 | 8523 | /** |
| 8524 | - * Gets the aircraft type from ModeS |
|
| 8525 | - * |
|
| 8526 | - * @param String $aircraft_modes the flight ModeS in hex |
|
| 8527 | - * @return String the aircraft type |
|
| 8528 | - * |
|
| 8529 | - */ |
|
| 8524 | + * Gets the aircraft type from ModeS |
|
| 8525 | + * |
|
| 8526 | + * @param String $aircraft_modes the flight ModeS in hex |
|
| 8527 | + * @return String the aircraft type |
|
| 8528 | + * |
|
| 8529 | + */ |
|
| 8530 | 8530 | public function getAircraftTypeBymodeS($aircraft_modes) |
| 8531 | 8531 | { |
| 8532 | 8532 | $aircraft_modes = filter_var($aircraft_modes,FILTER_SANITIZE_STRING); |
@@ -8538,19 +8538,19 @@ discard block |
||
| 8538 | 8538 | |
| 8539 | 8539 | $row = $sth->fetch(PDO::FETCH_ASSOC); |
| 8540 | 8540 | if (count($row) > 0) { |
| 8541 | - if ($row['type_flight'] == null) return ''; |
|
| 8542 | - else return $row['type_flight']; |
|
| 8541 | + if ($row['type_flight'] == null) return ''; |
|
| 8542 | + else return $row['type_flight']; |
|
| 8543 | 8543 | } else return ''; |
| 8544 | 8544 | |
| 8545 | 8545 | } |
| 8546 | 8546 | |
| 8547 | 8547 | /** |
| 8548 | - * Gets Countrie from latitude/longitude |
|
| 8549 | - * |
|
| 8550 | - * @param Float $latitude latitute of the flight |
|
| 8551 | - * @param Float $longitude longitute of the flight |
|
| 8552 | - * @return String the countrie |
|
| 8553 | - */ |
|
| 8548 | + * Gets Countrie from latitude/longitude |
|
| 8549 | + * |
|
| 8550 | + * @param Float $latitude latitute of the flight |
|
| 8551 | + * @param Float $longitude longitute of the flight |
|
| 8552 | + * @return String the countrie |
|
| 8553 | + */ |
|
| 8554 | 8554 | public function getCountryFromLatitudeLongitude($latitude,$longitude) |
| 8555 | 8555 | { |
| 8556 | 8556 | global $globalDBdriver, $globalDebug; |
@@ -8583,12 +8583,12 @@ discard block |
||
| 8583 | 8583 | } |
| 8584 | 8584 | |
| 8585 | 8585 | /** |
| 8586 | - * converts the registration code using the country prefix |
|
| 8587 | - * |
|
| 8588 | - * @param String $registration the aircraft registration |
|
| 8589 | - * @return String the aircraft registration |
|
| 8590 | - * |
|
| 8591 | - */ |
|
| 8586 | + * converts the registration code using the country prefix |
|
| 8587 | + * |
|
| 8588 | + * @param String $registration the aircraft registration |
|
| 8589 | + * @return String the aircraft registration |
|
| 8590 | + * |
|
| 8591 | + */ |
|
| 8592 | 8592 | public function convertAircraftRegistration($registration) |
| 8593 | 8593 | { |
| 8594 | 8594 | $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
@@ -8640,12 +8640,12 @@ discard block |
||
| 8640 | 8640 | } |
| 8641 | 8641 | |
| 8642 | 8642 | /** |
| 8643 | - * Country from the registration code |
|
| 8644 | - * |
|
| 8645 | - * @param String $registration the aircraft registration |
|
| 8646 | - * @return String the country |
|
| 8647 | - * |
|
| 8648 | - */ |
|
| 8643 | + * Country from the registration code |
|
| 8644 | + * |
|
| 8645 | + * @param String $registration the aircraft registration |
|
| 8646 | + * @return String the country |
|
| 8647 | + * |
|
| 8648 | + */ |
|
| 8649 | 8649 | public function countryFromAircraftRegistration($registration) |
| 8650 | 8650 | { |
| 8651 | 8651 | $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
@@ -8664,8 +8664,8 @@ discard block |
||
| 8664 | 8664 | $country = $row['country']; |
| 8665 | 8665 | } |
| 8666 | 8666 | } else { |
| 8667 | - $registration_1 = substr($registration, 0, 1); |
|
| 8668 | - $registration_2 = substr($registration, 0, 2); |
|
| 8667 | + $registration_1 = substr($registration, 0, 1); |
|
| 8668 | + $registration_2 = substr($registration, 0, 2); |
|
| 8669 | 8669 | |
| 8670 | 8670 | $country = ''; |
| 8671 | 8671 | //first get the prefix based on two characters |
@@ -8701,11 +8701,11 @@ discard block |
||
| 8701 | 8701 | } |
| 8702 | 8702 | |
| 8703 | 8703 | /** |
| 8704 | - * Set a new highlight value for a flight |
|
| 8705 | - * |
|
| 8706 | - * @param String $flightaware_id flightaware_id from spotter_output table |
|
| 8707 | - * @param String $highlight New highlight value |
|
| 8708 | - */ |
|
| 8704 | + * Set a new highlight value for a flight |
|
| 8705 | + * |
|
| 8706 | + * @param String $flightaware_id flightaware_id from spotter_output table |
|
| 8707 | + * @param String $highlight New highlight value |
|
| 8708 | + */ |
|
| 8709 | 8709 | public function setHighlightFlight($flightaware_id,$highlight) { |
| 8710 | 8710 | |
| 8711 | 8711 | $query = "UPDATE spotter_output SET highlight = :highlight WHERE flightaware_id = :flightaware_id"; |
@@ -8714,12 +8714,12 @@ discard block |
||
| 8714 | 8714 | } |
| 8715 | 8715 | |
| 8716 | 8716 | /** |
| 8717 | - * Gets the short url from bit.ly |
|
| 8718 | - * |
|
| 8719 | - * @param String $url the full url |
|
| 8720 | - * @return String the bit.ly url |
|
| 8721 | - * |
|
| 8722 | - */ |
|
| 8717 | + * Gets the short url from bit.ly |
|
| 8718 | + * |
|
| 8719 | + * @param String $url the full url |
|
| 8720 | + * @return String the bit.ly url |
|
| 8721 | + * |
|
| 8722 | + */ |
|
| 8723 | 8723 | public function getBitlyURL($url) |
| 8724 | 8724 | { |
| 8725 | 8725 | global $globalBitlyAccessToken; |
@@ -9003,11 +9003,11 @@ discard block |
||
| 9003 | 9003 | $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 |
| 9004 | 9004 | 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)) |
| 9005 | 9005 | 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;"; |
| 9006 | - } else { |
|
| 9006 | + } else { |
|
| 9007 | 9007 | $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 |
| 9008 | 9008 | 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)) |
| 9009 | 9009 | 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;"; |
| 9010 | - } |
|
| 9010 | + } |
|
| 9011 | 9011 | $sth = $this->db->prepare($query); |
| 9012 | 9012 | $sth->execute(); |
| 9013 | 9013 | return $sth->fetchAll(PDO::FETCH_ASSOC); |
@@ -4,7 +4,7 @@ discard block |
||
| 4 | 4 | require_once(dirname(__FILE__).'/class.Image.php'); |
| 5 | 5 | $global_query = "SELECT spotter_output.* FROM spotter_output"; |
| 6 | 6 | |
| 7 | -class Spotter{ |
|
| 7 | +class Spotter { |
|
| 8 | 8 | public $db; |
| 9 | 9 | |
| 10 | 10 | public function __construct($dbc = null) { |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | $sth = $this->db->prepare($query.$limitQuery); |
| 51 | 51 | $sth->execute($params); |
| 52 | 52 | } catch (PDOException $e) { |
| 53 | - printf("Invalid query : %s\nWhole query: %s\n",$e->getMessage(), $query.$limitQuery); |
|
| 53 | + printf("Invalid query : %s\nWhole query: %s\n", $e->getMessage(), $query.$limitQuery); |
|
| 54 | 54 | exit(); |
| 55 | 55 | } |
| 56 | 56 | |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | $spotter_array = array(); |
| 61 | 61 | |
| 62 | 62 | |
| 63 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 63 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 64 | 64 | { |
| 65 | 65 | $num_rows++; |
| 66 | 66 | $temp_array = array(); |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | if (isset($row['route_stop'])) { |
| 106 | 106 | $temp_array['route_stop'] = $row['route_stop']; |
| 107 | 107 | if ($row['route_stop'] != '') { |
| 108 | - $allroute = explode(' ',$row['route_stop']); |
|
| 108 | + $allroute = explode(' ', $row['route_stop']); |
|
| 109 | 109 | |
| 110 | 110 | foreach ($allroute as $route) { |
| 111 | 111 | $route_airport_array = $this->getAllAirportInfo($route); |
@@ -157,11 +157,11 @@ discard block |
||
| 157 | 157 | { |
| 158 | 158 | $temp_array['date'] = "about ".$dateArray['hours']." hours ago"; |
| 159 | 159 | } else { |
| 160 | - $temp_array['date'] = date("M j Y, g:i a",strtotime($row['date']." UTC")); |
|
| 160 | + $temp_array['date'] = date("M j Y, g:i a", strtotime($row['date']." UTC")); |
|
| 161 | 161 | } |
| 162 | 162 | $temp_array['date_minutes_past'] = $dateArray['minutes']; |
| 163 | - $temp_array['date_iso_8601'] = date("c",strtotime($row['date']." UTC")); |
|
| 164 | - $temp_array['date_rfc_2822'] = date("r",strtotime($row['date']." UTC")); |
|
| 163 | + $temp_array['date_iso_8601'] = date("c", strtotime($row['date']." UTC")); |
|
| 164 | + $temp_array['date_rfc_2822'] = date("r", strtotime($row['date']." UTC")); |
|
| 165 | 165 | $temp_array['date_unix'] = strtotime($row['date']." UTC"); |
| 166 | 166 | |
| 167 | 167 | if (isset($row['aircraft_name']) && $row['aircraft_name'] != '' && isset($row['aircraft_shadow']) && $row['aircraft_shadow'] != '') { |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | $temp_array['airline_type'] = $row['airline_type']; |
| 217 | 217 | } |
| 218 | 218 | if (isset($temp_array['airline_iata']) && $temp_array['airline_iata'] != '') { |
| 219 | - $acars_array = $ACARS->getLiveAcarsData($temp_array['airline_iata'].substr($temp_array['ident'],3)); |
|
| 219 | + $acars_array = $ACARS->getLiveAcarsData($temp_array['airline_iata'].substr($temp_array['ident'], 3)); |
|
| 220 | 220 | //$acars_array = ACARS->getLiveAcarsData('BA40YL'); |
| 221 | 221 | if (count($acars_array) > 0) { |
| 222 | 222 | $temp_array['acars'] = $acars_array; |
@@ -233,11 +233,11 @@ discard block |
||
| 233 | 233 | $temp_array['aircraft_date_first_reg'] = $owner_info['date_first_reg']; |
| 234 | 234 | } |
| 235 | 235 | |
| 236 | - if($temp_array['registration'] != "" || ($globalIVAO && $temp_array['aircraft_type'] != '')) |
|
| 236 | + if ($temp_array['registration'] != "" || ($globalIVAO && $temp_array['aircraft_type'] != '')) |
|
| 237 | 237 | { |
| 238 | 238 | if ($globalIVAO) { |
| 239 | - if (isset($temp_array['airline_icao'])) $image_array = $Image->getSpotterImage('',$temp_array['aircraft_type'],$temp_array['airline_icao']); |
|
| 240 | - else $image_array = $Image->getSpotterImage('',$temp_array['aircraft_type']); |
|
| 239 | + if (isset($temp_array['airline_icao'])) $image_array = $Image->getSpotterImage('', $temp_array['aircraft_type'], $temp_array['airline_icao']); |
|
| 240 | + else $image_array = $Image->getSpotterImage('', $temp_array['aircraft_type']); |
|
| 241 | 241 | } else $image_array = $Image->getSpotterImage($temp_array['registration']); |
| 242 | 242 | if (count($image_array) > 0) { |
| 243 | 243 | $temp_array['image'] = $image_array[0]['image']; |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | if (isset($row['arrival_airport_time']) && $row['arrival_airport_time'] != '') { |
| 261 | 261 | $temp_array['arrival_airport_time'] = $row['arrival_airport_time']; |
| 262 | 262 | } |
| 263 | - if ((!isset($globalIVAO) || ! $globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS)) { |
|
| 263 | + if ((!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS)) { |
|
| 264 | 264 | $schedule_array = $Schedule->getSchedule($temp_array['ident']); |
| 265 | 265 | //print_r($schedule_array); |
| 266 | 266 | if (count($schedule_array) > 0) { |
@@ -341,12 +341,12 @@ discard block |
||
| 341 | 341 | if (isset($row['squawk'])) { |
| 342 | 342 | $temp_array['squawk'] = $row['squawk']; |
| 343 | 343 | if ($row['squawk'] != '' && isset($temp_array['country_iso2'])) { |
| 344 | - $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'],$temp_array['country_iso2']); |
|
| 345 | - if ($temp_array['squawk_usage'] == '' && isset($globalSquawkCountry)) $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'],$globalSquawkCountry); |
|
| 344 | + $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'], $temp_array['country_iso2']); |
|
| 345 | + if ($temp_array['squawk_usage'] == '' && isset($globalSquawkCountry)) $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'], $globalSquawkCountry); |
|
| 346 | 346 | } elseif ($row['squawk'] != '' && isset($temp_array['over_country'])) { |
| 347 | - $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'],$temp_array['over_country']); |
|
| 348 | - if ($temp_array['squawk_usage'] == '' && isset($globalSquawkCountry)) $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'],$globalSquawkCountry); |
|
| 349 | - } elseif ($row['squawk'] != '' && isset($globalSquawkCountry)) $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'],$globalSquawkCountry); |
|
| 347 | + $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'], $temp_array['over_country']); |
|
| 348 | + if ($temp_array['squawk_usage'] == '' && isset($globalSquawkCountry)) $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'], $globalSquawkCountry); |
|
| 349 | + } elseif ($row['squawk'] != '' && isset($globalSquawkCountry)) $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'], $globalSquawkCountry); |
|
| 350 | 350 | } |
| 351 | 351 | |
| 352 | 352 | $temp_array['query_number_rows'] = $num_rows; |
@@ -365,7 +365,7 @@ discard block |
||
| 365 | 365 | * @return Array the spotter information |
| 366 | 366 | * |
| 367 | 367 | */ |
| 368 | - 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 = '') |
|
| 368 | + 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 = '') |
|
| 369 | 369 | { |
| 370 | 370 | global $globalTimezone, $globalDBdriver; |
| 371 | 371 | require_once(dirname(__FILE__).'/class.Translation.php'); |
@@ -382,8 +382,8 @@ discard block |
||
| 382 | 382 | return false; |
| 383 | 383 | } else { |
| 384 | 384 | $q_array = explode(" ", $q); |
| 385 | - foreach ($q_array as $q_item){ |
|
| 386 | - $q_item = filter_var($q_item,FILTER_SANITIZE_STRING); |
|
| 385 | + foreach ($q_array as $q_item) { |
|
| 386 | + $q_item = filter_var($q_item, FILTER_SANITIZE_STRING); |
|
| 387 | 387 | $additional_query .= " AND ("; |
| 388 | 388 | if (is_int($q_item)) $additional_query .= "(spotter_output.spotter_id like '%".$q_item."%') OR "; |
| 389 | 389 | $additional_query .= "(spotter_output.aircraft_icao like '%".$q_item."%') OR "; |
@@ -415,37 +415,37 @@ discard block |
||
| 415 | 415 | |
| 416 | 416 | if ($registration != "") |
| 417 | 417 | { |
| 418 | - $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
|
| 418 | + $registration = filter_var($registration, FILTER_SANITIZE_STRING); |
|
| 419 | 419 | if (!is_string($registration)) |
| 420 | 420 | { |
| 421 | 421 | return false; |
| 422 | 422 | } else { |
| 423 | 423 | $additional_query .= " AND spotter_output.registration = :registration"; |
| 424 | - $query_values = array_merge($query_values,array(':registration' => $registration)); |
|
| 424 | + $query_values = array_merge($query_values, array(':registration' => $registration)); |
|
| 425 | 425 | } |
| 426 | 426 | } |
| 427 | 427 | |
| 428 | 428 | if ($aircraft_icao != "") |
| 429 | 429 | { |
| 430 | - $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
|
| 430 | + $aircraft_icao = filter_var($aircraft_icao, FILTER_SANITIZE_STRING); |
|
| 431 | 431 | if (!is_string($aircraft_icao)) |
| 432 | 432 | { |
| 433 | 433 | return false; |
| 434 | 434 | } else { |
| 435 | 435 | $additional_query .= " AND spotter_output.aircraft_icao = :aircraft_icao"; |
| 436 | - $query_values = array_merge($query_values,array(':aircraft_icao' => $aircraft_icao)); |
|
| 436 | + $query_values = array_merge($query_values, array(':aircraft_icao' => $aircraft_icao)); |
|
| 437 | 437 | } |
| 438 | 438 | } |
| 439 | 439 | |
| 440 | 440 | if ($aircraft_manufacturer != "") |
| 441 | 441 | { |
| 442 | - $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
|
| 442 | + $aircraft_manufacturer = filter_var($aircraft_manufacturer, FILTER_SANITIZE_STRING); |
|
| 443 | 443 | if (!is_string($aircraft_manufacturer)) |
| 444 | 444 | { |
| 445 | 445 | return false; |
| 446 | 446 | } else { |
| 447 | 447 | $additional_query .= " AND spotter_output.aircraft_manufacturer = :aircraft_manufacturer"; |
| 448 | - $query_values = array_merge($query_values,array(':aircraft_manufacturer' => $aircraft_manufacturer)); |
|
| 448 | + $query_values = array_merge($query_values, array(':aircraft_manufacturer' => $aircraft_manufacturer)); |
|
| 449 | 449 | } |
| 450 | 450 | } |
| 451 | 451 | |
@@ -461,25 +461,25 @@ discard block |
||
| 461 | 461 | |
| 462 | 462 | if ($airline_icao != "") |
| 463 | 463 | { |
| 464 | - $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING); |
|
| 464 | + $airline_icao = filter_var($airline_icao, FILTER_SANITIZE_STRING); |
|
| 465 | 465 | if (!is_string($airline_icao)) |
| 466 | 466 | { |
| 467 | 467 | return false; |
| 468 | 468 | } else { |
| 469 | 469 | $additional_query .= " AND spotter_output.airline_icao = :airline_icao"; |
| 470 | - $query_values = array_merge($query_values,array(':airline_icao' => $airline_icao)); |
|
| 470 | + $query_values = array_merge($query_values, array(':airline_icao' => $airline_icao)); |
|
| 471 | 471 | } |
| 472 | 472 | } |
| 473 | 473 | |
| 474 | 474 | if ($airline_country != "") |
| 475 | 475 | { |
| 476 | - $airline_country = filter_var($airline_country,FILTER_SANITIZE_STRING); |
|
| 476 | + $airline_country = filter_var($airline_country, FILTER_SANITIZE_STRING); |
|
| 477 | 477 | if (!is_string($airline_country)) |
| 478 | 478 | { |
| 479 | 479 | return false; |
| 480 | 480 | } else { |
| 481 | 481 | $additional_query .= " AND spotter_output.airline_country = :airline_country"; |
| 482 | - $query_values = array_merge($query_values,array(':airline_country' => $airline_country)); |
|
| 482 | + $query_values = array_merge($query_values, array(':airline_country' => $airline_country)); |
|
| 483 | 483 | } |
| 484 | 484 | } |
| 485 | 485 | |
@@ -506,31 +506,31 @@ discard block |
||
| 506 | 506 | |
| 507 | 507 | if ($airport != "") |
| 508 | 508 | { |
| 509 | - $airport = filter_var($airport,FILTER_SANITIZE_STRING); |
|
| 509 | + $airport = filter_var($airport, FILTER_SANITIZE_STRING); |
|
| 510 | 510 | if (!is_string($airport)) |
| 511 | 511 | { |
| 512 | 512 | return false; |
| 513 | 513 | } else { |
| 514 | 514 | $additional_query .= " AND (spotter_output.departure_airport_icao = :airport OR spotter_output.arrival_airport_icao = :airport)"; |
| 515 | - $query_values = array_merge($query_values,array(':airport' => $airport)); |
|
| 515 | + $query_values = array_merge($query_values, array(':airport' => $airport)); |
|
| 516 | 516 | } |
| 517 | 517 | } |
| 518 | 518 | |
| 519 | 519 | if ($airport_country != "") |
| 520 | 520 | { |
| 521 | - $airport_country = filter_var($airport_country,FILTER_SANITIZE_STRING); |
|
| 521 | + $airport_country = filter_var($airport_country, FILTER_SANITIZE_STRING); |
|
| 522 | 522 | if (!is_string($airport_country)) |
| 523 | 523 | { |
| 524 | 524 | return false; |
| 525 | 525 | } else { |
| 526 | 526 | $additional_query .= " AND (spotter_output.departure_airport_country = :airport_country OR spotter_output.arrival_airport_country = :airport_country)"; |
| 527 | - $query_values = array_merge($query_values,array(':airport_country' => $airport_country)); |
|
| 527 | + $query_values = array_merge($query_values, array(':airport_country' => $airport_country)); |
|
| 528 | 528 | } |
| 529 | 529 | } |
| 530 | 530 | |
| 531 | 531 | if ($callsign != "") |
| 532 | 532 | { |
| 533 | - $callsign = filter_var($callsign,FILTER_SANITIZE_STRING); |
|
| 533 | + $callsign = filter_var($callsign, FILTER_SANITIZE_STRING); |
|
| 534 | 534 | if (!is_string($callsign)) |
| 535 | 535 | { |
| 536 | 536 | return false; |
@@ -538,79 +538,79 @@ discard block |
||
| 538 | 538 | $translate = $Translation->ident2icao($callsign); |
| 539 | 539 | if ($translate != $callsign) { |
| 540 | 540 | $additional_query .= " AND (spotter_output.ident = :callsign OR spotter_output.ident = :translate)"; |
| 541 | - $query_values = array_merge($query_values,array(':callsign' => $callsign,':translate' => $translate)); |
|
| 541 | + $query_values = array_merge($query_values, array(':callsign' => $callsign, ':translate' => $translate)); |
|
| 542 | 542 | } else { |
| 543 | 543 | $additional_query .= " AND spotter_output.ident = :callsign"; |
| 544 | - $query_values = array_merge($query_values,array(':callsign' => $callsign)); |
|
| 544 | + $query_values = array_merge($query_values, array(':callsign' => $callsign)); |
|
| 545 | 545 | } |
| 546 | 546 | } |
| 547 | 547 | } |
| 548 | 548 | |
| 549 | 549 | if ($owner != "") |
| 550 | 550 | { |
| 551 | - $owner = filter_var($owner,FILTER_SANITIZE_STRING); |
|
| 551 | + $owner = filter_var($owner, FILTER_SANITIZE_STRING); |
|
| 552 | 552 | if (!is_string($owner)) |
| 553 | 553 | { |
| 554 | 554 | return false; |
| 555 | 555 | } else { |
| 556 | 556 | $additional_query .= " AND spotter_output.owner_name = :owner"; |
| 557 | - $query_values = array_merge($query_values,array(':owner' => $owner)); |
|
| 557 | + $query_values = array_merge($query_values, array(':owner' => $owner)); |
|
| 558 | 558 | } |
| 559 | 559 | } |
| 560 | 560 | |
| 561 | 561 | if ($pilot_name != "") |
| 562 | 562 | { |
| 563 | - $pilot_name = filter_var($pilot_name,FILTER_SANITIZE_STRING); |
|
| 563 | + $pilot_name = filter_var($pilot_name, FILTER_SANITIZE_STRING); |
|
| 564 | 564 | if (!is_string($pilot_name)) |
| 565 | 565 | { |
| 566 | 566 | return false; |
| 567 | 567 | } else { |
| 568 | 568 | $additional_query .= " AND spotter_output.pilot_name = :pilot_name"; |
| 569 | - $query_values = array_merge($query_values,array(':pilot_name' => $pilot_name)); |
|
| 569 | + $query_values = array_merge($query_values, array(':pilot_name' => $pilot_name)); |
|
| 570 | 570 | } |
| 571 | 571 | } |
| 572 | 572 | |
| 573 | 573 | if ($pilot_id != "") |
| 574 | 574 | { |
| 575 | - $pilot_id = filter_var($pilot_id,FILTER_SANITIZE_NUMBER_INT); |
|
| 575 | + $pilot_id = filter_var($pilot_id, FILTER_SANITIZE_NUMBER_INT); |
|
| 576 | 576 | if (!is_string($pilot_id)) |
| 577 | 577 | { |
| 578 | 578 | return false; |
| 579 | 579 | } else { |
| 580 | 580 | $additional_query .= " AND spotter_output.pilot_id = :pilot_id"; |
| 581 | - $query_values = array_merge($query_values,array(':pilot_id' => $pilot_id)); |
|
| 581 | + $query_values = array_merge($query_values, array(':pilot_id' => $pilot_id)); |
|
| 582 | 582 | } |
| 583 | 583 | } |
| 584 | 584 | |
| 585 | 585 | if ($departure_airport_route != "") |
| 586 | 586 | { |
| 587 | - $departure_airport_route = filter_var($departure_airport_route,FILTER_SANITIZE_STRING); |
|
| 587 | + $departure_airport_route = filter_var($departure_airport_route, FILTER_SANITIZE_STRING); |
|
| 588 | 588 | if (!is_string($departure_airport_route)) |
| 589 | 589 | { |
| 590 | 590 | return false; |
| 591 | 591 | } else { |
| 592 | 592 | $additional_query .= " AND spotter_output.departure_airport_icao = :departure_airport_route"; |
| 593 | - $query_values = array_merge($query_values,array(':departure_airport_route' => $departure_airport_route)); |
|
| 593 | + $query_values = array_merge($query_values, array(':departure_airport_route' => $departure_airport_route)); |
|
| 594 | 594 | } |
| 595 | 595 | } |
| 596 | 596 | |
| 597 | 597 | if ($arrival_airport_route != "") |
| 598 | 598 | { |
| 599 | - $arrival_airport_route = filter_var($arrival_airport_route,FILTER_SANITIZE_STRING); |
|
| 599 | + $arrival_airport_route = filter_var($arrival_airport_route, FILTER_SANITIZE_STRING); |
|
| 600 | 600 | if (!is_string($arrival_airport_route)) |
| 601 | 601 | { |
| 602 | 602 | return false; |
| 603 | 603 | } else { |
| 604 | 604 | $additional_query .= " AND spotter_output.arrival_airport_icao = :arrival_airport_route"; |
| 605 | - $query_values = array_merge($query_values,array(':arrival_airport_route' => $arrival_airport_route)); |
|
| 605 | + $query_values = array_merge($query_values, array(':arrival_airport_route' => $arrival_airport_route)); |
|
| 606 | 606 | } |
| 607 | 607 | } |
| 608 | 608 | |
| 609 | 609 | if ($altitude != "") |
| 610 | 610 | { |
| 611 | 611 | $altitude_array = explode(",", $altitude); |
| 612 | - $altitude_array[0] = filter_var($altitude_array[0],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 613 | - $altitude_array[1] = filter_var($altitude_array[1],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 612 | + $altitude_array[0] = filter_var($altitude_array[0], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 613 | + $altitude_array[1] = filter_var($altitude_array[1], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 614 | 614 | |
| 615 | 615 | if ($altitude_array[1] != "") |
| 616 | 616 | { |
@@ -626,8 +626,8 @@ discard block |
||
| 626 | 626 | if ($date_posted != "") |
| 627 | 627 | { |
| 628 | 628 | $date_array = explode(",", $date_posted); |
| 629 | - $date_array[0] = filter_var($date_array[0],FILTER_SANITIZE_STRING); |
|
| 630 | - $date_array[1] = filter_var($date_array[1],FILTER_SANITIZE_STRING); |
|
| 629 | + $date_array[0] = filter_var($date_array[0], FILTER_SANITIZE_STRING); |
|
| 630 | + $date_array[1] = filter_var($date_array[1], FILTER_SANITIZE_STRING); |
|
| 631 | 631 | |
| 632 | 632 | if ($globalTimezone != '') { |
| 633 | 633 | date_default_timezone_set($globalTimezone); |
@@ -658,8 +658,8 @@ discard block |
||
| 658 | 658 | { |
| 659 | 659 | $limit_array = explode(",", $limit); |
| 660 | 660 | |
| 661 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
| 662 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
| 661 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
| 662 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
| 663 | 663 | |
| 664 | 664 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
| 665 | 665 | { |
@@ -688,24 +688,24 @@ discard block |
||
| 688 | 688 | |
| 689 | 689 | |
| 690 | 690 | if ($origLat != "" && $origLon != "" && $dist != "") { |
| 691 | - $dist = number_format($dist*0.621371,2,'.',''); // convert km to mile |
|
| 691 | + $dist = number_format($dist*0.621371, 2, '.', ''); // convert km to mile |
|
| 692 | 692 | |
| 693 | 693 | if ($globalDBdriver == 'mysql') { |
| 694 | - $query="SELECT spotter_output.*, 1.60935*3956 * 2 * ASIN(SQRT( POWER(SIN(($origLat - spotter_archive.latitude)*pi()/180/2),2)+COS( $origLat *pi()/180)*COS(spotter_archive.latitude*pi()/180)*POWER(SIN(($origLon-spotter_archive.longitude)*pi()/180/2),2))) as distance |
|
| 694 | + $query = "SELECT spotter_output.*, 1.60935*3956 * 2 * ASIN(SQRT( POWER(SIN(($origLat - spotter_archive.latitude)*pi()/180/2),2)+COS( $origLat *pi()/180)*COS(spotter_archive.latitude*pi()/180)*POWER(SIN(($origLon-spotter_archive.longitude)*pi()/180/2),2))) as distance |
|
| 695 | 695 | FROM spotter_output, spotter_archive WHERE spotter_output.flightaware_id = spotter_archive.flightaware_id AND spotter_output.ident <> '' ".$additional_query."AND spotter_archive.longitude between ($origLon-$dist/cos(radians($origLat))*69) and ($origLon+$dist/cos(radians($origLat)*69)) and spotter_archive.latitude between ($origLat-($dist/69)) and ($origLat+($dist/69)) |
| 696 | 696 | AND (3956 * 2 * ASIN(SQRT( POWER(SIN(($origLat - spotter_archive.latitude)*pi()/180/2),2)+COS( $origLat *pi()/180)*COS(spotter_archive.latitude*pi()/180)*POWER(SIN(($origLon-spotter_archive.longitude)*pi()/180/2),2)))) < $dist".$orderby_query; |
| 697 | 697 | } else { |
| 698 | - $query="SELECT spotter_output.*, 1.60935 * 3956 * 2 * ASIN(SQRT( POWER(SIN(($origLat - CAST(spotter_archive.latitude as double precision))*pi()/180/2),2)+COS( $origLat *pi()/180)*COS(CAST(spotter_archive.latitude as double precision)*pi()/180)*POWER(SIN(($origLon-CAST(spotter_archive.longitude as double precision))*pi()/180/2),2))) as distance |
|
| 698 | + $query = "SELECT spotter_output.*, 1.60935 * 3956 * 2 * ASIN(SQRT( POWER(SIN(($origLat - CAST(spotter_archive.latitude as double precision))*pi()/180/2),2)+COS( $origLat *pi()/180)*COS(CAST(spotter_archive.latitude as double precision)*pi()/180)*POWER(SIN(($origLon-CAST(spotter_archive.longitude as double precision))*pi()/180/2),2))) as distance |
|
| 699 | 699 | FROM spotter_output, spotter_archive WHERE spotter_output.flightaware_id = spotter_archive.flightaware_id AND spotter_output.ident <> '' ".$additional_query."AND CAST(spotter_archive.longitude as double precision) between ($origLon-$dist/cos(radians($origLat))*69) and ($origLon+$dist/cos(radians($origLat))*69) and CAST(spotter_archive.latitude as double precision) between ($origLat-($dist/69)) and ($origLat+($dist/69)) |
| 700 | 700 | AND (3956 * 2 * ASIN(SQRT( POWER(SIN(($origLat - CAST(spotter_archive.latitude as double precision))*pi()/180/2),2)+COS( $origLat *pi()/180)*COS(CAST(spotter_archive.latitude as double precision)*pi()/180)*POWER(SIN(($origLon-CAST(spotter_archive.longitude as double precision))*pi()/180/2),2)))) < $dist".$orderby_query; |
| 701 | 701 | } |
| 702 | 702 | } else { |
| 703 | - $query = "SELECT spotter_output.* FROM spotter_output |
|
| 703 | + $query = "SELECT spotter_output.* FROM spotter_output |
|
| 704 | 704 | WHERE spotter_output.ident <> '' |
| 705 | 705 | ".$additional_query." |
| 706 | 706 | ".$orderby_query; |
| 707 | 707 | } |
| 708 | - $spotter_array = $this->getDataFromDB($query, $query_values,$limit_query); |
|
| 708 | + $spotter_array = $this->getDataFromDB($query, $query_values, $limit_query); |
|
| 709 | 709 | return $spotter_array; |
| 710 | 710 | } |
| 711 | 711 | |
@@ -726,8 +726,8 @@ discard block |
||
| 726 | 726 | { |
| 727 | 727 | $limit_array = explode(",", $limit); |
| 728 | 728 | |
| 729 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
| 730 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
| 729 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
| 730 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
| 731 | 731 | |
| 732 | 732 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
| 733 | 733 | { |
@@ -744,9 +744,9 @@ discard block |
||
| 744 | 744 | $orderby_query = " ORDER BY spotter_output.date DESC"; |
| 745 | 745 | } |
| 746 | 746 | |
| 747 | - $query = $global_query." ".$orderby_query; |
|
| 747 | + $query = $global_query." ".$orderby_query; |
|
| 748 | 748 | |
| 749 | - $spotter_array = $this->getDataFromDB($query, array(),$limit_query); |
|
| 749 | + $spotter_array = $this->getDataFromDB($query, array(), $limit_query); |
|
| 750 | 750 | |
| 751 | 751 | return $spotter_array; |
| 752 | 752 | } |
@@ -792,34 +792,34 @@ discard block |
||
| 792 | 792 | { |
| 793 | 793 | return false; |
| 794 | 794 | } else { |
| 795 | - if ($interval == "30m"){ |
|
| 795 | + if ($interval == "30m") { |
|
| 796 | 796 | $additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 30 MINUTE) <= $this_output.date '; |
| 797 | - } else if ($interval == "1h"){ |
|
| 797 | + } else if ($interval == "1h") { |
|
| 798 | 798 | $additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 HOUR) <= $this_output.date '; |
| 799 | - } else if ($interval == "3h"){ |
|
| 799 | + } else if ($interval == "3h") { |
|
| 800 | 800 | $additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 3 HOUR) <= $this_output.date '; |
| 801 | - } else if ($interval == "6h"){ |
|
| 801 | + } else if ($interval == "6h") { |
|
| 802 | 802 | $additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 6 HOUR) <= $this_output.date '; |
| 803 | - } else if ($interval == "12h"){ |
|
| 803 | + } else if ($interval == "12h") { |
|
| 804 | 804 | $additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 12 HOUR) <= $this_output.date '; |
| 805 | - } else if ($interval == "24h"){ |
|
| 805 | + } else if ($interval == "24h") { |
|
| 806 | 806 | $additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 24 HOUR) <= $this_output.date '; |
| 807 | - } else if ($interval == "7d"){ |
|
| 807 | + } else if ($interval == "7d") { |
|
| 808 | 808 | $additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 7 DAY) <= $this_output.date '; |
| 809 | - } else if ($interval == "30d"){ |
|
| 809 | + } else if ($interval == "30d") { |
|
| 810 | 810 | $additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 30 DAY) <= $this_output.date '; |
| 811 | 811 | } |
| 812 | 812 | } |
| 813 | 813 | } |
| 814 | 814 | |
| 815 | - $query = "SELECT spotter_output.*, ( 6371 * acos( cos( radians($lat) ) * cos( radians( latitude ) ) * cos( radians( longitude ) - radians($lng) ) + sin( radians($lat) ) * sin( radians( latitude ) ) ) ) AS distance FROM spotter_output |
|
| 815 | + $query = "SELECT spotter_output.*, ( 6371 * acos( cos( radians($lat) ) * cos( radians( latitude ) ) * cos( radians( longitude ) - radians($lng) ) + sin( radians($lat) ) * sin( radians( latitude ) ) ) ) AS distance FROM spotter_output |
|
| 816 | 816 | WHERE spotter_output.latitude <> '' |
| 817 | 817 | AND spotter_output.longitude <> '' |
| 818 | 818 | ".$additional_query." |
| 819 | 819 | HAVING distance < :radius |
| 820 | 820 | ORDER BY distance"; |
| 821 | 821 | |
| 822 | - $spotter_array = $this->getDataFromDB($query, array(':radius' => $radius),$limit_query); |
|
| 822 | + $spotter_array = $this->getDataFromDB($query, array(':radius' => $radius), $limit_query); |
|
| 823 | 823 | |
| 824 | 824 | return $spotter_array; |
| 825 | 825 | } |
@@ -841,8 +841,8 @@ discard block |
||
| 841 | 841 | { |
| 842 | 842 | $limit_array = explode(",", $limit); |
| 843 | 843 | |
| 844 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
| 845 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
| 844 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
| 845 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
| 846 | 846 | |
| 847 | 847 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
| 848 | 848 | { |
@@ -859,7 +859,7 @@ discard block |
||
| 859 | 859 | $orderby_query = " ORDER BY spotter_output.date DESC "; |
| 860 | 860 | } |
| 861 | 861 | |
| 862 | - $query = $global_query." WHERE spotter_output.aircraft_name <> '' GROUP BY spotter_output.aircraft_icao,spotter_output.ident,spotter_output.spotter_id, spotter_output.flightaware_id, spotter_output.registration,spotter_output.airline_name,spotter_output.airline_icao,spotter_output.airline_country,spotter_output.airline_type,spotter_output.aircraft_icao,spotter_output.aircraft_name,spotter_output.aircraft_manufacturer,spotter_output.departure_airport_icao,spotter_output.departure_airport_name,spotter_output.departure_airport_city,spotter_output.departure_airport_country,spotter_output.departure_airport_time,spotter_output.arrival_airport_icao,spotter_output.arrival_airport_name,spotter_output.arrival_airport_city,spotter_output.arrival_airport_country,spotter_output.arrival_airport_time,spotter_output.route_stop,spotter_output.date,spotter_output.latitude,spotter_output.longitude,spotter_output.waypoints,spotter_output.altitude,spotter_output.heading,spotter_output.ground_speed,spotter_output.highlight,spotter_output.squawk,spotter_output.ModeS,spotter_output.pilot_id,spotter_output.pilot_name,spotter_output.verticalrate,spotter_output.owner_name,spotter_output.format_source,spotter_output.source_name,spotter_output.ground,spotter_output.last_ground,spotter_output.last_seen,spotter_output.last_latitude,spotter_output.last_longitude,spotter_output.last_altitude,spotter_output.last_ground_speed,spotter_output.real_arrival_airport_icao,spotter_output.real_arrival_airport_time ".$orderby_query; |
|
| 862 | + $query = $global_query." WHERE spotter_output.aircraft_name <> '' GROUP BY spotter_output.aircraft_icao,spotter_output.ident,spotter_output.spotter_id, spotter_output.flightaware_id, spotter_output.registration,spotter_output.airline_name,spotter_output.airline_icao,spotter_output.airline_country,spotter_output.airline_type,spotter_output.aircraft_icao,spotter_output.aircraft_name,spotter_output.aircraft_manufacturer,spotter_output.departure_airport_icao,spotter_output.departure_airport_name,spotter_output.departure_airport_city,spotter_output.departure_airport_country,spotter_output.departure_airport_time,spotter_output.arrival_airport_icao,spotter_output.arrival_airport_name,spotter_output.arrival_airport_city,spotter_output.arrival_airport_country,spotter_output.arrival_airport_time,spotter_output.route_stop,spotter_output.date,spotter_output.latitude,spotter_output.longitude,spotter_output.waypoints,spotter_output.altitude,spotter_output.heading,spotter_output.ground_speed,spotter_output.highlight,spotter_output.squawk,spotter_output.ModeS,spotter_output.pilot_id,spotter_output.pilot_name,spotter_output.verticalrate,spotter_output.owner_name,spotter_output.format_source,spotter_output.source_name,spotter_output.ground,spotter_output.last_ground,spotter_output.last_seen,spotter_output.last_latitude,spotter_output.last_longitude,spotter_output.last_altitude,spotter_output.last_ground_speed,spotter_output.real_arrival_airport_icao,spotter_output.real_arrival_airport_time ".$orderby_query; |
|
| 863 | 863 | |
| 864 | 864 | $spotter_array = $this->getDataFromDB($query, array(), $limit_query); |
| 865 | 865 | |
@@ -884,8 +884,8 @@ discard block |
||
| 884 | 884 | { |
| 885 | 885 | $limit_array = explode(",", $limit); |
| 886 | 886 | |
| 887 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
| 888 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
| 887 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
| 888 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
| 889 | 889 | |
| 890 | 890 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
| 891 | 891 | { |
@@ -902,7 +902,7 @@ discard block |
||
| 902 | 902 | $orderby_query = " ORDER BY spotter_output.date DESC "; |
| 903 | 903 | } |
| 904 | 904 | |
| 905 | - $query = $global_query." WHERE spotter_output.registration <> '' GROUP BY spotter_output.registration,spotter_output.ident,spotter_output.spotter_id, spotter_output.flightaware_id, spotter_output.registration,spotter_output.airline_name,spotter_output.airline_icao,spotter_output.airline_country,spotter_output.airline_type,spotter_output.aircraft_icao,spotter_output.aircraft_name,spotter_output.aircraft_manufacturer,spotter_output.departure_airport_icao,spotter_output.departure_airport_name,spotter_output.departure_airport_city,spotter_output.departure_airport_country,spotter_output.departure_airport_time,spotter_output.arrival_airport_icao,spotter_output.arrival_airport_name,spotter_output.arrival_airport_city,spotter_output.arrival_airport_country,spotter_output.arrival_airport_time,spotter_output.route_stop,spotter_output.date,spotter_output.latitude,spotter_output.longitude,spotter_output.waypoints,spotter_output.altitude,spotter_output.heading,spotter_output.ground_speed,spotter_output.highlight,spotter_output.squawk,spotter_output.ModeS,spotter_output.pilot_id,spotter_output.pilot_name,spotter_output.verticalrate,spotter_output.owner_name,spotter_output.format_source,spotter_output.source_name,spotter_output.ground,spotter_output.last_ground,spotter_output.last_seen,spotter_output.last_latitude,spotter_output.last_longitude,spotter_output.last_altitude,spotter_output.last_ground_speed,spotter_output.real_arrival_airport_icao,spotter_output.real_arrival_airport_time ".$orderby_query; |
|
| 905 | + $query = $global_query." WHERE spotter_output.registration <> '' GROUP BY spotter_output.registration,spotter_output.ident,spotter_output.spotter_id, spotter_output.flightaware_id, spotter_output.registration,spotter_output.airline_name,spotter_output.airline_icao,spotter_output.airline_country,spotter_output.airline_type,spotter_output.aircraft_icao,spotter_output.aircraft_name,spotter_output.aircraft_manufacturer,spotter_output.departure_airport_icao,spotter_output.departure_airport_name,spotter_output.departure_airport_city,spotter_output.departure_airport_country,spotter_output.departure_airport_time,spotter_output.arrival_airport_icao,spotter_output.arrival_airport_name,spotter_output.arrival_airport_city,spotter_output.arrival_airport_country,spotter_output.arrival_airport_time,spotter_output.route_stop,spotter_output.date,spotter_output.latitude,spotter_output.longitude,spotter_output.waypoints,spotter_output.altitude,spotter_output.heading,spotter_output.ground_speed,spotter_output.highlight,spotter_output.squawk,spotter_output.ModeS,spotter_output.pilot_id,spotter_output.pilot_name,spotter_output.verticalrate,spotter_output.owner_name,spotter_output.format_source,spotter_output.source_name,spotter_output.ground,spotter_output.last_ground,spotter_output.last_seen,spotter_output.last_latitude,spotter_output.last_longitude,spotter_output.last_altitude,spotter_output.last_ground_speed,spotter_output.real_arrival_airport_icao,spotter_output.real_arrival_airport_time ".$orderby_query; |
|
| 906 | 906 | |
| 907 | 907 | $spotter_array = $this->getDataFromDB($query, array(), $limit_query); |
| 908 | 908 | |
@@ -926,8 +926,8 @@ discard block |
||
| 926 | 926 | { |
| 927 | 927 | $limit_array = explode(",", $limit); |
| 928 | 928 | |
| 929 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
| 930 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
| 929 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
| 930 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
| 931 | 931 | |
| 932 | 932 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
| 933 | 933 | { |
@@ -944,7 +944,7 @@ discard block |
||
| 944 | 944 | $orderby_query = " ORDER BY spotter_output.date DESC "; |
| 945 | 945 | } |
| 946 | 946 | |
| 947 | - $query = $global_query." WHERE spotter_output.airline_name <> '' GROUP BY spotter_output.airline_icao,spotter_output.ident,spotter_output.spotter_id, spotter_output.flightaware_id, spotter_output.registration,spotter_output.airline_name,spotter_output.airline_icao,spotter_output.airline_country,spotter_output.airline_type,spotter_output.aircraft_icao,spotter_output.aircraft_name,spotter_output.aircraft_manufacturer,spotter_output.departure_airport_icao,spotter_output.departure_airport_name,spotter_output.departure_airport_city,spotter_output.departure_airport_country,spotter_output.departure_airport_time,spotter_output.arrival_airport_icao,spotter_output.arrival_airport_name,spotter_output.arrival_airport_city,spotter_output.arrival_airport_country,spotter_output.arrival_airport_time,spotter_output.route_stop,spotter_output.date,spotter_output.latitude,spotter_output.longitude,spotter_output.waypoints,spotter_output.altitude,spotter_output.heading,spotter_output.ground_speed,spotter_output.highlight,spotter_output.squawk,spotter_output.ModeS,spotter_output.pilot_id,spotter_output.pilot_name,spotter_output.verticalrate,spotter_output.owner_name,spotter_output.format_source,spotter_output.source_name,spotter_output.ground,spotter_output.last_ground,spotter_output.last_seen,spotter_output.last_latitude,spotter_output.last_longitude,spotter_output.last_altitude,spotter_output.last_ground_speed,spotter_output.real_arrival_airport_icao,spotter_output.real_arrival_airport_time ".$orderby_query; |
|
| 947 | + $query = $global_query." WHERE spotter_output.airline_name <> '' GROUP BY spotter_output.airline_icao,spotter_output.ident,spotter_output.spotter_id, spotter_output.flightaware_id, spotter_output.registration,spotter_output.airline_name,spotter_output.airline_icao,spotter_output.airline_country,spotter_output.airline_type,spotter_output.aircraft_icao,spotter_output.aircraft_name,spotter_output.aircraft_manufacturer,spotter_output.departure_airport_icao,spotter_output.departure_airport_name,spotter_output.departure_airport_city,spotter_output.departure_airport_country,spotter_output.departure_airport_time,spotter_output.arrival_airport_icao,spotter_output.arrival_airport_name,spotter_output.arrival_airport_city,spotter_output.arrival_airport_country,spotter_output.arrival_airport_time,spotter_output.route_stop,spotter_output.date,spotter_output.latitude,spotter_output.longitude,spotter_output.waypoints,spotter_output.altitude,spotter_output.heading,spotter_output.ground_speed,spotter_output.highlight,spotter_output.squawk,spotter_output.ModeS,spotter_output.pilot_id,spotter_output.pilot_name,spotter_output.verticalrate,spotter_output.owner_name,spotter_output.format_source,spotter_output.source_name,spotter_output.ground,spotter_output.last_ground,spotter_output.last_seen,spotter_output.last_latitude,spotter_output.last_longitude,spotter_output.last_altitude,spotter_output.last_ground_speed,spotter_output.real_arrival_airport_icao,spotter_output.real_arrival_airport_time ".$orderby_query; |
|
| 948 | 948 | |
| 949 | 949 | $spotter_array = $this->getDataFromDB($query, array(), $limit_query); |
| 950 | 950 | |
@@ -969,8 +969,8 @@ discard block |
||
| 969 | 969 | { |
| 970 | 970 | $limit_array = explode(",", $limit); |
| 971 | 971 | |
| 972 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
| 973 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
| 972 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
| 973 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
| 974 | 974 | |
| 975 | 975 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
| 976 | 976 | { |
@@ -987,7 +987,7 @@ discard block |
||
| 987 | 987 | $orderby_query = " ORDER BY spotter_output.date DESC "; |
| 988 | 988 | } |
| 989 | 989 | |
| 990 | - $query = $global_query." WHERE spotter_output.departure_airport_name <> '' AND spotter_output.departure_airport_icao <> 'NA' GROUP BY spotter_output.departure_airport_icao,spotter_output.ident,spotter_output.spotter_id, spotter_output.flightaware_id, spotter_output.registration,spotter_output.airline_name,spotter_output.airline_icao,spotter_output.airline_country,spotter_output.airline_type,spotter_output.aircraft_icao,spotter_output.aircraft_name,spotter_output.aircraft_manufacturer,spotter_output.departure_airport_icao,spotter_output.departure_airport_name,spotter_output.departure_airport_city,spotter_output.departure_airport_country,spotter_output.departure_airport_time,spotter_output.arrival_airport_icao,spotter_output.arrival_airport_name,spotter_output.arrival_airport_city,spotter_output.arrival_airport_country,spotter_output.arrival_airport_time,spotter_output.route_stop,spotter_output.date,spotter_output.latitude,spotter_output.longitude,spotter_output.waypoints,spotter_output.altitude,spotter_output.heading,spotter_output.ground_speed,spotter_output.highlight,spotter_output.squawk,spotter_output.ModeS,spotter_output.pilot_id,spotter_output.pilot_name,spotter_output.verticalrate,spotter_output.owner_name,spotter_output.format_source,spotter_output.source_name,spotter_output.ground,spotter_output.last_ground,spotter_output.last_seen,spotter_output.last_latitude,spotter_output.last_longitude,spotter_output.last_altitude,spotter_output.last_ground_speed,spotter_output.real_arrival_airport_icao,spotter_output.real_arrival_airport_time ".$orderby_query; |
|
| 990 | + $query = $global_query." WHERE spotter_output.departure_airport_name <> '' AND spotter_output.departure_airport_icao <> 'NA' GROUP BY spotter_output.departure_airport_icao,spotter_output.ident,spotter_output.spotter_id, spotter_output.flightaware_id, spotter_output.registration,spotter_output.airline_name,spotter_output.airline_icao,spotter_output.airline_country,spotter_output.airline_type,spotter_output.aircraft_icao,spotter_output.aircraft_name,spotter_output.aircraft_manufacturer,spotter_output.departure_airport_icao,spotter_output.departure_airport_name,spotter_output.departure_airport_city,spotter_output.departure_airport_country,spotter_output.departure_airport_time,spotter_output.arrival_airport_icao,spotter_output.arrival_airport_name,spotter_output.arrival_airport_city,spotter_output.arrival_airport_country,spotter_output.arrival_airport_time,spotter_output.route_stop,spotter_output.date,spotter_output.latitude,spotter_output.longitude,spotter_output.waypoints,spotter_output.altitude,spotter_output.heading,spotter_output.ground_speed,spotter_output.highlight,spotter_output.squawk,spotter_output.ModeS,spotter_output.pilot_id,spotter_output.pilot_name,spotter_output.verticalrate,spotter_output.owner_name,spotter_output.format_source,spotter_output.source_name,spotter_output.ground,spotter_output.last_ground,spotter_output.last_seen,spotter_output.last_latitude,spotter_output.last_longitude,spotter_output.last_altitude,spotter_output.last_ground_speed,spotter_output.real_arrival_airport_icao,spotter_output.real_arrival_airport_time ".$orderby_query; |
|
| 991 | 991 | |
| 992 | 992 | $spotter_array = $this->getDataFromDB($query, array(), $limit_query); |
| 993 | 993 | |
@@ -1012,8 +1012,8 @@ discard block |
||
| 1012 | 1012 | { |
| 1013 | 1013 | $limit_array = explode(",", $limit); |
| 1014 | 1014 | |
| 1015 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
| 1016 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
| 1015 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
| 1016 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
| 1017 | 1017 | |
| 1018 | 1018 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
| 1019 | 1019 | { |
@@ -1030,7 +1030,7 @@ discard block |
||
| 1030 | 1030 | $orderby_query = " ORDER BY spotter_output.date DESC "; |
| 1031 | 1031 | } |
| 1032 | 1032 | |
| 1033 | - $query = $global_query." WHERE spotter_output.arrival_airport_name <> '' AND spotter_output.arrival_airport_icao <> 'NA' GROUP BY spotter_output.arrival_airport_icao,spotter_output.ident,spotter_output.spotter_id, spotter_output.flightaware_id, spotter_output.registration,spotter_output.airline_name,spotter_output.airline_icao,spotter_output.airline_country,spotter_output.airline_type,spotter_output.aircraft_icao,spotter_output.aircraft_name,spotter_output.aircraft_manufacturer,spotter_output.departure_airport_icao,spotter_output.departure_airport_name,spotter_output.departure_airport_city,spotter_output.departure_airport_country,spotter_output.departure_airport_time,spotter_output.arrival_airport_icao,spotter_output.arrival_airport_name,spotter_output.arrival_airport_city,spotter_output.arrival_airport_country,spotter_output.arrival_airport_time,spotter_output.route_stop,spotter_output.date,spotter_output.latitude,spotter_output.longitude,spotter_output.waypoints,spotter_output.altitude,spotter_output.heading,spotter_output.ground_speed,spotter_output.highlight,spotter_output.squawk,spotter_output.ModeS,spotter_output.pilot_id,spotter_output.pilot_name,spotter_output.verticalrate,spotter_output.owner_name,spotter_output.format_source,spotter_output.source_name,spotter_output.ground,spotter_output.last_ground,spotter_output.last_seen,spotter_output.last_latitude,spotter_output.last_longitude,spotter_output.last_altitude,spotter_output.last_ground_speed,spotter_output.real_arrival_airport_icao,spotter_output.real_arrival_airport_time ".$orderby_query; |
|
| 1033 | + $query = $global_query." WHERE spotter_output.arrival_airport_name <> '' AND spotter_output.arrival_airport_icao <> 'NA' GROUP BY spotter_output.arrival_airport_icao,spotter_output.ident,spotter_output.spotter_id, spotter_output.flightaware_id, spotter_output.registration,spotter_output.airline_name,spotter_output.airline_icao,spotter_output.airline_country,spotter_output.airline_type,spotter_output.aircraft_icao,spotter_output.aircraft_name,spotter_output.aircraft_manufacturer,spotter_output.departure_airport_icao,spotter_output.departure_airport_name,spotter_output.departure_airport_city,spotter_output.departure_airport_country,spotter_output.departure_airport_time,spotter_output.arrival_airport_icao,spotter_output.arrival_airport_name,spotter_output.arrival_airport_city,spotter_output.arrival_airport_country,spotter_output.arrival_airport_time,spotter_output.route_stop,spotter_output.date,spotter_output.latitude,spotter_output.longitude,spotter_output.waypoints,spotter_output.altitude,spotter_output.heading,spotter_output.ground_speed,spotter_output.highlight,spotter_output.squawk,spotter_output.ModeS,spotter_output.pilot_id,spotter_output.pilot_name,spotter_output.verticalrate,spotter_output.owner_name,spotter_output.format_source,spotter_output.source_name,spotter_output.ground,spotter_output.last_ground,spotter_output.last_seen,spotter_output.last_latitude,spotter_output.last_longitude,spotter_output.last_altitude,spotter_output.last_ground_speed,spotter_output.real_arrival_airport_icao,spotter_output.real_arrival_airport_time ".$orderby_query; |
|
| 1034 | 1034 | |
| 1035 | 1035 | $spotter_array = $this->getDataFromDB($query, array(), $limit_query); |
| 1036 | 1036 | |
@@ -1062,9 +1062,9 @@ discard block |
||
| 1062 | 1062 | } |
| 1063 | 1063 | } |
| 1064 | 1064 | |
| 1065 | - $query = $global_query." WHERE spotter_output.ident <> '' ".$additional_query." "; |
|
| 1065 | + $query = $global_query." WHERE spotter_output.ident <> '' ".$additional_query." "; |
|
| 1066 | 1066 | |
| 1067 | - $spotter_array = $this->getDataFromDB($query,$query_values); |
|
| 1067 | + $spotter_array = $this->getDataFromDB($query, $query_values); |
|
| 1068 | 1068 | |
| 1069 | 1069 | return $spotter_array; |
| 1070 | 1070 | } |
@@ -1102,8 +1102,8 @@ discard block |
||
| 1102 | 1102 | { |
| 1103 | 1103 | $limit_array = explode(",", $limit); |
| 1104 | 1104 | |
| 1105 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
| 1106 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
| 1105 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
| 1106 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
| 1107 | 1107 | |
| 1108 | 1108 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
| 1109 | 1109 | { |
@@ -1160,8 +1160,8 @@ discard block |
||
| 1160 | 1160 | { |
| 1161 | 1161 | $limit_array = explode(",", $limit); |
| 1162 | 1162 | |
| 1163 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
| 1164 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
| 1163 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
| 1164 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
| 1165 | 1165 | |
| 1166 | 1166 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
| 1167 | 1167 | { |
@@ -1217,8 +1217,8 @@ discard block |
||
| 1217 | 1217 | { |
| 1218 | 1218 | $limit_array = explode(",", $limit); |
| 1219 | 1219 | |
| 1220 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
| 1221 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
| 1220 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
| 1221 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
| 1222 | 1222 | |
| 1223 | 1223 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
| 1224 | 1224 | { |
@@ -1276,8 +1276,8 @@ discard block |
||
| 1276 | 1276 | { |
| 1277 | 1277 | $limit_array = explode(",", $limit); |
| 1278 | 1278 | |
| 1279 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
| 1280 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
| 1279 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
| 1280 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
| 1281 | 1281 | |
| 1282 | 1282 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
| 1283 | 1283 | { |
@@ -1331,8 +1331,8 @@ discard block |
||
| 1331 | 1331 | { |
| 1332 | 1332 | $limit_array = explode(",", $limit); |
| 1333 | 1333 | |
| 1334 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
| 1335 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
| 1334 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
| 1335 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
| 1336 | 1336 | |
| 1337 | 1337 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
| 1338 | 1338 | { |
@@ -1396,8 +1396,8 @@ discard block |
||
| 1396 | 1396 | { |
| 1397 | 1397 | $limit_array = explode(",", $limit); |
| 1398 | 1398 | |
| 1399 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
| 1400 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
| 1399 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
| 1400 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
| 1401 | 1401 | |
| 1402 | 1402 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
| 1403 | 1403 | { |
@@ -1454,8 +1454,8 @@ discard block |
||
| 1454 | 1454 | { |
| 1455 | 1455 | $limit_array = explode(",", $limit); |
| 1456 | 1456 | |
| 1457 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
| 1458 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
| 1457 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
| 1458 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
| 1459 | 1459 | |
| 1460 | 1460 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
| 1461 | 1461 | { |
@@ -1511,8 +1511,8 @@ discard block |
||
| 1511 | 1511 | { |
| 1512 | 1512 | $limit_array = explode(",", $limit); |
| 1513 | 1513 | |
| 1514 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
| 1515 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
| 1514 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
| 1515 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
| 1516 | 1516 | |
| 1517 | 1517 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
| 1518 | 1518 | { |
@@ -1560,7 +1560,7 @@ discard block |
||
| 1560 | 1560 | { |
| 1561 | 1561 | return false; |
| 1562 | 1562 | } else { |
| 1563 | - $departure_airport_icao = filter_var($departure_airport_icao,FILTER_SANITIZE_STRING); |
|
| 1563 | + $departure_airport_icao = filter_var($departure_airport_icao, FILTER_SANITIZE_STRING); |
|
| 1564 | 1564 | $additional_query .= " AND (spotter_output.departure_airport_icao = :departure_airport_icao)"; |
| 1565 | 1565 | $query_values = array(':departure_airport_icao' => $departure_airport_icao); |
| 1566 | 1566 | } |
@@ -1572,9 +1572,9 @@ discard block |
||
| 1572 | 1572 | { |
| 1573 | 1573 | return false; |
| 1574 | 1574 | } else { |
| 1575 | - $arrival_airport_icao = filter_var($arrival_airport_icao,FILTER_SANITIZE_STRING); |
|
| 1575 | + $arrival_airport_icao = filter_var($arrival_airport_icao, FILTER_SANITIZE_STRING); |
|
| 1576 | 1576 | $additional_query .= " AND (spotter_output.arrival_airport_icao = :arrival_airport_icao)"; |
| 1577 | - $query_values = array_merge($query_values,array(':arrival_airport_icao' => $arrival_airport_icao)); |
|
| 1577 | + $query_values = array_merge($query_values, array(':arrival_airport_icao' => $arrival_airport_icao)); |
|
| 1578 | 1578 | } |
| 1579 | 1579 | } |
| 1580 | 1580 | |
@@ -1582,8 +1582,8 @@ discard block |
||
| 1582 | 1582 | { |
| 1583 | 1583 | $limit_array = explode(",", $limit); |
| 1584 | 1584 | |
| 1585 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
| 1586 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
| 1585 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
| 1586 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
| 1587 | 1587 | |
| 1588 | 1588 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
| 1589 | 1589 | { |
@@ -1628,8 +1628,8 @@ discard block |
||
| 1628 | 1628 | { |
| 1629 | 1629 | $limit_array = explode(",", $limit); |
| 1630 | 1630 | |
| 1631 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
| 1632 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
| 1631 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
| 1632 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
| 1633 | 1633 | |
| 1634 | 1634 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
| 1635 | 1635 | { |
@@ -1646,7 +1646,7 @@ discard block |
||
| 1646 | 1646 | $orderby_query = " ORDER BY spotter_output.date DESC"; |
| 1647 | 1647 | } |
| 1648 | 1648 | |
| 1649 | - $query = $global_query." WHERE spotter_output.highlight <> '' ".$orderby_query; |
|
| 1649 | + $query = $global_query." WHERE spotter_output.highlight <> '' ".$orderby_query; |
|
| 1650 | 1650 | |
| 1651 | 1651 | $spotter_array = $this->getDataFromDB($query, array(), $limit_query); |
| 1652 | 1652 | |
@@ -1667,14 +1667,14 @@ discard block |
||
| 1667 | 1667 | |
| 1668 | 1668 | date_default_timezone_set('UTC'); |
| 1669 | 1669 | |
| 1670 | - $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
|
| 1670 | + $registration = filter_var($registration, FILTER_SANITIZE_STRING); |
|
| 1671 | 1671 | |
| 1672 | 1672 | |
| 1673 | - $query = $global_query." WHERE spotter_output.highlight <> '' AND spotter_output.registration = :registration"; |
|
| 1673 | + $query = $global_query." WHERE spotter_output.highlight <> '' AND spotter_output.registration = :registration"; |
|
| 1674 | 1674 | $sth = $this->db->prepare($query); |
| 1675 | 1675 | $sth->execute(array(':registration' => $registration)); |
| 1676 | 1676 | |
| 1677 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 1677 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 1678 | 1678 | { |
| 1679 | 1679 | $highlight = $row['highlight']; |
| 1680 | 1680 | } |
@@ -1690,14 +1690,14 @@ discard block |
||
| 1690 | 1690 | * @return String usage |
| 1691 | 1691 | * |
| 1692 | 1692 | */ |
| 1693 | - public function getSquawkUsage($squawk = '',$country = 'FR') |
|
| 1693 | + public function getSquawkUsage($squawk = '', $country = 'FR') |
|
| 1694 | 1694 | { |
| 1695 | 1695 | |
| 1696 | - $squawk = filter_var($squawk,FILTER_SANITIZE_STRING); |
|
| 1697 | - $country = filter_var($country,FILTER_SANITIZE_STRING); |
|
| 1696 | + $squawk = filter_var($squawk, FILTER_SANITIZE_STRING); |
|
| 1697 | + $country = filter_var($country, FILTER_SANITIZE_STRING); |
|
| 1698 | 1698 | |
| 1699 | 1699 | $query = "SELECT squawk.* FROM squawk WHERE squawk.code = :squawk AND squawk.country = :country LIMIT 1"; |
| 1700 | - $query_values = array(':squawk' => ltrim($squawk,'0'), ':country' => $country); |
|
| 1700 | + $query_values = array(':squawk' => ltrim($squawk, '0'), ':country' => $country); |
|
| 1701 | 1701 | |
| 1702 | 1702 | $sth = $this->db->prepare($query); |
| 1703 | 1703 | $sth->execute($query_values); |
@@ -1718,9 +1718,9 @@ discard block |
||
| 1718 | 1718 | public function getAirportIcao($airport_iata = '') |
| 1719 | 1719 | { |
| 1720 | 1720 | |
| 1721 | - $airport_iata = filter_var($airport_iata,FILTER_SANITIZE_STRING); |
|
| 1721 | + $airport_iata = filter_var($airport_iata, FILTER_SANITIZE_STRING); |
|
| 1722 | 1722 | |
| 1723 | - $query = "SELECT airport.* FROM airport WHERE airport.iata = :airport LIMIT 1"; |
|
| 1723 | + $query = "SELECT airport.* FROM airport WHERE airport.iata = :airport LIMIT 1"; |
|
| 1724 | 1724 | $query_values = array(':airport' => $airport_iata); |
| 1725 | 1725 | |
| 1726 | 1726 | $sth = $this->db->prepare($query); |
@@ -1741,12 +1741,12 @@ discard block |
||
| 1741 | 1741 | * @return Float distance to the airport |
| 1742 | 1742 | * |
| 1743 | 1743 | */ |
| 1744 | - public function getAirportDistance($airport_icao,$latitude,$longitude) |
|
| 1744 | + public function getAirportDistance($airport_icao, $latitude, $longitude) |
|
| 1745 | 1745 | { |
| 1746 | 1746 | |
| 1747 | - $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
|
| 1747 | + $airport_icao = filter_var($airport_icao, FILTER_SANITIZE_STRING); |
|
| 1748 | 1748 | |
| 1749 | - $query = "SELECT airport.latitude, airport.longitude FROM airport WHERE airport.icao = :airport LIMIT 1"; |
|
| 1749 | + $query = "SELECT airport.latitude, airport.longitude FROM airport WHERE airport.icao = :airport LIMIT 1"; |
|
| 1750 | 1750 | $query_values = array(':airport' => $airport_icao); |
| 1751 | 1751 | $sth = $this->db->prepare($query); |
| 1752 | 1752 | $sth->execute($query_values); |
@@ -1755,7 +1755,7 @@ discard block |
||
| 1755 | 1755 | $airport_latitude = $row['latitude']; |
| 1756 | 1756 | $airport_longitude = $row['longitude']; |
| 1757 | 1757 | $Common = new Common(); |
| 1758 | - return $Common->distance($latitude,$longitude,$airport_latitude,$airport_longitude); |
|
| 1758 | + return $Common->distance($latitude, $longitude, $airport_latitude, $airport_longitude); |
|
| 1759 | 1759 | } else return ''; |
| 1760 | 1760 | } |
| 1761 | 1761 | |
@@ -1769,11 +1769,11 @@ discard block |
||
| 1769 | 1769 | public function getAllAirportInfo($airport = '') |
| 1770 | 1770 | { |
| 1771 | 1771 | |
| 1772 | - $airport = filter_var($airport,FILTER_SANITIZE_STRING); |
|
| 1772 | + $airport = filter_var($airport, FILTER_SANITIZE_STRING); |
|
| 1773 | 1773 | |
| 1774 | 1774 | $query_values = array(); |
| 1775 | 1775 | if ($airport == 'NA') { |
| 1776 | - return array(array('name' => 'Not available','city' => 'N/A', 'country' => 'N/A','iata' => 'NA','icao' => 'NA','altitude' => NULL,'latitude' => 0,'longitude' => 0,'type' => 'NA','home_link' => '','wikipedia_link' => '','image_thumb' => '', 'image' => '')); |
|
| 1776 | + return array(array('name' => 'Not available', 'city' => 'N/A', 'country' => 'N/A', 'iata' => 'NA', 'icao' => 'NA', 'altitude' => NULL, 'latitude' => 0, 'longitude' => 0, 'type' => 'NA', 'home_link' => '', 'wikipedia_link' => '', 'image_thumb' => '', 'image' => '')); |
|
| 1777 | 1777 | } elseif ($airport == '') { |
| 1778 | 1778 | $query = "SELECT airport.name, airport.city, airport.country, airport.iata, airport.icao, airport.latitude, airport.longitude, airport.altitude, airport.type, airport.home_link, airport.wikipedia_link, airport.image_thumb, airport.image FROM airport"; |
| 1779 | 1779 | } else { |
@@ -1821,14 +1821,14 @@ discard block |
||
| 1821 | 1821 | { |
| 1822 | 1822 | $lst_countries = ''; |
| 1823 | 1823 | foreach ($countries as $country) { |
| 1824 | - $country = filter_var($country,FILTER_SANITIZE_STRING); |
|
| 1824 | + $country = filter_var($country, FILTER_SANITIZE_STRING); |
|
| 1825 | 1825 | if ($lst_countries == '') { |
| 1826 | 1826 | $lst_countries = "'".$country."'"; |
| 1827 | 1827 | } else { |
| 1828 | 1828 | $lst_countries .= ",'".$country."'"; |
| 1829 | 1829 | } |
| 1830 | 1830 | } |
| 1831 | - $query = "SELECT airport.* FROM airport WHERE airport.country IN (".$lst_countries.")"; |
|
| 1831 | + $query = "SELECT airport.* FROM airport WHERE airport.country IN (".$lst_countries.")"; |
|
| 1832 | 1832 | |
| 1833 | 1833 | $sth = $this->db->prepare($query); |
| 1834 | 1834 | $sth->execute(); |
@@ -1836,7 +1836,7 @@ discard block |
||
| 1836 | 1836 | $airport_array = array(); |
| 1837 | 1837 | $temp_array = array(); |
| 1838 | 1838 | |
| 1839 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 1839 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 1840 | 1840 | { |
| 1841 | 1841 | $temp_array['name'] = $row['name']; |
| 1842 | 1842 | $temp_array['city'] = $row['city']; |
@@ -1864,10 +1864,10 @@ discard block |
||
| 1864 | 1864 | { |
| 1865 | 1865 | global $globalDBdriver; |
| 1866 | 1866 | if (is_array($coord)) { |
| 1867 | - $minlong = filter_var($coord[0],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 1868 | - $minlat = filter_var($coord[1],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 1869 | - $maxlong = filter_var($coord[2],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 1870 | - $maxlat = filter_var($coord[3],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 1867 | + $minlong = filter_var($coord[0], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 1868 | + $minlat = filter_var($coord[1], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 1869 | + $maxlong = filter_var($coord[2], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 1870 | + $maxlat = filter_var($coord[3], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 1871 | 1871 | } else return array(); |
| 1872 | 1872 | if ($globalDBdriver == 'mysql') { |
| 1873 | 1873 | $query = "SELECT airport.* FROM airport WHERE airport.latitude BETWEEN ".$minlat." AND ".$maxlat." AND airport.longitude BETWEEN ".$minlong." AND ".$maxlong." AND airport.type != 'closed'"; |
@@ -1879,7 +1879,7 @@ discard block |
||
| 1879 | 1879 | |
| 1880 | 1880 | $airport_array = array(); |
| 1881 | 1881 | |
| 1882 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 1882 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 1883 | 1883 | { |
| 1884 | 1884 | $temp_array = $row; |
| 1885 | 1885 | |
@@ -1899,13 +1899,13 @@ discard block |
||
| 1899 | 1899 | public function getAllWaypointsInfobyCoord($coord) |
| 1900 | 1900 | { |
| 1901 | 1901 | if (is_array($coord)) { |
| 1902 | - $minlong = filter_var($coord[0],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 1903 | - $minlat = filter_var($coord[1],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 1904 | - $maxlong = filter_var($coord[2],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 1905 | - $maxlat = filter_var($coord[3],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 1902 | + $minlong = filter_var($coord[0], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 1903 | + $minlat = filter_var($coord[1], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 1904 | + $maxlong = filter_var($coord[2], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 1905 | + $maxlat = filter_var($coord[3], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 1906 | 1906 | } else return array(); |
| 1907 | 1907 | //$query = "SELECT waypoints.* FROM waypoints WHERE waypoints.latitude_begin BETWEEN ".$minlat." AND ".$maxlat." AND waypoints.longitude_begin BETWEEN ".$minlong." AND ".$maxlong; |
| 1908 | - $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.")"; |
|
| 1908 | + $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.")"; |
|
| 1909 | 1909 | //$query = "SELECT waypoints.* FROM waypoints"; |
| 1910 | 1910 | //$query = "SELECT waypoints.* FROM waypoints INNER JOIN (SELECT waypoints.* FROM waypoints WHERE waypoints.latitude_begin BETWEEN ".$minlat." AND ".$maxlat." AND waypoints.longitude_begin BETWEEN ".$minlong." AND ".$maxlong.") w ON w.name_end = waypoints.name_begin OR w.name_begin = waypoints.name_begin OR w.name_begin = waypoints.name_end OR w.name_end = waypoints.name_end"; |
| 1911 | 1911 | //$query = "SELECT * FROM waypoints LEFT JOIN waypoints w ON waypoints.name_end = w.name_begin WHERE waypoints.latitude_begin BETWEEN ".$minlat." AND ".$maxlat." AND waypoints.longitude_begin BETWEEN ".$minlong." AND ".$maxlong; |
@@ -1917,7 +1917,7 @@ discard block |
||
| 1917 | 1917 | |
| 1918 | 1918 | $waypoints_array = array(); |
| 1919 | 1919 | |
| 1920 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 1920 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 1921 | 1921 | { |
| 1922 | 1922 | $temp_array = $row; |
| 1923 | 1923 | |
@@ -1937,10 +1937,10 @@ discard block |
||
| 1937 | 1937 | */ |
| 1938 | 1938 | public function getAllAirlineInfo($airline_icao) |
| 1939 | 1939 | { |
| 1940 | - $airline_icao = strtoupper(filter_var($airline_icao,FILTER_SANITIZE_STRING)); |
|
| 1940 | + $airline_icao = strtoupper(filter_var($airline_icao, FILTER_SANITIZE_STRING)); |
|
| 1941 | 1941 | if ($airline_icao == 'NA') { |
| 1942 | 1942 | $airline_array = array(); |
| 1943 | - $airline_array[] = array('name' => 'Not Available','iata' => 'NA', 'icao' => 'NA', 'callsign' => '', 'country' => 'NA', 'type' =>''); |
|
| 1943 | + $airline_array[] = array('name' => 'Not Available', 'iata' => 'NA', 'icao' => 'NA', 'callsign' => '', 'country' => 'NA', 'type' =>''); |
|
| 1944 | 1944 | return $airline_array; |
| 1945 | 1945 | } else { |
| 1946 | 1946 | if (strlen($airline_icao) == 2) { |
@@ -1982,12 +1982,12 @@ discard block |
||
| 1982 | 1982 | */ |
| 1983 | 1983 | public function getAllAircraftInfo($aircraft_type) |
| 1984 | 1984 | { |
| 1985 | - $aircraft_type = filter_var($aircraft_type,FILTER_SANITIZE_STRING); |
|
| 1985 | + $aircraft_type = filter_var($aircraft_type, FILTER_SANITIZE_STRING); |
|
| 1986 | 1986 | |
| 1987 | 1987 | if ($aircraft_type == 'NA') { |
| 1988 | - return array(array('icao' => 'NA','type' => 'Not Available', 'manufacturer' => 'Not Available', 'aircraft_shadow' => NULL)); |
|
| 1988 | + return array(array('icao' => 'NA', 'type' => 'Not Available', 'manufacturer' => 'Not Available', 'aircraft_shadow' => NULL)); |
|
| 1989 | 1989 | } |
| 1990 | - $query = "SELECT aircraft.icao, aircraft.type,aircraft.manufacturer,aircraft.aircraft_shadow FROM aircraft WHERE aircraft.icao = :aircraft_type"; |
|
| 1990 | + $query = "SELECT aircraft.icao, aircraft.type,aircraft.manufacturer,aircraft.aircraft_shadow FROM aircraft WHERE aircraft.icao = :aircraft_type"; |
|
| 1991 | 1991 | |
| 1992 | 1992 | $sth = $this->db->prepare($query); |
| 1993 | 1993 | $sth->execute(array(':aircraft_type' => $aircraft_type)); |
@@ -2019,7 +2019,7 @@ discard block |
||
| 2019 | 2019 | */ |
| 2020 | 2020 | public function getAircraftIcao($aircraft_type) |
| 2021 | 2021 | { |
| 2022 | - $aircraft_type = filter_var($aircraft_type,FILTER_SANITIZE_STRING); |
|
| 2022 | + $aircraft_type = filter_var($aircraft_type, FILTER_SANITIZE_STRING); |
|
| 2023 | 2023 | $all_aircraft = array('737-300' => 'B733', |
| 2024 | 2024 | '777-200' => 'B772', |
| 2025 | 2025 | '777-200ER' => 'B772', |
@@ -2031,10 +2031,10 @@ discard block |
||
| 2031 | 2031 | 'A380' => 'A388'); |
| 2032 | 2032 | if (isset($all_aircraft[$aircraft_type])) return $all_aircraft[$aircraft_type]; |
| 2033 | 2033 | |
| 2034 | - $query = "SELECT aircraft.icao FROM aircraft WHERE aircraft.type LIKE :saircraft_type OR aircraft.type = :aircraft_type OR aircraft.icao = :aircraft_type LIMIT 1"; |
|
| 2034 | + $query = "SELECT aircraft.icao FROM aircraft WHERE aircraft.type LIKE :saircraft_type OR aircraft.type = :aircraft_type OR aircraft.icao = :aircraft_type LIMIT 1"; |
|
| 2035 | 2035 | $aircraft_type = strtoupper($aircraft_type); |
| 2036 | 2036 | $sth = $this->db->prepare($query); |
| 2037 | - $sth->execute(array(':saircraft_type' => '%'.$aircraft_type.'%',':aircraft_type' => $aircraft_type,)); |
|
| 2037 | + $sth->execute(array(':saircraft_type' => '%'.$aircraft_type.'%', ':aircraft_type' => $aircraft_type,)); |
|
| 2038 | 2038 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
| 2039 | 2039 | if (isset($result[0]['icao'])) return $result[0]['icao']; |
| 2040 | 2040 | else return ''; |
@@ -2049,9 +2049,9 @@ discard block |
||
| 2049 | 2049 | */ |
| 2050 | 2050 | public function getAllAircraftType($aircraft_modes) |
| 2051 | 2051 | { |
| 2052 | - $aircraft_modes = filter_var($aircraft_modes,FILTER_SANITIZE_STRING); |
|
| 2052 | + $aircraft_modes = filter_var($aircraft_modes, FILTER_SANITIZE_STRING); |
|
| 2053 | 2053 | |
| 2054 | - $query = "SELECT aircraft_modes.ICAOTypeCode FROM aircraft_modes WHERE aircraft_modes.ModeS = :aircraft_modes LIMIT 1"; |
|
| 2054 | + $query = "SELECT aircraft_modes.ICAOTypeCode FROM aircraft_modes WHERE aircraft_modes.ModeS = :aircraft_modes LIMIT 1"; |
|
| 2055 | 2055 | |
| 2056 | 2056 | $sth = $this->db->prepare($query); |
| 2057 | 2057 | $sth->execute(array(':aircraft_modes' => $aircraft_modes)); |
@@ -2071,8 +2071,8 @@ discard block |
||
| 2071 | 2071 | */ |
| 2072 | 2072 | public function getOperator($operator) |
| 2073 | 2073 | { |
| 2074 | - $operator = filter_var($operator,FILTER_SANITIZE_STRING); |
|
| 2075 | - $query = "SELECT translation.operator_correct FROM translation WHERE translation.operator = :operator LIMIT 1"; |
|
| 2074 | + $operator = filter_var($operator, FILTER_SANITIZE_STRING); |
|
| 2075 | + $query = "SELECT translation.operator_correct FROM translation WHERE translation.operator = :operator LIMIT 1"; |
|
| 2076 | 2076 | |
| 2077 | 2077 | $sth = $this->db->prepare($query); |
| 2078 | 2078 | $sth->execute(array(':operator' => $operator)); |
@@ -2092,9 +2092,9 @@ discard block |
||
| 2092 | 2092 | */ |
| 2093 | 2093 | public function getRouteInfo($callsign) |
| 2094 | 2094 | { |
| 2095 | - $callsign = filter_var($callsign,FILTER_SANITIZE_STRING); |
|
| 2095 | + $callsign = filter_var($callsign, FILTER_SANITIZE_STRING); |
|
| 2096 | 2096 | if ($callsign == '') return array(); |
| 2097 | - $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"; |
|
| 2097 | + $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"; |
|
| 2098 | 2098 | |
| 2099 | 2099 | $sth = $this->db->prepare($query); |
| 2100 | 2100 | $sth->execute(array(':callsign' => $callsign)); |
@@ -2114,9 +2114,9 @@ discard block |
||
| 2114 | 2114 | */ |
| 2115 | 2115 | public function getAircraftInfoByRegistration($registration) |
| 2116 | 2116 | { |
| 2117 | - $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
|
| 2117 | + $registration = filter_var($registration, FILTER_SANITIZE_STRING); |
|
| 2118 | 2118 | |
| 2119 | - $query = "SELECT spotter_output.aircraft_icao, spotter_output.aircraft_name, spotter_output.aircraft_manufacturer, spotter_output.airline_icao FROM spotter_output WHERE spotter_output.registration = :registration"; |
|
| 2119 | + $query = "SELECT spotter_output.aircraft_icao, spotter_output.aircraft_name, spotter_output.aircraft_manufacturer, spotter_output.airline_icao FROM spotter_output WHERE spotter_output.registration = :registration"; |
|
| 2120 | 2120 | |
| 2121 | 2121 | $sth = $this->db->prepare($query); |
| 2122 | 2122 | $sth->execute(array(':registration' => $registration)); |
@@ -2124,7 +2124,7 @@ discard block |
||
| 2124 | 2124 | $aircraft_array = array(); |
| 2125 | 2125 | $temp_array = array(); |
| 2126 | 2126 | |
| 2127 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2127 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2128 | 2128 | { |
| 2129 | 2129 | $temp_array['airline_icao'] = $row['airline_icao']; |
| 2130 | 2130 | $temp_array['aircraft_icao'] = $row['aircraft_icao']; |
@@ -2146,10 +2146,10 @@ discard block |
||
| 2146 | 2146 | */ |
| 2147 | 2147 | public function getAircraftOwnerByRegistration($registration) |
| 2148 | 2148 | { |
| 2149 | - $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
|
| 2149 | + $registration = filter_var($registration, FILTER_SANITIZE_STRING); |
|
| 2150 | 2150 | $Connection = new Connection($this->db); |
| 2151 | 2151 | if ($Connection->tableExists('aircraft_owner')) { |
| 2152 | - $query = "SELECT aircraft_owner.base, aircraft_owner.owner, aircraft_owner.date_first_reg FROM aircraft_owner WHERE registration = :registration LIMIT 1"; |
|
| 2152 | + $query = "SELECT aircraft_owner.base, aircraft_owner.owner, aircraft_owner.date_first_reg FROM aircraft_owner WHERE registration = :registration LIMIT 1"; |
|
| 2153 | 2153 | $sth = $this->db->prepare($query); |
| 2154 | 2154 | $sth->execute(array(':registration' => $registration)); |
| 2155 | 2155 | |
@@ -2167,7 +2167,7 @@ discard block |
||
| 2167 | 2167 | public function getAllFlightsforSitemap() |
| 2168 | 2168 | { |
| 2169 | 2169 | //$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 "; |
| 2170 | - $query = "SELECT spotter_output.spotter_id FROM spotter_output ORDER BY spotter_id DESC LIMIT 200 OFFSET 0"; |
|
| 2170 | + $query = "SELECT spotter_output.spotter_id FROM spotter_output ORDER BY spotter_id DESC LIMIT 200 OFFSET 0"; |
|
| 2171 | 2171 | |
| 2172 | 2172 | $sth = $this->db->prepare($query); |
| 2173 | 2173 | $sth->execute(); |
@@ -2214,7 +2214,7 @@ discard block |
||
| 2214 | 2214 | $manufacturer_array = array(); |
| 2215 | 2215 | $temp_array = array(); |
| 2216 | 2216 | |
| 2217 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2217 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2218 | 2218 | { |
| 2219 | 2219 | $temp_array['aircraft_manufacturer'] = $row['aircraft_manufacturer']; |
| 2220 | 2220 | |
@@ -2248,7 +2248,7 @@ discard block |
||
| 2248 | 2248 | $aircraft_array = array(); |
| 2249 | 2249 | $temp_array = array(); |
| 2250 | 2250 | |
| 2251 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2251 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2252 | 2252 | { |
| 2253 | 2253 | $temp_array['aircraft_icao'] = $row['aircraft_icao']; |
| 2254 | 2254 | $temp_array['aircraft_manufacturer'] = $row['aircraft_manufacturer']; |
@@ -2269,7 +2269,7 @@ discard block |
||
| 2269 | 2269 | */ |
| 2270 | 2270 | public function getAllAircraftRegistrations() |
| 2271 | 2271 | { |
| 2272 | - $query = "SELECT DISTINCT spotter_output.registration |
|
| 2272 | + $query = "SELECT DISTINCT spotter_output.registration |
|
| 2273 | 2273 | FROM spotter_output |
| 2274 | 2274 | WHERE spotter_output.registration <> '' |
| 2275 | 2275 | ORDER BY spotter_output.registration ASC"; |
@@ -2280,7 +2280,7 @@ discard block |
||
| 2280 | 2280 | $aircraft_array = array(); |
| 2281 | 2281 | $temp_array = array(); |
| 2282 | 2282 | |
| 2283 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2283 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2284 | 2284 | { |
| 2285 | 2285 | $temp_array['registration'] = $row['registration']; |
| 2286 | 2286 | |
@@ -2300,7 +2300,7 @@ discard block |
||
| 2300 | 2300 | public function getAllSourceName($type = '') |
| 2301 | 2301 | { |
| 2302 | 2302 | $query_values = array(); |
| 2303 | - $query = "SELECT DISTINCT spotter_output.source_name |
|
| 2303 | + $query = "SELECT DISTINCT spotter_output.source_name |
|
| 2304 | 2304 | FROM spotter_output |
| 2305 | 2305 | WHERE spotter_output.source_name <> ''"; |
| 2306 | 2306 | if ($type != '') { |
@@ -2316,7 +2316,7 @@ discard block |
||
| 2316 | 2316 | $source_array = array(); |
| 2317 | 2317 | $temp_array = array(); |
| 2318 | 2318 | |
| 2319 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2319 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2320 | 2320 | { |
| 2321 | 2321 | $temp_array['source_name'] = $row['source_name']; |
| 2322 | 2322 | $source_array[] = $temp_array; |
@@ -2334,7 +2334,7 @@ discard block |
||
| 2334 | 2334 | */ |
| 2335 | 2335 | public function getAllAirlineNames($airline_type = '') |
| 2336 | 2336 | { |
| 2337 | - $airline_type = filter_var($airline_type,FILTER_SANITIZE_STRING); |
|
| 2337 | + $airline_type = filter_var($airline_type, FILTER_SANITIZE_STRING); |
|
| 2338 | 2338 | if ($airline_type == '' || $airline_type == 'all') { |
| 2339 | 2339 | /* |
| 2340 | 2340 | $query = "SELECT DISTINCT spotter_output.airline_icao AS airline_icao, spotter_output.airline_name AS airline_name, spotter_output.airline_type AS airline_type |
@@ -2344,7 +2344,7 @@ discard block |
||
| 2344 | 2344 | */ |
| 2345 | 2345 | $query = "SELECT DISTINCT icao AS airline_icao, name AS airline_name, type AS airline_type FROM airlines ORDER BY name ASC"; |
| 2346 | 2346 | } else { |
| 2347 | - $query = "SELECT DISTINCT spotter_output.airline_icao AS airline_icao, spotter_output.airline_name AS airline_name, spotter_output.airline_type AS airline_type |
|
| 2347 | + $query = "SELECT DISTINCT spotter_output.airline_icao AS airline_icao, spotter_output.airline_name AS airline_name, spotter_output.airline_type AS airline_type |
|
| 2348 | 2348 | FROM spotter_output |
| 2349 | 2349 | WHERE spotter_output.airline_icao <> '' |
| 2350 | 2350 | AND spotter_output.airline_type = :airline_type |
@@ -2361,7 +2361,7 @@ discard block |
||
| 2361 | 2361 | $airline_array = array(); |
| 2362 | 2362 | $temp_array = array(); |
| 2363 | 2363 | |
| 2364 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2364 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2365 | 2365 | { |
| 2366 | 2366 | $temp_array['airline_icao'] = $row['airline_icao']; |
| 2367 | 2367 | $temp_array['airline_name'] = $row['airline_name']; |
@@ -2382,7 +2382,7 @@ discard block |
||
| 2382 | 2382 | public function getAllAirlineCountries() |
| 2383 | 2383 | { |
| 2384 | 2384 | |
| 2385 | - $query = "SELECT DISTINCT spotter_output.airline_country AS airline_country |
|
| 2385 | + $query = "SELECT DISTINCT spotter_output.airline_country AS airline_country |
|
| 2386 | 2386 | FROM spotter_output |
| 2387 | 2387 | WHERE spotter_output.airline_country <> '' |
| 2388 | 2388 | ORDER BY spotter_output.airline_country ASC"; |
@@ -2394,7 +2394,7 @@ discard block |
||
| 2394 | 2394 | $airline_array = array(); |
| 2395 | 2395 | $temp_array = array(); |
| 2396 | 2396 | |
| 2397 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2397 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2398 | 2398 | { |
| 2399 | 2399 | $temp_array['airline_country'] = $row['airline_country']; |
| 2400 | 2400 | |
@@ -2416,7 +2416,7 @@ discard block |
||
| 2416 | 2416 | { |
| 2417 | 2417 | $airport_array = array(); |
| 2418 | 2418 | |
| 2419 | - $query = "SELECT DISTINCT spotter_output.departure_airport_icao AS airport_icao, spotter_output.departure_airport_name AS airport_name, spotter_output.departure_airport_city AS airport_city, spotter_output.departure_airport_country AS airport_country |
|
| 2419 | + $query = "SELECT DISTINCT spotter_output.departure_airport_icao AS airport_icao, spotter_output.departure_airport_name AS airport_name, spotter_output.departure_airport_city AS airport_city, spotter_output.departure_airport_country AS airport_country |
|
| 2420 | 2420 | FROM spotter_output |
| 2421 | 2421 | WHERE spotter_output.departure_airport_icao <> '' AND spotter_output.departure_airport_icao <> 'NA' |
| 2422 | 2422 | ORDER BY spotter_output.departure_airport_city ASC"; |
@@ -2426,7 +2426,7 @@ discard block |
||
| 2426 | 2426 | $sth->execute(); |
| 2427 | 2427 | |
| 2428 | 2428 | $temp_array = array(); |
| 2429 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2429 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2430 | 2430 | { |
| 2431 | 2431 | $temp_array['airport_icao'] = $row['airport_icao']; |
| 2432 | 2432 | $temp_array['airport_name'] = $row['airport_name']; |
@@ -2436,7 +2436,7 @@ discard block |
||
| 2436 | 2436 | $airport_array[$row['airport_city'].",".$row['airport_name']] = $temp_array; |
| 2437 | 2437 | } |
| 2438 | 2438 | |
| 2439 | - $query = "SELECT DISTINCT spotter_output.arrival_airport_icao AS airport_icao, spotter_output.arrival_airport_name AS airport_name, spotter_output.arrival_airport_city AS airport_city, spotter_output.arrival_airport_country AS airport_country |
|
| 2439 | + $query = "SELECT DISTINCT spotter_output.arrival_airport_icao AS airport_icao, spotter_output.arrival_airport_name AS airport_name, spotter_output.arrival_airport_city AS airport_city, spotter_output.arrival_airport_country AS airport_country |
|
| 2440 | 2440 | FROM spotter_output |
| 2441 | 2441 | WHERE spotter_output.arrival_airport_icao <> '' AND spotter_output.arrival_airport_icao <> 'NA' |
| 2442 | 2442 | ORDER BY spotter_output.arrival_airport_city ASC"; |
@@ -2444,7 +2444,7 @@ discard block |
||
| 2444 | 2444 | $sth = $this->db->prepare($query); |
| 2445 | 2445 | $sth->execute(); |
| 2446 | 2446 | |
| 2447 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2447 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2448 | 2448 | { |
| 2449 | 2449 | // if ($airport_array[$row['airport_city'].",".$row['airport_name']]['airport_icao'] != $row['airport_icao']) |
| 2450 | 2450 | // { |
@@ -2484,14 +2484,14 @@ discard block |
||
| 2484 | 2484 | |
| 2485 | 2485 | $temp_array = array(); |
| 2486 | 2486 | |
| 2487 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2487 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2488 | 2488 | { |
| 2489 | 2489 | $temp_array['airport_country'] = $row['airport_country']; |
| 2490 | 2490 | |
| 2491 | 2491 | $airport_array[$row['airport_country']] = $temp_array; |
| 2492 | 2492 | } |
| 2493 | 2493 | |
| 2494 | - $query = "SELECT DISTINCT spotter_output.arrival_airport_country AS airport_country |
|
| 2494 | + $query = "SELECT DISTINCT spotter_output.arrival_airport_country AS airport_country |
|
| 2495 | 2495 | FROM spotter_output |
| 2496 | 2496 | WHERE spotter_output.arrival_airport_country <> '' |
| 2497 | 2497 | ORDER BY spotter_output.arrival_airport_country ASC"; |
@@ -2499,7 +2499,7 @@ discard block |
||
| 2499 | 2499 | $sth = $this->db->prepare($query); |
| 2500 | 2500 | $sth->execute(); |
| 2501 | 2501 | |
| 2502 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2502 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2503 | 2503 | { |
| 2504 | 2504 | if (isset($airport_array[$row['airport_country']]['airport_country']) && $airport_array[$row['airport_country']]['airport_country'] != $row['airport_country']) |
| 2505 | 2505 | { |
@@ -2522,12 +2522,12 @@ discard block |
||
| 2522 | 2522 | */ |
| 2523 | 2523 | public function getAllCountries() |
| 2524 | 2524 | { |
| 2525 | - $Connection= new Connection($this->db); |
|
| 2525 | + $Connection = new Connection($this->db); |
|
| 2526 | 2526 | if ($Connection->tableExists('countries')) { |
| 2527 | 2527 | |
| 2528 | 2528 | $country_array = array(); |
| 2529 | 2529 | |
| 2530 | - $query = "SELECT countries.name AS airport_country |
|
| 2530 | + $query = "SELECT countries.name AS airport_country |
|
| 2531 | 2531 | FROM countries |
| 2532 | 2532 | ORDER BY countries.name ASC"; |
| 2533 | 2533 | $sth = $this->db->prepare($query); |
@@ -2536,7 +2536,7 @@ discard block |
||
| 2536 | 2536 | $temp_array = array(); |
| 2537 | 2537 | $country_array = array(); |
| 2538 | 2538 | |
| 2539 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2539 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2540 | 2540 | { |
| 2541 | 2541 | $temp_array['country'] = $row['airport_country']; |
| 2542 | 2542 | |
@@ -2544,7 +2544,7 @@ discard block |
||
| 2544 | 2544 | } |
| 2545 | 2545 | } else { |
| 2546 | 2546 | |
| 2547 | - $query = "SELECT DISTINCT spotter_output.departure_airport_country AS airport_country |
|
| 2547 | + $query = "SELECT DISTINCT spotter_output.departure_airport_country AS airport_country |
|
| 2548 | 2548 | FROM spotter_output |
| 2549 | 2549 | WHERE spotter_output.departure_airport_country <> '' |
| 2550 | 2550 | ORDER BY spotter_output.departure_airport_country ASC"; |
@@ -2554,14 +2554,14 @@ discard block |
||
| 2554 | 2554 | |
| 2555 | 2555 | $temp_array = array(); |
| 2556 | 2556 | |
| 2557 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2557 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2558 | 2558 | { |
| 2559 | 2559 | $temp_array['country'] = $row['airport_country']; |
| 2560 | 2560 | |
| 2561 | 2561 | $country_array[$row['airport_country']] = $temp_array; |
| 2562 | 2562 | } |
| 2563 | 2563 | |
| 2564 | - $query = "SELECT DISTINCT spotter_output.arrival_airport_country AS airport_country |
|
| 2564 | + $query = "SELECT DISTINCT spotter_output.arrival_airport_country AS airport_country |
|
| 2565 | 2565 | FROM spotter_output |
| 2566 | 2566 | WHERE spotter_output.arrival_airport_country <> '' |
| 2567 | 2567 | ORDER BY spotter_output.arrival_airport_country ASC"; |
@@ -2569,7 +2569,7 @@ discard block |
||
| 2569 | 2569 | $sth = $this->db->prepare($query); |
| 2570 | 2570 | $sth->execute(); |
| 2571 | 2571 | |
| 2572 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2572 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2573 | 2573 | { |
| 2574 | 2574 | if ($country_array[$row['airport_country']]['country'] != $row['airport_country']) |
| 2575 | 2575 | { |
@@ -2579,7 +2579,7 @@ discard block |
||
| 2579 | 2579 | } |
| 2580 | 2580 | } |
| 2581 | 2581 | |
| 2582 | - $query = "SELECT DISTINCT spotter_output.airline_country AS airline_country |
|
| 2582 | + $query = "SELECT DISTINCT spotter_output.airline_country AS airline_country |
|
| 2583 | 2583 | FROM spotter_output |
| 2584 | 2584 | WHERE spotter_output.airline_country <> '' |
| 2585 | 2585 | ORDER BY spotter_output.airline_country ASC"; |
@@ -2587,7 +2587,7 @@ discard block |
||
| 2587 | 2587 | $sth = $this->db->prepare($query); |
| 2588 | 2588 | $sth->execute(); |
| 2589 | 2589 | |
| 2590 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2590 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2591 | 2591 | { |
| 2592 | 2592 | if (isset($country_array[$row['airline_country']]['country']) && $country_array[$row['airline_country']]['country'] != $row['airline_country']) |
| 2593 | 2593 | { |
@@ -2611,7 +2611,7 @@ discard block |
||
| 2611 | 2611 | */ |
| 2612 | 2612 | public function getAllIdents() |
| 2613 | 2613 | { |
| 2614 | - $query = "SELECT DISTINCT spotter_output.ident |
|
| 2614 | + $query = "SELECT DISTINCT spotter_output.ident |
|
| 2615 | 2615 | FROM spotter_output |
| 2616 | 2616 | WHERE spotter_output.ident <> '' |
| 2617 | 2617 | ORDER BY spotter_output.date ASC LIMIT 700 OFFSET 0"; |
@@ -2622,7 +2622,7 @@ discard block |
||
| 2622 | 2622 | $ident_array = array(); |
| 2623 | 2623 | $temp_array = array(); |
| 2624 | 2624 | |
| 2625 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2625 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2626 | 2626 | { |
| 2627 | 2627 | $temp_array['ident'] = $row['ident']; |
| 2628 | 2628 | $ident_array[] = $temp_array; |
@@ -2802,12 +2802,12 @@ discard block |
||
| 2802 | 2802 | } else $offset = '+00:00'; |
| 2803 | 2803 | |
| 2804 | 2804 | if ($globalDBdriver == 'mysql') { |
| 2805 | - $query = "SELECT DISTINCT DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) as date |
|
| 2805 | + $query = "SELECT DISTINCT DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) as date |
|
| 2806 | 2806 | FROM spotter_output |
| 2807 | 2807 | WHERE spotter_output.date <> '' |
| 2808 | 2808 | ORDER BY spotter_output.date ASC LIMIT 0,200"; |
| 2809 | 2809 | } else { |
| 2810 | - $query = "SELECT DISTINCT to_char(spotter_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') as date |
|
| 2810 | + $query = "SELECT DISTINCT to_char(spotter_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') as date |
|
| 2811 | 2811 | FROM spotter_output |
| 2812 | 2812 | WHERE spotter_output.date <> '' |
| 2813 | 2813 | ORDER BY spotter_output.date ASC LIMIT 0,200"; |
@@ -2819,7 +2819,7 @@ discard block |
||
| 2819 | 2819 | $date_array = array(); |
| 2820 | 2820 | $temp_array = array(); |
| 2821 | 2821 | |
| 2822 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2822 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2823 | 2823 | { |
| 2824 | 2824 | $temp_array['date'] = $row['date']; |
| 2825 | 2825 | |
@@ -2839,7 +2839,7 @@ discard block |
||
| 2839 | 2839 | */ |
| 2840 | 2840 | public function getAllRoutes() |
| 2841 | 2841 | { |
| 2842 | - $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 |
|
| 2842 | + $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 |
|
| 2843 | 2843 | FROM spotter_output |
| 2844 | 2844 | WHERE spotter_output.ident <> '' |
| 2845 | 2845 | GROUP BY route |
@@ -2850,7 +2850,7 @@ discard block |
||
| 2850 | 2850 | |
| 2851 | 2851 | $routes_array = array(); |
| 2852 | 2852 | $temp_array = array(); |
| 2853 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2853 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2854 | 2854 | { |
| 2855 | 2855 | $temp_array['route'] = $row['route']; |
| 2856 | 2856 | $temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
@@ -2883,7 +2883,7 @@ discard block |
||
| 2883 | 2883 | if (count($airline_array) == 0) { |
| 2884 | 2884 | $airline_array = $this->getAllAirlineInfo("NA"); |
| 2885 | 2885 | } |
| 2886 | - if (!isset($airline_array[0]['icao']) || $airline_array[0]['icao'] == ""){ |
|
| 2886 | + if (!isset($airline_array[0]['icao']) || $airline_array[0]['icao'] == "") { |
|
| 2887 | 2887 | $airline_array = $this->getAllAirlineInfo("NA"); |
| 2888 | 2888 | } |
| 2889 | 2889 | } else { |
@@ -2896,7 +2896,7 @@ discard block |
||
| 2896 | 2896 | |
| 2897 | 2897 | |
| 2898 | 2898 | $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'; |
| 2899 | - $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); |
|
| 2899 | + $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); |
|
| 2900 | 2900 | |
| 2901 | 2901 | try { |
| 2902 | 2902 | $sth = $this->db->prepare($query); |
@@ -2919,11 +2919,11 @@ discard block |
||
| 2919 | 2919 | * @return String success or false |
| 2920 | 2920 | * |
| 2921 | 2921 | */ |
| 2922 | - public function updateLatestSpotterData($flightaware_id = '', $ident = '', $latitude = '', $longitude = '', $altitude = '', $ground = false, $groundspeed = NULL, $date = '', $arrival_airport_icao = '',$arrival_airport_time = '') |
|
| 2922 | + public function updateLatestSpotterData($flightaware_id = '', $ident = '', $latitude = '', $longitude = '', $altitude = '', $ground = false, $groundspeed = NULL, $date = '', $arrival_airport_icao = '', $arrival_airport_time = '') |
|
| 2923 | 2923 | { |
| 2924 | 2924 | if ($groundspeed == '') $groundspeed = NULL; |
| 2925 | 2925 | $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'; |
| 2926 | - $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); |
|
| 2926 | + $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); |
|
| 2927 | 2927 | |
| 2928 | 2928 | try { |
| 2929 | 2929 | $sth = $this->db->prepare($query); |
@@ -2963,7 +2963,7 @@ discard block |
||
| 2963 | 2963 | * @param String $verticalrate vertival rate of flight |
| 2964 | 2964 | * @return String success or false |
| 2965 | 2965 | */ |
| 2966 | - public function addSpotterData($flightaware_id = '', $ident = '', $aircraft_icao = '', $departure_airport_icao = '', $arrival_airport_icao = '', $latitude = '', $longitude = '', $waypoints = '', $altitude = '', $heading = '', $groundspeed = '', $date = '', $departure_airport_time = '', $arrival_airport_time = '',$squawk = '', $route_stop = '', $highlight = '', $ModeS = '', $registration = '',$pilot_id = '', $pilot_name = '', $verticalrate = '', $ground = false,$format_source = '', $source_name = '') |
|
| 2966 | + public function addSpotterData($flightaware_id = '', $ident = '', $aircraft_icao = '', $departure_airport_icao = '', $arrival_airport_icao = '', $latitude = '', $longitude = '', $waypoints = '', $altitude = '', $heading = '', $groundspeed = '', $date = '', $departure_airport_time = '', $arrival_airport_time = '', $squawk = '', $route_stop = '', $highlight = '', $ModeS = '', $registration = '', $pilot_id = '', $pilot_name = '', $verticalrate = '', $ground = false, $format_source = '', $source_name = '') |
|
| 2967 | 2967 | { |
| 2968 | 2968 | global $globalURL, $globalIVAO, $globalVATSIM, $globalphpVMS, $globalDebugTimeElapsed; |
| 2969 | 2969 | |
@@ -2986,13 +2986,13 @@ discard block |
||
| 2986 | 2986 | if ($ModeS != '') { |
| 2987 | 2987 | $timeelapsed = microtime(true); |
| 2988 | 2988 | $registration = $this->getAircraftRegistrationBymodeS($ModeS); |
| 2989 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftRegistrationBymodes : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 2989 | + if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftRegistrationBymodes : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
| 2990 | 2990 | } else { |
| 2991 | - $myhex = explode('-',$flightaware_id); |
|
| 2991 | + $myhex = explode('-', $flightaware_id); |
|
| 2992 | 2992 | if (count($myhex) > 0) { |
| 2993 | 2993 | $timeelapsed = microtime(true); |
| 2994 | 2994 | $registration = $this->getAircraftRegistrationBymodeS($myhex[0]); |
| 2995 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftRegistrationBymodes : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 2995 | + if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftRegistrationBymodes : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
| 2996 | 2996 | } |
| 2997 | 2997 | } |
| 2998 | 2998 | } |
@@ -3018,15 +3018,15 @@ discard block |
||
| 3018 | 3018 | if (count($airline_array) == 0) { |
| 3019 | 3019 | $airline_array = $this->getAllAirlineInfo("NA"); |
| 3020 | 3020 | } |
| 3021 | - if (!isset($airline_array[0]['icao']) || $airline_array[0]['icao'] == ""){ |
|
| 3021 | + if (!isset($airline_array[0]['icao']) || $airline_array[0]['icao'] == "") { |
|
| 3022 | 3022 | $airline_array = $this->getAllAirlineInfo("NA"); |
| 3023 | 3023 | } |
| 3024 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAirlineInfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3024 | + if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAirlineInfo : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
| 3025 | 3025 | |
| 3026 | 3026 | } else { |
| 3027 | 3027 | $timeelapsed = microtime(true); |
| 3028 | 3028 | $airline_array = $this->getAllAirlineInfo("NA"); |
| 3029 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAirlineInfo(NA) : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3029 | + if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAirlineInfo(NA) : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
| 3030 | 3030 | } |
| 3031 | 3031 | } |
| 3032 | 3032 | } else $airline_array = array(); |
@@ -3043,27 +3043,27 @@ discard block |
||
| 3043 | 3043 | { |
| 3044 | 3044 | $timeelapsed = microtime(true); |
| 3045 | 3045 | $aircraft_array = $this->getAllAircraftInfo("NA"); |
| 3046 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo(NA) : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3046 | + if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo(NA) : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
| 3047 | 3047 | } else { |
| 3048 | 3048 | $timeelapsed = microtime(true); |
| 3049 | 3049 | $aircraft_array = $this->getAllAircraftInfo($aircraft_icao); |
| 3050 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3050 | + if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
| 3051 | 3051 | } |
| 3052 | 3052 | } |
| 3053 | 3053 | } else { |
| 3054 | 3054 | if ($ModeS != '') { |
| 3055 | 3055 | $timeelapsed = microtime(true); |
| 3056 | 3056 | $aircraft_icao = $this->getAllAircraftType($ModeS); |
| 3057 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAllAircraftType : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3057 | + if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAllAircraftType : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
| 3058 | 3058 | if ($aircraft_icao == "" || $aircraft_icao == "XXXX") |
| 3059 | 3059 | { |
| 3060 | 3060 | $timeelapsed = microtime(true); |
| 3061 | 3061 | $aircraft_array = $this->getAllAircraftInfo("NA"); |
| 3062 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo(NA) : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3062 | + if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo(NA) : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
| 3063 | 3063 | } else { |
| 3064 | 3064 | $timeelapsed = microtime(true); |
| 3065 | 3065 | $aircraft_array = $this->getAllAircraftInfo($aircraft_icao); |
| 3066 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3066 | + if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
| 3067 | 3067 | } |
| 3068 | 3068 | } |
| 3069 | 3069 | } |
@@ -3078,7 +3078,7 @@ discard block |
||
| 3078 | 3078 | } else { |
| 3079 | 3079 | $timeelapsed = microtime(true); |
| 3080 | 3080 | $departure_airport_array = $this->getAllAirportInfo($departure_airport_icao); |
| 3081 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAllAirportInfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3081 | + if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAllAirportInfo : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
| 3082 | 3082 | } |
| 3083 | 3083 | } |
| 3084 | 3084 | |
@@ -3092,7 +3092,7 @@ discard block |
||
| 3092 | 3092 | } else { |
| 3093 | 3093 | $timeelapsed = microtime(true); |
| 3094 | 3094 | $arrival_airport_array = $this->getAllAirportInfo($arrival_airport_icao); |
| 3095 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAllAirportInfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3095 | + if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAllAirportInfo : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
| 3096 | 3096 | } |
| 3097 | 3097 | } |
| 3098 | 3098 | |
@@ -3156,7 +3156,7 @@ discard block |
||
| 3156 | 3156 | { |
| 3157 | 3157 | $timeelapsed = microtime(true); |
| 3158 | 3158 | $image_array = $Image->getSpotterImage($registration); |
| 3159 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getSpotterImage : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3159 | + if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getSpotterImage : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
| 3160 | 3160 | if (!isset($image_array[0]['registration'])) |
| 3161 | 3161 | { |
| 3162 | 3162 | //echo "Add image !!!! \n"; |
@@ -3164,7 +3164,7 @@ discard block |
||
| 3164 | 3164 | } |
| 3165 | 3165 | $timeelapsed = microtime(true); |
| 3166 | 3166 | $owner_info = $this->getAircraftOwnerByRegistration($registration); |
| 3167 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftOwnerByRegistration : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3167 | + if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftOwnerByRegistration : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
| 3168 | 3168 | if ($owner_info['owner'] != '') $aircraft_owner = ucwords(strtolower($owner_info['owner'])); |
| 3169 | 3169 | } |
| 3170 | 3170 | |
@@ -3172,33 +3172,33 @@ discard block |
||
| 3172 | 3172 | { |
| 3173 | 3173 | if (isset($airline_array[0]['icao'])) $airline_icao = $airline_array[0]['icao']; |
| 3174 | 3174 | else $airline_icao = ''; |
| 3175 | - $image_array = $Image->getSpotterImage('',$aircraft_icao,$airline_icao); |
|
| 3175 | + $image_array = $Image->getSpotterImage('', $aircraft_icao, $airline_icao); |
|
| 3176 | 3176 | if (!isset($image_array[0]['registration'])) |
| 3177 | 3177 | { |
| 3178 | 3178 | //echo "Add image !!!! \n"; |
| 3179 | - $Image->addSpotterImage('',$aircraft_icao,$airline_icao); |
|
| 3179 | + $Image->addSpotterImage('', $aircraft_icao, $airline_icao); |
|
| 3180 | 3180 | } |
| 3181 | 3181 | } |
| 3182 | 3182 | |
| 3183 | - $flightaware_id = filter_var($flightaware_id,FILTER_SANITIZE_STRING); |
|
| 3184 | - $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
|
| 3185 | - $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
|
| 3186 | - $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
|
| 3187 | - $departure_airport_icao = filter_var($departure_airport_icao,FILTER_SANITIZE_STRING); |
|
| 3188 | - $arrival_airport_icao = filter_var($arrival_airport_icao,FILTER_SANITIZE_STRING); |
|
| 3189 | - $latitude = filter_var($latitude,FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 3190 | - $longitude = filter_var($longitude,FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 3191 | - $waypoints = filter_var($waypoints,FILTER_SANITIZE_STRING); |
|
| 3192 | - $altitude = filter_var($altitude,FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 3193 | - $heading = filter_var($heading,FILTER_SANITIZE_NUMBER_INT); |
|
| 3194 | - $groundspeed = filter_var($groundspeed,FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 3195 | - $squawk = filter_var($squawk,FILTER_SANITIZE_NUMBER_INT); |
|
| 3196 | - $route_stop = filter_var($route_stop,FILTER_SANITIZE_STRING); |
|
| 3197 | - $ModeS = filter_var($ModeS,FILTER_SANITIZE_STRING); |
|
| 3198 | - $pilot_id = filter_var($pilot_id,FILTER_SANITIZE_STRING); |
|
| 3199 | - $pilot_name = filter_var($pilot_name,FILTER_SANITIZE_STRING); |
|
| 3200 | - $format_source = filter_var($format_source,FILTER_SANITIZE_STRING); |
|
| 3201 | - $verticalrate = filter_var($verticalrate,FILTER_SANITIZE_NUMBER_INT); |
|
| 3183 | + $flightaware_id = filter_var($flightaware_id, FILTER_SANITIZE_STRING); |
|
| 3184 | + $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
|
| 3185 | + $registration = filter_var($registration, FILTER_SANITIZE_STRING); |
|
| 3186 | + $aircraft_icao = filter_var($aircraft_icao, FILTER_SANITIZE_STRING); |
|
| 3187 | + $departure_airport_icao = filter_var($departure_airport_icao, FILTER_SANITIZE_STRING); |
|
| 3188 | + $arrival_airport_icao = filter_var($arrival_airport_icao, FILTER_SANITIZE_STRING); |
|
| 3189 | + $latitude = filter_var($latitude, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 3190 | + $longitude = filter_var($longitude, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 3191 | + $waypoints = filter_var($waypoints, FILTER_SANITIZE_STRING); |
|
| 3192 | + $altitude = filter_var($altitude, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 3193 | + $heading = filter_var($heading, FILTER_SANITIZE_NUMBER_INT); |
|
| 3194 | + $groundspeed = filter_var($groundspeed, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 3195 | + $squawk = filter_var($squawk, FILTER_SANITIZE_NUMBER_INT); |
|
| 3196 | + $route_stop = filter_var($route_stop, FILTER_SANITIZE_STRING); |
|
| 3197 | + $ModeS = filter_var($ModeS, FILTER_SANITIZE_STRING); |
|
| 3198 | + $pilot_id = filter_var($pilot_id, FILTER_SANITIZE_STRING); |
|
| 3199 | + $pilot_name = filter_var($pilot_name, FILTER_SANITIZE_STRING); |
|
| 3200 | + $format_source = filter_var($format_source, FILTER_SANITIZE_STRING); |
|
| 3201 | + $verticalrate = filter_var($verticalrate, FILTER_SANITIZE_NUMBER_INT); |
|
| 3202 | 3202 | |
| 3203 | 3203 | if (count($airline_array) == 0) |
| 3204 | 3204 | { |
@@ -3222,7 +3222,7 @@ discard block |
||
| 3222 | 3222 | if ($heading == '' || $Common->isInteger($heading) == false) $heading = 0; |
| 3223 | 3223 | if ($groundspeed == '' || $Common->isInteger($groundspeed) === false) $groundspeed = 0; |
| 3224 | 3224 | if (!isset($aircraft_owner)) $aircraft_owner = NULL; |
| 3225 | - $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) |
|
| 3225 | + $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) |
|
| 3226 | 3226 | 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)"; |
| 3227 | 3227 | |
| 3228 | 3228 | $airline_name = $airline_array[0]['name']; |
@@ -3232,7 +3232,7 @@ discard block |
||
| 3232 | 3232 | if ($airline_type == '') { |
| 3233 | 3233 | $timeelapsed = microtime(true); |
| 3234 | 3234 | $airline_type = $this->getAircraftTypeBymodeS($ModeS); |
| 3235 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftTypeBymodes : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3235 | + if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftTypeBymodes : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
| 3236 | 3236 | } |
| 3237 | 3237 | if ($airline_type == null) $airline_type = ''; |
| 3238 | 3238 | $aircraft_type = $aircraft_array[0]['type']; |
@@ -3243,7 +3243,7 @@ discard block |
||
| 3243 | 3243 | $arrival_airport_name = $arrival_airport_array[0]['name']; |
| 3244 | 3244 | $arrival_airport_city = $arrival_airport_array[0]['city']; |
| 3245 | 3245 | $arrival_airport_country = $arrival_airport_array[0]['country']; |
| 3246 | - $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); |
|
| 3246 | + $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); |
|
| 3247 | 3247 | |
| 3248 | 3248 | try { |
| 3249 | 3249 | |
@@ -3269,13 +3269,13 @@ discard block |
||
| 3269 | 3269 | { |
| 3270 | 3270 | global $globalDBdriver, $globalTimezone; |
| 3271 | 3271 | if ($globalDBdriver == 'mysql') { |
| 3272 | - $query = "SELECT spotter_output.ident FROM spotter_output |
|
| 3272 | + $query = "SELECT spotter_output.ident FROM spotter_output |
|
| 3273 | 3273 | WHERE spotter_output.ident = :ident |
| 3274 | 3274 | AND spotter_output.date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 HOUR) |
| 3275 | 3275 | AND spotter_output.date < UTC_TIMESTAMP()"; |
| 3276 | 3276 | $query_data = array(':ident' => $ident); |
| 3277 | 3277 | } else { |
| 3278 | - $query = "SELECT spotter_output.ident FROM spotter_output |
|
| 3278 | + $query = "SELECT spotter_output.ident FROM spotter_output |
|
| 3279 | 3279 | WHERE spotter_output.ident = :ident |
| 3280 | 3280 | AND spotter_output.date >= now() AT TIME ZONE 'UTC' - INTERVAL '1 HOURS' |
| 3281 | 3281 | AND spotter_output.date < now() AT TIME ZONE 'UTC'"; |
@@ -3284,8 +3284,8 @@ discard block |
||
| 3284 | 3284 | |
| 3285 | 3285 | $sth = $this->db->prepare($query); |
| 3286 | 3286 | $sth->execute($query_data); |
| 3287 | - $ident_result=''; |
|
| 3288 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3287 | + $ident_result = ''; |
|
| 3288 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3289 | 3289 | { |
| 3290 | 3290 | $ident_result = $row['ident']; |
| 3291 | 3291 | } |
@@ -3311,8 +3311,8 @@ discard block |
||
| 3311 | 3311 | return false; |
| 3312 | 3312 | } else { |
| 3313 | 3313 | $q_array = explode(" ", $q); |
| 3314 | - foreach ($q_array as $q_item){ |
|
| 3315 | - $q_item = filter_var($q_item,FILTER_SANITIZE_STRING); |
|
| 3314 | + foreach ($q_array as $q_item) { |
|
| 3315 | + $q_item = filter_var($q_item, FILTER_SANITIZE_STRING); |
|
| 3316 | 3316 | $additional_query .= " AND ("; |
| 3317 | 3317 | $additional_query .= "(spotter_output.aircraft_icao like '%".$q_item."%') OR "; |
| 3318 | 3318 | $additional_query .= "(spotter_output.aircraft_name like '%".$q_item."%') OR "; |
@@ -3327,11 +3327,11 @@ discard block |
||
| 3327 | 3327 | } |
| 3328 | 3328 | } |
| 3329 | 3329 | if ($globalDBdriver == 'mysql') { |
| 3330 | - $query = "SELECT spotter_output.* FROM spotter_output |
|
| 3330 | + $query = "SELECT spotter_output.* FROM spotter_output |
|
| 3331 | 3331 | WHERE spotter_output.date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 20 SECOND) ".$additional_query." |
| 3332 | 3332 | AND spotter_output.date < UTC_TIMESTAMP()"; |
| 3333 | 3333 | } else { |
| 3334 | - $query = "SELECT spotter_output.* FROM spotter_output |
|
| 3334 | + $query = "SELECT spotter_output.* FROM spotter_output |
|
| 3335 | 3335 | WHERE spotter_output.date::timestamp >= CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '20 SECONDS' ".$additional_query." |
| 3336 | 3336 | AND spotter_output.date::timestamp < CURRENT_TIMESTAMP AT TIME ZONE 'UTC'"; |
| 3337 | 3337 | } |
@@ -3351,7 +3351,7 @@ discard block |
||
| 3351 | 3351 | public function countAllAirlines($limit = true, $olderthanmonths = 0, $sincedate = '') |
| 3352 | 3352 | { |
| 3353 | 3353 | global $globalDBdriver; |
| 3354 | - $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
|
| 3354 | + $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
|
| 3355 | 3355 | FROM spotter_output |
| 3356 | 3356 | WHERE spotter_output.airline_name <> '' AND spotter_output.airline_icao <> 'NA' "; |
| 3357 | 3357 | if ($olderthanmonths > 0) { |
@@ -3376,7 +3376,7 @@ discard block |
||
| 3376 | 3376 | |
| 3377 | 3377 | $airline_array = array(); |
| 3378 | 3378 | $temp_array = array(); |
| 3379 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3379 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3380 | 3380 | { |
| 3381 | 3381 | $temp_array['airline_name'] = $row['airline_name']; |
| 3382 | 3382 | $temp_array['airline_icao'] = $row['airline_icao']; |
@@ -3396,7 +3396,7 @@ discard block |
||
| 3396 | 3396 | public function countAllPilots($limit = true, $olderthanmonths = 0, $sincedate = '') |
| 3397 | 3397 | { |
| 3398 | 3398 | global $globalDBdriver; |
| 3399 | - $query = "SELECT DISTINCT spotter_output.pilot_id, spotter_output.pilot_name, COUNT(spotter_output.pilot_id) AS pilot_count |
|
| 3399 | + $query = "SELECT DISTINCT spotter_output.pilot_id, spotter_output.pilot_name, COUNT(spotter_output.pilot_id) AS pilot_count |
|
| 3400 | 3400 | FROM spotter_output |
| 3401 | 3401 | WHERE spotter_output.pilot_id <> '' "; |
| 3402 | 3402 | if ($olderthanmonths > 0) { |
@@ -3423,7 +3423,7 @@ discard block |
||
| 3423 | 3423 | $airline_array = array(); |
| 3424 | 3424 | $temp_array = array(); |
| 3425 | 3425 | |
| 3426 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3426 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3427 | 3427 | { |
| 3428 | 3428 | $temp_array['pilot_name'] = $row['pilot_name']; |
| 3429 | 3429 | $temp_array['pilot_id'] = $row['pilot_id']; |
@@ -3442,7 +3442,7 @@ discard block |
||
| 3442 | 3442 | public function countAllOwners($limit = true, $olderthanmonths = 0, $sincedate = '') |
| 3443 | 3443 | { |
| 3444 | 3444 | global $globalDBdriver; |
| 3445 | - $query = "SELECT DISTINCT spotter_output.owner_name, COUNT(spotter_output.owner_name) AS owner_count |
|
| 3445 | + $query = "SELECT DISTINCT spotter_output.owner_name, COUNT(spotter_output.owner_name) AS owner_count |
|
| 3446 | 3446 | FROM spotter_output |
| 3447 | 3447 | WHERE spotter_output.owner_name <> '' AND spotter_output.owner_name IS NOT NULL "; |
| 3448 | 3448 | if ($olderthanmonths > 0) { |
@@ -3469,7 +3469,7 @@ discard block |
||
| 3469 | 3469 | $airline_array = array(); |
| 3470 | 3470 | $temp_array = array(); |
| 3471 | 3471 | |
| 3472 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3472 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3473 | 3473 | { |
| 3474 | 3474 | $temp_array['owner_name'] = $row['owner_name']; |
| 3475 | 3475 | $temp_array['owner_count'] = $row['owner_count']; |
@@ -3487,9 +3487,9 @@ discard block |
||
| 3487 | 3487 | */ |
| 3488 | 3488 | public function countAllAirlinesByAircraft($aircraft_icao) |
| 3489 | 3489 | { |
| 3490 | - $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
|
| 3490 | + $aircraft_icao = filter_var($aircraft_icao, FILTER_SANITIZE_STRING); |
|
| 3491 | 3491 | |
| 3492 | - $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
|
| 3492 | + $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
|
| 3493 | 3493 | FROM spotter_output |
| 3494 | 3494 | WHERE spotter_output.airline_name <> '' AND spotter_output.aircraft_icao = :aircraft_icao |
| 3495 | 3495 | GROUP BY spotter_output.airline_name |
@@ -3502,7 +3502,7 @@ discard block |
||
| 3502 | 3502 | $airline_array = array(); |
| 3503 | 3503 | $temp_array = array(); |
| 3504 | 3504 | |
| 3505 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3505 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3506 | 3506 | { |
| 3507 | 3507 | $temp_array['airline_name'] = $row['airline_name']; |
| 3508 | 3508 | $temp_array['airline_icao'] = $row['airline_icao']; |
@@ -3524,9 +3524,9 @@ discard block |
||
| 3524 | 3524 | */ |
| 3525 | 3525 | public function countAllAirlineCountriesByAircraft($aircraft_icao) |
| 3526 | 3526 | { |
| 3527 | - $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
|
| 3527 | + $aircraft_icao = filter_var($aircraft_icao, FILTER_SANITIZE_STRING); |
|
| 3528 | 3528 | |
| 3529 | - $query = "SELECT DISTINCT spotter_output.airline_country, COUNT(spotter_output.airline_country) AS airline_country_count |
|
| 3529 | + $query = "SELECT DISTINCT spotter_output.airline_country, COUNT(spotter_output.airline_country) AS airline_country_count |
|
| 3530 | 3530 | FROM spotter_output |
| 3531 | 3531 | WHERE spotter_output.airline_country <> '' AND spotter_output.aircraft_icao = :aircraft_icao |
| 3532 | 3532 | GROUP BY spotter_output.airline_country |
@@ -3540,7 +3540,7 @@ discard block |
||
| 3540 | 3540 | $airline_country_array = array(); |
| 3541 | 3541 | $temp_array = array(); |
| 3542 | 3542 | |
| 3543 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3543 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3544 | 3544 | { |
| 3545 | 3545 | $temp_array['airline_country_count'] = $row['airline_country_count']; |
| 3546 | 3546 | $temp_array['airline_country'] = $row['airline_country']; |
@@ -3561,9 +3561,9 @@ discard block |
||
| 3561 | 3561 | */ |
| 3562 | 3562 | public function countAllAirlinesByAirport($airport_icao) |
| 3563 | 3563 | { |
| 3564 | - $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
|
| 3564 | + $airport_icao = filter_var($airport_icao, FILTER_SANITIZE_STRING); |
|
| 3565 | 3565 | |
| 3566 | - $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
|
| 3566 | + $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
|
| 3567 | 3567 | FROM spotter_output |
| 3568 | 3568 | WHERE spotter_output.airline_name <> '' AND (spotter_output.departure_airport_icao = :airport_icao OR spotter_output.arrival_airport_icao = :airport_icao ) |
| 3569 | 3569 | GROUP BY spotter_output.airline_name |
@@ -3576,7 +3576,7 @@ discard block |
||
| 3576 | 3576 | $airline_array = array(); |
| 3577 | 3577 | $temp_array = array(); |
| 3578 | 3578 | |
| 3579 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3579 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3580 | 3580 | { |
| 3581 | 3581 | $temp_array['airline_name'] = $row['airline_name']; |
| 3582 | 3582 | $temp_array['airline_icao'] = $row['airline_icao']; |
@@ -3597,9 +3597,9 @@ discard block |
||
| 3597 | 3597 | */ |
| 3598 | 3598 | public function countAllAirlineCountriesByAirport($airport_icao) |
| 3599 | 3599 | { |
| 3600 | - $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
|
| 3600 | + $airport_icao = filter_var($airport_icao, FILTER_SANITIZE_STRING); |
|
| 3601 | 3601 | |
| 3602 | - $query = "SELECT DISTINCT spotter_output.airline_country, COUNT(spotter_output.airline_country) AS airline_country_count |
|
| 3602 | + $query = "SELECT DISTINCT spotter_output.airline_country, COUNT(spotter_output.airline_country) AS airline_country_count |
|
| 3603 | 3603 | FROM spotter_output |
| 3604 | 3604 | WHERE spotter_output.airline_country <> '' AND (spotter_output.departure_airport_icao = :airport_icao OR spotter_output.arrival_airport_icao = :airport_icao ) |
| 3605 | 3605 | GROUP BY spotter_output.airline_country |
@@ -3613,7 +3613,7 @@ discard block |
||
| 3613 | 3613 | $airline_country_array = array(); |
| 3614 | 3614 | $temp_array = array(); |
| 3615 | 3615 | |
| 3616 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3616 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3617 | 3617 | { |
| 3618 | 3618 | $temp_array['airline_country_count'] = $row['airline_country_count']; |
| 3619 | 3619 | $temp_array['airline_country'] = $row['airline_country']; |
@@ -3632,9 +3632,9 @@ discard block |
||
| 3632 | 3632 | */ |
| 3633 | 3633 | public function countAllAirlinesByManufacturer($aircraft_manufacturer) |
| 3634 | 3634 | { |
| 3635 | - $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
|
| 3635 | + $aircraft_manufacturer = filter_var($aircraft_manufacturer, FILTER_SANITIZE_STRING); |
|
| 3636 | 3636 | |
| 3637 | - $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
|
| 3637 | + $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
|
| 3638 | 3638 | FROM spotter_output |
| 3639 | 3639 | WHERE spotter_output.aircraft_manufacturer = :aircraft_manufacturer |
| 3640 | 3640 | GROUP BY spotter_output.airline_name |
@@ -3646,7 +3646,7 @@ discard block |
||
| 3646 | 3646 | $airline_array = array(); |
| 3647 | 3647 | $temp_array = array(); |
| 3648 | 3648 | |
| 3649 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3649 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3650 | 3650 | { |
| 3651 | 3651 | $temp_array['airline_name'] = $row['airline_name']; |
| 3652 | 3652 | $temp_array['airline_icao'] = $row['airline_icao']; |
@@ -3668,9 +3668,9 @@ discard block |
||
| 3668 | 3668 | */ |
| 3669 | 3669 | public function countAllAirlineCountriesByManufacturer($aircraft_manufacturer) |
| 3670 | 3670 | { |
| 3671 | - $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
|
| 3671 | + $aircraft_manufacturer = filter_var($aircraft_manufacturer, FILTER_SANITIZE_STRING); |
|
| 3672 | 3672 | |
| 3673 | - $query = "SELECT DISTINCT spotter_output.airline_country, COUNT(spotter_output.airline_country) AS airline_country_count |
|
| 3673 | + $query = "SELECT DISTINCT spotter_output.airline_country, COUNT(spotter_output.airline_country) AS airline_country_count |
|
| 3674 | 3674 | FROM spotter_output |
| 3675 | 3675 | WHERE spotter_output.airline_country <> '' AND spotter_output.aircraft_manufacturer = :aircraft_manufacturer |
| 3676 | 3676 | GROUP BY spotter_output.airline_country |
@@ -3684,7 +3684,7 @@ discard block |
||
| 3684 | 3684 | $airline_country_array = array(); |
| 3685 | 3685 | $temp_array = array(); |
| 3686 | 3686 | |
| 3687 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3687 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3688 | 3688 | { |
| 3689 | 3689 | $temp_array['airline_country_count'] = $row['airline_country_count']; |
| 3690 | 3690 | $temp_array['airline_country'] = $row['airline_country']; |
@@ -3703,7 +3703,7 @@ discard block |
||
| 3703 | 3703 | public function countAllAirlinesByDate($date) |
| 3704 | 3704 | { |
| 3705 | 3705 | global $globalTimezone, $globalDBdriver; |
| 3706 | - $date = filter_var($date,FILTER_SANITIZE_STRING); |
|
| 3706 | + $date = filter_var($date, FILTER_SANITIZE_STRING); |
|
| 3707 | 3707 | |
| 3708 | 3708 | if ($globalTimezone != '') { |
| 3709 | 3709 | date_default_timezone_set($globalTimezone); |
@@ -3712,13 +3712,13 @@ discard block |
||
| 3712 | 3712 | } else $offset = '+00:00'; |
| 3713 | 3713 | |
| 3714 | 3714 | if ($globalDBdriver == 'mysql') { |
| 3715 | - $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
|
| 3715 | + $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
|
| 3716 | 3716 | FROM spotter_output |
| 3717 | 3717 | WHERE DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) = :date |
| 3718 | 3718 | GROUP BY spotter_output.airline_name |
| 3719 | 3719 | ORDER BY airline_count DESC"; |
| 3720 | 3720 | } else { |
| 3721 | - $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
|
| 3721 | + $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
|
| 3722 | 3722 | FROM spotter_output |
| 3723 | 3723 | WHERE to_char(spotter_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') = :date |
| 3724 | 3724 | GROUP BY spotter_output.airline_name |
@@ -3730,7 +3730,7 @@ discard block |
||
| 3730 | 3730 | |
| 3731 | 3731 | $airline_array = array(); |
| 3732 | 3732 | $temp_array = array(); |
| 3733 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3733 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3734 | 3734 | { |
| 3735 | 3735 | $temp_array['airline_name'] = $row['airline_name']; |
| 3736 | 3736 | $temp_array['airline_icao'] = $row['airline_icao']; |
@@ -3753,7 +3753,7 @@ discard block |
||
| 3753 | 3753 | public function countAllAirlineCountriesByDate($date) |
| 3754 | 3754 | { |
| 3755 | 3755 | global $globalTimezone, $globalDBdriver; |
| 3756 | - $date = filter_var($date,FILTER_SANITIZE_STRING); |
|
| 3756 | + $date = filter_var($date, FILTER_SANITIZE_STRING); |
|
| 3757 | 3757 | if ($globalTimezone != '') { |
| 3758 | 3758 | date_default_timezone_set($globalTimezone); |
| 3759 | 3759 | $datetime = new DateTime($date); |
@@ -3761,14 +3761,14 @@ discard block |
||
| 3761 | 3761 | } else $offset = '+00:00'; |
| 3762 | 3762 | |
| 3763 | 3763 | if ($globalDBdriver == 'mysql') { |
| 3764 | - $query = "SELECT DISTINCT spotter_output.airline_country, COUNT(spotter_output.airline_country) AS airline_country_count |
|
| 3764 | + $query = "SELECT DISTINCT spotter_output.airline_country, COUNT(spotter_output.airline_country) AS airline_country_count |
|
| 3765 | 3765 | FROM spotter_output |
| 3766 | 3766 | WHERE spotter_output.airline_country <> '' AND DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) = :date |
| 3767 | 3767 | GROUP BY spotter_output.airline_country |
| 3768 | 3768 | ORDER BY airline_country_count DESC |
| 3769 | 3769 | LIMIT 10 OFFSET 0"; |
| 3770 | 3770 | } else { |
| 3771 | - $query = "SELECT DISTINCT spotter_output.airline_country, COUNT(spotter_output.airline_country) AS airline_country_count |
|
| 3771 | + $query = "SELECT DISTINCT spotter_output.airline_country, COUNT(spotter_output.airline_country) AS airline_country_count |
|
| 3772 | 3772 | FROM spotter_output |
| 3773 | 3773 | WHERE spotter_output.airline_country <> '' AND to_char(spotter_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') = :date |
| 3774 | 3774 | GROUP BY spotter_output.airline_country |
@@ -3781,7 +3781,7 @@ discard block |
||
| 3781 | 3781 | |
| 3782 | 3782 | $airline_country_array = array(); |
| 3783 | 3783 | $temp_array = array(); |
| 3784 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3784 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3785 | 3785 | { |
| 3786 | 3786 | $temp_array['airline_country_count'] = $row['airline_country_count']; |
| 3787 | 3787 | $temp_array['airline_country'] = $row['airline_country']; |
@@ -3800,9 +3800,9 @@ discard block |
||
| 3800 | 3800 | */ |
| 3801 | 3801 | public function countAllAirlinesByIdent($ident) |
| 3802 | 3802 | { |
| 3803 | - $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
|
| 3803 | + $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
|
| 3804 | 3804 | |
| 3805 | - $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
|
| 3805 | + $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
|
| 3806 | 3806 | FROM spotter_output |
| 3807 | 3807 | WHERE spotter_output.ident = :ident |
| 3808 | 3808 | GROUP BY spotter_output.airline_name |
@@ -3815,7 +3815,7 @@ discard block |
||
| 3815 | 3815 | $airline_array = array(); |
| 3816 | 3816 | $temp_array = array(); |
| 3817 | 3817 | |
| 3818 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3818 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3819 | 3819 | { |
| 3820 | 3820 | $temp_array['airline_name'] = $row['airline_name']; |
| 3821 | 3821 | $temp_array['airline_icao'] = $row['airline_icao']; |
@@ -3835,10 +3835,10 @@ discard block |
||
| 3835 | 3835 | */ |
| 3836 | 3836 | public function countAllAirlinesByRoute($departure_airport_icao, $arrival_airport_icao) |
| 3837 | 3837 | { |
| 3838 | - $departure_airport_icao = filter_var($departure_airport_icao,FILTER_SANITIZE_STRING); |
|
| 3839 | - $arrival_airport_icao = filter_var($arrival_airport_icao,FILTER_SANITIZE_STRING); |
|
| 3838 | + $departure_airport_icao = filter_var($departure_airport_icao, FILTER_SANITIZE_STRING); |
|
| 3839 | + $arrival_airport_icao = filter_var($arrival_airport_icao, FILTER_SANITIZE_STRING); |
|
| 3840 | 3840 | |
| 3841 | - $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
|
| 3841 | + $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
|
| 3842 | 3842 | FROM spotter_output |
| 3843 | 3843 | WHERE (spotter_output.departure_airport_icao = :departure_airport_icao) AND (spotter_output.arrival_airport_icao = :arrival_airport_icao) |
| 3844 | 3844 | GROUP BY spotter_output.airline_name |
@@ -3846,12 +3846,12 @@ discard block |
||
| 3846 | 3846 | |
| 3847 | 3847 | |
| 3848 | 3848 | $sth = $this->db->prepare($query); |
| 3849 | - $sth->execute(array(':departure_airport_icao' => $departure_airport_icao,':arrival_airport_icao' => $arrival_airport_icao)); |
|
| 3849 | + $sth->execute(array(':departure_airport_icao' => $departure_airport_icao, ':arrival_airport_icao' => $arrival_airport_icao)); |
|
| 3850 | 3850 | |
| 3851 | 3851 | $airline_array = array(); |
| 3852 | 3852 | $temp_array = array(); |
| 3853 | 3853 | |
| 3854 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3854 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3855 | 3855 | { |
| 3856 | 3856 | $temp_array['airline_name'] = $row['airline_name']; |
| 3857 | 3857 | $temp_array['airline_icao'] = $row['airline_icao']; |
@@ -3871,10 +3871,10 @@ discard block |
||
| 3871 | 3871 | */ |
| 3872 | 3872 | public function countAllAirlineCountriesByRoute($departure_airport_icao, $arrival_airport_icao) |
| 3873 | 3873 | { |
| 3874 | - $departure_airport_icao = filter_var($departure_airport_icao,FILTER_SANITIZE_STRING); |
|
| 3875 | - $arrival_airport_icao = filter_var($arrival_airport_icao,FILTER_SANITIZE_STRING); |
|
| 3874 | + $departure_airport_icao = filter_var($departure_airport_icao, FILTER_SANITIZE_STRING); |
|
| 3875 | + $arrival_airport_icao = filter_var($arrival_airport_icao, FILTER_SANITIZE_STRING); |
|
| 3876 | 3876 | |
| 3877 | - $query = "SELECT DISTINCT spotter_output.airline_country, COUNT(spotter_output.airline_country) AS airline_country_count |
|
| 3877 | + $query = "SELECT DISTINCT spotter_output.airline_country, COUNT(spotter_output.airline_country) AS airline_country_count |
|
| 3878 | 3878 | FROM spotter_output |
| 3879 | 3879 | WHERE spotter_output.airline_country <> '' AND (spotter_output.departure_airport_icao = :departure_airport_icao) AND (spotter_output.arrival_airport_icao = :arrival_airport_icao) |
| 3880 | 3880 | GROUP BY spotter_output.airline_country |
@@ -3883,11 +3883,11 @@ discard block |
||
| 3883 | 3883 | |
| 3884 | 3884 | |
| 3885 | 3885 | $sth = $this->db->prepare($query); |
| 3886 | - $sth->execute(array(':departure_airport_icao' => $departure_airport_icao,':arrival_airport_icao' => $arrival_airport_icao)); |
|
| 3886 | + $sth->execute(array(':departure_airport_icao' => $departure_airport_icao, ':arrival_airport_icao' => $arrival_airport_icao)); |
|
| 3887 | 3887 | |
| 3888 | 3888 | $airline_country_array = array(); |
| 3889 | 3889 | $temp_array = array(); |
| 3890 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3890 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3891 | 3891 | { |
| 3892 | 3892 | $temp_array['airline_country_count'] = $row['airline_country_count']; |
| 3893 | 3893 | $temp_array['airline_country'] = $row['airline_country']; |
@@ -3907,9 +3907,9 @@ discard block |
||
| 3907 | 3907 | */ |
| 3908 | 3908 | public function countAllAirlinesByCountry($country) |
| 3909 | 3909 | { |
| 3910 | - $country = filter_var($country,FILTER_SANITIZE_STRING); |
|
| 3910 | + $country = filter_var($country, FILTER_SANITIZE_STRING); |
|
| 3911 | 3911 | |
| 3912 | - $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
|
| 3912 | + $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
|
| 3913 | 3913 | FROM spotter_output |
| 3914 | 3914 | WHERE ((spotter_output.departure_airport_country = :country) OR (spotter_output.arrival_airport_country = :country)) OR spotter_output.airline_country = :country |
| 3915 | 3915 | GROUP BY spotter_output.airline_name |
@@ -3921,7 +3921,7 @@ discard block |
||
| 3921 | 3921 | |
| 3922 | 3922 | $airline_array = array(); |
| 3923 | 3923 | $temp_array = array(); |
| 3924 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3924 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3925 | 3925 | { |
| 3926 | 3926 | $temp_array['airline_name'] = $row['airline_name']; |
| 3927 | 3927 | $temp_array['airline_icao'] = $row['airline_icao']; |
@@ -3942,9 +3942,9 @@ discard block |
||
| 3942 | 3942 | */ |
| 3943 | 3943 | public function countAllAirlineCountriesByCountry($country) |
| 3944 | 3944 | { |
| 3945 | - $country = filter_var($country,FILTER_SANITIZE_STRING); |
|
| 3945 | + $country = filter_var($country, FILTER_SANITIZE_STRING); |
|
| 3946 | 3946 | |
| 3947 | - $query = "SELECT DISTINCT spotter_output.airline_country, COUNT(spotter_output.airline_country) AS airline_country_count |
|
| 3947 | + $query = "SELECT DISTINCT spotter_output.airline_country, COUNT(spotter_output.airline_country) AS airline_country_count |
|
| 3948 | 3948 | FROM spotter_output |
| 3949 | 3949 | WHERE spotter_output.airline_country <> '' AND ((spotter_output.departure_airport_country = :country) OR (spotter_output.arrival_airport_country = :country)) OR spotter_output.airline_country = :country |
| 3950 | 3950 | GROUP BY spotter_output.airline_country |
@@ -3957,7 +3957,7 @@ discard block |
||
| 3957 | 3957 | |
| 3958 | 3958 | $airline_country_array = array(); |
| 3959 | 3959 | $temp_array = array(); |
| 3960 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3960 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3961 | 3961 | { |
| 3962 | 3962 | $temp_array['airline_country_count'] = $row['airline_country_count']; |
| 3963 | 3963 | $temp_array['airline_country'] = $row['airline_country']; |
@@ -3976,7 +3976,7 @@ discard block |
||
| 3976 | 3976 | */ |
| 3977 | 3977 | public function countAllAirlineCountries($limit = true) |
| 3978 | 3978 | { |
| 3979 | - $query = "SELECT DISTINCT spotter_output.airline_country, COUNT(spotter_output.airline_country) AS airline_country_count |
|
| 3979 | + $query = "SELECT DISTINCT spotter_output.airline_country, COUNT(spotter_output.airline_country) AS airline_country_count |
|
| 3980 | 3980 | FROM spotter_output |
| 3981 | 3981 | WHERE spotter_output.airline_country <> '' AND spotter_output.airline_country <> 'NA' |
| 3982 | 3982 | GROUP BY spotter_output.airline_country |
@@ -3988,7 +3988,7 @@ discard block |
||
| 3988 | 3988 | |
| 3989 | 3989 | $airline_array = array(); |
| 3990 | 3990 | $temp_array = array(); |
| 3991 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3991 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3992 | 3992 | { |
| 3993 | 3993 | $temp_array['airline_country_count'] = $row['airline_country_count']; |
| 3994 | 3994 | $temp_array['airline_country'] = $row['airline_country']; |
@@ -4004,7 +4004,7 @@ discard block |
||
| 4004 | 4004 | * @return Array the airline country list |
| 4005 | 4005 | * |
| 4006 | 4006 | */ |
| 4007 | - public function countAllFlightOverCountries($limit = true,$olderthanmonths = 0,$sincedate = '') |
|
| 4007 | + public function countAllFlightOverCountries($limit = true, $olderthanmonths = 0, $sincedate = '') |
|
| 4008 | 4008 | { |
| 4009 | 4009 | global $globalDBdriver; |
| 4010 | 4010 | /* |
@@ -4033,7 +4033,7 @@ discard block |
||
| 4033 | 4033 | $flight_array = array(); |
| 4034 | 4034 | $temp_array = array(); |
| 4035 | 4035 | |
| 4036 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4036 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4037 | 4037 | { |
| 4038 | 4038 | $temp_array['flight_count'] = $row['nb']; |
| 4039 | 4039 | $temp_array['flight_country'] = $row['name']; |
@@ -4051,10 +4051,10 @@ discard block |
||
| 4051 | 4051 | * @return Array the aircraft list |
| 4052 | 4052 | * |
| 4053 | 4053 | */ |
| 4054 | - public function countAllAircraftTypes($limit = true,$olderthanmonths = 0,$sincedate = '') |
|
| 4054 | + public function countAllAircraftTypes($limit = true, $olderthanmonths = 0, $sincedate = '') |
|
| 4055 | 4055 | { |
| 4056 | 4056 | global $globalDBdriver; |
| 4057 | - $query = "SELECT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name |
|
| 4057 | + $query = "SELECT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name |
|
| 4058 | 4058 | FROM spotter_output |
| 4059 | 4059 | WHERE spotter_output.aircraft_name <> '' AND spotter_output.aircraft_icao <> '' "; |
| 4060 | 4060 | if ($olderthanmonths > 0) { |
@@ -4084,7 +4084,7 @@ discard block |
||
| 4084 | 4084 | $aircraft_array = array(); |
| 4085 | 4085 | $temp_array = array(); |
| 4086 | 4086 | |
| 4087 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4087 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4088 | 4088 | { |
| 4089 | 4089 | $temp_array['aircraft_icao'] = $row['aircraft_icao']; |
| 4090 | 4090 | $temp_array['aircraft_name'] = $row['aircraft_name']; |
@@ -4105,9 +4105,9 @@ discard block |
||
| 4105 | 4105 | public function countAllAircraftRegistrationByAircraft($aircraft_icao) |
| 4106 | 4106 | { |
| 4107 | 4107 | $Image = new Image($this->db); |
| 4108 | - $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
|
| 4108 | + $aircraft_icao = filter_var($aircraft_icao, FILTER_SANITIZE_STRING); |
|
| 4109 | 4109 | |
| 4110 | - $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 |
|
| 4110 | + $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 |
|
| 4111 | 4111 | FROM spotter_output |
| 4112 | 4112 | WHERE spotter_output.registration <> '' AND spotter_output.aircraft_icao = :aircraft_icao |
| 4113 | 4113 | GROUP BY spotter_output.registration |
@@ -4119,14 +4119,14 @@ discard block |
||
| 4119 | 4119 | $aircraft_array = array(); |
| 4120 | 4120 | $temp_array = array(); |
| 4121 | 4121 | |
| 4122 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4122 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4123 | 4123 | { |
| 4124 | 4124 | $temp_array['aircraft_icao'] = $row['aircraft_icao']; |
| 4125 | 4125 | $temp_array['aircraft_name'] = $row['aircraft_name']; |
| 4126 | 4126 | $temp_array['registration'] = $row['registration']; |
| 4127 | 4127 | $temp_array['airline_name'] = $row['airline_name']; |
| 4128 | 4128 | $temp_array['image_thumbnail'] = ""; |
| 4129 | - if($row['registration'] != "") |
|
| 4129 | + if ($row['registration'] != "") |
|
| 4130 | 4130 | { |
| 4131 | 4131 | $image_array = $Image->getSpotterImage($row['registration']); |
| 4132 | 4132 | if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
@@ -4147,9 +4147,9 @@ discard block |
||
| 4147 | 4147 | */ |
| 4148 | 4148 | public function countAllAircraftTypesByAirline($airline_icao) |
| 4149 | 4149 | { |
| 4150 | - $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING); |
|
| 4150 | + $airline_icao = filter_var($airline_icao, FILTER_SANITIZE_STRING); |
|
| 4151 | 4151 | |
| 4152 | - $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name |
|
| 4152 | + $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name |
|
| 4153 | 4153 | FROM spotter_output |
| 4154 | 4154 | WHERE spotter_output.aircraft_icao <> '' AND spotter_output.airline_icao = :airline_icao |
| 4155 | 4155 | GROUP BY spotter_output.aircraft_name |
@@ -4161,7 +4161,7 @@ discard block |
||
| 4161 | 4161 | $aircraft_array = array(); |
| 4162 | 4162 | $temp_array = array(); |
| 4163 | 4163 | |
| 4164 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4164 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4165 | 4165 | { |
| 4166 | 4166 | $temp_array['aircraft_icao'] = $row['aircraft_icao']; |
| 4167 | 4167 | $temp_array['aircraft_name'] = $row['aircraft_name']; |
@@ -4182,9 +4182,9 @@ discard block |
||
| 4182 | 4182 | public function countAllAircraftRegistrationByAirline($airline_icao) |
| 4183 | 4183 | { |
| 4184 | 4184 | $Image = new Image($this->db); |
| 4185 | - $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING); |
|
| 4185 | + $airline_icao = filter_var($airline_icao, FILTER_SANITIZE_STRING); |
|
| 4186 | 4186 | |
| 4187 | - $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 |
|
| 4187 | + $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 |
|
| 4188 | 4188 | FROM spotter_output |
| 4189 | 4189 | WHERE spotter_output.registration <> '' AND spotter_output.airline_icao = :airline_icao |
| 4190 | 4190 | GROUP BY spotter_output.registration |
@@ -4195,14 +4195,14 @@ discard block |
||
| 4195 | 4195 | |
| 4196 | 4196 | $aircraft_array = array(); |
| 4197 | 4197 | $temp_array = array(); |
| 4198 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4198 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4199 | 4199 | { |
| 4200 | 4200 | $temp_array['aircraft_icao'] = $row['aircraft_icao']; |
| 4201 | 4201 | $temp_array['aircraft_name'] = $row['aircraft_name']; |
| 4202 | 4202 | $temp_array['registration'] = $row['registration']; |
| 4203 | 4203 | $temp_array['airline_name'] = $row['airline_name']; |
| 4204 | 4204 | $temp_array['image_thumbnail'] = ""; |
| 4205 | - if($row['registration'] != "") |
|
| 4205 | + if ($row['registration'] != "") |
|
| 4206 | 4206 | { |
| 4207 | 4207 | $image_array = $Image->getSpotterImage($row['registration']); |
| 4208 | 4208 | if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
@@ -4223,9 +4223,9 @@ discard block |
||
| 4223 | 4223 | */ |
| 4224 | 4224 | public function countAllAircraftManufacturerByAirline($airline_icao) |
| 4225 | 4225 | { |
| 4226 | - $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING); |
|
| 4226 | + $airline_icao = filter_var($airline_icao, FILTER_SANITIZE_STRING); |
|
| 4227 | 4227 | |
| 4228 | - $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
|
| 4228 | + $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
|
| 4229 | 4229 | FROM spotter_output |
| 4230 | 4230 | WHERE spotter_output.aircraft_manufacturer <> '' AND spotter_output.airline_icao = :airline_icao |
| 4231 | 4231 | GROUP BY spotter_output.aircraft_manufacturer |
@@ -4237,7 +4237,7 @@ discard block |
||
| 4237 | 4237 | $aircraft_array = array(); |
| 4238 | 4238 | $temp_array = array(); |
| 4239 | 4239 | |
| 4240 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4240 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4241 | 4241 | { |
| 4242 | 4242 | $temp_array['aircraft_manufacturer'] = $row['aircraft_manufacturer']; |
| 4243 | 4243 | $temp_array['aircraft_manufacturer_count'] = $row['aircraft_manufacturer_count']; |
@@ -4256,9 +4256,9 @@ discard block |
||
| 4256 | 4256 | */ |
| 4257 | 4257 | public function countAllAircraftTypesByAirport($airport_icao) |
| 4258 | 4258 | { |
| 4259 | - $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
|
| 4259 | + $airport_icao = filter_var($airport_icao, FILTER_SANITIZE_STRING); |
|
| 4260 | 4260 | |
| 4261 | - $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name |
|
| 4261 | + $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name |
|
| 4262 | 4262 | FROM spotter_output |
| 4263 | 4263 | WHERE spotter_output.aircraft_icao <> '' AND (spotter_output.departure_airport_icao = :airport_icao OR spotter_output.arrival_airport_icao = :airport_icao) |
| 4264 | 4264 | GROUP BY spotter_output.aircraft_name |
@@ -4269,7 +4269,7 @@ discard block |
||
| 4269 | 4269 | |
| 4270 | 4270 | $aircraft_array = array(); |
| 4271 | 4271 | $temp_array = array(); |
| 4272 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4272 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4273 | 4273 | { |
| 4274 | 4274 | $temp_array['aircraft_icao'] = $row['aircraft_icao']; |
| 4275 | 4275 | $temp_array['aircraft_name'] = $row['aircraft_name']; |
@@ -4290,9 +4290,9 @@ discard block |
||
| 4290 | 4290 | public function countAllAircraftRegistrationByAirport($airport_icao) |
| 4291 | 4291 | { |
| 4292 | 4292 | $Image = new Image($this->db); |
| 4293 | - $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
|
| 4293 | + $airport_icao = filter_var($airport_icao, FILTER_SANITIZE_STRING); |
|
| 4294 | 4294 | |
| 4295 | - $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 |
|
| 4295 | + $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 |
|
| 4296 | 4296 | FROM spotter_output |
| 4297 | 4297 | WHERE spotter_output.registration <> '' AND (spotter_output.departure_airport_icao = :airport_icao OR spotter_output.arrival_airport_icao = :airport_icao) |
| 4298 | 4298 | GROUP BY spotter_output.registration |
@@ -4304,14 +4304,14 @@ discard block |
||
| 4304 | 4304 | |
| 4305 | 4305 | $aircraft_array = array(); |
| 4306 | 4306 | $temp_array = array(); |
| 4307 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4307 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4308 | 4308 | { |
| 4309 | 4309 | $temp_array['aircraft_icao'] = $row['aircraft_icao']; |
| 4310 | 4310 | $temp_array['aircraft_name'] = $row['aircraft_name']; |
| 4311 | 4311 | $temp_array['registration'] = $row['registration']; |
| 4312 | 4312 | $temp_array['airline_name'] = $row['airline_name']; |
| 4313 | 4313 | $temp_array['image_thumbnail'] = ""; |
| 4314 | - if($row['registration'] != "") |
|
| 4314 | + if ($row['registration'] != "") |
|
| 4315 | 4315 | { |
| 4316 | 4316 | $image_array = $Image->getSpotterImage($row['registration']); |
| 4317 | 4317 | $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
@@ -4331,9 +4331,9 @@ discard block |
||
| 4331 | 4331 | */ |
| 4332 | 4332 | public function countAllAircraftManufacturerByAirport($airport_icao) |
| 4333 | 4333 | { |
| 4334 | - $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
|
| 4334 | + $airport_icao = filter_var($airport_icao, FILTER_SANITIZE_STRING); |
|
| 4335 | 4335 | |
| 4336 | - $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
|
| 4336 | + $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
|
| 4337 | 4337 | FROM spotter_output |
| 4338 | 4338 | WHERE spotter_output.aircraft_manufacturer <> '' AND (spotter_output.departure_airport_icao = :airport_icao OR spotter_output.arrival_airport_icao = :airport_icao) |
| 4339 | 4339 | GROUP BY spotter_output.aircraft_manufacturer |
@@ -4345,7 +4345,7 @@ discard block |
||
| 4345 | 4345 | |
| 4346 | 4346 | $aircraft_array = array(); |
| 4347 | 4347 | $temp_array = array(); |
| 4348 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4348 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4349 | 4349 | { |
| 4350 | 4350 | $temp_array['aircraft_manufacturer'] = $row['aircraft_manufacturer']; |
| 4351 | 4351 | $temp_array['aircraft_manufacturer_count'] = $row['aircraft_manufacturer_count']; |
@@ -4362,9 +4362,9 @@ discard block |
||
| 4362 | 4362 | */ |
| 4363 | 4363 | public function countAllAircraftTypesByManufacturer($aircraft_manufacturer) |
| 4364 | 4364 | { |
| 4365 | - $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
|
| 4365 | + $aircraft_manufacturer = filter_var($aircraft_manufacturer, FILTER_SANITIZE_STRING); |
|
| 4366 | 4366 | |
| 4367 | - $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name |
|
| 4367 | + $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name |
|
| 4368 | 4368 | FROM spotter_output |
| 4369 | 4369 | WHERE spotter_output.aircraft_manufacturer = :aircraft_manufacturer |
| 4370 | 4370 | GROUP BY spotter_output.aircraft_name |
@@ -4374,7 +4374,7 @@ discard block |
||
| 4374 | 4374 | $sth->execute(array(':aircraft_manufacturer' => $aircraft_manufacturer)); |
| 4375 | 4375 | $aircraft_array = array(); |
| 4376 | 4376 | $temp_array = array(); |
| 4377 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4377 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4378 | 4378 | { |
| 4379 | 4379 | $temp_array['aircraft_icao'] = $row['aircraft_icao']; |
| 4380 | 4380 | $temp_array['aircraft_name'] = $row['aircraft_name']; |
@@ -4394,9 +4394,9 @@ discard block |
||
| 4394 | 4394 | public function countAllAircraftRegistrationByManufacturer($aircraft_manufacturer) |
| 4395 | 4395 | { |
| 4396 | 4396 | $Image = new Image($this->db); |
| 4397 | - $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
|
| 4397 | + $aircraft_manufacturer = filter_var($aircraft_manufacturer, FILTER_SANITIZE_STRING); |
|
| 4398 | 4398 | |
| 4399 | - $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 |
|
| 4399 | + $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 |
|
| 4400 | 4400 | FROM spotter_output |
| 4401 | 4401 | WHERE spotter_output.registration <> '' AND spotter_output.aircraft_manufacturer = :aircraft_manufacturer |
| 4402 | 4402 | GROUP BY spotter_output.registration |
@@ -4407,14 +4407,14 @@ discard block |
||
| 4407 | 4407 | $sth->execute(array(':aircraft_manufacturer' => $aircraft_manufacturer)); |
| 4408 | 4408 | $aircraft_array = array(); |
| 4409 | 4409 | $temp_array = array(); |
| 4410 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4410 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4411 | 4411 | { |
| 4412 | 4412 | $temp_array['aircraft_icao'] = $row['aircraft_icao']; |
| 4413 | 4413 | $temp_array['aircraft_name'] = $row['aircraft_name']; |
| 4414 | 4414 | $temp_array['registration'] = $row['registration']; |
| 4415 | 4415 | $temp_array['airline_name'] = $row['airline_name']; |
| 4416 | 4416 | $temp_array['image_thumbnail'] = ""; |
| 4417 | - if($row['registration'] != "") |
|
| 4417 | + if ($row['registration'] != "") |
|
| 4418 | 4418 | { |
| 4419 | 4419 | $image_array = $Image->getSpotterImage($row['registration']); |
| 4420 | 4420 | $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
@@ -4434,7 +4434,7 @@ discard block |
||
| 4434 | 4434 | public function countAllAircraftTypesByDate($date) |
| 4435 | 4435 | { |
| 4436 | 4436 | global $globalTimezone, $globalDBdriver; |
| 4437 | - $date = filter_var($date,FILTER_SANITIZE_STRING); |
|
| 4437 | + $date = filter_var($date, FILTER_SANITIZE_STRING); |
|
| 4438 | 4438 | if ($globalTimezone != '') { |
| 4439 | 4439 | date_default_timezone_set($globalTimezone); |
| 4440 | 4440 | $datetime = new DateTime($date); |
@@ -4442,13 +4442,13 @@ discard block |
||
| 4442 | 4442 | } else $offset = '+00:00'; |
| 4443 | 4443 | |
| 4444 | 4444 | if ($globalDBdriver == 'mysql') { |
| 4445 | - $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name |
|
| 4445 | + $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name |
|
| 4446 | 4446 | FROM spotter_output |
| 4447 | 4447 | WHERE DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) = :date |
| 4448 | 4448 | GROUP BY spotter_output.aircraft_name |
| 4449 | 4449 | ORDER BY aircraft_icao_count DESC"; |
| 4450 | 4450 | } else { |
| 4451 | - $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name |
|
| 4451 | + $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name |
|
| 4452 | 4452 | FROM spotter_output |
| 4453 | 4453 | WHERE to_char(spotter_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') = :date |
| 4454 | 4454 | GROUP BY spotter_output.aircraft_name |
@@ -4460,7 +4460,7 @@ discard block |
||
| 4460 | 4460 | |
| 4461 | 4461 | $aircraft_array = array(); |
| 4462 | 4462 | $temp_array = array(); |
| 4463 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4463 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4464 | 4464 | { |
| 4465 | 4465 | $temp_array['aircraft_icao'] = $row['aircraft_icao']; |
| 4466 | 4466 | $temp_array['aircraft_name'] = $row['aircraft_name']; |
@@ -4482,7 +4482,7 @@ discard block |
||
| 4482 | 4482 | { |
| 4483 | 4483 | global $globalTimezone, $globalDBdriver; |
| 4484 | 4484 | $Image = new Image($this->db); |
| 4485 | - $date = filter_var($date,FILTER_SANITIZE_STRING); |
|
| 4485 | + $date = filter_var($date, FILTER_SANITIZE_STRING); |
|
| 4486 | 4486 | if ($globalTimezone != '') { |
| 4487 | 4487 | date_default_timezone_set($globalTimezone); |
| 4488 | 4488 | $datetime = new DateTime($date); |
@@ -4490,13 +4490,13 @@ discard block |
||
| 4490 | 4490 | } else $offset = '+00:00'; |
| 4491 | 4491 | |
| 4492 | 4492 | if ($globalDBdriver == 'mysql') { |
| 4493 | - $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 |
|
| 4493 | + $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 |
|
| 4494 | 4494 | FROM spotter_output |
| 4495 | 4495 | WHERE spotter_output.registration <> '' AND DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) = :date |
| 4496 | 4496 | GROUP BY spotter_output.registration |
| 4497 | 4497 | ORDER BY registration_count DESC"; |
| 4498 | 4498 | } else { |
| 4499 | - $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 |
|
| 4499 | + $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 |
|
| 4500 | 4500 | FROM spotter_output |
| 4501 | 4501 | WHERE spotter_output.registration <> '' AND to_char(spotter_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') = :date |
| 4502 | 4502 | GROUP BY spotter_output.registration |
@@ -4508,14 +4508,14 @@ discard block |
||
| 4508 | 4508 | |
| 4509 | 4509 | $aircraft_array = array(); |
| 4510 | 4510 | $temp_array = array(); |
| 4511 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4511 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4512 | 4512 | { |
| 4513 | 4513 | $temp_array['aircraft_icao'] = $row['aircraft_icao']; |
| 4514 | 4514 | $temp_array['aircraft_name'] = $row['aircraft_name']; |
| 4515 | 4515 | $temp_array['registration'] = $row['registration']; |
| 4516 | 4516 | $temp_array['airline_name'] = $row['airline_name']; |
| 4517 | 4517 | $temp_array['image_thumbnail'] = ""; |
| 4518 | - if($row['registration'] != "") |
|
| 4518 | + if ($row['registration'] != "") |
|
| 4519 | 4519 | { |
| 4520 | 4520 | $image_array = $Image->getSpotterImage($row['registration']); |
| 4521 | 4521 | $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
@@ -4537,7 +4537,7 @@ discard block |
||
| 4537 | 4537 | public function countAllAircraftManufacturerByDate($date) |
| 4538 | 4538 | { |
| 4539 | 4539 | global $globalTimezone, $globalDBdriver; |
| 4540 | - $date = filter_var($date,FILTER_SANITIZE_STRING); |
|
| 4540 | + $date = filter_var($date, FILTER_SANITIZE_STRING); |
|
| 4541 | 4541 | if ($globalTimezone != '') { |
| 4542 | 4542 | date_default_timezone_set($globalTimezone); |
| 4543 | 4543 | $datetime = new DateTime($date); |
@@ -4545,13 +4545,13 @@ discard block |
||
| 4545 | 4545 | } else $offset = '+00:00'; |
| 4546 | 4546 | |
| 4547 | 4547 | if ($globalDBdriver == 'mysql') { |
| 4548 | - $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
|
| 4548 | + $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
|
| 4549 | 4549 | FROM spotter_output |
| 4550 | 4550 | WHERE spotter_output.aircraft_manufacturer <> '' AND DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) = :date |
| 4551 | 4551 | GROUP BY spotter_output.aircraft_manufacturer |
| 4552 | 4552 | ORDER BY aircraft_manufacturer_count DESC"; |
| 4553 | 4553 | } else { |
| 4554 | - $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
|
| 4554 | + $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
|
| 4555 | 4555 | FROM spotter_output |
| 4556 | 4556 | WHERE spotter_output.aircraft_manufacturer <> '' AND to_char(spotter_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') = :date |
| 4557 | 4557 | GROUP BY spotter_output.aircraft_manufacturer |
@@ -4564,7 +4564,7 @@ discard block |
||
| 4564 | 4564 | $aircraft_array = array(); |
| 4565 | 4565 | $temp_array = array(); |
| 4566 | 4566 | |
| 4567 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4567 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4568 | 4568 | { |
| 4569 | 4569 | $temp_array['aircraft_manufacturer'] = $row['aircraft_manufacturer']; |
| 4570 | 4570 | $temp_array['aircraft_manufacturer_count'] = $row['aircraft_manufacturer_count']; |
@@ -4583,9 +4583,9 @@ discard block |
||
| 4583 | 4583 | */ |
| 4584 | 4584 | public function countAllAircraftTypesByIdent($ident) |
| 4585 | 4585 | { |
| 4586 | - $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
|
| 4586 | + $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
|
| 4587 | 4587 | |
| 4588 | - $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name |
|
| 4588 | + $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name |
|
| 4589 | 4589 | FROM spotter_output |
| 4590 | 4590 | WHERE spotter_output.ident = :ident |
| 4591 | 4591 | GROUP BY spotter_output.aircraft_name, spotter_output.aircraft_icao |
@@ -4597,7 +4597,7 @@ discard block |
||
| 4597 | 4597 | $aircraft_array = array(); |
| 4598 | 4598 | $temp_array = array(); |
| 4599 | 4599 | |
| 4600 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4600 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4601 | 4601 | { |
| 4602 | 4602 | $temp_array['aircraft_icao'] = $row['aircraft_icao']; |
| 4603 | 4603 | $temp_array['aircraft_name'] = $row['aircraft_name']; |
@@ -4618,9 +4618,9 @@ discard block |
||
| 4618 | 4618 | public function countAllAircraftRegistrationByIdent($ident) |
| 4619 | 4619 | { |
| 4620 | 4620 | $Image = new Image($this->db); |
| 4621 | - $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
|
| 4621 | + $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
|
| 4622 | 4622 | |
| 4623 | - $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 |
|
| 4623 | + $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 |
|
| 4624 | 4624 | FROM spotter_output |
| 4625 | 4625 | WHERE spotter_output.registration <> '' AND spotter_output.ident = :ident |
| 4626 | 4626 | GROUP BY spotter_output.registration,spotter_output.aircraft_icao, spotter_output.aircraft_name, spotter_output.airline_name |
@@ -4633,14 +4633,14 @@ discard block |
||
| 4633 | 4633 | $aircraft_array = array(); |
| 4634 | 4634 | $temp_array = array(); |
| 4635 | 4635 | |
| 4636 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4636 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4637 | 4637 | { |
| 4638 | 4638 | $temp_array['aircraft_icao'] = $row['aircraft_icao']; |
| 4639 | 4639 | $temp_array['aircraft_name'] = $row['aircraft_name']; |
| 4640 | 4640 | $temp_array['registration'] = $row['registration']; |
| 4641 | 4641 | $temp_array['airline_name'] = $row['airline_name']; |
| 4642 | 4642 | $temp_array['image_thumbnail'] = ""; |
| 4643 | - if($row['registration'] != "") |
|
| 4643 | + if ($row['registration'] != "") |
|
| 4644 | 4644 | { |
| 4645 | 4645 | $image_array = $Image->getSpotterImage($row['registration']); |
| 4646 | 4646 | if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
@@ -4661,9 +4661,9 @@ discard block |
||
| 4661 | 4661 | */ |
| 4662 | 4662 | public function countAllAircraftManufacturerByIdent($ident) |
| 4663 | 4663 | { |
| 4664 | - $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
|
| 4664 | + $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
|
| 4665 | 4665 | |
| 4666 | - $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
|
| 4666 | + $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
|
| 4667 | 4667 | FROM spotter_output |
| 4668 | 4668 | WHERE spotter_output.aircraft_manufacturer <> '' AND spotter_output.ident = :ident |
| 4669 | 4669 | GROUP BY spotter_output.aircraft_manufacturer |
@@ -4674,7 +4674,7 @@ discard block |
||
| 4674 | 4674 | $sth->execute(array(':ident' => $ident)); |
| 4675 | 4675 | $aircraft_array = array(); |
| 4676 | 4676 | $temp_array = array(); |
| 4677 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4677 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4678 | 4678 | { |
| 4679 | 4679 | $temp_array['aircraft_manufacturer'] = $row['aircraft_manufacturer']; |
| 4680 | 4680 | $temp_array['aircraft_manufacturer_count'] = $row['aircraft_manufacturer_count']; |
@@ -4692,11 +4692,11 @@ discard block |
||
| 4692 | 4692 | */ |
| 4693 | 4693 | public function countAllAircraftTypesByRoute($departure_airport_icao, $arrival_airport_icao) |
| 4694 | 4694 | { |
| 4695 | - $departure_airport_icao = filter_var($departure_airport_icao,FILTER_SANITIZE_STRING); |
|
| 4696 | - $arrival_airport_icao = filter_var($arrival_airport_icao,FILTER_SANITIZE_STRING); |
|
| 4695 | + $departure_airport_icao = filter_var($departure_airport_icao, FILTER_SANITIZE_STRING); |
|
| 4696 | + $arrival_airport_icao = filter_var($arrival_airport_icao, FILTER_SANITIZE_STRING); |
|
| 4697 | 4697 | |
| 4698 | 4698 | |
| 4699 | - $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name |
|
| 4699 | + $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name |
|
| 4700 | 4700 | FROM spotter_output |
| 4701 | 4701 | WHERE (spotter_output.departure_airport_icao = :departure_airport_icao) AND (spotter_output.arrival_airport_icao = :arrival_airport_icao) |
| 4702 | 4702 | GROUP BY spotter_output.aircraft_name |
@@ -4704,10 +4704,10 @@ discard block |
||
| 4704 | 4704 | |
| 4705 | 4705 | |
| 4706 | 4706 | $sth = $this->db->prepare($query); |
| 4707 | - $sth->execute(array(':departure_airport_icao' => $departure_airport_icao,':arrival_airport_icao' => $arrival_airport_icao)); |
|
| 4707 | + $sth->execute(array(':departure_airport_icao' => $departure_airport_icao, ':arrival_airport_icao' => $arrival_airport_icao)); |
|
| 4708 | 4708 | $aircraft_array = array(); |
| 4709 | 4709 | $temp_array = array(); |
| 4710 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4710 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4711 | 4711 | { |
| 4712 | 4712 | $temp_array['aircraft_icao'] = $row['aircraft_icao']; |
| 4713 | 4713 | $temp_array['aircraft_name'] = $row['aircraft_name']; |
@@ -4726,10 +4726,10 @@ discard block |
||
| 4726 | 4726 | public function countAllAircraftRegistrationByRoute($departure_airport_icao, $arrival_airport_icao) |
| 4727 | 4727 | { |
| 4728 | 4728 | $Image = new Image($this->db); |
| 4729 | - $departure_airport_icao = filter_var($departure_airport_icao,FILTER_SANITIZE_STRING); |
|
| 4730 | - $arrival_airport_icao = filter_var($arrival_airport_icao,FILTER_SANITIZE_STRING); |
|
| 4729 | + $departure_airport_icao = filter_var($departure_airport_icao, FILTER_SANITIZE_STRING); |
|
| 4730 | + $arrival_airport_icao = filter_var($arrival_airport_icao, FILTER_SANITIZE_STRING); |
|
| 4731 | 4731 | |
| 4732 | - $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 |
|
| 4732 | + $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 |
|
| 4733 | 4733 | FROM spotter_output |
| 4734 | 4734 | WHERE spotter_output.registration <> '' AND (spotter_output.departure_airport_icao = :departure_airport_icao) AND (spotter_output.arrival_airport_icao = :arrival_airport_icao) |
| 4735 | 4735 | GROUP BY spotter_output.registration |
@@ -4737,19 +4737,19 @@ discard block |
||
| 4737 | 4737 | |
| 4738 | 4738 | |
| 4739 | 4739 | $sth = $this->db->prepare($query); |
| 4740 | - $sth->execute(array(':departure_airport_icao' => $departure_airport_icao,':arrival_airport_icao' => $arrival_airport_icao)); |
|
| 4740 | + $sth->execute(array(':departure_airport_icao' => $departure_airport_icao, ':arrival_airport_icao' => $arrival_airport_icao)); |
|
| 4741 | 4741 | |
| 4742 | 4742 | $aircraft_array = array(); |
| 4743 | 4743 | $temp_array = array(); |
| 4744 | 4744 | |
| 4745 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4745 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4746 | 4746 | { |
| 4747 | 4747 | $temp_array['aircraft_icao'] = $row['aircraft_icao']; |
| 4748 | 4748 | $temp_array['aircraft_name'] = $row['aircraft_name']; |
| 4749 | 4749 | $temp_array['registration'] = $row['registration']; |
| 4750 | 4750 | $temp_array['airline_name'] = $row['airline_name']; |
| 4751 | 4751 | $temp_array['image_thumbnail'] = ""; |
| 4752 | - if($row['registration'] != "") |
|
| 4752 | + if ($row['registration'] != "") |
|
| 4753 | 4753 | { |
| 4754 | 4754 | $image_array = $Image->getSpotterImage($row['registration']); |
| 4755 | 4755 | if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
@@ -4771,10 +4771,10 @@ discard block |
||
| 4771 | 4771 | */ |
| 4772 | 4772 | public function countAllAircraftManufacturerByRoute($departure_airport_icao, $arrival_airport_icao) |
| 4773 | 4773 | { |
| 4774 | - $departure_airport_icao = filter_var($departure_airport_icao,FILTER_SANITIZE_STRING); |
|
| 4775 | - $arrival_airport_icao = filter_var($arrival_airport_icao,FILTER_SANITIZE_STRING); |
|
| 4774 | + $departure_airport_icao = filter_var($departure_airport_icao, FILTER_SANITIZE_STRING); |
|
| 4775 | + $arrival_airport_icao = filter_var($arrival_airport_icao, FILTER_SANITIZE_STRING); |
|
| 4776 | 4776 | |
| 4777 | - $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
|
| 4777 | + $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
|
| 4778 | 4778 | FROM spotter_output |
| 4779 | 4779 | WHERE spotter_output.aircraft_manufacturer <> '' AND (spotter_output.departure_airport_icao = :departure_airport_icao) AND (spotter_output.arrival_airport_icao = :arrival_airport_icao) |
| 4780 | 4780 | GROUP BY spotter_output.aircraft_manufacturer |
@@ -4782,12 +4782,12 @@ discard block |
||
| 4782 | 4782 | |
| 4783 | 4783 | |
| 4784 | 4784 | $sth = $this->db->prepare($query); |
| 4785 | - $sth->execute(array(':departure_airport_icao' => $departure_airport_icao,':arrival_airport_icao' => $arrival_airport_icao)); |
|
| 4785 | + $sth->execute(array(':departure_airport_icao' => $departure_airport_icao, ':arrival_airport_icao' => $arrival_airport_icao)); |
|
| 4786 | 4786 | |
| 4787 | 4787 | $aircraft_array = array(); |
| 4788 | 4788 | $temp_array = array(); |
| 4789 | 4789 | |
| 4790 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4790 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4791 | 4791 | { |
| 4792 | 4792 | $temp_array['aircraft_manufacturer'] = $row['aircraft_manufacturer']; |
| 4793 | 4793 | $temp_array['aircraft_manufacturer_count'] = $row['aircraft_manufacturer_count']; |
@@ -4809,9 +4809,9 @@ discard block |
||
| 4809 | 4809 | */ |
| 4810 | 4810 | public function countAllAircraftTypesByCountry($country) |
| 4811 | 4811 | { |
| 4812 | - $country = filter_var($country,FILTER_SANITIZE_STRING); |
|
| 4812 | + $country = filter_var($country, FILTER_SANITIZE_STRING); |
|
| 4813 | 4813 | |
| 4814 | - $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name |
|
| 4814 | + $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name |
|
| 4815 | 4815 | FROM spotter_output |
| 4816 | 4816 | WHERE ((spotter_output.departure_airport_country = :country) OR (spotter_output.arrival_airport_country = :country)) OR spotter_output.airline_country = :country |
| 4817 | 4817 | GROUP BY spotter_output.aircraft_name |
@@ -4824,7 +4824,7 @@ discard block |
||
| 4824 | 4824 | $aircraft_array = array(); |
| 4825 | 4825 | $temp_array = array(); |
| 4826 | 4826 | |
| 4827 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4827 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4828 | 4828 | { |
| 4829 | 4829 | $temp_array['aircraft_icao'] = $row['aircraft_icao']; |
| 4830 | 4830 | $temp_array['aircraft_name'] = $row['aircraft_name']; |
@@ -4846,9 +4846,9 @@ discard block |
||
| 4846 | 4846 | public function countAllAircraftRegistrationByCountry($country) |
| 4847 | 4847 | { |
| 4848 | 4848 | $Image = new Image($this->db); |
| 4849 | - $country = filter_var($country,FILTER_SANITIZE_STRING); |
|
| 4849 | + $country = filter_var($country, FILTER_SANITIZE_STRING); |
|
| 4850 | 4850 | |
| 4851 | - $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 |
|
| 4851 | + $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 |
|
| 4852 | 4852 | FROM spotter_output |
| 4853 | 4853 | WHERE spotter_output.registration <> '' AND (((spotter_output.departure_airport_country = :country) OR (spotter_output.arrival_airport_country = :country)) OR spotter_output.airline_country = :country) |
| 4854 | 4854 | GROUP BY spotter_output.registration |
@@ -4861,14 +4861,14 @@ discard block |
||
| 4861 | 4861 | $aircraft_array = array(); |
| 4862 | 4862 | $temp_array = array(); |
| 4863 | 4863 | |
| 4864 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4864 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4865 | 4865 | { |
| 4866 | 4866 | $temp_array['aircraft_icao'] = $row['aircraft_icao']; |
| 4867 | 4867 | $temp_array['aircraft_name'] = $row['aircraft_name']; |
| 4868 | 4868 | $temp_array['registration'] = $row['registration']; |
| 4869 | 4869 | $temp_array['airline_name'] = $row['airline_name']; |
| 4870 | 4870 | $temp_array['image_thumbnail'] = ""; |
| 4871 | - if($row['registration'] != "") |
|
| 4871 | + if ($row['registration'] != "") |
|
| 4872 | 4872 | { |
| 4873 | 4873 | $image_array = $Image->getSpotterImage($row['registration']); |
| 4874 | 4874 | if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
@@ -4890,9 +4890,9 @@ discard block |
||
| 4890 | 4890 | */ |
| 4891 | 4891 | public function countAllAircraftManufacturerByCountry($country) |
| 4892 | 4892 | { |
| 4893 | - $country = filter_var($country,FILTER_SANITIZE_STRING); |
|
| 4893 | + $country = filter_var($country, FILTER_SANITIZE_STRING); |
|
| 4894 | 4894 | |
| 4895 | - $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
|
| 4895 | + $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
|
| 4896 | 4896 | FROM spotter_output |
| 4897 | 4897 | WHERE spotter_output.aircraft_manufacturer <> '' AND (((spotter_output.departure_airport_country = :country) OR (spotter_output.arrival_airport_country = :country)) OR spotter_output.airline_country = :country) |
| 4898 | 4898 | GROUP BY spotter_output.aircraft_manufacturer |
@@ -4905,7 +4905,7 @@ discard block |
||
| 4905 | 4905 | $aircraft_array = array(); |
| 4906 | 4906 | $temp_array = array(); |
| 4907 | 4907 | |
| 4908 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4908 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4909 | 4909 | { |
| 4910 | 4910 | $temp_array['aircraft_manufacturer'] = $row['aircraft_manufacturer']; |
| 4911 | 4911 | $temp_array['aircraft_manufacturer_count'] = $row['aircraft_manufacturer_count']; |
@@ -4926,7 +4926,7 @@ discard block |
||
| 4926 | 4926 | */ |
| 4927 | 4927 | public function countAllAircraftManufacturers() |
| 4928 | 4928 | { |
| 4929 | - $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
|
| 4929 | + $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
|
| 4930 | 4930 | FROM spotter_output |
| 4931 | 4931 | WHERE spotter_output.aircraft_manufacturer <> '' AND spotter_output.aircraft_manufacturer <> 'Not Available' |
| 4932 | 4932 | GROUP BY spotter_output.aircraft_manufacturer |
@@ -4940,7 +4940,7 @@ discard block |
||
| 4940 | 4940 | $manufacturer_array = array(); |
| 4941 | 4941 | $temp_array = array(); |
| 4942 | 4942 | |
| 4943 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4943 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4944 | 4944 | { |
| 4945 | 4945 | $temp_array['aircraft_manufacturer'] = $row['aircraft_manufacturer']; |
| 4946 | 4946 | $temp_array['aircraft_manufacturer_count'] = $row['aircraft_manufacturer_count']; |
@@ -4959,11 +4959,11 @@ discard block |
||
| 4959 | 4959 | * @return Array the aircraft list |
| 4960 | 4960 | * |
| 4961 | 4961 | */ |
| 4962 | - public function countAllAircraftRegistrations($limit = true,$olderthanmonths = 0,$sincedate = '') |
|
| 4962 | + public function countAllAircraftRegistrations($limit = true, $olderthanmonths = 0, $sincedate = '') |
|
| 4963 | 4963 | { |
| 4964 | 4964 | global $globalDBdriver; |
| 4965 | 4965 | $Image = new Image($this->db); |
| 4966 | - $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 |
|
| 4966 | + $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 |
|
| 4967 | 4967 | FROM spotter_output |
| 4968 | 4968 | WHERE spotter_output.registration <> '' AND spotter_output.registration <> 'NA' "; |
| 4969 | 4969 | if ($olderthanmonths > 0) { |
@@ -4992,7 +4992,7 @@ discard block |
||
| 4992 | 4992 | $aircraft_array = array(); |
| 4993 | 4993 | $temp_array = array(); |
| 4994 | 4994 | |
| 4995 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4995 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4996 | 4996 | { |
| 4997 | 4997 | $temp_array['registration'] = $row['registration']; |
| 4998 | 4998 | $temp_array['aircraft_registration_count'] = $row['aircraft_registration_count']; |
@@ -5000,7 +5000,7 @@ discard block |
||
| 5000 | 5000 | $temp_array['aircraft_name'] = $row['aircraft_name']; |
| 5001 | 5001 | $temp_array['airline_name'] = $row['airline_name']; |
| 5002 | 5002 | $temp_array['image_thumbnail'] = ""; |
| 5003 | - if($row['registration'] != "") |
|
| 5003 | + if ($row['registration'] != "") |
|
| 5004 | 5004 | { |
| 5005 | 5005 | $image_array = $Image->getSpotterImage($row['registration']); |
| 5006 | 5006 | if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
@@ -5024,7 +5024,7 @@ discard block |
||
| 5024 | 5024 | public function countAllDepartureAirports($limit = true, $olderthanmonths = 0, $sincedate = '') |
| 5025 | 5025 | { |
| 5026 | 5026 | global $globalDBdriver; |
| 5027 | - $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 |
|
| 5027 | + $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 |
|
| 5028 | 5028 | FROM spotter_output |
| 5029 | 5029 | WHERE spotter_output.departure_airport_name <> '' AND spotter_output.departure_airport_icao <> 'NA' "; |
| 5030 | 5030 | if ($olderthanmonths > 0) { |
@@ -5054,7 +5054,7 @@ discard block |
||
| 5054 | 5054 | $airport_array = array(); |
| 5055 | 5055 | $temp_array = array(); |
| 5056 | 5056 | |
| 5057 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5057 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5058 | 5058 | { |
| 5059 | 5059 | $temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
| 5060 | 5060 | $temp_array['airport_departure_icao_count'] = $row['airport_departure_icao_count']; |
@@ -5076,7 +5076,7 @@ discard block |
||
| 5076 | 5076 | public function countAllDetectedDepartureAirports($limit = true, $olderthanmonths = 0, $sincedate = '') |
| 5077 | 5077 | { |
| 5078 | 5078 | global $globalDBdriver; |
| 5079 | - $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 |
|
| 5079 | + $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 |
|
| 5080 | 5080 | FROM spotter_output, airport |
| 5081 | 5081 | WHERE spotter_output.real_departure_airport_icao <> '' AND spotter_output.real_departure_airport_icao <> 'NA' AND airport.icao = spotter_output.real_departure_airport_icao "; |
| 5082 | 5082 | if ($olderthanmonths > 0) { |
@@ -5106,7 +5106,7 @@ discard block |
||
| 5106 | 5106 | $airport_array = array(); |
| 5107 | 5107 | $temp_array = array(); |
| 5108 | 5108 | |
| 5109 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5109 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5110 | 5110 | { |
| 5111 | 5111 | $temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
| 5112 | 5112 | $temp_array['airport_departure_icao_count'] = $row['airport_departure_icao_count']; |
@@ -5129,9 +5129,9 @@ discard block |
||
| 5129 | 5129 | */ |
| 5130 | 5130 | public function countAllDepartureAirportsByAirline($airline_icao) |
| 5131 | 5131 | { |
| 5132 | - $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING); |
|
| 5132 | + $airline_icao = filter_var($airline_icao, FILTER_SANITIZE_STRING); |
|
| 5133 | 5133 | |
| 5134 | - $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 |
|
| 5134 | + $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 |
|
| 5135 | 5135 | FROM spotter_output |
| 5136 | 5136 | WHERE spotter_output.departure_airport_name <> '' AND spotter_output.departure_airport_icao <> 'NA' AND spotter_output.airline_icao = :airline_icao |
| 5137 | 5137 | GROUP BY spotter_output.departure_airport_icao |
@@ -5144,7 +5144,7 @@ discard block |
||
| 5144 | 5144 | $airport_array = array(); |
| 5145 | 5145 | $temp_array = array(); |
| 5146 | 5146 | |
| 5147 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5147 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5148 | 5148 | { |
| 5149 | 5149 | $temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
| 5150 | 5150 | $temp_array['airport_departure_icao_count'] = $row['airport_departure_icao_count']; |
@@ -5168,9 +5168,9 @@ discard block |
||
| 5168 | 5168 | */ |
| 5169 | 5169 | public function countAllDepartureAirportCountriesByAirline($airline_icao) |
| 5170 | 5170 | { |
| 5171 | - $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING); |
|
| 5171 | + $airline_icao = filter_var($airline_icao, FILTER_SANITIZE_STRING); |
|
| 5172 | 5172 | |
| 5173 | - $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
| 5173 | + $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
| 5174 | 5174 | FROM spotter_output |
| 5175 | 5175 | WHERE spotter_output.departure_airport_country <> '' AND spotter_output.airline_icao = :airline_icao |
| 5176 | 5176 | GROUP BY spotter_output.departure_airport_country |
@@ -5183,7 +5183,7 @@ discard block |
||
| 5183 | 5183 | $airport_array = array(); |
| 5184 | 5184 | $temp_array = array(); |
| 5185 | 5185 | |
| 5186 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5186 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5187 | 5187 | { |
| 5188 | 5188 | $temp_array['departure_airport_country'] = $row['departure_airport_country']; |
| 5189 | 5189 | $temp_array['airport_departure_country_count'] = $row['airport_departure_country_count']; |
@@ -5204,9 +5204,9 @@ discard block |
||
| 5204 | 5204 | */ |
| 5205 | 5205 | public function countAllDepartureAirportsByAircraft($aircraft_icao) |
| 5206 | 5206 | { |
| 5207 | - $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
|
| 5207 | + $aircraft_icao = filter_var($aircraft_icao, FILTER_SANITIZE_STRING); |
|
| 5208 | 5208 | |
| 5209 | - $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 |
|
| 5209 | + $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 |
|
| 5210 | 5210 | FROM spotter_output |
| 5211 | 5211 | WHERE spotter_output.departure_airport_name <> '' AND spotter_output.departure_airport_icao <> 'NA' AND spotter_output.aircraft_icao = :aircraft_icao |
| 5212 | 5212 | GROUP BY spotter_output.departure_airport_icao |
@@ -5219,7 +5219,7 @@ discard block |
||
| 5219 | 5219 | $airport_array = array(); |
| 5220 | 5220 | $temp_array = array(); |
| 5221 | 5221 | |
| 5222 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5222 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5223 | 5223 | { |
| 5224 | 5224 | $temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
| 5225 | 5225 | $temp_array['airport_departure_icao_count'] = $row['airport_departure_icao_count']; |
@@ -5242,9 +5242,9 @@ discard block |
||
| 5242 | 5242 | */ |
| 5243 | 5243 | public function countAllDepartureAirportCountriesByAircraft($aircraft_icao) |
| 5244 | 5244 | { |
| 5245 | - $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
|
| 5245 | + $aircraft_icao = filter_var($aircraft_icao, FILTER_SANITIZE_STRING); |
|
| 5246 | 5246 | |
| 5247 | - $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
| 5247 | + $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
| 5248 | 5248 | FROM spotter_output |
| 5249 | 5249 | WHERE spotter_output.departure_airport_country <> '' AND spotter_output.aircraft_icao = :aircraft_icao |
| 5250 | 5250 | GROUP BY spotter_output.departure_airport_country |
@@ -5257,7 +5257,7 @@ discard block |
||
| 5257 | 5257 | $airport_array = array(); |
| 5258 | 5258 | $temp_array = array(); |
| 5259 | 5259 | |
| 5260 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5260 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5261 | 5261 | { |
| 5262 | 5262 | $temp_array['departure_airport_country'] = $row['departure_airport_country']; |
| 5263 | 5263 | $temp_array['airport_departure_country_count'] = $row['airport_departure_country_count']; |
@@ -5277,9 +5277,9 @@ discard block |
||
| 5277 | 5277 | */ |
| 5278 | 5278 | public function countAllDepartureAirportsByRegistration($registration) |
| 5279 | 5279 | { |
| 5280 | - $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
|
| 5280 | + $registration = filter_var($registration, FILTER_SANITIZE_STRING); |
|
| 5281 | 5281 | |
| 5282 | - $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 |
|
| 5282 | + $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 |
|
| 5283 | 5283 | FROM spotter_output |
| 5284 | 5284 | WHERE spotter_output.departure_airport_name <> '' AND spotter_output.departure_airport_icao <> 'NA' AND spotter_output.registration = :registration |
| 5285 | 5285 | GROUP BY spotter_output.departure_airport_icao |
@@ -5292,7 +5292,7 @@ discard block |
||
| 5292 | 5292 | $airport_array = array(); |
| 5293 | 5293 | $temp_array = array(); |
| 5294 | 5294 | |
| 5295 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5295 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5296 | 5296 | { |
| 5297 | 5297 | $temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
| 5298 | 5298 | $temp_array['airport_departure_icao_count'] = $row['airport_departure_icao_count']; |
@@ -5315,9 +5315,9 @@ discard block |
||
| 5315 | 5315 | */ |
| 5316 | 5316 | public function countAllDepartureAirportCountriesByRegistration($registration) |
| 5317 | 5317 | { |
| 5318 | - $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
|
| 5318 | + $registration = filter_var($registration, FILTER_SANITIZE_STRING); |
|
| 5319 | 5319 | |
| 5320 | - $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
| 5320 | + $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
| 5321 | 5321 | FROM spotter_output |
| 5322 | 5322 | WHERE spotter_output.departure_airport_country <> '' AND spotter_output.registration = :registration |
| 5323 | 5323 | GROUP BY spotter_output.departure_airport_country |
@@ -5330,7 +5330,7 @@ discard block |
||
| 5330 | 5330 | $airport_array = array(); |
| 5331 | 5331 | $temp_array = array(); |
| 5332 | 5332 | |
| 5333 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5333 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5334 | 5334 | { |
| 5335 | 5335 | $temp_array['departure_airport_country'] = $row['departure_airport_country']; |
| 5336 | 5336 | $temp_array['airport_departure_country_count'] = $row['airport_departure_country_count']; |
@@ -5350,9 +5350,9 @@ discard block |
||
| 5350 | 5350 | */ |
| 5351 | 5351 | public function countAllDepartureAirportsByAirport($airport_icao) |
| 5352 | 5352 | { |
| 5353 | - $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
|
| 5353 | + $airport_icao = filter_var($airport_icao, FILTER_SANITIZE_STRING); |
|
| 5354 | 5354 | |
| 5355 | - $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 |
|
| 5355 | + $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 |
|
| 5356 | 5356 | FROM spotter_output |
| 5357 | 5357 | WHERE spotter_output.departure_airport_name <> '' AND spotter_output.departure_airport_icao <> 'NA' AND spotter_output.arrival_airport_icao = :airport_icao |
| 5358 | 5358 | GROUP BY spotter_output.departure_airport_icao |
@@ -5365,7 +5365,7 @@ discard block |
||
| 5365 | 5365 | $airport_array = array(); |
| 5366 | 5366 | $temp_array = array(); |
| 5367 | 5367 | |
| 5368 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5368 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5369 | 5369 | { |
| 5370 | 5370 | $temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
| 5371 | 5371 | $temp_array['airport_departure_icao_count'] = $row['airport_departure_icao_count']; |
@@ -5388,9 +5388,9 @@ discard block |
||
| 5388 | 5388 | */ |
| 5389 | 5389 | public function countAllDepartureAirportCountriesByAirport($airport_icao) |
| 5390 | 5390 | { |
| 5391 | - $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
|
| 5391 | + $airport_icao = filter_var($airport_icao, FILTER_SANITIZE_STRING); |
|
| 5392 | 5392 | |
| 5393 | - $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
| 5393 | + $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
| 5394 | 5394 | FROM spotter_output |
| 5395 | 5395 | WHERE spotter_output.departure_airport_country <> '' AND spotter_output.arrival_airport_icao = :airport_icao |
| 5396 | 5396 | GROUP BY spotter_output.departure_airport_country |
@@ -5403,7 +5403,7 @@ discard block |
||
| 5403 | 5403 | $airport_array = array(); |
| 5404 | 5404 | $temp_array = array(); |
| 5405 | 5405 | |
| 5406 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5406 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5407 | 5407 | { |
| 5408 | 5408 | $temp_array['departure_airport_country'] = $row['departure_airport_country']; |
| 5409 | 5409 | $temp_array['airport_departure_country_count'] = $row['airport_departure_country_count']; |
@@ -5424,9 +5424,9 @@ discard block |
||
| 5424 | 5424 | */ |
| 5425 | 5425 | public function countAllDepartureAirportsByManufacturer($aircraft_manufacturer) |
| 5426 | 5426 | { |
| 5427 | - $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
|
| 5427 | + $aircraft_manufacturer = filter_var($aircraft_manufacturer, FILTER_SANITIZE_STRING); |
|
| 5428 | 5428 | |
| 5429 | - $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 |
|
| 5429 | + $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 |
|
| 5430 | 5430 | FROM spotter_output |
| 5431 | 5431 | WHERE spotter_output.departure_airport_name <> '' AND spotter_output.departure_airport_icao <> 'NA' AND spotter_output.aircraft_manufacturer = :aircraft_manufacturer |
| 5432 | 5432 | GROUP BY spotter_output.departure_airport_icao |
@@ -5439,7 +5439,7 @@ discard block |
||
| 5439 | 5439 | $airport_array = array(); |
| 5440 | 5440 | $temp_array = array(); |
| 5441 | 5441 | |
| 5442 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5442 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5443 | 5443 | { |
| 5444 | 5444 | $temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
| 5445 | 5445 | $temp_array['airport_departure_icao_count'] = $row['airport_departure_icao_count']; |
@@ -5462,9 +5462,9 @@ discard block |
||
| 5462 | 5462 | */ |
| 5463 | 5463 | public function countAllDepartureAirportCountriesByManufacturer($aircraft_manufacturer) |
| 5464 | 5464 | { |
| 5465 | - $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
|
| 5465 | + $aircraft_manufacturer = filter_var($aircraft_manufacturer, FILTER_SANITIZE_STRING); |
|
| 5466 | 5466 | |
| 5467 | - $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
| 5467 | + $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
| 5468 | 5468 | FROM spotter_output |
| 5469 | 5469 | WHERE spotter_output.departure_airport_country <> '' AND spotter_output.aircraft_manufacturer = :aircraft_manufacturer |
| 5470 | 5470 | GROUP BY spotter_output.departure_airport_country |
@@ -5477,7 +5477,7 @@ discard block |
||
| 5477 | 5477 | $airport_array = array(); |
| 5478 | 5478 | $temp_array = array(); |
| 5479 | 5479 | |
| 5480 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5480 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5481 | 5481 | { |
| 5482 | 5482 | $temp_array['departure_airport_country'] = $row['departure_airport_country']; |
| 5483 | 5483 | $temp_array['airport_departure_country_count'] = $row['airport_departure_country_count']; |
@@ -5498,7 +5498,7 @@ discard block |
||
| 5498 | 5498 | public function countAllDepartureAirportsByDate($date) |
| 5499 | 5499 | { |
| 5500 | 5500 | global $globalTimezone, $globalDBdriver; |
| 5501 | - $date = filter_var($date,FILTER_SANITIZE_STRING); |
|
| 5501 | + $date = filter_var($date, FILTER_SANITIZE_STRING); |
|
| 5502 | 5502 | |
| 5503 | 5503 | if ($globalTimezone != '') { |
| 5504 | 5504 | date_default_timezone_set($globalTimezone); |
@@ -5507,13 +5507,13 @@ discard block |
||
| 5507 | 5507 | } else $offset = '+00:00'; |
| 5508 | 5508 | |
| 5509 | 5509 | if ($globalDBdriver == 'mysql') { |
| 5510 | - $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 |
|
| 5510 | + $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 |
|
| 5511 | 5511 | FROM spotter_output |
| 5512 | 5512 | WHERE spotter_output.departure_airport_name <> '' AND spotter_output.departure_airport_icao <> 'NA' AND DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) = :date |
| 5513 | 5513 | GROUP BY spotter_output.departure_airport_icao |
| 5514 | 5514 | ORDER BY airport_departure_icao_count DESC"; |
| 5515 | 5515 | } else { |
| 5516 | - $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 |
|
| 5516 | + $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 |
|
| 5517 | 5517 | FROM spotter_output |
| 5518 | 5518 | WHERE spotter_output.departure_airport_name <> '' AND spotter_output.departure_airport_icao <> 'NA' AND to_char(spotter_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') = :date |
| 5519 | 5519 | GROUP BY spotter_output.departure_airport_icao |
@@ -5526,7 +5526,7 @@ discard block |
||
| 5526 | 5526 | $airport_array = array(); |
| 5527 | 5527 | $temp_array = array(); |
| 5528 | 5528 | |
| 5529 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5529 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5530 | 5530 | { |
| 5531 | 5531 | $temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
| 5532 | 5532 | $temp_array['airport_departure_icao_count'] = $row['airport_departure_icao_count']; |
@@ -5550,7 +5550,7 @@ discard block |
||
| 5550 | 5550 | public function countAllDepartureAirportCountriesByDate($date) |
| 5551 | 5551 | { |
| 5552 | 5552 | global $globalTimezone, $globalDBdriver; |
| 5553 | - $date = filter_var($date,FILTER_SANITIZE_STRING); |
|
| 5553 | + $date = filter_var($date, FILTER_SANITIZE_STRING); |
|
| 5554 | 5554 | if ($globalTimezone != '') { |
| 5555 | 5555 | date_default_timezone_set($globalTimezone); |
| 5556 | 5556 | $datetime = new DateTime($date); |
@@ -5558,13 +5558,13 @@ discard block |
||
| 5558 | 5558 | } else $offset = '+00:00'; |
| 5559 | 5559 | |
| 5560 | 5560 | if ($globalDBdriver == 'mysql') { |
| 5561 | - $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
| 5561 | + $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
| 5562 | 5562 | FROM spotter_output |
| 5563 | 5563 | WHERE spotter_output.departure_airport_country <> '' AND DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) = :date |
| 5564 | 5564 | GROUP BY spotter_output.departure_airport_country |
| 5565 | 5565 | ORDER BY airport_departure_country_count DESC"; |
| 5566 | 5566 | } else { |
| 5567 | - $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
| 5567 | + $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
| 5568 | 5568 | FROM spotter_output |
| 5569 | 5569 | WHERE spotter_output.departure_airport_country <> '' AND to_char(spotter_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') = :date |
| 5570 | 5570 | GROUP BY spotter_output.departure_airport_country |
@@ -5577,7 +5577,7 @@ discard block |
||
| 5577 | 5577 | $airport_array = array(); |
| 5578 | 5578 | $temp_array = array(); |
| 5579 | 5579 | |
| 5580 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5580 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5581 | 5581 | { |
| 5582 | 5582 | $temp_array['departure_airport_country'] = $row['departure_airport_country']; |
| 5583 | 5583 | $temp_array['airport_departure_country_count'] = $row['airport_departure_country_count']; |
@@ -5597,9 +5597,9 @@ discard block |
||
| 5597 | 5597 | */ |
| 5598 | 5598 | public function countAllDepartureAirportsByIdent($ident) |
| 5599 | 5599 | { |
| 5600 | - $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
|
| 5600 | + $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
|
| 5601 | 5601 | |
| 5602 | - $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 |
|
| 5602 | + $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 |
|
| 5603 | 5603 | FROM spotter_output |
| 5604 | 5604 | WHERE spotter_output.departure_airport_name <> '' AND spotter_output.departure_airport_icao <> 'NA' AND spotter_output.ident = :ident |
| 5605 | 5605 | GROUP BY spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country |
@@ -5612,7 +5612,7 @@ discard block |
||
| 5612 | 5612 | $airport_array = array(); |
| 5613 | 5613 | $temp_array = array(); |
| 5614 | 5614 | |
| 5615 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5615 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5616 | 5616 | { |
| 5617 | 5617 | $temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
| 5618 | 5618 | $temp_array['airport_departure_icao_count'] = $row['airport_departure_icao_count']; |
@@ -5636,9 +5636,9 @@ discard block |
||
| 5636 | 5636 | */ |
| 5637 | 5637 | public function countAllDepartureAirportCountriesByIdent($ident) |
| 5638 | 5638 | { |
| 5639 | - $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
|
| 5639 | + $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
|
| 5640 | 5640 | |
| 5641 | - $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
| 5641 | + $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
| 5642 | 5642 | FROM spotter_output |
| 5643 | 5643 | WHERE spotter_output.departure_airport_country <> '' AND spotter_output.ident = :ident |
| 5644 | 5644 | GROUP BY spotter_output.departure_airport_country |
@@ -5651,7 +5651,7 @@ discard block |
||
| 5651 | 5651 | $airport_array = array(); |
| 5652 | 5652 | $temp_array = array(); |
| 5653 | 5653 | |
| 5654 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5654 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5655 | 5655 | { |
| 5656 | 5656 | $temp_array['departure_airport_country'] = $row['departure_airport_country']; |
| 5657 | 5657 | $temp_array['airport_departure_country_count'] = $row['airport_departure_country_count']; |
@@ -5672,9 +5672,9 @@ discard block |
||
| 5672 | 5672 | */ |
| 5673 | 5673 | public function countAllDepartureAirportsByCountry($country) |
| 5674 | 5674 | { |
| 5675 | - $country = filter_var($country,FILTER_SANITIZE_STRING); |
|
| 5675 | + $country = filter_var($country, FILTER_SANITIZE_STRING); |
|
| 5676 | 5676 | |
| 5677 | - $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 |
|
| 5677 | + $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 |
|
| 5678 | 5678 | FROM spotter_output |
| 5679 | 5679 | WHERE ((spotter_output.departure_airport_country = :country) OR (spotter_output.arrival_airport_country = :country)) OR spotter_output.airline_country = :country |
| 5680 | 5680 | GROUP BY spotter_output.departure_airport_icao |
@@ -5687,7 +5687,7 @@ discard block |
||
| 5687 | 5687 | $airport_array = array(); |
| 5688 | 5688 | $temp_array = array(); |
| 5689 | 5689 | |
| 5690 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5690 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5691 | 5691 | { |
| 5692 | 5692 | $temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
| 5693 | 5693 | $temp_array['airport_departure_icao_count'] = $row['airport_departure_icao_count']; |
@@ -5710,9 +5710,9 @@ discard block |
||
| 5710 | 5710 | */ |
| 5711 | 5711 | public function countAllDepartureAirportCountriesByCountry($country) |
| 5712 | 5712 | { |
| 5713 | - $country = filter_var($country,FILTER_SANITIZE_STRING); |
|
| 5713 | + $country = filter_var($country, FILTER_SANITIZE_STRING); |
|
| 5714 | 5714 | |
| 5715 | - $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
| 5715 | + $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
| 5716 | 5716 | FROM spotter_output |
| 5717 | 5717 | WHERE spotter_output.departure_airport_country <> '' AND ((spotter_output.departure_airport_country = :country) OR (spotter_output.arrival_airport_country = :country)) OR spotter_output.airline_country = :country |
| 5718 | 5718 | GROUP BY spotter_output.departure_airport_country |
@@ -5725,7 +5725,7 @@ discard block |
||
| 5725 | 5725 | $airport_array = array(); |
| 5726 | 5726 | $temp_array = array(); |
| 5727 | 5727 | |
| 5728 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5728 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5729 | 5729 | { |
| 5730 | 5730 | $temp_array['departure_airport_country'] = $row['departure_airport_country']; |
| 5731 | 5731 | $temp_array['airport_departure_country_count'] = $row['airport_departure_country_count']; |
@@ -5746,7 +5746,7 @@ discard block |
||
| 5746 | 5746 | public function countAllArrivalAirports($limit = true, $olderthanmonths = 0, $sincedate = '', $icaoaskey = false) |
| 5747 | 5747 | { |
| 5748 | 5748 | global $globalDBdriver; |
| 5749 | - $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 |
|
| 5749 | + $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 |
|
| 5750 | 5750 | FROM spotter_output |
| 5751 | 5751 | WHERE spotter_output.arrival_airport_name <> '' AND spotter_output.arrival_airport_icao <> 'NA' "; |
| 5752 | 5752 | if ($olderthanmonths > 0) { |
@@ -5782,7 +5782,7 @@ discard block |
||
| 5782 | 5782 | $airport_array = array(); |
| 5783 | 5783 | $temp_array = array(); |
| 5784 | 5784 | |
| 5785 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5785 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5786 | 5786 | { |
| 5787 | 5787 | $temp_array['airport_arrival_icao'] = $row['arrival_airport_icao']; |
| 5788 | 5788 | $temp_array['airport_arrival_icao_count'] = $row['airport_arrival_icao_count']; |
@@ -5805,10 +5805,10 @@ discard block |
||
| 5805 | 5805 | * @return Array the airport list |
| 5806 | 5806 | * |
| 5807 | 5807 | */ |
| 5808 | - public function countAllDetectedArrivalAirports($limit = true, $olderthanmonths = 0, $sincedate = '',$icaoaskey = false) |
|
| 5808 | + public function countAllDetectedArrivalAirports($limit = true, $olderthanmonths = 0, $sincedate = '', $icaoaskey = false) |
|
| 5809 | 5809 | { |
| 5810 | 5810 | global $globalDBdriver; |
| 5811 | - $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 |
|
| 5811 | + $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 |
|
| 5812 | 5812 | FROM spotter_output, airport |
| 5813 | 5813 | WHERE spotter_output.real_arrival_airport_icao <> '' AND spotter_output.real_arrival_airport_icao <> 'NA' AND airport.icao = spotter_output.real_arrival_airport_icao "; |
| 5814 | 5814 | if ($olderthanmonths > 0) { |
@@ -5844,7 +5844,7 @@ discard block |
||
| 5844 | 5844 | $airport_array = array(); |
| 5845 | 5845 | $temp_array = array(); |
| 5846 | 5846 | |
| 5847 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5847 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5848 | 5848 | { |
| 5849 | 5849 | $temp_array['airport_arrival_icao'] = $row['arrival_airport_icao']; |
| 5850 | 5850 | $temp_array['airport_arrival_icao_count'] = $row['airport_arrival_icao_count']; |
@@ -5871,9 +5871,9 @@ discard block |
||
| 5871 | 5871 | */ |
| 5872 | 5872 | public function countAllArrivalAirportsByAirline($airline_icao) |
| 5873 | 5873 | { |
| 5874 | - $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING); |
|
| 5874 | + $airline_icao = filter_var($airline_icao, FILTER_SANITIZE_STRING); |
|
| 5875 | 5875 | |
| 5876 | - $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 |
|
| 5876 | + $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 |
|
| 5877 | 5877 | FROM spotter_output |
| 5878 | 5878 | WHERE spotter_output.arrival_airport_name <> '' AND spotter_output.arrival_airport_icao <> 'NA' AND spotter_output.airline_icao = :airline_icao |
| 5879 | 5879 | GROUP BY spotter_output.arrival_airport_icao |
@@ -5886,7 +5886,7 @@ discard block |
||
| 5886 | 5886 | $airport_array = array(); |
| 5887 | 5887 | $temp_array = array(); |
| 5888 | 5888 | |
| 5889 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5889 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5890 | 5890 | { |
| 5891 | 5891 | $temp_array['airport_arrival_icao'] = $row['arrival_airport_icao']; |
| 5892 | 5892 | $temp_array['airport_arrival_icao_count'] = $row['airport_arrival_icao_count']; |
@@ -5909,9 +5909,9 @@ discard block |
||
| 5909 | 5909 | */ |
| 5910 | 5910 | public function countAllArrivalAirportCountriesByAirline($airline_icao) |
| 5911 | 5911 | { |
| 5912 | - $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING); |
|
| 5912 | + $airline_icao = filter_var($airline_icao, FILTER_SANITIZE_STRING); |
|
| 5913 | 5913 | |
| 5914 | - $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
| 5914 | + $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
| 5915 | 5915 | FROM spotter_output |
| 5916 | 5916 | WHERE spotter_output.arrival_airport_country <> '' AND spotter_output.airline_icao = :airline_icao |
| 5917 | 5917 | GROUP BY spotter_output.arrival_airport_country |
@@ -5924,7 +5924,7 @@ discard block |
||
| 5924 | 5924 | $airport_array = array(); |
| 5925 | 5925 | $temp_array = array(); |
| 5926 | 5926 | |
| 5927 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5927 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5928 | 5928 | { |
| 5929 | 5929 | $temp_array['arrival_airport_country'] = $row['arrival_airport_country']; |
| 5930 | 5930 | $temp_array['airport_arrival_country_count'] = $row['airport_arrival_country_count']; |
@@ -5944,9 +5944,9 @@ discard block |
||
| 5944 | 5944 | */ |
| 5945 | 5945 | public function countAllArrivalAirportsByAircraft($aircraft_icao) |
| 5946 | 5946 | { |
| 5947 | - $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
|
| 5947 | + $aircraft_icao = filter_var($aircraft_icao, FILTER_SANITIZE_STRING); |
|
| 5948 | 5948 | |
| 5949 | - $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 |
|
| 5949 | + $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 |
|
| 5950 | 5950 | FROM spotter_output |
| 5951 | 5951 | WHERE spotter_output.arrival_airport_name <> '' AND spotter_output.arrival_airport_icao <> 'NA' AND spotter_output.aircraft_icao = :aircraft_icao |
| 5952 | 5952 | GROUP BY spotter_output.arrival_airport_icao |
@@ -5959,7 +5959,7 @@ discard block |
||
| 5959 | 5959 | $airport_array = array(); |
| 5960 | 5960 | $temp_array = array(); |
| 5961 | 5961 | |
| 5962 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5962 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5963 | 5963 | { |
| 5964 | 5964 | $temp_array['airport_arrival_icao'] = $row['arrival_airport_icao']; |
| 5965 | 5965 | $temp_array['airport_arrival_icao_count'] = $row['airport_arrival_icao_count']; |
@@ -5983,9 +5983,9 @@ discard block |
||
| 5983 | 5983 | */ |
| 5984 | 5984 | public function countAllArrivalAirportCountriesByAircraft($aircraft_icao) |
| 5985 | 5985 | { |
| 5986 | - $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
|
| 5986 | + $aircraft_icao = filter_var($aircraft_icao, FILTER_SANITIZE_STRING); |
|
| 5987 | 5987 | |
| 5988 | - $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
| 5988 | + $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
| 5989 | 5989 | FROM spotter_output |
| 5990 | 5990 | WHERE spotter_output.arrival_airport_country <> '' AND spotter_output.aircraft_icao = :aircraft_icao |
| 5991 | 5991 | GROUP BY spotter_output.arrival_airport_country |
@@ -5998,7 +5998,7 @@ discard block |
||
| 5998 | 5998 | $airport_array = array(); |
| 5999 | 5999 | $temp_array = array(); |
| 6000 | 6000 | |
| 6001 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6001 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6002 | 6002 | { |
| 6003 | 6003 | $temp_array['arrival_airport_country'] = $row['arrival_airport_country']; |
| 6004 | 6004 | $temp_array['airport_arrival_country_count'] = $row['airport_arrival_country_count']; |
@@ -6018,9 +6018,9 @@ discard block |
||
| 6018 | 6018 | */ |
| 6019 | 6019 | public function countAllArrivalAirportsByRegistration($registration) |
| 6020 | 6020 | { |
| 6021 | - $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
|
| 6021 | + $registration = filter_var($registration, FILTER_SANITIZE_STRING); |
|
| 6022 | 6022 | |
| 6023 | - $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 |
|
| 6023 | + $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 |
|
| 6024 | 6024 | FROM spotter_output |
| 6025 | 6025 | WHERE spotter_output.arrival_airport_name <> '' AND spotter_output.arrival_airport_icao <> 'NA' AND spotter_output.registration = :registration |
| 6026 | 6026 | GROUP BY spotter_output.arrival_airport_icao |
@@ -6033,7 +6033,7 @@ discard block |
||
| 6033 | 6033 | $airport_array = array(); |
| 6034 | 6034 | $temp_array = array(); |
| 6035 | 6035 | |
| 6036 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6036 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6037 | 6037 | { |
| 6038 | 6038 | $temp_array['airport_arrival_icao'] = $row['arrival_airport_icao']; |
| 6039 | 6039 | $temp_array['airport_arrival_icao_count'] = $row['airport_arrival_icao_count']; |
@@ -6056,9 +6056,9 @@ discard block |
||
| 6056 | 6056 | */ |
| 6057 | 6057 | public function countAllArrivalAirportCountriesByRegistration($registration) |
| 6058 | 6058 | { |
| 6059 | - $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
|
| 6059 | + $registration = filter_var($registration, FILTER_SANITIZE_STRING); |
|
| 6060 | 6060 | |
| 6061 | - $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
| 6061 | + $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
| 6062 | 6062 | FROM spotter_output |
| 6063 | 6063 | WHERE spotter_output.arrival_airport_country <> '' AND spotter_output.registration = :registration |
| 6064 | 6064 | GROUP BY spotter_output.arrival_airport_country |
@@ -6071,7 +6071,7 @@ discard block |
||
| 6071 | 6071 | $airport_array = array(); |
| 6072 | 6072 | $temp_array = array(); |
| 6073 | 6073 | |
| 6074 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6074 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6075 | 6075 | { |
| 6076 | 6076 | $temp_array['arrival_airport_country'] = $row['arrival_airport_country']; |
| 6077 | 6077 | $temp_array['airport_arrival_country_count'] = $row['airport_arrival_country_count']; |
@@ -6092,9 +6092,9 @@ discard block |
||
| 6092 | 6092 | */ |
| 6093 | 6093 | public function countAllArrivalAirportsByAirport($airport_icao) |
| 6094 | 6094 | { |
| 6095 | - $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
|
| 6095 | + $airport_icao = filter_var($airport_icao, FILTER_SANITIZE_STRING); |
|
| 6096 | 6096 | |
| 6097 | - $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 |
|
| 6097 | + $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 |
|
| 6098 | 6098 | FROM spotter_output |
| 6099 | 6099 | WHERE spotter_output.arrival_airport_name <> '' AND spotter_output.arrival_airport_icao <> 'NA' AND spotter_output.departure_airport_icao = :airport_icao |
| 6100 | 6100 | GROUP BY spotter_output.arrival_airport_icao |
@@ -6107,7 +6107,7 @@ discard block |
||
| 6107 | 6107 | $airport_array = array(); |
| 6108 | 6108 | $temp_array = array(); |
| 6109 | 6109 | |
| 6110 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6110 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6111 | 6111 | { |
| 6112 | 6112 | $temp_array['airport_arrival_icao'] = $row['arrival_airport_icao']; |
| 6113 | 6113 | $temp_array['airport_arrival_icao_count'] = $row['airport_arrival_icao_count']; |
@@ -6130,9 +6130,9 @@ discard block |
||
| 6130 | 6130 | */ |
| 6131 | 6131 | public function countAllArrivalAirportCountriesByAirport($airport_icao) |
| 6132 | 6132 | { |
| 6133 | - $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
|
| 6133 | + $airport_icao = filter_var($airport_icao, FILTER_SANITIZE_STRING); |
|
| 6134 | 6134 | |
| 6135 | - $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
| 6135 | + $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
| 6136 | 6136 | FROM spotter_output |
| 6137 | 6137 | WHERE spotter_output.arrival_airport_country <> '' AND spotter_output.departure_airport_icao = :airport_icao |
| 6138 | 6138 | GROUP BY spotter_output.arrival_airport_country |
@@ -6145,7 +6145,7 @@ discard block |
||
| 6145 | 6145 | $airport_array = array(); |
| 6146 | 6146 | $temp_array = array(); |
| 6147 | 6147 | |
| 6148 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6148 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6149 | 6149 | { |
| 6150 | 6150 | $temp_array['arrival_airport_country'] = $row['arrival_airport_country']; |
| 6151 | 6151 | $temp_array['airport_arrival_country_count'] = $row['airport_arrival_country_count']; |
@@ -6165,9 +6165,9 @@ discard block |
||
| 6165 | 6165 | */ |
| 6166 | 6166 | public function countAllArrivalAirportsByManufacturer($aircraft_manufacturer) |
| 6167 | 6167 | { |
| 6168 | - $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
|
| 6168 | + $aircraft_manufacturer = filter_var($aircraft_manufacturer, FILTER_SANITIZE_STRING); |
|
| 6169 | 6169 | |
| 6170 | - $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 |
|
| 6170 | + $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 |
|
| 6171 | 6171 | FROM spotter_output |
| 6172 | 6172 | WHERE spotter_output.arrival_airport_name <> '' AND spotter_output.arrival_airport_icao <> 'NA' AND spotter_output.aircraft_manufacturer = :aircraft_manufacturer |
| 6173 | 6173 | GROUP BY spotter_output.arrival_airport_icao |
@@ -6180,7 +6180,7 @@ discard block |
||
| 6180 | 6180 | $airport_array = array(); |
| 6181 | 6181 | $temp_array = array(); |
| 6182 | 6182 | |
| 6183 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6183 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6184 | 6184 | { |
| 6185 | 6185 | $temp_array['airport_arrival_icao'] = $row['arrival_airport_icao']; |
| 6186 | 6186 | $temp_array['airport_arrival_icao_count'] = $row['airport_arrival_icao_count']; |
@@ -6204,9 +6204,9 @@ discard block |
||
| 6204 | 6204 | */ |
| 6205 | 6205 | public function countAllArrivalAirportCountriesByManufacturer($aircraft_manufacturer) |
| 6206 | 6206 | { |
| 6207 | - $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
|
| 6207 | + $aircraft_manufacturer = filter_var($aircraft_manufacturer, FILTER_SANITIZE_STRING); |
|
| 6208 | 6208 | |
| 6209 | - $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
| 6209 | + $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
| 6210 | 6210 | FROM spotter_output |
| 6211 | 6211 | WHERE spotter_output.arrival_airport_country <> '' AND spotter_output.aircraft_manufacturer = :aircraft_manufacturer |
| 6212 | 6212 | GROUP BY spotter_output.arrival_airport_country |
@@ -6219,7 +6219,7 @@ discard block |
||
| 6219 | 6219 | $airport_array = array(); |
| 6220 | 6220 | $temp_array = array(); |
| 6221 | 6221 | |
| 6222 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6222 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6223 | 6223 | { |
| 6224 | 6224 | $temp_array['arrival_airport_country'] = $row['arrival_airport_country']; |
| 6225 | 6225 | $temp_array['airport_arrival_country_count'] = $row['airport_arrival_country_count']; |
@@ -6241,7 +6241,7 @@ discard block |
||
| 6241 | 6241 | public function countAllArrivalAirportsByDate($date) |
| 6242 | 6242 | { |
| 6243 | 6243 | global $globalTimezone, $globalDBdriver; |
| 6244 | - $date = filter_var($date,FILTER_SANITIZE_STRING); |
|
| 6244 | + $date = filter_var($date, FILTER_SANITIZE_STRING); |
|
| 6245 | 6245 | if ($globalTimezone != '') { |
| 6246 | 6246 | date_default_timezone_set($globalTimezone); |
| 6247 | 6247 | $datetime = new DateTime($date); |
@@ -6249,13 +6249,13 @@ discard block |
||
| 6249 | 6249 | } else $offset = '+00:00'; |
| 6250 | 6250 | |
| 6251 | 6251 | if ($globalDBdriver == 'mysql') { |
| 6252 | - $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 |
|
| 6252 | + $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 |
|
| 6253 | 6253 | FROM spotter_output |
| 6254 | 6254 | WHERE spotter_output.arrival_airport_name <> '' AND spotter_output.arrival_airport_icao <> 'NA' AND DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) = :date |
| 6255 | 6255 | GROUP BY spotter_output.arrival_airport_icao |
| 6256 | 6256 | ORDER BY airport_arrival_icao_count DESC"; |
| 6257 | 6257 | } else { |
| 6258 | - $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 |
|
| 6258 | + $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 |
|
| 6259 | 6259 | FROM spotter_output |
| 6260 | 6260 | WHERE spotter_output.arrival_airport_name <> '' AND spotter_output.arrival_airport_icao <> 'NA' AND to_char(spotter_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') = :date |
| 6261 | 6261 | GROUP BY spotter_output.arrival_airport_icao |
@@ -6268,7 +6268,7 @@ discard block |
||
| 6268 | 6268 | $airport_array = array(); |
| 6269 | 6269 | $temp_array = array(); |
| 6270 | 6270 | |
| 6271 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6271 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6272 | 6272 | { |
| 6273 | 6273 | $temp_array['airport_arrival_icao'] = $row['arrival_airport_icao']; |
| 6274 | 6274 | $temp_array['airport_arrival_icao_count'] = $row['airport_arrival_icao_count']; |
@@ -6292,7 +6292,7 @@ discard block |
||
| 6292 | 6292 | public function countAllArrivalAirportCountriesByDate($date) |
| 6293 | 6293 | { |
| 6294 | 6294 | global $globalTimezone, $globalDBdriver; |
| 6295 | - $date = filter_var($date,FILTER_SANITIZE_STRING); |
|
| 6295 | + $date = filter_var($date, FILTER_SANITIZE_STRING); |
|
| 6296 | 6296 | if ($globalTimezone != '') { |
| 6297 | 6297 | date_default_timezone_set($globalTimezone); |
| 6298 | 6298 | $datetime = new DateTime($date); |
@@ -6300,13 +6300,13 @@ discard block |
||
| 6300 | 6300 | } else $offset = '+00:00'; |
| 6301 | 6301 | |
| 6302 | 6302 | if ($globalDBdriver == 'mysql') { |
| 6303 | - $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
| 6303 | + $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
| 6304 | 6304 | FROM spotter_output |
| 6305 | 6305 | WHERE spotter_output.arrival_airport_country <> '' AND DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) = :date |
| 6306 | 6306 | GROUP BY spotter_output.arrival_airport_country |
| 6307 | 6307 | ORDER BY airport_arrival_country_count DESC"; |
| 6308 | 6308 | } else { |
| 6309 | - $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
| 6309 | + $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
| 6310 | 6310 | FROM spotter_output |
| 6311 | 6311 | WHERE spotter_output.arrival_airport_country <> '' AND to_char(spotter_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') = :date |
| 6312 | 6312 | GROUP BY spotter_output.arrival_airport_country |
@@ -6319,7 +6319,7 @@ discard block |
||
| 6319 | 6319 | $airport_array = array(); |
| 6320 | 6320 | $temp_array = array(); |
| 6321 | 6321 | |
| 6322 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6322 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6323 | 6323 | { |
| 6324 | 6324 | $temp_array['arrival_airport_country'] = $row['arrival_airport_country']; |
| 6325 | 6325 | $temp_array['airport_arrival_country_count'] = $row['airport_arrival_country_count']; |
@@ -6339,9 +6339,9 @@ discard block |
||
| 6339 | 6339 | */ |
| 6340 | 6340 | public function countAllArrivalAirportsByIdent($ident) |
| 6341 | 6341 | { |
| 6342 | - $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
|
| 6342 | + $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
|
| 6343 | 6343 | |
| 6344 | - $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 |
|
| 6344 | + $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 |
|
| 6345 | 6345 | FROM spotter_output |
| 6346 | 6346 | WHERE spotter_output.arrival_airport_name <> '' AND spotter_output.arrival_airport_icao <> 'NA' AND spotter_output.ident = :ident |
| 6347 | 6347 | GROUP BY spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
@@ -6354,7 +6354,7 @@ discard block |
||
| 6354 | 6354 | $airport_array = array(); |
| 6355 | 6355 | $temp_array = array(); |
| 6356 | 6356 | |
| 6357 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6357 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6358 | 6358 | { |
| 6359 | 6359 | $temp_array['airport_arrival_icao'] = $row['arrival_airport_icao']; |
| 6360 | 6360 | $temp_array['airport_arrival_icao_count'] = $row['airport_arrival_icao_count']; |
@@ -6377,9 +6377,9 @@ discard block |
||
| 6377 | 6377 | */ |
| 6378 | 6378 | public function countAllArrivalAirportCountriesByIdent($ident) |
| 6379 | 6379 | { |
| 6380 | - $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
|
| 6380 | + $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
|
| 6381 | 6381 | |
| 6382 | - $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
| 6382 | + $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
| 6383 | 6383 | FROM spotter_output |
| 6384 | 6384 | WHERE spotter_output.arrival_airport_country <> '' AND spotter_output.ident = :ident |
| 6385 | 6385 | GROUP BY spotter_output.arrival_airport_country |
@@ -6392,7 +6392,7 @@ discard block |
||
| 6392 | 6392 | $airport_array = array(); |
| 6393 | 6393 | $temp_array = array(); |
| 6394 | 6394 | |
| 6395 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6395 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6396 | 6396 | { |
| 6397 | 6397 | $temp_array['arrival_airport_country'] = $row['arrival_airport_country']; |
| 6398 | 6398 | $temp_array['airport_arrival_country_count'] = $row['airport_arrival_country_count']; |
@@ -6413,9 +6413,9 @@ discard block |
||
| 6413 | 6413 | */ |
| 6414 | 6414 | public function countAllArrivalAirportsByCountry($country) |
| 6415 | 6415 | { |
| 6416 | - $country = filter_var($country,FILTER_SANITIZE_STRING); |
|
| 6416 | + $country = filter_var($country, FILTER_SANITIZE_STRING); |
|
| 6417 | 6417 | |
| 6418 | - $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 |
|
| 6418 | + $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 |
|
| 6419 | 6419 | FROM spotter_output |
| 6420 | 6420 | WHERE ((spotter_output.departure_airport_country = :country) OR (spotter_output.arrival_airport_country = :country)) OR spotter_output.airline_country = :country |
| 6421 | 6421 | GROUP BY spotter_output.arrival_airport_icao |
@@ -6428,7 +6428,7 @@ discard block |
||
| 6428 | 6428 | $airport_array = array(); |
| 6429 | 6429 | $temp_array = array(); |
| 6430 | 6430 | |
| 6431 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6431 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6432 | 6432 | { |
| 6433 | 6433 | $temp_array['airport_arrival_icao'] = $row['arrival_airport_icao']; |
| 6434 | 6434 | $temp_array['airport_arrival_icao_count'] = $row['airport_arrival_icao_count']; |
@@ -6451,9 +6451,9 @@ discard block |
||
| 6451 | 6451 | */ |
| 6452 | 6452 | public function countAllArrivalAirportCountriesByCountry($country) |
| 6453 | 6453 | { |
| 6454 | - $country = filter_var($country,FILTER_SANITIZE_STRING); |
|
| 6454 | + $country = filter_var($country, FILTER_SANITIZE_STRING); |
|
| 6455 | 6455 | |
| 6456 | - $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
| 6456 | + $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
| 6457 | 6457 | FROM spotter_output |
| 6458 | 6458 | WHERE spotter_output.arrival_airport_country <> '' AND ((spotter_output.departure_airport_country = :country) OR (spotter_output.arrival_airport_country = :country)) OR spotter_output.airline_country = :country |
| 6459 | 6459 | GROUP BY spotter_output.arrival_airport_country |
@@ -6466,7 +6466,7 @@ discard block |
||
| 6466 | 6466 | $airport_array = array(); |
| 6467 | 6467 | $temp_array = array(); |
| 6468 | 6468 | |
| 6469 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6469 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6470 | 6470 | { |
| 6471 | 6471 | $temp_array['arrival_airport_country'] = $row['arrival_airport_country']; |
| 6472 | 6472 | $temp_array['airport_arrival_country_count'] = $row['airport_arrival_country_count']; |
@@ -6487,7 +6487,7 @@ discard block |
||
| 6487 | 6487 | */ |
| 6488 | 6488 | public function countAllDepartureCountries() |
| 6489 | 6489 | { |
| 6490 | - $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
| 6490 | + $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
| 6491 | 6491 | FROM spotter_output |
| 6492 | 6492 | WHERE spotter_output.departure_airport_country <> '' AND spotter_output.departure_airport_icao <> 'NA' |
| 6493 | 6493 | GROUP BY spotter_output.departure_airport_country |
@@ -6501,7 +6501,7 @@ discard block |
||
| 6501 | 6501 | $airport_array = array(); |
| 6502 | 6502 | $temp_array = array(); |
| 6503 | 6503 | |
| 6504 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6504 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6505 | 6505 | { |
| 6506 | 6506 | $temp_array['airport_departure_country_count'] = $row['airport_departure_country_count']; |
| 6507 | 6507 | $temp_array['airport_departure_country'] = $row['departure_airport_country']; |
@@ -6521,7 +6521,7 @@ discard block |
||
| 6521 | 6521 | */ |
| 6522 | 6522 | public function countAllArrivalCountries($limit = true) |
| 6523 | 6523 | { |
| 6524 | - $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
| 6524 | + $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
| 6525 | 6525 | FROM spotter_output |
| 6526 | 6526 | WHERE spotter_output.arrival_airport_country <> '' AND spotter_output.arrival_airport_icao <> 'NA' |
| 6527 | 6527 | GROUP BY spotter_output.arrival_airport_country |
@@ -6535,7 +6535,7 @@ discard block |
||
| 6535 | 6535 | $airport_array = array(); |
| 6536 | 6536 | $temp_array = array(); |
| 6537 | 6537 | |
| 6538 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6538 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6539 | 6539 | { |
| 6540 | 6540 | $temp_array['airport_arrival_country_count'] = $row['airport_arrival_country_count']; |
| 6541 | 6541 | $temp_array['airport_arrival_country'] = $row['arrival_airport_country']; |
@@ -6559,7 +6559,7 @@ discard block |
||
| 6559 | 6559 | public function countAllRoutes() |
| 6560 | 6560 | { |
| 6561 | 6561 | |
| 6562 | - $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 |
|
| 6562 | + $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 |
|
| 6563 | 6563 | FROM spotter_output |
| 6564 | 6564 | WHERE spotter_output.ident <> '' AND spotter_output.departure_airport_icao <> 'NA' AND spotter_output.arrival_airport_icao <> 'NA' |
| 6565 | 6565 | GROUP BY route,spotter_output.departure_airport_icao, spotter_output.arrival_airport_icao,spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country |
@@ -6573,7 +6573,7 @@ discard block |
||
| 6573 | 6573 | $routes_array = array(); |
| 6574 | 6574 | $temp_array = array(); |
| 6575 | 6575 | |
| 6576 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6576 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6577 | 6577 | { |
| 6578 | 6578 | $temp_array['route_count'] = $row['route_count']; |
| 6579 | 6579 | $temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
@@ -6602,9 +6602,9 @@ discard block |
||
| 6602 | 6602 | */ |
| 6603 | 6603 | public function countAllRoutesByAircraft($aircraft_icao) |
| 6604 | 6604 | { |
| 6605 | - $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
|
| 6605 | + $aircraft_icao = filter_var($aircraft_icao, FILTER_SANITIZE_STRING); |
|
| 6606 | 6606 | |
| 6607 | - $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 |
|
| 6607 | + $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 |
|
| 6608 | 6608 | FROM spotter_output |
| 6609 | 6609 | WHERE spotter_output.ident <> '' AND spotter_output.aircraft_icao = :aircraft_icao |
| 6610 | 6610 | GROUP BY route |
@@ -6617,7 +6617,7 @@ discard block |
||
| 6617 | 6617 | $routes_array = array(); |
| 6618 | 6618 | $temp_array = array(); |
| 6619 | 6619 | |
| 6620 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6620 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6621 | 6621 | { |
| 6622 | 6622 | $temp_array['route_count'] = $row['route_count']; |
| 6623 | 6623 | $temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
@@ -6646,7 +6646,7 @@ discard block |
||
| 6646 | 6646 | { |
| 6647 | 6647 | $registration = filter_var($registration, FILTER_SANITIZE_STRING); |
| 6648 | 6648 | |
| 6649 | - $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 |
|
| 6649 | + $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 |
|
| 6650 | 6650 | FROM spotter_output |
| 6651 | 6651 | WHERE spotter_output.ident <> '' AND spotter_output.registration = :registration |
| 6652 | 6652 | GROUP BY route |
@@ -6659,7 +6659,7 @@ discard block |
||
| 6659 | 6659 | $routes_array = array(); |
| 6660 | 6660 | $temp_array = array(); |
| 6661 | 6661 | |
| 6662 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6662 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6663 | 6663 | { |
| 6664 | 6664 | $temp_array['route_count'] = $row['route_count']; |
| 6665 | 6665 | $temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
@@ -6687,9 +6687,9 @@ discard block |
||
| 6687 | 6687 | */ |
| 6688 | 6688 | public function countAllRoutesByAirline($airline_icao) |
| 6689 | 6689 | { |
| 6690 | - $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING); |
|
| 6690 | + $airline_icao = filter_var($airline_icao, FILTER_SANITIZE_STRING); |
|
| 6691 | 6691 | |
| 6692 | - $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 |
|
| 6692 | + $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 |
|
| 6693 | 6693 | FROM spotter_output |
| 6694 | 6694 | WHERE spotter_output.ident <> '' AND spotter_output.airline_icao = :airline_icao |
| 6695 | 6695 | GROUP BY route |
@@ -6702,7 +6702,7 @@ discard block |
||
| 6702 | 6702 | $routes_array = array(); |
| 6703 | 6703 | $temp_array = array(); |
| 6704 | 6704 | |
| 6705 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6705 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6706 | 6706 | { |
| 6707 | 6707 | $temp_array['route_count'] = $row['route_count']; |
| 6708 | 6708 | $temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
@@ -6730,9 +6730,9 @@ discard block |
||
| 6730 | 6730 | */ |
| 6731 | 6731 | public function countAllRoutesByAirport($airport_icao) |
| 6732 | 6732 | { |
| 6733 | - $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
|
| 6733 | + $airport_icao = filter_var($airport_icao, FILTER_SANITIZE_STRING); |
|
| 6734 | 6734 | |
| 6735 | - $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 |
|
| 6735 | + $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 |
|
| 6736 | 6736 | FROM spotter_output |
| 6737 | 6737 | WHERE spotter_output.ident <> '' AND (spotter_output.departure_airport_icao = :airport_icao OR spotter_output.arrival_airport_icao = :airport_icao) |
| 6738 | 6738 | GROUP BY route |
@@ -6745,7 +6745,7 @@ discard block |
||
| 6745 | 6745 | $routes_array = array(); |
| 6746 | 6746 | $temp_array = array(); |
| 6747 | 6747 | |
| 6748 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6748 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6749 | 6749 | { |
| 6750 | 6750 | $temp_array['route_count'] = $row['route_count']; |
| 6751 | 6751 | $temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
@@ -6773,9 +6773,9 @@ discard block |
||
| 6773 | 6773 | */ |
| 6774 | 6774 | public function countAllRoutesByCountry($country) |
| 6775 | 6775 | { |
| 6776 | - $country = filter_var($country,FILTER_SANITIZE_STRING); |
|
| 6776 | + $country = filter_var($country, FILTER_SANITIZE_STRING); |
|
| 6777 | 6777 | |
| 6778 | - $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 |
|
| 6778 | + $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 |
|
| 6779 | 6779 | FROM spotter_output |
| 6780 | 6780 | WHERE spotter_output.ident <> '' AND ((spotter_output.departure_airport_country = :country) OR (spotter_output.arrival_airport_country = :country)) OR spotter_output.airline_country = :country |
| 6781 | 6781 | GROUP BY route |
@@ -6788,7 +6788,7 @@ discard block |
||
| 6788 | 6788 | $routes_array = array(); |
| 6789 | 6789 | $temp_array = array(); |
| 6790 | 6790 | |
| 6791 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6791 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6792 | 6792 | { |
| 6793 | 6793 | $temp_array['route_count'] = $row['route_count']; |
| 6794 | 6794 | $temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
@@ -6816,7 +6816,7 @@ discard block |
||
| 6816 | 6816 | public function countAllRoutesByDate($date) |
| 6817 | 6817 | { |
| 6818 | 6818 | global $globalTimezone, $globalDBdriver; |
| 6819 | - $date = filter_var($date,FILTER_SANITIZE_STRING); |
|
| 6819 | + $date = filter_var($date, FILTER_SANITIZE_STRING); |
|
| 6820 | 6820 | if ($globalTimezone != '') { |
| 6821 | 6821 | date_default_timezone_set($globalTimezone); |
| 6822 | 6822 | $datetime = new DateTime($date); |
@@ -6824,13 +6824,13 @@ discard block |
||
| 6824 | 6824 | } else $offset = '+00:00'; |
| 6825 | 6825 | |
| 6826 | 6826 | if ($globalDBdriver == 'mysql') { |
| 6827 | - $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 |
|
| 6827 | + $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 |
|
| 6828 | 6828 | FROM spotter_output |
| 6829 | 6829 | WHERE spotter_output.ident <> '' AND DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) = :date |
| 6830 | 6830 | GROUP BY route |
| 6831 | 6831 | ORDER BY route_count DESC"; |
| 6832 | 6832 | } else { |
| 6833 | - $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 |
|
| 6833 | + $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 |
|
| 6834 | 6834 | FROM spotter_output |
| 6835 | 6835 | WHERE spotter_output.ident <> '' AND to_char(spotter_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') = :date |
| 6836 | 6836 | GROUP BY route |
@@ -6843,7 +6843,7 @@ discard block |
||
| 6843 | 6843 | $routes_array = array(); |
| 6844 | 6844 | $temp_array = array(); |
| 6845 | 6845 | |
| 6846 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6846 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6847 | 6847 | { |
| 6848 | 6848 | $temp_array['route_count'] = $row['route_count']; |
| 6849 | 6849 | $temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
@@ -6870,9 +6870,9 @@ discard block |
||
| 6870 | 6870 | */ |
| 6871 | 6871 | public function countAllRoutesByIdent($ident) |
| 6872 | 6872 | { |
| 6873 | - $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
|
| 6873 | + $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
|
| 6874 | 6874 | |
| 6875 | - $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 |
|
| 6875 | + $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 |
|
| 6876 | 6876 | FROM spotter_output |
| 6877 | 6877 | WHERE spotter_output.ident <> '' AND spotter_output.ident = :ident |
| 6878 | 6878 | GROUP BY route, spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
@@ -6885,7 +6885,7 @@ discard block |
||
| 6885 | 6885 | $routes_array = array(); |
| 6886 | 6886 | $temp_array = array(); |
| 6887 | 6887 | |
| 6888 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6888 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6889 | 6889 | { |
| 6890 | 6890 | $temp_array['route_count'] = $row['route_count']; |
| 6891 | 6891 | $temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
@@ -6912,9 +6912,9 @@ discard block |
||
| 6912 | 6912 | */ |
| 6913 | 6913 | public function countAllRoutesByManufacturer($aircraft_manufacturer) |
| 6914 | 6914 | { |
| 6915 | - $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
|
| 6915 | + $aircraft_manufacturer = filter_var($aircraft_manufacturer, FILTER_SANITIZE_STRING); |
|
| 6916 | 6916 | |
| 6917 | - $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 |
|
| 6917 | + $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 |
|
| 6918 | 6918 | FROM spotter_output |
| 6919 | 6919 | WHERE spotter_output.ident <> '' AND spotter_output.aircraft_manufacturer = :aircraft_manufacturer |
| 6920 | 6920 | GROUP BY route |
@@ -6927,7 +6927,7 @@ discard block |
||
| 6927 | 6927 | $routes_array = array(); |
| 6928 | 6928 | $temp_array = array(); |
| 6929 | 6929 | |
| 6930 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6930 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6931 | 6931 | { |
| 6932 | 6932 | $temp_array['route_count'] = $row['route_count']; |
| 6933 | 6933 | $temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
@@ -6955,7 +6955,7 @@ discard block |
||
| 6955 | 6955 | */ |
| 6956 | 6956 | public function countAllRoutesWithWaypoints() |
| 6957 | 6957 | { |
| 6958 | - $query = "SELECT DISTINCT spotter_output.waypoints AS route, count(spotter_output.waypoints) AS route_count, spotter_output.spotter_id, 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 |
|
| 6958 | + $query = "SELECT DISTINCT spotter_output.waypoints AS route, count(spotter_output.waypoints) AS route_count, spotter_output.spotter_id, 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 |
|
| 6959 | 6959 | FROM spotter_output |
| 6960 | 6960 | WHERE spotter_output.ident <> '' AND spotter_output.waypoints <> '' |
| 6961 | 6961 | GROUP BY route, spotter_output.spotter_id, spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
@@ -6969,7 +6969,7 @@ discard block |
||
| 6969 | 6969 | $routes_array = array(); |
| 6970 | 6970 | $temp_array = array(); |
| 6971 | 6971 | |
| 6972 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6972 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6973 | 6973 | { |
| 6974 | 6974 | $temp_array['spotter_id'] = $row['spotter_id']; |
| 6975 | 6975 | $temp_array['route_count'] = $row['route_count']; |
@@ -7000,7 +7000,7 @@ discard block |
||
| 7000 | 7000 | public function countAllCallsigns($limit = true, $olderthanmonths = 0, $sincedate = '') |
| 7001 | 7001 | { |
| 7002 | 7002 | global $globalDBdriver; |
| 7003 | - $query = "SELECT DISTINCT spotter_output.ident, COUNT(spotter_output.ident) AS callsign_icao_count, spotter_output.airline_name, spotter_output.airline_icao |
|
| 7003 | + $query = "SELECT DISTINCT spotter_output.ident, COUNT(spotter_output.ident) AS callsign_icao_count, spotter_output.airline_name, spotter_output.airline_icao |
|
| 7004 | 7004 | FROM spotter_output |
| 7005 | 7005 | WHERE spotter_output.ident <> '' "; |
| 7006 | 7006 | if ($olderthanmonths > 0) { |
@@ -7020,7 +7020,7 @@ discard block |
||
| 7020 | 7020 | $callsign_array = array(); |
| 7021 | 7021 | $temp_array = array(); |
| 7022 | 7022 | |
| 7023 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7023 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7024 | 7024 | { |
| 7025 | 7025 | $temp_array['callsign_icao'] = $row['ident']; |
| 7026 | 7026 | $temp_array['airline_name'] = $row['airline_name']; |
@@ -7052,13 +7052,13 @@ discard block |
||
| 7052 | 7052 | } else $offset = '+00:00'; |
| 7053 | 7053 | |
| 7054 | 7054 | if ($globalDBdriver == 'mysql') { |
| 7055 | - $query = "SELECT DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS date_name, count(*) as date_count |
|
| 7055 | + $query = "SELECT DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS date_name, count(*) as date_count |
|
| 7056 | 7056 | FROM spotter_output |
| 7057 | 7057 | GROUP BY date_name |
| 7058 | 7058 | ORDER BY date_count DESC |
| 7059 | 7059 | LIMIT 10 OFFSET 0"; |
| 7060 | 7060 | } else { |
| 7061 | - $query = "SELECT to_char(spotter_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') AS date_name, count(*) as date_count |
|
| 7061 | + $query = "SELECT to_char(spotter_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') AS date_name, count(*) as date_count |
|
| 7062 | 7062 | FROM spotter_output |
| 7063 | 7063 | GROUP BY date_name |
| 7064 | 7064 | ORDER BY date_count DESC |
@@ -7072,7 +7072,7 @@ discard block |
||
| 7072 | 7072 | $date_array = array(); |
| 7073 | 7073 | $temp_array = array(); |
| 7074 | 7074 | |
| 7075 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7075 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7076 | 7076 | { |
| 7077 | 7077 | $temp_array['date_name'] = $row['date_name']; |
| 7078 | 7078 | $temp_array['date_count'] = $row['date_count']; |
@@ -7101,14 +7101,14 @@ discard block |
||
| 7101 | 7101 | } else $offset = '+00:00'; |
| 7102 | 7102 | |
| 7103 | 7103 | if ($globalDBdriver == 'mysql') { |
| 7104 | - $query = "SELECT DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS date_name, count(*) as date_count |
|
| 7104 | + $query = "SELECT DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS date_name, count(*) as date_count |
|
| 7105 | 7105 | FROM spotter_output |
| 7106 | 7106 | WHERE spotter_output.date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 7 DAY) |
| 7107 | 7107 | GROUP BY date_name |
| 7108 | 7108 | ORDER BY spotter_output.date ASC"; |
| 7109 | 7109 | $query_data = array(':offset' => $offset); |
| 7110 | 7110 | } else { |
| 7111 | - $query = "SELECT to_char(spotter_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') AS date_name, count(*) as date_count |
|
| 7111 | + $query = "SELECT to_char(spotter_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') AS date_name, count(*) as date_count |
|
| 7112 | 7112 | FROM spotter_output |
| 7113 | 7113 | WHERE spotter_output.date >= CURRENT_TIMESTAMP AT TIME ZONE INTERVAL :offset - INTERVAL '7 DAYS' |
| 7114 | 7114 | GROUP BY date_name |
@@ -7122,7 +7122,7 @@ discard block |
||
| 7122 | 7122 | $date_array = array(); |
| 7123 | 7123 | $temp_array = array(); |
| 7124 | 7124 | |
| 7125 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7125 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7126 | 7126 | { |
| 7127 | 7127 | $temp_array['date_name'] = $row['date_name']; |
| 7128 | 7128 | $temp_array['date_count'] = $row['date_count']; |
@@ -7149,14 +7149,14 @@ discard block |
||
| 7149 | 7149 | } else $offset = '+00:00'; |
| 7150 | 7150 | |
| 7151 | 7151 | if ($globalDBdriver == 'mysql') { |
| 7152 | - $query = "SELECT DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS date_name, count(*) as date_count |
|
| 7152 | + $query = "SELECT DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS date_name, count(*) as date_count |
|
| 7153 | 7153 | FROM spotter_output |
| 7154 | 7154 | WHERE spotter_output.date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 MONTH) |
| 7155 | 7155 | GROUP BY date_name |
| 7156 | 7156 | ORDER BY spotter_output.date ASC"; |
| 7157 | 7157 | $query_data = array(':offset' => $offset); |
| 7158 | 7158 | } else { |
| 7159 | - $query = "SELECT to_char(spotter_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') AS date_name, count(*) as date_count |
|
| 7159 | + $query = "SELECT to_char(spotter_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') AS date_name, count(*) as date_count |
|
| 7160 | 7160 | FROM spotter_output |
| 7161 | 7161 | WHERE spotter_output.date >= CURRENT_TIMESTAMP AT TIME ZONE INTERVAL :offset - INTERVAL '1 MONTHS' |
| 7162 | 7162 | GROUP BY date_name |
@@ -7170,7 +7170,7 @@ discard block |
||
| 7170 | 7170 | $date_array = array(); |
| 7171 | 7171 | $temp_array = array(); |
| 7172 | 7172 | |
| 7173 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7173 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7174 | 7174 | { |
| 7175 | 7175 | $temp_array['date_name'] = $row['date_name']; |
| 7176 | 7176 | $temp_array['date_count'] = $row['date_count']; |
@@ -7197,12 +7197,12 @@ discard block |
||
| 7197 | 7197 | } else $offset = '+00:00'; |
| 7198 | 7198 | |
| 7199 | 7199 | if ($globalDBdriver == 'mysql') { |
| 7200 | - $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 |
|
| 7200 | + $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 |
|
| 7201 | 7201 | FROM spotter_output |
| 7202 | 7202 | GROUP BY year_name, month_name |
| 7203 | 7203 | ORDER BY date_count DESC"; |
| 7204 | 7204 | } else { |
| 7205 | - $query = "SELECT EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, count(*) as date_count |
|
| 7205 | + $query = "SELECT EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, count(*) as date_count |
|
| 7206 | 7206 | FROM spotter_output |
| 7207 | 7207 | GROUP BY year_name, month_name |
| 7208 | 7208 | ORDER BY date_count DESC"; |
@@ -7215,7 +7215,7 @@ discard block |
||
| 7215 | 7215 | $date_array = array(); |
| 7216 | 7216 | $temp_array = array(); |
| 7217 | 7217 | |
| 7218 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7218 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7219 | 7219 | { |
| 7220 | 7220 | $temp_array['month_name'] = $row['month_name']; |
| 7221 | 7221 | $temp_array['year_name'] = $row['year_name']; |
@@ -7243,13 +7243,13 @@ discard block |
||
| 7243 | 7243 | } else $offset = '+00:00'; |
| 7244 | 7244 | |
| 7245 | 7245 | if ($globalDBdriver == 'mysql') { |
| 7246 | - $query = "SELECT YEAR(CONVERT_TZ(s.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(s.date,'+00:00', :offset)) AS month_name, count(*) as date_count |
|
| 7246 | + $query = "SELECT YEAR(CONVERT_TZ(s.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(s.date,'+00:00', :offset)) AS month_name, count(*) as date_count |
|
| 7247 | 7247 | FROM spotter_output s |
| 7248 | 7248 | WHERE s.airline_type = 'military' |
| 7249 | 7249 | GROUP BY year_name, month_name |
| 7250 | 7250 | ORDER BY date_count DESC"; |
| 7251 | 7251 | } else { |
| 7252 | - $query = "SELECT EXTRACT(YEAR FROM s.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM s.date AT TIME ZONE INTERVAL :offset) AS month_name, count(*) as date_count |
|
| 7252 | + $query = "SELECT EXTRACT(YEAR FROM s.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM s.date AT TIME ZONE INTERVAL :offset) AS month_name, count(*) as date_count |
|
| 7253 | 7253 | FROM spotter_output s |
| 7254 | 7254 | WHERE s.airline_type = 'military' |
| 7255 | 7255 | GROUP BY year_name, month_name |
@@ -7262,7 +7262,7 @@ discard block |
||
| 7262 | 7262 | $date_array = array(); |
| 7263 | 7263 | $temp_array = array(); |
| 7264 | 7264 | |
| 7265 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7265 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7266 | 7266 | { |
| 7267 | 7267 | $temp_array['month_name'] = $row['month_name']; |
| 7268 | 7268 | $temp_array['year_name'] = $row['year_name']; |
@@ -7290,13 +7290,13 @@ discard block |
||
| 7290 | 7290 | } else $offset = '+00:00'; |
| 7291 | 7291 | |
| 7292 | 7292 | if ($globalDBdriver == 'mysql') { |
| 7293 | - $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 owner_name) as date_count |
|
| 7293 | + $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 owner_name) as date_count |
|
| 7294 | 7294 | FROM spotter_output |
| 7295 | 7295 | WHERE owner_name <> '' |
| 7296 | 7296 | GROUP BY year_name, month_name |
| 7297 | 7297 | ORDER BY date_count DESC"; |
| 7298 | 7298 | } else { |
| 7299 | - $query = "SELECT EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, count(distinct owner_name) as date_count |
|
| 7299 | + $query = "SELECT EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, count(distinct owner_name) as date_count |
|
| 7300 | 7300 | FROM spotter_output |
| 7301 | 7301 | WHERE owner_name <> '' |
| 7302 | 7302 | GROUP BY year_name, month_name |
@@ -7309,7 +7309,7 @@ discard block |
||
| 7309 | 7309 | $date_array = array(); |
| 7310 | 7310 | $temp_array = array(); |
| 7311 | 7311 | |
| 7312 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7312 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7313 | 7313 | { |
| 7314 | 7314 | $temp_array['month_name'] = $row['month_name']; |
| 7315 | 7315 | $temp_array['year_name'] = $row['year_name']; |
@@ -7337,13 +7337,13 @@ discard block |
||
| 7337 | 7337 | } else $offset = '+00:00'; |
| 7338 | 7338 | |
| 7339 | 7339 | if ($globalDBdriver == 'mysql') { |
| 7340 | - $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 pilot_id) as date_count |
|
| 7340 | + $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 pilot_id) as date_count |
|
| 7341 | 7341 | FROM spotter_output |
| 7342 | 7342 | WHERE pilot_id <> '' AND pilot_id IS NOT NULL |
| 7343 | 7343 | GROUP BY year_name, month_name |
| 7344 | 7344 | ORDER BY date_count DESC"; |
| 7345 | 7345 | } else { |
| 7346 | - $query = "SELECT EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, count(distinct pilot_id) as date_count |
|
| 7346 | + $query = "SELECT EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, count(distinct pilot_id) as date_count |
|
| 7347 | 7347 | FROM spotter_output |
| 7348 | 7348 | WHERE pilot_id <> '' AND pilot_id IS NOT NULL |
| 7349 | 7349 | GROUP BY year_name, month_name |
@@ -7356,7 +7356,7 @@ discard block |
||
| 7356 | 7356 | $date_array = array(); |
| 7357 | 7357 | $temp_array = array(); |
| 7358 | 7358 | |
| 7359 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7359 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7360 | 7360 | { |
| 7361 | 7361 | $temp_array['month_name'] = $row['month_name']; |
| 7362 | 7362 | $temp_array['year_name'] = $row['year_name']; |
@@ -7385,13 +7385,13 @@ discard block |
||
| 7385 | 7385 | } else $offset = '+00:00'; |
| 7386 | 7386 | |
| 7387 | 7387 | if ($globalDBdriver == 'mysql') { |
| 7388 | - $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 |
|
| 7388 | + $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 |
|
| 7389 | 7389 | FROM spotter_output |
| 7390 | 7390 | WHERE airline_icao <> '' |
| 7391 | 7391 | GROUP BY year_name, month_name |
| 7392 | 7392 | ORDER BY date_count DESC"; |
| 7393 | 7393 | } else { |
| 7394 | - $query = "SELECT EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, count(distinct airline_icao) as date_count |
|
| 7394 | + $query = "SELECT EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, count(distinct airline_icao) as date_count |
|
| 7395 | 7395 | FROM spotter_output |
| 7396 | 7396 | WHERE airline_icao <> '' |
| 7397 | 7397 | GROUP BY year_name, month_name |
@@ -7404,7 +7404,7 @@ discard block |
||
| 7404 | 7404 | $date_array = array(); |
| 7405 | 7405 | $temp_array = array(); |
| 7406 | 7406 | |
| 7407 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7407 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7408 | 7408 | { |
| 7409 | 7409 | $temp_array['month_name'] = $row['month_name']; |
| 7410 | 7410 | $temp_array['year_name'] = $row['year_name']; |
@@ -7432,13 +7432,13 @@ discard block |
||
| 7432 | 7432 | } else $offset = '+00:00'; |
| 7433 | 7433 | |
| 7434 | 7434 | if ($globalDBdriver == 'mysql') { |
| 7435 | - $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 aircraft_icao) as date_count |
|
| 7435 | + $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 aircraft_icao) as date_count |
|
| 7436 | 7436 | FROM spotter_output |
| 7437 | 7437 | WHERE aircraft_icao <> '' |
| 7438 | 7438 | GROUP BY year_name, month_name |
| 7439 | 7439 | ORDER BY date_count DESC"; |
| 7440 | 7440 | } else { |
| 7441 | - $query = "SELECT EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, count(distinct aircraft_icao) as date_count |
|
| 7441 | + $query = "SELECT EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, count(distinct aircraft_icao) as date_count |
|
| 7442 | 7442 | FROM spotter_output |
| 7443 | 7443 | WHERE aircraft_icao <> '' |
| 7444 | 7444 | GROUP BY year_name, month_name |
@@ -7451,7 +7451,7 @@ discard block |
||
| 7451 | 7451 | $date_array = array(); |
| 7452 | 7452 | $temp_array = array(); |
| 7453 | 7453 | |
| 7454 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7454 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7455 | 7455 | { |
| 7456 | 7456 | $temp_array['month_name'] = $row['month_name']; |
| 7457 | 7457 | $temp_array['year_name'] = $row['year_name']; |
@@ -7480,13 +7480,13 @@ discard block |
||
| 7480 | 7480 | } else $offset = '+00:00'; |
| 7481 | 7481 | |
| 7482 | 7482 | if ($globalDBdriver == 'mysql') { |
| 7483 | - $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(real_arrival_airport_icao) as date_count |
|
| 7483 | + $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(real_arrival_airport_icao) as date_count |
|
| 7484 | 7484 | FROM spotter_output |
| 7485 | 7485 | WHERE real_arrival_airport_icao <> '' |
| 7486 | 7486 | GROUP BY year_name, month_name |
| 7487 | 7487 | ORDER BY date_count DESC"; |
| 7488 | 7488 | } else { |
| 7489 | - $query = "SELECT EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, count(real_arrival_airport_icao) as date_count |
|
| 7489 | + $query = "SELECT EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, count(real_arrival_airport_icao) as date_count |
|
| 7490 | 7490 | FROM spotter_output |
| 7491 | 7491 | WHERE real_arrival_airport_icao <> '' |
| 7492 | 7492 | GROUP BY year_name, month_name |
@@ -7499,7 +7499,7 @@ discard block |
||
| 7499 | 7499 | $date_array = array(); |
| 7500 | 7500 | $temp_array = array(); |
| 7501 | 7501 | |
| 7502 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7502 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7503 | 7503 | { |
| 7504 | 7504 | $temp_array['month_name'] = $row['month_name']; |
| 7505 | 7505 | $temp_array['year_name'] = $row['year_name']; |
@@ -7529,14 +7529,14 @@ discard block |
||
| 7529 | 7529 | } else $offset = '+00:00'; |
| 7530 | 7530 | |
| 7531 | 7531 | if ($globalDBdriver == 'mysql') { |
| 7532 | - $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 |
|
| 7532 | + $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 |
|
| 7533 | 7533 | FROM spotter_output |
| 7534 | 7534 | WHERE spotter_output.date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 YEAR) |
| 7535 | 7535 | GROUP BY year_name, month_name |
| 7536 | 7536 | ORDER BY year_name, month_name ASC"; |
| 7537 | 7537 | $query_data = array(':offset' => $offset); |
| 7538 | 7538 | } else { |
| 7539 | - $query = "SELECT EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name, count(*) as date_count |
|
| 7539 | + $query = "SELECT EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name, count(*) as date_count |
|
| 7540 | 7540 | FROM spotter_output |
| 7541 | 7541 | WHERE spotter_output.date >= CURRENT_TIMESTAMP AT TIME ZONE INTERVAL :offset - INTERVAL '1 YEARS' |
| 7542 | 7542 | GROUP BY year_name, month_name |
@@ -7550,7 +7550,7 @@ discard block |
||
| 7550 | 7550 | $date_array = array(); |
| 7551 | 7551 | $temp_array = array(); |
| 7552 | 7552 | |
| 7553 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7553 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7554 | 7554 | { |
| 7555 | 7555 | $temp_array['year_name'] = $row['year_name']; |
| 7556 | 7556 | $temp_array['month_name'] = $row['month_name']; |
@@ -7590,7 +7590,7 @@ discard block |
||
| 7590 | 7590 | } |
| 7591 | 7591 | |
| 7592 | 7592 | if ($globalDBdriver == 'mysql') { |
| 7593 | - $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
| 7593 | + $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
| 7594 | 7594 | FROM spotter_output |
| 7595 | 7595 | GROUP BY hour_name |
| 7596 | 7596 | ".$orderby_sql; |
@@ -7603,7 +7603,7 @@ discard block |
||
| 7603 | 7603 | */ |
| 7604 | 7604 | $query_data = array(':offset' => $offset); |
| 7605 | 7605 | } else { |
| 7606 | - $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
| 7606 | + $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
| 7607 | 7607 | FROM spotter_output |
| 7608 | 7608 | GROUP BY hour_name |
| 7609 | 7609 | ".$orderby_sql; |
@@ -7616,7 +7616,7 @@ discard block |
||
| 7616 | 7616 | $hour_array = array(); |
| 7617 | 7617 | $temp_array = array(); |
| 7618 | 7618 | |
| 7619 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7619 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7620 | 7620 | { |
| 7621 | 7621 | $temp_array['hour_name'] = $row['hour_name']; |
| 7622 | 7622 | $temp_array['hour_count'] = $row['hour_count']; |
@@ -7643,16 +7643,16 @@ discard block |
||
| 7643 | 7643 | $offset = $datetime->format('P'); |
| 7644 | 7644 | } else $offset = '+00:00'; |
| 7645 | 7645 | |
| 7646 | - $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING); |
|
| 7646 | + $airline_icao = filter_var($airline_icao, FILTER_SANITIZE_STRING); |
|
| 7647 | 7647 | |
| 7648 | 7648 | if ($globalDBdriver == 'mysql') { |
| 7649 | - $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
| 7649 | + $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
| 7650 | 7650 | FROM spotter_output |
| 7651 | 7651 | WHERE spotter_output.airline_icao = :airline_icao |
| 7652 | 7652 | GROUP BY hour_name |
| 7653 | 7653 | ORDER BY hour_name ASC"; |
| 7654 | 7654 | } else { |
| 7655 | - $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
| 7655 | + $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
| 7656 | 7656 | FROM spotter_output |
| 7657 | 7657 | WHERE spotter_output.airline_icao = :airline_icao |
| 7658 | 7658 | GROUP BY hour_name |
@@ -7660,12 +7660,12 @@ discard block |
||
| 7660 | 7660 | } |
| 7661 | 7661 | |
| 7662 | 7662 | $sth = $this->db->prepare($query); |
| 7663 | - $sth->execute(array(':airline_icao' => $airline_icao,':offset' => $offset)); |
|
| 7663 | + $sth->execute(array(':airline_icao' => $airline_icao, ':offset' => $offset)); |
|
| 7664 | 7664 | |
| 7665 | 7665 | $hour_array = array(); |
| 7666 | 7666 | $temp_array = array(); |
| 7667 | 7667 | |
| 7668 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7668 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7669 | 7669 | { |
| 7670 | 7670 | $temp_array['hour_name'] = $row['hour_name']; |
| 7671 | 7671 | $temp_array['hour_count'] = $row['hour_count']; |
@@ -7688,7 +7688,7 @@ discard block |
||
| 7688 | 7688 | public function countAllHoursByAircraft($aircraft_icao) |
| 7689 | 7689 | { |
| 7690 | 7690 | global $globalTimezone, $globalDBdriver; |
| 7691 | - $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
|
| 7691 | + $aircraft_icao = filter_var($aircraft_icao, FILTER_SANITIZE_STRING); |
|
| 7692 | 7692 | if ($globalTimezone != '') { |
| 7693 | 7693 | date_default_timezone_set($globalTimezone); |
| 7694 | 7694 | $datetime = new DateTime(); |
@@ -7696,13 +7696,13 @@ discard block |
||
| 7696 | 7696 | } else $offset = '+00:00'; |
| 7697 | 7697 | |
| 7698 | 7698 | if ($globalDBdriver == 'mysql') { |
| 7699 | - $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
| 7699 | + $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
| 7700 | 7700 | FROM spotter_output |
| 7701 | 7701 | WHERE spotter_output.aircraft_icao = :aircraft_icao |
| 7702 | 7702 | GROUP BY hour_name |
| 7703 | 7703 | ORDER BY hour_name ASC"; |
| 7704 | 7704 | } else { |
| 7705 | - $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
| 7705 | + $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
| 7706 | 7706 | FROM spotter_output |
| 7707 | 7707 | WHERE spotter_output.aircraft_icao = :aircraft_icao |
| 7708 | 7708 | GROUP BY hour_name |
@@ -7710,12 +7710,12 @@ discard block |
||
| 7710 | 7710 | } |
| 7711 | 7711 | |
| 7712 | 7712 | $sth = $this->db->prepare($query); |
| 7713 | - $sth->execute(array(':aircraft_icao' => $aircraft_icao,':offset' => $offset)); |
|
| 7713 | + $sth->execute(array(':aircraft_icao' => $aircraft_icao, ':offset' => $offset)); |
|
| 7714 | 7714 | |
| 7715 | 7715 | $hour_array = array(); |
| 7716 | 7716 | $temp_array = array(); |
| 7717 | 7717 | |
| 7718 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7718 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7719 | 7719 | { |
| 7720 | 7720 | $temp_array['hour_name'] = $row['hour_name']; |
| 7721 | 7721 | $temp_array['hour_count'] = $row['hour_count']; |
@@ -7736,7 +7736,7 @@ discard block |
||
| 7736 | 7736 | public function countAllHoursByRegistration($registration) |
| 7737 | 7737 | { |
| 7738 | 7738 | global $globalTimezone, $globalDBdriver; |
| 7739 | - $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
|
| 7739 | + $registration = filter_var($registration, FILTER_SANITIZE_STRING); |
|
| 7740 | 7740 | if ($globalTimezone != '') { |
| 7741 | 7741 | date_default_timezone_set($globalTimezone); |
| 7742 | 7742 | $datetime = new DateTime(); |
@@ -7744,13 +7744,13 @@ discard block |
||
| 7744 | 7744 | } else $offset = '+00:00'; |
| 7745 | 7745 | |
| 7746 | 7746 | if ($globalDBdriver == 'mysql') { |
| 7747 | - $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
| 7747 | + $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
| 7748 | 7748 | FROM spotter_output |
| 7749 | 7749 | WHERE spotter_output.registration = :registration |
| 7750 | 7750 | GROUP BY hour_name |
| 7751 | 7751 | ORDER BY hour_name ASC"; |
| 7752 | 7752 | } else { |
| 7753 | - $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
| 7753 | + $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
| 7754 | 7754 | FROM spotter_output |
| 7755 | 7755 | WHERE spotter_output.registration = :registration |
| 7756 | 7756 | GROUP BY hour_name |
@@ -7758,12 +7758,12 @@ discard block |
||
| 7758 | 7758 | } |
| 7759 | 7759 | |
| 7760 | 7760 | $sth = $this->db->prepare($query); |
| 7761 | - $sth->execute(array(':registration' => $registration,':offset' => $offset)); |
|
| 7761 | + $sth->execute(array(':registration' => $registration, ':offset' => $offset)); |
|
| 7762 | 7762 | |
| 7763 | 7763 | $hour_array = array(); |
| 7764 | 7764 | $temp_array = array(); |
| 7765 | 7765 | |
| 7766 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7766 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7767 | 7767 | { |
| 7768 | 7768 | $temp_array['hour_name'] = $row['hour_name']; |
| 7769 | 7769 | $temp_array['hour_count'] = $row['hour_count']; |
@@ -7784,7 +7784,7 @@ discard block |
||
| 7784 | 7784 | public function countAllHoursByAirport($airport_icao) |
| 7785 | 7785 | { |
| 7786 | 7786 | global $globalTimezone, $globalDBdriver; |
| 7787 | - $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
|
| 7787 | + $airport_icao = filter_var($airport_icao, FILTER_SANITIZE_STRING); |
|
| 7788 | 7788 | if ($globalTimezone != '') { |
| 7789 | 7789 | date_default_timezone_set($globalTimezone); |
| 7790 | 7790 | $datetime = new DateTime(); |
@@ -7792,13 +7792,13 @@ discard block |
||
| 7792 | 7792 | } else $offset = '+00:00'; |
| 7793 | 7793 | |
| 7794 | 7794 | if ($globalDBdriver == 'mysql') { |
| 7795 | - $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
| 7795 | + $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
| 7796 | 7796 | FROM spotter_output |
| 7797 | 7797 | WHERE (spotter_output.departure_airport_icao = :airport_icao OR spotter_output.arrival_airport_icao = :airport_icao) |
| 7798 | 7798 | GROUP BY hour_name |
| 7799 | 7799 | ORDER BY hour_name ASC"; |
| 7800 | 7800 | } else { |
| 7801 | - $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
| 7801 | + $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
| 7802 | 7802 | FROM spotter_output |
| 7803 | 7803 | WHERE (spotter_output.departure_airport_icao = :airport_icao OR spotter_output.arrival_airport_icao = :airport_icao) |
| 7804 | 7804 | GROUP BY hour_name |
@@ -7806,12 +7806,12 @@ discard block |
||
| 7806 | 7806 | } |
| 7807 | 7807 | |
| 7808 | 7808 | $sth = $this->db->prepare($query); |
| 7809 | - $sth->execute(array(':airport_icao' => $airport_icao,':offset' => $offset)); |
|
| 7809 | + $sth->execute(array(':airport_icao' => $airport_icao, ':offset' => $offset)); |
|
| 7810 | 7810 | |
| 7811 | 7811 | $hour_array = array(); |
| 7812 | 7812 | $temp_array = array(); |
| 7813 | 7813 | |
| 7814 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7814 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7815 | 7815 | { |
| 7816 | 7816 | $temp_array['hour_name'] = $row['hour_name']; |
| 7817 | 7817 | $temp_array['hour_count'] = $row['hour_count']; |
@@ -7833,7 +7833,7 @@ discard block |
||
| 7833 | 7833 | public function countAllHoursByManufacturer($aircraft_manufacturer) |
| 7834 | 7834 | { |
| 7835 | 7835 | global $globalTimezone, $globalDBdriver; |
| 7836 | - $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
|
| 7836 | + $aircraft_manufacturer = filter_var($aircraft_manufacturer, FILTER_SANITIZE_STRING); |
|
| 7837 | 7837 | if ($globalTimezone != '') { |
| 7838 | 7838 | date_default_timezone_set($globalTimezone); |
| 7839 | 7839 | $datetime = new DateTime(); |
@@ -7841,13 +7841,13 @@ discard block |
||
| 7841 | 7841 | } else $offset = '+00:00'; |
| 7842 | 7842 | |
| 7843 | 7843 | if ($globalDBdriver == 'mysql') { |
| 7844 | - $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
| 7844 | + $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
| 7845 | 7845 | FROM spotter_output |
| 7846 | 7846 | WHERE spotter_output.aircraft_manufacturer = :aircraft_manufacturer |
| 7847 | 7847 | GROUP BY hour_name |
| 7848 | 7848 | ORDER BY hour_name ASC"; |
| 7849 | 7849 | } else { |
| 7850 | - $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
| 7850 | + $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
| 7851 | 7851 | FROM spotter_output |
| 7852 | 7852 | WHERE spotter_output.aircraft_manufacturer = :aircraft_manufacturer |
| 7853 | 7853 | GROUP BY hour_name |
@@ -7855,12 +7855,12 @@ discard block |
||
| 7855 | 7855 | } |
| 7856 | 7856 | |
| 7857 | 7857 | $sth = $this->db->prepare($query); |
| 7858 | - $sth->execute(array(':aircraft_manufacturer' => $aircraft_manufacturer,':offset' => $offset)); |
|
| 7858 | + $sth->execute(array(':aircraft_manufacturer' => $aircraft_manufacturer, ':offset' => $offset)); |
|
| 7859 | 7859 | |
| 7860 | 7860 | $hour_array = array(); |
| 7861 | 7861 | $temp_array = array(); |
| 7862 | 7862 | |
| 7863 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7863 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7864 | 7864 | { |
| 7865 | 7865 | $temp_array['hour_name'] = $row['hour_name']; |
| 7866 | 7866 | $temp_array['hour_count'] = $row['hour_count']; |
@@ -7882,7 +7882,7 @@ discard block |
||
| 7882 | 7882 | public function countAllHoursByDate($date) |
| 7883 | 7883 | { |
| 7884 | 7884 | global $globalTimezone, $globalDBdriver; |
| 7885 | - $date = filter_var($date,FILTER_SANITIZE_STRING); |
|
| 7885 | + $date = filter_var($date, FILTER_SANITIZE_STRING); |
|
| 7886 | 7886 | if ($globalTimezone != '') { |
| 7887 | 7887 | date_default_timezone_set($globalTimezone); |
| 7888 | 7888 | $datetime = new DateTime($date); |
@@ -7890,13 +7890,13 @@ discard block |
||
| 7890 | 7890 | } else $offset = '+00:00'; |
| 7891 | 7891 | |
| 7892 | 7892 | if ($globalDBdriver == 'mysql') { |
| 7893 | - $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
| 7893 | + $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
| 7894 | 7894 | FROM spotter_output |
| 7895 | 7895 | WHERE DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) = :date |
| 7896 | 7896 | GROUP BY hour_name |
| 7897 | 7897 | ORDER BY hour_name ASC"; |
| 7898 | 7898 | } else { |
| 7899 | - $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
| 7899 | + $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
| 7900 | 7900 | FROM spotter_output |
| 7901 | 7901 | WHERE to_char(spotter_output.date AT TIME ZONE INTERVAL :offset, 'YYYY-mm-dd') = :date |
| 7902 | 7902 | GROUP BY hour_name |
@@ -7909,7 +7909,7 @@ discard block |
||
| 7909 | 7909 | $hour_array = array(); |
| 7910 | 7910 | $temp_array = array(); |
| 7911 | 7911 | |
| 7912 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7912 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7913 | 7913 | { |
| 7914 | 7914 | $temp_array['hour_name'] = $row['hour_name']; |
| 7915 | 7915 | $temp_array['hour_count'] = $row['hour_count']; |
@@ -7931,7 +7931,7 @@ discard block |
||
| 7931 | 7931 | public function countAllHoursByIdent($ident) |
| 7932 | 7932 | { |
| 7933 | 7933 | global $globalTimezone, $globalDBdriver; |
| 7934 | - $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
|
| 7934 | + $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
|
| 7935 | 7935 | if ($globalTimezone != '') { |
| 7936 | 7936 | date_default_timezone_set($globalTimezone); |
| 7937 | 7937 | $datetime = new DateTime(); |
@@ -7939,13 +7939,13 @@ discard block |
||
| 7939 | 7939 | } else $offset = '+00:00'; |
| 7940 | 7940 | |
| 7941 | 7941 | if ($globalDBdriver == 'mysql') { |
| 7942 | - $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
| 7942 | + $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
| 7943 | 7943 | FROM spotter_output |
| 7944 | 7944 | WHERE spotter_output.ident = :ident |
| 7945 | 7945 | GROUP BY hour_name |
| 7946 | 7946 | ORDER BY hour_name ASC"; |
| 7947 | 7947 | } else { |
| 7948 | - $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
| 7948 | + $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
| 7949 | 7949 | FROM spotter_output |
| 7950 | 7950 | WHERE spotter_output.ident = :ident |
| 7951 | 7951 | GROUP BY hour_name |
@@ -7954,12 +7954,12 @@ discard block |
||
| 7954 | 7954 | |
| 7955 | 7955 | |
| 7956 | 7956 | $sth = $this->db->prepare($query); |
| 7957 | - $sth->execute(array(':ident' => $ident,':offset' => $offset)); |
|
| 7957 | + $sth->execute(array(':ident' => $ident, ':offset' => $offset)); |
|
| 7958 | 7958 | |
| 7959 | 7959 | $hour_array = array(); |
| 7960 | 7960 | $temp_array = array(); |
| 7961 | 7961 | |
| 7962 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7962 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7963 | 7963 | { |
| 7964 | 7964 | $temp_array['hour_name'] = $row['hour_name']; |
| 7965 | 7965 | $temp_array['hour_count'] = $row['hour_count']; |
@@ -7981,8 +7981,8 @@ discard block |
||
| 7981 | 7981 | public function countAllHoursByRoute($departure_airport_icao, $arrival_airport_icao) |
| 7982 | 7982 | { |
| 7983 | 7983 | global $globalTimezone, $globalDBdriver; |
| 7984 | - $departure_airport_icao = filter_var($departure_airport_icao,FILTER_SANITIZE_STRING); |
|
| 7985 | - $arrival_airport_icao = filter_var($arrival_airport_icao,FILTER_SANITIZE_STRING); |
|
| 7984 | + $departure_airport_icao = filter_var($departure_airport_icao, FILTER_SANITIZE_STRING); |
|
| 7985 | + $arrival_airport_icao = filter_var($arrival_airport_icao, FILTER_SANITIZE_STRING); |
|
| 7986 | 7986 | if ($globalTimezone != '') { |
| 7987 | 7987 | date_default_timezone_set($globalTimezone); |
| 7988 | 7988 | $datetime = new DateTime(); |
@@ -7990,13 +7990,13 @@ discard block |
||
| 7990 | 7990 | } else $offset = '+00:00'; |
| 7991 | 7991 | |
| 7992 | 7992 | if ($globalDBdriver == 'mysql') { |
| 7993 | - $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
| 7993 | + $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
| 7994 | 7994 | FROM spotter_output |
| 7995 | 7995 | WHERE (spotter_output.departure_airport_icao = :departure_airport_icao) AND (spotter_output.arrival_airport_icao = :arrival_airport_icao) |
| 7996 | 7996 | GROUP BY hour_name |
| 7997 | 7997 | ORDER BY hour_name ASC"; |
| 7998 | 7998 | } else { |
| 7999 | - $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
| 7999 | + $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
| 8000 | 8000 | FROM spotter_output |
| 8001 | 8001 | WHERE (spotter_output.departure_airport_icao = :departure_airport_icao) AND (spotter_output.arrival_airport_icao = :arrival_airport_icao) |
| 8002 | 8002 | GROUP BY hour_name |
@@ -8004,12 +8004,12 @@ discard block |
||
| 8004 | 8004 | } |
| 8005 | 8005 | |
| 8006 | 8006 | $sth = $this->db->prepare($query); |
| 8007 | - $sth->execute(array(':departure_airport_icao' => $departure_airport_icao,':arrival_airport_icao' => $arrival_airport_icao,':offset' => $offset)); |
|
| 8007 | + $sth->execute(array(':departure_airport_icao' => $departure_airport_icao, ':arrival_airport_icao' => $arrival_airport_icao, ':offset' => $offset)); |
|
| 8008 | 8008 | |
| 8009 | 8009 | $hour_array = array(); |
| 8010 | 8010 | $temp_array = array(); |
| 8011 | 8011 | |
| 8012 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8012 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8013 | 8013 | { |
| 8014 | 8014 | $temp_array['hour_name'] = $row['hour_name']; |
| 8015 | 8015 | $temp_array['hour_count'] = $row['hour_count']; |
@@ -8030,7 +8030,7 @@ discard block |
||
| 8030 | 8030 | public function countAllHoursByCountry($country) |
| 8031 | 8031 | { |
| 8032 | 8032 | global $globalTimezone, $globalDBdriver; |
| 8033 | - $country = filter_var($country,FILTER_SANITIZE_STRING); |
|
| 8033 | + $country = filter_var($country, FILTER_SANITIZE_STRING); |
|
| 8034 | 8034 | if ($globalTimezone != '') { |
| 8035 | 8035 | date_default_timezone_set($globalTimezone); |
| 8036 | 8036 | $datetime = new DateTime(); |
@@ -8038,13 +8038,13 @@ discard block |
||
| 8038 | 8038 | } else $offset = '+00:00'; |
| 8039 | 8039 | |
| 8040 | 8040 | if ($globalDBdriver == 'mysql') { |
| 8041 | - $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
| 8041 | + $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
| 8042 | 8042 | FROM spotter_output |
| 8043 | 8043 | WHERE ((spotter_output.departure_airport_country = :country) OR (spotter_output.arrival_airport_country = :country)) OR spotter_output.airline_country = :country |
| 8044 | 8044 | GROUP BY hour_name |
| 8045 | 8045 | ORDER BY hour_name ASC"; |
| 8046 | 8046 | } else { |
| 8047 | - $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
| 8047 | + $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
| 8048 | 8048 | FROM spotter_output |
| 8049 | 8049 | WHERE ((spotter_output.departure_airport_country = :country) OR (spotter_output.arrival_airport_country = :country)) OR spotter_output.airline_country = :country |
| 8050 | 8050 | GROUP BY hour_name |
@@ -8052,12 +8052,12 @@ discard block |
||
| 8052 | 8052 | } |
| 8053 | 8053 | |
| 8054 | 8054 | $sth = $this->db->prepare($query); |
| 8055 | - $sth->execute(array(':country' => $country,':offset' => $offset)); |
|
| 8055 | + $sth->execute(array(':country' => $country, ':offset' => $offset)); |
|
| 8056 | 8056 | |
| 8057 | 8057 | $hour_array = array(); |
| 8058 | 8058 | $temp_array = array(); |
| 8059 | 8059 | |
| 8060 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8060 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8061 | 8061 | { |
| 8062 | 8062 | $temp_array['hour_name'] = $row['hour_name']; |
| 8063 | 8063 | $temp_array['hour_count'] = $row['hour_count']; |
@@ -8079,7 +8079,7 @@ discard block |
||
| 8079 | 8079 | */ |
| 8080 | 8080 | public function countOverallAircrafts() |
| 8081 | 8081 | { |
| 8082 | - $query = "SELECT COUNT(DISTINCT spotter_output.aircraft_icao) AS aircraft_count |
|
| 8082 | + $query = "SELECT COUNT(DISTINCT spotter_output.aircraft_icao) AS aircraft_count |
|
| 8083 | 8083 | FROM spotter_output |
| 8084 | 8084 | WHERE spotter_output.ident <> ''"; |
| 8085 | 8085 | |
@@ -8097,7 +8097,7 @@ discard block |
||
| 8097 | 8097 | */ |
| 8098 | 8098 | public function countOverallArrival() |
| 8099 | 8099 | { |
| 8100 | - $query = "SELECT COUNT(spotter_output.real_arrival_airport_icao) AS arrival_count |
|
| 8100 | + $query = "SELECT COUNT(spotter_output.real_arrival_airport_icao) AS arrival_count |
|
| 8101 | 8101 | FROM spotter_output |
| 8102 | 8102 | WHERE spotter_output.arrival_airport_icao <> ''"; |
| 8103 | 8103 | |
@@ -8115,7 +8115,7 @@ discard block |
||
| 8115 | 8115 | */ |
| 8116 | 8116 | public function countOverallPilots() |
| 8117 | 8117 | { |
| 8118 | - $query = "SELECT COUNT(DISTINCT spotter_output.pilot_id) AS pilot_count |
|
| 8118 | + $query = "SELECT COUNT(DISTINCT spotter_output.pilot_id) AS pilot_count |
|
| 8119 | 8119 | FROM spotter_output |
| 8120 | 8120 | WHERE spotter_output.pilot_id <> ''"; |
| 8121 | 8121 | |
@@ -8133,7 +8133,7 @@ discard block |
||
| 8133 | 8133 | */ |
| 8134 | 8134 | public function countOverallOwners() |
| 8135 | 8135 | { |
| 8136 | - $query = "SELECT COUNT(DISTINCT spotter_output.owner_name) AS owner_count |
|
| 8136 | + $query = "SELECT COUNT(DISTINCT spotter_output.owner_name) AS owner_count |
|
| 8137 | 8137 | FROM spotter_output |
| 8138 | 8138 | WHERE spotter_output.owner_name <> ''"; |
| 8139 | 8139 | |
@@ -8152,7 +8152,7 @@ discard block |
||
| 8152 | 8152 | */ |
| 8153 | 8153 | public function countOverallFlights() |
| 8154 | 8154 | { |
| 8155 | - $query = "SELECT COUNT(spotter_output.spotter_id) AS flight_count |
|
| 8155 | + $query = "SELECT COUNT(spotter_output.spotter_id) AS flight_count |
|
| 8156 | 8156 | FROM spotter_output"; |
| 8157 | 8157 | |
| 8158 | 8158 | |
@@ -8169,7 +8169,7 @@ discard block |
||
| 8169 | 8169 | */ |
| 8170 | 8170 | public function countOverallMilitaryFlights() |
| 8171 | 8171 | { |
| 8172 | - $query = "SELECT COUNT(s.spotter_id) AS flight_count |
|
| 8172 | + $query = "SELECT COUNT(s.spotter_id) AS flight_count |
|
| 8173 | 8173 | FROM spotter_output s, airlines a WHERE s.airline_icao = a.icao AND a.type = 'military'"; |
| 8174 | 8174 | |
| 8175 | 8175 | |
@@ -8188,7 +8188,7 @@ discard block |
||
| 8188 | 8188 | */ |
| 8189 | 8189 | public function countOverallAirlines() |
| 8190 | 8190 | { |
| 8191 | - $query = "SELECT COUNT(DISTINCT spotter_output.airline_name) AS airline_count |
|
| 8191 | + $query = "SELECT COUNT(DISTINCT spotter_output.airline_name) AS airline_count |
|
| 8192 | 8192 | FROM spotter_output"; |
| 8193 | 8193 | |
| 8194 | 8194 | |
@@ -8214,13 +8214,13 @@ discard block |
||
| 8214 | 8214 | } else $offset = '+00:00'; |
| 8215 | 8215 | |
| 8216 | 8216 | if ($globalDBdriver == 'mysql') { |
| 8217 | - $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
| 8217 | + $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
| 8218 | 8218 | FROM spotter_output |
| 8219 | 8219 | WHERE DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) = CURDATE() |
| 8220 | 8220 | GROUP BY hour_name |
| 8221 | 8221 | ORDER BY hour_name ASC"; |
| 8222 | 8222 | } else { |
| 8223 | - $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
| 8223 | + $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
| 8224 | 8224 | FROM spotter_output |
| 8225 | 8225 | WHERE to_char(spotter_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') = CAST(NOW() AS date) |
| 8226 | 8226 | GROUP BY hour_name |
@@ -8233,7 +8233,7 @@ discard block |
||
| 8233 | 8233 | $hour_array = array(); |
| 8234 | 8234 | $temp_array = array(); |
| 8235 | 8235 | |
| 8236 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8236 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8237 | 8237 | { |
| 8238 | 8238 | $temp_array['hour_name'] = $row['hour_name']; |
| 8239 | 8239 | $temp_array['hour_count'] = $row['hour_count']; |
@@ -8257,8 +8257,8 @@ discard block |
||
| 8257 | 8257 | if ($limit != "") |
| 8258 | 8258 | { |
| 8259 | 8259 | $limit_array = explode(",", $limit); |
| 8260 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
| 8261 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
| 8260 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
| 8261 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
| 8262 | 8262 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
| 8263 | 8263 | { |
| 8264 | 8264 | //$limit_query = " LIMIT ".$limit_array[0].",".$limit_array[1]; |
@@ -8305,7 +8305,7 @@ discard block |
||
| 8305 | 8305 | FROM spotter_output |
| 8306 | 8306 | WHERE DATE_PART('dow', spotter_output.date) = DATE_PART('dow', date 'now' AT TIME ZONE :timezone) AND EXTRACT (HOUR FROM spotter_output.date AT TIME ZONE :timezone) >= '$currentHour' AND EXTRACT (HOUR FROM spotter_output.date AT TIME ZONE :timezone) <= '$next3Hours' AND ident <> '' |
| 8307 | 8307 | GROUP BY spotter_output.ident, spotter_output.spotter_id HAVING count(spotter_output.ident) > 10 $orderby_query"; |
| 8308 | - $spotter_array = $this->getDataFromDB($query.$limit_query,array(':timezone' => $globalTimezone)); |
|
| 8308 | + $spotter_array = $this->getDataFromDB($query.$limit_query, array(':timezone' => $globalTimezone)); |
|
| 8309 | 8309 | } |
| 8310 | 8310 | return $spotter_array; |
| 8311 | 8311 | } |
@@ -8319,9 +8319,9 @@ discard block |
||
| 8319 | 8319 | */ |
| 8320 | 8320 | public function getSpotterIDBasedOnFlightAwareID($flightaware_id) |
| 8321 | 8321 | { |
| 8322 | - $flightaware_id = filter_var($flightaware_id,FILTER_SANITIZE_STRING); |
|
| 8322 | + $flightaware_id = filter_var($flightaware_id, FILTER_SANITIZE_STRING); |
|
| 8323 | 8323 | |
| 8324 | - $query = "SELECT spotter_output.spotter_id |
|
| 8324 | + $query = "SELECT spotter_output.spotter_id |
|
| 8325 | 8325 | FROM spotter_output |
| 8326 | 8326 | WHERE spotter_output.flightaware_id = '".$flightaware_id."'"; |
| 8327 | 8327 | |
@@ -8329,7 +8329,7 @@ discard block |
||
| 8329 | 8329 | $sth = $this->db->prepare($query); |
| 8330 | 8330 | $sth->execute(); |
| 8331 | 8331 | |
| 8332 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8332 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8333 | 8333 | { |
| 8334 | 8334 | return $row['spotter_id']; |
| 8335 | 8335 | } |
@@ -8354,23 +8354,23 @@ discard block |
||
| 8354 | 8354 | } |
| 8355 | 8355 | |
| 8356 | 8356 | $current_date = date("Y-m-d H:i:s"); |
| 8357 | - $date = date("Y-m-d H:i:s",strtotime($dateString." UTC")); |
|
| 8357 | + $date = date("Y-m-d H:i:s", strtotime($dateString." UTC")); |
|
| 8358 | 8358 | |
| 8359 | 8359 | $diff = abs(strtotime($current_date) - strtotime($date)); |
| 8360 | 8360 | |
| 8361 | - $time_array['years'] = floor($diff / (365*60*60*24)); |
|
| 8361 | + $time_array['years'] = floor($diff/(365*60*60*24)); |
|
| 8362 | 8362 | $years = $time_array['years']; |
| 8363 | 8363 | |
| 8364 | - $time_array['months'] = floor(($diff - $years * 365*60*60*24) / (30*60*60*24)); |
|
| 8364 | + $time_array['months'] = floor(($diff - $years*365*60*60*24)/(30*60*60*24)); |
|
| 8365 | 8365 | $months = $time_array['months']; |
| 8366 | 8366 | |
| 8367 | - $time_array['days'] = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24)/ (60*60*24)); |
|
| 8367 | + $time_array['days'] = floor(($diff - $years*365*60*60*24 - $months*30*60*60*24)/(60*60*24)); |
|
| 8368 | 8368 | $days = $time_array['days']; |
| 8369 | - $time_array['hours'] = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24 - $days*60*60*24)/ (60*60)); |
|
| 8369 | + $time_array['hours'] = floor(($diff - $years*365*60*60*24 - $months*30*60*60*24 - $days*60*60*24)/(60*60)); |
|
| 8370 | 8370 | $hours = $time_array['hours']; |
| 8371 | - $time_array['minutes'] = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24 - $days*60*60*24 - $hours*60*60)/ 60); |
|
| 8371 | + $time_array['minutes'] = floor(($diff - $years*365*60*60*24 - $months*30*60*60*24 - $days*60*60*24 - $hours*60*60)/60); |
|
| 8372 | 8372 | $minutes = $time_array['minutes']; |
| 8373 | - $time_array['seconds'] = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24 - $days*60*60*24 - $hours*60*60 - $minutes*60)); |
|
| 8373 | + $time_array['seconds'] = floor(($diff - $years*365*60*60*24 - $months*30*60*60*24 - $days*60*60*24 - $hours*60*60 - $minutes*60)); |
|
| 8374 | 8374 | |
| 8375 | 8375 | return $time_array; |
| 8376 | 8376 | } |
@@ -8396,63 +8396,63 @@ discard block |
||
| 8396 | 8396 | $temp_array['direction_degree'] = $direction; |
| 8397 | 8397 | $temp_array['direction_shortname'] = "N"; |
| 8398 | 8398 | $temp_array['direction_fullname'] = "North"; |
| 8399 | - } elseif ($direction >= 22.5 && $direction < 45){ |
|
| 8399 | + } elseif ($direction >= 22.5 && $direction < 45) { |
|
| 8400 | 8400 | $temp_array['direction_degree'] = $direction; |
| 8401 | 8401 | $temp_array['direction_shortname'] = "NNE"; |
| 8402 | 8402 | $temp_array['direction_fullname'] = "North-Northeast"; |
| 8403 | - } elseif ($direction >= 45 && $direction < 67.5){ |
|
| 8403 | + } elseif ($direction >= 45 && $direction < 67.5) { |
|
| 8404 | 8404 | $temp_array['direction_degree'] = $direction; |
| 8405 | 8405 | $temp_array['direction_shortname'] = "NE"; |
| 8406 | 8406 | $temp_array['direction_fullname'] = "Northeast"; |
| 8407 | - } elseif ($direction >= 67.5 && $direction < 90){ |
|
| 8407 | + } elseif ($direction >= 67.5 && $direction < 90) { |
|
| 8408 | 8408 | $temp_array['direction_degree'] = $direction; |
| 8409 | 8409 | $temp_array['direction_shortname'] = "ENE"; |
| 8410 | 8410 | $temp_array['direction_fullname'] = "East-Northeast"; |
| 8411 | - } elseif ($direction >= 90 && $direction < 112.5){ |
|
| 8411 | + } elseif ($direction >= 90 && $direction < 112.5) { |
|
| 8412 | 8412 | $temp_array['direction_degree'] = $direction; |
| 8413 | 8413 | $temp_array['direction_shortname'] = "E"; |
| 8414 | 8414 | $temp_array['direction_fullname'] = "East"; |
| 8415 | - } elseif ($direction >= 112.5 && $direction < 135){ |
|
| 8415 | + } elseif ($direction >= 112.5 && $direction < 135) { |
|
| 8416 | 8416 | $temp_array['direction_degree'] = $direction; |
| 8417 | 8417 | $temp_array['direction_shortname'] = "ESE"; |
| 8418 | 8418 | $temp_array['direction_fullname'] = "East-Southeast"; |
| 8419 | - } elseif ($direction >= 135 && $direction < 157.5){ |
|
| 8419 | + } elseif ($direction >= 135 && $direction < 157.5) { |
|
| 8420 | 8420 | $temp_array['direction_degree'] = $direction; |
| 8421 | 8421 | $temp_array['direction_shortname'] = "SE"; |
| 8422 | 8422 | $temp_array['direction_fullname'] = "Southeast"; |
| 8423 | - } elseif ($direction >= 157.5 && $direction < 180){ |
|
| 8423 | + } elseif ($direction >= 157.5 && $direction < 180) { |
|
| 8424 | 8424 | $temp_array['direction_degree'] = $direction; |
| 8425 | 8425 | $temp_array['direction_shortname'] = "SSE"; |
| 8426 | 8426 | $temp_array['direction_fullname'] = "South-Southeast"; |
| 8427 | - } elseif ($direction >= 180 && $direction < 202.5){ |
|
| 8427 | + } elseif ($direction >= 180 && $direction < 202.5) { |
|
| 8428 | 8428 | $temp_array['direction_degree'] = $direction; |
| 8429 | 8429 | $temp_array['direction_shortname'] = "S"; |
| 8430 | 8430 | $temp_array['direction_fullname'] = "South"; |
| 8431 | - } elseif ($direction >= 202.5 && $direction < 225){ |
|
| 8431 | + } elseif ($direction >= 202.5 && $direction < 225) { |
|
| 8432 | 8432 | $temp_array['direction_degree'] = $direction; |
| 8433 | 8433 | $temp_array['direction_shortname'] = "SSW"; |
| 8434 | 8434 | $temp_array['direction_fullname'] = "South-Southwest"; |
| 8435 | - } elseif ($direction >= 225 && $direction < 247.5){ |
|
| 8435 | + } elseif ($direction >= 225 && $direction < 247.5) { |
|
| 8436 | 8436 | $temp_array['direction_degree'] = $direction; |
| 8437 | 8437 | $temp_array['direction_shortname'] = "SW"; |
| 8438 | 8438 | $temp_array['direction_fullname'] = "Southwest"; |
| 8439 | - } elseif ($direction >= 247.5 && $direction < 270){ |
|
| 8439 | + } elseif ($direction >= 247.5 && $direction < 270) { |
|
| 8440 | 8440 | $temp_array['direction_degree'] = $direction; |
| 8441 | 8441 | $temp_array['direction_shortname'] = "WSW"; |
| 8442 | 8442 | $temp_array['direction_fullname'] = "West-Southwest"; |
| 8443 | - } elseif ($direction >= 270 && $direction < 292.5){ |
|
| 8443 | + } elseif ($direction >= 270 && $direction < 292.5) { |
|
| 8444 | 8444 | $temp_array['direction_degree'] = $direction; |
| 8445 | 8445 | $temp_array['direction_shortname'] = "W"; |
| 8446 | 8446 | $temp_array['direction_fullname'] = "West"; |
| 8447 | - } elseif ($direction >= 292.5 && $direction < 315){ |
|
| 8447 | + } elseif ($direction >= 292.5 && $direction < 315) { |
|
| 8448 | 8448 | $temp_array['direction_degree'] = $direction; |
| 8449 | 8449 | $temp_array['direction_shortname'] = "WNW"; |
| 8450 | 8450 | $temp_array['direction_fullname'] = "West-Northwest"; |
| 8451 | - } elseif ($direction >= 315 && $direction < 337.5){ |
|
| 8451 | + } elseif ($direction >= 315 && $direction < 337.5) { |
|
| 8452 | 8452 | $temp_array['direction_degree'] = $direction; |
| 8453 | 8453 | $temp_array['direction_shortname'] = "NW"; |
| 8454 | 8454 | $temp_array['direction_fullname'] = "Northwest"; |
| 8455 | - } elseif ($direction >= 337.5 && $direction < 360){ |
|
| 8455 | + } elseif ($direction >= 337.5 && $direction < 360) { |
|
| 8456 | 8456 | $temp_array['direction_degree'] = $direction; |
| 8457 | 8457 | $temp_array['direction_shortname'] = "NNW"; |
| 8458 | 8458 | $temp_array['direction_fullname'] = "North-Northwest"; |
@@ -8505,9 +8505,9 @@ discard block |
||
| 8505 | 8505 | */ |
| 8506 | 8506 | public function getAircraftRegistrationBymodeS($aircraft_modes) |
| 8507 | 8507 | { |
| 8508 | - $aircraft_modes = filter_var($aircraft_modes,FILTER_SANITIZE_STRING); |
|
| 8508 | + $aircraft_modes = filter_var($aircraft_modes, FILTER_SANITIZE_STRING); |
|
| 8509 | 8509 | |
| 8510 | - $query = "SELECT aircraft_modes.Registration FROM aircraft_modes WHERE aircraft_modes.ModeS = :aircraft_modes LIMIT 1"; |
|
| 8510 | + $query = "SELECT aircraft_modes.Registration FROM aircraft_modes WHERE aircraft_modes.ModeS = :aircraft_modes LIMIT 1"; |
|
| 8511 | 8511 | |
| 8512 | 8512 | $sth = $this->db->prepare($query); |
| 8513 | 8513 | $sth->execute(array(':aircraft_modes' => $aircraft_modes)); |
@@ -8529,9 +8529,9 @@ discard block |
||
| 8529 | 8529 | */ |
| 8530 | 8530 | public function getAircraftTypeBymodeS($aircraft_modes) |
| 8531 | 8531 | { |
| 8532 | - $aircraft_modes = filter_var($aircraft_modes,FILTER_SANITIZE_STRING); |
|
| 8532 | + $aircraft_modes = filter_var($aircraft_modes, FILTER_SANITIZE_STRING); |
|
| 8533 | 8533 | |
| 8534 | - $query = "SELECT aircraft_modes.type_flight FROM aircraft_modes WHERE aircraft_modes.ModeS = :aircraft_modes LIMIT 1"; |
|
| 8534 | + $query = "SELECT aircraft_modes.type_flight FROM aircraft_modes WHERE aircraft_modes.ModeS = :aircraft_modes LIMIT 1"; |
|
| 8535 | 8535 | |
| 8536 | 8536 | $sth = $this->db->prepare($query); |
| 8537 | 8537 | $sth->execute(array(':aircraft_modes' => $aircraft_modes)); |
@@ -8551,11 +8551,11 @@ discard block |
||
| 8551 | 8551 | * @param Float $longitude longitute of the flight |
| 8552 | 8552 | * @return String the countrie |
| 8553 | 8553 | */ |
| 8554 | - public function getCountryFromLatitudeLongitude($latitude,$longitude) |
|
| 8554 | + public function getCountryFromLatitudeLongitude($latitude, $longitude) |
|
| 8555 | 8555 | { |
| 8556 | 8556 | global $globalDBdriver, $globalDebug; |
| 8557 | - $latitude = filter_var($latitude,FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 8558 | - $longitude = filter_var($longitude,FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 8557 | + $latitude = filter_var($latitude, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 8558 | + $longitude = filter_var($longitude, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 8559 | 8559 | |
| 8560 | 8560 | try { |
| 8561 | 8561 | /* |
@@ -8591,19 +8591,19 @@ discard block |
||
| 8591 | 8591 | */ |
| 8592 | 8592 | public function convertAircraftRegistration($registration) |
| 8593 | 8593 | { |
| 8594 | - $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
|
| 8594 | + $registration = filter_var($registration, FILTER_SANITIZE_STRING); |
|
| 8595 | 8595 | $registration_prefix = ''; |
| 8596 | 8596 | $registration_1 = substr($registration, 0, 1); |
| 8597 | 8597 | $registration_2 = substr($registration, 0, 2); |
| 8598 | 8598 | |
| 8599 | 8599 | //first get the prefix based on two characters |
| 8600 | - $query = "SELECT aircraft_registration.registration_prefix FROM aircraft_registration WHERE registration_prefix = :registration_2"; |
|
| 8600 | + $query = "SELECT aircraft_registration.registration_prefix FROM aircraft_registration WHERE registration_prefix = :registration_2"; |
|
| 8601 | 8601 | |
| 8602 | 8602 | |
| 8603 | 8603 | $sth = $this->db->prepare($query); |
| 8604 | 8604 | $sth->execute(array(':registration_2' => $registration_2)); |
| 8605 | 8605 | |
| 8606 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8606 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8607 | 8607 | { |
| 8608 | 8608 | $registration_prefix = $row['registration_prefix']; |
| 8609 | 8609 | } |
@@ -8611,11 +8611,11 @@ discard block |
||
| 8611 | 8611 | //if we didn't find a two chracter prefix lets just search the one with one character |
| 8612 | 8612 | if ($registration_prefix == '') |
| 8613 | 8613 | { |
| 8614 | - $query = "SELECT aircraft_registration.registration_prefix FROM aircraft_registration WHERE registration_prefix = :registration_1"; |
|
| 8614 | + $query = "SELECT aircraft_registration.registration_prefix FROM aircraft_registration WHERE registration_prefix = :registration_1"; |
|
| 8615 | 8615 | $sth = $this->db->prepare($query); |
| 8616 | 8616 | $sth->execute(array(':registration_1' => $registration_1)); |
| 8617 | 8617 | |
| 8618 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8618 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8619 | 8619 | { |
| 8620 | 8620 | $registration_prefix = $row['registration_prefix']; |
| 8621 | 8621 | } |
@@ -8629,7 +8629,7 @@ discard block |
||
| 8629 | 8629 | } else { |
| 8630 | 8630 | $registration = preg_replace("/^(.{1})/", "$1-", $registration); |
| 8631 | 8631 | } |
| 8632 | - } else if(strlen($registration_prefix) == 2){ |
|
| 8632 | + } else if (strlen($registration_prefix) == 2) { |
|
| 8633 | 8633 | if (0 === strpos($registration, 'N')) { |
| 8634 | 8634 | $registration = preg_replace("/^(.{2})/", "$1", $registration); |
| 8635 | 8635 | } else { |
@@ -8648,17 +8648,17 @@ discard block |
||
| 8648 | 8648 | */ |
| 8649 | 8649 | public function countryFromAircraftRegistration($registration) |
| 8650 | 8650 | { |
| 8651 | - $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
|
| 8651 | + $registration = filter_var($registration, FILTER_SANITIZE_STRING); |
|
| 8652 | 8652 | |
| 8653 | 8653 | $registration_prefix = ''; |
| 8654 | - $registration_test = explode('-',$registration); |
|
| 8654 | + $registration_test = explode('-', $registration); |
|
| 8655 | 8655 | $country = ''; |
| 8656 | 8656 | if ($registration_test[0] != $registration) { |
| 8657 | 8657 | $query = "SELECT aircraft_registration.registration_prefix, aircraft_registration.country FROM aircraft_registration WHERE registration_prefix = :registration_1 LIMIT 1"; |
| 8658 | 8658 | |
| 8659 | 8659 | $sth = $this->db->prepare($query); |
| 8660 | 8660 | $sth->execute(array(':registration_1' => $registration_test[0])); |
| 8661 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8661 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8662 | 8662 | { |
| 8663 | 8663 | //$registration_prefix = $row['registration_prefix']; |
| 8664 | 8664 | $country = $row['country']; |
@@ -8669,13 +8669,13 @@ discard block |
||
| 8669 | 8669 | |
| 8670 | 8670 | $country = ''; |
| 8671 | 8671 | //first get the prefix based on two characters |
| 8672 | - $query = "SELECT aircraft_registration.registration_prefix, aircraft_registration.country FROM aircraft_registration WHERE registration_prefix = :registration_2 LIMIT 1"; |
|
| 8672 | + $query = "SELECT aircraft_registration.registration_prefix, aircraft_registration.country FROM aircraft_registration WHERE registration_prefix = :registration_2 LIMIT 1"; |
|
| 8673 | 8673 | |
| 8674 | 8674 | |
| 8675 | 8675 | $sth = $this->db->prepare($query); |
| 8676 | 8676 | $sth->execute(array(':registration_2' => $registration_2)); |
| 8677 | 8677 | |
| 8678 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8678 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8679 | 8679 | { |
| 8680 | 8680 | $registration_prefix = $row['registration_prefix']; |
| 8681 | 8681 | $country = $row['country']; |
@@ -8684,12 +8684,12 @@ discard block |
||
| 8684 | 8684 | //if we didn't find a two chracter prefix lets just search the one with one character |
| 8685 | 8685 | if ($registration_prefix == "") |
| 8686 | 8686 | { |
| 8687 | - $query = "SELECT aircraft_registration.registration_prefix, aircraft_registration.country FROM aircraft_registration WHERE registration_prefix = :registration_1 LIMIT 1"; |
|
| 8687 | + $query = "SELECT aircraft_registration.registration_prefix, aircraft_registration.country FROM aircraft_registration WHERE registration_prefix = :registration_1 LIMIT 1"; |
|
| 8688 | 8688 | |
| 8689 | 8689 | $sth = $this->db->prepare($query); |
| 8690 | 8690 | $sth->execute(array(':registration_1' => $registration_1)); |
| 8691 | 8691 | |
| 8692 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8692 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8693 | 8693 | { |
| 8694 | 8694 | //$registration_prefix = $row['registration_prefix']; |
| 8695 | 8695 | $country = $row['country']; |
@@ -8706,9 +8706,9 @@ discard block |
||
| 8706 | 8706 | * @param String $flightaware_id flightaware_id from spotter_output table |
| 8707 | 8707 | * @param String $highlight New highlight value |
| 8708 | 8708 | */ |
| 8709 | - public function setHighlightFlight($flightaware_id,$highlight) { |
|
| 8709 | + public function setHighlightFlight($flightaware_id, $highlight) { |
|
| 8710 | 8710 | |
| 8711 | - $query = "UPDATE spotter_output SET highlight = :highlight WHERE flightaware_id = :flightaware_id"; |
|
| 8711 | + $query = "UPDATE spotter_output SET highlight = :highlight WHERE flightaware_id = :flightaware_id"; |
|
| 8712 | 8712 | $sth = $this->db->prepare($query); |
| 8713 | 8713 | $sth->execute(array(':flightaware_id' => $flightaware_id, ':highlight' => $highlight)); |
| 8714 | 8714 | } |
@@ -8737,7 +8737,7 @@ discard block |
||
| 8737 | 8737 | |
| 8738 | 8738 | $bitly_data = json_decode($bitly_data); |
| 8739 | 8739 | $bitly_url = ''; |
| 8740 | - if ($bitly_data->status_txt = "OK"){ |
|
| 8740 | + if ($bitly_data->status_txt = "OK") { |
|
| 8741 | 8741 | $bitly_url = $bitly_data->data->url; |
| 8742 | 8742 | } |
| 8743 | 8743 | |
@@ -8747,7 +8747,7 @@ discard block |
||
| 8747 | 8747 | |
| 8748 | 8748 | public function getOrderBy() |
| 8749 | 8749 | { |
| 8750 | - $orderby = array("aircraft_asc" => array("key" => "aircraft_asc", "value" => "Aircraft Type - ASC", "sql" => "ORDER BY spotter_output.aircraft_icao ASC"), "aircraft_desc" => array("key" => "aircraft_desc", "value" => "Aircraft Type - DESC", "sql" => "ORDER BY spotter_output.aircraft_icao DESC"),"manufacturer_asc" => array("key" => "manufacturer_asc", "value" => "Aircraft Manufacturer - ASC", "sql" => "ORDER BY spotter_output.aircraft_manufacturer ASC"), "manufacturer_desc" => array("key" => "manufacturer_desc", "value" => "Aircraft Manufacturer - DESC", "sql" => "ORDER BY spotter_output.aircraft_manufacturer DESC"),"airline_name_asc" => array("key" => "airline_name_asc", "value" => "Airline Name - ASC", "sql" => "ORDER BY spotter_output.airline_name ASC"), "airline_name_desc" => array("key" => "airline_name_desc", "value" => "Airline Name - DESC", "sql" => "ORDER BY spotter_output.airline_name DESC"), "ident_asc" => array("key" => "ident_asc", "value" => "Ident - ASC", "sql" => "ORDER BY spotter_output.ident ASC"), "ident_desc" => array("key" => "ident_desc", "value" => "Ident - DESC", "sql" => "ORDER BY spotter_output.ident DESC"), "airport_departure_asc" => array("key" => "airport_departure_asc", "value" => "Departure Airport - ASC", "sql" => "ORDER BY spotter_output.departure_airport_city ASC"), "airport_departure_desc" => array("key" => "airport_departure_desc", "value" => "Departure Airport - DESC", "sql" => "ORDER BY spotter_output.departure_airport_city DESC"), "airport_arrival_asc" => array("key" => "airport_arrival_asc", "value" => "Arrival Airport - ASC", "sql" => "ORDER BY spotter_output.arrival_airport_city ASC"), "airport_arrival_desc" => array("key" => "airport_arrival_desc", "value" => "Arrival Airport - DESC", "sql" => "ORDER BY spotter_output.arrival_airport_city DESC"), "date_asc" => array("key" => "date_asc", "value" => "Date - ASC", "sql" => "ORDER BY spotter_output.date ASC"), "date_desc" => array("key" => "date_desc", "value" => "Date - DESC", "sql" => "ORDER BY spotter_output.date DESC"),"distance_asc" => array("key" => "distance_asc","value" => "Distance - ASC","sql" => "ORDER BY distance ASC"),"distance_desc" => array("key" => "distance_desc","value" => "Distance - DESC","sql" => "ORDER BY distance DESC")); |
|
| 8750 | + $orderby = array("aircraft_asc" => array("key" => "aircraft_asc", "value" => "Aircraft Type - ASC", "sql" => "ORDER BY spotter_output.aircraft_icao ASC"), "aircraft_desc" => array("key" => "aircraft_desc", "value" => "Aircraft Type - DESC", "sql" => "ORDER BY spotter_output.aircraft_icao DESC"), "manufacturer_asc" => array("key" => "manufacturer_asc", "value" => "Aircraft Manufacturer - ASC", "sql" => "ORDER BY spotter_output.aircraft_manufacturer ASC"), "manufacturer_desc" => array("key" => "manufacturer_desc", "value" => "Aircraft Manufacturer - DESC", "sql" => "ORDER BY spotter_output.aircraft_manufacturer DESC"), "airline_name_asc" => array("key" => "airline_name_asc", "value" => "Airline Name - ASC", "sql" => "ORDER BY spotter_output.airline_name ASC"), "airline_name_desc" => array("key" => "airline_name_desc", "value" => "Airline Name - DESC", "sql" => "ORDER BY spotter_output.airline_name DESC"), "ident_asc" => array("key" => "ident_asc", "value" => "Ident - ASC", "sql" => "ORDER BY spotter_output.ident ASC"), "ident_desc" => array("key" => "ident_desc", "value" => "Ident - DESC", "sql" => "ORDER BY spotter_output.ident DESC"), "airport_departure_asc" => array("key" => "airport_departure_asc", "value" => "Departure Airport - ASC", "sql" => "ORDER BY spotter_output.departure_airport_city ASC"), "airport_departure_desc" => array("key" => "airport_departure_desc", "value" => "Departure Airport - DESC", "sql" => "ORDER BY spotter_output.departure_airport_city DESC"), "airport_arrival_asc" => array("key" => "airport_arrival_asc", "value" => "Arrival Airport - ASC", "sql" => "ORDER BY spotter_output.arrival_airport_city ASC"), "airport_arrival_desc" => array("key" => "airport_arrival_desc", "value" => "Arrival Airport - DESC", "sql" => "ORDER BY spotter_output.arrival_airport_city DESC"), "date_asc" => array("key" => "date_asc", "value" => "Date - ASC", "sql" => "ORDER BY spotter_output.date ASC"), "date_desc" => array("key" => "date_desc", "value" => "Date - DESC", "sql" => "ORDER BY spotter_output.date DESC"), "distance_asc" => array("key" => "distance_asc", "value" => "Distance - ASC", "sql" => "ORDER BY distance ASC"), "distance_desc" => array("key" => "distance_desc", "value" => "Distance - DESC", "sql" => "ORDER BY distance DESC")); |
|
| 8751 | 8751 | |
| 8752 | 8752 | return $orderby; |
| 8753 | 8753 | |
@@ -8881,14 +8881,14 @@ discard block |
||
| 8881 | 8881 | } |
| 8882 | 8882 | $sth = $this->db->prepare($query); |
| 8883 | 8883 | $sth->execute(); |
| 8884 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8884 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8885 | 8885 | { |
| 8886 | 8886 | $departure_airport_array = $this->getAllAirportInfo($row['fromairport_icao']); |
| 8887 | 8887 | $arrival_airport_array = $this->getAllAirportInfo($row['toairport_icao']); |
| 8888 | 8888 | if (count($departure_airport_array) > 0 && count($arrival_airport_array) > 0) { |
| 8889 | - $update_query="UPDATE spotter_output SET departure_airport_icao = :fromicao, arrival_airport_icao = :toicao, departure_airport_name = :departure_airport_name, departure_airport_city = :departure_airport_city, departure_airport_country = :departure_airport_country, arrival_airport_name = :arrival_airport_name, arrival_airport_city = :arrival_airport_city, arrival_airport_country = :arrival_airport_country WHERE spotter_id = :spotter_id"; |
|
| 8889 | + $update_query = "UPDATE spotter_output SET departure_airport_icao = :fromicao, arrival_airport_icao = :toicao, departure_airport_name = :departure_airport_name, departure_airport_city = :departure_airport_city, departure_airport_country = :departure_airport_country, arrival_airport_name = :arrival_airport_name, arrival_airport_city = :arrival_airport_city, arrival_airport_country = :arrival_airport_country WHERE spotter_id = :spotter_id"; |
|
| 8890 | 8890 | $sthu = $this->db->prepare($update_query); |
| 8891 | - $sthu->execute(array(':fromicao' => $row['fromairport_icao'],':toicao' => $row['toairport_icao'],':spotter_id' => $row['spotter_id'],':departure_airport_name' => $departure_airport_array[0]['name'],':departure_airport_city' => $departure_airport_array[0]['city'],':departure_airport_country' => $departure_airport_array[0]['country'],':arrival_airport_name' => $arrival_airport_array[0]['name'],':arrival_airport_city' => $arrival_airport_array[0]['city'],':arrival_airport_country' => $arrival_airport_array[0]['country'])); |
|
| 8891 | + $sthu->execute(array(':fromicao' => $row['fromairport_icao'], ':toicao' => $row['toairport_icao'], ':spotter_id' => $row['spotter_id'], ':departure_airport_name' => $departure_airport_array[0]['name'], ':departure_airport_city' => $departure_airport_array[0]['city'], ':departure_airport_country' => $departure_airport_array[0]['country'], ':arrival_airport_name' => $arrival_airport_array[0]['name'], ':arrival_airport_city' => $arrival_airport_array[0]['city'], ':arrival_airport_country' => $arrival_airport_array[0]['country'])); |
|
| 8892 | 8892 | } |
| 8893 | 8893 | } |
| 8894 | 8894 | |
@@ -8901,15 +8901,15 @@ discard block |
||
| 8901 | 8901 | } |
| 8902 | 8902 | $sth = $this->db->prepare($query); |
| 8903 | 8903 | $sth->execute(); |
| 8904 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8904 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8905 | 8905 | { |
| 8906 | 8906 | if (is_numeric(substr($row['ident'], -1, 1))) |
| 8907 | 8907 | { |
| 8908 | 8908 | $airline_array = $this->getAllAirlineInfo(substr($row['ident'], 0, 3)); |
| 8909 | 8909 | if (isset($airline_array[0]['name'])) { |
| 8910 | - $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"; |
|
| 8910 | + $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"; |
|
| 8911 | 8911 | $sthu = $this->db->prepare($update_query); |
| 8912 | - $sthu->execute(array(':airline_name' => $airline_array[0]['name'],':airline_icao' => $airline_array[0]['icao'], ':airline_country' => $airline_array[0]['country'], ':airline_type' => $airline_array[0]['type'], ':spotter_id' => $row['spotter_id'])); |
|
| 8912 | + $sthu->execute(array(':airline_name' => $airline_array[0]['name'], ':airline_icao' => $airline_array[0]['icao'], ':airline_country' => $airline_array[0]['country'], ':airline_type' => $airline_array[0]['type'], ':spotter_id' => $row['spotter_id'])); |
|
| 8913 | 8913 | } |
| 8914 | 8914 | } |
| 8915 | 8915 | } |
@@ -8929,18 +8929,18 @@ discard block |
||
| 8929 | 8929 | } |
| 8930 | 8930 | $sth = $this->db->prepare($query); |
| 8931 | 8931 | $sth->execute(); |
| 8932 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8932 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8933 | 8933 | { |
| 8934 | 8934 | if ($row['aircraft_icao'] != '') { |
| 8935 | 8935 | $aircraft_name = $this->getAllAircraftInfo($row['aircraft_icao']); |
| 8936 | - if ($row['registration'] != ""){ |
|
| 8936 | + if ($row['registration'] != "") { |
|
| 8937 | 8937 | $image_array = $Image->getSpotterImage($row['registration']); |
| 8938 | 8938 | if (count($image_array) == 0) { |
| 8939 | 8939 | $Image->addSpotterImage($row['registration']); |
| 8940 | 8940 | } |
| 8941 | 8941 | } |
| 8942 | 8942 | if (count($aircraft_name) > 0) { |
| 8943 | - $update_query = "UPDATE spotter_output SET spotter_output.aircraft_name = :aircraft_name, spotter_output.aircraft_manufacturer = :aircraft_manufacturer WHERE spotter_output.spotter_id = :spotter_id"; |
|
| 8943 | + $update_query = "UPDATE spotter_output SET spotter_output.aircraft_name = :aircraft_name, spotter_output.aircraft_manufacturer = :aircraft_manufacturer WHERE spotter_output.spotter_id = :spotter_id"; |
|
| 8944 | 8944 | $sthu = $this->db->prepare($update_query); |
| 8945 | 8945 | $sthu->execute(array(':aircraft_name' => $aircraft_name[0]['type'], ':aircraft_manufacturer' => $aircraft_name[0]['manufacturer'], ':spotter_id' => $row['spotter_id'])); |
| 8946 | 8946 | } |
@@ -8955,10 +8955,10 @@ discard block |
||
| 8955 | 8955 | $query = "SELECT spotter_output.spotter_id, spotter_output.last_latitude, spotter_output.last_longitude, spotter_output.last_altitude, spotter_output.arrival_airport_icao, spotter_output.real_arrival_airport_icao FROM spotter_output"; |
| 8956 | 8956 | $sth = $this->db->prepare($query); |
| 8957 | 8957 | $sth->execute(); |
| 8958 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8958 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8959 | 8959 | { |
| 8960 | 8960 | if ($row['last_latitude'] != '' && $row['last_longitude'] != '') { |
| 8961 | - $closestAirports = $this->closestAirports($row['last_latitude'],$row['last_longitude'],$globalClosestMinDist); |
|
| 8961 | + $closestAirports = $this->closestAirports($row['last_latitude'], $row['last_longitude'], $globalClosestMinDist); |
|
| 8962 | 8962 | $airport_icao = ''; |
| 8963 | 8963 | if (isset($closestAirports[0])) { |
| 8964 | 8964 | if ($row['arrival_airport_icao'] == $closestAirports[0]['icao']) { |
@@ -8972,7 +8972,7 @@ discard block |
||
| 8972 | 8972 | break; |
| 8973 | 8973 | } |
| 8974 | 8974 | } |
| 8975 | - } elseif ($row['last_altitude'] == 0 || ($row['last_altitude'] != '' && ($closestAirports[0]['altitude'] <= $row['last_altitude']*100+1000 && $row['last_altitude']*100 < $closestAirports[0]['altitude']+5000))) { |
|
| 8975 | + } elseif ($row['last_altitude'] == 0 || ($row['last_altitude'] != '' && ($closestAirports[0]['altitude'] <= $row['last_altitude']*100 + 1000 && $row['last_altitude']*100 < $closestAirports[0]['altitude'] + 5000))) { |
|
| 8976 | 8976 | $airport_icao = $closestAirports[0]['icao']; |
| 8977 | 8977 | 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"; |
| 8978 | 8978 | } else { |
@@ -8983,28 +8983,28 @@ discard block |
||
| 8983 | 8983 | } |
| 8984 | 8984 | if ($row['real_arrival_airport_icao'] != $airport_icao) { |
| 8985 | 8985 | if ($globalDebug) echo "Updating airport to ".$airport_icao."...\n"; |
| 8986 | - $update_query="UPDATE spotter_output SET real_arrival_airport_icao = :airport_icao WHERE spotter_id = :spotter_id"; |
|
| 8986 | + $update_query = "UPDATE spotter_output SET real_arrival_airport_icao = :airport_icao WHERE spotter_id = :spotter_id"; |
|
| 8987 | 8987 | $sthu = $this->db->prepare($update_query); |
| 8988 | - $sthu->execute(array(':airport_icao' => $airport_icao,':spotter_id' => $row['spotter_id'])); |
|
| 8988 | + $sthu->execute(array(':airport_icao' => $airport_icao, ':spotter_id' => $row['spotter_id'])); |
|
| 8989 | 8989 | } |
| 8990 | 8990 | } |
| 8991 | 8991 | } |
| 8992 | 8992 | } |
| 8993 | 8993 | |
| 8994 | - public function closestAirports($origLat,$origLon,$dist = 10) { |
|
| 8994 | + public function closestAirports($origLat, $origLon, $dist = 10) { |
|
| 8995 | 8995 | global $globalDBdriver; |
| 8996 | - $dist = number_format($dist*0.621371,2,'.',''); // convert km to mile |
|
| 8996 | + $dist = number_format($dist*0.621371, 2, '.', ''); // convert km to mile |
|
| 8997 | 8997 | /* |
| 8998 | 8998 | $query="SELECT name, icao, latitude, longitude, altitude, 3956 * 2 * ASIN(SQRT( POWER(SIN(($origLat - abs(latitude))*pi()/180/2),2)+COS( $origLat *pi()/180)*COS(abs(latitude)*pi()/180)*POWER(SIN(($origLon-longitude)*pi()/180/2),2))) as distance |
| 8999 | 8999 | FROM airport WHERE longitude between ($origLon-$dist/abs(cos(radians($origLat))*69)) and ($origLon+$dist/abs(cos(radians($origLat))*69)) and latitude between ($origLat-($dist/69)) and ($origLat+($dist/69)) |
| 9000 | 9000 | having distance < $dist ORDER BY distance limit 100;"; |
| 9001 | 9001 | */ |
| 9002 | 9002 | if ($globalDBdriver == 'mysql') { |
| 9003 | - $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 |
|
| 9003 | + $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 |
|
| 9004 | 9004 | 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)) |
| 9005 | 9005 | 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;"; |
| 9006 | 9006 | } else { |
| 9007 | - $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 |
|
| 9007 | + $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 |
|
| 9008 | 9008 | 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)) |
| 9009 | 9009 | 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;"; |
| 9010 | 9010 | } |
@@ -27,9 +27,15 @@ discard block |
||
| 27 | 27 | $Image = new Image($this->db); |
| 28 | 28 | $Schedule = new Schedule($this->db); |
| 29 | 29 | $ACARS = new ACARS($this->db); |
| 30 | - if (!isset($globalIVAO)) $globalIVAO = FALSE; |
|
| 31 | - if (!isset($globalVATSIM)) $globalVATSIM = FALSE; |
|
| 32 | - if (!isset($globalphpVMS)) $globalphpVMS = FALSE; |
|
| 30 | + if (!isset($globalIVAO)) { |
|
| 31 | + $globalIVAO = FALSE; |
|
| 32 | + } |
|
| 33 | + if (!isset($globalVATSIM)) { |
|
| 34 | + $globalVATSIM = FALSE; |
|
| 35 | + } |
|
| 36 | + if (!isset($globalphpVMS)) { |
|
| 37 | + $globalphpVMS = FALSE; |
|
| 38 | + } |
|
| 33 | 39 | date_default_timezone_set('UTC'); |
| 34 | 40 | |
| 35 | 41 | if (!is_string($query)) |
@@ -77,18 +83,24 @@ discard block |
||
| 77 | 83 | $temp_array['spotter_id'] = ''; |
| 78 | 84 | } |
| 79 | 85 | $temp_array['flightaware_id'] = $row['flightaware_id']; |
| 80 | - if (isset($row['modes'])) $temp_array['modes'] = $row['modes']; |
|
| 86 | + if (isset($row['modes'])) { |
|
| 87 | + $temp_array['modes'] = $row['modes']; |
|
| 88 | + } |
|
| 81 | 89 | $temp_array['ident'] = $row['ident']; |
| 82 | 90 | if (isset($row['registration']) && $row['registration'] != '') { |
| 83 | 91 | $temp_array['registration'] = $row['registration']; |
| 84 | 92 | } elseif (isset($temp_array['modes'])) { |
| 85 | 93 | $temp_array['registration'] = $this->getAircraftRegistrationBymodeS($temp_array['modes']); |
| 86 | - } else $temp_array['registration'] = ''; |
|
| 94 | + } else { |
|
| 95 | + $temp_array['registration'] = ''; |
|
| 96 | + } |
|
| 87 | 97 | $temp_array['aircraft_type'] = $row['aircraft_icao']; |
| 88 | 98 | |
| 89 | 99 | $temp_array['departure_airport'] = $row['departure_airport_icao']; |
| 90 | 100 | $temp_array['arrival_airport'] = $row['arrival_airport_icao']; |
| 91 | - if (isset($row['real_arrival_airport_icao']) && $row['real_arrival_airport_icao'] != NULL) $temp_array['real_arrival_airport'] = $row['real_arrival_airport_icao']; |
|
| 101 | + if (isset($row['real_arrival_airport_icao']) && $row['real_arrival_airport_icao'] != NULL) { |
|
| 102 | + $temp_array['real_arrival_airport'] = $row['real_arrival_airport_icao']; |
|
| 103 | + } |
|
| 92 | 104 | $temp_array['latitude'] = $row['latitude']; |
| 93 | 105 | $temp_array['longitude'] = $row['longitude']; |
| 94 | 106 | /* |
@@ -123,7 +135,9 @@ discard block |
||
| 123 | 135 | $temp_array['altitude'] = $row['altitude']; |
| 124 | 136 | $temp_array['heading'] = $row['heading']; |
| 125 | 137 | $heading_direction = $this->parseDirection($row['heading']); |
| 126 | - if (isset($heading_direction[0]['direction_fullname'])) $temp_array['heading_name'] = $heading_direction[0]['direction_fullname']; |
|
| 138 | + if (isset($heading_direction[0]['direction_fullname'])) { |
|
| 139 | + $temp_array['heading_name'] = $heading_direction[0]['direction_fullname']; |
|
| 140 | + } |
|
| 127 | 141 | $temp_array['ground_speed'] = $row['ground_speed']; |
| 128 | 142 | $temp_array['image'] = ""; |
| 129 | 143 | $temp_array['image_thumbnail'] = ""; |
@@ -132,7 +146,9 @@ discard block |
||
| 132 | 146 | |
| 133 | 147 | if (isset($row['highlight'])) { |
| 134 | 148 | $temp_array['highlight'] = $row['highlight']; |
| 135 | - } else $temp_array['highlight'] = ''; |
|
| 149 | + } else { |
|
| 150 | + $temp_array['highlight'] = ''; |
|
| 151 | + } |
|
| 136 | 152 | |
| 137 | 153 | $dateArray = $this->parseDateString($row['date']); |
| 138 | 154 | if ($dateArray['seconds'] < 10) |
@@ -178,7 +194,9 @@ discard block |
||
| 178 | 194 | |
| 179 | 195 | if ($aircraft_array[0]['aircraft_shadow'] != NULL) { |
| 180 | 196 | $temp_array['aircraft_shadow'] = $aircraft_array[0]['aircraft_shadow']; |
| 181 | - } else $temp_array['aircraft_shadow'] = 'default.png'; |
|
| 197 | + } else { |
|
| 198 | + $temp_array['aircraft_shadow'] = 'default.png'; |
|
| 199 | + } |
|
| 182 | 200 | } else { |
| 183 | 201 | $temp_array['aircraft_shadow'] = 'default.png'; |
| 184 | 202 | $temp_array['aircraft_name'] = 'N/A'; |
@@ -207,12 +225,18 @@ discard block |
||
| 207 | 225 | } |
| 208 | 226 | } else { |
| 209 | 227 | $temp_array['airline_icao'] = $row['airline_icao']; |
| 210 | - if (isset($row['airline_iata'])) $temp_array['airline_iata'] = $row['airline_iata']; |
|
| 211 | - else $temp_array['airline_iata'] = ''; |
|
| 228 | + if (isset($row['airline_iata'])) { |
|
| 229 | + $temp_array['airline_iata'] = $row['airline_iata']; |
|
| 230 | + } else { |
|
| 231 | + $temp_array['airline_iata'] = ''; |
|
| 232 | + } |
|
| 212 | 233 | $temp_array['airline_name'] = $row['airline_name']; |
| 213 | 234 | $temp_array['airline_country'] = $row['airline_country']; |
| 214 | - if (isset($row['airline_callsign'])) $temp_array['airline_callsign'] = $row['airline_callsign']; |
|
| 215 | - else $temp_array['airline_callsign'] = 'N/A'; |
|
| 235 | + if (isset($row['airline_callsign'])) { |
|
| 236 | + $temp_array['airline_callsign'] = $row['airline_callsign']; |
|
| 237 | + } else { |
|
| 238 | + $temp_array['airline_callsign'] = 'N/A'; |
|
| 239 | + } |
|
| 216 | 240 | $temp_array['airline_type'] = $row['airline_type']; |
| 217 | 241 | } |
| 218 | 242 | if (isset($temp_array['airline_iata']) && $temp_array['airline_iata'] != '') { |
@@ -228,7 +252,9 @@ discard block |
||
| 228 | 252 | } |
| 229 | 253 | if ($temp_array['registration'] != "" && !$globalIVAO && !$globalVATSIM && !$globalphpVMS && !isset($temp_array['aircraft_owner'])) { |
| 230 | 254 | $owner_info = $this->getAircraftOwnerByRegistration($temp_array['registration']); |
| 231 | - if ($owner_info['owner'] != '') $temp_array['aircraft_owner'] = ucwords(strtolower($owner_info['owner'])); |
|
| 255 | + if ($owner_info['owner'] != '') { |
|
| 256 | + $temp_array['aircraft_owner'] = ucwords(strtolower($owner_info['owner'])); |
|
| 257 | + } |
|
| 232 | 258 | $temp_array['aircraft_base'] = $owner_info['base']; |
| 233 | 259 | $temp_array['aircraft_date_first_reg'] = $owner_info['date_first_reg']; |
| 234 | 260 | } |
@@ -236,9 +262,14 @@ discard block |
||
| 236 | 262 | if($temp_array['registration'] != "" || ($globalIVAO && $temp_array['aircraft_type'] != '')) |
| 237 | 263 | { |
| 238 | 264 | if ($globalIVAO) { |
| 239 | - if (isset($temp_array['airline_icao'])) $image_array = $Image->getSpotterImage('',$temp_array['aircraft_type'],$temp_array['airline_icao']); |
|
| 240 | - else $image_array = $Image->getSpotterImage('',$temp_array['aircraft_type']); |
|
| 241 | - } else $image_array = $Image->getSpotterImage($temp_array['registration']); |
|
| 265 | + if (isset($temp_array['airline_icao'])) { |
|
| 266 | + $image_array = $Image->getSpotterImage('',$temp_array['aircraft_type'],$temp_array['airline_icao']); |
|
| 267 | + } else { |
|
| 268 | + $image_array = $Image->getSpotterImage('',$temp_array['aircraft_type']); |
|
| 269 | + } |
|
| 270 | + } else { |
|
| 271 | + $image_array = $Image->getSpotterImage($temp_array['registration']); |
|
| 272 | + } |
|
| 242 | 273 | if (count($image_array) > 0) { |
| 243 | 274 | $temp_array['image'] = $image_array[0]['image']; |
| 244 | 275 | $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
@@ -288,7 +319,9 @@ discard block |
||
| 288 | 319 | //if ($row['departure_airport_icao'] != '' && $row['departure_airport_name'] == '') { |
| 289 | 320 | if ($row['departure_airport_icao'] != '') { |
| 290 | 321 | $departure_airport_array = $this->getAllAirportInfo($row['departure_airport_icao']); |
| 291 | - if (!isset($departure_airport_array[0]['name'])) $departure_airport_array = $this->getAllAirportInfo('NA'); |
|
| 322 | + if (!isset($departure_airport_array[0]['name'])) { |
|
| 323 | + $departure_airport_array = $this->getAllAirportInfo('NA'); |
|
| 324 | + } |
|
| 292 | 325 | /* |
| 293 | 326 | } elseif ($row['departure_airport_name'] != '') { |
| 294 | 327 | $temp_array['departure_airport_name'] = $row['departure_airport_name']; |
@@ -296,7 +329,9 @@ discard block |
||
| 296 | 329 | $temp_array['departure_airport_country'] = $row['departure_airport_country']; |
| 297 | 330 | $temp_array['departure_airport_icao'] = $row['departure_airport_icao']; |
| 298 | 331 | */ |
| 299 | - } else $departure_airport_array = $this->getAllAirportInfo('NA'); |
|
| 332 | + } else { |
|
| 333 | + $departure_airport_array = $this->getAllAirportInfo('NA'); |
|
| 334 | + } |
|
| 300 | 335 | if (isset($departure_airport_array[0]['name'])) { |
| 301 | 336 | $temp_array['departure_airport_name'] = $departure_airport_array[0]['name']; |
| 302 | 337 | $temp_array['departure_airport_city'] = $departure_airport_array[0]['city']; |
@@ -316,8 +351,12 @@ discard block |
||
| 316 | 351 | |
| 317 | 352 | if ($row['arrival_airport_icao'] != '') { |
| 318 | 353 | $arrival_airport_array = $this->getAllAirportInfo($row['arrival_airport_icao']); |
| 319 | - if (count($arrival_airport_array) == 0) $arrival_airport_array = $this->getAllAirportInfo('NA'); |
|
| 320 | - } else $arrival_airport_array = $this->getAllAirportInfo('NA'); |
|
| 354 | + if (count($arrival_airport_array) == 0) { |
|
| 355 | + $arrival_airport_array = $this->getAllAirportInfo('NA'); |
|
| 356 | + } |
|
| 357 | + } else { |
|
| 358 | + $arrival_airport_array = $this->getAllAirportInfo('NA'); |
|
| 359 | + } |
|
| 321 | 360 | if (isset($arrival_airport_array[0]['name'])) { |
| 322 | 361 | $temp_array['arrival_airport_name'] = $arrival_airport_array[0]['name']; |
| 323 | 362 | $temp_array['arrival_airport_city'] = $arrival_airport_array[0]['city']; |
@@ -333,27 +372,45 @@ discard block |
||
| 333 | 372 | $temp_array['arrival_airport_time'] = $row['arrival_airport_time']; |
| 334 | 373 | } |
| 335 | 374 | */ |
| 336 | - if (isset($row['pilot_id']) && $row['pilot_id'] != '') $temp_array['pilot_id'] = $row['pilot_id']; |
|
| 337 | - if (isset($row['pilot_name']) && $row['pilot_name'] != '') $temp_array['pilot_name'] = $row['pilot_name']; |
|
| 338 | - if (isset($row['source_name']) && $row['source_name'] != '') $temp_array['source_name'] = $row['source_name']; |
|
| 339 | - if (isset($row['over_country']) && $row['over_country'] != '') $temp_array['over_country'] = $row['over_country']; |
|
| 340 | - if (isset($row['distance']) && $row['distance'] != '') $temp_array['distance'] = $row['distance']; |
|
| 375 | + if (isset($row['pilot_id']) && $row['pilot_id'] != '') { |
|
| 376 | + $temp_array['pilot_id'] = $row['pilot_id']; |
|
| 377 | + } |
|
| 378 | + if (isset($row['pilot_name']) && $row['pilot_name'] != '') { |
|
| 379 | + $temp_array['pilot_name'] = $row['pilot_name']; |
|
| 380 | + } |
|
| 381 | + if (isset($row['source_name']) && $row['source_name'] != '') { |
|
| 382 | + $temp_array['source_name'] = $row['source_name']; |
|
| 383 | + } |
|
| 384 | + if (isset($row['over_country']) && $row['over_country'] != '') { |
|
| 385 | + $temp_array['over_country'] = $row['over_country']; |
|
| 386 | + } |
|
| 387 | + if (isset($row['distance']) && $row['distance'] != '') { |
|
| 388 | + $temp_array['distance'] = $row['distance']; |
|
| 389 | + } |
|
| 341 | 390 | if (isset($row['squawk'])) { |
| 342 | 391 | $temp_array['squawk'] = $row['squawk']; |
| 343 | 392 | if ($row['squawk'] != '' && isset($temp_array['country_iso2'])) { |
| 344 | 393 | $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'],$temp_array['country_iso2']); |
| 345 | - if ($temp_array['squawk_usage'] == '' && isset($globalSquawkCountry)) $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'],$globalSquawkCountry); |
|
| 394 | + if ($temp_array['squawk_usage'] == '' && isset($globalSquawkCountry)) { |
|
| 395 | + $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'],$globalSquawkCountry); |
|
| 396 | + } |
|
| 346 | 397 | } elseif ($row['squawk'] != '' && isset($temp_array['over_country'])) { |
| 347 | 398 | $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'],$temp_array['over_country']); |
| 348 | - if ($temp_array['squawk_usage'] == '' && isset($globalSquawkCountry)) $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'],$globalSquawkCountry); |
|
| 349 | - } elseif ($row['squawk'] != '' && isset($globalSquawkCountry)) $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'],$globalSquawkCountry); |
|
| 399 | + if ($temp_array['squawk_usage'] == '' && isset($globalSquawkCountry)) { |
|
| 400 | + $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'],$globalSquawkCountry); |
|
| 401 | + } |
|
| 402 | + } elseif ($row['squawk'] != '' && isset($globalSquawkCountry)) { |
|
| 403 | + $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'],$globalSquawkCountry); |
|
| 404 | + } |
|
| 350 | 405 | } |
| 351 | 406 | |
| 352 | 407 | $temp_array['query_number_rows'] = $num_rows; |
| 353 | 408 | |
| 354 | 409 | $spotter_array[] = $temp_array; |
| 355 | 410 | } |
| 356 | - if ($num_rows == 0) return array(); |
|
| 411 | + if ($num_rows == 0) { |
|
| 412 | + return array(); |
|
| 413 | + } |
|
| 357 | 414 | $spotter_array[0]['query_number_rows'] = $num_rows; |
| 358 | 415 | return $spotter_array; |
| 359 | 416 | } |
@@ -385,7 +442,9 @@ discard block |
||
| 385 | 442 | foreach ($q_array as $q_item){ |
| 386 | 443 | $q_item = filter_var($q_item,FILTER_SANITIZE_STRING); |
| 387 | 444 | $additional_query .= " AND ("; |
| 388 | - if (is_int($q_item)) $additional_query .= "(spotter_output.spotter_id like '%".$q_item."%') OR "; |
|
| 445 | + if (is_int($q_item)) { |
|
| 446 | + $additional_query .= "(spotter_output.spotter_id like '%".$q_item."%') OR "; |
|
| 447 | + } |
|
| 389 | 448 | $additional_query .= "(spotter_output.aircraft_icao like '%".$q_item."%') OR "; |
| 390 | 449 | $additional_query .= "(spotter_output.aircraft_name like '%".$q_item."%') OR "; |
| 391 | 450 | $additional_query .= "(spotter_output.aircraft_manufacturer like '%".$q_item."%') OR "; |
@@ -406,7 +465,9 @@ discard block |
||
| 406 | 465 | $additional_query .= "(spotter_output.pilot_name like '%".$q_item."%') OR "; |
| 407 | 466 | $additional_query .= "(spotter_output.ident like '%".$q_item."%') OR "; |
| 408 | 467 | $translate = $Translation->ident2icao($q_item); |
| 409 | - if ($translate != $q_item) $additional_query .= "(spotter_output.ident like '%".$translate."%') OR "; |
|
| 468 | + if ($translate != $q_item) { |
|
| 469 | + $additional_query .= "(spotter_output.ident like '%".$translate."%') OR "; |
|
| 470 | + } |
|
| 410 | 471 | $additional_query .= "(spotter_output.highlight like '%".$q_item."%')"; |
| 411 | 472 | $additional_query .= ")"; |
| 412 | 473 | } |
@@ -633,7 +694,9 @@ discard block |
||
| 633 | 694 | date_default_timezone_set($globalTimezone); |
| 634 | 695 | $datetime = new DateTime(); |
| 635 | 696 | $offset = $datetime->format('P'); |
| 636 | - } else $offset = '+00:00'; |
|
| 697 | + } else { |
|
| 698 | + $offset = '+00:00'; |
|
| 699 | + } |
|
| 637 | 700 | |
| 638 | 701 | if ($date_array[1] != "") |
| 639 | 702 | { |
@@ -665,8 +728,12 @@ discard block |
||
| 665 | 728 | { |
| 666 | 729 | //$limit_query = " LIMIT ".$limit_array[0].",".$limit_array[1]; |
| 667 | 730 | $limit_query = " LIMIT ".$limit_array[1]." OFFSET ".$limit_array[0]; |
| 668 | - } else $limit_query = ""; |
|
| 669 | - } else $limit_query = ""; |
|
| 731 | + } else { |
|
| 732 | + $limit_query = ""; |
|
| 733 | + } |
|
| 734 | + } else { |
|
| 735 | + $limit_query = ""; |
|
| 736 | + } |
|
| 670 | 737 | |
| 671 | 738 | |
| 672 | 739 | if ($sort != "") |
@@ -733,8 +800,12 @@ discard block |
||
| 733 | 800 | { |
| 734 | 801 | //$limit_query = " LIMIT ".$limit_array[0].",".$limit_array[1]; |
| 735 | 802 | $limit_query = " LIMIT ".$limit_array[1]." OFFSET ".$limit_array[0]; |
| 736 | - } else $limit_query = ""; |
|
| 737 | - } else $limit_query = ""; |
|
| 803 | + } else { |
|
| 804 | + $limit_query = ""; |
|
| 805 | + } |
|
| 806 | + } else { |
|
| 807 | + $limit_query = ""; |
|
| 808 | + } |
|
| 738 | 809 | |
| 739 | 810 | if ($sort != "") |
| 740 | 811 | { |
@@ -1678,7 +1749,9 @@ discard block |
||
| 1678 | 1749 | { |
| 1679 | 1750 | $highlight = $row['highlight']; |
| 1680 | 1751 | } |
| 1681 | - if (isset($highlight)) return $highlight; |
|
| 1752 | + if (isset($highlight)) { |
|
| 1753 | + return $highlight; |
|
| 1754 | + } |
|
| 1682 | 1755 | } |
| 1683 | 1756 | |
| 1684 | 1757 | |
@@ -1705,7 +1778,9 @@ discard block |
||
| 1705 | 1778 | $row = $sth->fetch(PDO::FETCH_ASSOC); |
| 1706 | 1779 | if (count($row) > 0) { |
| 1707 | 1780 | return $row['usage']; |
| 1708 | - } else return ''; |
|
| 1781 | + } else { |
|
| 1782 | + return ''; |
|
| 1783 | + } |
|
| 1709 | 1784 | } |
| 1710 | 1785 | |
| 1711 | 1786 | /** |
@@ -1729,7 +1804,9 @@ discard block |
||
| 1729 | 1804 | $row = $sth->fetch(PDO::FETCH_ASSOC); |
| 1730 | 1805 | if (count($row) > 0) { |
| 1731 | 1806 | return $row['icao']; |
| 1732 | - } else return ''; |
|
| 1807 | + } else { |
|
| 1808 | + return ''; |
|
| 1809 | + } |
|
| 1733 | 1810 | } |
| 1734 | 1811 | |
| 1735 | 1812 | /** |
@@ -1756,7 +1833,9 @@ discard block |
||
| 1756 | 1833 | $airport_longitude = $row['longitude']; |
| 1757 | 1834 | $Common = new Common(); |
| 1758 | 1835 | return $Common->distance($latitude,$longitude,$airport_latitude,$airport_longitude); |
| 1759 | - } else return ''; |
|
| 1836 | + } else { |
|
| 1837 | + return ''; |
|
| 1838 | + } |
|
| 1760 | 1839 | } |
| 1761 | 1840 | |
| 1762 | 1841 | /** |
@@ -1868,7 +1947,9 @@ discard block |
||
| 1868 | 1947 | $minlat = filter_var($coord[1],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
| 1869 | 1948 | $maxlong = filter_var($coord[2],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
| 1870 | 1949 | $maxlat = filter_var($coord[3],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
| 1871 | - } else return array(); |
|
| 1950 | + } else { |
|
| 1951 | + return array(); |
|
| 1952 | + } |
|
| 1872 | 1953 | if ($globalDBdriver == 'mysql') { |
| 1873 | 1954 | $query = "SELECT airport.* FROM airport WHERE airport.latitude BETWEEN ".$minlat." AND ".$maxlat." AND airport.longitude BETWEEN ".$minlong." AND ".$maxlong." AND airport.type != 'closed'"; |
| 1874 | 1955 | } else { |
@@ -1903,7 +1984,9 @@ discard block |
||
| 1903 | 1984 | $minlat = filter_var($coord[1],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
| 1904 | 1985 | $maxlong = filter_var($coord[2],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
| 1905 | 1986 | $maxlat = filter_var($coord[3],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
| 1906 | - } else return array(); |
|
| 1987 | + } else { |
|
| 1988 | + return array(); |
|
| 1989 | + } |
|
| 1907 | 1990 | //$query = "SELECT waypoints.* FROM waypoints WHERE waypoints.latitude_begin BETWEEN ".$minlat." AND ".$maxlat." AND waypoints.longitude_begin BETWEEN ".$minlong." AND ".$maxlong; |
| 1908 | 1991 | $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.")"; |
| 1909 | 1992 | //$query = "SELECT waypoints.* FROM waypoints"; |
@@ -2029,15 +2112,20 @@ discard block |
||
| 2029 | 2112 | 'A320-211' => 'A320', |
| 2030 | 2113 | '747-8i' => 'B748', |
| 2031 | 2114 | 'A380' => 'A388'); |
| 2032 | - if (isset($all_aircraft[$aircraft_type])) return $all_aircraft[$aircraft_type]; |
|
| 2115 | + if (isset($all_aircraft[$aircraft_type])) { |
|
| 2116 | + return $all_aircraft[$aircraft_type]; |
|
| 2117 | + } |
|
| 2033 | 2118 | |
| 2034 | 2119 | $query = "SELECT aircraft.icao FROM aircraft WHERE aircraft.type LIKE :saircraft_type OR aircraft.type = :aircraft_type OR aircraft.icao = :aircraft_type LIMIT 1"; |
| 2035 | 2120 | $aircraft_type = strtoupper($aircraft_type); |
| 2036 | 2121 | $sth = $this->db->prepare($query); |
| 2037 | 2122 | $sth->execute(array(':saircraft_type' => '%'.$aircraft_type.'%',':aircraft_type' => $aircraft_type,)); |
| 2038 | 2123 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
| 2039 | - if (isset($result[0]['icao'])) return $result[0]['icao']; |
|
| 2040 | - else return ''; |
|
| 2124 | + if (isset($result[0]['icao'])) { |
|
| 2125 | + return $result[0]['icao']; |
|
| 2126 | + } else { |
|
| 2127 | + return ''; |
|
| 2128 | + } |
|
| 2041 | 2129 | } |
| 2042 | 2130 | |
| 2043 | 2131 | /** |
@@ -2059,7 +2147,9 @@ discard block |
||
| 2059 | 2147 | $row = $sth->fetch(PDO::FETCH_ASSOC); |
| 2060 | 2148 | if (isset($row['icaotypecode'])) { |
| 2061 | 2149 | return $row['icaotypecode']; |
| 2062 | - } else return ''; |
|
| 2150 | + } else { |
|
| 2151 | + return ''; |
|
| 2152 | + } |
|
| 2063 | 2153 | } |
| 2064 | 2154 | |
| 2065 | 2155 | /** |
@@ -2080,7 +2170,9 @@ discard block |
||
| 2080 | 2170 | $row = $sth->fetch(PDO::FETCH_ASSOC); |
| 2081 | 2171 | if (isset($row['operator_correct'])) { |
| 2082 | 2172 | return $row['operator_correct']; |
| 2083 | - } else return $operator; |
|
| 2173 | + } else { |
|
| 2174 | + return $operator; |
|
| 2175 | + } |
|
| 2084 | 2176 | } |
| 2085 | 2177 | |
| 2086 | 2178 | /** |
@@ -2093,7 +2185,9 @@ discard block |
||
| 2093 | 2185 | public function getRouteInfo($callsign) |
| 2094 | 2186 | { |
| 2095 | 2187 | $callsign = filter_var($callsign,FILTER_SANITIZE_STRING); |
| 2096 | - if ($callsign == '') return array(); |
|
| 2188 | + if ($callsign == '') { |
|
| 2189 | + return array(); |
|
| 2190 | + } |
|
| 2097 | 2191 | $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"; |
| 2098 | 2192 | |
| 2099 | 2193 | $sth = $this->db->prepare($query); |
@@ -2102,7 +2196,9 @@ discard block |
||
| 2102 | 2196 | $row = $sth->fetch(PDO::FETCH_ASSOC); |
| 2103 | 2197 | if (count($row) > 0) { |
| 2104 | 2198 | return $row; |
| 2105 | - } else return array(); |
|
| 2199 | + } else { |
|
| 2200 | + return array(); |
|
| 2201 | + } |
|
| 2106 | 2202 | } |
| 2107 | 2203 | |
| 2108 | 2204 | /** |
@@ -2154,7 +2250,9 @@ discard block |
||
| 2154 | 2250 | $sth->execute(array(':registration' => $registration)); |
| 2155 | 2251 | |
| 2156 | 2252 | return $sth->fetch(PDO::FETCH_ASSOC); |
| 2157 | - } else return array(); |
|
| 2253 | + } else { |
|
| 2254 | + return array(); |
|
| 2255 | + } |
|
| 2158 | 2256 | } |
| 2159 | 2257 | |
| 2160 | 2258 | |
@@ -2310,8 +2408,11 @@ discard block |
||
| 2310 | 2408 | $query .= " ORDER BY spotter_output.source_name ASC"; |
| 2311 | 2409 | |
| 2312 | 2410 | $sth = $this->db->prepare($query); |
| 2313 | - if (!empty($query_values)) $sth->execute($query_values); |
|
| 2314 | - else $sth->execute(); |
|
| 2411 | + if (!empty($query_values)) { |
|
| 2412 | + $sth->execute($query_values); |
|
| 2413 | + } else { |
|
| 2414 | + $sth->execute(); |
|
| 2415 | + } |
|
| 2315 | 2416 | |
| 2316 | 2417 | $source_array = array(); |
| 2317 | 2418 | $temp_array = array(); |
@@ -2642,7 +2743,9 @@ discard block |
||
| 2642 | 2743 | date_default_timezone_set($globalTimezone); |
| 2643 | 2744 | $datetime = new DateTime(); |
| 2644 | 2745 | $offset = $datetime->format('P'); |
| 2645 | - } else $offset = '+00:00'; |
|
| 2746 | + } else { |
|
| 2747 | + $offset = '+00:00'; |
|
| 2748 | + } |
|
| 2646 | 2749 | if ($airport_icao == '') { |
| 2647 | 2750 | if ($globalDBdriver == 'mysql') { |
| 2648 | 2751 | $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` WHERE spotter_output.date >= DATE_SUB(UTC_TIMESTAMP(), INTERVAL 7 DAY) AND departure_airport_icao <> 'NA' 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"; |
@@ -2674,7 +2777,9 @@ discard block |
||
| 2674 | 2777 | date_default_timezone_set($globalTimezone); |
| 2675 | 2778 | $datetime = new DateTime(); |
| 2676 | 2779 | $offset = $datetime->format('P'); |
| 2677 | - } else $offset = '+00:00'; |
|
| 2780 | + } else { |
|
| 2781 | + $offset = '+00:00'; |
|
| 2782 | + } |
|
| 2678 | 2783 | if ($airport_icao == '') { |
| 2679 | 2784 | if ($globalDBdriver == 'mysql') { |
| 2680 | 2785 | $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 |
@@ -2717,7 +2822,9 @@ discard block |
||
| 2717 | 2822 | date_default_timezone_set($globalTimezone); |
| 2718 | 2823 | $datetime = new DateTime(); |
| 2719 | 2824 | $offset = $datetime->format('P'); |
| 2720 | - } else $offset = '+00:00'; |
|
| 2825 | + } else { |
|
| 2826 | + $offset = '+00:00'; |
|
| 2827 | + } |
|
| 2721 | 2828 | if ($airport_icao == '') { |
| 2722 | 2829 | if ($globalDBdriver == 'mysql') { |
| 2723 | 2830 | $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` WHERE spotter_output.date >= DATE_SUB(UTC_TIMESTAMP(), INTERVAL 7 DAY) AND arrival_airport_icao <> 'NA' 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"; |
@@ -2751,7 +2858,9 @@ discard block |
||
| 2751 | 2858 | date_default_timezone_set($globalTimezone); |
| 2752 | 2859 | $datetime = new DateTime(); |
| 2753 | 2860 | $offset = $datetime->format('P'); |
| 2754 | - } else $offset = '+00:00'; |
|
| 2861 | + } else { |
|
| 2862 | + $offset = '+00:00'; |
|
| 2863 | + } |
|
| 2755 | 2864 | if ($airport_icao == '') { |
| 2756 | 2865 | if ($globalDBdriver == 'mysql') { |
| 2757 | 2866 | $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 |
@@ -2799,7 +2908,9 @@ discard block |
||
| 2799 | 2908 | date_default_timezone_set($globalTimezone); |
| 2800 | 2909 | $datetime = new DateTime(); |
| 2801 | 2910 | $offset = $datetime->format('P'); |
| 2802 | - } else $offset = '+00:00'; |
|
| 2911 | + } else { |
|
| 2912 | + $offset = '+00:00'; |
|
| 2913 | + } |
|
| 2803 | 2914 | |
| 2804 | 2915 | if ($globalDBdriver == 'mysql') { |
| 2805 | 2916 | $query = "SELECT DISTINCT DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) as date |
@@ -2921,7 +3032,9 @@ discard block |
||
| 2921 | 3032 | */ |
| 2922 | 3033 | public function updateLatestSpotterData($flightaware_id = '', $ident = '', $latitude = '', $longitude = '', $altitude = '', $ground = false, $groundspeed = NULL, $date = '', $arrival_airport_icao = '',$arrival_airport_time = '') |
| 2923 | 3034 | { |
| 2924 | - if ($groundspeed == '') $groundspeed = NULL; |
|
| 3035 | + if ($groundspeed == '') { |
|
| 3036 | + $groundspeed = NULL; |
|
| 3037 | + } |
|
| 2925 | 3038 | $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'; |
| 2926 | 3039 | $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); |
| 2927 | 3040 | |
@@ -2971,9 +3084,15 @@ discard block |
||
| 2971 | 3084 | $Image = new Image($this->db); |
| 2972 | 3085 | $Common = new Common(); |
| 2973 | 3086 | |
| 2974 | - if (!isset($globalIVAO)) $globalIVAO = FALSE; |
|
| 2975 | - if (!isset($globalVATSIM)) $globalVATSIM = FALSE; |
|
| 2976 | - if (!isset($globalphpVMS)) $globalphpVMS = FALSE; |
|
| 3087 | + if (!isset($globalIVAO)) { |
|
| 3088 | + $globalIVAO = FALSE; |
|
| 3089 | + } |
|
| 3090 | + if (!isset($globalVATSIM)) { |
|
| 3091 | + $globalVATSIM = FALSE; |
|
| 3092 | + } |
|
| 3093 | + if (!isset($globalphpVMS)) { |
|
| 3094 | + $globalphpVMS = FALSE; |
|
| 3095 | + } |
|
| 2977 | 3096 | date_default_timezone_set('UTC'); |
| 2978 | 3097 | |
| 2979 | 3098 | //getting the registration |
@@ -2986,13 +3105,17 @@ discard block |
||
| 2986 | 3105 | if ($ModeS != '') { |
| 2987 | 3106 | $timeelapsed = microtime(true); |
| 2988 | 3107 | $registration = $this->getAircraftRegistrationBymodeS($ModeS); |
| 2989 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftRegistrationBymodes : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3108 | + if ($globalDebugTimeElapsed) { |
|
| 3109 | + echo 'ADD SPOTTER DATA : Time elapsed for getAircraftRegistrationBymodes : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3110 | + } |
|
| 2990 | 3111 | } else { |
| 2991 | 3112 | $myhex = explode('-',$flightaware_id); |
| 2992 | 3113 | if (count($myhex) > 0) { |
| 2993 | 3114 | $timeelapsed = microtime(true); |
| 2994 | 3115 | $registration = $this->getAircraftRegistrationBymodeS($myhex[0]); |
| 2995 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftRegistrationBymodes : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3116 | + if ($globalDebugTimeElapsed) { |
|
| 3117 | + echo 'ADD SPOTTER DATA : Time elapsed for getAircraftRegistrationBymodes : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3118 | + } |
|
| 2996 | 3119 | } |
| 2997 | 3120 | } |
| 2998 | 3121 | } |
@@ -3021,15 +3144,21 @@ discard block |
||
| 3021 | 3144 | if (!isset($airline_array[0]['icao']) || $airline_array[0]['icao'] == ""){ |
| 3022 | 3145 | $airline_array = $this->getAllAirlineInfo("NA"); |
| 3023 | 3146 | } |
| 3024 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAirlineInfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3147 | + if ($globalDebugTimeElapsed) { |
|
| 3148 | + echo 'ADD SPOTTER DATA : Time elapsed for getAirlineInfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3149 | + } |
|
| 3025 | 3150 | |
| 3026 | 3151 | } else { |
| 3027 | 3152 | $timeelapsed = microtime(true); |
| 3028 | 3153 | $airline_array = $this->getAllAirlineInfo("NA"); |
| 3029 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAirlineInfo(NA) : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3154 | + if ($globalDebugTimeElapsed) { |
|
| 3155 | + echo 'ADD SPOTTER DATA : Time elapsed for getAirlineInfo(NA) : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3156 | + } |
|
| 3030 | 3157 | } |
| 3031 | 3158 | } |
| 3032 | - } else $airline_array = array(); |
|
| 3159 | + } else { |
|
| 3160 | + $airline_array = array(); |
|
| 3161 | + } |
|
| 3033 | 3162 | |
| 3034 | 3163 | //getting the aircraft information |
| 3035 | 3164 | $aircraft_array = array(); |
@@ -3043,27 +3172,37 @@ discard block |
||
| 3043 | 3172 | { |
| 3044 | 3173 | $timeelapsed = microtime(true); |
| 3045 | 3174 | $aircraft_array = $this->getAllAircraftInfo("NA"); |
| 3046 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo(NA) : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3175 | + if ($globalDebugTimeElapsed) { |
|
| 3176 | + echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo(NA) : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3177 | + } |
|
| 3047 | 3178 | } else { |
| 3048 | 3179 | $timeelapsed = microtime(true); |
| 3049 | 3180 | $aircraft_array = $this->getAllAircraftInfo($aircraft_icao); |
| 3050 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3181 | + if ($globalDebugTimeElapsed) { |
|
| 3182 | + echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3183 | + } |
|
| 3051 | 3184 | } |
| 3052 | 3185 | } |
| 3053 | 3186 | } else { |
| 3054 | 3187 | if ($ModeS != '') { |
| 3055 | 3188 | $timeelapsed = microtime(true); |
| 3056 | 3189 | $aircraft_icao = $this->getAllAircraftType($ModeS); |
| 3057 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAllAircraftType : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3190 | + if ($globalDebugTimeElapsed) { |
|
| 3191 | + echo 'ADD SPOTTER DATA : Time elapsed for getAllAircraftType : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3192 | + } |
|
| 3058 | 3193 | if ($aircraft_icao == "" || $aircraft_icao == "XXXX") |
| 3059 | 3194 | { |
| 3060 | 3195 | $timeelapsed = microtime(true); |
| 3061 | 3196 | $aircraft_array = $this->getAllAircraftInfo("NA"); |
| 3062 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo(NA) : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3197 | + if ($globalDebugTimeElapsed) { |
|
| 3198 | + echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo(NA) : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3199 | + } |
|
| 3063 | 3200 | } else { |
| 3064 | 3201 | $timeelapsed = microtime(true); |
| 3065 | 3202 | $aircraft_array = $this->getAllAircraftInfo($aircraft_icao); |
| 3066 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3203 | + if ($globalDebugTimeElapsed) { |
|
| 3204 | + echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3205 | + } |
|
| 3067 | 3206 | } |
| 3068 | 3207 | } |
| 3069 | 3208 | } |
@@ -3078,7 +3217,9 @@ discard block |
||
| 3078 | 3217 | } else { |
| 3079 | 3218 | $timeelapsed = microtime(true); |
| 3080 | 3219 | $departure_airport_array = $this->getAllAirportInfo($departure_airport_icao); |
| 3081 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAllAirportInfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3220 | + if ($globalDebugTimeElapsed) { |
|
| 3221 | + echo 'ADD SPOTTER DATA : Time elapsed for getAllAirportInfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3222 | + } |
|
| 3082 | 3223 | } |
| 3083 | 3224 | } |
| 3084 | 3225 | |
@@ -3092,7 +3233,9 @@ discard block |
||
| 3092 | 3233 | } else { |
| 3093 | 3234 | $timeelapsed = microtime(true); |
| 3094 | 3235 | $arrival_airport_array = $this->getAllAirportInfo($arrival_airport_icao); |
| 3095 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAllAirportInfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3236 | + if ($globalDebugTimeElapsed) { |
|
| 3237 | + echo 'ADD SPOTTER DATA : Time elapsed for getAllAirportInfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3238 | + } |
|
| 3096 | 3239 | } |
| 3097 | 3240 | } |
| 3098 | 3241 | |
@@ -3127,7 +3270,9 @@ discard block |
||
| 3127 | 3270 | { |
| 3128 | 3271 | return false; |
| 3129 | 3272 | } |
| 3130 | - } else $altitude = 0; |
|
| 3273 | + } else { |
|
| 3274 | + $altitude = 0; |
|
| 3275 | + } |
|
| 3131 | 3276 | |
| 3132 | 3277 | if ($heading != "") |
| 3133 | 3278 | { |
@@ -3156,7 +3301,9 @@ discard block |
||
| 3156 | 3301 | { |
| 3157 | 3302 | $timeelapsed = microtime(true); |
| 3158 | 3303 | $image_array = $Image->getSpotterImage($registration); |
| 3159 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getSpotterImage : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3304 | + if ($globalDebugTimeElapsed) { |
|
| 3305 | + echo 'ADD SPOTTER DATA : Time elapsed for getSpotterImage : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3306 | + } |
|
| 3160 | 3307 | if (!isset($image_array[0]['registration'])) |
| 3161 | 3308 | { |
| 3162 | 3309 | //echo "Add image !!!! \n"; |
@@ -3164,14 +3311,21 @@ discard block |
||
| 3164 | 3311 | } |
| 3165 | 3312 | $timeelapsed = microtime(true); |
| 3166 | 3313 | $owner_info = $this->getAircraftOwnerByRegistration($registration); |
| 3167 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftOwnerByRegistration : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3168 | - if ($owner_info['owner'] != '') $aircraft_owner = ucwords(strtolower($owner_info['owner'])); |
|
| 3314 | + if ($globalDebugTimeElapsed) { |
|
| 3315 | + echo 'ADD SPOTTER DATA : Time elapsed for getAircraftOwnerByRegistration : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3316 | + } |
|
| 3317 | + if ($owner_info['owner'] != '') { |
|
| 3318 | + $aircraft_owner = ucwords(strtolower($owner_info['owner'])); |
|
| 3319 | + } |
|
| 3169 | 3320 | } |
| 3170 | 3321 | |
| 3171 | 3322 | if ($globalIVAO && $aircraft_icao != '') |
| 3172 | 3323 | { |
| 3173 | - if (isset($airline_array[0]['icao'])) $airline_icao = $airline_array[0]['icao']; |
|
| 3174 | - else $airline_icao = ''; |
|
| 3324 | + if (isset($airline_array[0]['icao'])) { |
|
| 3325 | + $airline_icao = $airline_array[0]['icao']; |
|
| 3326 | + } else { |
|
| 3327 | + $airline_icao = ''; |
|
| 3328 | + } |
|
| 3175 | 3329 | $image_array = $Image->getSpotterImage('',$aircraft_icao,$airline_icao); |
| 3176 | 3330 | if (!isset($image_array[0]['registration'])) |
| 3177 | 3331 | { |
@@ -3216,12 +3370,24 @@ discard block |
||
| 3216 | 3370 | { |
| 3217 | 3371 | $arrival_airport_array = $this->getAllAirportInfo('NA'); |
| 3218 | 3372 | } |
| 3219 | - if ($registration == '') $registration = 'NA'; |
|
| 3220 | - if ($squawk == '' || $Common->isInteger($squawk) === false) $squawk = NULL; |
|
| 3221 | - if ($verticalrate == '' || $Common->isInteger($verticalrate) === false) $verticalrate = NULL; |
|
| 3222 | - if ($heading == '' || $Common->isInteger($heading) == false) $heading = 0; |
|
| 3223 | - if ($groundspeed == '' || $Common->isInteger($groundspeed) === false) $groundspeed = 0; |
|
| 3224 | - if (!isset($aircraft_owner)) $aircraft_owner = NULL; |
|
| 3373 | + if ($registration == '') { |
|
| 3374 | + $registration = 'NA'; |
|
| 3375 | + } |
|
| 3376 | + if ($squawk == '' || $Common->isInteger($squawk) === false) { |
|
| 3377 | + $squawk = NULL; |
|
| 3378 | + } |
|
| 3379 | + if ($verticalrate == '' || $Common->isInteger($verticalrate) === false) { |
|
| 3380 | + $verticalrate = NULL; |
|
| 3381 | + } |
|
| 3382 | + if ($heading == '' || $Common->isInteger($heading) == false) { |
|
| 3383 | + $heading = 0; |
|
| 3384 | + } |
|
| 3385 | + if ($groundspeed == '' || $Common->isInteger($groundspeed) === false) { |
|
| 3386 | + $groundspeed = 0; |
|
| 3387 | + } |
|
| 3388 | + if (!isset($aircraft_owner)) { |
|
| 3389 | + $aircraft_owner = NULL; |
|
| 3390 | + } |
|
| 3225 | 3391 | $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) |
| 3226 | 3392 | 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)"; |
| 3227 | 3393 | |
@@ -3232,9 +3398,13 @@ discard block |
||
| 3232 | 3398 | if ($airline_type == '') { |
| 3233 | 3399 | $timeelapsed = microtime(true); |
| 3234 | 3400 | $airline_type = $this->getAircraftTypeBymodeS($ModeS); |
| 3235 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftTypeBymodes : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3401 | + if ($globalDebugTimeElapsed) { |
|
| 3402 | + echo 'ADD SPOTTER DATA : Time elapsed for getAircraftTypeBymodes : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3403 | + } |
|
| 3404 | + } |
|
| 3405 | + if ($airline_type == null) { |
|
| 3406 | + $airline_type = ''; |
|
| 3236 | 3407 | } |
| 3237 | - if ($airline_type == null) $airline_type = ''; |
|
| 3238 | 3408 | $aircraft_type = $aircraft_array[0]['type']; |
| 3239 | 3409 | $aircraft_manufacturer = $aircraft_array[0]['manufacturer']; |
| 3240 | 3410 | $departure_airport_name = $departure_airport_array[0]['name']; |
@@ -3369,7 +3539,9 @@ discard block |
||
| 3369 | 3539 | } |
| 3370 | 3540 | } |
| 3371 | 3541 | $query .= "GROUP BY spotter_output.airline_name,spotter_output.airline_icao, spotter_output.airline_country ORDER BY airline_count DESC"; |
| 3372 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
| 3542 | + if ($limit) { |
|
| 3543 | + $query .= " LIMIT 10 OFFSET 0"; |
|
| 3544 | + } |
|
| 3373 | 3545 | |
| 3374 | 3546 | $sth = $this->db->prepare($query); |
| 3375 | 3547 | $sth->execute(); |
@@ -3414,7 +3586,9 @@ discard block |
||
| 3414 | 3586 | } |
| 3415 | 3587 | } |
| 3416 | 3588 | $query .= "GROUP BY spotter_output.pilot_id,spotter_output.pilot_name ORDER BY pilot_count DESC"; |
| 3417 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
| 3589 | + if ($limit) { |
|
| 3590 | + $query .= " LIMIT 10 OFFSET 0"; |
|
| 3591 | + } |
|
| 3418 | 3592 | |
| 3419 | 3593 | |
| 3420 | 3594 | $sth = $this->db->prepare($query); |
@@ -3460,7 +3634,9 @@ discard block |
||
| 3460 | 3634 | } |
| 3461 | 3635 | } |
| 3462 | 3636 | $query .= "GROUP BY spotter_output.owner_name ORDER BY owner_count DESC"; |
| 3463 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
| 3637 | + if ($limit) { |
|
| 3638 | + $query .= " LIMIT 10 OFFSET 0"; |
|
| 3639 | + } |
|
| 3464 | 3640 | |
| 3465 | 3641 | |
| 3466 | 3642 | $sth = $this->db->prepare($query); |
@@ -3709,7 +3885,9 @@ discard block |
||
| 3709 | 3885 | date_default_timezone_set($globalTimezone); |
| 3710 | 3886 | $datetime = new DateTime($date); |
| 3711 | 3887 | $offset = $datetime->format('P'); |
| 3712 | - } else $offset = '+00:00'; |
|
| 3888 | + } else { |
|
| 3889 | + $offset = '+00:00'; |
|
| 3890 | + } |
|
| 3713 | 3891 | |
| 3714 | 3892 | if ($globalDBdriver == 'mysql') { |
| 3715 | 3893 | $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
@@ -3758,7 +3936,9 @@ discard block |
||
| 3758 | 3936 | date_default_timezone_set($globalTimezone); |
| 3759 | 3937 | $datetime = new DateTime($date); |
| 3760 | 3938 | $offset = $datetime->format('P'); |
| 3761 | - } else $offset = '+00:00'; |
|
| 3939 | + } else { |
|
| 3940 | + $offset = '+00:00'; |
|
| 3941 | + } |
|
| 3762 | 3942 | |
| 3763 | 3943 | if ($globalDBdriver == 'mysql') { |
| 3764 | 3944 | $query = "SELECT DISTINCT spotter_output.airline_country, COUNT(spotter_output.airline_country) AS airline_country_count |
@@ -3981,7 +4161,9 @@ discard block |
||
| 3981 | 4161 | WHERE spotter_output.airline_country <> '' AND spotter_output.airline_country <> 'NA' |
| 3982 | 4162 | GROUP BY spotter_output.airline_country |
| 3983 | 4163 | ORDER BY airline_country_count DESC"; |
| 3984 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
| 4164 | + if ($limit) { |
|
| 4165 | + $query .= " LIMIT 10 OFFSET 0"; |
|
| 4166 | + } |
|
| 3985 | 4167 | |
| 3986 | 4168 | $sth = $this->db->prepare($query); |
| 3987 | 4169 | $sth->execute(); |
@@ -4022,9 +4204,13 @@ discard block |
||
| 4022 | 4204 | $query .= "AND date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
| 4023 | 4205 | } |
| 4024 | 4206 | } |
| 4025 | - if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
| 4207 | + if ($sincedate != '') { |
|
| 4208 | + $query .= "AND date > '".$sincedate."' "; |
|
| 4209 | + } |
|
| 4026 | 4210 | $query .= "GROUP BY c.name ORDER BY nb DESC"; |
| 4027 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
| 4211 | + if ($limit) { |
|
| 4212 | + $query .= " LIMIT 10 OFFSET 0"; |
|
| 4213 | + } |
|
| 4028 | 4214 | |
| 4029 | 4215 | |
| 4030 | 4216 | $sth = $this->db->prepare($query); |
@@ -4075,7 +4261,9 @@ discard block |
||
| 4075 | 4261 | //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
| 4076 | 4262 | //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
| 4077 | 4263 | $query .= "GROUP BY spotter_output.aircraft_icao, spotter_output.aircraft_name ORDER BY aircraft_icao_count DESC"; |
| 4078 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
| 4264 | + if ($limit) { |
|
| 4265 | + $query .= " LIMIT 10 OFFSET 0"; |
|
| 4266 | + } |
|
| 4079 | 4267 | |
| 4080 | 4268 | |
| 4081 | 4269 | $sth = $this->db->prepare($query); |
@@ -4129,7 +4317,9 @@ discard block |
||
| 4129 | 4317 | if($row['registration'] != "") |
| 4130 | 4318 | { |
| 4131 | 4319 | $image_array = $Image->getSpotterImage($row['registration']); |
| 4132 | - if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
| 4320 | + if (isset($image_array[0]['image_thumbnail'])) { |
|
| 4321 | + $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
| 4322 | + } |
|
| 4133 | 4323 | } |
| 4134 | 4324 | $temp_array['registration_count'] = $row['registration_count']; |
| 4135 | 4325 | |
@@ -4205,7 +4395,9 @@ discard block |
||
| 4205 | 4395 | if($row['registration'] != "") |
| 4206 | 4396 | { |
| 4207 | 4397 | $image_array = $Image->getSpotterImage($row['registration']); |
| 4208 | - if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
| 4398 | + if (isset($image_array[0]['image_thumbnail'])) { |
|
| 4399 | + $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
| 4400 | + } |
|
| 4209 | 4401 | } |
| 4210 | 4402 | $temp_array['registration_count'] = $row['registration_count']; |
| 4211 | 4403 | |
@@ -4439,7 +4631,9 @@ discard block |
||
| 4439 | 4631 | date_default_timezone_set($globalTimezone); |
| 4440 | 4632 | $datetime = new DateTime($date); |
| 4441 | 4633 | $offset = $datetime->format('P'); |
| 4442 | - } else $offset = '+00:00'; |
|
| 4634 | + } else { |
|
| 4635 | + $offset = '+00:00'; |
|
| 4636 | + } |
|
| 4443 | 4637 | |
| 4444 | 4638 | if ($globalDBdriver == 'mysql') { |
| 4445 | 4639 | $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name |
@@ -4487,7 +4681,9 @@ discard block |
||
| 4487 | 4681 | date_default_timezone_set($globalTimezone); |
| 4488 | 4682 | $datetime = new DateTime($date); |
| 4489 | 4683 | $offset = $datetime->format('P'); |
| 4490 | - } else $offset = '+00:00'; |
|
| 4684 | + } else { |
|
| 4685 | + $offset = '+00:00'; |
|
| 4686 | + } |
|
| 4491 | 4687 | |
| 4492 | 4688 | if ($globalDBdriver == 'mysql') { |
| 4493 | 4689 | $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 |
@@ -4542,7 +4738,9 @@ discard block |
||
| 4542 | 4738 | date_default_timezone_set($globalTimezone); |
| 4543 | 4739 | $datetime = new DateTime($date); |
| 4544 | 4740 | $offset = $datetime->format('P'); |
| 4545 | - } else $offset = '+00:00'; |
|
| 4741 | + } else { |
|
| 4742 | + $offset = '+00:00'; |
|
| 4743 | + } |
|
| 4546 | 4744 | |
| 4547 | 4745 | if ($globalDBdriver == 'mysql') { |
| 4548 | 4746 | $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
@@ -4643,8 +4841,11 @@ discard block |
||
| 4643 | 4841 | if($row['registration'] != "") |
| 4644 | 4842 | { |
| 4645 | 4843 | $image_array = $Image->getSpotterImage($row['registration']); |
| 4646 | - if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
| 4647 | - else $temp_array['image_thumbnail'] = ''; |
|
| 4844 | + if (isset($image_array[0]['image_thumbnail'])) { |
|
| 4845 | + $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
| 4846 | + } else { |
|
| 4847 | + $temp_array['image_thumbnail'] = ''; |
|
| 4848 | + } |
|
| 4648 | 4849 | } |
| 4649 | 4850 | $temp_array['registration_count'] = $row['registration_count']; |
| 4650 | 4851 | $aircraft_array[] = $temp_array; |
@@ -4752,7 +4953,9 @@ discard block |
||
| 4752 | 4953 | if($row['registration'] != "") |
| 4753 | 4954 | { |
| 4754 | 4955 | $image_array = $Image->getSpotterImage($row['registration']); |
| 4755 | - if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
| 4956 | + if (isset($image_array[0]['image_thumbnail'])) { |
|
| 4957 | + $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
| 4958 | + } |
|
| 4756 | 4959 | } |
| 4757 | 4960 | $temp_array['registration_count'] = $row['registration_count']; |
| 4758 | 4961 | |
@@ -4871,7 +5074,9 @@ discard block |
||
| 4871 | 5074 | if($row['registration'] != "") |
| 4872 | 5075 | { |
| 4873 | 5076 | $image_array = $Image->getSpotterImage($row['registration']); |
| 4874 | - if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
| 5077 | + if (isset($image_array[0]['image_thumbnail'])) { |
|
| 5078 | + $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
| 5079 | + } |
|
| 4875 | 5080 | } |
| 4876 | 5081 | $temp_array['registration_count'] = $row['registration_count']; |
| 4877 | 5082 | |
@@ -4984,7 +5189,9 @@ discard block |
||
| 4984 | 5189 | // if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
| 4985 | 5190 | //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
| 4986 | 5191 | $query .= "GROUP BY spotter_output.registration, spotter_output.aircraft_icao, spotter_output.aircraft_name, spotter_output.airline_name ORDER BY aircraft_registration_count DESC"; |
| 4987 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
| 5192 | + if ($limit) { |
|
| 5193 | + $query .= " LIMIT 10 OFFSET 0"; |
|
| 5194 | + } |
|
| 4988 | 5195 | |
| 4989 | 5196 | $sth = $this->db->prepare($query); |
| 4990 | 5197 | $sth->execute(); |
@@ -5003,7 +5210,9 @@ discard block |
||
| 5003 | 5210 | if($row['registration'] != "") |
| 5004 | 5211 | { |
| 5005 | 5212 | $image_array = $Image->getSpotterImage($row['registration']); |
| 5006 | - if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
| 5213 | + if (isset($image_array[0]['image_thumbnail'])) { |
|
| 5214 | + $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
| 5215 | + } |
|
| 5007 | 5216 | } |
| 5008 | 5217 | |
| 5009 | 5218 | $aircraft_array[] = $temp_array; |
@@ -5046,7 +5255,9 @@ discard block |
||
| 5046 | 5255 | //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
| 5047 | 5256 | $query .= "GROUP BY spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country |
| 5048 | 5257 | ORDER BY airport_departure_icao_count DESC"; |
| 5049 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
| 5258 | + if ($limit) { |
|
| 5259 | + $query .= " LIMIT 10 OFFSET 0"; |
|
| 5260 | + } |
|
| 5050 | 5261 | |
| 5051 | 5262 | $sth = $this->db->prepare($query); |
| 5052 | 5263 | $sth->execute(); |
@@ -5098,7 +5309,9 @@ discard block |
||
| 5098 | 5309 | //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
| 5099 | 5310 | $query .= "GROUP BY spotter_output.real_departure_airport_icao, airport.name, airport.city, airport.country |
| 5100 | 5311 | ORDER BY airport_departure_icao_count DESC"; |
| 5101 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
| 5312 | + if ($limit) { |
|
| 5313 | + $query .= " LIMIT 10 OFFSET 0"; |
|
| 5314 | + } |
|
| 5102 | 5315 | |
| 5103 | 5316 | $sth = $this->db->prepare($query); |
| 5104 | 5317 | $sth->execute(); |
@@ -5504,7 +5717,9 @@ discard block |
||
| 5504 | 5717 | date_default_timezone_set($globalTimezone); |
| 5505 | 5718 | $datetime = new DateTime($date); |
| 5506 | 5719 | $offset = $datetime->format('P'); |
| 5507 | - } else $offset = '+00:00'; |
|
| 5720 | + } else { |
|
| 5721 | + $offset = '+00:00'; |
|
| 5722 | + } |
|
| 5508 | 5723 | |
| 5509 | 5724 | if ($globalDBdriver == 'mysql') { |
| 5510 | 5725 | $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 |
@@ -5555,7 +5770,9 @@ discard block |
||
| 5555 | 5770 | date_default_timezone_set($globalTimezone); |
| 5556 | 5771 | $datetime = new DateTime($date); |
| 5557 | 5772 | $offset = $datetime->format('P'); |
| 5558 | - } else $offset = '+00:00'; |
|
| 5773 | + } else { |
|
| 5774 | + $offset = '+00:00'; |
|
| 5775 | + } |
|
| 5559 | 5776 | |
| 5560 | 5777 | if ($globalDBdriver == 'mysql') { |
| 5561 | 5778 | $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
@@ -5773,7 +5990,9 @@ discard block |
||
| 5773 | 5990 | //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
| 5774 | 5991 | $query .= "GROUP BY spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
| 5775 | 5992 | ORDER BY airport_arrival_icao_count DESC"; |
| 5776 | - if ($limit) $query .= " LIMIT 10"; |
|
| 5993 | + if ($limit) { |
|
| 5994 | + $query .= " LIMIT 10"; |
|
| 5995 | + } |
|
| 5777 | 5996 | |
| 5778 | 5997 | |
| 5779 | 5998 | $sth = $this->db->prepare($query); |
@@ -5793,7 +6012,9 @@ discard block |
||
| 5793 | 6012 | if ($icaoaskey) { |
| 5794 | 6013 | $icao = $row['arrival_airport_icao']; |
| 5795 | 6014 | $airport_array[$icao] = $temp_array; |
| 5796 | - } else $airport_array[] = $temp_array; |
|
| 6015 | + } else { |
|
| 6016 | + $airport_array[] = $temp_array; |
|
| 6017 | + } |
|
| 5797 | 6018 | } |
| 5798 | 6019 | |
| 5799 | 6020 | return $airport_array; |
@@ -5835,7 +6056,9 @@ discard block |
||
| 5835 | 6056 | //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
| 5836 | 6057 | $query .= "GROUP BY spotter_output.real_arrival_airport_icao, airport.name, airport.city, airport.country |
| 5837 | 6058 | ORDER BY airport_arrival_icao_count DESC"; |
| 5838 | - if ($limit) $query .= " LIMIT 10"; |
|
| 6059 | + if ($limit) { |
|
| 6060 | + $query .= " LIMIT 10"; |
|
| 6061 | + } |
|
| 5839 | 6062 | |
| 5840 | 6063 | |
| 5841 | 6064 | $sth = $this->db->prepare($query); |
@@ -5855,7 +6078,9 @@ discard block |
||
| 5855 | 6078 | if ($icaoaskey) { |
| 5856 | 6079 | $icao = $row['arrival_airport_icao']; |
| 5857 | 6080 | $airport_array[$icao] = $temp_array; |
| 5858 | - } else $airport_array[] = $temp_array; |
|
| 6081 | + } else { |
|
| 6082 | + $airport_array[] = $temp_array; |
|
| 6083 | + } |
|
| 5859 | 6084 | } |
| 5860 | 6085 | |
| 5861 | 6086 | return $airport_array; |
@@ -6246,7 +6471,9 @@ discard block |
||
| 6246 | 6471 | date_default_timezone_set($globalTimezone); |
| 6247 | 6472 | $datetime = new DateTime($date); |
| 6248 | 6473 | $offset = $datetime->format('P'); |
| 6249 | - } else $offset = '+00:00'; |
|
| 6474 | + } else { |
|
| 6475 | + $offset = '+00:00'; |
|
| 6476 | + } |
|
| 6250 | 6477 | |
| 6251 | 6478 | if ($globalDBdriver == 'mysql') { |
| 6252 | 6479 | $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 |
@@ -6297,7 +6524,9 @@ discard block |
||
| 6297 | 6524 | date_default_timezone_set($globalTimezone); |
| 6298 | 6525 | $datetime = new DateTime($date); |
| 6299 | 6526 | $offset = $datetime->format('P'); |
| 6300 | - } else $offset = '+00:00'; |
|
| 6527 | + } else { |
|
| 6528 | + $offset = '+00:00'; |
|
| 6529 | + } |
|
| 6301 | 6530 | |
| 6302 | 6531 | if ($globalDBdriver == 'mysql') { |
| 6303 | 6532 | $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
@@ -6526,7 +6755,9 @@ discard block |
||
| 6526 | 6755 | WHERE spotter_output.arrival_airport_country <> '' AND spotter_output.arrival_airport_icao <> 'NA' |
| 6527 | 6756 | GROUP BY spotter_output.arrival_airport_country |
| 6528 | 6757 | ORDER BY airport_arrival_country_count DESC"; |
| 6529 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
| 6758 | + if ($limit) { |
|
| 6759 | + $query .= " LIMIT 10 OFFSET 0"; |
|
| 6760 | + } |
|
| 6530 | 6761 | |
| 6531 | 6762 | |
| 6532 | 6763 | $sth = $this->db->prepare($query); |
@@ -6821,7 +7052,9 @@ discard block |
||
| 6821 | 7052 | date_default_timezone_set($globalTimezone); |
| 6822 | 7053 | $datetime = new DateTime($date); |
| 6823 | 7054 | $offset = $datetime->format('P'); |
| 6824 | - } else $offset = '+00:00'; |
|
| 7055 | + } else { |
|
| 7056 | + $offset = '+00:00'; |
|
| 7057 | + } |
|
| 6825 | 7058 | |
| 6826 | 7059 | if ($globalDBdriver == 'mysql') { |
| 6827 | 7060 | $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 |
@@ -7004,15 +7237,23 @@ discard block |
||
| 7004 | 7237 | FROM spotter_output |
| 7005 | 7238 | WHERE spotter_output.ident <> '' "; |
| 7006 | 7239 | if ($olderthanmonths > 0) { |
| 7007 | - if ($globalDBdriver == 'mysql') $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
| 7008 | - else $query .= "AND date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
|
| 7240 | + if ($globalDBdriver == 'mysql') { |
|
| 7241 | + $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
| 7242 | + } else { |
|
| 7243 | + $query .= "AND date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
|
| 7244 | + } |
|
| 7009 | 7245 | } |
| 7010 | 7246 | if ($sincedate != '') { |
| 7011 | - if ($globalDBdriver == 'mysql') $query .= "AND date > '".$sincedate."' "; |
|
| 7012 | - else $query .= "AND date > CAST('".$sincedate."' AS TIMESTAMP) "; |
|
| 7247 | + if ($globalDBdriver == 'mysql') { |
|
| 7248 | + $query .= "AND date > '".$sincedate."' "; |
|
| 7249 | + } else { |
|
| 7250 | + $query .= "AND date > CAST('".$sincedate."' AS TIMESTAMP) "; |
|
| 7251 | + } |
|
| 7013 | 7252 | } |
| 7014 | 7253 | $query .= "GROUP BY spotter_output.ident, spotter_output.airline_name, spotter_output.airline_icao ORDER BY callsign_icao_count DESC"; |
| 7015 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
| 7254 | + if ($limit) { |
|
| 7255 | + $query .= " LIMIT 10 OFFSET 0"; |
|
| 7256 | + } |
|
| 7016 | 7257 | |
| 7017 | 7258 | $sth = $this->db->prepare($query); |
| 7018 | 7259 | $sth->execute(); |
@@ -7049,7 +7290,9 @@ discard block |
||
| 7049 | 7290 | date_default_timezone_set($globalTimezone); |
| 7050 | 7291 | $datetime = new DateTime(); |
| 7051 | 7292 | $offset = $datetime->format('P'); |
| 7052 | - } else $offset = '+00:00'; |
|
| 7293 | + } else { |
|
| 7294 | + $offset = '+00:00'; |
|
| 7295 | + } |
|
| 7053 | 7296 | |
| 7054 | 7297 | if ($globalDBdriver == 'mysql') { |
| 7055 | 7298 | $query = "SELECT DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS date_name, count(*) as date_count |
@@ -7098,7 +7341,9 @@ discard block |
||
| 7098 | 7341 | date_default_timezone_set($globalTimezone); |
| 7099 | 7342 | $datetime = new DateTime(); |
| 7100 | 7343 | $offset = $datetime->format('P'); |
| 7101 | - } else $offset = '+00:00'; |
|
| 7344 | + } else { |
|
| 7345 | + $offset = '+00:00'; |
|
| 7346 | + } |
|
| 7102 | 7347 | |
| 7103 | 7348 | if ($globalDBdriver == 'mysql') { |
| 7104 | 7349 | $query = "SELECT DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS date_name, count(*) as date_count |
@@ -7146,7 +7391,9 @@ discard block |
||
| 7146 | 7391 | date_default_timezone_set($globalTimezone); |
| 7147 | 7392 | $datetime = new DateTime(); |
| 7148 | 7393 | $offset = $datetime->format('P'); |
| 7149 | - } else $offset = '+00:00'; |
|
| 7394 | + } else { |
|
| 7395 | + $offset = '+00:00'; |
|
| 7396 | + } |
|
| 7150 | 7397 | |
| 7151 | 7398 | if ($globalDBdriver == 'mysql') { |
| 7152 | 7399 | $query = "SELECT DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS date_name, count(*) as date_count |
@@ -7194,7 +7441,9 @@ discard block |
||
| 7194 | 7441 | date_default_timezone_set($globalTimezone); |
| 7195 | 7442 | $datetime = new DateTime(); |
| 7196 | 7443 | $offset = $datetime->format('P'); |
| 7197 | - } else $offset = '+00:00'; |
|
| 7444 | + } else { |
|
| 7445 | + $offset = '+00:00'; |
|
| 7446 | + } |
|
| 7198 | 7447 | |
| 7199 | 7448 | if ($globalDBdriver == 'mysql') { |
| 7200 | 7449 | $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 |
@@ -7240,7 +7489,9 @@ discard block |
||
| 7240 | 7489 | date_default_timezone_set($globalTimezone); |
| 7241 | 7490 | $datetime = new DateTime(); |
| 7242 | 7491 | $offset = $datetime->format('P'); |
| 7243 | - } else $offset = '+00:00'; |
|
| 7492 | + } else { |
|
| 7493 | + $offset = '+00:00'; |
|
| 7494 | + } |
|
| 7244 | 7495 | |
| 7245 | 7496 | if ($globalDBdriver == 'mysql') { |
| 7246 | 7497 | $query = "SELECT YEAR(CONVERT_TZ(s.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(s.date,'+00:00', :offset)) AS month_name, count(*) as date_count |
@@ -7287,7 +7538,9 @@ discard block |
||
| 7287 | 7538 | date_default_timezone_set($globalTimezone); |
| 7288 | 7539 | $datetime = new DateTime(); |
| 7289 | 7540 | $offset = $datetime->format('P'); |
| 7290 | - } else $offset = '+00:00'; |
|
| 7541 | + } else { |
|
| 7542 | + $offset = '+00:00'; |
|
| 7543 | + } |
|
| 7291 | 7544 | |
| 7292 | 7545 | if ($globalDBdriver == 'mysql') { |
| 7293 | 7546 | $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 owner_name) as date_count |
@@ -7334,7 +7587,9 @@ discard block |
||
| 7334 | 7587 | date_default_timezone_set($globalTimezone); |
| 7335 | 7588 | $datetime = new DateTime(); |
| 7336 | 7589 | $offset = $datetime->format('P'); |
| 7337 | - } else $offset = '+00:00'; |
|
| 7590 | + } else { |
|
| 7591 | + $offset = '+00:00'; |
|
| 7592 | + } |
|
| 7338 | 7593 | |
| 7339 | 7594 | if ($globalDBdriver == 'mysql') { |
| 7340 | 7595 | $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 pilot_id) as date_count |
@@ -7382,7 +7637,9 @@ discard block |
||
| 7382 | 7637 | date_default_timezone_set($globalTimezone); |
| 7383 | 7638 | $datetime = new DateTime(); |
| 7384 | 7639 | $offset = $datetime->format('P'); |
| 7385 | - } else $offset = '+00:00'; |
|
| 7640 | + } else { |
|
| 7641 | + $offset = '+00:00'; |
|
| 7642 | + } |
|
| 7386 | 7643 | |
| 7387 | 7644 | if ($globalDBdriver == 'mysql') { |
| 7388 | 7645 | $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 |
@@ -7429,7 +7686,9 @@ discard block |
||
| 7429 | 7686 | date_default_timezone_set($globalTimezone); |
| 7430 | 7687 | $datetime = new DateTime(); |
| 7431 | 7688 | $offset = $datetime->format('P'); |
| 7432 | - } else $offset = '+00:00'; |
|
| 7689 | + } else { |
|
| 7690 | + $offset = '+00:00'; |
|
| 7691 | + } |
|
| 7433 | 7692 | |
| 7434 | 7693 | if ($globalDBdriver == 'mysql') { |
| 7435 | 7694 | $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 aircraft_icao) as date_count |
@@ -7477,7 +7736,9 @@ discard block |
||
| 7477 | 7736 | date_default_timezone_set($globalTimezone); |
| 7478 | 7737 | $datetime = new DateTime(); |
| 7479 | 7738 | $offset = $datetime->format('P'); |
| 7480 | - } else $offset = '+00:00'; |
|
| 7739 | + } else { |
|
| 7740 | + $offset = '+00:00'; |
|
| 7741 | + } |
|
| 7481 | 7742 | |
| 7482 | 7743 | if ($globalDBdriver == 'mysql') { |
| 7483 | 7744 | $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(real_arrival_airport_icao) as date_count |
@@ -7526,7 +7787,9 @@ discard block |
||
| 7526 | 7787 | date_default_timezone_set($globalTimezone); |
| 7527 | 7788 | $datetime = new DateTime(); |
| 7528 | 7789 | $offset = $datetime->format('P'); |
| 7529 | - } else $offset = '+00:00'; |
|
| 7790 | + } else { |
|
| 7791 | + $offset = '+00:00'; |
|
| 7792 | + } |
|
| 7530 | 7793 | |
| 7531 | 7794 | if ($globalDBdriver == 'mysql') { |
| 7532 | 7795 | $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 |
@@ -7577,7 +7840,9 @@ discard block |
||
| 7577 | 7840 | date_default_timezone_set($globalTimezone); |
| 7578 | 7841 | $datetime = new DateTime(); |
| 7579 | 7842 | $offset = $datetime->format('P'); |
| 7580 | - } else $offset = '+00:00'; |
|
| 7843 | + } else { |
|
| 7844 | + $offset = '+00:00'; |
|
| 7845 | + } |
|
| 7581 | 7846 | |
| 7582 | 7847 | $orderby_sql = ''; |
| 7583 | 7848 | if ($orderby == "hour") |
@@ -7641,7 +7906,9 @@ discard block |
||
| 7641 | 7906 | date_default_timezone_set($globalTimezone); |
| 7642 | 7907 | $datetime = new DateTime(); |
| 7643 | 7908 | $offset = $datetime->format('P'); |
| 7644 | - } else $offset = '+00:00'; |
|
| 7909 | + } else { |
|
| 7910 | + $offset = '+00:00'; |
|
| 7911 | + } |
|
| 7645 | 7912 | |
| 7646 | 7913 | $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING); |
| 7647 | 7914 | |
@@ -7693,7 +7960,9 @@ discard block |
||
| 7693 | 7960 | date_default_timezone_set($globalTimezone); |
| 7694 | 7961 | $datetime = new DateTime(); |
| 7695 | 7962 | $offset = $datetime->format('P'); |
| 7696 | - } else $offset = '+00:00'; |
|
| 7963 | + } else { |
|
| 7964 | + $offset = '+00:00'; |
|
| 7965 | + } |
|
| 7697 | 7966 | |
| 7698 | 7967 | if ($globalDBdriver == 'mysql') { |
| 7699 | 7968 | $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
@@ -7741,7 +8010,9 @@ discard block |
||
| 7741 | 8010 | date_default_timezone_set($globalTimezone); |
| 7742 | 8011 | $datetime = new DateTime(); |
| 7743 | 8012 | $offset = $datetime->format('P'); |
| 7744 | - } else $offset = '+00:00'; |
|
| 8013 | + } else { |
|
| 8014 | + $offset = '+00:00'; |
|
| 8015 | + } |
|
| 7745 | 8016 | |
| 7746 | 8017 | if ($globalDBdriver == 'mysql') { |
| 7747 | 8018 | $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
@@ -7789,7 +8060,9 @@ discard block |
||
| 7789 | 8060 | date_default_timezone_set($globalTimezone); |
| 7790 | 8061 | $datetime = new DateTime(); |
| 7791 | 8062 | $offset = $datetime->format('P'); |
| 7792 | - } else $offset = '+00:00'; |
|
| 8063 | + } else { |
|
| 8064 | + $offset = '+00:00'; |
|
| 8065 | + } |
|
| 7793 | 8066 | |
| 7794 | 8067 | if ($globalDBdriver == 'mysql') { |
| 7795 | 8068 | $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
@@ -7838,7 +8111,9 @@ discard block |
||
| 7838 | 8111 | date_default_timezone_set($globalTimezone); |
| 7839 | 8112 | $datetime = new DateTime(); |
| 7840 | 8113 | $offset = $datetime->format('P'); |
| 7841 | - } else $offset = '+00:00'; |
|
| 8114 | + } else { |
|
| 8115 | + $offset = '+00:00'; |
|
| 8116 | + } |
|
| 7842 | 8117 | |
| 7843 | 8118 | if ($globalDBdriver == 'mysql') { |
| 7844 | 8119 | $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
@@ -7887,7 +8162,9 @@ discard block |
||
| 7887 | 8162 | date_default_timezone_set($globalTimezone); |
| 7888 | 8163 | $datetime = new DateTime($date); |
| 7889 | 8164 | $offset = $datetime->format('P'); |
| 7890 | - } else $offset = '+00:00'; |
|
| 8165 | + } else { |
|
| 8166 | + $offset = '+00:00'; |
|
| 8167 | + } |
|
| 7891 | 8168 | |
| 7892 | 8169 | if ($globalDBdriver == 'mysql') { |
| 7893 | 8170 | $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
@@ -7936,7 +8213,9 @@ discard block |
||
| 7936 | 8213 | date_default_timezone_set($globalTimezone); |
| 7937 | 8214 | $datetime = new DateTime(); |
| 7938 | 8215 | $offset = $datetime->format('P'); |
| 7939 | - } else $offset = '+00:00'; |
|
| 8216 | + } else { |
|
| 8217 | + $offset = '+00:00'; |
|
| 8218 | + } |
|
| 7940 | 8219 | |
| 7941 | 8220 | if ($globalDBdriver == 'mysql') { |
| 7942 | 8221 | $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
@@ -7987,7 +8266,9 @@ discard block |
||
| 7987 | 8266 | date_default_timezone_set($globalTimezone); |
| 7988 | 8267 | $datetime = new DateTime(); |
| 7989 | 8268 | $offset = $datetime->format('P'); |
| 7990 | - } else $offset = '+00:00'; |
|
| 8269 | + } else { |
|
| 8270 | + $offset = '+00:00'; |
|
| 8271 | + } |
|
| 7991 | 8272 | |
| 7992 | 8273 | if ($globalDBdriver == 'mysql') { |
| 7993 | 8274 | $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
@@ -8035,7 +8316,9 @@ discard block |
||
| 8035 | 8316 | date_default_timezone_set($globalTimezone); |
| 8036 | 8317 | $datetime = new DateTime(); |
| 8037 | 8318 | $offset = $datetime->format('P'); |
| 8038 | - } else $offset = '+00:00'; |
|
| 8319 | + } else { |
|
| 8320 | + $offset = '+00:00'; |
|
| 8321 | + } |
|
| 8039 | 8322 | |
| 8040 | 8323 | if ($globalDBdriver == 'mysql') { |
| 8041 | 8324 | $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
@@ -8211,7 +8494,9 @@ discard block |
||
| 8211 | 8494 | date_default_timezone_set($globalTimezone); |
| 8212 | 8495 | $datetime = new DateTime(); |
| 8213 | 8496 | $offset = $datetime->format('P'); |
| 8214 | - } else $offset = '+00:00'; |
|
| 8497 | + } else { |
|
| 8498 | + $offset = '+00:00'; |
|
| 8499 | + } |
|
| 8215 | 8500 | |
| 8216 | 8501 | if ($globalDBdriver == 'mysql') { |
| 8217 | 8502 | $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
@@ -8387,7 +8672,9 @@ discard block |
||
| 8387 | 8672 | */ |
| 8388 | 8673 | public function parseDirection($direction = 0) |
| 8389 | 8674 | { |
| 8390 | - if ($direction == '') $direction = 0; |
|
| 8675 | + if ($direction == '') { |
|
| 8676 | + $direction = 0; |
|
| 8677 | + } |
|
| 8391 | 8678 | $direction_array = array(); |
| 8392 | 8679 | $temp_array = array(); |
| 8393 | 8680 | |
@@ -8488,7 +8775,9 @@ discard block |
||
| 8488 | 8775 | if (isset($result->AirlineFlightInfoResult)) |
| 8489 | 8776 | { |
| 8490 | 8777 | $registration = $result->AirlineFlightInfoResult->tailnumber; |
| 8491 | - } else return ''; |
|
| 8778 | + } else { |
|
| 8779 | + return ''; |
|
| 8780 | + } |
|
| 8492 | 8781 | |
| 8493 | 8782 | $registration = $this->convertAircraftRegistration($registration); |
| 8494 | 8783 | |
@@ -8516,7 +8805,9 @@ discard block |
||
| 8516 | 8805 | if (count($row) > 0) { |
| 8517 | 8806 | //return $row['Registration']; |
| 8518 | 8807 | return $row['registration']; |
| 8519 | - } else return ''; |
|
| 8808 | + } else { |
|
| 8809 | + return ''; |
|
| 8810 | + } |
|
| 8520 | 8811 | |
| 8521 | 8812 | } |
| 8522 | 8813 | |
@@ -8538,9 +8829,14 @@ discard block |
||
| 8538 | 8829 | |
| 8539 | 8830 | $row = $sth->fetch(PDO::FETCH_ASSOC); |
| 8540 | 8831 | if (count($row) > 0) { |
| 8541 | - if ($row['type_flight'] == null) return ''; |
|
| 8542 | - else return $row['type_flight']; |
|
| 8543 | - } else return ''; |
|
| 8832 | + if ($row['type_flight'] == null) { |
|
| 8833 | + return ''; |
|
| 8834 | + } else { |
|
| 8835 | + return $row['type_flight']; |
|
| 8836 | + } |
|
| 8837 | + } else { |
|
| 8838 | + return ''; |
|
| 8839 | + } |
|
| 8544 | 8840 | |
| 8545 | 8841 | } |
| 8546 | 8842 | |
@@ -8574,9 +8870,13 @@ discard block |
||
| 8574 | 8870 | $row = $sth->fetch(PDO::FETCH_ASSOC); |
| 8575 | 8871 | if (count($row) > 0) { |
| 8576 | 8872 | return $row; |
| 8577 | - } else return ''; |
|
| 8873 | + } else { |
|
| 8874 | + return ''; |
|
| 8875 | + } |
|
| 8578 | 8876 | } catch (PDOException $e) { |
| 8579 | - if (isset($globalDebug) && $globalDebug) echo 'Error : '.$e->getMessage()."\n"; |
|
| 8877 | + if (isset($globalDebug) && $globalDebug) { |
|
| 8878 | + echo 'Error : '.$e->getMessage()."\n"; |
|
| 8879 | + } |
|
| 8580 | 8880 | return ''; |
| 8581 | 8881 | } |
| 8582 | 8882 | |
@@ -8724,7 +9024,9 @@ discard block |
||
| 8724 | 9024 | { |
| 8725 | 9025 | global $globalBitlyAccessToken; |
| 8726 | 9026 | |
| 8727 | - if ($globalBitlyAccessToken == '') return $url; |
|
| 9027 | + if ($globalBitlyAccessToken == '') { |
|
| 9028 | + return $url; |
|
| 9029 | + } |
|
| 8728 | 9030 | |
| 8729 | 9031 | $google_url = 'https://api-ssl.bitly.com/v3/shorten?access_token='.$globalBitlyAccessToken.'&longUrl='.$url; |
| 8730 | 9032 | |
@@ -8873,7 +9175,9 @@ discard block |
||
| 8873 | 9175 | |
| 8874 | 9176 | |
| 8875 | 9177 | // routes |
| 8876 | - if ($globalDebug) print "Routes...\n"; |
|
| 9178 | + if ($globalDebug) { |
|
| 9179 | + print "Routes...\n"; |
|
| 9180 | + } |
|
| 8877 | 9181 | if ($globalDBdriver == 'mysql') { |
| 8878 | 9182 | $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)"; |
| 8879 | 9183 | } else { |
@@ -8892,7 +9196,9 @@ discard block |
||
| 8892 | 9196 | } |
| 8893 | 9197 | } |
| 8894 | 9198 | |
| 8895 | - if ($globalDebug) print "Airlines...\n"; |
|
| 9199 | + if ($globalDebug) { |
|
| 9200 | + print "Airlines...\n"; |
|
| 9201 | + } |
|
| 8896 | 9202 | //airlines |
| 8897 | 9203 | if ($globalDBdriver == 'mysql') { |
| 8898 | 9204 | $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)"; |
@@ -8914,13 +9220,17 @@ discard block |
||
| 8914 | 9220 | } |
| 8915 | 9221 | } |
| 8916 | 9222 | |
| 8917 | - if ($globalDebug) print "Remove Duplicate in aircraft_modes...\n"; |
|
| 9223 | + if ($globalDebug) { |
|
| 9224 | + print "Remove Duplicate in aircraft_modes...\n"; |
|
| 9225 | + } |
|
| 8918 | 9226 | //duplicate modes |
| 8919 | 9227 | $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"; |
| 8920 | 9228 | $sth = $this->db->prepare($query); |
| 8921 | 9229 | $sth->execute(); |
| 8922 | 9230 | |
| 8923 | - if ($globalDebug) print "Aircraft...\n"; |
|
| 9231 | + if ($globalDebug) { |
|
| 9232 | + print "Aircraft...\n"; |
|
| 9233 | + } |
|
| 8924 | 9234 | //aircraft |
| 8925 | 9235 | if ($globalDBdriver == 'mysql') { |
| 8926 | 9236 | $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)"; |
@@ -8963,26 +9273,38 @@ discard block |
||
| 8963 | 9273 | if (isset($closestAirports[0])) { |
| 8964 | 9274 | if ($row['arrival_airport_icao'] == $closestAirports[0]['icao']) { |
| 8965 | 9275 | $airport_icao = $closestAirports[0]['icao']; |
| 8966 | - if ($globalDebug) echo "\o/ 1st ---++ Find arrival airport. airport_icao : ".$airport_icao."\n"; |
|
| 9276 | + if ($globalDebug) { |
|
| 9277 | + echo "\o/ 1st ---++ Find arrival airport. airport_icao : ".$airport_icao."\n"; |
|
| 9278 | + } |
|
| 8967 | 9279 | } elseif (count($closestAirports > 1) && $row['arrival_airport_icao'] != '' && $row['arrival_airport_icao'] != 'NA') { |
| 8968 | 9280 | foreach ($closestAirports as $airport) { |
| 8969 | 9281 | if ($row['arrival_airport_icao'] == $airport['icao']) { |
| 8970 | 9282 | $airport_icao = $airport['icao']; |
| 8971 | - if ($globalDebug) echo "\o/ try --++ Find arrival airport. airport_icao : ".$airport_icao."\n"; |
|
| 9283 | + if ($globalDebug) { |
|
| 9284 | + echo "\o/ try --++ Find arrival airport. airport_icao : ".$airport_icao."\n"; |
|
| 9285 | + } |
|
| 8972 | 9286 | break; |
| 8973 | 9287 | } |
| 8974 | 9288 | } |
| 8975 | 9289 | } elseif ($row['last_altitude'] == 0 || ($row['last_altitude'] != '' && ($closestAirports[0]['altitude'] <= $row['last_altitude']*100+1000 && $row['last_altitude']*100 < $closestAirports[0]['altitude']+5000))) { |
| 8976 | 9290 | $airport_icao = $closestAirports[0]['icao']; |
| 8977 | - 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"; |
|
| 9291 | + if ($globalDebug) { |
|
| 9292 | + 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"; |
|
| 9293 | + } |
|
| 8978 | 9294 | } else { |
| 8979 | - 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"; |
|
| 9295 | + if ($globalDebug) { |
|
| 9296 | + 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"; |
|
| 9297 | + } |
|
| 8980 | 9298 | } |
| 8981 | 9299 | } else { |
| 8982 | - if ($globalDebug) echo "----- No Airport near last coord. Latitude : ".$row['last_latitude'].' - Longitude : '.$row['last_longitude'].' - MinDist : '.$globalClosestMinDist."\n"; |
|
| 9300 | + if ($globalDebug) { |
|
| 9301 | + echo "----- No Airport near last coord. Latitude : ".$row['last_latitude'].' - Longitude : '.$row['last_longitude'].' - MinDist : '.$globalClosestMinDist."\n"; |
|
| 9302 | + } |
|
| 8983 | 9303 | } |
| 8984 | 9304 | if ($row['real_arrival_airport_icao'] != $airport_icao) { |
| 8985 | - if ($globalDebug) echo "Updating airport to ".$airport_icao."...\n"; |
|
| 9305 | + if ($globalDebug) { |
|
| 9306 | + echo "Updating airport to ".$airport_icao."...\n"; |
|
| 9307 | + } |
|
| 8986 | 9308 | $update_query="UPDATE spotter_output SET real_arrival_airport_icao = :airport_icao WHERE spotter_id = :spotter_id"; |
| 8987 | 9309 | $sthu = $this->db->prepare($update_query); |
| 8988 | 9310 | $sthu->execute(array(':airport_icao' => $airport_icao,':spotter_id' => $row['spotter_id'])); |