@@ -6,13 +6,13 @@ discard block |
||
6 | 6 | //protected $cookies = array(); |
7 | 7 | |
8 | 8 | /** |
9 | - * Get data from form result |
|
10 | - * @param String $url form URL |
|
11 | - * @param String $type type of submit form method (get or post) |
|
12 | - * @param String|Array $data values form post method |
|
13 | - * @param Array $headers header to submit with the form |
|
14 | - * @return String the result |
|
15 | - */ |
|
9 | + * Get data from form result |
|
10 | + * @param String $url form URL |
|
11 | + * @param String $type type of submit form method (get or post) |
|
12 | + * @param String|Array $data values form post method |
|
13 | + * @param Array $headers header to submit with the form |
|
14 | + * @return String the result |
|
15 | + */ |
|
16 | 16 | public function getData($url, $type = 'get', $data = '', $headers = '',$cookie = '',$referer = '',$timeout = '',$useragent = '') { |
17 | 17 | $ch = curl_init(); |
18 | 18 | curl_setopt($ch, CURLOPT_URL, $url); |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | return $this->getData($url,'get',$data,$headers,$clearanceCookie,$referer,$timeout,$useragent); |
68 | 68 | } |
69 | 69 | } else { |
70 | - return $result; |
|
70 | + return $result; |
|
71 | 71 | } |
72 | 72 | } |
73 | 73 | |
@@ -96,10 +96,10 @@ discard block |
||
96 | 96 | } |
97 | 97 | |
98 | 98 | /** |
99 | - * Convert a HTML table to an array |
|
100 | - * @param String $data HTML page |
|
101 | - * @return Array array of the tables in HTML page |
|
102 | - */ |
|
99 | + * Convert a HTML table to an array |
|
100 | + * @param String $data HTML page |
|
101 | + * @return Array array of the tables in HTML page |
|
102 | + */ |
|
103 | 103 | public function table2array($data) { |
104 | 104 | if (!is_string($data)) return array(); |
105 | 105 | if ($data == '') return array(); |
@@ -133,10 +133,10 @@ discard block |
||
133 | 133 | } |
134 | 134 | |
135 | 135 | /** |
136 | - * Convert <p> part of a HTML page to an array |
|
137 | - * @param String $data HTML page |
|
138 | - * @return Array array of the <p> in HTML page |
|
139 | - */ |
|
136 | + * Convert <p> part of a HTML page to an array |
|
137 | + * @param String $data HTML page |
|
138 | + * @return Array array of the <p> in HTML page |
|
139 | + */ |
|
140 | 140 | public function text2array($data) { |
141 | 141 | $html = str_get_html($data); |
142 | 142 | if ($html === false) return array(); |
@@ -151,14 +151,14 @@ discard block |
||
151 | 151 | } |
152 | 152 | |
153 | 153 | /** |
154 | - * Give distance between 2 coordonnates |
|
155 | - * @param Float $lat latitude of first point |
|
156 | - * @param Float $lon longitude of first point |
|
157 | - * @param Float $latc latitude of second point |
|
158 | - * @param Float $lonc longitude of second point |
|
159 | - * @param String $unit km else no unit used |
|
160 | - * @return Float Distance in $unit |
|
161 | - */ |
|
154 | + * Give distance between 2 coordonnates |
|
155 | + * @param Float $lat latitude of first point |
|
156 | + * @param Float $lon longitude of first point |
|
157 | + * @param Float $latc latitude of second point |
|
158 | + * @param Float $lonc longitude of second point |
|
159 | + * @param String $unit km else no unit used |
|
160 | + * @return Float Distance in $unit |
|
161 | + */ |
|
162 | 162 | public function distance($lat, $lon, $latc, $lonc, $unit = 'km') { |
163 | 163 | if ($lat == $latc && $lon == $lonc) return 0; |
164 | 164 | $dist = rad2deg(acos(sin(deg2rad(floatval($lat)))*sin(deg2rad(floatval($latc)))+ cos(deg2rad(floatval($lat)))*cos(deg2rad(floatval($latc)))*cos(deg2rad(floatval($lon)-floatval($lonc)))))*60*1.1515; |
@@ -176,11 +176,11 @@ discard block |
||
176 | 176 | } |
177 | 177 | |
178 | 178 | /** |
179 | - * Check is distance realistic |
|
180 | - * @param int $timeDifference the time between the reception of both messages |
|
181 | - * @param float $distance distance covered |
|
182 | - * @return whether distance is realistic |
|
183 | - */ |
|
179 | + * Check is distance realistic |
|
180 | + * @param int $timeDifference the time between the reception of both messages |
|
181 | + * @param float $distance distance covered |
|
182 | + * @return whether distance is realistic |
|
183 | + */ |
|
184 | 184 | public function withinThreshold ($timeDifference, $distance) { |
185 | 185 | $x = abs($timeDifference); |
186 | 186 | $d = abs($distance); |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | } |
199 | 199 | |
200 | 200 | public function isInteger($input){ |
201 | - return(ctype_digit(strval($input))); |
|
201 | + return(ctype_digit(strval($input))); |
|
202 | 202 | } |
203 | 203 | |
204 | 204 | |
@@ -214,11 +214,11 @@ discard block |
||
214 | 214 | } |
215 | 215 | |
216 | 216 | /** |
217 | - * Copy folder contents |
|
218 | - * @param string $source Source path |
|
219 | - * @param string $dest Destination path |
|
220 | - * @return bool Returns true on success, false on failure |
|
221 | - */ |
|
217 | + * Copy folder contents |
|
218 | + * @param string $source Source path |
|
219 | + * @param string $dest Destination path |
|
220 | + * @return bool Returns true on success, false on failure |
|
221 | + */ |
|
222 | 222 | public function xcopy($source, $dest) |
223 | 223 | { |
224 | 224 | $files = glob($source.'*.*'); |
@@ -230,20 +230,20 @@ discard block |
||
230 | 230 | } |
231 | 231 | |
232 | 232 | /** |
233 | - * Check if an url exist |
|
234 | - * @param String $url url to check |
|
235 | - * @return bool Return true on succes false on failure |
|
236 | - */ |
|
233 | + * Check if an url exist |
|
234 | + * @param String $url url to check |
|
235 | + * @return bool Return true on succes false on failure |
|
236 | + */ |
|
237 | 237 | public function urlexist($url){ |
238 | 238 | $headers=get_headers($url); |
239 | 239 | return stripos($headers[0],"200 OK")?true:false; |
240 | 240 | } |
241 | 241 | |
242 | 242 | /** |
243 | - * Convert hexa to string |
|
244 | - * @param String $hex data in hexa |
|
245 | - * @return String Return result |
|
246 | - */ |
|
243 | + * Convert hexa to string |
|
244 | + * @param String $hex data in hexa |
|
245 | + * @return String Return result |
|
246 | + */ |
|
247 | 247 | public function hex2str($hex) { |
248 | 248 | $str = ''; |
249 | 249 | $hexln = strlen($hex); |
@@ -301,9 +301,9 @@ discard block |
||
301 | 301 | } |
302 | 302 | |
303 | 303 | /** |
304 | - * Returns list of available locales |
|
305 | - * |
|
306 | - * @return array |
|
304 | + * Returns list of available locales |
|
305 | + * |
|
306 | + * @return array |
|
307 | 307 | */ |
308 | 308 | public function listLocaleDir() |
309 | 309 | { |
@@ -398,100 +398,100 @@ discard block |
||
398 | 398 | function remove_accents($string) { |
399 | 399 | if ( !preg_match('/[\x80-\xff]/', $string) ) return $string; |
400 | 400 | $chars = array( |
401 | - // Decompositions for Latin-1 Supplement |
|
402 | - chr(195).chr(128) => 'A', chr(195).chr(129) => 'A', |
|
403 | - chr(195).chr(130) => 'A', chr(195).chr(131) => 'A', |
|
404 | - chr(195).chr(132) => 'A', chr(195).chr(133) => 'A', |
|
405 | - chr(195).chr(135) => 'C', chr(195).chr(136) => 'E', |
|
406 | - chr(195).chr(137) => 'E', chr(195).chr(138) => 'E', |
|
407 | - chr(195).chr(139) => 'E', chr(195).chr(140) => 'I', |
|
408 | - chr(195).chr(141) => 'I', chr(195).chr(142) => 'I', |
|
409 | - chr(195).chr(143) => 'I', chr(195).chr(145) => 'N', |
|
410 | - chr(195).chr(146) => 'O', chr(195).chr(147) => 'O', |
|
411 | - chr(195).chr(148) => 'O', chr(195).chr(149) => 'O', |
|
412 | - chr(195).chr(150) => 'O', chr(195).chr(153) => 'U', |
|
413 | - chr(195).chr(154) => 'U', chr(195).chr(155) => 'U', |
|
414 | - chr(195).chr(156) => 'U', chr(195).chr(157) => 'Y', |
|
415 | - chr(195).chr(159) => 's', chr(195).chr(160) => 'a', |
|
416 | - chr(195).chr(161) => 'a', chr(195).chr(162) => 'a', |
|
417 | - chr(195).chr(163) => 'a', chr(195).chr(164) => 'a', |
|
418 | - chr(195).chr(165) => 'a', chr(195).chr(167) => 'c', |
|
419 | - chr(195).chr(168) => 'e', chr(195).chr(169) => 'e', |
|
420 | - chr(195).chr(170) => 'e', chr(195).chr(171) => 'e', |
|
421 | - chr(195).chr(172) => 'i', chr(195).chr(173) => 'i', |
|
422 | - chr(195).chr(174) => 'i', chr(195).chr(175) => 'i', |
|
423 | - chr(195).chr(177) => 'n', chr(195).chr(178) => 'o', |
|
424 | - chr(195).chr(179) => 'o', chr(195).chr(180) => 'o', |
|
425 | - chr(195).chr(181) => 'o', chr(195).chr(182) => 'o', |
|
426 | - chr(195).chr(182) => 'o', chr(195).chr(185) => 'u', |
|
427 | - chr(195).chr(186) => 'u', chr(195).chr(187) => 'u', |
|
428 | - chr(195).chr(188) => 'u', chr(195).chr(189) => 'y', |
|
429 | - chr(195).chr(191) => 'y', |
|
430 | - // Decompositions for Latin Extended-A |
|
431 | - chr(196).chr(128) => 'A', chr(196).chr(129) => 'a', |
|
432 | - chr(196).chr(130) => 'A', chr(196).chr(131) => 'a', |
|
433 | - chr(196).chr(132) => 'A', chr(196).chr(133) => 'a', |
|
434 | - chr(196).chr(134) => 'C', chr(196).chr(135) => 'c', |
|
435 | - chr(196).chr(136) => 'C', chr(196).chr(137) => 'c', |
|
436 | - chr(196).chr(138) => 'C', chr(196).chr(139) => 'c', |
|
437 | - chr(196).chr(140) => 'C', chr(196).chr(141) => 'c', |
|
438 | - chr(196).chr(142) => 'D', chr(196).chr(143) => 'd', |
|
439 | - chr(196).chr(144) => 'D', chr(196).chr(145) => 'd', |
|
440 | - chr(196).chr(146) => 'E', chr(196).chr(147) => 'e', |
|
441 | - chr(196).chr(148) => 'E', chr(196).chr(149) => 'e', |
|
442 | - chr(196).chr(150) => 'E', chr(196).chr(151) => 'e', |
|
443 | - chr(196).chr(152) => 'E', chr(196).chr(153) => 'e', |
|
444 | - chr(196).chr(154) => 'E', chr(196).chr(155) => 'e', |
|
445 | - chr(196).chr(156) => 'G', chr(196).chr(157) => 'g', |
|
446 | - chr(196).chr(158) => 'G', chr(196).chr(159) => 'g', |
|
447 | - chr(196).chr(160) => 'G', chr(196).chr(161) => 'g', |
|
448 | - chr(196).chr(162) => 'G', chr(196).chr(163) => 'g', |
|
449 | - chr(196).chr(164) => 'H', chr(196).chr(165) => 'h', |
|
450 | - chr(196).chr(166) => 'H', chr(196).chr(167) => 'h', |
|
451 | - chr(196).chr(168) => 'I', chr(196).chr(169) => 'i', |
|
452 | - chr(196).chr(170) => 'I', chr(196).chr(171) => 'i', |
|
453 | - chr(196).chr(172) => 'I', chr(196).chr(173) => 'i', |
|
454 | - chr(196).chr(174) => 'I', chr(196).chr(175) => 'i', |
|
455 | - chr(196).chr(176) => 'I', chr(196).chr(177) => 'i', |
|
456 | - chr(196).chr(178) => 'IJ',chr(196).chr(179) => 'ij', |
|
457 | - chr(196).chr(180) => 'J', chr(196).chr(181) => 'j', |
|
458 | - chr(196).chr(182) => 'K', chr(196).chr(183) => 'k', |
|
459 | - chr(196).chr(184) => 'k', chr(196).chr(185) => 'L', |
|
460 | - chr(196).chr(186) => 'l', chr(196).chr(187) => 'L', |
|
461 | - chr(196).chr(188) => 'l', chr(196).chr(189) => 'L', |
|
462 | - chr(196).chr(190) => 'l', chr(196).chr(191) => 'L', |
|
463 | - chr(197).chr(128) => 'l', chr(197).chr(129) => 'L', |
|
464 | - chr(197).chr(130) => 'l', chr(197).chr(131) => 'N', |
|
465 | - chr(197).chr(132) => 'n', chr(197).chr(133) => 'N', |
|
466 | - chr(197).chr(134) => 'n', chr(197).chr(135) => 'N', |
|
467 | - chr(197).chr(136) => 'n', chr(197).chr(137) => 'N', |
|
468 | - chr(197).chr(138) => 'n', chr(197).chr(139) => 'N', |
|
469 | - chr(197).chr(140) => 'O', chr(197).chr(141) => 'o', |
|
470 | - chr(197).chr(142) => 'O', chr(197).chr(143) => 'o', |
|
471 | - chr(197).chr(144) => 'O', chr(197).chr(145) => 'o', |
|
472 | - chr(197).chr(146) => 'OE',chr(197).chr(147) => 'oe', |
|
473 | - chr(197).chr(148) => 'R',chr(197).chr(149) => 'r', |
|
474 | - chr(197).chr(150) => 'R',chr(197).chr(151) => 'r', |
|
475 | - chr(197).chr(152) => 'R',chr(197).chr(153) => 'r', |
|
476 | - chr(197).chr(154) => 'S',chr(197).chr(155) => 's', |
|
477 | - chr(197).chr(156) => 'S',chr(197).chr(157) => 's', |
|
478 | - chr(197).chr(158) => 'S',chr(197).chr(159) => 's', |
|
479 | - chr(197).chr(160) => 'S', chr(197).chr(161) => 's', |
|
480 | - chr(197).chr(162) => 'T', chr(197).chr(163) => 't', |
|
481 | - chr(197).chr(164) => 'T', chr(197).chr(165) => 't', |
|
482 | - chr(197).chr(166) => 'T', chr(197).chr(167) => 't', |
|
483 | - chr(197).chr(168) => 'U', chr(197).chr(169) => 'u', |
|
484 | - chr(197).chr(170) => 'U', chr(197).chr(171) => 'u', |
|
485 | - chr(197).chr(172) => 'U', chr(197).chr(173) => 'u', |
|
486 | - chr(197).chr(174) => 'U', chr(197).chr(175) => 'u', |
|
487 | - chr(197).chr(176) => 'U', chr(197).chr(177) => 'u', |
|
488 | - chr(197).chr(178) => 'U', chr(197).chr(179) => 'u', |
|
489 | - chr(197).chr(180) => 'W', chr(197).chr(181) => 'w', |
|
490 | - chr(197).chr(182) => 'Y', chr(197).chr(183) => 'y', |
|
491 | - chr(197).chr(184) => 'Y', chr(197).chr(185) => 'Z', |
|
492 | - chr(197).chr(186) => 'z', chr(197).chr(187) => 'Z', |
|
493 | - chr(197).chr(188) => 'z', chr(197).chr(189) => 'Z', |
|
494 | - chr(197).chr(190) => 'z', chr(197).chr(191) => 's' |
|
401 | + // Decompositions for Latin-1 Supplement |
|
402 | + chr(195).chr(128) => 'A', chr(195).chr(129) => 'A', |
|
403 | + chr(195).chr(130) => 'A', chr(195).chr(131) => 'A', |
|
404 | + chr(195).chr(132) => 'A', chr(195).chr(133) => 'A', |
|
405 | + chr(195).chr(135) => 'C', chr(195).chr(136) => 'E', |
|
406 | + chr(195).chr(137) => 'E', chr(195).chr(138) => 'E', |
|
407 | + chr(195).chr(139) => 'E', chr(195).chr(140) => 'I', |
|
408 | + chr(195).chr(141) => 'I', chr(195).chr(142) => 'I', |
|
409 | + chr(195).chr(143) => 'I', chr(195).chr(145) => 'N', |
|
410 | + chr(195).chr(146) => 'O', chr(195).chr(147) => 'O', |
|
411 | + chr(195).chr(148) => 'O', chr(195).chr(149) => 'O', |
|
412 | + chr(195).chr(150) => 'O', chr(195).chr(153) => 'U', |
|
413 | + chr(195).chr(154) => 'U', chr(195).chr(155) => 'U', |
|
414 | + chr(195).chr(156) => 'U', chr(195).chr(157) => 'Y', |
|
415 | + chr(195).chr(159) => 's', chr(195).chr(160) => 'a', |
|
416 | + chr(195).chr(161) => 'a', chr(195).chr(162) => 'a', |
|
417 | + chr(195).chr(163) => 'a', chr(195).chr(164) => 'a', |
|
418 | + chr(195).chr(165) => 'a', chr(195).chr(167) => 'c', |
|
419 | + chr(195).chr(168) => 'e', chr(195).chr(169) => 'e', |
|
420 | + chr(195).chr(170) => 'e', chr(195).chr(171) => 'e', |
|
421 | + chr(195).chr(172) => 'i', chr(195).chr(173) => 'i', |
|
422 | + chr(195).chr(174) => 'i', chr(195).chr(175) => 'i', |
|
423 | + chr(195).chr(177) => 'n', chr(195).chr(178) => 'o', |
|
424 | + chr(195).chr(179) => 'o', chr(195).chr(180) => 'o', |
|
425 | + chr(195).chr(181) => 'o', chr(195).chr(182) => 'o', |
|
426 | + chr(195).chr(182) => 'o', chr(195).chr(185) => 'u', |
|
427 | + chr(195).chr(186) => 'u', chr(195).chr(187) => 'u', |
|
428 | + chr(195).chr(188) => 'u', chr(195).chr(189) => 'y', |
|
429 | + chr(195).chr(191) => 'y', |
|
430 | + // Decompositions for Latin Extended-A |
|
431 | + chr(196).chr(128) => 'A', chr(196).chr(129) => 'a', |
|
432 | + chr(196).chr(130) => 'A', chr(196).chr(131) => 'a', |
|
433 | + chr(196).chr(132) => 'A', chr(196).chr(133) => 'a', |
|
434 | + chr(196).chr(134) => 'C', chr(196).chr(135) => 'c', |
|
435 | + chr(196).chr(136) => 'C', chr(196).chr(137) => 'c', |
|
436 | + chr(196).chr(138) => 'C', chr(196).chr(139) => 'c', |
|
437 | + chr(196).chr(140) => 'C', chr(196).chr(141) => 'c', |
|
438 | + chr(196).chr(142) => 'D', chr(196).chr(143) => 'd', |
|
439 | + chr(196).chr(144) => 'D', chr(196).chr(145) => 'd', |
|
440 | + chr(196).chr(146) => 'E', chr(196).chr(147) => 'e', |
|
441 | + chr(196).chr(148) => 'E', chr(196).chr(149) => 'e', |
|
442 | + chr(196).chr(150) => 'E', chr(196).chr(151) => 'e', |
|
443 | + chr(196).chr(152) => 'E', chr(196).chr(153) => 'e', |
|
444 | + chr(196).chr(154) => 'E', chr(196).chr(155) => 'e', |
|
445 | + chr(196).chr(156) => 'G', chr(196).chr(157) => 'g', |
|
446 | + chr(196).chr(158) => 'G', chr(196).chr(159) => 'g', |
|
447 | + chr(196).chr(160) => 'G', chr(196).chr(161) => 'g', |
|
448 | + chr(196).chr(162) => 'G', chr(196).chr(163) => 'g', |
|
449 | + chr(196).chr(164) => 'H', chr(196).chr(165) => 'h', |
|
450 | + chr(196).chr(166) => 'H', chr(196).chr(167) => 'h', |
|
451 | + chr(196).chr(168) => 'I', chr(196).chr(169) => 'i', |
|
452 | + chr(196).chr(170) => 'I', chr(196).chr(171) => 'i', |
|
453 | + chr(196).chr(172) => 'I', chr(196).chr(173) => 'i', |
|
454 | + chr(196).chr(174) => 'I', chr(196).chr(175) => 'i', |
|
455 | + chr(196).chr(176) => 'I', chr(196).chr(177) => 'i', |
|
456 | + chr(196).chr(178) => 'IJ',chr(196).chr(179) => 'ij', |
|
457 | + chr(196).chr(180) => 'J', chr(196).chr(181) => 'j', |
|
458 | + chr(196).chr(182) => 'K', chr(196).chr(183) => 'k', |
|
459 | + chr(196).chr(184) => 'k', chr(196).chr(185) => 'L', |
|
460 | + chr(196).chr(186) => 'l', chr(196).chr(187) => 'L', |
|
461 | + chr(196).chr(188) => 'l', chr(196).chr(189) => 'L', |
|
462 | + chr(196).chr(190) => 'l', chr(196).chr(191) => 'L', |
|
463 | + chr(197).chr(128) => 'l', chr(197).chr(129) => 'L', |
|
464 | + chr(197).chr(130) => 'l', chr(197).chr(131) => 'N', |
|
465 | + chr(197).chr(132) => 'n', chr(197).chr(133) => 'N', |
|
466 | + chr(197).chr(134) => 'n', chr(197).chr(135) => 'N', |
|
467 | + chr(197).chr(136) => 'n', chr(197).chr(137) => 'N', |
|
468 | + chr(197).chr(138) => 'n', chr(197).chr(139) => 'N', |
|
469 | + chr(197).chr(140) => 'O', chr(197).chr(141) => 'o', |
|
470 | + chr(197).chr(142) => 'O', chr(197).chr(143) => 'o', |
|
471 | + chr(197).chr(144) => 'O', chr(197).chr(145) => 'o', |
|
472 | + chr(197).chr(146) => 'OE',chr(197).chr(147) => 'oe', |
|
473 | + chr(197).chr(148) => 'R',chr(197).chr(149) => 'r', |
|
474 | + chr(197).chr(150) => 'R',chr(197).chr(151) => 'r', |
|
475 | + chr(197).chr(152) => 'R',chr(197).chr(153) => 'r', |
|
476 | + chr(197).chr(154) => 'S',chr(197).chr(155) => 's', |
|
477 | + chr(197).chr(156) => 'S',chr(197).chr(157) => 's', |
|
478 | + chr(197).chr(158) => 'S',chr(197).chr(159) => 's', |
|
479 | + chr(197).chr(160) => 'S', chr(197).chr(161) => 's', |
|
480 | + chr(197).chr(162) => 'T', chr(197).chr(163) => 't', |
|
481 | + chr(197).chr(164) => 'T', chr(197).chr(165) => 't', |
|
482 | + chr(197).chr(166) => 'T', chr(197).chr(167) => 't', |
|
483 | + chr(197).chr(168) => 'U', chr(197).chr(169) => 'u', |
|
484 | + chr(197).chr(170) => 'U', chr(197).chr(171) => 'u', |
|
485 | + chr(197).chr(172) => 'U', chr(197).chr(173) => 'u', |
|
486 | + chr(197).chr(174) => 'U', chr(197).chr(175) => 'u', |
|
487 | + chr(197).chr(176) => 'U', chr(197).chr(177) => 'u', |
|
488 | + chr(197).chr(178) => 'U', chr(197).chr(179) => 'u', |
|
489 | + chr(197).chr(180) => 'W', chr(197).chr(181) => 'w', |
|
490 | + chr(197).chr(182) => 'Y', chr(197).chr(183) => 'y', |
|
491 | + chr(197).chr(184) => 'Y', chr(197).chr(185) => 'Z', |
|
492 | + chr(197).chr(186) => 'z', chr(197).chr(187) => 'Z', |
|
493 | + chr(197).chr(188) => 'z', chr(197).chr(189) => 'Z', |
|
494 | + chr(197).chr(190) => 'z', chr(197).chr(191) => 's' |
|
495 | 495 | ); |
496 | 496 | $string = strtr($string, $chars); |
497 | 497 | return $string; |
@@ -15,33 +15,33 @@ discard block |
||
15 | 15 | if (isset($globalFilterName)) $this->filter_name = $globalFilterName; |
16 | 16 | $Connection = new Connection($dbc); |
17 | 17 | $this->db = $Connection->db(); |
18 | - } |
|
18 | + } |
|
19 | 19 | |
20 | 20 | public function addLastStatsUpdate($type,$stats_date) { |
21 | - $query = "DELETE FROM config WHERE name = :type; |
|
21 | + $query = "DELETE FROM config WHERE name = :type; |
|
22 | 22 | INSERT INTO config (name,value) VALUES (:type,:stats_date);"; |
23 | - $query_values = array('type' => $type,':stats_date' => $stats_date); |
|
24 | - try { |
|
25 | - $sth = $this->db->prepare($query); |
|
26 | - $sth->execute($query_values); |
|
27 | - } catch(PDOException $e) { |
|
28 | - return "error : ".$e->getMessage(); |
|
29 | - } |
|
30 | - } |
|
23 | + $query_values = array('type' => $type,':stats_date' => $stats_date); |
|
24 | + try { |
|
25 | + $sth = $this->db->prepare($query); |
|
26 | + $sth->execute($query_values); |
|
27 | + } catch(PDOException $e) { |
|
28 | + return "error : ".$e->getMessage(); |
|
29 | + } |
|
30 | + } |
|
31 | 31 | |
32 | 32 | public function getLastStatsUpdate($type = 'last_update_stats') { |
33 | - $query = "SELECT value FROM config WHERE name = :type"; |
|
34 | - try { |
|
35 | - $sth = $this->db->prepare($query); |
|
36 | - $sth->execute(array(':type' => $type)); |
|
37 | - } catch(PDOException $e) { |
|
38 | - echo "error : ".$e->getMessage(); |
|
39 | - } |
|
40 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
41 | - return $all; |
|
42 | - } |
|
43 | - public function deleteStats($filter_name = '') { |
|
44 | - /* |
|
33 | + $query = "SELECT value FROM config WHERE name = :type"; |
|
34 | + try { |
|
35 | + $sth = $this->db->prepare($query); |
|
36 | + $sth->execute(array(':type' => $type)); |
|
37 | + } catch(PDOException $e) { |
|
38 | + echo "error : ".$e->getMessage(); |
|
39 | + } |
|
40 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
41 | + return $all; |
|
42 | + } |
|
43 | + public function deleteStats($filter_name = '') { |
|
44 | + /* |
|
45 | 45 | $query = "DELETE FROM config WHERE name = 'last_update_stats'"; |
46 | 46 | try { |
47 | 47 | $sth = $this->db->prepare($query); |
@@ -50,106 +50,106 @@ discard block |
||
50 | 50 | return "error : ".$e->getMessage(); |
51 | 51 | } |
52 | 52 | */ |
53 | - $query = "DELETE FROM stats WHERE filter_name = :filter_name;DELETE FROM stats_aircraft WHERE filter_name = :filter_name;DELETE FROM stats_airline WHERE filter_name = :filter_name;DELETE FROM stats_airport WHERE filter_name = :filter_name;DELETE FROM stats_callsign WHERE filter_name = :filter_name;DELETE FROM stats_country WHERE filter_name = :filter_name;DELETE FROM stats_flight WHERE filter_name = :filter_name;DELETE FROM stats_owner WHERE filter_name = :filter_name;DELETE FROM stats_pilot WHERE filter_name = :filter_name;DELETE FROM stats_registration WHERE filter_name = :filter_name;"; |
|
54 | - try { |
|
55 | - $sth = $this->db->prepare($query); |
|
56 | - $sth->execute(array(':filter_name' => $filter_name)); |
|
57 | - } catch(PDOException $e) { |
|
58 | - return "error : ".$e->getMessage(); |
|
59 | - } |
|
60 | - } |
|
61 | - public function deleteOldStats($filter_name = '') { |
|
53 | + $query = "DELETE FROM stats WHERE filter_name = :filter_name;DELETE FROM stats_aircraft WHERE filter_name = :filter_name;DELETE FROM stats_airline WHERE filter_name = :filter_name;DELETE FROM stats_airport WHERE filter_name = :filter_name;DELETE FROM stats_callsign WHERE filter_name = :filter_name;DELETE FROM stats_country WHERE filter_name = :filter_name;DELETE FROM stats_flight WHERE filter_name = :filter_name;DELETE FROM stats_owner WHERE filter_name = :filter_name;DELETE FROM stats_pilot WHERE filter_name = :filter_name;DELETE FROM stats_registration WHERE filter_name = :filter_name;"; |
|
54 | + try { |
|
55 | + $sth = $this->db->prepare($query); |
|
56 | + $sth->execute(array(':filter_name' => $filter_name)); |
|
57 | + } catch(PDOException $e) { |
|
58 | + return "error : ".$e->getMessage(); |
|
59 | + } |
|
60 | + } |
|
61 | + public function deleteOldStats($filter_name = '') { |
|
62 | 62 | |
63 | - $query = "DELETE FROM config WHERE name = 'last_update_stats'"; |
|
64 | - try { |
|
65 | - $sth = $this->db->prepare($query); |
|
66 | - $sth->execute(); |
|
67 | - } catch(PDOException $e) { |
|
68 | - return "error : ".$e->getMessage(); |
|
69 | - } |
|
63 | + $query = "DELETE FROM config WHERE name = 'last_update_stats'"; |
|
64 | + try { |
|
65 | + $sth = $this->db->prepare($query); |
|
66 | + $sth->execute(); |
|
67 | + } catch(PDOException $e) { |
|
68 | + return "error : ".$e->getMessage(); |
|
69 | + } |
|
70 | 70 | |
71 | - $query = "DELETE FROM stats_aircraft WHERE filter_name = :filter_name;DELETE FROM stats_airline WHERE filter_name = :filter_name;DELETE FROM stats_callsign WHERE filter_name = :filter_name;DELETE FROM stats_country WHERE filter_name = :filter_name;DELETE FROM stats_owner WHERE filter_name = :filter_name;DELETE FROM stats_pilot WHERE filter_name = :filter_name;DELETE FROM stats_registration WHERE filter_name = :filter_name;"; |
|
72 | - try { |
|
73 | - $sth = $this->db->prepare($query); |
|
74 | - $sth->execute(array(':filter_name' => $filter_name)); |
|
75 | - } catch(PDOException $e) { |
|
76 | - return "error : ".$e->getMessage(); |
|
77 | - } |
|
78 | - } |
|
71 | + $query = "DELETE FROM stats_aircraft WHERE filter_name = :filter_name;DELETE FROM stats_airline WHERE filter_name = :filter_name;DELETE FROM stats_callsign WHERE filter_name = :filter_name;DELETE FROM stats_country WHERE filter_name = :filter_name;DELETE FROM stats_owner WHERE filter_name = :filter_name;DELETE FROM stats_pilot WHERE filter_name = :filter_name;DELETE FROM stats_registration WHERE filter_name = :filter_name;"; |
|
72 | + try { |
|
73 | + $sth = $this->db->prepare($query); |
|
74 | + $sth->execute(array(':filter_name' => $filter_name)); |
|
75 | + } catch(PDOException $e) { |
|
76 | + return "error : ".$e->getMessage(); |
|
77 | + } |
|
78 | + } |
|
79 | 79 | public function getAllAirlineNames($filter_name = '') { |
80 | 80 | if ($filter_name == '') $filter_name = $this->filter_name; |
81 | - $query = "SELECT * FROM stats_airline WHERE filter_name = :filter_name ORDER BY airline_name ASC"; |
|
82 | - try { |
|
83 | - $sth = $this->db->prepare($query); |
|
84 | - $sth->execute(array(':filter_name' => $filter_name)); |
|
85 | - } catch(PDOException $e) { |
|
86 | - echo "error : ".$e->getMessage(); |
|
87 | - } |
|
88 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
89 | - return $all; |
|
90 | - } |
|
81 | + $query = "SELECT * FROM stats_airline WHERE filter_name = :filter_name ORDER BY airline_name ASC"; |
|
82 | + try { |
|
83 | + $sth = $this->db->prepare($query); |
|
84 | + $sth->execute(array(':filter_name' => $filter_name)); |
|
85 | + } catch(PDOException $e) { |
|
86 | + echo "error : ".$e->getMessage(); |
|
87 | + } |
|
88 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
89 | + return $all; |
|
90 | + } |
|
91 | 91 | public function getAllAircraftTypes($stats_airline = '',$filter_name = '') { |
92 | 92 | if ($filter_name == '') $filter_name = $this->filter_name; |
93 | - $query = "SELECT * FROM stats_aircraft WHERE stats_airline = :stats_airline AND filter_name = :filter_name ORDER BY aircraft_manufacturer ASC"; |
|
94 | - try { |
|
95 | - $sth = $this->db->prepare($query); |
|
96 | - $sth->execute(array(':stats_airline' => $stats_airline,':filter_name' => $filter_name)); |
|
97 | - } catch(PDOException $e) { |
|
98 | - echo "error : ".$e->getMessage(); |
|
99 | - } |
|
100 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
101 | - return $all; |
|
102 | - } |
|
93 | + $query = "SELECT * FROM stats_aircraft WHERE stats_airline = :stats_airline AND filter_name = :filter_name ORDER BY aircraft_manufacturer ASC"; |
|
94 | + try { |
|
95 | + $sth = $this->db->prepare($query); |
|
96 | + $sth->execute(array(':stats_airline' => $stats_airline,':filter_name' => $filter_name)); |
|
97 | + } catch(PDOException $e) { |
|
98 | + echo "error : ".$e->getMessage(); |
|
99 | + } |
|
100 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
101 | + return $all; |
|
102 | + } |
|
103 | 103 | public function getAllManufacturers($stats_airline = '',$filter_name = '') { |
104 | 104 | if ($filter_name == '') $filter_name = $this->filter_name; |
105 | - $query = "SELECT DISTINCT(aircraft_manufacturer) FROM stats_aircraft WHERE stats_airline = :stats_airline AND filter_name = :filter_name AND aircraft_manufacturer <> '' ORDER BY aircraft_manufacturer ASC"; |
|
106 | - try { |
|
107 | - $sth = $this->db->prepare($query); |
|
108 | - $sth->execute(array(':stats_airline' => $stats_airline,':filter_name' => $filter_name)); |
|
109 | - } catch(PDOException $e) { |
|
110 | - echo "error : ".$e->getMessage(); |
|
111 | - } |
|
112 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
113 | - return $all; |
|
114 | - } |
|
105 | + $query = "SELECT DISTINCT(aircraft_manufacturer) FROM stats_aircraft WHERE stats_airline = :stats_airline AND filter_name = :filter_name AND aircraft_manufacturer <> '' ORDER BY aircraft_manufacturer ASC"; |
|
106 | + try { |
|
107 | + $sth = $this->db->prepare($query); |
|
108 | + $sth->execute(array(':stats_airline' => $stats_airline,':filter_name' => $filter_name)); |
|
109 | + } catch(PDOException $e) { |
|
110 | + echo "error : ".$e->getMessage(); |
|
111 | + } |
|
112 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
113 | + return $all; |
|
114 | + } |
|
115 | 115 | public function getAllAirportNames($stats_airline = '',$filter_name = '') { |
116 | 116 | if ($filter_name == '') $filter_name = $this->filter_name; |
117 | - $query = "SELECT airport_icao, airport_name,airport_city,airport_country FROM stats_airport WHERE stats_airline = :stats_airline AND filter_name = :filter_name AND stats_type = 'daily' GROUP BY airport_icao,airport_name,airport_city,airport_country ORDER BY airport_city ASC"; |
|
118 | - try { |
|
119 | - $sth = $this->db->prepare($query); |
|
120 | - $sth->execute(array(':stats_airline' => $stats_airline,':filter_name' => $filter_name)); |
|
121 | - } catch(PDOException $e) { |
|
122 | - echo "error : ".$e->getMessage(); |
|
123 | - } |
|
124 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
125 | - return $all; |
|
126 | - } |
|
117 | + $query = "SELECT airport_icao, airport_name,airport_city,airport_country FROM stats_airport WHERE stats_airline = :stats_airline AND filter_name = :filter_name AND stats_type = 'daily' GROUP BY airport_icao,airport_name,airport_city,airport_country ORDER BY airport_city ASC"; |
|
118 | + try { |
|
119 | + $sth = $this->db->prepare($query); |
|
120 | + $sth->execute(array(':stats_airline' => $stats_airline,':filter_name' => $filter_name)); |
|
121 | + } catch(PDOException $e) { |
|
122 | + echo "error : ".$e->getMessage(); |
|
123 | + } |
|
124 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
125 | + return $all; |
|
126 | + } |
|
127 | 127 | |
128 | 128 | public function getAllOwnerNames($stats_airline = '',$filter_name = '') { |
129 | 129 | if ($filter_name == '') $filter_name = $this->filter_name; |
130 | - $query = "SELECT owner_name FROM stats_owner WHERE stats_airline = :stats_airline AND filter_name = :filter_name ORDER BY owner_name ASC"; |
|
131 | - try { |
|
132 | - $sth = $this->db->prepare($query); |
|
133 | - $sth->execute(array(':stats_airline' => $stats_airline,':filter_name' => $filter_name)); |
|
134 | - } catch(PDOException $e) { |
|
135 | - echo "error : ".$e->getMessage(); |
|
136 | - } |
|
137 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
138 | - return $all; |
|
139 | - } |
|
130 | + $query = "SELECT owner_name FROM stats_owner WHERE stats_airline = :stats_airline AND filter_name = :filter_name ORDER BY owner_name ASC"; |
|
131 | + try { |
|
132 | + $sth = $this->db->prepare($query); |
|
133 | + $sth->execute(array(':stats_airline' => $stats_airline,':filter_name' => $filter_name)); |
|
134 | + } catch(PDOException $e) { |
|
135 | + echo "error : ".$e->getMessage(); |
|
136 | + } |
|
137 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
138 | + return $all; |
|
139 | + } |
|
140 | 140 | |
141 | 141 | public function getAllPilotNames($stats_airline = '',$filter_name = '') { |
142 | 142 | if ($filter_name == '') $filter_name = $this->filter_name; |
143 | - $query = "SELECT pilot_id,pilot_name FROM stats_pilot WHERE stats_airline = :stats_airline AND filter_name = :filter_name ORDER BY pilot_name ASC"; |
|
144 | - try { |
|
145 | - $sth = $this->db->prepare($query); |
|
146 | - $sth->execute(array(':stats_airline' => $stats_airline,':filter_name' => $filter_name)); |
|
147 | - } catch(PDOException $e) { |
|
148 | - echo "error : ".$e->getMessage(); |
|
149 | - } |
|
150 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
151 | - return $all; |
|
152 | - } |
|
143 | + $query = "SELECT pilot_id,pilot_name FROM stats_pilot WHERE stats_airline = :stats_airline AND filter_name = :filter_name ORDER BY pilot_name ASC"; |
|
144 | + try { |
|
145 | + $sth = $this->db->prepare($query); |
|
146 | + $sth->execute(array(':stats_airline' => $stats_airline,':filter_name' => $filter_name)); |
|
147 | + } catch(PDOException $e) { |
|
148 | + echo "error : ".$e->getMessage(); |
|
149 | + } |
|
150 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
151 | + return $all; |
|
152 | + } |
|
153 | 153 | |
154 | 154 | |
155 | 155 | public function countAllAircraftTypes($limit = true, $stats_airline = '', $filter_name = '',$year = '', $month = '') { |
@@ -166,15 +166,15 @@ discard block |
||
166 | 166 | } |
167 | 167 | $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
168 | 168 | } else $all = array(); |
169 | - if (empty($all)) { |
|
170 | - $filters = array('airlines' => array($stats_airline)); |
|
171 | - if ($filter_name != '') { |
|
172 | - $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
173 | - } |
|
174 | - $Spotter = new Spotter($this->db); |
|
175 | - $all = $Spotter->countAllAircraftTypes($limit,0,'',$filters,$year,$month); |
|
176 | - } |
|
177 | - return $all; |
|
169 | + if (empty($all)) { |
|
170 | + $filters = array('airlines' => array($stats_airline)); |
|
171 | + if ($filter_name != '') { |
|
172 | + $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
173 | + } |
|
174 | + $Spotter = new Spotter($this->db); |
|
175 | + $all = $Spotter->countAllAircraftTypes($limit,0,'',$filters,$year,$month); |
|
176 | + } |
|
177 | + return $all; |
|
178 | 178 | } |
179 | 179 | public function countAllAirlineCountries($limit = true,$filter_name = '',$year = '',$month = '') { |
180 | 180 | global $globalStatsFilters; |
@@ -190,15 +190,15 @@ discard block |
||
190 | 190 | } |
191 | 191 | $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
192 | 192 | } else $all = array(); |
193 | - if (empty($all)) { |
|
194 | - $Spotter = new Spotter($this->db); |
|
195 | - $filters = array(); |
|
196 | - if ($filter_name != '') { |
|
197 | - $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
193 | + if (empty($all)) { |
|
194 | + $Spotter = new Spotter($this->db); |
|
195 | + $filters = array(); |
|
196 | + if ($filter_name != '') { |
|
197 | + $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
198 | 198 | } |
199 | - $all = $Spotter->countAllAirlineCountries($limit,$filters,$year,$month); |
|
200 | - } |
|
201 | - return $all; |
|
199 | + $all = $Spotter->countAllAirlineCountries($limit,$filters,$year,$month); |
|
200 | + } |
|
201 | + return $all; |
|
202 | 202 | } |
203 | 203 | public function countAllAircraftManufacturers($limit = true,$stats_airline = '', $filter_name = '',$year = '', $month = '') { |
204 | 204 | global $globalStatsFilters; |
@@ -239,37 +239,37 @@ discard block |
||
239 | 239 | } |
240 | 240 | $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
241 | 241 | } else $all = array(); |
242 | - if (empty($all)) { |
|
242 | + if (empty($all)) { |
|
243 | 243 | $filters = array('airlines' => array($stats_airline)); |
244 | 244 | if ($filter_name != '') { |
245 | - $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
245 | + $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
246 | 246 | } |
247 | 247 | $Spotter = new Spotter($this->db); |
248 | 248 | $all = $Spotter->countAllArrivalCountries($limit,$filters,$year,$month); |
249 | - } |
|
250 | - return $all; |
|
249 | + } |
|
250 | + return $all; |
|
251 | 251 | } |
252 | 252 | public function countAllDepartureCountries($limit = true, $stats_airline = '', $filter_name = '', $year = '', $month = '') { |
253 | 253 | global $globalStatsFilters; |
254 | 254 | if ($filter_name == '') $filter_name = $this->filter_name; |
255 | 255 | if ($limit) $query = "SELECT airport_country AS airport_departure_country, SUM(departure) as airport_departure_country_count FROM stats_airport WHERE stats_type = 'yearly' AND stats_airline = :stats_airline AND filter_name = :filter_name GROUP BY airport_departure_country ORDER BY airport_departure_country_count DESC LIMIT 10 OFFSET 0"; |
256 | 256 | else $query = "SELECT airport_country AS airport_departure_country, SUM(departure) as airport_departure_country_count FROM stats_airport WHERE stats_type = 'yearly' AND stats_airline = :stats_airline AND filter_name = :filter_name GROUP BY airport_departure_country ORDER BY airport_departure_country_count DESC"; |
257 | - try { |
|
258 | - $sth = $this->db->prepare($query); |
|
259 | - $sth->execute(array(':stats_airline' => $stats_airline,':filter_name' => $filter_name)); |
|
260 | - } catch(PDOException $e) { |
|
261 | - echo "error : ".$e->getMessage(); |
|
262 | - } |
|
263 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
264 | - if (empty($all)) { |
|
257 | + try { |
|
258 | + $sth = $this->db->prepare($query); |
|
259 | + $sth->execute(array(':stats_airline' => $stats_airline,':filter_name' => $filter_name)); |
|
260 | + } catch(PDOException $e) { |
|
261 | + echo "error : ".$e->getMessage(); |
|
262 | + } |
|
263 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
264 | + if (empty($all)) { |
|
265 | 265 | $filters = array('airlines' => array($stats_airline)); |
266 | 266 | if ($filter_name != '') { |
267 | - $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
267 | + $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
268 | 268 | } |
269 | 269 | $Spotter = new Spotter($this->db); |
270 | 270 | $all = $Spotter->countAllDepartureCountries($filters,$year,$month); |
271 | - } |
|
272 | - return $all; |
|
271 | + } |
|
272 | + return $all; |
|
273 | 273 | } |
274 | 274 | |
275 | 275 | public function countAllAirlines($limit = true,$filter_name = '',$year = '',$month = '') { |
@@ -286,16 +286,16 @@ discard block |
||
286 | 286 | } |
287 | 287 | $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
288 | 288 | } else $all = array(); |
289 | - if (empty($all)) { |
|
290 | - $Spotter = new Spotter($this->db); |
|
291 | - $filters = array(); |
|
292 | - if ($filter_name != '') { |
|
293 | - $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
289 | + if (empty($all)) { |
|
290 | + $Spotter = new Spotter($this->db); |
|
291 | + $filters = array(); |
|
292 | + if ($filter_name != '') { |
|
293 | + $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
294 | 294 | } |
295 | 295 | |
296 | - $all = $Spotter->countAllAirlines($limit,0,'',$filters,$year,$month); |
|
297 | - } |
|
298 | - return $all; |
|
296 | + $all = $Spotter->countAllAirlines($limit,0,'',$filters,$year,$month); |
|
297 | + } |
|
298 | + return $all; |
|
299 | 299 | } |
300 | 300 | public function countAllAircraftRegistrations($limit = true,$stats_airline = '',$filter_name = '',$year = '',$month = '') { |
301 | 301 | global $globalStatsFilters; |
@@ -311,15 +311,15 @@ discard block |
||
311 | 311 | } |
312 | 312 | $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
313 | 313 | } else $all = array(); |
314 | - if (empty($all)) { |
|
314 | + if (empty($all)) { |
|
315 | 315 | $filters = array('airlines' => array($stats_airline)); |
316 | 316 | if ($filter_name != '') { |
317 | 317 | $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
318 | 318 | } |
319 | - $Spotter = new Spotter($this->db); |
|
320 | - $all = $Spotter->countAllAircraftRegistrations($limit,0,'',$filters,$year,$month); |
|
321 | - } |
|
322 | - return $all; |
|
319 | + $Spotter = new Spotter($this->db); |
|
320 | + $all = $Spotter->countAllAircraftRegistrations($limit,0,'',$filters,$year,$month); |
|
321 | + } |
|
322 | + return $all; |
|
323 | 323 | } |
324 | 324 | public function countAllCallsigns($limit = true,$stats_airline = '',$filter_name = '',$year = '',$month = '') { |
325 | 325 | global $globalStatsFilters; |
@@ -359,7 +359,7 @@ discard block |
||
359 | 359 | echo "error : ".$e->getMessage(); |
360 | 360 | } |
361 | 361 | $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
362 | - /* |
|
362 | + /* |
|
363 | 363 | if (empty($all)) { |
364 | 364 | $Spotter = new Spotter($this->db); |
365 | 365 | $all = $Spotter->countAllFlightOverCountries($limit); |
@@ -410,15 +410,15 @@ discard block |
||
410 | 410 | } |
411 | 411 | $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
412 | 412 | } else $all = array(); |
413 | - if (empty($all)) { |
|
413 | + if (empty($all)) { |
|
414 | 414 | $filters = array('airlines' => array($stats_airline)); |
415 | 415 | if ($filter_name != '') { |
416 | 416 | $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
417 | 417 | } |
418 | - $Spotter = new Spotter($this->db); |
|
419 | - $all = $Spotter->countAllOwners($limit,0,'',$filters,$year,$month); |
|
420 | - } |
|
421 | - return $all; |
|
418 | + $Spotter = new Spotter($this->db); |
|
419 | + $all = $Spotter->countAllOwners($limit,0,'',$filters,$year,$month); |
|
420 | + } |
|
421 | + return $all; |
|
422 | 422 | } |
423 | 423 | public function countAllDepartureAirports($limit = true,$stats_airline = '',$filter_name = '',$year = '',$month = '') { |
424 | 424 | global $globalStatsFilters; |
@@ -434,33 +434,33 @@ discard block |
||
434 | 434 | } |
435 | 435 | $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
436 | 436 | } else $all = array(); |
437 | - if (empty($all)) { |
|
437 | + if (empty($all)) { |
|
438 | 438 | $filters = array('airlines' => array($stats_airline)); |
439 | - if ($filter_name != '') { |
|
440 | - $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
441 | - } |
|
442 | - $Spotter = new Spotter($this->db); |
|
443 | - $pall = $Spotter->countAllDepartureAirports($limit,0,'',$filters,$year,$month); |
|
444 | - $dall = $Spotter->countAllDetectedDepartureAirports($limit,0,'',$filters,$year,$month); |
|
445 | - $all = array(); |
|
446 | - foreach ($pall as $value) { |
|
447 | - $icao = $value['airport_departure_icao']; |
|
448 | - $all[$icao] = $value; |
|
449 | - } |
|
439 | + if ($filter_name != '') { |
|
440 | + $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
441 | + } |
|
442 | + $Spotter = new Spotter($this->db); |
|
443 | + $pall = $Spotter->countAllDepartureAirports($limit,0,'',$filters,$year,$month); |
|
444 | + $dall = $Spotter->countAllDetectedDepartureAirports($limit,0,'',$filters,$year,$month); |
|
445 | + $all = array(); |
|
446 | + foreach ($pall as $value) { |
|
447 | + $icao = $value['airport_departure_icao']; |
|
448 | + $all[$icao] = $value; |
|
449 | + } |
|
450 | 450 | |
451 | - foreach ($dall as $value) { |
|
452 | - $icao = $value['airport_departure_icao']; |
|
453 | - if (isset($all[$icao])) { |
|
454 | - $all[$icao]['airport_departure_icao_count'] = $all[$icao]['airport_departure_icao_count'] + $value['airport_departure_icao_count']; |
|
455 | - } else $all[$icao] = $value; |
|
456 | - } |
|
457 | - $count = array(); |
|
458 | - foreach ($all as $key => $row) { |
|
459 | - $count[$key] = $row['airport_departure_icao_count']; |
|
460 | - } |
|
461 | - array_multisort($count,SORT_DESC,$all); |
|
462 | - } |
|
463 | - return $all; |
|
451 | + foreach ($dall as $value) { |
|
452 | + $icao = $value['airport_departure_icao']; |
|
453 | + if (isset($all[$icao])) { |
|
454 | + $all[$icao]['airport_departure_icao_count'] = $all[$icao]['airport_departure_icao_count'] + $value['airport_departure_icao_count']; |
|
455 | + } else $all[$icao] = $value; |
|
456 | + } |
|
457 | + $count = array(); |
|
458 | + foreach ($all as $key => $row) { |
|
459 | + $count[$key] = $row['airport_departure_icao_count']; |
|
460 | + } |
|
461 | + array_multisort($count,SORT_DESC,$all); |
|
462 | + } |
|
463 | + return $all; |
|
464 | 464 | } |
465 | 465 | public function countAllArrivalAirports($limit = true,$stats_airline = '',$filter_name = '',$year = '',$month = '') { |
466 | 466 | global $globalStatsFilters; |
@@ -484,26 +484,26 @@ discard block |
||
484 | 484 | $Spotter = new Spotter($this->db); |
485 | 485 | $pall = $Spotter->countAllArrivalAirports($limit,0,'',false,$filters,$year,$month); |
486 | 486 | $dall = $Spotter->countAllDetectedArrivalAirports($limit,0,'',false,$filters,$year,$month); |
487 | - $all = array(); |
|
488 | - foreach ($pall as $value) { |
|
489 | - $icao = $value['airport_arrival_icao']; |
|
490 | - $all[$icao] = $value; |
|
491 | - } |
|
487 | + $all = array(); |
|
488 | + foreach ($pall as $value) { |
|
489 | + $icao = $value['airport_arrival_icao']; |
|
490 | + $all[$icao] = $value; |
|
491 | + } |
|
492 | 492 | |
493 | - foreach ($dall as $value) { |
|
494 | - $icao = $value['airport_arrival_icao']; |
|
495 | - if (isset($all[$icao])) { |
|
496 | - $all[$icao]['airport_arrival_icao_count'] = $all[$icao]['airport_arrival_icao_count'] + $value['airport_arrival_icao_count']; |
|
497 | - } else $all[$icao] = $value; |
|
498 | - } |
|
499 | - $count = array(); |
|
500 | - foreach ($all as $key => $row) { |
|
501 | - $count[$key] = $row['airport_arrival_icao_count']; |
|
502 | - } |
|
503 | - array_multisort($count,SORT_DESC,$all); |
|
504 | - } |
|
493 | + foreach ($dall as $value) { |
|
494 | + $icao = $value['airport_arrival_icao']; |
|
495 | + if (isset($all[$icao])) { |
|
496 | + $all[$icao]['airport_arrival_icao_count'] = $all[$icao]['airport_arrival_icao_count'] + $value['airport_arrival_icao_count']; |
|
497 | + } else $all[$icao] = $value; |
|
498 | + } |
|
499 | + $count = array(); |
|
500 | + foreach ($all as $key => $row) { |
|
501 | + $count[$key] = $row['airport_arrival_icao_count']; |
|
502 | + } |
|
503 | + array_multisort($count,SORT_DESC,$all); |
|
504 | + } |
|
505 | 505 | |
506 | - return $all; |
|
506 | + return $all; |
|
507 | 507 | } |
508 | 508 | public function countAllMonthsLastYear($limit = true,$stats_airline = '',$filter_name = '') { |
509 | 509 | global $globalDBdriver, $globalStatsFilters; |
@@ -516,23 +516,23 @@ discard block |
||
516 | 516 | else $query = "SELECT EXTRACT(MONTH FROM stats_date) as month_name, EXTRACT(YEAR FROM stats_date) as year_name, cnt as date_count FROM stats WHERE stats_type = 'flights_bymonth' AND stats_airline = :stats_airline AND filter_name = :filter_name"; |
517 | 517 | } |
518 | 518 | $query_data = array(':stats_airline' => $stats_airline,':filter_name' => $filter_name); |
519 | - try { |
|
520 | - $sth = $this->db->prepare($query); |
|
521 | - $sth->execute($query_data); |
|
522 | - } catch(PDOException $e) { |
|
523 | - echo "error : ".$e->getMessage(); |
|
524 | - } |
|
525 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
526 | - if (empty($all)) { |
|
519 | + try { |
|
520 | + $sth = $this->db->prepare($query); |
|
521 | + $sth->execute($query_data); |
|
522 | + } catch(PDOException $e) { |
|
523 | + echo "error : ".$e->getMessage(); |
|
524 | + } |
|
525 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
526 | + if (empty($all)) { |
|
527 | 527 | $filters = array('airlines' => array($stats_airline)); |
528 | 528 | if ($filter_name != '') { |
529 | 529 | $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
530 | 530 | } |
531 | - $Spotter = new Spotter($this->db); |
|
532 | - $all = $Spotter->countAllMonthsLastYear($filters); |
|
533 | - } |
|
531 | + $Spotter = new Spotter($this->db); |
|
532 | + $all = $Spotter->countAllMonthsLastYear($filters); |
|
533 | + } |
|
534 | 534 | |
535 | - return $all; |
|
535 | + return $all; |
|
536 | 536 | } |
537 | 537 | |
538 | 538 | public function countAllDatesLastMonth($stats_airline = '',$filter_name = '') { |
@@ -540,22 +540,22 @@ discard block |
||
540 | 540 | if ($filter_name == '') $filter_name = $this->filter_name; |
541 | 541 | $query = "SELECT flight_date as date_name, cnt as date_count FROM stats_flight WHERE stats_type = 'month' AND stats_airline = :stats_airline AND filter_name = :filter_name"; |
542 | 542 | $query_data = array(':stats_airline' => $stats_airline,':filter_name' => $filter_name); |
543 | - try { |
|
544 | - $sth = $this->db->prepare($query); |
|
545 | - $sth->execute($query_data); |
|
546 | - } catch(PDOException $e) { |
|
547 | - echo "error : ".$e->getMessage(); |
|
548 | - } |
|
549 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
550 | - if (empty($all)) { |
|
543 | + try { |
|
544 | + $sth = $this->db->prepare($query); |
|
545 | + $sth->execute($query_data); |
|
546 | + } catch(PDOException $e) { |
|
547 | + echo "error : ".$e->getMessage(); |
|
548 | + } |
|
549 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
550 | + if (empty($all)) { |
|
551 | 551 | $filters = array('airlines' => array($stats_airline)); |
552 | 552 | if ($filter_name != '') { |
553 | 553 | $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
554 | 554 | } |
555 | - $Spotter = new Spotter($this->db); |
|
556 | - $all = $Spotter->countAllDatesLastMonth($filters); |
|
557 | - } |
|
558 | - return $all; |
|
555 | + $Spotter = new Spotter($this->db); |
|
556 | + $all = $Spotter->countAllDatesLastMonth($filters); |
|
557 | + } |
|
558 | + return $all; |
|
559 | 559 | } |
560 | 560 | public function countAllDatesLast7Days($stats_airline = '',$filter_name = '') { |
561 | 561 | global $globalDBdriver, $globalStatsFilters; |
@@ -566,108 +566,108 @@ discard block |
||
566 | 566 | $query = "SELECT flight_date as date_name, cnt as date_count FROM stats_flight WHERE stats_type = 'month' AND flight_date::timestamp >= CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '7 DAYS' AND stats_airline = :stats_airline AND filter_name = :filter_name"; |
567 | 567 | } |
568 | 568 | $query_data = array(':stats_airline' => $stats_airline,':filter_name' => $filter_name); |
569 | - try { |
|
570 | - $sth = $this->db->prepare($query); |
|
571 | - $sth->execute($query_data); |
|
572 | - } catch(PDOException $e) { |
|
573 | - echo "error : ".$e->getMessage(); |
|
574 | - } |
|
575 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
576 | - if (empty($all)) { |
|
569 | + try { |
|
570 | + $sth = $this->db->prepare($query); |
|
571 | + $sth->execute($query_data); |
|
572 | + } catch(PDOException $e) { |
|
573 | + echo "error : ".$e->getMessage(); |
|
574 | + } |
|
575 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
576 | + if (empty($all)) { |
|
577 | 577 | $filters = array('airlines' => array($stats_airline)); |
578 | 578 | if ($filter_name != '') { |
579 | 579 | $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
580 | 580 | } |
581 | - $Spotter = new Spotter($this->db); |
|
582 | - $all = $Spotter->countAllDatesLast7Days($filters); |
|
583 | - } |
|
584 | - return $all; |
|
581 | + $Spotter = new Spotter($this->db); |
|
582 | + $all = $Spotter->countAllDatesLast7Days($filters); |
|
583 | + } |
|
584 | + return $all; |
|
585 | 585 | } |
586 | 586 | public function countAllDates($stats_airline = '',$filter_name = '') { |
587 | 587 | global $globalStatsFilters; |
588 | 588 | if ($filter_name == '') $filter_name = $this->filter_name; |
589 | 589 | $query = "SELECT flight_date as date_name, cnt as date_count FROM stats_flight WHERE stats_type = 'date' AND stats_airline = :stats_airline AND filter_name = :filter_name"; |
590 | 590 | $query_data = array(':stats_airline' => $stats_airline,':filter_name' => $filter_name); |
591 | - try { |
|
592 | - $sth = $this->db->prepare($query); |
|
593 | - $sth->execute($query_data); |
|
594 | - } catch(PDOException $e) { |
|
595 | - echo "error : ".$e->getMessage(); |
|
596 | - } |
|
597 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
598 | - if (empty($all)) { |
|
591 | + try { |
|
592 | + $sth = $this->db->prepare($query); |
|
593 | + $sth->execute($query_data); |
|
594 | + } catch(PDOException $e) { |
|
595 | + echo "error : ".$e->getMessage(); |
|
596 | + } |
|
597 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
598 | + if (empty($all)) { |
|
599 | 599 | $filters = array('airlines' => array($stats_airline)); |
600 | 600 | if ($filter_name != '') { |
601 | - $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
601 | + $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
602 | 602 | } |
603 | - $Spotter = new Spotter($this->db); |
|
604 | - $all = $Spotter->countAllDates($filters); |
|
605 | - } |
|
606 | - return $all; |
|
603 | + $Spotter = new Spotter($this->db); |
|
604 | + $all = $Spotter->countAllDates($filters); |
|
605 | + } |
|
606 | + return $all; |
|
607 | 607 | } |
608 | 608 | public function countAllDatesByAirlines($filter_name = '') { |
609 | 609 | global $globalStatsFilters; |
610 | 610 | if ($filter_name == '') $filter_name = $this->filter_name; |
611 | 611 | $query = "SELECT stats_airline as airline_icao, flight_date as date_name, cnt as date_count FROM stats_flight WHERE stats_type = 'date' AND filter_name = :filter_name"; |
612 | 612 | $query_data = array('filter_name' => $filter_name); |
613 | - try { |
|
614 | - $sth = $this->db->prepare($query); |
|
615 | - $sth->execute($query_data); |
|
616 | - } catch(PDOException $e) { |
|
617 | - echo "error : ".$e->getMessage(); |
|
618 | - } |
|
619 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
620 | - if (empty($all)) { |
|
621 | - $filters = array(); |
|
622 | - if ($filter_name != '') { |
|
623 | - $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
613 | + try { |
|
614 | + $sth = $this->db->prepare($query); |
|
615 | + $sth->execute($query_data); |
|
616 | + } catch(PDOException $e) { |
|
617 | + echo "error : ".$e->getMessage(); |
|
618 | + } |
|
619 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
620 | + if (empty($all)) { |
|
621 | + $filters = array(); |
|
622 | + if ($filter_name != '') { |
|
623 | + $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
624 | 624 | } |
625 | - $Spotter = new Spotter($this->db); |
|
626 | - $all = $Spotter->countAllDatesByAirlines($filters); |
|
627 | - } |
|
628 | - return $all; |
|
625 | + $Spotter = new Spotter($this->db); |
|
626 | + $all = $Spotter->countAllDatesByAirlines($filters); |
|
627 | + } |
|
628 | + return $all; |
|
629 | 629 | } |
630 | 630 | public function countAllMonths($stats_airline = '',$filter_name = '') { |
631 | 631 | global $globalStatsFilters; |
632 | 632 | if ($filter_name == '') $filter_name = $this->filter_name; |
633 | - $query = "SELECT YEAR(stats_date) AS year_name,MONTH(stats_date) AS month_name, cnt as date_count FROM stats WHERE stats_type = 'flights_bymonth' AND stats_airline = :stats_airline AND filter_name = :filter_name"; |
|
634 | - try { |
|
635 | - $sth = $this->db->prepare($query); |
|
636 | - $sth->execute(array(':stats_airline' => $stats_airline, ':filter_name' => $filter_name)); |
|
637 | - } catch(PDOException $e) { |
|
638 | - echo "error : ".$e->getMessage(); |
|
639 | - } |
|
640 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
641 | - if (empty($all)) { |
|
633 | + $query = "SELECT YEAR(stats_date) AS year_name,MONTH(stats_date) AS month_name, cnt as date_count FROM stats WHERE stats_type = 'flights_bymonth' AND stats_airline = :stats_airline AND filter_name = :filter_name"; |
|
634 | + try { |
|
635 | + $sth = $this->db->prepare($query); |
|
636 | + $sth->execute(array(':stats_airline' => $stats_airline, ':filter_name' => $filter_name)); |
|
637 | + } catch(PDOException $e) { |
|
638 | + echo "error : ".$e->getMessage(); |
|
639 | + } |
|
640 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
641 | + if (empty($all)) { |
|
642 | 642 | $filters = array('airlines' => array($stats_airline)); |
643 | 643 | if ($filter_name != '') { |
644 | 644 | $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
645 | 645 | } |
646 | - $Spotter = new Spotter($this->db); |
|
647 | - $all = $Spotter->countAllMonths($filters); |
|
648 | - } |
|
649 | - return $all; |
|
646 | + $Spotter = new Spotter($this->db); |
|
647 | + $all = $Spotter->countAllMonths($filters); |
|
648 | + } |
|
649 | + return $all; |
|
650 | 650 | } |
651 | 651 | public function countAllMilitaryMonths($filter_name = '') { |
652 | 652 | global $globalStatsFilters; |
653 | 653 | if ($filter_name == '') $filter_name = $this->filter_name; |
654 | - $query = "SELECT YEAR(stats_date) AS year_name,MONTH(stats_date) AS month_name, cnt as date_count FROM stats WHERE stats_type = 'military_flights_bymonth' AND filter_name = :filter_name"; |
|
655 | - try { |
|
656 | - $sth = $this->db->prepare($query); |
|
657 | - $sth->execute(array(':filter_name' => $filter_name)); |
|
658 | - } catch(PDOException $e) { |
|
659 | - echo "error : ".$e->getMessage(); |
|
660 | - } |
|
661 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
662 | - if (empty($all)) { |
|
663 | - $filters = array(); |
|
664 | - if ($filter_name != '') { |
|
665 | - $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
654 | + $query = "SELECT YEAR(stats_date) AS year_name,MONTH(stats_date) AS month_name, cnt as date_count FROM stats WHERE stats_type = 'military_flights_bymonth' AND filter_name = :filter_name"; |
|
655 | + try { |
|
656 | + $sth = $this->db->prepare($query); |
|
657 | + $sth->execute(array(':filter_name' => $filter_name)); |
|
658 | + } catch(PDOException $e) { |
|
659 | + echo "error : ".$e->getMessage(); |
|
660 | + } |
|
661 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
662 | + if (empty($all)) { |
|
663 | + $filters = array(); |
|
664 | + if ($filter_name != '') { |
|
665 | + $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
666 | 666 | } |
667 | - $Spotter = new Spotter($this->db); |
|
668 | - $all = $Spotter->countAllMilitaryMonths($filters); |
|
669 | - } |
|
670 | - return $all; |
|
667 | + $Spotter = new Spotter($this->db); |
|
668 | + $all = $Spotter->countAllMilitaryMonths($filters); |
|
669 | + } |
|
670 | + return $all; |
|
671 | 671 | } |
672 | 672 | public function countAllHours($orderby = 'hour',$limit = true,$stats_airline = '',$filter_name = '') { |
673 | 673 | global $globalTimezone, $globalDBdriver, $globalStatsFilters; |
@@ -683,22 +683,22 @@ discard block |
||
683 | 683 | $query .= " ORDER BY CAST(flight_date AS integer) ASC"; |
684 | 684 | } |
685 | 685 | if ($orderby == 'count') $query .= " ORDER BY hour_count DESC"; |
686 | - try { |
|
687 | - $sth = $this->db->prepare($query); |
|
688 | - $sth->execute(array(':stats_airline' => $stats_airline, ':filter_name' => $filter_name)); |
|
689 | - } catch(PDOException $e) { |
|
690 | - echo "error : ".$e->getMessage(); |
|
691 | - } |
|
692 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
693 | - if (empty($all)) { |
|
686 | + try { |
|
687 | + $sth = $this->db->prepare($query); |
|
688 | + $sth->execute(array(':stats_airline' => $stats_airline, ':filter_name' => $filter_name)); |
|
689 | + } catch(PDOException $e) { |
|
690 | + echo "error : ".$e->getMessage(); |
|
691 | + } |
|
692 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
693 | + if (empty($all)) { |
|
694 | 694 | $filters = array('airlines' => array($stats_airline)); |
695 | 695 | if ($filter_name != '') { |
696 | - $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
696 | + $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
697 | 697 | } |
698 | - $Spotter = new Spotter($this->db); |
|
699 | - $all = $Spotter->countAllHours($orderby,$filters); |
|
700 | - } |
|
701 | - return $all; |
|
698 | + $Spotter = new Spotter($this->db); |
|
699 | + $all = $Spotter->countAllHours($orderby,$filters); |
|
700 | + } |
|
701 | + return $all; |
|
702 | 702 | } |
703 | 703 | |
704 | 704 | public function countOverallFlights($stats_airline = '', $filter_name = '',$year = '',$month = '') { |
@@ -722,9 +722,9 @@ discard block |
||
722 | 722 | if ($year == '') $year = date('Y'); |
723 | 723 | $all = $this->getSumStats('military_flights_bymonth',$year,'',$filter_name,$month); |
724 | 724 | if (empty($all)) { |
725 | - $filters = array(); |
|
726 | - if ($filter_name != '') { |
|
727 | - $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
725 | + $filters = array(); |
|
726 | + if ($filter_name != '') { |
|
727 | + $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
728 | 728 | } |
729 | 729 | $Spotter = new Spotter($this->db); |
730 | 730 | $all = $Spotter->countOverallMilitaryFlights($filters,$year,$month); |
@@ -776,9 +776,9 @@ discard block |
||
776 | 776 | $all = $result[0]['nb_airline']; |
777 | 777 | } else $all = $this->getSumStats('airlines_bymonth',$year,'',$filter_name,$month); |
778 | 778 | if (empty($all)) { |
779 | - $filters = array(); |
|
780 | - if ($filter_name != '') { |
|
781 | - $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
779 | + $filters = array(); |
|
780 | + if ($filter_name != '') { |
|
781 | + $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
782 | 782 | } |
783 | 783 | $Spotter = new Spotter($this->db); |
784 | 784 | $all = $Spotter->countOverallAirlines($filters,$year,$month); |
@@ -831,33 +831,33 @@ discard block |
||
831 | 831 | if ($filter_name == '') $filter_name = $this->filter_name; |
832 | 832 | $query = "SELECT * FROM stats_airport WHERE stats_type = 'daily' AND airport_icao = :airport_icao AND stats_airline = :stats_airline AND filter_name = :filter_name ORDER BY date"; |
833 | 833 | $query_values = array(':airport_icao' => $airport_icao,':stats_airline' => $stats_airline, ':filter_name' => $filter_name); |
834 | - try { |
|
835 | - $sth = $this->db->prepare($query); |
|
836 | - $sth->execute($query_values); |
|
837 | - } catch(PDOException $e) { |
|
838 | - echo "error : ".$e->getMessage(); |
|
839 | - } |
|
840 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
841 | - return $all; |
|
834 | + try { |
|
835 | + $sth = $this->db->prepare($query); |
|
836 | + $sth->execute($query_values); |
|
837 | + } catch(PDOException $e) { |
|
838 | + echo "error : ".$e->getMessage(); |
|
839 | + } |
|
840 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
841 | + return $all; |
|
842 | 842 | } |
843 | 843 | public function getStats($type,$stats_airline = '', $filter_name = '') { |
844 | 844 | if ($filter_name == '') $filter_name = $this->filter_name; |
845 | - $query = "SELECT * FROM stats WHERE stats_type = :type AND stats_airline = :stats_airline AND filter_name = :filter_name ORDER BY stats_date"; |
|
846 | - $query_values = array(':type' => $type,':stats_airline' => $stats_airline,':filter_name' => $filter_name); |
|
847 | - try { |
|
848 | - $sth = $this->db->prepare($query); |
|
849 | - $sth->execute($query_values); |
|
850 | - } catch(PDOException $e) { |
|
851 | - echo "error : ".$e->getMessage(); |
|
852 | - } |
|
853 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
854 | - return $all; |
|
855 | - } |
|
845 | + $query = "SELECT * FROM stats WHERE stats_type = :type AND stats_airline = :stats_airline AND filter_name = :filter_name ORDER BY stats_date"; |
|
846 | + $query_values = array(':type' => $type,':stats_airline' => $stats_airline,':filter_name' => $filter_name); |
|
847 | + try { |
|
848 | + $sth = $this->db->prepare($query); |
|
849 | + $sth->execute($query_values); |
|
850 | + } catch(PDOException $e) { |
|
851 | + echo "error : ".$e->getMessage(); |
|
852 | + } |
|
853 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
854 | + return $all; |
|
855 | + } |
|
856 | 856 | public function getSumStats($type,$year,$stats_airline = '',$filter_name = '',$month = '') { |
857 | 857 | if ($filter_name == '') $filter_name = $this->filter_name; |
858 | - global $globalArchiveMonths, $globalDBdriver; |
|
859 | - if ($globalDBdriver == 'mysql') { |
|
860 | - if ($month == '') { |
|
858 | + global $globalArchiveMonths, $globalDBdriver; |
|
859 | + if ($globalDBdriver == 'mysql') { |
|
860 | + if ($month == '') { |
|
861 | 861 | $query = "SELECT SUM(cnt) as total FROM stats WHERE stats_type = :type AND YEAR(stats_date) = :year AND stats_airline = :stats_airline AND filter_name = :filter_name"; |
862 | 862 | $query_values = array(':type' => $type, ':year' => $year, ':stats_airline' => $stats_airline,':filter_name' => $filter_name); |
863 | 863 | } else { |
@@ -872,137 +872,137 @@ discard block |
||
872 | 872 | $query = "SELECT SUM(cnt) as total FROM stats WHERE stats_type = :type AND EXTRACT(YEAR FROM stats_date) = :year AND EXTRACT(MONTH FROM stats_date) = :month AND stats_airline = :stats_airline AND filter_name = :filter_name"; |
873 | 873 | $query_values = array(':type' => $type, ':year' => $year, ':stats_airline' => $stats_airline,':filter_name' => $filter_name,':month' => $month); |
874 | 874 | } |
875 | - } |
|
876 | - try { |
|
877 | - $sth = $this->db->prepare($query); |
|
878 | - $sth->execute($query_values); |
|
879 | - } catch(PDOException $e) { |
|
880 | - echo "error : ".$e->getMessage(); |
|
881 | - } |
|
882 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
883 | - return $all[0]['total']; |
|
884 | - } |
|
875 | + } |
|
876 | + try { |
|
877 | + $sth = $this->db->prepare($query); |
|
878 | + $sth->execute($query_values); |
|
879 | + } catch(PDOException $e) { |
|
880 | + echo "error : ".$e->getMessage(); |
|
881 | + } |
|
882 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
883 | + return $all[0]['total']; |
|
884 | + } |
|
885 | 885 | public function getStatsTotal($type, $stats_airline = '', $filter_name = '') { |
886 | - global $globalArchiveMonths, $globalDBdriver; |
|
886 | + global $globalArchiveMonths, $globalDBdriver; |
|
887 | 887 | if ($filter_name == '') $filter_name = $this->filter_name; |
888 | - if ($globalDBdriver == 'mysql') { |
|
888 | + if ($globalDBdriver == 'mysql') { |
|
889 | 889 | $query = "SELECT SUM(cnt) as total FROM stats WHERE stats_type = :type AND stats_date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL ".$globalArchiveMonths." MONTH) AND stats_airline = :stats_airline AND filter_name = :filter_name"; |
890 | 890 | } else { |
891 | 891 | $query = "SELECT SUM(cnt) as total FROM stats WHERE stats_type = :type AND stats_date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$globalArchiveMonths." MONTHS' AND stats_airline = :stats_airline AND filter_name = :filter_name"; |
892 | - } |
|
893 | - $query_values = array(':type' => $type, ':stats_airline' => $stats_airline, ':filter_name' => $filter_name); |
|
894 | - try { |
|
895 | - $sth = $this->db->prepare($query); |
|
896 | - $sth->execute($query_values); |
|
897 | - } catch(PDOException $e) { |
|
898 | - echo "error : ".$e->getMessage(); |
|
899 | - } |
|
900 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
901 | - return $all[0]['total']; |
|
902 | - } |
|
892 | + } |
|
893 | + $query_values = array(':type' => $type, ':stats_airline' => $stats_airline, ':filter_name' => $filter_name); |
|
894 | + try { |
|
895 | + $sth = $this->db->prepare($query); |
|
896 | + $sth->execute($query_values); |
|
897 | + } catch(PDOException $e) { |
|
898 | + echo "error : ".$e->getMessage(); |
|
899 | + } |
|
900 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
901 | + return $all[0]['total']; |
|
902 | + } |
|
903 | 903 | public function getStatsAircraftTotal($stats_airline = '', $filter_name = '') { |
904 | - global $globalArchiveMonths, $globalDBdriver; |
|
904 | + global $globalArchiveMonths, $globalDBdriver; |
|
905 | 905 | if ($filter_name == '') $filter_name = $this->filter_name; |
906 | - if ($globalDBdriver == 'mysql') { |
|
906 | + if ($globalDBdriver == 'mysql') { |
|
907 | 907 | $query = "SELECT SUM(cnt) as total FROM stats_aircraft WHERE stats_airline = :stats_airline AND filter_name = :filter_name"; |
908 | - } else { |
|
908 | + } else { |
|
909 | 909 | $query = "SELECT SUM(cnt) as total FROM stats_aircraft WHERE stats_airline = :stats_airline AND filter_name = :filter_name"; |
910 | - } |
|
911 | - try { |
|
912 | - $sth = $this->db->prepare($query); |
|
913 | - $sth->execute(array(':stats_airline' => $stats_airline, ':filter_name' => $filter_name)); |
|
914 | - } catch(PDOException $e) { |
|
915 | - echo "error : ".$e->getMessage(); |
|
916 | - } |
|
917 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
918 | - return $all[0]['total']; |
|
919 | - } |
|
910 | + } |
|
911 | + try { |
|
912 | + $sth = $this->db->prepare($query); |
|
913 | + $sth->execute(array(':stats_airline' => $stats_airline, ':filter_name' => $filter_name)); |
|
914 | + } catch(PDOException $e) { |
|
915 | + echo "error : ".$e->getMessage(); |
|
916 | + } |
|
917 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
918 | + return $all[0]['total']; |
|
919 | + } |
|
920 | 920 | public function getStatsAirlineTotal($filter_name = '') { |
921 | - global $globalArchiveMonths, $globalDBdriver; |
|
921 | + global $globalArchiveMonths, $globalDBdriver; |
|
922 | 922 | if ($filter_name == '') $filter_name = $this->filter_name; |
923 | - if ($globalDBdriver == 'mysql') { |
|
923 | + if ($globalDBdriver == 'mysql') { |
|
924 | 924 | $query = "SELECT SUM(cnt) as total FROM stats_airline WHERE filter_name = :filter_name"; |
925 | - } else { |
|
925 | + } else { |
|
926 | 926 | $query = "SELECT SUM(cnt) as total FROM stats_airline WHERE filter_name = :filter_name"; |
927 | - } |
|
928 | - try { |
|
929 | - $sth = $this->db->prepare($query); |
|
930 | - $sth->execute(array(':filter_name' => $filter_name)); |
|
931 | - } catch(PDOException $e) { |
|
932 | - echo "error : ".$e->getMessage(); |
|
933 | - } |
|
934 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
935 | - return $all[0]['total']; |
|
936 | - } |
|
927 | + } |
|
928 | + try { |
|
929 | + $sth = $this->db->prepare($query); |
|
930 | + $sth->execute(array(':filter_name' => $filter_name)); |
|
931 | + } catch(PDOException $e) { |
|
932 | + echo "error : ".$e->getMessage(); |
|
933 | + } |
|
934 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
935 | + return $all[0]['total']; |
|
936 | + } |
|
937 | 937 | public function getStatsOwnerTotal($filter_name = '') { |
938 | - global $globalArchiveMonths, $globalDBdriver; |
|
938 | + global $globalArchiveMonths, $globalDBdriver; |
|
939 | 939 | if ($filter_name == '') $filter_name = $this->filter_name; |
940 | - if ($globalDBdriver == 'mysql') { |
|
940 | + if ($globalDBdriver == 'mysql') { |
|
941 | 941 | $query = "SELECT SUM(cnt) as total FROM stats_owner WHERE filter_name = :filter_name"; |
942 | 942 | } else { |
943 | 943 | $query = "SELECT SUM(cnt) as total FROM stats_owner WHERE filter_name = :filter_name"; |
944 | - } |
|
945 | - try { |
|
946 | - $sth = $this->db->prepare($query); |
|
947 | - $sth->execute(array(':filter_name' => $filter_name)); |
|
948 | - } catch(PDOException $e) { |
|
949 | - echo "error : ".$e->getMessage(); |
|
950 | - } |
|
951 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
952 | - return $all[0]['total']; |
|
953 | - } |
|
944 | + } |
|
945 | + try { |
|
946 | + $sth = $this->db->prepare($query); |
|
947 | + $sth->execute(array(':filter_name' => $filter_name)); |
|
948 | + } catch(PDOException $e) { |
|
949 | + echo "error : ".$e->getMessage(); |
|
950 | + } |
|
951 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
952 | + return $all[0]['total']; |
|
953 | + } |
|
954 | 954 | public function getStatsPilotTotal($filter_name = '') { |
955 | - global $globalArchiveMonths, $globalDBdriver; |
|
955 | + global $globalArchiveMonths, $globalDBdriver; |
|
956 | 956 | if ($filter_name == '') $filter_name = $this->filter_name; |
957 | - if ($globalDBdriver == 'mysql') { |
|
958 | - $query = "SELECT SUM(cnt) as total FROM stats_pilot WHERE filter_name = :filter_name"; |
|
959 | - } else { |
|
960 | - $query = "SELECT SUM(cnt) as total FROM stats_pilot WHERE filter_name = :filter_name"; |
|
961 | - } |
|
962 | - try { |
|
963 | - $sth = $this->db->prepare($query); |
|
964 | - $sth->execute(array(':filter_name' => $filter_name)); |
|
965 | - } catch(PDOException $e) { |
|
966 | - echo "error : ".$e->getMessage(); |
|
967 | - } |
|
968 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
969 | - return $all[0]['total']; |
|
970 | - } |
|
957 | + if ($globalDBdriver == 'mysql') { |
|
958 | + $query = "SELECT SUM(cnt) as total FROM stats_pilot WHERE filter_name = :filter_name"; |
|
959 | + } else { |
|
960 | + $query = "SELECT SUM(cnt) as total FROM stats_pilot WHERE filter_name = :filter_name"; |
|
961 | + } |
|
962 | + try { |
|
963 | + $sth = $this->db->prepare($query); |
|
964 | + $sth->execute(array(':filter_name' => $filter_name)); |
|
965 | + } catch(PDOException $e) { |
|
966 | + echo "error : ".$e->getMessage(); |
|
967 | + } |
|
968 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
969 | + return $all[0]['total']; |
|
970 | + } |
|
971 | 971 | |
972 | 972 | public function addStat($type,$cnt,$stats_date,$stats_airline = '',$filter_name = '') { |
973 | 973 | global $globalDBdriver; |
974 | 974 | if ($filter_name == '') $filter_name = $this->filter_name; |
975 | 975 | if ($globalDBdriver == 'mysql') { |
976 | 976 | $query = "INSERT INTO stats (stats_type,cnt,stats_date,stats_airline,filter_name) VALUES (:type,:cnt,:stats_date,:stats_airline,:filter_name) ON DUPLICATE KEY UPDATE cnt = :cnt"; |
977 | - } else { |
|
977 | + } else { |
|
978 | 978 | $query = "UPDATE stats SET cnt = :cnt WHERE stats_type = :type AND stats_date = :stats_date AND stats_airline = :stats_airline AND filter_name = :filter_name; INSERT INTO stats (stats_type,cnt,stats_date,stats_airline,filter_name) SELECT :type,:cnt,:stats_date,:stats_airline,:filter_name WHERE NOT EXISTS (SELECT 1 FROM stats WHERE stats_type = :type AND stats_date = :stats_date AND stats_airline = :stats_airline AND filter_name = :filter_name);"; |
979 | 979 | } |
980 | - $query_values = array(':type' => $type,':cnt' => $cnt,':stats_date' => $stats_date, ':stats_airline' => $stats_airline,':filter_name' => $filter_name); |
|
981 | - try { |
|
982 | - $sth = $this->db->prepare($query); |
|
983 | - $sth->execute($query_values); |
|
984 | - } catch(PDOException $e) { |
|
985 | - return "error : ".$e->getMessage(); |
|
986 | - } |
|
987 | - } |
|
980 | + $query_values = array(':type' => $type,':cnt' => $cnt,':stats_date' => $stats_date, ':stats_airline' => $stats_airline,':filter_name' => $filter_name); |
|
981 | + try { |
|
982 | + $sth = $this->db->prepare($query); |
|
983 | + $sth->execute($query_values); |
|
984 | + } catch(PDOException $e) { |
|
985 | + return "error : ".$e->getMessage(); |
|
986 | + } |
|
987 | + } |
|
988 | 988 | public function updateStat($type,$cnt,$stats_date,$stats_airline = '',$filter_name = '') { |
989 | 989 | global $globalDBdriver; |
990 | 990 | if ($filter_name == '') $filter_name = $this->filter_name; |
991 | 991 | if ($globalDBdriver == 'mysql') { |
992 | 992 | $query = "INSERT INTO stats (stats_type,cnt,stats_date,stats_airline,filter_name) VALUES (:type,:cnt,:stats_date,:stats_airline,:filter_name) ON DUPLICATE KEY UPDATE cnt = cnt+:cnt, stats_date = :date"; |
993 | 993 | } else { |
994 | - //$query = "INSERT INTO stats (stats_type,cnt,stats_date) VALUES (:type,:cnt,:stats_date) ON DUPLICATE KEY UPDATE cnt = cnt+:cnt, stats_date = :date"; |
|
994 | + //$query = "INSERT INTO stats (stats_type,cnt,stats_date) VALUES (:type,:cnt,:stats_date) ON DUPLICATE KEY UPDATE cnt = cnt+:cnt, stats_date = :date"; |
|
995 | 995 | $query = "UPDATE stats SET cnt = cnt+:cnt WHERE stats_type = :type AND stats_date = :stats_date AND stats_airline = :stats_airline AND filter_name = :filter_name; INSERT INTO stats (stats_type,cnt,stats_date,stats_airline,filter_name) SELECT :type,:cnt,:stats_date,:stats_airline,:filter_name WHERE NOT EXISTS (SELECT 1 FROM stats WHERE stats_type = :type AND stats_date = :stats_date AND stats_airline = :stats_airline AND filter_name = :filter_name);"; |
996 | - } |
|
997 | - $query_values = array(':type' => $type,':cnt' => $cnt,':stats_date' => $stats_date,':stats_airline' => $stats_airline,':filter_name' => $filter_name); |
|
998 | - try { |
|
999 | - $sth = $this->db->prepare($query); |
|
1000 | - $sth->execute($query_values); |
|
1001 | - } catch(PDOException $e) { |
|
1002 | - return "error : ".$e->getMessage(); |
|
1003 | - } |
|
1004 | - } |
|
1005 | - /* |
|
996 | + } |
|
997 | + $query_values = array(':type' => $type,':cnt' => $cnt,':stats_date' => $stats_date,':stats_airline' => $stats_airline,':filter_name' => $filter_name); |
|
998 | + try { |
|
999 | + $sth = $this->db->prepare($query); |
|
1000 | + $sth->execute($query_values); |
|
1001 | + } catch(PDOException $e) { |
|
1002 | + return "error : ".$e->getMessage(); |
|
1003 | + } |
|
1004 | + } |
|
1005 | + /* |
|
1006 | 1006 | public function getStatsSource($date,$stats_type = '') { |
1007 | 1007 | if ($stats_type == '') { |
1008 | 1008 | $query = "SELECT * FROM stats_source WHERE stats_date = :date ORDER BY source_name"; |
@@ -1071,25 +1071,25 @@ discard block |
||
1071 | 1071 | $query = "INSERT INTO stats_source (source_data,source_name,stats_type,stats_date) VALUES (:data,:source_name,:stats_type,:stats_date) ON DUPLICATE KEY UPDATE source_data = :data"; |
1072 | 1072 | } else { |
1073 | 1073 | $query = "UPDATE stats_source SET source_data = :data WHERE stats_date = :stats_date AND source_name = :source_name AND stats_type = :stats_type; INSERT INTO stats_source (source_data,source_name,stats_type,stats_date) SELECT :data,:source_name,:stats_type,:stats_date WHERE NOT EXISTS (SELECT 1 FROM stats_source WHERE stats_date = :stats_date AND source_name = :source_name AND stats_type = :stats_type);"; |
1074 | - } |
|
1075 | - $query_values = array(':data' => $data,':stats_date' => $date,':source_name' => $source_name,':stats_type' => $stats_type); |
|
1076 | - try { |
|
1077 | - $sth = $this->db->prepare($query); |
|
1078 | - $sth->execute($query_values); |
|
1079 | - } catch(PDOException $e) { |
|
1080 | - return "error : ".$e->getMessage(); |
|
1081 | - } |
|
1082 | - } |
|
1083 | - public function addStatFlight($type,$date_name,$cnt,$stats_airline = '',$filter_name = '') { |
|
1084 | - $query = "INSERT INTO stats_flight (stats_type,flight_date,cnt,stats_airline,filter_name) VALUES (:type,:flight_date,:cnt,:stats_airline,:filter_name)"; |
|
1085 | - $query_values = array(':type' => $type,':flight_date' => $date_name,':cnt' => $cnt, ':stats_airline' => $stats_airline,':filter_name' => $filter_name); |
|
1086 | - try { |
|
1087 | - $sth = $this->db->prepare($query); |
|
1088 | - $sth->execute($query_values); |
|
1089 | - } catch(PDOException $e) { |
|
1090 | - return "error : ".$e->getMessage(); |
|
1091 | - } |
|
1092 | - } |
|
1074 | + } |
|
1075 | + $query_values = array(':data' => $data,':stats_date' => $date,':source_name' => $source_name,':stats_type' => $stats_type); |
|
1076 | + try { |
|
1077 | + $sth = $this->db->prepare($query); |
|
1078 | + $sth->execute($query_values); |
|
1079 | + } catch(PDOException $e) { |
|
1080 | + return "error : ".$e->getMessage(); |
|
1081 | + } |
|
1082 | + } |
|
1083 | + public function addStatFlight($type,$date_name,$cnt,$stats_airline = '',$filter_name = '') { |
|
1084 | + $query = "INSERT INTO stats_flight (stats_type,flight_date,cnt,stats_airline,filter_name) VALUES (:type,:flight_date,:cnt,:stats_airline,:filter_name)"; |
|
1085 | + $query_values = array(':type' => $type,':flight_date' => $date_name,':cnt' => $cnt, ':stats_airline' => $stats_airline,':filter_name' => $filter_name); |
|
1086 | + try { |
|
1087 | + $sth = $this->db->prepare($query); |
|
1088 | + $sth->execute($query_values); |
|
1089 | + } catch(PDOException $e) { |
|
1090 | + return "error : ".$e->getMessage(); |
|
1091 | + } |
|
1092 | + } |
|
1093 | 1093 | public function addStatAircraftRegistration($registration,$cnt,$aircraft_icao = '',$airline_icao = '',$filter_name = '',$reset = false) { |
1094 | 1094 | global $globalDBdriver; |
1095 | 1095 | if ($globalDBdriver == 'mysql') { |
@@ -1105,14 +1105,14 @@ discard block |
||
1105 | 1105 | $query = "UPDATE stats_registration SET cnt = cnt+:cnt WHERE registration = :registration AND stats_airline = :stats_airline AND filter_name = :filter_name; INSERT INTO stats_registration (aircraft_icao,registration,cnt,stats_airline,filter_name) SELECT :aircraft_icao,:registration,:cnt,:stats_airline,:filter_name WHERE NOT EXISTS (SELECT 1 FROM stats_registration WHERE registration = :registration AND stats_airline = :stats_airline AND filter_name = :filter_name);"; |
1106 | 1106 | } |
1107 | 1107 | } |
1108 | - $query_values = array(':aircraft_icao' => $aircraft_icao,':registration' => $registration,':cnt' => $cnt,':stats_airline' => $airline_icao, ':filter_name' => $filter_name); |
|
1109 | - try { |
|
1110 | - $sth = $this->db->prepare($query); |
|
1111 | - $sth->execute($query_values); |
|
1112 | - } catch(PDOException $e) { |
|
1113 | - return "error : ".$e->getMessage(); |
|
1114 | - } |
|
1115 | - } |
|
1108 | + $query_values = array(':aircraft_icao' => $aircraft_icao,':registration' => $registration,':cnt' => $cnt,':stats_airline' => $airline_icao, ':filter_name' => $filter_name); |
|
1109 | + try { |
|
1110 | + $sth = $this->db->prepare($query); |
|
1111 | + $sth->execute($query_values); |
|
1112 | + } catch(PDOException $e) { |
|
1113 | + return "error : ".$e->getMessage(); |
|
1114 | + } |
|
1115 | + } |
|
1116 | 1116 | public function addStatCallsign($callsign_icao,$cnt,$airline_icao = '', $filter_name = '', $reset = false) { |
1117 | 1117 | global $globalDBdriver; |
1118 | 1118 | if ($globalDBdriver == 'mysql') { |
@@ -1128,14 +1128,14 @@ discard block |
||
1128 | 1128 | $query = "UPDATE stats_callsign SET cnt = cnt+:cnt WHERE callsign_icao = :callsign_icao AND filter_name = :filter_name; INSERT INTO stats_callsign (callsign_icao,airline_icao,cnt,filter_name) SELECT :callsign_icao,:airline_icao,:cnt,:filter_name WHERE NOT EXISTS (SELECT 1 FROM stats_callsign WHERE callsign_icao = :callsign_icao AND filter_name = :filter_name);"; |
1129 | 1129 | } |
1130 | 1130 | } |
1131 | - $query_values = array(':callsign_icao' => $callsign_icao,':airline_icao' => $airline_icao,':cnt' => $cnt, ':filter_name' => $filter_name); |
|
1132 | - try { |
|
1133 | - $sth = $this->db->prepare($query); |
|
1134 | - $sth->execute($query_values); |
|
1135 | - } catch(PDOException $e) { |
|
1136 | - return "error : ".$e->getMessage(); |
|
1137 | - } |
|
1138 | - } |
|
1131 | + $query_values = array(':callsign_icao' => $callsign_icao,':airline_icao' => $airline_icao,':cnt' => $cnt, ':filter_name' => $filter_name); |
|
1132 | + try { |
|
1133 | + $sth = $this->db->prepare($query); |
|
1134 | + $sth->execute($query_values); |
|
1135 | + } catch(PDOException $e) { |
|
1136 | + return "error : ".$e->getMessage(); |
|
1137 | + } |
|
1138 | + } |
|
1139 | 1139 | public function addStatCountry($iso2,$iso3,$name,$cnt,$filter_name = '',$reset = false) { |
1140 | 1140 | global $globalDBdriver; |
1141 | 1141 | if ($globalDBdriver == 'mysql') { |
@@ -1151,14 +1151,14 @@ discard block |
||
1151 | 1151 | $query = "UPDATE stats_country SET cnt = cnt+:cnt WHERE iso2 = :iso2 AND filter_name = :filter_name; INSERT INTO stats_country (iso2,iso3,name,cnt,filter_name) SELECT :iso2,:iso3,:name,:cnt,:filter_name WHERE NOT EXISTS (SELECT 1 FROM stats_country WHERE iso2 = :iso2 AND filter_name = :filter_name);"; |
1152 | 1152 | } |
1153 | 1153 | } |
1154 | - $query_values = array(':iso2' => $iso2,':iso3' => $iso3,':name' => $name,':cnt' => $cnt,':filter_name' => $filter_name); |
|
1155 | - try { |
|
1156 | - $sth = $this->db->prepare($query); |
|
1157 | - $sth->execute($query_values); |
|
1158 | - } catch(PDOException $e) { |
|
1159 | - return "error : ".$e->getMessage(); |
|
1160 | - } |
|
1161 | - } |
|
1154 | + $query_values = array(':iso2' => $iso2,':iso3' => $iso3,':name' => $name,':cnt' => $cnt,':filter_name' => $filter_name); |
|
1155 | + try { |
|
1156 | + $sth = $this->db->prepare($query); |
|
1157 | + $sth->execute($query_values); |
|
1158 | + } catch(PDOException $e) { |
|
1159 | + return "error : ".$e->getMessage(); |
|
1160 | + } |
|
1161 | + } |
|
1162 | 1162 | public function addStatAircraft($aircraft_icao,$cnt,$aircraft_name = '',$aircraft_manufacturer = '', $airline_icao = '', $filter_name = '', $reset = false) { |
1163 | 1163 | global $globalDBdriver; |
1164 | 1164 | if ($globalDBdriver == 'mysql') { |
@@ -1174,14 +1174,14 @@ discard block |
||
1174 | 1174 | $query = "UPDATE stats_aircraft SET cnt = cnt+:cnt, aircraft_name = :aircraft_name, aircraft_manufacturer = :aircraft_manufacturer, filter_name = :filter_name WHERE aircraft_icao = :aircraft_icao AND stats_airline = :stats_airline AND filter_name = :filter_name; INSERT INTO stats_aircraft (aircraft_icao,aircraft_name,aircraft_manufacturer,cnt,stats_airline,filter_name) SELECT :aircraft_icao,:aircraft_name,:aircraft_manufacturer,:cnt,:stats_airline,:filter_name WHERE NOT EXISTS (SELECT 1 FROM stats_aircraft WHERE aircraft_icao = :aircraft_icao AND stats_airline = :stats_airline AND filter_name = :filter_name);"; |
1175 | 1175 | } |
1176 | 1176 | } |
1177 | - $query_values = array(':aircraft_icao' => $aircraft_icao,':aircraft_name' => $aircraft_name,':cnt' => $cnt, ':aircraft_manufacturer' => $aircraft_manufacturer,':stats_airline' => $airline_icao, ':filter_name' => $filter_name); |
|
1178 | - try { |
|
1179 | - $sth = $this->db->prepare($query); |
|
1180 | - $sth->execute($query_values); |
|
1181 | - } catch(PDOException $e) { |
|
1182 | - return "error : ".$e->getMessage(); |
|
1183 | - } |
|
1184 | - } |
|
1177 | + $query_values = array(':aircraft_icao' => $aircraft_icao,':aircraft_name' => $aircraft_name,':cnt' => $cnt, ':aircraft_manufacturer' => $aircraft_manufacturer,':stats_airline' => $airline_icao, ':filter_name' => $filter_name); |
|
1178 | + try { |
|
1179 | + $sth = $this->db->prepare($query); |
|
1180 | + $sth->execute($query_values); |
|
1181 | + } catch(PDOException $e) { |
|
1182 | + return "error : ".$e->getMessage(); |
|
1183 | + } |
|
1184 | + } |
|
1185 | 1185 | public function addStatAirline($airline_icao,$cnt,$airline_name = '',$filter_name = '', $reset = false) { |
1186 | 1186 | global $globalDBdriver; |
1187 | 1187 | if ($globalDBdriver == 'mysql') { |
@@ -1197,14 +1197,14 @@ discard block |
||
1197 | 1197 | $query = "UPDATE stats_airline SET cnt = cnt+:cnt WHERE airline_icao = :airline_icao AND filter_name = :filter_name; INSERT INTO stats_airline (airline_icao,airline_name,cnt,filter_name) SELECT :airline_icao,:airline_name,:cnt,:filter_name WHERE NOT EXISTS (SELECT 1 FROM stats_airline WHERE airline_icao = :airline_icao AND filter_name = :filter_name);"; |
1198 | 1198 | } |
1199 | 1199 | } |
1200 | - $query_values = array(':airline_icao' => $airline_icao,':airline_name' => $airline_name,':cnt' => $cnt,':filter_name' => $filter_name); |
|
1201 | - try { |
|
1202 | - $sth = $this->db->prepare($query); |
|
1203 | - $sth->execute($query_values); |
|
1204 | - } catch(PDOException $e) { |
|
1205 | - return "error : ".$e->getMessage(); |
|
1206 | - } |
|
1207 | - } |
|
1200 | + $query_values = array(':airline_icao' => $airline_icao,':airline_name' => $airline_name,':cnt' => $cnt,':filter_name' => $filter_name); |
|
1201 | + try { |
|
1202 | + $sth = $this->db->prepare($query); |
|
1203 | + $sth->execute($query_values); |
|
1204 | + } catch(PDOException $e) { |
|
1205 | + return "error : ".$e->getMessage(); |
|
1206 | + } |
|
1207 | + } |
|
1208 | 1208 | public function addStatOwner($owner_name,$cnt,$stats_airline = '', $filter_name = '', $reset = false) { |
1209 | 1209 | global $globalDBdriver; |
1210 | 1210 | if ($globalDBdriver == 'mysql') { |
@@ -1220,14 +1220,14 @@ discard block |
||
1220 | 1220 | $query = "UPDATE stats_owner SET cnt = cnt+:cnt WHERE owner_name = :owner_name AND stats_airline = :stats_airline AND filter_name = :filter_name; INSERT INTO stats_owner (owner_name,cnt,stats_airline,filter_name) SELECT :owner_name,:cnt,:stats_airline,:filter_name WHERE NOT EXISTS (SELECT 1 FROM stats_owner WHERE owner_name = :owner_name AND stats_airline = :stats_airline AND filter_name = :filter_name);"; |
1221 | 1221 | } |
1222 | 1222 | } |
1223 | - $query_values = array(':owner_name' => $owner_name,':cnt' => $cnt,':stats_airline' => $stats_airline,':filter_name' => $filter_name); |
|
1224 | - try { |
|
1225 | - $sth = $this->db->prepare($query); |
|
1226 | - $sth->execute($query_values); |
|
1227 | - } catch(PDOException $e) { |
|
1228 | - return "error : ".$e->getMessage(); |
|
1229 | - } |
|
1230 | - } |
|
1223 | + $query_values = array(':owner_name' => $owner_name,':cnt' => $cnt,':stats_airline' => $stats_airline,':filter_name' => $filter_name); |
|
1224 | + try { |
|
1225 | + $sth = $this->db->prepare($query); |
|
1226 | + $sth->execute($query_values); |
|
1227 | + } catch(PDOException $e) { |
|
1228 | + return "error : ".$e->getMessage(); |
|
1229 | + } |
|
1230 | + } |
|
1231 | 1231 | public function addStatPilot($pilot_id,$cnt,$pilot_name,$stats_airline = '',$filter_name = '',$format_source = '',$reset = false) { |
1232 | 1232 | global $globalDBdriver; |
1233 | 1233 | if ($globalDBdriver == 'mysql') { |
@@ -1243,14 +1243,14 @@ discard block |
||
1243 | 1243 | $query = "UPDATE stats_pilot SET cnt = cnt+:cnt, pilot_name = :pilot_name WHERE pilot_id = :pilot_id AND stats_airline = :stats_airline AND filter_name = :filter_name AND format_source = :format_source; INSERT INTO stats_pilot (pilot_id,cnt,pilot_name,stats_airline,filter_name,format_source) SELECT :pilot_id,:cnt,:pilot_name,:stats_airline,:filter_name,:format_source WHERE NOT EXISTS (SELECT 1 FROM stats_pilot WHERE pilot_id = :pilot_id AND stats_airline = :stats_airline AND filter_name = :filter_name AND format_source = :format_source);"; |
1244 | 1244 | } |
1245 | 1245 | } |
1246 | - $query_values = array(':pilot_id' => $pilot_id,':cnt' => $cnt,':pilot_name' => $pilot_name,':stats_airline' => $stats_airline,':filter_name' => $filter_name,':format_source' => $format_source); |
|
1247 | - try { |
|
1248 | - $sth = $this->db->prepare($query); |
|
1249 | - $sth->execute($query_values); |
|
1250 | - } catch(PDOException $e) { |
|
1251 | - return "error : ".$e->getMessage(); |
|
1252 | - } |
|
1253 | - } |
|
1246 | + $query_values = array(':pilot_id' => $pilot_id,':cnt' => $cnt,':pilot_name' => $pilot_name,':stats_airline' => $stats_airline,':filter_name' => $filter_name,':format_source' => $format_source); |
|
1247 | + try { |
|
1248 | + $sth = $this->db->prepare($query); |
|
1249 | + $sth->execute($query_values); |
|
1250 | + } catch(PDOException $e) { |
|
1251 | + return "error : ".$e->getMessage(); |
|
1252 | + } |
|
1253 | + } |
|
1254 | 1254 | public function addStatDepartureAirports($airport_icao,$airport_name,$airport_city,$airport_country,$departure,$airline_icao = '',$filter_name = '',$reset = false) { |
1255 | 1255 | global $globalDBdriver; |
1256 | 1256 | if ($airport_icao != '') { |
@@ -1274,8 +1274,8 @@ discard block |
||
1274 | 1274 | } catch(PDOException $e) { |
1275 | 1275 | return "error : ".$e->getMessage(); |
1276 | 1276 | } |
1277 | - } |
|
1278 | - } |
|
1277 | + } |
|
1278 | + } |
|
1279 | 1279 | public function addStatDepartureAirportsDaily($date,$airport_icao,$airport_name,$airport_city,$airport_country,$departure,$airline_icao = '',$filter_name = '') { |
1280 | 1280 | global $globalDBdriver; |
1281 | 1281 | if ($airport_icao != '') { |
@@ -1291,8 +1291,8 @@ discard block |
||
1291 | 1291 | } catch(PDOException $e) { |
1292 | 1292 | return "error : ".$e->getMessage(); |
1293 | 1293 | } |
1294 | - } |
|
1295 | - } |
|
1294 | + } |
|
1295 | + } |
|
1296 | 1296 | public function addStatArrivalAirports($airport_icao,$airport_name,$airport_city,$airport_country,$arrival,$airline_icao = '',$filter_name = '',$reset = false) { |
1297 | 1297 | global $globalDBdriver; |
1298 | 1298 | if ($airport_icao != '') { |
@@ -1309,15 +1309,15 @@ discard block |
||
1309 | 1309 | $query = "UPDATE stats_airport SET arrival = arrival+:arrival WHERE airport_icao = :airport_icao AND stats_type = 'yearly' AND stats_airline = :stats_airline AND date = :date AND filter_name = :filter_name; INSERT INTO stats_airport (airport_icao,airport_name,airport_city,airport_country,arrival,stats_type,date,stats_airline,filter_name) SELECT :airport_icao,:airport_name,:airport_city,:airport_country,:arrival,'yearly',:date,:stats_airline,:filter_name WHERE NOT EXISTS (SELECT 1 FROM stats_airport WHERE airport_icao = :airport_icao AND stats_type = 'yearly' AND stats_airline = :stats_airline AND date = :date AND filter_name = :filter_name);"; |
1310 | 1310 | } |
1311 | 1311 | } |
1312 | - $query_values = array(':airport_icao' => $airport_icao,':airport_name' => $airport_name,':airport_city' => $airport_city,':airport_country' => $airport_country,':arrival' => $arrival,':date' => date('Y').'-01-01 00:00:00',':stats_airline' => $airline_icao,':filter_name' => $filter_name); |
|
1312 | + $query_values = array(':airport_icao' => $airport_icao,':airport_name' => $airport_name,':airport_city' => $airport_city,':airport_country' => $airport_country,':arrival' => $arrival,':date' => date('Y').'-01-01 00:00:00',':stats_airline' => $airline_icao,':filter_name' => $filter_name); |
|
1313 | 1313 | try { |
1314 | - $sth = $this->db->prepare($query); |
|
1315 | - $sth->execute($query_values); |
|
1316 | - } catch(PDOException $e) { |
|
1317 | - return "error : ".$e->getMessage(); |
|
1318 | - } |
|
1319 | - } |
|
1320 | - } |
|
1314 | + $sth = $this->db->prepare($query); |
|
1315 | + $sth->execute($query_values); |
|
1316 | + } catch(PDOException $e) { |
|
1317 | + return "error : ".$e->getMessage(); |
|
1318 | + } |
|
1319 | + } |
|
1320 | + } |
|
1321 | 1321 | public function addStatArrivalAirportsDaily($date,$airport_icao,$airport_name,$airport_city,$airport_country,$arrival,$airline_icao = '',$filter_name = '') { |
1322 | 1322 | global $globalDBdriver; |
1323 | 1323 | if ($airport_icao != '') { |
@@ -1333,46 +1333,46 @@ discard block |
||
1333 | 1333 | } catch(PDOException $e) { |
1334 | 1334 | return "error : ".$e->getMessage(); |
1335 | 1335 | } |
1336 | - } |
|
1337 | - } |
|
1336 | + } |
|
1337 | + } |
|
1338 | 1338 | |
1339 | 1339 | public function deleteStat($id) { |
1340 | - $query = "DELETE FROM stats WHERE stats_id = :id"; |
|
1341 | - $query_values = array(':id' => $id); |
|
1342 | - try { |
|
1343 | - $sth = $this->db->prepare($query); |
|
1344 | - $sth->execute($query_values); |
|
1345 | - } catch(PDOException $e) { |
|
1346 | - return "error : ".$e->getMessage(); |
|
1347 | - } |
|
1348 | - } |
|
1340 | + $query = "DELETE FROM stats WHERE stats_id = :id"; |
|
1341 | + $query_values = array(':id' => $id); |
|
1342 | + try { |
|
1343 | + $sth = $this->db->prepare($query); |
|
1344 | + $sth->execute($query_values); |
|
1345 | + } catch(PDOException $e) { |
|
1346 | + return "error : ".$e->getMessage(); |
|
1347 | + } |
|
1348 | + } |
|
1349 | 1349 | public function deleteStatFlight($type) { |
1350 | - $query = "DELETE FROM stats_flight WHERE stats_type = :type"; |
|
1351 | - $query_values = array(':type' => $type); |
|
1352 | - try { |
|
1353 | - $sth = $this->db->prepare($query); |
|
1354 | - $sth->execute($query_values); |
|
1355 | - } catch(PDOException $e) { |
|
1356 | - return "error : ".$e->getMessage(); |
|
1357 | - } |
|
1358 | - } |
|
1350 | + $query = "DELETE FROM stats_flight WHERE stats_type = :type"; |
|
1351 | + $query_values = array(':type' => $type); |
|
1352 | + try { |
|
1353 | + $sth = $this->db->prepare($query); |
|
1354 | + $sth->execute($query_values); |
|
1355 | + } catch(PDOException $e) { |
|
1356 | + return "error : ".$e->getMessage(); |
|
1357 | + } |
|
1358 | + } |
|
1359 | 1359 | public function deleteStatAirport($type) { |
1360 | - $query = "DELETE FROM stats_airport WHERE stats_type = :type"; |
|
1361 | - $query_values = array(':type' => $type); |
|
1362 | - try { |
|
1363 | - $sth = $this->db->prepare($query); |
|
1364 | - $sth->execute($query_values); |
|
1365 | - } catch(PDOException $e) { |
|
1366 | - return "error : ".$e->getMessage(); |
|
1367 | - } |
|
1368 | - } |
|
1360 | + $query = "DELETE FROM stats_airport WHERE stats_type = :type"; |
|
1361 | + $query_values = array(':type' => $type); |
|
1362 | + try { |
|
1363 | + $sth = $this->db->prepare($query); |
|
1364 | + $sth->execute($query_values); |
|
1365 | + } catch(PDOException $e) { |
|
1366 | + return "error : ".$e->getMessage(); |
|
1367 | + } |
|
1368 | + } |
|
1369 | 1369 | |
1370 | - public function addOldStats() { |
|
1371 | - global $globalDebug, $globalArchiveMonths, $globalArchive, $globalArchiveYear, $globalDBdriver, $globalStatsFilters,$globalDeleteLastYearStats,$globalStatsReset,$globalStatsResetYear; |
|
1372 | - $Common = new Common(); |
|
1373 | - $Connection = new Connection(); |
|
1374 | - date_default_timezone_set('UTC'); |
|
1375 | - $last_update = $this->getLastStatsUpdate('last_update_stats'); |
|
1370 | + public function addOldStats() { |
|
1371 | + global $globalDebug, $globalArchiveMonths, $globalArchive, $globalArchiveYear, $globalDBdriver, $globalStatsFilters,$globalDeleteLastYearStats,$globalStatsReset,$globalStatsResetYear; |
|
1372 | + $Common = new Common(); |
|
1373 | + $Connection = new Connection(); |
|
1374 | + date_default_timezone_set('UTC'); |
|
1375 | + $last_update = $this->getLastStatsUpdate('last_update_stats'); |
|
1376 | 1376 | if ($globalDebug) echo 'Update stats !'."\n"; |
1377 | 1377 | if (isset($last_update[0]['value'])) { |
1378 | 1378 | $last_update_day = $last_update[0]['value']; |
@@ -1418,24 +1418,24 @@ discard block |
||
1418 | 1418 | if ($globalDebug) echo 'Count all departure airports...'."\n"; |
1419 | 1419 | $pall = $Spotter->countAllDepartureAirports(false,0,$last_update_day); |
1420 | 1420 | if ($globalDebug) echo 'Count all detected departure airports...'."\n"; |
1421 | - $dall = $Spotter->countAllDetectedDepartureAirports(false,0,$last_update_day); |
|
1421 | + $dall = $Spotter->countAllDetectedDepartureAirports(false,0,$last_update_day); |
|
1422 | 1422 | if ($globalDebug) echo 'Order departure airports...'."\n"; |
1423 | - $alldata = array(); |
|
1423 | + $alldata = array(); |
|
1424 | 1424 | |
1425 | - foreach ($pall as $value) { |
|
1426 | - $icao = $value['airport_departure_icao']; |
|
1427 | - $alldata[$icao] = $value; |
|
1428 | - } |
|
1429 | - foreach ($dall as $value) { |
|
1430 | - $icao = $value['airport_departure_icao']; |
|
1431 | - if (isset($alldata[$icao])) { |
|
1432 | - $alldata[$icao]['airport_departure_icao_count'] = $alldata[$icao]['airport_departure_icao_count'] + $value['airport_departure_icao_count']; |
|
1433 | - } else $alldata[$icao] = $value; |
|
1434 | - } |
|
1435 | - $count = array(); |
|
1436 | - foreach ($alldata as $key => $row) { |
|
1437 | - $count[$key] = $row['airport_departure_icao_count']; |
|
1438 | - } |
|
1425 | + foreach ($pall as $value) { |
|
1426 | + $icao = $value['airport_departure_icao']; |
|
1427 | + $alldata[$icao] = $value; |
|
1428 | + } |
|
1429 | + foreach ($dall as $value) { |
|
1430 | + $icao = $value['airport_departure_icao']; |
|
1431 | + if (isset($alldata[$icao])) { |
|
1432 | + $alldata[$icao]['airport_departure_icao_count'] = $alldata[$icao]['airport_departure_icao_count'] + $value['airport_departure_icao_count']; |
|
1433 | + } else $alldata[$icao] = $value; |
|
1434 | + } |
|
1435 | + $count = array(); |
|
1436 | + foreach ($alldata as $key => $row) { |
|
1437 | + $count[$key] = $row['airport_departure_icao_count']; |
|
1438 | + } |
|
1439 | 1439 | array_multisort($count,SORT_DESC,$alldata); |
1440 | 1440 | foreach ($alldata as $number) { |
1441 | 1441 | echo $this->addStatDepartureAirports($number['airport_departure_icao'],$number['airport_departure_name'],$number['airport_departure_city'],$number['airport_departure_country'],$number['airport_departure_icao_count'],'','',$reset); |
@@ -1443,25 +1443,25 @@ discard block |
||
1443 | 1443 | if ($globalDebug) echo 'Count all arrival airports...'."\n"; |
1444 | 1444 | $pall = $Spotter->countAllArrivalAirports(false,0,$last_update_day); |
1445 | 1445 | if ($globalDebug) echo 'Count all detected arrival airports...'."\n"; |
1446 | - $dall = $Spotter->countAllDetectedArrivalAirports(false,0,$last_update_day); |
|
1446 | + $dall = $Spotter->countAllDetectedArrivalAirports(false,0,$last_update_day); |
|
1447 | 1447 | if ($globalDebug) echo 'Order arrival airports...'."\n"; |
1448 | - $alldata = array(); |
|
1449 | - foreach ($pall as $value) { |
|
1450 | - $icao = $value['airport_arrival_icao']; |
|
1451 | - $alldata[$icao] = $value; |
|
1452 | - } |
|
1453 | - foreach ($dall as $value) { |
|
1454 | - $icao = $value['airport_arrival_icao']; |
|
1455 | - if (isset($alldata[$icao])) { |
|
1456 | - $alldata[$icao]['airport_arrival_icao_count'] = $alldata[$icao]['airport_arrival_icao_count'] + $value['airport_arrival_icao_count']; |
|
1457 | - } else $alldata[$icao] = $value; |
|
1458 | - } |
|
1459 | - $count = array(); |
|
1460 | - foreach ($alldata as $key => $row) { |
|
1461 | - $count[$key] = $row['airport_arrival_icao_count']; |
|
1462 | - } |
|
1463 | - array_multisort($count,SORT_DESC,$alldata); |
|
1464 | - foreach ($alldata as $number) { |
|
1448 | + $alldata = array(); |
|
1449 | + foreach ($pall as $value) { |
|
1450 | + $icao = $value['airport_arrival_icao']; |
|
1451 | + $alldata[$icao] = $value; |
|
1452 | + } |
|
1453 | + foreach ($dall as $value) { |
|
1454 | + $icao = $value['airport_arrival_icao']; |
|
1455 | + if (isset($alldata[$icao])) { |
|
1456 | + $alldata[$icao]['airport_arrival_icao_count'] = $alldata[$icao]['airport_arrival_icao_count'] + $value['airport_arrival_icao_count']; |
|
1457 | + } else $alldata[$icao] = $value; |
|
1458 | + } |
|
1459 | + $count = array(); |
|
1460 | + foreach ($alldata as $key => $row) { |
|
1461 | + $count[$key] = $row['airport_arrival_icao_count']; |
|
1462 | + } |
|
1463 | + array_multisort($count,SORT_DESC,$alldata); |
|
1464 | + foreach ($alldata as $number) { |
|
1465 | 1465 | echo $this->addStatArrivalAirports($number['airport_arrival_icao'],$number['airport_arrival_name'],$number['airport_arrival_city'],$number['airport_arrival_country'],$number['airport_arrival_icao_count'],'','',$reset); |
1466 | 1466 | } |
1467 | 1467 | if ($Connection->tableExists('countries')) { |
@@ -1521,8 +1521,8 @@ discard block |
||
1521 | 1521 | // $pall = $Spotter->getLast7DaysAirportsDeparture(); |
1522 | 1522 | // $dall = $Spotter->getLast7DaysDetectedAirportsDeparture(); |
1523 | 1523 | $pall = $Spotter->getLast7DaysAirportsDeparture(); |
1524 | - $dall = $Spotter->getLast7DaysDetectedAirportsDeparture(); |
|
1525 | - /* |
|
1524 | + $dall = $Spotter->getLast7DaysDetectedAirportsDeparture(); |
|
1525 | + /* |
|
1526 | 1526 | $alldata = array(); |
1527 | 1527 | foreach ($pall as $value) { |
1528 | 1528 | $icao = $value['departure_airport_icao']; |
@@ -1541,29 +1541,29 @@ discard block |
||
1541 | 1541 | } |
1542 | 1542 | array_multisort($count,SORT_DESC,$alldata); |
1543 | 1543 | */ |
1544 | - foreach ($dall as $value) { |
|
1545 | - $icao = $value['departure_airport_icao']; |
|
1546 | - $ddate = $value['date']; |
|
1547 | - $find = false; |
|
1548 | - foreach ($pall as $pvalue) { |
|
1549 | - if ($pvalue['departure_airport_icao'] == $icao && $pvalue['date'] == $ddate) { |
|
1550 | - $pvalue['departure_airport_count'] = $pvalue['departure_airport_count'] + $value['departure_airport_count']; |
|
1551 | - $find = true; |
|
1552 | - break; |
|
1553 | - } |
|
1554 | - } |
|
1555 | - if ($find === false) { |
|
1556 | - $pall[] = $value; |
|
1557 | - } |
|
1558 | - } |
|
1559 | - $alldata = $pall; |
|
1544 | + foreach ($dall as $value) { |
|
1545 | + $icao = $value['departure_airport_icao']; |
|
1546 | + $ddate = $value['date']; |
|
1547 | + $find = false; |
|
1548 | + foreach ($pall as $pvalue) { |
|
1549 | + if ($pvalue['departure_airport_icao'] == $icao && $pvalue['date'] == $ddate) { |
|
1550 | + $pvalue['departure_airport_count'] = $pvalue['departure_airport_count'] + $value['departure_airport_count']; |
|
1551 | + $find = true; |
|
1552 | + break; |
|
1553 | + } |
|
1554 | + } |
|
1555 | + if ($find === false) { |
|
1556 | + $pall[] = $value; |
|
1557 | + } |
|
1558 | + } |
|
1559 | + $alldata = $pall; |
|
1560 | 1560 | foreach ($alldata as $number) { |
1561 | 1561 | $this->addStatDepartureAirportsDaily($number['date'],$number['departure_airport_icao'],$number['departure_airport_name'],$number['departure_airport_city'],$number['departure_airport_country'],$number['departure_airport_count']); |
1562 | 1562 | } |
1563 | 1563 | echo '...Arrival'."\n"; |
1564 | 1564 | $pall = $Spotter->getLast7DaysAirportsArrival(); |
1565 | - $dall = $Spotter->getLast7DaysDetectedAirportsArrival(); |
|
1566 | - /* |
|
1565 | + $dall = $Spotter->getLast7DaysDetectedAirportsArrival(); |
|
1566 | + /* |
|
1567 | 1567 | $alldata = array(); |
1568 | 1568 | foreach ($pall as $value) { |
1569 | 1569 | $icao = $value['arrival_airport_icao']; |
@@ -1583,22 +1583,22 @@ discard block |
||
1583 | 1583 | */ |
1584 | 1584 | |
1585 | 1585 | |
1586 | - foreach ($dall as $value) { |
|
1587 | - $icao = $value['arrival_airport_icao']; |
|
1588 | - $ddate = $value['date']; |
|
1589 | - $find = false; |
|
1590 | - foreach ($pall as $pvalue) { |
|
1591 | - if ($pvalue['arrival_airport_icao'] == $icao && $pvalue['date'] == $ddate) { |
|
1592 | - $pvalue['arrival_airport_count'] = $pvalue['arrival_airport_count'] + $value['arrival_airport_count']; |
|
1593 | - $find = true; |
|
1594 | - break; |
|
1595 | - } |
|
1596 | - } |
|
1597 | - if ($find === false) { |
|
1598 | - $pall[] = $value; |
|
1599 | - } |
|
1600 | - } |
|
1601 | - $alldata = $pall; |
|
1586 | + foreach ($dall as $value) { |
|
1587 | + $icao = $value['arrival_airport_icao']; |
|
1588 | + $ddate = $value['date']; |
|
1589 | + $find = false; |
|
1590 | + foreach ($pall as $pvalue) { |
|
1591 | + if ($pvalue['arrival_airport_icao'] == $icao && $pvalue['date'] == $ddate) { |
|
1592 | + $pvalue['arrival_airport_count'] = $pvalue['arrival_airport_count'] + $value['arrival_airport_count']; |
|
1593 | + $find = true; |
|
1594 | + break; |
|
1595 | + } |
|
1596 | + } |
|
1597 | + if ($find === false) { |
|
1598 | + $pall[] = $value; |
|
1599 | + } |
|
1600 | + } |
|
1601 | + $alldata = $pall; |
|
1602 | 1602 | foreach ($alldata as $number) { |
1603 | 1603 | $this->addStatArrivalAirportsDaily($number['date'],$number['arrival_airport_icao'],$number['arrival_airport_name'],$number['arrival_airport_city'],$number['arrival_airport_country'],$number['arrival_airport_count']); |
1604 | 1604 | } |
@@ -1665,51 +1665,51 @@ discard block |
||
1665 | 1665 | if ($globalDebug) echo 'Count all departure airports by airlines...'."\n"; |
1666 | 1666 | $pall = $Spotter->countAllDepartureAirportsByAirlines(false,0,$last_update_day); |
1667 | 1667 | if ($globalDebug) echo 'Count all detected departure airports by airlines...'."\n"; |
1668 | - $dall = $Spotter->countAllDetectedDepartureAirportsByAirlines(false,0,$last_update_day); |
|
1668 | + $dall = $Spotter->countAllDetectedDepartureAirportsByAirlines(false,0,$last_update_day); |
|
1669 | 1669 | if ($globalDebug) echo 'Order detected departure airports by airlines...'."\n"; |
1670 | - //$alldata = array(); |
|
1671 | - foreach ($dall as $value) { |
|
1672 | - $icao = $value['airport_departure_icao']; |
|
1673 | - $dicao = $value['airline_icao']; |
|
1674 | - $find = false; |
|
1675 | - foreach ($pall as $pvalue) { |
|
1676 | - if ($pvalue['airport_departure_icao'] == $icao && $pvalue['airline_icao'] = $dicao) { |
|
1677 | - $pvalue['airport_departure_icao_count'] = $pvalue['airport_departure_icao_count'] + $value['airport_departure_icao_count']; |
|
1678 | - $find = true; |
|
1679 | - break; |
|
1680 | - } |
|
1681 | - } |
|
1682 | - if ($find === false) { |
|
1683 | - $pall[] = $value; |
|
1684 | - } |
|
1685 | - } |
|
1686 | - $alldata = $pall; |
|
1670 | + //$alldata = array(); |
|
1671 | + foreach ($dall as $value) { |
|
1672 | + $icao = $value['airport_departure_icao']; |
|
1673 | + $dicao = $value['airline_icao']; |
|
1674 | + $find = false; |
|
1675 | + foreach ($pall as $pvalue) { |
|
1676 | + if ($pvalue['airport_departure_icao'] == $icao && $pvalue['airline_icao'] = $dicao) { |
|
1677 | + $pvalue['airport_departure_icao_count'] = $pvalue['airport_departure_icao_count'] + $value['airport_departure_icao_count']; |
|
1678 | + $find = true; |
|
1679 | + break; |
|
1680 | + } |
|
1681 | + } |
|
1682 | + if ($find === false) { |
|
1683 | + $pall[] = $value; |
|
1684 | + } |
|
1685 | + } |
|
1686 | + $alldata = $pall; |
|
1687 | 1687 | foreach ($alldata as $number) { |
1688 | 1688 | echo $this->addStatDepartureAirports($number['airport_departure_icao'],$number['airport_departure_name'],$number['airport_departure_city'],$number['airport_departure_country'],$number['airport_departure_icao_count'],$number['airline_icao'],'',$reset); |
1689 | 1689 | } |
1690 | 1690 | if ($globalDebug) echo 'Count all arrival airports by airlines...'."\n"; |
1691 | 1691 | $pall = $Spotter->countAllArrivalAirportsByAirlines(false,0,$last_update_day); |
1692 | 1692 | if ($globalDebug) echo 'Count all detected arrival airports by airlines...'."\n"; |
1693 | - $dall = $Spotter->countAllDetectedArrivalAirportsByAirlines(false,0,$last_update_day); |
|
1693 | + $dall = $Spotter->countAllDetectedArrivalAirportsByAirlines(false,0,$last_update_day); |
|
1694 | 1694 | if ($globalDebug) echo 'Order arrival airports by airlines...'."\n"; |
1695 | - //$alldata = array(); |
|
1696 | - foreach ($dall as $value) { |
|
1697 | - $icao = $value['airport_arrival_icao']; |
|
1698 | - $dicao = $value['airline_icao']; |
|
1699 | - $find = false; |
|
1700 | - foreach ($pall as $pvalue) { |
|
1701 | - if ($pvalue['airport_arrival_icao'] == $icao && $pvalue['airline_icao'] = $dicao) { |
|
1702 | - $pvalue['airport_arrival_icao_count'] = $pvalue['airport_arrival_icao_count'] + $value['airport_arrival_icao_count']; |
|
1703 | - $find = true; |
|
1704 | - break; |
|
1705 | - } |
|
1706 | - } |
|
1707 | - if ($find === false) { |
|
1708 | - $pall[] = $value; |
|
1709 | - } |
|
1710 | - } |
|
1711 | - $alldata = $pall; |
|
1712 | - foreach ($alldata as $number) { |
|
1695 | + //$alldata = array(); |
|
1696 | + foreach ($dall as $value) { |
|
1697 | + $icao = $value['airport_arrival_icao']; |
|
1698 | + $dicao = $value['airline_icao']; |
|
1699 | + $find = false; |
|
1700 | + foreach ($pall as $pvalue) { |
|
1701 | + if ($pvalue['airport_arrival_icao'] == $icao && $pvalue['airline_icao'] = $dicao) { |
|
1702 | + $pvalue['airport_arrival_icao_count'] = $pvalue['airport_arrival_icao_count'] + $value['airport_arrival_icao_count']; |
|
1703 | + $find = true; |
|
1704 | + break; |
|
1705 | + } |
|
1706 | + } |
|
1707 | + if ($find === false) { |
|
1708 | + $pall[] = $value; |
|
1709 | + } |
|
1710 | + } |
|
1711 | + $alldata = $pall; |
|
1712 | + foreach ($alldata as $number) { |
|
1713 | 1713 | if ($number['airline_icao'] != '') echo $this->addStatArrivalAirports($number['airport_arrival_icao'],$number['airport_arrival_name'],$number['airport_arrival_city'],$number['airport_arrival_country'],$number['airport_arrival_icao_count'],$number['airline_icao'],'',$reset); |
1714 | 1714 | } |
1715 | 1715 | if ($globalDebug) echo 'Count all flights by months by airlines...'."\n"; |
@@ -1742,47 +1742,47 @@ discard block |
||
1742 | 1742 | } |
1743 | 1743 | if ($globalDebug) echo '...Departure'."\n"; |
1744 | 1744 | $pall = $Spotter->getLast7DaysAirportsDepartureByAirlines(); |
1745 | - $dall = $Spotter->getLast7DaysDetectedAirportsDepartureByAirlines(); |
|
1746 | - foreach ($dall as $value) { |
|
1747 | - $icao = $value['departure_airport_icao']; |
|
1748 | - $airline = $value['airline_icao']; |
|
1749 | - $ddate = $value['date']; |
|
1750 | - $find = false; |
|
1751 | - foreach ($pall as $pvalue) { |
|
1752 | - if ($pvalue['departure_airport_icao'] == $icao && $pvalue['date'] == $ddate && $pvalue['airline_icao'] = $airline) { |
|
1753 | - $pvalue['departure_airport_count'] = $pvalue['departure_airport_count'] + $value['departure_airport_count']; |
|
1754 | - $find = true; |
|
1755 | - break; |
|
1756 | - } |
|
1757 | - } |
|
1758 | - if ($find === false) { |
|
1759 | - $pall[] = $value; |
|
1760 | - } |
|
1761 | - } |
|
1762 | - $alldata = $pall; |
|
1745 | + $dall = $Spotter->getLast7DaysDetectedAirportsDepartureByAirlines(); |
|
1746 | + foreach ($dall as $value) { |
|
1747 | + $icao = $value['departure_airport_icao']; |
|
1748 | + $airline = $value['airline_icao']; |
|
1749 | + $ddate = $value['date']; |
|
1750 | + $find = false; |
|
1751 | + foreach ($pall as $pvalue) { |
|
1752 | + if ($pvalue['departure_airport_icao'] == $icao && $pvalue['date'] == $ddate && $pvalue['airline_icao'] = $airline) { |
|
1753 | + $pvalue['departure_airport_count'] = $pvalue['departure_airport_count'] + $value['departure_airport_count']; |
|
1754 | + $find = true; |
|
1755 | + break; |
|
1756 | + } |
|
1757 | + } |
|
1758 | + if ($find === false) { |
|
1759 | + $pall[] = $value; |
|
1760 | + } |
|
1761 | + } |
|
1762 | + $alldata = $pall; |
|
1763 | 1763 | foreach ($alldata as $number) { |
1764 | 1764 | $this->addStatDepartureAirportsDaily($number['date'],$number['departure_airport_icao'],$number['departure_airport_name'],$number['departure_airport_city'],$number['departure_airport_country'],$number['departure_airport_count'],$number['airline_icao']); |
1765 | 1765 | } |
1766 | 1766 | if ($globalDebug) echo '...Arrival'."\n"; |
1767 | 1767 | $pall = $Spotter->getLast7DaysAirportsArrivalByAirlines(); |
1768 | - $dall = $Spotter->getLast7DaysDetectedAirportsArrivalByAirlines(); |
|
1769 | - foreach ($dall as $value) { |
|
1770 | - $icao = $value['arrival_airport_icao']; |
|
1771 | - $airline = $value['airline_icao']; |
|
1772 | - $ddate = $value['date']; |
|
1773 | - $find = false; |
|
1774 | - foreach ($pall as $pvalue) { |
|
1775 | - if ($pvalue['arrival_airport_icao'] == $icao && $pvalue['date'] == $ddate && $pvalue['airline_icao'] == $airline) { |
|
1776 | - $pvalue['arrival_airport_count'] = $pvalue['arrival_airport_count'] + $value['arrival_airport_count']; |
|
1777 | - $find = true; |
|
1778 | - break; |
|
1779 | - } |
|
1780 | - } |
|
1781 | - if ($find === false) { |
|
1782 | - $pall[] = $value; |
|
1783 | - } |
|
1784 | - } |
|
1785 | - $alldata = $pall; |
|
1768 | + $dall = $Spotter->getLast7DaysDetectedAirportsArrivalByAirlines(); |
|
1769 | + foreach ($dall as $value) { |
|
1770 | + $icao = $value['arrival_airport_icao']; |
|
1771 | + $airline = $value['airline_icao']; |
|
1772 | + $ddate = $value['date']; |
|
1773 | + $find = false; |
|
1774 | + foreach ($pall as $pvalue) { |
|
1775 | + if ($pvalue['arrival_airport_icao'] == $icao && $pvalue['date'] == $ddate && $pvalue['airline_icao'] == $airline) { |
|
1776 | + $pvalue['arrival_airport_count'] = $pvalue['arrival_airport_count'] + $value['arrival_airport_count']; |
|
1777 | + $find = true; |
|
1778 | + break; |
|
1779 | + } |
|
1780 | + } |
|
1781 | + if ($find === false) { |
|
1782 | + $pall[] = $value; |
|
1783 | + } |
|
1784 | + } |
|
1785 | + $alldata = $pall; |
|
1786 | 1786 | foreach ($alldata as $number) { |
1787 | 1787 | $this->addStatArrivalAirportsDaily($number['date'],$number['arrival_airport_icao'],$number['arrival_airport_name'],$number['arrival_airport_city'],$number['arrival_airport_country'],$number['arrival_airport_count'],$number['airline_icao']); |
1788 | 1788 | } |
@@ -1853,44 +1853,44 @@ discard block |
||
1853 | 1853 | $this->addStatPilot($number['pilot_id'],$number['pilot_count'],$number['pilot_name'],'',$filter_name,$number['format_source'],$reset); |
1854 | 1854 | } |
1855 | 1855 | $pall = $Spotter->countAllDepartureAirports(false,0,$last_update_day,$filter); |
1856 | - $dall = $Spotter->countAllDetectedDepartureAirports(false,0,$last_update_day,$filter); |
|
1857 | - $alldata = array(); |
|
1858 | - foreach ($pall as $value) { |
|
1859 | - $icao = $value['airport_departure_icao']; |
|
1860 | - $alldata[$icao] = $value; |
|
1861 | - } |
|
1862 | - foreach ($dall as $value) { |
|
1863 | - $icao = $value['airport_departure_icao']; |
|
1864 | - if (isset($alldata[$icao])) { |
|
1865 | - $alldata[$icao]['airport_departure_icao_count'] = $alldata[$icao]['airport_departure_icao_count'] + $value['airport_departure_icao_count']; |
|
1866 | - } else $alldata[$icao] = $value; |
|
1867 | - } |
|
1868 | - $count = array(); |
|
1869 | - foreach ($alldata as $key => $row) { |
|
1870 | - $count[$key] = $row['airport_departure_icao_count']; |
|
1871 | - } |
|
1856 | + $dall = $Spotter->countAllDetectedDepartureAirports(false,0,$last_update_day,$filter); |
|
1857 | + $alldata = array(); |
|
1858 | + foreach ($pall as $value) { |
|
1859 | + $icao = $value['airport_departure_icao']; |
|
1860 | + $alldata[$icao] = $value; |
|
1861 | + } |
|
1862 | + foreach ($dall as $value) { |
|
1863 | + $icao = $value['airport_departure_icao']; |
|
1864 | + if (isset($alldata[$icao])) { |
|
1865 | + $alldata[$icao]['airport_departure_icao_count'] = $alldata[$icao]['airport_departure_icao_count'] + $value['airport_departure_icao_count']; |
|
1866 | + } else $alldata[$icao] = $value; |
|
1867 | + } |
|
1868 | + $count = array(); |
|
1869 | + foreach ($alldata as $key => $row) { |
|
1870 | + $count[$key] = $row['airport_departure_icao_count']; |
|
1871 | + } |
|
1872 | 1872 | array_multisort($count,SORT_DESC,$alldata); |
1873 | 1873 | foreach ($alldata as $number) { |
1874 | - echo $this->addStatDepartureAirports($number['airport_departure_icao'],$number['airport_departure_name'],$number['airport_departure_city'],$number['airport_departure_country'],$number['airport_departure_icao_count'],'',$filter_name,$reset); |
|
1874 | + echo $this->addStatDepartureAirports($number['airport_departure_icao'],$number['airport_departure_name'],$number['airport_departure_city'],$number['airport_departure_country'],$number['airport_departure_icao_count'],'',$filter_name,$reset); |
|
1875 | 1875 | } |
1876 | 1876 | $pall = $Spotter->countAllArrivalAirports(false,0,$last_update_day,false,$filter); |
1877 | - $dall = $Spotter->countAllDetectedArrivalAirports(false,0,$last_update_day,false,$filter); |
|
1877 | + $dall = $Spotter->countAllDetectedArrivalAirports(false,0,$last_update_day,false,$filter); |
|
1878 | 1878 | $alldata = array(); |
1879 | - foreach ($pall as $value) { |
|
1880 | - $icao = $value['airport_arrival_icao']; |
|
1881 | - $alldata[$icao] = $value; |
|
1882 | - } |
|
1883 | - foreach ($dall as $value) { |
|
1884 | - $icao = $value['airport_arrival_icao']; |
|
1885 | - if (isset($alldata[$icao])) { |
|
1886 | - $alldata[$icao]['airport_arrival_icao_count'] = $alldata[$icao]['airport_arrival_icao_count'] + $value['airport_arrival_icao_count']; |
|
1887 | - } else $alldata[$icao] = $value; |
|
1888 | - } |
|
1889 | - $count = array(); |
|
1890 | - foreach ($alldata as $key => $row) { |
|
1891 | - $count[$key] = $row['airport_arrival_icao_count']; |
|
1892 | - } |
|
1893 | - array_multisort($count,SORT_DESC,$alldata); |
|
1879 | + foreach ($pall as $value) { |
|
1880 | + $icao = $value['airport_arrival_icao']; |
|
1881 | + $alldata[$icao] = $value; |
|
1882 | + } |
|
1883 | + foreach ($dall as $value) { |
|
1884 | + $icao = $value['airport_arrival_icao']; |
|
1885 | + if (isset($alldata[$icao])) { |
|
1886 | + $alldata[$icao]['airport_arrival_icao_count'] = $alldata[$icao]['airport_arrival_icao_count'] + $value['airport_arrival_icao_count']; |
|
1887 | + } else $alldata[$icao] = $value; |
|
1888 | + } |
|
1889 | + $count = array(); |
|
1890 | + foreach ($alldata as $key => $row) { |
|
1891 | + $count[$key] = $row['airport_arrival_icao_count']; |
|
1892 | + } |
|
1893 | + array_multisort($count,SORT_DESC,$alldata); |
|
1894 | 1894 | foreach ($alldata as $number) { |
1895 | 1895 | echo $this->addStatArrivalAirports($number['airport_arrival_icao'],$number['airport_arrival_name'],$number['airport_arrival_city'],$number['airport_arrival_country'],$number['airport_arrival_icao_count'],'',$filter_name,$reset); |
1896 | 1896 | } |
@@ -1923,45 +1923,45 @@ discard block |
||
1923 | 1923 | } |
1924 | 1924 | echo '...Departure'."\n"; |
1925 | 1925 | $pall = $Spotter->getLast7DaysAirportsDeparture('',$filter); |
1926 | - $dall = $Spotter->getLast7DaysDetectedAirportsDeparture('',$filter); |
|
1926 | + $dall = $Spotter->getLast7DaysDetectedAirportsDeparture('',$filter); |
|
1927 | 1927 | foreach ($dall as $value) { |
1928 | - $icao = $value['departure_airport_icao']; |
|
1929 | - $ddate = $value['date']; |
|
1930 | - $find = false; |
|
1931 | - foreach ($pall as $pvalue) { |
|
1932 | - if ($pvalue['departure_airport_icao'] == $icao && $pvalue['date'] == $ddate) { |
|
1933 | - $pvalue['departure_airport_count'] = $pvalue['departure_airport_count'] + $value['departure_airport_count']; |
|
1934 | - $find = true; |
|
1935 | - break; |
|
1936 | - } |
|
1937 | - } |
|
1938 | - if ($find === false) { |
|
1939 | - $pall[] = $value; |
|
1940 | - } |
|
1941 | - } |
|
1942 | - $alldata = $pall; |
|
1928 | + $icao = $value['departure_airport_icao']; |
|
1929 | + $ddate = $value['date']; |
|
1930 | + $find = false; |
|
1931 | + foreach ($pall as $pvalue) { |
|
1932 | + if ($pvalue['departure_airport_icao'] == $icao && $pvalue['date'] == $ddate) { |
|
1933 | + $pvalue['departure_airport_count'] = $pvalue['departure_airport_count'] + $value['departure_airport_count']; |
|
1934 | + $find = true; |
|
1935 | + break; |
|
1936 | + } |
|
1937 | + } |
|
1938 | + if ($find === false) { |
|
1939 | + $pall[] = $value; |
|
1940 | + } |
|
1941 | + } |
|
1942 | + $alldata = $pall; |
|
1943 | 1943 | foreach ($alldata as $number) { |
1944 | 1944 | $this->addStatDepartureAirportsDaily($number['date'],$number['departure_airport_icao'],$number['departure_airport_name'],$number['departure_airport_city'],$number['departure_airport_country'],$number['departure_airport_count'],'',$filter_name); |
1945 | 1945 | } |
1946 | 1946 | echo '...Arrival'."\n"; |
1947 | 1947 | $pall = $Spotter->getLast7DaysAirportsArrival('',$filter); |
1948 | - $dall = $Spotter->getLast7DaysDetectedAirportsArrival('',$filter); |
|
1948 | + $dall = $Spotter->getLast7DaysDetectedAirportsArrival('',$filter); |
|
1949 | 1949 | foreach ($dall as $value) { |
1950 | 1950 | $icao = $value['arrival_airport_icao']; |
1951 | 1951 | $ddate = $value['date']; |
1952 | - $find = false; |
|
1952 | + $find = false; |
|
1953 | 1953 | foreach ($pall as $pvalue) { |
1954 | - if ($pvalue['arrival_airport_icao'] == $icao && $pvalue['date'] == $ddate) { |
|
1955 | - $pvalue['arrival_airport_count'] = $pvalue['arrival_airport_count'] + $value['arrival_airport_count']; |
|
1956 | - $find = true; |
|
1957 | - break; |
|
1958 | - } |
|
1959 | - } |
|
1960 | - if ($find === false) { |
|
1961 | - $pall[] = $value; |
|
1962 | - } |
|
1963 | - } |
|
1964 | - $alldata = $pall; |
|
1954 | + if ($pvalue['arrival_airport_icao'] == $icao && $pvalue['date'] == $ddate) { |
|
1955 | + $pvalue['arrival_airport_count'] = $pvalue['arrival_airport_count'] + $value['arrival_airport_count']; |
|
1956 | + $find = true; |
|
1957 | + break; |
|
1958 | + } |
|
1959 | + } |
|
1960 | + if ($find === false) { |
|
1961 | + $pall[] = $value; |
|
1962 | + } |
|
1963 | + } |
|
1964 | + $alldata = $pall; |
|
1965 | 1965 | foreach ($alldata as $number) { |
1966 | 1966 | $this->addStatArrivalAirportsDaily($number['date'],$number['arrival_airport_icao'],$number['arrival_airport_name'],$number['arrival_airport_city'],$number['arrival_airport_country'],$number['arrival_airport_count'],'',$filter_name); |
1967 | 1967 | } |
@@ -55,10 +55,10 @@ discard block |
||
55 | 55 | } |
56 | 56 | |
57 | 57 | /** |
58 | - * Get SQL query part for filter used |
|
59 | - * @param Array $filter the filter |
|
60 | - * @return Array the SQL part |
|
61 | - */ |
|
58 | + * Get SQL query part for filter used |
|
59 | + * @param Array $filter the filter |
|
60 | + * @return Array the SQL part |
|
61 | + */ |
|
62 | 62 | public function getFilter($filter = array(),$where = false,$and = false) { |
63 | 63 | global $globalFilter, $globalStatsFilters, $globalFilterName; |
64 | 64 | $filters = array(); |
@@ -129,14 +129,14 @@ discard block |
||
129 | 129 | } |
130 | 130 | |
131 | 131 | /** |
132 | - * Executes the SQL statements to get the spotter information |
|
133 | - * |
|
134 | - * @param String $query the SQL query |
|
135 | - * @param Array $params parameter of the query |
|
136 | - * @param String $limitQuery the limit query |
|
137 | - * @return Array the spotter information |
|
138 | - * |
|
139 | - */ |
|
132 | + * Executes the SQL statements to get the spotter information |
|
133 | + * |
|
134 | + * @param String $query the SQL query |
|
135 | + * @param Array $params parameter of the query |
|
136 | + * @param String $limitQuery the limit query |
|
137 | + * @return Array the spotter information |
|
138 | + * |
|
139 | + */ |
|
140 | 140 | public function getDataFromDB($query, $params = array(), $limitQuery = '',$schedules = false) |
141 | 141 | { |
142 | 142 | global $globalSquawkCountry, $globalIVAO, $globalVATSIM, $globalphpVMS, $globalAirlinesSource, $globalVAM; |
@@ -300,11 +300,11 @@ discard block |
||
300 | 300 | if ($aircraft_array[0]['aircraft_shadow'] != NULL) { |
301 | 301 | $temp_array['aircraft_shadow'] = $aircraft_array[0]['aircraft_shadow']; |
302 | 302 | } else $temp_array['aircraft_shadow'] = 'default.png'; |
303 | - } else { |
|
304 | - $temp_array['aircraft_shadow'] = 'default.png'; |
|
303 | + } else { |
|
304 | + $temp_array['aircraft_shadow'] = 'default.png'; |
|
305 | 305 | $temp_array['aircraft_name'] = 'N/A'; |
306 | 306 | $temp_array['aircraft_manufacturer'] = 'N/A'; |
307 | - } |
|
307 | + } |
|
308 | 308 | } |
309 | 309 | $fromsource = NULL; |
310 | 310 | if (isset($globalAirlinesSource) && $globalAirlinesSource != '') $fromsource = $globalAirlinesSource; |
@@ -500,11 +500,11 @@ discard block |
||
500 | 500 | |
501 | 501 | |
502 | 502 | /** |
503 | - * Gets all the spotter information |
|
504 | - * |
|
505 | - * @return Array the spotter information |
|
506 | - * |
|
507 | - */ |
|
503 | + * Gets all the spotter information |
|
504 | + * |
|
505 | + * @return Array the spotter information |
|
506 | + * |
|
507 | + */ |
|
508 | 508 | public function searchSpotterData($q = '', $registration = '', $aircraft_icao = '', $aircraft_manufacturer = '', $highlights = '', $airline_icao = '', $airline_country = '', $airline_type = '', $airport = '', $airport_country = '', $callsign = '', $departure_airport_route = '', $arrival_airport_route = '', $owner = '',$pilot_id = '',$pilot_name = '',$altitude = '', $date_posted = '', $limit = '', $sort = '', $includegeodata = '',$origLat = '',$origLon = '',$dist = '',$filters = array()) |
509 | 509 | { |
510 | 510 | global $globalTimezone, $globalDBdriver; |
@@ -851,11 +851,11 @@ discard block |
||
851 | 851 | |
852 | 852 | |
853 | 853 | /** |
854 | - * Gets all the spotter information based on the latest data entry |
|
855 | - * |
|
856 | - * @return Array the spotter information |
|
857 | - * |
|
858 | - */ |
|
854 | + * Gets all the spotter information based on the latest data entry |
|
855 | + * |
|
856 | + * @return Array the spotter information |
|
857 | + * |
|
858 | + */ |
|
859 | 859 | public function getLatestSpotterData($limit = '', $sort = '', $filter = array()) |
860 | 860 | { |
861 | 861 | global $global_query; |
@@ -894,12 +894,12 @@ discard block |
||
894 | 894 | } |
895 | 895 | |
896 | 896 | |
897 | - /** |
|
898 | - * Gets all the spotter information based on a user's latitude and longitude |
|
899 | - * |
|
900 | - * @return Array the spotter information |
|
901 | - * |
|
902 | - */ |
|
897 | + /** |
|
898 | + * Gets all the spotter information based on a user's latitude and longitude |
|
899 | + * |
|
900 | + * @return Array the spotter information |
|
901 | + * |
|
902 | + */ |
|
903 | 903 | public function getLatestSpotterForLayar($lat, $lng, $radius, $interval) |
904 | 904 | { |
905 | 905 | date_default_timezone_set('UTC'); |
@@ -927,7 +927,7 @@ discard block |
||
927 | 927 | return false; |
928 | 928 | } |
929 | 929 | } |
930 | - $additional_query = ''; |
|
930 | + $additional_query = ''; |
|
931 | 931 | if ($interval != "") |
932 | 932 | { |
933 | 933 | if (!is_string($interval)) |
@@ -967,12 +967,12 @@ discard block |
||
967 | 967 | } |
968 | 968 | |
969 | 969 | |
970 | - /** |
|
971 | - * Gets all the spotter information sorted by the newest aircraft type |
|
972 | - * |
|
973 | - * @return Array the spotter information |
|
974 | - * |
|
975 | - */ |
|
970 | + /** |
|
971 | + * Gets all the spotter information sorted by the newest aircraft type |
|
972 | + * |
|
973 | + * @return Array the spotter information |
|
974 | + * |
|
975 | + */ |
|
976 | 976 | public function getNewestSpotterDataSortedByAircraftType($limit = '', $sort = '',$filter = array()) |
977 | 977 | { |
978 | 978 | global $global_query; |
@@ -1013,11 +1013,11 @@ discard block |
||
1013 | 1013 | |
1014 | 1014 | |
1015 | 1015 | /** |
1016 | - * Gets all the spotter information sorted by the newest aircraft registration |
|
1017 | - * |
|
1018 | - * @return Array the spotter information |
|
1019 | - * |
|
1020 | - */ |
|
1016 | + * Gets all the spotter information sorted by the newest aircraft registration |
|
1017 | + * |
|
1018 | + * @return Array the spotter information |
|
1019 | + * |
|
1020 | + */ |
|
1021 | 1021 | public function getNewestSpotterDataSortedByAircraftRegistration($limit = '', $sort = '', $filter = array()) |
1022 | 1022 | { |
1023 | 1023 | global $global_query; |
@@ -1057,11 +1057,11 @@ discard block |
||
1057 | 1057 | |
1058 | 1058 | |
1059 | 1059 | /** |
1060 | - * Gets all the spotter information sorted by the newest airline |
|
1061 | - * |
|
1062 | - * @return Array the spotter information |
|
1063 | - * |
|
1064 | - */ |
|
1060 | + * Gets all the spotter information sorted by the newest airline |
|
1061 | + * |
|
1062 | + * @return Array the spotter information |
|
1063 | + * |
|
1064 | + */ |
|
1065 | 1065 | public function getNewestSpotterDataSortedByAirline($limit = '', $sort = '',$filter = array()) |
1066 | 1066 | { |
1067 | 1067 | global $global_query; |
@@ -1100,12 +1100,12 @@ discard block |
||
1100 | 1100 | } |
1101 | 1101 | |
1102 | 1102 | |
1103 | - /** |
|
1104 | - * Gets all the spotter information sorted by the newest departure airport |
|
1105 | - * |
|
1106 | - * @return Array the spotter information |
|
1107 | - * |
|
1108 | - */ |
|
1103 | + /** |
|
1104 | + * Gets all the spotter information sorted by the newest departure airport |
|
1105 | + * |
|
1106 | + * @return Array the spotter information |
|
1107 | + * |
|
1108 | + */ |
|
1109 | 1109 | public function getNewestSpotterDataSortedByDepartureAirport($limit = '', $sort = '', $filter = array()) |
1110 | 1110 | { |
1111 | 1111 | global $global_query; |
@@ -1147,11 +1147,11 @@ discard block |
||
1147 | 1147 | |
1148 | 1148 | |
1149 | 1149 | /** |
1150 | - * Gets all the spotter information sorted by the newest arrival airport |
|
1151 | - * |
|
1152 | - * @return Array the spotter information |
|
1153 | - * |
|
1154 | - */ |
|
1150 | + * Gets all the spotter information sorted by the newest arrival airport |
|
1151 | + * |
|
1152 | + * @return Array the spotter information |
|
1153 | + * |
|
1154 | + */ |
|
1155 | 1155 | public function getNewestSpotterDataSortedByArrivalAirport($limit = '', $sort = '', $filter = array()) |
1156 | 1156 | { |
1157 | 1157 | global $global_query; |
@@ -1190,11 +1190,11 @@ discard block |
||
1190 | 1190 | |
1191 | 1191 | |
1192 | 1192 | /** |
1193 | - * Gets all the spotter information based on the spotter id |
|
1194 | - * |
|
1195 | - * @return Array the spotter information |
|
1196 | - * |
|
1197 | - */ |
|
1193 | + * Gets all the spotter information based on the spotter id |
|
1194 | + * |
|
1195 | + * @return Array the spotter information |
|
1196 | + * |
|
1197 | + */ |
|
1198 | 1198 | public function getSpotterDataByID($id = '') |
1199 | 1199 | { |
1200 | 1200 | global $global_query; |
@@ -1216,11 +1216,11 @@ discard block |
||
1216 | 1216 | |
1217 | 1217 | |
1218 | 1218 | /** |
1219 | - * Gets all the spotter information based on the callsign |
|
1220 | - * |
|
1221 | - * @return Array the spotter information |
|
1222 | - * |
|
1223 | - */ |
|
1219 | + * Gets all the spotter information based on the callsign |
|
1220 | + * |
|
1221 | + * @return Array the spotter information |
|
1222 | + * |
|
1223 | + */ |
|
1224 | 1224 | public function getSpotterDataByIdent($ident = '', $limit = '', $sort = '') |
1225 | 1225 | { |
1226 | 1226 | global $global_query; |
@@ -1271,11 +1271,11 @@ discard block |
||
1271 | 1271 | } |
1272 | 1272 | |
1273 | 1273 | /** |
1274 | - * Gets all the spotter information based on the owner |
|
1275 | - * |
|
1276 | - * @return Array the spotter information |
|
1277 | - * |
|
1278 | - */ |
|
1274 | + * Gets all the spotter information based on the owner |
|
1275 | + * |
|
1276 | + * @return Array the spotter information |
|
1277 | + * |
|
1278 | + */ |
|
1279 | 1279 | public function getSpotterDataByOwner($owner = '', $limit = '', $sort = '') |
1280 | 1280 | { |
1281 | 1281 | global $global_query; |
@@ -1326,11 +1326,11 @@ discard block |
||
1326 | 1326 | } |
1327 | 1327 | |
1328 | 1328 | /** |
1329 | - * Gets all the spotter information based on the pilot |
|
1330 | - * |
|
1331 | - * @return Array the spotter information |
|
1332 | - * |
|
1333 | - */ |
|
1329 | + * Gets all the spotter information based on the pilot |
|
1330 | + * |
|
1331 | + * @return Array the spotter information |
|
1332 | + * |
|
1333 | + */ |
|
1334 | 1334 | public function getSpotterDataByPilot($pilot = '', $limit = '', $sort = '') |
1335 | 1335 | { |
1336 | 1336 | global $global_query; |
@@ -1378,11 +1378,11 @@ discard block |
||
1378 | 1378 | |
1379 | 1379 | |
1380 | 1380 | /** |
1381 | - * Gets all the spotter information based on the aircraft type |
|
1382 | - * |
|
1383 | - * @return Array the spotter information |
|
1384 | - * |
|
1385 | - */ |
|
1381 | + * Gets all the spotter information based on the aircraft type |
|
1382 | + * |
|
1383 | + * @return Array the spotter information |
|
1384 | + * |
|
1385 | + */ |
|
1386 | 1386 | public function getSpotterDataByAircraft($aircraft_type = '', $limit = '', $sort = '', $filter = array()) |
1387 | 1387 | { |
1388 | 1388 | global $global_query; |
@@ -1436,11 +1436,11 @@ discard block |
||
1436 | 1436 | |
1437 | 1437 | |
1438 | 1438 | /** |
1439 | - * Gets all the spotter information based on the aircraft registration |
|
1440 | - * |
|
1441 | - * @return Array the spotter information |
|
1442 | - * |
|
1443 | - */ |
|
1439 | + * Gets all the spotter information based on the aircraft registration |
|
1440 | + * |
|
1441 | + * @return Array the spotter information |
|
1442 | + * |
|
1443 | + */ |
|
1444 | 1444 | public function getSpotterDataByRegistration($registration = '', $limit = '', $sort = '', $filter = array()) |
1445 | 1445 | { |
1446 | 1446 | global $global_query; |
@@ -1497,11 +1497,11 @@ discard block |
||
1497 | 1497 | |
1498 | 1498 | |
1499 | 1499 | /** |
1500 | - * Gets all the spotter information based on the airline |
|
1501 | - * |
|
1502 | - * @return Array the spotter information |
|
1503 | - * |
|
1504 | - */ |
|
1500 | + * Gets all the spotter information based on the airline |
|
1501 | + * |
|
1502 | + * @return Array the spotter information |
|
1503 | + * |
|
1504 | + */ |
|
1505 | 1505 | public function getSpotterDataByAirline($airline = '', $limit = '', $sort = '',$filters = array()) |
1506 | 1506 | { |
1507 | 1507 | global $global_query; |
@@ -1554,11 +1554,11 @@ discard block |
||
1554 | 1554 | |
1555 | 1555 | |
1556 | 1556 | /** |
1557 | - * Gets all the spotter information based on the airport |
|
1558 | - * |
|
1559 | - * @return Array the spotter information |
|
1560 | - * |
|
1561 | - */ |
|
1557 | + * Gets all the spotter information based on the airport |
|
1558 | + * |
|
1559 | + * @return Array the spotter information |
|
1560 | + * |
|
1561 | + */ |
|
1562 | 1562 | public function getSpotterDataByAirport($airport = '', $limit = '', $sort = '',$filters = array()) |
1563 | 1563 | { |
1564 | 1564 | global $global_query; |
@@ -1612,11 +1612,11 @@ discard block |
||
1612 | 1612 | |
1613 | 1613 | |
1614 | 1614 | /** |
1615 | - * Gets all the spotter information based on the date |
|
1616 | - * |
|
1617 | - * @return Array the spotter information |
|
1618 | - * |
|
1619 | - */ |
|
1615 | + * Gets all the spotter information based on the date |
|
1616 | + * |
|
1617 | + * @return Array the spotter information |
|
1618 | + * |
|
1619 | + */ |
|
1620 | 1620 | public function getSpotterDataByDate($date = '', $limit = '', $sort = '',$filter = array()) |
1621 | 1621 | { |
1622 | 1622 | global $global_query, $globalTimezone, $globalDBdriver; |
@@ -1680,11 +1680,11 @@ discard block |
||
1680 | 1680 | |
1681 | 1681 | |
1682 | 1682 | /** |
1683 | - * Gets all the spotter information based on the country name |
|
1684 | - * |
|
1685 | - * @return Array the spotter information |
|
1686 | - * |
|
1687 | - */ |
|
1683 | + * Gets all the spotter information based on the country name |
|
1684 | + * |
|
1685 | + * @return Array the spotter information |
|
1686 | + * |
|
1687 | + */ |
|
1688 | 1688 | public function getSpotterDataByCountry($country = '', $limit = '', $sort = '',$filters = array()) |
1689 | 1689 | { |
1690 | 1690 | global $global_query; |
@@ -1738,11 +1738,11 @@ discard block |
||
1738 | 1738 | |
1739 | 1739 | |
1740 | 1740 | /** |
1741 | - * Gets all the spotter information based on the manufacturer name |
|
1742 | - * |
|
1743 | - * @return Array the spotter information |
|
1744 | - * |
|
1745 | - */ |
|
1741 | + * Gets all the spotter information based on the manufacturer name |
|
1742 | + * |
|
1743 | + * @return Array the spotter information |
|
1744 | + * |
|
1745 | + */ |
|
1746 | 1746 | public function getSpotterDataByManufacturer($aircraft_manufacturer = '', $limit = '', $sort = '', $filters = array()) |
1747 | 1747 | { |
1748 | 1748 | global $global_query; |
@@ -1798,13 +1798,13 @@ discard block |
||
1798 | 1798 | |
1799 | 1799 | |
1800 | 1800 | /** |
1801 | - * Gets a list of all aircraft that take a route |
|
1802 | - * |
|
1803 | - * @param String $departure_airport_icao ICAO code of departure airport |
|
1804 | - * @param String $arrival_airport_icao ICAO code of arrival airport |
|
1805 | - * @return Array the spotter information |
|
1806 | - * |
|
1807 | - */ |
|
1801 | + * Gets a list of all aircraft that take a route |
|
1802 | + * |
|
1803 | + * @param String $departure_airport_icao ICAO code of departure airport |
|
1804 | + * @param String $arrival_airport_icao ICAO code of arrival airport |
|
1805 | + * @return Array the spotter information |
|
1806 | + * |
|
1807 | + */ |
|
1808 | 1808 | public function getSpotterDataByRoute($departure_airport_icao = '', $arrival_airport_icao = '', $limit = '', $sort = '', $filters = array()) |
1809 | 1809 | { |
1810 | 1810 | global $global_query; |
@@ -1873,11 +1873,11 @@ discard block |
||
1873 | 1873 | |
1874 | 1874 | |
1875 | 1875 | /** |
1876 | - * Gets all the spotter information based on the special column in the table |
|
1877 | - * |
|
1878 | - * @return Array the spotter information |
|
1879 | - * |
|
1880 | - */ |
|
1876 | + * Gets all the spotter information based on the special column in the table |
|
1877 | + * |
|
1878 | + * @return Array the spotter information |
|
1879 | + * |
|
1880 | + */ |
|
1881 | 1881 | public function getSpotterDataByHighlight($limit = '', $sort = '', $filter = array()) |
1882 | 1882 | { |
1883 | 1883 | global $global_query; |
@@ -1916,11 +1916,11 @@ discard block |
||
1916 | 1916 | } |
1917 | 1917 | |
1918 | 1918 | /** |
1919 | - * Gets all the highlight based on a aircraft registration |
|
1920 | - * |
|
1921 | - * @return String the highlight text |
|
1922 | - * |
|
1923 | - */ |
|
1919 | + * Gets all the highlight based on a aircraft registration |
|
1920 | + * |
|
1921 | + * @return String the highlight text |
|
1922 | + * |
|
1923 | + */ |
|
1924 | 1924 | public function getHighlightByRegistration($registration,$filter = array()) |
1925 | 1925 | { |
1926 | 1926 | global $global_query; |
@@ -1942,13 +1942,13 @@ discard block |
||
1942 | 1942 | |
1943 | 1943 | |
1944 | 1944 | /** |
1945 | - * Gets the squawk usage from squawk code |
|
1946 | - * |
|
1947 | - * @param String $squawk squawk code |
|
1948 | - * @param String $country country |
|
1949 | - * @return String usage |
|
1950 | - * |
|
1951 | - */ |
|
1945 | + * Gets the squawk usage from squawk code |
|
1946 | + * |
|
1947 | + * @param String $squawk squawk code |
|
1948 | + * @param String $country country |
|
1949 | + * @return String usage |
|
1950 | + * |
|
1951 | + */ |
|
1952 | 1952 | public function getSquawkUsage($squawk = '',$country = 'FR') |
1953 | 1953 | { |
1954 | 1954 | |
@@ -1969,12 +1969,12 @@ discard block |
||
1969 | 1969 | } |
1970 | 1970 | |
1971 | 1971 | /** |
1972 | - * Gets the airport icao from the iata |
|
1973 | - * |
|
1974 | - * @param String $airport_iata the iata code of the airport |
|
1975 | - * @return String airport iata |
|
1976 | - * |
|
1977 | - */ |
|
1972 | + * Gets the airport icao from the iata |
|
1973 | + * |
|
1974 | + * @param String $airport_iata the iata code of the airport |
|
1975 | + * @return String airport iata |
|
1976 | + * |
|
1977 | + */ |
|
1978 | 1978 | public function getAirportIcao($airport_iata = '') |
1979 | 1979 | { |
1980 | 1980 | |
@@ -1994,14 +1994,14 @@ discard block |
||
1994 | 1994 | } |
1995 | 1995 | |
1996 | 1996 | /** |
1997 | - * Gets the airport distance |
|
1998 | - * |
|
1999 | - * @param String $airport_icao the icao code of the airport |
|
2000 | - * @param Float $latitude the latitude |
|
2001 | - * @param Float $longitude the longitude |
|
2002 | - * @return Float distance to the airport |
|
2003 | - * |
|
2004 | - */ |
|
1997 | + * Gets the airport distance |
|
1998 | + * |
|
1999 | + * @param String $airport_icao the icao code of the airport |
|
2000 | + * @param Float $latitude the latitude |
|
2001 | + * @param Float $longitude the longitude |
|
2002 | + * @return Float distance to the airport |
|
2003 | + * |
|
2004 | + */ |
|
2005 | 2005 | public function getAirportDistance($airport_icao,$latitude,$longitude) |
2006 | 2006 | { |
2007 | 2007 | |
@@ -2022,12 +2022,12 @@ discard block |
||
2022 | 2022 | } |
2023 | 2023 | |
2024 | 2024 | /** |
2025 | - * Gets the airport info based on the icao |
|
2026 | - * |
|
2027 | - * @param String $airport the icao code of the airport |
|
2028 | - * @return Array airport information |
|
2029 | - * |
|
2030 | - */ |
|
2025 | + * Gets the airport info based on the icao |
|
2026 | + * |
|
2027 | + * @param String $airport the icao code of the airport |
|
2028 | + * @return Array airport information |
|
2029 | + * |
|
2030 | + */ |
|
2031 | 2031 | public function getAllAirportInfo($airport = '') |
2032 | 2032 | { |
2033 | 2033 | |
@@ -2073,12 +2073,12 @@ discard block |
||
2073 | 2073 | } |
2074 | 2074 | |
2075 | 2075 | /** |
2076 | - * Gets the airport info based on the country |
|
2077 | - * |
|
2078 | - * @param Array $countries Airports countries |
|
2079 | - * @return Array airport information |
|
2080 | - * |
|
2081 | - */ |
|
2076 | + * Gets the airport info based on the country |
|
2077 | + * |
|
2078 | + * @param Array $countries Airports countries |
|
2079 | + * @return Array airport information |
|
2080 | + * |
|
2081 | + */ |
|
2082 | 2082 | public function getAllAirportInfobyCountry($countries) |
2083 | 2083 | { |
2084 | 2084 | $lst_countries = ''; |
@@ -2116,12 +2116,12 @@ discard block |
||
2116 | 2116 | } |
2117 | 2117 | |
2118 | 2118 | /** |
2119 | - * Gets airports info based on the coord |
|
2120 | - * |
|
2121 | - * @param Array $coord Airports longitude min,latitude min, longitude max, latitude max |
|
2122 | - * @return Array airport information |
|
2123 | - * |
|
2124 | - */ |
|
2119 | + * Gets airports info based on the coord |
|
2120 | + * |
|
2121 | + * @param Array $coord Airports longitude min,latitude min, longitude max, latitude max |
|
2122 | + * @return Array airport information |
|
2123 | + * |
|
2124 | + */ |
|
2125 | 2125 | public function getAllAirportInfobyCoord($coord) |
2126 | 2126 | { |
2127 | 2127 | global $globalDBdriver; |
@@ -2152,12 +2152,12 @@ discard block |
||
2152 | 2152 | } |
2153 | 2153 | |
2154 | 2154 | /** |
2155 | - * Gets waypoints info based on the coord |
|
2156 | - * |
|
2157 | - * @param Array $coord waypoints coord |
|
2158 | - * @return Array airport information |
|
2159 | - * |
|
2160 | - */ |
|
2155 | + * Gets waypoints info based on the coord |
|
2156 | + * |
|
2157 | + * @param Array $coord waypoints coord |
|
2158 | + * @return Array airport information |
|
2159 | + * |
|
2160 | + */ |
|
2161 | 2161 | public function getAllWaypointsInfobyCoord($coord) |
2162 | 2162 | { |
2163 | 2163 | if (is_array($coord)) { |
@@ -2191,12 +2191,12 @@ discard block |
||
2191 | 2191 | |
2192 | 2192 | |
2193 | 2193 | /** |
2194 | - * Gets the airline info based on the icao code or iata code |
|
2195 | - * |
|
2196 | - * @param String $airline_icao the iata code of the airport |
|
2197 | - * @return Array airport information |
|
2198 | - * |
|
2199 | - */ |
|
2194 | + * Gets the airline info based on the icao code or iata code |
|
2195 | + * |
|
2196 | + * @param String $airline_icao the iata code of the airport |
|
2197 | + * @return Array airport information |
|
2198 | + * |
|
2199 | + */ |
|
2200 | 2200 | public function getAllAirlineInfo($airline_icao, $fromsource = NULL) |
2201 | 2201 | { |
2202 | 2202 | global $globalUseRealAirlines; |
@@ -2227,7 +2227,7 @@ discard block |
||
2227 | 2227 | } else { |
2228 | 2228 | $sth->execute(array(':airline_icao' => $airline_icao,':fromsource' => $fromsource)); |
2229 | 2229 | } |
2230 | - /* |
|
2230 | + /* |
|
2231 | 2231 | $airline_array = array(); |
2232 | 2232 | $temp_array = array(); |
2233 | 2233 | |
@@ -2260,12 +2260,12 @@ discard block |
||
2260 | 2260 | } |
2261 | 2261 | |
2262 | 2262 | /** |
2263 | - * Gets the airline info based on the airline name |
|
2264 | - * |
|
2265 | - * @param String $airline_name the name of the airline |
|
2266 | - * @return Array airline information |
|
2267 | - * |
|
2268 | - */ |
|
2263 | + * Gets the airline info based on the airline name |
|
2264 | + * |
|
2265 | + * @param String $airline_name the name of the airline |
|
2266 | + * @return Array airline information |
|
2267 | + * |
|
2268 | + */ |
|
2269 | 2269 | public function getAllAirlineInfoByName($airline_name, $fromsource = NULL) |
2270 | 2270 | { |
2271 | 2271 | global $globalUseRealAirlines; |
@@ -2293,12 +2293,12 @@ discard block |
||
2293 | 2293 | |
2294 | 2294 | |
2295 | 2295 | /** |
2296 | - * Gets the aircraft info based on the aircraft type |
|
2297 | - * |
|
2298 | - * @param String $aircraft_type the aircraft type |
|
2299 | - * @return Array aircraft information |
|
2300 | - * |
|
2301 | - */ |
|
2296 | + * Gets the aircraft info based on the aircraft type |
|
2297 | + * |
|
2298 | + * @param String $aircraft_type the aircraft type |
|
2299 | + * @return Array aircraft information |
|
2300 | + * |
|
2301 | + */ |
|
2302 | 2302 | public function getAllAircraftInfo($aircraft_type) |
2303 | 2303 | { |
2304 | 2304 | $aircraft_type = filter_var($aircraft_type,FILTER_SANITIZE_STRING); |
@@ -2330,12 +2330,12 @@ discard block |
||
2330 | 2330 | } |
2331 | 2331 | |
2332 | 2332 | /** |
2333 | - * Gets the aircraft icao based on the aircraft name/type |
|
2334 | - * |
|
2335 | - * @param String $aircraft_type the aircraft type |
|
2336 | - * @return String aircraft information |
|
2337 | - * |
|
2338 | - */ |
|
2333 | + * Gets the aircraft icao based on the aircraft name/type |
|
2334 | + * |
|
2335 | + * @param String $aircraft_type the aircraft type |
|
2336 | + * @return String aircraft information |
|
2337 | + * |
|
2338 | + */ |
|
2339 | 2339 | public function getAircraftIcao($aircraft_type) |
2340 | 2340 | { |
2341 | 2341 | $aircraft_type = filter_var($aircraft_type,FILTER_SANITIZE_STRING); |
@@ -2360,12 +2360,12 @@ discard block |
||
2360 | 2360 | } |
2361 | 2361 | |
2362 | 2362 | /** |
2363 | - * Gets the aircraft info based on the aircraft modes |
|
2364 | - * |
|
2365 | - * @param String $aircraft_modes the aircraft ident (hex) |
|
2366 | - * @return String aircraft type |
|
2367 | - * |
|
2368 | - */ |
|
2363 | + * Gets the aircraft info based on the aircraft modes |
|
2364 | + * |
|
2365 | + * @param String $aircraft_modes the aircraft ident (hex) |
|
2366 | + * @return String aircraft type |
|
2367 | + * |
|
2368 | + */ |
|
2369 | 2369 | public function getAllAircraftType($aircraft_modes) |
2370 | 2370 | { |
2371 | 2371 | $aircraft_modes = filter_var($aircraft_modes,FILTER_SANITIZE_STRING); |
@@ -2385,12 +2385,12 @@ discard block |
||
2385 | 2385 | } |
2386 | 2386 | |
2387 | 2387 | /** |
2388 | - * Gets the aircraft info based on the aircraft registration |
|
2389 | - * |
|
2390 | - * @param String $registration the aircraft registration |
|
2391 | - * @return String aircraft type |
|
2392 | - * |
|
2393 | - */ |
|
2388 | + * Gets the aircraft info based on the aircraft registration |
|
2389 | + * |
|
2390 | + * @param String $registration the aircraft registration |
|
2391 | + * @return String aircraft type |
|
2392 | + * |
|
2393 | + */ |
|
2394 | 2394 | public function getAllAircraftTypeByRegistration($registration) |
2395 | 2395 | { |
2396 | 2396 | $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
@@ -2408,12 +2408,12 @@ discard block |
||
2408 | 2408 | } |
2409 | 2409 | |
2410 | 2410 | /** |
2411 | - * Gets the spotter_id and flightaware_id based on the aircraft registration |
|
2412 | - * |
|
2413 | - * @param String $registration the aircraft registration |
|
2414 | - * @return Array spotter_id and flightaware_id |
|
2415 | - * |
|
2416 | - */ |
|
2411 | + * Gets the spotter_id and flightaware_id based on the aircraft registration |
|
2412 | + * |
|
2413 | + * @param String $registration the aircraft registration |
|
2414 | + * @return Array spotter_id and flightaware_id |
|
2415 | + * |
|
2416 | + */ |
|
2417 | 2417 | public function getAllIDByRegistration($registration) |
2418 | 2418 | { |
2419 | 2419 | $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
@@ -2432,12 +2432,12 @@ discard block |
||
2432 | 2432 | } |
2433 | 2433 | |
2434 | 2434 | /** |
2435 | - * Gets correct aircraft operator code |
|
2436 | - * |
|
2437 | - * @param String $operator the aircraft operator code (callsign) |
|
2438 | - * @return String aircraft operator code |
|
2439 | - * |
|
2440 | - */ |
|
2435 | + * Gets correct aircraft operator code |
|
2436 | + * |
|
2437 | + * @param String $operator the aircraft operator code (callsign) |
|
2438 | + * @return String aircraft operator code |
|
2439 | + * |
|
2440 | + */ |
|
2441 | 2441 | public function getOperator($operator) |
2442 | 2442 | { |
2443 | 2443 | $operator = filter_var($operator,FILTER_SANITIZE_STRING); |
@@ -2454,16 +2454,16 @@ discard block |
||
2454 | 2454 | } |
2455 | 2455 | |
2456 | 2456 | /** |
2457 | - * Gets the aircraft route based on the aircraft callsign |
|
2458 | - * |
|
2459 | - * @param String $callsign the aircraft callsign |
|
2460 | - * @return Array aircraft type |
|
2461 | - * |
|
2462 | - */ |
|
2457 | + * Gets the aircraft route based on the aircraft callsign |
|
2458 | + * |
|
2459 | + * @param String $callsign the aircraft callsign |
|
2460 | + * @return Array aircraft type |
|
2461 | + * |
|
2462 | + */ |
|
2463 | 2463 | public function getRouteInfo($callsign) |
2464 | 2464 | { |
2465 | 2465 | $callsign = filter_var($callsign,FILTER_SANITIZE_STRING); |
2466 | - if ($callsign == '') return array(); |
|
2466 | + if ($callsign == '') return array(); |
|
2467 | 2467 | $query = "SELECT routes.Operator_ICAO, routes.FromAirport_ICAO, routes.ToAirport_ICAO, routes.RouteStop, routes.FromAirport_Time, routes.ToAirport_Time FROM routes WHERE CallSign = :callsign LIMIT 1"; |
2468 | 2468 | |
2469 | 2469 | $sth = $this->db->prepare($query); |
@@ -2477,12 +2477,12 @@ discard block |
||
2477 | 2477 | } |
2478 | 2478 | |
2479 | 2479 | /** |
2480 | - * Gets the aircraft info based on the aircraft registration |
|
2481 | - * |
|
2482 | - * @param String $registration the aircraft registration |
|
2483 | - * @return Array aircraft information |
|
2484 | - * |
|
2485 | - */ |
|
2480 | + * Gets the aircraft info based on the aircraft registration |
|
2481 | + * |
|
2482 | + * @param String $registration the aircraft registration |
|
2483 | + * @return Array aircraft information |
|
2484 | + * |
|
2485 | + */ |
|
2486 | 2486 | public function getAircraftInfoByRegistration($registration) |
2487 | 2487 | { |
2488 | 2488 | $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
@@ -2509,12 +2509,12 @@ discard block |
||
2509 | 2509 | } |
2510 | 2510 | |
2511 | 2511 | /** |
2512 | - * Gets the aircraft owner & base based on the aircraft registration |
|
2513 | - * |
|
2514 | - * @param String $registration the aircraft registration |
|
2515 | - * @return Array aircraft information |
|
2516 | - * |
|
2517 | - */ |
|
2512 | + * Gets the aircraft owner & base based on the aircraft registration |
|
2513 | + * |
|
2514 | + * @param String $registration the aircraft registration |
|
2515 | + * @return Array aircraft information |
|
2516 | + * |
|
2517 | + */ |
|
2518 | 2518 | public function getAircraftOwnerByRegistration($registration) |
2519 | 2519 | { |
2520 | 2520 | $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
@@ -2531,11 +2531,11 @@ discard block |
||
2531 | 2531 | |
2532 | 2532 | |
2533 | 2533 | /** |
2534 | - * Gets all flights (but with only little info) |
|
2535 | - * |
|
2536 | - * @return Array basic flight information |
|
2537 | - * |
|
2538 | - */ |
|
2534 | + * Gets all flights (but with only little info) |
|
2535 | + * |
|
2536 | + * @return Array basic flight information |
|
2537 | + * |
|
2538 | + */ |
|
2539 | 2539 | public function getAllFlightsforSitemap() |
2540 | 2540 | { |
2541 | 2541 | //$query = "SELECT spotter_output.spotter_id, spotter_output.ident, spotter_output.airline_name, spotter_output.aircraft_name, spotter_output.aircraft_icao FROM spotter_output ORDER BY LIMIT "; |
@@ -2543,7 +2543,7 @@ discard block |
||
2543 | 2543 | |
2544 | 2544 | $sth = $this->db->prepare($query); |
2545 | 2545 | $sth->execute(); |
2546 | - /* |
|
2546 | + /* |
|
2547 | 2547 | $flight_array = array(); |
2548 | 2548 | $temp_array = array(); |
2549 | 2549 | |
@@ -2565,11 +2565,11 @@ discard block |
||
2565 | 2565 | } |
2566 | 2566 | |
2567 | 2567 | /** |
2568 | - * Gets a list of all aircraft manufacturers |
|
2569 | - * |
|
2570 | - * @return Array list of aircraft types |
|
2571 | - * |
|
2572 | - */ |
|
2568 | + * Gets a list of all aircraft manufacturers |
|
2569 | + * |
|
2570 | + * @return Array list of aircraft types |
|
2571 | + * |
|
2572 | + */ |
|
2573 | 2573 | public function getAllManufacturers() |
2574 | 2574 | { |
2575 | 2575 | /* |
@@ -2598,11 +2598,11 @@ discard block |
||
2598 | 2598 | |
2599 | 2599 | |
2600 | 2600 | /** |
2601 | - * Gets a list of all aircraft types |
|
2602 | - * |
|
2603 | - * @return Array list of aircraft types |
|
2604 | - * |
|
2605 | - */ |
|
2601 | + * Gets a list of all aircraft types |
|
2602 | + * |
|
2603 | + * @return Array list of aircraft types |
|
2604 | + * |
|
2605 | + */ |
|
2606 | 2606 | public function getAllAircraftTypes($filters = array()) |
2607 | 2607 | { |
2608 | 2608 | /* |
@@ -2637,11 +2637,11 @@ discard block |
||
2637 | 2637 | |
2638 | 2638 | |
2639 | 2639 | /** |
2640 | - * Gets a list of all aircraft registrations |
|
2641 | - * |
|
2642 | - * @return Array list of aircraft registrations |
|
2643 | - * |
|
2644 | - */ |
|
2640 | + * Gets a list of all aircraft registrations |
|
2641 | + * |
|
2642 | + * @return Array list of aircraft registrations |
|
2643 | + * |
|
2644 | + */ |
|
2645 | 2645 | public function getAllAircraftRegistrations($filters = array()) |
2646 | 2646 | { |
2647 | 2647 | $filter_query = $this->getFilter($filters,true,true); |
@@ -2666,12 +2666,12 @@ discard block |
||
2666 | 2666 | } |
2667 | 2667 | |
2668 | 2668 | /** |
2669 | - * Gets all source name |
|
2670 | - * |
|
2671 | - * @param String type format of source |
|
2672 | - * @return Array list of source name |
|
2673 | - * |
|
2674 | - */ |
|
2669 | + * Gets all source name |
|
2670 | + * |
|
2671 | + * @param String type format of source |
|
2672 | + * @return Array list of source name |
|
2673 | + * |
|
2674 | + */ |
|
2675 | 2675 | public function getAllSourceName($type = '',$filters = array()) |
2676 | 2676 | { |
2677 | 2677 | $filter_query = $this->getFilter($filters,true,true); |
@@ -2702,11 +2702,11 @@ discard block |
||
2702 | 2702 | |
2703 | 2703 | |
2704 | 2704 | /** |
2705 | - * Gets a list of all airline names |
|
2706 | - * |
|
2707 | - * @return Array list of airline names |
|
2708 | - * |
|
2709 | - */ |
|
2705 | + * Gets a list of all airline names |
|
2706 | + * |
|
2707 | + * @return Array list of airline names |
|
2708 | + * |
|
2709 | + */ |
|
2710 | 2710 | public function getAllAirlineNames($airline_type = '',$forsource = NULL,$filters = array()) |
2711 | 2711 | { |
2712 | 2712 | global $globalAirlinesSource,$globalVATSIM, $globalIVAO; |
@@ -2755,11 +2755,11 @@ discard block |
||
2755 | 2755 | } |
2756 | 2756 | |
2757 | 2757 | /** |
2758 | - * Gets a list of all alliance names |
|
2759 | - * |
|
2760 | - * @return Array list of alliance names |
|
2761 | - * |
|
2762 | - */ |
|
2758 | + * Gets a list of all alliance names |
|
2759 | + * |
|
2760 | + * @return Array list of alliance names |
|
2761 | + * |
|
2762 | + */ |
|
2763 | 2763 | public function getAllAllianceNames($forsource = NULL,$filters = array()) |
2764 | 2764 | { |
2765 | 2765 | global $globalAirlinesSource,$globalVATSIM, $globalIVAO; |
@@ -2784,11 +2784,11 @@ discard block |
||
2784 | 2784 | } |
2785 | 2785 | |
2786 | 2786 | /** |
2787 | - * Gets a list of all airline countries |
|
2788 | - * |
|
2789 | - * @return Array list of airline countries |
|
2790 | - * |
|
2791 | - */ |
|
2787 | + * Gets a list of all airline countries |
|
2788 | + * |
|
2789 | + * @return Array list of airline countries |
|
2790 | + * |
|
2791 | + */ |
|
2792 | 2792 | public function getAllAirlineCountries($filters = array()) |
2793 | 2793 | { |
2794 | 2794 | $filter_query = $this->getFilter($filters,true,true); |
@@ -2816,11 +2816,11 @@ discard block |
||
2816 | 2816 | |
2817 | 2817 | |
2818 | 2818 | /** |
2819 | - * Gets a list of all departure & arrival names |
|
2820 | - * |
|
2821 | - * @return Array list of airport names |
|
2822 | - * |
|
2823 | - */ |
|
2819 | + * Gets a list of all departure & arrival names |
|
2820 | + * |
|
2821 | + * @return Array list of airport names |
|
2822 | + * |
|
2823 | + */ |
|
2824 | 2824 | public function getAllAirportNames($filters = array()) |
2825 | 2825 | { |
2826 | 2826 | $filter_query = $this->getFilter($filters,true,true); |
@@ -2868,11 +2868,11 @@ discard block |
||
2868 | 2868 | } |
2869 | 2869 | |
2870 | 2870 | /** |
2871 | - * Gets a list of all owner names |
|
2872 | - * |
|
2873 | - * @return Array list of owner names |
|
2874 | - * |
|
2875 | - */ |
|
2871 | + * Gets a list of all owner names |
|
2872 | + * |
|
2873 | + * @return Array list of owner names |
|
2874 | + * |
|
2875 | + */ |
|
2876 | 2876 | public function getAllOwnerNames($filters = array()) |
2877 | 2877 | { |
2878 | 2878 | $filter_query = $this->getFilter($filters,true,true); |
@@ -2887,11 +2887,11 @@ discard block |
||
2887 | 2887 | } |
2888 | 2888 | |
2889 | 2889 | /** |
2890 | - * Gets a list of all pilot names and pilot ids |
|
2891 | - * |
|
2892 | - * @return Array list of pilot names and pilot ids |
|
2893 | - * |
|
2894 | - */ |
|
2890 | + * Gets a list of all pilot names and pilot ids |
|
2891 | + * |
|
2892 | + * @return Array list of pilot names and pilot ids |
|
2893 | + * |
|
2894 | + */ |
|
2895 | 2895 | public function getAllPilotNames($filters = array()) |
2896 | 2896 | { |
2897 | 2897 | $filter_query = $this->getFilter($filters,true,true); |
@@ -2907,11 +2907,11 @@ discard block |
||
2907 | 2907 | |
2908 | 2908 | |
2909 | 2909 | /** |
2910 | - * Gets a list of all departure & arrival airport countries |
|
2911 | - * |
|
2912 | - * @return Array list of airport countries |
|
2913 | - * |
|
2914 | - */ |
|
2910 | + * Gets a list of all departure & arrival airport countries |
|
2911 | + * |
|
2912 | + * @return Array list of airport countries |
|
2913 | + * |
|
2914 | + */ |
|
2915 | 2915 | public function getAllAirportCountries($filters = array()) |
2916 | 2916 | { |
2917 | 2917 | $airport_array = array(); |
@@ -2959,11 +2959,11 @@ discard block |
||
2959 | 2959 | |
2960 | 2960 | |
2961 | 2961 | /** |
2962 | - * Gets a list of all countries (airline, departure airport & arrival airport) |
|
2963 | - * |
|
2964 | - * @return Array list of countries |
|
2965 | - * |
|
2966 | - */ |
|
2962 | + * Gets a list of all countries (airline, departure airport & arrival airport) |
|
2963 | + * |
|
2964 | + * @return Array list of countries |
|
2965 | + * |
|
2966 | + */ |
|
2967 | 2967 | public function getAllCountries($filters = array()) |
2968 | 2968 | { |
2969 | 2969 | $Connection= new Connection($this->db); |
@@ -3040,11 +3040,11 @@ discard block |
||
3040 | 3040 | |
3041 | 3041 | |
3042 | 3042 | /** |
3043 | - * Gets a list of all idents/callsigns |
|
3044 | - * |
|
3045 | - * @return Array list of ident/callsign names |
|
3046 | - * |
|
3047 | - */ |
|
3043 | + * Gets a list of all idents/callsigns |
|
3044 | + * |
|
3045 | + * @return Array list of ident/callsign names |
|
3046 | + * |
|
3047 | + */ |
|
3048 | 3048 | public function getAllIdents($filters = array()) |
3049 | 3049 | { |
3050 | 3050 | $filter_query = $this->getFilter($filters,true,true); |
@@ -3068,9 +3068,9 @@ discard block |
||
3068 | 3068 | } |
3069 | 3069 | |
3070 | 3070 | /** |
3071 | - * Get a list of flights from airport since 7 days |
|
3072 | - * @return Array number, icao, name and city of airports |
|
3073 | - */ |
|
3071 | + * Get a list of flights from airport since 7 days |
|
3072 | + * @return Array number, icao, name and city of airports |
|
3073 | + */ |
|
3074 | 3074 | |
3075 | 3075 | public function getLast7DaysAirportsDeparture($airport_icao = '',$filters = array()) { |
3076 | 3076 | global $globalTimezone, $globalDBdriver; |
@@ -3101,9 +3101,9 @@ discard block |
||
3101 | 3101 | } |
3102 | 3102 | |
3103 | 3103 | /** |
3104 | - * Get a list of flights from airport since 7 days |
|
3105 | - * @return Array number, icao, name and city of airports |
|
3106 | - */ |
|
3104 | + * Get a list of flights from airport since 7 days |
|
3105 | + * @return Array number, icao, name and city of airports |
|
3106 | + */ |
|
3107 | 3107 | |
3108 | 3108 | public function getLast7DaysAirportsDepartureByAirlines($airport_icao = '') { |
3109 | 3109 | global $globalTimezone, $globalDBdriver; |
@@ -3133,9 +3133,9 @@ discard block |
||
3133 | 3133 | } |
3134 | 3134 | |
3135 | 3135 | /** |
3136 | - * Get a list of flights from detected airport since 7 days |
|
3137 | - * @return Array number, icao, name and city of airports |
|
3138 | - */ |
|
3136 | + * Get a list of flights from detected airport since 7 days |
|
3137 | + * @return Array number, icao, name and city of airports |
|
3138 | + */ |
|
3139 | 3139 | |
3140 | 3140 | public function getLast7DaysDetectedAirportsDeparture($airport_icao = '', $filters = array()) { |
3141 | 3141 | global $globalTimezone, $globalDBdriver; |
@@ -3173,9 +3173,9 @@ discard block |
||
3173 | 3173 | } |
3174 | 3174 | |
3175 | 3175 | /** |
3176 | - * Get a list of flights from detected airport since 7 days |
|
3177 | - * @return Array number, icao, name and city of airports |
|
3178 | - */ |
|
3176 | + * Get a list of flights from detected airport since 7 days |
|
3177 | + * @return Array number, icao, name and city of airports |
|
3178 | + */ |
|
3179 | 3179 | |
3180 | 3180 | public function getLast7DaysDetectedAirportsDepartureByAirlines($airport_icao = '') { |
3181 | 3181 | global $globalTimezone, $globalDBdriver; |
@@ -3217,9 +3217,9 @@ discard block |
||
3217 | 3217 | |
3218 | 3218 | |
3219 | 3219 | /** |
3220 | - * Get a list of flights to airport since 7 days |
|
3221 | - * @return Array number, icao, name and city of airports |
|
3222 | - */ |
|
3220 | + * Get a list of flights to airport since 7 days |
|
3221 | + * @return Array number, icao, name and city of airports |
|
3222 | + */ |
|
3223 | 3223 | |
3224 | 3224 | public function getLast7DaysAirportsArrival($airport_icao = '', $filters = array()) { |
3225 | 3225 | global $globalTimezone, $globalDBdriver; |
@@ -3252,9 +3252,9 @@ discard block |
||
3252 | 3252 | |
3253 | 3253 | |
3254 | 3254 | /** |
3255 | - * Get a list of flights detected to airport since 7 days |
|
3256 | - * @return Array number, icao, name and city of airports |
|
3257 | - */ |
|
3255 | + * Get a list of flights detected to airport since 7 days |
|
3256 | + * @return Array number, icao, name and city of airports |
|
3257 | + */ |
|
3258 | 3258 | |
3259 | 3259 | public function getLast7DaysDetectedAirportsArrival($airport_icao = '',$filters = array()) { |
3260 | 3260 | global $globalTimezone, $globalDBdriver; |
@@ -3295,9 +3295,9 @@ discard block |
||
3295 | 3295 | |
3296 | 3296 | |
3297 | 3297 | /** |
3298 | - * Get a list of flights to airport since 7 days |
|
3299 | - * @return Array number, icao, name and city of airports |
|
3300 | - */ |
|
3298 | + * Get a list of flights to airport since 7 days |
|
3299 | + * @return Array number, icao, name and city of airports |
|
3300 | + */ |
|
3301 | 3301 | |
3302 | 3302 | public function getLast7DaysAirportsArrivalByAirlines($airport_icao = '') { |
3303 | 3303 | global $globalTimezone, $globalDBdriver; |
@@ -3329,9 +3329,9 @@ discard block |
||
3329 | 3329 | |
3330 | 3330 | |
3331 | 3331 | /** |
3332 | - * Get a list of flights detected to airport since 7 days |
|
3333 | - * @return Array number, icao, name and city of airports |
|
3334 | - */ |
|
3332 | + * Get a list of flights detected to airport since 7 days |
|
3333 | + * @return Array number, icao, name and city of airports |
|
3334 | + */ |
|
3335 | 3335 | |
3336 | 3336 | public function getLast7DaysDetectedAirportsArrivalByAirlines($airport_icao = '') { |
3337 | 3337 | global $globalTimezone, $globalDBdriver; |
@@ -3375,11 +3375,11 @@ discard block |
||
3375 | 3375 | |
3376 | 3376 | |
3377 | 3377 | /** |
3378 | - * Gets a list of all dates |
|
3379 | - * |
|
3380 | - * @return Array list of date names |
|
3381 | - * |
|
3382 | - */ |
|
3378 | + * Gets a list of all dates |
|
3379 | + * |
|
3380 | + * @return Array list of date names |
|
3381 | + * |
|
3382 | + */ |
|
3383 | 3383 | public function getAllDates() |
3384 | 3384 | { |
3385 | 3385 | global $globalTimezone, $globalDBdriver; |
@@ -3420,11 +3420,11 @@ discard block |
||
3420 | 3420 | |
3421 | 3421 | |
3422 | 3422 | /** |
3423 | - * Gets all route combinations |
|
3424 | - * |
|
3425 | - * @return Array the route list |
|
3426 | - * |
|
3427 | - */ |
|
3423 | + * Gets all route combinations |
|
3424 | + * |
|
3425 | + * @return Array the route list |
|
3426 | + * |
|
3427 | + */ |
|
3428 | 3428 | public function getAllRoutes() |
3429 | 3429 | { |
3430 | 3430 | $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 |
@@ -3450,13 +3450,13 @@ discard block |
||
3450 | 3450 | } |
3451 | 3451 | |
3452 | 3452 | /** |
3453 | - * Update ident spotter data |
|
3454 | - * |
|
3455 | - * @param String $flightaware_id the ID from flightaware |
|
3456 | - * @param String $ident the flight ident |
|
3457 | - * @return String success or false |
|
3458 | - * |
|
3459 | - */ |
|
3453 | + * Update ident spotter data |
|
3454 | + * |
|
3455 | + * @param String $flightaware_id the ID from flightaware |
|
3456 | + * @param String $ident the flight ident |
|
3457 | + * @return String success or false |
|
3458 | + * |
|
3459 | + */ |
|
3460 | 3460 | public function updateIdentSpotterData($flightaware_id = '', $ident = '',$fromsource = NULL) |
3461 | 3461 | { |
3462 | 3462 | if (!is_numeric(substr($ident, 0, 3))) |
@@ -3477,14 +3477,14 @@ discard block |
||
3477 | 3477 | } else { |
3478 | 3478 | $airline_array = $this->getAllAirlineInfo("NA"); |
3479 | 3479 | } |
3480 | - $airline_name = $airline_array[0]['name']; |
|
3481 | - $airline_icao = $airline_array[0]['icao']; |
|
3482 | - $airline_country = $airline_array[0]['country']; |
|
3483 | - $airline_type = $airline_array[0]['type']; |
|
3480 | + $airline_name = $airline_array[0]['name']; |
|
3481 | + $airline_icao = $airline_array[0]['icao']; |
|
3482 | + $airline_country = $airline_array[0]['country']; |
|
3483 | + $airline_type = $airline_array[0]['type']; |
|
3484 | 3484 | |
3485 | 3485 | |
3486 | 3486 | $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'; |
3487 | - $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); |
|
3487 | + $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); |
|
3488 | 3488 | |
3489 | 3489 | try { |
3490 | 3490 | $sth = $this->db->prepare($query); |
@@ -3497,19 +3497,19 @@ discard block |
||
3497 | 3497 | |
3498 | 3498 | } |
3499 | 3499 | /** |
3500 | - * Update latest spotter data |
|
3501 | - * |
|
3502 | - * @param String $flightaware_id the ID from flightaware |
|
3503 | - * @param String $ident the flight ident |
|
3504 | - * @param String $arrival_airport_icao the arrival airport |
|
3505 | - * @return String success or false |
|
3506 | - * |
|
3507 | - */ |
|
3500 | + * Update latest spotter data |
|
3501 | + * |
|
3502 | + * @param String $flightaware_id the ID from flightaware |
|
3503 | + * @param String $ident the flight ident |
|
3504 | + * @param String $arrival_airport_icao the arrival airport |
|
3505 | + * @return String success or false |
|
3506 | + * |
|
3507 | + */ |
|
3508 | 3508 | public function updateLatestSpotterData($flightaware_id = '', $ident = '', $latitude = '', $longitude = '', $altitude = '', $ground = false, $groundspeed = NULL, $date = '', $arrival_airport_icao = '',$arrival_airport_time = '') |
3509 | 3509 | { |
3510 | 3510 | if ($groundspeed == '') $groundspeed = NULL; |
3511 | 3511 | $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'; |
3512 | - $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); |
|
3512 | + $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); |
|
3513 | 3513 | |
3514 | 3514 | try { |
3515 | 3515 | $sth = $this->db->prepare($query); |
@@ -3523,32 +3523,32 @@ discard block |
||
3523 | 3523 | } |
3524 | 3524 | |
3525 | 3525 | /** |
3526 | - * Adds a new spotter data |
|
3527 | - * |
|
3528 | - * @param String $flightaware_id the ID from flightaware |
|
3529 | - * @param String $ident the flight ident |
|
3530 | - * @param String $aircraft_icao the aircraft type |
|
3531 | - * @param String $departure_airport_icao the departure airport |
|
3532 | - * @param String $arrival_airport_icao the arrival airport |
|
3533 | - * @param String $latitude latitude of flight |
|
3534 | - * @param String $longitude latitude of flight |
|
3535 | - * @param String $waypoints waypoints of flight |
|
3536 | - * @param String $altitude altitude of flight |
|
3537 | - * @param String $heading heading of flight |
|
3538 | - * @param String $groundspeed speed of flight |
|
3539 | - * @param String $date date of flight |
|
3540 | - * @param String $departure_airport_time departure time of flight |
|
3541 | - * @param String $arrival_airport_time arrival time of flight |
|
3542 | - * @param String $squawk squawk code of flight |
|
3543 | - * @param String $route_stop route stop of flight |
|
3544 | - * @param String $highlight highlight or not |
|
3545 | - * @param String $ModeS ModesS code of flight |
|
3546 | - * @param String $registration registration code of flight |
|
3547 | - * @param String $pilot_id pilot id of flight (for virtual airlines) |
|
3548 | - * @param String $pilot_name pilot name of flight (for virtual airlines) |
|
3549 | - * @param String $verticalrate vertival rate of flight |
|
3550 | - * @return String success or false |
|
3551 | - */ |
|
3526 | + * Adds a new spotter data |
|
3527 | + * |
|
3528 | + * @param String $flightaware_id the ID from flightaware |
|
3529 | + * @param String $ident the flight ident |
|
3530 | + * @param String $aircraft_icao the aircraft type |
|
3531 | + * @param String $departure_airport_icao the departure airport |
|
3532 | + * @param String $arrival_airport_icao the arrival airport |
|
3533 | + * @param String $latitude latitude of flight |
|
3534 | + * @param String $longitude latitude of flight |
|
3535 | + * @param String $waypoints waypoints of flight |
|
3536 | + * @param String $altitude altitude of flight |
|
3537 | + * @param String $heading heading of flight |
|
3538 | + * @param String $groundspeed speed of flight |
|
3539 | + * @param String $date date of flight |
|
3540 | + * @param String $departure_airport_time departure time of flight |
|
3541 | + * @param String $arrival_airport_time arrival time of flight |
|
3542 | + * @param String $squawk squawk code of flight |
|
3543 | + * @param String $route_stop route stop of flight |
|
3544 | + * @param String $highlight highlight or not |
|
3545 | + * @param String $ModeS ModesS code of flight |
|
3546 | + * @param String $registration registration code of flight |
|
3547 | + * @param String $pilot_id pilot id of flight (for virtual airlines) |
|
3548 | + * @param String $pilot_name pilot name of flight (for virtual airlines) |
|
3549 | + * @param String $verticalrate vertival rate of flight |
|
3550 | + * @return String success or false |
|
3551 | + */ |
|
3552 | 3552 | 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 = '') |
3553 | 3553 | { |
3554 | 3554 | global $globalURL, $globalIVAO, $globalVATSIM, $globalphpVMS, $globalDebugTimeElapsed, $globalAirlinesSource, $globalVAM; |
@@ -3763,8 +3763,8 @@ discard block |
||
3763 | 3763 | |
3764 | 3764 | if ($globalIVAO && $aircraft_icao != '') |
3765 | 3765 | { |
3766 | - if (isset($airline_array[0]['icao'])) $airline_icao = $airline_array[0]['icao']; |
|
3767 | - else $airline_icao = ''; |
|
3766 | + if (isset($airline_array[0]['icao'])) $airline_icao = $airline_array[0]['icao']; |
|
3767 | + else $airline_icao = ''; |
|
3768 | 3768 | $image_array = $Image->getSpotterImage('',$aircraft_icao,$airline_icao); |
3769 | 3769 | if (!isset($image_array[0]['registration'])) |
3770 | 3770 | { |
@@ -3795,53 +3795,53 @@ discard block |
||
3795 | 3795 | |
3796 | 3796 | if (count($airline_array) == 0) |
3797 | 3797 | { |
3798 | - $airline_array = $this->getAllAirlineInfo('NA'); |
|
3799 | - } |
|
3800 | - if (count($aircraft_array) == 0) |
|
3801 | - { |
|
3802 | - $aircraft_array = $this->getAllAircraftInfo('NA'); |
|
3803 | - } |
|
3804 | - if (count($departure_airport_array) == 0 || $departure_airport_array[0]['icao'] == '' || $departure_airport_icao == '') |
|
3805 | - { |
|
3806 | - $departure_airport_array = $this->getAllAirportInfo('NA'); |
|
3807 | - } |
|
3808 | - if (count($arrival_airport_array) == 0 || $arrival_airport_array[0]['icao'] == '' || $arrival_airport_icao == '') |
|
3809 | - { |
|
3810 | - $arrival_airport_array = $this->getAllAirportInfo('NA'); |
|
3811 | - } |
|
3812 | - if ($registration == '') $registration = 'NA'; |
|
3813 | - if ($latitude == '' && $longitude == '') { |
|
3814 | - $latitude = 0; |
|
3815 | - $longitude = 0; |
|
3816 | - } |
|
3817 | - if ($squawk == '' || $Common->isInteger($squawk) === false) $squawk = NULL; |
|
3818 | - if ($verticalrate == '' || $Common->isInteger($verticalrate) === false) $verticalrate = NULL; |
|
3819 | - if ($heading == '' || $Common->isInteger($heading) === false) $heading = 0; |
|
3820 | - if ($groundspeed == '' || $Common->isInteger($groundspeed) === false) $groundspeed = 0; |
|
3821 | - if (!isset($aircraft_owner)) $aircraft_owner = NULL; |
|
3822 | - $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) |
|
3798 | + $airline_array = $this->getAllAirlineInfo('NA'); |
|
3799 | + } |
|
3800 | + if (count($aircraft_array) == 0) |
|
3801 | + { |
|
3802 | + $aircraft_array = $this->getAllAircraftInfo('NA'); |
|
3803 | + } |
|
3804 | + if (count($departure_airport_array) == 0 || $departure_airport_array[0]['icao'] == '' || $departure_airport_icao == '') |
|
3805 | + { |
|
3806 | + $departure_airport_array = $this->getAllAirportInfo('NA'); |
|
3807 | + } |
|
3808 | + if (count($arrival_airport_array) == 0 || $arrival_airport_array[0]['icao'] == '' || $arrival_airport_icao == '') |
|
3809 | + { |
|
3810 | + $arrival_airport_array = $this->getAllAirportInfo('NA'); |
|
3811 | + } |
|
3812 | + if ($registration == '') $registration = 'NA'; |
|
3813 | + if ($latitude == '' && $longitude == '') { |
|
3814 | + $latitude = 0; |
|
3815 | + $longitude = 0; |
|
3816 | + } |
|
3817 | + if ($squawk == '' || $Common->isInteger($squawk) === false) $squawk = NULL; |
|
3818 | + if ($verticalrate == '' || $Common->isInteger($verticalrate) === false) $verticalrate = NULL; |
|
3819 | + if ($heading == '' || $Common->isInteger($heading) === false) $heading = 0; |
|
3820 | + if ($groundspeed == '' || $Common->isInteger($groundspeed) === false) $groundspeed = 0; |
|
3821 | + if (!isset($aircraft_owner)) $aircraft_owner = NULL; |
|
3822 | + $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) |
|
3823 | 3823 | 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)"; |
3824 | 3824 | |
3825 | - $airline_name = $airline_array[0]['name']; |
|
3826 | - $airline_icao = $airline_array[0]['icao']; |
|
3827 | - $airline_country = $airline_array[0]['country']; |
|
3828 | - $airline_type = $airline_array[0]['type']; |
|
3825 | + $airline_name = $airline_array[0]['name']; |
|
3826 | + $airline_icao = $airline_array[0]['icao']; |
|
3827 | + $airline_country = $airline_array[0]['country']; |
|
3828 | + $airline_type = $airline_array[0]['type']; |
|
3829 | 3829 | if ($airline_type == '') { |
3830 | 3830 | $timeelapsed = microtime(true); |
3831 | 3831 | $airline_type = $this->getAircraftTypeBymodeS($ModeS); |
3832 | 3832 | if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftTypeBymodes : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
3833 | 3833 | } |
3834 | 3834 | if ($airline_type == null) $airline_type = ''; |
3835 | - $aircraft_type = $aircraft_array[0]['type']; |
|
3836 | - $aircraft_manufacturer = $aircraft_array[0]['manufacturer']; |
|
3837 | - $departure_airport_name = $departure_airport_array[0]['name']; |
|
3838 | - $departure_airport_city = $departure_airport_array[0]['city']; |
|
3839 | - $departure_airport_country = $departure_airport_array[0]['country']; |
|
3835 | + $aircraft_type = $aircraft_array[0]['type']; |
|
3836 | + $aircraft_manufacturer = $aircraft_array[0]['manufacturer']; |
|
3837 | + $departure_airport_name = $departure_airport_array[0]['name']; |
|
3838 | + $departure_airport_city = $departure_airport_array[0]['city']; |
|
3839 | + $departure_airport_country = $departure_airport_array[0]['country']; |
|
3840 | 3840 | |
3841 | - $arrival_airport_name = $arrival_airport_array[0]['name']; |
|
3842 | - $arrival_airport_city = $arrival_airport_array[0]['city']; |
|
3843 | - $arrival_airport_country = $arrival_airport_array[0]['country']; |
|
3844 | - $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); |
|
3841 | + $arrival_airport_name = $arrival_airport_array[0]['name']; |
|
3842 | + $arrival_airport_city = $arrival_airport_array[0]['city']; |
|
3843 | + $arrival_airport_country = $arrival_airport_array[0]['country']; |
|
3844 | + $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); |
|
3845 | 3845 | |
3846 | 3846 | try { |
3847 | 3847 | |
@@ -3849,7 +3849,7 @@ discard block |
||
3849 | 3849 | $sth->execute($query_values); |
3850 | 3850 | $this->db = null; |
3851 | 3851 | } catch (PDOException $e) { |
3852 | - return "error : ".$e->getMessage(); |
|
3852 | + return "error : ".$e->getMessage(); |
|
3853 | 3853 | } |
3854 | 3854 | |
3855 | 3855 | return "success"; |
@@ -3858,11 +3858,11 @@ discard block |
||
3858 | 3858 | |
3859 | 3859 | |
3860 | 3860 | /** |
3861 | - * Gets the aircraft ident within the last hour |
|
3862 | - * |
|
3863 | - * @return String the ident |
|
3864 | - * |
|
3865 | - */ |
|
3861 | + * Gets the aircraft ident within the last hour |
|
3862 | + * |
|
3863 | + * @return String the ident |
|
3864 | + * |
|
3865 | + */ |
|
3866 | 3866 | public function getIdentFromLastHour($ident) |
3867 | 3867 | { |
3868 | 3868 | global $globalDBdriver, $globalTimezone; |
@@ -3878,11 +3878,11 @@ discard block |
||
3878 | 3878 | AND spotter_output.date >= now() AT TIME ZONE 'UTC' - INTERVAL '1 HOURS' |
3879 | 3879 | AND spotter_output.date < now() AT TIME ZONE 'UTC'"; |
3880 | 3880 | $query_data = array(':ident' => $ident); |
3881 | - } |
|
3881 | + } |
|
3882 | 3882 | |
3883 | 3883 | $sth = $this->db->prepare($query); |
3884 | 3884 | $sth->execute($query_data); |
3885 | - $ident_result=''; |
|
3885 | + $ident_result=''; |
|
3886 | 3886 | while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
3887 | 3887 | { |
3888 | 3888 | $ident_result = $row['ident']; |
@@ -3893,11 +3893,11 @@ discard block |
||
3893 | 3893 | |
3894 | 3894 | |
3895 | 3895 | /** |
3896 | - * Gets the aircraft data from the last 20 seconds |
|
3897 | - * |
|
3898 | - * @return Array the spotter data |
|
3899 | - * |
|
3900 | - */ |
|
3896 | + * Gets the aircraft data from the last 20 seconds |
|
3897 | + * |
|
3898 | + * @return Array the spotter data |
|
3899 | + * |
|
3900 | + */ |
|
3901 | 3901 | public function getRealTimeData($q = '') |
3902 | 3902 | { |
3903 | 3903 | global $globalDBdriver; |
@@ -3941,11 +3941,11 @@ discard block |
||
3941 | 3941 | |
3942 | 3942 | |
3943 | 3943 | /** |
3944 | - * Gets all airlines that have flown over |
|
3945 | - * |
|
3946 | - * @return Array the airline list |
|
3947 | - * |
|
3948 | - */ |
|
3944 | + * Gets all airlines that have flown over |
|
3945 | + * |
|
3946 | + * @return Array the airline list |
|
3947 | + * |
|
3948 | + */ |
|
3949 | 3949 | public function countAllAirlines($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array(), $year = '', $month = '', $day = '') |
3950 | 3950 | { |
3951 | 3951 | global $globalDBdriver; |
@@ -3959,7 +3959,7 @@ discard block |
||
3959 | 3959 | $query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
3960 | 3960 | } |
3961 | 3961 | } |
3962 | - if ($sincedate != '') { |
|
3962 | + if ($sincedate != '') { |
|
3963 | 3963 | if ($globalDBdriver == 'mysql') { |
3964 | 3964 | $query .= " AND spotter_output.date > '".$sincedate."'"; |
3965 | 3965 | } else { |
@@ -4013,26 +4013,26 @@ discard block |
||
4013 | 4013 | } |
4014 | 4014 | |
4015 | 4015 | /** |
4016 | - * Gets all pilots that have flown over |
|
4017 | - * |
|
4018 | - * @return Array the pilots list |
|
4019 | - * |
|
4020 | - */ |
|
4016 | + * Gets all pilots that have flown over |
|
4017 | + * |
|
4018 | + * @return Array the pilots list |
|
4019 | + * |
|
4020 | + */ |
|
4021 | 4021 | public function countAllPilots($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array(),$year = '', $month = '',$day = '') |
4022 | 4022 | { |
4023 | 4023 | global $globalDBdriver; |
4024 | 4024 | $filter_query = $this->getFilter($filters,true,true); |
4025 | 4025 | $query = "SELECT DISTINCT spotter_output.pilot_id, spotter_output.pilot_name, COUNT(spotter_output.pilot_id) AS pilot_count, spotter_output.format_source |
4026 | 4026 | FROM spotter_output".$filter_query." spotter_output.pilot_id <> '' "; |
4027 | - if ($olderthanmonths > 0) { |
|
4028 | - if ($globalDBdriver == 'mysql') { |
|
4027 | + if ($olderthanmonths > 0) { |
|
4028 | + if ($globalDBdriver == 'mysql') { |
|
4029 | 4029 | $query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) '; |
4030 | 4030 | } else { |
4031 | 4031 | $query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
4032 | 4032 | } |
4033 | 4033 | } |
4034 | - if ($sincedate != '') { |
|
4035 | - if ($globalDBdriver == 'mysql') { |
|
4034 | + if ($sincedate != '') { |
|
4035 | + if ($globalDBdriver == 'mysql') { |
|
4036 | 4036 | $query .= "AND spotter_output.date > '".$sincedate."' "; |
4037 | 4037 | } else { |
4038 | 4038 | $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -4087,25 +4087,25 @@ discard block |
||
4087 | 4087 | } |
4088 | 4088 | |
4089 | 4089 | /** |
4090 | - * Gets all pilots that have flown over |
|
4091 | - * |
|
4092 | - * @return Array the pilots list |
|
4093 | - * |
|
4094 | - */ |
|
4090 | + * Gets all pilots that have flown over |
|
4091 | + * |
|
4092 | + * @return Array the pilots list |
|
4093 | + * |
|
4094 | + */ |
|
4095 | 4095 | public function countAllPilotsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '') |
4096 | 4096 | { |
4097 | 4097 | global $globalDBdriver; |
4098 | 4098 | $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 |
4099 | 4099 | FROM spotter_output WHERE spotter_output.pilot_id <> '' "; |
4100 | - if ($olderthanmonths > 0) { |
|
4101 | - if ($globalDBdriver == 'mysql') { |
|
4100 | + if ($olderthanmonths > 0) { |
|
4101 | + if ($globalDBdriver == 'mysql') { |
|
4102 | 4102 | $query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) '; |
4103 | 4103 | } else { |
4104 | 4104 | $query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
4105 | 4105 | } |
4106 | 4106 | } |
4107 | - if ($sincedate != '') { |
|
4108 | - if ($globalDBdriver == 'mysql') { |
|
4107 | + if ($sincedate != '') { |
|
4108 | + if ($globalDBdriver == 'mysql') { |
|
4109 | 4109 | $query .= "AND spotter_output.date > '".$sincedate."' "; |
4110 | 4110 | } else { |
4111 | 4111 | $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -4134,26 +4134,26 @@ discard block |
||
4134 | 4134 | } |
4135 | 4135 | |
4136 | 4136 | /** |
4137 | - * Gets all owner that have flown over |
|
4138 | - * |
|
4139 | - * @return Array the pilots list |
|
4140 | - * |
|
4141 | - */ |
|
4137 | + * Gets all owner that have flown over |
|
4138 | + * |
|
4139 | + * @return Array the pilots list |
|
4140 | + * |
|
4141 | + */ |
|
4142 | 4142 | public function countAllOwners($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array(),$year = '',$month = '',$day = '') |
4143 | 4143 | { |
4144 | 4144 | global $globalDBdriver; |
4145 | 4145 | $filter_query = $this->getFilter($filters,true,true); |
4146 | 4146 | $query = "SELECT DISTINCT spotter_output.owner_name, COUNT(spotter_output.owner_name) AS owner_count |
4147 | 4147 | FROM spotter_output".$filter_query." spotter_output.owner_name <> '' AND spotter_output.owner_name IS NOT NULL"; |
4148 | - if ($olderthanmonths > 0) { |
|
4149 | - if ($globalDBdriver == 'mysql') { |
|
4148 | + if ($olderthanmonths > 0) { |
|
4149 | + if ($globalDBdriver == 'mysql') { |
|
4150 | 4150 | $query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)'; |
4151 | 4151 | } else { |
4152 | 4152 | $query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
4153 | 4153 | } |
4154 | 4154 | } |
4155 | - if ($sincedate != '') { |
|
4156 | - if ($globalDBdriver == 'mysql') { |
|
4155 | + if ($sincedate != '') { |
|
4156 | + if ($globalDBdriver == 'mysql') { |
|
4157 | 4157 | $query .= "AND spotter_output.date > '".$sincedate."' "; |
4158 | 4158 | } else { |
4159 | 4159 | $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -4204,26 +4204,26 @@ discard block |
||
4204 | 4204 | } |
4205 | 4205 | |
4206 | 4206 | /** |
4207 | - * Gets all owner that have flown over |
|
4208 | - * |
|
4209 | - * @return Array the pilots list |
|
4210 | - * |
|
4211 | - */ |
|
4207 | + * Gets all owner that have flown over |
|
4208 | + * |
|
4209 | + * @return Array the pilots list |
|
4210 | + * |
|
4211 | + */ |
|
4212 | 4212 | public function countAllOwnersByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array()) |
4213 | 4213 | { |
4214 | 4214 | global $globalDBdriver; |
4215 | 4215 | $filter_query = $this->getFilter($filters,true,true); |
4216 | 4216 | $query = "SELECT DISTINCT spotter_output.airline_icao, spotter_output.owner_name, COUNT(spotter_output.owner_name) AS owner_count |
4217 | 4217 | FROM spotter_output".$filter_query." spotter_output.owner_name <> '' AND spotter_output.owner_name IS NOT NULL "; |
4218 | - if ($olderthanmonths > 0) { |
|
4219 | - if ($globalDBdriver == 'mysql') { |
|
4218 | + if ($olderthanmonths > 0) { |
|
4219 | + if ($globalDBdriver == 'mysql') { |
|
4220 | 4220 | $query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) '; |
4221 | 4221 | } else { |
4222 | 4222 | $query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
4223 | 4223 | } |
4224 | 4224 | } |
4225 | - if ($sincedate != '') { |
|
4226 | - if ($globalDBdriver == 'mysql') { |
|
4225 | + if ($sincedate != '') { |
|
4226 | + if ($globalDBdriver == 'mysql') { |
|
4227 | 4227 | $query .= "AND spotter_output.date > '".$sincedate."' "; |
4228 | 4228 | } else { |
4229 | 4229 | $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -4250,11 +4250,11 @@ discard block |
||
4250 | 4250 | } |
4251 | 4251 | |
4252 | 4252 | /** |
4253 | - * Gets all airlines that have flown over by aircraft |
|
4254 | - * |
|
4255 | - * @return Array the airline list |
|
4256 | - * |
|
4257 | - */ |
|
4253 | + * Gets all airlines that have flown over by aircraft |
|
4254 | + * |
|
4255 | + * @return Array the airline list |
|
4256 | + * |
|
4257 | + */ |
|
4258 | 4258 | public function countAllAirlinesByAircraft($aircraft_icao,$filters = array()) |
4259 | 4259 | { |
4260 | 4260 | $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
@@ -4286,11 +4286,11 @@ discard block |
||
4286 | 4286 | |
4287 | 4287 | |
4288 | 4288 | /** |
4289 | - * Gets all airline countries that have flown over by aircraft |
|
4290 | - * |
|
4291 | - * @return Array the airline country list |
|
4292 | - * |
|
4293 | - */ |
|
4289 | + * Gets all airline countries that have flown over by aircraft |
|
4290 | + * |
|
4291 | + * @return Array the airline country list |
|
4292 | + * |
|
4293 | + */ |
|
4294 | 4294 | public function countAllAirlineCountriesByAircraft($aircraft_icao,$filters = array()) |
4295 | 4295 | { |
4296 | 4296 | $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
@@ -4322,11 +4322,11 @@ discard block |
||
4322 | 4322 | |
4323 | 4323 | |
4324 | 4324 | /** |
4325 | - * Gets all airlines that have flown over by airport |
|
4326 | - * |
|
4327 | - * @return Array the airline list |
|
4328 | - * |
|
4329 | - */ |
|
4325 | + * Gets all airlines that have flown over by airport |
|
4326 | + * |
|
4327 | + * @return Array the airline list |
|
4328 | + * |
|
4329 | + */ |
|
4330 | 4330 | public function countAllAirlinesByAirport($airport_icao,$filters = array()) |
4331 | 4331 | { |
4332 | 4332 | $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
@@ -4357,11 +4357,11 @@ discard block |
||
4357 | 4357 | |
4358 | 4358 | |
4359 | 4359 | /** |
4360 | - * Gets all airline countries that have flown over by airport icao |
|
4361 | - * |
|
4362 | - * @return Array the airline country list |
|
4363 | - * |
|
4364 | - */ |
|
4360 | + * Gets all airline countries that have flown over by airport icao |
|
4361 | + * |
|
4362 | + * @return Array the airline country list |
|
4363 | + * |
|
4364 | + */ |
|
4365 | 4365 | public function countAllAirlineCountriesByAirport($airport_icao,$filters = array()) |
4366 | 4366 | { |
4367 | 4367 | $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
@@ -4391,11 +4391,11 @@ discard block |
||
4391 | 4391 | |
4392 | 4392 | |
4393 | 4393 | /** |
4394 | - * Gets all airlines that have flown over by aircraft manufacturer |
|
4395 | - * |
|
4396 | - * @return Array the airline list |
|
4397 | - * |
|
4398 | - */ |
|
4394 | + * Gets all airlines that have flown over by aircraft manufacturer |
|
4395 | + * |
|
4396 | + * @return Array the airline list |
|
4397 | + * |
|
4398 | + */ |
|
4399 | 4399 | public function countAllAirlinesByManufacturer($aircraft_manufacturer,$filters = array()) |
4400 | 4400 | { |
4401 | 4401 | $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
@@ -4426,11 +4426,11 @@ discard block |
||
4426 | 4426 | |
4427 | 4427 | |
4428 | 4428 | /** |
4429 | - * Gets all airline countries that have flown over by aircraft manufacturer |
|
4430 | - * |
|
4431 | - * @return Array the airline country list |
|
4432 | - * |
|
4433 | - */ |
|
4429 | + * Gets all airline countries that have flown over by aircraft manufacturer |
|
4430 | + * |
|
4431 | + * @return Array the airline country list |
|
4432 | + * |
|
4433 | + */ |
|
4434 | 4434 | public function countAllAirlineCountriesByManufacturer($aircraft_manufacturer,$filters = array()) |
4435 | 4435 | { |
4436 | 4436 | $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
@@ -4459,11 +4459,11 @@ discard block |
||
4459 | 4459 | |
4460 | 4460 | |
4461 | 4461 | /** |
4462 | - * Gets all airlines that have flown over by date |
|
4463 | - * |
|
4464 | - * @return Array the airline list |
|
4465 | - * |
|
4466 | - */ |
|
4462 | + * Gets all airlines that have flown over by date |
|
4463 | + * |
|
4464 | + * @return Array the airline list |
|
4465 | + * |
|
4466 | + */ |
|
4467 | 4467 | public function countAllAirlinesByDate($date,$filters = array()) |
4468 | 4468 | { |
4469 | 4469 | global $globalTimezone, $globalDBdriver; |
@@ -4507,11 +4507,11 @@ discard block |
||
4507 | 4507 | |
4508 | 4508 | |
4509 | 4509 | /** |
4510 | - * Gets all airline countries that have flown over by date |
|
4511 | - * |
|
4512 | - * @return Array the airline country list |
|
4513 | - * |
|
4514 | - */ |
|
4510 | + * Gets all airline countries that have flown over by date |
|
4511 | + * |
|
4512 | + * @return Array the airline country list |
|
4513 | + * |
|
4514 | + */ |
|
4515 | 4515 | public function countAllAirlineCountriesByDate($date,$filters = array()) |
4516 | 4516 | { |
4517 | 4517 | global $globalTimezone, $globalDBdriver; |
@@ -4554,11 +4554,11 @@ discard block |
||
4554 | 4554 | |
4555 | 4555 | |
4556 | 4556 | /** |
4557 | - * Gets all airlines that have flown over by ident/callsign |
|
4558 | - * |
|
4559 | - * @return Array the airline list |
|
4560 | - * |
|
4561 | - */ |
|
4557 | + * Gets all airlines that have flown over by ident/callsign |
|
4558 | + * |
|
4559 | + * @return Array the airline list |
|
4560 | + * |
|
4561 | + */ |
|
4562 | 4562 | public function countAllAirlinesByIdent($ident,$filters = array()) |
4563 | 4563 | { |
4564 | 4564 | $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
@@ -4575,11 +4575,11 @@ discard block |
||
4575 | 4575 | } |
4576 | 4576 | |
4577 | 4577 | /** |
4578 | - * Gets all airlines by owner |
|
4579 | - * |
|
4580 | - * @return Array the airline list |
|
4581 | - * |
|
4582 | - */ |
|
4578 | + * Gets all airlines by owner |
|
4579 | + * |
|
4580 | + * @return Array the airline list |
|
4581 | + * |
|
4582 | + */ |
|
4583 | 4583 | public function countAllAirlinesByOwner($owner,$filters = array()) |
4584 | 4584 | { |
4585 | 4585 | $owner = filter_var($owner,FILTER_SANITIZE_STRING); |
@@ -4596,11 +4596,11 @@ discard block |
||
4596 | 4596 | } |
4597 | 4597 | |
4598 | 4598 | /** |
4599 | - * Gets all airlines used by pilot |
|
4600 | - * |
|
4601 | - * @return Array the airline list |
|
4602 | - * |
|
4603 | - */ |
|
4599 | + * Gets all airlines used by pilot |
|
4600 | + * |
|
4601 | + * @return Array the airline list |
|
4602 | + * |
|
4603 | + */ |
|
4604 | 4604 | public function countAllAirlinesByPilot($pilot,$filters = array()) |
4605 | 4605 | { |
4606 | 4606 | $pilot = filter_var($pilot,FILTER_SANITIZE_STRING); |
@@ -4617,11 +4617,11 @@ discard block |
||
4617 | 4617 | } |
4618 | 4618 | |
4619 | 4619 | /** |
4620 | - * Gets all airlines that have flown over by route |
|
4621 | - * |
|
4622 | - * @return Array the airline list |
|
4623 | - * |
|
4624 | - */ |
|
4620 | + * Gets all airlines that have flown over by route |
|
4621 | + * |
|
4622 | + * @return Array the airline list |
|
4623 | + * |
|
4624 | + */ |
|
4625 | 4625 | public function countAllAirlinesByRoute($departure_airport_icao, $arrival_airport_icao,$filters = array()) |
4626 | 4626 | { |
4627 | 4627 | $filter_query = $this->getFilter($filters,true,true); |
@@ -4653,11 +4653,11 @@ discard block |
||
4653 | 4653 | } |
4654 | 4654 | |
4655 | 4655 | /** |
4656 | - * Gets all airline countries that have flown over by route |
|
4657 | - * |
|
4658 | - * @return Array the airline country list |
|
4659 | - * |
|
4660 | - */ |
|
4656 | + * Gets all airline countries that have flown over by route |
|
4657 | + * |
|
4658 | + * @return Array the airline country list |
|
4659 | + * |
|
4660 | + */ |
|
4661 | 4661 | public function countAllAirlineCountriesByRoute($departure_airport_icao, $arrival_airport_icao,$filters= array()) |
4662 | 4662 | { |
4663 | 4663 | $filter_query = $this->getFilter($filters,true,true); |
@@ -4689,11 +4689,11 @@ discard block |
||
4689 | 4689 | |
4690 | 4690 | |
4691 | 4691 | /** |
4692 | - * Gets all airlines that have flown over by country |
|
4693 | - * |
|
4694 | - * @return Array the airline list |
|
4695 | - * |
|
4696 | - */ |
|
4692 | + * Gets all airlines that have flown over by country |
|
4693 | + * |
|
4694 | + * @return Array the airline list |
|
4695 | + * |
|
4696 | + */ |
|
4697 | 4697 | public function countAllAirlinesByCountry($country,$filters = array()) |
4698 | 4698 | { |
4699 | 4699 | $country = filter_var($country,FILTER_SANITIZE_STRING); |
@@ -4723,11 +4723,11 @@ discard block |
||
4723 | 4723 | |
4724 | 4724 | |
4725 | 4725 | /** |
4726 | - * Gets all airline countries that have flown over by country |
|
4727 | - * |
|
4728 | - * @return Array the airline country list |
|
4729 | - * |
|
4730 | - */ |
|
4726 | + * Gets all airline countries that have flown over by country |
|
4727 | + * |
|
4728 | + * @return Array the airline country list |
|
4729 | + * |
|
4730 | + */ |
|
4731 | 4731 | public function countAllAirlineCountriesByCountry($country,$filters = array()) |
4732 | 4732 | { |
4733 | 4733 | $filter_query = $this->getFilter($filters,true,true); |
@@ -4756,11 +4756,11 @@ discard block |
||
4756 | 4756 | |
4757 | 4757 | |
4758 | 4758 | /** |
4759 | - * Gets all airlines countries |
|
4760 | - * |
|
4761 | - * @return Array the airline country list |
|
4762 | - * |
|
4763 | - */ |
|
4759 | + * Gets all airlines countries |
|
4760 | + * |
|
4761 | + * @return Array the airline country list |
|
4762 | + * |
|
4763 | + */ |
|
4764 | 4764 | public function countAllAirlineCountries($limit = true, $filters = array(), $year = '', $month = '', $day = '') |
4765 | 4765 | { |
4766 | 4766 | global $globalDBdriver; |
@@ -4815,11 +4815,11 @@ discard block |
||
4815 | 4815 | } |
4816 | 4816 | |
4817 | 4817 | /** |
4818 | - * Gets all number of flight over countries |
|
4819 | - * |
|
4820 | - * @return Array the airline country list |
|
4821 | - * |
|
4822 | - */ |
|
4818 | + * Gets all number of flight over countries |
|
4819 | + * |
|
4820 | + * @return Array the airline country list |
|
4821 | + * |
|
4822 | + */ |
|
4823 | 4823 | public function countAllFlightOverCountries($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array()) |
4824 | 4824 | { |
4825 | 4825 | global $globalDBdriver; |
@@ -4841,15 +4841,15 @@ discard block |
||
4841 | 4841 | $SpotterLive = new SpotterLive(); |
4842 | 4842 | $filter_query = $SpotterLive->getFilter($filters,true,true); |
4843 | 4843 | $filter_query .= ' over_country IS NOT NULL'; |
4844 | - if ($olderthanmonths > 0) { |
|
4844 | + if ($olderthanmonths > 0) { |
|
4845 | 4845 | if ($globalDBdriver == 'mysql') { |
4846 | 4846 | $filter_query .= ' AND spotter_live.date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
4847 | 4847 | } else { |
4848 | 4848 | $filter_query .= " AND spotter_live.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
4849 | 4849 | } |
4850 | 4850 | } |
4851 | - if ($sincedate != '') { |
|
4852 | - if ($globalDBdriver == 'mysql') { |
|
4851 | + if ($sincedate != '') { |
|
4852 | + if ($globalDBdriver == 'mysql') { |
|
4853 | 4853 | $filter_query .= " AND spotter_live.date > '".$sincedate."' "; |
4854 | 4854 | } else { |
4855 | 4855 | $filter_query .= " AND spotter_live.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -4879,11 +4879,11 @@ discard block |
||
4879 | 4879 | |
4880 | 4880 | |
4881 | 4881 | /** |
4882 | - * Gets all aircraft types that have flown over |
|
4883 | - * |
|
4884 | - * @return Array the aircraft list |
|
4885 | - * |
|
4886 | - */ |
|
4882 | + * Gets all aircraft types that have flown over |
|
4883 | + * |
|
4884 | + * @return Array the aircraft list |
|
4885 | + * |
|
4886 | + */ |
|
4887 | 4887 | public function countAllAircraftTypes($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array(),$year = '',$month = '',$day = '') |
4888 | 4888 | { |
4889 | 4889 | global $globalDBdriver; |
@@ -4953,11 +4953,11 @@ discard block |
||
4953 | 4953 | } |
4954 | 4954 | |
4955 | 4955 | /** |
4956 | - * Gets all aircraft types that have flown over by airline |
|
4957 | - * |
|
4958 | - * @return Array the aircraft list |
|
4959 | - * |
|
4960 | - */ |
|
4956 | + * Gets all aircraft types that have flown over by airline |
|
4957 | + * |
|
4958 | + * @return Array the aircraft list |
|
4959 | + * |
|
4960 | + */ |
|
4961 | 4961 | public function countAllAircraftTypesByAirlines($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array(),$year = '',$month = '', $day = '') |
4962 | 4962 | { |
4963 | 4963 | global $globalDBdriver; |
@@ -5028,11 +5028,11 @@ discard block |
||
5028 | 5028 | } |
5029 | 5029 | |
5030 | 5030 | /** |
5031 | - * Gets all aircraft types that have flown over by months |
|
5032 | - * |
|
5033 | - * @return Array the aircraft list |
|
5034 | - * |
|
5035 | - */ |
|
5031 | + * Gets all aircraft types that have flown over by months |
|
5032 | + * |
|
5033 | + * @return Array the aircraft list |
|
5034 | + * |
|
5035 | + */ |
|
5036 | 5036 | public function countAllAircraftTypesByMonths($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array()) |
5037 | 5037 | { |
5038 | 5038 | global $globalDBdriver; |
@@ -5076,11 +5076,11 @@ discard block |
||
5076 | 5076 | |
5077 | 5077 | |
5078 | 5078 | /** |
5079 | - * Gets all aircraft registration that have flown over by aircaft icao |
|
5080 | - * |
|
5081 | - * @return Array the aircraft list |
|
5082 | - * |
|
5083 | - */ |
|
5079 | + * Gets all aircraft registration that have flown over by aircaft icao |
|
5080 | + * |
|
5081 | + * @return Array the aircraft list |
|
5082 | + * |
|
5083 | + */ |
|
5084 | 5084 | public function countAllAircraftRegistrationByAircraft($aircraft_icao,$filters = array()) |
5085 | 5085 | { |
5086 | 5086 | $Image = new Image($this->db); |
@@ -5119,11 +5119,11 @@ discard block |
||
5119 | 5119 | |
5120 | 5120 | |
5121 | 5121 | /** |
5122 | - * Gets all aircraft types that have flown over by airline icao |
|
5123 | - * |
|
5124 | - * @return Array the aircraft list |
|
5125 | - * |
|
5126 | - */ |
|
5122 | + * Gets all aircraft types that have flown over by airline icao |
|
5123 | + * |
|
5124 | + * @return Array the aircraft list |
|
5125 | + * |
|
5126 | + */ |
|
5127 | 5127 | public function countAllAircraftTypesByAirline($airline_icao,$filters = array()) |
5128 | 5128 | { |
5129 | 5129 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5152,11 +5152,11 @@ discard block |
||
5152 | 5152 | |
5153 | 5153 | |
5154 | 5154 | /** |
5155 | - * Gets all aircraft registration that have flown over by airline icao |
|
5156 | - * |
|
5157 | - * @return Array the aircraft list |
|
5158 | - * |
|
5159 | - */ |
|
5155 | + * Gets all aircraft registration that have flown over by airline icao |
|
5156 | + * |
|
5157 | + * @return Array the aircraft list |
|
5158 | + * |
|
5159 | + */ |
|
5160 | 5160 | public function countAllAircraftRegistrationByAirline($airline_icao,$filters = array()) |
5161 | 5161 | { |
5162 | 5162 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5194,11 +5194,11 @@ discard block |
||
5194 | 5194 | |
5195 | 5195 | |
5196 | 5196 | /** |
5197 | - * Gets all aircraft manufacturer that have flown over by airline icao |
|
5198 | - * |
|
5199 | - * @return Array the aircraft list |
|
5200 | - * |
|
5201 | - */ |
|
5197 | + * Gets all aircraft manufacturer that have flown over by airline icao |
|
5198 | + * |
|
5199 | + * @return Array the aircraft list |
|
5200 | + * |
|
5201 | + */ |
|
5202 | 5202 | public function countAllAircraftManufacturerByAirline($airline_icao,$filters = array()) |
5203 | 5203 | { |
5204 | 5204 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5226,11 +5226,11 @@ discard block |
||
5226 | 5226 | |
5227 | 5227 | |
5228 | 5228 | /** |
5229 | - * Gets all aircraft types that have flown over by airline icao |
|
5230 | - * |
|
5231 | - * @return Array the aircraft list |
|
5232 | - * |
|
5233 | - */ |
|
5229 | + * Gets all aircraft types that have flown over by airline icao |
|
5230 | + * |
|
5231 | + * @return Array the aircraft list |
|
5232 | + * |
|
5233 | + */ |
|
5234 | 5234 | public function countAllAircraftTypesByAirport($airport_icao,$filters = array()) |
5235 | 5235 | { |
5236 | 5236 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5259,11 +5259,11 @@ discard block |
||
5259 | 5259 | |
5260 | 5260 | |
5261 | 5261 | /** |
5262 | - * Gets all aircraft registration that have flown over by airport icao |
|
5263 | - * |
|
5264 | - * @return Array the aircraft list |
|
5265 | - * |
|
5266 | - */ |
|
5262 | + * Gets all aircraft registration that have flown over by airport icao |
|
5263 | + * |
|
5264 | + * @return Array the aircraft list |
|
5265 | + * |
|
5266 | + */ |
|
5267 | 5267 | public function countAllAircraftRegistrationByAirport($airport_icao,$filters = array()) |
5268 | 5268 | { |
5269 | 5269 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5300,11 +5300,11 @@ discard block |
||
5300 | 5300 | |
5301 | 5301 | |
5302 | 5302 | /** |
5303 | - * Gets all aircraft manufacturer that have flown over by airport icao |
|
5304 | - * |
|
5305 | - * @return Array the aircraft list |
|
5306 | - * |
|
5307 | - */ |
|
5303 | + * Gets all aircraft manufacturer that have flown over by airport icao |
|
5304 | + * |
|
5305 | + * @return Array the aircraft list |
|
5306 | + * |
|
5307 | + */ |
|
5308 | 5308 | public function countAllAircraftManufacturerByAirport($airport_icao,$filters = array()) |
5309 | 5309 | { |
5310 | 5310 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5330,11 +5330,11 @@ discard block |
||
5330 | 5330 | } |
5331 | 5331 | |
5332 | 5332 | /** |
5333 | - * Gets all aircraft types that have flown over by aircraft manufacturer |
|
5334 | - * |
|
5335 | - * @return Array the aircraft list |
|
5336 | - * |
|
5337 | - */ |
|
5333 | + * Gets all aircraft types that have flown over by aircraft manufacturer |
|
5334 | + * |
|
5335 | + * @return Array the aircraft list |
|
5336 | + * |
|
5337 | + */ |
|
5338 | 5338 | public function countAllAircraftTypesByManufacturer($aircraft_manufacturer,$filters = array()) |
5339 | 5339 | { |
5340 | 5340 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5361,11 +5361,11 @@ discard block |
||
5361 | 5361 | |
5362 | 5362 | |
5363 | 5363 | /** |
5364 | - * Gets all aircraft registration that have flown over by aircaft manufacturer |
|
5365 | - * |
|
5366 | - * @return Array the aircraft list |
|
5367 | - * |
|
5368 | - */ |
|
5364 | + * Gets all aircraft registration that have flown over by aircaft manufacturer |
|
5365 | + * |
|
5366 | + * @return Array the aircraft list |
|
5367 | + * |
|
5368 | + */ |
|
5369 | 5369 | public function countAllAircraftRegistrationByManufacturer($aircraft_manufacturer, $filters = array()) |
5370 | 5370 | { |
5371 | 5371 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5401,11 +5401,11 @@ discard block |
||
5401 | 5401 | } |
5402 | 5402 | |
5403 | 5403 | /** |
5404 | - * Gets all aircraft types that have flown over by date |
|
5405 | - * |
|
5406 | - * @return Array the aircraft list |
|
5407 | - * |
|
5408 | - */ |
|
5404 | + * Gets all aircraft types that have flown over by date |
|
5405 | + * |
|
5406 | + * @return Array the aircraft list |
|
5407 | + * |
|
5408 | + */ |
|
5409 | 5409 | public function countAllAircraftTypesByDate($date,$filters = array()) |
5410 | 5410 | { |
5411 | 5411 | global $globalTimezone, $globalDBdriver; |
@@ -5447,11 +5447,11 @@ discard block |
||
5447 | 5447 | |
5448 | 5448 | |
5449 | 5449 | /** |
5450 | - * Gets all aircraft registration that have flown over by date |
|
5451 | - * |
|
5452 | - * @return Array the aircraft list |
|
5453 | - * |
|
5454 | - */ |
|
5450 | + * Gets all aircraft registration that have flown over by date |
|
5451 | + * |
|
5452 | + * @return Array the aircraft list |
|
5453 | + * |
|
5454 | + */ |
|
5455 | 5455 | public function countAllAircraftRegistrationByDate($date,$filters = array()) |
5456 | 5456 | { |
5457 | 5457 | global $globalTimezone, $globalDBdriver; |
@@ -5502,11 +5502,11 @@ discard block |
||
5502 | 5502 | |
5503 | 5503 | |
5504 | 5504 | /** |
5505 | - * Gets all aircraft manufacturer that have flown over by date |
|
5506 | - * |
|
5507 | - * @return Array the aircraft manufacturer list |
|
5508 | - * |
|
5509 | - */ |
|
5505 | + * Gets all aircraft manufacturer that have flown over by date |
|
5506 | + * |
|
5507 | + * @return Array the aircraft manufacturer list |
|
5508 | + * |
|
5509 | + */ |
|
5510 | 5510 | public function countAllAircraftManufacturerByDate($date,$filters = array()) |
5511 | 5511 | { |
5512 | 5512 | global $globalTimezone, $globalDBdriver; |
@@ -5548,11 +5548,11 @@ discard block |
||
5548 | 5548 | |
5549 | 5549 | |
5550 | 5550 | /** |
5551 | - * Gets all aircraft types that have flown over by ident/callsign |
|
5552 | - * |
|
5553 | - * @return Array the aircraft list |
|
5554 | - * |
|
5555 | - */ |
|
5551 | + * Gets all aircraft types that have flown over by ident/callsign |
|
5552 | + * |
|
5553 | + * @return Array the aircraft list |
|
5554 | + * |
|
5555 | + */ |
|
5556 | 5556 | public function countAllAircraftTypesByIdent($ident,$filters = array()) |
5557 | 5557 | { |
5558 | 5558 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5580,11 +5580,11 @@ discard block |
||
5580 | 5580 | } |
5581 | 5581 | |
5582 | 5582 | /** |
5583 | - * Gets all aircraft types that have flown over by pilot |
|
5584 | - * |
|
5585 | - * @return Array the aircraft list |
|
5586 | - * |
|
5587 | - */ |
|
5583 | + * Gets all aircraft types that have flown over by pilot |
|
5584 | + * |
|
5585 | + * @return Array the aircraft list |
|
5586 | + * |
|
5587 | + */ |
|
5588 | 5588 | public function countAllAircraftTypesByPilot($pilot,$filters = array()) |
5589 | 5589 | { |
5590 | 5590 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5600,11 +5600,11 @@ discard block |
||
5600 | 5600 | } |
5601 | 5601 | |
5602 | 5602 | /** |
5603 | - * Gets all aircraft types that have flown over by owner |
|
5604 | - * |
|
5605 | - * @return Array the aircraft list |
|
5606 | - * |
|
5607 | - */ |
|
5603 | + * Gets all aircraft types that have flown over by owner |
|
5604 | + * |
|
5605 | + * @return Array the aircraft list |
|
5606 | + * |
|
5607 | + */ |
|
5608 | 5608 | public function countAllAircraftTypesByOwner($owner,$filters = array()) |
5609 | 5609 | { |
5610 | 5610 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5621,11 +5621,11 @@ discard block |
||
5621 | 5621 | |
5622 | 5622 | |
5623 | 5623 | /** |
5624 | - * Gets all aircraft registration that have flown over by ident/callsign |
|
5625 | - * |
|
5626 | - * @return Array the aircraft list |
|
5627 | - * |
|
5628 | - */ |
|
5624 | + * Gets all aircraft registration that have flown over by ident/callsign |
|
5625 | + * |
|
5626 | + * @return Array the aircraft list |
|
5627 | + * |
|
5628 | + */ |
|
5629 | 5629 | public function countAllAircraftRegistrationByIdent($ident,$filters = array()) |
5630 | 5630 | { |
5631 | 5631 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5664,11 +5664,11 @@ discard block |
||
5664 | 5664 | } |
5665 | 5665 | |
5666 | 5666 | /** |
5667 | - * Gets all aircraft registration that have flown over by owner |
|
5668 | - * |
|
5669 | - * @return Array the aircraft list |
|
5670 | - * |
|
5671 | - */ |
|
5667 | + * Gets all aircraft registration that have flown over by owner |
|
5668 | + * |
|
5669 | + * @return Array the aircraft list |
|
5670 | + * |
|
5671 | + */ |
|
5672 | 5672 | public function countAllAircraftRegistrationByOwner($owner,$filters = array()) |
5673 | 5673 | { |
5674 | 5674 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5708,11 +5708,11 @@ discard block |
||
5708 | 5708 | } |
5709 | 5709 | |
5710 | 5710 | /** |
5711 | - * Gets all aircraft registration that have flown over by pilot |
|
5712 | - * |
|
5713 | - * @return Array the aircraft list |
|
5714 | - * |
|
5715 | - */ |
|
5711 | + * Gets all aircraft registration that have flown over by pilot |
|
5712 | + * |
|
5713 | + * @return Array the aircraft list |
|
5714 | + * |
|
5715 | + */ |
|
5716 | 5716 | public function countAllAircraftRegistrationByPilot($pilot,$filters = array()) |
5717 | 5717 | { |
5718 | 5718 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5753,11 +5753,11 @@ discard block |
||
5753 | 5753 | |
5754 | 5754 | |
5755 | 5755 | /** |
5756 | - * Gets all aircraft manufacturer that have flown over by ident/callsign |
|
5757 | - * |
|
5758 | - * @return Array the aircraft manufacturer list |
|
5759 | - * |
|
5760 | - */ |
|
5756 | + * Gets all aircraft manufacturer that have flown over by ident/callsign |
|
5757 | + * |
|
5758 | + * @return Array the aircraft manufacturer list |
|
5759 | + * |
|
5760 | + */ |
|
5761 | 5761 | public function countAllAircraftManufacturerByIdent($ident,$filters = array()) |
5762 | 5762 | { |
5763 | 5763 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5782,11 +5782,11 @@ discard block |
||
5782 | 5782 | } |
5783 | 5783 | |
5784 | 5784 | /** |
5785 | - * Gets all aircraft manufacturer that have flown over by owner |
|
5786 | - * |
|
5787 | - * @return Array the aircraft manufacturer list |
|
5788 | - * |
|
5789 | - */ |
|
5785 | + * Gets all aircraft manufacturer that have flown over by owner |
|
5786 | + * |
|
5787 | + * @return Array the aircraft manufacturer list |
|
5788 | + * |
|
5789 | + */ |
|
5790 | 5790 | public function countAllAircraftManufacturerByOwner($owner,$filters = array()) |
5791 | 5791 | { |
5792 | 5792 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5803,11 +5803,11 @@ discard block |
||
5803 | 5803 | } |
5804 | 5804 | |
5805 | 5805 | /** |
5806 | - * Gets all aircraft manufacturer that have flown over by pilot |
|
5807 | - * |
|
5808 | - * @return Array the aircraft manufacturer list |
|
5809 | - * |
|
5810 | - */ |
|
5806 | + * Gets all aircraft manufacturer that have flown over by pilot |
|
5807 | + * |
|
5808 | + * @return Array the aircraft manufacturer list |
|
5809 | + * |
|
5810 | + */ |
|
5811 | 5811 | public function countAllAircraftManufacturerByPilot($pilot,$filters = array()) |
5812 | 5812 | { |
5813 | 5813 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5825,11 +5825,11 @@ discard block |
||
5825 | 5825 | |
5826 | 5826 | |
5827 | 5827 | /** |
5828 | - * Gets all aircraft types that have flown over by route |
|
5829 | - * |
|
5830 | - * @return Array the aircraft list |
|
5831 | - * |
|
5832 | - */ |
|
5828 | + * Gets all aircraft types that have flown over by route |
|
5829 | + * |
|
5830 | + * @return Array the aircraft list |
|
5831 | + * |
|
5832 | + */ |
|
5833 | 5833 | public function countAllAircraftTypesByRoute($departure_airport_icao, $arrival_airport_icao,$filters = array()) |
5834 | 5834 | { |
5835 | 5835 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5858,11 +5858,11 @@ discard block |
||
5858 | 5858 | } |
5859 | 5859 | |
5860 | 5860 | /** |
5861 | - * Gets all aircraft registration that have flown over by route |
|
5862 | - * |
|
5863 | - * @return Array the aircraft list |
|
5864 | - * |
|
5865 | - */ |
|
5861 | + * Gets all aircraft registration that have flown over by route |
|
5862 | + * |
|
5863 | + * @return Array the aircraft list |
|
5864 | + * |
|
5865 | + */ |
|
5866 | 5866 | public function countAllAircraftRegistrationByRoute($departure_airport_icao, $arrival_airport_icao,$filters = array()) |
5867 | 5867 | { |
5868 | 5868 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5904,11 +5904,11 @@ discard block |
||
5904 | 5904 | |
5905 | 5905 | |
5906 | 5906 | /** |
5907 | - * Gets all aircraft manufacturer that have flown over by route |
|
5908 | - * |
|
5909 | - * @return Array the aircraft manufacturer list |
|
5910 | - * |
|
5911 | - */ |
|
5907 | + * Gets all aircraft manufacturer that have flown over by route |
|
5908 | + * |
|
5909 | + * @return Array the aircraft manufacturer list |
|
5910 | + * |
|
5911 | + */ |
|
5912 | 5912 | public function countAllAircraftManufacturerByRoute($departure_airport_icao, $arrival_airport_icao,$filters = array()) |
5913 | 5913 | { |
5914 | 5914 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5942,11 +5942,11 @@ discard block |
||
5942 | 5942 | |
5943 | 5943 | |
5944 | 5944 | /** |
5945 | - * Gets all aircraft types that have flown over by country |
|
5946 | - * |
|
5947 | - * @return Array the aircraft list |
|
5948 | - * |
|
5949 | - */ |
|
5945 | + * Gets all aircraft types that have flown over by country |
|
5946 | + * |
|
5947 | + * @return Array the aircraft list |
|
5948 | + * |
|
5949 | + */ |
|
5950 | 5950 | public function countAllAircraftTypesByCountry($country,$filters = array()) |
5951 | 5951 | { |
5952 | 5952 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5977,11 +5977,11 @@ discard block |
||
5977 | 5977 | |
5978 | 5978 | |
5979 | 5979 | /** |
5980 | - * Gets all aircraft registration that have flown over by country |
|
5981 | - * |
|
5982 | - * @return Array the aircraft list |
|
5983 | - * |
|
5984 | - */ |
|
5980 | + * Gets all aircraft registration that have flown over by country |
|
5981 | + * |
|
5982 | + * @return Array the aircraft list |
|
5983 | + * |
|
5984 | + */ |
|
5985 | 5985 | public function countAllAircraftRegistrationByCountry($country,$filters = array()) |
5986 | 5986 | { |
5987 | 5987 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6021,11 +6021,11 @@ discard block |
||
6021 | 6021 | |
6022 | 6022 | |
6023 | 6023 | /** |
6024 | - * Gets all aircraft manufacturer that have flown over by country |
|
6025 | - * |
|
6026 | - * @return Array the aircraft manufacturer list |
|
6027 | - * |
|
6028 | - */ |
|
6024 | + * Gets all aircraft manufacturer that have flown over by country |
|
6025 | + * |
|
6026 | + * @return Array the aircraft manufacturer list |
|
6027 | + * |
|
6028 | + */ |
|
6029 | 6029 | public function countAllAircraftManufacturerByCountry($country,$filters = array()) |
6030 | 6030 | { |
6031 | 6031 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6056,18 +6056,18 @@ discard block |
||
6056 | 6056 | |
6057 | 6057 | |
6058 | 6058 | /** |
6059 | - * Gets all aircraft manufacturers that have flown over |
|
6060 | - * |
|
6061 | - * @return Array the aircraft list |
|
6062 | - * |
|
6063 | - */ |
|
6059 | + * Gets all aircraft manufacturers that have flown over |
|
6060 | + * |
|
6061 | + * @return Array the aircraft list |
|
6062 | + * |
|
6063 | + */ |
|
6064 | 6064 | public function countAllAircraftManufacturers($filters = array(),$year = '',$month = '',$day = '') |
6065 | 6065 | { |
6066 | 6066 | global $globalDBdriver; |
6067 | 6067 | $filter_query = $this->getFilter($filters,true,true); |
6068 | 6068 | $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
6069 | 6069 | FROM spotter_output ".$filter_query." spotter_output.aircraft_manufacturer <> '' AND spotter_output.aircraft_manufacturer <> 'Not Available'"; |
6070 | - $query_values = array(); |
|
6070 | + $query_values = array(); |
|
6071 | 6071 | if ($year != '') { |
6072 | 6072 | if ($globalDBdriver == 'mysql') { |
6073 | 6073 | $query .= " AND YEAR(spotter_output.date) = :year"; |
@@ -6120,11 +6120,11 @@ discard block |
||
6120 | 6120 | |
6121 | 6121 | |
6122 | 6122 | /** |
6123 | - * Gets all aircraft registrations that have flown over |
|
6124 | - * |
|
6125 | - * @return Array the aircraft list |
|
6126 | - * |
|
6127 | - */ |
|
6123 | + * Gets all aircraft registrations that have flown over |
|
6124 | + * |
|
6125 | + * @return Array the aircraft list |
|
6126 | + * |
|
6127 | + */ |
|
6128 | 6128 | public function countAllAircraftRegistrations($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array(),$year = '', $month = '', $day = '') |
6129 | 6129 | { |
6130 | 6130 | global $globalDBdriver; |
@@ -6132,15 +6132,15 @@ discard block |
||
6132 | 6132 | $filter_query = $this->getFilter($filters,true,true); |
6133 | 6133 | $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 |
6134 | 6134 | FROM spotter_output ".$filter_query." spotter_output.registration <> '' AND spotter_output.registration <> 'NA'"; |
6135 | - if ($olderthanmonths > 0) { |
|
6136 | - if ($globalDBdriver == 'mysql') { |
|
6135 | + if ($olderthanmonths > 0) { |
|
6136 | + if ($globalDBdriver == 'mysql') { |
|
6137 | 6137 | $query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)'; |
6138 | 6138 | } else { |
6139 | 6139 | $query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
6140 | 6140 | } |
6141 | 6141 | } |
6142 | - if ($sincedate != '') { |
|
6143 | - if ($globalDBdriver == 'mysql') { |
|
6142 | + if ($sincedate != '') { |
|
6143 | + if ($globalDBdriver == 'mysql') { |
|
6144 | 6144 | $query .= " AND spotter_output.date > '".$sincedate."'"; |
6145 | 6145 | } else { |
6146 | 6146 | $query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -6205,11 +6205,11 @@ discard block |
||
6205 | 6205 | |
6206 | 6206 | |
6207 | 6207 | /** |
6208 | - * Gets all aircraft registrations that have flown over |
|
6209 | - * |
|
6210 | - * @return Array the aircraft list |
|
6211 | - * |
|
6212 | - */ |
|
6208 | + * Gets all aircraft registrations that have flown over |
|
6209 | + * |
|
6210 | + * @return Array the aircraft list |
|
6211 | + * |
|
6212 | + */ |
|
6213 | 6213 | public function countAllAircraftRegistrationsByAirlines($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array()) |
6214 | 6214 | { |
6215 | 6215 | global $globalDBdriver; |
@@ -6217,15 +6217,15 @@ discard block |
||
6217 | 6217 | $Image = new Image($this->db); |
6218 | 6218 | $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 |
6219 | 6219 | FROM spotter_output".$filter_query." spotter_output.airline_icao <> '' AND spotter_output.registration <> '' AND spotter_output.registration <> 'NA' "; |
6220 | - if ($olderthanmonths > 0) { |
|
6221 | - if ($globalDBdriver == 'mysql') { |
|
6220 | + if ($olderthanmonths > 0) { |
|
6221 | + if ($globalDBdriver == 'mysql') { |
|
6222 | 6222 | $query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) '; |
6223 | 6223 | } else { |
6224 | 6224 | $query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
6225 | 6225 | } |
6226 | 6226 | } |
6227 | - if ($sincedate != '') { |
|
6228 | - if ($globalDBdriver == 'mysql') { |
|
6227 | + if ($sincedate != '') { |
|
6228 | + if ($globalDBdriver == 'mysql') { |
|
6229 | 6229 | $query .= "AND spotter_output.date > '".$sincedate."' "; |
6230 | 6230 | } else { |
6231 | 6231 | $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -6234,7 +6234,7 @@ discard block |
||
6234 | 6234 | |
6235 | 6235 | // if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
6236 | 6236 | //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
6237 | - $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"; |
|
6237 | + $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"; |
|
6238 | 6238 | if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
6239 | 6239 | |
6240 | 6240 | $sth = $this->db->prepare($query); |
@@ -6266,26 +6266,26 @@ discard block |
||
6266 | 6266 | |
6267 | 6267 | |
6268 | 6268 | /** |
6269 | - * Gets all departure airports of the airplanes that have flown over |
|
6270 | - * |
|
6271 | - * @return Array the airport list |
|
6272 | - * |
|
6273 | - */ |
|
6269 | + * Gets all departure airports of the airplanes that have flown over |
|
6270 | + * |
|
6271 | + * @return Array the airport list |
|
6272 | + * |
|
6273 | + */ |
|
6274 | 6274 | public function countAllDepartureAirports($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array(),$year = '',$month = '',$day = '') |
6275 | 6275 | { |
6276 | 6276 | global $globalDBdriver; |
6277 | 6277 | $filter_query = $this->getFilter($filters,true,true); |
6278 | 6278 | $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 |
6279 | 6279 | FROM spotter_output".$filter_query." spotter_output.departure_airport_name <> '' AND spotter_output.departure_airport_icao <> 'NA' AND spotter_output.departure_airport_icao <> ''"; |
6280 | - if ($olderthanmonths > 0) { |
|
6281 | - if ($globalDBdriver == 'mysql') { |
|
6280 | + if ($olderthanmonths > 0) { |
|
6281 | + if ($globalDBdriver == 'mysql') { |
|
6282 | 6282 | $query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)'; |
6283 | 6283 | } else { |
6284 | 6284 | $query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
6285 | 6285 | } |
6286 | - } |
|
6287 | - if ($sincedate != '') { |
|
6288 | - if ($globalDBdriver == 'mysql') { |
|
6286 | + } |
|
6287 | + if ($sincedate != '') { |
|
6288 | + if ($globalDBdriver == 'mysql') { |
|
6289 | 6289 | $query .= " AND spotter_output.date > '".$sincedate."'"; |
6290 | 6290 | } else { |
6291 | 6291 | $query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -6319,7 +6319,7 @@ discard block |
||
6319 | 6319 | $query_values = array_merge($query_values,array(':day' => $day)); |
6320 | 6320 | } |
6321 | 6321 | } |
6322 | - $query .= " GROUP BY spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country |
|
6322 | + $query .= " GROUP BY spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country |
|
6323 | 6323 | ORDER BY airport_departure_icao_count DESC"; |
6324 | 6324 | if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
6325 | 6325 | |
@@ -6342,35 +6342,35 @@ discard block |
||
6342 | 6342 | } |
6343 | 6343 | |
6344 | 6344 | /** |
6345 | - * Gets all departure airports of the airplanes that have flown over |
|
6346 | - * |
|
6347 | - * @return Array the airport list |
|
6348 | - * |
|
6349 | - */ |
|
6345 | + * Gets all departure airports of the airplanes that have flown over |
|
6346 | + * |
|
6347 | + * @return Array the airport list |
|
6348 | + * |
|
6349 | + */ |
|
6350 | 6350 | public function countAllDepartureAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array()) |
6351 | 6351 | { |
6352 | 6352 | global $globalDBdriver; |
6353 | 6353 | $filter_query = $this->getFilter($filters,true,true); |
6354 | 6354 | $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 |
6355 | 6355 | FROM spotter_output".$filter_query." spotter_output.airline_icao <> '' AND spotter_output.departure_airport_name <> '' AND spotter_output.departure_airport_icao <> 'NA' AND spotter_output.departure_airport_icao <> '' "; |
6356 | - if ($olderthanmonths > 0) { |
|
6357 | - if ($globalDBdriver == 'mysql') { |
|
6356 | + if ($olderthanmonths > 0) { |
|
6357 | + if ($globalDBdriver == 'mysql') { |
|
6358 | 6358 | $query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) '; |
6359 | 6359 | } else { |
6360 | 6360 | $query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
6361 | 6361 | } |
6362 | - } |
|
6363 | - if ($sincedate != '') { |
|
6364 | - if ($globalDBdriver == 'mysql') { |
|
6362 | + } |
|
6363 | + if ($sincedate != '') { |
|
6364 | + if ($globalDBdriver == 'mysql') { |
|
6365 | 6365 | $query .= "AND spotter_output.date > '".$sincedate."' "; |
6366 | 6366 | } else { |
6367 | 6367 | $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
6368 | 6368 | } |
6369 | 6369 | } |
6370 | 6370 | |
6371 | - //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
6372 | - //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
6373 | - $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 |
|
6371 | + //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
6372 | + //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
6373 | + $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 |
|
6374 | 6374 | ORDER BY airport_departure_icao_count DESC"; |
6375 | 6375 | if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
6376 | 6376 | |
@@ -6395,26 +6395,26 @@ discard block |
||
6395 | 6395 | } |
6396 | 6396 | |
6397 | 6397 | /** |
6398 | - * Gets all detected departure airports of the airplanes that have flown over |
|
6399 | - * |
|
6400 | - * @return Array the airport list |
|
6401 | - * |
|
6402 | - */ |
|
6398 | + * Gets all detected departure airports of the airplanes that have flown over |
|
6399 | + * |
|
6400 | + * @return Array the airport list |
|
6401 | + * |
|
6402 | + */ |
|
6403 | 6403 | public function countAllDetectedDepartureAirports($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array(),$year = '',$month = '',$day = '') |
6404 | 6404 | { |
6405 | 6405 | global $globalDBdriver; |
6406 | 6406 | $filter_query = $this->getFilter($filters,true,true); |
6407 | 6407 | $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 |
6408 | 6408 | 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"; |
6409 | - if ($olderthanmonths > 0) { |
|
6410 | - if ($globalDBdriver == 'mysql') { |
|
6409 | + if ($olderthanmonths > 0) { |
|
6410 | + if ($globalDBdriver == 'mysql') { |
|
6411 | 6411 | $query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)'; |
6412 | 6412 | } else { |
6413 | 6413 | $query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
6414 | 6414 | } |
6415 | - } |
|
6416 | - if ($sincedate != '') { |
|
6417 | - if ($globalDBdriver == 'mysql') { |
|
6415 | + } |
|
6416 | + if ($sincedate != '') { |
|
6417 | + if ($globalDBdriver == 'mysql') { |
|
6418 | 6418 | $query .= " AND spotter_output.date > '".$sincedate."'"; |
6419 | 6419 | } else { |
6420 | 6420 | $query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -6448,10 +6448,10 @@ discard block |
||
6448 | 6448 | $query_values = array_merge($query_values,array(':day' => $day)); |
6449 | 6449 | } |
6450 | 6450 | } |
6451 | - $query .= " GROUP BY spotter_output.real_departure_airport_icao, airport.name, airport.city, airport.country |
|
6451 | + $query .= " GROUP BY spotter_output.real_departure_airport_icao, airport.name, airport.city, airport.country |
|
6452 | 6452 | ORDER BY airport_departure_icao_count DESC"; |
6453 | 6453 | if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
6454 | - //echo $query; |
|
6454 | + //echo $query; |
|
6455 | 6455 | $sth = $this->db->prepare($query); |
6456 | 6456 | $sth->execute($query_values); |
6457 | 6457 | |
@@ -6472,35 +6472,35 @@ discard block |
||
6472 | 6472 | } |
6473 | 6473 | |
6474 | 6474 | /** |
6475 | - * Gets all detected departure airports of the airplanes that have flown over |
|
6476 | - * |
|
6477 | - * @return Array the airport list |
|
6478 | - * |
|
6479 | - */ |
|
6475 | + * Gets all detected departure airports of the airplanes that have flown over |
|
6476 | + * |
|
6477 | + * @return Array the airport list |
|
6478 | + * |
|
6479 | + */ |
|
6480 | 6480 | public function countAllDetectedDepartureAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array()) |
6481 | 6481 | { |
6482 | 6482 | global $globalDBdriver; |
6483 | 6483 | $filter_query = $this->getFilter($filters,true,true); |
6484 | 6484 | $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 |
6485 | 6485 | 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 "; |
6486 | - if ($olderthanmonths > 0) { |
|
6487 | - if ($globalDBdriver == 'mysql') { |
|
6486 | + if ($olderthanmonths > 0) { |
|
6487 | + if ($globalDBdriver == 'mysql') { |
|
6488 | 6488 | $query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) '; |
6489 | 6489 | } else { |
6490 | 6490 | $query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
6491 | 6491 | } |
6492 | - } |
|
6493 | - if ($sincedate != '') { |
|
6494 | - if ($globalDBdriver == 'mysql') { |
|
6492 | + } |
|
6493 | + if ($sincedate != '') { |
|
6494 | + if ($globalDBdriver == 'mysql') { |
|
6495 | 6495 | $query .= "AND spotter_output.date > '".$sincedate."' "; |
6496 | 6496 | } else { |
6497 | 6497 | $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP) "; |
6498 | 6498 | } |
6499 | 6499 | } |
6500 | 6500 | |
6501 | - //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
6502 | - //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
6503 | - $query .= "GROUP BY spotter_output.airline_icao, spotter_output.real_departure_airport_icao, airport.name, airport.city, airport.country |
|
6501 | + //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
6502 | + //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
6503 | + $query .= "GROUP BY spotter_output.airline_icao, spotter_output.real_departure_airport_icao, airport.name, airport.city, airport.country |
|
6504 | 6504 | ORDER BY airport_departure_icao_count DESC"; |
6505 | 6505 | if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
6506 | 6506 | |
@@ -6525,11 +6525,11 @@ discard block |
||
6525 | 6525 | } |
6526 | 6526 | |
6527 | 6527 | /** |
6528 | - * Gets all departure airports of the airplanes that have flown over based on an airline icao |
|
6529 | - * |
|
6530 | - * @return Array the airport list |
|
6531 | - * |
|
6532 | - */ |
|
6528 | + * Gets all departure airports of the airplanes that have flown over based on an airline icao |
|
6529 | + * |
|
6530 | + * @return Array the airport list |
|
6531 | + * |
|
6532 | + */ |
|
6533 | 6533 | public function countAllDepartureAirportsByAirline($airline_icao,$filters = array()) |
6534 | 6534 | { |
6535 | 6535 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6563,11 +6563,11 @@ discard block |
||
6563 | 6563 | |
6564 | 6564 | |
6565 | 6565 | /** |
6566 | - * Gets all departure airports by country of the airplanes that have flown over based on an airline icao |
|
6567 | - * |
|
6568 | - * @return Array the airport list |
|
6569 | - * |
|
6570 | - */ |
|
6566 | + * Gets all departure airports by country of the airplanes that have flown over based on an airline icao |
|
6567 | + * |
|
6568 | + * @return Array the airport list |
|
6569 | + * |
|
6570 | + */ |
|
6571 | 6571 | public function countAllDepartureAirportCountriesByAirline($airline_icao,$filters = array()) |
6572 | 6572 | { |
6573 | 6573 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6598,11 +6598,11 @@ discard block |
||
6598 | 6598 | |
6599 | 6599 | |
6600 | 6600 | /** |
6601 | - * Gets all departure airports of the airplanes that have flown over based on an aircraft icao |
|
6602 | - * |
|
6603 | - * @return Array the airport list |
|
6604 | - * |
|
6605 | - */ |
|
6601 | + * Gets all departure airports of the airplanes that have flown over based on an aircraft icao |
|
6602 | + * |
|
6603 | + * @return Array the airport list |
|
6604 | + * |
|
6605 | + */ |
|
6606 | 6606 | public function countAllDepartureAirportsByAircraft($aircraft_icao,$filters = array()) |
6607 | 6607 | { |
6608 | 6608 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6635,11 +6635,11 @@ discard block |
||
6635 | 6635 | |
6636 | 6636 | |
6637 | 6637 | /** |
6638 | - * Gets all departure airports by country of the airplanes that have flown over based on an aircraft icao |
|
6639 | - * |
|
6640 | - * @return Array the airport list |
|
6641 | - * |
|
6642 | - */ |
|
6638 | + * Gets all departure airports by country of the airplanes that have flown over based on an aircraft icao |
|
6639 | + * |
|
6640 | + * @return Array the airport list |
|
6641 | + * |
|
6642 | + */ |
|
6643 | 6643 | public function countAllDepartureAirportCountriesByAircraft($aircraft_icao,$filters = array()) |
6644 | 6644 | { |
6645 | 6645 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6669,11 +6669,11 @@ discard block |
||
6669 | 6669 | |
6670 | 6670 | |
6671 | 6671 | /** |
6672 | - * Gets all departure airports of the airplanes that have flown over based on an aircraft registration |
|
6673 | - * |
|
6674 | - * @return Array the airport list |
|
6675 | - * |
|
6676 | - */ |
|
6672 | + * Gets all departure airports of the airplanes that have flown over based on an aircraft registration |
|
6673 | + * |
|
6674 | + * @return Array the airport list |
|
6675 | + * |
|
6676 | + */ |
|
6677 | 6677 | public function countAllDepartureAirportsByRegistration($registration,$filters = array()) |
6678 | 6678 | { |
6679 | 6679 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6706,11 +6706,11 @@ discard block |
||
6706 | 6706 | |
6707 | 6707 | |
6708 | 6708 | /** |
6709 | - * Gets all departure airports by country of the airplanes that have flown over based on an aircraft registration |
|
6710 | - * |
|
6711 | - * @return Array the airport list |
|
6712 | - * |
|
6713 | - */ |
|
6709 | + * Gets all departure airports by country of the airplanes that have flown over based on an aircraft registration |
|
6710 | + * |
|
6711 | + * @return Array the airport list |
|
6712 | + * |
|
6713 | + */ |
|
6714 | 6714 | public function countAllDepartureAirportCountriesByRegistration($registration,$filters = array()) |
6715 | 6715 | { |
6716 | 6716 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6740,11 +6740,11 @@ discard block |
||
6740 | 6740 | |
6741 | 6741 | |
6742 | 6742 | /** |
6743 | - * Gets all departure airports of the airplanes that have flown over based on an arrivl airport icao |
|
6744 | - * |
|
6745 | - * @return Array the airport list |
|
6746 | - * |
|
6747 | - */ |
|
6743 | + * Gets all departure airports of the airplanes that have flown over based on an arrivl airport icao |
|
6744 | + * |
|
6745 | + * @return Array the airport list |
|
6746 | + * |
|
6747 | + */ |
|
6748 | 6748 | public function countAllDepartureAirportsByAirport($airport_icao,$filters = array()) |
6749 | 6749 | { |
6750 | 6750 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6777,11 +6777,11 @@ discard block |
||
6777 | 6777 | |
6778 | 6778 | |
6779 | 6779 | /** |
6780 | - * Gets all departure airports by country of the airplanes that have flown over based on an airport icao |
|
6781 | - * |
|
6782 | - * @return Array the airport list |
|
6783 | - * |
|
6784 | - */ |
|
6780 | + * Gets all departure airports by country of the airplanes that have flown over based on an airport icao |
|
6781 | + * |
|
6782 | + * @return Array the airport list |
|
6783 | + * |
|
6784 | + */ |
|
6785 | 6785 | public function countAllDepartureAirportCountriesByAirport($airport_icao,$filters = array()) |
6786 | 6786 | { |
6787 | 6787 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6812,11 +6812,11 @@ discard block |
||
6812 | 6812 | |
6813 | 6813 | |
6814 | 6814 | /** |
6815 | - * Gets all departure airports of the airplanes that have flown over based on an aircraft manufacturer |
|
6816 | - * |
|
6817 | - * @return Array the airport list |
|
6818 | - * |
|
6819 | - */ |
|
6815 | + * Gets all departure airports of the airplanes that have flown over based on an aircraft manufacturer |
|
6816 | + * |
|
6817 | + * @return Array the airport list |
|
6818 | + * |
|
6819 | + */ |
|
6820 | 6820 | public function countAllDepartureAirportsByManufacturer($aircraft_manufacturer,$filters = array()) |
6821 | 6821 | { |
6822 | 6822 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6849,11 +6849,11 @@ discard block |
||
6849 | 6849 | |
6850 | 6850 | |
6851 | 6851 | /** |
6852 | - * Gets all departure airports by country of the airplanes that have flown over based on an aircraft manufacturer |
|
6853 | - * |
|
6854 | - * @return Array the airport list |
|
6855 | - * |
|
6856 | - */ |
|
6852 | + * Gets all departure airports by country of the airplanes that have flown over based on an aircraft manufacturer |
|
6853 | + * |
|
6854 | + * @return Array the airport list |
|
6855 | + * |
|
6856 | + */ |
|
6857 | 6857 | public function countAllDepartureAirportCountriesByManufacturer($aircraft_manufacturer,$filters = array()) |
6858 | 6858 | { |
6859 | 6859 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6883,11 +6883,11 @@ discard block |
||
6883 | 6883 | |
6884 | 6884 | |
6885 | 6885 | /** |
6886 | - * Gets all departure airports of the airplanes that have flown over based on a date |
|
6887 | - * |
|
6888 | - * @return Array the airport list |
|
6889 | - * |
|
6890 | - */ |
|
6886 | + * Gets all departure airports of the airplanes that have flown over based on a date |
|
6887 | + * |
|
6888 | + * @return Array the airport list |
|
6889 | + * |
|
6890 | + */ |
|
6891 | 6891 | public function countAllDepartureAirportsByDate($date,$filters = array()) |
6892 | 6892 | { |
6893 | 6893 | global $globalTimezone, $globalDBdriver; |
@@ -6933,11 +6933,11 @@ discard block |
||
6933 | 6933 | |
6934 | 6934 | |
6935 | 6935 | /** |
6936 | - * Gets all departure airports by country of the airplanes that have flown over based on a date |
|
6937 | - * |
|
6938 | - * @return Array the airport list |
|
6939 | - * |
|
6940 | - */ |
|
6936 | + * Gets all departure airports by country of the airplanes that have flown over based on a date |
|
6937 | + * |
|
6938 | + * @return Array the airport list |
|
6939 | + * |
|
6940 | + */ |
|
6941 | 6941 | public function countAllDepartureAirportCountriesByDate($date,$filters = array()) |
6942 | 6942 | { |
6943 | 6943 | global $globalTimezone, $globalDBdriver; |
@@ -6980,11 +6980,11 @@ discard block |
||
6980 | 6980 | |
6981 | 6981 | |
6982 | 6982 | /** |
6983 | - * Gets all departure airports of the airplanes that have flown over based on a ident/callsign |
|
6984 | - * |
|
6985 | - * @return Array the airport list |
|
6986 | - * |
|
6987 | - */ |
|
6983 | + * Gets all departure airports of the airplanes that have flown over based on a ident/callsign |
|
6984 | + * |
|
6985 | + * @return Array the airport list |
|
6986 | + * |
|
6987 | + */ |
|
6988 | 6988 | public function countAllDepartureAirportsByIdent($ident,$filters = array()) |
6989 | 6989 | { |
6990 | 6990 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7016,11 +7016,11 @@ discard block |
||
7016 | 7016 | } |
7017 | 7017 | |
7018 | 7018 | /** |
7019 | - * Gets all departure airports of the airplanes that have flown over based on a owner |
|
7020 | - * |
|
7021 | - * @return Array the airport list |
|
7022 | - * |
|
7023 | - */ |
|
7019 | + * Gets all departure airports of the airplanes that have flown over based on a owner |
|
7020 | + * |
|
7021 | + * @return Array the airport list |
|
7022 | + * |
|
7023 | + */ |
|
7024 | 7024 | public function countAllDepartureAirportsByOwner($owner,$filters = array()) |
7025 | 7025 | { |
7026 | 7026 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7052,11 +7052,11 @@ discard block |
||
7052 | 7052 | } |
7053 | 7053 | |
7054 | 7054 | /** |
7055 | - * Gets all departure airports of the airplanes that have flown over based on a pilot |
|
7056 | - * |
|
7057 | - * @return Array the airport list |
|
7058 | - * |
|
7059 | - */ |
|
7055 | + * Gets all departure airports of the airplanes that have flown over based on a pilot |
|
7056 | + * |
|
7057 | + * @return Array the airport list |
|
7058 | + * |
|
7059 | + */ |
|
7060 | 7060 | public function countAllDepartureAirportsByPilot($pilot,$filters = array()) |
7061 | 7061 | { |
7062 | 7062 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7089,11 +7089,11 @@ discard block |
||
7089 | 7089 | |
7090 | 7090 | |
7091 | 7091 | /** |
7092 | - * Gets all departure airports by country of the airplanes that have flown over based on a callsign/ident |
|
7093 | - * |
|
7094 | - * @return Array the airport list |
|
7095 | - * |
|
7096 | - */ |
|
7092 | + * Gets all departure airports by country of the airplanes that have flown over based on a callsign/ident |
|
7093 | + * |
|
7094 | + * @return Array the airport list |
|
7095 | + * |
|
7096 | + */ |
|
7097 | 7097 | public function countAllDepartureAirportCountriesByIdent($ident,$filters = array()) |
7098 | 7098 | { |
7099 | 7099 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7122,11 +7122,11 @@ discard block |
||
7122 | 7122 | } |
7123 | 7123 | |
7124 | 7124 | /** |
7125 | - * Gets all departure airports by country of the airplanes that have flown over based on owner |
|
7126 | - * |
|
7127 | - * @return Array the airport list |
|
7128 | - * |
|
7129 | - */ |
|
7125 | + * Gets all departure airports by country of the airplanes that have flown over based on owner |
|
7126 | + * |
|
7127 | + * @return Array the airport list |
|
7128 | + * |
|
7129 | + */ |
|
7130 | 7130 | public function countAllDepartureAirportCountriesByOwner($owner,$filters = array()) |
7131 | 7131 | { |
7132 | 7132 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7142,11 +7142,11 @@ discard block |
||
7142 | 7142 | } |
7143 | 7143 | |
7144 | 7144 | /** |
7145 | - * Gets all departure airports by country of the airplanes that have flown over based on pilot |
|
7146 | - * |
|
7147 | - * @return Array the airport list |
|
7148 | - * |
|
7149 | - */ |
|
7145 | + * Gets all departure airports by country of the airplanes that have flown over based on pilot |
|
7146 | + * |
|
7147 | + * @return Array the airport list |
|
7148 | + * |
|
7149 | + */ |
|
7150 | 7150 | public function countAllDepartureAirportCountriesByPilot($pilot,$filters = array()) |
7151 | 7151 | { |
7152 | 7152 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7164,11 +7164,11 @@ discard block |
||
7164 | 7164 | |
7165 | 7165 | |
7166 | 7166 | /** |
7167 | - * Gets all departure airports of the airplanes that have flown over based on a country |
|
7168 | - * |
|
7169 | - * @return Array the airport list |
|
7170 | - * |
|
7171 | - */ |
|
7167 | + * Gets all departure airports of the airplanes that have flown over based on a country |
|
7168 | + * |
|
7169 | + * @return Array the airport list |
|
7170 | + * |
|
7171 | + */ |
|
7172 | 7172 | public function countAllDepartureAirportsByCountry($country,$filters = array()) |
7173 | 7173 | { |
7174 | 7174 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7202,11 +7202,11 @@ discard block |
||
7202 | 7202 | |
7203 | 7203 | |
7204 | 7204 | /** |
7205 | - * Gets all departure airports by country of the airplanes that have flown over based on an aircraft icao |
|
7206 | - * |
|
7207 | - * @return Array the airport list |
|
7208 | - * |
|
7209 | - */ |
|
7205 | + * Gets all departure airports by country of the airplanes that have flown over based on an aircraft icao |
|
7206 | + * |
|
7207 | + * @return Array the airport list |
|
7208 | + * |
|
7209 | + */ |
|
7210 | 7210 | public function countAllDepartureAirportCountriesByCountry($country,$filters = array()) |
7211 | 7211 | { |
7212 | 7212 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7236,31 +7236,31 @@ discard block |
||
7236 | 7236 | |
7237 | 7237 | |
7238 | 7238 | /** |
7239 | - * Gets all arrival airports of the airplanes that have flown over |
|
7240 | - * |
|
7241 | - * @param Boolean $limit Limit result to 10 or not |
|
7242 | - * @param Integer $olderthanmonths Only show result older than x months |
|
7243 | - * @param String $sincedate Only show result since x date |
|
7244 | - * @param Boolean $icaoaskey Show result by ICAO |
|
7245 | - * @param Array $filters Filter used here |
|
7246 | - * @return Array the airport list |
|
7247 | - * |
|
7248 | - */ |
|
7239 | + * Gets all arrival airports of the airplanes that have flown over |
|
7240 | + * |
|
7241 | + * @param Boolean $limit Limit result to 10 or not |
|
7242 | + * @param Integer $olderthanmonths Only show result older than x months |
|
7243 | + * @param String $sincedate Only show result since x date |
|
7244 | + * @param Boolean $icaoaskey Show result by ICAO |
|
7245 | + * @param Array $filters Filter used here |
|
7246 | + * @return Array the airport list |
|
7247 | + * |
|
7248 | + */ |
|
7249 | 7249 | public function countAllArrivalAirports($limit = true, $olderthanmonths = 0, $sincedate = '', $icaoaskey = false,$filters = array(),$year = '',$month = '',$day = '') |
7250 | 7250 | { |
7251 | 7251 | global $globalDBdriver; |
7252 | 7252 | $filter_query = $this->getFilter($filters,true,true); |
7253 | 7253 | $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 |
7254 | 7254 | FROM spotter_output".$filter_query." spotter_output.arrival_airport_name <> '' AND spotter_output.arrival_airport_icao <> 'NA' AND spotter_output.arrival_airport_icao <> ''"; |
7255 | - if ($olderthanmonths > 0) { |
|
7256 | - if ($globalDBdriver == 'mysql') { |
|
7255 | + if ($olderthanmonths > 0) { |
|
7256 | + if ($globalDBdriver == 'mysql') { |
|
7257 | 7257 | $query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)'; |
7258 | 7258 | } else { |
7259 | 7259 | $query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
7260 | 7260 | } |
7261 | 7261 | } |
7262 | - if ($sincedate != '') { |
|
7263 | - if ($globalDBdriver == 'mysql') { |
|
7262 | + if ($sincedate != '') { |
|
7263 | + if ($globalDBdriver == 'mysql') { |
|
7264 | 7264 | $query .= " AND spotter_output.date > '".$sincedate."'"; |
7265 | 7265 | } else { |
7266 | 7266 | $query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -7294,7 +7294,7 @@ discard block |
||
7294 | 7294 | $query_values = array_merge($query_values,array(':day' => $day)); |
7295 | 7295 | } |
7296 | 7296 | } |
7297 | - $query .= " GROUP BY spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
|
7297 | + $query .= " GROUP BY spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
|
7298 | 7298 | ORDER BY airport_arrival_icao_count DESC"; |
7299 | 7299 | if ($limit) $query .= " LIMIT 10"; |
7300 | 7300 | |
@@ -7323,35 +7323,35 @@ discard block |
||
7323 | 7323 | } |
7324 | 7324 | |
7325 | 7325 | /** |
7326 | - * Gets all arrival airports of the airplanes that have flown over |
|
7327 | - * |
|
7328 | - * @return Array the airport list |
|
7329 | - * |
|
7330 | - */ |
|
7326 | + * Gets all arrival airports of the airplanes that have flown over |
|
7327 | + * |
|
7328 | + * @return Array the airport list |
|
7329 | + * |
|
7330 | + */ |
|
7331 | 7331 | public function countAllArrivalAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '', $icaoaskey = false,$filters = array()) |
7332 | 7332 | { |
7333 | 7333 | global $globalDBdriver; |
7334 | 7334 | $filter_query = $this->getFilter($filters,true,true); |
7335 | 7335 | $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 |
7336 | 7336 | FROM spotter_output".$filter_query." spotter_output.airline_icao <> '' AND spotter_output.arrival_airport_name <> '' AND spotter_output.arrival_airport_icao <> 'NA' AND spotter_output.arrival_airport_icao <> '' "; |
7337 | - if ($olderthanmonths > 0) { |
|
7338 | - if ($globalDBdriver == 'mysql') { |
|
7337 | + if ($olderthanmonths > 0) { |
|
7338 | + if ($globalDBdriver == 'mysql') { |
|
7339 | 7339 | $query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) '; |
7340 | 7340 | } else { |
7341 | 7341 | $query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
7342 | 7342 | } |
7343 | 7343 | } |
7344 | - if ($sincedate != '') { |
|
7345 | - if ($globalDBdriver == 'mysql') { |
|
7344 | + if ($sincedate != '') { |
|
7345 | + if ($globalDBdriver == 'mysql') { |
|
7346 | 7346 | $query .= "AND spotter_output.date > '".$sincedate."' "; |
7347 | 7347 | } else { |
7348 | 7348 | $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
7349 | 7349 | } |
7350 | 7350 | } |
7351 | 7351 | |
7352 | - //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
7353 | - //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
7354 | - $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 |
|
7352 | + //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
7353 | + //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
7354 | + $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 |
|
7355 | 7355 | ORDER BY airport_arrival_icao_count DESC"; |
7356 | 7356 | if ($limit) $query .= " LIMIT 10"; |
7357 | 7357 | |
@@ -7382,26 +7382,26 @@ discard block |
||
7382 | 7382 | |
7383 | 7383 | |
7384 | 7384 | /** |
7385 | - * Gets all detected arrival airports of the airplanes that have flown over |
|
7386 | - * |
|
7387 | - * @return Array the airport list |
|
7388 | - * |
|
7389 | - */ |
|
7385 | + * Gets all detected arrival airports of the airplanes that have flown over |
|
7386 | + * |
|
7387 | + * @return Array the airport list |
|
7388 | + * |
|
7389 | + */ |
|
7390 | 7390 | public function countAllDetectedArrivalAirports($limit = true, $olderthanmonths = 0, $sincedate = '',$icaoaskey = false,$filters = array(),$year = '',$month = '',$day = '') |
7391 | 7391 | { |
7392 | 7392 | global $globalDBdriver; |
7393 | 7393 | $filter_query = $this->getFilter($filters,true,true); |
7394 | 7394 | $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 |
7395 | 7395 | 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"; |
7396 | - if ($olderthanmonths > 0) { |
|
7397 | - if ($globalDBdriver == 'mysql') { |
|
7396 | + if ($olderthanmonths > 0) { |
|
7397 | + if ($globalDBdriver == 'mysql') { |
|
7398 | 7398 | $query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)'; |
7399 | 7399 | } else { |
7400 | 7400 | $query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
7401 | 7401 | } |
7402 | 7402 | } |
7403 | - if ($sincedate != '') { |
|
7404 | - if ($globalDBdriver == 'mysql') { |
|
7403 | + if ($sincedate != '') { |
|
7404 | + if ($globalDBdriver == 'mysql') { |
|
7405 | 7405 | $query .= " AND spotter_output.date > '".$sincedate."'"; |
7406 | 7406 | } else { |
7407 | 7407 | $query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -7435,7 +7435,7 @@ discard block |
||
7435 | 7435 | $query_values = array_merge($query_values,array(':day' => $day)); |
7436 | 7436 | } |
7437 | 7437 | } |
7438 | - $query .= " GROUP BY spotter_output.real_arrival_airport_icao, airport.name, airport.city, airport.country |
|
7438 | + $query .= " GROUP BY spotter_output.real_arrival_airport_icao, airport.name, airport.city, airport.country |
|
7439 | 7439 | ORDER BY airport_arrival_icao_count DESC"; |
7440 | 7440 | if ($limit) $query .= " LIMIT 10"; |
7441 | 7441 | |
@@ -7463,35 +7463,35 @@ discard block |
||
7463 | 7463 | } |
7464 | 7464 | |
7465 | 7465 | /** |
7466 | - * Gets all detected arrival airports of the airplanes that have flown over |
|
7467 | - * |
|
7468 | - * @return Array the airport list |
|
7469 | - * |
|
7470 | - */ |
|
7466 | + * Gets all detected arrival airports of the airplanes that have flown over |
|
7467 | + * |
|
7468 | + * @return Array the airport list |
|
7469 | + * |
|
7470 | + */ |
|
7471 | 7471 | public function countAllDetectedArrivalAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '',$icaoaskey = false,$filters = array()) |
7472 | 7472 | { |
7473 | 7473 | global $globalDBdriver; |
7474 | 7474 | $filter_query = $this->getFilter($filters,true,true); |
7475 | 7475 | $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 |
7476 | 7476 | 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 "; |
7477 | - if ($olderthanmonths > 0) { |
|
7478 | - if ($globalDBdriver == 'mysql') { |
|
7477 | + if ($olderthanmonths > 0) { |
|
7478 | + if ($globalDBdriver == 'mysql') { |
|
7479 | 7479 | $query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) '; |
7480 | 7480 | } else { |
7481 | 7481 | $query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
7482 | 7482 | } |
7483 | 7483 | } |
7484 | - if ($sincedate != '') { |
|
7485 | - if ($globalDBdriver == 'mysql') { |
|
7484 | + if ($sincedate != '') { |
|
7485 | + if ($globalDBdriver == 'mysql') { |
|
7486 | 7486 | $query .= "AND spotter_output.date > '".$sincedate."' "; |
7487 | 7487 | } else { |
7488 | 7488 | $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
7489 | 7489 | } |
7490 | 7490 | } |
7491 | 7491 | |
7492 | - //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
7493 | - //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
7494 | - $query .= "GROUP BY spotter_output.airline_icao, spotter_output.real_arrival_airport_icao, airport.name, airport.city, airport.country |
|
7492 | + //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
7493 | + //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
7494 | + $query .= "GROUP BY spotter_output.airline_icao, spotter_output.real_arrival_airport_icao, airport.name, airport.city, airport.country |
|
7495 | 7495 | ORDER BY airport_arrival_icao_count DESC"; |
7496 | 7496 | if ($limit) $query .= " LIMIT 10"; |
7497 | 7497 | |
@@ -7521,11 +7521,11 @@ discard block |
||
7521 | 7521 | } |
7522 | 7522 | |
7523 | 7523 | /** |
7524 | - * Gets all arrival airports of the airplanes that have flown over based on an airline icao |
|
7525 | - * |
|
7526 | - * @return Array the airport list |
|
7527 | - * |
|
7528 | - */ |
|
7524 | + * Gets all arrival airports of the airplanes that have flown over based on an airline icao |
|
7525 | + * |
|
7526 | + * @return Array the airport list |
|
7527 | + * |
|
7528 | + */ |
|
7529 | 7529 | public function countAllArrivalAirportsByAirline($airline_icao, $filters = array()) |
7530 | 7530 | { |
7531 | 7531 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7557,11 +7557,11 @@ discard block |
||
7557 | 7557 | |
7558 | 7558 | |
7559 | 7559 | /** |
7560 | - * Gets all arrival airports by country of the airplanes that have flown over based on an airline icao |
|
7561 | - * |
|
7562 | - * @return Array the airport list |
|
7563 | - * |
|
7564 | - */ |
|
7560 | + * Gets all arrival airports by country of the airplanes that have flown over based on an airline icao |
|
7561 | + * |
|
7562 | + * @return Array the airport list |
|
7563 | + * |
|
7564 | + */ |
|
7565 | 7565 | public function countAllArrivalAirportCountriesByAirline($airline_icao,$filters = array()) |
7566 | 7566 | { |
7567 | 7567 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7592,11 +7592,11 @@ discard block |
||
7592 | 7592 | |
7593 | 7593 | |
7594 | 7594 | /** |
7595 | - * Gets all arrival airports of the airplanes that have flown over based on an aircraft icao |
|
7596 | - * |
|
7597 | - * @return Array the airport list |
|
7598 | - * |
|
7599 | - */ |
|
7595 | + * Gets all arrival airports of the airplanes that have flown over based on an aircraft icao |
|
7596 | + * |
|
7597 | + * @return Array the airport list |
|
7598 | + * |
|
7599 | + */ |
|
7600 | 7600 | public function countAllArrivalAirportsByAircraft($aircraft_icao,$filters = array()) |
7601 | 7601 | { |
7602 | 7602 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7630,11 +7630,11 @@ discard block |
||
7630 | 7630 | |
7631 | 7631 | |
7632 | 7632 | /** |
7633 | - * Gets all arrival airports by country of the airplanes that have flown over based on an aircraft icao |
|
7634 | - * |
|
7635 | - * @return Array the airport list |
|
7636 | - * |
|
7637 | - */ |
|
7633 | + * Gets all arrival airports by country of the airplanes that have flown over based on an aircraft icao |
|
7634 | + * |
|
7635 | + * @return Array the airport list |
|
7636 | + * |
|
7637 | + */ |
|
7638 | 7638 | public function countAllArrivalAirportCountriesByAircraft($aircraft_icao,$filters = array()) |
7639 | 7639 | { |
7640 | 7640 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7664,11 +7664,11 @@ discard block |
||
7664 | 7664 | |
7665 | 7665 | |
7666 | 7666 | /** |
7667 | - * Gets all arrival airports of the airplanes that have flown over based on an aircraft registration |
|
7668 | - * |
|
7669 | - * @return Array the airport list |
|
7670 | - * |
|
7671 | - */ |
|
7667 | + * Gets all arrival airports of the airplanes that have flown over based on an aircraft registration |
|
7668 | + * |
|
7669 | + * @return Array the airport list |
|
7670 | + * |
|
7671 | + */ |
|
7672 | 7672 | public function countAllArrivalAirportsByRegistration($registration,$filters = array()) |
7673 | 7673 | { |
7674 | 7674 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7702,11 +7702,11 @@ discard block |
||
7702 | 7702 | |
7703 | 7703 | |
7704 | 7704 | /** |
7705 | - * Gets all arrival airports by country of the airplanes that have flown over based on an aircraft registration |
|
7706 | - * |
|
7707 | - * @return Array the airport list |
|
7708 | - * |
|
7709 | - */ |
|
7705 | + * Gets all arrival airports by country of the airplanes that have flown over based on an aircraft registration |
|
7706 | + * |
|
7707 | + * @return Array the airport list |
|
7708 | + * |
|
7709 | + */ |
|
7710 | 7710 | public function countAllArrivalAirportCountriesByRegistration($registration,$filters = array()) |
7711 | 7711 | { |
7712 | 7712 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7737,11 +7737,11 @@ discard block |
||
7737 | 7737 | |
7738 | 7738 | |
7739 | 7739 | /** |
7740 | - * Gets all arrival airports of the airplanes that have flown over based on an departure airport |
|
7741 | - * |
|
7742 | - * @return Array the airport list |
|
7743 | - * |
|
7744 | - */ |
|
7740 | + * Gets all arrival airports of the airplanes that have flown over based on an departure airport |
|
7741 | + * |
|
7742 | + * @return Array the airport list |
|
7743 | + * |
|
7744 | + */ |
|
7745 | 7745 | public function countAllArrivalAirportsByAirport($airport_icao,$filters = array()) |
7746 | 7746 | { |
7747 | 7747 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7774,11 +7774,11 @@ discard block |
||
7774 | 7774 | |
7775 | 7775 | |
7776 | 7776 | /** |
7777 | - * Gets all arrival airports by country of the airplanes that have flown over based on an airport icao |
|
7778 | - * |
|
7779 | - * @return Array the airport list |
|
7780 | - * |
|
7781 | - */ |
|
7777 | + * Gets all arrival airports by country of the airplanes that have flown over based on an airport icao |
|
7778 | + * |
|
7779 | + * @return Array the airport list |
|
7780 | + * |
|
7781 | + */ |
|
7782 | 7782 | public function countAllArrivalAirportCountriesByAirport($airport_icao,$filters = array()) |
7783 | 7783 | { |
7784 | 7784 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7808,11 +7808,11 @@ discard block |
||
7808 | 7808 | |
7809 | 7809 | |
7810 | 7810 | /** |
7811 | - * Gets all arrival airports of the airplanes that have flown over based on a aircraft manufacturer |
|
7812 | - * |
|
7813 | - * @return Array the airport list |
|
7814 | - * |
|
7815 | - */ |
|
7811 | + * Gets all arrival airports of the airplanes that have flown over based on a aircraft manufacturer |
|
7812 | + * |
|
7813 | + * @return Array the airport list |
|
7814 | + * |
|
7815 | + */ |
|
7816 | 7816 | public function countAllArrivalAirportsByManufacturer($aircraft_manufacturer,$filters = array()) |
7817 | 7817 | { |
7818 | 7818 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7846,11 +7846,11 @@ discard block |
||
7846 | 7846 | |
7847 | 7847 | |
7848 | 7848 | /** |
7849 | - * Gets all arrival airports by country of the airplanes that have flown over based on a aircraft manufacturer |
|
7850 | - * |
|
7851 | - * @return Array the airport list |
|
7852 | - * |
|
7853 | - */ |
|
7849 | + * Gets all arrival airports by country of the airplanes that have flown over based on a aircraft manufacturer |
|
7850 | + * |
|
7851 | + * @return Array the airport list |
|
7852 | + * |
|
7853 | + */ |
|
7854 | 7854 | public function countAllArrivalAirportCountriesByManufacturer($aircraft_manufacturer,$filters = array()) |
7855 | 7855 | { |
7856 | 7856 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7881,11 +7881,11 @@ discard block |
||
7881 | 7881 | |
7882 | 7882 | |
7883 | 7883 | /** |
7884 | - * Gets all arrival airports of the airplanes that have flown over based on a date |
|
7885 | - * |
|
7886 | - * @return Array the airport list |
|
7887 | - * |
|
7888 | - */ |
|
7884 | + * Gets all arrival airports of the airplanes that have flown over based on a date |
|
7885 | + * |
|
7886 | + * @return Array the airport list |
|
7887 | + * |
|
7888 | + */ |
|
7889 | 7889 | public function countAllArrivalAirportsByDate($date,$filters = array()) |
7890 | 7890 | { |
7891 | 7891 | global $globalTimezone, $globalDBdriver; |
@@ -7931,11 +7931,11 @@ discard block |
||
7931 | 7931 | |
7932 | 7932 | |
7933 | 7933 | /** |
7934 | - * Gets all arrival airports by country of the airplanes that have flown over based on a date |
|
7935 | - * |
|
7936 | - * @return Array the airport list |
|
7937 | - * |
|
7938 | - */ |
|
7934 | + * Gets all arrival airports by country of the airplanes that have flown over based on a date |
|
7935 | + * |
|
7936 | + * @return Array the airport list |
|
7937 | + * |
|
7938 | + */ |
|
7939 | 7939 | public function countAllArrivalAirportCountriesByDate($date, $filters = array()) |
7940 | 7940 | { |
7941 | 7941 | global $globalTimezone, $globalDBdriver; |
@@ -7978,11 +7978,11 @@ discard block |
||
7978 | 7978 | |
7979 | 7979 | |
7980 | 7980 | /** |
7981 | - * Gets all arrival airports of the airplanes that have flown over based on a ident/callsign |
|
7982 | - * |
|
7983 | - * @return Array the airport list |
|
7984 | - * |
|
7985 | - */ |
|
7981 | + * Gets all arrival airports of the airplanes that have flown over based on a ident/callsign |
|
7982 | + * |
|
7983 | + * @return Array the airport list |
|
7984 | + * |
|
7985 | + */ |
|
7986 | 7986 | public function countAllArrivalAirportsByIdent($ident,$filters = array()) |
7987 | 7987 | { |
7988 | 7988 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8014,11 +8014,11 @@ discard block |
||
8014 | 8014 | } |
8015 | 8015 | |
8016 | 8016 | /** |
8017 | - * Gets all arrival airports of the airplanes that have flown over based on a owner |
|
8018 | - * |
|
8019 | - * @return Array the airport list |
|
8020 | - * |
|
8021 | - */ |
|
8017 | + * Gets all arrival airports of the airplanes that have flown over based on a owner |
|
8018 | + * |
|
8019 | + * @return Array the airport list |
|
8020 | + * |
|
8021 | + */ |
|
8022 | 8022 | public function countAllArrivalAirportsByOwner($owner,$filters = array()) |
8023 | 8023 | { |
8024 | 8024 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8049,11 +8049,11 @@ discard block |
||
8049 | 8049 | } |
8050 | 8050 | |
8051 | 8051 | /** |
8052 | - * Gets all arrival airports of the airplanes that have flown over based on a pilot |
|
8053 | - * |
|
8054 | - * @return Array the airport list |
|
8055 | - * |
|
8056 | - */ |
|
8052 | + * Gets all arrival airports of the airplanes that have flown over based on a pilot |
|
8053 | + * |
|
8054 | + * @return Array the airport list |
|
8055 | + * |
|
8056 | + */ |
|
8057 | 8057 | public function countAllArrivalAirportsByPilot($pilot,$filters = array()) |
8058 | 8058 | { |
8059 | 8059 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8084,11 +8084,11 @@ discard block |
||
8084 | 8084 | } |
8085 | 8085 | |
8086 | 8086 | /** |
8087 | - * Gets all arrival airports by country of the airplanes that have flown over based on a callsign/ident |
|
8088 | - * |
|
8089 | - * @return Array the airport list |
|
8090 | - * |
|
8091 | - */ |
|
8087 | + * Gets all arrival airports by country of the airplanes that have flown over based on a callsign/ident |
|
8088 | + * |
|
8089 | + * @return Array the airport list |
|
8090 | + * |
|
8091 | + */ |
|
8092 | 8092 | public function countAllArrivalAirportCountriesByIdent($ident, $filters = array()) |
8093 | 8093 | { |
8094 | 8094 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8117,11 +8117,11 @@ discard block |
||
8117 | 8117 | } |
8118 | 8118 | |
8119 | 8119 | /** |
8120 | - * Gets all arrival airports by country of the airplanes that have flown over based on a owner |
|
8121 | - * |
|
8122 | - * @return Array the airport list |
|
8123 | - * |
|
8124 | - */ |
|
8120 | + * Gets all arrival airports by country of the airplanes that have flown over based on a owner |
|
8121 | + * |
|
8122 | + * @return Array the airport list |
|
8123 | + * |
|
8124 | + */ |
|
8125 | 8125 | public function countAllArrivalAirportCountriesByOwner($owner, $filters = array()) |
8126 | 8126 | { |
8127 | 8127 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8137,11 +8137,11 @@ discard block |
||
8137 | 8137 | } |
8138 | 8138 | |
8139 | 8139 | /** |
8140 | - * Gets all arrival airports by country of the airplanes that have flown over based on a pilot |
|
8141 | - * |
|
8142 | - * @return Array the airport list |
|
8143 | - * |
|
8144 | - */ |
|
8140 | + * Gets all arrival airports by country of the airplanes that have flown over based on a pilot |
|
8141 | + * |
|
8142 | + * @return Array the airport list |
|
8143 | + * |
|
8144 | + */ |
|
8145 | 8145 | public function countAllArrivalAirportCountriesByPilot($pilot, $filters = array()) |
8146 | 8146 | { |
8147 | 8147 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8159,11 +8159,11 @@ discard block |
||
8159 | 8159 | |
8160 | 8160 | |
8161 | 8161 | /** |
8162 | - * Gets all arrival airports of the airplanes that have flown over based on a country |
|
8163 | - * |
|
8164 | - * @return Array the airport list |
|
8165 | - * |
|
8166 | - */ |
|
8162 | + * Gets all arrival airports of the airplanes that have flown over based on a country |
|
8163 | + * |
|
8164 | + * @return Array the airport list |
|
8165 | + * |
|
8166 | + */ |
|
8167 | 8167 | public function countAllArrivalAirportsByCountry($country,$filters = array()) |
8168 | 8168 | { |
8169 | 8169 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8196,11 +8196,11 @@ discard block |
||
8196 | 8196 | |
8197 | 8197 | |
8198 | 8198 | /** |
8199 | - * Gets all arrival airports by country of the airplanes that have flown over based on a country |
|
8200 | - * |
|
8201 | - * @return Array the airport list |
|
8202 | - * |
|
8203 | - */ |
|
8199 | + * Gets all arrival airports by country of the airplanes that have flown over based on a country |
|
8200 | + * |
|
8201 | + * @return Array the airport list |
|
8202 | + * |
|
8203 | + */ |
|
8204 | 8204 | public function countAllArrivalAirportCountriesByCountry($country,$filters = array()) |
8205 | 8205 | { |
8206 | 8206 | global $globalDBdriver; |
@@ -8232,11 +8232,11 @@ discard block |
||
8232 | 8232 | |
8233 | 8233 | |
8234 | 8234 | /** |
8235 | - * Counts all airport departure countries |
|
8236 | - * |
|
8237 | - * @return Array the airport departure list |
|
8238 | - * |
|
8239 | - */ |
|
8235 | + * Counts all airport departure countries |
|
8236 | + * |
|
8237 | + * @return Array the airport departure list |
|
8238 | + * |
|
8239 | + */ |
|
8240 | 8240 | public function countAllDepartureCountries($filters = array(),$year = '',$month = '', $day = '') |
8241 | 8241 | { |
8242 | 8242 | global $globalDBdriver; |
@@ -8295,11 +8295,11 @@ discard block |
||
8295 | 8295 | |
8296 | 8296 | |
8297 | 8297 | /** |
8298 | - * Counts all airport arrival countries |
|
8299 | - * |
|
8300 | - * @return Array the airport arrival list |
|
8301 | - * |
|
8302 | - */ |
|
8298 | + * Counts all airport arrival countries |
|
8299 | + * |
|
8300 | + * @return Array the airport arrival list |
|
8301 | + * |
|
8302 | + */ |
|
8303 | 8303 | public function countAllArrivalCountries($limit = true,$filters = array(),$year = '',$month = '',$day = '') |
8304 | 8304 | { |
8305 | 8305 | global $globalDBdriver; |
@@ -8361,11 +8361,11 @@ discard block |
||
8361 | 8361 | |
8362 | 8362 | |
8363 | 8363 | /** |
8364 | - * Gets all route combinations |
|
8365 | - * |
|
8366 | - * @return Array the route list |
|
8367 | - * |
|
8368 | - */ |
|
8364 | + * Gets all route combinations |
|
8365 | + * |
|
8366 | + * @return Array the route list |
|
8367 | + * |
|
8368 | + */ |
|
8369 | 8369 | public function countAllRoutes($filters = array()) |
8370 | 8370 | { |
8371 | 8371 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8404,11 +8404,11 @@ discard block |
||
8404 | 8404 | |
8405 | 8405 | |
8406 | 8406 | /** |
8407 | - * Gets all route combinations based on an aircraft |
|
8408 | - * |
|
8409 | - * @return Array the route list |
|
8410 | - * |
|
8411 | - */ |
|
8407 | + * Gets all route combinations based on an aircraft |
|
8408 | + * |
|
8409 | + * @return Array the route list |
|
8410 | + * |
|
8411 | + */ |
|
8412 | 8412 | public function countAllRoutesByAircraft($aircraft_icao,$filters = array()) |
8413 | 8413 | { |
8414 | 8414 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8444,11 +8444,11 @@ discard block |
||
8444 | 8444 | |
8445 | 8445 | |
8446 | 8446 | /** |
8447 | - * Gets all route combinations based on an aircraft registration |
|
8448 | - * |
|
8449 | - * @return Array the route list |
|
8450 | - * |
|
8451 | - */ |
|
8447 | + * Gets all route combinations based on an aircraft registration |
|
8448 | + * |
|
8449 | + * @return Array the route list |
|
8450 | + * |
|
8451 | + */ |
|
8452 | 8452 | public function countAllRoutesByRegistration($registration, $filters = array()) |
8453 | 8453 | { |
8454 | 8454 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8486,11 +8486,11 @@ discard block |
||
8486 | 8486 | |
8487 | 8487 | |
8488 | 8488 | /** |
8489 | - * Gets all route combinations based on an airline |
|
8490 | - * |
|
8491 | - * @return Array the route list |
|
8492 | - * |
|
8493 | - */ |
|
8489 | + * Gets all route combinations based on an airline |
|
8490 | + * |
|
8491 | + * @return Array the route list |
|
8492 | + * |
|
8493 | + */ |
|
8494 | 8494 | public function countAllRoutesByAirline($airline_icao, $filters = array()) |
8495 | 8495 | { |
8496 | 8496 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8528,11 +8528,11 @@ discard block |
||
8528 | 8528 | |
8529 | 8529 | |
8530 | 8530 | /** |
8531 | - * Gets all route combinations based on an airport |
|
8532 | - * |
|
8533 | - * @return Array the route list |
|
8534 | - * |
|
8535 | - */ |
|
8531 | + * Gets all route combinations based on an airport |
|
8532 | + * |
|
8533 | + * @return Array the route list |
|
8534 | + * |
|
8535 | + */ |
|
8536 | 8536 | public function countAllRoutesByAirport($airport_icao, $filters = array()) |
8537 | 8537 | { |
8538 | 8538 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8569,11 +8569,11 @@ discard block |
||
8569 | 8569 | |
8570 | 8570 | |
8571 | 8571 | /** |
8572 | - * Gets all route combinations based on an country |
|
8573 | - * |
|
8574 | - * @return Array the route list |
|
8575 | - * |
|
8576 | - */ |
|
8572 | + * Gets all route combinations based on an country |
|
8573 | + * |
|
8574 | + * @return Array the route list |
|
8575 | + * |
|
8576 | + */ |
|
8577 | 8577 | public function countAllRoutesByCountry($country, $filters = array()) |
8578 | 8578 | { |
8579 | 8579 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8609,11 +8609,11 @@ discard block |
||
8609 | 8609 | |
8610 | 8610 | |
8611 | 8611 | /** |
8612 | - * Gets all route combinations based on an date |
|
8613 | - * |
|
8614 | - * @return Array the route list |
|
8615 | - * |
|
8616 | - */ |
|
8612 | + * Gets all route combinations based on an date |
|
8613 | + * |
|
8614 | + * @return Array the route list |
|
8615 | + * |
|
8616 | + */ |
|
8617 | 8617 | public function countAllRoutesByDate($date, $filters = array()) |
8618 | 8618 | { |
8619 | 8619 | global $globalTimezone, $globalDBdriver; |
@@ -8663,11 +8663,11 @@ discard block |
||
8663 | 8663 | |
8664 | 8664 | |
8665 | 8665 | /** |
8666 | - * Gets all route combinations based on an ident/callsign |
|
8667 | - * |
|
8668 | - * @return Array the route list |
|
8669 | - * |
|
8670 | - */ |
|
8666 | + * Gets all route combinations based on an ident/callsign |
|
8667 | + * |
|
8668 | + * @return Array the route list |
|
8669 | + * |
|
8670 | + */ |
|
8671 | 8671 | public function countAllRoutesByIdent($ident, $filters = array()) |
8672 | 8672 | { |
8673 | 8673 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8703,11 +8703,11 @@ discard block |
||
8703 | 8703 | } |
8704 | 8704 | |
8705 | 8705 | /** |
8706 | - * Gets all route combinations based on an owner |
|
8707 | - * |
|
8708 | - * @return Array the route list |
|
8709 | - * |
|
8710 | - */ |
|
8706 | + * Gets all route combinations based on an owner |
|
8707 | + * |
|
8708 | + * @return Array the route list |
|
8709 | + * |
|
8710 | + */ |
|
8711 | 8711 | public function countAllRoutesByOwner($owner,$filters = array()) |
8712 | 8712 | { |
8713 | 8713 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8743,11 +8743,11 @@ discard block |
||
8743 | 8743 | } |
8744 | 8744 | |
8745 | 8745 | /** |
8746 | - * Gets all route combinations based on a pilot |
|
8747 | - * |
|
8748 | - * @return Array the route list |
|
8749 | - * |
|
8750 | - */ |
|
8746 | + * Gets all route combinations based on a pilot |
|
8747 | + * |
|
8748 | + * @return Array the route list |
|
8749 | + * |
|
8750 | + */ |
|
8751 | 8751 | public function countAllRoutesByPilot($pilot,$filters = array()) |
8752 | 8752 | { |
8753 | 8753 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8784,11 +8784,11 @@ discard block |
||
8784 | 8784 | |
8785 | 8785 | |
8786 | 8786 | /** |
8787 | - * Gets all route combinations based on an manufacturer |
|
8788 | - * |
|
8789 | - * @return Array the route list |
|
8790 | - * |
|
8791 | - */ |
|
8787 | + * Gets all route combinations based on an manufacturer |
|
8788 | + * |
|
8789 | + * @return Array the route list |
|
8790 | + * |
|
8791 | + */ |
|
8792 | 8792 | public function countAllRoutesByManufacturer($aircraft_manufacturer, $filters = array()) |
8793 | 8793 | { |
8794 | 8794 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8826,11 +8826,11 @@ discard block |
||
8826 | 8826 | |
8827 | 8827 | |
8828 | 8828 | /** |
8829 | - * Gets all route combinations with waypoints |
|
8830 | - * |
|
8831 | - * @return Array the route list |
|
8832 | - * |
|
8833 | - */ |
|
8829 | + * Gets all route combinations with waypoints |
|
8830 | + * |
|
8831 | + * @return Array the route list |
|
8832 | + * |
|
8833 | + */ |
|
8834 | 8834 | public function countAllRoutesWithWaypoints($filters = array()) |
8835 | 8835 | { |
8836 | 8836 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8867,11 +8867,11 @@ discard block |
||
8867 | 8867 | } |
8868 | 8868 | |
8869 | 8869 | /** |
8870 | - * Gets all callsigns that have flown over |
|
8871 | - * |
|
8872 | - * @return Array the callsign list |
|
8873 | - * |
|
8874 | - */ |
|
8870 | + * Gets all callsigns that have flown over |
|
8871 | + * |
|
8872 | + * @return Array the callsign list |
|
8873 | + * |
|
8874 | + */ |
|
8875 | 8875 | public function countAllCallsigns($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array(),$year = '', $month = '', $day = '') |
8876 | 8876 | { |
8877 | 8877 | global $globalDBdriver; |
@@ -8937,11 +8937,11 @@ discard block |
||
8937 | 8937 | } |
8938 | 8938 | |
8939 | 8939 | /** |
8940 | - * Gets all callsigns that have flown over |
|
8941 | - * |
|
8942 | - * @return Array the callsign list |
|
8943 | - * |
|
8944 | - */ |
|
8940 | + * Gets all callsigns that have flown over |
|
8941 | + * |
|
8942 | + * @return Array the callsign list |
|
8943 | + * |
|
8944 | + */ |
|
8945 | 8945 | public function countAllCallsignsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '', $filters = array()) |
8946 | 8946 | { |
8947 | 8947 | global $globalDBdriver; |
@@ -8982,11 +8982,11 @@ discard block |
||
8982 | 8982 | |
8983 | 8983 | |
8984 | 8984 | /** |
8985 | - * Counts all dates |
|
8986 | - * |
|
8987 | - * @return Array the date list |
|
8988 | - * |
|
8989 | - */ |
|
8985 | + * Counts all dates |
|
8986 | + * |
|
8987 | + * @return Array the date list |
|
8988 | + * |
|
8989 | + */ |
|
8990 | 8990 | public function countAllDates($filters = array()) |
8991 | 8991 | { |
8992 | 8992 | global $globalTimezone, $globalDBdriver; |
@@ -9031,11 +9031,11 @@ discard block |
||
9031 | 9031 | } |
9032 | 9032 | |
9033 | 9033 | /** |
9034 | - * Counts all dates |
|
9035 | - * |
|
9036 | - * @return Array the date list |
|
9037 | - * |
|
9038 | - */ |
|
9034 | + * Counts all dates |
|
9035 | + * |
|
9036 | + * @return Array the date list |
|
9037 | + * |
|
9038 | + */ |
|
9039 | 9039 | public function countAllDatesByAirlines($filters = array()) |
9040 | 9040 | { |
9041 | 9041 | global $globalTimezone, $globalDBdriver; |
@@ -9080,11 +9080,11 @@ discard block |
||
9080 | 9080 | } |
9081 | 9081 | |
9082 | 9082 | /** |
9083 | - * Counts all dates during the last 7 days |
|
9084 | - * |
|
9085 | - * @return Array the date list |
|
9086 | - * |
|
9087 | - */ |
|
9083 | + * Counts all dates during the last 7 days |
|
9084 | + * |
|
9085 | + * @return Array the date list |
|
9086 | + * |
|
9087 | + */ |
|
9088 | 9088 | public function countAllDatesLast7Days($filters = array()) |
9089 | 9089 | { |
9090 | 9090 | global $globalTimezone, $globalDBdriver; |
@@ -9106,7 +9106,7 @@ discard block |
||
9106 | 9106 | $query .= " GROUP BY date_name |
9107 | 9107 | ORDER BY date_name ASC"; |
9108 | 9108 | $query_data = array(':offset' => $offset); |
9109 | - } |
|
9109 | + } |
|
9110 | 9110 | |
9111 | 9111 | $sth = $this->db->prepare($query); |
9112 | 9112 | $sth->execute($query_data); |
@@ -9126,11 +9126,11 @@ discard block |
||
9126 | 9126 | } |
9127 | 9127 | |
9128 | 9128 | /** |
9129 | - * Counts all dates during the last month |
|
9130 | - * |
|
9131 | - * @return Array the date list |
|
9132 | - * |
|
9133 | - */ |
|
9129 | + * Counts all dates during the last month |
|
9130 | + * |
|
9131 | + * @return Array the date list |
|
9132 | + * |
|
9133 | + */ |
|
9134 | 9134 | public function countAllDatesLastMonth($filters = array()) |
9135 | 9135 | { |
9136 | 9136 | global $globalTimezone, $globalDBdriver; |
@@ -9152,7 +9152,7 @@ discard block |
||
9152 | 9152 | $query .= " GROUP BY date_name |
9153 | 9153 | ORDER BY date_name ASC"; |
9154 | 9154 | $query_data = array(':offset' => $offset); |
9155 | - } |
|
9155 | + } |
|
9156 | 9156 | |
9157 | 9157 | $sth = $this->db->prepare($query); |
9158 | 9158 | $sth->execute($query_data); |
@@ -9173,11 +9173,11 @@ discard block |
||
9173 | 9173 | |
9174 | 9174 | |
9175 | 9175 | /** |
9176 | - * Counts all dates during the last month |
|
9177 | - * |
|
9178 | - * @return Array the date list |
|
9179 | - * |
|
9180 | - */ |
|
9176 | + * Counts all dates during the last month |
|
9177 | + * |
|
9178 | + * @return Array the date list |
|
9179 | + * |
|
9180 | + */ |
|
9181 | 9181 | public function countAllDatesLastMonthByAirlines($filters = array()) |
9182 | 9182 | { |
9183 | 9183 | global $globalTimezone, $globalDBdriver; |
@@ -9200,7 +9200,7 @@ discard block |
||
9200 | 9200 | GROUP BY spotter_output.airline_icao, date_name |
9201 | 9201 | ORDER BY date_name ASC"; |
9202 | 9202 | $query_data = array(':offset' => $offset); |
9203 | - } |
|
9203 | + } |
|
9204 | 9204 | |
9205 | 9205 | $sth = $this->db->prepare($query); |
9206 | 9206 | $sth->execute($query_data); |
@@ -9222,11 +9222,11 @@ discard block |
||
9222 | 9222 | |
9223 | 9223 | |
9224 | 9224 | /** |
9225 | - * Counts all month |
|
9226 | - * |
|
9227 | - * @return Array the month list |
|
9228 | - * |
|
9229 | - */ |
|
9225 | + * Counts all month |
|
9226 | + * |
|
9227 | + * @return Array the month list |
|
9228 | + * |
|
9229 | + */ |
|
9230 | 9230 | public function countAllMonths($filters = array()) |
9231 | 9231 | { |
9232 | 9232 | global $globalTimezone, $globalDBdriver; |
@@ -9268,11 +9268,11 @@ discard block |
||
9268 | 9268 | } |
9269 | 9269 | |
9270 | 9270 | /** |
9271 | - * Counts all month |
|
9272 | - * |
|
9273 | - * @return Array the month list |
|
9274 | - * |
|
9275 | - */ |
|
9271 | + * Counts all month |
|
9272 | + * |
|
9273 | + * @return Array the month list |
|
9274 | + * |
|
9275 | + */ |
|
9276 | 9276 | public function countAllMonthsByAirlines($filters = array()) |
9277 | 9277 | { |
9278 | 9278 | global $globalTimezone, $globalDBdriver; |
@@ -9317,11 +9317,11 @@ discard block |
||
9317 | 9317 | } |
9318 | 9318 | |
9319 | 9319 | /** |
9320 | - * Counts all military month |
|
9321 | - * |
|
9322 | - * @return Array the month list |
|
9323 | - * |
|
9324 | - */ |
|
9320 | + * Counts all military month |
|
9321 | + * |
|
9322 | + * @return Array the month list |
|
9323 | + * |
|
9324 | + */ |
|
9325 | 9325 | public function countAllMilitaryMonths($filters = array()) |
9326 | 9326 | { |
9327 | 9327 | global $globalTimezone, $globalDBdriver; |
@@ -9362,11 +9362,11 @@ discard block |
||
9362 | 9362 | } |
9363 | 9363 | |
9364 | 9364 | /** |
9365 | - * Counts all month owners |
|
9366 | - * |
|
9367 | - * @return Array the month list |
|
9368 | - * |
|
9369 | - */ |
|
9365 | + * Counts all month owners |
|
9366 | + * |
|
9367 | + * @return Array the month list |
|
9368 | + * |
|
9369 | + */ |
|
9370 | 9370 | public function countAllMonthsOwners($filters = array()) |
9371 | 9371 | { |
9372 | 9372 | global $globalTimezone, $globalDBdriver; |
@@ -9408,11 +9408,11 @@ discard block |
||
9408 | 9408 | } |
9409 | 9409 | |
9410 | 9410 | /** |
9411 | - * Counts all month owners |
|
9412 | - * |
|
9413 | - * @return Array the month list |
|
9414 | - * |
|
9415 | - */ |
|
9411 | + * Counts all month owners |
|
9412 | + * |
|
9413 | + * @return Array the month list |
|
9414 | + * |
|
9415 | + */ |
|
9416 | 9416 | public function countAllMonthsOwnersByAirlines($filters = array()) |
9417 | 9417 | { |
9418 | 9418 | global $globalTimezone, $globalDBdriver; |
@@ -9455,11 +9455,11 @@ discard block |
||
9455 | 9455 | } |
9456 | 9456 | |
9457 | 9457 | /** |
9458 | - * Counts all month pilot |
|
9459 | - * |
|
9460 | - * @return Array the month list |
|
9461 | - * |
|
9462 | - */ |
|
9458 | + * Counts all month pilot |
|
9459 | + * |
|
9460 | + * @return Array the month list |
|
9461 | + * |
|
9462 | + */ |
|
9463 | 9463 | public function countAllMonthsPilots($filters = array()) |
9464 | 9464 | { |
9465 | 9465 | global $globalTimezone, $globalDBdriver; |
@@ -9501,11 +9501,11 @@ discard block |
||
9501 | 9501 | } |
9502 | 9502 | |
9503 | 9503 | /** |
9504 | - * Counts all month pilot |
|
9505 | - * |
|
9506 | - * @return Array the month list |
|
9507 | - * |
|
9508 | - */ |
|
9504 | + * Counts all month pilot |
|
9505 | + * |
|
9506 | + * @return Array the month list |
|
9507 | + * |
|
9508 | + */ |
|
9509 | 9509 | public function countAllMonthsPilotsByAirlines($filters = array()) |
9510 | 9510 | { |
9511 | 9511 | global $globalTimezone, $globalDBdriver; |
@@ -9548,11 +9548,11 @@ discard block |
||
9548 | 9548 | } |
9549 | 9549 | |
9550 | 9550 | /** |
9551 | - * Counts all month airline |
|
9552 | - * |
|
9553 | - * @return Array the month list |
|
9554 | - * |
|
9555 | - */ |
|
9551 | + * Counts all month airline |
|
9552 | + * |
|
9553 | + * @return Array the month list |
|
9554 | + * |
|
9555 | + */ |
|
9556 | 9556 | public function countAllMonthsAirlines($filters = array()) |
9557 | 9557 | { |
9558 | 9558 | global $globalTimezone, $globalDBdriver; |
@@ -9594,11 +9594,11 @@ discard block |
||
9594 | 9594 | } |
9595 | 9595 | |
9596 | 9596 | /** |
9597 | - * Counts all month aircraft |
|
9598 | - * |
|
9599 | - * @return Array the month list |
|
9600 | - * |
|
9601 | - */ |
|
9597 | + * Counts all month aircraft |
|
9598 | + * |
|
9599 | + * @return Array the month list |
|
9600 | + * |
|
9601 | + */ |
|
9602 | 9602 | public function countAllMonthsAircrafts($filters = array()) |
9603 | 9603 | { |
9604 | 9604 | global $globalTimezone, $globalDBdriver; |
@@ -9641,11 +9641,11 @@ discard block |
||
9641 | 9641 | |
9642 | 9642 | |
9643 | 9643 | /** |
9644 | - * Counts all month aircraft |
|
9645 | - * |
|
9646 | - * @return Array the month list |
|
9647 | - * |
|
9648 | - */ |
|
9644 | + * Counts all month aircraft |
|
9645 | + * |
|
9646 | + * @return Array the month list |
|
9647 | + * |
|
9648 | + */ |
|
9649 | 9649 | public function countAllMonthsAircraftsByAirlines($filters = array()) |
9650 | 9650 | { |
9651 | 9651 | global $globalTimezone, $globalDBdriver; |
@@ -9688,11 +9688,11 @@ discard block |
||
9688 | 9688 | } |
9689 | 9689 | |
9690 | 9690 | /** |
9691 | - * Counts all month real arrival |
|
9692 | - * |
|
9693 | - * @return Array the month list |
|
9694 | - * |
|
9695 | - */ |
|
9691 | + * Counts all month real arrival |
|
9692 | + * |
|
9693 | + * @return Array the month list |
|
9694 | + * |
|
9695 | + */ |
|
9696 | 9696 | public function countAllMonthsRealArrivals($filters = array()) |
9697 | 9697 | { |
9698 | 9698 | global $globalTimezone, $globalDBdriver; |
@@ -9735,11 +9735,11 @@ discard block |
||
9735 | 9735 | |
9736 | 9736 | |
9737 | 9737 | /** |
9738 | - * Counts all month real arrival |
|
9739 | - * |
|
9740 | - * @return Array the month list |
|
9741 | - * |
|
9742 | - */ |
|
9738 | + * Counts all month real arrival |
|
9739 | + * |
|
9740 | + * @return Array the month list |
|
9741 | + * |
|
9742 | + */ |
|
9743 | 9743 | public function countAllMonthsRealArrivalsByAirlines($filters = array()) |
9744 | 9744 | { |
9745 | 9745 | global $globalTimezone, $globalDBdriver; |
@@ -9783,11 +9783,11 @@ discard block |
||
9783 | 9783 | |
9784 | 9784 | |
9785 | 9785 | /** |
9786 | - * Counts all dates during the last year |
|
9787 | - * |
|
9788 | - * @return Array the date list |
|
9789 | - * |
|
9790 | - */ |
|
9786 | + * Counts all dates during the last year |
|
9787 | + * |
|
9788 | + * @return Array the date list |
|
9789 | + * |
|
9790 | + */ |
|
9791 | 9791 | public function countAllMonthsLastYear($filters) |
9792 | 9792 | { |
9793 | 9793 | global $globalTimezone, $globalDBdriver; |
@@ -9809,7 +9809,7 @@ discard block |
||
9809 | 9809 | $query .= " GROUP BY year_name, month_name |
9810 | 9810 | ORDER BY year_name, month_name ASC"; |
9811 | 9811 | $query_data = array(':offset' => $offset); |
9812 | - } |
|
9812 | + } |
|
9813 | 9813 | |
9814 | 9814 | $sth = $this->db->prepare($query); |
9815 | 9815 | $sth->execute($query_data); |
@@ -9832,11 +9832,11 @@ discard block |
||
9832 | 9832 | |
9833 | 9833 | |
9834 | 9834 | /** |
9835 | - * Counts all hours |
|
9836 | - * |
|
9837 | - * @return Array the hour list |
|
9838 | - * |
|
9839 | - */ |
|
9835 | + * Counts all hours |
|
9836 | + * |
|
9837 | + * @return Array the hour list |
|
9838 | + * |
|
9839 | + */ |
|
9840 | 9840 | public function countAllHours($orderby,$filters = array()) |
9841 | 9841 | { |
9842 | 9842 | global $globalTimezone, $globalDBdriver; |
@@ -9897,11 +9897,11 @@ discard block |
||
9897 | 9897 | } |
9898 | 9898 | |
9899 | 9899 | /** |
9900 | - * Counts all hours |
|
9901 | - * |
|
9902 | - * @return Array the hour list |
|
9903 | - * |
|
9904 | - */ |
|
9900 | + * Counts all hours |
|
9901 | + * |
|
9902 | + * @return Array the hour list |
|
9903 | + * |
|
9904 | + */ |
|
9905 | 9905 | public function countAllHoursByAirlines($orderby, $filters = array()) |
9906 | 9906 | { |
9907 | 9907 | global $globalTimezone, $globalDBdriver; |
@@ -9964,11 +9964,11 @@ discard block |
||
9964 | 9964 | |
9965 | 9965 | |
9966 | 9966 | /** |
9967 | - * Counts all hours by airline |
|
9968 | - * |
|
9969 | - * @return Array the hour list |
|
9970 | - * |
|
9971 | - */ |
|
9967 | + * Counts all hours by airline |
|
9968 | + * |
|
9969 | + * @return Array the hour list |
|
9970 | + * |
|
9971 | + */ |
|
9972 | 9972 | public function countAllHoursByAirline($airline_icao, $filters = array()) |
9973 | 9973 | { |
9974 | 9974 | global $globalTimezone, $globalDBdriver; |
@@ -10014,11 +10014,11 @@ discard block |
||
10014 | 10014 | |
10015 | 10015 | |
10016 | 10016 | /** |
10017 | - * Counts all hours by aircraft |
|
10018 | - * |
|
10019 | - * @return Array the hour list |
|
10020 | - * |
|
10021 | - */ |
|
10017 | + * Counts all hours by aircraft |
|
10018 | + * |
|
10019 | + * @return Array the hour list |
|
10020 | + * |
|
10021 | + */ |
|
10022 | 10022 | public function countAllHoursByAircraft($aircraft_icao, $filters = array()) |
10023 | 10023 | { |
10024 | 10024 | global $globalTimezone, $globalDBdriver; |
@@ -10061,11 +10061,11 @@ discard block |
||
10061 | 10061 | |
10062 | 10062 | |
10063 | 10063 | /** |
10064 | - * Counts all hours by aircraft registration |
|
10065 | - * |
|
10066 | - * @return Array the hour list |
|
10067 | - * |
|
10068 | - */ |
|
10064 | + * Counts all hours by aircraft registration |
|
10065 | + * |
|
10066 | + * @return Array the hour list |
|
10067 | + * |
|
10068 | + */ |
|
10069 | 10069 | public function countAllHoursByRegistration($registration, $filters = array()) |
10070 | 10070 | { |
10071 | 10071 | global $globalTimezone, $globalDBdriver; |
@@ -10108,11 +10108,11 @@ discard block |
||
10108 | 10108 | |
10109 | 10109 | |
10110 | 10110 | /** |
10111 | - * Counts all hours by airport |
|
10112 | - * |
|
10113 | - * @return Array the hour list |
|
10114 | - * |
|
10115 | - */ |
|
10111 | + * Counts all hours by airport |
|
10112 | + * |
|
10113 | + * @return Array the hour list |
|
10114 | + * |
|
10115 | + */ |
|
10116 | 10116 | public function countAllHoursByAirport($airport_icao, $filters = array()) |
10117 | 10117 | { |
10118 | 10118 | global $globalTimezone, $globalDBdriver; |
@@ -10156,11 +10156,11 @@ discard block |
||
10156 | 10156 | |
10157 | 10157 | |
10158 | 10158 | /** |
10159 | - * Counts all hours by manufacturer |
|
10160 | - * |
|
10161 | - * @return Array the hour list |
|
10162 | - * |
|
10163 | - */ |
|
10159 | + * Counts all hours by manufacturer |
|
10160 | + * |
|
10161 | + * @return Array the hour list |
|
10162 | + * |
|
10163 | + */ |
|
10164 | 10164 | public function countAllHoursByManufacturer($aircraft_manufacturer,$filters =array()) |
10165 | 10165 | { |
10166 | 10166 | global $globalTimezone, $globalDBdriver; |
@@ -10204,11 +10204,11 @@ discard block |
||
10204 | 10204 | |
10205 | 10205 | |
10206 | 10206 | /** |
10207 | - * Counts all hours by date |
|
10208 | - * |
|
10209 | - * @return Array the hour list |
|
10210 | - * |
|
10211 | - */ |
|
10207 | + * Counts all hours by date |
|
10208 | + * |
|
10209 | + * @return Array the hour list |
|
10210 | + * |
|
10211 | + */ |
|
10212 | 10212 | public function countAllHoursByDate($date, $filters = array()) |
10213 | 10213 | { |
10214 | 10214 | global $globalTimezone, $globalDBdriver; |
@@ -10252,11 +10252,11 @@ discard block |
||
10252 | 10252 | |
10253 | 10253 | |
10254 | 10254 | /** |
10255 | - * Counts all hours by a ident/callsign |
|
10256 | - * |
|
10257 | - * @return Array the hour list |
|
10258 | - * |
|
10259 | - */ |
|
10255 | + * Counts all hours by a ident/callsign |
|
10256 | + * |
|
10257 | + * @return Array the hour list |
|
10258 | + * |
|
10259 | + */ |
|
10260 | 10260 | public function countAllHoursByIdent($ident, $filters = array()) |
10261 | 10261 | { |
10262 | 10262 | global $globalTimezone, $globalDBdriver; |
@@ -10299,11 +10299,11 @@ discard block |
||
10299 | 10299 | } |
10300 | 10300 | |
10301 | 10301 | /** |
10302 | - * Counts all hours by a owner |
|
10303 | - * |
|
10304 | - * @return Array the hour list |
|
10305 | - * |
|
10306 | - */ |
|
10302 | + * Counts all hours by a owner |
|
10303 | + * |
|
10304 | + * @return Array the hour list |
|
10305 | + * |
|
10306 | + */ |
|
10307 | 10307 | public function countAllHoursByOwner($owner, $filters = array()) |
10308 | 10308 | { |
10309 | 10309 | global $globalTimezone, $globalDBdriver; |
@@ -10346,11 +10346,11 @@ discard block |
||
10346 | 10346 | } |
10347 | 10347 | |
10348 | 10348 | /** |
10349 | - * Counts all hours by a pilot |
|
10350 | - * |
|
10351 | - * @return Array the hour list |
|
10352 | - * |
|
10353 | - */ |
|
10349 | + * Counts all hours by a pilot |
|
10350 | + * |
|
10351 | + * @return Array the hour list |
|
10352 | + * |
|
10353 | + */ |
|
10354 | 10354 | public function countAllHoursByPilot($pilot, $filters = array()) |
10355 | 10355 | { |
10356 | 10356 | global $globalTimezone, $globalDBdriver; |
@@ -10395,11 +10395,11 @@ discard block |
||
10395 | 10395 | |
10396 | 10396 | |
10397 | 10397 | /** |
10398 | - * Counts all hours by route |
|
10399 | - * |
|
10400 | - * @return Array the hour list |
|
10401 | - * |
|
10402 | - */ |
|
10398 | + * Counts all hours by route |
|
10399 | + * |
|
10400 | + * @return Array the hour list |
|
10401 | + * |
|
10402 | + */ |
|
10403 | 10403 | public function countAllHoursByRoute($departure_airport_icao, $arrival_airport_icao, $filters =array()) |
10404 | 10404 | { |
10405 | 10405 | global $globalTimezone, $globalDBdriver; |
@@ -10443,11 +10443,11 @@ discard block |
||
10443 | 10443 | |
10444 | 10444 | |
10445 | 10445 | /** |
10446 | - * Counts all hours by country |
|
10447 | - * |
|
10448 | - * @return Array the hour list |
|
10449 | - * |
|
10450 | - */ |
|
10446 | + * Counts all hours by country |
|
10447 | + * |
|
10448 | + * @return Array the hour list |
|
10449 | + * |
|
10450 | + */ |
|
10451 | 10451 | public function countAllHoursByCountry($country, $filters = array()) |
10452 | 10452 | { |
10453 | 10453 | global $globalTimezone, $globalDBdriver; |
@@ -10492,11 +10492,11 @@ discard block |
||
10492 | 10492 | |
10493 | 10493 | |
10494 | 10494 | /** |
10495 | - * Counts all aircraft that have flown over |
|
10496 | - * |
|
10497 | - * @return Integer the number of aircrafts |
|
10498 | - * |
|
10499 | - */ |
|
10495 | + * Counts all aircraft that have flown over |
|
10496 | + * |
|
10497 | + * @return Integer the number of aircrafts |
|
10498 | + * |
|
10499 | + */ |
|
10500 | 10500 | public function countOverallAircrafts($filters = array(),$year = '',$month = '') |
10501 | 10501 | { |
10502 | 10502 | global $globalDBdriver; |
@@ -10529,11 +10529,11 @@ discard block |
||
10529 | 10529 | } |
10530 | 10530 | |
10531 | 10531 | /** |
10532 | - * Counts all flight that really arrival |
|
10533 | - * |
|
10534 | - * @return Integer the number of aircrafts |
|
10535 | - * |
|
10536 | - */ |
|
10532 | + * Counts all flight that really arrival |
|
10533 | + * |
|
10534 | + * @return Integer the number of aircrafts |
|
10535 | + * |
|
10536 | + */ |
|
10537 | 10537 | public function countOverallArrival($filters = array(),$year = '',$month = '') |
10538 | 10538 | { |
10539 | 10539 | global $globalDBdriver; |
@@ -10566,11 +10566,11 @@ discard block |
||
10566 | 10566 | } |
10567 | 10567 | |
10568 | 10568 | /** |
10569 | - * Counts all pilots that have flown over |
|
10570 | - * |
|
10571 | - * @return Integer the number of pilots |
|
10572 | - * |
|
10573 | - */ |
|
10569 | + * Counts all pilots that have flown over |
|
10570 | + * |
|
10571 | + * @return Integer the number of pilots |
|
10572 | + * |
|
10573 | + */ |
|
10574 | 10574 | public function countOverallPilots($filters = array(),$year = '',$month = '') |
10575 | 10575 | { |
10576 | 10576 | global $globalDBdriver; |
@@ -10602,11 +10602,11 @@ discard block |
||
10602 | 10602 | } |
10603 | 10603 | |
10604 | 10604 | /** |
10605 | - * Counts all owners that have flown over |
|
10606 | - * |
|
10607 | - * @return Integer the number of owners |
|
10608 | - * |
|
10609 | - */ |
|
10605 | + * Counts all owners that have flown over |
|
10606 | + * |
|
10607 | + * @return Integer the number of owners |
|
10608 | + * |
|
10609 | + */ |
|
10610 | 10610 | public function countOverallOwners($filters = array(),$year = '',$month = '') |
10611 | 10611 | { |
10612 | 10612 | global $globalDBdriver; |
@@ -10639,11 +10639,11 @@ discard block |
||
10639 | 10639 | |
10640 | 10640 | |
10641 | 10641 | /** |
10642 | - * Counts all flights that have flown over |
|
10643 | - * |
|
10644 | - * @return Integer the number of flights |
|
10645 | - * |
|
10646 | - */ |
|
10642 | + * Counts all flights that have flown over |
|
10643 | + * |
|
10644 | + * @return Integer the number of flights |
|
10645 | + * |
|
10646 | + */ |
|
10647 | 10647 | public function countOverallFlights($filters = array(),$year = '',$month = '') |
10648 | 10648 | { |
10649 | 10649 | global $globalDBdriver; |
@@ -10678,11 +10678,11 @@ discard block |
||
10678 | 10678 | } |
10679 | 10679 | |
10680 | 10680 | /** |
10681 | - * Counts all military flights that have flown over |
|
10682 | - * |
|
10683 | - * @return Integer the number of flights |
|
10684 | - * |
|
10685 | - */ |
|
10681 | + * Counts all military flights that have flown over |
|
10682 | + * |
|
10683 | + * @return Integer the number of flights |
|
10684 | + * |
|
10685 | + */ |
|
10686 | 10686 | public function countOverallMilitaryFlights($filters = array(),$year = '',$month = '') |
10687 | 10687 | { |
10688 | 10688 | global $globalDBdriver; |
@@ -10717,11 +10717,11 @@ discard block |
||
10717 | 10717 | |
10718 | 10718 | |
10719 | 10719 | /** |
10720 | - * Counts all airlines that have flown over |
|
10721 | - * |
|
10722 | - * @return Integer the number of airlines |
|
10723 | - * |
|
10724 | - */ |
|
10720 | + * Counts all airlines that have flown over |
|
10721 | + * |
|
10722 | + * @return Integer the number of airlines |
|
10723 | + * |
|
10724 | + */ |
|
10725 | 10725 | public function countOverallAirlines($filters = array(),$year = '',$month = '') |
10726 | 10726 | { |
10727 | 10727 | global $globalDBdriver; |
@@ -10748,8 +10748,8 @@ discard block |
||
10748 | 10748 | $query_values = array_merge($query_values,array(':month' => $month)); |
10749 | 10749 | } |
10750 | 10750 | } |
10751 | - if ($query == '') $queryi .= $this->getFilter($filters); |
|
10752 | - else $queryi .= $this->getFilter($filters,true,true).substr($query,4); |
|
10751 | + if ($query == '') $queryi .= $this->getFilter($filters); |
|
10752 | + else $queryi .= $this->getFilter($filters,true,true).substr($query,4); |
|
10753 | 10753 | |
10754 | 10754 | |
10755 | 10755 | $sth = $this->db->prepare($queryi); |
@@ -10759,11 +10759,11 @@ discard block |
||
10759 | 10759 | |
10760 | 10760 | |
10761 | 10761 | /** |
10762 | - * Counts all hours of today |
|
10763 | - * |
|
10764 | - * @return Array the hour list |
|
10765 | - * |
|
10766 | - */ |
|
10762 | + * Counts all hours of today |
|
10763 | + * |
|
10764 | + * @return Array the hour list |
|
10765 | + * |
|
10766 | + */ |
|
10767 | 10767 | public function countAllHoursFromToday($filters = array()) |
10768 | 10768 | { |
10769 | 10769 | global $globalTimezone, $globalDBdriver; |
@@ -10803,11 +10803,11 @@ discard block |
||
10803 | 10803 | } |
10804 | 10804 | |
10805 | 10805 | /** |
10806 | - * Gets all the spotter information based on calculated upcoming flights |
|
10807 | - * |
|
10808 | - * @return Array the spotter information |
|
10809 | - * |
|
10810 | - */ |
|
10806 | + * Gets all the spotter information based on calculated upcoming flights |
|
10807 | + * |
|
10808 | + * @return Array the spotter information |
|
10809 | + * |
|
10810 | + */ |
|
10811 | 10811 | public function getUpcomingFlights($limit = '', $sort = '', $filters = array()) |
10812 | 10812 | { |
10813 | 10813 | global $global_query, $globalDBdriver, $globalTimezone; |
@@ -10882,12 +10882,12 @@ discard block |
||
10882 | 10882 | } |
10883 | 10883 | |
10884 | 10884 | |
10885 | - /** |
|
10886 | - * Gets the Barrie Spotter ID based on the FlightAware ID |
|
10887 | - * |
|
10888 | - * @return Integer the Barrie Spotter ID |
|
10885 | + /** |
|
10886 | + * Gets the Barrie Spotter ID based on the FlightAware ID |
|
10887 | + * |
|
10888 | + * @return Integer the Barrie Spotter ID |
|
10889 | 10889 | q * |
10890 | - */ |
|
10890 | + */ |
|
10891 | 10891 | public function getSpotterIDBasedOnFlightAwareID($flightaware_id) |
10892 | 10892 | { |
10893 | 10893 | $flightaware_id = filter_var($flightaware_id,FILTER_SANITIZE_STRING); |
@@ -10908,13 +10908,13 @@ discard block |
||
10908 | 10908 | |
10909 | 10909 | |
10910 | 10910 | /** |
10911 | - * Parses a date string |
|
10912 | - * |
|
10913 | - * @param String $dateString the date string |
|
10914 | - * @param String $timezone the timezone of a user |
|
10915 | - * @return Array the time information |
|
10916 | - * |
|
10917 | - */ |
|
10911 | + * Parses a date string |
|
10912 | + * |
|
10913 | + * @param String $dateString the date string |
|
10914 | + * @param String $timezone the timezone of a user |
|
10915 | + * @return Array the time information |
|
10916 | + * |
|
10917 | + */ |
|
10918 | 10918 | public function parseDateString($dateString, $timezone = '') |
10919 | 10919 | { |
10920 | 10920 | $time_array = array(); |
@@ -10950,12 +10950,12 @@ discard block |
||
10950 | 10950 | |
10951 | 10951 | |
10952 | 10952 | /** |
10953 | - * Parses the direction degrees to working |
|
10954 | - * |
|
10955 | - * @param Float $direction the direction in degrees |
|
10956 | - * @return Array the direction information |
|
10957 | - * |
|
10958 | - */ |
|
10953 | + * Parses the direction degrees to working |
|
10954 | + * |
|
10955 | + * @param Float $direction the direction in degrees |
|
10956 | + * @return Array the direction information |
|
10957 | + * |
|
10958 | + */ |
|
10959 | 10959 | public function parseDirection($direction = 0) |
10960 | 10960 | { |
10961 | 10961 | if ($direction == '') $direction = 0; |
@@ -11034,12 +11034,12 @@ discard block |
||
11034 | 11034 | |
11035 | 11035 | |
11036 | 11036 | /** |
11037 | - * Gets the aircraft registration |
|
11038 | - * |
|
11039 | - * @param String $flightaware_id the flight aware id |
|
11040 | - * @return String the aircraft registration |
|
11041 | - * |
|
11042 | - */ |
|
11037 | + * Gets the aircraft registration |
|
11038 | + * |
|
11039 | + * @param String $flightaware_id the flight aware id |
|
11040 | + * @return String the aircraft registration |
|
11041 | + * |
|
11042 | + */ |
|
11043 | 11043 | |
11044 | 11044 | public function getAircraftRegistration($flightaware_id) |
11045 | 11045 | { |
@@ -11068,12 +11068,12 @@ discard block |
||
11068 | 11068 | |
11069 | 11069 | |
11070 | 11070 | /** |
11071 | - * Gets the aircraft registration from ModeS |
|
11072 | - * |
|
11073 | - * @param String $aircraft_modes the flight ModeS in hex |
|
11074 | - * @return String the aircraft registration |
|
11075 | - * |
|
11076 | - */ |
|
11071 | + * Gets the aircraft registration from ModeS |
|
11072 | + * |
|
11073 | + * @param String $aircraft_modes the flight ModeS in hex |
|
11074 | + * @return String the aircraft registration |
|
11075 | + * |
|
11076 | + */ |
|
11077 | 11077 | public function getAircraftRegistrationBymodeS($aircraft_modes) |
11078 | 11078 | { |
11079 | 11079 | $aircraft_modes = filter_var($aircraft_modes,FILTER_SANITIZE_STRING); |
@@ -11086,19 +11086,19 @@ discard block |
||
11086 | 11086 | $row = $sth->fetch(PDO::FETCH_ASSOC); |
11087 | 11087 | $sth->closeCursor(); |
11088 | 11088 | if (count($row) > 0) { |
11089 | - //return $row['Registration']; |
|
11090 | - return $row['registration']; |
|
11089 | + //return $row['Registration']; |
|
11090 | + return $row['registration']; |
|
11091 | 11091 | } else return ''; |
11092 | 11092 | |
11093 | 11093 | } |
11094 | 11094 | |
11095 | 11095 | /** |
11096 | - * Gets the aircraft type from ModeS |
|
11097 | - * |
|
11098 | - * @param String $aircraft_modes the flight ModeS in hex |
|
11099 | - * @return String the aircraft type |
|
11100 | - * |
|
11101 | - */ |
|
11096 | + * Gets the aircraft type from ModeS |
|
11097 | + * |
|
11098 | + * @param String $aircraft_modes the flight ModeS in hex |
|
11099 | + * @return String the aircraft type |
|
11100 | + * |
|
11101 | + */ |
|
11102 | 11102 | public function getAircraftTypeBymodeS($aircraft_modes) |
11103 | 11103 | { |
11104 | 11104 | $aircraft_modes = filter_var($aircraft_modes,FILTER_SANITIZE_STRING); |
@@ -11111,19 +11111,19 @@ discard block |
||
11111 | 11111 | $row = $sth->fetch(PDO::FETCH_ASSOC); |
11112 | 11112 | $sth->closeCursor(); |
11113 | 11113 | if (count($row) > 0) { |
11114 | - if ($row['type_flight'] == null) return ''; |
|
11115 | - else return $row['type_flight']; |
|
11114 | + if ($row['type_flight'] == null) return ''; |
|
11115 | + else return $row['type_flight']; |
|
11116 | 11116 | } else return ''; |
11117 | 11117 | |
11118 | 11118 | } |
11119 | 11119 | |
11120 | 11120 | /** |
11121 | - * Gets Country from latitude/longitude |
|
11122 | - * |
|
11123 | - * @param Float $latitude latitute of the flight |
|
11124 | - * @param Float $longitude longitute of the flight |
|
11125 | - * @return String the countrie |
|
11126 | - */ |
|
11121 | + * Gets Country from latitude/longitude |
|
11122 | + * |
|
11123 | + * @param Float $latitude latitute of the flight |
|
11124 | + * @param Float $longitude longitute of the flight |
|
11125 | + * @return String the countrie |
|
11126 | + */ |
|
11127 | 11127 | public function getCountryFromLatitudeLongitude($latitude,$longitude) |
11128 | 11128 | { |
11129 | 11129 | global $globalDBdriver, $globalDebug; |
@@ -11160,11 +11160,11 @@ discard block |
||
11160 | 11160 | } |
11161 | 11161 | |
11162 | 11162 | /** |
11163 | - * Gets Country from iso2 |
|
11164 | - * |
|
11165 | - * @param String $iso2 ISO2 country code |
|
11166 | - * @return String the countrie |
|
11167 | - */ |
|
11163 | + * Gets Country from iso2 |
|
11164 | + * |
|
11165 | + * @param String $iso2 ISO2 country code |
|
11166 | + * @return String the countrie |
|
11167 | + */ |
|
11168 | 11168 | public function getCountryFromISO2($iso2) |
11169 | 11169 | { |
11170 | 11170 | global $globalDBdriver, $globalDebug; |
@@ -11192,12 +11192,12 @@ discard block |
||
11192 | 11192 | } |
11193 | 11193 | |
11194 | 11194 | /** |
11195 | - * converts the registration code using the country prefix |
|
11196 | - * |
|
11197 | - * @param String $registration the aircraft registration |
|
11198 | - * @return String the aircraft registration |
|
11199 | - * |
|
11200 | - */ |
|
11195 | + * converts the registration code using the country prefix |
|
11196 | + * |
|
11197 | + * @param String $registration the aircraft registration |
|
11198 | + * @return String the aircraft registration |
|
11199 | + * |
|
11200 | + */ |
|
11201 | 11201 | public function convertAircraftRegistration($registration) |
11202 | 11202 | { |
11203 | 11203 | $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
@@ -11249,12 +11249,12 @@ discard block |
||
11249 | 11249 | } |
11250 | 11250 | |
11251 | 11251 | /** |
11252 | - * Country from the registration code |
|
11253 | - * |
|
11254 | - * @param String $registration the aircraft registration |
|
11255 | - * @return String the country |
|
11256 | - * |
|
11257 | - */ |
|
11252 | + * Country from the registration code |
|
11253 | + * |
|
11254 | + * @param String $registration the aircraft registration |
|
11255 | + * @return String the country |
|
11256 | + * |
|
11257 | + */ |
|
11258 | 11258 | public function countryFromAircraftRegistration($registration) |
11259 | 11259 | { |
11260 | 11260 | $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
@@ -11273,8 +11273,8 @@ discard block |
||
11273 | 11273 | $country = $row['country']; |
11274 | 11274 | } |
11275 | 11275 | } else { |
11276 | - $registration_1 = substr($registration, 0, 1); |
|
11277 | - $registration_2 = substr($registration, 0, 2); |
|
11276 | + $registration_1 = substr($registration, 0, 1); |
|
11277 | + $registration_2 = substr($registration, 0, 2); |
|
11278 | 11278 | |
11279 | 11279 | $country = ''; |
11280 | 11280 | //first get the prefix based on two characters |
@@ -11310,12 +11310,12 @@ discard block |
||
11310 | 11310 | } |
11311 | 11311 | |
11312 | 11312 | /** |
11313 | - * Registration prefix from the registration code |
|
11314 | - * |
|
11315 | - * @param String $registration the aircraft registration |
|
11316 | - * @return String the registration prefix |
|
11317 | - * |
|
11318 | - */ |
|
11313 | + * Registration prefix from the registration code |
|
11314 | + * |
|
11315 | + * @param String $registration the aircraft registration |
|
11316 | + * @return String the registration prefix |
|
11317 | + * |
|
11318 | + */ |
|
11319 | 11319 | public function registrationPrefixFromAircraftRegistration($registration) |
11320 | 11320 | { |
11321 | 11321 | $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
@@ -11334,8 +11334,8 @@ discard block |
||
11334 | 11334 | //$country = $row['country']; |
11335 | 11335 | } |
11336 | 11336 | } else { |
11337 | - $registration_1 = substr($registration, 0, 1); |
|
11338 | - $registration_2 = substr($registration, 0, 2); |
|
11337 | + $registration_1 = substr($registration, 0, 1); |
|
11338 | + $registration_2 = substr($registration, 0, 2); |
|
11339 | 11339 | |
11340 | 11340 | //first get the prefix based on two characters |
11341 | 11341 | $query = "SELECT aircraft_registration.registration_prefix, aircraft_registration.country FROM aircraft_registration WHERE registration_prefix = :registration_2 LIMIT 1"; |
@@ -11371,12 +11371,12 @@ discard block |
||
11371 | 11371 | |
11372 | 11372 | |
11373 | 11373 | /** |
11374 | - * Country from the registration code |
|
11375 | - * |
|
11376 | - * @param String $registration the aircraft registration |
|
11377 | - * @return String the country |
|
11378 | - * |
|
11379 | - */ |
|
11374 | + * Country from the registration code |
|
11375 | + * |
|
11376 | + * @param String $registration the aircraft registration |
|
11377 | + * @return String the country |
|
11378 | + * |
|
11379 | + */ |
|
11380 | 11380 | public function countryFromAircraftRegistrationCode($registration) |
11381 | 11381 | { |
11382 | 11382 | $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
@@ -11393,11 +11393,11 @@ discard block |
||
11393 | 11393 | } |
11394 | 11394 | |
11395 | 11395 | /** |
11396 | - * Set a new highlight value for a flight |
|
11397 | - * |
|
11398 | - * @param String $flightaware_id flightaware_id from spotter_output table |
|
11399 | - * @param String $highlight New highlight value |
|
11400 | - */ |
|
11396 | + * Set a new highlight value for a flight |
|
11397 | + * |
|
11398 | + * @param String $flightaware_id flightaware_id from spotter_output table |
|
11399 | + * @param String $highlight New highlight value |
|
11400 | + */ |
|
11401 | 11401 | public function setHighlightFlight($flightaware_id,$highlight) { |
11402 | 11402 | |
11403 | 11403 | $query = "UPDATE spotter_output SET highlight = :highlight WHERE flightaware_id = :flightaware_id"; |
@@ -11406,12 +11406,12 @@ discard block |
||
11406 | 11406 | } |
11407 | 11407 | |
11408 | 11408 | /** |
11409 | - * Set a new highlight value for a flight by Registration |
|
11410 | - * |
|
11411 | - * @param String $registration Registration of the aircraft |
|
11412 | - * @param String $date Date of spotted aircraft |
|
11413 | - * @param String $highlight New highlight value |
|
11414 | - */ |
|
11409 | + * Set a new highlight value for a flight by Registration |
|
11410 | + * |
|
11411 | + * @param String $registration Registration of the aircraft |
|
11412 | + * @param String $date Date of spotted aircraft |
|
11413 | + * @param String $highlight New highlight value |
|
11414 | + */ |
|
11415 | 11415 | public function setHighlightFlightByRegistration($registration,$highlight, $date = '') { |
11416 | 11416 | if ($date == '') { |
11417 | 11417 | $query = "UPDATE spotter_output SET highlight = :highlight WHERE spotter_id IN (SELECT MAX(spotter_id) FROM spotter_output WHERE registration = :registration)"; |
@@ -11425,12 +11425,12 @@ discard block |
||
11425 | 11425 | } |
11426 | 11426 | |
11427 | 11427 | /** |
11428 | - * Gets the short url from bit.ly |
|
11429 | - * |
|
11430 | - * @param String $url the full url |
|
11431 | - * @return String the bit.ly url |
|
11432 | - * |
|
11433 | - */ |
|
11428 | + * Gets the short url from bit.ly |
|
11429 | + * |
|
11430 | + * @param String $url the full url |
|
11431 | + * @return String the bit.ly url |
|
11432 | + * |
|
11433 | + */ |
|
11434 | 11434 | public function getBitlyURL($url) |
11435 | 11435 | { |
11436 | 11436 | global $globalBitlyAccessToken; |
@@ -11719,11 +11719,11 @@ discard block |
||
11719 | 11719 | $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 |
11720 | 11720 | 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)) |
11721 | 11721 | 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;"; |
11722 | - } else { |
|
11722 | + } else { |
|
11723 | 11723 | $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 |
11724 | 11724 | 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)) |
11725 | 11725 | 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;"; |
11726 | - } |
|
11726 | + } |
|
11727 | 11727 | $sth = $this->db->prepare($query); |
11728 | 11728 | $sth->execute(); |
11729 | 11729 | return $sth->fetchAll(PDO::FETCH_ASSOC); |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | // When button "Remove all filters" is clicked |
29 | 29 | if (isset($_POST['removefilters'])) { |
30 | 30 | $allfilters = array_filter(array_keys($_COOKIE),function($key) { |
31 | - return strpos($key,'filter_') === 0; |
|
31 | + return strpos($key,'filter_') === 0; |
|
32 | 32 | }); |
33 | 33 | foreach ($allfilters as $filt) { |
34 | 34 | unset($_COOKIE[$filt]); |
@@ -167,16 +167,16 @@ discard block |
||
167 | 167 | } |
168 | 168 | ?> |
169 | 169 | <?php |
170 | - if (isset($_POST['archive'])) { |
|
170 | + if (isset($_POST['archive'])) { |
|
171 | 171 | ?> |
172 | 172 | <?php |
173 | - if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) { |
|
173 | + if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) { |
|
174 | 174 | ?> |
175 | 175 | |
176 | 176 | <script src="<?php print $globalURL; ?>/js/map.js.php?<?php print time(); ?>&archive&begindate=<?php print strtotime($_POST['start_date']); ?>&enddate=<?php print strtotime($_POST['end_date']); ?>&archivespeed=<?php print $_POST['archivespeed']; ?>"></script> |
177 | 177 | <?php |
178 | - } |
|
179 | - } else { |
|
178 | + } |
|
179 | + } else { |
|
180 | 180 | ?> |
181 | 181 | <?php |
182 | 182 | /* if (isset($globalBeta) && $globalBeta) { |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | */ |
189 | 189 | ?> |
190 | 190 | <?php |
191 | - if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) { |
|
191 | + if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) { |
|
192 | 192 | ?> |
193 | 193 | <?php |
194 | 194 | // if (isset($globalBeta) && $globalBeta) { |
@@ -199,13 +199,13 @@ discard block |
||
199 | 199 | ?> |
200 | 200 | <script src="<?php print $globalURL; ?>/js/map.js.php?<?php print time(); ?>"></script> |
201 | 201 | <?php |
202 | - } |
|
202 | + } |
|
203 | 203 | ?> |
204 | 204 | <?php |
205 | 205 | // } |
206 | 206 | ?> |
207 | 207 | <?php |
208 | - } |
|
208 | + } |
|
209 | 209 | } |
210 | 210 | ?> |
211 | 211 | <?php |
@@ -360,15 +360,15 @@ discard block |
||
360 | 360 | <li><a href="<?php print $globalURL; ?>/airline"><?php echo _("Airlines"); ?></a></li> |
361 | 361 | <li><a href="<?php print $globalURL; ?>/airport"><?php echo _("Airports"); ?></a></li> |
362 | 362 | <?php |
363 | - if ((!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS) && (!isset($globalVAM) || !$globalVAM)) { |
|
363 | + if ((!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS) && (!isset($globalVAM) || !$globalVAM)) { |
|
364 | 364 | ?> |
365 | 365 | <li><a href="<?php print $globalURL; ?>/owner"><?php echo _("Owners"); ?></a></li> |
366 | 366 | <?php |
367 | - } else { |
|
367 | + } else { |
|
368 | 368 | ?> |
369 | 369 | <li><a href="<?php print $globalURL; ?>/pilot"><?php echo _("Pilots"); ?></a></li> |
370 | 370 | <?php |
371 | - } |
|
371 | + } |
|
372 | 372 | ?> |
373 | 373 | <li><hr /></li> |
374 | 374 | <li><a href="<?php print $globalURL; ?>/currently"><?php echo _("Current Activity"); ?></a></li> |
@@ -376,34 +376,34 @@ discard block |
||
376 | 376 | <li><a href="<?php print $globalURL; ?>/date/<?php print date("Y-m-d"); ?>"><?php echo _("Today's Activity"); ?></a></li> |
377 | 377 | <li><a href="<?php print $globalURL; ?>/newest"><?php echo _("Newest by Category"); ?></a></li> |
378 | 378 | <?php |
379 | - if ($globalACARS) { |
|
380 | - if (isset($globalDemo) && $globalDemo) { |
|
381 | - ?> |
|
379 | + if ($globalACARS) { |
|
380 | + if (isset($globalDemo) && $globalDemo) { |
|
381 | + ?> |
|
382 | 382 | <li><hr /></li> |
383 | 383 | <li><i><?php echo _('ACARS data not available publicly'); ?></i></li> |
384 | 384 | <li><a href=""><?php echo _('Latest ACARS messages'); ?></a></li> |
385 | 385 | <li><a href=""><?php echo _('Archive ACARS messages'); ?></a></li> |
386 | 386 | <?php |
387 | - } else { |
|
388 | - ?> |
|
387 | + } else { |
|
388 | + ?> |
|
389 | 389 | <li><hr /></li> |
390 | 390 | <li><a href="<?php print $globalURL; ?>/acars-latest"><?php echo _("Latest ACARS messages"); ?></a></li> |
391 | 391 | <li><a href="<?php print $globalURL; ?>/acars-archive"><?php echo _("Archive ACARS messages"); ?></a></li> |
392 | 392 | <?php |
393 | - } |
|
394 | - } |
|
395 | - ?> |
|
393 | + } |
|
394 | + } |
|
395 | + ?> |
|
396 | 396 | <?php |
397 | - if (isset($globalAccidents) && $globalAccidents) { |
|
398 | - ?> |
|
397 | + if (isset($globalAccidents) && $globalAccidents) { |
|
398 | + ?> |
|
399 | 399 | <li><hr /></li> |
400 | 400 | <li><a href="<?php print $globalURL; ?>/accident-latest"><?php echo _("Latest accident messages"); ?></a></li> |
401 | 401 | <li><a href="<?php print $globalURL; ?>/accident/<?php print date("Y-m-d"); ?>"><?php echo _("Today's Accident"); ?></a></li> |
402 | 402 | <li><a href="<?php print $globalURL; ?>/incident-latest"><?php echo _("Latest incident messages"); ?></a></li> |
403 | 403 | <li><a href="<?php print $globalURL; ?>/incident/<?php print date("Y-m-d"); ?>"><?php echo _("Today's Incident"); ?></a></li> |
404 | 404 | <?php |
405 | - } |
|
406 | - ?> |
|
405 | + } |
|
406 | + ?> |
|
407 | 407 | <li><hr /></li> |
408 | 408 | <li><a href="<?php print $globalURL; ?>/highlights/table"><?php echo _("Special Highlights"); ?></a></li> |
409 | 409 | <li><a href="<?php print $globalURL; ?>/upcoming"><?php echo _("Upcoming Flights"); ?></a></li> |
@@ -445,14 +445,14 @@ discard block |
||
445 | 445 | <form> |
446 | 446 | <select class="selectpicker" data-width="120px" onchange="language(this);"> |
447 | 447 | <?php |
448 | - $Language = new Language(); |
|
449 | - $alllang = $Language->getLanguages(); |
|
450 | - foreach ($alllang as $key => $lang) { |
|
451 | - print '<option value="'.$key.'"'; |
|
452 | - if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) print ' selected '; |
|
453 | - print '>'.$lang[0].'</option>'; |
|
454 | - } |
|
455 | - ?> |
|
448 | + $Language = new Language(); |
|
449 | + $alllang = $Language->getLanguages(); |
|
450 | + foreach ($alllang as $key => $lang) { |
|
451 | + print '<option value="'.$key.'"'; |
|
452 | + if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) print ' selected '; |
|
453 | + print '>'.$lang[0].'</option>'; |
|
454 | + } |
|
455 | + ?> |
|
456 | 456 | </select> |
457 | 457 | </form> |
458 | 458 | </div> |
@@ -483,18 +483,18 @@ discard block |
||
483 | 483 | ?> |
484 | 484 | <div class="top-header clear" role="main"> |
485 | 485 | <?php |
486 | - if (isset($longitude) && isset($latitude) && $longitude != 0 && $latitude != 0) { |
|
486 | + if (isset($longitude) && isset($latitude) && $longitude != 0 && $latitude != 0) { |
|
487 | 487 | ?> |
488 | 488 | <div id="archive-map"></div> |
489 | 489 | <?php |
490 | - } |
|
490 | + } |
|
491 | 491 | ?> |
492 | 492 | </div> |
493 | 493 | <?php |
494 | 494 | } |
495 | 495 | if ((strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false) || (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false)) |
496 | 496 | { |
497 | - ?> |
|
497 | + ?> |
|
498 | 498 | <div class="top-header clear" role="main"> |
499 | 499 | <div id="map"></div> |
500 | 500 | <link rel="stylesheet" href="<?php print $globalURL; ?>/css/leaflet.css" /> |
@@ -505,15 +505,15 @@ discard block |
||
505 | 505 | var zoom = 13; |
506 | 506 | //create the map |
507 | 507 | <?php |
508 | - if (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($airport_array[0]['latitude'])) { |
|
508 | + if (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($airport_array[0]['latitude'])) { |
|
509 | 509 | ?> |
510 | 510 | map = L.map('map', { zoomControl:true }).setView([<?php print $airport_array[0]['latitude']; ?>,<?php print $airport_array[0]['longitude']; ?>], zoom); |
511 | 511 | <?php |
512 | - } elseif (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false) { |
|
512 | + } elseif (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false) { |
|
513 | 513 | ?> |
514 | 514 | map = L.map('map', { zoomControl:true }); |
515 | 515 | <?php |
516 | - } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($spotter_array[0]['departure_airport_latitude'])) { |
|
516 | + } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($spotter_array[0]['departure_airport_latitude'])) { |
|
517 | 517 | ?> |
518 | 518 | map = L.map('map', { zoomControl:true }).setView([<?php print $spotter_array[0]['departure_airport_latitude']; ?>,<?php print $spotter_array[0]['arrival_airport_longitude']; ?>]); |
519 | 519 | var line = L.polyline([[<?php print $spotter_array[0]['departure_airport_latitude']; ?>, <?php print $spotter_array[0]['departure_airport_longitude']; ?>],[<?php print $spotter_array[0]['arrival_airport_latitude']; ?>, <?php print $spotter_array[0]['arrival_airport_longitude']; ?>]]).addTo(map); |
@@ -521,22 +521,22 @@ discard block |
||
521 | 521 | var departure_airport = L.marker([<?php print $spotter_array[0]['departure_airport_latitude']; ?>, <?php print $spotter_array[0]['departure_airport_longitude']; ?>], {icon: L.icon({iconUrl: '<?php print $globalURL; ?>/images/departure_airport.png',iconSize: [16,18],iconAnchor: [8,16]})}).addTo(map); |
522 | 522 | var arrival_airport = L.marker([<?php print $spotter_array[0]['arrival_airport_latitude']; ?>, <?php print $spotter_array[0]['arrival_airport_longitude']; ?>], {icon: L.icon({iconUrl: '<?php print $globalURL; ?>/images/arrival_airport.png',iconSize: [16,18],iconAnchor: [8,16]})}).addTo(map); |
523 | 523 | <?php |
524 | - } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && !isset($spotter_array[0]['departure_airport_latitude'])) { |
|
524 | + } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && !isset($spotter_array[0]['departure_airport_latitude'])) { |
|
525 | 525 | ?> |
526 | 526 | map = L.map('map', { zoomControl:true }).setView([<?php print $spotter_array[0]['latitude']; ?>,<?php print $spotter_array[0]['longitude']; ?>]); |
527 | 527 | <?php |
528 | - } elseif (!isset($spotter_array[0]['latitude']) && !isset($spotter_array[0]['longitude'])) { |
|
528 | + } elseif (!isset($spotter_array[0]['latitude']) && !isset($spotter_array[0]['longitude'])) { |
|
529 | 529 | ?> |
530 | 530 | map = L.map('map', { zoomControl:true }); |
531 | 531 | <?php |
532 | - } |
|
532 | + } |
|
533 | 533 | ?> |
534 | 534 | //initialize the layer group for the aircrft markers |
535 | 535 | var layer_data = L.layerGroup(); |
536 | 536 | |
537 | 537 | //a few title layers |
538 | 538 | <?php |
539 | - if ($globalMapProvider == 'Mapbox') { |
|
539 | + if ($globalMapProvider == 'Mapbox') { |
|
540 | 540 | ?> |
541 | 541 | L.tileLayer('https://{s}.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={token}', { |
542 | 542 | maxZoom: 18, |
@@ -547,7 +547,7 @@ discard block |
||
547 | 547 | token : '<?php print $globalMapboxToken; ?>' |
548 | 548 | }).addTo(map); |
549 | 549 | <?php |
550 | - } elseif ($globalMapProvider == 'OpenStreetMap') { |
|
550 | + } elseif ($globalMapProvider == 'OpenStreetMap') { |
|
551 | 551 | ?> |
552 | 552 | L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { |
553 | 553 | maxZoom: 18, |
@@ -555,7 +555,7 @@ discard block |
||
555 | 555 | '<a href="http://www.openstreetmap.org/copyright">Open Database Licence</a>' |
556 | 556 | }).addTo(map); |
557 | 557 | <?php |
558 | - } elseif ($globalMapProvider == 'MapQuest-OSM') { |
|
558 | + } elseif ($globalMapProvider == 'MapQuest-OSM') { |
|
559 | 559 | ?> |
560 | 560 | L.tileLayer('http://otile1.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.png', { |
561 | 561 | maxZoom: 18, |
@@ -564,7 +564,7 @@ discard block |
||
564 | 564 | 'Tiles Courtesy of <a href="http://www.mapquest.com">MapQuest</a>' |
565 | 565 | }).addTo(map); |
566 | 566 | <?php |
567 | - } elseif ($globalMapProvider == 'MapQuest-Aerial') { |
|
567 | + } elseif ($globalMapProvider == 'MapQuest-Aerial') { |
|
568 | 568 | ?> |
569 | 569 | L.tileLayer('http://otile1.mqcdn.com/tiles/1.0.0/sat/{z}/{x}/{y}.png', { |
570 | 570 | maxZoom: 18, |
@@ -573,27 +573,27 @@ discard block |
||
573 | 573 | 'Tiles Courtesy of <a href="http://www.mapquest.com">MapQuest</a>, Portions Courtesy NASA/JPL-Caltech and U.S. Depart. of Agriculture, Farm Service Agency"' |
574 | 574 | }).addTo(map); |
575 | 575 | <?php |
576 | - } elseif ($globalMapProvider == 'Google-Roadmap') { |
|
576 | + } elseif ($globalMapProvider == 'Google-Roadmap') { |
|
577 | 577 | ?> |
578 | 578 | var googleLayer = new L.Google('ROADMAP'); |
579 | 579 | map.addLayer(googleLayer); |
580 | 580 | <?php |
581 | - } elseif ($globalMapProvider == 'Google-Satellite') { |
|
581 | + } elseif ($globalMapProvider == 'Google-Satellite') { |
|
582 | 582 | ?> |
583 | 583 | var googleLayer = new L.Google('SATELLITE'); |
584 | 584 | map.addLayer(googleLayer); |
585 | 585 | <?php |
586 | - } elseif ($globalMapProvider == 'Google-Hybrid') { |
|
586 | + } elseif ($globalMapProvider == 'Google-Hybrid') { |
|
587 | 587 | ?> |
588 | 588 | var googleLayer = new L.Google('HYBRID'); |
589 | 589 | map.addLayer(googleLayer); |
590 | 590 | <?php |
591 | - } elseif ($globalMapProvider == 'Google-Terrain') { |
|
591 | + } elseif ($globalMapProvider == 'Google-Terrain') { |
|
592 | 592 | ?> |
593 | 593 | var googleLayer = new L.Google('Terrain'); |
594 | 594 | map.addLayer(googleLayer); |
595 | 595 | <?php |
596 | - } |
|
596 | + } |
|
597 | 597 | ?> |
598 | 598 | </script> |
599 | 599 | </div> |