@@ -3,8 +3,8 @@ |
||
3 | 3 | require_once('require/class.Spotter.php'); |
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | if (!isset($_GET['pilot'])) { |
6 | - header('Location: '.$globalURL.'/pilot'); |
|
7 | - die(); |
|
6 | + header('Location: '.$globalURL.'/pilot'); |
|
7 | + die(); |
|
8 | 8 | } |
9 | 9 | $Spotter = new Spotter(); |
10 | 10 | $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
@@ -3,8 +3,8 @@ |
||
3 | 3 | require_once('require/class.Spotter.php'); |
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | if (!isset($_GET['owner'])) { |
6 | - header('Location: '.$globalURL.'/owner'); |
|
7 | - die(); |
|
6 | + header('Location: '.$globalURL.'/owner'); |
|
7 | + die(); |
|
8 | 8 | } |
9 | 9 | $Spotter = new Spotter(); |
10 | 10 | $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
@@ -3,8 +3,8 @@ |
||
3 | 3 | require_once('require/class.Spotter.php'); |
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | if (!isset($_GET['owner'])) { |
6 | - header('Location: '.$globalURL.'/owner'); |
|
7 | - die(); |
|
6 | + header('Location: '.$globalURL.'/owner'); |
|
7 | + die(); |
|
8 | 8 | } |
9 | 9 | $Spotter = new Spotter(); |
10 | 10 | $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
@@ -3,8 +3,8 @@ |
||
3 | 3 | require_once('require/class.Spotter.php'); |
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | if (!isset($_GET['owner'])) { |
6 | - header('Location: '.$globalURL.'/owner'); |
|
7 | - die(); |
|
6 | + header('Location: '.$globalURL.'/owner'); |
|
7 | + die(); |
|
8 | 8 | } |
9 | 9 | $Spotter = new Spotter(); |
10 | 10 | $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
@@ -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> |
@@ -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 | public 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; |
@@ -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); |
@@ -2886,11 +2886,11 @@ discard block |
||
2886 | 2886 | } |
2887 | 2887 | |
2888 | 2888 | /** |
2889 | - * Gets a list of all pilot names and pilot ids |
|
2890 | - * |
|
2891 | - * @return Array list of pilot names and pilot ids |
|
2892 | - * |
|
2893 | - */ |
|
2889 | + * Gets a list of all pilot names and pilot ids |
|
2890 | + * |
|
2891 | + * @return Array list of pilot names and pilot ids |
|
2892 | + * |
|
2893 | + */ |
|
2894 | 2894 | public function getAllPilotNames($filters = array()) |
2895 | 2895 | { |
2896 | 2896 | $filter_query = $this->getFilter($filters,true,true); |
@@ -2905,11 +2905,11 @@ discard block |
||
2905 | 2905 | |
2906 | 2906 | |
2907 | 2907 | /** |
2908 | - * Gets a list of all departure & arrival airport countries |
|
2909 | - * |
|
2910 | - * @return Array list of airport countries |
|
2911 | - * |
|
2912 | - */ |
|
2908 | + * Gets a list of all departure & arrival airport countries |
|
2909 | + * |
|
2910 | + * @return Array list of airport countries |
|
2911 | + * |
|
2912 | + */ |
|
2913 | 2913 | public function getAllAirportCountries($filters = array()) |
2914 | 2914 | { |
2915 | 2915 | $airport_array = array(); |
@@ -2957,11 +2957,11 @@ discard block |
||
2957 | 2957 | |
2958 | 2958 | |
2959 | 2959 | /** |
2960 | - * Gets a list of all countries (airline, departure airport & arrival airport) |
|
2961 | - * |
|
2962 | - * @return Array list of countries |
|
2963 | - * |
|
2964 | - */ |
|
2960 | + * Gets a list of all countries (airline, departure airport & arrival airport) |
|
2961 | + * |
|
2962 | + * @return Array list of countries |
|
2963 | + * |
|
2964 | + */ |
|
2965 | 2965 | public function getAllCountries($filters = array()) |
2966 | 2966 | { |
2967 | 2967 | $Connection= new Connection($this->db); |
@@ -3038,11 +3038,11 @@ discard block |
||
3038 | 3038 | |
3039 | 3039 | |
3040 | 3040 | /** |
3041 | - * Gets a list of all idents/callsigns |
|
3042 | - * |
|
3043 | - * @return Array list of ident/callsign names |
|
3044 | - * |
|
3045 | - */ |
|
3041 | + * Gets a list of all idents/callsigns |
|
3042 | + * |
|
3043 | + * @return Array list of ident/callsign names |
|
3044 | + * |
|
3045 | + */ |
|
3046 | 3046 | public function getAllIdents($filters = array()) |
3047 | 3047 | { |
3048 | 3048 | $filter_query = $this->getFilter($filters,true,true); |
@@ -3066,9 +3066,9 @@ discard block |
||
3066 | 3066 | } |
3067 | 3067 | |
3068 | 3068 | /** |
3069 | - * Get a list of flights from airport since 7 days |
|
3070 | - * @return Array number, icao, name and city of airports |
|
3071 | - */ |
|
3069 | + * Get a list of flights from airport since 7 days |
|
3070 | + * @return Array number, icao, name and city of airports |
|
3071 | + */ |
|
3072 | 3072 | |
3073 | 3073 | public function getLast7DaysAirportsDeparture($airport_icao = '',$filters = array()) { |
3074 | 3074 | global $globalTimezone, $globalDBdriver; |
@@ -3099,9 +3099,9 @@ discard block |
||
3099 | 3099 | } |
3100 | 3100 | |
3101 | 3101 | /** |
3102 | - * Get a list of flights from airport since 7 days |
|
3103 | - * @return Array number, icao, name and city of airports |
|
3104 | - */ |
|
3102 | + * Get a list of flights from airport since 7 days |
|
3103 | + * @return Array number, icao, name and city of airports |
|
3104 | + */ |
|
3105 | 3105 | |
3106 | 3106 | public function getLast7DaysAirportsDepartureByAirlines($airport_icao = '') { |
3107 | 3107 | global $globalTimezone, $globalDBdriver; |
@@ -3131,9 +3131,9 @@ discard block |
||
3131 | 3131 | } |
3132 | 3132 | |
3133 | 3133 | /** |
3134 | - * Get a list of flights from detected airport since 7 days |
|
3135 | - * @return Array number, icao, name and city of airports |
|
3136 | - */ |
|
3134 | + * Get a list of flights from detected airport since 7 days |
|
3135 | + * @return Array number, icao, name and city of airports |
|
3136 | + */ |
|
3137 | 3137 | |
3138 | 3138 | public function getLast7DaysDetectedAirportsDeparture($airport_icao = '', $filters = array()) { |
3139 | 3139 | global $globalTimezone, $globalDBdriver; |
@@ -3171,9 +3171,9 @@ discard block |
||
3171 | 3171 | } |
3172 | 3172 | |
3173 | 3173 | /** |
3174 | - * Get a list of flights from detected airport since 7 days |
|
3175 | - * @return Array number, icao, name and city of airports |
|
3176 | - */ |
|
3174 | + * Get a list of flights from detected airport since 7 days |
|
3175 | + * @return Array number, icao, name and city of airports |
|
3176 | + */ |
|
3177 | 3177 | |
3178 | 3178 | public function getLast7DaysDetectedAirportsDepartureByAirlines($airport_icao = '') { |
3179 | 3179 | global $globalTimezone, $globalDBdriver; |
@@ -3215,9 +3215,9 @@ discard block |
||
3215 | 3215 | |
3216 | 3216 | |
3217 | 3217 | /** |
3218 | - * Get a list of flights to airport since 7 days |
|
3219 | - * @return Array number, icao, name and city of airports |
|
3220 | - */ |
|
3218 | + * Get a list of flights to airport since 7 days |
|
3219 | + * @return Array number, icao, name and city of airports |
|
3220 | + */ |
|
3221 | 3221 | |
3222 | 3222 | public function getLast7DaysAirportsArrival($airport_icao = '', $filters = array()) { |
3223 | 3223 | global $globalTimezone, $globalDBdriver; |
@@ -3250,9 +3250,9 @@ discard block |
||
3250 | 3250 | |
3251 | 3251 | |
3252 | 3252 | /** |
3253 | - * Get a list of flights detected to airport since 7 days |
|
3254 | - * @return Array number, icao, name and city of airports |
|
3255 | - */ |
|
3253 | + * Get a list of flights detected to airport since 7 days |
|
3254 | + * @return Array number, icao, name and city of airports |
|
3255 | + */ |
|
3256 | 3256 | |
3257 | 3257 | public function getLast7DaysDetectedAirportsArrival($airport_icao = '',$filters = array()) { |
3258 | 3258 | global $globalTimezone, $globalDBdriver; |
@@ -3293,9 +3293,9 @@ discard block |
||
3293 | 3293 | |
3294 | 3294 | |
3295 | 3295 | /** |
3296 | - * Get a list of flights to airport since 7 days |
|
3297 | - * @return Array number, icao, name and city of airports |
|
3298 | - */ |
|
3296 | + * Get a list of flights to airport since 7 days |
|
3297 | + * @return Array number, icao, name and city of airports |
|
3298 | + */ |
|
3299 | 3299 | |
3300 | 3300 | public function getLast7DaysAirportsArrivalByAirlines($airport_icao = '') { |
3301 | 3301 | global $globalTimezone, $globalDBdriver; |
@@ -3327,9 +3327,9 @@ discard block |
||
3327 | 3327 | |
3328 | 3328 | |
3329 | 3329 | /** |
3330 | - * Get a list of flights detected to airport since 7 days |
|
3331 | - * @return Array number, icao, name and city of airports |
|
3332 | - */ |
|
3330 | + * Get a list of flights detected to airport since 7 days |
|
3331 | + * @return Array number, icao, name and city of airports |
|
3332 | + */ |
|
3333 | 3333 | |
3334 | 3334 | public function getLast7DaysDetectedAirportsArrivalByAirlines($airport_icao = '') { |
3335 | 3335 | global $globalTimezone, $globalDBdriver; |
@@ -3373,11 +3373,11 @@ discard block |
||
3373 | 3373 | |
3374 | 3374 | |
3375 | 3375 | /** |
3376 | - * Gets a list of all dates |
|
3377 | - * |
|
3378 | - * @return Array list of date names |
|
3379 | - * |
|
3380 | - */ |
|
3376 | + * Gets a list of all dates |
|
3377 | + * |
|
3378 | + * @return Array list of date names |
|
3379 | + * |
|
3380 | + */ |
|
3381 | 3381 | public function getAllDates() |
3382 | 3382 | { |
3383 | 3383 | global $globalTimezone, $globalDBdriver; |
@@ -3418,11 +3418,11 @@ discard block |
||
3418 | 3418 | |
3419 | 3419 | |
3420 | 3420 | /** |
3421 | - * Gets all route combinations |
|
3422 | - * |
|
3423 | - * @return Array the route list |
|
3424 | - * |
|
3425 | - */ |
|
3421 | + * Gets all route combinations |
|
3422 | + * |
|
3423 | + * @return Array the route list |
|
3424 | + * |
|
3425 | + */ |
|
3426 | 3426 | public function getAllRoutes() |
3427 | 3427 | { |
3428 | 3428 | $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 |
@@ -3448,13 +3448,13 @@ discard block |
||
3448 | 3448 | } |
3449 | 3449 | |
3450 | 3450 | /** |
3451 | - * Update ident spotter data |
|
3452 | - * |
|
3453 | - * @param String $flightaware_id the ID from flightaware |
|
3454 | - * @param String $ident the flight ident |
|
3455 | - * @return String success or false |
|
3456 | - * |
|
3457 | - */ |
|
3451 | + * Update ident spotter data |
|
3452 | + * |
|
3453 | + * @param String $flightaware_id the ID from flightaware |
|
3454 | + * @param String $ident the flight ident |
|
3455 | + * @return String success or false |
|
3456 | + * |
|
3457 | + */ |
|
3458 | 3458 | public function updateIdentSpotterData($flightaware_id = '', $ident = '',$fromsource = NULL) |
3459 | 3459 | { |
3460 | 3460 | if (!is_numeric(substr($ident, 0, 3))) |
@@ -3475,14 +3475,14 @@ discard block |
||
3475 | 3475 | } else { |
3476 | 3476 | $airline_array = $this->getAllAirlineInfo("NA"); |
3477 | 3477 | } |
3478 | - $airline_name = $airline_array[0]['name']; |
|
3479 | - $airline_icao = $airline_array[0]['icao']; |
|
3480 | - $airline_country = $airline_array[0]['country']; |
|
3481 | - $airline_type = $airline_array[0]['type']; |
|
3478 | + $airline_name = $airline_array[0]['name']; |
|
3479 | + $airline_icao = $airline_array[0]['icao']; |
|
3480 | + $airline_country = $airline_array[0]['country']; |
|
3481 | + $airline_type = $airline_array[0]['type']; |
|
3482 | 3482 | |
3483 | 3483 | |
3484 | 3484 | $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'; |
3485 | - $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); |
|
3485 | + $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); |
|
3486 | 3486 | |
3487 | 3487 | try { |
3488 | 3488 | $sth = $this->db->prepare($query); |
@@ -3495,19 +3495,19 @@ discard block |
||
3495 | 3495 | |
3496 | 3496 | } |
3497 | 3497 | /** |
3498 | - * Update latest spotter data |
|
3499 | - * |
|
3500 | - * @param String $flightaware_id the ID from flightaware |
|
3501 | - * @param String $ident the flight ident |
|
3502 | - * @param String $arrival_airport_icao the arrival airport |
|
3503 | - * @return String success or false |
|
3504 | - * |
|
3505 | - */ |
|
3498 | + * Update latest spotter data |
|
3499 | + * |
|
3500 | + * @param String $flightaware_id the ID from flightaware |
|
3501 | + * @param String $ident the flight ident |
|
3502 | + * @param String $arrival_airport_icao the arrival airport |
|
3503 | + * @return String success or false |
|
3504 | + * |
|
3505 | + */ |
|
3506 | 3506 | public function updateLatestSpotterData($flightaware_id = '', $ident = '', $latitude = '', $longitude = '', $altitude = '', $ground = false, $groundspeed = NULL, $date = '', $arrival_airport_icao = '',$arrival_airport_time = '') |
3507 | 3507 | { |
3508 | 3508 | if ($groundspeed == '') $groundspeed = NULL; |
3509 | 3509 | $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'; |
3510 | - $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); |
|
3510 | + $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); |
|
3511 | 3511 | |
3512 | 3512 | try { |
3513 | 3513 | $sth = $this->db->prepare($query); |
@@ -3521,32 +3521,32 @@ discard block |
||
3521 | 3521 | } |
3522 | 3522 | |
3523 | 3523 | /** |
3524 | - * Adds a new spotter data |
|
3525 | - * |
|
3526 | - * @param String $flightaware_id the ID from flightaware |
|
3527 | - * @param String $ident the flight ident |
|
3528 | - * @param String $aircraft_icao the aircraft type |
|
3529 | - * @param String $departure_airport_icao the departure airport |
|
3530 | - * @param String $arrival_airport_icao the arrival airport |
|
3531 | - * @param String $latitude latitude of flight |
|
3532 | - * @param String $longitude latitude of flight |
|
3533 | - * @param String $waypoints waypoints of flight |
|
3534 | - * @param String $altitude altitude of flight |
|
3535 | - * @param String $heading heading of flight |
|
3536 | - * @param String $groundspeed speed of flight |
|
3537 | - * @param String $date date of flight |
|
3538 | - * @param String $departure_airport_time departure time of flight |
|
3539 | - * @param String $arrival_airport_time arrival time of flight |
|
3540 | - * @param String $squawk squawk code of flight |
|
3541 | - * @param String $route_stop route stop of flight |
|
3542 | - * @param String $highlight highlight or not |
|
3543 | - * @param String $ModeS ModesS code of flight |
|
3544 | - * @param String $registration registration code of flight |
|
3545 | - * @param String $pilot_id pilot id of flight (for virtual airlines) |
|
3546 | - * @param String $pilot_name pilot name of flight (for virtual airlines) |
|
3547 | - * @param String $verticalrate vertival rate of flight |
|
3548 | - * @return String success or false |
|
3549 | - */ |
|
3524 | + * Adds a new spotter data |
|
3525 | + * |
|
3526 | + * @param String $flightaware_id the ID from flightaware |
|
3527 | + * @param String $ident the flight ident |
|
3528 | + * @param String $aircraft_icao the aircraft type |
|
3529 | + * @param String $departure_airport_icao the departure airport |
|
3530 | + * @param String $arrival_airport_icao the arrival airport |
|
3531 | + * @param String $latitude latitude of flight |
|
3532 | + * @param String $longitude latitude of flight |
|
3533 | + * @param String $waypoints waypoints of flight |
|
3534 | + * @param String $altitude altitude of flight |
|
3535 | + * @param String $heading heading of flight |
|
3536 | + * @param String $groundspeed speed of flight |
|
3537 | + * @param String $date date of flight |
|
3538 | + * @param String $departure_airport_time departure time of flight |
|
3539 | + * @param String $arrival_airport_time arrival time of flight |
|
3540 | + * @param String $squawk squawk code of flight |
|
3541 | + * @param String $route_stop route stop of flight |
|
3542 | + * @param String $highlight highlight or not |
|
3543 | + * @param String $ModeS ModesS code of flight |
|
3544 | + * @param String $registration registration code of flight |
|
3545 | + * @param String $pilot_id pilot id of flight (for virtual airlines) |
|
3546 | + * @param String $pilot_name pilot name of flight (for virtual airlines) |
|
3547 | + * @param String $verticalrate vertival rate of flight |
|
3548 | + * @return String success or false |
|
3549 | + */ |
|
3550 | 3550 | 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 = '') |
3551 | 3551 | { |
3552 | 3552 | global $globalURL, $globalIVAO, $globalVATSIM, $globalphpVMS, $globalDebugTimeElapsed, $globalAirlinesSource, $globalVAM; |
@@ -3761,8 +3761,8 @@ discard block |
||
3761 | 3761 | |
3762 | 3762 | if ($globalIVAO && $aircraft_icao != '') |
3763 | 3763 | { |
3764 | - if (isset($airline_array[0]['icao'])) $airline_icao = $airline_array[0]['icao']; |
|
3765 | - else $airline_icao = ''; |
|
3764 | + if (isset($airline_array[0]['icao'])) $airline_icao = $airline_array[0]['icao']; |
|
3765 | + else $airline_icao = ''; |
|
3766 | 3766 | $image_array = $Image->getSpotterImage('',$aircraft_icao,$airline_icao); |
3767 | 3767 | if (!isset($image_array[0]['registration'])) |
3768 | 3768 | { |
@@ -3793,53 +3793,53 @@ discard block |
||
3793 | 3793 | |
3794 | 3794 | if (count($airline_array) == 0) |
3795 | 3795 | { |
3796 | - $airline_array = $this->getAllAirlineInfo('NA'); |
|
3797 | - } |
|
3798 | - if (count($aircraft_array) == 0) |
|
3799 | - { |
|
3800 | - $aircraft_array = $this->getAllAircraftInfo('NA'); |
|
3801 | - } |
|
3802 | - if (count($departure_airport_array) == 0 || $departure_airport_array[0]['icao'] == '' || $departure_airport_icao == '') |
|
3803 | - { |
|
3804 | - $departure_airport_array = $this->getAllAirportInfo('NA'); |
|
3805 | - } |
|
3806 | - if (count($arrival_airport_array) == 0 || $arrival_airport_array[0]['icao'] == '' || $arrival_airport_icao == '') |
|
3807 | - { |
|
3808 | - $arrival_airport_array = $this->getAllAirportInfo('NA'); |
|
3809 | - } |
|
3810 | - if ($registration == '') $registration = 'NA'; |
|
3811 | - if ($latitude == '' && $longitude == '') { |
|
3812 | - $latitude = 0; |
|
3813 | - $longitude = 0; |
|
3814 | - } |
|
3815 | - if ($squawk == '' || $Common->isInteger($squawk) === false) $squawk = NULL; |
|
3816 | - if ($verticalrate == '' || $Common->isInteger($verticalrate) === false) $verticalrate = NULL; |
|
3817 | - if ($heading == '' || $Common->isInteger($heading) === false) $heading = 0; |
|
3818 | - if ($groundspeed == '' || $Common->isInteger($groundspeed) === false) $groundspeed = 0; |
|
3819 | - if (!isset($aircraft_owner)) $aircraft_owner = NULL; |
|
3820 | - $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) |
|
3796 | + $airline_array = $this->getAllAirlineInfo('NA'); |
|
3797 | + } |
|
3798 | + if (count($aircraft_array) == 0) |
|
3799 | + { |
|
3800 | + $aircraft_array = $this->getAllAircraftInfo('NA'); |
|
3801 | + } |
|
3802 | + if (count($departure_airport_array) == 0 || $departure_airport_array[0]['icao'] == '' || $departure_airport_icao == '') |
|
3803 | + { |
|
3804 | + $departure_airport_array = $this->getAllAirportInfo('NA'); |
|
3805 | + } |
|
3806 | + if (count($arrival_airport_array) == 0 || $arrival_airport_array[0]['icao'] == '' || $arrival_airport_icao == '') |
|
3807 | + { |
|
3808 | + $arrival_airport_array = $this->getAllAirportInfo('NA'); |
|
3809 | + } |
|
3810 | + if ($registration == '') $registration = 'NA'; |
|
3811 | + if ($latitude == '' && $longitude == '') { |
|
3812 | + $latitude = 0; |
|
3813 | + $longitude = 0; |
|
3814 | + } |
|
3815 | + if ($squawk == '' || $Common->isInteger($squawk) === false) $squawk = NULL; |
|
3816 | + if ($verticalrate == '' || $Common->isInteger($verticalrate) === false) $verticalrate = NULL; |
|
3817 | + if ($heading == '' || $Common->isInteger($heading) === false) $heading = 0; |
|
3818 | + if ($groundspeed == '' || $Common->isInteger($groundspeed) === false) $groundspeed = 0; |
|
3819 | + if (!isset($aircraft_owner)) $aircraft_owner = NULL; |
|
3820 | + $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) |
|
3821 | 3821 | 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)"; |
3822 | 3822 | |
3823 | - $airline_name = $airline_array[0]['name']; |
|
3824 | - $airline_icao = $airline_array[0]['icao']; |
|
3825 | - $airline_country = $airline_array[0]['country']; |
|
3826 | - $airline_type = $airline_array[0]['type']; |
|
3823 | + $airline_name = $airline_array[0]['name']; |
|
3824 | + $airline_icao = $airline_array[0]['icao']; |
|
3825 | + $airline_country = $airline_array[0]['country']; |
|
3826 | + $airline_type = $airline_array[0]['type']; |
|
3827 | 3827 | if ($airline_type == '') { |
3828 | 3828 | $timeelapsed = microtime(true); |
3829 | 3829 | $airline_type = $this->getAircraftTypeBymodeS($ModeS); |
3830 | 3830 | if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftTypeBymodes : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
3831 | 3831 | } |
3832 | 3832 | if ($airline_type == null) $airline_type = ''; |
3833 | - $aircraft_type = $aircraft_array[0]['type']; |
|
3834 | - $aircraft_manufacturer = $aircraft_array[0]['manufacturer']; |
|
3835 | - $departure_airport_name = $departure_airport_array[0]['name']; |
|
3836 | - $departure_airport_city = $departure_airport_array[0]['city']; |
|
3837 | - $departure_airport_country = $departure_airport_array[0]['country']; |
|
3833 | + $aircraft_type = $aircraft_array[0]['type']; |
|
3834 | + $aircraft_manufacturer = $aircraft_array[0]['manufacturer']; |
|
3835 | + $departure_airport_name = $departure_airport_array[0]['name']; |
|
3836 | + $departure_airport_city = $departure_airport_array[0]['city']; |
|
3837 | + $departure_airport_country = $departure_airport_array[0]['country']; |
|
3838 | 3838 | |
3839 | - $arrival_airport_name = $arrival_airport_array[0]['name']; |
|
3840 | - $arrival_airport_city = $arrival_airport_array[0]['city']; |
|
3841 | - $arrival_airport_country = $arrival_airport_array[0]['country']; |
|
3842 | - $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); |
|
3839 | + $arrival_airport_name = $arrival_airport_array[0]['name']; |
|
3840 | + $arrival_airport_city = $arrival_airport_array[0]['city']; |
|
3841 | + $arrival_airport_country = $arrival_airport_array[0]['country']; |
|
3842 | + $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); |
|
3843 | 3843 | |
3844 | 3844 | try { |
3845 | 3845 | |
@@ -3847,7 +3847,7 @@ discard block |
||
3847 | 3847 | $sth->execute($query_values); |
3848 | 3848 | $this->db = null; |
3849 | 3849 | } catch (PDOException $e) { |
3850 | - return "error : ".$e->getMessage(); |
|
3850 | + return "error : ".$e->getMessage(); |
|
3851 | 3851 | } |
3852 | 3852 | |
3853 | 3853 | return "success"; |
@@ -3856,11 +3856,11 @@ discard block |
||
3856 | 3856 | |
3857 | 3857 | |
3858 | 3858 | /** |
3859 | - * Gets the aircraft ident within the last hour |
|
3860 | - * |
|
3861 | - * @return String the ident |
|
3862 | - * |
|
3863 | - */ |
|
3859 | + * Gets the aircraft ident within the last hour |
|
3860 | + * |
|
3861 | + * @return String the ident |
|
3862 | + * |
|
3863 | + */ |
|
3864 | 3864 | public function getIdentFromLastHour($ident) |
3865 | 3865 | { |
3866 | 3866 | global $globalDBdriver, $globalTimezone; |
@@ -3876,11 +3876,11 @@ discard block |
||
3876 | 3876 | AND spotter_output.date >= now() AT TIME ZONE 'UTC' - INTERVAL '1 HOURS' |
3877 | 3877 | AND spotter_output.date < now() AT TIME ZONE 'UTC'"; |
3878 | 3878 | $query_data = array(':ident' => $ident); |
3879 | - } |
|
3879 | + } |
|
3880 | 3880 | |
3881 | 3881 | $sth = $this->db->prepare($query); |
3882 | 3882 | $sth->execute($query_data); |
3883 | - $ident_result=''; |
|
3883 | + $ident_result=''; |
|
3884 | 3884 | while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
3885 | 3885 | { |
3886 | 3886 | $ident_result = $row['ident']; |
@@ -3891,11 +3891,11 @@ discard block |
||
3891 | 3891 | |
3892 | 3892 | |
3893 | 3893 | /** |
3894 | - * Gets the aircraft data from the last 20 seconds |
|
3895 | - * |
|
3896 | - * @return Array the spotter data |
|
3897 | - * |
|
3898 | - */ |
|
3894 | + * Gets the aircraft data from the last 20 seconds |
|
3895 | + * |
|
3896 | + * @return Array the spotter data |
|
3897 | + * |
|
3898 | + */ |
|
3899 | 3899 | public function getRealTimeData($q = '') |
3900 | 3900 | { |
3901 | 3901 | global $globalDBdriver; |
@@ -3939,11 +3939,11 @@ discard block |
||
3939 | 3939 | |
3940 | 3940 | |
3941 | 3941 | /** |
3942 | - * Gets all airlines that have flown over |
|
3943 | - * |
|
3944 | - * @return Array the airline list |
|
3945 | - * |
|
3946 | - */ |
|
3942 | + * Gets all airlines that have flown over |
|
3943 | + * |
|
3944 | + * @return Array the airline list |
|
3945 | + * |
|
3946 | + */ |
|
3947 | 3947 | public function countAllAirlines($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array(), $year = '', $month = '', $day = '') |
3948 | 3948 | { |
3949 | 3949 | global $globalDBdriver; |
@@ -3957,7 +3957,7 @@ discard block |
||
3957 | 3957 | $query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
3958 | 3958 | } |
3959 | 3959 | } |
3960 | - if ($sincedate != '') { |
|
3960 | + if ($sincedate != '') { |
|
3961 | 3961 | if ($globalDBdriver == 'mysql') { |
3962 | 3962 | $query .= " AND spotter_output.date > '".$sincedate."'"; |
3963 | 3963 | } else { |
@@ -4011,26 +4011,26 @@ discard block |
||
4011 | 4011 | } |
4012 | 4012 | |
4013 | 4013 | /** |
4014 | - * Gets all pilots that have flown over |
|
4015 | - * |
|
4016 | - * @return Array the pilots list |
|
4017 | - * |
|
4018 | - */ |
|
4014 | + * Gets all pilots that have flown over |
|
4015 | + * |
|
4016 | + * @return Array the pilots list |
|
4017 | + * |
|
4018 | + */ |
|
4019 | 4019 | public function countAllPilots($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array(),$year = '', $month = '',$day = '') |
4020 | 4020 | { |
4021 | 4021 | global $globalDBdriver; |
4022 | 4022 | $filter_query = $this->getFilter($filters,true,true); |
4023 | 4023 | $query = "SELECT DISTINCT spotter_output.pilot_id, spotter_output.pilot_name, COUNT(spotter_output.pilot_id) AS pilot_count, spotter_output.format_source |
4024 | 4024 | FROM spotter_output".$filter_query." spotter_output.pilot_id <> ''"; |
4025 | - if ($olderthanmonths > 0) { |
|
4026 | - if ($globalDBdriver == 'mysql') { |
|
4025 | + if ($olderthanmonths > 0) { |
|
4026 | + if ($globalDBdriver == 'mysql') { |
|
4027 | 4027 | $query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)'; |
4028 | 4028 | } else { |
4029 | 4029 | $query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
4030 | 4030 | } |
4031 | 4031 | } |
4032 | - if ($sincedate != '') { |
|
4033 | - if ($globalDBdriver == 'mysql') { |
|
4032 | + if ($sincedate != '') { |
|
4033 | + if ($globalDBdriver == 'mysql') { |
|
4034 | 4034 | $query .= " AND spotter_output.date > '".$sincedate."'"; |
4035 | 4035 | } else { |
4036 | 4036 | $query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -4085,25 +4085,25 @@ discard block |
||
4085 | 4085 | } |
4086 | 4086 | |
4087 | 4087 | /** |
4088 | - * Gets all pilots that have flown over |
|
4089 | - * |
|
4090 | - * @return Array the pilots list |
|
4091 | - * |
|
4092 | - */ |
|
4088 | + * Gets all pilots that have flown over |
|
4089 | + * |
|
4090 | + * @return Array the pilots list |
|
4091 | + * |
|
4092 | + */ |
|
4093 | 4093 | public function countAllPilotsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '') |
4094 | 4094 | { |
4095 | 4095 | global $globalDBdriver; |
4096 | 4096 | $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 |
4097 | 4097 | FROM spotter_output WHERE spotter_output.pilot_id <> '' "; |
4098 | - if ($olderthanmonths > 0) { |
|
4099 | - if ($globalDBdriver == 'mysql') { |
|
4098 | + if ($olderthanmonths > 0) { |
|
4099 | + if ($globalDBdriver == 'mysql') { |
|
4100 | 4100 | $query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) '; |
4101 | 4101 | } else { |
4102 | 4102 | $query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
4103 | 4103 | } |
4104 | 4104 | } |
4105 | - if ($sincedate != '') { |
|
4106 | - if ($globalDBdriver == 'mysql') { |
|
4105 | + if ($sincedate != '') { |
|
4106 | + if ($globalDBdriver == 'mysql') { |
|
4107 | 4107 | $query .= "AND spotter_output.date > '".$sincedate."' "; |
4108 | 4108 | } else { |
4109 | 4109 | $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -4132,26 +4132,26 @@ discard block |
||
4132 | 4132 | } |
4133 | 4133 | |
4134 | 4134 | /** |
4135 | - * Gets all owner that have flown over |
|
4136 | - * |
|
4137 | - * @return Array the pilots list |
|
4138 | - * |
|
4139 | - */ |
|
4135 | + * Gets all owner that have flown over |
|
4136 | + * |
|
4137 | + * @return Array the pilots list |
|
4138 | + * |
|
4139 | + */ |
|
4140 | 4140 | public function countAllOwners($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array(),$year = '',$month = '',$day = '') |
4141 | 4141 | { |
4142 | 4142 | global $globalDBdriver; |
4143 | 4143 | $filter_query = $this->getFilter($filters,true,true); |
4144 | 4144 | $query = "SELECT DISTINCT spotter_output.owner_name, COUNT(spotter_output.owner_name) AS owner_count |
4145 | 4145 | FROM spotter_output".$filter_query." spotter_output.owner_name <> '' AND spotter_output.owner_name IS NOT NULL"; |
4146 | - if ($olderthanmonths > 0) { |
|
4147 | - if ($globalDBdriver == 'mysql') { |
|
4146 | + if ($olderthanmonths > 0) { |
|
4147 | + if ($globalDBdriver == 'mysql') { |
|
4148 | 4148 | $query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)'; |
4149 | 4149 | } else { |
4150 | 4150 | $query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
4151 | 4151 | } |
4152 | 4152 | } |
4153 | - if ($sincedate != '') { |
|
4154 | - if ($globalDBdriver == 'mysql') { |
|
4153 | + if ($sincedate != '') { |
|
4154 | + if ($globalDBdriver == 'mysql') { |
|
4155 | 4155 | $query .= " AND spotter_output.date > '".$sincedate."' "; |
4156 | 4156 | } else { |
4157 | 4157 | $query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -4202,26 +4202,26 @@ discard block |
||
4202 | 4202 | } |
4203 | 4203 | |
4204 | 4204 | /** |
4205 | - * Gets all owner that have flown over |
|
4206 | - * |
|
4207 | - * @return Array the pilots list |
|
4208 | - * |
|
4209 | - */ |
|
4205 | + * Gets all owner that have flown over |
|
4206 | + * |
|
4207 | + * @return Array the pilots list |
|
4208 | + * |
|
4209 | + */ |
|
4210 | 4210 | public function countAllOwnersByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array()) |
4211 | 4211 | { |
4212 | 4212 | global $globalDBdriver; |
4213 | 4213 | $filter_query = $this->getFilter($filters,true,true); |
4214 | 4214 | $query = "SELECT DISTINCT spotter_output.airline_icao, spotter_output.owner_name, COUNT(spotter_output.owner_name) AS owner_count |
4215 | 4215 | FROM spotter_output".$filter_query." spotter_output.owner_name <> '' AND spotter_output.owner_name IS NOT NULL "; |
4216 | - if ($olderthanmonths > 0) { |
|
4217 | - if ($globalDBdriver == 'mysql') { |
|
4216 | + if ($olderthanmonths > 0) { |
|
4217 | + if ($globalDBdriver == 'mysql') { |
|
4218 | 4218 | $query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) '; |
4219 | 4219 | } else { |
4220 | 4220 | $query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
4221 | 4221 | } |
4222 | 4222 | } |
4223 | - if ($sincedate != '') { |
|
4224 | - if ($globalDBdriver == 'mysql') { |
|
4223 | + if ($sincedate != '') { |
|
4224 | + if ($globalDBdriver == 'mysql') { |
|
4225 | 4225 | $query .= "AND spotter_output.date > '".$sincedate."' "; |
4226 | 4226 | } else { |
4227 | 4227 | $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -4248,11 +4248,11 @@ discard block |
||
4248 | 4248 | } |
4249 | 4249 | |
4250 | 4250 | /** |
4251 | - * Gets all airlines that have flown over by aircraft |
|
4252 | - * |
|
4253 | - * @return Array the airline list |
|
4254 | - * |
|
4255 | - */ |
|
4251 | + * Gets all airlines that have flown over by aircraft |
|
4252 | + * |
|
4253 | + * @return Array the airline list |
|
4254 | + * |
|
4255 | + */ |
|
4256 | 4256 | public function countAllAirlinesByAircraft($aircraft_icao,$filters = array()) |
4257 | 4257 | { |
4258 | 4258 | $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
@@ -4284,11 +4284,11 @@ discard block |
||
4284 | 4284 | |
4285 | 4285 | |
4286 | 4286 | /** |
4287 | - * Gets all airline countries that have flown over by aircraft |
|
4288 | - * |
|
4289 | - * @return Array the airline country list |
|
4290 | - * |
|
4291 | - */ |
|
4287 | + * Gets all airline countries that have flown over by aircraft |
|
4288 | + * |
|
4289 | + * @return Array the airline country list |
|
4290 | + * |
|
4291 | + */ |
|
4292 | 4292 | public function countAllAirlineCountriesByAircraft($aircraft_icao,$filters = array()) |
4293 | 4293 | { |
4294 | 4294 | $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
@@ -4320,11 +4320,11 @@ discard block |
||
4320 | 4320 | |
4321 | 4321 | |
4322 | 4322 | /** |
4323 | - * Gets all airlines that have flown over by airport |
|
4324 | - * |
|
4325 | - * @return Array the airline list |
|
4326 | - * |
|
4327 | - */ |
|
4323 | + * Gets all airlines that have flown over by airport |
|
4324 | + * |
|
4325 | + * @return Array the airline list |
|
4326 | + * |
|
4327 | + */ |
|
4328 | 4328 | public function countAllAirlinesByAirport($airport_icao,$filters = array()) |
4329 | 4329 | { |
4330 | 4330 | $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
@@ -4355,11 +4355,11 @@ discard block |
||
4355 | 4355 | |
4356 | 4356 | |
4357 | 4357 | /** |
4358 | - * Gets all airline countries that have flown over by airport icao |
|
4359 | - * |
|
4360 | - * @return Array the airline country list |
|
4361 | - * |
|
4362 | - */ |
|
4358 | + * Gets all airline countries that have flown over by airport icao |
|
4359 | + * |
|
4360 | + * @return Array the airline country list |
|
4361 | + * |
|
4362 | + */ |
|
4363 | 4363 | public function countAllAirlineCountriesByAirport($airport_icao,$filters = array()) |
4364 | 4364 | { |
4365 | 4365 | $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
@@ -4389,11 +4389,11 @@ discard block |
||
4389 | 4389 | |
4390 | 4390 | |
4391 | 4391 | /** |
4392 | - * Gets all airlines that have flown over by aircraft manufacturer |
|
4393 | - * |
|
4394 | - * @return Array the airline list |
|
4395 | - * |
|
4396 | - */ |
|
4392 | + * Gets all airlines that have flown over by aircraft manufacturer |
|
4393 | + * |
|
4394 | + * @return Array the airline list |
|
4395 | + * |
|
4396 | + */ |
|
4397 | 4397 | public function countAllAirlinesByManufacturer($aircraft_manufacturer,$filters = array()) |
4398 | 4398 | { |
4399 | 4399 | $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
@@ -4424,11 +4424,11 @@ discard block |
||
4424 | 4424 | |
4425 | 4425 | |
4426 | 4426 | /** |
4427 | - * Gets all airline countries that have flown over by aircraft manufacturer |
|
4428 | - * |
|
4429 | - * @return Array the airline country list |
|
4430 | - * |
|
4431 | - */ |
|
4427 | + * Gets all airline countries that have flown over by aircraft manufacturer |
|
4428 | + * |
|
4429 | + * @return Array the airline country list |
|
4430 | + * |
|
4431 | + */ |
|
4432 | 4432 | public function countAllAirlineCountriesByManufacturer($aircraft_manufacturer,$filters = array()) |
4433 | 4433 | { |
4434 | 4434 | $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
@@ -4457,11 +4457,11 @@ discard block |
||
4457 | 4457 | |
4458 | 4458 | |
4459 | 4459 | /** |
4460 | - * Gets all airlines that have flown over by date |
|
4461 | - * |
|
4462 | - * @return Array the airline list |
|
4463 | - * |
|
4464 | - */ |
|
4460 | + * Gets all airlines that have flown over by date |
|
4461 | + * |
|
4462 | + * @return Array the airline list |
|
4463 | + * |
|
4464 | + */ |
|
4465 | 4465 | public function countAllAirlinesByDate($date,$filters = array()) |
4466 | 4466 | { |
4467 | 4467 | global $globalTimezone, $globalDBdriver; |
@@ -4505,11 +4505,11 @@ discard block |
||
4505 | 4505 | |
4506 | 4506 | |
4507 | 4507 | /** |
4508 | - * Gets all airline countries that have flown over by date |
|
4509 | - * |
|
4510 | - * @return Array the airline country list |
|
4511 | - * |
|
4512 | - */ |
|
4508 | + * Gets all airline countries that have flown over by date |
|
4509 | + * |
|
4510 | + * @return Array the airline country list |
|
4511 | + * |
|
4512 | + */ |
|
4513 | 4513 | public function countAllAirlineCountriesByDate($date,$filters = array()) |
4514 | 4514 | { |
4515 | 4515 | global $globalTimezone, $globalDBdriver; |
@@ -4552,11 +4552,11 @@ discard block |
||
4552 | 4552 | |
4553 | 4553 | |
4554 | 4554 | /** |
4555 | - * Gets all airlines that have flown over by ident/callsign |
|
4556 | - * |
|
4557 | - * @return Array the airline list |
|
4558 | - * |
|
4559 | - */ |
|
4555 | + * Gets all airlines that have flown over by ident/callsign |
|
4556 | + * |
|
4557 | + * @return Array the airline list |
|
4558 | + * |
|
4559 | + */ |
|
4560 | 4560 | public function countAllAirlinesByIdent($ident,$filters = array()) |
4561 | 4561 | { |
4562 | 4562 | $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
@@ -4573,11 +4573,11 @@ discard block |
||
4573 | 4573 | } |
4574 | 4574 | |
4575 | 4575 | /** |
4576 | - * Gets all airlines by owner |
|
4577 | - * |
|
4578 | - * @return Array the airline list |
|
4579 | - * |
|
4580 | - */ |
|
4576 | + * Gets all airlines by owner |
|
4577 | + * |
|
4578 | + * @return Array the airline list |
|
4579 | + * |
|
4580 | + */ |
|
4581 | 4581 | public function countAllAirlinesByOwner($owner,$filters = array()) |
4582 | 4582 | { |
4583 | 4583 | $owner = filter_var($owner,FILTER_SANITIZE_STRING); |
@@ -4594,11 +4594,11 @@ discard block |
||
4594 | 4594 | } |
4595 | 4595 | |
4596 | 4596 | /** |
4597 | - * Gets all airlines used by pilot |
|
4598 | - * |
|
4599 | - * @return Array the airline list |
|
4600 | - * |
|
4601 | - */ |
|
4597 | + * Gets all airlines used by pilot |
|
4598 | + * |
|
4599 | + * @return Array the airline list |
|
4600 | + * |
|
4601 | + */ |
|
4602 | 4602 | public function countAllAirlinesByPilot($pilot,$filters = array()) |
4603 | 4603 | { |
4604 | 4604 | $pilot = filter_var($pilot,FILTER_SANITIZE_STRING); |
@@ -4615,11 +4615,11 @@ discard block |
||
4615 | 4615 | } |
4616 | 4616 | |
4617 | 4617 | /** |
4618 | - * Gets all airlines that have flown over by route |
|
4619 | - * |
|
4620 | - * @return Array the airline list |
|
4621 | - * |
|
4622 | - */ |
|
4618 | + * Gets all airlines that have flown over by route |
|
4619 | + * |
|
4620 | + * @return Array the airline list |
|
4621 | + * |
|
4622 | + */ |
|
4623 | 4623 | public function countAllAirlinesByRoute($departure_airport_icao, $arrival_airport_icao,$filters = array()) |
4624 | 4624 | { |
4625 | 4625 | $filter_query = $this->getFilter($filters,true,true); |
@@ -4651,11 +4651,11 @@ discard block |
||
4651 | 4651 | } |
4652 | 4652 | |
4653 | 4653 | /** |
4654 | - * Gets all airline countries that have flown over by route |
|
4655 | - * |
|
4656 | - * @return Array the airline country list |
|
4657 | - * |
|
4658 | - */ |
|
4654 | + * Gets all airline countries that have flown over by route |
|
4655 | + * |
|
4656 | + * @return Array the airline country list |
|
4657 | + * |
|
4658 | + */ |
|
4659 | 4659 | public function countAllAirlineCountriesByRoute($departure_airport_icao, $arrival_airport_icao,$filters= array()) |
4660 | 4660 | { |
4661 | 4661 | $filter_query = $this->getFilter($filters,true,true); |
@@ -4687,11 +4687,11 @@ discard block |
||
4687 | 4687 | |
4688 | 4688 | |
4689 | 4689 | /** |
4690 | - * Gets all airlines that have flown over by country |
|
4691 | - * |
|
4692 | - * @return Array the airline list |
|
4693 | - * |
|
4694 | - */ |
|
4690 | + * Gets all airlines that have flown over by country |
|
4691 | + * |
|
4692 | + * @return Array the airline list |
|
4693 | + * |
|
4694 | + */ |
|
4695 | 4695 | public function countAllAirlinesByCountry($country,$filters = array()) |
4696 | 4696 | { |
4697 | 4697 | $country = filter_var($country,FILTER_SANITIZE_STRING); |
@@ -4721,11 +4721,11 @@ discard block |
||
4721 | 4721 | |
4722 | 4722 | |
4723 | 4723 | /** |
4724 | - * Gets all airline countries that have flown over by country |
|
4725 | - * |
|
4726 | - * @return Array the airline country list |
|
4727 | - * |
|
4728 | - */ |
|
4724 | + * Gets all airline countries that have flown over by country |
|
4725 | + * |
|
4726 | + * @return Array the airline country list |
|
4727 | + * |
|
4728 | + */ |
|
4729 | 4729 | public function countAllAirlineCountriesByCountry($country,$filters = array()) |
4730 | 4730 | { |
4731 | 4731 | $filter_query = $this->getFilter($filters,true,true); |
@@ -4754,11 +4754,11 @@ discard block |
||
4754 | 4754 | |
4755 | 4755 | |
4756 | 4756 | /** |
4757 | - * Gets all airlines countries |
|
4758 | - * |
|
4759 | - * @return Array the airline country list |
|
4760 | - * |
|
4761 | - */ |
|
4757 | + * Gets all airlines countries |
|
4758 | + * |
|
4759 | + * @return Array the airline country list |
|
4760 | + * |
|
4761 | + */ |
|
4762 | 4762 | public function countAllAirlineCountries($limit = true, $filters = array(), $year = '', $month = '', $day = '') |
4763 | 4763 | { |
4764 | 4764 | global $globalDBdriver; |
@@ -4813,11 +4813,11 @@ discard block |
||
4813 | 4813 | } |
4814 | 4814 | |
4815 | 4815 | /** |
4816 | - * Gets all number of flight over countries |
|
4817 | - * |
|
4818 | - * @return Array the airline country list |
|
4819 | - * |
|
4820 | - */ |
|
4816 | + * Gets all number of flight over countries |
|
4817 | + * |
|
4818 | + * @return Array the airline country list |
|
4819 | + * |
|
4820 | + */ |
|
4821 | 4821 | public function countAllFlightOverCountries($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array()) |
4822 | 4822 | { |
4823 | 4823 | global $globalDBdriver; |
@@ -4839,15 +4839,15 @@ discard block |
||
4839 | 4839 | $SpotterLive = new SpotterLive(); |
4840 | 4840 | $filter_query = $SpotterLive->getFilter($filters,true,true); |
4841 | 4841 | $filter_query .= ' over_country IS NOT NULL'; |
4842 | - if ($olderthanmonths > 0) { |
|
4842 | + if ($olderthanmonths > 0) { |
|
4843 | 4843 | if ($globalDBdriver == 'mysql') { |
4844 | 4844 | $filter_query .= ' AND spotter_live.date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
4845 | 4845 | } else { |
4846 | 4846 | $filter_query .= " AND spotter_live.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
4847 | 4847 | } |
4848 | 4848 | } |
4849 | - if ($sincedate != '') { |
|
4850 | - if ($globalDBdriver == 'mysql') { |
|
4849 | + if ($sincedate != '') { |
|
4850 | + if ($globalDBdriver == 'mysql') { |
|
4851 | 4851 | $filter_query .= " AND spotter_live.date > '".$sincedate."' "; |
4852 | 4852 | } else { |
4853 | 4853 | $filter_query .= " AND spotter_live.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -4877,11 +4877,11 @@ discard block |
||
4877 | 4877 | |
4878 | 4878 | |
4879 | 4879 | /** |
4880 | - * Gets all aircraft types that have flown over |
|
4881 | - * |
|
4882 | - * @return Array the aircraft list |
|
4883 | - * |
|
4884 | - */ |
|
4880 | + * Gets all aircraft types that have flown over |
|
4881 | + * |
|
4882 | + * @return Array the aircraft list |
|
4883 | + * |
|
4884 | + */ |
|
4885 | 4885 | public function countAllAircraftTypes($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array(),$year = '',$month = '',$day = '') |
4886 | 4886 | { |
4887 | 4887 | global $globalDBdriver; |
@@ -4951,11 +4951,11 @@ discard block |
||
4951 | 4951 | } |
4952 | 4952 | |
4953 | 4953 | /** |
4954 | - * Gets all aircraft types that have flown over by airline |
|
4955 | - * |
|
4956 | - * @return Array the aircraft list |
|
4957 | - * |
|
4958 | - */ |
|
4954 | + * Gets all aircraft types that have flown over by airline |
|
4955 | + * |
|
4956 | + * @return Array the aircraft list |
|
4957 | + * |
|
4958 | + */ |
|
4959 | 4959 | public function countAllAircraftTypesByAirlines($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array(),$year = '',$month = '', $day = '') |
4960 | 4960 | { |
4961 | 4961 | global $globalDBdriver; |
@@ -5026,11 +5026,11 @@ discard block |
||
5026 | 5026 | } |
5027 | 5027 | |
5028 | 5028 | /** |
5029 | - * Gets all aircraft types that have flown over by months |
|
5030 | - * |
|
5031 | - * @return Array the aircraft list |
|
5032 | - * |
|
5033 | - */ |
|
5029 | + * Gets all aircraft types that have flown over by months |
|
5030 | + * |
|
5031 | + * @return Array the aircraft list |
|
5032 | + * |
|
5033 | + */ |
|
5034 | 5034 | public function countAllAircraftTypesByMonths($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array()) |
5035 | 5035 | { |
5036 | 5036 | global $globalDBdriver; |
@@ -5074,11 +5074,11 @@ discard block |
||
5074 | 5074 | |
5075 | 5075 | |
5076 | 5076 | /** |
5077 | - * Gets all aircraft registration that have flown over by aircaft icao |
|
5078 | - * |
|
5079 | - * @return Array the aircraft list |
|
5080 | - * |
|
5081 | - */ |
|
5077 | + * Gets all aircraft registration that have flown over by aircaft icao |
|
5078 | + * |
|
5079 | + * @return Array the aircraft list |
|
5080 | + * |
|
5081 | + */ |
|
5082 | 5082 | public function countAllAircraftRegistrationByAircraft($aircraft_icao,$filters = array()) |
5083 | 5083 | { |
5084 | 5084 | $Image = new Image($this->db); |
@@ -5117,11 +5117,11 @@ discard block |
||
5117 | 5117 | |
5118 | 5118 | |
5119 | 5119 | /** |
5120 | - * Gets all aircraft types that have flown over by airline icao |
|
5121 | - * |
|
5122 | - * @return Array the aircraft list |
|
5123 | - * |
|
5124 | - */ |
|
5120 | + * Gets all aircraft types that have flown over by airline icao |
|
5121 | + * |
|
5122 | + * @return Array the aircraft list |
|
5123 | + * |
|
5124 | + */ |
|
5125 | 5125 | public function countAllAircraftTypesByAirline($airline_icao,$filters = array()) |
5126 | 5126 | { |
5127 | 5127 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5150,11 +5150,11 @@ discard block |
||
5150 | 5150 | |
5151 | 5151 | |
5152 | 5152 | /** |
5153 | - * Gets all aircraft registration that have flown over by airline icao |
|
5154 | - * |
|
5155 | - * @return Array the aircraft list |
|
5156 | - * |
|
5157 | - */ |
|
5153 | + * Gets all aircraft registration that have flown over by airline icao |
|
5154 | + * |
|
5155 | + * @return Array the aircraft list |
|
5156 | + * |
|
5157 | + */ |
|
5158 | 5158 | public function countAllAircraftRegistrationByAirline($airline_icao,$filters = array()) |
5159 | 5159 | { |
5160 | 5160 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5192,11 +5192,11 @@ discard block |
||
5192 | 5192 | |
5193 | 5193 | |
5194 | 5194 | /** |
5195 | - * Gets all aircraft manufacturer that have flown over by airline icao |
|
5196 | - * |
|
5197 | - * @return Array the aircraft list |
|
5198 | - * |
|
5199 | - */ |
|
5195 | + * Gets all aircraft manufacturer that have flown over by airline icao |
|
5196 | + * |
|
5197 | + * @return Array the aircraft list |
|
5198 | + * |
|
5199 | + */ |
|
5200 | 5200 | public function countAllAircraftManufacturerByAirline($airline_icao,$filters = array()) |
5201 | 5201 | { |
5202 | 5202 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5224,11 +5224,11 @@ discard block |
||
5224 | 5224 | |
5225 | 5225 | |
5226 | 5226 | /** |
5227 | - * Gets all aircraft types that have flown over by airline icao |
|
5228 | - * |
|
5229 | - * @return Array the aircraft list |
|
5230 | - * |
|
5231 | - */ |
|
5227 | + * Gets all aircraft types that have flown over by airline icao |
|
5228 | + * |
|
5229 | + * @return Array the aircraft list |
|
5230 | + * |
|
5231 | + */ |
|
5232 | 5232 | public function countAllAircraftTypesByAirport($airport_icao,$filters = array()) |
5233 | 5233 | { |
5234 | 5234 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5257,11 +5257,11 @@ discard block |
||
5257 | 5257 | |
5258 | 5258 | |
5259 | 5259 | /** |
5260 | - * Gets all aircraft registration that have flown over by airport icao |
|
5261 | - * |
|
5262 | - * @return Array the aircraft list |
|
5263 | - * |
|
5264 | - */ |
|
5260 | + * Gets all aircraft registration that have flown over by airport icao |
|
5261 | + * |
|
5262 | + * @return Array the aircraft list |
|
5263 | + * |
|
5264 | + */ |
|
5265 | 5265 | public function countAllAircraftRegistrationByAirport($airport_icao,$filters = array()) |
5266 | 5266 | { |
5267 | 5267 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5298,11 +5298,11 @@ discard block |
||
5298 | 5298 | |
5299 | 5299 | |
5300 | 5300 | /** |
5301 | - * Gets all aircraft manufacturer that have flown over by airport icao |
|
5302 | - * |
|
5303 | - * @return Array the aircraft list |
|
5304 | - * |
|
5305 | - */ |
|
5301 | + * Gets all aircraft manufacturer that have flown over by airport icao |
|
5302 | + * |
|
5303 | + * @return Array the aircraft list |
|
5304 | + * |
|
5305 | + */ |
|
5306 | 5306 | public function countAllAircraftManufacturerByAirport($airport_icao,$filters = array()) |
5307 | 5307 | { |
5308 | 5308 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5328,11 +5328,11 @@ discard block |
||
5328 | 5328 | } |
5329 | 5329 | |
5330 | 5330 | /** |
5331 | - * Gets all aircraft types that have flown over by aircraft manufacturer |
|
5332 | - * |
|
5333 | - * @return Array the aircraft list |
|
5334 | - * |
|
5335 | - */ |
|
5331 | + * Gets all aircraft types that have flown over by aircraft manufacturer |
|
5332 | + * |
|
5333 | + * @return Array the aircraft list |
|
5334 | + * |
|
5335 | + */ |
|
5336 | 5336 | public function countAllAircraftTypesByManufacturer($aircraft_manufacturer,$filters = array()) |
5337 | 5337 | { |
5338 | 5338 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5359,11 +5359,11 @@ discard block |
||
5359 | 5359 | |
5360 | 5360 | |
5361 | 5361 | /** |
5362 | - * Gets all aircraft registration that have flown over by aircaft manufacturer |
|
5363 | - * |
|
5364 | - * @return Array the aircraft list |
|
5365 | - * |
|
5366 | - */ |
|
5362 | + * Gets all aircraft registration that have flown over by aircaft manufacturer |
|
5363 | + * |
|
5364 | + * @return Array the aircraft list |
|
5365 | + * |
|
5366 | + */ |
|
5367 | 5367 | public function countAllAircraftRegistrationByManufacturer($aircraft_manufacturer, $filters = array()) |
5368 | 5368 | { |
5369 | 5369 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5399,11 +5399,11 @@ discard block |
||
5399 | 5399 | } |
5400 | 5400 | |
5401 | 5401 | /** |
5402 | - * Gets all aircraft types that have flown over by date |
|
5403 | - * |
|
5404 | - * @return Array the aircraft list |
|
5405 | - * |
|
5406 | - */ |
|
5402 | + * Gets all aircraft types that have flown over by date |
|
5403 | + * |
|
5404 | + * @return Array the aircraft list |
|
5405 | + * |
|
5406 | + */ |
|
5407 | 5407 | public function countAllAircraftTypesByDate($date,$filters = array()) |
5408 | 5408 | { |
5409 | 5409 | global $globalTimezone, $globalDBdriver; |
@@ -5445,11 +5445,11 @@ discard block |
||
5445 | 5445 | |
5446 | 5446 | |
5447 | 5447 | /** |
5448 | - * Gets all aircraft registration that have flown over by date |
|
5449 | - * |
|
5450 | - * @return Array the aircraft list |
|
5451 | - * |
|
5452 | - */ |
|
5448 | + * Gets all aircraft registration that have flown over by date |
|
5449 | + * |
|
5450 | + * @return Array the aircraft list |
|
5451 | + * |
|
5452 | + */ |
|
5453 | 5453 | public function countAllAircraftRegistrationByDate($date,$filters = array()) |
5454 | 5454 | { |
5455 | 5455 | global $globalTimezone, $globalDBdriver; |
@@ -5500,11 +5500,11 @@ discard block |
||
5500 | 5500 | |
5501 | 5501 | |
5502 | 5502 | /** |
5503 | - * Gets all aircraft manufacturer that have flown over by date |
|
5504 | - * |
|
5505 | - * @return Array the aircraft manufacturer list |
|
5506 | - * |
|
5507 | - */ |
|
5503 | + * Gets all aircraft manufacturer that have flown over by date |
|
5504 | + * |
|
5505 | + * @return Array the aircraft manufacturer list |
|
5506 | + * |
|
5507 | + */ |
|
5508 | 5508 | public function countAllAircraftManufacturerByDate($date,$filters = array()) |
5509 | 5509 | { |
5510 | 5510 | global $globalTimezone, $globalDBdriver; |
@@ -5546,11 +5546,11 @@ discard block |
||
5546 | 5546 | |
5547 | 5547 | |
5548 | 5548 | /** |
5549 | - * Gets all aircraft types that have flown over by ident/callsign |
|
5550 | - * |
|
5551 | - * @return Array the aircraft list |
|
5552 | - * |
|
5553 | - */ |
|
5549 | + * Gets all aircraft types that have flown over by ident/callsign |
|
5550 | + * |
|
5551 | + * @return Array the aircraft list |
|
5552 | + * |
|
5553 | + */ |
|
5554 | 5554 | public function countAllAircraftTypesByIdent($ident,$filters = array()) |
5555 | 5555 | { |
5556 | 5556 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5578,11 +5578,11 @@ discard block |
||
5578 | 5578 | } |
5579 | 5579 | |
5580 | 5580 | /** |
5581 | - * Gets all aircraft types that have flown over by pilot |
|
5582 | - * |
|
5583 | - * @return Array the aircraft list |
|
5584 | - * |
|
5585 | - */ |
|
5581 | + * Gets all aircraft types that have flown over by pilot |
|
5582 | + * |
|
5583 | + * @return Array the aircraft list |
|
5584 | + * |
|
5585 | + */ |
|
5586 | 5586 | public function countAllAircraftTypesByPilot($pilot,$filters = array()) |
5587 | 5587 | { |
5588 | 5588 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5598,11 +5598,11 @@ discard block |
||
5598 | 5598 | } |
5599 | 5599 | |
5600 | 5600 | /** |
5601 | - * Gets all aircraft types that have flown over by owner |
|
5602 | - * |
|
5603 | - * @return Array the aircraft list |
|
5604 | - * |
|
5605 | - */ |
|
5601 | + * Gets all aircraft types that have flown over by owner |
|
5602 | + * |
|
5603 | + * @return Array the aircraft list |
|
5604 | + * |
|
5605 | + */ |
|
5606 | 5606 | public function countAllAircraftTypesByOwner($owner,$filters = array()) |
5607 | 5607 | { |
5608 | 5608 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5619,11 +5619,11 @@ discard block |
||
5619 | 5619 | |
5620 | 5620 | |
5621 | 5621 | /** |
5622 | - * Gets all aircraft registration that have flown over by ident/callsign |
|
5623 | - * |
|
5624 | - * @return Array the aircraft list |
|
5625 | - * |
|
5626 | - */ |
|
5622 | + * Gets all aircraft registration that have flown over by ident/callsign |
|
5623 | + * |
|
5624 | + * @return Array the aircraft list |
|
5625 | + * |
|
5626 | + */ |
|
5627 | 5627 | public function countAllAircraftRegistrationByIdent($ident,$filters = array()) |
5628 | 5628 | { |
5629 | 5629 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5662,11 +5662,11 @@ discard block |
||
5662 | 5662 | } |
5663 | 5663 | |
5664 | 5664 | /** |
5665 | - * Gets all aircraft registration that have flown over by owner |
|
5666 | - * |
|
5667 | - * @return Array the aircraft list |
|
5668 | - * |
|
5669 | - */ |
|
5665 | + * Gets all aircraft registration that have flown over by owner |
|
5666 | + * |
|
5667 | + * @return Array the aircraft list |
|
5668 | + * |
|
5669 | + */ |
|
5670 | 5670 | public function countAllAircraftRegistrationByOwner($owner,$filters = array()) |
5671 | 5671 | { |
5672 | 5672 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5706,11 +5706,11 @@ discard block |
||
5706 | 5706 | } |
5707 | 5707 | |
5708 | 5708 | /** |
5709 | - * Gets all aircraft registration that have flown over by pilot |
|
5710 | - * |
|
5711 | - * @return Array the aircraft list |
|
5712 | - * |
|
5713 | - */ |
|
5709 | + * Gets all aircraft registration that have flown over by pilot |
|
5710 | + * |
|
5711 | + * @return Array the aircraft list |
|
5712 | + * |
|
5713 | + */ |
|
5714 | 5714 | public function countAllAircraftRegistrationByPilot($pilot,$filters = array()) |
5715 | 5715 | { |
5716 | 5716 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5751,11 +5751,11 @@ discard block |
||
5751 | 5751 | |
5752 | 5752 | |
5753 | 5753 | /** |
5754 | - * Gets all aircraft manufacturer that have flown over by ident/callsign |
|
5755 | - * |
|
5756 | - * @return Array the aircraft manufacturer list |
|
5757 | - * |
|
5758 | - */ |
|
5754 | + * Gets all aircraft manufacturer that have flown over by ident/callsign |
|
5755 | + * |
|
5756 | + * @return Array the aircraft manufacturer list |
|
5757 | + * |
|
5758 | + */ |
|
5759 | 5759 | public function countAllAircraftManufacturerByIdent($ident,$filters = array()) |
5760 | 5760 | { |
5761 | 5761 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5780,11 +5780,11 @@ discard block |
||
5780 | 5780 | } |
5781 | 5781 | |
5782 | 5782 | /** |
5783 | - * Gets all aircraft manufacturer that have flown over by owner |
|
5784 | - * |
|
5785 | - * @return Array the aircraft manufacturer list |
|
5786 | - * |
|
5787 | - */ |
|
5783 | + * Gets all aircraft manufacturer that have flown over by owner |
|
5784 | + * |
|
5785 | + * @return Array the aircraft manufacturer list |
|
5786 | + * |
|
5787 | + */ |
|
5788 | 5788 | public function countAllAircraftManufacturerByOwner($owner,$filters = array()) |
5789 | 5789 | { |
5790 | 5790 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5801,11 +5801,11 @@ discard block |
||
5801 | 5801 | } |
5802 | 5802 | |
5803 | 5803 | /** |
5804 | - * Gets all aircraft manufacturer that have flown over by pilot |
|
5805 | - * |
|
5806 | - * @return Array the aircraft manufacturer list |
|
5807 | - * |
|
5808 | - */ |
|
5804 | + * Gets all aircraft manufacturer that have flown over by pilot |
|
5805 | + * |
|
5806 | + * @return Array the aircraft manufacturer list |
|
5807 | + * |
|
5808 | + */ |
|
5809 | 5809 | public function countAllAircraftManufacturerByPilot($pilot,$filters = array()) |
5810 | 5810 | { |
5811 | 5811 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5823,11 +5823,11 @@ discard block |
||
5823 | 5823 | |
5824 | 5824 | |
5825 | 5825 | /** |
5826 | - * Gets all aircraft types that have flown over by route |
|
5827 | - * |
|
5828 | - * @return Array the aircraft list |
|
5829 | - * |
|
5830 | - */ |
|
5826 | + * Gets all aircraft types that have flown over by route |
|
5827 | + * |
|
5828 | + * @return Array the aircraft list |
|
5829 | + * |
|
5830 | + */ |
|
5831 | 5831 | public function countAllAircraftTypesByRoute($departure_airport_icao, $arrival_airport_icao,$filters = array()) |
5832 | 5832 | { |
5833 | 5833 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5856,11 +5856,11 @@ discard block |
||
5856 | 5856 | } |
5857 | 5857 | |
5858 | 5858 | /** |
5859 | - * Gets all aircraft registration that have flown over by route |
|
5860 | - * |
|
5861 | - * @return Array the aircraft list |
|
5862 | - * |
|
5863 | - */ |
|
5859 | + * Gets all aircraft registration that have flown over by route |
|
5860 | + * |
|
5861 | + * @return Array the aircraft list |
|
5862 | + * |
|
5863 | + */ |
|
5864 | 5864 | public function countAllAircraftRegistrationByRoute($departure_airport_icao, $arrival_airport_icao,$filters = array()) |
5865 | 5865 | { |
5866 | 5866 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5902,11 +5902,11 @@ discard block |
||
5902 | 5902 | |
5903 | 5903 | |
5904 | 5904 | /** |
5905 | - * Gets all aircraft manufacturer that have flown over by route |
|
5906 | - * |
|
5907 | - * @return Array the aircraft manufacturer list |
|
5908 | - * |
|
5909 | - */ |
|
5905 | + * Gets all aircraft manufacturer that have flown over by route |
|
5906 | + * |
|
5907 | + * @return Array the aircraft manufacturer list |
|
5908 | + * |
|
5909 | + */ |
|
5910 | 5910 | public function countAllAircraftManufacturerByRoute($departure_airport_icao, $arrival_airport_icao,$filters = array()) |
5911 | 5911 | { |
5912 | 5912 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5940,11 +5940,11 @@ discard block |
||
5940 | 5940 | |
5941 | 5941 | |
5942 | 5942 | /** |
5943 | - * Gets all aircraft types that have flown over by country |
|
5944 | - * |
|
5945 | - * @return Array the aircraft list |
|
5946 | - * |
|
5947 | - */ |
|
5943 | + * Gets all aircraft types that have flown over by country |
|
5944 | + * |
|
5945 | + * @return Array the aircraft list |
|
5946 | + * |
|
5947 | + */ |
|
5948 | 5948 | public function countAllAircraftTypesByCountry($country,$filters = array()) |
5949 | 5949 | { |
5950 | 5950 | $filter_query = $this->getFilter($filters,true,true); |
@@ -5975,11 +5975,11 @@ discard block |
||
5975 | 5975 | |
5976 | 5976 | |
5977 | 5977 | /** |
5978 | - * Gets all aircraft registration that have flown over by country |
|
5979 | - * |
|
5980 | - * @return Array the aircraft list |
|
5981 | - * |
|
5982 | - */ |
|
5978 | + * Gets all aircraft registration that have flown over by country |
|
5979 | + * |
|
5980 | + * @return Array the aircraft list |
|
5981 | + * |
|
5982 | + */ |
|
5983 | 5983 | public function countAllAircraftRegistrationByCountry($country,$filters = array()) |
5984 | 5984 | { |
5985 | 5985 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6019,11 +6019,11 @@ discard block |
||
6019 | 6019 | |
6020 | 6020 | |
6021 | 6021 | /** |
6022 | - * Gets all aircraft manufacturer that have flown over by country |
|
6023 | - * |
|
6024 | - * @return Array the aircraft manufacturer list |
|
6025 | - * |
|
6026 | - */ |
|
6022 | + * Gets all aircraft manufacturer that have flown over by country |
|
6023 | + * |
|
6024 | + * @return Array the aircraft manufacturer list |
|
6025 | + * |
|
6026 | + */ |
|
6027 | 6027 | public function countAllAircraftManufacturerByCountry($country,$filters = array()) |
6028 | 6028 | { |
6029 | 6029 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6054,18 +6054,18 @@ discard block |
||
6054 | 6054 | |
6055 | 6055 | |
6056 | 6056 | /** |
6057 | - * Gets all aircraft manufacturers that have flown over |
|
6058 | - * |
|
6059 | - * @return Array the aircraft list |
|
6060 | - * |
|
6061 | - */ |
|
6057 | + * Gets all aircraft manufacturers that have flown over |
|
6058 | + * |
|
6059 | + * @return Array the aircraft list |
|
6060 | + * |
|
6061 | + */ |
|
6062 | 6062 | public function countAllAircraftManufacturers($filters = array(),$year = '',$month = '',$day = '') |
6063 | 6063 | { |
6064 | 6064 | global $globalDBdriver; |
6065 | 6065 | $filter_query = $this->getFilter($filters,true,true); |
6066 | 6066 | $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
6067 | 6067 | FROM spotter_output ".$filter_query." spotter_output.aircraft_manufacturer <> '' AND spotter_output.aircraft_manufacturer <> 'Not Available'"; |
6068 | - $query_values = array(); |
|
6068 | + $query_values = array(); |
|
6069 | 6069 | if ($year != '') { |
6070 | 6070 | if ($globalDBdriver == 'mysql') { |
6071 | 6071 | $query .= " AND YEAR(spotter_output.date) = :year"; |
@@ -6118,11 +6118,11 @@ discard block |
||
6118 | 6118 | |
6119 | 6119 | |
6120 | 6120 | /** |
6121 | - * Gets all aircraft registrations that have flown over |
|
6122 | - * |
|
6123 | - * @return Array the aircraft list |
|
6124 | - * |
|
6125 | - */ |
|
6121 | + * Gets all aircraft registrations that have flown over |
|
6122 | + * |
|
6123 | + * @return Array the aircraft list |
|
6124 | + * |
|
6125 | + */ |
|
6126 | 6126 | public function countAllAircraftRegistrations($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array(),$year = '', $month = '', $day = '') |
6127 | 6127 | { |
6128 | 6128 | global $globalDBdriver; |
@@ -6130,15 +6130,15 @@ discard block |
||
6130 | 6130 | $filter_query = $this->getFilter($filters,true,true); |
6131 | 6131 | $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 |
6132 | 6132 | FROM spotter_output ".$filter_query." spotter_output.registration <> '' AND spotter_output.registration <> 'NA'"; |
6133 | - if ($olderthanmonths > 0) { |
|
6134 | - if ($globalDBdriver == 'mysql') { |
|
6133 | + if ($olderthanmonths > 0) { |
|
6134 | + if ($globalDBdriver == 'mysql') { |
|
6135 | 6135 | $query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)'; |
6136 | 6136 | } else { |
6137 | 6137 | $query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
6138 | 6138 | } |
6139 | 6139 | } |
6140 | - if ($sincedate != '') { |
|
6141 | - if ($globalDBdriver == 'mysql') { |
|
6140 | + if ($sincedate != '') { |
|
6141 | + if ($globalDBdriver == 'mysql') { |
|
6142 | 6142 | $query .= " AND spotter_output.date > '".$sincedate."'"; |
6143 | 6143 | } else { |
6144 | 6144 | $query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -6203,11 +6203,11 @@ discard block |
||
6203 | 6203 | |
6204 | 6204 | |
6205 | 6205 | /** |
6206 | - * Gets all aircraft registrations that have flown over |
|
6207 | - * |
|
6208 | - * @return Array the aircraft list |
|
6209 | - * |
|
6210 | - */ |
|
6206 | + * Gets all aircraft registrations that have flown over |
|
6207 | + * |
|
6208 | + * @return Array the aircraft list |
|
6209 | + * |
|
6210 | + */ |
|
6211 | 6211 | public function countAllAircraftRegistrationsByAirlines($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array()) |
6212 | 6212 | { |
6213 | 6213 | global $globalDBdriver; |
@@ -6215,15 +6215,15 @@ discard block |
||
6215 | 6215 | $Image = new Image($this->db); |
6216 | 6216 | $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 |
6217 | 6217 | FROM spotter_output".$filter_query." spotter_output.airline_icao <> '' AND spotter_output.registration <> '' AND spotter_output.registration <> 'NA' "; |
6218 | - if ($olderthanmonths > 0) { |
|
6219 | - if ($globalDBdriver == 'mysql') { |
|
6218 | + if ($olderthanmonths > 0) { |
|
6219 | + if ($globalDBdriver == 'mysql') { |
|
6220 | 6220 | $query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) '; |
6221 | 6221 | } else { |
6222 | 6222 | $query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
6223 | 6223 | } |
6224 | 6224 | } |
6225 | - if ($sincedate != '') { |
|
6226 | - if ($globalDBdriver == 'mysql') { |
|
6225 | + if ($sincedate != '') { |
|
6226 | + if ($globalDBdriver == 'mysql') { |
|
6227 | 6227 | $query .= "AND spotter_output.date > '".$sincedate."' "; |
6228 | 6228 | } else { |
6229 | 6229 | $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -6232,7 +6232,7 @@ discard block |
||
6232 | 6232 | |
6233 | 6233 | // if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
6234 | 6234 | //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
6235 | - $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"; |
|
6235 | + $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"; |
|
6236 | 6236 | if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
6237 | 6237 | |
6238 | 6238 | $sth = $this->db->prepare($query); |
@@ -6264,26 +6264,26 @@ discard block |
||
6264 | 6264 | |
6265 | 6265 | |
6266 | 6266 | /** |
6267 | - * Gets all departure airports of the airplanes that have flown over |
|
6268 | - * |
|
6269 | - * @return Array the airport list |
|
6270 | - * |
|
6271 | - */ |
|
6267 | + * Gets all departure airports of the airplanes that have flown over |
|
6268 | + * |
|
6269 | + * @return Array the airport list |
|
6270 | + * |
|
6271 | + */ |
|
6272 | 6272 | public function countAllDepartureAirports($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array(),$year = '',$month = '',$day = '') |
6273 | 6273 | { |
6274 | 6274 | global $globalDBdriver; |
6275 | 6275 | $filter_query = $this->getFilter($filters,true,true); |
6276 | 6276 | $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 |
6277 | 6277 | FROM spotter_output".$filter_query." spotter_output.departure_airport_name <> '' AND spotter_output.departure_airport_icao <> 'NA' AND spotter_output.departure_airport_icao <> ''"; |
6278 | - if ($olderthanmonths > 0) { |
|
6279 | - if ($globalDBdriver == 'mysql') { |
|
6278 | + if ($olderthanmonths > 0) { |
|
6279 | + if ($globalDBdriver == 'mysql') { |
|
6280 | 6280 | $query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)'; |
6281 | 6281 | } else { |
6282 | 6282 | $query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
6283 | 6283 | } |
6284 | - } |
|
6285 | - if ($sincedate != '') { |
|
6286 | - if ($globalDBdriver == 'mysql') { |
|
6284 | + } |
|
6285 | + if ($sincedate != '') { |
|
6286 | + if ($globalDBdriver == 'mysql') { |
|
6287 | 6287 | $query .= " AND spotter_output.date > '".$sincedate."'"; |
6288 | 6288 | } else { |
6289 | 6289 | $query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -6317,7 +6317,7 @@ discard block |
||
6317 | 6317 | $query_values = array_merge($query_values,array(':day' => $day)); |
6318 | 6318 | } |
6319 | 6319 | } |
6320 | - $query .= " GROUP BY spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country |
|
6320 | + $query .= " GROUP BY spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country |
|
6321 | 6321 | ORDER BY airport_departure_icao_count DESC"; |
6322 | 6322 | if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
6323 | 6323 | |
@@ -6340,35 +6340,35 @@ discard block |
||
6340 | 6340 | } |
6341 | 6341 | |
6342 | 6342 | /** |
6343 | - * Gets all departure airports of the airplanes that have flown over |
|
6344 | - * |
|
6345 | - * @return Array the airport list |
|
6346 | - * |
|
6347 | - */ |
|
6343 | + * Gets all departure airports of the airplanes that have flown over |
|
6344 | + * |
|
6345 | + * @return Array the airport list |
|
6346 | + * |
|
6347 | + */ |
|
6348 | 6348 | public function countAllDepartureAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array()) |
6349 | 6349 | { |
6350 | 6350 | global $globalDBdriver; |
6351 | 6351 | $filter_query = $this->getFilter($filters,true,true); |
6352 | 6352 | $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 |
6353 | 6353 | 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 <> '' "; |
6354 | - if ($olderthanmonths > 0) { |
|
6355 | - if ($globalDBdriver == 'mysql') { |
|
6354 | + if ($olderthanmonths > 0) { |
|
6355 | + if ($globalDBdriver == 'mysql') { |
|
6356 | 6356 | $query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) '; |
6357 | 6357 | } else { |
6358 | 6358 | $query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
6359 | 6359 | } |
6360 | - } |
|
6361 | - if ($sincedate != '') { |
|
6362 | - if ($globalDBdriver == 'mysql') { |
|
6360 | + } |
|
6361 | + if ($sincedate != '') { |
|
6362 | + if ($globalDBdriver == 'mysql') { |
|
6363 | 6363 | $query .= "AND spotter_output.date > '".$sincedate."' "; |
6364 | 6364 | } else { |
6365 | 6365 | $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
6366 | 6366 | } |
6367 | 6367 | } |
6368 | 6368 | |
6369 | - //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
6370 | - //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
6371 | - $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 |
|
6369 | + //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
6370 | + //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
6371 | + $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 |
|
6372 | 6372 | ORDER BY airport_departure_icao_count DESC"; |
6373 | 6373 | if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
6374 | 6374 | |
@@ -6393,26 +6393,26 @@ discard block |
||
6393 | 6393 | } |
6394 | 6394 | |
6395 | 6395 | /** |
6396 | - * Gets all detected departure airports of the airplanes that have flown over |
|
6397 | - * |
|
6398 | - * @return Array the airport list |
|
6399 | - * |
|
6400 | - */ |
|
6396 | + * Gets all detected departure airports of the airplanes that have flown over |
|
6397 | + * |
|
6398 | + * @return Array the airport list |
|
6399 | + * |
|
6400 | + */ |
|
6401 | 6401 | public function countAllDetectedDepartureAirports($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array(),$year = '',$month = '',$day = '') |
6402 | 6402 | { |
6403 | 6403 | global $globalDBdriver; |
6404 | 6404 | $filter_query = $this->getFilter($filters,true,true); |
6405 | 6405 | $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 |
6406 | 6406 | 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"; |
6407 | - if ($olderthanmonths > 0) { |
|
6408 | - if ($globalDBdriver == 'mysql') { |
|
6407 | + if ($olderthanmonths > 0) { |
|
6408 | + if ($globalDBdriver == 'mysql') { |
|
6409 | 6409 | $query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)'; |
6410 | 6410 | } else { |
6411 | 6411 | $query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
6412 | 6412 | } |
6413 | - } |
|
6414 | - if ($sincedate != '') { |
|
6415 | - if ($globalDBdriver == 'mysql') { |
|
6413 | + } |
|
6414 | + if ($sincedate != '') { |
|
6415 | + if ($globalDBdriver == 'mysql') { |
|
6416 | 6416 | $query .= " AND spotter_output.date > '".$sincedate."'"; |
6417 | 6417 | } else { |
6418 | 6418 | $query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -6446,10 +6446,10 @@ discard block |
||
6446 | 6446 | $query_values = array_merge($query_values,array(':day' => $day)); |
6447 | 6447 | } |
6448 | 6448 | } |
6449 | - $query .= " GROUP BY spotter_output.real_departure_airport_icao, airport.name, airport.city, airport.country |
|
6449 | + $query .= " GROUP BY spotter_output.real_departure_airport_icao, airport.name, airport.city, airport.country |
|
6450 | 6450 | ORDER BY airport_departure_icao_count DESC"; |
6451 | 6451 | if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
6452 | - //echo $query; |
|
6452 | + //echo $query; |
|
6453 | 6453 | $sth = $this->db->prepare($query); |
6454 | 6454 | $sth->execute($query_values); |
6455 | 6455 | |
@@ -6470,35 +6470,35 @@ discard block |
||
6470 | 6470 | } |
6471 | 6471 | |
6472 | 6472 | /** |
6473 | - * Gets all detected departure airports of the airplanes that have flown over |
|
6474 | - * |
|
6475 | - * @return Array the airport list |
|
6476 | - * |
|
6477 | - */ |
|
6473 | + * Gets all detected departure airports of the airplanes that have flown over |
|
6474 | + * |
|
6475 | + * @return Array the airport list |
|
6476 | + * |
|
6477 | + */ |
|
6478 | 6478 | public function countAllDetectedDepartureAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array()) |
6479 | 6479 | { |
6480 | 6480 | global $globalDBdriver; |
6481 | 6481 | $filter_query = $this->getFilter($filters,true,true); |
6482 | 6482 | $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 |
6483 | 6483 | 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 "; |
6484 | - if ($olderthanmonths > 0) { |
|
6485 | - if ($globalDBdriver == 'mysql') { |
|
6484 | + if ($olderthanmonths > 0) { |
|
6485 | + if ($globalDBdriver == 'mysql') { |
|
6486 | 6486 | $query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) '; |
6487 | 6487 | } else { |
6488 | 6488 | $query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
6489 | 6489 | } |
6490 | - } |
|
6491 | - if ($sincedate != '') { |
|
6492 | - if ($globalDBdriver == 'mysql') { |
|
6490 | + } |
|
6491 | + if ($sincedate != '') { |
|
6492 | + if ($globalDBdriver == 'mysql') { |
|
6493 | 6493 | $query .= "AND spotter_output.date > '".$sincedate."' "; |
6494 | 6494 | } else { |
6495 | 6495 | $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP) "; |
6496 | 6496 | } |
6497 | 6497 | } |
6498 | 6498 | |
6499 | - //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
6500 | - //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
6501 | - $query .= "GROUP BY spotter_output.airline_icao, spotter_output.real_departure_airport_icao, airport.name, airport.city, airport.country |
|
6499 | + //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
6500 | + //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
6501 | + $query .= "GROUP BY spotter_output.airline_icao, spotter_output.real_departure_airport_icao, airport.name, airport.city, airport.country |
|
6502 | 6502 | ORDER BY airport_departure_icao_count DESC"; |
6503 | 6503 | if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
6504 | 6504 | |
@@ -6523,11 +6523,11 @@ discard block |
||
6523 | 6523 | } |
6524 | 6524 | |
6525 | 6525 | /** |
6526 | - * Gets all departure airports of the airplanes that have flown over based on an airline icao |
|
6527 | - * |
|
6528 | - * @return Array the airport list |
|
6529 | - * |
|
6530 | - */ |
|
6526 | + * Gets all departure airports of the airplanes that have flown over based on an airline icao |
|
6527 | + * |
|
6528 | + * @return Array the airport list |
|
6529 | + * |
|
6530 | + */ |
|
6531 | 6531 | public function countAllDepartureAirportsByAirline($airline_icao,$filters = array()) |
6532 | 6532 | { |
6533 | 6533 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6561,11 +6561,11 @@ discard block |
||
6561 | 6561 | |
6562 | 6562 | |
6563 | 6563 | /** |
6564 | - * Gets all departure airports by country of the airplanes that have flown over based on an airline icao |
|
6565 | - * |
|
6566 | - * @return Array the airport list |
|
6567 | - * |
|
6568 | - */ |
|
6564 | + * Gets all departure airports by country of the airplanes that have flown over based on an airline icao |
|
6565 | + * |
|
6566 | + * @return Array the airport list |
|
6567 | + * |
|
6568 | + */ |
|
6569 | 6569 | public function countAllDepartureAirportCountriesByAirline($airline_icao,$filters = array()) |
6570 | 6570 | { |
6571 | 6571 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6596,11 +6596,11 @@ discard block |
||
6596 | 6596 | |
6597 | 6597 | |
6598 | 6598 | /** |
6599 | - * Gets all departure airports of the airplanes that have flown over based on an aircraft icao |
|
6600 | - * |
|
6601 | - * @return Array the airport list |
|
6602 | - * |
|
6603 | - */ |
|
6599 | + * Gets all departure airports of the airplanes that have flown over based on an aircraft icao |
|
6600 | + * |
|
6601 | + * @return Array the airport list |
|
6602 | + * |
|
6603 | + */ |
|
6604 | 6604 | public function countAllDepartureAirportsByAircraft($aircraft_icao,$filters = array()) |
6605 | 6605 | { |
6606 | 6606 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6633,11 +6633,11 @@ discard block |
||
6633 | 6633 | |
6634 | 6634 | |
6635 | 6635 | /** |
6636 | - * Gets all departure airports by country of the airplanes that have flown over based on an aircraft icao |
|
6637 | - * |
|
6638 | - * @return Array the airport list |
|
6639 | - * |
|
6640 | - */ |
|
6636 | + * Gets all departure airports by country of the airplanes that have flown over based on an aircraft icao |
|
6637 | + * |
|
6638 | + * @return Array the airport list |
|
6639 | + * |
|
6640 | + */ |
|
6641 | 6641 | public function countAllDepartureAirportCountriesByAircraft($aircraft_icao,$filters = array()) |
6642 | 6642 | { |
6643 | 6643 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6667,11 +6667,11 @@ discard block |
||
6667 | 6667 | |
6668 | 6668 | |
6669 | 6669 | /** |
6670 | - * Gets all departure airports of the airplanes that have flown over based on an aircraft registration |
|
6671 | - * |
|
6672 | - * @return Array the airport list |
|
6673 | - * |
|
6674 | - */ |
|
6670 | + * Gets all departure airports of the airplanes that have flown over based on an aircraft registration |
|
6671 | + * |
|
6672 | + * @return Array the airport list |
|
6673 | + * |
|
6674 | + */ |
|
6675 | 6675 | public function countAllDepartureAirportsByRegistration($registration,$filters = array()) |
6676 | 6676 | { |
6677 | 6677 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6704,11 +6704,11 @@ discard block |
||
6704 | 6704 | |
6705 | 6705 | |
6706 | 6706 | /** |
6707 | - * Gets all departure airports by country of the airplanes that have flown over based on an aircraft registration |
|
6708 | - * |
|
6709 | - * @return Array the airport list |
|
6710 | - * |
|
6711 | - */ |
|
6707 | + * Gets all departure airports by country of the airplanes that have flown over based on an aircraft registration |
|
6708 | + * |
|
6709 | + * @return Array the airport list |
|
6710 | + * |
|
6711 | + */ |
|
6712 | 6712 | public function countAllDepartureAirportCountriesByRegistration($registration,$filters = array()) |
6713 | 6713 | { |
6714 | 6714 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6738,11 +6738,11 @@ discard block |
||
6738 | 6738 | |
6739 | 6739 | |
6740 | 6740 | /** |
6741 | - * Gets all departure airports of the airplanes that have flown over based on an arrivl airport icao |
|
6742 | - * |
|
6743 | - * @return Array the airport list |
|
6744 | - * |
|
6745 | - */ |
|
6741 | + * Gets all departure airports of the airplanes that have flown over based on an arrivl airport icao |
|
6742 | + * |
|
6743 | + * @return Array the airport list |
|
6744 | + * |
|
6745 | + */ |
|
6746 | 6746 | public function countAllDepartureAirportsByAirport($airport_icao,$filters = array()) |
6747 | 6747 | { |
6748 | 6748 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6775,11 +6775,11 @@ discard block |
||
6775 | 6775 | |
6776 | 6776 | |
6777 | 6777 | /** |
6778 | - * Gets all departure airports by country of the airplanes that have flown over based on an airport icao |
|
6779 | - * |
|
6780 | - * @return Array the airport list |
|
6781 | - * |
|
6782 | - */ |
|
6778 | + * Gets all departure airports by country of the airplanes that have flown over based on an airport icao |
|
6779 | + * |
|
6780 | + * @return Array the airport list |
|
6781 | + * |
|
6782 | + */ |
|
6783 | 6783 | public function countAllDepartureAirportCountriesByAirport($airport_icao,$filters = array()) |
6784 | 6784 | { |
6785 | 6785 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6810,11 +6810,11 @@ discard block |
||
6810 | 6810 | |
6811 | 6811 | |
6812 | 6812 | /** |
6813 | - * Gets all departure airports of the airplanes that have flown over based on an aircraft manufacturer |
|
6814 | - * |
|
6815 | - * @return Array the airport list |
|
6816 | - * |
|
6817 | - */ |
|
6813 | + * Gets all departure airports of the airplanes that have flown over based on an aircraft manufacturer |
|
6814 | + * |
|
6815 | + * @return Array the airport list |
|
6816 | + * |
|
6817 | + */ |
|
6818 | 6818 | public function countAllDepartureAirportsByManufacturer($aircraft_manufacturer,$filters = array()) |
6819 | 6819 | { |
6820 | 6820 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6847,11 +6847,11 @@ discard block |
||
6847 | 6847 | |
6848 | 6848 | |
6849 | 6849 | /** |
6850 | - * Gets all departure airports by country of the airplanes that have flown over based on an aircraft manufacturer |
|
6851 | - * |
|
6852 | - * @return Array the airport list |
|
6853 | - * |
|
6854 | - */ |
|
6850 | + * Gets all departure airports by country of the airplanes that have flown over based on an aircraft manufacturer |
|
6851 | + * |
|
6852 | + * @return Array the airport list |
|
6853 | + * |
|
6854 | + */ |
|
6855 | 6855 | public function countAllDepartureAirportCountriesByManufacturer($aircraft_manufacturer,$filters = array()) |
6856 | 6856 | { |
6857 | 6857 | $filter_query = $this->getFilter($filters,true,true); |
@@ -6881,11 +6881,11 @@ discard block |
||
6881 | 6881 | |
6882 | 6882 | |
6883 | 6883 | /** |
6884 | - * Gets all departure airports of the airplanes that have flown over based on a date |
|
6885 | - * |
|
6886 | - * @return Array the airport list |
|
6887 | - * |
|
6888 | - */ |
|
6884 | + * Gets all departure airports of the airplanes that have flown over based on a date |
|
6885 | + * |
|
6886 | + * @return Array the airport list |
|
6887 | + * |
|
6888 | + */ |
|
6889 | 6889 | public function countAllDepartureAirportsByDate($date,$filters = array()) |
6890 | 6890 | { |
6891 | 6891 | global $globalTimezone, $globalDBdriver; |
@@ -6931,11 +6931,11 @@ discard block |
||
6931 | 6931 | |
6932 | 6932 | |
6933 | 6933 | /** |
6934 | - * Gets all departure airports by country of the airplanes that have flown over based on a date |
|
6935 | - * |
|
6936 | - * @return Array the airport list |
|
6937 | - * |
|
6938 | - */ |
|
6934 | + * Gets all departure airports by country of the airplanes that have flown over based on a date |
|
6935 | + * |
|
6936 | + * @return Array the airport list |
|
6937 | + * |
|
6938 | + */ |
|
6939 | 6939 | public function countAllDepartureAirportCountriesByDate($date,$filters = array()) |
6940 | 6940 | { |
6941 | 6941 | global $globalTimezone, $globalDBdriver; |
@@ -6978,11 +6978,11 @@ discard block |
||
6978 | 6978 | |
6979 | 6979 | |
6980 | 6980 | /** |
6981 | - * Gets all departure airports of the airplanes that have flown over based on a ident/callsign |
|
6982 | - * |
|
6983 | - * @return Array the airport list |
|
6984 | - * |
|
6985 | - */ |
|
6981 | + * Gets all departure airports of the airplanes that have flown over based on a ident/callsign |
|
6982 | + * |
|
6983 | + * @return Array the airport list |
|
6984 | + * |
|
6985 | + */ |
|
6986 | 6986 | public function countAllDepartureAirportsByIdent($ident,$filters = array()) |
6987 | 6987 | { |
6988 | 6988 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7014,11 +7014,11 @@ discard block |
||
7014 | 7014 | } |
7015 | 7015 | |
7016 | 7016 | /** |
7017 | - * Gets all departure airports of the airplanes that have flown over based on a owner |
|
7018 | - * |
|
7019 | - * @return Array the airport list |
|
7020 | - * |
|
7021 | - */ |
|
7017 | + * Gets all departure airports of the airplanes that have flown over based on a owner |
|
7018 | + * |
|
7019 | + * @return Array the airport list |
|
7020 | + * |
|
7021 | + */ |
|
7022 | 7022 | public function countAllDepartureAirportsByOwner($owner,$filters = array()) |
7023 | 7023 | { |
7024 | 7024 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7050,11 +7050,11 @@ discard block |
||
7050 | 7050 | } |
7051 | 7051 | |
7052 | 7052 | /** |
7053 | - * Gets all departure airports of the airplanes that have flown over based on a pilot |
|
7054 | - * |
|
7055 | - * @return Array the airport list |
|
7056 | - * |
|
7057 | - */ |
|
7053 | + * Gets all departure airports of the airplanes that have flown over based on a pilot |
|
7054 | + * |
|
7055 | + * @return Array the airport list |
|
7056 | + * |
|
7057 | + */ |
|
7058 | 7058 | public function countAllDepartureAirportsByPilot($pilot,$filters = array()) |
7059 | 7059 | { |
7060 | 7060 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7087,11 +7087,11 @@ discard block |
||
7087 | 7087 | |
7088 | 7088 | |
7089 | 7089 | /** |
7090 | - * Gets all departure airports by country of the airplanes that have flown over based on a callsign/ident |
|
7091 | - * |
|
7092 | - * @return Array the airport list |
|
7093 | - * |
|
7094 | - */ |
|
7090 | + * Gets all departure airports by country of the airplanes that have flown over based on a callsign/ident |
|
7091 | + * |
|
7092 | + * @return Array the airport list |
|
7093 | + * |
|
7094 | + */ |
|
7095 | 7095 | public function countAllDepartureAirportCountriesByIdent($ident,$filters = array()) |
7096 | 7096 | { |
7097 | 7097 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7120,11 +7120,11 @@ discard block |
||
7120 | 7120 | } |
7121 | 7121 | |
7122 | 7122 | /** |
7123 | - * Gets all departure airports by country of the airplanes that have flown over based on owner |
|
7124 | - * |
|
7125 | - * @return Array the airport list |
|
7126 | - * |
|
7127 | - */ |
|
7123 | + * Gets all departure airports by country of the airplanes that have flown over based on owner |
|
7124 | + * |
|
7125 | + * @return Array the airport list |
|
7126 | + * |
|
7127 | + */ |
|
7128 | 7128 | public function countAllDepartureAirportCountriesByOwner($owner,$filters = array()) |
7129 | 7129 | { |
7130 | 7130 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7140,11 +7140,11 @@ discard block |
||
7140 | 7140 | } |
7141 | 7141 | |
7142 | 7142 | /** |
7143 | - * Gets all departure airports by country of the airplanes that have flown over based on pilot |
|
7144 | - * |
|
7145 | - * @return Array the airport list |
|
7146 | - * |
|
7147 | - */ |
|
7143 | + * Gets all departure airports by country of the airplanes that have flown over based on pilot |
|
7144 | + * |
|
7145 | + * @return Array the airport list |
|
7146 | + * |
|
7147 | + */ |
|
7148 | 7148 | public function countAllDepartureAirportCountriesByPilot($pilot,$filters = array()) |
7149 | 7149 | { |
7150 | 7150 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7162,11 +7162,11 @@ discard block |
||
7162 | 7162 | |
7163 | 7163 | |
7164 | 7164 | /** |
7165 | - * Gets all departure airports of the airplanes that have flown over based on a country |
|
7166 | - * |
|
7167 | - * @return Array the airport list |
|
7168 | - * |
|
7169 | - */ |
|
7165 | + * Gets all departure airports of the airplanes that have flown over based on a country |
|
7166 | + * |
|
7167 | + * @return Array the airport list |
|
7168 | + * |
|
7169 | + */ |
|
7170 | 7170 | public function countAllDepartureAirportsByCountry($country,$filters = array()) |
7171 | 7171 | { |
7172 | 7172 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7200,11 +7200,11 @@ discard block |
||
7200 | 7200 | |
7201 | 7201 | |
7202 | 7202 | /** |
7203 | - * Gets all departure airports by country of the airplanes that have flown over based on an aircraft icao |
|
7204 | - * |
|
7205 | - * @return Array the airport list |
|
7206 | - * |
|
7207 | - */ |
|
7203 | + * Gets all departure airports by country of the airplanes that have flown over based on an aircraft icao |
|
7204 | + * |
|
7205 | + * @return Array the airport list |
|
7206 | + * |
|
7207 | + */ |
|
7208 | 7208 | public function countAllDepartureAirportCountriesByCountry($country,$filters = array()) |
7209 | 7209 | { |
7210 | 7210 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7234,31 +7234,31 @@ discard block |
||
7234 | 7234 | |
7235 | 7235 | |
7236 | 7236 | /** |
7237 | - * Gets all arrival airports of the airplanes that have flown over |
|
7238 | - * |
|
7239 | - * @param Boolean $limit Limit result to 10 or not |
|
7240 | - * @param Integer $olderthanmonths Only show result older than x months |
|
7241 | - * @param String $sincedate Only show result since x date |
|
7242 | - * @param Boolean $icaoaskey Show result by ICAO |
|
7243 | - * @param Array $filters Filter used here |
|
7244 | - * @return Array the airport list |
|
7245 | - * |
|
7246 | - */ |
|
7237 | + * Gets all arrival airports of the airplanes that have flown over |
|
7238 | + * |
|
7239 | + * @param Boolean $limit Limit result to 10 or not |
|
7240 | + * @param Integer $olderthanmonths Only show result older than x months |
|
7241 | + * @param String $sincedate Only show result since x date |
|
7242 | + * @param Boolean $icaoaskey Show result by ICAO |
|
7243 | + * @param Array $filters Filter used here |
|
7244 | + * @return Array the airport list |
|
7245 | + * |
|
7246 | + */ |
|
7247 | 7247 | public function countAllArrivalAirports($limit = true, $olderthanmonths = 0, $sincedate = '', $icaoaskey = false,$filters = array(),$year = '',$month = '',$day = '') |
7248 | 7248 | { |
7249 | 7249 | global $globalDBdriver; |
7250 | 7250 | $filter_query = $this->getFilter($filters,true,true); |
7251 | 7251 | $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 |
7252 | 7252 | FROM spotter_output".$filter_query." spotter_output.arrival_airport_name <> '' AND spotter_output.arrival_airport_icao <> 'NA' AND spotter_output.arrival_airport_icao <> ''"; |
7253 | - if ($olderthanmonths > 0) { |
|
7254 | - if ($globalDBdriver == 'mysql') { |
|
7253 | + if ($olderthanmonths > 0) { |
|
7254 | + if ($globalDBdriver == 'mysql') { |
|
7255 | 7255 | $query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)'; |
7256 | 7256 | } else { |
7257 | 7257 | $query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
7258 | 7258 | } |
7259 | 7259 | } |
7260 | - if ($sincedate != '') { |
|
7261 | - if ($globalDBdriver == 'mysql') { |
|
7260 | + if ($sincedate != '') { |
|
7261 | + if ($globalDBdriver == 'mysql') { |
|
7262 | 7262 | $query .= " AND spotter_output.date > '".$sincedate."'"; |
7263 | 7263 | } else { |
7264 | 7264 | $query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -7292,7 +7292,7 @@ discard block |
||
7292 | 7292 | $query_values = array_merge($query_values,array(':day' => $day)); |
7293 | 7293 | } |
7294 | 7294 | } |
7295 | - $query .= " GROUP BY spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
|
7295 | + $query .= " GROUP BY spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
|
7296 | 7296 | ORDER BY airport_arrival_icao_count DESC"; |
7297 | 7297 | if ($limit) $query .= " LIMIT 10"; |
7298 | 7298 | |
@@ -7321,35 +7321,35 @@ discard block |
||
7321 | 7321 | } |
7322 | 7322 | |
7323 | 7323 | /** |
7324 | - * Gets all arrival airports of the airplanes that have flown over |
|
7325 | - * |
|
7326 | - * @return Array the airport list |
|
7327 | - * |
|
7328 | - */ |
|
7324 | + * Gets all arrival airports of the airplanes that have flown over |
|
7325 | + * |
|
7326 | + * @return Array the airport list |
|
7327 | + * |
|
7328 | + */ |
|
7329 | 7329 | public function countAllArrivalAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '', $icaoaskey = false,$filters = array()) |
7330 | 7330 | { |
7331 | 7331 | global $globalDBdriver; |
7332 | 7332 | $filter_query = $this->getFilter($filters,true,true); |
7333 | 7333 | $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 |
7334 | 7334 | 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 <> '' "; |
7335 | - if ($olderthanmonths > 0) { |
|
7336 | - if ($globalDBdriver == 'mysql') { |
|
7335 | + if ($olderthanmonths > 0) { |
|
7336 | + if ($globalDBdriver == 'mysql') { |
|
7337 | 7337 | $query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) '; |
7338 | 7338 | } else { |
7339 | 7339 | $query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
7340 | 7340 | } |
7341 | 7341 | } |
7342 | - if ($sincedate != '') { |
|
7343 | - if ($globalDBdriver == 'mysql') { |
|
7342 | + if ($sincedate != '') { |
|
7343 | + if ($globalDBdriver == 'mysql') { |
|
7344 | 7344 | $query .= "AND spotter_output.date > '".$sincedate."' "; |
7345 | 7345 | } else { |
7346 | 7346 | $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
7347 | 7347 | } |
7348 | 7348 | } |
7349 | 7349 | |
7350 | - //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
7351 | - //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
7352 | - $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 |
|
7350 | + //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
7351 | + //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
7352 | + $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 |
|
7353 | 7353 | ORDER BY airport_arrival_icao_count DESC"; |
7354 | 7354 | if ($limit) $query .= " LIMIT 10"; |
7355 | 7355 | |
@@ -7380,26 +7380,26 @@ discard block |
||
7380 | 7380 | |
7381 | 7381 | |
7382 | 7382 | /** |
7383 | - * Gets all detected arrival airports of the airplanes that have flown over |
|
7384 | - * |
|
7385 | - * @return Array the airport list |
|
7386 | - * |
|
7387 | - */ |
|
7383 | + * Gets all detected arrival airports of the airplanes that have flown over |
|
7384 | + * |
|
7385 | + * @return Array the airport list |
|
7386 | + * |
|
7387 | + */ |
|
7388 | 7388 | public function countAllDetectedArrivalAirports($limit = true, $olderthanmonths = 0, $sincedate = '',$icaoaskey = false,$filters = array(),$year = '',$month = '',$day = '') |
7389 | 7389 | { |
7390 | 7390 | global $globalDBdriver; |
7391 | 7391 | $filter_query = $this->getFilter($filters,true,true); |
7392 | 7392 | $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 |
7393 | 7393 | 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"; |
7394 | - if ($olderthanmonths > 0) { |
|
7395 | - if ($globalDBdriver == 'mysql') { |
|
7394 | + if ($olderthanmonths > 0) { |
|
7395 | + if ($globalDBdriver == 'mysql') { |
|
7396 | 7396 | $query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)'; |
7397 | 7397 | } else { |
7398 | 7398 | $query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
7399 | 7399 | } |
7400 | 7400 | } |
7401 | - if ($sincedate != '') { |
|
7402 | - if ($globalDBdriver == 'mysql') { |
|
7401 | + if ($sincedate != '') { |
|
7402 | + if ($globalDBdriver == 'mysql') { |
|
7403 | 7403 | $query .= " AND spotter_output.date > '".$sincedate."'"; |
7404 | 7404 | } else { |
7405 | 7405 | $query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -7433,7 +7433,7 @@ discard block |
||
7433 | 7433 | $query_values = array_merge($query_values,array(':day' => $day)); |
7434 | 7434 | } |
7435 | 7435 | } |
7436 | - $query .= " GROUP BY spotter_output.real_arrival_airport_icao, airport.name, airport.city, airport.country |
|
7436 | + $query .= " GROUP BY spotter_output.real_arrival_airport_icao, airport.name, airport.city, airport.country |
|
7437 | 7437 | ORDER BY airport_arrival_icao_count DESC"; |
7438 | 7438 | if ($limit) $query .= " LIMIT 10"; |
7439 | 7439 | |
@@ -7461,35 +7461,35 @@ discard block |
||
7461 | 7461 | } |
7462 | 7462 | |
7463 | 7463 | /** |
7464 | - * Gets all detected arrival airports of the airplanes that have flown over |
|
7465 | - * |
|
7466 | - * @return Array the airport list |
|
7467 | - * |
|
7468 | - */ |
|
7464 | + * Gets all detected arrival airports of the airplanes that have flown over |
|
7465 | + * |
|
7466 | + * @return Array the airport list |
|
7467 | + * |
|
7468 | + */ |
|
7469 | 7469 | public function countAllDetectedArrivalAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '',$icaoaskey = false,$filters = array()) |
7470 | 7470 | { |
7471 | 7471 | global $globalDBdriver; |
7472 | 7472 | $filter_query = $this->getFilter($filters,true,true); |
7473 | 7473 | $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 |
7474 | 7474 | 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 "; |
7475 | - if ($olderthanmonths > 0) { |
|
7476 | - if ($globalDBdriver == 'mysql') { |
|
7475 | + if ($olderthanmonths > 0) { |
|
7476 | + if ($globalDBdriver == 'mysql') { |
|
7477 | 7477 | $query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) '; |
7478 | 7478 | } else { |
7479 | 7479 | $query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
7480 | 7480 | } |
7481 | 7481 | } |
7482 | - if ($sincedate != '') { |
|
7483 | - if ($globalDBdriver == 'mysql') { |
|
7482 | + if ($sincedate != '') { |
|
7483 | + if ($globalDBdriver == 'mysql') { |
|
7484 | 7484 | $query .= "AND spotter_output.date > '".$sincedate."' "; |
7485 | 7485 | } else { |
7486 | 7486 | $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
7487 | 7487 | } |
7488 | 7488 | } |
7489 | 7489 | |
7490 | - //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
7491 | - //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
7492 | - $query .= "GROUP BY spotter_output.airline_icao, spotter_output.real_arrival_airport_icao, airport.name, airport.city, airport.country |
|
7490 | + //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
7491 | + //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
7492 | + $query .= "GROUP BY spotter_output.airline_icao, spotter_output.real_arrival_airport_icao, airport.name, airport.city, airport.country |
|
7493 | 7493 | ORDER BY airport_arrival_icao_count DESC"; |
7494 | 7494 | if ($limit) $query .= " LIMIT 10"; |
7495 | 7495 | |
@@ -7519,11 +7519,11 @@ discard block |
||
7519 | 7519 | } |
7520 | 7520 | |
7521 | 7521 | /** |
7522 | - * Gets all arrival airports of the airplanes that have flown over based on an airline icao |
|
7523 | - * |
|
7524 | - * @return Array the airport list |
|
7525 | - * |
|
7526 | - */ |
|
7522 | + * Gets all arrival airports of the airplanes that have flown over based on an airline icao |
|
7523 | + * |
|
7524 | + * @return Array the airport list |
|
7525 | + * |
|
7526 | + */ |
|
7527 | 7527 | public function countAllArrivalAirportsByAirline($airline_icao, $filters = array()) |
7528 | 7528 | { |
7529 | 7529 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7555,11 +7555,11 @@ discard block |
||
7555 | 7555 | |
7556 | 7556 | |
7557 | 7557 | /** |
7558 | - * Gets all arrival airports by country of the airplanes that have flown over based on an airline icao |
|
7559 | - * |
|
7560 | - * @return Array the airport list |
|
7561 | - * |
|
7562 | - */ |
|
7558 | + * Gets all arrival airports by country of the airplanes that have flown over based on an airline icao |
|
7559 | + * |
|
7560 | + * @return Array the airport list |
|
7561 | + * |
|
7562 | + */ |
|
7563 | 7563 | public function countAllArrivalAirportCountriesByAirline($airline_icao,$filters = array()) |
7564 | 7564 | { |
7565 | 7565 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7590,11 +7590,11 @@ discard block |
||
7590 | 7590 | |
7591 | 7591 | |
7592 | 7592 | /** |
7593 | - * Gets all arrival airports of the airplanes that have flown over based on an aircraft icao |
|
7594 | - * |
|
7595 | - * @return Array the airport list |
|
7596 | - * |
|
7597 | - */ |
|
7593 | + * Gets all arrival airports of the airplanes that have flown over based on an aircraft icao |
|
7594 | + * |
|
7595 | + * @return Array the airport list |
|
7596 | + * |
|
7597 | + */ |
|
7598 | 7598 | public function countAllArrivalAirportsByAircraft($aircraft_icao,$filters = array()) |
7599 | 7599 | { |
7600 | 7600 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7628,11 +7628,11 @@ discard block |
||
7628 | 7628 | |
7629 | 7629 | |
7630 | 7630 | /** |
7631 | - * Gets all arrival airports by country of the airplanes that have flown over based on an aircraft icao |
|
7632 | - * |
|
7633 | - * @return Array the airport list |
|
7634 | - * |
|
7635 | - */ |
|
7631 | + * Gets all arrival airports by country of the airplanes that have flown over based on an aircraft icao |
|
7632 | + * |
|
7633 | + * @return Array the airport list |
|
7634 | + * |
|
7635 | + */ |
|
7636 | 7636 | public function countAllArrivalAirportCountriesByAircraft($aircraft_icao,$filters = array()) |
7637 | 7637 | { |
7638 | 7638 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7662,11 +7662,11 @@ discard block |
||
7662 | 7662 | |
7663 | 7663 | |
7664 | 7664 | /** |
7665 | - * Gets all arrival airports of the airplanes that have flown over based on an aircraft registration |
|
7666 | - * |
|
7667 | - * @return Array the airport list |
|
7668 | - * |
|
7669 | - */ |
|
7665 | + * Gets all arrival airports of the airplanes that have flown over based on an aircraft registration |
|
7666 | + * |
|
7667 | + * @return Array the airport list |
|
7668 | + * |
|
7669 | + */ |
|
7670 | 7670 | public function countAllArrivalAirportsByRegistration($registration,$filters = array()) |
7671 | 7671 | { |
7672 | 7672 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7700,11 +7700,11 @@ discard block |
||
7700 | 7700 | |
7701 | 7701 | |
7702 | 7702 | /** |
7703 | - * Gets all arrival airports by country of the airplanes that have flown over based on an aircraft registration |
|
7704 | - * |
|
7705 | - * @return Array the airport list |
|
7706 | - * |
|
7707 | - */ |
|
7703 | + * Gets all arrival airports by country of the airplanes that have flown over based on an aircraft registration |
|
7704 | + * |
|
7705 | + * @return Array the airport list |
|
7706 | + * |
|
7707 | + */ |
|
7708 | 7708 | public function countAllArrivalAirportCountriesByRegistration($registration,$filters = array()) |
7709 | 7709 | { |
7710 | 7710 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7735,11 +7735,11 @@ discard block |
||
7735 | 7735 | |
7736 | 7736 | |
7737 | 7737 | /** |
7738 | - * Gets all arrival airports of the airplanes that have flown over based on an departure airport |
|
7739 | - * |
|
7740 | - * @return Array the airport list |
|
7741 | - * |
|
7742 | - */ |
|
7738 | + * Gets all arrival airports of the airplanes that have flown over based on an departure airport |
|
7739 | + * |
|
7740 | + * @return Array the airport list |
|
7741 | + * |
|
7742 | + */ |
|
7743 | 7743 | public function countAllArrivalAirportsByAirport($airport_icao,$filters = array()) |
7744 | 7744 | { |
7745 | 7745 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7772,11 +7772,11 @@ discard block |
||
7772 | 7772 | |
7773 | 7773 | |
7774 | 7774 | /** |
7775 | - * Gets all arrival airports by country of the airplanes that have flown over based on an airport icao |
|
7776 | - * |
|
7777 | - * @return Array the airport list |
|
7778 | - * |
|
7779 | - */ |
|
7775 | + * Gets all arrival airports by country of the airplanes that have flown over based on an airport icao |
|
7776 | + * |
|
7777 | + * @return Array the airport list |
|
7778 | + * |
|
7779 | + */ |
|
7780 | 7780 | public function countAllArrivalAirportCountriesByAirport($airport_icao,$filters = array()) |
7781 | 7781 | { |
7782 | 7782 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7806,11 +7806,11 @@ discard block |
||
7806 | 7806 | |
7807 | 7807 | |
7808 | 7808 | /** |
7809 | - * Gets all arrival airports of the airplanes that have flown over based on a aircraft manufacturer |
|
7810 | - * |
|
7811 | - * @return Array the airport list |
|
7812 | - * |
|
7813 | - */ |
|
7809 | + * Gets all arrival airports of the airplanes that have flown over based on a aircraft manufacturer |
|
7810 | + * |
|
7811 | + * @return Array the airport list |
|
7812 | + * |
|
7813 | + */ |
|
7814 | 7814 | public function countAllArrivalAirportsByManufacturer($aircraft_manufacturer,$filters = array()) |
7815 | 7815 | { |
7816 | 7816 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7844,11 +7844,11 @@ discard block |
||
7844 | 7844 | |
7845 | 7845 | |
7846 | 7846 | /** |
7847 | - * Gets all arrival airports by country of the airplanes that have flown over based on a aircraft manufacturer |
|
7848 | - * |
|
7849 | - * @return Array the airport list |
|
7850 | - * |
|
7851 | - */ |
|
7847 | + * Gets all arrival airports by country of the airplanes that have flown over based on a aircraft manufacturer |
|
7848 | + * |
|
7849 | + * @return Array the airport list |
|
7850 | + * |
|
7851 | + */ |
|
7852 | 7852 | public function countAllArrivalAirportCountriesByManufacturer($aircraft_manufacturer,$filters = array()) |
7853 | 7853 | { |
7854 | 7854 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7879,11 +7879,11 @@ discard block |
||
7879 | 7879 | |
7880 | 7880 | |
7881 | 7881 | /** |
7882 | - * Gets all arrival airports of the airplanes that have flown over based on a date |
|
7883 | - * |
|
7884 | - * @return Array the airport list |
|
7885 | - * |
|
7886 | - */ |
|
7882 | + * Gets all arrival airports of the airplanes that have flown over based on a date |
|
7883 | + * |
|
7884 | + * @return Array the airport list |
|
7885 | + * |
|
7886 | + */ |
|
7887 | 7887 | public function countAllArrivalAirportsByDate($date,$filters = array()) |
7888 | 7888 | { |
7889 | 7889 | global $globalTimezone, $globalDBdriver; |
@@ -7929,11 +7929,11 @@ discard block |
||
7929 | 7929 | |
7930 | 7930 | |
7931 | 7931 | /** |
7932 | - * Gets all arrival airports by country of the airplanes that have flown over based on a date |
|
7933 | - * |
|
7934 | - * @return Array the airport list |
|
7935 | - * |
|
7936 | - */ |
|
7932 | + * Gets all arrival airports by country of the airplanes that have flown over based on a date |
|
7933 | + * |
|
7934 | + * @return Array the airport list |
|
7935 | + * |
|
7936 | + */ |
|
7937 | 7937 | public function countAllArrivalAirportCountriesByDate($date, $filters = array()) |
7938 | 7938 | { |
7939 | 7939 | global $globalTimezone, $globalDBdriver; |
@@ -7976,11 +7976,11 @@ discard block |
||
7976 | 7976 | |
7977 | 7977 | |
7978 | 7978 | /** |
7979 | - * Gets all arrival airports of the airplanes that have flown over based on a ident/callsign |
|
7980 | - * |
|
7981 | - * @return Array the airport list |
|
7982 | - * |
|
7983 | - */ |
|
7979 | + * Gets all arrival airports of the airplanes that have flown over based on a ident/callsign |
|
7980 | + * |
|
7981 | + * @return Array the airport list |
|
7982 | + * |
|
7983 | + */ |
|
7984 | 7984 | public function countAllArrivalAirportsByIdent($ident,$filters = array()) |
7985 | 7985 | { |
7986 | 7986 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8012,11 +8012,11 @@ discard block |
||
8012 | 8012 | } |
8013 | 8013 | |
8014 | 8014 | /** |
8015 | - * Gets all arrival airports of the airplanes that have flown over based on a owner |
|
8016 | - * |
|
8017 | - * @return Array the airport list |
|
8018 | - * |
|
8019 | - */ |
|
8015 | + * Gets all arrival airports of the airplanes that have flown over based on a owner |
|
8016 | + * |
|
8017 | + * @return Array the airport list |
|
8018 | + * |
|
8019 | + */ |
|
8020 | 8020 | public function countAllArrivalAirportsByOwner($owner,$filters = array()) |
8021 | 8021 | { |
8022 | 8022 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8047,11 +8047,11 @@ discard block |
||
8047 | 8047 | } |
8048 | 8048 | |
8049 | 8049 | /** |
8050 | - * Gets all arrival airports of the airplanes that have flown over based on a pilot |
|
8051 | - * |
|
8052 | - * @return Array the airport list |
|
8053 | - * |
|
8054 | - */ |
|
8050 | + * Gets all arrival airports of the airplanes that have flown over based on a pilot |
|
8051 | + * |
|
8052 | + * @return Array the airport list |
|
8053 | + * |
|
8054 | + */ |
|
8055 | 8055 | public function countAllArrivalAirportsByPilot($pilot,$filters = array()) |
8056 | 8056 | { |
8057 | 8057 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8082,11 +8082,11 @@ discard block |
||
8082 | 8082 | } |
8083 | 8083 | |
8084 | 8084 | /** |
8085 | - * Gets all arrival airports by country of the airplanes that have flown over based on a callsign/ident |
|
8086 | - * |
|
8087 | - * @return Array the airport list |
|
8088 | - * |
|
8089 | - */ |
|
8085 | + * Gets all arrival airports by country of the airplanes that have flown over based on a callsign/ident |
|
8086 | + * |
|
8087 | + * @return Array the airport list |
|
8088 | + * |
|
8089 | + */ |
|
8090 | 8090 | public function countAllArrivalAirportCountriesByIdent($ident, $filters = array()) |
8091 | 8091 | { |
8092 | 8092 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8115,11 +8115,11 @@ discard block |
||
8115 | 8115 | } |
8116 | 8116 | |
8117 | 8117 | /** |
8118 | - * Gets all arrival airports by country of the airplanes that have flown over based on a owner |
|
8119 | - * |
|
8120 | - * @return Array the airport list |
|
8121 | - * |
|
8122 | - */ |
|
8118 | + * Gets all arrival airports by country of the airplanes that have flown over based on a owner |
|
8119 | + * |
|
8120 | + * @return Array the airport list |
|
8121 | + * |
|
8122 | + */ |
|
8123 | 8123 | public function countAllArrivalAirportCountriesByOwner($owner, $filters = array()) |
8124 | 8124 | { |
8125 | 8125 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8135,11 +8135,11 @@ discard block |
||
8135 | 8135 | } |
8136 | 8136 | |
8137 | 8137 | /** |
8138 | - * Gets all arrival airports by country of the airplanes that have flown over based on a pilot |
|
8139 | - * |
|
8140 | - * @return Array the airport list |
|
8141 | - * |
|
8142 | - */ |
|
8138 | + * Gets all arrival airports by country of the airplanes that have flown over based on a pilot |
|
8139 | + * |
|
8140 | + * @return Array the airport list |
|
8141 | + * |
|
8142 | + */ |
|
8143 | 8143 | public function countAllArrivalAirportCountriesByPilot($pilot, $filters = array()) |
8144 | 8144 | { |
8145 | 8145 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8157,11 +8157,11 @@ discard block |
||
8157 | 8157 | |
8158 | 8158 | |
8159 | 8159 | /** |
8160 | - * Gets all arrival airports of the airplanes that have flown over based on a country |
|
8161 | - * |
|
8162 | - * @return Array the airport list |
|
8163 | - * |
|
8164 | - */ |
|
8160 | + * Gets all arrival airports of the airplanes that have flown over based on a country |
|
8161 | + * |
|
8162 | + * @return Array the airport list |
|
8163 | + * |
|
8164 | + */ |
|
8165 | 8165 | public function countAllArrivalAirportsByCountry($country,$filters = array()) |
8166 | 8166 | { |
8167 | 8167 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8194,11 +8194,11 @@ discard block |
||
8194 | 8194 | |
8195 | 8195 | |
8196 | 8196 | /** |
8197 | - * Gets all arrival airports by country of the airplanes that have flown over based on a country |
|
8198 | - * |
|
8199 | - * @return Array the airport list |
|
8200 | - * |
|
8201 | - */ |
|
8197 | + * Gets all arrival airports by country of the airplanes that have flown over based on a country |
|
8198 | + * |
|
8199 | + * @return Array the airport list |
|
8200 | + * |
|
8201 | + */ |
|
8202 | 8202 | public function countAllArrivalAirportCountriesByCountry($country,$filters = array()) |
8203 | 8203 | { |
8204 | 8204 | global $globalDBdriver; |
@@ -8230,11 +8230,11 @@ discard block |
||
8230 | 8230 | |
8231 | 8231 | |
8232 | 8232 | /** |
8233 | - * Counts all airport departure countries |
|
8234 | - * |
|
8235 | - * @return Array the airport departure list |
|
8236 | - * |
|
8237 | - */ |
|
8233 | + * Counts all airport departure countries |
|
8234 | + * |
|
8235 | + * @return Array the airport departure list |
|
8236 | + * |
|
8237 | + */ |
|
8238 | 8238 | public function countAllDepartureCountries($filters = array(),$year = '',$month = '', $day = '') |
8239 | 8239 | { |
8240 | 8240 | global $globalDBdriver; |
@@ -8293,11 +8293,11 @@ discard block |
||
8293 | 8293 | |
8294 | 8294 | |
8295 | 8295 | /** |
8296 | - * Counts all airport arrival countries |
|
8297 | - * |
|
8298 | - * @return Array the airport arrival list |
|
8299 | - * |
|
8300 | - */ |
|
8296 | + * Counts all airport arrival countries |
|
8297 | + * |
|
8298 | + * @return Array the airport arrival list |
|
8299 | + * |
|
8300 | + */ |
|
8301 | 8301 | public function countAllArrivalCountries($limit = true,$filters = array(),$year = '',$month = '',$day = '') |
8302 | 8302 | { |
8303 | 8303 | global $globalDBdriver; |
@@ -8359,11 +8359,11 @@ discard block |
||
8359 | 8359 | |
8360 | 8360 | |
8361 | 8361 | /** |
8362 | - * Gets all route combinations |
|
8363 | - * |
|
8364 | - * @return Array the route list |
|
8365 | - * |
|
8366 | - */ |
|
8362 | + * Gets all route combinations |
|
8363 | + * |
|
8364 | + * @return Array the route list |
|
8365 | + * |
|
8366 | + */ |
|
8367 | 8367 | public function countAllRoutes($filters = array()) |
8368 | 8368 | { |
8369 | 8369 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8402,11 +8402,11 @@ discard block |
||
8402 | 8402 | |
8403 | 8403 | |
8404 | 8404 | /** |
8405 | - * Gets all route combinations based on an aircraft |
|
8406 | - * |
|
8407 | - * @return Array the route list |
|
8408 | - * |
|
8409 | - */ |
|
8405 | + * Gets all route combinations based on an aircraft |
|
8406 | + * |
|
8407 | + * @return Array the route list |
|
8408 | + * |
|
8409 | + */ |
|
8410 | 8410 | public function countAllRoutesByAircraft($aircraft_icao,$filters = array()) |
8411 | 8411 | { |
8412 | 8412 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8442,11 +8442,11 @@ discard block |
||
8442 | 8442 | |
8443 | 8443 | |
8444 | 8444 | /** |
8445 | - * Gets all route combinations based on an aircraft registration |
|
8446 | - * |
|
8447 | - * @return Array the route list |
|
8448 | - * |
|
8449 | - */ |
|
8445 | + * Gets all route combinations based on an aircraft registration |
|
8446 | + * |
|
8447 | + * @return Array the route list |
|
8448 | + * |
|
8449 | + */ |
|
8450 | 8450 | public function countAllRoutesByRegistration($registration, $filters = array()) |
8451 | 8451 | { |
8452 | 8452 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8484,11 +8484,11 @@ discard block |
||
8484 | 8484 | |
8485 | 8485 | |
8486 | 8486 | /** |
8487 | - * Gets all route combinations based on an airline |
|
8488 | - * |
|
8489 | - * @return Array the route list |
|
8490 | - * |
|
8491 | - */ |
|
8487 | + * Gets all route combinations based on an airline |
|
8488 | + * |
|
8489 | + * @return Array the route list |
|
8490 | + * |
|
8491 | + */ |
|
8492 | 8492 | public function countAllRoutesByAirline($airline_icao, $filters = array()) |
8493 | 8493 | { |
8494 | 8494 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8526,11 +8526,11 @@ discard block |
||
8526 | 8526 | |
8527 | 8527 | |
8528 | 8528 | /** |
8529 | - * Gets all route combinations based on an airport |
|
8530 | - * |
|
8531 | - * @return Array the route list |
|
8532 | - * |
|
8533 | - */ |
|
8529 | + * Gets all route combinations based on an airport |
|
8530 | + * |
|
8531 | + * @return Array the route list |
|
8532 | + * |
|
8533 | + */ |
|
8534 | 8534 | public function countAllRoutesByAirport($airport_icao, $filters = array()) |
8535 | 8535 | { |
8536 | 8536 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8567,11 +8567,11 @@ discard block |
||
8567 | 8567 | |
8568 | 8568 | |
8569 | 8569 | /** |
8570 | - * Gets all route combinations based on an country |
|
8571 | - * |
|
8572 | - * @return Array the route list |
|
8573 | - * |
|
8574 | - */ |
|
8570 | + * Gets all route combinations based on an country |
|
8571 | + * |
|
8572 | + * @return Array the route list |
|
8573 | + * |
|
8574 | + */ |
|
8575 | 8575 | public function countAllRoutesByCountry($country, $filters = array()) |
8576 | 8576 | { |
8577 | 8577 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8607,11 +8607,11 @@ discard block |
||
8607 | 8607 | |
8608 | 8608 | |
8609 | 8609 | /** |
8610 | - * Gets all route combinations based on an date |
|
8611 | - * |
|
8612 | - * @return Array the route list |
|
8613 | - * |
|
8614 | - */ |
|
8610 | + * Gets all route combinations based on an date |
|
8611 | + * |
|
8612 | + * @return Array the route list |
|
8613 | + * |
|
8614 | + */ |
|
8615 | 8615 | public function countAllRoutesByDate($date, $filters = array()) |
8616 | 8616 | { |
8617 | 8617 | global $globalTimezone, $globalDBdriver; |
@@ -8661,11 +8661,11 @@ discard block |
||
8661 | 8661 | |
8662 | 8662 | |
8663 | 8663 | /** |
8664 | - * Gets all route combinations based on an ident/callsign |
|
8665 | - * |
|
8666 | - * @return Array the route list |
|
8667 | - * |
|
8668 | - */ |
|
8664 | + * Gets all route combinations based on an ident/callsign |
|
8665 | + * |
|
8666 | + * @return Array the route list |
|
8667 | + * |
|
8668 | + */ |
|
8669 | 8669 | public function countAllRoutesByIdent($ident, $filters = array()) |
8670 | 8670 | { |
8671 | 8671 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8701,11 +8701,11 @@ discard block |
||
8701 | 8701 | } |
8702 | 8702 | |
8703 | 8703 | /** |
8704 | - * Gets all route combinations based on an owner |
|
8705 | - * |
|
8706 | - * @return Array the route list |
|
8707 | - * |
|
8708 | - */ |
|
8704 | + * Gets all route combinations based on an owner |
|
8705 | + * |
|
8706 | + * @return Array the route list |
|
8707 | + * |
|
8708 | + */ |
|
8709 | 8709 | public function countAllRoutesByOwner($owner,$filters = array()) |
8710 | 8710 | { |
8711 | 8711 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8741,11 +8741,11 @@ discard block |
||
8741 | 8741 | } |
8742 | 8742 | |
8743 | 8743 | /** |
8744 | - * Gets all route combinations based on a pilot |
|
8745 | - * |
|
8746 | - * @return Array the route list |
|
8747 | - * |
|
8748 | - */ |
|
8744 | + * Gets all route combinations based on a pilot |
|
8745 | + * |
|
8746 | + * @return Array the route list |
|
8747 | + * |
|
8748 | + */ |
|
8749 | 8749 | public function countAllRoutesByPilot($pilot,$filters = array()) |
8750 | 8750 | { |
8751 | 8751 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8782,11 +8782,11 @@ discard block |
||
8782 | 8782 | |
8783 | 8783 | |
8784 | 8784 | /** |
8785 | - * Gets all route combinations based on an manufacturer |
|
8786 | - * |
|
8787 | - * @return Array the route list |
|
8788 | - * |
|
8789 | - */ |
|
8785 | + * Gets all route combinations based on an manufacturer |
|
8786 | + * |
|
8787 | + * @return Array the route list |
|
8788 | + * |
|
8789 | + */ |
|
8790 | 8790 | public function countAllRoutesByManufacturer($aircraft_manufacturer, $filters = array()) |
8791 | 8791 | { |
8792 | 8792 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8824,11 +8824,11 @@ discard block |
||
8824 | 8824 | |
8825 | 8825 | |
8826 | 8826 | /** |
8827 | - * Gets all route combinations with waypoints |
|
8828 | - * |
|
8829 | - * @return Array the route list |
|
8830 | - * |
|
8831 | - */ |
|
8827 | + * Gets all route combinations with waypoints |
|
8828 | + * |
|
8829 | + * @return Array the route list |
|
8830 | + * |
|
8831 | + */ |
|
8832 | 8832 | public function countAllRoutesWithWaypoints($filters = array()) |
8833 | 8833 | { |
8834 | 8834 | $filter_query = $this->getFilter($filters,true,true); |
@@ -8865,11 +8865,11 @@ discard block |
||
8865 | 8865 | } |
8866 | 8866 | |
8867 | 8867 | /** |
8868 | - * Gets all callsigns that have flown over |
|
8869 | - * |
|
8870 | - * @return Array the callsign list |
|
8871 | - * |
|
8872 | - */ |
|
8868 | + * Gets all callsigns that have flown over |
|
8869 | + * |
|
8870 | + * @return Array the callsign list |
|
8871 | + * |
|
8872 | + */ |
|
8873 | 8873 | public function countAllCallsigns($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array(),$year = '', $month = '', $day = '') |
8874 | 8874 | { |
8875 | 8875 | global $globalDBdriver; |
@@ -8935,11 +8935,11 @@ discard block |
||
8935 | 8935 | } |
8936 | 8936 | |
8937 | 8937 | /** |
8938 | - * Gets all callsigns that have flown over |
|
8939 | - * |
|
8940 | - * @return Array the callsign list |
|
8941 | - * |
|
8942 | - */ |
|
8938 | + * Gets all callsigns that have flown over |
|
8939 | + * |
|
8940 | + * @return Array the callsign list |
|
8941 | + * |
|
8942 | + */ |
|
8943 | 8943 | public function countAllCallsignsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '', $filters = array()) |
8944 | 8944 | { |
8945 | 8945 | global $globalDBdriver; |
@@ -8980,11 +8980,11 @@ discard block |
||
8980 | 8980 | |
8981 | 8981 | |
8982 | 8982 | /** |
8983 | - * Counts all dates |
|
8984 | - * |
|
8985 | - * @return Array the date list |
|
8986 | - * |
|
8987 | - */ |
|
8983 | + * Counts all dates |
|
8984 | + * |
|
8985 | + * @return Array the date list |
|
8986 | + * |
|
8987 | + */ |
|
8988 | 8988 | public function countAllDates($filters = array()) |
8989 | 8989 | { |
8990 | 8990 | global $globalTimezone, $globalDBdriver; |
@@ -9029,11 +9029,11 @@ discard block |
||
9029 | 9029 | } |
9030 | 9030 | |
9031 | 9031 | /** |
9032 | - * Counts all dates |
|
9033 | - * |
|
9034 | - * @return Array the date list |
|
9035 | - * |
|
9036 | - */ |
|
9032 | + * Counts all dates |
|
9033 | + * |
|
9034 | + * @return Array the date list |
|
9035 | + * |
|
9036 | + */ |
|
9037 | 9037 | public function countAllDatesByAirlines($filters = array()) |
9038 | 9038 | { |
9039 | 9039 | global $globalTimezone, $globalDBdriver; |
@@ -9078,11 +9078,11 @@ discard block |
||
9078 | 9078 | } |
9079 | 9079 | |
9080 | 9080 | /** |
9081 | - * Counts all dates during the last 7 days |
|
9082 | - * |
|
9083 | - * @return Array the date list |
|
9084 | - * |
|
9085 | - */ |
|
9081 | + * Counts all dates during the last 7 days |
|
9082 | + * |
|
9083 | + * @return Array the date list |
|
9084 | + * |
|
9085 | + */ |
|
9086 | 9086 | public function countAllDatesLast7Days($filters = array()) |
9087 | 9087 | { |
9088 | 9088 | global $globalTimezone, $globalDBdriver; |
@@ -9104,7 +9104,7 @@ discard block |
||
9104 | 9104 | $query .= " GROUP BY date_name |
9105 | 9105 | ORDER BY date_name ASC"; |
9106 | 9106 | $query_data = array(':offset' => $offset); |
9107 | - } |
|
9107 | + } |
|
9108 | 9108 | |
9109 | 9109 | $sth = $this->db->prepare($query); |
9110 | 9110 | $sth->execute($query_data); |
@@ -9124,11 +9124,11 @@ discard block |
||
9124 | 9124 | } |
9125 | 9125 | |
9126 | 9126 | /** |
9127 | - * Counts all dates during the last month |
|
9128 | - * |
|
9129 | - * @return Array the date list |
|
9130 | - * |
|
9131 | - */ |
|
9127 | + * Counts all dates during the last month |
|
9128 | + * |
|
9129 | + * @return Array the date list |
|
9130 | + * |
|
9131 | + */ |
|
9132 | 9132 | public function countAllDatesLastMonth($filters = array()) |
9133 | 9133 | { |
9134 | 9134 | global $globalTimezone, $globalDBdriver; |
@@ -9150,7 +9150,7 @@ discard block |
||
9150 | 9150 | $query .= " GROUP BY date_name |
9151 | 9151 | ORDER BY date_name ASC"; |
9152 | 9152 | $query_data = array(':offset' => $offset); |
9153 | - } |
|
9153 | + } |
|
9154 | 9154 | |
9155 | 9155 | $sth = $this->db->prepare($query); |
9156 | 9156 | $sth->execute($query_data); |
@@ -9171,11 +9171,11 @@ discard block |
||
9171 | 9171 | |
9172 | 9172 | |
9173 | 9173 | /** |
9174 | - * Counts all dates during the last month |
|
9175 | - * |
|
9176 | - * @return Array the date list |
|
9177 | - * |
|
9178 | - */ |
|
9174 | + * Counts all dates during the last month |
|
9175 | + * |
|
9176 | + * @return Array the date list |
|
9177 | + * |
|
9178 | + */ |
|
9179 | 9179 | public function countAllDatesLastMonthByAirlines($filters = array()) |
9180 | 9180 | { |
9181 | 9181 | global $globalTimezone, $globalDBdriver; |
@@ -9198,7 +9198,7 @@ discard block |
||
9198 | 9198 | GROUP BY spotter_output.airline_icao, date_name |
9199 | 9199 | ORDER BY date_name ASC"; |
9200 | 9200 | $query_data = array(':offset' => $offset); |
9201 | - } |
|
9201 | + } |
|
9202 | 9202 | |
9203 | 9203 | $sth = $this->db->prepare($query); |
9204 | 9204 | $sth->execute($query_data); |
@@ -9220,11 +9220,11 @@ discard block |
||
9220 | 9220 | |
9221 | 9221 | |
9222 | 9222 | /** |
9223 | - * Counts all month |
|
9224 | - * |
|
9225 | - * @return Array the month list |
|
9226 | - * |
|
9227 | - */ |
|
9223 | + * Counts all month |
|
9224 | + * |
|
9225 | + * @return Array the month list |
|
9226 | + * |
|
9227 | + */ |
|
9228 | 9228 | public function countAllMonths($filters = array()) |
9229 | 9229 | { |
9230 | 9230 | global $globalTimezone, $globalDBdriver; |
@@ -9266,11 +9266,11 @@ discard block |
||
9266 | 9266 | } |
9267 | 9267 | |
9268 | 9268 | /** |
9269 | - * Counts all month |
|
9270 | - * |
|
9271 | - * @return Array the month list |
|
9272 | - * |
|
9273 | - */ |
|
9269 | + * Counts all month |
|
9270 | + * |
|
9271 | + * @return Array the month list |
|
9272 | + * |
|
9273 | + */ |
|
9274 | 9274 | public function countAllMonthsByAirlines($filters = array()) |
9275 | 9275 | { |
9276 | 9276 | global $globalTimezone, $globalDBdriver; |
@@ -9315,11 +9315,11 @@ discard block |
||
9315 | 9315 | } |
9316 | 9316 | |
9317 | 9317 | /** |
9318 | - * Counts all military month |
|
9319 | - * |
|
9320 | - * @return Array the month list |
|
9321 | - * |
|
9322 | - */ |
|
9318 | + * Counts all military month |
|
9319 | + * |
|
9320 | + * @return Array the month list |
|
9321 | + * |
|
9322 | + */ |
|
9323 | 9323 | public function countAllMilitaryMonths($filters = array()) |
9324 | 9324 | { |
9325 | 9325 | global $globalTimezone, $globalDBdriver; |
@@ -9360,11 +9360,11 @@ discard block |
||
9360 | 9360 | } |
9361 | 9361 | |
9362 | 9362 | /** |
9363 | - * Counts all month owners |
|
9364 | - * |
|
9365 | - * @return Array the month list |
|
9366 | - * |
|
9367 | - */ |
|
9363 | + * Counts all month owners |
|
9364 | + * |
|
9365 | + * @return Array the month list |
|
9366 | + * |
|
9367 | + */ |
|
9368 | 9368 | public function countAllMonthsOwners($filters = array()) |
9369 | 9369 | { |
9370 | 9370 | global $globalTimezone, $globalDBdriver; |
@@ -9406,11 +9406,11 @@ discard block |
||
9406 | 9406 | } |
9407 | 9407 | |
9408 | 9408 | /** |
9409 | - * Counts all month owners |
|
9410 | - * |
|
9411 | - * @return Array the month list |
|
9412 | - * |
|
9413 | - */ |
|
9409 | + * Counts all month owners |
|
9410 | + * |
|
9411 | + * @return Array the month list |
|
9412 | + * |
|
9413 | + */ |
|
9414 | 9414 | public function countAllMonthsOwnersByAirlines($filters = array()) |
9415 | 9415 | { |
9416 | 9416 | global $globalTimezone, $globalDBdriver; |
@@ -9453,11 +9453,11 @@ discard block |
||
9453 | 9453 | } |
9454 | 9454 | |
9455 | 9455 | /** |
9456 | - * Counts all month pilot |
|
9457 | - * |
|
9458 | - * @return Array the month list |
|
9459 | - * |
|
9460 | - */ |
|
9456 | + * Counts all month pilot |
|
9457 | + * |
|
9458 | + * @return Array the month list |
|
9459 | + * |
|
9460 | + */ |
|
9461 | 9461 | public function countAllMonthsPilots($filters = array()) |
9462 | 9462 | { |
9463 | 9463 | global $globalTimezone, $globalDBdriver; |
@@ -9499,11 +9499,11 @@ discard block |
||
9499 | 9499 | } |
9500 | 9500 | |
9501 | 9501 | /** |
9502 | - * Counts all month pilot |
|
9503 | - * |
|
9504 | - * @return Array the month list |
|
9505 | - * |
|
9506 | - */ |
|
9502 | + * Counts all month pilot |
|
9503 | + * |
|
9504 | + * @return Array the month list |
|
9505 | + * |
|
9506 | + */ |
|
9507 | 9507 | public function countAllMonthsPilotsByAirlines($filters = array()) |
9508 | 9508 | { |
9509 | 9509 | global $globalTimezone, $globalDBdriver; |
@@ -9546,11 +9546,11 @@ discard block |
||
9546 | 9546 | } |
9547 | 9547 | |
9548 | 9548 | /** |
9549 | - * Counts all month airline |
|
9550 | - * |
|
9551 | - * @return Array the month list |
|
9552 | - * |
|
9553 | - */ |
|
9549 | + * Counts all month airline |
|
9550 | + * |
|
9551 | + * @return Array the month list |
|
9552 | + * |
|
9553 | + */ |
|
9554 | 9554 | public function countAllMonthsAirlines($filters = array()) |
9555 | 9555 | { |
9556 | 9556 | global $globalTimezone, $globalDBdriver; |
@@ -9592,11 +9592,11 @@ discard block |
||
9592 | 9592 | } |
9593 | 9593 | |
9594 | 9594 | /** |
9595 | - * Counts all month aircraft |
|
9596 | - * |
|
9597 | - * @return Array the month list |
|
9598 | - * |
|
9599 | - */ |
|
9595 | + * Counts all month aircraft |
|
9596 | + * |
|
9597 | + * @return Array the month list |
|
9598 | + * |
|
9599 | + */ |
|
9600 | 9600 | public function countAllMonthsAircrafts($filters = array()) |
9601 | 9601 | { |
9602 | 9602 | global $globalTimezone, $globalDBdriver; |
@@ -9639,11 +9639,11 @@ discard block |
||
9639 | 9639 | |
9640 | 9640 | |
9641 | 9641 | /** |
9642 | - * Counts all month aircraft |
|
9643 | - * |
|
9644 | - * @return Array the month list |
|
9645 | - * |
|
9646 | - */ |
|
9642 | + * Counts all month aircraft |
|
9643 | + * |
|
9644 | + * @return Array the month list |
|
9645 | + * |
|
9646 | + */ |
|
9647 | 9647 | public function countAllMonthsAircraftsByAirlines($filters = array()) |
9648 | 9648 | { |
9649 | 9649 | global $globalTimezone, $globalDBdriver; |
@@ -9686,11 +9686,11 @@ discard block |
||
9686 | 9686 | } |
9687 | 9687 | |
9688 | 9688 | /** |
9689 | - * Counts all month real arrival |
|
9690 | - * |
|
9691 | - * @return Array the month list |
|
9692 | - * |
|
9693 | - */ |
|
9689 | + * Counts all month real arrival |
|
9690 | + * |
|
9691 | + * @return Array the month list |
|
9692 | + * |
|
9693 | + */ |
|
9694 | 9694 | public function countAllMonthsRealArrivals($filters = array()) |
9695 | 9695 | { |
9696 | 9696 | global $globalTimezone, $globalDBdriver; |
@@ -9733,11 +9733,11 @@ discard block |
||
9733 | 9733 | |
9734 | 9734 | |
9735 | 9735 | /** |
9736 | - * Counts all month real arrival |
|
9737 | - * |
|
9738 | - * @return Array the month list |
|
9739 | - * |
|
9740 | - */ |
|
9736 | + * Counts all month real arrival |
|
9737 | + * |
|
9738 | + * @return Array the month list |
|
9739 | + * |
|
9740 | + */ |
|
9741 | 9741 | public function countAllMonthsRealArrivalsByAirlines($filters = array()) |
9742 | 9742 | { |
9743 | 9743 | global $globalTimezone, $globalDBdriver; |
@@ -9781,11 +9781,11 @@ discard block |
||
9781 | 9781 | |
9782 | 9782 | |
9783 | 9783 | /** |
9784 | - * Counts all dates during the last year |
|
9785 | - * |
|
9786 | - * @return Array the date list |
|
9787 | - * |
|
9788 | - */ |
|
9784 | + * Counts all dates during the last year |
|
9785 | + * |
|
9786 | + * @return Array the date list |
|
9787 | + * |
|
9788 | + */ |
|
9789 | 9789 | public function countAllMonthsLastYear($filters) |
9790 | 9790 | { |
9791 | 9791 | global $globalTimezone, $globalDBdriver; |
@@ -9807,7 +9807,7 @@ discard block |
||
9807 | 9807 | $query .= " GROUP BY year_name, month_name |
9808 | 9808 | ORDER BY year_name, month_name ASC"; |
9809 | 9809 | $query_data = array(':offset' => $offset); |
9810 | - } |
|
9810 | + } |
|
9811 | 9811 | |
9812 | 9812 | $sth = $this->db->prepare($query); |
9813 | 9813 | $sth->execute($query_data); |
@@ -9830,11 +9830,11 @@ discard block |
||
9830 | 9830 | |
9831 | 9831 | |
9832 | 9832 | /** |
9833 | - * Counts all hours |
|
9834 | - * |
|
9835 | - * @return Array the hour list |
|
9836 | - * |
|
9837 | - */ |
|
9833 | + * Counts all hours |
|
9834 | + * |
|
9835 | + * @return Array the hour list |
|
9836 | + * |
|
9837 | + */ |
|
9838 | 9838 | public function countAllHours($orderby,$filters = array()) |
9839 | 9839 | { |
9840 | 9840 | global $globalTimezone, $globalDBdriver; |
@@ -9895,11 +9895,11 @@ discard block |
||
9895 | 9895 | } |
9896 | 9896 | |
9897 | 9897 | /** |
9898 | - * Counts all hours |
|
9899 | - * |
|
9900 | - * @return Array the hour list |
|
9901 | - * |
|
9902 | - */ |
|
9898 | + * Counts all hours |
|
9899 | + * |
|
9900 | + * @return Array the hour list |
|
9901 | + * |
|
9902 | + */ |
|
9903 | 9903 | public function countAllHoursByAirlines($orderby, $filters = array()) |
9904 | 9904 | { |
9905 | 9905 | global $globalTimezone, $globalDBdriver; |
@@ -9962,11 +9962,11 @@ discard block |
||
9962 | 9962 | |
9963 | 9963 | |
9964 | 9964 | /** |
9965 | - * Counts all hours by airline |
|
9966 | - * |
|
9967 | - * @return Array the hour list |
|
9968 | - * |
|
9969 | - */ |
|
9965 | + * Counts all hours by airline |
|
9966 | + * |
|
9967 | + * @return Array the hour list |
|
9968 | + * |
|
9969 | + */ |
|
9970 | 9970 | public function countAllHoursByAirline($airline_icao, $filters = array()) |
9971 | 9971 | { |
9972 | 9972 | global $globalTimezone, $globalDBdriver; |
@@ -10012,11 +10012,11 @@ discard block |
||
10012 | 10012 | |
10013 | 10013 | |
10014 | 10014 | /** |
10015 | - * Counts all hours by aircraft |
|
10016 | - * |
|
10017 | - * @return Array the hour list |
|
10018 | - * |
|
10019 | - */ |
|
10015 | + * Counts all hours by aircraft |
|
10016 | + * |
|
10017 | + * @return Array the hour list |
|
10018 | + * |
|
10019 | + */ |
|
10020 | 10020 | public function countAllHoursByAircraft($aircraft_icao, $filters = array()) |
10021 | 10021 | { |
10022 | 10022 | global $globalTimezone, $globalDBdriver; |
@@ -10059,11 +10059,11 @@ discard block |
||
10059 | 10059 | |
10060 | 10060 | |
10061 | 10061 | /** |
10062 | - * Counts all hours by aircraft registration |
|
10063 | - * |
|
10064 | - * @return Array the hour list |
|
10065 | - * |
|
10066 | - */ |
|
10062 | + * Counts all hours by aircraft registration |
|
10063 | + * |
|
10064 | + * @return Array the hour list |
|
10065 | + * |
|
10066 | + */ |
|
10067 | 10067 | public function countAllHoursByRegistration($registration, $filters = array()) |
10068 | 10068 | { |
10069 | 10069 | global $globalTimezone, $globalDBdriver; |
@@ -10106,11 +10106,11 @@ discard block |
||
10106 | 10106 | |
10107 | 10107 | |
10108 | 10108 | /** |
10109 | - * Counts all hours by airport |
|
10110 | - * |
|
10111 | - * @return Array the hour list |
|
10112 | - * |
|
10113 | - */ |
|
10109 | + * Counts all hours by airport |
|
10110 | + * |
|
10111 | + * @return Array the hour list |
|
10112 | + * |
|
10113 | + */ |
|
10114 | 10114 | public function countAllHoursByAirport($airport_icao, $filters = array()) |
10115 | 10115 | { |
10116 | 10116 | global $globalTimezone, $globalDBdriver; |
@@ -10154,11 +10154,11 @@ discard block |
||
10154 | 10154 | |
10155 | 10155 | |
10156 | 10156 | /** |
10157 | - * Counts all hours by manufacturer |
|
10158 | - * |
|
10159 | - * @return Array the hour list |
|
10160 | - * |
|
10161 | - */ |
|
10157 | + * Counts all hours by manufacturer |
|
10158 | + * |
|
10159 | + * @return Array the hour list |
|
10160 | + * |
|
10161 | + */ |
|
10162 | 10162 | public function countAllHoursByManufacturer($aircraft_manufacturer,$filters =array()) |
10163 | 10163 | { |
10164 | 10164 | global $globalTimezone, $globalDBdriver; |
@@ -10202,11 +10202,11 @@ discard block |
||
10202 | 10202 | |
10203 | 10203 | |
10204 | 10204 | /** |
10205 | - * Counts all hours by date |
|
10206 | - * |
|
10207 | - * @return Array the hour list |
|
10208 | - * |
|
10209 | - */ |
|
10205 | + * Counts all hours by date |
|
10206 | + * |
|
10207 | + * @return Array the hour list |
|
10208 | + * |
|
10209 | + */ |
|
10210 | 10210 | public function countAllHoursByDate($date, $filters = array()) |
10211 | 10211 | { |
10212 | 10212 | global $globalTimezone, $globalDBdriver; |
@@ -10250,11 +10250,11 @@ discard block |
||
10250 | 10250 | |
10251 | 10251 | |
10252 | 10252 | /** |
10253 | - * Counts all hours by a ident/callsign |
|
10254 | - * |
|
10255 | - * @return Array the hour list |
|
10256 | - * |
|
10257 | - */ |
|
10253 | + * Counts all hours by a ident/callsign |
|
10254 | + * |
|
10255 | + * @return Array the hour list |
|
10256 | + * |
|
10257 | + */ |
|
10258 | 10258 | public function countAllHoursByIdent($ident, $filters = array()) |
10259 | 10259 | { |
10260 | 10260 | global $globalTimezone, $globalDBdriver; |
@@ -10297,11 +10297,11 @@ discard block |
||
10297 | 10297 | } |
10298 | 10298 | |
10299 | 10299 | /** |
10300 | - * Counts all hours by a owner |
|
10301 | - * |
|
10302 | - * @return Array the hour list |
|
10303 | - * |
|
10304 | - */ |
|
10300 | + * Counts all hours by a owner |
|
10301 | + * |
|
10302 | + * @return Array the hour list |
|
10303 | + * |
|
10304 | + */ |
|
10305 | 10305 | public function countAllHoursByOwner($owner, $filters = array()) |
10306 | 10306 | { |
10307 | 10307 | global $globalTimezone, $globalDBdriver; |
@@ -10344,11 +10344,11 @@ discard block |
||
10344 | 10344 | } |
10345 | 10345 | |
10346 | 10346 | /** |
10347 | - * Counts all hours by a pilot |
|
10348 | - * |
|
10349 | - * @return Array the hour list |
|
10350 | - * |
|
10351 | - */ |
|
10347 | + * Counts all hours by a pilot |
|
10348 | + * |
|
10349 | + * @return Array the hour list |
|
10350 | + * |
|
10351 | + */ |
|
10352 | 10352 | public function countAllHoursByPilot($pilot, $filters = array()) |
10353 | 10353 | { |
10354 | 10354 | global $globalTimezone, $globalDBdriver; |
@@ -10393,11 +10393,11 @@ discard block |
||
10393 | 10393 | |
10394 | 10394 | |
10395 | 10395 | /** |
10396 | - * Counts all hours by route |
|
10397 | - * |
|
10398 | - * @return Array the hour list |
|
10399 | - * |
|
10400 | - */ |
|
10396 | + * Counts all hours by route |
|
10397 | + * |
|
10398 | + * @return Array the hour list |
|
10399 | + * |
|
10400 | + */ |
|
10401 | 10401 | public function countAllHoursByRoute($departure_airport_icao, $arrival_airport_icao, $filters =array()) |
10402 | 10402 | { |
10403 | 10403 | global $globalTimezone, $globalDBdriver; |
@@ -10441,11 +10441,11 @@ discard block |
||
10441 | 10441 | |
10442 | 10442 | |
10443 | 10443 | /** |
10444 | - * Counts all hours by country |
|
10445 | - * |
|
10446 | - * @return Array the hour list |
|
10447 | - * |
|
10448 | - */ |
|
10444 | + * Counts all hours by country |
|
10445 | + * |
|
10446 | + * @return Array the hour list |
|
10447 | + * |
|
10448 | + */ |
|
10449 | 10449 | public function countAllHoursByCountry($country, $filters = array()) |
10450 | 10450 | { |
10451 | 10451 | global $globalTimezone, $globalDBdriver; |
@@ -10490,11 +10490,11 @@ discard block |
||
10490 | 10490 | |
10491 | 10491 | |
10492 | 10492 | /** |
10493 | - * Counts all aircraft that have flown over |
|
10494 | - * |
|
10495 | - * @return Integer the number of aircrafts |
|
10496 | - * |
|
10497 | - */ |
|
10493 | + * Counts all aircraft that have flown over |
|
10494 | + * |
|
10495 | + * @return Integer the number of aircrafts |
|
10496 | + * |
|
10497 | + */ |
|
10498 | 10498 | public function countOverallAircrafts($filters = array(),$year = '',$month = '') |
10499 | 10499 | { |
10500 | 10500 | global $globalDBdriver; |
@@ -10527,11 +10527,11 @@ discard block |
||
10527 | 10527 | } |
10528 | 10528 | |
10529 | 10529 | /** |
10530 | - * Counts all flight that really arrival |
|
10531 | - * |
|
10532 | - * @return Integer the number of aircrafts |
|
10533 | - * |
|
10534 | - */ |
|
10530 | + * Counts all flight that really arrival |
|
10531 | + * |
|
10532 | + * @return Integer the number of aircrafts |
|
10533 | + * |
|
10534 | + */ |
|
10535 | 10535 | public function countOverallArrival($filters = array(),$year = '',$month = '') |
10536 | 10536 | { |
10537 | 10537 | global $globalDBdriver; |
@@ -10564,11 +10564,11 @@ discard block |
||
10564 | 10564 | } |
10565 | 10565 | |
10566 | 10566 | /** |
10567 | - * Counts all pilots that have flown over |
|
10568 | - * |
|
10569 | - * @return Integer the number of pilots |
|
10570 | - * |
|
10571 | - */ |
|
10567 | + * Counts all pilots that have flown over |
|
10568 | + * |
|
10569 | + * @return Integer the number of pilots |
|
10570 | + * |
|
10571 | + */ |
|
10572 | 10572 | public function countOverallPilots($filters = array(),$year = '',$month = '') |
10573 | 10573 | { |
10574 | 10574 | global $globalDBdriver; |
@@ -10600,11 +10600,11 @@ discard block |
||
10600 | 10600 | } |
10601 | 10601 | |
10602 | 10602 | /** |
10603 | - * Counts all owners that have flown over |
|
10604 | - * |
|
10605 | - * @return Integer the number of owners |
|
10606 | - * |
|
10607 | - */ |
|
10603 | + * Counts all owners that have flown over |
|
10604 | + * |
|
10605 | + * @return Integer the number of owners |
|
10606 | + * |
|
10607 | + */ |
|
10608 | 10608 | public function countOverallOwners($filters = array(),$year = '',$month = '') |
10609 | 10609 | { |
10610 | 10610 | global $globalDBdriver; |
@@ -10637,11 +10637,11 @@ discard block |
||
10637 | 10637 | |
10638 | 10638 | |
10639 | 10639 | /** |
10640 | - * Counts all flights that have flown over |
|
10641 | - * |
|
10642 | - * @return Integer the number of flights |
|
10643 | - * |
|
10644 | - */ |
|
10640 | + * Counts all flights that have flown over |
|
10641 | + * |
|
10642 | + * @return Integer the number of flights |
|
10643 | + * |
|
10644 | + */ |
|
10645 | 10645 | public function countOverallFlights($filters = array(),$year = '',$month = '') |
10646 | 10646 | { |
10647 | 10647 | global $globalDBdriver; |
@@ -10676,11 +10676,11 @@ discard block |
||
10676 | 10676 | } |
10677 | 10677 | |
10678 | 10678 | /** |
10679 | - * Counts all military flights that have flown over |
|
10680 | - * |
|
10681 | - * @return Integer the number of flights |
|
10682 | - * |
|
10683 | - */ |
|
10679 | + * Counts all military flights that have flown over |
|
10680 | + * |
|
10681 | + * @return Integer the number of flights |
|
10682 | + * |
|
10683 | + */ |
|
10684 | 10684 | public function countOverallMilitaryFlights($filters = array(),$year = '',$month = '') |
10685 | 10685 | { |
10686 | 10686 | global $globalDBdriver; |
@@ -10715,11 +10715,11 @@ discard block |
||
10715 | 10715 | |
10716 | 10716 | |
10717 | 10717 | /** |
10718 | - * Counts all airlines that have flown over |
|
10719 | - * |
|
10720 | - * @return Integer the number of airlines |
|
10721 | - * |
|
10722 | - */ |
|
10718 | + * Counts all airlines that have flown over |
|
10719 | + * |
|
10720 | + * @return Integer the number of airlines |
|
10721 | + * |
|
10722 | + */ |
|
10723 | 10723 | public function countOverallAirlines($filters = array(),$year = '',$month = '') |
10724 | 10724 | { |
10725 | 10725 | global $globalDBdriver; |
@@ -10746,8 +10746,8 @@ discard block |
||
10746 | 10746 | $query_values = array_merge($query_values,array(':month' => $month)); |
10747 | 10747 | } |
10748 | 10748 | } |
10749 | - if ($query == '') $queryi .= $this->getFilter($filters); |
|
10750 | - else $queryi .= $this->getFilter($filters,true,true).substr($query,4); |
|
10749 | + if ($query == '') $queryi .= $this->getFilter($filters); |
|
10750 | + else $queryi .= $this->getFilter($filters,true,true).substr($query,4); |
|
10751 | 10751 | |
10752 | 10752 | |
10753 | 10753 | $sth = $this->db->prepare($queryi); |
@@ -10757,11 +10757,11 @@ discard block |
||
10757 | 10757 | |
10758 | 10758 | |
10759 | 10759 | /** |
10760 | - * Counts all hours of today |
|
10761 | - * |
|
10762 | - * @return Array the hour list |
|
10763 | - * |
|
10764 | - */ |
|
10760 | + * Counts all hours of today |
|
10761 | + * |
|
10762 | + * @return Array the hour list |
|
10763 | + * |
|
10764 | + */ |
|
10765 | 10765 | public function countAllHoursFromToday($filters = array()) |
10766 | 10766 | { |
10767 | 10767 | global $globalTimezone, $globalDBdriver; |
@@ -10801,11 +10801,11 @@ discard block |
||
10801 | 10801 | } |
10802 | 10802 | |
10803 | 10803 | /** |
10804 | - * Gets all the spotter information based on calculated upcoming flights |
|
10805 | - * |
|
10806 | - * @return Array the spotter information |
|
10807 | - * |
|
10808 | - */ |
|
10804 | + * Gets all the spotter information based on calculated upcoming flights |
|
10805 | + * |
|
10806 | + * @return Array the spotter information |
|
10807 | + * |
|
10808 | + */ |
|
10809 | 10809 | public function getUpcomingFlights($limit = '', $sort = '', $filters = array()) |
10810 | 10810 | { |
10811 | 10811 | global $global_query, $globalDBdriver, $globalTimezone; |
@@ -10880,12 +10880,12 @@ discard block |
||
10880 | 10880 | } |
10881 | 10881 | |
10882 | 10882 | |
10883 | - /** |
|
10884 | - * Gets the Barrie Spotter ID based on the FlightAware ID |
|
10885 | - * |
|
10886 | - * @return Integer the Barrie Spotter ID |
|
10883 | + /** |
|
10884 | + * Gets the Barrie Spotter ID based on the FlightAware ID |
|
10885 | + * |
|
10886 | + * @return Integer the Barrie Spotter ID |
|
10887 | 10887 | q * |
10888 | - */ |
|
10888 | + */ |
|
10889 | 10889 | public function getSpotterIDBasedOnFlightAwareID($flightaware_id) |
10890 | 10890 | { |
10891 | 10891 | $flightaware_id = filter_var($flightaware_id,FILTER_SANITIZE_STRING); |
@@ -10906,13 +10906,13 @@ discard block |
||
10906 | 10906 | |
10907 | 10907 | |
10908 | 10908 | /** |
10909 | - * Parses a date string |
|
10910 | - * |
|
10911 | - * @param String $dateString the date string |
|
10912 | - * @param String $timezone the timezone of a user |
|
10913 | - * @return Array the time information |
|
10914 | - * |
|
10915 | - */ |
|
10909 | + * Parses a date string |
|
10910 | + * |
|
10911 | + * @param String $dateString the date string |
|
10912 | + * @param String $timezone the timezone of a user |
|
10913 | + * @return Array the time information |
|
10914 | + * |
|
10915 | + */ |
|
10916 | 10916 | public function parseDateString($dateString, $timezone = '') |
10917 | 10917 | { |
10918 | 10918 | $time_array = array(); |
@@ -10948,12 +10948,12 @@ discard block |
||
10948 | 10948 | |
10949 | 10949 | |
10950 | 10950 | /** |
10951 | - * Parses the direction degrees to working |
|
10952 | - * |
|
10953 | - * @param Float $direction the direction in degrees |
|
10954 | - * @return Array the direction information |
|
10955 | - * |
|
10956 | - */ |
|
10951 | + * Parses the direction degrees to working |
|
10952 | + * |
|
10953 | + * @param Float $direction the direction in degrees |
|
10954 | + * @return Array the direction information |
|
10955 | + * |
|
10956 | + */ |
|
10957 | 10957 | public function parseDirection($direction = 0) |
10958 | 10958 | { |
10959 | 10959 | if ($direction == '') $direction = 0; |
@@ -11032,12 +11032,12 @@ discard block |
||
11032 | 11032 | |
11033 | 11033 | |
11034 | 11034 | /** |
11035 | - * Gets the aircraft registration |
|
11036 | - * |
|
11037 | - * @param String $flightaware_id the flight aware id |
|
11038 | - * @return String the aircraft registration |
|
11039 | - * |
|
11040 | - */ |
|
11035 | + * Gets the aircraft registration |
|
11036 | + * |
|
11037 | + * @param String $flightaware_id the flight aware id |
|
11038 | + * @return String the aircraft registration |
|
11039 | + * |
|
11040 | + */ |
|
11041 | 11041 | |
11042 | 11042 | public function getAircraftRegistration($flightaware_id) |
11043 | 11043 | { |
@@ -11066,12 +11066,12 @@ discard block |
||
11066 | 11066 | |
11067 | 11067 | |
11068 | 11068 | /** |
11069 | - * Gets the aircraft registration from ModeS |
|
11070 | - * |
|
11071 | - * @param String $aircraft_modes the flight ModeS in hex |
|
11072 | - * @return String the aircraft registration |
|
11073 | - * |
|
11074 | - */ |
|
11069 | + * Gets the aircraft registration from ModeS |
|
11070 | + * |
|
11071 | + * @param String $aircraft_modes the flight ModeS in hex |
|
11072 | + * @return String the aircraft registration |
|
11073 | + * |
|
11074 | + */ |
|
11075 | 11075 | public function getAircraftRegistrationBymodeS($aircraft_modes) |
11076 | 11076 | { |
11077 | 11077 | $aircraft_modes = filter_var($aircraft_modes,FILTER_SANITIZE_STRING); |
@@ -11084,19 +11084,19 @@ discard block |
||
11084 | 11084 | $row = $sth->fetch(PDO::FETCH_ASSOC); |
11085 | 11085 | $sth->closeCursor(); |
11086 | 11086 | if (count($row) > 0) { |
11087 | - //return $row['Registration']; |
|
11088 | - return $row['registration']; |
|
11087 | + //return $row['Registration']; |
|
11088 | + return $row['registration']; |
|
11089 | 11089 | } else return ''; |
11090 | 11090 | |
11091 | 11091 | } |
11092 | 11092 | |
11093 | 11093 | /** |
11094 | - * Gets the aircraft type from ModeS |
|
11095 | - * |
|
11096 | - * @param String $aircraft_modes the flight ModeS in hex |
|
11097 | - * @return String the aircraft type |
|
11098 | - * |
|
11099 | - */ |
|
11094 | + * Gets the aircraft type from ModeS |
|
11095 | + * |
|
11096 | + * @param String $aircraft_modes the flight ModeS in hex |
|
11097 | + * @return String the aircraft type |
|
11098 | + * |
|
11099 | + */ |
|
11100 | 11100 | public function getAircraftTypeBymodeS($aircraft_modes) |
11101 | 11101 | { |
11102 | 11102 | $aircraft_modes = filter_var($aircraft_modes,FILTER_SANITIZE_STRING); |
@@ -11109,19 +11109,19 @@ discard block |
||
11109 | 11109 | $row = $sth->fetch(PDO::FETCH_ASSOC); |
11110 | 11110 | $sth->closeCursor(); |
11111 | 11111 | if (count($row) > 0) { |
11112 | - if ($row['type_flight'] == null) return ''; |
|
11113 | - else return $row['type_flight']; |
|
11112 | + if ($row['type_flight'] == null) return ''; |
|
11113 | + else return $row['type_flight']; |
|
11114 | 11114 | } else return ''; |
11115 | 11115 | |
11116 | 11116 | } |
11117 | 11117 | |
11118 | 11118 | /** |
11119 | - * Gets Country from latitude/longitude |
|
11120 | - * |
|
11121 | - * @param Float $latitude latitute of the flight |
|
11122 | - * @param Float $longitude longitute of the flight |
|
11123 | - * @return String the countrie |
|
11124 | - */ |
|
11119 | + * Gets Country from latitude/longitude |
|
11120 | + * |
|
11121 | + * @param Float $latitude latitute of the flight |
|
11122 | + * @param Float $longitude longitute of the flight |
|
11123 | + * @return String the countrie |
|
11124 | + */ |
|
11125 | 11125 | public function getCountryFromLatitudeLongitude($latitude,$longitude) |
11126 | 11126 | { |
11127 | 11127 | global $globalDBdriver, $globalDebug; |
@@ -11158,11 +11158,11 @@ discard block |
||
11158 | 11158 | } |
11159 | 11159 | |
11160 | 11160 | /** |
11161 | - * Gets Country from iso2 |
|
11162 | - * |
|
11163 | - * @param String $iso2 ISO2 country code |
|
11164 | - * @return String the countrie |
|
11165 | - */ |
|
11161 | + * Gets Country from iso2 |
|
11162 | + * |
|
11163 | + * @param String $iso2 ISO2 country code |
|
11164 | + * @return String the countrie |
|
11165 | + */ |
|
11166 | 11166 | public function getCountryFromISO2($iso2) |
11167 | 11167 | { |
11168 | 11168 | global $globalDBdriver, $globalDebug; |
@@ -11190,12 +11190,12 @@ discard block |
||
11190 | 11190 | } |
11191 | 11191 | |
11192 | 11192 | /** |
11193 | - * converts the registration code using the country prefix |
|
11194 | - * |
|
11195 | - * @param String $registration the aircraft registration |
|
11196 | - * @return String the aircraft registration |
|
11197 | - * |
|
11198 | - */ |
|
11193 | + * converts the registration code using the country prefix |
|
11194 | + * |
|
11195 | + * @param String $registration the aircraft registration |
|
11196 | + * @return String the aircraft registration |
|
11197 | + * |
|
11198 | + */ |
|
11199 | 11199 | public function convertAircraftRegistration($registration) |
11200 | 11200 | { |
11201 | 11201 | $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
@@ -11247,12 +11247,12 @@ discard block |
||
11247 | 11247 | } |
11248 | 11248 | |
11249 | 11249 | /** |
11250 | - * Country from the registration code |
|
11251 | - * |
|
11252 | - * @param String $registration the aircraft registration |
|
11253 | - * @return String the country |
|
11254 | - * |
|
11255 | - */ |
|
11250 | + * Country from the registration code |
|
11251 | + * |
|
11252 | + * @param String $registration the aircraft registration |
|
11253 | + * @return String the country |
|
11254 | + * |
|
11255 | + */ |
|
11256 | 11256 | public function countryFromAircraftRegistration($registration) |
11257 | 11257 | { |
11258 | 11258 | $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
@@ -11271,8 +11271,8 @@ discard block |
||
11271 | 11271 | $country = $row['country']; |
11272 | 11272 | } |
11273 | 11273 | } else { |
11274 | - $registration_1 = substr($registration, 0, 1); |
|
11275 | - $registration_2 = substr($registration, 0, 2); |
|
11274 | + $registration_1 = substr($registration, 0, 1); |
|
11275 | + $registration_2 = substr($registration, 0, 2); |
|
11276 | 11276 | |
11277 | 11277 | $country = ''; |
11278 | 11278 | //first get the prefix based on two characters |
@@ -11308,12 +11308,12 @@ discard block |
||
11308 | 11308 | } |
11309 | 11309 | |
11310 | 11310 | /** |
11311 | - * Registration prefix from the registration code |
|
11312 | - * |
|
11313 | - * @param String $registration the aircraft registration |
|
11314 | - * @return String the registration prefix |
|
11315 | - * |
|
11316 | - */ |
|
11311 | + * Registration prefix from the registration code |
|
11312 | + * |
|
11313 | + * @param String $registration the aircraft registration |
|
11314 | + * @return String the registration prefix |
|
11315 | + * |
|
11316 | + */ |
|
11317 | 11317 | public function registrationPrefixFromAircraftRegistration($registration) |
11318 | 11318 | { |
11319 | 11319 | $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
@@ -11332,8 +11332,8 @@ discard block |
||
11332 | 11332 | //$country = $row['country']; |
11333 | 11333 | } |
11334 | 11334 | } else { |
11335 | - $registration_1 = substr($registration, 0, 1); |
|
11336 | - $registration_2 = substr($registration, 0, 2); |
|
11335 | + $registration_1 = substr($registration, 0, 1); |
|
11336 | + $registration_2 = substr($registration, 0, 2); |
|
11337 | 11337 | |
11338 | 11338 | //first get the prefix based on two characters |
11339 | 11339 | $query = "SELECT aircraft_registration.registration_prefix, aircraft_registration.country FROM aircraft_registration WHERE registration_prefix = :registration_2 LIMIT 1"; |
@@ -11369,12 +11369,12 @@ discard block |
||
11369 | 11369 | |
11370 | 11370 | |
11371 | 11371 | /** |
11372 | - * Country from the registration code |
|
11373 | - * |
|
11374 | - * @param String $registration the aircraft registration |
|
11375 | - * @return String the country |
|
11376 | - * |
|
11377 | - */ |
|
11372 | + * Country from the registration code |
|
11373 | + * |
|
11374 | + * @param String $registration the aircraft registration |
|
11375 | + * @return String the country |
|
11376 | + * |
|
11377 | + */ |
|
11378 | 11378 | public function countryFromAircraftRegistrationCode($registration) |
11379 | 11379 | { |
11380 | 11380 | $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
@@ -11391,11 +11391,11 @@ discard block |
||
11391 | 11391 | } |
11392 | 11392 | |
11393 | 11393 | /** |
11394 | - * Set a new highlight value for a flight |
|
11395 | - * |
|
11396 | - * @param String $flightaware_id flightaware_id from spotter_output table |
|
11397 | - * @param String $highlight New highlight value |
|
11398 | - */ |
|
11394 | + * Set a new highlight value for a flight |
|
11395 | + * |
|
11396 | + * @param String $flightaware_id flightaware_id from spotter_output table |
|
11397 | + * @param String $highlight New highlight value |
|
11398 | + */ |
|
11399 | 11399 | public function setHighlightFlight($flightaware_id,$highlight) { |
11400 | 11400 | |
11401 | 11401 | $query = "UPDATE spotter_output SET highlight = :highlight WHERE flightaware_id = :flightaware_id"; |
@@ -11404,12 +11404,12 @@ discard block |
||
11404 | 11404 | } |
11405 | 11405 | |
11406 | 11406 | /** |
11407 | - * Set a new highlight value for a flight by Registration |
|
11408 | - * |
|
11409 | - * @param String $registration Registration of the aircraft |
|
11410 | - * @param String $date Date of spotted aircraft |
|
11411 | - * @param String $highlight New highlight value |
|
11412 | - */ |
|
11407 | + * Set a new highlight value for a flight by Registration |
|
11408 | + * |
|
11409 | + * @param String $registration Registration of the aircraft |
|
11410 | + * @param String $date Date of spotted aircraft |
|
11411 | + * @param String $highlight New highlight value |
|
11412 | + */ |
|
11413 | 11413 | public function setHighlightFlightByRegistration($registration,$highlight, $date = '') { |
11414 | 11414 | if ($date == '') { |
11415 | 11415 | $query = "UPDATE spotter_output SET highlight = :highlight WHERE spotter_id IN (SELECT MAX(spotter_id) FROM spotter_output WHERE registration = :registration)"; |
@@ -11423,12 +11423,12 @@ discard block |
||
11423 | 11423 | } |
11424 | 11424 | |
11425 | 11425 | /** |
11426 | - * Gets the short url from bit.ly |
|
11427 | - * |
|
11428 | - * @param String $url the full url |
|
11429 | - * @return String the bit.ly url |
|
11430 | - * |
|
11431 | - */ |
|
11426 | + * Gets the short url from bit.ly |
|
11427 | + * |
|
11428 | + * @param String $url the full url |
|
11429 | + * @return String the bit.ly url |
|
11430 | + * |
|
11431 | + */ |
|
11432 | 11432 | public function getBitlyURL($url) |
11433 | 11433 | { |
11434 | 11434 | global $globalBitlyAccessToken; |
@@ -11717,11 +11717,11 @@ discard block |
||
11717 | 11717 | $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 |
11718 | 11718 | 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)) |
11719 | 11719 | 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;"; |
11720 | - } else { |
|
11720 | + } else { |
|
11721 | 11721 | $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 |
11722 | 11722 | 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)) |
11723 | 11723 | 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;"; |
11724 | - } |
|
11724 | + } |
|
11725 | 11725 | $sth = $this->db->prepare($query); |
11726 | 11726 | $sth->execute(); |
11727 | 11727 | return $sth->fetchAll(PDO::FETCH_ASSOC); |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | if (isset($globalTimezone) && $globalTimezone != '') date_default_timezone_set($globalTimezone); |
54 | 54 | print '<i>Last update: '.date('Y-m-d G:i:s',$lastupdate).'</i>'; |
55 | 55 | } |
56 | - ?> |
|
56 | + ?> |
|
57 | 57 | </div> |
58 | 58 | <?php include('statistics-sub-menu.php'); ?> |
59 | 59 | <p class="global-stats"> |
@@ -62,23 +62,23 @@ discard block |
||
62 | 62 | <span><span class="badge"><?php print number_format($Stats->countOverallArrival($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Arrivals seen"); ?></span> |
63 | 63 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
64 | 64 | <?php |
65 | - if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) { |
|
65 | + if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) { |
|
66 | 66 | ?> |
67 | 67 | <span><span class="badge"><?php print number_format($Stats->countOverallPilots($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Pilots"); ?></span> |
68 | 68 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
69 | 69 | <?php |
70 | - } else { |
|
71 | - ?> |
|
70 | + } else { |
|
71 | + ?> |
|
72 | 72 | <span><span class="badge"><?php print number_format($Stats->countOverallOwners($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Owners"); ?></span> |
73 | 73 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
74 | 74 | <?php |
75 | - } |
|
76 | - ?> |
|
75 | + } |
|
76 | + ?> |
|
77 | 77 | <span><span class="badge"><?php print number_format($Stats->countOverallAircrafts($airline_icao,$filter_name,$year,$month)); ?></span> <?php echo _("Aircrafts types"); ?></span> |
78 | 78 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
79 | 79 | <?php |
80 | - if ($airline_icao == '') { |
|
81 | - ?> |
|
80 | + if ($airline_icao == '') { |
|
81 | + ?> |
|
82 | 82 | <span><span class="badge"><?php print number_format($Stats->countOverallAirlines($filter_name,$year,$month)); ?></span> <?php echo _("Airlines"); ?></span> |
83 | 83 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
84 | 84 | <?php |
@@ -101,25 +101,25 @@ discard block |
||
101 | 101 | <div class="col-md-6"> |
102 | 102 | <h2><?php echo _("Top 10 Most Common Aircraft Type"); ?></h2> |
103 | 103 | <?php |
104 | - $aircraft_array = $Stats->countAllAircraftTypes(true,$airline_icao,$filter_name,$year,$month); |
|
105 | - if (count($aircraft_array) == 0) print _("No data available"); |
|
106 | - else { |
|
104 | + $aircraft_array = $Stats->countAllAircraftTypes(true,$airline_icao,$filter_name,$year,$month); |
|
105 | + if (count($aircraft_array) == 0) print _("No data available"); |
|
106 | + else { |
|
107 | 107 | |
108 | - print '<div id="chart1" class="chart" width="100%"></div> |
|
108 | + print '<div id="chart1" class="chart" width="100%"></div> |
|
109 | 109 | <script> |
110 | 110 | google.load("visualization", "1", {packages:["corechart"]}); |
111 | 111 | google.setOnLoadCallback(drawChart1); |
112 | 112 | function drawChart1() { |
113 | 113 | var data = google.visualization.arrayToDataTable([ |
114 | 114 | ["'._("Aircraft").'", "'._("# of times").'"], '; |
115 | - $aircraft_data = ''; |
|
116 | - foreach($aircraft_array as $aircraft_item) |
|
117 | - { |
|
118 | - $aircraft_data .= '[ "'.$aircraft_item['aircraft_manufacturer'].' '.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],'; |
|
119 | - } |
|
120 | - $aircraft_data = substr($aircraft_data, 0, -1); |
|
121 | - print $aircraft_data; |
|
122 | - print ']); |
|
115 | + $aircraft_data = ''; |
|
116 | + foreach($aircraft_array as $aircraft_item) |
|
117 | + { |
|
118 | + $aircraft_data .= '[ "'.$aircraft_item['aircraft_manufacturer'].' '.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],'; |
|
119 | + } |
|
120 | + $aircraft_data = substr($aircraft_data, 0, -1); |
|
121 | + print $aircraft_data; |
|
122 | + print ']); |
|
123 | 123 | |
124 | 124 | var options = { |
125 | 125 | chartArea: {"width": "80%", "height": "60%"}, |
@@ -134,45 +134,45 @@ discard block |
||
134 | 134 | drawChart1(); |
135 | 135 | }); |
136 | 136 | </script>'; |
137 | - } |
|
138 | - ?> |
|
137 | + } |
|
138 | + ?> |
|
139 | 139 | <div class="more"> |
140 | 140 | <?php |
141 | - if ($year != '' && $month != '') { |
|
142 | - ?> |
|
141 | + if ($year != '' && $month != '') { |
|
142 | + ?> |
|
143 | 143 | <a href="<?php print $globalURL; ?>/statistics/aircraft/<?php echo $year; ?>/<?php echo $month ?>/" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
144 | 144 | <?php |
145 | - } else { |
|
146 | - ?> |
|
145 | + } else { |
|
146 | + ?> |
|
147 | 147 | <a href="<?php print $globalURL; ?>/statistics/aircraft" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
148 | 148 | <?php |
149 | - } |
|
150 | - ?> |
|
149 | + } |
|
150 | + ?> |
|
151 | 151 | </div> |
152 | 152 | </div> |
153 | 153 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
154 | 154 | <?php |
155 | 155 | // echo $airline_icao; |
156 | - if ($airline_icao == '' || $airline_icao == 'all') { |
|
156 | + if ($airline_icao == '' || $airline_icao == 'all') { |
|
157 | 157 | $airline_array = $Stats->countAllAirlines(true,$filter_name,$year,$month); |
158 | 158 | if (count($airline_array) > 0) { |
159 | - print '<div class="col-md-6">'; |
|
160 | - print '<h2>'._("Top 10 Most Common Airline").'</h2>'; |
|
161 | - print '<div id="chart2" class="chart" width="100%"></div> |
|
159 | + print '<div class="col-md-6">'; |
|
160 | + print '<h2>'._("Top 10 Most Common Airline").'</h2>'; |
|
161 | + print '<div id="chart2" class="chart" width="100%"></div> |
|
162 | 162 | <script> |
163 | 163 | google.load("visualization", "1", {packages:["corechart"]}); |
164 | 164 | google.setOnLoadCallback(drawChart2); |
165 | 165 | function drawChart2() { |
166 | 166 | var data = google.visualization.arrayToDataTable([ |
167 | 167 | ["'._("Airline").'", "'._("# of times").'"], '; |
168 | - $airline_data = ''; |
|
169 | - foreach($airline_array as $airline_item) |
|
170 | - { |
|
168 | + $airline_data = ''; |
|
169 | + foreach($airline_array as $airline_item) |
|
170 | + { |
|
171 | 171 | $airline_data .= '[ "'.$airline_item['airline_name'].' ('.$airline_item['airline_icao'].')",'.$airline_item['airline_count'].'],'; |
172 | - } |
|
173 | - $airline_data = substr($airline_data, 0, -1); |
|
174 | - print $airline_data; |
|
175 | - print ']); |
|
172 | + } |
|
173 | + $airline_data = substr($airline_data, 0, -1); |
|
174 | + print $airline_data; |
|
175 | + print ']); |
|
176 | 176 | |
177 | 177 | var options = { |
178 | 178 | chartArea: {"width": "80%", "height": "60%"}, |
@@ -187,27 +187,27 @@ discard block |
||
187 | 187 | drawChart2(); |
188 | 188 | }); |
189 | 189 | </script>'; |
190 | - if ($year != '' && $month != '') { |
|
190 | + if ($year != '' && $month != '') { |
|
191 | 191 | print '<div class="more"><a href="'.$globalURL.'/statistics/airline/'.$year.'/'.$month.'/" class="btn btn-default btn" role="button">'._("See full statistic").'»</a></div>'; |
192 | - } else { |
|
192 | + } else { |
|
193 | 193 | print '<div class="more"><a href="'.$globalURL.'/statistics/airline" class="btn btn-default btn" role="button">'._("See full statistic").'»</a></div>'; |
194 | - } |
|
195 | - print '</div>'; |
|
194 | + } |
|
195 | + print '</div>'; |
|
196 | 196 | } |
197 | 197 | ?> |
198 | 198 | </div> |
199 | 199 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
200 | 200 | <?php |
201 | - } |
|
201 | + } |
|
202 | 202 | ?> |
203 | 203 | <div class="row column"> |
204 | 204 | <?php |
205 | - $flightover_array = $Stats->countAllFlightOverCountries(false,$airline_icao,$filter_name,$year,$month); |
|
206 | - if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) { |
|
205 | + $flightover_array = $Stats->countAllFlightOverCountries(false,$airline_icao,$filter_name,$year,$month); |
|
206 | + if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) { |
|
207 | 207 | if (empty($flightover_array)) { |
208 | - print '<div class="col-md-12">'; |
|
208 | + print '<div class="col-md-12">'; |
|
209 | 209 | } else { |
210 | - print '<div class="col-md-6">'; |
|
210 | + print '<div class="col-md-6">'; |
|
211 | 211 | } |
212 | 212 | ?> |
213 | 213 | <h2><?php echo _("Top 10 Most Common Pilots"); ?></h2> |
@@ -215,21 +215,21 @@ discard block |
||
215 | 215 | $pilot_array = $Stats->countAllPilots(true,$airline_icao,$filter_name,$year,$month); |
216 | 216 | if (count($pilot_array) == 0) print _("No data available"); |
217 | 217 | else { |
218 | - print '<div id="chart7" class="chart" width="100%"></div> |
|
218 | + print '<div id="chart7" class="chart" width="100%"></div> |
|
219 | 219 | <script> |
220 | 220 | google.load("visualization", "1", {packages:["corechart"]}); |
221 | 221 | google.setOnLoadCallback(drawChart7); |
222 | 222 | function drawChart7() { |
223 | 223 | var data = google.visualization.arrayToDataTable([ |
224 | 224 | ["'._("Pilots").'", "'._("# of times").'"], '; |
225 | - $pilot_data = ''; |
|
226 | - foreach($pilot_array as $pilot_item) |
|
227 | - { |
|
225 | + $pilot_data = ''; |
|
226 | + foreach($pilot_array as $pilot_item) |
|
227 | + { |
|
228 | 228 | $pilot_data .= '[ "'.$pilot_item['pilot_name'].' ('.$pilot_item['pilot_id'].')",'.$pilot_item['pilot_count'].'],'; |
229 | - } |
|
230 | - $pilot_data = substr($pilot_data, 0, -1); |
|
231 | - print $pilot_data; |
|
232 | - print ']); |
|
229 | + } |
|
230 | + $pilot_data = substr($pilot_data, 0, -1); |
|
231 | + print $pilot_data; |
|
232 | + print ']); |
|
233 | 233 | |
234 | 234 | var options = { |
235 | 235 | chartArea: {"width": "80%", "height": "60%"}, |
@@ -244,8 +244,8 @@ discard block |
||
244 | 244 | drawChart7(); |
245 | 245 | }); |
246 | 246 | </script>'; |
247 | - } |
|
248 | - print '<div class="more">'; |
|
247 | + } |
|
248 | + print '<div class="more">'; |
|
249 | 249 | print '<a href="'.$globalURL.'/statistics/pilot" class="btn btn-default btn" role="button">'._("See full statistic").'»</a>'; |
250 | 250 | print '</div>'; |
251 | 251 | ?> |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | |
254 | 254 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
255 | 255 | <?php |
256 | - } else { |
|
256 | + } else { |
|
257 | 257 | ?> |
258 | 258 | <div class="col-md-6"> |
259 | 259 | <h2><?php echo _("Top 10 Most Common Owners"); ?></h2> |
@@ -261,21 +261,21 @@ discard block |
||
261 | 261 | $owner_array = $Stats->countAllOwners(true,$airline_icao,$filter_name,$year,$month); |
262 | 262 | if (count($owner_array) == 0) print _("No data available"); |
263 | 263 | else { |
264 | - print '<div id="chart7" class="chart" width="100%"></div> |
|
264 | + print '<div id="chart7" class="chart" width="100%"></div> |
|
265 | 265 | <script> |
266 | 266 | google.load("visualization", "1", {packages:["corechart"]}); |
267 | 267 | google.setOnLoadCallback(drawChart7); |
268 | 268 | function drawChart7() { |
269 | 269 | var data = google.visualization.arrayToDataTable([ |
270 | 270 | ["'._("Owner").'", "'._("# of times").'"], '; |
271 | - $owner_data = ''; |
|
272 | - foreach($owner_array as $owner_item) |
|
273 | - { |
|
271 | + $owner_data = ''; |
|
272 | + foreach($owner_array as $owner_item) |
|
273 | + { |
|
274 | 274 | $owner_data .= '[ "'.$owner_item['owner_name'].'",'.$owner_item['owner_count'].'],'; |
275 | - } |
|
276 | - $owner_data = substr($owner_data, 0, -1); |
|
277 | - print $owner_data; |
|
278 | - print ']); |
|
275 | + } |
|
276 | + $owner_data = substr($owner_data, 0, -1); |
|
277 | + print $owner_data; |
|
278 | + print ']); |
|
279 | 279 | |
280 | 280 | var options = { |
281 | 281 | chartArea: {"width": "80%", "height": "60%"}, |
@@ -299,8 +299,8 @@ discard block |
||
299 | 299 | |
300 | 300 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
301 | 301 | <?php |
302 | - } |
|
303 | - if (!empty($flightover_array)) { |
|
302 | + } |
|
303 | + if (!empty($flightover_array)) { |
|
304 | 304 | ?> |
305 | 305 | <div class="col-md-6"> |
306 | 306 | <h2><?php echo _("Top 20 Most Common Country a Flight was Over"); ?></h2> |
@@ -308,21 +308,21 @@ discard block |
||
308 | 308 | //$flightover_array = $Stats->countAllFlightOverCountries(); |
309 | 309 | if (count($flightover_array) == 0) print _("No data available"); |
310 | 310 | else { |
311 | - print '<div id="chart10" class="chart" width="100%"></div> |
|
311 | + print '<div id="chart10" class="chart" width="100%"></div> |
|
312 | 312 | <script> |
313 | 313 | google.load("visualization", "1", {packages:["corechart"]}); |
314 | 314 | google.setOnLoadCallback(drawChart10); |
315 | 315 | function drawChart10() { |
316 | 316 | var data = google.visualization.arrayToDataTable([ |
317 | 317 | ["'._("Country").'", "'._("# of times").'"], '; |
318 | - $flightover_data = ''; |
|
319 | - foreach($flightover_array as $flightover_item) |
|
320 | - { |
|
318 | + $flightover_data = ''; |
|
319 | + foreach($flightover_array as $flightover_item) |
|
320 | + { |
|
321 | 321 | $flightover_data .= '[ "'.$flightover_item['flight_country'].' ('.$flightover_item['flight_country_iso2'].')",'.$flightover_item['flight_count'].'],'; |
322 | - } |
|
323 | - $flightover_data = substr($flightover_data, 0, -1); |
|
324 | - print $flightover_data; |
|
325 | - print ']); |
|
322 | + } |
|
323 | + $flightover_data = substr($flightover_data, 0, -1); |
|
324 | + print $flightover_data; |
|
325 | + print ']); |
|
326 | 326 | |
327 | 327 | var options = { |
328 | 328 | chartArea: {"width": "80%", "height": "60%"}, |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | </div> |
347 | 347 | </div> |
348 | 348 | <?php |
349 | - } |
|
349 | + } |
|
350 | 350 | ?> |
351 | 351 | </div> |
352 | 352 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
@@ -356,8 +356,8 @@ discard block |
||
356 | 356 | <div class="row column"> |
357 | 357 | <div class="col-md-6"> |
358 | 358 | <?php |
359 | - $airport_airport_array = $Stats->countAllDepartureAirports(true,$airline_icao,$filter_name,$year,$month); |
|
360 | - if (count($airport_airport_array) > 0) { |
|
359 | + $airport_airport_array = $Stats->countAllDepartureAirports(true,$airline_icao,$filter_name,$year,$month); |
|
360 | + if (count($airport_airport_array) > 0) { |
|
361 | 361 | print '<h2>'._("Top 10 Most Common Departure Airports").'</h2>'; |
362 | 362 | print '<div id="chart3" class="chart" width="100%"></div> |
363 | 363 | <script> |
@@ -370,13 +370,13 @@ discard block |
||
370 | 370 | |
371 | 371 | var data = google.visualization.arrayToDataTable([ |
372 | 372 | ["'._("Airport").'", "'._("# of times").'"],'; |
373 | - $airport_data = ''; |
|
373 | + $airport_data = ''; |
|
374 | 374 | foreach($airport_airport_array as $airport_item) |
375 | 375 | { |
376 | - $name = $airport_item['airport_departure_city'].', '.$airport_item['airport_departure_country'].' ('.$airport_item['airport_departure_icao'].')'; |
|
377 | - $name = str_replace("'", "", $name); |
|
378 | - $name = str_replace('"', "", $name); |
|
379 | - $airport_data .= '[ "'.$name.'",'.$airport_item['airport_departure_icao_count'].'],'; |
|
376 | + $name = $airport_item['airport_departure_city'].', '.$airport_item['airport_departure_country'].' ('.$airport_item['airport_departure_icao'].')'; |
|
377 | + $name = str_replace("'", "", $name); |
|
378 | + $name = str_replace('"', "", $name); |
|
379 | + $airport_data .= '[ "'.$name.'",'.$airport_item['airport_departure_icao_count'].'],'; |
|
380 | 380 | } |
381 | 381 | $airport_data = substr($airport_data, 0, -1); |
382 | 382 | print $airport_data; |
@@ -395,15 +395,15 @@ discard block |
||
395 | 395 | } |
396 | 396 | </script>'; |
397 | 397 | print '<div class="more"><a href="'.$globalURL.'/statistics/airport-departure" class="btn btn-default btn" role="button">'._("See full statistic").'»</a></div>'; |
398 | - } |
|
398 | + } |
|
399 | 399 | ?> |
400 | 400 | </div> |
401 | 401 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
402 | 402 | |
403 | 403 | <div class="col-md-6"> |
404 | 404 | <?php |
405 | - $airport_airport_array2 = $Stats->countAllArrivalAirports(true,$airline_icao,$filter_name,$year,$month); |
|
406 | - if (count($airport_airport_array2) > 0) { |
|
405 | + $airport_airport_array2 = $Stats->countAllArrivalAirports(true,$airline_icao,$filter_name,$year,$month); |
|
406 | + if (count($airport_airport_array2) > 0) { |
|
407 | 407 | print '<h2>'._("Top 10 Most Common Arrival Airports").'</h2>'; |
408 | 408 | print '<div id="chart4" class="chart" width="100%"></div> |
409 | 409 | <script> |
@@ -419,9 +419,9 @@ discard block |
||
419 | 419 | $airport_data2 = ''; |
420 | 420 | foreach($airport_airport_array2 as $airport_item2) |
421 | 421 | { |
422 | - $name2 = $airport_item2['airport_arrival_city'].', '.$airport_item2['airport_arrival_country'].' ('.$airport_item2['airport_arrival_icao'].')'; |
|
423 | - $name2 = str_replace(array("'",'"'), '', $name2); |
|
424 | - $airport_data2 .= '[ "'.$name2.'",'.$airport_item2['airport_arrival_icao_count'].'],'; |
|
422 | + $name2 = $airport_item2['airport_arrival_city'].', '.$airport_item2['airport_arrival_country'].' ('.$airport_item2['airport_arrival_icao'].')'; |
|
423 | + $name2 = str_replace(array("'",'"'), '', $name2); |
|
424 | + $airport_data2 .= '[ "'.$name2.'",'.$airport_item2['airport_arrival_icao_count'].'],'; |
|
425 | 425 | } |
426 | 426 | $airport_data2 = substr($airport_data2, 0, -1); |
427 | 427 | print $airport_data2; |
@@ -440,36 +440,36 @@ discard block |
||
440 | 440 | } |
441 | 441 | </script>'; |
442 | 442 | print '<div class="more"><a href="'.$globalURL.'/statistics/airport-arrival" class="btn btn-default btn" role="button">'._("See full statistic").'»</a></div>'; |
443 | - } |
|
443 | + } |
|
444 | 444 | ?> |
445 | 445 | </div> |
446 | 446 | </div> |
447 | 447 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
448 | 448 | <?php |
449 | - if ($year == '' && $month == '') { |
|
449 | + if ($year == '' && $month == '') { |
|
450 | 450 | ?> |
451 | 451 | <div class="row column"> |
452 | 452 | <div class="col-md-6"> |
453 | 453 | <h2><?php echo _("Busiest Months of the last 12 Months"); ?></h2> |
454 | 454 | <?php |
455 | - $year_array = $Stats->countAllMonthsLastYear(true,$airline_icao,$filter_name); |
|
456 | - if (count($year_array) == 0) print _("No data available"); |
|
457 | - else { |
|
458 | - print '<div id="chart8" class="chart" width="100%"></div> |
|
455 | + $year_array = $Stats->countAllMonthsLastYear(true,$airline_icao,$filter_name); |
|
456 | + if (count($year_array) == 0) print _("No data available"); |
|
457 | + else { |
|
458 | + print '<div id="chart8" class="chart" width="100%"></div> |
|
459 | 459 | <script> |
460 | 460 | google.load("visualization", "1", {packages:["corechart"]}); |
461 | 461 | google.setOnLoadCallback(drawChart8); |
462 | 462 | function drawChart8() { |
463 | 463 | var data = google.visualization.arrayToDataTable([ |
464 | 464 | ["'._("Month").'", "'._("# of Flights").'"], '; |
465 | - $year_data = ''; |
|
466 | - foreach($year_array as $year_item) |
|
467 | - { |
|
468 | - $year_data .= '[ "'.date('F, Y',strtotime($year_item['year_name'].'-'.$year_item['month_name'].'-01')).'",'.$year_item['date_count'].'],'; |
|
469 | - } |
|
470 | - $year_data = substr($year_data, 0, -1); |
|
471 | - print $year_data; |
|
472 | - print ']); |
|
465 | + $year_data = ''; |
|
466 | + foreach($year_array as $year_item) |
|
467 | + { |
|
468 | + $year_data .= '[ "'.date('F, Y',strtotime($year_item['year_name'].'-'.$year_item['month_name'].'-01')).'",'.$year_item['date_count'].'],'; |
|
469 | + } |
|
470 | + $year_data = substr($year_data, 0, -1); |
|
471 | + print $year_data; |
|
472 | + print ']); |
|
473 | 473 | |
474 | 474 | var options = { |
475 | 475 | legend: {position: "none"}, |
@@ -487,8 +487,8 @@ discard block |
||
487 | 487 | drawChart8(); |
488 | 488 | }); |
489 | 489 | </script>'; |
490 | - } |
|
491 | - ?> |
|
490 | + } |
|
491 | + ?> |
|
492 | 492 | <div class="more"> |
493 | 493 | <a href="<?php print $globalURL; ?>/statistics/year" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
494 | 494 | </div> |
@@ -497,24 +497,24 @@ discard block |
||
497 | 497 | <div class="col-md-6"> |
498 | 498 | <h2><?php echo _("Busiest Day in the last Month"); ?></h2> |
499 | 499 | <?php |
500 | - $month_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name); |
|
501 | - if (count($month_array) == 0) print _("No data available"); |
|
502 | - else { |
|
503 | - print '<div id="chart9" class="chart" width="100%"></div> |
|
500 | + $month_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name); |
|
501 | + if (count($month_array) == 0) print _("No data available"); |
|
502 | + else { |
|
503 | + print '<div id="chart9" class="chart" width="100%"></div> |
|
504 | 504 | <script> |
505 | 505 | google.load("visualization", "1", {packages:["corechart"]}); |
506 | 506 | google.setOnLoadCallback(drawChart9); |
507 | 507 | function drawChart9() { |
508 | 508 | var data = google.visualization.arrayToDataTable([ |
509 | 509 | ["'._("Day").'", "'._("# of Flights").'"], '; |
510 | - $month_data = ''; |
|
511 | - foreach($month_array as $month_item) |
|
512 | - { |
|
513 | - $month_data .= '[ "'.date('F j, Y',strtotime($month_item['date_name'])).'",'.$month_item['date_count'].'],'; |
|
514 | - } |
|
515 | - $month_data = substr($month_data, 0, -1); |
|
516 | - print $month_data; |
|
517 | - print ']); |
|
510 | + $month_data = ''; |
|
511 | + foreach($month_array as $month_item) |
|
512 | + { |
|
513 | + $month_data .= '[ "'.date('F j, Y',strtotime($month_item['date_name'])).'",'.$month_item['date_count'].'],'; |
|
514 | + } |
|
515 | + $month_data = substr($month_data, 0, -1); |
|
516 | + print $month_data; |
|
517 | + print ']); |
|
518 | 518 | |
519 | 519 | var options = { |
520 | 520 | legend: {position: "none"}, |
@@ -532,8 +532,8 @@ discard block |
||
532 | 532 | drawChart9(); |
533 | 533 | }); |
534 | 534 | </script>'; |
535 | - } |
|
536 | - ?> |
|
535 | + } |
|
536 | + ?> |
|
537 | 537 | <div class="more"> |
538 | 538 | <a href="<?php print $globalURL; ?>/statistics/month" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
539 | 539 | </div> |
@@ -543,25 +543,25 @@ discard block |
||
543 | 543 | <div class="col-md-6"> |
544 | 544 | <h2><?php echo _("Busiest Day in the last 7 Days"); ?></h2> |
545 | 545 | <?php |
546 | - $date_array = $Stats->countAllDatesLast7Days($airline_icao,$filter_name); |
|
547 | - if (empty($date_array)) print _("No data available"); |
|
548 | - else { |
|
549 | - print '<div id="chart5" class="chart" width="100%"></div> |
|
546 | + $date_array = $Stats->countAllDatesLast7Days($airline_icao,$filter_name); |
|
547 | + if (empty($date_array)) print _("No data available"); |
|
548 | + else { |
|
549 | + print '<div id="chart5" class="chart" width="100%"></div> |
|
550 | 550 | <script> |
551 | 551 | google.load("visualization", "1", {packages:["corechart"]}); |
552 | 552 | google.setOnLoadCallback(drawChart5); |
553 | 553 | function drawChart5() { |
554 | 554 | var data = google.visualization.arrayToDataTable([ |
555 | 555 | ["'._("Date").'", "'._("# of Flights").'"], '; |
556 | - $date_data = ''; |
|
556 | + $date_data = ''; |
|
557 | 557 | |
558 | - foreach($date_array as $date_item) |
|
559 | - { |
|
560 | - $date_data .= '[ "'.date("F j, Y", strtotime($date_item['date_name'])).'",'.$date_item['date_count'].'],'; |
|
561 | - } |
|
562 | - $date_data = substr($date_data, 0, -1); |
|
563 | - print $date_data; |
|
564 | - print ']); |
|
558 | + foreach($date_array as $date_item) |
|
559 | + { |
|
560 | + $date_data .= '[ "'.date("F j, Y", strtotime($date_item['date_name'])).'",'.$date_item['date_count'].'],'; |
|
561 | + } |
|
562 | + $date_data = substr($date_data, 0, -1); |
|
563 | + print $date_data; |
|
564 | + print ']); |
|
565 | 565 | |
566 | 566 | var options = { |
567 | 567 | legend: {position: "none"}, |
@@ -579,8 +579,8 @@ discard block |
||
579 | 579 | drawChart5(); |
580 | 580 | }); |
581 | 581 | </script>'; |
582 | - } |
|
583 | - ?> |
|
582 | + } |
|
583 | + ?> |
|
584 | 584 | <div class="more"> |
585 | 585 | <a href="<?php print $globalURL; ?>/statistics/date" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
586 | 586 | </div> |
@@ -589,25 +589,25 @@ discard block |
||
589 | 589 | <div class="col-md-6"> |
590 | 590 | <h2><?php echo _("Busiest Time of the Day"); ?></h2> |
591 | 591 | <?php |
592 | - $hour_array = $Stats->countAllHours('hour',true,$airline_icao,$filter_name); |
|
593 | - if (empty($hour_array)) print _("No data available"); |
|
594 | - else { |
|
592 | + $hour_array = $Stats->countAllHours('hour',true,$airline_icao,$filter_name); |
|
593 | + if (empty($hour_array)) print _("No data available"); |
|
594 | + else { |
|
595 | 595 | |
596 | - print '<div id="chart6" class="chart" width="100%"></div> |
|
596 | + print '<div id="chart6" class="chart" width="100%"></div> |
|
597 | 597 | <script> |
598 | 598 | google.load("visualization", "1", {packages:["corechart"]}); |
599 | 599 | google.setOnLoadCallback(drawChart6); |
600 | 600 | function drawChart6() { |
601 | 601 | var data = google.visualization.arrayToDataTable([ |
602 | 602 | ["'._("Hour").'", "'._("# of Flights").'"], '; |
603 | - $hour_data = ''; |
|
604 | - foreach($hour_array as $hour_item) |
|
605 | - { |
|
606 | - $hour_data .= '[ "'.$hour_item['hour_name'].':00",'.$hour_item['hour_count'].'],'; |
|
607 | - } |
|
608 | - $hour_data = substr($hour_data, 0, -1); |
|
609 | - print $hour_data; |
|
610 | - print ']); |
|
603 | + $hour_data = ''; |
|
604 | + foreach($hour_array as $hour_item) |
|
605 | + { |
|
606 | + $hour_data .= '[ "'.$hour_item['hour_name'].':00",'.$hour_item['hour_count'].'],'; |
|
607 | + } |
|
608 | + $hour_data = substr($hour_data, 0, -1); |
|
609 | + print $hour_data; |
|
610 | + print ']); |
|
611 | 611 | |
612 | 612 | var options = { |
613 | 613 | legend: {position: "none"}, |
@@ -625,8 +625,8 @@ discard block |
||
625 | 625 | drawChart6(); |
626 | 626 | }); |
627 | 627 | </script>'; |
628 | - } |
|
629 | - ?> |
|
628 | + } |
|
629 | + ?> |
|
630 | 630 | <div class="more"> |
631 | 631 | <a href="<?php print $globalURL; ?>/statistics/time" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
632 | 632 | </div> |
@@ -634,36 +634,36 @@ discard block |
||
634 | 634 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
635 | 635 | </div> |
636 | 636 | <?php |
637 | - } |
|
637 | + } |
|
638 | 638 | ?> |
639 | 639 | |
640 | 640 | <?php |
641 | - if (($airline_icao == '' || $airline_icao == 'all') && $year == '' && $month == '' && isset($globalAccidents) && $globalAccidents) { |
|
641 | + if (($airline_icao == '' || $airline_icao == 'all') && $year == '' && $month == '' && isset($globalAccidents) && $globalAccidents) { |
|
642 | 642 | ?> |
643 | 643 | <div class="row column"> |
644 | 644 | <div class="col-md-6"> |
645 | 645 | <h2><?php echo _("Fatalities by Years"); ?></h2> |
646 | 646 | <?php |
647 | - require_once('require/class.Accident.php'); |
|
648 | - $Accident = new Accident(); |
|
649 | - $year_array = $Accident->countFatalitiesByYear($filter_name); |
|
650 | - if (count($year_array) == 0) print _("No data available"); |
|
651 | - else { |
|
652 | - print '<div id="chart32" class="chart" width="100%"></div> |
|
647 | + require_once('require/class.Accident.php'); |
|
648 | + $Accident = new Accident(); |
|
649 | + $year_array = $Accident->countFatalitiesByYear($filter_name); |
|
650 | + if (count($year_array) == 0) print _("No data available"); |
|
651 | + else { |
|
652 | + print '<div id="chart32" class="chart" width="100%"></div> |
|
653 | 653 | <script> |
654 | 654 | google.load("visualization", "1", {packages:["corechart"]}); |
655 | 655 | google.setOnLoadCallback(drawChart32); |
656 | 656 | function drawChart32() { |
657 | 657 | var data = google.visualization.arrayToDataTable([ |
658 | 658 | ["'._("Year").'", "'._("# of Fatalities").'"], '; |
659 | - $year_data = ''; |
|
660 | - foreach($year_array as $year_item) |
|
661 | - { |
|
662 | - $year_data .= '[ "'.$year_item['year'].'",'.$year_item['count'].'],'; |
|
663 | - } |
|
664 | - $year_data = substr($year_data, 0, -1); |
|
665 | - print $year_data; |
|
666 | - print ']); |
|
659 | + $year_data = ''; |
|
660 | + foreach($year_array as $year_item) |
|
661 | + { |
|
662 | + $year_data .= '[ "'.$year_item['year'].'",'.$year_item['count'].'],'; |
|
663 | + } |
|
664 | + $year_data = substr($year_data, 0, -1); |
|
665 | + print $year_data; |
|
666 | + print ']); |
|
667 | 667 | |
668 | 668 | var options = { |
669 | 669 | legend: {position: "none"}, |
@@ -681,8 +681,8 @@ discard block |
||
681 | 681 | drawChart32(); |
682 | 682 | }); |
683 | 683 | </script>'; |
684 | - } |
|
685 | - ?> |
|
684 | + } |
|
685 | + ?> |
|
686 | 686 | <div class="more"> |
687 | 687 | <a href="<?php print $globalURL; ?>/statistics/fatalities/year" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
688 | 688 | </div> |
@@ -693,26 +693,26 @@ discard block |
||
693 | 693 | <div class="col-md-6"> |
694 | 694 | <h2><?php echo _("Fatalities last 12 Months"); ?></h2> |
695 | 695 | <?php |
696 | - require_once('require/class.Accident.php'); |
|
697 | - $Accident = new Accident(); |
|
698 | - $year_array = $Accident->countFatalitiesLast12Months($filter_name); |
|
699 | - if (count($year_array) == 0) print _("No data available"); |
|
700 | - else { |
|
701 | - print '<div id="chart33" class="chart" width="100%"></div> |
|
696 | + require_once('require/class.Accident.php'); |
|
697 | + $Accident = new Accident(); |
|
698 | + $year_array = $Accident->countFatalitiesLast12Months($filter_name); |
|
699 | + if (count($year_array) == 0) print _("No data available"); |
|
700 | + else { |
|
701 | + print '<div id="chart33" class="chart" width="100%"></div> |
|
702 | 702 | <script> |
703 | 703 | google.load("visualization", "1", {packages:["corechart"]}); |
704 | 704 | google.setOnLoadCallback(drawChart33); |
705 | 705 | function drawChart33() { |
706 | 706 | var data = google.visualization.arrayToDataTable([ |
707 | 707 | ["'._("Month").'", "'._("# of Fatalities").'"], '; |
708 | - $year_data = ''; |
|
709 | - foreach($year_array as $year_item) |
|
710 | - { |
|
711 | - $year_data .= '[ "'.date('F, Y',strtotime($year_item['year'].'-'.$year_item['month'].'-01')).'",'.$year_item['count'].'],'; |
|
712 | - } |
|
713 | - $year_data = substr($year_data, 0, -1); |
|
714 | - print $year_data; |
|
715 | - print ']); |
|
708 | + $year_data = ''; |
|
709 | + foreach($year_array as $year_item) |
|
710 | + { |
|
711 | + $year_data .= '[ "'.date('F, Y',strtotime($year_item['year'].'-'.$year_item['month'].'-01')).'",'.$year_item['count'].'],'; |
|
712 | + } |
|
713 | + $year_data = substr($year_data, 0, -1); |
|
714 | + print $year_data; |
|
715 | + print ']); |
|
716 | 716 | |
717 | 717 | var options = { |
718 | 718 | legend: {position: "none"}, |
@@ -730,8 +730,8 @@ discard block |
||
730 | 730 | drawChart33(); |
731 | 731 | }); |
732 | 732 | </script>'; |
733 | - } |
|
734 | - ?> |
|
733 | + } |
|
734 | + ?> |
|
735 | 735 | <div class="more"> |
736 | 736 | <a href="<?php print $globalURL; ?>/statistics/fatalities/month" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
737 | 737 | </div> |
@@ -739,30 +739,30 @@ discard block |
||
739 | 739 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
740 | 740 | <br/> |
741 | 741 | <?php |
742 | - } |
|
742 | + } |
|
743 | 743 | ?> |
744 | 744 | |
745 | 745 | <?php |
746 | - if (($airline_icao == '' || $airline_icao == 'all') && $filter_name == '' && $year == '' && $month == '') { |
|
746 | + if (($airline_icao == '' || $airline_icao == 'all') && $filter_name == '' && $year == '' && $month == '') { |
|
747 | 747 | ?> |
748 | 748 | <div class="row column"> |
749 | 749 | <?php |
750 | - //$polar = $Stats->getStatsSource(date('Y-m-d'),'polar'); |
|
751 | - if ($year == '' && $month == '') { |
|
752 | - $polar = $Stats->getStatsSource('polar',date('Y'),date('m'),date('d')); |
|
753 | - } else { |
|
754 | - $polar = $Stats->getStatsSource('polar',$year,$month); |
|
755 | - } |
|
756 | - if (!empty($polar)) { |
|
757 | - print '<h2>'._("Coverage pattern").'</h2>'; |
|
758 | - foreach ($polar as $eachpolar) { |
|
759 | - unset($polar_data); |
|
760 | - $Spotter = new Spotter(); |
|
761 | - $data = json_decode($eachpolar['source_data']); |
|
762 | - foreach($data as $value => $key) { |
|
763 | - $direction = $Spotter->parseDirection(($value*22.5)); |
|
764 | - $distance = $key; |
|
765 | - $unit = 'km'; |
|
750 | + //$polar = $Stats->getStatsSource(date('Y-m-d'),'polar'); |
|
751 | + if ($year == '' && $month == '') { |
|
752 | + $polar = $Stats->getStatsSource('polar',date('Y'),date('m'),date('d')); |
|
753 | + } else { |
|
754 | + $polar = $Stats->getStatsSource('polar',$year,$month); |
|
755 | + } |
|
756 | + if (!empty($polar)) { |
|
757 | + print '<h2>'._("Coverage pattern").'</h2>'; |
|
758 | + foreach ($polar as $eachpolar) { |
|
759 | + unset($polar_data); |
|
760 | + $Spotter = new Spotter(); |
|
761 | + $data = json_decode($eachpolar['source_data']); |
|
762 | + foreach($data as $value => $key) { |
|
763 | + $direction = $Spotter->parseDirection(($value*22.5)); |
|
764 | + $distance = $key; |
|
765 | + $unit = 'km'; |
|
766 | 766 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
767 | 767 | $distance = round($distance*0.539957); |
768 | 768 | $unit = 'nm'; |
@@ -773,10 +773,10 @@ discard block |
||
773 | 773 | $distance = $distance; |
774 | 774 | $unit = 'km'; |
775 | 775 | } |
776 | - if (!isset($polar_data)) $polar_data = '{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
777 | - else $polar_data = $polar_data.',{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
778 | - } |
|
779 | - ?> |
|
776 | + if (!isset($polar_data)) $polar_data = '{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
777 | + else $polar_data = $polar_data.',{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
778 | + } |
|
779 | + ?> |
|
780 | 780 | <div class="col-md-6"> |
781 | 781 | <h4><?php print $eachpolar['source_name']; ?></h4> |
782 | 782 | <div id="polar-<?php print str_replace(' ','_',strtolower($eachpolar['source_name'])); ?>" class="chart" width="100%"></div> |
@@ -808,27 +808,27 @@ discard block |
||
808 | 808 | </script> |
809 | 809 | </div> |
810 | 810 | <?php |
811 | - } |
|
812 | - } |
|
813 | - ?> |
|
811 | + } |
|
812 | + } |
|
813 | + ?> |
|
814 | 814 | </div> |
815 | 815 | <div class="row column"> |
816 | 816 | <div class="col-md-6"> |
817 | 817 | <?php |
818 | - //$msg = $Stats->getStatsSource(date('Y-m-d'),'msg'); |
|
819 | - if ($year == '' && $month == '') { |
|
820 | - $msg = $Stats->getStatsSource('msg',date('Y'),date('m'),date('d')); |
|
821 | - } else { |
|
822 | - $msg = $Stats->getStatsSource('msg',$year,$month); |
|
823 | - } |
|
824 | - if (!empty($msg)) { |
|
825 | - print '<h2>'._("Messages received").'</h2>'; |
|
826 | - foreach ($msg as $eachmsg) { |
|
827 | - //$eachmsg = $msg[0]; |
|
828 | - $data = $eachmsg['source_data']; |
|
829 | - if ($data > 500) $max = (round(($data+100)/100))*100; |
|
830 | - else $max = 500; |
|
831 | - ?> |
|
818 | + //$msg = $Stats->getStatsSource(date('Y-m-d'),'msg'); |
|
819 | + if ($year == '' && $month == '') { |
|
820 | + $msg = $Stats->getStatsSource('msg',date('Y'),date('m'),date('d')); |
|
821 | + } else { |
|
822 | + $msg = $Stats->getStatsSource('msg',$year,$month); |
|
823 | + } |
|
824 | + if (!empty($msg)) { |
|
825 | + print '<h2>'._("Messages received").'</h2>'; |
|
826 | + foreach ($msg as $eachmsg) { |
|
827 | + //$eachmsg = $msg[0]; |
|
828 | + $data = $eachmsg['source_data']; |
|
829 | + if ($data > 500) $max = (round(($data+100)/100))*100; |
|
830 | + else $max = 500; |
|
831 | + ?> |
|
832 | 832 | <div id="msg-<?php print str_replace(' ','_',strtolower($eachmsg['source_name'])); ?>" class="col-md-4"></div> |
833 | 833 | <script> |
834 | 834 | var g = new JustGage({ |
@@ -844,9 +844,9 @@ discard block |
||
844 | 844 | }); |
845 | 845 | </script> |
846 | 846 | <?php |
847 | - } |
|
848 | - } |
|
849 | - ?> |
|
847 | + } |
|
848 | + } |
|
849 | + ?> |
|
850 | 850 | </div> |
851 | 851 | </div> |
852 | 852 | <div class="row column"> |
@@ -878,19 +878,19 @@ discard block |
||
878 | 878 | $hist_data .= '[ "'.$distance.'",'.$nb.'],'; |
879 | 879 | } |
880 | 880 | $hist_data = substr($hist_data, 0, -1); |
881 | - ?> |
|
881 | + ?> |
|
882 | 882 | <div class="col-md-6"> |
883 | 883 | <h2><?php echo sprintf(_("Flights Distance for %s"),$source); ?></h2> |
884 | 884 | <?php |
885 | - print '<div id="charthist-'.str_replace(' ','_',strtolower($source)).'" class="chart" width="100%"></div> |
|
885 | + print '<div id="charthist-'.str_replace(' ','_',strtolower($source)).'" class="chart" width="100%"></div> |
|
886 | 886 | <script> |
887 | 887 | google.load("visualization", "1", {packages:["corechart"]}); |
888 | 888 | google.setOnLoadCallback(drawCharthist_'.str_replace(' ','_',strtolower($source)).'); |
889 | 889 | function drawCharthist_'.str_replace(' ','_',strtolower($source)).'() { |
890 | 890 | var data = google.visualization.arrayToDataTable([ |
891 | 891 | ["'._("Distance").'", "'._("# of Flights").'"], '; |
892 | - print $hist_data; |
|
893 | - print ']); |
|
892 | + print $hist_data; |
|
893 | + print ']); |
|
894 | 894 | |
895 | 895 | var options = { |
896 | 896 | legend: {position: "none"}, |
@@ -908,15 +908,15 @@ discard block |
||
908 | 908 | drawCharthist_'.str_replace(' ','_',strtolower($source)).'(); |
909 | 909 | }); |
910 | 910 | </script>'; |
911 | - ?> |
|
911 | + ?> |
|
912 | 912 | </div> |
913 | 913 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
914 | 914 | <?php |
915 | - } |
|
916 | - ?> |
|
915 | + } |
|
916 | + ?> |
|
917 | 917 | </div> |
918 | 918 | <?php |
919 | - } |
|
919 | + } |
|
920 | 920 | ?> |
921 | 921 | </div> |
922 | 922 | </div> |
@@ -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,110 +566,110 @@ 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); |
|
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 | 641 | |
642 | - if (empty($all)) { |
|
642 | + if (empty($all)) { |
|
643 | 643 | $filters = array('airlines' => array($stats_airline)); |
644 | 644 | if ($filter_name != '') { |
645 | 645 | $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
646 | 646 | } |
647 | - $Spotter = new Spotter($this->db); |
|
648 | - $all = $Spotter->countAllMonths($filters); |
|
649 | - } |
|
647 | + $Spotter = new Spotter($this->db); |
|
648 | + $all = $Spotter->countAllMonths($filters); |
|
649 | + } |
|
650 | 650 | |
651 | - return $all; |
|
651 | + return $all; |
|
652 | 652 | } |
653 | 653 | public function countAllMilitaryMonths($filter_name = '') { |
654 | 654 | global $globalStatsFilters; |
655 | 655 | if ($filter_name == '') $filter_name = $this->filter_name; |
656 | - $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"; |
|
657 | - try { |
|
658 | - $sth = $this->db->prepare($query); |
|
659 | - $sth->execute(array(':filter_name' => $filter_name)); |
|
660 | - } catch(PDOException $e) { |
|
661 | - echo "error : ".$e->getMessage(); |
|
662 | - } |
|
663 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
664 | - if (empty($all)) { |
|
665 | - $filters = array(); |
|
666 | - if ($filter_name != '') { |
|
667 | - $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
656 | + $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"; |
|
657 | + try { |
|
658 | + $sth = $this->db->prepare($query); |
|
659 | + $sth->execute(array(':filter_name' => $filter_name)); |
|
660 | + } catch(PDOException $e) { |
|
661 | + echo "error : ".$e->getMessage(); |
|
662 | + } |
|
663 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
664 | + if (empty($all)) { |
|
665 | + $filters = array(); |
|
666 | + if ($filter_name != '') { |
|
667 | + $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
668 | 668 | } |
669 | - $Spotter = new Spotter($this->db); |
|
670 | - $all = $Spotter->countAllMilitaryMonths($filters); |
|
671 | - } |
|
672 | - return $all; |
|
669 | + $Spotter = new Spotter($this->db); |
|
670 | + $all = $Spotter->countAllMilitaryMonths($filters); |
|
671 | + } |
|
672 | + return $all; |
|
673 | 673 | } |
674 | 674 | public function countAllHours($orderby = 'hour',$limit = true,$stats_airline = '',$filter_name = '') { |
675 | 675 | global $globalTimezone, $globalDBdriver, $globalStatsFilters; |
@@ -685,22 +685,22 @@ discard block |
||
685 | 685 | $query .= " ORDER BY CAST(flight_date AS integer) ASC"; |
686 | 686 | } |
687 | 687 | if ($orderby == 'count') $query .= " ORDER BY hour_count DESC"; |
688 | - try { |
|
689 | - $sth = $this->db->prepare($query); |
|
690 | - $sth->execute(array(':stats_airline' => $stats_airline, ':filter_name' => $filter_name)); |
|
691 | - } catch(PDOException $e) { |
|
692 | - echo "error : ".$e->getMessage(); |
|
693 | - } |
|
694 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
695 | - if (empty($all)) { |
|
688 | + try { |
|
689 | + $sth = $this->db->prepare($query); |
|
690 | + $sth->execute(array(':stats_airline' => $stats_airline, ':filter_name' => $filter_name)); |
|
691 | + } catch(PDOException $e) { |
|
692 | + echo "error : ".$e->getMessage(); |
|
693 | + } |
|
694 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
695 | + if (empty($all)) { |
|
696 | 696 | $filters = array('airlines' => array($stats_airline)); |
697 | 697 | if ($filter_name != '') { |
698 | - $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
698 | + $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
699 | 699 | } |
700 | - $Spotter = new Spotter($this->db); |
|
701 | - $all = $Spotter->countAllHours($orderby,$filters); |
|
702 | - } |
|
703 | - return $all; |
|
700 | + $Spotter = new Spotter($this->db); |
|
701 | + $all = $Spotter->countAllHours($orderby,$filters); |
|
702 | + } |
|
703 | + return $all; |
|
704 | 704 | } |
705 | 705 | |
706 | 706 | public function countOverallFlights($stats_airline = '', $filter_name = '',$year = '',$month = '') { |
@@ -724,9 +724,9 @@ discard block |
||
724 | 724 | if ($year == '') $year = date('Y'); |
725 | 725 | $all = $this->getSumStats('military_flights_bymonth',$year,'',$filter_name,$month); |
726 | 726 | if (empty($all)) { |
727 | - $filters = array(); |
|
728 | - if ($filter_name != '') { |
|
729 | - $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
727 | + $filters = array(); |
|
728 | + if ($filter_name != '') { |
|
729 | + $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
730 | 730 | } |
731 | 731 | $Spotter = new Spotter($this->db); |
732 | 732 | $all = $Spotter->countOverallMilitaryFlights($filters,$year,$month); |
@@ -778,9 +778,9 @@ discard block |
||
778 | 778 | $all = $result[0]['nb_airline']; |
779 | 779 | } else $all = $this->getSumStats('airlines_bymonth',$year,'',$filter_name,$month); |
780 | 780 | if (empty($all)) { |
781 | - $filters = array(); |
|
782 | - if ($filter_name != '') { |
|
783 | - $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
781 | + $filters = array(); |
|
782 | + if ($filter_name != '') { |
|
783 | + $filters = array_merge($filters,$globalStatsFilters[$filter_name]); |
|
784 | 784 | } |
785 | 785 | $Spotter = new Spotter($this->db); |
786 | 786 | $all = $Spotter->countOverallAirlines($filters,$year,$month); |
@@ -833,33 +833,33 @@ discard block |
||
833 | 833 | if ($filter_name == '') $filter_name = $this->filter_name; |
834 | 834 | $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"; |
835 | 835 | $query_values = array(':airport_icao' => $airport_icao,':stats_airline' => $stats_airline, ':filter_name' => $filter_name); |
836 | - try { |
|
837 | - $sth = $this->db->prepare($query); |
|
838 | - $sth->execute($query_values); |
|
839 | - } catch(PDOException $e) { |
|
840 | - echo "error : ".$e->getMessage(); |
|
841 | - } |
|
842 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
843 | - return $all; |
|
836 | + try { |
|
837 | + $sth = $this->db->prepare($query); |
|
838 | + $sth->execute($query_values); |
|
839 | + } catch(PDOException $e) { |
|
840 | + echo "error : ".$e->getMessage(); |
|
841 | + } |
|
842 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
843 | + return $all; |
|
844 | 844 | } |
845 | 845 | public function getStats($type,$stats_airline = '', $filter_name = '') { |
846 | 846 | if ($filter_name == '') $filter_name = $this->filter_name; |
847 | - $query = "SELECT * FROM stats WHERE stats_type = :type AND stats_airline = :stats_airline AND filter_name = :filter_name ORDER BY stats_date"; |
|
848 | - $query_values = array(':type' => $type,':stats_airline' => $stats_airline,':filter_name' => $filter_name); |
|
849 | - try { |
|
850 | - $sth = $this->db->prepare($query); |
|
851 | - $sth->execute($query_values); |
|
852 | - } catch(PDOException $e) { |
|
853 | - echo "error : ".$e->getMessage(); |
|
854 | - } |
|
855 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
856 | - return $all; |
|
857 | - } |
|
847 | + $query = "SELECT * FROM stats WHERE stats_type = :type AND stats_airline = :stats_airline AND filter_name = :filter_name ORDER BY stats_date"; |
|
848 | + $query_values = array(':type' => $type,':stats_airline' => $stats_airline,':filter_name' => $filter_name); |
|
849 | + try { |
|
850 | + $sth = $this->db->prepare($query); |
|
851 | + $sth->execute($query_values); |
|
852 | + } catch(PDOException $e) { |
|
853 | + echo "error : ".$e->getMessage(); |
|
854 | + } |
|
855 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
856 | + return $all; |
|
857 | + } |
|
858 | 858 | public function getSumStats($type,$year,$stats_airline = '',$filter_name = '',$month = '') { |
859 | 859 | if ($filter_name == '') $filter_name = $this->filter_name; |
860 | - global $globalArchiveMonths, $globalDBdriver; |
|
861 | - if ($globalDBdriver == 'mysql') { |
|
862 | - if ($month == '') { |
|
860 | + global $globalArchiveMonths, $globalDBdriver; |
|
861 | + if ($globalDBdriver == 'mysql') { |
|
862 | + if ($month == '') { |
|
863 | 863 | $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"; |
864 | 864 | $query_values = array(':type' => $type, ':year' => $year, ':stats_airline' => $stats_airline,':filter_name' => $filter_name); |
865 | 865 | } else { |
@@ -874,137 +874,137 @@ discard block |
||
874 | 874 | $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"; |
875 | 875 | $query_values = array(':type' => $type, ':year' => $year, ':stats_airline' => $stats_airline,':filter_name' => $filter_name,':month' => $month); |
876 | 876 | } |
877 | - } |
|
878 | - try { |
|
879 | - $sth = $this->db->prepare($query); |
|
880 | - $sth->execute($query_values); |
|
881 | - } catch(PDOException $e) { |
|
882 | - echo "error : ".$e->getMessage(); |
|
883 | - } |
|
884 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
885 | - return $all[0]['total']; |
|
886 | - } |
|
877 | + } |
|
878 | + try { |
|
879 | + $sth = $this->db->prepare($query); |
|
880 | + $sth->execute($query_values); |
|
881 | + } catch(PDOException $e) { |
|
882 | + echo "error : ".$e->getMessage(); |
|
883 | + } |
|
884 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
885 | + return $all[0]['total']; |
|
886 | + } |
|
887 | 887 | public function getStatsTotal($type, $stats_airline = '', $filter_name = '') { |
888 | - global $globalArchiveMonths, $globalDBdriver; |
|
888 | + global $globalArchiveMonths, $globalDBdriver; |
|
889 | 889 | if ($filter_name == '') $filter_name = $this->filter_name; |
890 | - if ($globalDBdriver == 'mysql') { |
|
890 | + if ($globalDBdriver == 'mysql') { |
|
891 | 891 | $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"; |
892 | 892 | } else { |
893 | 893 | $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"; |
894 | - } |
|
895 | - $query_values = array(':type' => $type, ':stats_airline' => $stats_airline, ':filter_name' => $filter_name); |
|
896 | - try { |
|
897 | - $sth = $this->db->prepare($query); |
|
898 | - $sth->execute($query_values); |
|
899 | - } catch(PDOException $e) { |
|
900 | - echo "error : ".$e->getMessage(); |
|
901 | - } |
|
902 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
903 | - return $all[0]['total']; |
|
904 | - } |
|
894 | + } |
|
895 | + $query_values = array(':type' => $type, ':stats_airline' => $stats_airline, ':filter_name' => $filter_name); |
|
896 | + try { |
|
897 | + $sth = $this->db->prepare($query); |
|
898 | + $sth->execute($query_values); |
|
899 | + } catch(PDOException $e) { |
|
900 | + echo "error : ".$e->getMessage(); |
|
901 | + } |
|
902 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
903 | + return $all[0]['total']; |
|
904 | + } |
|
905 | 905 | public function getStatsAircraftTotal($stats_airline = '', $filter_name = '') { |
906 | - global $globalArchiveMonths, $globalDBdriver; |
|
906 | + global $globalArchiveMonths, $globalDBdriver; |
|
907 | 907 | if ($filter_name == '') $filter_name = $this->filter_name; |
908 | - if ($globalDBdriver == 'mysql') { |
|
908 | + if ($globalDBdriver == 'mysql') { |
|
909 | 909 | $query = "SELECT SUM(cnt) as total FROM stats_aircraft WHERE stats_airline = :stats_airline AND filter_name = :filter_name"; |
910 | - } else { |
|
910 | + } else { |
|
911 | 911 | $query = "SELECT SUM(cnt) as total FROM stats_aircraft WHERE stats_airline = :stats_airline AND filter_name = :filter_name"; |
912 | - } |
|
913 | - try { |
|
914 | - $sth = $this->db->prepare($query); |
|
915 | - $sth->execute(array(':stats_airline' => $stats_airline, ':filter_name' => $filter_name)); |
|
916 | - } catch(PDOException $e) { |
|
917 | - echo "error : ".$e->getMessage(); |
|
918 | - } |
|
919 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
920 | - return $all[0]['total']; |
|
921 | - } |
|
912 | + } |
|
913 | + try { |
|
914 | + $sth = $this->db->prepare($query); |
|
915 | + $sth->execute(array(':stats_airline' => $stats_airline, ':filter_name' => $filter_name)); |
|
916 | + } catch(PDOException $e) { |
|
917 | + echo "error : ".$e->getMessage(); |
|
918 | + } |
|
919 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
920 | + return $all[0]['total']; |
|
921 | + } |
|
922 | 922 | public function getStatsAirlineTotal($filter_name = '') { |
923 | - global $globalArchiveMonths, $globalDBdriver; |
|
923 | + global $globalArchiveMonths, $globalDBdriver; |
|
924 | 924 | if ($filter_name == '') $filter_name = $this->filter_name; |
925 | - if ($globalDBdriver == 'mysql') { |
|
925 | + if ($globalDBdriver == 'mysql') { |
|
926 | 926 | $query = "SELECT SUM(cnt) as total FROM stats_airline WHERE filter_name = :filter_name"; |
927 | - } else { |
|
927 | + } else { |
|
928 | 928 | $query = "SELECT SUM(cnt) as total FROM stats_airline WHERE filter_name = :filter_name"; |
929 | - } |
|
930 | - try { |
|
931 | - $sth = $this->db->prepare($query); |
|
932 | - $sth->execute(array(':filter_name' => $filter_name)); |
|
933 | - } catch(PDOException $e) { |
|
934 | - echo "error : ".$e->getMessage(); |
|
935 | - } |
|
936 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
937 | - return $all[0]['total']; |
|
938 | - } |
|
929 | + } |
|
930 | + try { |
|
931 | + $sth = $this->db->prepare($query); |
|
932 | + $sth->execute(array(':filter_name' => $filter_name)); |
|
933 | + } catch(PDOException $e) { |
|
934 | + echo "error : ".$e->getMessage(); |
|
935 | + } |
|
936 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
937 | + return $all[0]['total']; |
|
938 | + } |
|
939 | 939 | public function getStatsOwnerTotal($filter_name = '') { |
940 | - global $globalArchiveMonths, $globalDBdriver; |
|
940 | + global $globalArchiveMonths, $globalDBdriver; |
|
941 | 941 | if ($filter_name == '') $filter_name = $this->filter_name; |
942 | - if ($globalDBdriver == 'mysql') { |
|
942 | + if ($globalDBdriver == 'mysql') { |
|
943 | 943 | $query = "SELECT SUM(cnt) as total FROM stats_owner WHERE filter_name = :filter_name"; |
944 | 944 | } else { |
945 | 945 | $query = "SELECT SUM(cnt) as total FROM stats_owner WHERE filter_name = :filter_name"; |
946 | - } |
|
947 | - try { |
|
948 | - $sth = $this->db->prepare($query); |
|
949 | - $sth->execute(array(':filter_name' => $filter_name)); |
|
950 | - } catch(PDOException $e) { |
|
951 | - echo "error : ".$e->getMessage(); |
|
952 | - } |
|
953 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
954 | - return $all[0]['total']; |
|
955 | - } |
|
946 | + } |
|
947 | + try { |
|
948 | + $sth = $this->db->prepare($query); |
|
949 | + $sth->execute(array(':filter_name' => $filter_name)); |
|
950 | + } catch(PDOException $e) { |
|
951 | + echo "error : ".$e->getMessage(); |
|
952 | + } |
|
953 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
954 | + return $all[0]['total']; |
|
955 | + } |
|
956 | 956 | public function getStatsPilotTotal($filter_name = '') { |
957 | - global $globalArchiveMonths, $globalDBdriver; |
|
957 | + global $globalArchiveMonths, $globalDBdriver; |
|
958 | 958 | if ($filter_name == '') $filter_name = $this->filter_name; |
959 | - if ($globalDBdriver == 'mysql') { |
|
960 | - $query = "SELECT SUM(cnt) as total FROM stats_pilot WHERE filter_name = :filter_name"; |
|
961 | - } else { |
|
962 | - $query = "SELECT SUM(cnt) as total FROM stats_pilot WHERE filter_name = :filter_name"; |
|
963 | - } |
|
964 | - try { |
|
965 | - $sth = $this->db->prepare($query); |
|
966 | - $sth->execute(array(':filter_name' => $filter_name)); |
|
967 | - } catch(PDOException $e) { |
|
968 | - echo "error : ".$e->getMessage(); |
|
969 | - } |
|
970 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
971 | - return $all[0]['total']; |
|
972 | - } |
|
959 | + if ($globalDBdriver == 'mysql') { |
|
960 | + $query = "SELECT SUM(cnt) as total FROM stats_pilot WHERE filter_name = :filter_name"; |
|
961 | + } else { |
|
962 | + $query = "SELECT SUM(cnt) as total FROM stats_pilot WHERE filter_name = :filter_name"; |
|
963 | + } |
|
964 | + try { |
|
965 | + $sth = $this->db->prepare($query); |
|
966 | + $sth->execute(array(':filter_name' => $filter_name)); |
|
967 | + } catch(PDOException $e) { |
|
968 | + echo "error : ".$e->getMessage(); |
|
969 | + } |
|
970 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
971 | + return $all[0]['total']; |
|
972 | + } |
|
973 | 973 | |
974 | 974 | public function addStat($type,$cnt,$stats_date,$stats_airline = '',$filter_name = '') { |
975 | 975 | global $globalDBdriver; |
976 | 976 | if ($filter_name == '') $filter_name = $this->filter_name; |
977 | 977 | if ($globalDBdriver == 'mysql') { |
978 | 978 | $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"; |
979 | - } else { |
|
979 | + } else { |
|
980 | 980 | $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);"; |
981 | 981 | } |
982 | - $query_values = array(':type' => $type,':cnt' => $cnt,':stats_date' => $stats_date, ':stats_airline' => $stats_airline,':filter_name' => $filter_name); |
|
983 | - try { |
|
984 | - $sth = $this->db->prepare($query); |
|
985 | - $sth->execute($query_values); |
|
986 | - } catch(PDOException $e) { |
|
987 | - return "error : ".$e->getMessage(); |
|
988 | - } |
|
989 | - } |
|
982 | + $query_values = array(':type' => $type,':cnt' => $cnt,':stats_date' => $stats_date, ':stats_airline' => $stats_airline,':filter_name' => $filter_name); |
|
983 | + try { |
|
984 | + $sth = $this->db->prepare($query); |
|
985 | + $sth->execute($query_values); |
|
986 | + } catch(PDOException $e) { |
|
987 | + return "error : ".$e->getMessage(); |
|
988 | + } |
|
989 | + } |
|
990 | 990 | public function updateStat($type,$cnt,$stats_date,$stats_airline = '',$filter_name = '') { |
991 | 991 | global $globalDBdriver; |
992 | 992 | if ($filter_name == '') $filter_name = $this->filter_name; |
993 | 993 | if ($globalDBdriver == 'mysql') { |
994 | 994 | $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"; |
995 | 995 | } else { |
996 | - //$query = "INSERT INTO stats (stats_type,cnt,stats_date) VALUES (:type,:cnt,:stats_date) ON DUPLICATE KEY UPDATE cnt = cnt+:cnt, stats_date = :date"; |
|
996 | + //$query = "INSERT INTO stats (stats_type,cnt,stats_date) VALUES (:type,:cnt,:stats_date) ON DUPLICATE KEY UPDATE cnt = cnt+:cnt, stats_date = :date"; |
|
997 | 997 | $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);"; |
998 | - } |
|
999 | - $query_values = array(':type' => $type,':cnt' => $cnt,':stats_date' => $stats_date,':stats_airline' => $stats_airline,':filter_name' => $filter_name); |
|
1000 | - try { |
|
1001 | - $sth = $this->db->prepare($query); |
|
1002 | - $sth->execute($query_values); |
|
1003 | - } catch(PDOException $e) { |
|
1004 | - return "error : ".$e->getMessage(); |
|
1005 | - } |
|
1006 | - } |
|
1007 | - /* |
|
998 | + } |
|
999 | + $query_values = array(':type' => $type,':cnt' => $cnt,':stats_date' => $stats_date,':stats_airline' => $stats_airline,':filter_name' => $filter_name); |
|
1000 | + try { |
|
1001 | + $sth = $this->db->prepare($query); |
|
1002 | + $sth->execute($query_values); |
|
1003 | + } catch(PDOException $e) { |
|
1004 | + return "error : ".$e->getMessage(); |
|
1005 | + } |
|
1006 | + } |
|
1007 | + /* |
|
1008 | 1008 | public function getStatsSource($date,$stats_type = '') { |
1009 | 1009 | if ($stats_type == '') { |
1010 | 1010 | $query = "SELECT * FROM stats_source WHERE stats_date = :date ORDER BY source_name"; |
@@ -1073,25 +1073,25 @@ discard block |
||
1073 | 1073 | $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"; |
1074 | 1074 | } else { |
1075 | 1075 | $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);"; |
1076 | - } |
|
1077 | - $query_values = array(':data' => $data,':stats_date' => $date,':source_name' => $source_name,':stats_type' => $stats_type); |
|
1078 | - try { |
|
1079 | - $sth = $this->db->prepare($query); |
|
1080 | - $sth->execute($query_values); |
|
1081 | - } catch(PDOException $e) { |
|
1082 | - return "error : ".$e->getMessage(); |
|
1083 | - } |
|
1084 | - } |
|
1085 | - public function addStatFlight($type,$date_name,$cnt,$stats_airline = '',$filter_name = '') { |
|
1086 | - $query = "INSERT INTO stats_flight (stats_type,flight_date,cnt,stats_airline,filter_name) VALUES (:type,:flight_date,:cnt,:stats_airline,:filter_name)"; |
|
1087 | - $query_values = array(':type' => $type,':flight_date' => $date_name,':cnt' => $cnt, ':stats_airline' => $stats_airline,':filter_name' => $filter_name); |
|
1088 | - try { |
|
1089 | - $sth = $this->db->prepare($query); |
|
1090 | - $sth->execute($query_values); |
|
1091 | - } catch(PDOException $e) { |
|
1092 | - return "error : ".$e->getMessage(); |
|
1093 | - } |
|
1094 | - } |
|
1076 | + } |
|
1077 | + $query_values = array(':data' => $data,':stats_date' => $date,':source_name' => $source_name,':stats_type' => $stats_type); |
|
1078 | + try { |
|
1079 | + $sth = $this->db->prepare($query); |
|
1080 | + $sth->execute($query_values); |
|
1081 | + } catch(PDOException $e) { |
|
1082 | + return "error : ".$e->getMessage(); |
|
1083 | + } |
|
1084 | + } |
|
1085 | + public function addStatFlight($type,$date_name,$cnt,$stats_airline = '',$filter_name = '') { |
|
1086 | + $query = "INSERT INTO stats_flight (stats_type,flight_date,cnt,stats_airline,filter_name) VALUES (:type,:flight_date,:cnt,:stats_airline,:filter_name)"; |
|
1087 | + $query_values = array(':type' => $type,':flight_date' => $date_name,':cnt' => $cnt, ':stats_airline' => $stats_airline,':filter_name' => $filter_name); |
|
1088 | + try { |
|
1089 | + $sth = $this->db->prepare($query); |
|
1090 | + $sth->execute($query_values); |
|
1091 | + } catch(PDOException $e) { |
|
1092 | + return "error : ".$e->getMessage(); |
|
1093 | + } |
|
1094 | + } |
|
1095 | 1095 | public function addStatAircraftRegistration($registration,$cnt,$aircraft_icao = '',$airline_icao = '',$filter_name = '',$reset = false) { |
1096 | 1096 | global $globalDBdriver; |
1097 | 1097 | if ($globalDBdriver == 'mysql') { |
@@ -1107,14 +1107,14 @@ discard block |
||
1107 | 1107 | $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);"; |
1108 | 1108 | } |
1109 | 1109 | } |
1110 | - $query_values = array(':aircraft_icao' => $aircraft_icao,':registration' => $registration,':cnt' => $cnt,':stats_airline' => $airline_icao, ':filter_name' => $filter_name); |
|
1111 | - try { |
|
1112 | - $sth = $this->db->prepare($query); |
|
1113 | - $sth->execute($query_values); |
|
1114 | - } catch(PDOException $e) { |
|
1115 | - return "error : ".$e->getMessage(); |
|
1116 | - } |
|
1117 | - } |
|
1110 | + $query_values = array(':aircraft_icao' => $aircraft_icao,':registration' => $registration,':cnt' => $cnt,':stats_airline' => $airline_icao, ':filter_name' => $filter_name); |
|
1111 | + try { |
|
1112 | + $sth = $this->db->prepare($query); |
|
1113 | + $sth->execute($query_values); |
|
1114 | + } catch(PDOException $e) { |
|
1115 | + return "error : ".$e->getMessage(); |
|
1116 | + } |
|
1117 | + } |
|
1118 | 1118 | public function addStatCallsign($callsign_icao,$cnt,$airline_icao = '', $filter_name = '', $reset = false) { |
1119 | 1119 | global $globalDBdriver; |
1120 | 1120 | if ($globalDBdriver == 'mysql') { |
@@ -1130,14 +1130,14 @@ discard block |
||
1130 | 1130 | $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);"; |
1131 | 1131 | } |
1132 | 1132 | } |
1133 | - $query_values = array(':callsign_icao' => $callsign_icao,':airline_icao' => $airline_icao,':cnt' => $cnt, ':filter_name' => $filter_name); |
|
1134 | - try { |
|
1135 | - $sth = $this->db->prepare($query); |
|
1136 | - $sth->execute($query_values); |
|
1137 | - } catch(PDOException $e) { |
|
1138 | - return "error : ".$e->getMessage(); |
|
1139 | - } |
|
1140 | - } |
|
1133 | + $query_values = array(':callsign_icao' => $callsign_icao,':airline_icao' => $airline_icao,':cnt' => $cnt, ':filter_name' => $filter_name); |
|
1134 | + try { |
|
1135 | + $sth = $this->db->prepare($query); |
|
1136 | + $sth->execute($query_values); |
|
1137 | + } catch(PDOException $e) { |
|
1138 | + return "error : ".$e->getMessage(); |
|
1139 | + } |
|
1140 | + } |
|
1141 | 1141 | public function addStatCountry($iso2,$iso3,$name,$cnt,$filter_name = '',$reset = false) { |
1142 | 1142 | global $globalDBdriver; |
1143 | 1143 | if ($globalDBdriver == 'mysql') { |
@@ -1153,14 +1153,14 @@ discard block |
||
1153 | 1153 | $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);"; |
1154 | 1154 | } |
1155 | 1155 | } |
1156 | - $query_values = array(':iso2' => $iso2,':iso3' => $iso3,':name' => $name,':cnt' => $cnt,':filter_name' => $filter_name); |
|
1157 | - try { |
|
1158 | - $sth = $this->db->prepare($query); |
|
1159 | - $sth->execute($query_values); |
|
1160 | - } catch(PDOException $e) { |
|
1161 | - return "error : ".$e->getMessage(); |
|
1162 | - } |
|
1163 | - } |
|
1156 | + $query_values = array(':iso2' => $iso2,':iso3' => $iso3,':name' => $name,':cnt' => $cnt,':filter_name' => $filter_name); |
|
1157 | + try { |
|
1158 | + $sth = $this->db->prepare($query); |
|
1159 | + $sth->execute($query_values); |
|
1160 | + } catch(PDOException $e) { |
|
1161 | + return "error : ".$e->getMessage(); |
|
1162 | + } |
|
1163 | + } |
|
1164 | 1164 | public function addStatAircraft($aircraft_icao,$cnt,$aircraft_name = '',$aircraft_manufacturer = '', $airline_icao = '', $filter_name = '', $reset = false) { |
1165 | 1165 | global $globalDBdriver; |
1166 | 1166 | if ($globalDBdriver == 'mysql') { |
@@ -1176,14 +1176,14 @@ discard block |
||
1176 | 1176 | $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);"; |
1177 | 1177 | } |
1178 | 1178 | } |
1179 | - $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); |
|
1180 | - try { |
|
1181 | - $sth = $this->db->prepare($query); |
|
1182 | - $sth->execute($query_values); |
|
1183 | - } catch(PDOException $e) { |
|
1184 | - return "error : ".$e->getMessage(); |
|
1185 | - } |
|
1186 | - } |
|
1179 | + $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); |
|
1180 | + try { |
|
1181 | + $sth = $this->db->prepare($query); |
|
1182 | + $sth->execute($query_values); |
|
1183 | + } catch(PDOException $e) { |
|
1184 | + return "error : ".$e->getMessage(); |
|
1185 | + } |
|
1186 | + } |
|
1187 | 1187 | public function addStatAirline($airline_icao,$cnt,$airline_name = '',$filter_name = '', $reset = false) { |
1188 | 1188 | global $globalDBdriver; |
1189 | 1189 | if ($globalDBdriver == 'mysql') { |
@@ -1199,14 +1199,14 @@ discard block |
||
1199 | 1199 | $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);"; |
1200 | 1200 | } |
1201 | 1201 | } |
1202 | - $query_values = array(':airline_icao' => $airline_icao,':airline_name' => $airline_name,':cnt' => $cnt,':filter_name' => $filter_name); |
|
1203 | - try { |
|
1204 | - $sth = $this->db->prepare($query); |
|
1205 | - $sth->execute($query_values); |
|
1206 | - } catch(PDOException $e) { |
|
1207 | - return "error : ".$e->getMessage(); |
|
1208 | - } |
|
1209 | - } |
|
1202 | + $query_values = array(':airline_icao' => $airline_icao,':airline_name' => $airline_name,':cnt' => $cnt,':filter_name' => $filter_name); |
|
1203 | + try { |
|
1204 | + $sth = $this->db->prepare($query); |
|
1205 | + $sth->execute($query_values); |
|
1206 | + } catch(PDOException $e) { |
|
1207 | + return "error : ".$e->getMessage(); |
|
1208 | + } |
|
1209 | + } |
|
1210 | 1210 | public function addStatOwner($owner_name,$cnt,$stats_airline = '', $filter_name = '', $reset = false) { |
1211 | 1211 | global $globalDBdriver; |
1212 | 1212 | if ($globalDBdriver == 'mysql') { |
@@ -1222,14 +1222,14 @@ discard block |
||
1222 | 1222 | $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);"; |
1223 | 1223 | } |
1224 | 1224 | } |
1225 | - $query_values = array(':owner_name' => $owner_name,':cnt' => $cnt,':stats_airline' => $stats_airline,':filter_name' => $filter_name); |
|
1226 | - try { |
|
1227 | - $sth = $this->db->prepare($query); |
|
1228 | - $sth->execute($query_values); |
|
1229 | - } catch(PDOException $e) { |
|
1230 | - return "error : ".$e->getMessage(); |
|
1231 | - } |
|
1232 | - } |
|
1225 | + $query_values = array(':owner_name' => $owner_name,':cnt' => $cnt,':stats_airline' => $stats_airline,':filter_name' => $filter_name); |
|
1226 | + try { |
|
1227 | + $sth = $this->db->prepare($query); |
|
1228 | + $sth->execute($query_values); |
|
1229 | + } catch(PDOException $e) { |
|
1230 | + return "error : ".$e->getMessage(); |
|
1231 | + } |
|
1232 | + } |
|
1233 | 1233 | public function addStatPilot($pilot_id,$cnt,$pilot_name,$stats_airline = '',$filter_name = '',$format_source = '',$reset = false) { |
1234 | 1234 | global $globalDBdriver; |
1235 | 1235 | if ($globalDBdriver == 'mysql') { |
@@ -1245,14 +1245,14 @@ discard block |
||
1245 | 1245 | $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);"; |
1246 | 1246 | } |
1247 | 1247 | } |
1248 | - $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); |
|
1249 | - try { |
|
1250 | - $sth = $this->db->prepare($query); |
|
1251 | - $sth->execute($query_values); |
|
1252 | - } catch(PDOException $e) { |
|
1253 | - return "error : ".$e->getMessage(); |
|
1254 | - } |
|
1255 | - } |
|
1248 | + $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); |
|
1249 | + try { |
|
1250 | + $sth = $this->db->prepare($query); |
|
1251 | + $sth->execute($query_values); |
|
1252 | + } catch(PDOException $e) { |
|
1253 | + return "error : ".$e->getMessage(); |
|
1254 | + } |
|
1255 | + } |
|
1256 | 1256 | public function addStatDepartureAirports($airport_icao,$airport_name,$airport_city,$airport_country,$departure,$airline_icao = '',$filter_name = '',$reset = false) { |
1257 | 1257 | global $globalDBdriver; |
1258 | 1258 | if ($airport_icao != '') { |
@@ -1276,8 +1276,8 @@ discard block |
||
1276 | 1276 | } catch(PDOException $e) { |
1277 | 1277 | return "error : ".$e->getMessage(); |
1278 | 1278 | } |
1279 | - } |
|
1280 | - } |
|
1279 | + } |
|
1280 | + } |
|
1281 | 1281 | public function addStatDepartureAirportsDaily($date,$airport_icao,$airport_name,$airport_city,$airport_country,$departure,$airline_icao = '',$filter_name = '') { |
1282 | 1282 | global $globalDBdriver; |
1283 | 1283 | if ($airport_icao != '') { |
@@ -1293,8 +1293,8 @@ discard block |
||
1293 | 1293 | } catch(PDOException $e) { |
1294 | 1294 | return "error : ".$e->getMessage(); |
1295 | 1295 | } |
1296 | - } |
|
1297 | - } |
|
1296 | + } |
|
1297 | + } |
|
1298 | 1298 | public function addStatArrivalAirports($airport_icao,$airport_name,$airport_city,$airport_country,$arrival,$airline_icao = '',$filter_name = '',$reset = false) { |
1299 | 1299 | global $globalDBdriver; |
1300 | 1300 | if ($airport_icao != '') { |
@@ -1311,15 +1311,15 @@ discard block |
||
1311 | 1311 | $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);"; |
1312 | 1312 | } |
1313 | 1313 | } |
1314 | - $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); |
|
1314 | + $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); |
|
1315 | 1315 | try { |
1316 | - $sth = $this->db->prepare($query); |
|
1317 | - $sth->execute($query_values); |
|
1318 | - } catch(PDOException $e) { |
|
1319 | - return "error : ".$e->getMessage(); |
|
1320 | - } |
|
1321 | - } |
|
1322 | - } |
|
1316 | + $sth = $this->db->prepare($query); |
|
1317 | + $sth->execute($query_values); |
|
1318 | + } catch(PDOException $e) { |
|
1319 | + return "error : ".$e->getMessage(); |
|
1320 | + } |
|
1321 | + } |
|
1322 | + } |
|
1323 | 1323 | public function addStatArrivalAirportsDaily($date,$airport_icao,$airport_name,$airport_city,$airport_country,$arrival,$airline_icao = '',$filter_name = '') { |
1324 | 1324 | global $globalDBdriver; |
1325 | 1325 | if ($airport_icao != '') { |
@@ -1335,46 +1335,46 @@ discard block |
||
1335 | 1335 | } catch(PDOException $e) { |
1336 | 1336 | return "error : ".$e->getMessage(); |
1337 | 1337 | } |
1338 | - } |
|
1339 | - } |
|
1338 | + } |
|
1339 | + } |
|
1340 | 1340 | |
1341 | 1341 | public function deleteStat($id) { |
1342 | - $query = "DELETE FROM stats WHERE stats_id = :id"; |
|
1343 | - $query_values = array(':id' => $id); |
|
1344 | - try { |
|
1345 | - $sth = $this->db->prepare($query); |
|
1346 | - $sth->execute($query_values); |
|
1347 | - } catch(PDOException $e) { |
|
1348 | - return "error : ".$e->getMessage(); |
|
1349 | - } |
|
1350 | - } |
|
1342 | + $query = "DELETE FROM stats WHERE stats_id = :id"; |
|
1343 | + $query_values = array(':id' => $id); |
|
1344 | + try { |
|
1345 | + $sth = $this->db->prepare($query); |
|
1346 | + $sth->execute($query_values); |
|
1347 | + } catch(PDOException $e) { |
|
1348 | + return "error : ".$e->getMessage(); |
|
1349 | + } |
|
1350 | + } |
|
1351 | 1351 | public function deleteStatFlight($type) { |
1352 | - $query = "DELETE FROM stats_flight WHERE stats_type = :type"; |
|
1353 | - $query_values = array(':type' => $type); |
|
1354 | - try { |
|
1355 | - $sth = $this->db->prepare($query); |
|
1356 | - $sth->execute($query_values); |
|
1357 | - } catch(PDOException $e) { |
|
1358 | - return "error : ".$e->getMessage(); |
|
1359 | - } |
|
1360 | - } |
|
1352 | + $query = "DELETE FROM stats_flight WHERE stats_type = :type"; |
|
1353 | + $query_values = array(':type' => $type); |
|
1354 | + try { |
|
1355 | + $sth = $this->db->prepare($query); |
|
1356 | + $sth->execute($query_values); |
|
1357 | + } catch(PDOException $e) { |
|
1358 | + return "error : ".$e->getMessage(); |
|
1359 | + } |
|
1360 | + } |
|
1361 | 1361 | public function deleteStatAirport($type) { |
1362 | - $query = "DELETE FROM stats_airport WHERE stats_type = :type"; |
|
1363 | - $query_values = array(':type' => $type); |
|
1364 | - try { |
|
1365 | - $sth = $this->db->prepare($query); |
|
1366 | - $sth->execute($query_values); |
|
1367 | - } catch(PDOException $e) { |
|
1368 | - return "error : ".$e->getMessage(); |
|
1369 | - } |
|
1370 | - } |
|
1362 | + $query = "DELETE FROM stats_airport WHERE stats_type = :type"; |
|
1363 | + $query_values = array(':type' => $type); |
|
1364 | + try { |
|
1365 | + $sth = $this->db->prepare($query); |
|
1366 | + $sth->execute($query_values); |
|
1367 | + } catch(PDOException $e) { |
|
1368 | + return "error : ".$e->getMessage(); |
|
1369 | + } |
|
1370 | + } |
|
1371 | 1371 | |
1372 | - public function addOldStats() { |
|
1373 | - global $globalDebug, $globalArchiveMonths, $globalArchive, $globalArchiveYear, $globalDBdriver, $globalStatsFilters,$globalDeleteLastYearStats,$globalStatsReset,$globalStatsResetYear; |
|
1374 | - $Common = new Common(); |
|
1375 | - $Connection = new Connection(); |
|
1376 | - date_default_timezone_set('UTC'); |
|
1377 | - $last_update = $this->getLastStatsUpdate('last_update_stats'); |
|
1372 | + public function addOldStats() { |
|
1373 | + global $globalDebug, $globalArchiveMonths, $globalArchive, $globalArchiveYear, $globalDBdriver, $globalStatsFilters,$globalDeleteLastYearStats,$globalStatsReset,$globalStatsResetYear; |
|
1374 | + $Common = new Common(); |
|
1375 | + $Connection = new Connection(); |
|
1376 | + date_default_timezone_set('UTC'); |
|
1377 | + $last_update = $this->getLastStatsUpdate('last_update_stats'); |
|
1378 | 1378 | if ($globalDebug) echo 'Update stats !'."\n"; |
1379 | 1379 | if (isset($last_update[0]['value'])) { |
1380 | 1380 | $last_update_day = $last_update[0]['value']; |
@@ -1420,24 +1420,24 @@ discard block |
||
1420 | 1420 | if ($globalDebug) echo 'Count all departure airports...'."\n"; |
1421 | 1421 | $pall = $Spotter->countAllDepartureAirports(false,0,$last_update_day); |
1422 | 1422 | if ($globalDebug) echo 'Count all detected departure airports...'."\n"; |
1423 | - $dall = $Spotter->countAllDetectedDepartureAirports(false,0,$last_update_day); |
|
1423 | + $dall = $Spotter->countAllDetectedDepartureAirports(false,0,$last_update_day); |
|
1424 | 1424 | if ($globalDebug) echo 'Order departure airports...'."\n"; |
1425 | - $alldata = array(); |
|
1425 | + $alldata = array(); |
|
1426 | 1426 | |
1427 | - foreach ($pall as $value) { |
|
1428 | - $icao = $value['airport_departure_icao']; |
|
1429 | - $alldata[$icao] = $value; |
|
1430 | - } |
|
1431 | - foreach ($dall as $value) { |
|
1432 | - $icao = $value['airport_departure_icao']; |
|
1433 | - if (isset($alldata[$icao])) { |
|
1434 | - $alldata[$icao]['airport_departure_icao_count'] = $alldata[$icao]['airport_departure_icao_count'] + $value['airport_departure_icao_count']; |
|
1435 | - } else $alldata[$icao] = $value; |
|
1436 | - } |
|
1437 | - $count = array(); |
|
1438 | - foreach ($alldata as $key => $row) { |
|
1439 | - $count[$key] = $row['airport_departure_icao_count']; |
|
1440 | - } |
|
1427 | + foreach ($pall as $value) { |
|
1428 | + $icao = $value['airport_departure_icao']; |
|
1429 | + $alldata[$icao] = $value; |
|
1430 | + } |
|
1431 | + foreach ($dall as $value) { |
|
1432 | + $icao = $value['airport_departure_icao']; |
|
1433 | + if (isset($alldata[$icao])) { |
|
1434 | + $alldata[$icao]['airport_departure_icao_count'] = $alldata[$icao]['airport_departure_icao_count'] + $value['airport_departure_icao_count']; |
|
1435 | + } else $alldata[$icao] = $value; |
|
1436 | + } |
|
1437 | + $count = array(); |
|
1438 | + foreach ($alldata as $key => $row) { |
|
1439 | + $count[$key] = $row['airport_departure_icao_count']; |
|
1440 | + } |
|
1441 | 1441 | array_multisort($count,SORT_DESC,$alldata); |
1442 | 1442 | foreach ($alldata as $number) { |
1443 | 1443 | 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); |
@@ -1445,25 +1445,25 @@ discard block |
||
1445 | 1445 | if ($globalDebug) echo 'Count all arrival airports...'."\n"; |
1446 | 1446 | $pall = $Spotter->countAllArrivalAirports(false,0,$last_update_day); |
1447 | 1447 | if ($globalDebug) echo 'Count all detected arrival airports...'."\n"; |
1448 | - $dall = $Spotter->countAllDetectedArrivalAirports(false,0,$last_update_day); |
|
1448 | + $dall = $Spotter->countAllDetectedArrivalAirports(false,0,$last_update_day); |
|
1449 | 1449 | if ($globalDebug) echo 'Order arrival airports...'."\n"; |
1450 | - $alldata = array(); |
|
1451 | - foreach ($pall as $value) { |
|
1452 | - $icao = $value['airport_arrival_icao']; |
|
1453 | - $alldata[$icao] = $value; |
|
1454 | - } |
|
1455 | - foreach ($dall as $value) { |
|
1456 | - $icao = $value['airport_arrival_icao']; |
|
1457 | - if (isset($alldata[$icao])) { |
|
1458 | - $alldata[$icao]['airport_arrival_icao_count'] = $alldata[$icao]['airport_arrival_icao_count'] + $value['airport_arrival_icao_count']; |
|
1459 | - } else $alldata[$icao] = $value; |
|
1460 | - } |
|
1461 | - $count = array(); |
|
1462 | - foreach ($alldata as $key => $row) { |
|
1463 | - $count[$key] = $row['airport_arrival_icao_count']; |
|
1464 | - } |
|
1465 | - array_multisort($count,SORT_DESC,$alldata); |
|
1466 | - foreach ($alldata as $number) { |
|
1450 | + $alldata = array(); |
|
1451 | + foreach ($pall as $value) { |
|
1452 | + $icao = $value['airport_arrival_icao']; |
|
1453 | + $alldata[$icao] = $value; |
|
1454 | + } |
|
1455 | + foreach ($dall as $value) { |
|
1456 | + $icao = $value['airport_arrival_icao']; |
|
1457 | + if (isset($alldata[$icao])) { |
|
1458 | + $alldata[$icao]['airport_arrival_icao_count'] = $alldata[$icao]['airport_arrival_icao_count'] + $value['airport_arrival_icao_count']; |
|
1459 | + } else $alldata[$icao] = $value; |
|
1460 | + } |
|
1461 | + $count = array(); |
|
1462 | + foreach ($alldata as $key => $row) { |
|
1463 | + $count[$key] = $row['airport_arrival_icao_count']; |
|
1464 | + } |
|
1465 | + array_multisort($count,SORT_DESC,$alldata); |
|
1466 | + foreach ($alldata as $number) { |
|
1467 | 1467 | 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); |
1468 | 1468 | } |
1469 | 1469 | if ($Connection->tableExists('countries')) { |
@@ -1523,8 +1523,8 @@ discard block |
||
1523 | 1523 | // $pall = $Spotter->getLast7DaysAirportsDeparture(); |
1524 | 1524 | // $dall = $Spotter->getLast7DaysDetectedAirportsDeparture(); |
1525 | 1525 | $pall = $Spotter->getLast7DaysAirportsDeparture(); |
1526 | - $dall = $Spotter->getLast7DaysDetectedAirportsDeparture(); |
|
1527 | - /* |
|
1526 | + $dall = $Spotter->getLast7DaysDetectedAirportsDeparture(); |
|
1527 | + /* |
|
1528 | 1528 | $alldata = array(); |
1529 | 1529 | foreach ($pall as $value) { |
1530 | 1530 | $icao = $value['departure_airport_icao']; |
@@ -1543,29 +1543,29 @@ discard block |
||
1543 | 1543 | } |
1544 | 1544 | array_multisort($count,SORT_DESC,$alldata); |
1545 | 1545 | */ |
1546 | - foreach ($dall as $value) { |
|
1547 | - $icao = $value['departure_airport_icao']; |
|
1548 | - $ddate = $value['date']; |
|
1549 | - $find = false; |
|
1550 | - foreach ($pall as $pvalue) { |
|
1551 | - if ($pvalue['departure_airport_icao'] == $icao && $pvalue['date'] == $ddate) { |
|
1552 | - $pvalue['departure_airport_count'] = $pvalue['departure_airport_count'] + $value['departure_airport_count']; |
|
1553 | - $find = true; |
|
1554 | - break; |
|
1555 | - } |
|
1556 | - } |
|
1557 | - if ($find === false) { |
|
1558 | - $pall[] = $value; |
|
1559 | - } |
|
1560 | - } |
|
1561 | - $alldata = $pall; |
|
1546 | + foreach ($dall as $value) { |
|
1547 | + $icao = $value['departure_airport_icao']; |
|
1548 | + $ddate = $value['date']; |
|
1549 | + $find = false; |
|
1550 | + foreach ($pall as $pvalue) { |
|
1551 | + if ($pvalue['departure_airport_icao'] == $icao && $pvalue['date'] == $ddate) { |
|
1552 | + $pvalue['departure_airport_count'] = $pvalue['departure_airport_count'] + $value['departure_airport_count']; |
|
1553 | + $find = true; |
|
1554 | + break; |
|
1555 | + } |
|
1556 | + } |
|
1557 | + if ($find === false) { |
|
1558 | + $pall[] = $value; |
|
1559 | + } |
|
1560 | + } |
|
1561 | + $alldata = $pall; |
|
1562 | 1562 | foreach ($alldata as $number) { |
1563 | 1563 | $this->addStatDepartureAirportsDaily($number['date'],$number['departure_airport_icao'],$number['departure_airport_name'],$number['departure_airport_city'],$number['departure_airport_country'],$number['departure_airport_count']); |
1564 | 1564 | } |
1565 | 1565 | echo '...Arrival'."\n"; |
1566 | 1566 | $pall = $Spotter->getLast7DaysAirportsArrival(); |
1567 | - $dall = $Spotter->getLast7DaysDetectedAirportsArrival(); |
|
1568 | - /* |
|
1567 | + $dall = $Spotter->getLast7DaysDetectedAirportsArrival(); |
|
1568 | + /* |
|
1569 | 1569 | $alldata = array(); |
1570 | 1570 | foreach ($pall as $value) { |
1571 | 1571 | $icao = $value['arrival_airport_icao']; |
@@ -1585,22 +1585,22 @@ discard block |
||
1585 | 1585 | */ |
1586 | 1586 | |
1587 | 1587 | |
1588 | - foreach ($dall as $value) { |
|
1589 | - $icao = $value['arrival_airport_icao']; |
|
1590 | - $ddate = $value['date']; |
|
1591 | - $find = false; |
|
1592 | - foreach ($pall as $pvalue) { |
|
1593 | - if ($pvalue['arrival_airport_icao'] == $icao && $pvalue['date'] == $ddate) { |
|
1594 | - $pvalue['arrival_airport_count'] = $pvalue['arrival_airport_count'] + $value['arrival_airport_count']; |
|
1595 | - $find = true; |
|
1596 | - break; |
|
1597 | - } |
|
1598 | - } |
|
1599 | - if ($find === false) { |
|
1600 | - $pall[] = $value; |
|
1601 | - } |
|
1602 | - } |
|
1603 | - $alldata = $pall; |
|
1588 | + foreach ($dall as $value) { |
|
1589 | + $icao = $value['arrival_airport_icao']; |
|
1590 | + $ddate = $value['date']; |
|
1591 | + $find = false; |
|
1592 | + foreach ($pall as $pvalue) { |
|
1593 | + if ($pvalue['arrival_airport_icao'] == $icao && $pvalue['date'] == $ddate) { |
|
1594 | + $pvalue['arrival_airport_count'] = $pvalue['arrival_airport_count'] + $value['arrival_airport_count']; |
|
1595 | + $find = true; |
|
1596 | + break; |
|
1597 | + } |
|
1598 | + } |
|
1599 | + if ($find === false) { |
|
1600 | + $pall[] = $value; |
|
1601 | + } |
|
1602 | + } |
|
1603 | + $alldata = $pall; |
|
1604 | 1604 | foreach ($alldata as $number) { |
1605 | 1605 | $this->addStatArrivalAirportsDaily($number['date'],$number['arrival_airport_icao'],$number['arrival_airport_name'],$number['arrival_airport_city'],$number['arrival_airport_country'],$number['arrival_airport_count']); |
1606 | 1606 | } |
@@ -1667,51 +1667,51 @@ discard block |
||
1667 | 1667 | if ($globalDebug) echo 'Count all departure airports by airlines...'."\n"; |
1668 | 1668 | $pall = $Spotter->countAllDepartureAirportsByAirlines(false,0,$last_update_day); |
1669 | 1669 | if ($globalDebug) echo 'Count all detected departure airports by airlines...'."\n"; |
1670 | - $dall = $Spotter->countAllDetectedDepartureAirportsByAirlines(false,0,$last_update_day); |
|
1670 | + $dall = $Spotter->countAllDetectedDepartureAirportsByAirlines(false,0,$last_update_day); |
|
1671 | 1671 | if ($globalDebug) echo 'Order detected departure airports by airlines...'."\n"; |
1672 | - //$alldata = array(); |
|
1673 | - foreach ($dall as $value) { |
|
1674 | - $icao = $value['airport_departure_icao']; |
|
1675 | - $dicao = $value['airline_icao']; |
|
1676 | - $find = false; |
|
1677 | - foreach ($pall as $pvalue) { |
|
1678 | - if ($pvalue['airport_departure_icao'] == $icao && $pvalue['airline_icao'] = $dicao) { |
|
1679 | - $pvalue['airport_departure_icao_count'] = $pvalue['airport_departure_icao_count'] + $value['airport_departure_icao_count']; |
|
1680 | - $find = true; |
|
1681 | - break; |
|
1682 | - } |
|
1683 | - } |
|
1684 | - if ($find === false) { |
|
1685 | - $pall[] = $value; |
|
1686 | - } |
|
1687 | - } |
|
1688 | - $alldata = $pall; |
|
1672 | + //$alldata = array(); |
|
1673 | + foreach ($dall as $value) { |
|
1674 | + $icao = $value['airport_departure_icao']; |
|
1675 | + $dicao = $value['airline_icao']; |
|
1676 | + $find = false; |
|
1677 | + foreach ($pall as $pvalue) { |
|
1678 | + if ($pvalue['airport_departure_icao'] == $icao && $pvalue['airline_icao'] = $dicao) { |
|
1679 | + $pvalue['airport_departure_icao_count'] = $pvalue['airport_departure_icao_count'] + $value['airport_departure_icao_count']; |
|
1680 | + $find = true; |
|
1681 | + break; |
|
1682 | + } |
|
1683 | + } |
|
1684 | + if ($find === false) { |
|
1685 | + $pall[] = $value; |
|
1686 | + } |
|
1687 | + } |
|
1688 | + $alldata = $pall; |
|
1689 | 1689 | foreach ($alldata as $number) { |
1690 | 1690 | 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); |
1691 | 1691 | } |
1692 | 1692 | if ($globalDebug) echo 'Count all arrival airports by airlines...'."\n"; |
1693 | 1693 | $pall = $Spotter->countAllArrivalAirportsByAirlines(false,0,$last_update_day); |
1694 | 1694 | if ($globalDebug) echo 'Count all detected arrival airports by airlines...'."\n"; |
1695 | - $dall = $Spotter->countAllDetectedArrivalAirportsByAirlines(false,0,$last_update_day); |
|
1695 | + $dall = $Spotter->countAllDetectedArrivalAirportsByAirlines(false,0,$last_update_day); |
|
1696 | 1696 | if ($globalDebug) echo 'Order arrival airports by airlines...'."\n"; |
1697 | - //$alldata = array(); |
|
1698 | - foreach ($dall as $value) { |
|
1699 | - $icao = $value['airport_arrival_icao']; |
|
1700 | - $dicao = $value['airline_icao']; |
|
1701 | - $find = false; |
|
1702 | - foreach ($pall as $pvalue) { |
|
1703 | - if ($pvalue['airport_arrival_icao'] == $icao && $pvalue['airline_icao'] = $dicao) { |
|
1704 | - $pvalue['airport_arrival_icao_count'] = $pvalue['airport_arrival_icao_count'] + $value['airport_arrival_icao_count']; |
|
1705 | - $find = true; |
|
1706 | - break; |
|
1707 | - } |
|
1708 | - } |
|
1709 | - if ($find === false) { |
|
1710 | - $pall[] = $value; |
|
1711 | - } |
|
1712 | - } |
|
1713 | - $alldata = $pall; |
|
1714 | - foreach ($alldata as $number) { |
|
1697 | + //$alldata = array(); |
|
1698 | + foreach ($dall as $value) { |
|
1699 | + $icao = $value['airport_arrival_icao']; |
|
1700 | + $dicao = $value['airline_icao']; |
|
1701 | + $find = false; |
|
1702 | + foreach ($pall as $pvalue) { |
|
1703 | + if ($pvalue['airport_arrival_icao'] == $icao && $pvalue['airline_icao'] = $dicao) { |
|
1704 | + $pvalue['airport_arrival_icao_count'] = $pvalue['airport_arrival_icao_count'] + $value['airport_arrival_icao_count']; |
|
1705 | + $find = true; |
|
1706 | + break; |
|
1707 | + } |
|
1708 | + } |
|
1709 | + if ($find === false) { |
|
1710 | + $pall[] = $value; |
|
1711 | + } |
|
1712 | + } |
|
1713 | + $alldata = $pall; |
|
1714 | + foreach ($alldata as $number) { |
|
1715 | 1715 | 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); |
1716 | 1716 | } |
1717 | 1717 | if ($globalDebug) echo 'Count all flights by months by airlines...'."\n"; |
@@ -1744,47 +1744,47 @@ discard block |
||
1744 | 1744 | } |
1745 | 1745 | if ($globalDebug) echo '...Departure'."\n"; |
1746 | 1746 | $pall = $Spotter->getLast7DaysAirportsDepartureByAirlines(); |
1747 | - $dall = $Spotter->getLast7DaysDetectedAirportsDepartureByAirlines(); |
|
1748 | - foreach ($dall as $value) { |
|
1749 | - $icao = $value['departure_airport_icao']; |
|
1750 | - $airline = $value['airline_icao']; |
|
1751 | - $ddate = $value['date']; |
|
1752 | - $find = false; |
|
1753 | - foreach ($pall as $pvalue) { |
|
1754 | - if ($pvalue['departure_airport_icao'] == $icao && $pvalue['date'] == $ddate && $pvalue['airline_icao'] = $airline) { |
|
1755 | - $pvalue['departure_airport_count'] = $pvalue['departure_airport_count'] + $value['departure_airport_count']; |
|
1756 | - $find = true; |
|
1757 | - break; |
|
1758 | - } |
|
1759 | - } |
|
1760 | - if ($find === false) { |
|
1761 | - $pall[] = $value; |
|
1762 | - } |
|
1763 | - } |
|
1764 | - $alldata = $pall; |
|
1747 | + $dall = $Spotter->getLast7DaysDetectedAirportsDepartureByAirlines(); |
|
1748 | + foreach ($dall as $value) { |
|
1749 | + $icao = $value['departure_airport_icao']; |
|
1750 | + $airline = $value['airline_icao']; |
|
1751 | + $ddate = $value['date']; |
|
1752 | + $find = false; |
|
1753 | + foreach ($pall as $pvalue) { |
|
1754 | + if ($pvalue['departure_airport_icao'] == $icao && $pvalue['date'] == $ddate && $pvalue['airline_icao'] = $airline) { |
|
1755 | + $pvalue['departure_airport_count'] = $pvalue['departure_airport_count'] + $value['departure_airport_count']; |
|
1756 | + $find = true; |
|
1757 | + break; |
|
1758 | + } |
|
1759 | + } |
|
1760 | + if ($find === false) { |
|
1761 | + $pall[] = $value; |
|
1762 | + } |
|
1763 | + } |
|
1764 | + $alldata = $pall; |
|
1765 | 1765 | foreach ($alldata as $number) { |
1766 | 1766 | $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']); |
1767 | 1767 | } |
1768 | 1768 | if ($globalDebug) echo '...Arrival'."\n"; |
1769 | 1769 | $pall = $Spotter->getLast7DaysAirportsArrivalByAirlines(); |
1770 | - $dall = $Spotter->getLast7DaysDetectedAirportsArrivalByAirlines(); |
|
1771 | - foreach ($dall as $value) { |
|
1772 | - $icao = $value['arrival_airport_icao']; |
|
1773 | - $airline = $value['airline_icao']; |
|
1774 | - $ddate = $value['date']; |
|
1775 | - $find = false; |
|
1776 | - foreach ($pall as $pvalue) { |
|
1777 | - if ($pvalue['arrival_airport_icao'] == $icao && $pvalue['date'] == $ddate && $pvalue['airline_icao'] == $airline) { |
|
1778 | - $pvalue['arrival_airport_count'] = $pvalue['arrival_airport_count'] + $value['arrival_airport_count']; |
|
1779 | - $find = true; |
|
1780 | - break; |
|
1781 | - } |
|
1782 | - } |
|
1783 | - if ($find === false) { |
|
1784 | - $pall[] = $value; |
|
1785 | - } |
|
1786 | - } |
|
1787 | - $alldata = $pall; |
|
1770 | + $dall = $Spotter->getLast7DaysDetectedAirportsArrivalByAirlines(); |
|
1771 | + foreach ($dall as $value) { |
|
1772 | + $icao = $value['arrival_airport_icao']; |
|
1773 | + $airline = $value['airline_icao']; |
|
1774 | + $ddate = $value['date']; |
|
1775 | + $find = false; |
|
1776 | + foreach ($pall as $pvalue) { |
|
1777 | + if ($pvalue['arrival_airport_icao'] == $icao && $pvalue['date'] == $ddate && $pvalue['airline_icao'] == $airline) { |
|
1778 | + $pvalue['arrival_airport_count'] = $pvalue['arrival_airport_count'] + $value['arrival_airport_count']; |
|
1779 | + $find = true; |
|
1780 | + break; |
|
1781 | + } |
|
1782 | + } |
|
1783 | + if ($find === false) { |
|
1784 | + $pall[] = $value; |
|
1785 | + } |
|
1786 | + } |
|
1787 | + $alldata = $pall; |
|
1788 | 1788 | foreach ($alldata as $number) { |
1789 | 1789 | $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']); |
1790 | 1790 | } |
@@ -1855,44 +1855,44 @@ discard block |
||
1855 | 1855 | $this->addStatPilot($number['pilot_id'],$number['pilot_count'],$number['pilot_name'],'',$filter_name,$number['format_source'],$reset); |
1856 | 1856 | } |
1857 | 1857 | $pall = $Spotter->countAllDepartureAirports(false,0,$last_update_day,$filter); |
1858 | - $dall = $Spotter->countAllDetectedDepartureAirports(false,0,$last_update_day,$filter); |
|
1859 | - $alldata = array(); |
|
1860 | - foreach ($pall as $value) { |
|
1861 | - $icao = $value['airport_departure_icao']; |
|
1862 | - $alldata[$icao] = $value; |
|
1863 | - } |
|
1864 | - foreach ($dall as $value) { |
|
1865 | - $icao = $value['airport_departure_icao']; |
|
1866 | - if (isset($alldata[$icao])) { |
|
1867 | - $alldata[$icao]['airport_departure_icao_count'] = $alldata[$icao]['airport_departure_icao_count'] + $value['airport_departure_icao_count']; |
|
1868 | - } else $alldata[$icao] = $value; |
|
1869 | - } |
|
1870 | - $count = array(); |
|
1871 | - foreach ($alldata as $key => $row) { |
|
1872 | - $count[$key] = $row['airport_departure_icao_count']; |
|
1873 | - } |
|
1858 | + $dall = $Spotter->countAllDetectedDepartureAirports(false,0,$last_update_day,$filter); |
|
1859 | + $alldata = array(); |
|
1860 | + foreach ($pall as $value) { |
|
1861 | + $icao = $value['airport_departure_icao']; |
|
1862 | + $alldata[$icao] = $value; |
|
1863 | + } |
|
1864 | + foreach ($dall as $value) { |
|
1865 | + $icao = $value['airport_departure_icao']; |
|
1866 | + if (isset($alldata[$icao])) { |
|
1867 | + $alldata[$icao]['airport_departure_icao_count'] = $alldata[$icao]['airport_departure_icao_count'] + $value['airport_departure_icao_count']; |
|
1868 | + } else $alldata[$icao] = $value; |
|
1869 | + } |
|
1870 | + $count = array(); |
|
1871 | + foreach ($alldata as $key => $row) { |
|
1872 | + $count[$key] = $row['airport_departure_icao_count']; |
|
1873 | + } |
|
1874 | 1874 | array_multisort($count,SORT_DESC,$alldata); |
1875 | 1875 | foreach ($alldata as $number) { |
1876 | - 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); |
|
1876 | + 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); |
|
1877 | 1877 | } |
1878 | 1878 | $pall = $Spotter->countAllArrivalAirports(false,0,$last_update_day,false,$filter); |
1879 | - $dall = $Spotter->countAllDetectedArrivalAirports(false,0,$last_update_day,false,$filter); |
|
1879 | + $dall = $Spotter->countAllDetectedArrivalAirports(false,0,$last_update_day,false,$filter); |
|
1880 | 1880 | $alldata = array(); |
1881 | - foreach ($pall as $value) { |
|
1882 | - $icao = $value['airport_arrival_icao']; |
|
1883 | - $alldata[$icao] = $value; |
|
1884 | - } |
|
1885 | - foreach ($dall as $value) { |
|
1886 | - $icao = $value['airport_arrival_icao']; |
|
1887 | - if (isset($alldata[$icao])) { |
|
1888 | - $alldata[$icao]['airport_arrival_icao_count'] = $alldata[$icao]['airport_arrival_icao_count'] + $value['airport_arrival_icao_count']; |
|
1889 | - } else $alldata[$icao] = $value; |
|
1890 | - } |
|
1891 | - $count = array(); |
|
1892 | - foreach ($alldata as $key => $row) { |
|
1893 | - $count[$key] = $row['airport_arrival_icao_count']; |
|
1894 | - } |
|
1895 | - array_multisort($count,SORT_DESC,$alldata); |
|
1881 | + foreach ($pall as $value) { |
|
1882 | + $icao = $value['airport_arrival_icao']; |
|
1883 | + $alldata[$icao] = $value; |
|
1884 | + } |
|
1885 | + foreach ($dall as $value) { |
|
1886 | + $icao = $value['airport_arrival_icao']; |
|
1887 | + if (isset($alldata[$icao])) { |
|
1888 | + $alldata[$icao]['airport_arrival_icao_count'] = $alldata[$icao]['airport_arrival_icao_count'] + $value['airport_arrival_icao_count']; |
|
1889 | + } else $alldata[$icao] = $value; |
|
1890 | + } |
|
1891 | + $count = array(); |
|
1892 | + foreach ($alldata as $key => $row) { |
|
1893 | + $count[$key] = $row['airport_arrival_icao_count']; |
|
1894 | + } |
|
1895 | + array_multisort($count,SORT_DESC,$alldata); |
|
1896 | 1896 | foreach ($alldata as $number) { |
1897 | 1897 | 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); |
1898 | 1898 | } |
@@ -1925,45 +1925,45 @@ discard block |
||
1925 | 1925 | } |
1926 | 1926 | echo '...Departure'."\n"; |
1927 | 1927 | $pall = $Spotter->getLast7DaysAirportsDeparture('',$filter); |
1928 | - $dall = $Spotter->getLast7DaysDetectedAirportsDeparture('',$filter); |
|
1928 | + $dall = $Spotter->getLast7DaysDetectedAirportsDeparture('',$filter); |
|
1929 | 1929 | foreach ($dall as $value) { |
1930 | - $icao = $value['departure_airport_icao']; |
|
1931 | - $ddate = $value['date']; |
|
1932 | - $find = false; |
|
1933 | - foreach ($pall as $pvalue) { |
|
1934 | - if ($pvalue['departure_airport_icao'] == $icao && $pvalue['date'] == $ddate) { |
|
1935 | - $pvalue['departure_airport_count'] = $pvalue['departure_airport_count'] + $value['departure_airport_count']; |
|
1936 | - $find = true; |
|
1937 | - break; |
|
1938 | - } |
|
1939 | - } |
|
1940 | - if ($find === false) { |
|
1941 | - $pall[] = $value; |
|
1942 | - } |
|
1943 | - } |
|
1944 | - $alldata = $pall; |
|
1930 | + $icao = $value['departure_airport_icao']; |
|
1931 | + $ddate = $value['date']; |
|
1932 | + $find = false; |
|
1933 | + foreach ($pall as $pvalue) { |
|
1934 | + if ($pvalue['departure_airport_icao'] == $icao && $pvalue['date'] == $ddate) { |
|
1935 | + $pvalue['departure_airport_count'] = $pvalue['departure_airport_count'] + $value['departure_airport_count']; |
|
1936 | + $find = true; |
|
1937 | + break; |
|
1938 | + } |
|
1939 | + } |
|
1940 | + if ($find === false) { |
|
1941 | + $pall[] = $value; |
|
1942 | + } |
|
1943 | + } |
|
1944 | + $alldata = $pall; |
|
1945 | 1945 | foreach ($alldata as $number) { |
1946 | 1946 | $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); |
1947 | 1947 | } |
1948 | 1948 | echo '...Arrival'."\n"; |
1949 | 1949 | $pall = $Spotter->getLast7DaysAirportsArrival('',$filter); |
1950 | - $dall = $Spotter->getLast7DaysDetectedAirportsArrival('',$filter); |
|
1950 | + $dall = $Spotter->getLast7DaysDetectedAirportsArrival('',$filter); |
|
1951 | 1951 | foreach ($dall as $value) { |
1952 | 1952 | $icao = $value['arrival_airport_icao']; |
1953 | 1953 | $ddate = $value['date']; |
1954 | - $find = false; |
|
1954 | + $find = false; |
|
1955 | 1955 | foreach ($pall as $pvalue) { |
1956 | - if ($pvalue['arrival_airport_icao'] == $icao && $pvalue['date'] == $ddate) { |
|
1957 | - $pvalue['arrival_airport_count'] = $pvalue['arrival_airport_count'] + $value['arrival_airport_count']; |
|
1958 | - $find = true; |
|
1959 | - break; |
|
1960 | - } |
|
1961 | - } |
|
1962 | - if ($find === false) { |
|
1963 | - $pall[] = $value; |
|
1964 | - } |
|
1965 | - } |
|
1966 | - $alldata = $pall; |
|
1956 | + if ($pvalue['arrival_airport_icao'] == $icao && $pvalue['date'] == $ddate) { |
|
1957 | + $pvalue['arrival_airport_count'] = $pvalue['arrival_airport_count'] + $value['arrival_airport_count']; |
|
1958 | + $find = true; |
|
1959 | + break; |
|
1960 | + } |
|
1961 | + } |
|
1962 | + if ($find === false) { |
|
1963 | + $pall[] = $value; |
|
1964 | + } |
|
1965 | + } |
|
1966 | + $alldata = $pall; |
|
1967 | 1967 | foreach ($alldata as $number) { |
1968 | 1968 | $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); |
1969 | 1969 | } |