@@ -23,10 +23,10 @@ discard block |
||
23 | 23 | } |
24 | 24 | |
25 | 25 | /** |
26 | - * Get Latest ACARS data from DB |
|
27 | - * |
|
28 | - * @return Array Return ACARS data in array |
|
29 | - */ |
|
26 | + * Get Latest ACARS data from DB |
|
27 | + * |
|
28 | + * @return Array Return ACARS data in array |
|
29 | + */ |
|
30 | 30 | public function getLatestAccidentData($limit = '',$type = '') { |
31 | 31 | global $globalURL, $globalDBdriver; |
32 | 32 | $Image = new Image($this->db); |
@@ -37,36 +37,36 @@ discard block |
||
37 | 37 | $limit_query = ''; |
38 | 38 | if ($limit != "") |
39 | 39 | { |
40 | - $limit_array = explode(",", $limit); |
|
40 | + $limit_array = explode(",", $limit); |
|
41 | 41 | |
42 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
43 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
42 | + $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
43 | + $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
44 | 44 | |
45 | - if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
|
46 | - { |
|
45 | + if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
|
46 | + { |
|
47 | 47 | $limit_query = " LIMIT ".$limit_array[1]." OFFSET ".$limit_array[0]; |
48 | - } |
|
48 | + } |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | if ($type != '') { |
52 | - $query = "SELECT * FROM accidents WHERE accidents_id IN (SELECT max(accidents_id) FROM accidents WHERE type = :type GROUP BY registration) ORDER BY date DESC".$limit_query; |
|
53 | - $query_values = array(':type' => $type); |
|
52 | + $query = "SELECT * FROM accidents WHERE accidents_id IN (SELECT max(accidents_id) FROM accidents WHERE type = :type GROUP BY registration) ORDER BY date DESC".$limit_query; |
|
53 | + $query_values = array(':type' => $type); |
|
54 | 54 | } else { |
55 | - //$query = "SELECT * FROM accidents GROUP BY registration ORDER BY date DESC".$limit_query; |
|
56 | - $query = "SELECT * FROM accidents WHERE accidents_id IN (SELECT max(accidents_id) FROM accidents GROUP BY registration) ORDER BY date DESC".$limit_query; |
|
57 | - $query_values = array(); |
|
55 | + //$query = "SELECT * FROM accidents GROUP BY registration ORDER BY date DESC".$limit_query; |
|
56 | + $query = "SELECT * FROM accidents WHERE accidents_id IN (SELECT max(accidents_id) FROM accidents GROUP BY registration) ORDER BY date DESC".$limit_query; |
|
57 | + $query_values = array(); |
|
58 | 58 | } |
59 | 59 | try { |
60 | 60 | |
61 | - $sth = $this->db->prepare($query); |
|
62 | - $sth->execute($query_values); |
|
61 | + $sth = $this->db->prepare($query); |
|
62 | + $sth->execute($query_values); |
|
63 | 63 | } catch(PDOException $e) { |
64 | - return "error : ".$e->getMessage(); |
|
64 | + return "error : ".$e->getMessage(); |
|
65 | 65 | } |
66 | 66 | $i = 0; |
67 | 67 | while ($row = $sth->fetch(PDO::FETCH_ASSOC)) { |
68 | - $data = array(); |
|
69 | - if ($row['registration'] != '') { |
|
68 | + $data = array(); |
|
69 | + if ($row['registration'] != '') { |
|
70 | 70 | // $row['registration'] = str_replace('.','',$row['registration']); |
71 | 71 | $image_array = $Image->getSpotterImage($row['registration']); |
72 | 72 | if (count($image_array) > 0) $data = array_merge($data,array('image' => $image_array[0]['image'],'image_thumbnail' => $image_array[0]['image_thumbnail'],'image_copyright' => $image_array[0]['image_copyright'],'image_source' => $image_array[0]['image_source'],'image_source_website' => $image_array[0]['image_source_website'])); |
@@ -89,33 +89,33 @@ discard block |
||
89 | 89 | $data['aircraft_base'] = $owner_data['base']; |
90 | 90 | $data['aircraft_date_first_reg'] = $owner_data['date_first_reg']; |
91 | 91 | } |
92 | - } else $data = array_merge($data,array('image' => '','image_thumbnail' => '','image_copyright' => '','image_source' => '','image_source_website' => '')); |
|
93 | - if ($row['registration'] == '') $row['registration'] = 'NA'; |
|
94 | - if ($row['ident'] == '') $row['ident'] = 'NA'; |
|
95 | - $identicao = $Spotter->getAllAirlineInfo(substr($row['ident'],0,2)); |
|
96 | - if (isset($identicao[0])) { |
|
92 | + } else $data = array_merge($data,array('image' => '','image_thumbnail' => '','image_copyright' => '','image_source' => '','image_source_website' => '')); |
|
93 | + if ($row['registration'] == '') $row['registration'] = 'NA'; |
|
94 | + if ($row['ident'] == '') $row['ident'] = 'NA'; |
|
95 | + $identicao = $Spotter->getAllAirlineInfo(substr($row['ident'],0,2)); |
|
96 | + if (isset($identicao[0])) { |
|
97 | 97 | if (substr($row['ident'],0,2) == 'AF') { |
98 | - if (filter_var(substr($row['ident'],2),FILTER_VALIDATE_INT,array("flags"=>FILTER_FLAG_ALLOW_OCTAL))) $icao = $row['ident']; |
|
99 | - else $icao = 'AFR'.ltrim(substr($row['ident'],2),'0'); |
|
98 | + if (filter_var(substr($row['ident'],2),FILTER_VALIDATE_INT,array("flags"=>FILTER_FLAG_ALLOW_OCTAL))) $icao = $row['ident']; |
|
99 | + else $icao = 'AFR'.ltrim(substr($row['ident'],2),'0'); |
|
100 | 100 | } else $icao = $identicao[0]['icao'].ltrim(substr($row['ident'],2),'0'); |
101 | 101 | |
102 | 102 | $data = array_merge($data,array('airline_icao' => $identicao[0]['icao'],'airline_name' => $identicao[0]['name'])); |
103 | - } else $icao = $row['ident']; |
|
104 | - $icao = $Translation->checkTranslation($icao,false); |
|
105 | - //$data = array_merge($data,array('registration' => $row['registration'], 'date' => $row['date'], 'ident' => $icao,'url' => $row['url'])); |
|
106 | - $data = array_merge($row,$data); |
|
107 | - if ($data['ident'] == null) $data['ident'] = $icao; |
|
108 | - if ($data['title'] == null) { |
|
103 | + } else $icao = $row['ident']; |
|
104 | + $icao = $Translation->checkTranslation($icao,false); |
|
105 | + //$data = array_merge($data,array('registration' => $row['registration'], 'date' => $row['date'], 'ident' => $icao,'url' => $row['url'])); |
|
106 | + $data = array_merge($row,$data); |
|
107 | + if ($data['ident'] == null) $data['ident'] = $icao; |
|
108 | + if ($data['title'] == null) { |
|
109 | 109 | $data['message'] = $row['type'].' of '.$row['registration'].' at '.$row['place'].','.$row['country']; |
110 | - } else $data['message'] = strtolower($data['title']); |
|
111 | - $result[] = $data; |
|
112 | - $i++; |
|
110 | + } else $data['message'] = strtolower($data['title']); |
|
111 | + $result[] = $data; |
|
112 | + $i++; |
|
113 | 113 | } |
114 | 114 | if (isset($result)) { |
115 | - $result[0]['query_number_rows'] = $i; |
|
116 | - return $result; |
|
115 | + $result[0]['query_number_rows'] = $i; |
|
116 | + return $result; |
|
117 | 117 | } |
118 | 118 | else return array(); |
119 | - } |
|
119 | + } |
|
120 | 120 | } |
121 | 121 | ?> |
122 | 122 | \ No newline at end of file |
@@ -13,10 +13,10 @@ discard block |
||
13 | 13 | } |
14 | 14 | |
15 | 15 | /** |
16 | - * Get SQL query part for filter used |
|
17 | - * @param Array $filter the filter |
|
18 | - * @return Array the SQL part |
|
19 | - */ |
|
16 | + * Get SQL query part for filter used |
|
17 | + * @param Array $filter the filter |
|
18 | + * @return Array the SQL part |
|
19 | + */ |
|
20 | 20 | public function getFilter($filter = array(),$where = false,$and = false) { |
21 | 21 | global $globalFilter, $globalStatsFilters, $globalFilterName; |
22 | 22 | $filters = array(); |
@@ -84,14 +84,14 @@ discard block |
||
84 | 84 | } |
85 | 85 | |
86 | 86 | /** |
87 | - * Executes the SQL statements to get the spotter information |
|
88 | - * |
|
89 | - * @param String $query the SQL query |
|
90 | - * @param Array $params parameter of the query |
|
91 | - * @param String $limitQuery the limit query |
|
92 | - * @return Array the spotter information |
|
93 | - * |
|
94 | - */ |
|
87 | + * Executes the SQL statements to get the spotter information |
|
88 | + * |
|
89 | + * @param String $query the SQL query |
|
90 | + * @param Array $params parameter of the query |
|
91 | + * @param String $limitQuery the limit query |
|
92 | + * @return Array the spotter information |
|
93 | + * |
|
94 | + */ |
|
95 | 95 | public function getDataFromDB($query, $params = array(), $limitQuery = '',$schedules = false) |
96 | 96 | { |
97 | 97 | global $globalSquawkCountry, $globalIVAO, $globalVATSIM, $globalphpVMS, $globalAirlinesSource, $globalVAM; |
@@ -255,11 +255,11 @@ discard block |
||
255 | 255 | if ($aircraft_array[0]['aircraft_shadow'] != NULL) { |
256 | 256 | $temp_array['aircraft_shadow'] = $aircraft_array[0]['aircraft_shadow']; |
257 | 257 | } else $temp_array['aircraft_shadow'] = 'default.png'; |
258 | - } else { |
|
259 | - $temp_array['aircraft_shadow'] = 'default.png'; |
|
258 | + } else { |
|
259 | + $temp_array['aircraft_shadow'] = 'default.png'; |
|
260 | 260 | $temp_array['aircraft_name'] = 'N/A'; |
261 | 261 | $temp_array['aircraft_manufacturer'] = 'N/A'; |
262 | - } |
|
262 | + } |
|
263 | 263 | } |
264 | 264 | $fromsource = NULL; |
265 | 265 | if (isset($globalAirlinesSource) && $globalAirlinesSource != '') $fromsource = $globalAirlinesSource; |
@@ -455,11 +455,11 @@ discard block |
||
455 | 455 | |
456 | 456 | |
457 | 457 | /** |
458 | - * Gets all the spotter information |
|
459 | - * |
|
460 | - * @return Array the spotter information |
|
461 | - * |
|
462 | - */ |
|
458 | + * Gets all the spotter information |
|
459 | + * |
|
460 | + * @return Array the spotter information |
|
461 | + * |
|
462 | + */ |
|
463 | 463 | public function searchSpotterData($q = '', $registration = '', $aircraft_icao = '', $aircraft_manufacturer = '', $highlights = '', $airline_icao = '', $airline_country = '', $airline_type = '', $airport = '', $airport_country = '', $callsign = '', $departure_airport_route = '', $arrival_airport_route = '', $owner = '',$pilot_id = '',$pilot_name = '',$altitude = '', $date_posted = '', $limit = '', $sort = '', $includegeodata = '',$origLat = '',$origLon = '',$dist = '',$filters = array()) |
464 | 464 | { |
465 | 465 | global $globalTimezone, $globalDBdriver; |
@@ -806,11 +806,11 @@ discard block |
||
806 | 806 | |
807 | 807 | |
808 | 808 | /** |
809 | - * Gets all the spotter information based on the latest data entry |
|
810 | - * |
|
811 | - * @return Array the spotter information |
|
812 | - * |
|
813 | - */ |
|
809 | + * Gets all the spotter information based on the latest data entry |
|
810 | + * |
|
811 | + * @return Array the spotter information |
|
812 | + * |
|
813 | + */ |
|
814 | 814 | public function getLatestSpotterData($limit = '', $sort = '', $filter = array()) |
815 | 815 | { |
816 | 816 | global $global_query; |
@@ -849,12 +849,12 @@ discard block |
||
849 | 849 | } |
850 | 850 | |
851 | 851 | |
852 | - /** |
|
853 | - * Gets all the spotter information based on a user's latitude and longitude |
|
854 | - * |
|
855 | - * @return Array the spotter information |
|
856 | - * |
|
857 | - */ |
|
852 | + /** |
|
853 | + * Gets all the spotter information based on a user's latitude and longitude |
|
854 | + * |
|
855 | + * @return Array the spotter information |
|
856 | + * |
|
857 | + */ |
|
858 | 858 | public function getLatestSpotterForLayar($lat, $lng, $radius, $interval) |
859 | 859 | { |
860 | 860 | date_default_timezone_set('UTC'); |
@@ -882,7 +882,7 @@ discard block |
||
882 | 882 | return false; |
883 | 883 | } |
884 | 884 | } |
885 | - $additional_query = ''; |
|
885 | + $additional_query = ''; |
|
886 | 886 | if ($interval != "") |
887 | 887 | { |
888 | 888 | if (!is_string($interval)) |
@@ -922,12 +922,12 @@ discard block |
||
922 | 922 | } |
923 | 923 | |
924 | 924 | |
925 | - /** |
|
926 | - * Gets all the spotter information sorted by the newest aircraft type |
|
927 | - * |
|
928 | - * @return Array the spotter information |
|
929 | - * |
|
930 | - */ |
|
925 | + /** |
|
926 | + * Gets all the spotter information sorted by the newest aircraft type |
|
927 | + * |
|
928 | + * @return Array the spotter information |
|
929 | + * |
|
930 | + */ |
|
931 | 931 | public function getNewestSpotterDataSortedByAircraftType($limit = '', $sort = '',$filter = array()) |
932 | 932 | { |
933 | 933 | global $global_query; |
@@ -968,11 +968,11 @@ discard block |
||
968 | 968 | |
969 | 969 | |
970 | 970 | /** |
971 | - * Gets all the spotter information sorted by the newest aircraft registration |
|
972 | - * |
|
973 | - * @return Array the spotter information |
|
974 | - * |
|
975 | - */ |
|
971 | + * Gets all the spotter information sorted by the newest aircraft registration |
|
972 | + * |
|
973 | + * @return Array the spotter information |
|
974 | + * |
|
975 | + */ |
|
976 | 976 | public function getNewestSpotterDataSortedByAircraftRegistration($limit = '', $sort = '', $filter = array()) |
977 | 977 | { |
978 | 978 | global $global_query; |
@@ -1012,11 +1012,11 @@ discard block |
||
1012 | 1012 | |
1013 | 1013 | |
1014 | 1014 | /** |
1015 | - * Gets all the spotter information sorted by the newest airline |
|
1016 | - * |
|
1017 | - * @return Array the spotter information |
|
1018 | - * |
|
1019 | - */ |
|
1015 | + * Gets all the spotter information sorted by the newest airline |
|
1016 | + * |
|
1017 | + * @return Array the spotter information |
|
1018 | + * |
|
1019 | + */ |
|
1020 | 1020 | public function getNewestSpotterDataSortedByAirline($limit = '', $sort = '',$filter = array()) |
1021 | 1021 | { |
1022 | 1022 | global $global_query; |
@@ -1055,12 +1055,12 @@ discard block |
||
1055 | 1055 | } |
1056 | 1056 | |
1057 | 1057 | |
1058 | - /** |
|
1059 | - * Gets all the spotter information sorted by the newest departure airport |
|
1060 | - * |
|
1061 | - * @return Array the spotter information |
|
1062 | - * |
|
1063 | - */ |
|
1058 | + /** |
|
1059 | + * Gets all the spotter information sorted by the newest departure airport |
|
1060 | + * |
|
1061 | + * @return Array the spotter information |
|
1062 | + * |
|
1063 | + */ |
|
1064 | 1064 | public function getNewestSpotterDataSortedByDepartureAirport($limit = '', $sort = '', $filter = array()) |
1065 | 1065 | { |
1066 | 1066 | global $global_query; |
@@ -1102,11 +1102,11 @@ discard block |
||
1102 | 1102 | |
1103 | 1103 | |
1104 | 1104 | /** |
1105 | - * Gets all the spotter information sorted by the newest arrival airport |
|
1106 | - * |
|
1107 | - * @return Array the spotter information |
|
1108 | - * |
|
1109 | - */ |
|
1105 | + * Gets all the spotter information sorted by the newest arrival airport |
|
1106 | + * |
|
1107 | + * @return Array the spotter information |
|
1108 | + * |
|
1109 | + */ |
|
1110 | 1110 | public function getNewestSpotterDataSortedByArrivalAirport($limit = '', $sort = '', $filter = array()) |
1111 | 1111 | { |
1112 | 1112 | global $global_query; |
@@ -1145,11 +1145,11 @@ discard block |
||
1145 | 1145 | |
1146 | 1146 | |
1147 | 1147 | /** |
1148 | - * Gets all the spotter information based on the spotter id |
|
1149 | - * |
|
1150 | - * @return Array the spotter information |
|
1151 | - * |
|
1152 | - */ |
|
1148 | + * Gets all the spotter information based on the spotter id |
|
1149 | + * |
|
1150 | + * @return Array the spotter information |
|
1151 | + * |
|
1152 | + */ |
|
1153 | 1153 | public function getSpotterDataByID($id = '') |
1154 | 1154 | { |
1155 | 1155 | global $global_query; |
@@ -1171,11 +1171,11 @@ discard block |
||
1171 | 1171 | |
1172 | 1172 | |
1173 | 1173 | /** |
1174 | - * Gets all the spotter information based on the callsign |
|
1175 | - * |
|
1176 | - * @return Array the spotter information |
|
1177 | - * |
|
1178 | - */ |
|
1174 | + * Gets all the spotter information based on the callsign |
|
1175 | + * |
|
1176 | + * @return Array the spotter information |
|
1177 | + * |
|
1178 | + */ |
|
1179 | 1179 | public function getSpotterDataByIdent($ident = '', $limit = '', $sort = '') |
1180 | 1180 | { |
1181 | 1181 | global $global_query; |
@@ -1228,11 +1228,11 @@ discard block |
||
1228 | 1228 | |
1229 | 1229 | |
1230 | 1230 | /** |
1231 | - * Gets all the spotter information based on the aircraft type |
|
1232 | - * |
|
1233 | - * @return Array the spotter information |
|
1234 | - * |
|
1235 | - */ |
|
1231 | + * Gets all the spotter information based on the aircraft type |
|
1232 | + * |
|
1233 | + * @return Array the spotter information |
|
1234 | + * |
|
1235 | + */ |
|
1236 | 1236 | public function getSpotterDataByAircraft($aircraft_type = '', $limit = '', $sort = '', $filter = array()) |
1237 | 1237 | { |
1238 | 1238 | global $global_query; |
@@ -1286,11 +1286,11 @@ discard block |
||
1286 | 1286 | |
1287 | 1287 | |
1288 | 1288 | /** |
1289 | - * Gets all the spotter information based on the aircraft registration |
|
1290 | - * |
|
1291 | - * @return Array the spotter information |
|
1292 | - * |
|
1293 | - */ |
|
1289 | + * Gets all the spotter information based on the aircraft registration |
|
1290 | + * |
|
1291 | + * @return Array the spotter information |
|
1292 | + * |
|
1293 | + */ |
|
1294 | 1294 | public function getSpotterDataByRegistration($registration = '', $limit = '', $sort = '', $filter = array()) |
1295 | 1295 | { |
1296 | 1296 | global $global_query; |
@@ -1347,11 +1347,11 @@ discard block |
||
1347 | 1347 | |
1348 | 1348 | |
1349 | 1349 | /** |
1350 | - * Gets all the spotter information based on the airline |
|
1351 | - * |
|
1352 | - * @return Array the spotter information |
|
1353 | - * |
|
1354 | - */ |
|
1350 | + * Gets all the spotter information based on the airline |
|
1351 | + * |
|
1352 | + * @return Array the spotter information |
|
1353 | + * |
|
1354 | + */ |
|
1355 | 1355 | public function getSpotterDataByAirline($airline = '', $limit = '', $sort = '',$filters = array()) |
1356 | 1356 | { |
1357 | 1357 | global $global_query; |
@@ -1404,11 +1404,11 @@ discard block |
||
1404 | 1404 | |
1405 | 1405 | |
1406 | 1406 | /** |
1407 | - * Gets all the spotter information based on the airport |
|
1408 | - * |
|
1409 | - * @return Array the spotter information |
|
1410 | - * |
|
1411 | - */ |
|
1407 | + * Gets all the spotter information based on the airport |
|
1408 | + * |
|
1409 | + * @return Array the spotter information |
|
1410 | + * |
|
1411 | + */ |
|
1412 | 1412 | public function getSpotterDataByAirport($airport = '', $limit = '', $sort = '',$filters = array()) |
1413 | 1413 | { |
1414 | 1414 | global $global_query; |
@@ -1462,11 +1462,11 @@ discard block |
||
1462 | 1462 | |
1463 | 1463 | |
1464 | 1464 | /** |
1465 | - * Gets all the spotter information based on the date |
|
1466 | - * |
|
1467 | - * @return Array the spotter information |
|
1468 | - * |
|
1469 | - */ |
|
1465 | + * Gets all the spotter information based on the date |
|
1466 | + * |
|
1467 | + * @return Array the spotter information |
|
1468 | + * |
|
1469 | + */ |
|
1470 | 1470 | public function getSpotterDataByDate($date = '', $limit = '', $sort = '',$filter = array()) |
1471 | 1471 | { |
1472 | 1472 | global $global_query, $globalTimezone, $globalDBdriver; |
@@ -1527,11 +1527,11 @@ discard block |
||
1527 | 1527 | |
1528 | 1528 | |
1529 | 1529 | /** |
1530 | - * Gets all the spotter information based on the country name |
|
1531 | - * |
|
1532 | - * @return Array the spotter information |
|
1533 | - * |
|
1534 | - */ |
|
1530 | + * Gets all the spotter information based on the country name |
|
1531 | + * |
|
1532 | + * @return Array the spotter information |
|
1533 | + * |
|
1534 | + */ |
|
1535 | 1535 | public function getSpotterDataByCountry($country = '', $limit = '', $sort = '',$filters = array()) |
1536 | 1536 | { |
1537 | 1537 | global $global_query; |
@@ -1585,11 +1585,11 @@ discard block |
||
1585 | 1585 | |
1586 | 1586 | |
1587 | 1587 | /** |
1588 | - * Gets all the spotter information based on the manufacturer name |
|
1589 | - * |
|
1590 | - * @return Array the spotter information |
|
1591 | - * |
|
1592 | - */ |
|
1588 | + * Gets all the spotter information based on the manufacturer name |
|
1589 | + * |
|
1590 | + * @return Array the spotter information |
|
1591 | + * |
|
1592 | + */ |
|
1593 | 1593 | public function getSpotterDataByManufacturer($aircraft_manufacturer = '', $limit = '', $sort = '', $filters = array()) |
1594 | 1594 | { |
1595 | 1595 | global $global_query; |
@@ -1645,13 +1645,13 @@ discard block |
||
1645 | 1645 | |
1646 | 1646 | |
1647 | 1647 | /** |
1648 | - * Gets a list of all aircraft that take a route |
|
1649 | - * |
|
1650 | - * @param String $departure_airport_icao ICAO code of departure airport |
|
1651 | - * @param String $arrival_airport_icao ICAO code of arrival airport |
|
1652 | - * @return Array the spotter information |
|
1653 | - * |
|
1654 | - */ |
|
1648 | + * Gets a list of all aircraft that take a route |
|
1649 | + * |
|
1650 | + * @param String $departure_airport_icao ICAO code of departure airport |
|
1651 | + * @param String $arrival_airport_icao ICAO code of arrival airport |
|
1652 | + * @return Array the spotter information |
|
1653 | + * |
|
1654 | + */ |
|
1655 | 1655 | public function getSpotterDataByRoute($departure_airport_icao = '', $arrival_airport_icao = '', $limit = '', $sort = '', $filters = array()) |
1656 | 1656 | { |
1657 | 1657 | global $global_query; |
@@ -1720,11 +1720,11 @@ discard block |
||
1720 | 1720 | |
1721 | 1721 | |
1722 | 1722 | /** |
1723 | - * Gets all the spotter information based on the special column in the table |
|
1724 | - * |
|
1725 | - * @return Array the spotter information |
|
1726 | - * |
|
1727 | - */ |
|
1723 | + * Gets all the spotter information based on the special column in the table |
|
1724 | + * |
|
1725 | + * @return Array the spotter information |
|
1726 | + * |
|
1727 | + */ |
|
1728 | 1728 | public function getSpotterDataByHighlight($limit = '', $sort = '', $filter = array()) |
1729 | 1729 | { |
1730 | 1730 | global $global_query; |
@@ -1763,11 +1763,11 @@ discard block |
||
1763 | 1763 | } |
1764 | 1764 | |
1765 | 1765 | /** |
1766 | - * Gets all the highlight based on a aircraft registration |
|
1767 | - * |
|
1768 | - * @return String the highlight text |
|
1769 | - * |
|
1770 | - */ |
|
1766 | + * Gets all the highlight based on a aircraft registration |
|
1767 | + * |
|
1768 | + * @return String the highlight text |
|
1769 | + * |
|
1770 | + */ |
|
1771 | 1771 | public function getHighlightByRegistration($registration,$filter = array()) |
1772 | 1772 | { |
1773 | 1773 | global $global_query; |
@@ -1789,13 +1789,13 @@ discard block |
||
1789 | 1789 | |
1790 | 1790 | |
1791 | 1791 | /** |
1792 | - * Gets the squawk usage from squawk code |
|
1793 | - * |
|
1794 | - * @param String $squawk squawk code |
|
1795 | - * @param String $country country |
|
1796 | - * @return String usage |
|
1797 | - * |
|
1798 | - */ |
|
1792 | + * Gets the squawk usage from squawk code |
|
1793 | + * |
|
1794 | + * @param String $squawk squawk code |
|
1795 | + * @param String $country country |
|
1796 | + * @return String usage |
|
1797 | + * |
|
1798 | + */ |
|
1799 | 1799 | public function getSquawkUsage($squawk = '',$country = 'FR') |
1800 | 1800 | { |
1801 | 1801 | |
@@ -1816,12 +1816,12 @@ discard block |
||
1816 | 1816 | } |
1817 | 1817 | |
1818 | 1818 | /** |
1819 | - * Gets the airport icao from the iata |
|
1820 | - * |
|
1821 | - * @param String $airport_iata the iata code of the airport |
|
1822 | - * @return String airport iata |
|
1823 | - * |
|
1824 | - */ |
|
1819 | + * Gets the airport icao from the iata |
|
1820 | + * |
|
1821 | + * @param String $airport_iata the iata code of the airport |
|
1822 | + * @return String airport iata |
|
1823 | + * |
|
1824 | + */ |
|
1825 | 1825 | public function getAirportIcao($airport_iata = '') |
1826 | 1826 | { |
1827 | 1827 | |
@@ -1841,14 +1841,14 @@ discard block |
||
1841 | 1841 | } |
1842 | 1842 | |
1843 | 1843 | /** |
1844 | - * Gets the airport distance |
|
1845 | - * |
|
1846 | - * @param String $airport_icao the icao code of the airport |
|
1847 | - * @param Float $latitude the latitude |
|
1848 | - * @param Float $longitude the longitude |
|
1849 | - * @return Float distance to the airport |
|
1850 | - * |
|
1851 | - */ |
|
1844 | + * Gets the airport distance |
|
1845 | + * |
|
1846 | + * @param String $airport_icao the icao code of the airport |
|
1847 | + * @param Float $latitude the latitude |
|
1848 | + * @param Float $longitude the longitude |
|
1849 | + * @return Float distance to the airport |
|
1850 | + * |
|
1851 | + */ |
|
1852 | 1852 | public function getAirportDistance($airport_icao,$latitude,$longitude) |
1853 | 1853 | { |
1854 | 1854 | |
@@ -1869,12 +1869,12 @@ discard block |
||
1869 | 1869 | } |
1870 | 1870 | |
1871 | 1871 | /** |
1872 | - * Gets the airport info based on the icao |
|
1873 | - * |
|
1874 | - * @param String $airport the icao code of the airport |
|
1875 | - * @return Array airport information |
|
1876 | - * |
|
1877 | - */ |
|
1872 | + * Gets the airport info based on the icao |
|
1873 | + * |
|
1874 | + * @param String $airport the icao code of the airport |
|
1875 | + * @return Array airport information |
|
1876 | + * |
|
1877 | + */ |
|
1878 | 1878 | public function getAllAirportInfo($airport = '') |
1879 | 1879 | { |
1880 | 1880 | |
@@ -1920,12 +1920,12 @@ discard block |
||
1920 | 1920 | } |
1921 | 1921 | |
1922 | 1922 | /** |
1923 | - * Gets the airport info based on the country |
|
1924 | - * |
|
1925 | - * @param Array $countries Airports countries |
|
1926 | - * @return Array airport information |
|
1927 | - * |
|
1928 | - */ |
|
1923 | + * Gets the airport info based on the country |
|
1924 | + * |
|
1925 | + * @param Array $countries Airports countries |
|
1926 | + * @return Array airport information |
|
1927 | + * |
|
1928 | + */ |
|
1929 | 1929 | public function getAllAirportInfobyCountry($countries) |
1930 | 1930 | { |
1931 | 1931 | $lst_countries = ''; |
@@ -1963,12 +1963,12 @@ discard block |
||
1963 | 1963 | } |
1964 | 1964 | |
1965 | 1965 | /** |
1966 | - * Gets airports info based on the coord |
|
1967 | - * |
|
1968 | - * @param Array $coord Airports longitude min,latitude min, longitude max, latitude max |
|
1969 | - * @return Array airport information |
|
1970 | - * |
|
1971 | - */ |
|
1966 | + * Gets airports info based on the coord |
|
1967 | + * |
|
1968 | + * @param Array $coord Airports longitude min,latitude min, longitude max, latitude max |
|
1969 | + * @return Array airport information |
|
1970 | + * |
|
1971 | + */ |
|
1972 | 1972 | public function getAllAirportInfobyCoord($coord) |
1973 | 1973 | { |
1974 | 1974 | global $globalDBdriver; |
@@ -1999,12 +1999,12 @@ discard block |
||
1999 | 1999 | } |
2000 | 2000 | |
2001 | 2001 | /** |
2002 | - * Gets waypoints info based on the coord |
|
2003 | - * |
|
2004 | - * @param Array $coord waypoints coord |
|
2005 | - * @return Array airport information |
|
2006 | - * |
|
2007 | - */ |
|
2002 | + * Gets waypoints info based on the coord |
|
2003 | + * |
|
2004 | + * @param Array $coord waypoints coord |
|
2005 | + * @return Array airport information |
|
2006 | + * |
|
2007 | + */ |
|
2008 | 2008 | public function getAllWaypointsInfobyCoord($coord) |
2009 | 2009 | { |
2010 | 2010 | if (is_array($coord)) { |
@@ -2038,12 +2038,12 @@ discard block |
||
2038 | 2038 | |
2039 | 2039 | |
2040 | 2040 | /** |
2041 | - * Gets the airline info based on the icao code or iata code |
|
2042 | - * |
|
2043 | - * @param String $airline_icao the iata code of the airport |
|
2044 | - * @return Array airport information |
|
2045 | - * |
|
2046 | - */ |
|
2041 | + * Gets the airline info based on the icao code or iata code |
|
2042 | + * |
|
2043 | + * @param String $airline_icao the iata code of the airport |
|
2044 | + * @return Array airport information |
|
2045 | + * |
|
2046 | + */ |
|
2047 | 2047 | public function getAllAirlineInfo($airline_icao, $fromsource = NULL) |
2048 | 2048 | { |
2049 | 2049 | global $globalUseRealAirlines; |
@@ -2074,7 +2074,7 @@ discard block |
||
2074 | 2074 | } else { |
2075 | 2075 | $sth->execute(array(':airline_icao' => $airline_icao,':fromsource' => $fromsource)); |
2076 | 2076 | } |
2077 | - /* |
|
2077 | + /* |
|
2078 | 2078 | $airline_array = array(); |
2079 | 2079 | $temp_array = array(); |
2080 | 2080 | |
@@ -2106,12 +2106,12 @@ discard block |
||
2106 | 2106 | |
2107 | 2107 | |
2108 | 2108 | /** |
2109 | - * Gets the aircraft info based on the aircraft type |
|
2110 | - * |
|
2111 | - * @param String $aircraft_type the aircraft type |
|
2112 | - * @return Array aircraft information |
|
2113 | - * |
|
2114 | - */ |
|
2109 | + * Gets the aircraft info based on the aircraft type |
|
2110 | + * |
|
2111 | + * @param String $aircraft_type the aircraft type |
|
2112 | + * @return Array aircraft information |
|
2113 | + * |
|
2114 | + */ |
|
2115 | 2115 | public function getAllAircraftInfo($aircraft_type) |
2116 | 2116 | { |
2117 | 2117 | $aircraft_type = filter_var($aircraft_type,FILTER_SANITIZE_STRING); |
@@ -2143,12 +2143,12 @@ discard block |
||
2143 | 2143 | } |
2144 | 2144 | |
2145 | 2145 | /** |
2146 | - * Gets the aircraft icao based on the aircraft name/type |
|
2147 | - * |
|
2148 | - * @param String $aircraft_type the aircraft type |
|
2149 | - * @return String aircraft information |
|
2150 | - * |
|
2151 | - */ |
|
2146 | + * Gets the aircraft icao based on the aircraft name/type |
|
2147 | + * |
|
2148 | + * @param String $aircraft_type the aircraft type |
|
2149 | + * @return String aircraft information |
|
2150 | + * |
|
2151 | + */ |
|
2152 | 2152 | public function getAircraftIcao($aircraft_type) |
2153 | 2153 | { |
2154 | 2154 | $aircraft_type = filter_var($aircraft_type,FILTER_SANITIZE_STRING); |
@@ -2173,12 +2173,12 @@ discard block |
||
2173 | 2173 | } |
2174 | 2174 | |
2175 | 2175 | /** |
2176 | - * Gets the aircraft info based on the aircraft modes |
|
2177 | - * |
|
2178 | - * @param String $aircraft_modes the aircraft ident (hex) |
|
2179 | - * @return String aircraft type |
|
2180 | - * |
|
2181 | - */ |
|
2176 | + * Gets the aircraft info based on the aircraft modes |
|
2177 | + * |
|
2178 | + * @param String $aircraft_modes the aircraft ident (hex) |
|
2179 | + * @return String aircraft type |
|
2180 | + * |
|
2181 | + */ |
|
2182 | 2182 | public function getAllAircraftType($aircraft_modes) |
2183 | 2183 | { |
2184 | 2184 | $aircraft_modes = filter_var($aircraft_modes,FILTER_SANITIZE_STRING); |
@@ -2196,12 +2196,12 @@ discard block |
||
2196 | 2196 | } |
2197 | 2197 | |
2198 | 2198 | /** |
2199 | - * Gets the aircraft info based on the aircraft registration |
|
2200 | - * |
|
2201 | - * @param String $aircraft_registration the aircraft registration |
|
2202 | - * @return String aircraft type |
|
2203 | - * |
|
2204 | - */ |
|
2199 | + * Gets the aircraft info based on the aircraft registration |
|
2200 | + * |
|
2201 | + * @param String $aircraft_registration the aircraft registration |
|
2202 | + * @return String aircraft type |
|
2203 | + * |
|
2204 | + */ |
|
2205 | 2205 | public function getAllAircraftTypeByRegistration($registration) |
2206 | 2206 | { |
2207 | 2207 | $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
@@ -2219,12 +2219,12 @@ discard block |
||
2219 | 2219 | } |
2220 | 2220 | |
2221 | 2221 | /** |
2222 | - * Gets correct aircraft operator corde |
|
2223 | - * |
|
2224 | - * @param String $operator the aircraft operator code (callsign) |
|
2225 | - * @return String aircraft operator code |
|
2226 | - * |
|
2227 | - */ |
|
2222 | + * Gets correct aircraft operator corde |
|
2223 | + * |
|
2224 | + * @param String $operator the aircraft operator code (callsign) |
|
2225 | + * @return String aircraft operator code |
|
2226 | + * |
|
2227 | + */ |
|
2228 | 2228 | public function getOperator($operator) |
2229 | 2229 | { |
2230 | 2230 | $operator = filter_var($operator,FILTER_SANITIZE_STRING); |
@@ -2241,16 +2241,16 @@ discard block |
||
2241 | 2241 | } |
2242 | 2242 | |
2243 | 2243 | /** |
2244 | - * Gets the aircraft route based on the aircraft callsign |
|
2245 | - * |
|
2246 | - * @param String $callsign the aircraft callsign |
|
2247 | - * @return Array aircraft type |
|
2248 | - * |
|
2249 | - */ |
|
2244 | + * Gets the aircraft route based on the aircraft callsign |
|
2245 | + * |
|
2246 | + * @param String $callsign the aircraft callsign |
|
2247 | + * @return Array aircraft type |
|
2248 | + * |
|
2249 | + */ |
|
2250 | 2250 | public function getRouteInfo($callsign) |
2251 | 2251 | { |
2252 | 2252 | $callsign = filter_var($callsign,FILTER_SANITIZE_STRING); |
2253 | - if ($callsign == '') return array(); |
|
2253 | + if ($callsign == '') return array(); |
|
2254 | 2254 | $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"; |
2255 | 2255 | |
2256 | 2256 | $sth = $this->db->prepare($query); |
@@ -2264,12 +2264,12 @@ discard block |
||
2264 | 2264 | } |
2265 | 2265 | |
2266 | 2266 | /** |
2267 | - * Gets the aircraft info based on the aircraft registration |
|
2268 | - * |
|
2269 | - * @param String $registration the aircraft registration |
|
2270 | - * @return Array aircraft information |
|
2271 | - * |
|
2272 | - */ |
|
2267 | + * Gets the aircraft info based on the aircraft registration |
|
2268 | + * |
|
2269 | + * @param String $registration the aircraft registration |
|
2270 | + * @return Array aircraft information |
|
2271 | + * |
|
2272 | + */ |
|
2273 | 2273 | public function getAircraftInfoByRegistration($registration) |
2274 | 2274 | { |
2275 | 2275 | $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
@@ -2296,12 +2296,12 @@ discard block |
||
2296 | 2296 | } |
2297 | 2297 | |
2298 | 2298 | /** |
2299 | - * Gets the aircraft owner & base based on the aircraft registration |
|
2300 | - * |
|
2301 | - * @param String $registration the aircraft registration |
|
2302 | - * @return Array aircraft information |
|
2303 | - * |
|
2304 | - */ |
|
2299 | + * Gets the aircraft owner & base based on the aircraft registration |
|
2300 | + * |
|
2301 | + * @param String $registration the aircraft registration |
|
2302 | + * @return Array aircraft information |
|
2303 | + * |
|
2304 | + */ |
|
2305 | 2305 | public function getAircraftOwnerByRegistration($registration) |
2306 | 2306 | { |
2307 | 2307 | $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
@@ -2318,11 +2318,11 @@ discard block |
||
2318 | 2318 | |
2319 | 2319 | |
2320 | 2320 | /** |
2321 | - * Gets all flights (but with only little info) |
|
2322 | - * |
|
2323 | - * @return Array basic flight information |
|
2324 | - * |
|
2325 | - */ |
|
2321 | + * Gets all flights (but with only little info) |
|
2322 | + * |
|
2323 | + * @return Array basic flight information |
|
2324 | + * |
|
2325 | + */ |
|
2326 | 2326 | public function getAllFlightsforSitemap() |
2327 | 2327 | { |
2328 | 2328 | //$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 "; |
@@ -2330,7 +2330,7 @@ discard block |
||
2330 | 2330 | |
2331 | 2331 | $sth = $this->db->prepare($query); |
2332 | 2332 | $sth->execute(); |
2333 | - /* |
|
2333 | + /* |
|
2334 | 2334 | $flight_array = array(); |
2335 | 2335 | $temp_array = array(); |
2336 | 2336 | |
@@ -2352,11 +2352,11 @@ discard block |
||
2352 | 2352 | } |
2353 | 2353 | |
2354 | 2354 | /** |
2355 | - * Gets a list of all aircraft manufacturers |
|
2356 | - * |
|
2357 | - * @return Array list of aircraft types |
|
2358 | - * |
|
2359 | - */ |
|
2355 | + * Gets a list of all aircraft manufacturers |
|
2356 | + * |
|
2357 | + * @return Array list of aircraft types |
|
2358 | + * |
|
2359 | + */ |
|
2360 | 2360 | public function getAllManufacturers() |
2361 | 2361 | { |
2362 | 2362 | /* |
@@ -2385,11 +2385,11 @@ discard block |
||
2385 | 2385 | |
2386 | 2386 | |
2387 | 2387 | /** |
2388 | - * Gets a list of all aircraft types |
|
2389 | - * |
|
2390 | - * @return Array list of aircraft types |
|
2391 | - * |
|
2392 | - */ |
|
2388 | + * Gets a list of all aircraft types |
|
2389 | + * |
|
2390 | + * @return Array list of aircraft types |
|
2391 | + * |
|
2392 | + */ |
|
2393 | 2393 | public function getAllAircraftTypes($filters = array()) |
2394 | 2394 | { |
2395 | 2395 | /* |
@@ -2422,11 +2422,11 @@ discard block |
||
2422 | 2422 | |
2423 | 2423 | |
2424 | 2424 | /** |
2425 | - * Gets a list of all aircraft registrations |
|
2426 | - * |
|
2427 | - * @return Array list of aircraft registrations |
|
2428 | - * |
|
2429 | - */ |
|
2425 | + * Gets a list of all aircraft registrations |
|
2426 | + * |
|
2427 | + * @return Array list of aircraft registrations |
|
2428 | + * |
|
2429 | + */ |
|
2430 | 2430 | public function getAllAircraftRegistrations($filters = array()) |
2431 | 2431 | { |
2432 | 2432 | $filter_query = $this->getFilter($filters,true,true); |
@@ -2451,12 +2451,12 @@ discard block |
||
2451 | 2451 | } |
2452 | 2452 | |
2453 | 2453 | /** |
2454 | - * Gets all source name |
|
2455 | - * |
|
2456 | - * @param String type format of source |
|
2457 | - * @return Array list of source name |
|
2458 | - * |
|
2459 | - */ |
|
2454 | + * Gets all source name |
|
2455 | + * |
|
2456 | + * @param String type format of source |
|
2457 | + * @return Array list of source name |
|
2458 | + * |
|
2459 | + */ |
|
2460 | 2460 | public function getAllSourceName($type = '',$filters = array()) |
2461 | 2461 | { |
2462 | 2462 | $filter_query = $this->getFilter($filters,true,true); |
@@ -2487,11 +2487,11 @@ discard block |
||
2487 | 2487 | |
2488 | 2488 | |
2489 | 2489 | /** |
2490 | - * Gets a list of all airline names |
|
2491 | - * |
|
2492 | - * @return Array list of airline names |
|
2493 | - * |
|
2494 | - */ |
|
2490 | + * Gets a list of all airline names |
|
2491 | + * |
|
2492 | + * @return Array list of airline names |
|
2493 | + * |
|
2494 | + */ |
|
2495 | 2495 | public function getAllAirlineNames($airline_type = '',$forsource = NULL,$filters = array()) |
2496 | 2496 | { |
2497 | 2497 | global $globalAirlinesSource,$globalVATSIM, $globalIVAO; |
@@ -2541,11 +2541,11 @@ discard block |
||
2541 | 2541 | |
2542 | 2542 | |
2543 | 2543 | /** |
2544 | - * Gets a list of all airline countries |
|
2545 | - * |
|
2546 | - * @return Array list of airline countries |
|
2547 | - * |
|
2548 | - */ |
|
2544 | + * Gets a list of all airline countries |
|
2545 | + * |
|
2546 | + * @return Array list of airline countries |
|
2547 | + * |
|
2548 | + */ |
|
2549 | 2549 | public function getAllAirlineCountries($filters = array()) |
2550 | 2550 | { |
2551 | 2551 | $filter_query = $this->getFilter($filters,true,true); |
@@ -2573,11 +2573,11 @@ discard block |
||
2573 | 2573 | |
2574 | 2574 | |
2575 | 2575 | /** |
2576 | - * Gets a list of all departure & arrival names |
|
2577 | - * |
|
2578 | - * @return Array list of airport names |
|
2579 | - * |
|
2580 | - */ |
|
2576 | + * Gets a list of all departure & arrival names |
|
2577 | + * |
|
2578 | + * @return Array list of airport names |
|
2579 | + * |
|
2580 | + */ |
|
2581 | 2581 | public function getAllAirportNames($filters = array()) |
2582 | 2582 | { |
2583 | 2583 | $filter_query = $this->getFilter($filters,true,true); |
@@ -2626,11 +2626,11 @@ discard block |
||
2626 | 2626 | |
2627 | 2627 | |
2628 | 2628 | /** |
2629 | - * Gets a list of all departure & arrival airport countries |
|
2630 | - * |
|
2631 | - * @return Array list of airport countries |
|
2632 | - * |
|
2633 | - */ |
|
2629 | + * Gets a list of all departure & arrival airport countries |
|
2630 | + * |
|
2631 | + * @return Array list of airport countries |
|
2632 | + * |
|
2633 | + */ |
|
2634 | 2634 | public function getAllAirportCountries($filters = array()) |
2635 | 2635 | { |
2636 | 2636 | $airport_array = array(); |
@@ -2678,11 +2678,11 @@ discard block |
||
2678 | 2678 | |
2679 | 2679 | |
2680 | 2680 | /** |
2681 | - * Gets a list of all countries (airline, departure airport & arrival airport) |
|
2682 | - * |
|
2683 | - * @return Array list of countries |
|
2684 | - * |
|
2685 | - */ |
|
2681 | + * Gets a list of all countries (airline, departure airport & arrival airport) |
|
2682 | + * |
|
2683 | + * @return Array list of countries |
|
2684 | + * |
|
2685 | + */ |
|
2686 | 2686 | public function getAllCountries($filters = array()) |
2687 | 2687 | { |
2688 | 2688 | $Connection= new Connection($this->db); |
@@ -2759,11 +2759,11 @@ discard block |
||
2759 | 2759 | |
2760 | 2760 | |
2761 | 2761 | /** |
2762 | - * Gets a list of all idents/callsigns |
|
2763 | - * |
|
2764 | - * @return Array list of ident/callsign names |
|
2765 | - * |
|
2766 | - */ |
|
2762 | + * Gets a list of all idents/callsigns |
|
2763 | + * |
|
2764 | + * @return Array list of ident/callsign names |
|
2765 | + * |
|
2766 | + */ |
|
2767 | 2767 | public function getAllIdents($filters = array()) |
2768 | 2768 | { |
2769 | 2769 | $filter_query = $this->getFilter($filters,true,true); |
@@ -2787,9 +2787,9 @@ discard block |
||
2787 | 2787 | } |
2788 | 2788 | |
2789 | 2789 | /** |
2790 | - * Get a list of flights from airport since 7 days |
|
2791 | - * @return Array number, icao, name and city of airports |
|
2792 | - */ |
|
2790 | + * Get a list of flights from airport since 7 days |
|
2791 | + * @return Array number, icao, name and city of airports |
|
2792 | + */ |
|
2793 | 2793 | |
2794 | 2794 | public function getLast7DaysAirportsDeparture($airport_icao = '',$filters = array()) { |
2795 | 2795 | global $globalTimezone, $globalDBdriver; |
@@ -2820,9 +2820,9 @@ discard block |
||
2820 | 2820 | } |
2821 | 2821 | |
2822 | 2822 | /** |
2823 | - * Get a list of flights from airport since 7 days |
|
2824 | - * @return Array number, icao, name and city of airports |
|
2825 | - */ |
|
2823 | + * Get a list of flights from airport since 7 days |
|
2824 | + * @return Array number, icao, name and city of airports |
|
2825 | + */ |
|
2826 | 2826 | |
2827 | 2827 | public function getLast7DaysAirportsDepartureByAirlines($airport_icao = '') { |
2828 | 2828 | global $globalTimezone, $globalDBdriver; |
@@ -2852,9 +2852,9 @@ discard block |
||
2852 | 2852 | } |
2853 | 2853 | |
2854 | 2854 | /** |
2855 | - * Get a list of flights from detected airport since 7 days |
|
2856 | - * @return Array number, icao, name and city of airports |
|
2857 | - */ |
|
2855 | + * Get a list of flights from detected airport since 7 days |
|
2856 | + * @return Array number, icao, name and city of airports |
|
2857 | + */ |
|
2858 | 2858 | |
2859 | 2859 | public function getLast7DaysDetectedAirportsDeparture($airport_icao = '', $filters = array()) { |
2860 | 2860 | global $globalTimezone, $globalDBdriver; |
@@ -2892,9 +2892,9 @@ discard block |
||
2892 | 2892 | } |
2893 | 2893 | |
2894 | 2894 | /** |
2895 | - * Get a list of flights from detected airport since 7 days |
|
2896 | - * @return Array number, icao, name and city of airports |
|
2897 | - */ |
|
2895 | + * Get a list of flights from detected airport since 7 days |
|
2896 | + * @return Array number, icao, name and city of airports |
|
2897 | + */ |
|
2898 | 2898 | |
2899 | 2899 | public function getLast7DaysDetectedAirportsDepartureByAirlines($airport_icao = '') { |
2900 | 2900 | global $globalTimezone, $globalDBdriver; |
@@ -2936,9 +2936,9 @@ discard block |
||
2936 | 2936 | |
2937 | 2937 | |
2938 | 2938 | /** |
2939 | - * Get a list of flights to airport since 7 days |
|
2940 | - * @return Array number, icao, name and city of airports |
|
2941 | - */ |
|
2939 | + * Get a list of flights to airport since 7 days |
|
2940 | + * @return Array number, icao, name and city of airports |
|
2941 | + */ |
|
2942 | 2942 | |
2943 | 2943 | public function getLast7DaysAirportsArrival($airport_icao = '', $filters = array()) { |
2944 | 2944 | global $globalTimezone, $globalDBdriver; |
@@ -2971,9 +2971,9 @@ discard block |
||
2971 | 2971 | |
2972 | 2972 | |
2973 | 2973 | /** |
2974 | - * Get a list of flights detected to airport since 7 days |
|
2975 | - * @return Array number, icao, name and city of airports |
|
2976 | - */ |
|
2974 | + * Get a list of flights detected to airport since 7 days |
|
2975 | + * @return Array number, icao, name and city of airports |
|
2976 | + */ |
|
2977 | 2977 | |
2978 | 2978 | public function getLast7DaysDetectedAirportsArrival($airport_icao = '',$filters = array()) { |
2979 | 2979 | global $globalTimezone, $globalDBdriver; |
@@ -3014,9 +3014,9 @@ discard block |
||
3014 | 3014 | |
3015 | 3015 | |
3016 | 3016 | /** |
3017 | - * Get a list of flights to airport since 7 days |
|
3018 | - * @return Array number, icao, name and city of airports |
|
3019 | - */ |
|
3017 | + * Get a list of flights to airport since 7 days |
|
3018 | + * @return Array number, icao, name and city of airports |
|
3019 | + */ |
|
3020 | 3020 | |
3021 | 3021 | public function getLast7DaysAirportsArrivalByAirlines($airport_icao = '') { |
3022 | 3022 | global $globalTimezone, $globalDBdriver; |
@@ -3048,9 +3048,9 @@ discard block |
||
3048 | 3048 | |
3049 | 3049 | |
3050 | 3050 | /** |
3051 | - * Get a list of flights detected to airport since 7 days |
|
3052 | - * @return Array number, icao, name and city of airports |
|
3053 | - */ |
|
3051 | + * Get a list of flights detected to airport since 7 days |
|
3052 | + * @return Array number, icao, name and city of airports |
|
3053 | + */ |
|
3054 | 3054 | |
3055 | 3055 | public function getLast7DaysDetectedAirportsArrivalByAirlines($airport_icao = '') { |
3056 | 3056 | global $globalTimezone, $globalDBdriver; |
@@ -3094,11 +3094,11 @@ discard block |
||
3094 | 3094 | |
3095 | 3095 | |
3096 | 3096 | /** |
3097 | - * Gets a list of all dates |
|
3098 | - * |
|
3099 | - * @return Array list of date names |
|
3100 | - * |
|
3101 | - */ |
|
3097 | + * Gets a list of all dates |
|
3098 | + * |
|
3099 | + * @return Array list of date names |
|
3100 | + * |
|
3101 | + */ |
|
3102 | 3102 | public function getAllDates() |
3103 | 3103 | { |
3104 | 3104 | global $globalTimezone, $globalDBdriver; |
@@ -3139,11 +3139,11 @@ discard block |
||
3139 | 3139 | |
3140 | 3140 | |
3141 | 3141 | /** |
3142 | - * Gets all route combinations |
|
3143 | - * |
|
3144 | - * @return Array the route list |
|
3145 | - * |
|
3146 | - */ |
|
3142 | + * Gets all route combinations |
|
3143 | + * |
|
3144 | + * @return Array the route list |
|
3145 | + * |
|
3146 | + */ |
|
3147 | 3147 | public function getAllRoutes() |
3148 | 3148 | { |
3149 | 3149 | $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 |
@@ -3169,13 +3169,13 @@ discard block |
||
3169 | 3169 | } |
3170 | 3170 | |
3171 | 3171 | /** |
3172 | - * Update ident spotter data |
|
3173 | - * |
|
3174 | - * @param String $flightaware_id the ID from flightaware |
|
3175 | - * @param String $ident the flight ident |
|
3176 | - * @return String success or false |
|
3177 | - * |
|
3178 | - */ |
|
3172 | + * Update ident spotter data |
|
3173 | + * |
|
3174 | + * @param String $flightaware_id the ID from flightaware |
|
3175 | + * @param String $ident the flight ident |
|
3176 | + * @return String success or false |
|
3177 | + * |
|
3178 | + */ |
|
3179 | 3179 | public function updateIdentSpotterData($flightaware_id = '', $ident = '',$fromsource = NULL) |
3180 | 3180 | { |
3181 | 3181 | if (!is_numeric(substr($ident, 0, 3))) |
@@ -3196,14 +3196,14 @@ discard block |
||
3196 | 3196 | } else { |
3197 | 3197 | $airline_array = $this->getAllAirlineInfo("NA"); |
3198 | 3198 | } |
3199 | - $airline_name = $airline_array[0]['name']; |
|
3200 | - $airline_icao = $airline_array[0]['icao']; |
|
3201 | - $airline_country = $airline_array[0]['country']; |
|
3202 | - $airline_type = $airline_array[0]['type']; |
|
3199 | + $airline_name = $airline_array[0]['name']; |
|
3200 | + $airline_icao = $airline_array[0]['icao']; |
|
3201 | + $airline_country = $airline_array[0]['country']; |
|
3202 | + $airline_type = $airline_array[0]['type']; |
|
3203 | 3203 | |
3204 | 3204 | |
3205 | 3205 | $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'; |
3206 | - $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); |
|
3206 | + $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); |
|
3207 | 3207 | |
3208 | 3208 | try { |
3209 | 3209 | $sth = $this->db->prepare($query); |
@@ -3216,19 +3216,19 @@ discard block |
||
3216 | 3216 | |
3217 | 3217 | } |
3218 | 3218 | /** |
3219 | - * Update latest spotter data |
|
3220 | - * |
|
3221 | - * @param String $flightaware_id the ID from flightaware |
|
3222 | - * @param String $ident the flight ident |
|
3223 | - * @param String $arrival_airport_icao the arrival airport |
|
3224 | - * @return String success or false |
|
3225 | - * |
|
3226 | - */ |
|
3219 | + * Update latest spotter data |
|
3220 | + * |
|
3221 | + * @param String $flightaware_id the ID from flightaware |
|
3222 | + * @param String $ident the flight ident |
|
3223 | + * @param String $arrival_airport_icao the arrival airport |
|
3224 | + * @return String success or false |
|
3225 | + * |
|
3226 | + */ |
|
3227 | 3227 | public function updateLatestSpotterData($flightaware_id = '', $ident = '', $latitude = '', $longitude = '', $altitude = '', $ground = false, $groundspeed = NULL, $date = '', $arrival_airport_icao = '',$arrival_airport_time = '') |
3228 | 3228 | { |
3229 | 3229 | if ($groundspeed == '') $groundspeed = NULL; |
3230 | 3230 | $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'; |
3231 | - $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); |
|
3231 | + $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); |
|
3232 | 3232 | |
3233 | 3233 | try { |
3234 | 3234 | $sth = $this->db->prepare($query); |
@@ -3242,32 +3242,32 @@ discard block |
||
3242 | 3242 | } |
3243 | 3243 | |
3244 | 3244 | /** |
3245 | - * Adds a new spotter data |
|
3246 | - * |
|
3247 | - * @param String $flightaware_id the ID from flightaware |
|
3248 | - * @param String $ident the flight ident |
|
3249 | - * @param String $aircraft_icao the aircraft type |
|
3250 | - * @param String $departure_airport_icao the departure airport |
|
3251 | - * @param String $arrival_airport_icao the arrival airport |
|
3252 | - * @param String $latitude latitude of flight |
|
3253 | - * @param String $longitude latitude of flight |
|
3254 | - * @param String $waypoints waypoints of flight |
|
3255 | - * @param String $altitude altitude of flight |
|
3256 | - * @param String $heading heading of flight |
|
3257 | - * @param String $groundspeed speed of flight |
|
3258 | - * @param String $date date of flight |
|
3259 | - * @param String $departure_airport_time departure time of flight |
|
3260 | - * @param String $arrival_airport_time arrival time of flight |
|
3261 | - * @param String $squawk squawk code of flight |
|
3262 | - * @param String $route_stop route stop of flight |
|
3263 | - * @param String $highlight highlight or not |
|
3264 | - * @param String $ModeS ModesS code of flight |
|
3265 | - * @param String $registration registration code of flight |
|
3266 | - * @param String $pilot_id pilot id of flight (for virtual airlines) |
|
3267 | - * @param String $pilot_name pilot name of flight (for virtual airlines) |
|
3268 | - * @param String $verticalrate vertival rate of flight |
|
3269 | - * @return String success or false |
|
3270 | - */ |
|
3245 | + * Adds a new spotter data |
|
3246 | + * |
|
3247 | + * @param String $flightaware_id the ID from flightaware |
|
3248 | + * @param String $ident the flight ident |
|
3249 | + * @param String $aircraft_icao the aircraft type |
|
3250 | + * @param String $departure_airport_icao the departure airport |
|
3251 | + * @param String $arrival_airport_icao the arrival airport |
|
3252 | + * @param String $latitude latitude of flight |
|
3253 | + * @param String $longitude latitude of flight |
|
3254 | + * @param String $waypoints waypoints of flight |
|
3255 | + * @param String $altitude altitude of flight |
|
3256 | + * @param String $heading heading of flight |
|
3257 | + * @param String $groundspeed speed of flight |
|
3258 | + * @param String $date date of flight |
|
3259 | + * @param String $departure_airport_time departure time of flight |
|
3260 | + * @param String $arrival_airport_time arrival time of flight |
|
3261 | + * @param String $squawk squawk code of flight |
|
3262 | + * @param String $route_stop route stop of flight |
|
3263 | + * @param String $highlight highlight or not |
|
3264 | + * @param String $ModeS ModesS code of flight |
|
3265 | + * @param String $registration registration code of flight |
|
3266 | + * @param String $pilot_id pilot id of flight (for virtual airlines) |
|
3267 | + * @param String $pilot_name pilot name of flight (for virtual airlines) |
|
3268 | + * @param String $verticalrate vertival rate of flight |
|
3269 | + * @return String success or false |
|
3270 | + */ |
|
3271 | 3271 | 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 = '') |
3272 | 3272 | { |
3273 | 3273 | global $globalURL, $globalIVAO, $globalVATSIM, $globalphpVMS, $globalDebugTimeElapsed, $globalAirlinesSource, $globalVAM; |
@@ -3481,8 +3481,8 @@ discard block |
||
3481 | 3481 | |
3482 | 3482 | if ($globalIVAO && $aircraft_icao != '') |
3483 | 3483 | { |
3484 | - if (isset($airline_array[0]['icao'])) $airline_icao = $airline_array[0]['icao']; |
|
3485 | - else $airline_icao = ''; |
|
3484 | + if (isset($airline_array[0]['icao'])) $airline_icao = $airline_array[0]['icao']; |
|
3485 | + else $airline_icao = ''; |
|
3486 | 3486 | $image_array = $Image->getSpotterImage('',$aircraft_icao,$airline_icao); |
3487 | 3487 | if (!isset($image_array[0]['registration'])) |
3488 | 3488 | { |
@@ -3513,52 +3513,52 @@ discard block |
||
3513 | 3513 | |
3514 | 3514 | if (count($airline_array) == 0) |
3515 | 3515 | { |
3516 | - $airline_array = $this->getAllAirlineInfo('NA'); |
|
3517 | - } |
|
3518 | - if (count($aircraft_array) == 0) |
|
3519 | - { |
|
3520 | - $aircraft_array = $this->getAllAircraftInfo('NA'); |
|
3521 | - } |
|
3522 | - if (count($departure_airport_array) == 0) |
|
3523 | - { |
|
3524 | - $departure_airport_array = $this->getAllAirportInfo('NA'); |
|
3525 | - } |
|
3526 | - if (count($arrival_airport_array) == 0) |
|
3527 | - { |
|
3528 | - $arrival_airport_array = $this->getAllAirportInfo('NA'); |
|
3529 | - } |
|
3530 | - if ($registration == '') $registration = 'NA'; |
|
3531 | - if ($latitude == '' && $longitude == '') { |
|
3532 | - $latitude = 0; |
|
3533 | - $longitude = 0; |
|
3534 | - } |
|
3535 | - if ($squawk == '' || $Common->isInteger($squawk) === false) $squawk = NULL; |
|
3536 | - if ($verticalrate == '' || $Common->isInteger($verticalrate) === false) $verticalrate = NULL; |
|
3537 | - if ($heading == '' || $Common->isInteger($heading) === false) $heading = 0; |
|
3538 | - if ($groundspeed == '' || $Common->isInteger($groundspeed) === false) $groundspeed = 0; |
|
3539 | - if (!isset($aircraft_owner)) $aircraft_owner = NULL; |
|
3540 | - $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) |
|
3516 | + $airline_array = $this->getAllAirlineInfo('NA'); |
|
3517 | + } |
|
3518 | + if (count($aircraft_array) == 0) |
|
3519 | + { |
|
3520 | + $aircraft_array = $this->getAllAircraftInfo('NA'); |
|
3521 | + } |
|
3522 | + if (count($departure_airport_array) == 0) |
|
3523 | + { |
|
3524 | + $departure_airport_array = $this->getAllAirportInfo('NA'); |
|
3525 | + } |
|
3526 | + if (count($arrival_airport_array) == 0) |
|
3527 | + { |
|
3528 | + $arrival_airport_array = $this->getAllAirportInfo('NA'); |
|
3529 | + } |
|
3530 | + if ($registration == '') $registration = 'NA'; |
|
3531 | + if ($latitude == '' && $longitude == '') { |
|
3532 | + $latitude = 0; |
|
3533 | + $longitude = 0; |
|
3534 | + } |
|
3535 | + if ($squawk == '' || $Common->isInteger($squawk) === false) $squawk = NULL; |
|
3536 | + if ($verticalrate == '' || $Common->isInteger($verticalrate) === false) $verticalrate = NULL; |
|
3537 | + if ($heading == '' || $Common->isInteger($heading) === false) $heading = 0; |
|
3538 | + if ($groundspeed == '' || $Common->isInteger($groundspeed) === false) $groundspeed = 0; |
|
3539 | + if (!isset($aircraft_owner)) $aircraft_owner = NULL; |
|
3540 | + $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) |
|
3541 | 3541 | 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)"; |
3542 | 3542 | |
3543 | - $airline_name = $airline_array[0]['name']; |
|
3544 | - $airline_icao = $airline_array[0]['icao']; |
|
3545 | - $airline_country = $airline_array[0]['country']; |
|
3546 | - $airline_type = $airline_array[0]['type']; |
|
3543 | + $airline_name = $airline_array[0]['name']; |
|
3544 | + $airline_icao = $airline_array[0]['icao']; |
|
3545 | + $airline_country = $airline_array[0]['country']; |
|
3546 | + $airline_type = $airline_array[0]['type']; |
|
3547 | 3547 | if ($airline_type == '') { |
3548 | 3548 | $timeelapsed = microtime(true); |
3549 | 3549 | $airline_type = $this->getAircraftTypeBymodeS($ModeS); |
3550 | 3550 | if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftTypeBymodes : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
3551 | 3551 | } |
3552 | 3552 | if ($airline_type == null) $airline_type = ''; |
3553 | - $aircraft_type = $aircraft_array[0]['type']; |
|
3554 | - $aircraft_manufacturer = $aircraft_array[0]['manufacturer']; |
|
3555 | - $departure_airport_name = $departure_airport_array[0]['name']; |
|
3556 | - $departure_airport_city = $departure_airport_array[0]['city']; |
|
3557 | - $departure_airport_country = $departure_airport_array[0]['country']; |
|
3558 | - $arrival_airport_name = $arrival_airport_array[0]['name']; |
|
3559 | - $arrival_airport_city = $arrival_airport_array[0]['city']; |
|
3560 | - $arrival_airport_country = $arrival_airport_array[0]['country']; |
|
3561 | - $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); |
|
3553 | + $aircraft_type = $aircraft_array[0]['type']; |
|
3554 | + $aircraft_manufacturer = $aircraft_array[0]['manufacturer']; |
|
3555 | + $departure_airport_name = $departure_airport_array[0]['name']; |
|
3556 | + $departure_airport_city = $departure_airport_array[0]['city']; |
|
3557 | + $departure_airport_country = $departure_airport_array[0]['country']; |
|
3558 | + $arrival_airport_name = $arrival_airport_array[0]['name']; |
|
3559 | + $arrival_airport_city = $arrival_airport_array[0]['city']; |
|
3560 | + $arrival_airport_country = $arrival_airport_array[0]['country']; |
|
3561 | + $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); |
|
3562 | 3562 | |
3563 | 3563 | try { |
3564 | 3564 | |
@@ -3566,7 +3566,7 @@ discard block |
||
3566 | 3566 | $sth->execute($query_values); |
3567 | 3567 | $this->db = null; |
3568 | 3568 | } catch (PDOException $e) { |
3569 | - return "error : ".$e->getMessage(); |
|
3569 | + return "error : ".$e->getMessage(); |
|
3570 | 3570 | } |
3571 | 3571 | |
3572 | 3572 | return "success"; |
@@ -3575,11 +3575,11 @@ discard block |
||
3575 | 3575 | |
3576 | 3576 | |
3577 | 3577 | /** |
3578 | - * Gets the aircraft ident within the last hour |
|
3579 | - * |
|
3580 | - * @return String the ident |
|
3581 | - * |
|
3582 | - */ |
|
3578 | + * Gets the aircraft ident within the last hour |
|
3579 | + * |
|
3580 | + * @return String the ident |
|
3581 | + * |
|
3582 | + */ |
|
3583 | 3583 | public function getIdentFromLastHour($ident) |
3584 | 3584 | { |
3585 | 3585 | global $globalDBdriver, $globalTimezone; |
@@ -3595,11 +3595,11 @@ discard block |
||
3595 | 3595 | AND spotter_output.date >= now() AT TIME ZONE 'UTC' - INTERVAL '1 HOURS' |
3596 | 3596 | AND spotter_output.date < now() AT TIME ZONE 'UTC'"; |
3597 | 3597 | $query_data = array(':ident' => $ident); |
3598 | - } |
|
3598 | + } |
|
3599 | 3599 | |
3600 | 3600 | $sth = $this->db->prepare($query); |
3601 | 3601 | $sth->execute($query_data); |
3602 | - $ident_result=''; |
|
3602 | + $ident_result=''; |
|
3603 | 3603 | while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
3604 | 3604 | { |
3605 | 3605 | $ident_result = $row['ident']; |
@@ -3610,11 +3610,11 @@ discard block |
||
3610 | 3610 | |
3611 | 3611 | |
3612 | 3612 | /** |
3613 | - * Gets the aircraft data from the last 20 seconds |
|
3614 | - * |
|
3615 | - * @return Array the spotter data |
|
3616 | - * |
|
3617 | - */ |
|
3613 | + * Gets the aircraft data from the last 20 seconds |
|
3614 | + * |
|
3615 | + * @return Array the spotter data |
|
3616 | + * |
|
3617 | + */ |
|
3618 | 3618 | public function getRealTimeData($q = '') |
3619 | 3619 | { |
3620 | 3620 | global $globalDBdriver; |
@@ -3658,11 +3658,11 @@ discard block |
||
3658 | 3658 | |
3659 | 3659 | |
3660 | 3660 | /** |
3661 | - * Gets all airlines that have flown over |
|
3662 | - * |
|
3663 | - * @return Array the airline list |
|
3664 | - * |
|
3665 | - */ |
|
3661 | + * Gets all airlines that have flown over |
|
3662 | + * |
|
3663 | + * @return Array the airline list |
|
3664 | + * |
|
3665 | + */ |
|
3666 | 3666 | public function countAllAirlines($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array()) |
3667 | 3667 | { |
3668 | 3668 | global $globalDBdriver; |
@@ -3676,7 +3676,7 @@ discard block |
||
3676 | 3676 | $query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
3677 | 3677 | } |
3678 | 3678 | } |
3679 | - if ($sincedate != '') { |
|
3679 | + if ($sincedate != '') { |
|
3680 | 3680 | if ($globalDBdriver == 'mysql') { |
3681 | 3681 | $query .= "AND spotter_output.date > '".$sincedate."' "; |
3682 | 3682 | } else { |
@@ -3703,26 +3703,26 @@ discard block |
||
3703 | 3703 | } |
3704 | 3704 | |
3705 | 3705 | /** |
3706 | - * Gets all pilots that have flown over |
|
3707 | - * |
|
3708 | - * @return Array the pilots list |
|
3709 | - * |
|
3710 | - */ |
|
3706 | + * Gets all pilots that have flown over |
|
3707 | + * |
|
3708 | + * @return Array the pilots list |
|
3709 | + * |
|
3710 | + */ |
|
3711 | 3711 | public function countAllPilots($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array()) |
3712 | 3712 | { |
3713 | 3713 | global $globalDBdriver; |
3714 | 3714 | $filter_query = $this->getFilter($filters,true,true); |
3715 | 3715 | $query = "SELECT DISTINCT spotter_output.pilot_id, spotter_output.pilot_name, COUNT(spotter_output.pilot_id) AS pilot_count, spotter_output.format_source |
3716 | 3716 | FROM spotter_output".$filter_query." spotter_output.pilot_id <> '' "; |
3717 | - if ($olderthanmonths > 0) { |
|
3718 | - if ($globalDBdriver == 'mysql') { |
|
3717 | + if ($olderthanmonths > 0) { |
|
3718 | + if ($globalDBdriver == 'mysql') { |
|
3719 | 3719 | $query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) '; |
3720 | 3720 | } else { |
3721 | 3721 | $query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
3722 | 3722 | } |
3723 | 3723 | } |
3724 | - if ($sincedate != '') { |
|
3725 | - if ($globalDBdriver == 'mysql') { |
|
3724 | + if ($sincedate != '') { |
|
3725 | + if ($globalDBdriver == 'mysql') { |
|
3726 | 3726 | $query .= "AND spotter_output.date > '".$sincedate."' "; |
3727 | 3727 | } else { |
3728 | 3728 | $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -3750,25 +3750,25 @@ discard block |
||
3750 | 3750 | } |
3751 | 3751 | |
3752 | 3752 | /** |
3753 | - * Gets all pilots that have flown over |
|
3754 | - * |
|
3755 | - * @return Array the pilots list |
|
3756 | - * |
|
3757 | - */ |
|
3753 | + * Gets all pilots that have flown over |
|
3754 | + * |
|
3755 | + * @return Array the pilots list |
|
3756 | + * |
|
3757 | + */ |
|
3758 | 3758 | public function countAllPilotsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '') |
3759 | 3759 | { |
3760 | 3760 | global $globalDBdriver; |
3761 | 3761 | $query = "SELECT DISTINCT spotter_output.airline_icao, spotter_output.pilot_id, spotter_output.pilot_name, COUNT(spotter_output.pilot_id) AS pilot_count, spotter_output.format_source |
3762 | 3762 | FROM spotter_output WHERE spotter_output.pilot_id <> '' "; |
3763 | - if ($olderthanmonths > 0) { |
|
3764 | - if ($globalDBdriver == 'mysql') { |
|
3763 | + if ($olderthanmonths > 0) { |
|
3764 | + if ($globalDBdriver == 'mysql') { |
|
3765 | 3765 | $query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) '; |
3766 | 3766 | } else { |
3767 | 3767 | $query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
3768 | 3768 | } |
3769 | 3769 | } |
3770 | - if ($sincedate != '') { |
|
3771 | - if ($globalDBdriver == 'mysql') { |
|
3770 | + if ($sincedate != '') { |
|
3771 | + if ($globalDBdriver == 'mysql') { |
|
3772 | 3772 | $query .= "AND spotter_output.date > '".$sincedate."' "; |
3773 | 3773 | } else { |
3774 | 3774 | $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -3797,26 +3797,26 @@ discard block |
||
3797 | 3797 | } |
3798 | 3798 | |
3799 | 3799 | /** |
3800 | - * Gets all owner that have flown over |
|
3801 | - * |
|
3802 | - * @return Array the pilots list |
|
3803 | - * |
|
3804 | - */ |
|
3800 | + * Gets all owner that have flown over |
|
3801 | + * |
|
3802 | + * @return Array the pilots list |
|
3803 | + * |
|
3804 | + */ |
|
3805 | 3805 | public function countAllOwners($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array()) |
3806 | 3806 | { |
3807 | 3807 | global $globalDBdriver; |
3808 | 3808 | $filter_query = $this->getFilter($filters,true,true); |
3809 | 3809 | $query = "SELECT DISTINCT spotter_output.owner_name, COUNT(spotter_output.owner_name) AS owner_count |
3810 | 3810 | FROM spotter_output".$filter_query." spotter_output.owner_name <> '' AND spotter_output.owner_name IS NOT NULL "; |
3811 | - if ($olderthanmonths > 0) { |
|
3812 | - if ($globalDBdriver == 'mysql') { |
|
3811 | + if ($olderthanmonths > 0) { |
|
3812 | + if ($globalDBdriver == 'mysql') { |
|
3813 | 3813 | $query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) '; |
3814 | 3814 | } else { |
3815 | 3815 | $query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
3816 | 3816 | } |
3817 | 3817 | } |
3818 | - if ($sincedate != '') { |
|
3819 | - if ($globalDBdriver == 'mysql') { |
|
3818 | + if ($sincedate != '') { |
|
3819 | + if ($globalDBdriver == 'mysql') { |
|
3820 | 3820 | $query .= "AND spotter_output.date > '".$sincedate."' "; |
3821 | 3821 | } else { |
3822 | 3822 | $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -3842,26 +3842,26 @@ discard block |
||
3842 | 3842 | } |
3843 | 3843 | |
3844 | 3844 | /** |
3845 | - * Gets all owner that have flown over |
|
3846 | - * |
|
3847 | - * @return Array the pilots list |
|
3848 | - * |
|
3849 | - */ |
|
3845 | + * Gets all owner that have flown over |
|
3846 | + * |
|
3847 | + * @return Array the pilots list |
|
3848 | + * |
|
3849 | + */ |
|
3850 | 3850 | public function countAllOwnersByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array()) |
3851 | 3851 | { |
3852 | 3852 | global $globalDBdriver; |
3853 | 3853 | $filter_query = $this->getFilter($filters,true,true); |
3854 | 3854 | $query = "SELECT DISTINCT spotter_output.airline_icao, spotter_output.owner_name, COUNT(spotter_output.owner_name) AS owner_count |
3855 | 3855 | FROM spotter_output".$filter_query." spotter_output.owner_name <> '' AND spotter_output.owner_name IS NOT NULL "; |
3856 | - if ($olderthanmonths > 0) { |
|
3857 | - if ($globalDBdriver == 'mysql') { |
|
3856 | + if ($olderthanmonths > 0) { |
|
3857 | + if ($globalDBdriver == 'mysql') { |
|
3858 | 3858 | $query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) '; |
3859 | 3859 | } else { |
3860 | 3860 | $query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
3861 | 3861 | } |
3862 | 3862 | } |
3863 | - if ($sincedate != '') { |
|
3864 | - if ($globalDBdriver == 'mysql') { |
|
3863 | + if ($sincedate != '') { |
|
3864 | + if ($globalDBdriver == 'mysql') { |
|
3865 | 3865 | $query .= "AND spotter_output.date > '".$sincedate."' "; |
3866 | 3866 | } else { |
3867 | 3867 | $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -3888,11 +3888,11 @@ discard block |
||
3888 | 3888 | } |
3889 | 3889 | |
3890 | 3890 | /** |
3891 | - * Gets all airlines that have flown over by aircraft |
|
3892 | - * |
|
3893 | - * @return Array the airline list |
|
3894 | - * |
|
3895 | - */ |
|
3891 | + * Gets all airlines that have flown over by aircraft |
|
3892 | + * |
|
3893 | + * @return Array the airline list |
|
3894 | + * |
|
3895 | + */ |
|
3896 | 3896 | public function countAllAirlinesByAircraft($aircraft_icao,$filters = array()) |
3897 | 3897 | { |
3898 | 3898 | $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
@@ -3924,11 +3924,11 @@ discard block |
||
3924 | 3924 | |
3925 | 3925 | |
3926 | 3926 | /** |
3927 | - * Gets all airline countries that have flown over by aircraft |
|
3928 | - * |
|
3929 | - * @return Array the airline country list |
|
3930 | - * |
|
3931 | - */ |
|
3927 | + * Gets all airline countries that have flown over by aircraft |
|
3928 | + * |
|
3929 | + * @return Array the airline country list |
|
3930 | + * |
|
3931 | + */ |
|
3932 | 3932 | public function countAllAirlineCountriesByAircraft($aircraft_icao,$filters = array()) |
3933 | 3933 | { |
3934 | 3934 | $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
@@ -3960,11 +3960,11 @@ discard block |
||
3960 | 3960 | |
3961 | 3961 | |
3962 | 3962 | /** |
3963 | - * Gets all airlines that have flown over by airport |
|
3964 | - * |
|
3965 | - * @return Array the airline list |
|
3966 | - * |
|
3967 | - */ |
|
3963 | + * Gets all airlines that have flown over by airport |
|
3964 | + * |
|
3965 | + * @return Array the airline list |
|
3966 | + * |
|
3967 | + */ |
|
3968 | 3968 | public function countAllAirlinesByAirport($airport_icao,$filters = array()) |
3969 | 3969 | { |
3970 | 3970 | $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
@@ -3995,11 +3995,11 @@ discard block |
||
3995 | 3995 | |
3996 | 3996 | |
3997 | 3997 | /** |
3998 | - * Gets all airline countries that have flown over by airport icao |
|
3999 | - * |
|
4000 | - * @return Array the airline country list |
|
4001 | - * |
|
4002 | - */ |
|
3998 | + * Gets all airline countries that have flown over by airport icao |
|
3999 | + * |
|
4000 | + * @return Array the airline country list |
|
4001 | + * |
|
4002 | + */ |
|
4003 | 4003 | public function countAllAirlineCountriesByAirport($airport_icao,$filters = array()) |
4004 | 4004 | { |
4005 | 4005 | $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
@@ -4029,11 +4029,11 @@ discard block |
||
4029 | 4029 | |
4030 | 4030 | |
4031 | 4031 | /** |
4032 | - * Gets all airlines that have flown over by aircraft manufacturer |
|
4033 | - * |
|
4034 | - * @return Array the airline list |
|
4035 | - * |
|
4036 | - */ |
|
4032 | + * Gets all airlines that have flown over by aircraft manufacturer |
|
4033 | + * |
|
4034 | + * @return Array the airline list |
|
4035 | + * |
|
4036 | + */ |
|
4037 | 4037 | public function countAllAirlinesByManufacturer($aircraft_manufacturer,$filters = array()) |
4038 | 4038 | { |
4039 | 4039 | $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
@@ -4064,11 +4064,11 @@ discard block |
||
4064 | 4064 | |
4065 | 4065 | |
4066 | 4066 | /** |
4067 | - * Gets all airline countries that have flown over by aircraft manufacturer |
|
4068 | - * |
|
4069 | - * @return Array the airline country list |
|
4070 | - * |
|
4071 | - */ |
|
4067 | + * Gets all airline countries that have flown over by aircraft manufacturer |
|
4068 | + * |
|
4069 | + * @return Array the airline country list |
|
4070 | + * |
|
4071 | + */ |
|
4072 | 4072 | public function countAllAirlineCountriesByManufacturer($aircraft_manufacturer,$filters = array()) |
4073 | 4073 | { |
4074 | 4074 | $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
@@ -4097,11 +4097,11 @@ discard block |
||
4097 | 4097 | |
4098 | 4098 | |
4099 | 4099 | /** |
4100 | - * Gets all airlines that have flown over by date |
|
4101 | - * |
|
4102 | - * @return Array the airline list |
|
4103 | - * |
|
4104 | - */ |
|
4100 | + * Gets all airlines that have flown over by date |
|
4101 | + * |
|
4102 | + * @return Array the airline list |
|
4103 | + * |
|
4104 | + */ |
|
4105 | 4105 | public function countAllAirlinesByDate($date,$filters = array()) |
4106 | 4106 | { |
4107 | 4107 | global $globalTimezone, $globalDBdriver; |
@@ -4145,11 +4145,11 @@ discard block |
||
4145 | 4145 | |
4146 | 4146 | |
4147 | 4147 | /** |
4148 | - * Gets all airline countries that have flown over by date |
|
4149 | - * |
|
4150 | - * @return Array the airline country list |
|
4151 | - * |
|
4152 | - */ |
|
4148 | + * Gets all airline countries that have flown over by date |
|
4149 | + * |
|
4150 | + * @return Array the airline country list |
|
4151 | + * |
|
4152 | + */ |
|
4153 | 4153 | public function countAllAirlineCountriesByDate($date,$filters = array()) |
4154 | 4154 | { |
4155 | 4155 | global $globalTimezone, $globalDBdriver; |
@@ -4192,11 +4192,11 @@ discard block |
||
4192 | 4192 | |
4193 | 4193 | |
4194 | 4194 | /** |
4195 | - * Gets all airlines that have flown over by ident/callsign |
|
4196 | - * |
|
4197 | - * @return Array the airline list |
|
4198 | - * |
|
4199 | - */ |
|
4195 | + * Gets all airlines that have flown over by ident/callsign |
|
4196 | + * |
|
4197 | + * @return Array the airline list |
|
4198 | + * |
|
4199 | + */ |
|
4200 | 4200 | public function countAllAirlinesByIdent($ident,$filters = array()) |
4201 | 4201 | { |
4202 | 4202 | $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
@@ -4226,11 +4226,11 @@ discard block |
||
4226 | 4226 | } |
4227 | 4227 | |
4228 | 4228 | /** |
4229 | - * Gets all airlines that have flown over by route |
|
4230 | - * |
|
4231 | - * @return Array the airline list |
|
4232 | - * |
|
4233 | - */ |
|
4229 | + * Gets all airlines that have flown over by route |
|
4230 | + * |
|
4231 | + * @return Array the airline list |
|
4232 | + * |
|
4233 | + */ |
|
4234 | 4234 | public function countAllAirlinesByRoute($departure_airport_icao, $arrival_airport_icao,$filters = array()) |
4235 | 4235 | { |
4236 | 4236 | $filter_query = $this->getFilter($filters,true,true); |
@@ -4262,11 +4262,11 @@ discard block |
||
4262 | 4262 | } |
4263 | 4263 | |
4264 | 4264 | /** |
4265 | - * Gets all airline countries that have flown over by route |
|
4266 | - * |
|
4267 | - * @return Array the airline country list |
|
4268 | - * |
|
4269 | - */ |
|
4265 | + * Gets all airline countries that have flown over by route |
|
4266 | + * |
|
4267 | + * @return Array the airline country list |
|
4268 | + * |
|
4269 | + */ |
|
4270 | 4270 | public function countAllAirlineCountriesByRoute($departure_airport_icao, $arrival_airport_icao,$filters= array()) |
4271 | 4271 | { |
4272 | 4272 | $filter_query = $this->getFilter($filters,true,true); |
@@ -4298,11 +4298,11 @@ discard block |
||
4298 | 4298 | |
4299 | 4299 | |
4300 | 4300 | /** |
4301 | - * Gets all airlines that have flown over by country |
|
4302 | - * |
|
4303 | - * @return Array the airline list |
|
4304 | - * |
|
4305 | - */ |
|
4301 | + * Gets all airlines that have flown over by country |
|
4302 | + * |
|
4303 | + * @return Array the airline list |
|
4304 | + * |
|
4305 | + */ |
|
4306 | 4306 | public function countAllAirlinesByCountry($country,$filters = array()) |
4307 | 4307 | { |
4308 | 4308 | $country = filter_var($country,FILTER_SANITIZE_STRING); |
@@ -4332,11 +4332,11 @@ discard block |
||
4332 | 4332 | |
4333 | 4333 | |
4334 | 4334 | /** |
4335 | - * Gets all airline countries that have flown over by country |
|
4336 | - * |
|
4337 | - * @return Array the airline country list |
|
4338 | - * |
|
4339 | - */ |
|
4335 | + * Gets all airline countries that have flown over by country |
|
4336 | + * |
|
4337 | + * @return Array the airline country list |
|
4338 | + * |
|
4339 | + */ |
|
4340 | 4340 | public function countAllAirlineCountriesByCountry($country,$filters = array()) |
4341 | 4341 | { |
4342 | 4342 | $filter_query = $this->getFilter($filters,true,true); |
@@ -4365,11 +4365,11 @@ discard block |
||
4365 | 4365 | |
4366 | 4366 | |
4367 | 4367 | /** |
4368 | - * Gets all airlines countries |
|
4369 | - * |
|
4370 | - * @return Array the airline country list |
|
4371 | - * |
|
4372 | - */ |
|
4368 | + * Gets all airlines countries |
|
4369 | + * |
|
4370 | + * @return Array the airline country list |
|
4371 | + * |
|
4372 | + */ |
|
4373 | 4373 | public function countAllAirlineCountries($limit = true, $filters = array()) |
4374 | 4374 | { |
4375 | 4375 | $filter_query = $this->getFilter($filters,true,true); |
@@ -4395,11 +4395,11 @@ discard block |
||
4395 | 4395 | } |
4396 | 4396 | |
4397 | 4397 | /** |
4398 | - * Gets all number of flight over countries |
|
4399 | - * |
|
4400 | - * @return Array the airline country list |
|
4401 | - * |
|
4402 | - */ |
|
4398 | + * Gets all number of flight over countries |
|
4399 | + * |
|
4400 | + * @return Array the airline country list |
|
4401 | + * |
|
4402 | + */ |
|
4403 | 4403 | public function countAllFlightOverCountries($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array()) |
4404 | 4404 | { |
4405 | 4405 | global $globalDBdriver; |
@@ -4421,15 +4421,15 @@ discard block |
||
4421 | 4421 | $SpotterLive = new SpotterLive(); |
4422 | 4422 | $filter_query = $SpotterLive->getFilter($filters,true,true); |
4423 | 4423 | $filter_query .= ' over_country IS NOT NULL'; |
4424 | - if ($olderthanmonths > 0) { |
|
4424 | + if ($olderthanmonths > 0) { |
|
4425 | 4425 | if ($globalDBdriver == 'mysql') { |
4426 | 4426 | $filter_query .= ' AND spotter_live.date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
4427 | 4427 | } else { |
4428 | 4428 | $filter_query .= " AND spotter_live.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
4429 | 4429 | } |
4430 | 4430 | } |
4431 | - if ($sincedate != '') { |
|
4432 | - if ($globalDBdriver == 'mysql') { |
|
4431 | + if ($sincedate != '') { |
|
4432 | + if ($globalDBdriver == 'mysql') { |
|
4433 | 4433 | $filter_query .= " AND spotter_live.date > '".$sincedate."' "; |
4434 | 4434 | } else { |
4435 | 4435 | $filter_query .= " AND spotter_live.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -4459,11 +4459,11 @@ discard block |
||
4459 | 4459 | |
4460 | 4460 | |
4461 | 4461 | /** |
4462 | - * Gets all aircraft types that have flown over |
|
4463 | - * |
|
4464 | - * @return Array the aircraft list |
|
4465 | - * |
|
4466 | - */ |
|
4462 | + * Gets all aircraft types that have flown over |
|
4463 | + * |
|
4464 | + * @return Array the aircraft list |
|
4465 | + * |
|
4466 | + */ |
|
4467 | 4467 | public function countAllAircraftTypes($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array()) |
4468 | 4468 | { |
4469 | 4469 | global $globalDBdriver; |
@@ -4506,11 +4506,11 @@ discard block |
||
4506 | 4506 | } |
4507 | 4507 | |
4508 | 4508 | /** |
4509 | - * Gets all aircraft types that have flown over by airline |
|
4510 | - * |
|
4511 | - * @return Array the aircraft list |
|
4512 | - * |
|
4513 | - */ |
|
4509 | + * Gets all aircraft types that have flown over by airline |
|
4510 | + * |
|
4511 | + * @return Array the aircraft list |
|
4512 | + * |
|
4513 | + */ |
|
4514 | 4514 | public function countAllAircraftTypesByAirlines($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array()) |
4515 | 4515 | { |
4516 | 4516 | global $globalDBdriver; |
@@ -4553,11 +4553,11 @@ discard block |
||
4553 | 4553 | } |
4554 | 4554 | |
4555 | 4555 | /** |
4556 | - * Gets all aircraft types that have flown over by months |
|
4557 | - * |
|
4558 | - * @return Array the aircraft list |
|
4559 | - * |
|
4560 | - */ |
|
4556 | + * Gets all aircraft types that have flown over by months |
|
4557 | + * |
|
4558 | + * @return Array the aircraft list |
|
4559 | + * |
|
4560 | + */ |
|
4561 | 4561 | public function countAllAircraftTypesByMonths($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array()) |
4562 | 4562 | { |
4563 | 4563 | global $globalDBdriver; |
@@ -4601,11 +4601,11 @@ discard block |
||
4601 | 4601 | |
4602 | 4602 | |
4603 | 4603 | /** |
4604 | - * Gets all aircraft registration that have flown over by aircaft icao |
|
4605 | - * |
|
4606 | - * @return Array the aircraft list |
|
4607 | - * |
|
4608 | - */ |
|
4604 | + * Gets all aircraft registration that have flown over by aircaft icao |
|
4605 | + * |
|
4606 | + * @return Array the aircraft list |
|
4607 | + * |
|
4608 | + */ |
|
4609 | 4609 | public function countAllAircraftRegistrationByAircraft($aircraft_icao,$filters = array()) |
4610 | 4610 | { |
4611 | 4611 | $Image = new Image($this->db); |
@@ -4644,11 +4644,11 @@ discard block |
||
4644 | 4644 | |
4645 | 4645 | |
4646 | 4646 | /** |
4647 | - * Gets all aircraft types that have flown over by airline icao |
|
4648 | - * |
|
4649 | - * @return Array the aircraft list |
|
4650 | - * |
|
4651 | - */ |
|
4647 | + * Gets all aircraft types that have flown over by airline icao |
|
4648 | + * |
|
4649 | + * @return Array the aircraft list |
|
4650 | + * |
|
4651 | + */ |
|
4652 | 4652 | public function countAllAircraftTypesByAirline($airline_icao,$filters = array()) |
4653 | 4653 | { |
4654 | 4654 | $filter_query = $this->getFilter($filters,true,true); |
@@ -4677,11 +4677,11 @@ discard block |
||
4677 | 4677 | |
4678 | 4678 | |
4679 | 4679 | /** |
4680 | - * Gets all aircraft registration that have flown over by airline icao |
|
4681 | - * |
|
4682 | - * @return Array the aircraft list |
|
4683 | - * |
|
4684 | - */ |
|
4680 | + * Gets all aircraft registration that have flown over by airline icao |
|
4681 | + * |
|
4682 | + * @return Array the aircraft list |
|
4683 | + * |
|
4684 | + */ |
|
4685 | 4685 | public function countAllAircraftRegistrationByAirline($airline_icao,$filters = array()) |
4686 | 4686 | { |
4687 | 4687 | $filter_query = $this->getFilter($filters,true,true); |
@@ -4719,11 +4719,11 @@ discard block |
||
4719 | 4719 | |
4720 | 4720 | |
4721 | 4721 | /** |
4722 | - * Gets all aircraft manufacturer that have flown over by airline icao |
|
4723 | - * |
|
4724 | - * @return Array the aircraft list |
|
4725 | - * |
|
4726 | - */ |
|
4722 | + * Gets all aircraft manufacturer that have flown over by airline icao |
|
4723 | + * |
|
4724 | + * @return Array the aircraft list |
|
4725 | + * |
|
4726 | + */ |
|
4727 | 4727 | public function countAllAircraftManufacturerByAirline($airline_icao,$filters = array()) |
4728 | 4728 | { |
4729 | 4729 | $filter_query = $this->getFilter($filters,true,true); |
@@ -4751,11 +4751,11 @@ discard block |
||
4751 | 4751 | |
4752 | 4752 | |
4753 | 4753 | /** |
4754 | - * Gets all aircraft types that have flown over by airline icao |
|
4755 | - * |
|
4756 | - * @return Array the aircraft list |
|
4757 | - * |
|
4758 | - */ |
|
4754 | + * Gets all aircraft types that have flown over by airline icao |
|
4755 | + * |
|
4756 | + * @return Array the aircraft list |
|
4757 | + * |
|
4758 | + */ |
|
4759 | 4759 | public function countAllAircraftTypesByAirport($airport_icao,$filters = array()) |
4760 | 4760 | { |
4761 | 4761 | $filter_query = $this->getFilter($filters,true,true); |
@@ -4784,11 +4784,11 @@ discard block |
||
4784 | 4784 | |
4785 | 4785 | |
4786 | 4786 | /** |
4787 | - * Gets all aircraft registration that have flown over by airport icao |
|
4788 | - * |
|
4789 | - * @return Array the aircraft list |
|
4790 | - * |
|
4791 | - */ |
|
4787 | + * Gets all aircraft registration that have flown over by airport icao |
|
4788 | + * |
|
4789 | + * @return Array the aircraft list |
|
4790 | + * |
|
4791 | + */ |
|
4792 | 4792 | public function countAllAircraftRegistrationByAirport($airport_icao,$filters = array()) |
4793 | 4793 | { |
4794 | 4794 | $filter_query = $this->getFilter($filters,true,true); |
@@ -4825,11 +4825,11 @@ discard block |
||
4825 | 4825 | |
4826 | 4826 | |
4827 | 4827 | /** |
4828 | - * Gets all aircraft manufacturer that have flown over by airport icao |
|
4829 | - * |
|
4830 | - * @return Array the aircraft list |
|
4831 | - * |
|
4832 | - */ |
|
4828 | + * Gets all aircraft manufacturer that have flown over by airport icao |
|
4829 | + * |
|
4830 | + * @return Array the aircraft list |
|
4831 | + * |
|
4832 | + */ |
|
4833 | 4833 | public function countAllAircraftManufacturerByAirport($airport_icao,$filters = array()) |
4834 | 4834 | { |
4835 | 4835 | $filter_query = $this->getFilter($filters,true,true); |
@@ -4855,11 +4855,11 @@ discard block |
||
4855 | 4855 | } |
4856 | 4856 | |
4857 | 4857 | /** |
4858 | - * Gets all aircraft types that have flown over by aircraft manufacturer |
|
4859 | - * |
|
4860 | - * @return Array the aircraft list |
|
4861 | - * |
|
4862 | - */ |
|
4858 | + * Gets all aircraft types that have flown over by aircraft manufacturer |
|
4859 | + * |
|
4860 | + * @return Array the aircraft list |
|
4861 | + * |
|
4862 | + */ |
|
4863 | 4863 | public function countAllAircraftTypesByManufacturer($aircraft_manufacturer,$filters = array()) |
4864 | 4864 | { |
4865 | 4865 | $filter_query = $this->getFilter($filters,true,true); |
@@ -4886,11 +4886,11 @@ discard block |
||
4886 | 4886 | |
4887 | 4887 | |
4888 | 4888 | /** |
4889 | - * Gets all aircraft registration that have flown over by aircaft manufacturer |
|
4890 | - * |
|
4891 | - * @return Array the aircraft list |
|
4892 | - * |
|
4893 | - */ |
|
4889 | + * Gets all aircraft registration that have flown over by aircaft manufacturer |
|
4890 | + * |
|
4891 | + * @return Array the aircraft list |
|
4892 | + * |
|
4893 | + */ |
|
4894 | 4894 | public function countAllAircraftRegistrationByManufacturer($aircraft_manufacturer, $filters = array()) |
4895 | 4895 | { |
4896 | 4896 | $filter_query = $this->getFilter($filters,true,true); |
@@ -4926,11 +4926,11 @@ discard block |
||
4926 | 4926 | } |
4927 | 4927 | |
4928 | 4928 | /** |
4929 | - * Gets all aircraft types that have flown over by date |
|
4930 | - * |
|
4931 | - * @return Array the aircraft list |
|
4932 | - * |
|
4933 | - */ |
|
4929 | + * Gets all aircraft types that have flown over by date |
|
4930 | + * |
|
4931 | + * @return Array the aircraft list |
|
4932 | + * |
|
4933 | + */ |
|
4934 | 4934 | public function countAllAircraftTypesByDate($date,$filters = array()) |
4935 | 4935 | { |
4936 | 4936 | global $globalTimezone, $globalDBdriver; |
@@ -4972,11 +4972,11 @@ discard block |
||
4972 | 4972 | |
4973 | 4973 | |
4974 | 4974 | /** |
4975 | - * Gets all aircraft registration that have flown over by date |
|
4976 | - * |
|
4977 | - * @return Array the aircraft list |
|
4978 | - * |
|
4979 | - */ |
|
4975 | + * Gets all aircraft registration that have flown over by date |
|
4976 | + * |
|
4977 | + * @return Array the aircraft list |
|
4978 | + * |
|
4979 | + */ |
|
4980 | 4980 | public function countAllAircraftRegistrationByDate($date,$filters = array()) |
4981 | 4981 | { |
4982 | 4982 | global $globalTimezone, $globalDBdriver; |
@@ -5027,11 +5027,11 @@ discard block |
||
5027 | 5027 | |
5028 | 5028 | |
5029 | 5029 | /** |
5030 | - * Gets all aircraft manufacturer that have flown over by date |
|
5031 | - * |
|
5032 | - * @return Array the aircraft manufacturer list |
|
5033 | - * |
|
5034 | - */ |
|
5030 | + * Gets all aircraft manufacturer that have flown over by date |
|
5031 | + * |
|
5032 | + * @return Array the aircraft manufacturer list |
|
5033 | + * |
|
5034 | + */ |
|
5035 | 5035 | public function countAllAircraftManufacturerByDate($date,$filters = array()) |
5036 | 5036 | { |
5037 | 5037 | global $globalTimezone, $globalDBdriver; |
@@ -5073,11 +5073,11 @@ discard block |
||
5073 | 5073 | |
5074 | 5074 | |
5075 | 5075 | /** |
5076 | - * Gets all aircraft types that have flown over by ident/callsign |
|
5077 | - * |
|
5078 | - * @return Array the aircraft list |
|
5079 | - * |
|
5080 | - */ |
|
5076 | + * Gets all aircraft types that have flown over by ident/callsign |
|
5077 | + * |
|
5078 | + * @return Array the aircraft list |
|
5079 | + * |
|
5080 | + */ |
|
5081 | 5081 | public function countAllAircraftTypesByIdent($ident,$filters = array()) |
5082 | 5082 | { |
5083 | 5083 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5106,11 +5106,11 @@ discard block |
||
5106 | 5106 | |
5107 | 5107 | |
5108 | 5108 | /** |
5109 | - * Gets all aircraft registration that have flown over by ident/callsign |
|
5110 | - * |
|
5111 | - * @return Array the aircraft list |
|
5112 | - * |
|
5113 | - */ |
|
5109 | + * Gets all aircraft registration that have flown over by ident/callsign |
|
5110 | + * |
|
5111 | + * @return Array the aircraft list |
|
5112 | + * |
|
5113 | + */ |
|
5114 | 5114 | public function countAllAircraftRegistrationByIdent($ident,$filters = array()) |
5115 | 5115 | { |
5116 | 5116 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5150,11 +5150,11 @@ discard block |
||
5150 | 5150 | |
5151 | 5151 | |
5152 | 5152 | /** |
5153 | - * Gets all aircraft manufacturer that have flown over by ident/callsign |
|
5154 | - * |
|
5155 | - * @return Array the aircraft manufacturer list |
|
5156 | - * |
|
5157 | - */ |
|
5153 | + * Gets all aircraft manufacturer that have flown over by ident/callsign |
|
5154 | + * |
|
5155 | + * @return Array the aircraft manufacturer list |
|
5156 | + * |
|
5157 | + */ |
|
5158 | 5158 | public function countAllAircraftManufacturerByIdent($ident,$filters = array()) |
5159 | 5159 | { |
5160 | 5160 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5180,11 +5180,11 @@ discard block |
||
5180 | 5180 | |
5181 | 5181 | |
5182 | 5182 | /** |
5183 | - * Gets all aircraft types that have flown over by route |
|
5184 | - * |
|
5185 | - * @return Array the aircraft list |
|
5186 | - * |
|
5187 | - */ |
|
5183 | + * Gets all aircraft types that have flown over by route |
|
5184 | + * |
|
5185 | + * @return Array the aircraft list |
|
5186 | + * |
|
5187 | + */ |
|
5188 | 5188 | public function countAllAircraftTypesByRoute($departure_airport_icao, $arrival_airport_icao,$filters = array()) |
5189 | 5189 | { |
5190 | 5190 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5213,11 +5213,11 @@ discard block |
||
5213 | 5213 | } |
5214 | 5214 | |
5215 | 5215 | /** |
5216 | - * Gets all aircraft registration that have flown over by route |
|
5217 | - * |
|
5218 | - * @return Array the aircraft list |
|
5219 | - * |
|
5220 | - */ |
|
5216 | + * Gets all aircraft registration that have flown over by route |
|
5217 | + * |
|
5218 | + * @return Array the aircraft list |
|
5219 | + * |
|
5220 | + */ |
|
5221 | 5221 | public function countAllAircraftRegistrationByRoute($departure_airport_icao, $arrival_airport_icao,$filters = array()) |
5222 | 5222 | { |
5223 | 5223 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5259,11 +5259,11 @@ discard block |
||
5259 | 5259 | |
5260 | 5260 | |
5261 | 5261 | /** |
5262 | - * Gets all aircraft manufacturer that have flown over by route |
|
5263 | - * |
|
5264 | - * @return Array the aircraft manufacturer list |
|
5265 | - * |
|
5266 | - */ |
|
5262 | + * Gets all aircraft manufacturer that have flown over by route |
|
5263 | + * |
|
5264 | + * @return Array the aircraft manufacturer list |
|
5265 | + * |
|
5266 | + */ |
|
5267 | 5267 | public function countAllAircraftManufacturerByRoute($departure_airport_icao, $arrival_airport_icao,$filters = array()) |
5268 | 5268 | { |
5269 | 5269 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5297,11 +5297,11 @@ discard block |
||
5297 | 5297 | |
5298 | 5298 | |
5299 | 5299 | /** |
5300 | - * Gets all aircraft types that have flown over by country |
|
5301 | - * |
|
5302 | - * @return Array the aircraft list |
|
5303 | - * |
|
5304 | - */ |
|
5300 | + * Gets all aircraft types that have flown over by country |
|
5301 | + * |
|
5302 | + * @return Array the aircraft list |
|
5303 | + * |
|
5304 | + */ |
|
5305 | 5305 | public function countAllAircraftTypesByCountry($country,$filters = array()) |
5306 | 5306 | { |
5307 | 5307 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5332,11 +5332,11 @@ discard block |
||
5332 | 5332 | |
5333 | 5333 | |
5334 | 5334 | /** |
5335 | - * Gets all aircraft registration that have flown over by country |
|
5336 | - * |
|
5337 | - * @return Array the aircraft list |
|
5338 | - * |
|
5339 | - */ |
|
5335 | + * Gets all aircraft registration that have flown over by country |
|
5336 | + * |
|
5337 | + * @return Array the aircraft list |
|
5338 | + * |
|
5339 | + */ |
|
5340 | 5340 | public function countAllAircraftRegistrationByCountry($country,$filters = array()) |
5341 | 5341 | { |
5342 | 5342 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5376,11 +5376,11 @@ discard block |
||
5376 | 5376 | |
5377 | 5377 | |
5378 | 5378 | /** |
5379 | - * Gets all aircraft manufacturer that have flown over by country |
|
5380 | - * |
|
5381 | - * @return Array the aircraft manufacturer list |
|
5382 | - * |
|
5383 | - */ |
|
5379 | + * Gets all aircraft manufacturer that have flown over by country |
|
5380 | + * |
|
5381 | + * @return Array the aircraft manufacturer list |
|
5382 | + * |
|
5383 | + */ |
|
5384 | 5384 | public function countAllAircraftManufacturerByCountry($country,$filters = array()) |
5385 | 5385 | { |
5386 | 5386 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5411,17 +5411,17 @@ discard block |
||
5411 | 5411 | |
5412 | 5412 | |
5413 | 5413 | /** |
5414 | - * Gets all aircraft manufacturers that have flown over |
|
5415 | - * |
|
5416 | - * @return Array the aircraft list |
|
5417 | - * |
|
5418 | - */ |
|
5414 | + * Gets all aircraft manufacturers that have flown over |
|
5415 | + * |
|
5416 | + * @return Array the aircraft list |
|
5417 | + * |
|
5418 | + */ |
|
5419 | 5419 | public function countAllAircraftManufacturers($filters = array()) |
5420 | 5420 | { |
5421 | 5421 | $filter_query = $this->getFilter($filters,true,true); |
5422 | 5422 | $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
5423 | 5423 | FROM spotter_output ".$filter_query." spotter_output.aircraft_manufacturer <> '' AND spotter_output.aircraft_manufacturer <> 'Not Available'"; |
5424 | - $query .= " GROUP BY spotter_output.aircraft_manufacturer |
|
5424 | + $query .= " GROUP BY spotter_output.aircraft_manufacturer |
|
5425 | 5425 | ORDER BY aircraft_manufacturer_count DESC |
5426 | 5426 | LIMIT 10"; |
5427 | 5427 | |
@@ -5446,11 +5446,11 @@ discard block |
||
5446 | 5446 | |
5447 | 5447 | |
5448 | 5448 | /** |
5449 | - * Gets all aircraft registrations that have flown over |
|
5450 | - * |
|
5451 | - * @return Array the aircraft list |
|
5452 | - * |
|
5453 | - */ |
|
5449 | + * Gets all aircraft registrations that have flown over |
|
5450 | + * |
|
5451 | + * @return Array the aircraft list |
|
5452 | + * |
|
5453 | + */ |
|
5454 | 5454 | public function countAllAircraftRegistrations($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array()) |
5455 | 5455 | { |
5456 | 5456 | global $globalDBdriver; |
@@ -5458,15 +5458,15 @@ discard block |
||
5458 | 5458 | $filter_query = $this->getFilter($filters,true,true); |
5459 | 5459 | $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 |
5460 | 5460 | FROM spotter_output ".$filter_query." spotter_output.registration <> '' AND spotter_output.registration <> 'NA'"; |
5461 | - if ($olderthanmonths > 0) { |
|
5462 | - if ($globalDBdriver == 'mysql') { |
|
5461 | + if ($olderthanmonths > 0) { |
|
5462 | + if ($globalDBdriver == 'mysql') { |
|
5463 | 5463 | $query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)'; |
5464 | 5464 | } else { |
5465 | 5465 | $query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
5466 | 5466 | } |
5467 | 5467 | } |
5468 | - if ($sincedate != '') { |
|
5469 | - if ($globalDBdriver == 'mysql') { |
|
5468 | + if ($sincedate != '') { |
|
5469 | + if ($globalDBdriver == 'mysql') { |
|
5470 | 5470 | $query .= " AND spotter_output.date > '".$sincedate."'"; |
5471 | 5471 | } else { |
5472 | 5472 | $query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -5475,7 +5475,7 @@ discard block |
||
5475 | 5475 | |
5476 | 5476 | // if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
5477 | 5477 | //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
5478 | - $query .= " GROUP BY spotter_output.registration, spotter_output.aircraft_icao, spotter_output.aircraft_name, spotter_output.airline_name ORDER BY aircraft_registration_count DESC"; |
|
5478 | + $query .= " GROUP BY spotter_output.registration, spotter_output.aircraft_icao, spotter_output.aircraft_name, spotter_output.airline_name ORDER BY aircraft_registration_count DESC"; |
|
5479 | 5479 | if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
5480 | 5480 | |
5481 | 5481 | $sth = $this->db->prepare($query); |
@@ -5506,11 +5506,11 @@ discard block |
||
5506 | 5506 | |
5507 | 5507 | |
5508 | 5508 | /** |
5509 | - * Gets all aircraft registrations that have flown over |
|
5510 | - * |
|
5511 | - * @return Array the aircraft list |
|
5512 | - * |
|
5513 | - */ |
|
5509 | + * Gets all aircraft registrations that have flown over |
|
5510 | + * |
|
5511 | + * @return Array the aircraft list |
|
5512 | + * |
|
5513 | + */ |
|
5514 | 5514 | public function countAllAircraftRegistrationsByAirlines($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array()) |
5515 | 5515 | { |
5516 | 5516 | global $globalDBdriver; |
@@ -5518,15 +5518,15 @@ discard block |
||
5518 | 5518 | $Image = new Image($this->db); |
5519 | 5519 | $query = "SELECT DISTINCT spotter_output.airline_icao, spotter_output.registration, COUNT(spotter_output.registration) AS aircraft_registration_count, spotter_output.aircraft_icao, spotter_output.aircraft_name, spotter_output.airline_name |
5520 | 5520 | FROM spotter_output".$filter_query." spotter_output.airline_icao <> '' AND spotter_output.registration <> '' AND spotter_output.registration <> 'NA' "; |
5521 | - if ($olderthanmonths > 0) { |
|
5522 | - if ($globalDBdriver == 'mysql') { |
|
5521 | + if ($olderthanmonths > 0) { |
|
5522 | + if ($globalDBdriver == 'mysql') { |
|
5523 | 5523 | $query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) '; |
5524 | 5524 | } else { |
5525 | 5525 | $query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
5526 | 5526 | } |
5527 | 5527 | } |
5528 | - if ($sincedate != '') { |
|
5529 | - if ($globalDBdriver == 'mysql') { |
|
5528 | + if ($sincedate != '') { |
|
5529 | + if ($globalDBdriver == 'mysql') { |
|
5530 | 5530 | $query .= "AND spotter_output.date > '".$sincedate."' "; |
5531 | 5531 | } else { |
5532 | 5532 | $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -5535,7 +5535,7 @@ discard block |
||
5535 | 5535 | |
5536 | 5536 | // if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
5537 | 5537 | //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
5538 | - $query .= "GROUP BY spotter_output.airline_icao, spotter_output.registration, spotter_output.aircraft_icao, spotter_output.aircraft_name, spotter_output.airline_name ORDER BY aircraft_registration_count DESC"; |
|
5538 | + $query .= "GROUP BY spotter_output.airline_icao, spotter_output.registration, spotter_output.aircraft_icao, spotter_output.aircraft_name, spotter_output.airline_name ORDER BY aircraft_registration_count DESC"; |
|
5539 | 5539 | if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
5540 | 5540 | |
5541 | 5541 | $sth = $this->db->prepare($query); |
@@ -5567,35 +5567,35 @@ discard block |
||
5567 | 5567 | |
5568 | 5568 | |
5569 | 5569 | /** |
5570 | - * Gets all departure airports of the airplanes that have flown over |
|
5571 | - * |
|
5572 | - * @return Array the airport list |
|
5573 | - * |
|
5574 | - */ |
|
5570 | + * Gets all departure airports of the airplanes that have flown over |
|
5571 | + * |
|
5572 | + * @return Array the airport list |
|
5573 | + * |
|
5574 | + */ |
|
5575 | 5575 | public function countAllDepartureAirports($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array()) |
5576 | 5576 | { |
5577 | 5577 | global $globalDBdriver; |
5578 | 5578 | $filter_query = $this->getFilter($filters,true,true); |
5579 | 5579 | $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 |
5580 | 5580 | FROM spotter_output".$filter_query." spotter_output.departure_airport_name <> '' AND spotter_output.departure_airport_icao <> 'NA'"; |
5581 | - if ($olderthanmonths > 0) { |
|
5582 | - if ($globalDBdriver == 'mysql') { |
|
5581 | + if ($olderthanmonths > 0) { |
|
5582 | + if ($globalDBdriver == 'mysql') { |
|
5583 | 5583 | $query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)'; |
5584 | 5584 | } else { |
5585 | 5585 | $query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
5586 | 5586 | } |
5587 | - } |
|
5588 | - if ($sincedate != '') { |
|
5589 | - if ($globalDBdriver == 'mysql') { |
|
5587 | + } |
|
5588 | + if ($sincedate != '') { |
|
5589 | + if ($globalDBdriver == 'mysql') { |
|
5590 | 5590 | $query .= " AND spotter_output.date > '".$sincedate."'"; |
5591 | 5591 | } else { |
5592 | 5592 | $query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
5593 | 5593 | } |
5594 | 5594 | } |
5595 | 5595 | |
5596 | - //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
5597 | - //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
5598 | - $query .= " GROUP BY spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country |
|
5596 | + //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
5597 | + //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
5598 | + $query .= " GROUP BY spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country |
|
5599 | 5599 | ORDER BY airport_departure_icao_count DESC"; |
5600 | 5600 | if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
5601 | 5601 | |
@@ -5619,35 +5619,35 @@ discard block |
||
5619 | 5619 | } |
5620 | 5620 | |
5621 | 5621 | /** |
5622 | - * Gets all departure airports of the airplanes that have flown over |
|
5623 | - * |
|
5624 | - * @return Array the airport list |
|
5625 | - * |
|
5626 | - */ |
|
5622 | + * Gets all departure airports of the airplanes that have flown over |
|
5623 | + * |
|
5624 | + * @return Array the airport list |
|
5625 | + * |
|
5626 | + */ |
|
5627 | 5627 | public function countAllDepartureAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array()) |
5628 | 5628 | { |
5629 | 5629 | global $globalDBdriver; |
5630 | 5630 | $filter_query = $this->getFilter($filters,true,true); |
5631 | 5631 | $query = "SELECT DISTINCT spotter_output.airline_icao, spotter_output.departure_airport_icao, COUNT(spotter_output.departure_airport_icao) AS airport_departure_icao_count, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country |
5632 | 5632 | FROM spotter_output".$filter_query." spotter_output.airline_icao <> '' AND spotter_output.departure_airport_name <> '' AND spotter_output.departure_airport_icao <> 'NA' "; |
5633 | - if ($olderthanmonths > 0) { |
|
5634 | - if ($globalDBdriver == 'mysql') { |
|
5633 | + if ($olderthanmonths > 0) { |
|
5634 | + if ($globalDBdriver == 'mysql') { |
|
5635 | 5635 | $query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) '; |
5636 | 5636 | } else { |
5637 | 5637 | $query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
5638 | 5638 | } |
5639 | - } |
|
5640 | - if ($sincedate != '') { |
|
5641 | - if ($globalDBdriver == 'mysql') { |
|
5639 | + } |
|
5640 | + if ($sincedate != '') { |
|
5641 | + if ($globalDBdriver == 'mysql') { |
|
5642 | 5642 | $query .= "AND spotter_output.date > '".$sincedate."' "; |
5643 | 5643 | } else { |
5644 | 5644 | $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
5645 | 5645 | } |
5646 | 5646 | } |
5647 | 5647 | |
5648 | - //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
5649 | - //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
5650 | - $query .= "GROUP BY spotter_output.airline_icao, spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country |
|
5648 | + //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
5649 | + //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
5650 | + $query .= "GROUP BY spotter_output.airline_icao, spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country |
|
5651 | 5651 | ORDER BY airport_departure_icao_count DESC"; |
5652 | 5652 | if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
5653 | 5653 | |
@@ -5672,37 +5672,37 @@ discard block |
||
5672 | 5672 | } |
5673 | 5673 | |
5674 | 5674 | /** |
5675 | - * Gets all detected departure airports of the airplanes that have flown over |
|
5676 | - * |
|
5677 | - * @return Array the airport list |
|
5678 | - * |
|
5679 | - */ |
|
5675 | + * Gets all detected departure airports of the airplanes that have flown over |
|
5676 | + * |
|
5677 | + * @return Array the airport list |
|
5678 | + * |
|
5679 | + */ |
|
5680 | 5680 | public function countAllDetectedDepartureAirports($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array()) |
5681 | 5681 | { |
5682 | 5682 | global $globalDBdriver; |
5683 | 5683 | $filter_query = $this->getFilter($filters,true,true); |
5684 | 5684 | $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 |
5685 | 5685 | FROM airport, spotter_output".$filter_query." spotter_output.real_departure_airport_icao <> '' AND spotter_output.real_departure_airport_icao <> 'NA' AND airport.icao = spotter_output.real_departure_airport_icao"; |
5686 | - if ($olderthanmonths > 0) { |
|
5687 | - if ($globalDBdriver == 'mysql') { |
|
5686 | + if ($olderthanmonths > 0) { |
|
5687 | + if ($globalDBdriver == 'mysql') { |
|
5688 | 5688 | $query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)'; |
5689 | 5689 | } else { |
5690 | 5690 | $query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
5691 | 5691 | } |
5692 | - } |
|
5693 | - if ($sincedate != '') { |
|
5694 | - if ($globalDBdriver == 'mysql') { |
|
5692 | + } |
|
5693 | + if ($sincedate != '') { |
|
5694 | + if ($globalDBdriver == 'mysql') { |
|
5695 | 5695 | $query .= " AND spotter_output.date > '".$sincedate."'"; |
5696 | 5696 | } else { |
5697 | 5697 | $query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
5698 | 5698 | } |
5699 | 5699 | } |
5700 | - //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
5701 | - //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
5702 | - $query .= " GROUP BY spotter_output.real_departure_airport_icao, airport.name, airport.city, airport.country |
|
5700 | + //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
5701 | + //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
5702 | + $query .= " GROUP BY spotter_output.real_departure_airport_icao, airport.name, airport.city, airport.country |
|
5703 | 5703 | ORDER BY airport_departure_icao_count DESC"; |
5704 | 5704 | if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
5705 | - //echo $query; |
|
5705 | + //echo $query; |
|
5706 | 5706 | $sth = $this->db->prepare($query); |
5707 | 5707 | $sth->execute(); |
5708 | 5708 | |
@@ -5723,35 +5723,35 @@ discard block |
||
5723 | 5723 | } |
5724 | 5724 | |
5725 | 5725 | /** |
5726 | - * Gets all detected departure airports of the airplanes that have flown over |
|
5727 | - * |
|
5728 | - * @return Array the airport list |
|
5729 | - * |
|
5730 | - */ |
|
5726 | + * Gets all detected departure airports of the airplanes that have flown over |
|
5727 | + * |
|
5728 | + * @return Array the airport list |
|
5729 | + * |
|
5730 | + */ |
|
5731 | 5731 | public function countAllDetectedDepartureAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array()) |
5732 | 5732 | { |
5733 | 5733 | global $globalDBdriver; |
5734 | 5734 | $filter_query = $this->getFilter($filters,true,true); |
5735 | 5735 | $query = "SELECT DISTINCT spotter_output.airline_icao, spotter_output.real_departure_airport_icao AS departure_airport_icao, COUNT(spotter_output.real_departure_airport_icao) AS airport_departure_icao_count, airport.name as departure_airport_name, airport.city as departure_airport_city, airport.country as departure_airport_country |
5736 | 5736 | FROM airport, spotter_output".$filter_query." spotter_output.airline_icao <> '' AND spotter_output.real_departure_airport_icao <> '' AND spotter_output.real_departure_airport_icao <> 'NA' AND airport.icao = spotter_output.real_departure_airport_icao "; |
5737 | - if ($olderthanmonths > 0) { |
|
5738 | - if ($globalDBdriver == 'mysql') { |
|
5737 | + if ($olderthanmonths > 0) { |
|
5738 | + if ($globalDBdriver == 'mysql') { |
|
5739 | 5739 | $query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) '; |
5740 | 5740 | } else { |
5741 | 5741 | $query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
5742 | 5742 | } |
5743 | - } |
|
5744 | - if ($sincedate != '') { |
|
5745 | - if ($globalDBdriver == 'mysql') { |
|
5743 | + } |
|
5744 | + if ($sincedate != '') { |
|
5745 | + if ($globalDBdriver == 'mysql') { |
|
5746 | 5746 | $query .= "AND spotter_output.date > '".$sincedate."' "; |
5747 | 5747 | } else { |
5748 | 5748 | $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP) "; |
5749 | 5749 | } |
5750 | 5750 | } |
5751 | 5751 | |
5752 | - //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
5753 | - //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
5754 | - $query .= "GROUP BY spotter_output.airline_icao, spotter_output.real_departure_airport_icao, airport.name, airport.city, airport.country |
|
5752 | + //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
5753 | + //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
5754 | + $query .= "GROUP BY spotter_output.airline_icao, spotter_output.real_departure_airport_icao, airport.name, airport.city, airport.country |
|
5755 | 5755 | ORDER BY airport_departure_icao_count DESC"; |
5756 | 5756 | if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
5757 | 5757 | |
@@ -5776,11 +5776,11 @@ discard block |
||
5776 | 5776 | } |
5777 | 5777 | |
5778 | 5778 | /** |
5779 | - * Gets all departure airports of the airplanes that have flown over based on an airline icao |
|
5780 | - * |
|
5781 | - * @return Array the airport list |
|
5782 | - * |
|
5783 | - */ |
|
5779 | + * Gets all departure airports of the airplanes that have flown over based on an airline icao |
|
5780 | + * |
|
5781 | + * @return Array the airport list |
|
5782 | + * |
|
5783 | + */ |
|
5784 | 5784 | public function countAllDepartureAirportsByAirline($airline_icao,$filters = array()) |
5785 | 5785 | { |
5786 | 5786 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5814,11 +5814,11 @@ discard block |
||
5814 | 5814 | |
5815 | 5815 | |
5816 | 5816 | /** |
5817 | - * Gets all departure airports by country of the airplanes that have flown over based on an airline icao |
|
5818 | - * |
|
5819 | - * @return Array the airport list |
|
5820 | - * |
|
5821 | - */ |
|
5817 | + * Gets all departure airports by country of the airplanes that have flown over based on an airline icao |
|
5818 | + * |
|
5819 | + * @return Array the airport list |
|
5820 | + * |
|
5821 | + */ |
|
5822 | 5822 | public function countAllDepartureAirportCountriesByAirline($airline_icao,$filters = array()) |
5823 | 5823 | { |
5824 | 5824 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5849,11 +5849,11 @@ discard block |
||
5849 | 5849 | |
5850 | 5850 | |
5851 | 5851 | /** |
5852 | - * Gets all departure airports of the airplanes that have flown over based on an aircraft icao |
|
5853 | - * |
|
5854 | - * @return Array the airport list |
|
5855 | - * |
|
5856 | - */ |
|
5852 | + * Gets all departure airports of the airplanes that have flown over based on an aircraft icao |
|
5853 | + * |
|
5854 | + * @return Array the airport list |
|
5855 | + * |
|
5856 | + */ |
|
5857 | 5857 | public function countAllDepartureAirportsByAircraft($aircraft_icao,$filters = array()) |
5858 | 5858 | { |
5859 | 5859 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5886,11 +5886,11 @@ discard block |
||
5886 | 5886 | |
5887 | 5887 | |
5888 | 5888 | /** |
5889 | - * Gets all departure airports by country of the airplanes that have flown over based on an aircraft icao |
|
5890 | - * |
|
5891 | - * @return Array the airport list |
|
5892 | - * |
|
5893 | - */ |
|
5889 | + * Gets all departure airports by country of the airplanes that have flown over based on an aircraft icao |
|
5890 | + * |
|
5891 | + * @return Array the airport list |
|
5892 | + * |
|
5893 | + */ |
|
5894 | 5894 | public function countAllDepartureAirportCountriesByAircraft($aircraft_icao,$filters = array()) |
5895 | 5895 | { |
5896 | 5896 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5920,11 +5920,11 @@ discard block |
||
5920 | 5920 | |
5921 | 5921 | |
5922 | 5922 | /** |
5923 | - * Gets all departure airports of the airplanes that have flown over based on an aircraft registration |
|
5924 | - * |
|
5925 | - * @return Array the airport list |
|
5926 | - * |
|
5927 | - */ |
|
5923 | + * Gets all departure airports of the airplanes that have flown over based on an aircraft registration |
|
5924 | + * |
|
5925 | + * @return Array the airport list |
|
5926 | + * |
|
5927 | + */ |
|
5928 | 5928 | public function countAllDepartureAirportsByRegistration($registration,$filters = array()) |
5929 | 5929 | { |
5930 | 5930 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5957,11 +5957,11 @@ discard block |
||
5957 | 5957 | |
5958 | 5958 | |
5959 | 5959 | /** |
5960 | - * Gets all departure airports by country of the airplanes that have flown over based on an aircraft registration |
|
5961 | - * |
|
5962 | - * @return Array the airport list |
|
5963 | - * |
|
5964 | - */ |
|
5960 | + * Gets all departure airports by country of the airplanes that have flown over based on an aircraft registration |
|
5961 | + * |
|
5962 | + * @return Array the airport list |
|
5963 | + * |
|
5964 | + */ |
|
5965 | 5965 | public function countAllDepartureAirportCountriesByRegistration($registration,$filters = array()) |
5966 | 5966 | { |
5967 | 5967 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5991,11 +5991,11 @@ discard block |
||
5991 | 5991 | |
5992 | 5992 | |
5993 | 5993 | /** |
5994 | - * Gets all departure airports of the airplanes that have flown over based on an arrivl airport icao |
|
5995 | - * |
|
5996 | - * @return Array the airport list |
|
5997 | - * |
|
5998 | - */ |
|
5994 | + * Gets all departure airports of the airplanes that have flown over based on an arrivl airport icao |
|
5995 | + * |
|
5996 | + * @return Array the airport list |
|
5997 | + * |
|
5998 | + */ |
|
5999 | 5999 | public function countAllDepartureAirportsByAirport($airport_icao,$filters = array()) |
6000 | 6000 | { |
6001 | 6001 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6028,11 +6028,11 @@ discard block |
||
6028 | 6028 | |
6029 | 6029 | |
6030 | 6030 | /** |
6031 | - * Gets all departure airports by country of the airplanes that have flown over based on an airport icao |
|
6032 | - * |
|
6033 | - * @return Array the airport list |
|
6034 | - * |
|
6035 | - */ |
|
6031 | + * Gets all departure airports by country of the airplanes that have flown over based on an airport icao |
|
6032 | + * |
|
6033 | + * @return Array the airport list |
|
6034 | + * |
|
6035 | + */ |
|
6036 | 6036 | public function countAllDepartureAirportCountriesByAirport($airport_icao,$filters = array()) |
6037 | 6037 | { |
6038 | 6038 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6063,11 +6063,11 @@ discard block |
||
6063 | 6063 | |
6064 | 6064 | |
6065 | 6065 | /** |
6066 | - * Gets all departure airports of the airplanes that have flown over based on an aircraft manufacturer |
|
6067 | - * |
|
6068 | - * @return Array the airport list |
|
6069 | - * |
|
6070 | - */ |
|
6066 | + * Gets all departure airports of the airplanes that have flown over based on an aircraft manufacturer |
|
6067 | + * |
|
6068 | + * @return Array the airport list |
|
6069 | + * |
|
6070 | + */ |
|
6071 | 6071 | public function countAllDepartureAirportsByManufacturer($aircraft_manufacturer,$filters = array()) |
6072 | 6072 | { |
6073 | 6073 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6100,11 +6100,11 @@ discard block |
||
6100 | 6100 | |
6101 | 6101 | |
6102 | 6102 | /** |
6103 | - * Gets all departure airports by country of the airplanes that have flown over based on an aircraft manufacturer |
|
6104 | - * |
|
6105 | - * @return Array the airport list |
|
6106 | - * |
|
6107 | - */ |
|
6103 | + * Gets all departure airports by country of the airplanes that have flown over based on an aircraft manufacturer |
|
6104 | + * |
|
6105 | + * @return Array the airport list |
|
6106 | + * |
|
6107 | + */ |
|
6108 | 6108 | public function countAllDepartureAirportCountriesByManufacturer($aircraft_manufacturer,$filters = array()) |
6109 | 6109 | { |
6110 | 6110 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6134,11 +6134,11 @@ discard block |
||
6134 | 6134 | |
6135 | 6135 | |
6136 | 6136 | /** |
6137 | - * Gets all departure airports of the airplanes that have flown over based on a date |
|
6138 | - * |
|
6139 | - * @return Array the airport list |
|
6140 | - * |
|
6141 | - */ |
|
6137 | + * Gets all departure airports of the airplanes that have flown over based on a date |
|
6138 | + * |
|
6139 | + * @return Array the airport list |
|
6140 | + * |
|
6141 | + */ |
|
6142 | 6142 | public function countAllDepartureAirportsByDate($date,$filters = array()) |
6143 | 6143 | { |
6144 | 6144 | global $globalTimezone, $globalDBdriver; |
@@ -6184,11 +6184,11 @@ discard block |
||
6184 | 6184 | |
6185 | 6185 | |
6186 | 6186 | /** |
6187 | - * Gets all departure airports by country of the airplanes that have flown over based on a date |
|
6188 | - * |
|
6189 | - * @return Array the airport list |
|
6190 | - * |
|
6191 | - */ |
|
6187 | + * Gets all departure airports by country of the airplanes that have flown over based on a date |
|
6188 | + * |
|
6189 | + * @return Array the airport list |
|
6190 | + * |
|
6191 | + */ |
|
6192 | 6192 | public function countAllDepartureAirportCountriesByDate($date,$filters = array()) |
6193 | 6193 | { |
6194 | 6194 | global $globalTimezone, $globalDBdriver; |
@@ -6231,11 +6231,11 @@ discard block |
||
6231 | 6231 | |
6232 | 6232 | |
6233 | 6233 | /** |
6234 | - * Gets all departure airports of the airplanes that have flown over based on a ident/callsign |
|
6235 | - * |
|
6236 | - * @return Array the airport list |
|
6237 | - * |
|
6238 | - */ |
|
6234 | + * Gets all departure airports of the airplanes that have flown over based on a ident/callsign |
|
6235 | + * |
|
6236 | + * @return Array the airport list |
|
6237 | + * |
|
6238 | + */ |
|
6239 | 6239 | public function countAllDepartureAirportsByIdent($ident,$filters = array()) |
6240 | 6240 | { |
6241 | 6241 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6269,11 +6269,11 @@ discard block |
||
6269 | 6269 | |
6270 | 6270 | |
6271 | 6271 | /** |
6272 | - * Gets all departure airports by country of the airplanes that have flown over based on a callsign/ident |
|
6273 | - * |
|
6274 | - * @return Array the airport list |
|
6275 | - * |
|
6276 | - */ |
|
6272 | + * Gets all departure airports by country of the airplanes that have flown over based on a callsign/ident |
|
6273 | + * |
|
6274 | + * @return Array the airport list |
|
6275 | + * |
|
6276 | + */ |
|
6277 | 6277 | public function countAllDepartureAirportCountriesByIdent($ident,$filters = array()) |
6278 | 6278 | { |
6279 | 6279 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6304,11 +6304,11 @@ discard block |
||
6304 | 6304 | |
6305 | 6305 | |
6306 | 6306 | /** |
6307 | - * Gets all departure airports of the airplanes that have flown over based on a country |
|
6308 | - * |
|
6309 | - * @return Array the airport list |
|
6310 | - * |
|
6311 | - */ |
|
6307 | + * Gets all departure airports of the airplanes that have flown over based on a country |
|
6308 | + * |
|
6309 | + * @return Array the airport list |
|
6310 | + * |
|
6311 | + */ |
|
6312 | 6312 | public function countAllDepartureAirportsByCountry($country,$filters = array()) |
6313 | 6313 | { |
6314 | 6314 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6342,11 +6342,11 @@ discard block |
||
6342 | 6342 | |
6343 | 6343 | |
6344 | 6344 | /** |
6345 | - * Gets all departure airports by country of the airplanes that have flown over based on an aircraft icao |
|
6346 | - * |
|
6347 | - * @return Array the airport list |
|
6348 | - * |
|
6349 | - */ |
|
6345 | + * Gets all departure airports by country of the airplanes that have flown over based on an aircraft icao |
|
6346 | + * |
|
6347 | + * @return Array the airport list |
|
6348 | + * |
|
6349 | + */ |
|
6350 | 6350 | public function countAllDepartureAirportCountriesByCountry($country,$filters = array()) |
6351 | 6351 | { |
6352 | 6352 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6376,40 +6376,40 @@ discard block |
||
6376 | 6376 | |
6377 | 6377 | |
6378 | 6378 | /** |
6379 | - * Gets all arrival airports of the airplanes that have flown over |
|
6380 | - * |
|
6381 | - * @return Array the airport list |
|
6382 | - * |
|
6383 | - */ |
|
6379 | + * Gets all arrival airports of the airplanes that have flown over |
|
6380 | + * |
|
6381 | + * @return Array the airport list |
|
6382 | + * |
|
6383 | + */ |
|
6384 | 6384 | public function countAllArrivalAirports($limit = true, $olderthanmonths = 0, $sincedate = '', $icaoaskey = false,$filters = array()) |
6385 | 6385 | { |
6386 | 6386 | global $globalDBdriver; |
6387 | 6387 | $filter_query = $this->getFilter($filters,true,true); |
6388 | 6388 | $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 |
6389 | 6389 | FROM spotter_output".$filter_query." spotter_output.arrival_airport_name <> '' AND spotter_output.arrival_airport_icao <> 'NA'"; |
6390 | - if ($olderthanmonths > 0) { |
|
6391 | - if ($globalDBdriver == 'mysql') { |
|
6390 | + if ($olderthanmonths > 0) { |
|
6391 | + if ($globalDBdriver == 'mysql') { |
|
6392 | 6392 | $query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)'; |
6393 | 6393 | } else { |
6394 | 6394 | $query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
6395 | 6395 | } |
6396 | - if ($sincedate != '') { |
|
6397 | - if ($globalDBdriver == 'mysql') { |
|
6396 | + if ($sincedate != '') { |
|
6397 | + if ($globalDBdriver == 'mysql') { |
|
6398 | 6398 | $query .= " AND spotter_output.date > '".$sincedate."'"; |
6399 | 6399 | } else { |
6400 | 6400 | $query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
6401 | 6401 | } |
6402 | 6402 | } |
6403 | - if ($globalDBdriver == 'mysql') { |
|
6403 | + if ($globalDBdriver == 'mysql') { |
|
6404 | 6404 | $query .= " AND spotter_output.date > '".$sincedate."'"; |
6405 | 6405 | } else { |
6406 | 6406 | $query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
6407 | 6407 | } |
6408 | 6408 | } |
6409 | 6409 | |
6410 | - //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
6411 | - //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
6412 | - $query .= " GROUP BY spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
|
6410 | + //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
6411 | + //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
6412 | + $query .= " GROUP BY spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
|
6413 | 6413 | ORDER BY airport_arrival_icao_count DESC"; |
6414 | 6414 | if ($limit) $query .= " LIMIT 10"; |
6415 | 6415 | |
@@ -6438,40 +6438,40 @@ discard block |
||
6438 | 6438 | } |
6439 | 6439 | |
6440 | 6440 | /** |
6441 | - * Gets all arrival airports of the airplanes that have flown over |
|
6442 | - * |
|
6443 | - * @return Array the airport list |
|
6444 | - * |
|
6445 | - */ |
|
6441 | + * Gets all arrival airports of the airplanes that have flown over |
|
6442 | + * |
|
6443 | + * @return Array the airport list |
|
6444 | + * |
|
6445 | + */ |
|
6446 | 6446 | public function countAllArrivalAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '', $icaoaskey = false,$filters = array()) |
6447 | 6447 | { |
6448 | 6448 | global $globalDBdriver; |
6449 | 6449 | $filter_query = $this->getFilter($filters,true,true); |
6450 | 6450 | $query = "SELECT DISTINCT spotter_output.airline_icao, spotter_output.arrival_airport_icao, COUNT(spotter_output.arrival_airport_icao) AS airport_arrival_icao_count, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
6451 | 6451 | FROM spotter_output".$filter_query." spotter_output.airline_icao <> '' AND spotter_output.arrival_airport_name <> '' AND spotter_output.arrival_airport_icao <> 'NA' "; |
6452 | - if ($olderthanmonths > 0) { |
|
6453 | - if ($globalDBdriver == 'mysql') { |
|
6452 | + if ($olderthanmonths > 0) { |
|
6453 | + if ($globalDBdriver == 'mysql') { |
|
6454 | 6454 | $query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) '; |
6455 | 6455 | } else { |
6456 | 6456 | $query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
6457 | 6457 | } |
6458 | - if ($sincedate != '') { |
|
6459 | - if ($globalDBdriver == 'mysql') { |
|
6458 | + if ($sincedate != '') { |
|
6459 | + if ($globalDBdriver == 'mysql') { |
|
6460 | 6460 | $query .= "AND spotter_output.date > '".$sincedate."' "; |
6461 | 6461 | } else { |
6462 | 6462 | $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
6463 | 6463 | } |
6464 | 6464 | } |
6465 | - if ($globalDBdriver == 'mysql') { |
|
6465 | + if ($globalDBdriver == 'mysql') { |
|
6466 | 6466 | $query .= "AND spotter_output.date > '".$sincedate."' "; |
6467 | 6467 | } else { |
6468 | 6468 | $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
6469 | 6469 | } |
6470 | 6470 | } |
6471 | 6471 | |
6472 | - //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
6473 | - //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
6474 | - $query .= "GROUP BY spotter_output.airline_icao,spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
|
6472 | + //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
6473 | + //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
6474 | + $query .= "GROUP BY spotter_output.airline_icao,spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
|
6475 | 6475 | ORDER BY airport_arrival_icao_count DESC"; |
6476 | 6476 | if ($limit) $query .= " LIMIT 10"; |
6477 | 6477 | |
@@ -6502,39 +6502,39 @@ discard block |
||
6502 | 6502 | |
6503 | 6503 | |
6504 | 6504 | /** |
6505 | - * Gets all detected arrival airports of the airplanes that have flown over |
|
6506 | - * |
|
6507 | - * @return Array the airport list |
|
6508 | - * |
|
6509 | - */ |
|
6505 | + * Gets all detected arrival airports of the airplanes that have flown over |
|
6506 | + * |
|
6507 | + * @return Array the airport list |
|
6508 | + * |
|
6509 | + */ |
|
6510 | 6510 | public function countAllDetectedArrivalAirports($limit = true, $olderthanmonths = 0, $sincedate = '',$icaoaskey = false,$filters = array()) |
6511 | 6511 | { |
6512 | 6512 | global $globalDBdriver; |
6513 | 6513 | $filter_query = $this->getFilter($filters,true,true); |
6514 | 6514 | $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 |
6515 | 6515 | FROM airport,spotter_output".$filter_query." spotter_output.real_arrival_airport_icao <> '' AND spotter_output.real_arrival_airport_icao <> 'NA' AND airport.icao = spotter_output.real_arrival_airport_icao"; |
6516 | - if ($olderthanmonths > 0) { |
|
6517 | - if ($globalDBdriver == 'mysql') { |
|
6516 | + if ($olderthanmonths > 0) { |
|
6517 | + if ($globalDBdriver == 'mysql') { |
|
6518 | 6518 | $query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)'; |
6519 | 6519 | } else { |
6520 | 6520 | $query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
6521 | 6521 | } |
6522 | - if ($sincedate != '') { |
|
6523 | - if ($globalDBdriver == 'mysql') { |
|
6522 | + if ($sincedate != '') { |
|
6523 | + if ($globalDBdriver == 'mysql') { |
|
6524 | 6524 | $query .= " AND spotter_output.date > '".$sincedate."'"; |
6525 | 6525 | } else { |
6526 | 6526 | $query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
6527 | 6527 | } |
6528 | 6528 | } |
6529 | - if ($globalDBdriver == 'mysql') { |
|
6529 | + if ($globalDBdriver == 'mysql') { |
|
6530 | 6530 | $query .= " AND spotter_output.date > '".$sincedate."'"; |
6531 | 6531 | } else { |
6532 | 6532 | $query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
6533 | 6533 | } |
6534 | 6534 | } |
6535 | - //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
6536 | - //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
6537 | - $query .= " GROUP BY spotter_output.real_arrival_airport_icao, airport.name, airport.city, airport.country |
|
6535 | + //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
6536 | + //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
6537 | + $query .= " GROUP BY spotter_output.real_arrival_airport_icao, airport.name, airport.city, airport.country |
|
6538 | 6538 | ORDER BY airport_arrival_icao_count DESC"; |
6539 | 6539 | if ($limit) $query .= " LIMIT 10"; |
6540 | 6540 | |
@@ -6563,40 +6563,40 @@ discard block |
||
6563 | 6563 | } |
6564 | 6564 | |
6565 | 6565 | /** |
6566 | - * Gets all detected arrival airports of the airplanes that have flown over |
|
6567 | - * |
|
6568 | - * @return Array the airport list |
|
6569 | - * |
|
6570 | - */ |
|
6566 | + * Gets all detected arrival airports of the airplanes that have flown over |
|
6567 | + * |
|
6568 | + * @return Array the airport list |
|
6569 | + * |
|
6570 | + */ |
|
6571 | 6571 | public function countAllDetectedArrivalAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '',$icaoaskey = false,$filters = array()) |
6572 | 6572 | { |
6573 | 6573 | global $globalDBdriver; |
6574 | 6574 | $filter_query = $this->getFilter($filters,true,true); |
6575 | 6575 | $query = "SELECT DISTINCT spotter_output.airline_icao, spotter_output.real_arrival_airport_icao as arrival_airport_icao, COUNT(spotter_output.real_arrival_airport_icao) AS airport_arrival_icao_count, airport.name AS arrival_airport_name, airport.city AS arrival_airport_city, airport.country AS arrival_airport_country |
6576 | 6576 | FROM airport,spotter_output".$filter_query." spotter_output.airline_icao <> '' AND spotter_output.real_arrival_airport_icao <> '' AND spotter_output.real_arrival_airport_icao <> 'NA' AND airport.icao = spotter_output.real_arrival_airport_icao "; |
6577 | - if ($olderthanmonths > 0) { |
|
6578 | - if ($globalDBdriver == 'mysql') { |
|
6577 | + if ($olderthanmonths > 0) { |
|
6578 | + if ($globalDBdriver == 'mysql') { |
|
6579 | 6579 | $query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) '; |
6580 | 6580 | } else { |
6581 | 6581 | $query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
6582 | 6582 | } |
6583 | - if ($sincedate != '') { |
|
6584 | - if ($globalDBdriver == 'mysql') { |
|
6583 | + if ($sincedate != '') { |
|
6584 | + if ($globalDBdriver == 'mysql') { |
|
6585 | 6585 | $query .= "AND spotter_output.date > '".$sincedate."' "; |
6586 | 6586 | } else { |
6587 | 6587 | $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
6588 | 6588 | } |
6589 | 6589 | } |
6590 | - if ($globalDBdriver == 'mysql') { |
|
6590 | + if ($globalDBdriver == 'mysql') { |
|
6591 | 6591 | $query .= "AND spotter_output.date > '".$sincedate."' "; |
6592 | 6592 | } else { |
6593 | 6593 | $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
6594 | 6594 | } |
6595 | 6595 | } |
6596 | 6596 | |
6597 | - //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
6598 | - //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
6599 | - $query .= "GROUP BY spotter_output.airline_icao, spotter_output.real_arrival_airport_icao, airport.name, airport.city, airport.country |
|
6597 | + //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
6598 | + //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
6599 | + $query .= "GROUP BY spotter_output.airline_icao, spotter_output.real_arrival_airport_icao, airport.name, airport.city, airport.country |
|
6600 | 6600 | ORDER BY airport_arrival_icao_count DESC"; |
6601 | 6601 | if ($limit) $query .= " LIMIT 10"; |
6602 | 6602 | |
@@ -6626,11 +6626,11 @@ discard block |
||
6626 | 6626 | } |
6627 | 6627 | |
6628 | 6628 | /** |
6629 | - * Gets all arrival airports of the airplanes that have flown over based on an airline icao |
|
6630 | - * |
|
6631 | - * @return Array the airport list |
|
6632 | - * |
|
6633 | - */ |
|
6629 | + * Gets all arrival airports of the airplanes that have flown over based on an airline icao |
|
6630 | + * |
|
6631 | + * @return Array the airport list |
|
6632 | + * |
|
6633 | + */ |
|
6634 | 6634 | public function countAllArrivalAirportsByAirline($airline_icao, $filters = array()) |
6635 | 6635 | { |
6636 | 6636 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6662,11 +6662,11 @@ discard block |
||
6662 | 6662 | |
6663 | 6663 | |
6664 | 6664 | /** |
6665 | - * Gets all arrival airports by country of the airplanes that have flown over based on an airline icao |
|
6666 | - * |
|
6667 | - * @return Array the airport list |
|
6668 | - * |
|
6669 | - */ |
|
6665 | + * Gets all arrival airports by country of the airplanes that have flown over based on an airline icao |
|
6666 | + * |
|
6667 | + * @return Array the airport list |
|
6668 | + * |
|
6669 | + */ |
|
6670 | 6670 | public function countAllArrivalAirportCountriesByAirline($airline_icao,$filters = array()) |
6671 | 6671 | { |
6672 | 6672 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6697,11 +6697,11 @@ discard block |
||
6697 | 6697 | |
6698 | 6698 | |
6699 | 6699 | /** |
6700 | - * Gets all arrival airports of the airplanes that have flown over based on an aircraft icao |
|
6701 | - * |
|
6702 | - * @return Array the airport list |
|
6703 | - * |
|
6704 | - */ |
|
6700 | + * Gets all arrival airports of the airplanes that have flown over based on an aircraft icao |
|
6701 | + * |
|
6702 | + * @return Array the airport list |
|
6703 | + * |
|
6704 | + */ |
|
6705 | 6705 | public function countAllArrivalAirportsByAircraft($aircraft_icao,$filters = array()) |
6706 | 6706 | { |
6707 | 6707 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6735,11 +6735,11 @@ discard block |
||
6735 | 6735 | |
6736 | 6736 | |
6737 | 6737 | /** |
6738 | - * Gets all arrival airports by country of the airplanes that have flown over based on an aircraft icao |
|
6739 | - * |
|
6740 | - * @return Array the airport list |
|
6741 | - * |
|
6742 | - */ |
|
6738 | + * Gets all arrival airports by country of the airplanes that have flown over based on an aircraft icao |
|
6739 | + * |
|
6740 | + * @return Array the airport list |
|
6741 | + * |
|
6742 | + */ |
|
6743 | 6743 | public function countAllArrivalAirportCountriesByAircraft($aircraft_icao,$filters = array()) |
6744 | 6744 | { |
6745 | 6745 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6769,11 +6769,11 @@ discard block |
||
6769 | 6769 | |
6770 | 6770 | |
6771 | 6771 | /** |
6772 | - * Gets all arrival airports of the airplanes that have flown over based on an aircraft registration |
|
6773 | - * |
|
6774 | - * @return Array the airport list |
|
6775 | - * |
|
6776 | - */ |
|
6772 | + * Gets all arrival airports of the airplanes that have flown over based on an aircraft registration |
|
6773 | + * |
|
6774 | + * @return Array the airport list |
|
6775 | + * |
|
6776 | + */ |
|
6777 | 6777 | public function countAllArrivalAirportsByRegistration($registration,$filters = array()) |
6778 | 6778 | { |
6779 | 6779 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6807,11 +6807,11 @@ discard block |
||
6807 | 6807 | |
6808 | 6808 | |
6809 | 6809 | /** |
6810 | - * Gets all arrival airports by country of the airplanes that have flown over based on an aircraft registration |
|
6811 | - * |
|
6812 | - * @return Array the airport list |
|
6813 | - * |
|
6814 | - */ |
|
6810 | + * Gets all arrival airports by country of the airplanes that have flown over based on an aircraft registration |
|
6811 | + * |
|
6812 | + * @return Array the airport list |
|
6813 | + * |
|
6814 | + */ |
|
6815 | 6815 | public function countAllArrivalAirportCountriesByRegistration($registration,$filters = array()) |
6816 | 6816 | { |
6817 | 6817 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6842,11 +6842,11 @@ discard block |
||
6842 | 6842 | |
6843 | 6843 | |
6844 | 6844 | /** |
6845 | - * Gets all arrival airports of the airplanes that have flown over based on an departure airport |
|
6846 | - * |
|
6847 | - * @return Array the airport list |
|
6848 | - * |
|
6849 | - */ |
|
6845 | + * Gets all arrival airports of the airplanes that have flown over based on an departure airport |
|
6846 | + * |
|
6847 | + * @return Array the airport list |
|
6848 | + * |
|
6849 | + */ |
|
6850 | 6850 | public function countAllArrivalAirportsByAirport($airport_icao,$filters = array()) |
6851 | 6851 | { |
6852 | 6852 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6879,11 +6879,11 @@ discard block |
||
6879 | 6879 | |
6880 | 6880 | |
6881 | 6881 | /** |
6882 | - * Gets all arrival airports by country of the airplanes that have flown over based on an airport icao |
|
6883 | - * |
|
6884 | - * @return Array the airport list |
|
6885 | - * |
|
6886 | - */ |
|
6882 | + * Gets all arrival airports by country of the airplanes that have flown over based on an airport icao |
|
6883 | + * |
|
6884 | + * @return Array the airport list |
|
6885 | + * |
|
6886 | + */ |
|
6887 | 6887 | public function countAllArrivalAirportCountriesByAirport($airport_icao,$filters = array()) |
6888 | 6888 | { |
6889 | 6889 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6913,11 +6913,11 @@ discard block |
||
6913 | 6913 | |
6914 | 6914 | |
6915 | 6915 | /** |
6916 | - * Gets all arrival airports of the airplanes that have flown over based on a aircraft manufacturer |
|
6917 | - * |
|
6918 | - * @return Array the airport list |
|
6919 | - * |
|
6920 | - */ |
|
6916 | + * Gets all arrival airports of the airplanes that have flown over based on a aircraft manufacturer |
|
6917 | + * |
|
6918 | + * @return Array the airport list |
|
6919 | + * |
|
6920 | + */ |
|
6921 | 6921 | public function countAllArrivalAirportsByManufacturer($aircraft_manufacturer,$filters = array()) |
6922 | 6922 | { |
6923 | 6923 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6951,11 +6951,11 @@ discard block |
||
6951 | 6951 | |
6952 | 6952 | |
6953 | 6953 | /** |
6954 | - * Gets all arrival airports by country of the airplanes that have flown over based on a aircraft manufacturer |
|
6955 | - * |
|
6956 | - * @return Array the airport list |
|
6957 | - * |
|
6958 | - */ |
|
6954 | + * Gets all arrival airports by country of the airplanes that have flown over based on a aircraft manufacturer |
|
6955 | + * |
|
6956 | + * @return Array the airport list |
|
6957 | + * |
|
6958 | + */ |
|
6959 | 6959 | public function countAllArrivalAirportCountriesByManufacturer($aircraft_manufacturer,$filters = array()) |
6960 | 6960 | { |
6961 | 6961 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6986,11 +6986,11 @@ discard block |
||
6986 | 6986 | |
6987 | 6987 | |
6988 | 6988 | /** |
6989 | - * Gets all arrival airports of the airplanes that have flown over based on a date |
|
6990 | - * |
|
6991 | - * @return Array the airport list |
|
6992 | - * |
|
6993 | - */ |
|
6989 | + * Gets all arrival airports of the airplanes that have flown over based on a date |
|
6990 | + * |
|
6991 | + * @return Array the airport list |
|
6992 | + * |
|
6993 | + */ |
|
6994 | 6994 | public function countAllArrivalAirportsByDate($date,$filters = array()) |
6995 | 6995 | { |
6996 | 6996 | global $globalTimezone, $globalDBdriver; |
@@ -7036,11 +7036,11 @@ discard block |
||
7036 | 7036 | |
7037 | 7037 | |
7038 | 7038 | /** |
7039 | - * Gets all arrival airports by country of the airplanes that have flown over based on a date |
|
7040 | - * |
|
7041 | - * @return Array the airport list |
|
7042 | - * |
|
7043 | - */ |
|
7039 | + * Gets all arrival airports by country of the airplanes that have flown over based on a date |
|
7040 | + * |
|
7041 | + * @return Array the airport list |
|
7042 | + * |
|
7043 | + */ |
|
7044 | 7044 | public function countAllArrivalAirportCountriesByDate($date, $filters = array()) |
7045 | 7045 | { |
7046 | 7046 | global $globalTimezone, $globalDBdriver; |
@@ -7083,11 +7083,11 @@ discard block |
||
7083 | 7083 | |
7084 | 7084 | |
7085 | 7085 | /** |
7086 | - * Gets all arrival airports of the airplanes that have flown over based on a ident/callsign |
|
7087 | - * |
|
7088 | - * @return Array the airport list |
|
7089 | - * |
|
7090 | - */ |
|
7086 | + * Gets all arrival airports of the airplanes that have flown over based on a ident/callsign |
|
7087 | + * |
|
7088 | + * @return Array the airport list |
|
7089 | + * |
|
7090 | + */ |
|
7091 | 7091 | public function countAllArrivalAirportsByIdent($ident,$filters = array()) |
7092 | 7092 | { |
7093 | 7093 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7120,11 +7120,11 @@ discard block |
||
7120 | 7120 | |
7121 | 7121 | |
7122 | 7122 | /** |
7123 | - * Gets all arrival airports by country of the airplanes that have flown over based on a callsign/ident |
|
7124 | - * |
|
7125 | - * @return Array the airport list |
|
7126 | - * |
|
7127 | - */ |
|
7123 | + * Gets all arrival airports by country of the airplanes that have flown over based on a callsign/ident |
|
7124 | + * |
|
7125 | + * @return Array the airport list |
|
7126 | + * |
|
7127 | + */ |
|
7128 | 7128 | public function countAllArrivalAirportCountriesByIdent($ident, $filters = array()) |
7129 | 7129 | { |
7130 | 7130 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7155,11 +7155,11 @@ discard block |
||
7155 | 7155 | |
7156 | 7156 | |
7157 | 7157 | /** |
7158 | - * Gets all arrival airports of the airplanes that have flown over based on a country |
|
7159 | - * |
|
7160 | - * @return Array the airport list |
|
7161 | - * |
|
7162 | - */ |
|
7158 | + * Gets all arrival airports of the airplanes that have flown over based on a country |
|
7159 | + * |
|
7160 | + * @return Array the airport list |
|
7161 | + * |
|
7162 | + */ |
|
7163 | 7163 | public function countAllArrivalAirportsByCountry($country,$filters = array()) |
7164 | 7164 | { |
7165 | 7165 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7192,11 +7192,11 @@ discard block |
||
7192 | 7192 | |
7193 | 7193 | |
7194 | 7194 | /** |
7195 | - * Gets all arrival airports by country of the airplanes that have flown over based on a country |
|
7196 | - * |
|
7197 | - * @return Array the airport list |
|
7198 | - * |
|
7199 | - */ |
|
7195 | + * Gets all arrival airports by country of the airplanes that have flown over based on a country |
|
7196 | + * |
|
7197 | + * @return Array the airport list |
|
7198 | + * |
|
7199 | + */ |
|
7200 | 7200 | public function countAllArrivalAirportCountriesByCountry($country,$filters = array()) |
7201 | 7201 | { |
7202 | 7202 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7227,11 +7227,11 @@ discard block |
||
7227 | 7227 | |
7228 | 7228 | |
7229 | 7229 | /** |
7230 | - * Counts all airport departure countries |
|
7231 | - * |
|
7232 | - * @return Array the airport departure list |
|
7233 | - * |
|
7234 | - */ |
|
7230 | + * Counts all airport departure countries |
|
7231 | + * |
|
7232 | + * @return Array the airport departure list |
|
7233 | + * |
|
7234 | + */ |
|
7235 | 7235 | public function countAllDepartureCountries($filters = array()) |
7236 | 7236 | { |
7237 | 7237 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7261,11 +7261,11 @@ discard block |
||
7261 | 7261 | |
7262 | 7262 | |
7263 | 7263 | /** |
7264 | - * Counts all airport arrival countries |
|
7265 | - * |
|
7266 | - * @return Array the airport arrival list |
|
7267 | - * |
|
7268 | - */ |
|
7264 | + * Counts all airport arrival countries |
|
7265 | + * |
|
7266 | + * @return Array the airport arrival list |
|
7267 | + * |
|
7268 | + */ |
|
7269 | 7269 | public function countAllArrivalCountries($limit = true,$filters = array()) |
7270 | 7270 | { |
7271 | 7271 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7298,11 +7298,11 @@ discard block |
||
7298 | 7298 | |
7299 | 7299 | |
7300 | 7300 | /** |
7301 | - * Gets all route combinations |
|
7302 | - * |
|
7303 | - * @return Array the route list |
|
7304 | - * |
|
7305 | - */ |
|
7301 | + * Gets all route combinations |
|
7302 | + * |
|
7303 | + * @return Array the route list |
|
7304 | + * |
|
7305 | + */ |
|
7306 | 7306 | public function countAllRoutes($filters = array()) |
7307 | 7307 | { |
7308 | 7308 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7341,11 +7341,11 @@ discard block |
||
7341 | 7341 | |
7342 | 7342 | |
7343 | 7343 | /** |
7344 | - * Gets all route combinations based on an aircraft |
|
7345 | - * |
|
7346 | - * @return Array the route list |
|
7347 | - * |
|
7348 | - */ |
|
7344 | + * Gets all route combinations based on an aircraft |
|
7345 | + * |
|
7346 | + * @return Array the route list |
|
7347 | + * |
|
7348 | + */ |
|
7349 | 7349 | public function countAllRoutesByAircraft($aircraft_icao,$filters = array()) |
7350 | 7350 | { |
7351 | 7351 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7381,11 +7381,11 @@ discard block |
||
7381 | 7381 | |
7382 | 7382 | |
7383 | 7383 | /** |
7384 | - * Gets all route combinations based on an aircraft registration |
|
7385 | - * |
|
7386 | - * @return Array the route list |
|
7387 | - * |
|
7388 | - */ |
|
7384 | + * Gets all route combinations based on an aircraft registration |
|
7385 | + * |
|
7386 | + * @return Array the route list |
|
7387 | + * |
|
7388 | + */ |
|
7389 | 7389 | public function countAllRoutesByRegistration($registration, $filters = array()) |
7390 | 7390 | { |
7391 | 7391 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7423,11 +7423,11 @@ discard block |
||
7423 | 7423 | |
7424 | 7424 | |
7425 | 7425 | /** |
7426 | - * Gets all route combinations based on an airline |
|
7427 | - * |
|
7428 | - * @return Array the route list |
|
7429 | - * |
|
7430 | - */ |
|
7426 | + * Gets all route combinations based on an airline |
|
7427 | + * |
|
7428 | + * @return Array the route list |
|
7429 | + * |
|
7430 | + */ |
|
7431 | 7431 | public function countAllRoutesByAirline($airline_icao, $filters = array()) |
7432 | 7432 | { |
7433 | 7433 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7465,11 +7465,11 @@ discard block |
||
7465 | 7465 | |
7466 | 7466 | |
7467 | 7467 | /** |
7468 | - * Gets all route combinations based on an airport |
|
7469 | - * |
|
7470 | - * @return Array the route list |
|
7471 | - * |
|
7472 | - */ |
|
7468 | + * Gets all route combinations based on an airport |
|
7469 | + * |
|
7470 | + * @return Array the route list |
|
7471 | + * |
|
7472 | + */ |
|
7473 | 7473 | public function countAllRoutesByAirport($airport_icao, $filters = array()) |
7474 | 7474 | { |
7475 | 7475 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7506,11 +7506,11 @@ discard block |
||
7506 | 7506 | |
7507 | 7507 | |
7508 | 7508 | /** |
7509 | - * Gets all route combinations based on an country |
|
7510 | - * |
|
7511 | - * @return Array the route list |
|
7512 | - * |
|
7513 | - */ |
|
7509 | + * Gets all route combinations based on an country |
|
7510 | + * |
|
7511 | + * @return Array the route list |
|
7512 | + * |
|
7513 | + */ |
|
7514 | 7514 | public function countAllRoutesByCountry($country, $filters = array()) |
7515 | 7515 | { |
7516 | 7516 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7546,11 +7546,11 @@ discard block |
||
7546 | 7546 | |
7547 | 7547 | |
7548 | 7548 | /** |
7549 | - * Gets all route combinations based on an date |
|
7550 | - * |
|
7551 | - * @return Array the route list |
|
7552 | - * |
|
7553 | - */ |
|
7549 | + * Gets all route combinations based on an date |
|
7550 | + * |
|
7551 | + * @return Array the route list |
|
7552 | + * |
|
7553 | + */ |
|
7554 | 7554 | public function countAllRoutesByDate($date, $filters = array()) |
7555 | 7555 | { |
7556 | 7556 | global $globalTimezone, $globalDBdriver; |
@@ -7600,11 +7600,11 @@ discard block |
||
7600 | 7600 | |
7601 | 7601 | |
7602 | 7602 | /** |
7603 | - * Gets all route combinations based on an ident/callsign |
|
7604 | - * |
|
7605 | - * @return Array the route list |
|
7606 | - * |
|
7607 | - */ |
|
7603 | + * Gets all route combinations based on an ident/callsign |
|
7604 | + * |
|
7605 | + * @return Array the route list |
|
7606 | + * |
|
7607 | + */ |
|
7608 | 7608 | public function countAllRoutesByIdent($ident, $filters = array()) |
7609 | 7609 | { |
7610 | 7610 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7641,11 +7641,11 @@ discard block |
||
7641 | 7641 | |
7642 | 7642 | |
7643 | 7643 | /** |
7644 | - * Gets all route combinations based on an manufacturer |
|
7645 | - * |
|
7646 | - * @return Array the route list |
|
7647 | - * |
|
7648 | - */ |
|
7644 | + * Gets all route combinations based on an manufacturer |
|
7645 | + * |
|
7646 | + * @return Array the route list |
|
7647 | + * |
|
7648 | + */ |
|
7649 | 7649 | public function countAllRoutesByManufacturer($aircraft_manufacturer, $filters = array()) |
7650 | 7650 | { |
7651 | 7651 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7683,11 +7683,11 @@ discard block |
||
7683 | 7683 | |
7684 | 7684 | |
7685 | 7685 | /** |
7686 | - * Gets all route combinations with waypoints |
|
7687 | - * |
|
7688 | - * @return Array the route list |
|
7689 | - * |
|
7690 | - */ |
|
7686 | + * Gets all route combinations with waypoints |
|
7687 | + * |
|
7688 | + * @return Array the route list |
|
7689 | + * |
|
7690 | + */ |
|
7691 | 7691 | public function countAllRoutesWithWaypoints($filters = array()) |
7692 | 7692 | { |
7693 | 7693 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7724,11 +7724,11 @@ discard block |
||
7724 | 7724 | } |
7725 | 7725 | |
7726 | 7726 | /** |
7727 | - * Gets all callsigns that have flown over |
|
7728 | - * |
|
7729 | - * @return Array the callsign list |
|
7730 | - * |
|
7731 | - */ |
|
7727 | + * Gets all callsigns that have flown over |
|
7728 | + * |
|
7729 | + * @return Array the callsign list |
|
7730 | + * |
|
7731 | + */ |
|
7732 | 7732 | public function countAllCallsigns($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array()) |
7733 | 7733 | { |
7734 | 7734 | global $globalDBdriver; |
@@ -7766,11 +7766,11 @@ discard block |
||
7766 | 7766 | } |
7767 | 7767 | |
7768 | 7768 | /** |
7769 | - * Gets all callsigns that have flown over |
|
7770 | - * |
|
7771 | - * @return Array the callsign list |
|
7772 | - * |
|
7773 | - */ |
|
7769 | + * Gets all callsigns that have flown over |
|
7770 | + * |
|
7771 | + * @return Array the callsign list |
|
7772 | + * |
|
7773 | + */ |
|
7774 | 7774 | public function countAllCallsignsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '', $filters = array()) |
7775 | 7775 | { |
7776 | 7776 | global $globalDBdriver; |
@@ -7811,11 +7811,11 @@ discard block |
||
7811 | 7811 | |
7812 | 7812 | |
7813 | 7813 | /** |
7814 | - * Counts all dates |
|
7815 | - * |
|
7816 | - * @return Array the date list |
|
7817 | - * |
|
7818 | - */ |
|
7814 | + * Counts all dates |
|
7815 | + * |
|
7816 | + * @return Array the date list |
|
7817 | + * |
|
7818 | + */ |
|
7819 | 7819 | public function countAllDates($filters = array()) |
7820 | 7820 | { |
7821 | 7821 | global $globalTimezone, $globalDBdriver; |
@@ -7860,11 +7860,11 @@ discard block |
||
7860 | 7860 | } |
7861 | 7861 | |
7862 | 7862 | /** |
7863 | - * Counts all dates |
|
7864 | - * |
|
7865 | - * @return Array the date list |
|
7866 | - * |
|
7867 | - */ |
|
7863 | + * Counts all dates |
|
7864 | + * |
|
7865 | + * @return Array the date list |
|
7866 | + * |
|
7867 | + */ |
|
7868 | 7868 | public function countAllDatesByAirlines($filters = array()) |
7869 | 7869 | { |
7870 | 7870 | global $globalTimezone, $globalDBdriver; |
@@ -7909,11 +7909,11 @@ discard block |
||
7909 | 7909 | } |
7910 | 7910 | |
7911 | 7911 | /** |
7912 | - * Counts all dates during the last 7 days |
|
7913 | - * |
|
7914 | - * @return Array the date list |
|
7915 | - * |
|
7916 | - */ |
|
7912 | + * Counts all dates during the last 7 days |
|
7913 | + * |
|
7914 | + * @return Array the date list |
|
7915 | + * |
|
7916 | + */ |
|
7917 | 7917 | public function countAllDatesLast7Days($filters = array()) |
7918 | 7918 | { |
7919 | 7919 | global $globalTimezone, $globalDBdriver; |
@@ -7935,7 +7935,7 @@ discard block |
||
7935 | 7935 | $query .= " GROUP BY date_name |
7936 | 7936 | ORDER BY date_name ASC"; |
7937 | 7937 | $query_data = array(':offset' => $offset); |
7938 | - } |
|
7938 | + } |
|
7939 | 7939 | |
7940 | 7940 | $sth = $this->db->prepare($query); |
7941 | 7941 | $sth->execute($query_data); |
@@ -7955,11 +7955,11 @@ discard block |
||
7955 | 7955 | } |
7956 | 7956 | |
7957 | 7957 | /** |
7958 | - * Counts all dates during the last month |
|
7959 | - * |
|
7960 | - * @return Array the date list |
|
7961 | - * |
|
7962 | - */ |
|
7958 | + * Counts all dates during the last month |
|
7959 | + * |
|
7960 | + * @return Array the date list |
|
7961 | + * |
|
7962 | + */ |
|
7963 | 7963 | public function countAllDatesLastMonth($filters = array()) |
7964 | 7964 | { |
7965 | 7965 | global $globalTimezone, $globalDBdriver; |
@@ -7981,7 +7981,7 @@ discard block |
||
7981 | 7981 | $query .= " GROUP BY date_name |
7982 | 7982 | ORDER BY date_name ASC"; |
7983 | 7983 | $query_data = array(':offset' => $offset); |
7984 | - } |
|
7984 | + } |
|
7985 | 7985 | |
7986 | 7986 | $sth = $this->db->prepare($query); |
7987 | 7987 | $sth->execute($query_data); |
@@ -8002,11 +8002,11 @@ discard block |
||
8002 | 8002 | |
8003 | 8003 | |
8004 | 8004 | /** |
8005 | - * Counts all dates during the last month |
|
8006 | - * |
|
8007 | - * @return Array the date list |
|
8008 | - * |
|
8009 | - */ |
|
8005 | + * Counts all dates during the last month |
|
8006 | + * |
|
8007 | + * @return Array the date list |
|
8008 | + * |
|
8009 | + */ |
|
8010 | 8010 | public function countAllDatesLastMonthByAirlines($filters = array()) |
8011 | 8011 | { |
8012 | 8012 | global $globalTimezone, $globalDBdriver; |
@@ -8029,7 +8029,7 @@ discard block |
||
8029 | 8029 | GROUP BY spotter_output.airline_icao, date_name |
8030 | 8030 | ORDER BY date_name ASC"; |
8031 | 8031 | $query_data = array(':offset' => $offset); |
8032 | - } |
|
8032 | + } |
|
8033 | 8033 | |
8034 | 8034 | $sth = $this->db->prepare($query); |
8035 | 8035 | $sth->execute($query_data); |
@@ -8051,11 +8051,11 @@ discard block |
||
8051 | 8051 | |
8052 | 8052 | |
8053 | 8053 | /** |
8054 | - * Counts all month |
|
8055 | - * |
|
8056 | - * @return Array the month list |
|
8057 | - * |
|
8058 | - */ |
|
8054 | + * Counts all month |
|
8055 | + * |
|
8056 | + * @return Array the month list |
|
8057 | + * |
|
8058 | + */ |
|
8059 | 8059 | public function countAllMonths($filters = array()) |
8060 | 8060 | { |
8061 | 8061 | global $globalTimezone, $globalDBdriver; |
@@ -8097,11 +8097,11 @@ discard block |
||
8097 | 8097 | } |
8098 | 8098 | |
8099 | 8099 | /** |
8100 | - * Counts all month |
|
8101 | - * |
|
8102 | - * @return Array the month list |
|
8103 | - * |
|
8104 | - */ |
|
8100 | + * Counts all month |
|
8101 | + * |
|
8102 | + * @return Array the month list |
|
8103 | + * |
|
8104 | + */ |
|
8105 | 8105 | public function countAllMonthsByAirlines($filters = array()) |
8106 | 8106 | { |
8107 | 8107 | global $globalTimezone, $globalDBdriver; |
@@ -8146,11 +8146,11 @@ discard block |
||
8146 | 8146 | } |
8147 | 8147 | |
8148 | 8148 | /** |
8149 | - * Counts all military month |
|
8150 | - * |
|
8151 | - * @return Array the month list |
|
8152 | - * |
|
8153 | - */ |
|
8149 | + * Counts all military month |
|
8150 | + * |
|
8151 | + * @return Array the month list |
|
8152 | + * |
|
8153 | + */ |
|
8154 | 8154 | public function countAllMilitaryMonths($filters = array()) |
8155 | 8155 | { |
8156 | 8156 | global $globalTimezone, $globalDBdriver; |
@@ -8191,11 +8191,11 @@ discard block |
||
8191 | 8191 | } |
8192 | 8192 | |
8193 | 8193 | /** |
8194 | - * Counts all month owners |
|
8195 | - * |
|
8196 | - * @return Array the month list |
|
8197 | - * |
|
8198 | - */ |
|
8194 | + * Counts all month owners |
|
8195 | + * |
|
8196 | + * @return Array the month list |
|
8197 | + * |
|
8198 | + */ |
|
8199 | 8199 | public function countAllMonthsOwners($filters = array()) |
8200 | 8200 | { |
8201 | 8201 | global $globalTimezone, $globalDBdriver; |
@@ -8237,11 +8237,11 @@ discard block |
||
8237 | 8237 | } |
8238 | 8238 | |
8239 | 8239 | /** |
8240 | - * Counts all month owners |
|
8241 | - * |
|
8242 | - * @return Array the month list |
|
8243 | - * |
|
8244 | - */ |
|
8240 | + * Counts all month owners |
|
8241 | + * |
|
8242 | + * @return Array the month list |
|
8243 | + * |
|
8244 | + */ |
|
8245 | 8245 | public function countAllMonthsOwnersByAirlines($filters = array()) |
8246 | 8246 | { |
8247 | 8247 | global $globalTimezone, $globalDBdriver; |
@@ -8284,11 +8284,11 @@ discard block |
||
8284 | 8284 | } |
8285 | 8285 | |
8286 | 8286 | /** |
8287 | - * Counts all month pilot |
|
8288 | - * |
|
8289 | - * @return Array the month list |
|
8290 | - * |
|
8291 | - */ |
|
8287 | + * Counts all month pilot |
|
8288 | + * |
|
8289 | + * @return Array the month list |
|
8290 | + * |
|
8291 | + */ |
|
8292 | 8292 | public function countAllMonthsPilots($filters = array()) |
8293 | 8293 | { |
8294 | 8294 | global $globalTimezone, $globalDBdriver; |
@@ -8330,11 +8330,11 @@ discard block |
||
8330 | 8330 | } |
8331 | 8331 | |
8332 | 8332 | /** |
8333 | - * Counts all month pilot |
|
8334 | - * |
|
8335 | - * @return Array the month list |
|
8336 | - * |
|
8337 | - */ |
|
8333 | + * Counts all month pilot |
|
8334 | + * |
|
8335 | + * @return Array the month list |
|
8336 | + * |
|
8337 | + */ |
|
8338 | 8338 | public function countAllMonthsPilotsByAirlines($filters = array()) |
8339 | 8339 | { |
8340 | 8340 | global $globalTimezone, $globalDBdriver; |
@@ -8377,11 +8377,11 @@ discard block |
||
8377 | 8377 | } |
8378 | 8378 | |
8379 | 8379 | /** |
8380 | - * Counts all month airline |
|
8381 | - * |
|
8382 | - * @return Array the month list |
|
8383 | - * |
|
8384 | - */ |
|
8380 | + * Counts all month airline |
|
8381 | + * |
|
8382 | + * @return Array the month list |
|
8383 | + * |
|
8384 | + */ |
|
8385 | 8385 | public function countAllMonthsAirlines($filters = array()) |
8386 | 8386 | { |
8387 | 8387 | global $globalTimezone, $globalDBdriver; |
@@ -8423,11 +8423,11 @@ discard block |
||
8423 | 8423 | } |
8424 | 8424 | |
8425 | 8425 | /** |
8426 | - * Counts all month aircraft |
|
8427 | - * |
|
8428 | - * @return Array the month list |
|
8429 | - * |
|
8430 | - */ |
|
8426 | + * Counts all month aircraft |
|
8427 | + * |
|
8428 | + * @return Array the month list |
|
8429 | + * |
|
8430 | + */ |
|
8431 | 8431 | public function countAllMonthsAircrafts($filters = array()) |
8432 | 8432 | { |
8433 | 8433 | global $globalTimezone, $globalDBdriver; |
@@ -8470,11 +8470,11 @@ discard block |
||
8470 | 8470 | |
8471 | 8471 | |
8472 | 8472 | /** |
8473 | - * Counts all month aircraft |
|
8474 | - * |
|
8475 | - * @return Array the month list |
|
8476 | - * |
|
8477 | - */ |
|
8473 | + * Counts all month aircraft |
|
8474 | + * |
|
8475 | + * @return Array the month list |
|
8476 | + * |
|
8477 | + */ |
|
8478 | 8478 | public function countAllMonthsAircraftsByAirlines($filters = array()) |
8479 | 8479 | { |
8480 | 8480 | global $globalTimezone, $globalDBdriver; |
@@ -8517,11 +8517,11 @@ discard block |
||
8517 | 8517 | } |
8518 | 8518 | |
8519 | 8519 | /** |
8520 | - * Counts all month real arrival |
|
8521 | - * |
|
8522 | - * @return Array the month list |
|
8523 | - * |
|
8524 | - */ |
|
8520 | + * Counts all month real arrival |
|
8521 | + * |
|
8522 | + * @return Array the month list |
|
8523 | + * |
|
8524 | + */ |
|
8525 | 8525 | public function countAllMonthsRealArrivals($filters = array()) |
8526 | 8526 | { |
8527 | 8527 | global $globalTimezone, $globalDBdriver; |
@@ -8564,11 +8564,11 @@ discard block |
||
8564 | 8564 | |
8565 | 8565 | |
8566 | 8566 | /** |
8567 | - * Counts all month real arrival |
|
8568 | - * |
|
8569 | - * @return Array the month list |
|
8570 | - * |
|
8571 | - */ |
|
8567 | + * Counts all month real arrival |
|
8568 | + * |
|
8569 | + * @return Array the month list |
|
8570 | + * |
|
8571 | + */ |
|
8572 | 8572 | public function countAllMonthsRealArrivalsByAirlines($filters = array()) |
8573 | 8573 | { |
8574 | 8574 | global $globalTimezone, $globalDBdriver; |
@@ -8612,11 +8612,11 @@ discard block |
||
8612 | 8612 | |
8613 | 8613 | |
8614 | 8614 | /** |
8615 | - * Counts all dates during the last year |
|
8616 | - * |
|
8617 | - * @return Array the date list |
|
8618 | - * |
|
8619 | - */ |
|
8615 | + * Counts all dates during the last year |
|
8616 | + * |
|
8617 | + * @return Array the date list |
|
8618 | + * |
|
8619 | + */ |
|
8620 | 8620 | public function countAllMonthsLastYear($filters) |
8621 | 8621 | { |
8622 | 8622 | global $globalTimezone, $globalDBdriver; |
@@ -8638,7 +8638,7 @@ discard block |
||
8638 | 8638 | $query .= " GROUP BY year_name, month_name |
8639 | 8639 | ORDER BY year_name, month_name ASC"; |
8640 | 8640 | $query_data = array(':offset' => $offset); |
8641 | - } |
|
8641 | + } |
|
8642 | 8642 | |
8643 | 8643 | $sth = $this->db->prepare($query); |
8644 | 8644 | $sth->execute($query_data); |
@@ -8661,11 +8661,11 @@ discard block |
||
8661 | 8661 | |
8662 | 8662 | |
8663 | 8663 | /** |
8664 | - * Counts all hours |
|
8665 | - * |
|
8666 | - * @return Array the hour list |
|
8667 | - * |
|
8668 | - */ |
|
8664 | + * Counts all hours |
|
8665 | + * |
|
8666 | + * @return Array the hour list |
|
8667 | + * |
|
8668 | + */ |
|
8669 | 8669 | public function countAllHours($orderby,$filters = array()) |
8670 | 8670 | { |
8671 | 8671 | global $globalTimezone, $globalDBdriver; |
@@ -8726,11 +8726,11 @@ discard block |
||
8726 | 8726 | } |
8727 | 8727 | |
8728 | 8728 | /** |
8729 | - * Counts all hours |
|
8730 | - * |
|
8731 | - * @return Array the hour list |
|
8732 | - * |
|
8733 | - */ |
|
8729 | + * Counts all hours |
|
8730 | + * |
|
8731 | + * @return Array the hour list |
|
8732 | + * |
|
8733 | + */ |
|
8734 | 8734 | public function countAllHoursByAirlines($orderby, $filters = array()) |
8735 | 8735 | { |
8736 | 8736 | global $globalTimezone, $globalDBdriver; |
@@ -8793,11 +8793,11 @@ discard block |
||
8793 | 8793 | |
8794 | 8794 | |
8795 | 8795 | /** |
8796 | - * Counts all hours by airline |
|
8797 | - * |
|
8798 | - * @return Array the hour list |
|
8799 | - * |
|
8800 | - */ |
|
8796 | + * Counts all hours by airline |
|
8797 | + * |
|
8798 | + * @return Array the hour list |
|
8799 | + * |
|
8800 | + */ |
|
8801 | 8801 | public function countAllHoursByAirline($airline_icao, $filters = array()) |
8802 | 8802 | { |
8803 | 8803 | global $globalTimezone, $globalDBdriver; |
@@ -8843,11 +8843,11 @@ discard block |
||
8843 | 8843 | |
8844 | 8844 | |
8845 | 8845 | /** |
8846 | - * Counts all hours by aircraft |
|
8847 | - * |
|
8848 | - * @return Array the hour list |
|
8849 | - * |
|
8850 | - */ |
|
8846 | + * Counts all hours by aircraft |
|
8847 | + * |
|
8848 | + * @return Array the hour list |
|
8849 | + * |
|
8850 | + */ |
|
8851 | 8851 | public function countAllHoursByAircraft($aircraft_icao, $filters = array()) |
8852 | 8852 | { |
8853 | 8853 | global $globalTimezone, $globalDBdriver; |
@@ -8890,11 +8890,11 @@ discard block |
||
8890 | 8890 | |
8891 | 8891 | |
8892 | 8892 | /** |
8893 | - * Counts all hours by aircraft registration |
|
8894 | - * |
|
8895 | - * @return Array the hour list |
|
8896 | - * |
|
8897 | - */ |
|
8893 | + * Counts all hours by aircraft registration |
|
8894 | + * |
|
8895 | + * @return Array the hour list |
|
8896 | + * |
|
8897 | + */ |
|
8898 | 8898 | public function countAllHoursByRegistration($registration, $filters = array()) |
8899 | 8899 | { |
8900 | 8900 | global $globalTimezone, $globalDBdriver; |
@@ -8937,11 +8937,11 @@ discard block |
||
8937 | 8937 | |
8938 | 8938 | |
8939 | 8939 | /** |
8940 | - * Counts all hours by airport |
|
8941 | - * |
|
8942 | - * @return Array the hour list |
|
8943 | - * |
|
8944 | - */ |
|
8940 | + * Counts all hours by airport |
|
8941 | + * |
|
8942 | + * @return Array the hour list |
|
8943 | + * |
|
8944 | + */ |
|
8945 | 8945 | public function countAllHoursByAirport($airport_icao, $filters = array()) |
8946 | 8946 | { |
8947 | 8947 | global $globalTimezone, $globalDBdriver; |
@@ -8985,11 +8985,11 @@ discard block |
||
8985 | 8985 | |
8986 | 8986 | |
8987 | 8987 | /** |
8988 | - * Counts all hours by manufacturer |
|
8989 | - * |
|
8990 | - * @return Array the hour list |
|
8991 | - * |
|
8992 | - */ |
|
8988 | + * Counts all hours by manufacturer |
|
8989 | + * |
|
8990 | + * @return Array the hour list |
|
8991 | + * |
|
8992 | + */ |
|
8993 | 8993 | public function countAllHoursByManufacturer($aircraft_manufacturer,$filters =array()) |
8994 | 8994 | { |
8995 | 8995 | global $globalTimezone, $globalDBdriver; |
@@ -9033,11 +9033,11 @@ discard block |
||
9033 | 9033 | |
9034 | 9034 | |
9035 | 9035 | /** |
9036 | - * Counts all hours by date |
|
9037 | - * |
|
9038 | - * @return Array the hour list |
|
9039 | - * |
|
9040 | - */ |
|
9036 | + * Counts all hours by date |
|
9037 | + * |
|
9038 | + * @return Array the hour list |
|
9039 | + * |
|
9040 | + */ |
|
9041 | 9041 | public function countAllHoursByDate($date, $filters = array()) |
9042 | 9042 | { |
9043 | 9043 | global $globalTimezone, $globalDBdriver; |
@@ -9081,11 +9081,11 @@ discard block |
||
9081 | 9081 | |
9082 | 9082 | |
9083 | 9083 | /** |
9084 | - * Counts all hours by a ident/callsign |
|
9085 | - * |
|
9086 | - * @return Array the hour list |
|
9087 | - * |
|
9088 | - */ |
|
9084 | + * Counts all hours by a ident/callsign |
|
9085 | + * |
|
9086 | + * @return Array the hour list |
|
9087 | + * |
|
9088 | + */ |
|
9089 | 9089 | public function countAllHoursByIdent($ident, $filters = array()) |
9090 | 9090 | { |
9091 | 9091 | global $globalTimezone, $globalDBdriver; |
@@ -9130,11 +9130,11 @@ discard block |
||
9130 | 9130 | |
9131 | 9131 | |
9132 | 9132 | /** |
9133 | - * Counts all hours by route |
|
9134 | - * |
|
9135 | - * @return Array the hour list |
|
9136 | - * |
|
9137 | - */ |
|
9133 | + * Counts all hours by route |
|
9134 | + * |
|
9135 | + * @return Array the hour list |
|
9136 | + * |
|
9137 | + */ |
|
9138 | 9138 | public function countAllHoursByRoute($departure_airport_icao, $arrival_airport_icao, $filters =array()) |
9139 | 9139 | { |
9140 | 9140 | global $globalTimezone, $globalDBdriver; |
@@ -9178,11 +9178,11 @@ discard block |
||
9178 | 9178 | |
9179 | 9179 | |
9180 | 9180 | /** |
9181 | - * Counts all hours by country |
|
9182 | - * |
|
9183 | - * @return Array the hour list |
|
9184 | - * |
|
9185 | - */ |
|
9181 | + * Counts all hours by country |
|
9182 | + * |
|
9183 | + * @return Array the hour list |
|
9184 | + * |
|
9185 | + */ |
|
9186 | 9186 | public function countAllHoursByCountry($country, $filters = array()) |
9187 | 9187 | { |
9188 | 9188 | global $globalTimezone, $globalDBdriver; |
@@ -9227,11 +9227,11 @@ discard block |
||
9227 | 9227 | |
9228 | 9228 | |
9229 | 9229 | /** |
9230 | - * Counts all aircraft that have flown over |
|
9231 | - * |
|
9232 | - * @return Integer the number of aircrafts |
|
9233 | - * |
|
9234 | - */ |
|
9230 | + * Counts all aircraft that have flown over |
|
9231 | + * |
|
9232 | + * @return Integer the number of aircrafts |
|
9233 | + * |
|
9234 | + */ |
|
9235 | 9235 | public function countOverallAircrafts($filters = array()) |
9236 | 9236 | { |
9237 | 9237 | $filter_query = $this->getFilter($filters,true,true); |
@@ -9243,11 +9243,11 @@ discard block |
||
9243 | 9243 | } |
9244 | 9244 | |
9245 | 9245 | /** |
9246 | - * Counts all flight that really arrival |
|
9247 | - * |
|
9248 | - * @return Integer the number of aircrafts |
|
9249 | - * |
|
9250 | - */ |
|
9246 | + * Counts all flight that really arrival |
|
9247 | + * |
|
9248 | + * @return Integer the number of aircrafts |
|
9249 | + * |
|
9250 | + */ |
|
9251 | 9251 | public function countOverallArrival($filters = array()) |
9252 | 9252 | { |
9253 | 9253 | $filter_query = $this->getFilter($filters,true,true); |
@@ -9260,11 +9260,11 @@ discard block |
||
9260 | 9260 | } |
9261 | 9261 | |
9262 | 9262 | /** |
9263 | - * Counts all pilots that have flown over |
|
9264 | - * |
|
9265 | - * @return Integer the number of pilots |
|
9266 | - * |
|
9267 | - */ |
|
9263 | + * Counts all pilots that have flown over |
|
9264 | + * |
|
9265 | + * @return Integer the number of pilots |
|
9266 | + * |
|
9267 | + */ |
|
9268 | 9268 | public function countOverallPilots($filters = array()) |
9269 | 9269 | { |
9270 | 9270 | $filter_query = $this->getFilter($filters,true,true); |
@@ -9276,11 +9276,11 @@ discard block |
||
9276 | 9276 | } |
9277 | 9277 | |
9278 | 9278 | /** |
9279 | - * Counts all owners that have flown over |
|
9280 | - * |
|
9281 | - * @return Integer the number of owners |
|
9282 | - * |
|
9283 | - */ |
|
9279 | + * Counts all owners that have flown over |
|
9280 | + * |
|
9281 | + * @return Integer the number of owners |
|
9282 | + * |
|
9283 | + */ |
|
9284 | 9284 | public function countOverallOwners($filters = array()) |
9285 | 9285 | { |
9286 | 9286 | $filter_query = $this->getFilter($filters,true,true); |
@@ -9293,11 +9293,11 @@ discard block |
||
9293 | 9293 | |
9294 | 9294 | |
9295 | 9295 | /** |
9296 | - * Counts all flights that have flown over |
|
9297 | - * |
|
9298 | - * @return Integer the number of flights |
|
9299 | - * |
|
9300 | - */ |
|
9296 | + * Counts all flights that have flown over |
|
9297 | + * |
|
9298 | + * @return Integer the number of flights |
|
9299 | + * |
|
9300 | + */ |
|
9301 | 9301 | public function countOverallFlights($filters = array()) |
9302 | 9302 | { |
9303 | 9303 | $query = "SELECT COUNT(spotter_output.spotter_id) AS flight_count |
@@ -9310,11 +9310,11 @@ discard block |
||
9310 | 9310 | } |
9311 | 9311 | |
9312 | 9312 | /** |
9313 | - * Counts all military flights that have flown over |
|
9314 | - * |
|
9315 | - * @return Integer the number of flights |
|
9316 | - * |
|
9317 | - */ |
|
9313 | + * Counts all military flights that have flown over |
|
9314 | + * |
|
9315 | + * @return Integer the number of flights |
|
9316 | + * |
|
9317 | + */ |
|
9318 | 9318 | public function countOverallMilitaryFlights($filters = array()) |
9319 | 9319 | { |
9320 | 9320 | $filter_query = $this->getFilter($filters,true,true); |
@@ -9329,11 +9329,11 @@ discard block |
||
9329 | 9329 | |
9330 | 9330 | |
9331 | 9331 | /** |
9332 | - * Counts all airlines that have flown over |
|
9333 | - * |
|
9334 | - * @return Integer the number of airlines |
|
9335 | - * |
|
9336 | - */ |
|
9332 | + * Counts all airlines that have flown over |
|
9333 | + * |
|
9334 | + * @return Integer the number of airlines |
|
9335 | + * |
|
9336 | + */ |
|
9337 | 9337 | public function countOverallAirlines($filters = array()) |
9338 | 9338 | { |
9339 | 9339 | $query = "SELECT COUNT(DISTINCT spotter_output.airline_name) AS airline_count |
@@ -9347,11 +9347,11 @@ discard block |
||
9347 | 9347 | |
9348 | 9348 | |
9349 | 9349 | /** |
9350 | - * Counts all hours of today |
|
9351 | - * |
|
9352 | - * @return Array the hour list |
|
9353 | - * |
|
9354 | - */ |
|
9350 | + * Counts all hours of today |
|
9351 | + * |
|
9352 | + * @return Array the hour list |
|
9353 | + * |
|
9354 | + */ |
|
9355 | 9355 | public function countAllHoursFromToday($filters = array()) |
9356 | 9356 | { |
9357 | 9357 | global $globalTimezone, $globalDBdriver; |
@@ -9391,11 +9391,11 @@ discard block |
||
9391 | 9391 | } |
9392 | 9392 | |
9393 | 9393 | /** |
9394 | - * Gets all the spotter information based on calculated upcoming flights |
|
9395 | - * |
|
9396 | - * @return Array the spotter information |
|
9397 | - * |
|
9398 | - */ |
|
9394 | + * Gets all the spotter information based on calculated upcoming flights |
|
9395 | + * |
|
9396 | + * @return Array the spotter information |
|
9397 | + * |
|
9398 | + */ |
|
9399 | 9399 | public function getUpcomingFlights($limit = '', $sort = '', $filters = array()) |
9400 | 9400 | { |
9401 | 9401 | global $global_query, $globalDBdriver, $globalTimezone; |
@@ -9470,12 +9470,12 @@ discard block |
||
9470 | 9470 | } |
9471 | 9471 | |
9472 | 9472 | |
9473 | - /** |
|
9474 | - * Gets the Barrie Spotter ID based on the FlightAware ID |
|
9475 | - * |
|
9476 | - * @return Integer the Barrie Spotter ID |
|
9473 | + /** |
|
9474 | + * Gets the Barrie Spotter ID based on the FlightAware ID |
|
9475 | + * |
|
9476 | + * @return Integer the Barrie Spotter ID |
|
9477 | 9477 | q * |
9478 | - */ |
|
9478 | + */ |
|
9479 | 9479 | public function getSpotterIDBasedOnFlightAwareID($flightaware_id) |
9480 | 9480 | { |
9481 | 9481 | $flightaware_id = filter_var($flightaware_id,FILTER_SANITIZE_STRING); |
@@ -9496,13 +9496,13 @@ discard block |
||
9496 | 9496 | |
9497 | 9497 | |
9498 | 9498 | /** |
9499 | - * Parses a date string |
|
9500 | - * |
|
9501 | - * @param String $dateString the date string |
|
9502 | - * @param String $timezone the timezone of a user |
|
9503 | - * @return Array the time information |
|
9504 | - * |
|
9505 | - */ |
|
9499 | + * Parses a date string |
|
9500 | + * |
|
9501 | + * @param String $dateString the date string |
|
9502 | + * @param String $timezone the timezone of a user |
|
9503 | + * @return Array the time information |
|
9504 | + * |
|
9505 | + */ |
|
9506 | 9506 | public function parseDateString($dateString, $timezone = '') |
9507 | 9507 | { |
9508 | 9508 | $time_array = array(); |
@@ -9538,12 +9538,12 @@ discard block |
||
9538 | 9538 | |
9539 | 9539 | |
9540 | 9540 | /** |
9541 | - * Parses the direction degrees to working |
|
9542 | - * |
|
9543 | - * @param Float $direction the direction in degrees |
|
9544 | - * @return Array the direction information |
|
9545 | - * |
|
9546 | - */ |
|
9541 | + * Parses the direction degrees to working |
|
9542 | + * |
|
9543 | + * @param Float $direction the direction in degrees |
|
9544 | + * @return Array the direction information |
|
9545 | + * |
|
9546 | + */ |
|
9547 | 9547 | public function parseDirection($direction = 0) |
9548 | 9548 | { |
9549 | 9549 | if ($direction == '') $direction = 0; |
@@ -9622,12 +9622,12 @@ discard block |
||
9622 | 9622 | |
9623 | 9623 | |
9624 | 9624 | /** |
9625 | - * Gets the aircraft registration |
|
9626 | - * |
|
9627 | - * @param String $flightaware_id the flight aware id |
|
9628 | - * @return String the aircraft registration |
|
9629 | - * |
|
9630 | - */ |
|
9625 | + * Gets the aircraft registration |
|
9626 | + * |
|
9627 | + * @param String $flightaware_id the flight aware id |
|
9628 | + * @return String the aircraft registration |
|
9629 | + * |
|
9630 | + */ |
|
9631 | 9631 | |
9632 | 9632 | public function getAircraftRegistration($flightaware_id) |
9633 | 9633 | { |
@@ -9656,12 +9656,12 @@ discard block |
||
9656 | 9656 | |
9657 | 9657 | |
9658 | 9658 | /** |
9659 | - * Gets the aircraft registration from ModeS |
|
9660 | - * |
|
9661 | - * @param String $aircraft_modes the flight ModeS in hex |
|
9662 | - * @return String the aircraft registration |
|
9663 | - * |
|
9664 | - */ |
|
9659 | + * Gets the aircraft registration from ModeS |
|
9660 | + * |
|
9661 | + * @param String $aircraft_modes the flight ModeS in hex |
|
9662 | + * @return String the aircraft registration |
|
9663 | + * |
|
9664 | + */ |
|
9665 | 9665 | public function getAircraftRegistrationBymodeS($aircraft_modes) |
9666 | 9666 | { |
9667 | 9667 | $aircraft_modes = filter_var($aircraft_modes,FILTER_SANITIZE_STRING); |
@@ -9674,19 +9674,19 @@ discard block |
||
9674 | 9674 | $row = $sth->fetch(PDO::FETCH_ASSOC); |
9675 | 9675 | $sth->closeCursor(); |
9676 | 9676 | if (count($row) > 0) { |
9677 | - //return $row['Registration']; |
|
9678 | - return $row['registration']; |
|
9677 | + //return $row['Registration']; |
|
9678 | + return $row['registration']; |
|
9679 | 9679 | } else return ''; |
9680 | 9680 | |
9681 | 9681 | } |
9682 | 9682 | |
9683 | 9683 | /** |
9684 | - * Gets the aircraft type from ModeS |
|
9685 | - * |
|
9686 | - * @param String $aircraft_modes the flight ModeS in hex |
|
9687 | - * @return String the aircraft type |
|
9688 | - * |
|
9689 | - */ |
|
9684 | + * Gets the aircraft type from ModeS |
|
9685 | + * |
|
9686 | + * @param String $aircraft_modes the flight ModeS in hex |
|
9687 | + * @return String the aircraft type |
|
9688 | + * |
|
9689 | + */ |
|
9690 | 9690 | public function getAircraftTypeBymodeS($aircraft_modes) |
9691 | 9691 | { |
9692 | 9692 | $aircraft_modes = filter_var($aircraft_modes,FILTER_SANITIZE_STRING); |
@@ -9699,19 +9699,19 @@ discard block |
||
9699 | 9699 | $row = $sth->fetch(PDO::FETCH_ASSOC); |
9700 | 9700 | $sth->closeCursor(); |
9701 | 9701 | if (count($row) > 0) { |
9702 | - if ($row['type_flight'] == null) return ''; |
|
9703 | - else return $row['type_flight']; |
|
9702 | + if ($row['type_flight'] == null) return ''; |
|
9703 | + else return $row['type_flight']; |
|
9704 | 9704 | } else return ''; |
9705 | 9705 | |
9706 | 9706 | } |
9707 | 9707 | |
9708 | 9708 | /** |
9709 | - * Gets Country from latitude/longitude |
|
9710 | - * |
|
9711 | - * @param Float $latitude latitute of the flight |
|
9712 | - * @param Float $longitude longitute of the flight |
|
9713 | - * @return String the countrie |
|
9714 | - */ |
|
9709 | + * Gets Country from latitude/longitude |
|
9710 | + * |
|
9711 | + * @param Float $latitude latitute of the flight |
|
9712 | + * @param Float $longitude longitute of the flight |
|
9713 | + * @return String the countrie |
|
9714 | + */ |
|
9715 | 9715 | public function getCountryFromLatitudeLongitude($latitude,$longitude) |
9716 | 9716 | { |
9717 | 9717 | global $globalDBdriver, $globalDebug; |
@@ -9748,11 +9748,11 @@ discard block |
||
9748 | 9748 | } |
9749 | 9749 | |
9750 | 9750 | /** |
9751 | - * Gets Country from iso2 |
|
9752 | - * |
|
9753 | - * @param String $iso2 ISO2 country code |
|
9754 | - * @return String the countrie |
|
9755 | - */ |
|
9751 | + * Gets Country from iso2 |
|
9752 | + * |
|
9753 | + * @param String $iso2 ISO2 country code |
|
9754 | + * @return String the countrie |
|
9755 | + */ |
|
9756 | 9756 | public function getCountryFromISO2($iso2) |
9757 | 9757 | { |
9758 | 9758 | global $globalDBdriver, $globalDebug; |
@@ -9780,12 +9780,12 @@ discard block |
||
9780 | 9780 | } |
9781 | 9781 | |
9782 | 9782 | /** |
9783 | - * converts the registration code using the country prefix |
|
9784 | - * |
|
9785 | - * @param String $registration the aircraft registration |
|
9786 | - * @return String the aircraft registration |
|
9787 | - * |
|
9788 | - */ |
|
9783 | + * converts the registration code using the country prefix |
|
9784 | + * |
|
9785 | + * @param String $registration the aircraft registration |
|
9786 | + * @return String the aircraft registration |
|
9787 | + * |
|
9788 | + */ |
|
9789 | 9789 | public function convertAircraftRegistration($registration) |
9790 | 9790 | { |
9791 | 9791 | $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
@@ -9837,12 +9837,12 @@ discard block |
||
9837 | 9837 | } |
9838 | 9838 | |
9839 | 9839 | /** |
9840 | - * Country from the registration code |
|
9841 | - * |
|
9842 | - * @param String $registration the aircraft registration |
|
9843 | - * @return String the country |
|
9844 | - * |
|
9845 | - */ |
|
9840 | + * Country from the registration code |
|
9841 | + * |
|
9842 | + * @param String $registration the aircraft registration |
|
9843 | + * @return String the country |
|
9844 | + * |
|
9845 | + */ |
|
9846 | 9846 | public function countryFromAircraftRegistration($registration) |
9847 | 9847 | { |
9848 | 9848 | $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
@@ -9861,8 +9861,8 @@ discard block |
||
9861 | 9861 | $country = $row['country']; |
9862 | 9862 | } |
9863 | 9863 | } else { |
9864 | - $registration_1 = substr($registration, 0, 1); |
|
9865 | - $registration_2 = substr($registration, 0, 2); |
|
9864 | + $registration_1 = substr($registration, 0, 1); |
|
9865 | + $registration_2 = substr($registration, 0, 2); |
|
9866 | 9866 | |
9867 | 9867 | $country = ''; |
9868 | 9868 | //first get the prefix based on two characters |
@@ -9898,12 +9898,12 @@ discard block |
||
9898 | 9898 | } |
9899 | 9899 | |
9900 | 9900 | /** |
9901 | - * Country from the registration code |
|
9902 | - * |
|
9903 | - * @param String $registration the aircraft registration |
|
9904 | - * @return String the country |
|
9905 | - * |
|
9906 | - */ |
|
9901 | + * Country from the registration code |
|
9902 | + * |
|
9903 | + * @param String $registration the aircraft registration |
|
9904 | + * @return String the country |
|
9905 | + * |
|
9906 | + */ |
|
9907 | 9907 | public function countryFromAircraftRegistrationCode($registration) |
9908 | 9908 | { |
9909 | 9909 | $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
@@ -9920,11 +9920,11 @@ discard block |
||
9920 | 9920 | } |
9921 | 9921 | |
9922 | 9922 | /** |
9923 | - * Set a new highlight value for a flight |
|
9924 | - * |
|
9925 | - * @param String $flightaware_id flightaware_id from spotter_output table |
|
9926 | - * @param String $highlight New highlight value |
|
9927 | - */ |
|
9923 | + * Set a new highlight value for a flight |
|
9924 | + * |
|
9925 | + * @param String $flightaware_id flightaware_id from spotter_output table |
|
9926 | + * @param String $highlight New highlight value |
|
9927 | + */ |
|
9928 | 9928 | public function setHighlightFlight($flightaware_id,$highlight) { |
9929 | 9929 | |
9930 | 9930 | $query = "UPDATE spotter_output SET highlight = :highlight WHERE flightaware_id = :flightaware_id"; |
@@ -9933,12 +9933,12 @@ discard block |
||
9933 | 9933 | } |
9934 | 9934 | |
9935 | 9935 | /** |
9936 | - * Gets the short url from bit.ly |
|
9937 | - * |
|
9938 | - * @param String $url the full url |
|
9939 | - * @return String the bit.ly url |
|
9940 | - * |
|
9941 | - */ |
|
9936 | + * Gets the short url from bit.ly |
|
9937 | + * |
|
9938 | + * @param String $url the full url |
|
9939 | + * @return String the bit.ly url |
|
9940 | + * |
|
9941 | + */ |
|
9942 | 9942 | public function getBitlyURL($url) |
9943 | 9943 | { |
9944 | 9944 | global $globalBitlyAccessToken; |
@@ -10227,11 +10227,11 @@ discard block |
||
10227 | 10227 | $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 |
10228 | 10228 | 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)) |
10229 | 10229 | 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;"; |
10230 | - } else { |
|
10230 | + } else { |
|
10231 | 10231 | $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 |
10232 | 10232 | 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)) |
10233 | 10233 | 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;"; |
10234 | - } |
|
10234 | + } |
|
10235 | 10235 | $sth = $this->db->prepare($query); |
10236 | 10236 | $sth->execute(); |
10237 | 10237 | return $sth->fetchAll(PDO::FETCH_ASSOC); |
@@ -388,17 +388,17 @@ discard block |
||
388 | 388 | else { |
389 | 389 | $planespotter_url_array = explode("_", $spotter_item['image']); |
390 | 390 | $planespotter_id = str_replace(".jpg", "", $planespotter_url_array[1]); |
391 | - $image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id; |
|
391 | + $image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id; |
|
392 | 392 | } |
393 | 393 | if (isset($spotter_item['airline_name'])) { |
394 | 394 | print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" alt="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Airline:").' '.$spotter_item['airline_name'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
395 | 395 | } else { |
396 | 396 | print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Airline:").' '._("Not available").'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
397 | 397 | } |
398 | - } else { |
|
399 | - if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
|
400 | - $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
|
401 | - } else $image_thumbnail = $spotter_item['image_thumbnail']; |
|
398 | + } else { |
|
399 | + if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
|
400 | + $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
|
401 | + } else $image_thumbnail = $spotter_item['image_thumbnail']; |
|
402 | 402 | if (isset($spotter_item['airline_name'])) { |
403 | 403 | print '<img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" alt="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Airline:").' '.$spotter_item['airline_name'].'" data-html="true" width="100px" />'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
404 | 404 | } else { |
@@ -413,7 +413,7 @@ discard block |
||
413 | 413 | } |
414 | 414 | } elseif(strtolower($current_page) != "currently" && strtolower($current_page) != "upcoming" && strtolower($current_page) != "acars-latest" && strtolower($current_page) != "acars-archive" && strtolower($current_page) != "accident-latest" && strtolower($current_page) != "incident-latest"){ |
415 | 415 | if (!isset($spotter_item['squawk']) || $spotter_item['squawk'] == 0) { |
416 | - $spotter_item['squawk'] = '-'; |
|
416 | + $spotter_item['squawk'] = '-'; |
|
417 | 417 | } |
418 | 418 | if ($spotter_item['image_thumbnail'] != "") |
419 | 419 | { |
@@ -424,7 +424,7 @@ discard block |
||
424 | 424 | else { |
425 | 425 | $planespotter_url_array = explode("_", $spotter_array[0]['image']); |
426 | 426 | $planespotter_id = str_replace(".jpg", "", $planespotter_url_array[1]); |
427 | - $image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id; |
|
427 | + $image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id; |
|
428 | 428 | } |
429 | 429 | if (!isset($spotter_item['airline_name']) && isset($spotter_item['aircraft_name'])) { |
430 | 430 | print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '._("Not available").'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
@@ -436,9 +436,9 @@ discard block |
||
436 | 436 | print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '.$spotter_item['airline_name'].'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '.$spotter_item['airline_name'].'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '.$spotter_item['airline_name'].'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
437 | 437 | } |
438 | 438 | } else { |
439 | - if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
|
440 | - $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
|
441 | - } else $image_thumbnail = $spotter_item['image_thumbnail']; |
|
439 | + if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
|
440 | + $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
|
441 | + } else $image_thumbnail = $spotter_item['image_thumbnail']; |
|
442 | 442 | if (!isset($spotter_item['airline_name']) && isset($spotter_item['aircraft_name'])) { |
443 | 443 | print '<a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'"><img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '._("Not available").'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
444 | 444 | } elseif (!isset($spotter_item['aircraft_name']) && isset($spotter_item['airline_name'])) { |
@@ -452,7 +452,7 @@ discard block |
||
452 | 452 | print '</td>'."\n"; |
453 | 453 | } else { |
454 | 454 | print '<td class="aircraft_thumbnail">'."\n"; |
455 | - // print '<a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'"><img src="'.$globalURL.'/images/placeholder_thumb.png" alt="Click to see more information about this flight" title="Click to see more information about this flight" width="100px" /></a>'; |
|
455 | + // print '<a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'"><img src="'.$globalURL.'/images/placeholder_thumb.png" alt="Click to see more information about this flight" title="Click to see more information about this flight" width="100px" /></a>'; |
|
456 | 456 | //} |
457 | 457 | if (!isset($spotter_item['airline_name']) && !isset($spotter_item['aircraft_name'])) { |
458 | 458 | print '<a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'"><img src="'.$globalURL.'/images/placeholder_thumb.png" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' '._("Not available").' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '._("Not available").'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n"; |
@@ -557,13 +557,13 @@ discard block |
||
557 | 557 | $distance = $Spotter->getAirportDistance($spotter_item['departure_airport'],$latitude,$longitude); |
558 | 558 | } else $distance = ''; |
559 | 559 | if ($distance != '') { |
560 | - if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
|
561 | - echo '<br/><i>'.round($distance*0.539957).' nm</i>'; |
|
562 | - } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
|
563 | - echo '<br/><i>'.round($distance*0.621371).' mi</i>'; |
|
564 | - } elseif ((!isset($_COOKIE['unitdistance']) && ((isset($globalUnitDistance) && $globalUnitDistance == 'km') || !isset($globalUnitDistance))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) { |
|
565 | - echo '<br/><i>'.$distance.' km</i>'; |
|
566 | - } |
|
560 | + if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
|
561 | + echo '<br/><i>'.round($distance*0.539957).' nm</i>'; |
|
562 | + } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
|
563 | + echo '<br/><i>'.round($distance*0.621371).' mi</i>'; |
|
564 | + } elseif ((!isset($_COOKIE['unitdistance']) && ((isset($globalUnitDistance) && $globalUnitDistance == 'km') || !isset($globalUnitDistance))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) { |
|
565 | + echo '<br/><i>'.$distance.' km</i>'; |
|
566 | + } |
|
567 | 567 | } |
568 | 568 | } |
569 | 569 | print '</td>'."\n"; |
@@ -624,13 +624,13 @@ discard block |
||
624 | 624 | $distance = $Spotter->getAirportDistance($spotter_item['arrival_airport'],$latitude,$longitude); |
625 | 625 | } else $distance = ''; |
626 | 626 | if ($distance != '') { |
627 | - if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
|
628 | - echo '<br/><i>'.round($distance*0.539957).' nm</i>'; |
|
629 | - } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
|
630 | - echo '<br/><i>'.round($distance*0.621371).' mi</i>'; |
|
631 | - } elseif ((!isset($_COOKIE['unitdistance']) && ((isset($globalUnitDistance) && $globalUnitDistance == 'km') || !isset($globalUnitDistance))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) { |
|
632 | - echo '<br/><i>'.$distance.' km</i>'; |
|
633 | - } |
|
627 | + if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
|
628 | + echo '<br/><i>'.round($distance*0.539957).' nm</i>'; |
|
629 | + } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
|
630 | + echo '<br/><i>'.round($distance*0.621371).' mi</i>'; |
|
631 | + } elseif ((!isset($_COOKIE['unitdistance']) && ((isset($globalUnitDistance) && $globalUnitDistance == 'km') || !isset($globalUnitDistance))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) { |
|
632 | + echo '<br/><i>'.$distance.' km</i>'; |
|
633 | + } |
|
634 | 634 | } |
635 | 635 | } |
636 | 636 | print '</td>'."\n"; |
@@ -8,18 +8,18 @@ discard block |
||
8 | 8 | class update_schema { |
9 | 9 | |
10 | 10 | public static function update_schedule() { |
11 | - $Connection = new Connection(); |
|
12 | - $Schedule = new Schedule(); |
|
13 | - $query = "SELECT * FROM schedule"; |
|
14 | - try { |
|
15 | - $sth = $Connection->db->prepare($query); |
|
11 | + $Connection = new Connection(); |
|
12 | + $Schedule = new Schedule(); |
|
13 | + $query = "SELECT * FROM schedule"; |
|
14 | + try { |
|
15 | + $sth = $Connection->db->prepare($query); |
|
16 | 16 | $sth->execute(); |
17 | - } catch(PDOException $e) { |
|
17 | + } catch(PDOException $e) { |
|
18 | 18 | return "error : ".$e->getMessage()."\n"; |
19 | - } |
|
20 | - while ($row = $sth->fetch(PDO::FETCH_ASSOC)) { |
|
21 | - $Schedule->addSchedule($row['ident'],$row['departure_airport_icao'],$row['departure_airport_time'],$row['arrival_airport_icao'],$row['arrival_airport_time']); |
|
22 | - } |
|
19 | + } |
|
20 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) { |
|
21 | + $Schedule->addSchedule($row['ident'],$row['departure_airport_icao'],$row['departure_airport_time'],$row['arrival_airport_icao'],$row['arrival_airport_time']); |
|
22 | + } |
|
23 | 23 | |
24 | 24 | } |
25 | 25 | /* |
@@ -43,198 +43,198 @@ discard block |
||
43 | 43 | } |
44 | 44 | */ |
45 | 45 | private static function update_from_1() { |
46 | - $Connection = new Connection(); |
|
47 | - // Add new column to routes table |
|
48 | - //$query = "ALTER TABLE `routes` ADD `FromAirport_Time` VARCHAR(10),`ToAirport_Time` VARCHAR(10),`Source` VARCHAR(255),`date_added` DATETIME DEFAULT CURRENT TIMESTAMP,`date_modified` DATETIME,`date_lastseen` DATETIME"; |
|
46 | + $Connection = new Connection(); |
|
47 | + // Add new column to routes table |
|
48 | + //$query = "ALTER TABLE `routes` ADD `FromAirport_Time` VARCHAR(10),`ToAirport_Time` VARCHAR(10),`Source` VARCHAR(255),`date_added` DATETIME DEFAULT CURRENT TIMESTAMP,`date_modified` DATETIME,`date_lastseen` DATETIME"; |
|
49 | 49 | $query = "ALTER TABLE `routes` ADD `FromAirport_Time` VARCHAR(10) NULL , ADD `ToAirport_Time` VARCHAR(10) NULL , ADD `Source` VARCHAR(255) NULL, ADD `date_added` timestamp DEFAULT CURRENT_TIMESTAMP, ADD `date_modified` timestamp NULL, ADD `date_lastseen` timestamp NULL"; |
50 | - try { |
|
51 | - $sth = $Connection->db->prepare($query); |
|
52 | - $sth->execute(); |
|
53 | - } catch(PDOException $e) { |
|
54 | - return "error (add new columns to routes table) : ".$e->getMessage()."\n"; |
|
55 | - } |
|
56 | - // Copy schedules data to routes table |
|
57 | - self::update_schedule(); |
|
58 | - // Delete schedule table |
|
50 | + try { |
|
51 | + $sth = $Connection->db->prepare($query); |
|
52 | + $sth->execute(); |
|
53 | + } catch(PDOException $e) { |
|
54 | + return "error (add new columns to routes table) : ".$e->getMessage()."\n"; |
|
55 | + } |
|
56 | + // Copy schedules data to routes table |
|
57 | + self::update_schedule(); |
|
58 | + // Delete schedule table |
|
59 | 59 | $query = "DROP TABLE `schedule`"; |
60 | - try { |
|
61 | - $sth = $Connection->db->prepare($query); |
|
62 | - $sth->execute(); |
|
63 | - } catch(PDOException $e) { |
|
64 | - return "error (delete schedule table) : ".$e->getMessage()."\n"; |
|
65 | - } |
|
66 | - // Add source column |
|
67 | - $query = "ALTER TABLE `aircraft_modes` ADD `Source` VARCHAR(255) NULL"; |
|
68 | - try { |
|
69 | - $sth = $Connection->db->prepare($query); |
|
70 | - $sth->execute(); |
|
71 | - } catch(PDOException $e) { |
|
72 | - return "error (add source column to aircraft_modes) : ".$e->getMessage()."\n"; |
|
73 | - } |
|
60 | + try { |
|
61 | + $sth = $Connection->db->prepare($query); |
|
62 | + $sth->execute(); |
|
63 | + } catch(PDOException $e) { |
|
64 | + return "error (delete schedule table) : ".$e->getMessage()."\n"; |
|
65 | + } |
|
66 | + // Add source column |
|
67 | + $query = "ALTER TABLE `aircraft_modes` ADD `Source` VARCHAR(255) NULL"; |
|
68 | + try { |
|
69 | + $sth = $Connection->db->prepare($query); |
|
70 | + $sth->execute(); |
|
71 | + } catch(PDOException $e) { |
|
72 | + return "error (add source column to aircraft_modes) : ".$e->getMessage()."\n"; |
|
73 | + } |
|
74 | 74 | // Delete unused column |
75 | 75 | $query = "ALTER TABLE `aircraft_modes` DROP `SerialNo`, DROP `OperatorFlagCode`, DROP `Manufacturer`, DROP `Type`, DROP `FirstRegDate`, DROP `CurrentRegDate`, DROP `Country`, DROP `PreviousID`, DROP `DeRegDate`, DROP `Status`, DROP `PopularName`, DROP `GenericName`, DROP `AircraftClass`, DROP `Engines`, DROP `OwnershipStatus`, DROP `RegisteredOwners`, DROP `MTOW`, DROP `TotalHours`, DROP `YearBuilt`, DROP `CofACategory`, DROP `CofAExpiry`, DROP `UserNotes`, DROP `Interested`, DROP `UserTag`, DROP `InfoUrl`, DROP `PictureUrl1`, DROP `PictureUrl2`, DROP `PictureUrl3`, DROP `UserBool1`, DROP `UserBool2`, DROP `UserBool3`, DROP `UserBool4`, DROP `UserBool5`, DROP `UserString1`, DROP `UserString2`, DROP `UserString3`, DROP `UserString4`, DROP `UserString5`, DROP `UserInt1`, DROP `UserInt2`, DROP `UserInt3`, DROP `UserInt4`, DROP `UserInt5`"; |
76 | - try { |
|
77 | - $sth = $Connection->db->prepare($query); |
|
78 | - $sth->execute(); |
|
79 | - } catch(PDOException $e) { |
|
80 | - return "error (Delete unused column of aircraft_modes) : ".$e->getMessage()."\n"; |
|
81 | - } |
|
76 | + try { |
|
77 | + $sth = $Connection->db->prepare($query); |
|
78 | + $sth->execute(); |
|
79 | + } catch(PDOException $e) { |
|
80 | + return "error (Delete unused column of aircraft_modes) : ".$e->getMessage()."\n"; |
|
81 | + } |
|
82 | 82 | // Add ModeS column |
83 | 83 | $query = "ALTER TABLE `spotter_output` ADD `ModeS` VARCHAR(255) NULL"; |
84 | - try { |
|
85 | - $sth = $Connection->db->prepare($query); |
|
86 | - $sth->execute(); |
|
87 | - } catch(PDOException $e) { |
|
88 | - return "error (Add ModeS column in spotter_output) : ".$e->getMessage()."\n"; |
|
89 | - } |
|
84 | + try { |
|
85 | + $sth = $Connection->db->prepare($query); |
|
86 | + $sth->execute(); |
|
87 | + } catch(PDOException $e) { |
|
88 | + return "error (Add ModeS column in spotter_output) : ".$e->getMessage()."\n"; |
|
89 | + } |
|
90 | 90 | $query = "ALTER TABLE `spotter_live` ADD `ModeS` VARCHAR(255)"; |
91 | - try { |
|
92 | - $sth = $Connection->db->prepare($query); |
|
93 | - $sth->execute(); |
|
94 | - } catch(PDOException $e) { |
|
95 | - return "error (Add ModeS column in spotter_live) : ".$e->getMessage()."\n"; |
|
96 | - } |
|
97 | - // Add auto_increment for aircraft_modes |
|
98 | - $query = "ALTER TABLE `aircraft_modes` CHANGE `AircraftID` `AircraftID` INT(11) NOT NULL AUTO_INCREMENT"; |
|
99 | - try { |
|
100 | - $sth = $Connection->db->prepare($query); |
|
101 | - $sth->execute(); |
|
102 | - } catch(PDOException $e) { |
|
103 | - return "error (Add Auto increment in aircraft_modes) : ".$e->getMessage()."\n"; |
|
104 | - } |
|
105 | - $error = ''; |
|
91 | + try { |
|
92 | + $sth = $Connection->db->prepare($query); |
|
93 | + $sth->execute(); |
|
94 | + } catch(PDOException $e) { |
|
95 | + return "error (Add ModeS column in spotter_live) : ".$e->getMessage()."\n"; |
|
96 | + } |
|
97 | + // Add auto_increment for aircraft_modes |
|
98 | + $query = "ALTER TABLE `aircraft_modes` CHANGE `AircraftID` `AircraftID` INT(11) NOT NULL AUTO_INCREMENT"; |
|
99 | + try { |
|
100 | + $sth = $Connection->db->prepare($query); |
|
101 | + $sth->execute(); |
|
102 | + } catch(PDOException $e) { |
|
103 | + return "error (Add Auto increment in aircraft_modes) : ".$e->getMessage()."\n"; |
|
104 | + } |
|
105 | + $error = ''; |
|
106 | 106 | $error .= create_db::import_file('../db/acars_live.sql'); |
107 | 107 | $error .= create_db::import_file('../db/config.sql'); |
108 | 108 | // Update schema_version to 2 |
109 | 109 | $query = "UPDATE `config` SET `value` = '2' WHERE `name` = 'schema_version'"; |
110 | - try { |
|
111 | - $sth = $Connection->db->prepare($query); |
|
112 | - $sth->execute(); |
|
113 | - } catch(PDOException $e) { |
|
114 | - return "error (update schema_version) : ".$e->getMessage()."\n"; |
|
115 | - } |
|
110 | + try { |
|
111 | + $sth = $Connection->db->prepare($query); |
|
112 | + $sth->execute(); |
|
113 | + } catch(PDOException $e) { |
|
114 | + return "error (update schema_version) : ".$e->getMessage()."\n"; |
|
115 | + } |
|
116 | 116 | return $error; |
117 | - } |
|
117 | + } |
|
118 | 118 | |
119 | 119 | private static function update_from_2() { |
120 | - $Connection = new Connection(); |
|
121 | - // Add new column decode to acars_live table |
|
120 | + $Connection = new Connection(); |
|
121 | + // Add new column decode to acars_live table |
|
122 | 122 | $query = "ALTER TABLE `acars_live` ADD `decode` TEXT"; |
123 | - try { |
|
124 | - $sth = $Connection->db->prepare($query); |
|
125 | - $sth->execute(); |
|
126 | - } catch(PDOException $e) { |
|
127 | - return "error (add new columns to routes table) : ".$e->getMessage()."\n"; |
|
128 | - } |
|
129 | - $error = ''; |
|
130 | - // Create table acars_archive |
|
123 | + try { |
|
124 | + $sth = $Connection->db->prepare($query); |
|
125 | + $sth->execute(); |
|
126 | + } catch(PDOException $e) { |
|
127 | + return "error (add new columns to routes table) : ".$e->getMessage()."\n"; |
|
128 | + } |
|
129 | + $error = ''; |
|
130 | + // Create table acars_archive |
|
131 | 131 | $error .= create_db::import_file('../db/acars_archive.sql'); |
132 | 132 | // Update schema_version to 3 |
133 | 133 | $query = "UPDATE `config` SET `value` = '3' WHERE `name` = 'schema_version'"; |
134 | - try { |
|
135 | - $sth = $Connection->db->prepare($query); |
|
136 | - $sth->execute(); |
|
137 | - } catch(PDOException $e) { |
|
138 | - return "error (update schema_version) : ".$e->getMessage()."\n"; |
|
139 | - } |
|
134 | + try { |
|
135 | + $sth = $Connection->db->prepare($query); |
|
136 | + $sth->execute(); |
|
137 | + } catch(PDOException $e) { |
|
138 | + return "error (update schema_version) : ".$e->getMessage()."\n"; |
|
139 | + } |
|
140 | 140 | return $error; |
141 | 141 | } |
142 | 142 | |
143 | 143 | private static function update_from_3() { |
144 | - $Connection = new Connection(); |
|
145 | - // Add default CURRENT_TIMESTAMP to aircraft_modes column FirstCreated |
|
144 | + $Connection = new Connection(); |
|
145 | + // Add default CURRENT_TIMESTAMP to aircraft_modes column FirstCreated |
|
146 | 146 | $query = "ALTER TABLE `aircraft_modes` CHANGE `FirstCreated` `FirstCreated` timestamp DEFAULT CURRENT_TIMESTAMP"; |
147 | - try { |
|
148 | - $sth = $Connection->db->prepare($query); |
|
149 | - $sth->execute(); |
|
150 | - } catch(PDOException $e) { |
|
151 | - return "error (add new columns to aircraft_modes) : ".$e->getMessage()."\n"; |
|
152 | - } |
|
153 | - // Add image_source_website column to spotter_image |
|
147 | + try { |
|
148 | + $sth = $Connection->db->prepare($query); |
|
149 | + $sth->execute(); |
|
150 | + } catch(PDOException $e) { |
|
151 | + return "error (add new columns to aircraft_modes) : ".$e->getMessage()."\n"; |
|
152 | + } |
|
153 | + // Add image_source_website column to spotter_image |
|
154 | 154 | $query = "ALTER TABLE `spotter_image` ADD `image_source_website` VARCHAR(999) NULL"; |
155 | - try { |
|
156 | - $sth = $Connection->db->prepare($query); |
|
157 | - $sth->execute(); |
|
158 | - } catch(PDOException $e) { |
|
159 | - return "error (add new columns to spotter_image) : ".$e->getMessage()."\n"; |
|
160 | - } |
|
161 | - $error = ''; |
|
155 | + try { |
|
156 | + $sth = $Connection->db->prepare($query); |
|
157 | + $sth->execute(); |
|
158 | + } catch(PDOException $e) { |
|
159 | + return "error (add new columns to spotter_image) : ".$e->getMessage()."\n"; |
|
160 | + } |
|
161 | + $error = ''; |
|
162 | 162 | // Update schema_version to 4 |
163 | 163 | $query = "UPDATE `config` SET `value` = '4' WHERE `name` = 'schema_version'"; |
164 | - try { |
|
165 | - $sth = $Connection->db->prepare($query); |
|
166 | - $sth->execute(); |
|
167 | - } catch(PDOException $e) { |
|
168 | - return "error (update schema_version) : ".$e->getMessage()."\n"; |
|
169 | - } |
|
164 | + try { |
|
165 | + $sth = $Connection->db->prepare($query); |
|
166 | + $sth->execute(); |
|
167 | + } catch(PDOException $e) { |
|
168 | + return "error (update schema_version) : ".$e->getMessage()."\n"; |
|
169 | + } |
|
170 | 170 | return $error; |
171 | 171 | } |
172 | 172 | |
173 | 173 | private static function update_from_4() { |
174 | - $Connection = new Connection(); |
|
174 | + $Connection = new Connection(); |
|
175 | 175 | |
176 | - $error = ''; |
|
177 | - // Create table acars_label |
|
176 | + $error = ''; |
|
177 | + // Create table acars_label |
|
178 | 178 | $error .= create_db::import_file('../db/acars_label.sql'); |
179 | 179 | if ($error == '') { |
180 | - // Update schema_version to 5 |
|
181 | - $query = "UPDATE `config` SET `value` = '5' WHERE `name` = 'schema_version'"; |
|
182 | - try { |
|
183 | - $sth = $Connection->db->prepare($query); |
|
180 | + // Update schema_version to 5 |
|
181 | + $query = "UPDATE `config` SET `value` = '5' WHERE `name` = 'schema_version'"; |
|
182 | + try { |
|
183 | + $sth = $Connection->db->prepare($query); |
|
184 | 184 | $sth->execute(); |
185 | - } catch(PDOException $e) { |
|
185 | + } catch(PDOException $e) { |
|
186 | 186 | return "error (update schema_version) : ".$e->getMessage()."\n"; |
187 | - } |
|
188 | - } |
|
187 | + } |
|
188 | + } |
|
189 | 189 | return $error; |
190 | 190 | } |
191 | 191 | |
192 | 192 | private static function update_from_5() { |
193 | - $Connection = new Connection(); |
|
194 | - // Add columns to translation |
|
193 | + $Connection = new Connection(); |
|
194 | + // Add columns to translation |
|
195 | 195 | $query = "ALTER TABLE `translation` ADD `Source` VARCHAR(255) NULL, ADD `date_added` timestamp DEFAULT CURRENT_TIMESTAMP , ADD `date_modified` timestamp DEFAULT CURRENT_TIMESTAMP ;"; |
196 | - try { |
|
197 | - $sth = $Connection->db->prepare($query); |
|
198 | - $sth->execute(); |
|
199 | - } catch(PDOException $e) { |
|
200 | - return "error (add new columns to translation) : ".$e->getMessage()."\n"; |
|
201 | - } |
|
202 | - // Add aircraft_shadow column to aircraft |
|
203 | - $query = "ALTER TABLE `aircraft` ADD `aircraft_shadow` VARCHAR(255) NULL"; |
|
204 | - try { |
|
205 | - $sth = $Connection->db->prepare($query); |
|
206 | - $sth->execute(); |
|
207 | - } catch(PDOException $e) { |
|
208 | - return "error (add new column to aircraft) : ".$e->getMessage()."\n"; |
|
209 | - } |
|
210 | - // Add aircraft_shadow column to spotter_live |
|
211 | - $query = "ALTER TABLE `spotter_live` ADD `aircraft_shadow` VARCHAR(255) NULL"; |
|
212 | - try { |
|
213 | - $sth = $Connection->db->prepare($query); |
|
214 | - $sth->execute(); |
|
215 | - } catch(PDOException $e) { |
|
216 | - return "error (add new column to spotter_live) : ".$e->getMessage()."\n"; |
|
217 | - } |
|
218 | - $error = ''; |
|
219 | - // Update table aircraft |
|
196 | + try { |
|
197 | + $sth = $Connection->db->prepare($query); |
|
198 | + $sth->execute(); |
|
199 | + } catch(PDOException $e) { |
|
200 | + return "error (add new columns to translation) : ".$e->getMessage()."\n"; |
|
201 | + } |
|
202 | + // Add aircraft_shadow column to aircraft |
|
203 | + $query = "ALTER TABLE `aircraft` ADD `aircraft_shadow` VARCHAR(255) NULL"; |
|
204 | + try { |
|
205 | + $sth = $Connection->db->prepare($query); |
|
206 | + $sth->execute(); |
|
207 | + } catch(PDOException $e) { |
|
208 | + return "error (add new column to aircraft) : ".$e->getMessage()."\n"; |
|
209 | + } |
|
210 | + // Add aircraft_shadow column to spotter_live |
|
211 | + $query = "ALTER TABLE `spotter_live` ADD `aircraft_shadow` VARCHAR(255) NULL"; |
|
212 | + try { |
|
213 | + $sth = $Connection->db->prepare($query); |
|
214 | + $sth->execute(); |
|
215 | + } catch(PDOException $e) { |
|
216 | + return "error (add new column to spotter_live) : ".$e->getMessage()."\n"; |
|
217 | + } |
|
218 | + $error = ''; |
|
219 | + // Update table aircraft |
|
220 | 220 | $error .= create_db::import_file('../db/aircraft.sql'); |
221 | 221 | $error .= create_db::import_file('../db/spotter_archive.sql'); |
222 | 222 | |
223 | 223 | // Update schema_version to 6 |
224 | 224 | $query = "UPDATE `config` SET `value` = '6' WHERE `name` = 'schema_version'"; |
225 | - try { |
|
226 | - $sth = $Connection->db->prepare($query); |
|
227 | - $sth->execute(); |
|
228 | - } catch(PDOException $e) { |
|
229 | - return "error (update schema_version) : ".$e->getMessage()."\n"; |
|
230 | - } |
|
225 | + try { |
|
226 | + $sth = $Connection->db->prepare($query); |
|
227 | + $sth->execute(); |
|
228 | + } catch(PDOException $e) { |
|
229 | + return "error (update schema_version) : ".$e->getMessage()."\n"; |
|
230 | + } |
|
231 | 231 | return $error; |
232 | 232 | } |
233 | 233 | |
234 | 234 | private static function update_from_6() { |
235 | - $Connection = new Connection(); |
|
236 | - if (!$Connection->indexExists('spotter_output','flightaware_id')) { |
|
237 | - $query = "ALTER TABLE spotter_output ADD INDEX(flightaware_id); |
|
235 | + $Connection = new Connection(); |
|
236 | + if (!$Connection->indexExists('spotter_output','flightaware_id')) { |
|
237 | + $query = "ALTER TABLE spotter_output ADD INDEX(flightaware_id); |
|
238 | 238 | ALTER TABLE spotter_output ADD INDEX(date); |
239 | 239 | ALTER TABLE spotter_output ADD INDEX(ident); |
240 | 240 | ALTER TABLE spotter_live ADD INDEX(flightaware_id); |
@@ -247,147 +247,147 @@ discard block |
||
247 | 247 | ALTER TABLE aircraft ADD INDEX(icao); |
248 | 248 | ALTER TABLE airport ADD INDEX(icao); |
249 | 249 | ALTER TABLE translation ADD INDEX(Operator);"; |
250 | - try { |
|
251 | - $sth = $Connection->db->prepare($query); |
|
250 | + try { |
|
251 | + $sth = $Connection->db->prepare($query); |
|
252 | 252 | $sth->execute(); |
253 | - } catch(PDOException $e) { |
|
253 | + } catch(PDOException $e) { |
|
254 | 254 | return "error (add some indexes) : ".$e->getMessage()."\n"; |
255 | - } |
|
256 | - } |
|
257 | - $error = ''; |
|
258 | - // Update table countries |
|
259 | - if ($Connection->tableExists('airspace')) { |
|
260 | - $error .= update_db::update_countries(); |
|
261 | - if ($error != '') return $error; |
|
255 | + } |
|
256 | + } |
|
257 | + $error = ''; |
|
258 | + // Update table countries |
|
259 | + if ($Connection->tableExists('airspace')) { |
|
260 | + $error .= update_db::update_countries(); |
|
261 | + if ($error != '') return $error; |
|
262 | 262 | } |
263 | 263 | // Update schema_version to 7 |
264 | 264 | $query = "UPDATE `config` SET `value` = '7' WHERE `name` = 'schema_version'"; |
265 | - try { |
|
266 | - $sth = $Connection->db->prepare($query); |
|
267 | - $sth->execute(); |
|
268 | - } catch(PDOException $e) { |
|
269 | - return "error (update schema_version) : ".$e->getMessage()."\n"; |
|
270 | - } |
|
265 | + try { |
|
266 | + $sth = $Connection->db->prepare($query); |
|
267 | + $sth->execute(); |
|
268 | + } catch(PDOException $e) { |
|
269 | + return "error (update schema_version) : ".$e->getMessage()."\n"; |
|
270 | + } |
|
271 | 271 | return $error; |
272 | - } |
|
272 | + } |
|
273 | 273 | |
274 | 274 | private static function update_from_7() { |
275 | 275 | global $globalDBname, $globalDBdriver; |
276 | - $Connection = new Connection(); |
|
277 | - $query="ALTER TABLE spotter_live ADD pilot_name VARCHAR(255) NULL, ADD pilot_id VARCHAR(255) NULL; |
|
276 | + $Connection = new Connection(); |
|
277 | + $query="ALTER TABLE spotter_live ADD pilot_name VARCHAR(255) NULL, ADD pilot_id VARCHAR(255) NULL; |
|
278 | 278 | ALTER TABLE spotter_output ADD pilot_name VARCHAR(255) NULL, ADD pilot_id VARCHAR(255) NULL;"; |
279 | - try { |
|
280 | - $sth = $Connection->db->prepare($query); |
|
281 | - $sth->execute(); |
|
282 | - } catch(PDOException $e) { |
|
283 | - return "error (add pilot column to spotter_live and spotter_output) : ".$e->getMessage()."\n"; |
|
284 | - } |
|
285 | - if ($globalDBdriver == 'mysql') { |
|
286 | - $query = "SELECT ENGINE FROM information_schema.TABLES where TABLE_SCHEMA = '".$globalDBname."' AND TABLE_NAME = 'spotter_archive'"; |
|
287 | - try { |
|
288 | - $sth = $Connection->db->prepare($query); |
|
279 | + try { |
|
280 | + $sth = $Connection->db->prepare($query); |
|
281 | + $sth->execute(); |
|
282 | + } catch(PDOException $e) { |
|
283 | + return "error (add pilot column to spotter_live and spotter_output) : ".$e->getMessage()."\n"; |
|
284 | + } |
|
285 | + if ($globalDBdriver == 'mysql') { |
|
286 | + $query = "SELECT ENGINE FROM information_schema.TABLES where TABLE_SCHEMA = '".$globalDBname."' AND TABLE_NAME = 'spotter_archive'"; |
|
287 | + try { |
|
288 | + $sth = $Connection->db->prepare($query); |
|
289 | 289 | $sth->execute(); |
290 | - } catch(PDOException $e) { |
|
290 | + } catch(PDOException $e) { |
|
291 | 291 | return "error (problem when select engine for spotter_engine) : ".$e->getMessage()."\n"; |
292 | - } |
|
293 | - $row = $sth->fetch(PDO::FETCH_ASSOC); |
|
294 | - if ($row['engine'] == 'ARCHIVE') { |
|
292 | + } |
|
293 | + $row = $sth->fetch(PDO::FETCH_ASSOC); |
|
294 | + if ($row['engine'] == 'ARCHIVE') { |
|
295 | 295 | $query = "CREATE TABLE copy LIKE spotter_archive; |
296 | 296 | ALTER TABLE copy ENGINE=ARCHIVE; |
297 | 297 | ALTER TABLE copy ADD pilot_name VARCHAR(255) NULL, ADD pilot_id VARCHAR(255) NULL; |
298 | 298 | INSERT INTO copy SELECT *, '' as pilot_name, '' as pilot_id FROM spotter_archive ORDER BY `spotter_archive_id`; |
299 | 299 | DROP TABLE spotter_archive; |
300 | 300 | RENAME TABLE copy TO spotter_archive;"; |
301 | - } else { |
|
302 | - $query="ALTER TABLE spotter_archive ADD pilot_name VARCHAR(255) NULL, ADD pilot_id VARCHAR(255) NULL"; |
|
303 | - } |
|
304 | - } else { |
|
305 | - $query="ALTER TABLE spotter_archive ADD pilot_name VARCHAR(255) NULL, ADD pilot_id VARCHAR(255) NULL"; |
|
306 | - } |
|
307 | - try { |
|
308 | - $sth = $Connection->db->prepare($query); |
|
309 | - $sth->execute(); |
|
310 | - } catch(PDOException $e) { |
|
311 | - return "error (add pilot column to spotter_archive) : ".$e->getMessage()."\n"; |
|
312 | - } |
|
301 | + } else { |
|
302 | + $query="ALTER TABLE spotter_archive ADD pilot_name VARCHAR(255) NULL, ADD pilot_id VARCHAR(255) NULL"; |
|
303 | + } |
|
304 | + } else { |
|
305 | + $query="ALTER TABLE spotter_archive ADD pilot_name VARCHAR(255) NULL, ADD pilot_id VARCHAR(255) NULL"; |
|
306 | + } |
|
307 | + try { |
|
308 | + $sth = $Connection->db->prepare($query); |
|
309 | + $sth->execute(); |
|
310 | + } catch(PDOException $e) { |
|
311 | + return "error (add pilot column to spotter_archive) : ".$e->getMessage()."\n"; |
|
312 | + } |
|
313 | 313 | |
314 | - $error = ''; |
|
315 | - // Update table aircraft |
|
314 | + $error = ''; |
|
315 | + // Update table aircraft |
|
316 | 316 | $error .= create_db::import_file('../db/source_location.sql'); |
317 | 317 | if ($error != '') return $error; |
318 | 318 | // Update schema_version to 6 |
319 | 319 | $query = "UPDATE `config` SET `value` = '8' WHERE `name` = 'schema_version'"; |
320 | - try { |
|
321 | - $sth = $Connection->db->prepare($query); |
|
322 | - $sth->execute(); |
|
323 | - } catch(PDOException $e) { |
|
324 | - return "error (update schema_version) : ".$e->getMessage()."\n"; |
|
325 | - } |
|
320 | + try { |
|
321 | + $sth = $Connection->db->prepare($query); |
|
322 | + $sth->execute(); |
|
323 | + } catch(PDOException $e) { |
|
324 | + return "error (update schema_version) : ".$e->getMessage()."\n"; |
|
325 | + } |
|
326 | 326 | return $error; |
327 | 327 | } |
328 | 328 | |
329 | 329 | private static function update_from_8() { |
330 | - $Connection = new Connection(); |
|
331 | - $error = ''; |
|
332 | - // Update table aircraft |
|
330 | + $Connection = new Connection(); |
|
331 | + $error = ''; |
|
332 | + // Update table aircraft |
|
333 | 333 | $error .= create_db::import_file('../db/notam.sql'); |
334 | 334 | if ($error != '') return $error; |
335 | 335 | $query = "DELETE FROM config WHERE name = 'last_update_db'; |
336 | 336 | INSERT INTO config (name,value) VALUES ('last_update_db',NOW()); |
337 | 337 | DELETE FROM config WHERE name = 'last_update_notam_db'; |
338 | 338 | INSERT INTO config (name,value) VALUES ('last_update_notam_db',NOW());"; |
339 | - try { |
|
340 | - $sth = $Connection->db->prepare($query); |
|
341 | - $sth->execute(); |
|
342 | - } catch(PDOException $e) { |
|
343 | - return "error (insert last_update values) : ".$e->getMessage()."\n"; |
|
344 | - } |
|
339 | + try { |
|
340 | + $sth = $Connection->db->prepare($query); |
|
341 | + $sth->execute(); |
|
342 | + } catch(PDOException $e) { |
|
343 | + return "error (insert last_update values) : ".$e->getMessage()."\n"; |
|
344 | + } |
|
345 | 345 | $query = "UPDATE `config` SET `value` = '9' WHERE `name` = 'schema_version'"; |
346 | - try { |
|
347 | - $sth = $Connection->db->prepare($query); |
|
348 | - $sth->execute(); |
|
349 | - } catch(PDOException $e) { |
|
350 | - return "error (update schema_version) : ".$e->getMessage()."\n"; |
|
351 | - } |
|
346 | + try { |
|
347 | + $sth = $Connection->db->prepare($query); |
|
348 | + $sth->execute(); |
|
349 | + } catch(PDOException $e) { |
|
350 | + return "error (update schema_version) : ".$e->getMessage()."\n"; |
|
351 | + } |
|
352 | 352 | return $error; |
353 | 353 | } |
354 | 354 | |
355 | 355 | private static function update_from_9() { |
356 | - $Connection = new Connection(); |
|
357 | - $query="ALTER TABLE spotter_live ADD verticalrate INT(11) NULL; |
|
356 | + $Connection = new Connection(); |
|
357 | + $query="ALTER TABLE spotter_live ADD verticalrate INT(11) NULL; |
|
358 | 358 | ALTER TABLE spotter_output ADD verticalrate INT(11) NULL;"; |
359 | - try { |
|
360 | - $sth = $Connection->db->prepare($query); |
|
361 | - $sth->execute(); |
|
362 | - } catch(PDOException $e) { |
|
363 | - return "error (add verticalrate column to spotter_live and spotter_output) : ".$e->getMessage()."\n"; |
|
364 | - } |
|
359 | + try { |
|
360 | + $sth = $Connection->db->prepare($query); |
|
361 | + $sth->execute(); |
|
362 | + } catch(PDOException $e) { |
|
363 | + return "error (add verticalrate column to spotter_live and spotter_output) : ".$e->getMessage()."\n"; |
|
364 | + } |
|
365 | 365 | $error = ''; |
366 | - // Update table atc |
|
366 | + // Update table atc |
|
367 | 367 | $error .= create_db::import_file('../db/atc.sql'); |
368 | 368 | if ($error != '') return $error; |
369 | 369 | |
370 | 370 | $query = "UPDATE `config` SET `value` = '10' WHERE `name` = 'schema_version'"; |
371 | - try { |
|
372 | - $sth = $Connection->db->prepare($query); |
|
373 | - $sth->execute(); |
|
374 | - } catch(PDOException $e) { |
|
375 | - return "error (update schema_version) : ".$e->getMessage()."\n"; |
|
376 | - } |
|
371 | + try { |
|
372 | + $sth = $Connection->db->prepare($query); |
|
373 | + $sth->execute(); |
|
374 | + } catch(PDOException $e) { |
|
375 | + return "error (update schema_version) : ".$e->getMessage()."\n"; |
|
376 | + } |
|
377 | 377 | return $error; |
378 | 378 | } |
379 | 379 | |
380 | 380 | private static function update_from_10() { |
381 | - $Connection = new Connection(); |
|
382 | - $query="ALTER TABLE atc CHANGE `type` `type` ENUM('Observer','Flight Information','Delivery','Tower','Approach','ACC','Departure','Ground','Flight Service Station','Control Radar or Centre') CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL"; |
|
383 | - try { |
|
384 | - $sth = $Connection->db->prepare($query); |
|
385 | - $sth->execute(); |
|
386 | - } catch(PDOException $e) { |
|
387 | - return "error (add new enum to ATC table) : ".$e->getMessage()."\n"; |
|
388 | - } |
|
381 | + $Connection = new Connection(); |
|
382 | + $query="ALTER TABLE atc CHANGE `type` `type` ENUM('Observer','Flight Information','Delivery','Tower','Approach','ACC','Departure','Ground','Flight Service Station','Control Radar or Centre') CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL"; |
|
383 | + try { |
|
384 | + $sth = $Connection->db->prepare($query); |
|
385 | + $sth->execute(); |
|
386 | + } catch(PDOException $e) { |
|
387 | + return "error (add new enum to ATC table) : ".$e->getMessage()."\n"; |
|
388 | + } |
|
389 | 389 | $error = ''; |
390 | - // Add tables |
|
390 | + // Add tables |
|
391 | 391 | $error .= create_db::import_file('../db/aircraft_owner.sql'); |
392 | 392 | if ($error != '') return $error; |
393 | 393 | $error .= create_db::import_file('../db/metar.sql'); |
@@ -398,76 +398,76 @@ discard block |
||
398 | 398 | if ($error != '') return $error; |
399 | 399 | |
400 | 400 | $query = "UPDATE `config` SET `value` = '11' WHERE `name` = 'schema_version'"; |
401 | - try { |
|
402 | - $sth = $Connection->db->prepare($query); |
|
403 | - $sth->execute(); |
|
404 | - } catch(PDOException $e) { |
|
405 | - return "error (update schema_version) : ".$e->getMessage()."\n"; |
|
406 | - } |
|
401 | + try { |
|
402 | + $sth = $Connection->db->prepare($query); |
|
403 | + $sth->execute(); |
|
404 | + } catch(PDOException $e) { |
|
405 | + return "error (update schema_version) : ".$e->getMessage()."\n"; |
|
406 | + } |
|
407 | 407 | return $error; |
408 | 408 | } |
409 | 409 | |
410 | 410 | private static function update_from_11() { |
411 | 411 | global $globalDBdriver, $globalDBname; |
412 | - $Connection = new Connection(); |
|
413 | - $query="ALTER TABLE spotter_output ADD owner_name VARCHAR(255) NULL DEFAULT NULL, ADD format_source VARCHAR(255) NULL DEFAULT NULL, ADD ground BOOLEAN NOT NULL DEFAULT FALSE, ADD last_ground BOOLEAN NOT NULL DEFAULT FALSE, ADD last_seen DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, ADD last_latitude FLOAT NULL, ADD last_longitude FLOAT NULL, ADD last_altitude INT(11) NULL, ADD last_ground_speed INT(11), ADD real_arrival_airport_icao VARCHAR(999), ADD real_arrival_airport_time VARCHAR(20),ADD real_departure_airport_icao VARCHAR(999), ADD real_departure_airport_time VARCHAR(20)"; |
|
414 | - try { |
|
415 | - $sth = $Connection->db->prepare($query); |
|
416 | - $sth->execute(); |
|
417 | - } catch(PDOException $e) { |
|
418 | - return "error (add owner_name & format_source column to spotter_output) : ".$e->getMessage()."\n"; |
|
419 | - } |
|
420 | - $query="ALTER TABLE spotter_live ADD format_source VARCHAR(255) NULL DEFAULT NULL, ADD ground BOOLEAN NOT NULL DEFAULT FALSE"; |
|
421 | - try { |
|
422 | - $sth = $Connection->db->prepare($query); |
|
423 | - $sth->execute(); |
|
424 | - } catch(PDOException $e) { |
|
425 | - return "error (format_source column to spotter_live) : ".$e->getMessage()."\n"; |
|
426 | - } |
|
427 | - if ($globalDBdriver == 'mysql') { |
|
428 | - $query = "SELECT ENGINE FROM information_schema.TABLES where TABLE_SCHEMA = '".$globalDBname."' AND TABLE_NAME = 'spotter_archive'"; |
|
429 | - try { |
|
430 | - $sth = $Connection->db->prepare($query); |
|
412 | + $Connection = new Connection(); |
|
413 | + $query="ALTER TABLE spotter_output ADD owner_name VARCHAR(255) NULL DEFAULT NULL, ADD format_source VARCHAR(255) NULL DEFAULT NULL, ADD ground BOOLEAN NOT NULL DEFAULT FALSE, ADD last_ground BOOLEAN NOT NULL DEFAULT FALSE, ADD last_seen DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, ADD last_latitude FLOAT NULL, ADD last_longitude FLOAT NULL, ADD last_altitude INT(11) NULL, ADD last_ground_speed INT(11), ADD real_arrival_airport_icao VARCHAR(999), ADD real_arrival_airport_time VARCHAR(20),ADD real_departure_airport_icao VARCHAR(999), ADD real_departure_airport_time VARCHAR(20)"; |
|
414 | + try { |
|
415 | + $sth = $Connection->db->prepare($query); |
|
416 | + $sth->execute(); |
|
417 | + } catch(PDOException $e) { |
|
418 | + return "error (add owner_name & format_source column to spotter_output) : ".$e->getMessage()."\n"; |
|
419 | + } |
|
420 | + $query="ALTER TABLE spotter_live ADD format_source VARCHAR(255) NULL DEFAULT NULL, ADD ground BOOLEAN NOT NULL DEFAULT FALSE"; |
|
421 | + try { |
|
422 | + $sth = $Connection->db->prepare($query); |
|
423 | + $sth->execute(); |
|
424 | + } catch(PDOException $e) { |
|
425 | + return "error (format_source column to spotter_live) : ".$e->getMessage()."\n"; |
|
426 | + } |
|
427 | + if ($globalDBdriver == 'mysql') { |
|
428 | + $query = "SELECT ENGINE FROM information_schema.TABLES where TABLE_SCHEMA = '".$globalDBname."' AND TABLE_NAME = 'spotter_archive'"; |
|
429 | + try { |
|
430 | + $sth = $Connection->db->prepare($query); |
|
431 | 431 | $sth->execute(); |
432 | - } catch(PDOException $e) { |
|
432 | + } catch(PDOException $e) { |
|
433 | 433 | return "error (problem when select engine for spotter_engine) : ".$e->getMessage()."\n"; |
434 | - } |
|
435 | - $row = $sth->fetch(PDO::FETCH_ASSOC); |
|
436 | - if ($row['engine'] == 'ARCHIVE') { |
|
434 | + } |
|
435 | + $row = $sth->fetch(PDO::FETCH_ASSOC); |
|
436 | + if ($row['engine'] == 'ARCHIVE') { |
|
437 | 437 | $query = "CREATE TABLE copy LIKE spotter_archive; |
438 | 438 | ALTER TABLE copy ENGINE=ARCHIVE; |
439 | 439 | ALTER TABLE copy ADD verticalrate INT(11) NULL, ADD format_source VARCHAR(255) NULL DEFAULT NULL, ADD ground BOOLEAN NOT NULL DEFAULT FALSE; |
440 | 440 | INSERT INTO copy SELECT *, '' as verticalrate, '' as format_source, '0' as ground FROM spotter_archive ORDER BY `spotter_archive_id`; |
441 | 441 | DROP TABLE spotter_archive; |
442 | 442 | RENAME TABLE copy TO spotter_archive;"; |
443 | - } else { |
|
444 | - $query="ALTER TABLE spotter_archive ADD verticalrate INT(11) NULL, ADD format_source VARCHAR(255) NULL DEFAULT NULL, ADD ground BOOLEAN NOT NULL DEFAULT FALSE"; |
|
445 | - } |
|
446 | - } else { |
|
447 | - $query="ALTER TABLE spotter_archive ADD verticalrate INT(11) NULL, ADD format_source VARCHAR(255) NULL DEFAULT NULL, ADD ground BOOLEAN NOT NULL DEFAULT FALSE"; |
|
448 | - } |
|
449 | - try { |
|
450 | - $sth = $Connection->db->prepare($query); |
|
451 | - $sth->execute(); |
|
452 | - } catch(PDOException $e) { |
|
453 | - return "error (add columns to spotter_archive) : ".$e->getMessage()."\n"; |
|
454 | - } |
|
443 | + } else { |
|
444 | + $query="ALTER TABLE spotter_archive ADD verticalrate INT(11) NULL, ADD format_source VARCHAR(255) NULL DEFAULT NULL, ADD ground BOOLEAN NOT NULL DEFAULT FALSE"; |
|
445 | + } |
|
446 | + } else { |
|
447 | + $query="ALTER TABLE spotter_archive ADD verticalrate INT(11) NULL, ADD format_source VARCHAR(255) NULL DEFAULT NULL, ADD ground BOOLEAN NOT NULL DEFAULT FALSE"; |
|
448 | + } |
|
449 | + try { |
|
450 | + $sth = $Connection->db->prepare($query); |
|
451 | + $sth->execute(); |
|
452 | + } catch(PDOException $e) { |
|
453 | + return "error (add columns to spotter_archive) : ".$e->getMessage()."\n"; |
|
454 | + } |
|
455 | 455 | |
456 | 456 | $error = ''; |
457 | 457 | |
458 | 458 | $query = "UPDATE `config` SET `value` = '12' WHERE `name` = 'schema_version'"; |
459 | - try { |
|
460 | - $sth = $Connection->db->prepare($query); |
|
461 | - $sth->execute(); |
|
462 | - } catch(PDOException $e) { |
|
463 | - return "error (update schema_version) : ".$e->getMessage()."\n"; |
|
464 | - } |
|
459 | + try { |
|
460 | + $sth = $Connection->db->prepare($query); |
|
461 | + $sth->execute(); |
|
462 | + } catch(PDOException $e) { |
|
463 | + return "error (update schema_version) : ".$e->getMessage()."\n"; |
|
464 | + } |
|
465 | 465 | return $error; |
466 | 466 | } |
467 | 467 | private static function update_from_12() { |
468 | - $Connection = new Connection(); |
|
468 | + $Connection = new Connection(); |
|
469 | 469 | $error = ''; |
470 | - // Add tables |
|
470 | + // Add tables |
|
471 | 471 | $error .= create_db::import_file('../db/stats.sql'); |
472 | 472 | if ($error != '') return $error; |
473 | 473 | $error .= create_db::import_file('../db/stats_aircraft.sql'); |
@@ -484,166 +484,166 @@ discard block |
||
484 | 484 | if ($error != '') return $error; |
485 | 485 | |
486 | 486 | $query = "UPDATE `config` SET `value` = '13' WHERE `name` = 'schema_version'"; |
487 | - try { |
|
488 | - $sth = $Connection->db->prepare($query); |
|
489 | - $sth->execute(); |
|
490 | - } catch(PDOException $e) { |
|
491 | - return "error (update schema_version) : ".$e->getMessage()."\n"; |
|
492 | - } |
|
487 | + try { |
|
488 | + $sth = $Connection->db->prepare($query); |
|
489 | + $sth->execute(); |
|
490 | + } catch(PDOException $e) { |
|
491 | + return "error (update schema_version) : ".$e->getMessage()."\n"; |
|
492 | + } |
|
493 | 493 | return $error; |
494 | 494 | } |
495 | 495 | |
496 | 496 | private static function update_from_13() { |
497 | - $Connection = new Connection(); |
|
498 | - if (!$Connection->checkColumnName('spotter_archive_output','real_departure_airport_icao')) { |
|
499 | - $query="ALTER TABLE spotter_archive_output ADD real_departure_airport_icao VARCHAR(20), ADD real_departure_airport_time VARCHAR(20)"; |
|
497 | + $Connection = new Connection(); |
|
498 | + if (!$Connection->checkColumnName('spotter_archive_output','real_departure_airport_icao')) { |
|
499 | + $query="ALTER TABLE spotter_archive_output ADD real_departure_airport_icao VARCHAR(20), ADD real_departure_airport_time VARCHAR(20)"; |
|
500 | 500 | try { |
501 | 501 | $sth = $Connection->db->prepare($query); |
502 | 502 | $sth->execute(); |
503 | - } catch(PDOException $e) { |
|
503 | + } catch(PDOException $e) { |
|
504 | 504 | return "error (update spotter_archive_output) : ".$e->getMessage()."\n"; |
505 | - } |
|
505 | + } |
|
506 | 506 | } |
507 | - $error = ''; |
|
507 | + $error = ''; |
|
508 | 508 | $query = "UPDATE `config` SET `value` = '14' WHERE `name` = 'schema_version'"; |
509 | - try { |
|
510 | - $sth = $Connection->db->prepare($query); |
|
511 | - $sth->execute(); |
|
512 | - } catch(PDOException $e) { |
|
513 | - return "error (update schema_version) : ".$e->getMessage()."\n"; |
|
514 | - } |
|
509 | + try { |
|
510 | + $sth = $Connection->db->prepare($query); |
|
511 | + $sth->execute(); |
|
512 | + } catch(PDOException $e) { |
|
513 | + return "error (update schema_version) : ".$e->getMessage()."\n"; |
|
514 | + } |
|
515 | 515 | return $error; |
516 | 516 | } |
517 | 517 | |
518 | 518 | private static function update_from_14() { |
519 | - $Connection = new Connection(); |
|
519 | + $Connection = new Connection(); |
|
520 | 520 | $error = ''; |
521 | - // Add tables |
|
522 | - if (!$Connection->tableExists('stats_flight')) { |
|
521 | + // Add tables |
|
522 | + if (!$Connection->tableExists('stats_flight')) { |
|
523 | 523 | $error .= create_db::import_file('../db/stats_flight.sql'); |
524 | 524 | if ($error != '') return $error; |
525 | 525 | } |
526 | 526 | $query = "UPDATE `config` SET `value` = '15' WHERE `name` = 'schema_version'"; |
527 | - try { |
|
528 | - $sth = $Connection->db->prepare($query); |
|
529 | - $sth->execute(); |
|
530 | - } catch(PDOException $e) { |
|
531 | - return "error (update schema_version) : ".$e->getMessage()."\n"; |
|
532 | - } |
|
527 | + try { |
|
528 | + $sth = $Connection->db->prepare($query); |
|
529 | + $sth->execute(); |
|
530 | + } catch(PDOException $e) { |
|
531 | + return "error (update schema_version) : ".$e->getMessage()."\n"; |
|
532 | + } |
|
533 | 533 | return $error; |
534 | 534 | } |
535 | 535 | |
536 | 536 | |
537 | 537 | private static function update_from_15() { |
538 | - $Connection = new Connection(); |
|
538 | + $Connection = new Connection(); |
|
539 | 539 | $error = ''; |
540 | - // Add tables |
|
541 | - $query="ALTER TABLE `stats` CHANGE `stats_date` `stats_date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP"; |
|
542 | - try { |
|
543 | - $sth = $Connection->db->prepare($query); |
|
544 | - $sth->execute(); |
|
545 | - } catch(PDOException $e) { |
|
546 | - return "error (update stats) : ".$e->getMessage()."\n"; |
|
547 | - } |
|
540 | + // Add tables |
|
541 | + $query="ALTER TABLE `stats` CHANGE `stats_date` `stats_date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP"; |
|
542 | + try { |
|
543 | + $sth = $Connection->db->prepare($query); |
|
544 | + $sth->execute(); |
|
545 | + } catch(PDOException $e) { |
|
546 | + return "error (update stats) : ".$e->getMessage()."\n"; |
|
547 | + } |
|
548 | 548 | if ($error != '') return $error; |
549 | 549 | $query = "UPDATE `config` SET `value` = '16' WHERE `name` = 'schema_version'"; |
550 | - try { |
|
551 | - $sth = $Connection->db->prepare($query); |
|
552 | - $sth->execute(); |
|
553 | - } catch(PDOException $e) { |
|
554 | - return "error (update schema_version) : ".$e->getMessage()."\n"; |
|
555 | - } |
|
550 | + try { |
|
551 | + $sth = $Connection->db->prepare($query); |
|
552 | + $sth->execute(); |
|
553 | + } catch(PDOException $e) { |
|
554 | + return "error (update schema_version) : ".$e->getMessage()."\n"; |
|
555 | + } |
|
556 | 556 | return $error; |
557 | 557 | } |
558 | 558 | |
559 | 559 | private static function update_from_16() { |
560 | - $Connection = new Connection(); |
|
560 | + $Connection = new Connection(); |
|
561 | 561 | $error = ''; |
562 | - // Add tables |
|
563 | - if (!$Connection->tableExists('stats_registration')) { |
|
562 | + // Add tables |
|
563 | + if (!$Connection->tableExists('stats_registration')) { |
|
564 | 564 | $error .= create_db::import_file('../db/stats_registration.sql'); |
565 | 565 | } |
566 | - if (!$Connection->tableExists('stats_callsign')) { |
|
566 | + if (!$Connection->tableExists('stats_callsign')) { |
|
567 | 567 | $error .= create_db::import_file('../db/stats_callsign.sql'); |
568 | 568 | } |
569 | 569 | if ($error != '') return $error; |
570 | 570 | $query = "UPDATE `config` SET `value` = '17' WHERE `name` = 'schema_version'"; |
571 | - try { |
|
572 | - $sth = $Connection->db->prepare($query); |
|
573 | - $sth->execute(); |
|
574 | - } catch(PDOException $e) { |
|
575 | - return "error (update schema_version) : ".$e->getMessage()."\n"; |
|
576 | - } |
|
571 | + try { |
|
572 | + $sth = $Connection->db->prepare($query); |
|
573 | + $sth->execute(); |
|
574 | + } catch(PDOException $e) { |
|
575 | + return "error (update schema_version) : ".$e->getMessage()."\n"; |
|
576 | + } |
|
577 | 577 | return $error; |
578 | 578 | } |
579 | 579 | |
580 | 580 | private static function update_from_17() { |
581 | - $Connection = new Connection(); |
|
581 | + $Connection = new Connection(); |
|
582 | 582 | $error = ''; |
583 | - // Add tables |
|
584 | - if (!$Connection->tableExists('stats_country')) { |
|
583 | + // Add tables |
|
584 | + if (!$Connection->tableExists('stats_country')) { |
|
585 | 585 | $error .= create_db::import_file('../db/stats_country.sql'); |
586 | 586 | } |
587 | 587 | if ($error != '') return $error; |
588 | 588 | $query = "UPDATE `config` SET `value` = '18' WHERE `name` = 'schema_version'"; |
589 | - try { |
|
590 | - $sth = $Connection->db->prepare($query); |
|
591 | - $sth->execute(); |
|
592 | - } catch(PDOException $e) { |
|
593 | - return "error (update schema_version) : ".$e->getMessage()."\n"; |
|
594 | - } |
|
589 | + try { |
|
590 | + $sth = $Connection->db->prepare($query); |
|
591 | + $sth->execute(); |
|
592 | + } catch(PDOException $e) { |
|
593 | + return "error (update schema_version) : ".$e->getMessage()."\n"; |
|
594 | + } |
|
595 | 595 | return $error; |
596 | 596 | } |
597 | 597 | private static function update_from_18() { |
598 | - $Connection = new Connection(); |
|
598 | + $Connection = new Connection(); |
|
599 | 599 | $error = ''; |
600 | - // Modify stats_airport table |
|
601 | - if (!$Connection->checkColumnName('stats_airport','airport_name')) { |
|
602 | - $query = "ALTER TABLE `stats_airport` ADD `stats_type` VARCHAR(50) NOT NULL DEFAULT 'yearly', ADD `airport_name` VARCHAR(255) NOT NULL, ADD `date` DATE NULL DEFAULT NULL, DROP INDEX `airport_icao`, ADD UNIQUE `airport_icao` (`airport_icao`, `type`, `date`)"; |
|
603 | - try { |
|
604 | - $sth = $Connection->db->prepare($query); |
|
605 | - $sth->execute(); |
|
606 | - } catch(PDOException $e) { |
|
607 | - return "error (update stats) : ".$e->getMessage()."\n"; |
|
608 | - } |
|
609 | - } |
|
600 | + // Modify stats_airport table |
|
601 | + if (!$Connection->checkColumnName('stats_airport','airport_name')) { |
|
602 | + $query = "ALTER TABLE `stats_airport` ADD `stats_type` VARCHAR(50) NOT NULL DEFAULT 'yearly', ADD `airport_name` VARCHAR(255) NOT NULL, ADD `date` DATE NULL DEFAULT NULL, DROP INDEX `airport_icao`, ADD UNIQUE `airport_icao` (`airport_icao`, `type`, `date`)"; |
|
603 | + try { |
|
604 | + $sth = $Connection->db->prepare($query); |
|
605 | + $sth->execute(); |
|
606 | + } catch(PDOException $e) { |
|
607 | + return "error (update stats) : ".$e->getMessage()."\n"; |
|
608 | + } |
|
609 | + } |
|
610 | 610 | if ($error != '') return $error; |
611 | 611 | $query = "UPDATE `config` SET `value` = '19' WHERE `name` = 'schema_version'"; |
612 | - try { |
|
613 | - $sth = $Connection->db->prepare($query); |
|
614 | - $sth->execute(); |
|
615 | - } catch(PDOException $e) { |
|
616 | - return "error (update schema_version) : ".$e->getMessage()."\n"; |
|
617 | - } |
|
612 | + try { |
|
613 | + $sth = $Connection->db->prepare($query); |
|
614 | + $sth->execute(); |
|
615 | + } catch(PDOException $e) { |
|
616 | + return "error (update schema_version) : ".$e->getMessage()."\n"; |
|
617 | + } |
|
618 | 618 | return $error; |
619 | 619 | } |
620 | 620 | |
621 | 621 | private static function update_from_19() { |
622 | - $Connection = new Connection(); |
|
622 | + $Connection = new Connection(); |
|
623 | 623 | $error = ''; |
624 | - // Update airport table |
|
624 | + // Update airport table |
|
625 | 625 | $error .= create_db::import_file('../db/airport.sql'); |
626 | 626 | if ($error != '') return 'Import airport.sql : '.$error; |
627 | 627 | // Remove primary key on Spotter_Archive |
628 | 628 | $query = "alter table spotter_archive drop spotter_archive_id"; |
629 | - try { |
|
630 | - $sth = $Connection->db->prepare($query); |
|
631 | - $sth->execute(); |
|
632 | - } catch(PDOException $e) { |
|
633 | - return "error (remove primary key on spotter_archive) : ".$e->getMessage()."\n"; |
|
634 | - } |
|
629 | + try { |
|
630 | + $sth = $Connection->db->prepare($query); |
|
631 | + $sth->execute(); |
|
632 | + } catch(PDOException $e) { |
|
633 | + return "error (remove primary key on spotter_archive) : ".$e->getMessage()."\n"; |
|
634 | + } |
|
635 | 635 | $query = "alter table spotter_archive add spotter_archive_id INT(11)"; |
636 | - try { |
|
637 | - $sth = $Connection->db->prepare($query); |
|
638 | - $sth->execute(); |
|
639 | - } catch(PDOException $e) { |
|
640 | - return "error (add id again on spotter_archive) : ".$e->getMessage()."\n"; |
|
641 | - } |
|
636 | + try { |
|
637 | + $sth = $Connection->db->prepare($query); |
|
638 | + $sth->execute(); |
|
639 | + } catch(PDOException $e) { |
|
640 | + return "error (add id again on spotter_archive) : ".$e->getMessage()."\n"; |
|
641 | + } |
|
642 | 642 | if (!$Connection->checkColumnName('spotter_archive','over_country')) { |
643 | 643 | // Add column over_country |
644 | - $query = "ALTER TABLE `spotter_archive` ADD `over_country` VARCHAR(5) NULL DEFAULT NULL"; |
|
644 | + $query = "ALTER TABLE `spotter_archive` ADD `over_country` VARCHAR(5) NULL DEFAULT NULL"; |
|
645 | 645 | try { |
646 | - $sth = $Connection->db->prepare($query); |
|
646 | + $sth = $Connection->db->prepare($query); |
|
647 | 647 | $sth->execute(); |
648 | 648 | } catch(PDOException $e) { |
649 | 649 | return "error (add over_country) : ".$e->getMessage()."\n"; |
@@ -651,9 +651,9 @@ discard block |
||
651 | 651 | } |
652 | 652 | if (!$Connection->checkColumnName('spotter_live','over_country')) { |
653 | 653 | // Add column over_country |
654 | - $query = "ALTER TABLE `spotter_live` ADD `over_country` VARCHAR(5) NULL DEFAULT NULL"; |
|
654 | + $query = "ALTER TABLE `spotter_live` ADD `over_country` VARCHAR(5) NULL DEFAULT NULL"; |
|
655 | 655 | try { |
656 | - $sth = $Connection->db->prepare($query); |
|
656 | + $sth = $Connection->db->prepare($query); |
|
657 | 657 | $sth->execute(); |
658 | 658 | } catch(PDOException $e) { |
659 | 659 | return "error (add over_country) : ".$e->getMessage()."\n"; |
@@ -661,74 +661,74 @@ discard block |
||
661 | 661 | } |
662 | 662 | if (!$Connection->checkColumnName('spotter_output','source_name')) { |
663 | 663 | // Add source_name to spotter_output, spotter_live, spotter_archive, spotter_archive_output |
664 | - $query = "ALTER TABLE `spotter_output` ADD `source_name` VARCHAR(255) NULL AFTER `format_source`"; |
|
664 | + $query = "ALTER TABLE `spotter_output` ADD `source_name` VARCHAR(255) NULL AFTER `format_source`"; |
|
665 | 665 | try { |
666 | 666 | $sth = $Connection->db->prepare($query); |
667 | 667 | $sth->execute(); |
668 | 668 | } catch(PDOException $e) { |
669 | 669 | return "error (add source_name column) : ".$e->getMessage()."\n"; |
670 | - } |
|
671 | - } |
|
670 | + } |
|
671 | + } |
|
672 | 672 | if (!$Connection->checkColumnName('spotter_live','source_name')) { |
673 | 673 | // Add source_name to spotter_output, spotter_live, spotter_archive, spotter_archive_output |
674 | - $query = "ALTER TABLE `spotter_live` ADD `source_name` VARCHAR(255) NULL AFTER `format_source`"; |
|
674 | + $query = "ALTER TABLE `spotter_live` ADD `source_name` VARCHAR(255) NULL AFTER `format_source`"; |
|
675 | 675 | try { |
676 | 676 | $sth = $Connection->db->prepare($query); |
677 | 677 | $sth->execute(); |
678 | 678 | } catch(PDOException $e) { |
679 | 679 | return "error (add source_name column) : ".$e->getMessage()."\n"; |
680 | - } |
|
681 | - } |
|
680 | + } |
|
681 | + } |
|
682 | 682 | if (!$Connection->checkColumnName('spotter_archive_output','source_name')) { |
683 | 683 | // Add source_name to spotter_output, spotter_live, spotter_archive, spotter_archive_output |
684 | - $query = "ALTER TABLE `spotter_archive_output` ADD `source_name` VARCHAR(255) NULL AFTER `format_source`"; |
|
684 | + $query = "ALTER TABLE `spotter_archive_output` ADD `source_name` VARCHAR(255) NULL AFTER `format_source`"; |
|
685 | 685 | try { |
686 | 686 | $sth = $Connection->db->prepare($query); |
687 | 687 | $sth->execute(); |
688 | 688 | } catch(PDOException $e) { |
689 | 689 | return "error (add source_name column) : ".$e->getMessage()."\n"; |
690 | - } |
|
691 | - } |
|
690 | + } |
|
691 | + } |
|
692 | 692 | if (!$Connection->checkColumnName('spotter_archive','source_name')) { |
693 | 693 | // Add source_name to spotter_output, spotter_live, spotter_archive, spotter_archive_output |
694 | - $query = "ALTER TABLE `spotter_archive` ADD `source_name` VARCHAR(255) NULL AFTER `format_source`;"; |
|
694 | + $query = "ALTER TABLE `spotter_archive` ADD `source_name` VARCHAR(255) NULL AFTER `format_source`;"; |
|
695 | 695 | try { |
696 | 696 | $sth = $Connection->db->prepare($query); |
697 | 697 | $sth->execute(); |
698 | 698 | } catch(PDOException $e) { |
699 | 699 | return "error (add source_name column) : ".$e->getMessage()."\n"; |
700 | - } |
|
701 | - } |
|
700 | + } |
|
701 | + } |
|
702 | 702 | if ($error != '') return $error; |
703 | 703 | $query = "UPDATE `config` SET `value` = '20' WHERE `name` = 'schema_version'"; |
704 | - try { |
|
705 | - $sth = $Connection->db->prepare($query); |
|
706 | - $sth->execute(); |
|
707 | - } catch(PDOException $e) { |
|
708 | - return "error (update schema_version) : ".$e->getMessage()."\n"; |
|
709 | - } |
|
704 | + try { |
|
705 | + $sth = $Connection->db->prepare($query); |
|
706 | + $sth->execute(); |
|
707 | + } catch(PDOException $e) { |
|
708 | + return "error (update schema_version) : ".$e->getMessage()."\n"; |
|
709 | + } |
|
710 | 710 | return $error; |
711 | 711 | } |
712 | 712 | |
713 | 713 | private static function update_from_20() { |
714 | 714 | global $globalIVAO, $globalVATSIM, $globalphpVMS; |
715 | - $Connection = new Connection(); |
|
715 | + $Connection = new Connection(); |
|
716 | 716 | $error = ''; |
717 | - // Update airline table |
|
718 | - if (!$globalIVAO && !$globalVATSIM && !$globalphpVMS) { |
|
717 | + // Update airline table |
|
718 | + if (!$globalIVAO && !$globalVATSIM && !$globalphpVMS) { |
|
719 | 719 | $error .= create_db::import_file('../db/airlines.sql'); |
720 | 720 | if ($error != '') return 'Import airlines.sql : '.$error; |
721 | 721 | } |
722 | 722 | if (!$Connection->checkColumnName('aircraft_modes','type_flight')) { |
723 | 723 | // Add column over_country |
724 | - $query = "ALTER TABLE `aircraft_modes` ADD `type_flight` VARCHAR(50) NULL DEFAULT NULL;"; |
|
725 | - try { |
|
724 | + $query = "ALTER TABLE `aircraft_modes` ADD `type_flight` VARCHAR(50) NULL DEFAULT NULL;"; |
|
725 | + try { |
|
726 | 726 | $sth = $Connection->db->prepare($query); |
727 | 727 | $sth->execute(); |
728 | 728 | } catch(PDOException $e) { |
729 | 729 | return "error (add over_country) : ".$e->getMessage()."\n"; |
730 | - } |
|
731 | - } |
|
730 | + } |
|
731 | + } |
|
732 | 732 | if ($error != '') return $error; |
733 | 733 | /* |
734 | 734 | if (!$globalIVAO && !$globalVATSIM && !$globalphpVMS) { |
@@ -738,12 +738,12 @@ discard block |
||
738 | 738 | } |
739 | 739 | */ |
740 | 740 | $query = "UPDATE `config` SET `value` = '21' WHERE `name` = 'schema_version'"; |
741 | - try { |
|
742 | - $sth = $Connection->db->prepare($query); |
|
743 | - $sth->execute(); |
|
744 | - } catch(PDOException $e) { |
|
745 | - return "error (update schema_version) : ".$e->getMessage()."\n"; |
|
746 | - } |
|
741 | + try { |
|
742 | + $sth = $Connection->db->prepare($query); |
|
743 | + $sth->execute(); |
|
744 | + } catch(PDOException $e) { |
|
745 | + return "error (update schema_version) : ".$e->getMessage()."\n"; |
|
746 | + } |
|
747 | 747 | return $error; |
748 | 748 | } |
749 | 749 | |
@@ -762,35 +762,35 @@ discard block |
||
762 | 762 | if ($error != '') return $error; |
763 | 763 | } |
764 | 764 | $query = "UPDATE `config` SET `value` = '22' WHERE `name` = 'schema_version'"; |
765 | - try { |
|
766 | - $sth = $Connection->db->prepare($query); |
|
767 | - $sth->execute(); |
|
768 | - } catch(PDOException $e) { |
|
769 | - return "error (update schema_version) : ".$e->getMessage()."\n"; |
|
770 | - } |
|
765 | + try { |
|
766 | + $sth = $Connection->db->prepare($query); |
|
767 | + $sth->execute(); |
|
768 | + } catch(PDOException $e) { |
|
769 | + return "error (update schema_version) : ".$e->getMessage()."\n"; |
|
770 | + } |
|
771 | 771 | return $error; |
772 | 772 | } |
773 | 773 | |
774 | 774 | private static function update_from_22() { |
775 | 775 | global $globalDBdriver; |
776 | - $Connection = new Connection(); |
|
776 | + $Connection = new Connection(); |
|
777 | 777 | $error = ''; |
778 | 778 | // Add table stats polar |
779 | - if (!$Connection->tableExists('stats_source')) { |
|
779 | + if (!$Connection->tableExists('stats_source')) { |
|
780 | 780 | if ($globalDBdriver == 'mysql') { |
781 | - $error .= create_db::import_file('../db/stats_source.sql'); |
|
781 | + $error .= create_db::import_file('../db/stats_source.sql'); |
|
782 | 782 | } else { |
783 | 783 | $error .= create_db::import_file('../db/pgsql/stats_source.sql'); |
784 | 784 | } |
785 | 785 | if ($error != '') return $error; |
786 | 786 | } |
787 | 787 | $query = "UPDATE config SET value = '23' WHERE name = 'schema_version'"; |
788 | - try { |
|
789 | - $sth = $Connection->db->prepare($query); |
|
790 | - $sth->execute(); |
|
791 | - } catch(PDOException $e) { |
|
792 | - return "error (update schema_version) : ".$e->getMessage()."\n"; |
|
793 | - } |
|
788 | + try { |
|
789 | + $sth = $Connection->db->prepare($query); |
|
790 | + $sth->execute(); |
|
791 | + } catch(PDOException $e) { |
|
792 | + return "error (update schema_version) : ".$e->getMessage()."\n"; |
|
793 | + } |
|
794 | 794 | return $error; |
795 | 795 | } |
796 | 796 | |
@@ -821,14 +821,14 @@ discard block |
||
821 | 821 | } |
822 | 822 | if (!$Connection->checkColumnName('stats_aircraft','aircraft_manufacturer')) { |
823 | 823 | // Add aircraft_manufacturer to stats_aircraft |
824 | - $query = "ALTER TABLE stats_aircraft ADD aircraft_manufacturer VARCHAR(255) NULL"; |
|
824 | + $query = "ALTER TABLE stats_aircraft ADD aircraft_manufacturer VARCHAR(255) NULL"; |
|
825 | 825 | try { |
826 | 826 | $sth = $Connection->db->prepare($query); |
827 | 827 | $sth->execute(); |
828 | 828 | } catch(PDOException $e) { |
829 | 829 | return "error (add aircraft_manufacturer column) : ".$e->getMessage()."\n"; |
830 | - } |
|
831 | - } |
|
830 | + } |
|
831 | + } |
|
832 | 832 | |
833 | 833 | $query = "UPDATE config SET value = '24' WHERE name = 'schema_version'"; |
834 | 834 | try { |
@@ -1176,7 +1176,7 @@ discard block |
||
1176 | 1176 | } catch(PDOException $e) { |
1177 | 1177 | return "error (add index latitude,longitude on spotter_live) : ".$e->getMessage()."\n"; |
1178 | 1178 | } |
1179 | - } |
|
1179 | + } |
|
1180 | 1180 | if (!$Connection->checkColumnName('aircraft','manufacturer')) { |
1181 | 1181 | // Add mfr to aircraft |
1182 | 1182 | $query = "ALTER TABLE aircraft ADD mfr VARCHAR(255) NULL"; |
@@ -1206,141 +1206,141 @@ discard block |
||
1206 | 1206 | } |
1207 | 1207 | |
1208 | 1208 | |
1209 | - public static function check_version($update = false) { |
|
1210 | - global $globalDBname; |
|
1211 | - $version = 0; |
|
1212 | - $Connection = new Connection(); |
|
1213 | - if ($Connection->tableExists('aircraft')) { |
|
1214 | - if (!$Connection->tableExists('config')) { |
|
1215 | - $version = '1'; |
|
1216 | - if ($update) return self::update_from_1(); |
|
1217 | - else return $version; |
|
1209 | + public static function check_version($update = false) { |
|
1210 | + global $globalDBname; |
|
1211 | + $version = 0; |
|
1212 | + $Connection = new Connection(); |
|
1213 | + if ($Connection->tableExists('aircraft')) { |
|
1214 | + if (!$Connection->tableExists('config')) { |
|
1215 | + $version = '1'; |
|
1216 | + if ($update) return self::update_from_1(); |
|
1217 | + else return $version; |
|
1218 | 1218 | } else { |
1219 | - $Connection = new Connection(); |
|
1220 | - $query = "SELECT value FROM config WHERE name = 'schema_version' LIMIT 1"; |
|
1221 | - try { |
|
1222 | - $sth = $Connection->db->prepare($query); |
|
1223 | - $sth->execute(); |
|
1224 | - } catch(PDOException $e) { |
|
1219 | + $Connection = new Connection(); |
|
1220 | + $query = "SELECT value FROM config WHERE name = 'schema_version' LIMIT 1"; |
|
1221 | + try { |
|
1222 | + $sth = $Connection->db->prepare($query); |
|
1223 | + $sth->execute(); |
|
1224 | + } catch(PDOException $e) { |
|
1225 | 1225 | return "error : ".$e->getMessage()."\n"; |
1226 | - } |
|
1227 | - $result = $sth->fetch(PDO::FETCH_ASSOC); |
|
1228 | - if ($update) { |
|
1229 | - if ($result['value'] == '2') { |
|
1230 | - $error = self::update_from_2(); |
|
1231 | - if ($error != '') return $error; |
|
1232 | - else return self::check_version(true); |
|
1233 | - } elseif ($result['value'] == '3') { |
|
1234 | - $error = self::update_from_3(); |
|
1235 | - if ($error != '') return $error; |
|
1236 | - else return self::check_version(true); |
|
1237 | - } elseif ($result['value'] == '4') { |
|
1238 | - $error = self::update_from_4(); |
|
1239 | - if ($error != '') return $error; |
|
1240 | - else return self::check_version(true); |
|
1241 | - } elseif ($result['value'] == '5') { |
|
1242 | - $error = self::update_from_5(); |
|
1243 | - if ($error != '') return $error; |
|
1244 | - else return self::check_version(true); |
|
1245 | - } elseif ($result['value'] == '6') { |
|
1246 | - $error = self::update_from_6(); |
|
1247 | - if ($error != '') return $error; |
|
1248 | - else return self::check_version(true); |
|
1249 | - } elseif ($result['value'] == '7') { |
|
1250 | - $error = self::update_from_7(); |
|
1251 | - if ($error != '') return $error; |
|
1252 | - else return self::check_version(true); |
|
1253 | - } elseif ($result['value'] == '8') { |
|
1254 | - $error = self::update_from_8(); |
|
1255 | - if ($error != '') return $error; |
|
1256 | - else return self::check_version(true); |
|
1257 | - } elseif ($result['value'] == '9') { |
|
1258 | - $error = self::update_from_9(); |
|
1259 | - if ($error != '') return $error; |
|
1260 | - else return self::check_version(true); |
|
1261 | - } elseif ($result['value'] == '10') { |
|
1262 | - $error = self::update_from_10(); |
|
1263 | - if ($error != '') return $error; |
|
1264 | - else return self::check_version(true); |
|
1265 | - } elseif ($result['value'] == '11') { |
|
1266 | - $error = self::update_from_11(); |
|
1267 | - if ($error != '') return $error; |
|
1268 | - else return self::check_version(true); |
|
1269 | - } elseif ($result['value'] == '12') { |
|
1270 | - $error = self::update_from_12(); |
|
1271 | - if ($error != '') return $error; |
|
1272 | - else return self::check_version(true); |
|
1273 | - } elseif ($result['value'] == '13') { |
|
1274 | - $error = self::update_from_13(); |
|
1275 | - if ($error != '') return $error; |
|
1276 | - else return self::check_version(true); |
|
1277 | - } elseif ($result['value'] == '14') { |
|
1278 | - $error = self::update_from_14(); |
|
1279 | - if ($error != '') return $error; |
|
1280 | - else return self::check_version(true); |
|
1281 | - } elseif ($result['value'] == '15') { |
|
1282 | - $error = self::update_from_15(); |
|
1283 | - if ($error != '') return $error; |
|
1284 | - else return self::check_version(true); |
|
1285 | - } elseif ($result['value'] == '16') { |
|
1286 | - $error = self::update_from_16(); |
|
1287 | - if ($error != '') return $error; |
|
1288 | - else return self::check_version(true); |
|
1289 | - } elseif ($result['value'] == '17') { |
|
1290 | - $error = self::update_from_17(); |
|
1291 | - if ($error != '') return $error; |
|
1292 | - else return self::check_version(true); |
|
1293 | - } elseif ($result['value'] == '18') { |
|
1294 | - $error = self::update_from_18(); |
|
1295 | - if ($error != '') return $error; |
|
1296 | - else return self::check_version(true); |
|
1297 | - } elseif ($result['value'] == '19') { |
|
1298 | - $error = self::update_from_19(); |
|
1299 | - if ($error != '') return $error; |
|
1300 | - else return self::check_version(true); |
|
1301 | - } elseif ($result['value'] == '20') { |
|
1302 | - $error = self::update_from_20(); |
|
1303 | - if ($error != '') return $error; |
|
1304 | - else return self::check_version(true); |
|
1305 | - } elseif ($result['value'] == '21') { |
|
1306 | - $error = self::update_from_21(); |
|
1307 | - if ($error != '') return $error; |
|
1308 | - else return self::check_version(true); |
|
1309 | - } elseif ($result['value'] == '22') { |
|
1310 | - $error = self::update_from_22(); |
|
1311 | - if ($error != '') return $error; |
|
1312 | - else return self::check_version(true); |
|
1313 | - } elseif ($result['value'] == '23') { |
|
1314 | - $error = self::update_from_23(); |
|
1315 | - if ($error != '') return $error; |
|
1316 | - else return self::check_version(true); |
|
1317 | - } elseif ($result['value'] == '24') { |
|
1318 | - $error = self::update_from_24(); |
|
1319 | - if ($error != '') return $error; |
|
1320 | - else return self::check_version(true); |
|
1321 | - } elseif ($result['value'] == '25') { |
|
1322 | - $error = self::update_from_25(); |
|
1323 | - if ($error != '') return $error; |
|
1324 | - else return self::check_version(true); |
|
1325 | - } elseif ($result['value'] == '26') { |
|
1326 | - $error = self::update_from_26(); |
|
1327 | - if ($error != '') return $error; |
|
1328 | - else return self::check_version(true); |
|
1329 | - } elseif ($result['value'] == '27') { |
|
1330 | - $error = self::update_from_27(); |
|
1331 | - if ($error != '') return $error; |
|
1332 | - else return self::check_version(true); |
|
1333 | - } elseif ($result['value'] == '28') { |
|
1334 | - $error = self::update_from_28(); |
|
1335 | - if ($error != '') return $error; |
|
1336 | - else return self::check_version(true); |
|
1337 | - } else return ''; |
|
1338 | - } |
|
1339 | - else return $result['value']; |
|
1226 | + } |
|
1227 | + $result = $sth->fetch(PDO::FETCH_ASSOC); |
|
1228 | + if ($update) { |
|
1229 | + if ($result['value'] == '2') { |
|
1230 | + $error = self::update_from_2(); |
|
1231 | + if ($error != '') return $error; |
|
1232 | + else return self::check_version(true); |
|
1233 | + } elseif ($result['value'] == '3') { |
|
1234 | + $error = self::update_from_3(); |
|
1235 | + if ($error != '') return $error; |
|
1236 | + else return self::check_version(true); |
|
1237 | + } elseif ($result['value'] == '4') { |
|
1238 | + $error = self::update_from_4(); |
|
1239 | + if ($error != '') return $error; |
|
1240 | + else return self::check_version(true); |
|
1241 | + } elseif ($result['value'] == '5') { |
|
1242 | + $error = self::update_from_5(); |
|
1243 | + if ($error != '') return $error; |
|
1244 | + else return self::check_version(true); |
|
1245 | + } elseif ($result['value'] == '6') { |
|
1246 | + $error = self::update_from_6(); |
|
1247 | + if ($error != '') return $error; |
|
1248 | + else return self::check_version(true); |
|
1249 | + } elseif ($result['value'] == '7') { |
|
1250 | + $error = self::update_from_7(); |
|
1251 | + if ($error != '') return $error; |
|
1252 | + else return self::check_version(true); |
|
1253 | + } elseif ($result['value'] == '8') { |
|
1254 | + $error = self::update_from_8(); |
|
1255 | + if ($error != '') return $error; |
|
1256 | + else return self::check_version(true); |
|
1257 | + } elseif ($result['value'] == '9') { |
|
1258 | + $error = self::update_from_9(); |
|
1259 | + if ($error != '') return $error; |
|
1260 | + else return self::check_version(true); |
|
1261 | + } elseif ($result['value'] == '10') { |
|
1262 | + $error = self::update_from_10(); |
|
1263 | + if ($error != '') return $error; |
|
1264 | + else return self::check_version(true); |
|
1265 | + } elseif ($result['value'] == '11') { |
|
1266 | + $error = self::update_from_11(); |
|
1267 | + if ($error != '') return $error; |
|
1268 | + else return self::check_version(true); |
|
1269 | + } elseif ($result['value'] == '12') { |
|
1270 | + $error = self::update_from_12(); |
|
1271 | + if ($error != '') return $error; |
|
1272 | + else return self::check_version(true); |
|
1273 | + } elseif ($result['value'] == '13') { |
|
1274 | + $error = self::update_from_13(); |
|
1275 | + if ($error != '') return $error; |
|
1276 | + else return self::check_version(true); |
|
1277 | + } elseif ($result['value'] == '14') { |
|
1278 | + $error = self::update_from_14(); |
|
1279 | + if ($error != '') return $error; |
|
1280 | + else return self::check_version(true); |
|
1281 | + } elseif ($result['value'] == '15') { |
|
1282 | + $error = self::update_from_15(); |
|
1283 | + if ($error != '') return $error; |
|
1284 | + else return self::check_version(true); |
|
1285 | + } elseif ($result['value'] == '16') { |
|
1286 | + $error = self::update_from_16(); |
|
1287 | + if ($error != '') return $error; |
|
1288 | + else return self::check_version(true); |
|
1289 | + } elseif ($result['value'] == '17') { |
|
1290 | + $error = self::update_from_17(); |
|
1291 | + if ($error != '') return $error; |
|
1292 | + else return self::check_version(true); |
|
1293 | + } elseif ($result['value'] == '18') { |
|
1294 | + $error = self::update_from_18(); |
|
1295 | + if ($error != '') return $error; |
|
1296 | + else return self::check_version(true); |
|
1297 | + } elseif ($result['value'] == '19') { |
|
1298 | + $error = self::update_from_19(); |
|
1299 | + if ($error != '') return $error; |
|
1300 | + else return self::check_version(true); |
|
1301 | + } elseif ($result['value'] == '20') { |
|
1302 | + $error = self::update_from_20(); |
|
1303 | + if ($error != '') return $error; |
|
1304 | + else return self::check_version(true); |
|
1305 | + } elseif ($result['value'] == '21') { |
|
1306 | + $error = self::update_from_21(); |
|
1307 | + if ($error != '') return $error; |
|
1308 | + else return self::check_version(true); |
|
1309 | + } elseif ($result['value'] == '22') { |
|
1310 | + $error = self::update_from_22(); |
|
1311 | + if ($error != '') return $error; |
|
1312 | + else return self::check_version(true); |
|
1313 | + } elseif ($result['value'] == '23') { |
|
1314 | + $error = self::update_from_23(); |
|
1315 | + if ($error != '') return $error; |
|
1316 | + else return self::check_version(true); |
|
1317 | + } elseif ($result['value'] == '24') { |
|
1318 | + $error = self::update_from_24(); |
|
1319 | + if ($error != '') return $error; |
|
1320 | + else return self::check_version(true); |
|
1321 | + } elseif ($result['value'] == '25') { |
|
1322 | + $error = self::update_from_25(); |
|
1323 | + if ($error != '') return $error; |
|
1324 | + else return self::check_version(true); |
|
1325 | + } elseif ($result['value'] == '26') { |
|
1326 | + $error = self::update_from_26(); |
|
1327 | + if ($error != '') return $error; |
|
1328 | + else return self::check_version(true); |
|
1329 | + } elseif ($result['value'] == '27') { |
|
1330 | + $error = self::update_from_27(); |
|
1331 | + if ($error != '') return $error; |
|
1332 | + else return self::check_version(true); |
|
1333 | + } elseif ($result['value'] == '28') { |
|
1334 | + $error = self::update_from_28(); |
|
1335 | + if ($error != '') return $error; |
|
1336 | + else return self::check_version(true); |
|
1337 | + } else return ''; |
|
1338 | + } |
|
1339 | + else return $result['value']; |
|
1340 | 1340 | } |
1341 | 1341 | |
1342 | - } else return $version; |
|
1343 | - } |
|
1342 | + } else return $version; |
|
1343 | + } |
|
1344 | 1344 | |
1345 | 1345 | } |
1346 | 1346 | //echo update_schema::check_version(); |