@@ -9,8 +9,10 @@ discard block |
||
| 9 | 9 | |
| 10 | 10 | $airline_icao = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
| 11 | 11 | if ($airline_icao == '' && isset($globalFilter)) { |
| 12 | - if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
| 13 | -} |
|
| 12 | + if (isset($globalFilter['airline'])) { |
|
| 13 | + $airline_icao = $globalFilter['airline'][0]; |
|
| 14 | + } |
|
| 15 | + } |
|
| 14 | 16 | |
| 15 | 17 | ?> |
| 16 | 18 | <script type="text/javascript" src="https://www.google.com/jsapi"></script> |
@@ -28,7 +30,9 @@ discard block |
||
| 28 | 30 | if (isset($last_update[0]['value'])) { |
| 29 | 31 | date_default_timezone_set('UTC'); |
| 30 | 32 | $lastupdate = strtotime($last_update[0]['value']); |
| 31 | - if (isset($globalTimezone) && $globalTimezone != '') date_default_timezone_set($globalTimezone); |
|
| 33 | + if (isset($globalTimezone) && $globalTimezone != '') { |
|
| 34 | + date_default_timezone_set($globalTimezone); |
|
| 35 | + } |
|
| 32 | 36 | print '<i>Last update: '.date('Y-m-d G:i:s',$lastupdate).'</i>'; |
| 33 | 37 | } |
| 34 | 38 | ?> |
@@ -81,8 +85,9 @@ discard block |
||
| 81 | 85 | <h2><?php echo _("Top 10 Most Common Aircraft Type"); ?></h2> |
| 82 | 86 | <?php |
| 83 | 87 | $aircraft_array = $Stats->countAllAircraftTypes(true,$airline_icao); |
| 84 | - if (count($aircraft_array) == 0) print _("No data available"); |
|
| 85 | - else { |
|
| 88 | + if (count($aircraft_array) == 0) { |
|
| 89 | + print _("No data available"); |
|
| 90 | + } else { |
|
| 86 | 91 | |
| 87 | 92 | print '<div id="chart1" class="chart" width="100%"></div> |
| 88 | 93 | <script> |
@@ -127,8 +132,9 @@ discard block |
||
| 127 | 132 | <h2><?php echo _("Top 10 Most Common Airline"); ?></h2> |
| 128 | 133 | <?php |
| 129 | 134 | $airline_array = $Stats->countAllAirlines(); |
| 130 | - if (count($airline_array) == 0) print _("No data available"); |
|
| 131 | - else { |
|
| 135 | + if (count($airline_array) == 0) { |
|
| 136 | + print _("No data available"); |
|
| 137 | + } else { |
|
| 132 | 138 | |
| 133 | 139 | print '<div id="chart2" class="chart" width="100%"></div> |
| 134 | 140 | <script> |
@@ -189,8 +195,9 @@ discard block |
||
| 189 | 195 | <h2><?php echo _("Top 10 Most Common Pilots"); ?></h2> |
| 190 | 196 | <?php |
| 191 | 197 | $pilot_array = $Stats->countAllPilots(true,$airline_icao); |
| 192 | - if (count($pilot_array) == 0) print _("No data available"); |
|
| 193 | - else { |
|
| 198 | + if (count($pilot_array) == 0) { |
|
| 199 | + print _("No data available"); |
|
| 200 | + } else { |
|
| 194 | 201 | |
| 195 | 202 | print '<div id="chart7" class="chart" width="100%"></div> |
| 196 | 203 | <script> |
@@ -236,8 +243,9 @@ discard block |
||
| 236 | 243 | <h2><?php echo _("Top 10 Most Common Owners"); ?></h2> |
| 237 | 244 | <?php |
| 238 | 245 | $owner_array = $Stats->countAllOwners(true,$airline_icao); |
| 239 | - if (count($owner_array) == 0) print _("No data available"); |
|
| 240 | - else { |
|
| 246 | + if (count($owner_array) == 0) { |
|
| 247 | + print _("No data available"); |
|
| 248 | + } else { |
|
| 241 | 249 | |
| 242 | 250 | print '<div id="chart7" class="chart" width="100%"></div> |
| 243 | 251 | <script> |
@@ -286,8 +294,9 @@ discard block |
||
| 286 | 294 | <h2><?php echo _("Top 20 Most Common Country a Flight was Over"); ?></h2> |
| 287 | 295 | <?php |
| 288 | 296 | //$flightover_array = $Stats->countAllFlightOverCountries(); |
| 289 | - if (count($flightover_array) == 0) print _("No data available"); |
|
| 290 | - else { |
|
| 297 | + if (count($flightover_array) == 0) { |
|
| 298 | + print _("No data available"); |
|
| 299 | + } else { |
|
| 291 | 300 | |
| 292 | 301 | print '<div id="chart10" class="chart" width="100%"></div> |
| 293 | 302 | <script> |
@@ -339,8 +348,9 @@ discard block |
||
| 339 | 348 | <h2><?php echo _("Top 10 Most Common Departure Airports"); ?></h2> |
| 340 | 349 | <?php |
| 341 | 350 | $airport_airport_array = $Stats->countAllDepartureAirports($airline_icao); |
| 342 | - if (count($airport_airport_array) == 0) print _("No data available"); |
|
| 343 | - else { |
|
| 351 | + if (count($airport_airport_array) == 0) { |
|
| 352 | + print _("No data available"); |
|
| 353 | + } else { |
|
| 344 | 354 | |
| 345 | 355 | print '<div id="chart3" class="chart" width="100%"></div> |
| 346 | 356 | <script> |
@@ -389,8 +399,9 @@ discard block |
||
| 389 | 399 | <h2><?php echo _("Top 10 Most Common Arrival Airports"); ?></h2> |
| 390 | 400 | <?php |
| 391 | 401 | $airport_airport_array2 = $Stats->countAllArrivalAirports($airline_icao); |
| 392 | - if (count($airport_airport_array2) == 0) print _("No data available"); |
|
| 393 | - else { |
|
| 402 | + if (count($airport_airport_array2) == 0) { |
|
| 403 | + print _("No data available"); |
|
| 404 | + } else { |
|
| 394 | 405 | |
| 395 | 406 | print '<div id="chart4" class="chart" width="100%"></div> |
| 396 | 407 | <script> |
@@ -441,8 +452,9 @@ discard block |
||
| 441 | 452 | <h2><?php echo _("Busiest Months of the last 12 Months"); ?></h2> |
| 442 | 453 | <?php |
| 443 | 454 | $year_array = $Stats->countAllMonthsLastYear($airline_icao); |
| 444 | - if (count($year_array) == 0) print _("No data available"); |
|
| 445 | - else { |
|
| 455 | + if (count($year_array) == 0) { |
|
| 456 | + print _("No data available"); |
|
| 457 | + } else { |
|
| 446 | 458 | print '<div id="chart8" class="chart" width="100%"></div> |
| 447 | 459 | <script> |
| 448 | 460 | google.load("visualization", "1", {packages:["corechart"]}); |
@@ -487,8 +499,9 @@ discard block |
||
| 487 | 499 | <h2><?php echo _("Busiest Day in the last Month"); ?></h2> |
| 488 | 500 | <?php |
| 489 | 501 | $month_array = $Stats->countAllDatesLastMonth($airline_icao); |
| 490 | - if (count($month_array) == 0) print _("No data available"); |
|
| 491 | - else { |
|
| 502 | + if (count($month_array) == 0) { |
|
| 503 | + print _("No data available"); |
|
| 504 | + } else { |
|
| 492 | 505 | print '<div id="chart9" class="chart" width="100%"></div> |
| 493 | 506 | <script> |
| 494 | 507 | google.load("visualization", "1", {packages:["corechart"]}); |
@@ -533,8 +546,9 @@ discard block |
||
| 533 | 546 | <h2><?php echo _("Busiest Day in the last 7 Days"); ?></h2> |
| 534 | 547 | <?php |
| 535 | 548 | $date_array = $Stats->countAllDatesLast7Days($airline_icao); |
| 536 | - if (empty($date_array)) print _("No data available"); |
|
| 537 | - else { |
|
| 549 | + if (empty($date_array)) { |
|
| 550 | + print _("No data available"); |
|
| 551 | + } else { |
|
| 538 | 552 | print '<div id="chart5" class="chart" width="100%"></div> |
| 539 | 553 | <script> |
| 540 | 554 | google.load("visualization", "1", {packages:["corechart"]}); |
@@ -580,8 +594,9 @@ discard block |
||
| 580 | 594 | <h2><?php echo _("Busiest Time of the Day"); ?></h2> |
| 581 | 595 | <?php |
| 582 | 596 | $hour_array = $Stats->countAllHours('hour',$airline_icao); |
| 583 | - if (empty($hour_array)) print _("No data available"); |
|
| 584 | - else { |
|
| 597 | + if (empty($hour_array)) { |
|
| 598 | + print _("No data available"); |
|
| 599 | + } else { |
|
| 585 | 600 | |
| 586 | 601 | print '<div id="chart6" class="chart" width="100%"></div> |
| 587 | 602 | <script> |
@@ -649,8 +664,11 @@ discard block |
||
| 649 | 664 | $distance = $distance; |
| 650 | 665 | $unit = 'km'; |
| 651 | 666 | } |
| 652 | - if (!isset($polar_data)) $polar_data = '{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
| 653 | - else $polar_data = $polar_data.',{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
| 667 | + if (!isset($polar_data)) { |
|
| 668 | + $polar_data = '{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
| 669 | + } else { |
|
| 670 | + $polar_data = $polar_data.',{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
| 671 | + } |
|
| 654 | 672 | } |
| 655 | 673 | ?> |
| 656 | 674 | <div class="col-md-6"> |
@@ -697,8 +715,11 @@ discard block |
||
| 697 | 715 | foreach ($msg as $eachmsg) { |
| 698 | 716 | //$eachmsg = $msg[0]; |
| 699 | 717 | $data = $eachmsg['source_data']; |
| 700 | - if ($data > 500) $max = (round(($data+100)/100))*100; |
|
| 701 | - else $max = 500; |
|
| 718 | + if ($data > 500) { |
|
| 719 | + $max = (round(($data+100)/100))*100; |
|
| 720 | + } else { |
|
| 721 | + $max = 500; |
|
| 722 | + } |
|
| 702 | 723 | ?> |
| 703 | 724 | <div id="msg-<?php print str_replace(' ','_',strtolower($eachmsg['source_name'])); ?>" class="col-md-4"></div> |
| 704 | 725 | <script> |
@@ -37,11 +37,11 @@ discard block |
||
| 37 | 37 | if (isset($globalTimezone) && $globalTimezone != '') date_default_timezone_set($globalTimezone); |
| 38 | 38 | print '<i>Last update: '.date('Y-m-d G:i:s',$lastupdate).'</i>'; |
| 39 | 39 | } |
| 40 | - ?> |
|
| 40 | + ?> |
|
| 41 | 41 | </div> |
| 42 | 42 | <?php |
| 43 | 43 | // print_r($Stats->getAllAirlineNames()); |
| 44 | - ?> |
|
| 44 | + ?> |
|
| 45 | 45 | <?php include('statistics-sub-menu.php'); ?> |
| 46 | 46 | <div class="row global-stats"> |
| 47 | 47 | <div class="col-md-2"><span class="type"><?php echo _("Flights"); ?></span><span><?php print number_format($Stats->countOverallFlights($airline_icao)); ?></span></div> |
@@ -49,23 +49,23 @@ discard block |
||
| 49 | 49 | <div class="col-md-2"><span class="type"><?php echo _("Arrivals seen"); ?></span><span><?php print number_format($Stats->countOverallArrival($airline_icao)); ?></span></div> |
| 50 | 50 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
| 51 | 51 | <?php |
| 52 | - if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) { |
|
| 52 | + if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) { |
|
| 53 | 53 | ?> |
| 54 | 54 | <div class="col-md-2"><span class="type"><?php echo _("Pilots"); ?></span><span><?php print number_format($Stats->countOverallPilots($airline_icao)); ?></span></div> |
| 55 | 55 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
| 56 | 56 | <?php |
| 57 | - } else { |
|
| 58 | - ?> |
|
| 57 | + } else { |
|
| 58 | + ?> |
|
| 59 | 59 | <div class="col-md-2"><span class="type"><?php echo _("Owners"); ?></span><span><?php print number_format($Stats->countOverallOwners($airline_icao)); ?></span></div> |
| 60 | 60 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
| 61 | 61 | <?php |
| 62 | - } |
|
| 63 | - ?> |
|
| 62 | + } |
|
| 63 | + ?> |
|
| 64 | 64 | <div class="col-md-2"><span class="type"><?php echo _("Aircrafts"); ?></span><span><?php print number_format($Stats->countOverallAircrafts($airline_icao)); ?></span></div> |
| 65 | 65 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
| 66 | 66 | <?php |
| 67 | - if ($airline_icao == '') { |
|
| 68 | - ?> |
|
| 67 | + if ($airline_icao == '') { |
|
| 68 | + ?> |
|
| 69 | 69 | <div class="col-md-2"><span class="type"><?php echo _("Airlines"); ?></span><span><?php print number_format($Stats->countOverallAirlines()); ?></span></div> |
| 70 | 70 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
| 71 | 71 | <?php |
@@ -86,25 +86,25 @@ discard block |
||
| 86 | 86 | <div class="col-md-6"> |
| 87 | 87 | <h2><?php echo _("Top 10 Most Common Aircraft Type"); ?></h2> |
| 88 | 88 | <?php |
| 89 | - $aircraft_array = $Stats->countAllAircraftTypes(true,$airline_icao); |
|
| 90 | - if (count($aircraft_array) == 0) print _("No data available"); |
|
| 91 | - else { |
|
| 89 | + $aircraft_array = $Stats->countAllAircraftTypes(true,$airline_icao); |
|
| 90 | + if (count($aircraft_array) == 0) print _("No data available"); |
|
| 91 | + else { |
|
| 92 | 92 | |
| 93 | - print '<div id="chart1" class="chart" width="100%"></div> |
|
| 93 | + print '<div id="chart1" class="chart" width="100%"></div> |
|
| 94 | 94 | <script> |
| 95 | 95 | google.load("visualization", "1", {packages:["corechart"]}); |
| 96 | 96 | google.setOnLoadCallback(drawChart1); |
| 97 | 97 | function drawChart1() { |
| 98 | 98 | var data = google.visualization.arrayToDataTable([ |
| 99 | 99 | ["'._("Aircraft").'", "'._("# of times").'"], '; |
| 100 | - $aircraft_data = ''; |
|
| 101 | - foreach($aircraft_array as $aircraft_item) |
|
| 102 | - { |
|
| 103 | - $aircraft_data .= '[ "'.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],'; |
|
| 104 | - } |
|
| 105 | - $aircraft_data = substr($aircraft_data, 0, -1); |
|
| 106 | - print $aircraft_data; |
|
| 107 | - print ']); |
|
| 100 | + $aircraft_data = ''; |
|
| 101 | + foreach($aircraft_array as $aircraft_item) |
|
| 102 | + { |
|
| 103 | + $aircraft_data .= '[ "'.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],'; |
|
| 104 | + } |
|
| 105 | + $aircraft_data = substr($aircraft_data, 0, -1); |
|
| 106 | + print $aircraft_data; |
|
| 107 | + print ']); |
|
| 108 | 108 | |
| 109 | 109 | var options = { |
| 110 | 110 | chartArea: {"width": "80%", "height": "60%"}, |
@@ -119,8 +119,8 @@ discard block |
||
| 119 | 119 | drawChart1(); |
| 120 | 120 | }); |
| 121 | 121 | </script>'; |
| 122 | - } |
|
| 123 | - ?> |
|
| 122 | + } |
|
| 123 | + ?> |
|
| 124 | 124 | <div class="more"> |
| 125 | 125 | <a href="<?php print $globalURL; ?>/statistics/aircraft" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
| 126 | 126 | </div> |
@@ -128,30 +128,30 @@ discard block |
||
| 128 | 128 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
| 129 | 129 | <?php |
| 130 | 130 | // echo $airline_icao; |
| 131 | - if ($airline_icao == '' || $airline_icao == 'all') { |
|
| 131 | + if ($airline_icao == '' || $airline_icao == 'all') { |
|
| 132 | 132 | ?> |
| 133 | 133 | <div class="col-md-6"> |
| 134 | 134 | <h2><?php echo _("Top 10 Most Common Airline"); ?></h2> |
| 135 | 135 | <?php |
| 136 | - $airline_array = $Stats->countAllAirlines(); |
|
| 137 | - if (count($airline_array) == 0) print _("No data available"); |
|
| 138 | - else { |
|
| 136 | + $airline_array = $Stats->countAllAirlines(); |
|
| 137 | + if (count($airline_array) == 0) print _("No data available"); |
|
| 138 | + else { |
|
| 139 | 139 | |
| 140 | - print '<div id="chart2" class="chart" width="100%"></div> |
|
| 140 | + print '<div id="chart2" class="chart" width="100%"></div> |
|
| 141 | 141 | <script> |
| 142 | 142 | google.load("visualization", "1", {packages:["corechart"]}); |
| 143 | 143 | google.setOnLoadCallback(drawChart2); |
| 144 | 144 | function drawChart2() { |
| 145 | 145 | var data = google.visualization.arrayToDataTable([ |
| 146 | 146 | ["'._("Airline").'", "'._("# of times").'"], '; |
| 147 | - $airline_data = ''; |
|
| 148 | - foreach($airline_array as $airline_item) |
|
| 149 | - { |
|
| 150 | - $airline_data .= '[ "'.$airline_item['airline_name'].' ('.$airline_item['airline_icao'].')",'.$airline_item['airline_count'].'],'; |
|
| 151 | - } |
|
| 152 | - $airline_data = substr($airline_data, 0, -1); |
|
| 153 | - print $airline_data; |
|
| 154 | - print ']); |
|
| 147 | + $airline_data = ''; |
|
| 148 | + foreach($airline_array as $airline_item) |
|
| 149 | + { |
|
| 150 | + $airline_data .= '[ "'.$airline_item['airline_name'].' ('.$airline_item['airline_icao'].')",'.$airline_item['airline_count'].'],'; |
|
| 151 | + } |
|
| 152 | + $airline_data = substr($airline_data, 0, -1); |
|
| 153 | + print $airline_data; |
|
| 154 | + print ']); |
|
| 155 | 155 | |
| 156 | 156 | var options = { |
| 157 | 157 | chartArea: {"width": "80%", "height": "60%"}, |
@@ -166,8 +166,8 @@ discard block |
||
| 166 | 166 | drawChart2(); |
| 167 | 167 | }); |
| 168 | 168 | </script>'; |
| 169 | - } |
|
| 170 | - ?> |
|
| 169 | + } |
|
| 170 | + ?> |
|
| 171 | 171 | <div class="more"> |
| 172 | 172 | <a href="<?php print $globalURL; ?>/statistics/airline" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
| 173 | 173 | </div> |
@@ -175,44 +175,44 @@ discard block |
||
| 175 | 175 | </div> |
| 176 | 176 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
| 177 | 177 | <?php |
| 178 | - } |
|
| 178 | + } |
|
| 179 | 179 | ?> |
| 180 | 180 | <div class="row column"> |
| 181 | 181 | |
| 182 | 182 | <?php |
| 183 | - $flightover_array = $Stats->countAllFlightOverCountries($airline_icao); |
|
| 183 | + $flightover_array = $Stats->countAllFlightOverCountries($airline_icao); |
|
| 184 | 184 | if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) { |
| 185 | - if (empty($flightover_array)) { |
|
| 186 | - ?> |
|
| 185 | + if (empty($flightover_array)) { |
|
| 186 | + ?> |
|
| 187 | 187 | <div class="col-md-12"> |
| 188 | 188 | <?php |
| 189 | - } else { |
|
| 190 | - ?> |
|
| 189 | + } else { |
|
| 190 | + ?> |
|
| 191 | 191 | <div class="col-md-6"> |
| 192 | 192 | <?php |
| 193 | - } |
|
| 194 | - ?> |
|
| 193 | + } |
|
| 194 | + ?> |
|
| 195 | 195 | <h2><?php echo _("Top 10 Most Common Pilots"); ?></h2> |
| 196 | 196 | <?php |
| 197 | - $pilot_array = $Stats->countAllPilots(true,$airline_icao); |
|
| 198 | - if (count($pilot_array) == 0) print _("No data available"); |
|
| 199 | - else { |
|
| 197 | + $pilot_array = $Stats->countAllPilots(true,$airline_icao); |
|
| 198 | + if (count($pilot_array) == 0) print _("No data available"); |
|
| 199 | + else { |
|
| 200 | 200 | |
| 201 | - print '<div id="chart7" class="chart" width="100%"></div> |
|
| 201 | + print '<div id="chart7" class="chart" width="100%"></div> |
|
| 202 | 202 | <script> |
| 203 | 203 | google.load("visualization", "1", {packages:["corechart"]}); |
| 204 | 204 | google.setOnLoadCallback(drawChart7); |
| 205 | 205 | function drawChart7() { |
| 206 | 206 | var data = google.visualization.arrayToDataTable([ |
| 207 | 207 | ["'._("Pilots").'", "'._("# of times").'"], '; |
| 208 | - $pilot_data = ''; |
|
| 209 | - foreach($pilot_array as $pilot_item) |
|
| 210 | - { |
|
| 211 | - $pilot_data .= '[ "'.$pilot_item['pilot_name'].' ('.$pilot_item['pilot_id'].')",'.$pilot_item['pilot_count'].'],'; |
|
| 212 | - } |
|
| 213 | - $pilot_data = substr($pilot_data, 0, -1); |
|
| 214 | - print $pilot_data; |
|
| 215 | - print ']); |
|
| 208 | + $pilot_data = ''; |
|
| 209 | + foreach($pilot_array as $pilot_item) |
|
| 210 | + { |
|
| 211 | + $pilot_data .= '[ "'.$pilot_item['pilot_name'].' ('.$pilot_item['pilot_id'].')",'.$pilot_item['pilot_count'].'],'; |
|
| 212 | + } |
|
| 213 | + $pilot_data = substr($pilot_data, 0, -1); |
|
| 214 | + print $pilot_data; |
|
| 215 | + print ']); |
|
| 216 | 216 | |
| 217 | 217 | var options = { |
| 218 | 218 | chartArea: {"width": "80%", "height": "60%"}, |
@@ -227,8 +227,8 @@ discard block |
||
| 227 | 227 | drawChart7(); |
| 228 | 228 | }); |
| 229 | 229 | </script>'; |
| 230 | - } |
|
| 231 | - ?> |
|
| 230 | + } |
|
| 231 | + ?> |
|
| 232 | 232 | <div class="more"> |
| 233 | 233 | <a href="<?php print $globalURL; ?>/statistics/pilot" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
| 234 | 234 | </div> |
@@ -236,30 +236,30 @@ discard block |
||
| 236 | 236 | |
| 237 | 237 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
| 238 | 238 | <?php |
| 239 | - } else { |
|
| 240 | - ?> |
|
| 239 | + } else { |
|
| 240 | + ?> |
|
| 241 | 241 | <div class="col-md-6"> |
| 242 | 242 | <h2><?php echo _("Top 10 Most Common Owners"); ?></h2> |
| 243 | 243 | <?php |
| 244 | - $owner_array = $Stats->countAllOwners(true,$airline_icao); |
|
| 245 | - if (count($owner_array) == 0) print _("No data available"); |
|
| 246 | - else { |
|
| 244 | + $owner_array = $Stats->countAllOwners(true,$airline_icao); |
|
| 245 | + if (count($owner_array) == 0) print _("No data available"); |
|
| 246 | + else { |
|
| 247 | 247 | |
| 248 | - print '<div id="chart7" class="chart" width="100%"></div> |
|
| 248 | + print '<div id="chart7" class="chart" width="100%"></div> |
|
| 249 | 249 | <script> |
| 250 | 250 | google.load("visualization", "1", {packages:["corechart"]}); |
| 251 | 251 | google.setOnLoadCallback(drawChart7); |
| 252 | 252 | function drawChart7() { |
| 253 | 253 | var data = google.visualization.arrayToDataTable([ |
| 254 | 254 | ["'._("Owner").'", "'._("# of times").'"], '; |
| 255 | - $owner_data = ''; |
|
| 256 | - foreach($owner_array as $owner_item) |
|
| 257 | - { |
|
| 258 | - $owner_data .= '[ "'.$owner_item['owner_name'].'",'.$owner_item['owner_count'].'],'; |
|
| 259 | - } |
|
| 260 | - $owner_data = substr($owner_data, 0, -1); |
|
| 261 | - print $owner_data; |
|
| 262 | - print ']); |
|
| 255 | + $owner_data = ''; |
|
| 256 | + foreach($owner_array as $owner_item) |
|
| 257 | + { |
|
| 258 | + $owner_data .= '[ "'.$owner_item['owner_name'].'",'.$owner_item['owner_count'].'],'; |
|
| 259 | + } |
|
| 260 | + $owner_data = substr($owner_data, 0, -1); |
|
| 261 | + print $owner_data; |
|
| 262 | + print ']); |
|
| 263 | 263 | |
| 264 | 264 | var options = { |
| 265 | 265 | chartArea: {"width": "80%", "height": "60%"}, |
@@ -274,8 +274,8 @@ discard block |
||
| 274 | 274 | drawChart7(); |
| 275 | 275 | }); |
| 276 | 276 | </script>'; |
| 277 | - } |
|
| 278 | - ?> |
|
| 277 | + } |
|
| 278 | + ?> |
|
| 279 | 279 | <div class="more"> |
| 280 | 280 | <a href="<?php print $globalURL; ?>/statistics/owner" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
| 281 | 281 | </div> |
@@ -283,32 +283,32 @@ discard block |
||
| 283 | 283 | |
| 284 | 284 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
| 285 | 285 | <?php |
| 286 | - } |
|
| 287 | - if (!empty($flightover_array)) { |
|
| 288 | - ?> |
|
| 286 | + } |
|
| 287 | + if (!empty($flightover_array)) { |
|
| 288 | + ?> |
|
| 289 | 289 | |
| 290 | 290 | <div class="col-md-6"> |
| 291 | 291 | <h2><?php echo _("Top 20 Most Common Country a Flight was Over"); ?></h2> |
| 292 | 292 | <?php |
| 293 | - //$flightover_array = $Stats->countAllFlightOverCountries(); |
|
| 294 | - if (count($flightover_array) == 0) print _("No data available"); |
|
| 295 | - else { |
|
| 293 | + //$flightover_array = $Stats->countAllFlightOverCountries(); |
|
| 294 | + if (count($flightover_array) == 0) print _("No data available"); |
|
| 295 | + else { |
|
| 296 | 296 | |
| 297 | - print '<div id="chart10" class="chart" width="100%"></div> |
|
| 297 | + print '<div id="chart10" class="chart" width="100%"></div> |
|
| 298 | 298 | <script> |
| 299 | 299 | google.load("visualization", "1", {packages:["corechart"]}); |
| 300 | 300 | google.setOnLoadCallback(drawChart10); |
| 301 | 301 | function drawChart10() { |
| 302 | 302 | var data = google.visualization.arrayToDataTable([ |
| 303 | 303 | ["'._("Country").'", "'._("# of times").'"], '; |
| 304 | - $flightover_data = ''; |
|
| 305 | - foreach($flightover_array as $flightover_item) |
|
| 306 | - { |
|
| 307 | - $flightover_data .= '[ "'.$flightover_item['flight_country'].' ('.$flightover_item['flight_country_iso2'].')",'.$flightover_item['flight_count'].'],'; |
|
| 308 | - } |
|
| 309 | - $flightover_data = substr($flightover_data, 0, -1); |
|
| 310 | - print $flightover_data; |
|
| 311 | - print ']); |
|
| 304 | + $flightover_data = ''; |
|
| 305 | + foreach($flightover_array as $flightover_item) |
|
| 306 | + { |
|
| 307 | + $flightover_data .= '[ "'.$flightover_item['flight_country'].' ('.$flightover_item['flight_country_iso2'].')",'.$flightover_item['flight_count'].'],'; |
|
| 308 | + } |
|
| 309 | + $flightover_data = substr($flightover_data, 0, -1); |
|
| 310 | + print $flightover_data; |
|
| 311 | + print ']); |
|
| 312 | 312 | |
| 313 | 313 | var options = { |
| 314 | 314 | chartArea: {"width": "80%", "height": "60%"}, |
@@ -325,15 +325,15 @@ discard block |
||
| 325 | 325 | drawChart10(); |
| 326 | 326 | }); |
| 327 | 327 | </script>'; |
| 328 | - } |
|
| 329 | - ?> |
|
| 328 | + } |
|
| 329 | + ?> |
|
| 330 | 330 | <div class="more"> |
| 331 | 331 | <a href="<?php print $globalURL; ?>/statistics/country" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
| 332 | 332 | </div> |
| 333 | 333 | </div> |
| 334 | 334 | <?php |
| 335 | - } |
|
| 336 | - ?> |
|
| 335 | + } |
|
| 336 | + ?> |
|
| 337 | 337 | </div> |
| 338 | 338 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
| 339 | 339 | |
@@ -343,11 +343,11 @@ discard block |
||
| 343 | 343 | <div class="col-md-6"> |
| 344 | 344 | <h2><?php echo _("Top 10 Most Common Departure Airports"); ?></h2> |
| 345 | 345 | <?php |
| 346 | - $airport_airport_array = $Stats->countAllDepartureAirports($airline_icao); |
|
| 347 | - if (count($airport_airport_array) == 0) print _("No data available"); |
|
| 348 | - else { |
|
| 346 | + $airport_airport_array = $Stats->countAllDepartureAirports($airline_icao); |
|
| 347 | + if (count($airport_airport_array) == 0) print _("No data available"); |
|
| 348 | + else { |
|
| 349 | 349 | |
| 350 | - print '<div id="chart3" class="chart" width="100%"></div> |
|
| 350 | + print '<div id="chart3" class="chart" width="100%"></div> |
|
| 351 | 351 | <script> |
| 352 | 352 | google.load("visualization", "1", {packages:["geochart"]}); |
| 353 | 353 | google.setOnLoadCallback(drawCharts3); |
@@ -358,17 +358,17 @@ discard block |
||
| 358 | 358 | |
| 359 | 359 | var data = google.visualization.arrayToDataTable([ |
| 360 | 360 | ["'._("Airport").'", "'._("# of times").'"],'; |
| 361 | - $airport_data = ''; |
|
| 362 | - foreach($airport_airport_array as $airport_item) |
|
| 363 | - { |
|
| 364 | - $name = $airport_item['airport_departure_city'].', '.$airport_item['airport_departure_country'].' ('.$airport_item['airport_departure_icao'].')'; |
|
| 365 | - $name = str_replace("'", "", $name); |
|
| 366 | - $name = str_replace('"', "", $name); |
|
| 367 | - $airport_data .= '[ "'.$name.'",'.$airport_item['airport_departure_icao_count'].'],'; |
|
| 368 | - } |
|
| 369 | - $airport_data = substr($airport_data, 0, -1); |
|
| 370 | - print $airport_data; |
|
| 371 | - print ']); |
|
| 361 | + $airport_data = ''; |
|
| 362 | + foreach($airport_airport_array as $airport_item) |
|
| 363 | + { |
|
| 364 | + $name = $airport_item['airport_departure_city'].', '.$airport_item['airport_departure_country'].' ('.$airport_item['airport_departure_icao'].')'; |
|
| 365 | + $name = str_replace("'", "", $name); |
|
| 366 | + $name = str_replace('"', "", $name); |
|
| 367 | + $airport_data .= '[ "'.$name.'",'.$airport_item['airport_departure_icao_count'].'],'; |
|
| 368 | + } |
|
| 369 | + $airport_data = substr($airport_data, 0, -1); |
|
| 370 | + print $airport_data; |
|
| 371 | + print ']); |
|
| 372 | 372 | |
| 373 | 373 | var options = { |
| 374 | 374 | legend: {position: "none"}, |
@@ -382,8 +382,8 @@ discard block |
||
| 382 | 382 | chart.draw(data, options); |
| 383 | 383 | } |
| 384 | 384 | </script>'; |
| 385 | - } |
|
| 386 | - ?> |
|
| 385 | + } |
|
| 386 | + ?> |
|
| 387 | 387 | <div class="more"> |
| 388 | 388 | <a href="<?php print $globalURL; ?>/statistics/airport-departure" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
| 389 | 389 | </div> |
@@ -393,11 +393,11 @@ discard block |
||
| 393 | 393 | <div class="col-md-6"> |
| 394 | 394 | <h2><?php echo _("Top 10 Most Common Arrival Airports"); ?></h2> |
| 395 | 395 | <?php |
| 396 | - $airport_airport_array2 = $Stats->countAllArrivalAirports($airline_icao); |
|
| 397 | - if (count($airport_airport_array2) == 0) print _("No data available"); |
|
| 398 | - else { |
|
| 396 | + $airport_airport_array2 = $Stats->countAllArrivalAirports($airline_icao); |
|
| 397 | + if (count($airport_airport_array2) == 0) print _("No data available"); |
|
| 398 | + else { |
|
| 399 | 399 | |
| 400 | - print '<div id="chart4" class="chart" width="100%"></div> |
|
| 400 | + print '<div id="chart4" class="chart" width="100%"></div> |
|
| 401 | 401 | <script> |
| 402 | 402 | google.load("visualization", "1", {packages:["geochart"]}); |
| 403 | 403 | google.setOnLoadCallback(drawCharts4); |
@@ -408,17 +408,17 @@ discard block |
||
| 408 | 408 | |
| 409 | 409 | var data = google.visualization.arrayToDataTable([ |
| 410 | 410 | ["'._("Airport").'", "'._("# of times").'"],'; |
| 411 | - $airport_data2 = ''; |
|
| 412 | - foreach($airport_airport_array2 as $airport_item2) |
|
| 413 | - { |
|
| 414 | - $name2 = $airport_item2['airport_arrival_city'].', '.$airport_item2['airport_arrival_country'].' ('.$airport_item2['airport_arrival_icao'].')'; |
|
| 415 | - $name2 = str_replace("'", "", $name2); |
|
| 416 | - $name2 = str_replace('"', "", $name2); |
|
| 417 | - $airport_data2 .= '[ "'.$name2.'",'.$airport_item2['airport_arrival_icao_count'].'],'; |
|
| 418 | - } |
|
| 419 | - $airport_data2 = substr($airport_data2, 0, -1); |
|
| 420 | - print $airport_data2; |
|
| 421 | - print ']); |
|
| 411 | + $airport_data2 = ''; |
|
| 412 | + foreach($airport_airport_array2 as $airport_item2) |
|
| 413 | + { |
|
| 414 | + $name2 = $airport_item2['airport_arrival_city'].', '.$airport_item2['airport_arrival_country'].' ('.$airport_item2['airport_arrival_icao'].')'; |
|
| 415 | + $name2 = str_replace("'", "", $name2); |
|
| 416 | + $name2 = str_replace('"', "", $name2); |
|
| 417 | + $airport_data2 .= '[ "'.$name2.'",'.$airport_item2['airport_arrival_icao_count'].'],'; |
|
| 418 | + } |
|
| 419 | + $airport_data2 = substr($airport_data2, 0, -1); |
|
| 420 | + print $airport_data2; |
|
| 421 | + print ']); |
|
| 422 | 422 | |
| 423 | 423 | var options = { |
| 424 | 424 | legend: {position: "none"}, |
@@ -432,8 +432,8 @@ discard block |
||
| 432 | 432 | chart.draw(data, options); |
| 433 | 433 | } |
| 434 | 434 | </script>'; |
| 435 | - } |
|
| 436 | - ?> |
|
| 435 | + } |
|
| 436 | + ?> |
|
| 437 | 437 | <div class="more"> |
| 438 | 438 | <a href="<?php print $globalURL; ?>/statistics/airport-arrival" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
| 439 | 439 | </div> |
@@ -445,24 +445,24 @@ discard block |
||
| 445 | 445 | <div class="col-md-6"> |
| 446 | 446 | <h2><?php echo _("Busiest Months of the last 12 Months"); ?></h2> |
| 447 | 447 | <?php |
| 448 | - $year_array = $Stats->countAllMonthsLastYear($airline_icao); |
|
| 449 | - if (count($year_array) == 0) print _("No data available"); |
|
| 450 | - else { |
|
| 451 | - print '<div id="chart8" class="chart" width="100%"></div> |
|
| 448 | + $year_array = $Stats->countAllMonthsLastYear($airline_icao); |
|
| 449 | + if (count($year_array) == 0) print _("No data available"); |
|
| 450 | + else { |
|
| 451 | + print '<div id="chart8" class="chart" width="100%"></div> |
|
| 452 | 452 | <script> |
| 453 | 453 | google.load("visualization", "1", {packages:["corechart"]}); |
| 454 | 454 | google.setOnLoadCallback(drawChart8); |
| 455 | 455 | function drawChart8() { |
| 456 | 456 | var data = google.visualization.arrayToDataTable([ |
| 457 | 457 | ["'._("Month").'", "'._("# of Flights").'"], '; |
| 458 | - $year_data = ''; |
|
| 459 | - foreach($year_array as $year_item) |
|
| 460 | - { |
|
| 461 | - $year_data .= '[ "'.date('F, Y',strtotime($year_item['year_name'].'-'.$year_item['month_name'].'-01')).'",'.$year_item['date_count'].'],'; |
|
| 462 | - } |
|
| 463 | - $year_data = substr($year_data, 0, -1); |
|
| 464 | - print $year_data; |
|
| 465 | - print ']); |
|
| 458 | + $year_data = ''; |
|
| 459 | + foreach($year_array as $year_item) |
|
| 460 | + { |
|
| 461 | + $year_data .= '[ "'.date('F, Y',strtotime($year_item['year_name'].'-'.$year_item['month_name'].'-01')).'",'.$year_item['date_count'].'],'; |
|
| 462 | + } |
|
| 463 | + $year_data = substr($year_data, 0, -1); |
|
| 464 | + print $year_data; |
|
| 465 | + print ']); |
|
| 466 | 466 | |
| 467 | 467 | var options = { |
| 468 | 468 | legend: {position: "none"}, |
@@ -480,8 +480,8 @@ discard block |
||
| 480 | 480 | drawChart8(); |
| 481 | 481 | }); |
| 482 | 482 | </script>'; |
| 483 | - } |
|
| 484 | - ?> |
|
| 483 | + } |
|
| 484 | + ?> |
|
| 485 | 485 | <div class="more"> |
| 486 | 486 | <a href="<?php print $globalURL; ?>/statistics/year" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
| 487 | 487 | </div> |
@@ -491,24 +491,24 @@ discard block |
||
| 491 | 491 | <div class="col-md-6"> |
| 492 | 492 | <h2><?php echo _("Busiest Day in the last Month"); ?></h2> |
| 493 | 493 | <?php |
| 494 | - $month_array = $Stats->countAllDatesLastMonth($airline_icao); |
|
| 495 | - if (count($month_array) == 0) print _("No data available"); |
|
| 496 | - else { |
|
| 497 | - print '<div id="chart9" class="chart" width="100%"></div> |
|
| 494 | + $month_array = $Stats->countAllDatesLastMonth($airline_icao); |
|
| 495 | + if (count($month_array) == 0) print _("No data available"); |
|
| 496 | + else { |
|
| 497 | + print '<div id="chart9" class="chart" width="100%"></div> |
|
| 498 | 498 | <script> |
| 499 | 499 | google.load("visualization", "1", {packages:["corechart"]}); |
| 500 | 500 | google.setOnLoadCallback(drawChart9); |
| 501 | 501 | function drawChart9() { |
| 502 | 502 | var data = google.visualization.arrayToDataTable([ |
| 503 | 503 | ["'._("Day").'", "'._("# of Flights").'"], '; |
| 504 | - $month_data = ''; |
|
| 505 | - foreach($month_array as $month_item) |
|
| 506 | - { |
|
| 507 | - $month_data .= '[ "'.date('F j, Y',strtotime($month_item['date_name'])).'",'.$month_item['date_count'].'],'; |
|
| 508 | - } |
|
| 509 | - $month_data = substr($month_data, 0, -1); |
|
| 510 | - print $month_data; |
|
| 511 | - print ']); |
|
| 504 | + $month_data = ''; |
|
| 505 | + foreach($month_array as $month_item) |
|
| 506 | + { |
|
| 507 | + $month_data .= '[ "'.date('F j, Y',strtotime($month_item['date_name'])).'",'.$month_item['date_count'].'],'; |
|
| 508 | + } |
|
| 509 | + $month_data = substr($month_data, 0, -1); |
|
| 510 | + print $month_data; |
|
| 511 | + print ']); |
|
| 512 | 512 | |
| 513 | 513 | var options = { |
| 514 | 514 | legend: {position: "none"}, |
@@ -526,8 +526,8 @@ discard block |
||
| 526 | 526 | drawChart9(); |
| 527 | 527 | }); |
| 528 | 528 | </script>'; |
| 529 | - } |
|
| 530 | - ?> |
|
| 529 | + } |
|
| 530 | + ?> |
|
| 531 | 531 | <div class="more"> |
| 532 | 532 | <a href="<?php print $globalURL; ?>/statistics/month" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
| 533 | 533 | </div> |
@@ -537,25 +537,25 @@ discard block |
||
| 537 | 537 | <div class="col-md-6"> |
| 538 | 538 | <h2><?php echo _("Busiest Day in the last 7 Days"); ?></h2> |
| 539 | 539 | <?php |
| 540 | - $date_array = $Stats->countAllDatesLast7Days($airline_icao); |
|
| 541 | - if (empty($date_array)) print _("No data available"); |
|
| 542 | - else { |
|
| 543 | - print '<div id="chart5" class="chart" width="100%"></div> |
|
| 540 | + $date_array = $Stats->countAllDatesLast7Days($airline_icao); |
|
| 541 | + if (empty($date_array)) print _("No data available"); |
|
| 542 | + else { |
|
| 543 | + print '<div id="chart5" class="chart" width="100%"></div> |
|
| 544 | 544 | <script> |
| 545 | 545 | google.load("visualization", "1", {packages:["corechart"]}); |
| 546 | 546 | google.setOnLoadCallback(drawChart5); |
| 547 | 547 | function drawChart5() { |
| 548 | 548 | var data = google.visualization.arrayToDataTable([ |
| 549 | 549 | ["'._("Date").'", "'._("# of Flights").'"], '; |
| 550 | - $date_data = ''; |
|
| 550 | + $date_data = ''; |
|
| 551 | 551 | |
| 552 | - foreach($date_array as $date_item) |
|
| 553 | - { |
|
| 554 | - $date_data .= '[ "'.date("F j, Y", strtotime($date_item['date_name'])).'",'.$date_item['date_count'].'],'; |
|
| 555 | - } |
|
| 556 | - $date_data = substr($date_data, 0, -1); |
|
| 557 | - print $date_data; |
|
| 558 | - print ']); |
|
| 552 | + foreach($date_array as $date_item) |
|
| 553 | + { |
|
| 554 | + $date_data .= '[ "'.date("F j, Y", strtotime($date_item['date_name'])).'",'.$date_item['date_count'].'],'; |
|
| 555 | + } |
|
| 556 | + $date_data = substr($date_data, 0, -1); |
|
| 557 | + print $date_data; |
|
| 558 | + print ']); |
|
| 559 | 559 | |
| 560 | 560 | var options = { |
| 561 | 561 | legend: {position: "none"}, |
@@ -573,8 +573,8 @@ discard block |
||
| 573 | 573 | drawChart5(); |
| 574 | 574 | }); |
| 575 | 575 | </script>'; |
| 576 | - } |
|
| 577 | - ?> |
|
| 576 | + } |
|
| 577 | + ?> |
|
| 578 | 578 | <div class="more"> |
| 579 | 579 | <a href="<?php print $globalURL; ?>/statistics/date" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
| 580 | 580 | </div> |
@@ -584,25 +584,25 @@ discard block |
||
| 584 | 584 | <div class="col-md-6"> |
| 585 | 585 | <h2><?php echo _("Busiest Time of the Day"); ?></h2> |
| 586 | 586 | <?php |
| 587 | - $hour_array = $Stats->countAllHours('hour',$airline_icao); |
|
| 588 | - if (empty($hour_array)) print _("No data available"); |
|
| 589 | - else { |
|
| 587 | + $hour_array = $Stats->countAllHours('hour',$airline_icao); |
|
| 588 | + if (empty($hour_array)) print _("No data available"); |
|
| 589 | + else { |
|
| 590 | 590 | |
| 591 | - print '<div id="chart6" class="chart" width="100%"></div> |
|
| 591 | + print '<div id="chart6" class="chart" width="100%"></div> |
|
| 592 | 592 | <script> |
| 593 | 593 | google.load("visualization", "1", {packages:["corechart"]}); |
| 594 | 594 | google.setOnLoadCallback(drawChart6); |
| 595 | 595 | function drawChart6() { |
| 596 | 596 | var data = google.visualization.arrayToDataTable([ |
| 597 | 597 | ["'._("Hour").'", "'._("# of Flights").'"], '; |
| 598 | - $hour_data = ''; |
|
| 599 | - foreach($hour_array as $hour_item) |
|
| 600 | - { |
|
| 601 | - $hour_data .= '[ "'.$hour_item['hour_name'].':00",'.$hour_item['hour_count'].'],'; |
|
| 602 | - } |
|
| 603 | - $hour_data = substr($hour_data, 0, -1); |
|
| 604 | - print $hour_data; |
|
| 605 | - print ']); |
|
| 598 | + $hour_data = ''; |
|
| 599 | + foreach($hour_array as $hour_item) |
|
| 600 | + { |
|
| 601 | + $hour_data .= '[ "'.$hour_item['hour_name'].':00",'.$hour_item['hour_count'].'],'; |
|
| 602 | + } |
|
| 603 | + $hour_data = substr($hour_data, 0, -1); |
|
| 604 | + print $hour_data; |
|
| 605 | + print ']); |
|
| 606 | 606 | |
| 607 | 607 | var options = { |
| 608 | 608 | legend: {position: "none"}, |
@@ -620,8 +620,8 @@ discard block |
||
| 620 | 620 | drawChart6(); |
| 621 | 621 | }); |
| 622 | 622 | </script>'; |
| 623 | - } |
|
| 624 | - ?> |
|
| 623 | + } |
|
| 624 | + ?> |
|
| 625 | 625 | <div class="more"> |
| 626 | 626 | <a href="<?php print $globalURL; ?>/statistics/time" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
| 627 | 627 | </div> |
@@ -629,21 +629,21 @@ discard block |
||
| 629 | 629 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
| 630 | 630 | </div> |
| 631 | 631 | <?php |
| 632 | - if ($airline_icao == '') { |
|
| 632 | + if ($airline_icao == '') { |
|
| 633 | 633 | ?> |
| 634 | 634 | <div class="row column"> |
| 635 | 635 | <?php |
| 636 | - $polar = $Stats->getStatsSource(date('Y-m-d'),'polar'); |
|
| 637 | - if (!empty($polar)) { |
|
| 638 | - print '<h2>'._("Coverage pattern").'</h2>'; |
|
| 639 | - foreach ($polar as $eachpolar) { |
|
| 640 | - unset($polar_data); |
|
| 641 | - $Spotter = new Spotter(); |
|
| 642 | - $data = json_decode($eachpolar['source_data']); |
|
| 643 | - foreach($data as $value => $key) { |
|
| 644 | - $direction = $Spotter->parseDirection(($value*22.5)); |
|
| 645 | - $distance = $key; |
|
| 646 | - $unit = 'km'; |
|
| 636 | + $polar = $Stats->getStatsSource(date('Y-m-d'),'polar'); |
|
| 637 | + if (!empty($polar)) { |
|
| 638 | + print '<h2>'._("Coverage pattern").'</h2>'; |
|
| 639 | + foreach ($polar as $eachpolar) { |
|
| 640 | + unset($polar_data); |
|
| 641 | + $Spotter = new Spotter(); |
|
| 642 | + $data = json_decode($eachpolar['source_data']); |
|
| 643 | + foreach($data as $value => $key) { |
|
| 644 | + $direction = $Spotter->parseDirection(($value*22.5)); |
|
| 645 | + $distance = $key; |
|
| 646 | + $unit = 'km'; |
|
| 647 | 647 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
| 648 | 648 | $distance = round($distance*0.539957); |
| 649 | 649 | $unit = 'nm'; |
@@ -654,10 +654,10 @@ discard block |
||
| 654 | 654 | $distance = $distance; |
| 655 | 655 | $unit = 'km'; |
| 656 | 656 | } |
| 657 | - if (!isset($polar_data)) $polar_data = '{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
| 658 | - else $polar_data = $polar_data.',{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
| 659 | - } |
|
| 660 | - ?> |
|
| 657 | + if (!isset($polar_data)) $polar_data = '{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
| 658 | + else $polar_data = $polar_data.',{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
| 659 | + } |
|
| 660 | + ?> |
|
| 661 | 661 | <div class="col-md-6"> |
| 662 | 662 | <h4><?php print $eachpolar['source_name']; ?></h4> |
| 663 | 663 | <div id="polar-<?php print str_replace(' ','_',strtolower($eachpolar['source_name'])); ?>" class="chart" width="100%"></div> |
@@ -689,22 +689,22 @@ discard block |
||
| 689 | 689 | </script> |
| 690 | 690 | </div> |
| 691 | 691 | <?php |
| 692 | - } |
|
| 693 | - } |
|
| 694 | - ?> |
|
| 692 | + } |
|
| 693 | + } |
|
| 694 | + ?> |
|
| 695 | 695 | </div> |
| 696 | 696 | <div class="row column"> |
| 697 | 697 | <div class="col-md-6"> |
| 698 | 698 | <?php |
| 699 | - $msg = $Stats->getStatsSource(date('Y-m-d'),'msg'); |
|
| 700 | - if (!empty($msg)) { |
|
| 701 | - print '<h2>'._("Messages received").'</h2>'; |
|
| 702 | - foreach ($msg as $eachmsg) { |
|
| 703 | - //$eachmsg = $msg[0]; |
|
| 704 | - $data = $eachmsg['source_data']; |
|
| 705 | - if ($data > 500) $max = (round(($data+100)/100))*100; |
|
| 706 | - else $max = 500; |
|
| 707 | - ?> |
|
| 699 | + $msg = $Stats->getStatsSource(date('Y-m-d'),'msg'); |
|
| 700 | + if (!empty($msg)) { |
|
| 701 | + print '<h2>'._("Messages received").'</h2>'; |
|
| 702 | + foreach ($msg as $eachmsg) { |
|
| 703 | + //$eachmsg = $msg[0]; |
|
| 704 | + $data = $eachmsg['source_data']; |
|
| 705 | + if ($data > 500) $max = (round(($data+100)/100))*100; |
|
| 706 | + else $max = 500; |
|
| 707 | + ?> |
|
| 708 | 708 | <div id="msg-<?php print str_replace(' ','_',strtolower($eachmsg['source_name'])); ?>" class="col-md-4"></div> |
| 709 | 709 | <script> |
| 710 | 710 | var g = new JustGage({ |
@@ -720,9 +720,9 @@ discard block |
||
| 720 | 720 | }); |
| 721 | 721 | </script> |
| 722 | 722 | <?php |
| 723 | - } |
|
| 724 | - } |
|
| 725 | - ?> |
|
| 723 | + } |
|
| 724 | + } |
|
| 725 | + ?> |
|
| 726 | 726 | </div> |
| 727 | 727 | </div> |
| 728 | 728 | <div class="row column"> |
@@ -749,19 +749,19 @@ discard block |
||
| 749 | 749 | $hist_data .= '[ "'.$distance.'",'.$nb.'],'; |
| 750 | 750 | } |
| 751 | 751 | $hist_data = substr($hist_data, 0, -1); |
| 752 | - ?> |
|
| 752 | + ?> |
|
| 753 | 753 | <div class="col-md-6"> |
| 754 | 754 | <h2><?php echo sprintf(_("Flights Distance for %s"),$source); ?></h2> |
| 755 | 755 | <?php |
| 756 | - print '<div id="charthist-'.str_replace(' ','_',strtolower($source)).'" class="chart" width="100%"></div> |
|
| 756 | + print '<div id="charthist-'.str_replace(' ','_',strtolower($source)).'" class="chart" width="100%"></div> |
|
| 757 | 757 | <script> |
| 758 | 758 | google.load("visualization", "1", {packages:["corechart"]}); |
| 759 | 759 | google.setOnLoadCallback(drawCharthist_'.str_replace(' ','_',strtolower($source)).'); |
| 760 | 760 | function drawCharthist_'.str_replace(' ','_',strtolower($source)).'() { |
| 761 | 761 | var data = google.visualization.arrayToDataTable([ |
| 762 | 762 | ["'._("Distance").'", "'._("# of Flights").'"], '; |
| 763 | - print $hist_data; |
|
| 764 | - print ']); |
|
| 763 | + print $hist_data; |
|
| 764 | + print ']); |
|
| 765 | 765 | |
| 766 | 766 | var options = { |
| 767 | 767 | legend: {position: "none"}, |
@@ -779,15 +779,15 @@ discard block |
||
| 779 | 779 | drawCharthist_'.str_replace(' ','_',strtolower($source)).'(); |
| 780 | 780 | }); |
| 781 | 781 | </script>'; |
| 782 | - ?> |
|
| 782 | + ?> |
|
| 783 | 783 | </div> |
| 784 | 784 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
| 785 | 785 | <?php |
| 786 | - } |
|
| 787 | - ?> |
|
| 786 | + } |
|
| 787 | + ?> |
|
| 788 | 788 | </div> |
| 789 | 789 | <?php |
| 790 | - } |
|
| 790 | + } |
|
| 791 | 791 | ?> |
| 792 | 792 | </div> |
| 793 | 793 | </div> |
@@ -6,17 +6,17 @@ discard block |
||
| 6 | 6 | $Stats = new Stats(); |
| 7 | 7 | $title = _("Statistics"); |
| 8 | 8 | |
| 9 | -$airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
|
| 9 | +$airline_icao = (string) filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING); |
|
| 10 | 10 | if ($airline_icao == 'all') { |
| 11 | 11 | unset($_COOKIE['stats_airline_icao']); |
| 12 | - setcookie('stats_airline_icao', '', time()-3600); |
|
| 12 | + setcookie('stats_airline_icao', '', time() - 3600); |
|
| 13 | 13 | $airline_icao = ''; |
| 14 | 14 | } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) { |
| 15 | 15 | $airline_icao = $_COOKIE['stats_airline_icao']; |
| 16 | 16 | } elseif ($airline_icao == '' && isset($globalFilter)) { |
| 17 | 17 | if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
| 18 | 18 | } |
| 19 | -setcookie('stats_airline_icao',$airline_icao); |
|
| 19 | +setcookie('stats_airline_icao', $airline_icao); |
|
| 20 | 20 | require_once('header.php'); |
| 21 | 21 | |
| 22 | 22 | ?> |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | date_default_timezone_set('UTC'); |
| 37 | 37 | $lastupdate = strtotime($last_update[0]['value']); |
| 38 | 38 | if (isset($globalTimezone) && $globalTimezone != '') date_default_timezone_set($globalTimezone); |
| 39 | - print '<i>Last update: '.date('Y-m-d G:i:s',$lastupdate).'</i>'; |
|
| 39 | + print '<i>Last update: '.date('Y-m-d G:i:s', $lastupdate).'</i>'; |
|
| 40 | 40 | } |
| 41 | 41 | ?> |
| 42 | 42 | </div> |
@@ -46,29 +46,29 @@ discard block |
||
| 46 | 46 | <?php include('statistics-sub-menu.php'); ?> |
| 47 | 47 | <div class="row global-stats"> |
| 48 | 48 | <div class="col-md-2"><span class="type"><?php echo _("Flights"); ?></span><span><?php print number_format($Stats->countOverallFlights($airline_icao)); ?></span></div> |
| 49 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
| 49 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
| 50 | 50 | <div class="col-md-2"><span class="type"><?php echo _("Arrivals seen"); ?></span><span><?php print number_format($Stats->countOverallArrival($airline_icao)); ?></span></div> |
| 51 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
| 51 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
| 52 | 52 | <?php |
| 53 | 53 | if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) { |
| 54 | 54 | ?> |
| 55 | 55 | <div class="col-md-2"><span class="type"><?php echo _("Pilots"); ?></span><span><?php print number_format($Stats->countOverallPilots($airline_icao)); ?></span></div> |
| 56 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
| 56 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
| 57 | 57 | <?php |
| 58 | 58 | } else { |
| 59 | 59 | ?> |
| 60 | 60 | <div class="col-md-2"><span class="type"><?php echo _("Owners"); ?></span><span><?php print number_format($Stats->countOverallOwners($airline_icao)); ?></span></div> |
| 61 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
| 61 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
| 62 | 62 | <?php |
| 63 | 63 | } |
| 64 | 64 | ?> |
| 65 | 65 | <div class="col-md-2"><span class="type"><?php echo _("Aircrafts"); ?></span><span><?php print number_format($Stats->countOverallAircrafts($airline_icao)); ?></span></div> |
| 66 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
| 66 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
| 67 | 67 | <?php |
| 68 | 68 | if ($airline_icao == '') { |
| 69 | 69 | ?> |
| 70 | 70 | <div class="col-md-2"><span class="type"><?php echo _("Airlines"); ?></span><span><?php print number_format($Stats->countOverallAirlines()); ?></span></div> |
| 71 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
| 71 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
| 72 | 72 | <?php |
| 73 | 73 | } |
| 74 | 74 | ?> |
@@ -76,18 +76,18 @@ discard block |
||
| 76 | 76 | if (!(isset($globalIVAO) && $globalIVAO) && !(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalphpVMS) && $globalphpVMS)) { |
| 77 | 77 | ?> |
| 78 | 78 | <div class="col-md-2"><span class="type"><?php echo _("Military"); ?></span><span><?php print number_format($Stats->countOverallMilitaryFlights()); ?></span></div> |
| 79 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
| 79 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
| 80 | 80 | <?php |
| 81 | 81 | } |
| 82 | 82 | ?> |
| 83 | 83 | </div> |
| 84 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
| 84 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
| 85 | 85 | <div class="specific-stats"> |
| 86 | 86 | <div class="row column"> |
| 87 | 87 | <div class="col-md-6"> |
| 88 | 88 | <h2><?php echo _("Top 10 Most Common Aircraft Type"); ?></h2> |
| 89 | 89 | <?php |
| 90 | - $aircraft_array = $Stats->countAllAircraftTypes(true,$airline_icao); |
|
| 90 | + $aircraft_array = $Stats->countAllAircraftTypes(true, $airline_icao); |
|
| 91 | 91 | if (count($aircraft_array) == 0) print _("No data available"); |
| 92 | 92 | else { |
| 93 | 93 | |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | var data = google.visualization.arrayToDataTable([ |
| 100 | 100 | ["'._("Aircraft").'", "'._("# of times").'"], '; |
| 101 | 101 | $aircraft_data = ''; |
| 102 | - foreach($aircraft_array as $aircraft_item) |
|
| 102 | + foreach ($aircraft_array as $aircraft_item) |
|
| 103 | 103 | { |
| 104 | 104 | $aircraft_data .= '[ "'.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],'; |
| 105 | 105 | } |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | <a href="<?php print $globalURL; ?>/statistics/aircraft" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
| 127 | 127 | </div> |
| 128 | 128 | </div> |
| 129 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
| 129 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
| 130 | 130 | <?php |
| 131 | 131 | // echo $airline_icao; |
| 132 | 132 | if ($airline_icao == '' || $airline_icao == 'all') { |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | var data = google.visualization.arrayToDataTable([ |
| 147 | 147 | ["'._("Airline").'", "'._("# of times").'"], '; |
| 148 | 148 | $airline_data = ''; |
| 149 | - foreach($airline_array as $airline_item) |
|
| 149 | + foreach ($airline_array as $airline_item) |
|
| 150 | 150 | { |
| 151 | 151 | $airline_data .= '[ "'.$airline_item['airline_name'].' ('.$airline_item['airline_icao'].')",'.$airline_item['airline_count'].'],'; |
| 152 | 152 | } |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | </div> |
| 175 | 175 | </div> |
| 176 | 176 | </div> |
| 177 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
| 177 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
| 178 | 178 | <?php |
| 179 | 179 | } |
| 180 | 180 | ?> |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | ?> |
| 196 | 196 | <h2><?php echo _("Top 10 Most Common Pilots"); ?></h2> |
| 197 | 197 | <?php |
| 198 | - $pilot_array = $Stats->countAllPilots(true,$airline_icao); |
|
| 198 | + $pilot_array = $Stats->countAllPilots(true, $airline_icao); |
|
| 199 | 199 | if (count($pilot_array) == 0) print _("No data available"); |
| 200 | 200 | else { |
| 201 | 201 | |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | var data = google.visualization.arrayToDataTable([ |
| 208 | 208 | ["'._("Pilots").'", "'._("# of times").'"], '; |
| 209 | 209 | $pilot_data = ''; |
| 210 | - foreach($pilot_array as $pilot_item) |
|
| 210 | + foreach ($pilot_array as $pilot_item) |
|
| 211 | 211 | { |
| 212 | 212 | $pilot_data .= '[ "'.$pilot_item['pilot_name'].' ('.$pilot_item['pilot_id'].')",'.$pilot_item['pilot_count'].'],'; |
| 213 | 213 | } |
@@ -235,14 +235,14 @@ discard block |
||
| 235 | 235 | </div> |
| 236 | 236 | </div> |
| 237 | 237 | |
| 238 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
| 238 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
| 239 | 239 | <?php |
| 240 | 240 | } else { |
| 241 | 241 | ?> |
| 242 | 242 | <div class="col-md-6"> |
| 243 | 243 | <h2><?php echo _("Top 10 Most Common Owners"); ?></h2> |
| 244 | 244 | <?php |
| 245 | - $owner_array = $Stats->countAllOwners(true,$airline_icao); |
|
| 245 | + $owner_array = $Stats->countAllOwners(true, $airline_icao); |
|
| 246 | 246 | if (count($owner_array) == 0) print _("No data available"); |
| 247 | 247 | else { |
| 248 | 248 | |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | var data = google.visualization.arrayToDataTable([ |
| 255 | 255 | ["'._("Owner").'", "'._("# of times").'"], '; |
| 256 | 256 | $owner_data = ''; |
| 257 | - foreach($owner_array as $owner_item) |
|
| 257 | + foreach ($owner_array as $owner_item) |
|
| 258 | 258 | { |
| 259 | 259 | $owner_data .= '[ "'.$owner_item['owner_name'].'",'.$owner_item['owner_count'].'],'; |
| 260 | 260 | } |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | </div> |
| 283 | 283 | </div> |
| 284 | 284 | |
| 285 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
| 285 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
| 286 | 286 | <?php |
| 287 | 287 | } |
| 288 | 288 | if (!empty($flightover_array)) { |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | var data = google.visualization.arrayToDataTable([ |
| 304 | 304 | ["'._("Country").'", "'._("# of times").'"], '; |
| 305 | 305 | $flightover_data = ''; |
| 306 | - foreach($flightover_array as $flightover_item) |
|
| 306 | + foreach ($flightover_array as $flightover_item) |
|
| 307 | 307 | { |
| 308 | 308 | $flightover_data .= '[ "'.$flightover_item['flight_country'].' ('.$flightover_item['flight_country_iso2'].')",'.$flightover_item['flight_count'].'],'; |
| 309 | 309 | } |
@@ -336,7 +336,7 @@ discard block |
||
| 336 | 336 | } |
| 337 | 337 | ?> |
| 338 | 338 | </div> |
| 339 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
| 339 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
| 340 | 340 | |
| 341 | 341 | |
| 342 | 342 | </div> |
@@ -360,7 +360,7 @@ discard block |
||
| 360 | 360 | var data = google.visualization.arrayToDataTable([ |
| 361 | 361 | ["'._("Airport").'", "'._("# of times").'"],'; |
| 362 | 362 | $airport_data = ''; |
| 363 | - foreach($airport_airport_array as $airport_item) |
|
| 363 | + foreach ($airport_airport_array as $airport_item) |
|
| 364 | 364 | { |
| 365 | 365 | $name = $airport_item['airport_departure_city'].', '.$airport_item['airport_departure_country'].' ('.$airport_item['airport_departure_icao'].')'; |
| 366 | 366 | $name = str_replace("'", "", $name); |
@@ -389,7 +389,7 @@ discard block |
||
| 389 | 389 | <a href="<?php print $globalURL; ?>/statistics/airport-departure" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
| 390 | 390 | </div> |
| 391 | 391 | </div> |
| 392 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
| 392 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
| 393 | 393 | |
| 394 | 394 | <div class="col-md-6"> |
| 395 | 395 | <h2><?php echo _("Top 10 Most Common Arrival Airports"); ?></h2> |
@@ -410,7 +410,7 @@ discard block |
||
| 410 | 410 | var data = google.visualization.arrayToDataTable([ |
| 411 | 411 | ["'._("Airport").'", "'._("# of times").'"],'; |
| 412 | 412 | $airport_data2 = ''; |
| 413 | - foreach($airport_airport_array2 as $airport_item2) |
|
| 413 | + foreach ($airport_airport_array2 as $airport_item2) |
|
| 414 | 414 | { |
| 415 | 415 | $name2 = $airport_item2['airport_arrival_city'].', '.$airport_item2['airport_arrival_country'].' ('.$airport_item2['airport_arrival_icao'].')'; |
| 416 | 416 | $name2 = str_replace("'", "", $name2); |
@@ -440,7 +440,7 @@ discard block |
||
| 440 | 440 | </div> |
| 441 | 441 | </div> |
| 442 | 442 | </div> |
| 443 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
| 443 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
| 444 | 444 | |
| 445 | 445 | <div class="row column"> |
| 446 | 446 | <div class="col-md-6"> |
@@ -457,9 +457,9 @@ discard block |
||
| 457 | 457 | var data = google.visualization.arrayToDataTable([ |
| 458 | 458 | ["'._("Month").'", "'._("# of Flights").'"], '; |
| 459 | 459 | $year_data = ''; |
| 460 | - foreach($year_array as $year_item) |
|
| 460 | + foreach ($year_array as $year_item) |
|
| 461 | 461 | { |
| 462 | - $year_data .= '[ "'.date('F, Y',strtotime($year_item['year_name'].'-'.$year_item['month_name'].'-01')).'",'.$year_item['date_count'].'],'; |
|
| 462 | + $year_data .= '[ "'.date('F, Y', strtotime($year_item['year_name'].'-'.$year_item['month_name'].'-01')).'",'.$year_item['date_count'].'],'; |
|
| 463 | 463 | } |
| 464 | 464 | $year_data = substr($year_data, 0, -1); |
| 465 | 465 | print $year_data; |
@@ -487,7 +487,7 @@ discard block |
||
| 487 | 487 | <a href="<?php print $globalURL; ?>/statistics/year" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
| 488 | 488 | </div> |
| 489 | 489 | </div> |
| 490 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
| 490 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
| 491 | 491 | |
| 492 | 492 | <div class="col-md-6"> |
| 493 | 493 | <h2><?php echo _("Busiest Day in the last Month"); ?></h2> |
@@ -503,9 +503,9 @@ discard block |
||
| 503 | 503 | var data = google.visualization.arrayToDataTable([ |
| 504 | 504 | ["'._("Day").'", "'._("# of Flights").'"], '; |
| 505 | 505 | $month_data = ''; |
| 506 | - foreach($month_array as $month_item) |
|
| 506 | + foreach ($month_array as $month_item) |
|
| 507 | 507 | { |
| 508 | - $month_data .= '[ "'.date('F j, Y',strtotime($month_item['date_name'])).'",'.$month_item['date_count'].'],'; |
|
| 508 | + $month_data .= '[ "'.date('F j, Y', strtotime($month_item['date_name'])).'",'.$month_item['date_count'].'],'; |
|
| 509 | 509 | } |
| 510 | 510 | $month_data = substr($month_data, 0, -1); |
| 511 | 511 | print $month_data; |
@@ -533,7 +533,7 @@ discard block |
||
| 533 | 533 | <a href="<?php print $globalURL; ?>/statistics/month" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
| 534 | 534 | </div> |
| 535 | 535 | </div> |
| 536 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
| 536 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
| 537 | 537 | |
| 538 | 538 | <div class="col-md-6"> |
| 539 | 539 | <h2><?php echo _("Busiest Day in the last 7 Days"); ?></h2> |
@@ -550,7 +550,7 @@ discard block |
||
| 550 | 550 | ["'._("Date").'", "'._("# of Flights").'"], '; |
| 551 | 551 | $date_data = ''; |
| 552 | 552 | |
| 553 | - foreach($date_array as $date_item) |
|
| 553 | + foreach ($date_array as $date_item) |
|
| 554 | 554 | { |
| 555 | 555 | $date_data .= '[ "'.date("F j, Y", strtotime($date_item['date_name'])).'",'.$date_item['date_count'].'],'; |
| 556 | 556 | } |
@@ -580,12 +580,12 @@ discard block |
||
| 580 | 580 | <a href="<?php print $globalURL; ?>/statistics/date" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
| 581 | 581 | </div> |
| 582 | 582 | </div> |
| 583 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
| 583 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
| 584 | 584 | |
| 585 | 585 | <div class="col-md-6"> |
| 586 | 586 | <h2><?php echo _("Busiest Time of the Day"); ?></h2> |
| 587 | 587 | <?php |
| 588 | - $hour_array = $Stats->countAllHours('hour',$airline_icao); |
|
| 588 | + $hour_array = $Stats->countAllHours('hour', $airline_icao); |
|
| 589 | 589 | if (empty($hour_array)) print _("No data available"); |
| 590 | 590 | else { |
| 591 | 591 | |
@@ -597,7 +597,7 @@ discard block |
||
| 597 | 597 | var data = google.visualization.arrayToDataTable([ |
| 598 | 598 | ["'._("Hour").'", "'._("# of Flights").'"], '; |
| 599 | 599 | $hour_data = ''; |
| 600 | - foreach($hour_array as $hour_item) |
|
| 600 | + foreach ($hour_array as $hour_item) |
|
| 601 | 601 | { |
| 602 | 602 | $hour_data .= '[ "'.$hour_item['hour_name'].':00",'.$hour_item['hour_count'].'],'; |
| 603 | 603 | } |
@@ -627,21 +627,21 @@ discard block |
||
| 627 | 627 | <a href="<?php print $globalURL; ?>/statistics/time" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
| 628 | 628 | </div> |
| 629 | 629 | </div> |
| 630 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
| 630 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
| 631 | 631 | </div> |
| 632 | 632 | <?php |
| 633 | 633 | if ($airline_icao == '') { |
| 634 | 634 | ?> |
| 635 | 635 | <div class="row column"> |
| 636 | 636 | <?php |
| 637 | - $polar = $Stats->getStatsSource(date('Y-m-d'),'polar'); |
|
| 637 | + $polar = $Stats->getStatsSource(date('Y-m-d'), 'polar'); |
|
| 638 | 638 | if (!empty($polar)) { |
| 639 | 639 | print '<h2>'._("Coverage pattern").'</h2>'; |
| 640 | 640 | foreach ($polar as $eachpolar) { |
| 641 | 641 | unset($polar_data); |
| 642 | 642 | $Spotter = new Spotter(); |
| 643 | 643 | $data = json_decode($eachpolar['source_data']); |
| 644 | - foreach($data as $value => $key) { |
|
| 644 | + foreach ($data as $value => $key) { |
|
| 645 | 645 | $direction = $Spotter->parseDirection(($value*22.5)); |
| 646 | 646 | $distance = $key; |
| 647 | 647 | $unit = 'km'; |
@@ -661,7 +661,7 @@ discard block |
||
| 661 | 661 | ?> |
| 662 | 662 | <div class="col-md-6"> |
| 663 | 663 | <h4><?php print $eachpolar['source_name']; ?></h4> |
| 664 | - <div id="polar-<?php print str_replace(' ','_',strtolower($eachpolar['source_name'])); ?>" class="chart" width="100%"></div> |
|
| 664 | + <div id="polar-<?php print str_replace(' ', '_', strtolower($eachpolar['source_name'])); ?>" class="chart" width="100%"></div> |
|
| 665 | 665 | <script> |
| 666 | 666 | (function() { |
| 667 | 667 | var margin = {top: 100, right: 100, bottom: 100, left: 100}, |
@@ -685,7 +685,7 @@ discard block |
||
| 685 | 685 | color: color, |
| 686 | 686 | unit: '<?php echo $unit; ?>' |
| 687 | 687 | }; |
| 688 | - RadarChart("#polar-<?php print str_replace(' ','_',strtolower($eachpolar['source_name'])); ?>", data, radarChartOptions); |
|
| 688 | + RadarChart("#polar-<?php print str_replace(' ', '_', strtolower($eachpolar['source_name'])); ?>", data, radarChartOptions); |
|
| 689 | 689 | })(); |
| 690 | 690 | </script> |
| 691 | 691 | </div> |
@@ -697,19 +697,19 @@ discard block |
||
| 697 | 697 | <div class="row column"> |
| 698 | 698 | <div class="col-md-6"> |
| 699 | 699 | <?php |
| 700 | - $msg = $Stats->getStatsSource(date('Y-m-d'),'msg'); |
|
| 700 | + $msg = $Stats->getStatsSource(date('Y-m-d'), 'msg'); |
|
| 701 | 701 | if (!empty($msg)) { |
| 702 | 702 | print '<h2>'._("Messages received").'</h2>'; |
| 703 | 703 | foreach ($msg as $eachmsg) { |
| 704 | 704 | //$eachmsg = $msg[0]; |
| 705 | 705 | $data = $eachmsg['source_data']; |
| 706 | - if ($data > 500) $max = (round(($data+100)/100))*100; |
|
| 706 | + if ($data > 500) $max = (round(($data + 100)/100))*100; |
|
| 707 | 707 | else $max = 500; |
| 708 | 708 | ?> |
| 709 | - <div id="msg-<?php print str_replace(' ','_',strtolower($eachmsg['source_name'])); ?>" class="col-md-4"></div> |
|
| 709 | + <div id="msg-<?php print str_replace(' ', '_', strtolower($eachmsg['source_name'])); ?>" class="col-md-4"></div> |
|
| 710 | 710 | <script> |
| 711 | 711 | var g = new JustGage({ |
| 712 | - id: "msg-<?php print str_replace(' ','_',strtolower($eachmsg['source_name'])); ?>", |
|
| 712 | + id: "msg-<?php print str_replace(' ', '_', strtolower($eachmsg['source_name'])); ?>", |
|
| 713 | 713 | value: <?php echo $data; ?>, |
| 714 | 714 | min: 0, |
| 715 | 715 | max: <?php print $max; ?>, |
@@ -729,12 +729,12 @@ discard block |
||
| 729 | 729 | <div class="row column"> |
| 730 | 730 | |
| 731 | 731 | <?php |
| 732 | - $hist = $Stats->getStatsSource(date('Y-m-d'),'hist'); |
|
| 732 | + $hist = $Stats->getStatsSource(date('Y-m-d'), 'hist'); |
|
| 733 | 733 | foreach ($hist as $hists) { |
| 734 | 734 | $hist_data = ''; |
| 735 | 735 | $source = $hists['source_name']; |
| 736 | 736 | $hist_array = json_decode($hists['source_data']); |
| 737 | - foreach($hist_array as $distance => $nb) |
|
| 737 | + foreach ($hist_array as $distance => $nb) |
|
| 738 | 738 | { |
| 739 | 739 | $unit = 'km'; |
| 740 | 740 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
@@ -752,13 +752,13 @@ discard block |
||
| 752 | 752 | $hist_data = substr($hist_data, 0, -1); |
| 753 | 753 | ?> |
| 754 | 754 | <div class="col-md-6"> |
| 755 | - <h2><?php echo sprintf(_("Flights Distance for %s"),$source); ?></h2> |
|
| 755 | + <h2><?php echo sprintf(_("Flights Distance for %s"), $source); ?></h2> |
|
| 756 | 756 | <?php |
| 757 | - print '<div id="charthist-'.str_replace(' ','_',strtolower($source)).'" class="chart" width="100%"></div> |
|
| 757 | + print '<div id="charthist-'.str_replace(' ', '_', strtolower($source)).'" class="chart" width="100%"></div> |
|
| 758 | 758 | <script> |
| 759 | 759 | google.load("visualization", "1", {packages:["corechart"]}); |
| 760 | - google.setOnLoadCallback(drawCharthist_'.str_replace(' ','_',strtolower($source)).'); |
|
| 761 | - function drawCharthist_'.str_replace(' ','_',strtolower($source)).'() { |
|
| 760 | + google.setOnLoadCallback(drawCharthist_'.str_replace(' ', '_', strtolower($source)).'); |
|
| 761 | + function drawCharthist_'.str_replace(' ', '_', strtolower($source)).'() { |
|
| 762 | 762 | var data = google.visualization.arrayToDataTable([ |
| 763 | 763 | ["'._("Distance").'", "'._("# of Flights").'"], '; |
| 764 | 764 | print $hist_data; |
@@ -773,16 +773,16 @@ discard block |
||
| 773 | 773 | colors: ["#1a3151"] |
| 774 | 774 | }; |
| 775 | 775 | |
| 776 | - var chart = new google.visualization.AreaChart(document.getElementById("charthist-'.str_replace(' ','_',strtolower($source)).'")); |
|
| 776 | + var chart = new google.visualization.AreaChart(document.getElementById("charthist-'.str_replace(' ', '_', strtolower($source)).'")); |
|
| 777 | 777 | chart.draw(data, options); |
| 778 | 778 | } |
| 779 | 779 | $(window).resize(function(){ |
| 780 | - drawCharthist_'.str_replace(' ','_',strtolower($source)).'(); |
|
| 780 | + drawCharthist_'.str_replace(' ', '_', strtolower($source)).'(); |
|
| 781 | 781 | }); |
| 782 | 782 | </script>'; |
| 783 | 783 | ?> |
| 784 | 784 | </div> |
| 785 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
| 785 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
| 786 | 786 | <?php |
| 787 | 787 | } |
| 788 | 788 | ?> |
@@ -13,10 +13,10 @@ discard block |
||
| 13 | 13 | } |
| 14 | 14 | |
| 15 | 15 | /** |
| 16 | - * Get SQL query part for filter used |
|
| 17 | - * @param Array $filter the filter |
|
| 18 | - * @return Array the SQL part |
|
| 19 | - */ |
|
| 16 | + * Get SQL query part for filter used |
|
| 17 | + * @param Array $filter the filter |
|
| 18 | + * @return Array the SQL part |
|
| 19 | + */ |
|
| 20 | 20 | public function getFilter($filter = array(),$where = false,$and = false) { |
| 21 | 21 | global $globalFilter; |
| 22 | 22 | if (is_array($globalFilter)) $filter = array_merge($globalFilter,$filter); |
@@ -51,14 +51,14 @@ discard block |
||
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | /** |
| 54 | - * Executes the SQL statements to get the spotter information |
|
| 55 | - * |
|
| 56 | - * @param String $query the SQL query |
|
| 57 | - * @param Array $params parameter of the query |
|
| 58 | - * @param String $limitQuery the limit query |
|
| 59 | - * @return Array the spotter information |
|
| 60 | - * |
|
| 61 | - */ |
|
| 54 | + * Executes the SQL statements to get the spotter information |
|
| 55 | + * |
|
| 56 | + * @param String $query the SQL query |
|
| 57 | + * @param Array $params parameter of the query |
|
| 58 | + * @param String $limitQuery the limit query |
|
| 59 | + * @return Array the spotter information |
|
| 60 | + * |
|
| 61 | + */ |
|
| 62 | 62 | public function getDataFromDB($query, $params = array(), $limitQuery = '') |
| 63 | 63 | { |
| 64 | 64 | global $globalSquawkCountry, $globalIVAO, $globalVATSIM, $globalphpVMS; |
@@ -221,11 +221,11 @@ discard block |
||
| 221 | 221 | if ($aircraft_array[0]['aircraft_shadow'] != NULL) { |
| 222 | 222 | $temp_array['aircraft_shadow'] = $aircraft_array[0]['aircraft_shadow']; |
| 223 | 223 | } else $temp_array['aircraft_shadow'] = 'default.png'; |
| 224 | - } else { |
|
| 225 | - $temp_array['aircraft_shadow'] = 'default.png'; |
|
| 224 | + } else { |
|
| 225 | + $temp_array['aircraft_shadow'] = 'default.png'; |
|
| 226 | 226 | $temp_array['aircraft_name'] = 'N/A'; |
| 227 | 227 | $temp_array['aircraft_manufacturer'] = 'N/A'; |
| 228 | - } |
|
| 228 | + } |
|
| 229 | 229 | } |
| 230 | 230 | $fromsource = NULL; |
| 231 | 231 | if (isset($row['format_source']) && $row['format_source'] == 'vatsimtxt') $fromsource = 'vatsim'; |
@@ -407,11 +407,11 @@ discard block |
||
| 407 | 407 | |
| 408 | 408 | |
| 409 | 409 | /** |
| 410 | - * Gets all the spotter information |
|
| 411 | - * |
|
| 412 | - * @return Array the spotter information |
|
| 413 | - * |
|
| 414 | - */ |
|
| 410 | + * Gets all the spotter information |
|
| 411 | + * |
|
| 412 | + * @return Array the spotter information |
|
| 413 | + * |
|
| 414 | + */ |
|
| 415 | 415 | 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 = '',$filter = array()) |
| 416 | 416 | { |
| 417 | 417 | global $globalTimezone, $globalDBdriver; |
@@ -758,11 +758,11 @@ discard block |
||
| 758 | 758 | |
| 759 | 759 | |
| 760 | 760 | /** |
| 761 | - * Gets all the spotter information based on the latest data entry |
|
| 762 | - * |
|
| 763 | - * @return Array the spotter information |
|
| 764 | - * |
|
| 765 | - */ |
|
| 761 | + * Gets all the spotter information based on the latest data entry |
|
| 762 | + * |
|
| 763 | + * @return Array the spotter information |
|
| 764 | + * |
|
| 765 | + */ |
|
| 766 | 766 | public function getLatestSpotterData($limit = '', $sort = '', $filter = array()) |
| 767 | 767 | { |
| 768 | 768 | global $global_query; |
@@ -801,12 +801,12 @@ discard block |
||
| 801 | 801 | } |
| 802 | 802 | |
| 803 | 803 | |
| 804 | - /** |
|
| 805 | - * Gets all the spotter information based on a user's latitude and longitude |
|
| 806 | - * |
|
| 807 | - * @return Array the spotter information |
|
| 808 | - * |
|
| 809 | - */ |
|
| 804 | + /** |
|
| 805 | + * Gets all the spotter information based on a user's latitude and longitude |
|
| 806 | + * |
|
| 807 | + * @return Array the spotter information |
|
| 808 | + * |
|
| 809 | + */ |
|
| 810 | 810 | public function getLatestSpotterForLayar($lat, $lng, $radius, $interval) |
| 811 | 811 | { |
| 812 | 812 | date_default_timezone_set('UTC'); |
@@ -834,7 +834,7 @@ discard block |
||
| 834 | 834 | return false; |
| 835 | 835 | } |
| 836 | 836 | } |
| 837 | - $additional_query = ''; |
|
| 837 | + $additional_query = ''; |
|
| 838 | 838 | if ($interval != "") |
| 839 | 839 | { |
| 840 | 840 | if (!is_string($interval)) |
@@ -874,12 +874,12 @@ discard block |
||
| 874 | 874 | } |
| 875 | 875 | |
| 876 | 876 | |
| 877 | - /** |
|
| 878 | - * Gets all the spotter information sorted by the newest aircraft type |
|
| 879 | - * |
|
| 880 | - * @return Array the spotter information |
|
| 881 | - * |
|
| 882 | - */ |
|
| 877 | + /** |
|
| 878 | + * Gets all the spotter information sorted by the newest aircraft type |
|
| 879 | + * |
|
| 880 | + * @return Array the spotter information |
|
| 881 | + * |
|
| 882 | + */ |
|
| 883 | 883 | public function getNewestSpotterDataSortedByAircraftType($limit = '', $sort = '',$filter = array()) |
| 884 | 884 | { |
| 885 | 885 | global $global_query; |
@@ -920,11 +920,11 @@ discard block |
||
| 920 | 920 | |
| 921 | 921 | |
| 922 | 922 | /** |
| 923 | - * Gets all the spotter information sorted by the newest aircraft registration |
|
| 924 | - * |
|
| 925 | - * @return Array the spotter information |
|
| 926 | - * |
|
| 927 | - */ |
|
| 923 | + * Gets all the spotter information sorted by the newest aircraft registration |
|
| 924 | + * |
|
| 925 | + * @return Array the spotter information |
|
| 926 | + * |
|
| 927 | + */ |
|
| 928 | 928 | public function getNewestSpotterDataSortedByAircraftRegistration($limit = '', $sort = '', $filter = array()) |
| 929 | 929 | { |
| 930 | 930 | global $global_query; |
@@ -964,11 +964,11 @@ discard block |
||
| 964 | 964 | |
| 965 | 965 | |
| 966 | 966 | /** |
| 967 | - * Gets all the spotter information sorted by the newest airline |
|
| 968 | - * |
|
| 969 | - * @return Array the spotter information |
|
| 970 | - * |
|
| 971 | - */ |
|
| 967 | + * Gets all the spotter information sorted by the newest airline |
|
| 968 | + * |
|
| 969 | + * @return Array the spotter information |
|
| 970 | + * |
|
| 971 | + */ |
|
| 972 | 972 | public function getNewestSpotterDataSortedByAirline($limit = '', $sort = '',$filter = array()) |
| 973 | 973 | { |
| 974 | 974 | global $global_query; |
@@ -1007,12 +1007,12 @@ discard block |
||
| 1007 | 1007 | } |
| 1008 | 1008 | |
| 1009 | 1009 | |
| 1010 | - /** |
|
| 1011 | - * Gets all the spotter information sorted by the newest departure airport |
|
| 1012 | - * |
|
| 1013 | - * @return Array the spotter information |
|
| 1014 | - * |
|
| 1015 | - */ |
|
| 1010 | + /** |
|
| 1011 | + * Gets all the spotter information sorted by the newest departure airport |
|
| 1012 | + * |
|
| 1013 | + * @return Array the spotter information |
|
| 1014 | + * |
|
| 1015 | + */ |
|
| 1016 | 1016 | public function getNewestSpotterDataSortedByDepartureAirport($limit = '', $sort = '', $filter = array()) |
| 1017 | 1017 | { |
| 1018 | 1018 | global $global_query; |
@@ -1054,11 +1054,11 @@ discard block |
||
| 1054 | 1054 | |
| 1055 | 1055 | |
| 1056 | 1056 | /** |
| 1057 | - * Gets all the spotter information sorted by the newest arrival airport |
|
| 1058 | - * |
|
| 1059 | - * @return Array the spotter information |
|
| 1060 | - * |
|
| 1061 | - */ |
|
| 1057 | + * Gets all the spotter information sorted by the newest arrival airport |
|
| 1058 | + * |
|
| 1059 | + * @return Array the spotter information |
|
| 1060 | + * |
|
| 1061 | + */ |
|
| 1062 | 1062 | public function getNewestSpotterDataSortedByArrivalAirport($limit = '', $sort = '', $filter = array()) |
| 1063 | 1063 | { |
| 1064 | 1064 | global $global_query; |
@@ -1097,11 +1097,11 @@ discard block |
||
| 1097 | 1097 | |
| 1098 | 1098 | |
| 1099 | 1099 | /** |
| 1100 | - * Gets all the spotter information based on the spotter id |
|
| 1101 | - * |
|
| 1102 | - * @return Array the spotter information |
|
| 1103 | - * |
|
| 1104 | - */ |
|
| 1100 | + * Gets all the spotter information based on the spotter id |
|
| 1101 | + * |
|
| 1102 | + * @return Array the spotter information |
|
| 1103 | + * |
|
| 1104 | + */ |
|
| 1105 | 1105 | public function getSpotterDataByID($id = '') |
| 1106 | 1106 | { |
| 1107 | 1107 | global $global_query; |
@@ -1123,11 +1123,11 @@ discard block |
||
| 1123 | 1123 | |
| 1124 | 1124 | |
| 1125 | 1125 | /** |
| 1126 | - * Gets all the spotter information based on the callsign |
|
| 1127 | - * |
|
| 1128 | - * @return Array the spotter information |
|
| 1129 | - * |
|
| 1130 | - */ |
|
| 1126 | + * Gets all the spotter information based on the callsign |
|
| 1127 | + * |
|
| 1128 | + * @return Array the spotter information |
|
| 1129 | + * |
|
| 1130 | + */ |
|
| 1131 | 1131 | public function getSpotterDataByIdent($ident = '', $limit = '', $sort = '') |
| 1132 | 1132 | { |
| 1133 | 1133 | global $global_query; |
@@ -1180,11 +1180,11 @@ discard block |
||
| 1180 | 1180 | |
| 1181 | 1181 | |
| 1182 | 1182 | /** |
| 1183 | - * Gets all the spotter information based on the aircraft type |
|
| 1184 | - * |
|
| 1185 | - * @return Array the spotter information |
|
| 1186 | - * |
|
| 1187 | - */ |
|
| 1183 | + * Gets all the spotter information based on the aircraft type |
|
| 1184 | + * |
|
| 1185 | + * @return Array the spotter information |
|
| 1186 | + * |
|
| 1187 | + */ |
|
| 1188 | 1188 | public function getSpotterDataByAircraft($aircraft_type = '', $limit = '', $sort = '', $filter = array()) |
| 1189 | 1189 | { |
| 1190 | 1190 | global $global_query; |
@@ -1238,11 +1238,11 @@ discard block |
||
| 1238 | 1238 | |
| 1239 | 1239 | |
| 1240 | 1240 | /** |
| 1241 | - * Gets all the spotter information based on the aircraft registration |
|
| 1242 | - * |
|
| 1243 | - * @return Array the spotter information |
|
| 1244 | - * |
|
| 1245 | - */ |
|
| 1241 | + * Gets all the spotter information based on the aircraft registration |
|
| 1242 | + * |
|
| 1243 | + * @return Array the spotter information |
|
| 1244 | + * |
|
| 1245 | + */ |
|
| 1246 | 1246 | public function getSpotterDataByRegistration($registration = '', $limit = '', $sort = '', $filter = array()) |
| 1247 | 1247 | { |
| 1248 | 1248 | global $global_query; |
@@ -1298,11 +1298,11 @@ discard block |
||
| 1298 | 1298 | |
| 1299 | 1299 | |
| 1300 | 1300 | /** |
| 1301 | - * Gets all the spotter information based on the airline |
|
| 1302 | - * |
|
| 1303 | - * @return Array the spotter information |
|
| 1304 | - * |
|
| 1305 | - */ |
|
| 1301 | + * Gets all the spotter information based on the airline |
|
| 1302 | + * |
|
| 1303 | + * @return Array the spotter information |
|
| 1304 | + * |
|
| 1305 | + */ |
|
| 1306 | 1306 | public function getSpotterDataByAirline($airline = '', $limit = '', $sort = '') |
| 1307 | 1307 | { |
| 1308 | 1308 | global $global_query; |
@@ -1354,11 +1354,11 @@ discard block |
||
| 1354 | 1354 | |
| 1355 | 1355 | |
| 1356 | 1356 | /** |
| 1357 | - * Gets all the spotter information based on the airport |
|
| 1358 | - * |
|
| 1359 | - * @return Array the spotter information |
|
| 1360 | - * |
|
| 1361 | - */ |
|
| 1357 | + * Gets all the spotter information based on the airport |
|
| 1358 | + * |
|
| 1359 | + * @return Array the spotter information |
|
| 1360 | + * |
|
| 1361 | + */ |
|
| 1362 | 1362 | public function getSpotterDataByAirport($airport = '', $limit = '', $sort = '') |
| 1363 | 1363 | { |
| 1364 | 1364 | global $global_query; |
@@ -1411,11 +1411,11 @@ discard block |
||
| 1411 | 1411 | |
| 1412 | 1412 | |
| 1413 | 1413 | /** |
| 1414 | - * Gets all the spotter information based on the date |
|
| 1415 | - * |
|
| 1416 | - * @return Array the spotter information |
|
| 1417 | - * |
|
| 1418 | - */ |
|
| 1414 | + * Gets all the spotter information based on the date |
|
| 1415 | + * |
|
| 1416 | + * @return Array the spotter information |
|
| 1417 | + * |
|
| 1418 | + */ |
|
| 1419 | 1419 | public function getSpotterDataByDate($date = '', $limit = '', $sort = '',$filter = array()) |
| 1420 | 1420 | { |
| 1421 | 1421 | global $global_query, $globalTimezone, $globalDBdriver; |
@@ -1492,11 +1492,11 @@ discard block |
||
| 1492 | 1492 | |
| 1493 | 1493 | |
| 1494 | 1494 | /** |
| 1495 | - * Gets all the spotter information based on the country name |
|
| 1496 | - * |
|
| 1497 | - * @return Array the spotter information |
|
| 1498 | - * |
|
| 1499 | - */ |
|
| 1495 | + * Gets all the spotter information based on the country name |
|
| 1496 | + * |
|
| 1497 | + * @return Array the spotter information |
|
| 1498 | + * |
|
| 1499 | + */ |
|
| 1500 | 1500 | public function getSpotterDataByCountry($country = '', $limit = '', $sort = '') |
| 1501 | 1501 | { |
| 1502 | 1502 | global $global_query; |
@@ -1549,11 +1549,11 @@ discard block |
||
| 1549 | 1549 | |
| 1550 | 1550 | |
| 1551 | 1551 | /** |
| 1552 | - * Gets all the spotter information based on the manufacturer name |
|
| 1553 | - * |
|
| 1554 | - * @return Array the spotter information |
|
| 1555 | - * |
|
| 1556 | - */ |
|
| 1552 | + * Gets all the spotter information based on the manufacturer name |
|
| 1553 | + * |
|
| 1554 | + * @return Array the spotter information |
|
| 1555 | + * |
|
| 1556 | + */ |
|
| 1557 | 1557 | public function getSpotterDataByManufacturer($aircraft_manufacturer = '', $limit = '', $sort = '') |
| 1558 | 1558 | { |
| 1559 | 1559 | global $global_query; |
@@ -1608,13 +1608,13 @@ discard block |
||
| 1608 | 1608 | |
| 1609 | 1609 | |
| 1610 | 1610 | /** |
| 1611 | - * Gets a list of all aircraft that take a route |
|
| 1612 | - * |
|
| 1613 | - * @param String $departure_airport_icao ICAO code of departure airport |
|
| 1614 | - * @param String $arrival_airport_icao ICAO code of arrival airport |
|
| 1615 | - * @return Array the spotter information |
|
| 1616 | - * |
|
| 1617 | - */ |
|
| 1611 | + * Gets a list of all aircraft that take a route |
|
| 1612 | + * |
|
| 1613 | + * @param String $departure_airport_icao ICAO code of departure airport |
|
| 1614 | + * @param String $arrival_airport_icao ICAO code of arrival airport |
|
| 1615 | + * @return Array the spotter information |
|
| 1616 | + * |
|
| 1617 | + */ |
|
| 1618 | 1618 | public function getSpotterDataByRoute($departure_airport_icao = '', $arrival_airport_icao = '', $limit = '', $sort = '') |
| 1619 | 1619 | { |
| 1620 | 1620 | global $global_query; |
@@ -1680,11 +1680,11 @@ discard block |
||
| 1680 | 1680 | |
| 1681 | 1681 | |
| 1682 | 1682 | /** |
| 1683 | - * Gets all the spotter information based on the special column in the table |
|
| 1684 | - * |
|
| 1685 | - * @return Array the spotter information |
|
| 1686 | - * |
|
| 1687 | - */ |
|
| 1683 | + * Gets all the spotter information based on the special column in the table |
|
| 1684 | + * |
|
| 1685 | + * @return Array the spotter information |
|
| 1686 | + * |
|
| 1687 | + */ |
|
| 1688 | 1688 | public function getSpotterDataByHighlight($limit = '', $sort = '', $filter = array()) |
| 1689 | 1689 | { |
| 1690 | 1690 | global $global_query; |
@@ -1723,11 +1723,11 @@ discard block |
||
| 1723 | 1723 | } |
| 1724 | 1724 | |
| 1725 | 1725 | /** |
| 1726 | - * Gets all the highlight based on a aircraft registration |
|
| 1727 | - * |
|
| 1728 | - * @return String the highlight text |
|
| 1729 | - * |
|
| 1730 | - */ |
|
| 1726 | + * Gets all the highlight based on a aircraft registration |
|
| 1727 | + * |
|
| 1728 | + * @return String the highlight text |
|
| 1729 | + * |
|
| 1730 | + */ |
|
| 1731 | 1731 | public function getHighlightByRegistration($registration,$filter = array()) |
| 1732 | 1732 | { |
| 1733 | 1733 | global $global_query; |
@@ -1749,13 +1749,13 @@ discard block |
||
| 1749 | 1749 | |
| 1750 | 1750 | |
| 1751 | 1751 | /** |
| 1752 | - * Gets the squawk usage from squawk code |
|
| 1753 | - * |
|
| 1754 | - * @param String $squawk squawk code |
|
| 1755 | - * @param String $country country |
|
| 1756 | - * @return String usage |
|
| 1757 | - * |
|
| 1758 | - */ |
|
| 1752 | + * Gets the squawk usage from squawk code |
|
| 1753 | + * |
|
| 1754 | + * @param String $squawk squawk code |
|
| 1755 | + * @param String $country country |
|
| 1756 | + * @return String usage |
|
| 1757 | + * |
|
| 1758 | + */ |
|
| 1759 | 1759 | public function getSquawkUsage($squawk = '',$country = 'FR') |
| 1760 | 1760 | { |
| 1761 | 1761 | |
@@ -1775,12 +1775,12 @@ discard block |
||
| 1775 | 1775 | } |
| 1776 | 1776 | |
| 1777 | 1777 | /** |
| 1778 | - * Gets the airport icao from the iata |
|
| 1779 | - * |
|
| 1780 | - * @param String $airport_iata the iata code of the airport |
|
| 1781 | - * @return String airport iata |
|
| 1782 | - * |
|
| 1783 | - */ |
|
| 1778 | + * Gets the airport icao from the iata |
|
| 1779 | + * |
|
| 1780 | + * @param String $airport_iata the iata code of the airport |
|
| 1781 | + * @return String airport iata |
|
| 1782 | + * |
|
| 1783 | + */ |
|
| 1784 | 1784 | public function getAirportIcao($airport_iata = '') |
| 1785 | 1785 | { |
| 1786 | 1786 | |
@@ -1799,14 +1799,14 @@ discard block |
||
| 1799 | 1799 | } |
| 1800 | 1800 | |
| 1801 | 1801 | /** |
| 1802 | - * Gets the airport distance |
|
| 1803 | - * |
|
| 1804 | - * @param String $airport_icao the icao code of the airport |
|
| 1805 | - * @param Float $latitude the latitude |
|
| 1806 | - * @param Float $longitude the longitude |
|
| 1807 | - * @return Float distance to the airport |
|
| 1808 | - * |
|
| 1809 | - */ |
|
| 1802 | + * Gets the airport distance |
|
| 1803 | + * |
|
| 1804 | + * @param String $airport_icao the icao code of the airport |
|
| 1805 | + * @param Float $latitude the latitude |
|
| 1806 | + * @param Float $longitude the longitude |
|
| 1807 | + * @return Float distance to the airport |
|
| 1808 | + * |
|
| 1809 | + */ |
|
| 1810 | 1810 | public function getAirportDistance($airport_icao,$latitude,$longitude) |
| 1811 | 1811 | { |
| 1812 | 1812 | |
@@ -1826,12 +1826,12 @@ discard block |
||
| 1826 | 1826 | } |
| 1827 | 1827 | |
| 1828 | 1828 | /** |
| 1829 | - * Gets the airport info based on the icao |
|
| 1830 | - * |
|
| 1831 | - * @param String $airport the icao code of the airport |
|
| 1832 | - * @return Array airport information |
|
| 1833 | - * |
|
| 1834 | - */ |
|
| 1829 | + * Gets the airport info based on the icao |
|
| 1830 | + * |
|
| 1831 | + * @param String $airport the icao code of the airport |
|
| 1832 | + * @return Array airport information |
|
| 1833 | + * |
|
| 1834 | + */ |
|
| 1835 | 1835 | public function getAllAirportInfo($airport = '') |
| 1836 | 1836 | { |
| 1837 | 1837 | |
@@ -1877,12 +1877,12 @@ discard block |
||
| 1877 | 1877 | } |
| 1878 | 1878 | |
| 1879 | 1879 | /** |
| 1880 | - * Gets the airport info based on the country |
|
| 1881 | - * |
|
| 1882 | - * @param Array $countries Airports countries |
|
| 1883 | - * @return Array airport information |
|
| 1884 | - * |
|
| 1885 | - */ |
|
| 1880 | + * Gets the airport info based on the country |
|
| 1881 | + * |
|
| 1882 | + * @param Array $countries Airports countries |
|
| 1883 | + * @return Array airport information |
|
| 1884 | + * |
|
| 1885 | + */ |
|
| 1886 | 1886 | public function getAllAirportInfobyCountry($countries) |
| 1887 | 1887 | { |
| 1888 | 1888 | $lst_countries = ''; |
@@ -1920,12 +1920,12 @@ discard block |
||
| 1920 | 1920 | } |
| 1921 | 1921 | |
| 1922 | 1922 | /** |
| 1923 | - * Gets airports info based on the coord |
|
| 1924 | - * |
|
| 1925 | - * @param Array $coord Airports longitude min,latitude min, longitude max, latitude max |
|
| 1926 | - * @return Array airport information |
|
| 1927 | - * |
|
| 1928 | - */ |
|
| 1923 | + * Gets airports info based on the coord |
|
| 1924 | + * |
|
| 1925 | + * @param Array $coord Airports longitude min,latitude min, longitude max, latitude max |
|
| 1926 | + * @return Array airport information |
|
| 1927 | + * |
|
| 1928 | + */ |
|
| 1929 | 1929 | public function getAllAirportInfobyCoord($coord) |
| 1930 | 1930 | { |
| 1931 | 1931 | global $globalDBdriver; |
@@ -1956,12 +1956,12 @@ discard block |
||
| 1956 | 1956 | } |
| 1957 | 1957 | |
| 1958 | 1958 | /** |
| 1959 | - * Gets waypoints info based on the coord |
|
| 1960 | - * |
|
| 1961 | - * @param Array $coord waypoints coord |
|
| 1962 | - * @return Array airport information |
|
| 1963 | - * |
|
| 1964 | - */ |
|
| 1959 | + * Gets waypoints info based on the coord |
|
| 1960 | + * |
|
| 1961 | + * @param Array $coord waypoints coord |
|
| 1962 | + * @return Array airport information |
|
| 1963 | + * |
|
| 1964 | + */ |
|
| 1965 | 1965 | public function getAllWaypointsInfobyCoord($coord) |
| 1966 | 1966 | { |
| 1967 | 1967 | if (is_array($coord)) { |
@@ -1995,12 +1995,12 @@ discard block |
||
| 1995 | 1995 | |
| 1996 | 1996 | |
| 1997 | 1997 | /** |
| 1998 | - * Gets the airline info based on the icao code or iata code |
|
| 1999 | - * |
|
| 2000 | - * @param String $airline_icao the iata code of the airport |
|
| 2001 | - * @return Array airport information |
|
| 2002 | - * |
|
| 2003 | - */ |
|
| 1998 | + * Gets the airline info based on the icao code or iata code |
|
| 1999 | + * |
|
| 2000 | + * @param String $airline_icao the iata code of the airport |
|
| 2001 | + * @return Array airport information |
|
| 2002 | + * |
|
| 2003 | + */ |
|
| 2004 | 2004 | public function getAllAirlineInfo($airline_icao, $fromsource = NULL) |
| 2005 | 2005 | { |
| 2006 | 2006 | $airline_icao = strtoupper(filter_var($airline_icao,FILTER_SANITIZE_STRING)); |
@@ -2029,7 +2029,7 @@ discard block |
||
| 2029 | 2029 | } else { |
| 2030 | 2030 | $sth->execute(array(':airline_icao' => $airline_icao,':fromsource' => $fromsource)); |
| 2031 | 2031 | } |
| 2032 | - /* |
|
| 2032 | + /* |
|
| 2033 | 2033 | $airline_array = array(); |
| 2034 | 2034 | $temp_array = array(); |
| 2035 | 2035 | |
@@ -2052,12 +2052,12 @@ discard block |
||
| 2052 | 2052 | |
| 2053 | 2053 | |
| 2054 | 2054 | /** |
| 2055 | - * Gets the aircraft info based on the aircraft type |
|
| 2056 | - * |
|
| 2057 | - * @param String $aircraft_type the aircraft type |
|
| 2058 | - * @return Array aircraft information |
|
| 2059 | - * |
|
| 2060 | - */ |
|
| 2055 | + * Gets the aircraft info based on the aircraft type |
|
| 2056 | + * |
|
| 2057 | + * @param String $aircraft_type the aircraft type |
|
| 2058 | + * @return Array aircraft information |
|
| 2059 | + * |
|
| 2060 | + */ |
|
| 2061 | 2061 | public function getAllAircraftInfo($aircraft_type) |
| 2062 | 2062 | { |
| 2063 | 2063 | $aircraft_type = filter_var($aircraft_type,FILTER_SANITIZE_STRING); |
@@ -2089,12 +2089,12 @@ discard block |
||
| 2089 | 2089 | } |
| 2090 | 2090 | |
| 2091 | 2091 | /** |
| 2092 | - * Gets the aircraft icao based on the aircraft name/type |
|
| 2093 | - * |
|
| 2094 | - * @param String $aircraft_type the aircraft type |
|
| 2095 | - * @return String aircraft information |
|
| 2096 | - * |
|
| 2097 | - */ |
|
| 2092 | + * Gets the aircraft icao based on the aircraft name/type |
|
| 2093 | + * |
|
| 2094 | + * @param String $aircraft_type the aircraft type |
|
| 2095 | + * @return String aircraft information |
|
| 2096 | + * |
|
| 2097 | + */ |
|
| 2098 | 2098 | public function getAircraftIcao($aircraft_type) |
| 2099 | 2099 | { |
| 2100 | 2100 | $aircraft_type = filter_var($aircraft_type,FILTER_SANITIZE_STRING); |
@@ -2119,12 +2119,12 @@ discard block |
||
| 2119 | 2119 | } |
| 2120 | 2120 | |
| 2121 | 2121 | /** |
| 2122 | - * Gets the aircraft info based on the aircraft ident |
|
| 2123 | - * |
|
| 2124 | - * @param String $aircraft_modes the aircraft ident (hex) |
|
| 2125 | - * @return String aircraft type |
|
| 2126 | - * |
|
| 2127 | - */ |
|
| 2122 | + * Gets the aircraft info based on the aircraft ident |
|
| 2123 | + * |
|
| 2124 | + * @param String $aircraft_modes the aircraft ident (hex) |
|
| 2125 | + * @return String aircraft type |
|
| 2126 | + * |
|
| 2127 | + */ |
|
| 2128 | 2128 | public function getAllAircraftType($aircraft_modes) |
| 2129 | 2129 | { |
| 2130 | 2130 | $aircraft_modes = filter_var($aircraft_modes,FILTER_SANITIZE_STRING); |
@@ -2141,12 +2141,12 @@ discard block |
||
| 2141 | 2141 | } |
| 2142 | 2142 | |
| 2143 | 2143 | /** |
| 2144 | - * Gets correct aircraft operator corde |
|
| 2145 | - * |
|
| 2146 | - * @param String $operator the aircraft operator code (callsign) |
|
| 2147 | - * @return String aircraft operator code |
|
| 2148 | - * |
|
| 2149 | - */ |
|
| 2144 | + * Gets correct aircraft operator corde |
|
| 2145 | + * |
|
| 2146 | + * @param String $operator the aircraft operator code (callsign) |
|
| 2147 | + * @return String aircraft operator code |
|
| 2148 | + * |
|
| 2149 | + */ |
|
| 2150 | 2150 | public function getOperator($operator) |
| 2151 | 2151 | { |
| 2152 | 2152 | $operator = filter_var($operator,FILTER_SANITIZE_STRING); |
@@ -2162,16 +2162,16 @@ discard block |
||
| 2162 | 2162 | } |
| 2163 | 2163 | |
| 2164 | 2164 | /** |
| 2165 | - * Gets the aircraft route based on the aircraft callsign |
|
| 2166 | - * |
|
| 2167 | - * @param String $callsign the aircraft callsign |
|
| 2168 | - * @return Array aircraft type |
|
| 2169 | - * |
|
| 2170 | - */ |
|
| 2165 | + * Gets the aircraft route based on the aircraft callsign |
|
| 2166 | + * |
|
| 2167 | + * @param String $callsign the aircraft callsign |
|
| 2168 | + * @return Array aircraft type |
|
| 2169 | + * |
|
| 2170 | + */ |
|
| 2171 | 2171 | public function getRouteInfo($callsign) |
| 2172 | 2172 | { |
| 2173 | 2173 | $callsign = filter_var($callsign,FILTER_SANITIZE_STRING); |
| 2174 | - if ($callsign == '') return array(); |
|
| 2174 | + if ($callsign == '') return array(); |
|
| 2175 | 2175 | $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"; |
| 2176 | 2176 | |
| 2177 | 2177 | $sth = $this->db->prepare($query); |
@@ -2184,12 +2184,12 @@ discard block |
||
| 2184 | 2184 | } |
| 2185 | 2185 | |
| 2186 | 2186 | /** |
| 2187 | - * Gets the aircraft info based on the aircraft registration |
|
| 2188 | - * |
|
| 2189 | - * @param String $registration the aircraft registration |
|
| 2190 | - * @return Array aircraft information |
|
| 2191 | - * |
|
| 2192 | - */ |
|
| 2187 | + * Gets the aircraft info based on the aircraft registration |
|
| 2188 | + * |
|
| 2189 | + * @param String $registration the aircraft registration |
|
| 2190 | + * @return Array aircraft information |
|
| 2191 | + * |
|
| 2192 | + */ |
|
| 2193 | 2193 | public function getAircraftInfoByRegistration($registration) |
| 2194 | 2194 | { |
| 2195 | 2195 | $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
@@ -2216,12 +2216,12 @@ discard block |
||
| 2216 | 2216 | } |
| 2217 | 2217 | |
| 2218 | 2218 | /** |
| 2219 | - * Gets the aircraft owner & base based on the aircraft registration |
|
| 2220 | - * |
|
| 2221 | - * @param String $registration the aircraft registration |
|
| 2222 | - * @return Array aircraft information |
|
| 2223 | - * |
|
| 2224 | - */ |
|
| 2219 | + * Gets the aircraft owner & base based on the aircraft registration |
|
| 2220 | + * |
|
| 2221 | + * @param String $registration the aircraft registration |
|
| 2222 | + * @return Array aircraft information |
|
| 2223 | + * |
|
| 2224 | + */ |
|
| 2225 | 2225 | public function getAircraftOwnerByRegistration($registration) |
| 2226 | 2226 | { |
| 2227 | 2227 | $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
@@ -2237,11 +2237,11 @@ discard block |
||
| 2237 | 2237 | |
| 2238 | 2238 | |
| 2239 | 2239 | /** |
| 2240 | - * Gets all flights (but with only little info) |
|
| 2241 | - * |
|
| 2242 | - * @return Array basic flight information |
|
| 2243 | - * |
|
| 2244 | - */ |
|
| 2240 | + * Gets all flights (but with only little info) |
|
| 2241 | + * |
|
| 2242 | + * @return Array basic flight information |
|
| 2243 | + * |
|
| 2244 | + */ |
|
| 2245 | 2245 | public function getAllFlightsforSitemap() |
| 2246 | 2246 | { |
| 2247 | 2247 | //$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 "; |
@@ -2249,7 +2249,7 @@ discard block |
||
| 2249 | 2249 | |
| 2250 | 2250 | $sth = $this->db->prepare($query); |
| 2251 | 2251 | $sth->execute(); |
| 2252 | - /* |
|
| 2252 | + /* |
|
| 2253 | 2253 | $flight_array = array(); |
| 2254 | 2254 | $temp_array = array(); |
| 2255 | 2255 | |
@@ -2271,11 +2271,11 @@ discard block |
||
| 2271 | 2271 | } |
| 2272 | 2272 | |
| 2273 | 2273 | /** |
| 2274 | - * Gets a list of all aircraft manufacturers |
|
| 2275 | - * |
|
| 2276 | - * @return Array list of aircraft types |
|
| 2277 | - * |
|
| 2278 | - */ |
|
| 2274 | + * Gets a list of all aircraft manufacturers |
|
| 2275 | + * |
|
| 2276 | + * @return Array list of aircraft types |
|
| 2277 | + * |
|
| 2278 | + */ |
|
| 2279 | 2279 | public function getAllManufacturers() |
| 2280 | 2280 | { |
| 2281 | 2281 | /* |
@@ -2304,11 +2304,11 @@ discard block |
||
| 2304 | 2304 | |
| 2305 | 2305 | |
| 2306 | 2306 | /** |
| 2307 | - * Gets a list of all aircraft types |
|
| 2308 | - * |
|
| 2309 | - * @return Array list of aircraft types |
|
| 2310 | - * |
|
| 2311 | - */ |
|
| 2307 | + * Gets a list of all aircraft types |
|
| 2308 | + * |
|
| 2309 | + * @return Array list of aircraft types |
|
| 2310 | + * |
|
| 2311 | + */ |
|
| 2312 | 2312 | public function getAllAircraftTypes() |
| 2313 | 2313 | { |
| 2314 | 2314 | /* |
@@ -2340,11 +2340,11 @@ discard block |
||
| 2340 | 2340 | |
| 2341 | 2341 | |
| 2342 | 2342 | /** |
| 2343 | - * Gets a list of all aircraft registrations |
|
| 2344 | - * |
|
| 2345 | - * @return Array list of aircraft registrations |
|
| 2346 | - * |
|
| 2347 | - */ |
|
| 2343 | + * Gets a list of all aircraft registrations |
|
| 2344 | + * |
|
| 2345 | + * @return Array list of aircraft registrations |
|
| 2346 | + * |
|
| 2347 | + */ |
|
| 2348 | 2348 | public function getAllAircraftRegistrations() |
| 2349 | 2349 | { |
| 2350 | 2350 | $query = "SELECT DISTINCT spotter_output.registration |
@@ -2369,12 +2369,12 @@ discard block |
||
| 2369 | 2369 | } |
| 2370 | 2370 | |
| 2371 | 2371 | /** |
| 2372 | - * Gets all source name |
|
| 2373 | - * |
|
| 2374 | - * @param String type format of source |
|
| 2375 | - * @return Array list of source name |
|
| 2376 | - * |
|
| 2377 | - */ |
|
| 2372 | + * Gets all source name |
|
| 2373 | + * |
|
| 2374 | + * @param String type format of source |
|
| 2375 | + * @return Array list of source name |
|
| 2376 | + * |
|
| 2377 | + */ |
|
| 2378 | 2378 | public function getAllSourceName($type = '') |
| 2379 | 2379 | { |
| 2380 | 2380 | $query_values = array(); |
@@ -2405,11 +2405,11 @@ discard block |
||
| 2405 | 2405 | |
| 2406 | 2406 | |
| 2407 | 2407 | /** |
| 2408 | - * Gets a list of all airline names |
|
| 2409 | - * |
|
| 2410 | - * @return Array list of airline names |
|
| 2411 | - * |
|
| 2412 | - */ |
|
| 2408 | + * Gets a list of all airline names |
|
| 2409 | + * |
|
| 2410 | + * @return Array list of airline names |
|
| 2411 | + * |
|
| 2412 | + */ |
|
| 2413 | 2413 | public function getAllAirlineNames($airline_type = '') |
| 2414 | 2414 | { |
| 2415 | 2415 | $airline_type = filter_var($airline_type,FILTER_SANITIZE_STRING); |
@@ -2452,11 +2452,11 @@ discard block |
||
| 2452 | 2452 | |
| 2453 | 2453 | |
| 2454 | 2454 | /** |
| 2455 | - * Gets a list of all airline countries |
|
| 2456 | - * |
|
| 2457 | - * @return Array list of airline countries |
|
| 2458 | - * |
|
| 2459 | - */ |
|
| 2455 | + * Gets a list of all airline countries |
|
| 2456 | + * |
|
| 2457 | + * @return Array list of airline countries |
|
| 2458 | + * |
|
| 2459 | + */ |
|
| 2460 | 2460 | public function getAllAirlineCountries() |
| 2461 | 2461 | { |
| 2462 | 2462 | |
@@ -2485,11 +2485,11 @@ discard block |
||
| 2485 | 2485 | |
| 2486 | 2486 | |
| 2487 | 2487 | /** |
| 2488 | - * Gets a list of all departure & arrival names |
|
| 2489 | - * |
|
| 2490 | - * @return Array list of airport names |
|
| 2491 | - * |
|
| 2492 | - */ |
|
| 2488 | + * Gets a list of all departure & arrival names |
|
| 2489 | + * |
|
| 2490 | + * @return Array list of airport names |
|
| 2491 | + * |
|
| 2492 | + */ |
|
| 2493 | 2493 | public function getAllAirportNames() |
| 2494 | 2494 | { |
| 2495 | 2495 | $airport_array = array(); |
@@ -2540,11 +2540,11 @@ discard block |
||
| 2540 | 2540 | |
| 2541 | 2541 | |
| 2542 | 2542 | /** |
| 2543 | - * Gets a list of all departure & arrival airport countries |
|
| 2544 | - * |
|
| 2545 | - * @return Array list of airport countries |
|
| 2546 | - * |
|
| 2547 | - */ |
|
| 2543 | + * Gets a list of all departure & arrival airport countries |
|
| 2544 | + * |
|
| 2545 | + * @return Array list of airport countries |
|
| 2546 | + * |
|
| 2547 | + */ |
|
| 2548 | 2548 | public function getAllAirportCountries() |
| 2549 | 2549 | { |
| 2550 | 2550 | $airport_array = array(); |
@@ -2593,11 +2593,11 @@ discard block |
||
| 2593 | 2593 | |
| 2594 | 2594 | |
| 2595 | 2595 | /** |
| 2596 | - * Gets a list of all countries (airline, departure airport & arrival airport) |
|
| 2597 | - * |
|
| 2598 | - * @return Array list of countries |
|
| 2599 | - * |
|
| 2600 | - */ |
|
| 2596 | + * Gets a list of all countries (airline, departure airport & arrival airport) |
|
| 2597 | + * |
|
| 2598 | + * @return Array list of countries |
|
| 2599 | + * |
|
| 2600 | + */ |
|
| 2601 | 2601 | public function getAllCountries() |
| 2602 | 2602 | { |
| 2603 | 2603 | $Connection= new Connection($this->db); |
@@ -2676,11 +2676,11 @@ discard block |
||
| 2676 | 2676 | |
| 2677 | 2677 | |
| 2678 | 2678 | /** |
| 2679 | - * Gets a list of all idents/callsigns |
|
| 2680 | - * |
|
| 2681 | - * @return Array list of ident/callsign names |
|
| 2682 | - * |
|
| 2683 | - */ |
|
| 2679 | + * Gets a list of all idents/callsigns |
|
| 2680 | + * |
|
| 2681 | + * @return Array list of ident/callsign names |
|
| 2682 | + * |
|
| 2683 | + */ |
|
| 2684 | 2684 | public function getAllIdents() |
| 2685 | 2685 | { |
| 2686 | 2686 | $query = "SELECT DISTINCT spotter_output.ident |
@@ -2704,9 +2704,9 @@ discard block |
||
| 2704 | 2704 | } |
| 2705 | 2705 | |
| 2706 | 2706 | /** |
| 2707 | - * Get a list of flights from airport since 7 days |
|
| 2708 | - * @return Array number, icao, name and city of airports |
|
| 2709 | - */ |
|
| 2707 | + * Get a list of flights from airport since 7 days |
|
| 2708 | + * @return Array number, icao, name and city of airports |
|
| 2709 | + */ |
|
| 2710 | 2710 | |
| 2711 | 2711 | public function getLast7DaysAirportsDeparture($airport_icao = '') { |
| 2712 | 2712 | global $globalTimezone, $globalDBdriver; |
@@ -2736,9 +2736,9 @@ discard block |
||
| 2736 | 2736 | } |
| 2737 | 2737 | |
| 2738 | 2738 | /** |
| 2739 | - * Get a list of flights from airport since 7 days |
|
| 2740 | - * @return Array number, icao, name and city of airports |
|
| 2741 | - */ |
|
| 2739 | + * Get a list of flights from airport since 7 days |
|
| 2740 | + * @return Array number, icao, name and city of airports |
|
| 2741 | + */ |
|
| 2742 | 2742 | |
| 2743 | 2743 | public function getLast7DaysAirportsDepartureByAirlines($airport_icao = '') { |
| 2744 | 2744 | global $globalTimezone, $globalDBdriver; |
@@ -2768,9 +2768,9 @@ discard block |
||
| 2768 | 2768 | } |
| 2769 | 2769 | |
| 2770 | 2770 | /** |
| 2771 | - * Get a list of flights from detected airport since 7 days |
|
| 2772 | - * @return Array number, icao, name and city of airports |
|
| 2773 | - */ |
|
| 2771 | + * Get a list of flights from detected airport since 7 days |
|
| 2772 | + * @return Array number, icao, name and city of airports |
|
| 2773 | + */ |
|
| 2774 | 2774 | |
| 2775 | 2775 | public function getLast7DaysDetectedAirportsDeparture($airport_icao = '') { |
| 2776 | 2776 | global $globalTimezone, $globalDBdriver; |
@@ -2811,9 +2811,9 @@ discard block |
||
| 2811 | 2811 | } |
| 2812 | 2812 | |
| 2813 | 2813 | /** |
| 2814 | - * Get a list of flights from detected airport since 7 days |
|
| 2815 | - * @return Array number, icao, name and city of airports |
|
| 2816 | - */ |
|
| 2814 | + * Get a list of flights from detected airport since 7 days |
|
| 2815 | + * @return Array number, icao, name and city of airports |
|
| 2816 | + */ |
|
| 2817 | 2817 | |
| 2818 | 2818 | public function getLast7DaysDetectedAirportsDepartureByAirlines($airport_icao = '') { |
| 2819 | 2819 | global $globalTimezone, $globalDBdriver; |
@@ -2855,9 +2855,9 @@ discard block |
||
| 2855 | 2855 | |
| 2856 | 2856 | |
| 2857 | 2857 | /** |
| 2858 | - * Get a list of flights to airport since 7 days |
|
| 2859 | - * @return Array number, icao, name and city of airports |
|
| 2860 | - */ |
|
| 2858 | + * Get a list of flights to airport since 7 days |
|
| 2859 | + * @return Array number, icao, name and city of airports |
|
| 2860 | + */ |
|
| 2861 | 2861 | |
| 2862 | 2862 | public function getLast7DaysAirportsArrival($airport_icao = '') { |
| 2863 | 2863 | global $globalTimezone, $globalDBdriver; |
@@ -2889,9 +2889,9 @@ discard block |
||
| 2889 | 2889 | |
| 2890 | 2890 | |
| 2891 | 2891 | /** |
| 2892 | - * Get a list of flights detected to airport since 7 days |
|
| 2893 | - * @return Array number, icao, name and city of airports |
|
| 2894 | - */ |
|
| 2892 | + * Get a list of flights detected to airport since 7 days |
|
| 2893 | + * @return Array number, icao, name and city of airports |
|
| 2894 | + */ |
|
| 2895 | 2895 | |
| 2896 | 2896 | public function getLast7DaysDetectedAirportsArrival($airport_icao = '') { |
| 2897 | 2897 | global $globalTimezone, $globalDBdriver; |
@@ -2935,9 +2935,9 @@ discard block |
||
| 2935 | 2935 | |
| 2936 | 2936 | |
| 2937 | 2937 | /** |
| 2938 | - * Get a list of flights to airport since 7 days |
|
| 2939 | - * @return Array number, icao, name and city of airports |
|
| 2940 | - */ |
|
| 2938 | + * Get a list of flights to airport since 7 days |
|
| 2939 | + * @return Array number, icao, name and city of airports |
|
| 2940 | + */ |
|
| 2941 | 2941 | |
| 2942 | 2942 | public function getLast7DaysAirportsArrivalByAirlines($airport_icao = '') { |
| 2943 | 2943 | global $globalTimezone, $globalDBdriver; |
@@ -2969,9 +2969,9 @@ discard block |
||
| 2969 | 2969 | |
| 2970 | 2970 | |
| 2971 | 2971 | /** |
| 2972 | - * Get a list of flights detected to airport since 7 days |
|
| 2973 | - * @return Array number, icao, name and city of airports |
|
| 2974 | - */ |
|
| 2972 | + * Get a list of flights detected to airport since 7 days |
|
| 2973 | + * @return Array number, icao, name and city of airports |
|
| 2974 | + */ |
|
| 2975 | 2975 | |
| 2976 | 2976 | public function getLast7DaysDetectedAirportsArrivalByAirlines($airport_icao = '') { |
| 2977 | 2977 | global $globalTimezone, $globalDBdriver; |
@@ -3015,11 +3015,11 @@ discard block |
||
| 3015 | 3015 | |
| 3016 | 3016 | |
| 3017 | 3017 | /** |
| 3018 | - * Gets a list of all dates |
|
| 3019 | - * |
|
| 3020 | - * @return Array list of date names |
|
| 3021 | - * |
|
| 3022 | - */ |
|
| 3018 | + * Gets a list of all dates |
|
| 3019 | + * |
|
| 3020 | + * @return Array list of date names |
|
| 3021 | + * |
|
| 3022 | + */ |
|
| 3023 | 3023 | public function getAllDates() |
| 3024 | 3024 | { |
| 3025 | 3025 | global $globalTimezone, $globalDBdriver; |
@@ -3060,11 +3060,11 @@ discard block |
||
| 3060 | 3060 | |
| 3061 | 3061 | |
| 3062 | 3062 | /** |
| 3063 | - * Gets all route combinations |
|
| 3064 | - * |
|
| 3065 | - * @return Array the route list |
|
| 3066 | - * |
|
| 3067 | - */ |
|
| 3063 | + * Gets all route combinations |
|
| 3064 | + * |
|
| 3065 | + * @return Array the route list |
|
| 3066 | + * |
|
| 3067 | + */ |
|
| 3068 | 3068 | public function getAllRoutes() |
| 3069 | 3069 | { |
| 3070 | 3070 | $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 |
@@ -3090,13 +3090,13 @@ discard block |
||
| 3090 | 3090 | } |
| 3091 | 3091 | |
| 3092 | 3092 | /** |
| 3093 | - * Update ident spotter data |
|
| 3094 | - * |
|
| 3095 | - * @param String $flightaware_id the ID from flightaware |
|
| 3096 | - * @param String $ident the flight ident |
|
| 3097 | - * @return String success or false |
|
| 3098 | - * |
|
| 3099 | - */ |
|
| 3093 | + * Update ident spotter data |
|
| 3094 | + * |
|
| 3095 | + * @param String $flightaware_id the ID from flightaware |
|
| 3096 | + * @param String $ident the flight ident |
|
| 3097 | + * @return String success or false |
|
| 3098 | + * |
|
| 3099 | + */ |
|
| 3100 | 3100 | public function updateIdentSpotterData($flightaware_id = '', $ident = '',$fromsource = NULL) |
| 3101 | 3101 | { |
| 3102 | 3102 | if (!is_numeric(substr($ident, 0, 3))) |
@@ -3117,14 +3117,14 @@ discard block |
||
| 3117 | 3117 | } else { |
| 3118 | 3118 | $airline_array = $this->getAllAirlineInfo("NA"); |
| 3119 | 3119 | } |
| 3120 | - $airline_name = $airline_array[0]['name']; |
|
| 3121 | - $airline_icao = $airline_array[0]['icao']; |
|
| 3122 | - $airline_country = $airline_array[0]['country']; |
|
| 3123 | - $airline_type = $airline_array[0]['type']; |
|
| 3120 | + $airline_name = $airline_array[0]['name']; |
|
| 3121 | + $airline_icao = $airline_array[0]['icao']; |
|
| 3122 | + $airline_country = $airline_array[0]['country']; |
|
| 3123 | + $airline_type = $airline_array[0]['type']; |
|
| 3124 | 3124 | |
| 3125 | 3125 | |
| 3126 | 3126 | $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'; |
| 3127 | - $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); |
|
| 3127 | + $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); |
|
| 3128 | 3128 | |
| 3129 | 3129 | try { |
| 3130 | 3130 | $sth = $this->db->prepare($query); |
@@ -3137,19 +3137,19 @@ discard block |
||
| 3137 | 3137 | |
| 3138 | 3138 | } |
| 3139 | 3139 | /** |
| 3140 | - * Update latest spotter data |
|
| 3141 | - * |
|
| 3142 | - * @param String $flightaware_id the ID from flightaware |
|
| 3143 | - * @param String $ident the flight ident |
|
| 3144 | - * @param String $arrival_airport_icao the arrival airport |
|
| 3145 | - * @return String success or false |
|
| 3146 | - * |
|
| 3147 | - */ |
|
| 3140 | + * Update latest spotter data |
|
| 3141 | + * |
|
| 3142 | + * @param String $flightaware_id the ID from flightaware |
|
| 3143 | + * @param String $ident the flight ident |
|
| 3144 | + * @param String $arrival_airport_icao the arrival airport |
|
| 3145 | + * @return String success or false |
|
| 3146 | + * |
|
| 3147 | + */ |
|
| 3148 | 3148 | public function updateLatestSpotterData($flightaware_id = '', $ident = '', $latitude = '', $longitude = '', $altitude = '', $ground = false, $groundspeed = NULL, $date = '', $arrival_airport_icao = '',$arrival_airport_time = '') |
| 3149 | 3149 | { |
| 3150 | 3150 | if ($groundspeed == '') $groundspeed = NULL; |
| 3151 | 3151 | $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'; |
| 3152 | - $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); |
|
| 3152 | + $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); |
|
| 3153 | 3153 | |
| 3154 | 3154 | try { |
| 3155 | 3155 | $sth = $this->db->prepare($query); |
@@ -3163,32 +3163,32 @@ discard block |
||
| 3163 | 3163 | } |
| 3164 | 3164 | |
| 3165 | 3165 | /** |
| 3166 | - * Adds a new spotter data |
|
| 3167 | - * |
|
| 3168 | - * @param String $flightaware_id the ID from flightaware |
|
| 3169 | - * @param String $ident the flight ident |
|
| 3170 | - * @param String $aircraft_icao the aircraft type |
|
| 3171 | - * @param String $departure_airport_icao the departure airport |
|
| 3172 | - * @param String $arrival_airport_icao the arrival airport |
|
| 3173 | - * @param String $latitude latitude of flight |
|
| 3174 | - * @param String $longitude latitude of flight |
|
| 3175 | - * @param String $waypoints waypoints of flight |
|
| 3176 | - * @param String $altitude altitude of flight |
|
| 3177 | - * @param String $heading heading of flight |
|
| 3178 | - * @param String $groundspeed speed of flight |
|
| 3179 | - * @param String $date date of flight |
|
| 3180 | - * @param String $departure_airport_time departure time of flight |
|
| 3181 | - * @param String $arrival_airport_time arrival time of flight |
|
| 3182 | - * @param String $squawk squawk code of flight |
|
| 3183 | - * @param String $route_stop route stop of flight |
|
| 3184 | - * @param String $highlight highlight or not |
|
| 3185 | - * @param String $ModeS ModesS code of flight |
|
| 3186 | - * @param String $registration registration code of flight |
|
| 3187 | - * @param String $pilot_id pilot id of flight (for virtual airlines) |
|
| 3188 | - * @param String $pilot_name pilot name of flight (for virtual airlines) |
|
| 3189 | - * @param String $verticalrate vertival rate of flight |
|
| 3190 | - * @return String success or false |
|
| 3191 | - */ |
|
| 3166 | + * Adds a new spotter data |
|
| 3167 | + * |
|
| 3168 | + * @param String $flightaware_id the ID from flightaware |
|
| 3169 | + * @param String $ident the flight ident |
|
| 3170 | + * @param String $aircraft_icao the aircraft type |
|
| 3171 | + * @param String $departure_airport_icao the departure airport |
|
| 3172 | + * @param String $arrival_airport_icao the arrival airport |
|
| 3173 | + * @param String $latitude latitude of flight |
|
| 3174 | + * @param String $longitude latitude of flight |
|
| 3175 | + * @param String $waypoints waypoints of flight |
|
| 3176 | + * @param String $altitude altitude of flight |
|
| 3177 | + * @param String $heading heading of flight |
|
| 3178 | + * @param String $groundspeed speed of flight |
|
| 3179 | + * @param String $date date of flight |
|
| 3180 | + * @param String $departure_airport_time departure time of flight |
|
| 3181 | + * @param String $arrival_airport_time arrival time of flight |
|
| 3182 | + * @param String $squawk squawk code of flight |
|
| 3183 | + * @param String $route_stop route stop of flight |
|
| 3184 | + * @param String $highlight highlight or not |
|
| 3185 | + * @param String $ModeS ModesS code of flight |
|
| 3186 | + * @param String $registration registration code of flight |
|
| 3187 | + * @param String $pilot_id pilot id of flight (for virtual airlines) |
|
| 3188 | + * @param String $pilot_name pilot name of flight (for virtual airlines) |
|
| 3189 | + * @param String $verticalrate vertival rate of flight |
|
| 3190 | + * @return String success or false |
|
| 3191 | + */ |
|
| 3192 | 3192 | 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 = '') |
| 3193 | 3193 | { |
| 3194 | 3194 | global $globalURL, $globalIVAO, $globalVATSIM, $globalphpVMS, $globalDebugTimeElapsed; |
@@ -3400,8 +3400,8 @@ discard block |
||
| 3400 | 3400 | |
| 3401 | 3401 | if ($globalIVAO && $aircraft_icao != '') |
| 3402 | 3402 | { |
| 3403 | - if (isset($airline_array[0]['icao'])) $airline_icao = $airline_array[0]['icao']; |
|
| 3404 | - else $airline_icao = ''; |
|
| 3403 | + if (isset($airline_array[0]['icao'])) $airline_icao = $airline_array[0]['icao']; |
|
| 3404 | + else $airline_icao = ''; |
|
| 3405 | 3405 | $image_array = $Image->getSpotterImage('',$aircraft_icao,$airline_icao); |
| 3406 | 3406 | if (!isset($image_array[0]['registration'])) |
| 3407 | 3407 | { |
@@ -3432,48 +3432,48 @@ discard block |
||
| 3432 | 3432 | |
| 3433 | 3433 | if (count($airline_array) == 0) |
| 3434 | 3434 | { |
| 3435 | - $airline_array = $this->getAllAirlineInfo('NA'); |
|
| 3436 | - } |
|
| 3437 | - if (count($aircraft_array) == 0) |
|
| 3438 | - { |
|
| 3439 | - $aircraft_array = $this->getAllAircraftInfo('NA'); |
|
| 3440 | - } |
|
| 3441 | - if (count($departure_airport_array) == 0) |
|
| 3442 | - { |
|
| 3443 | - $departure_airport_array = $this->getAllAirportInfo('NA'); |
|
| 3444 | - } |
|
| 3445 | - if (count($arrival_airport_array) == 0) |
|
| 3446 | - { |
|
| 3447 | - $arrival_airport_array = $this->getAllAirportInfo('NA'); |
|
| 3448 | - } |
|
| 3449 | - if ($registration == '') $registration = 'NA'; |
|
| 3450 | - if ($squawk == '' || $Common->isInteger($squawk) === false) $squawk = NULL; |
|
| 3451 | - if ($verticalrate == '' || $Common->isInteger($verticalrate) === false) $verticalrate = NULL; |
|
| 3452 | - if ($heading == '' || $Common->isInteger($heading) === false) $heading = 0; |
|
| 3453 | - if ($groundspeed == '' || $Common->isInteger($groundspeed) === false) $groundspeed = 0; |
|
| 3454 | - if (!isset($aircraft_owner)) $aircraft_owner = NULL; |
|
| 3455 | - $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) |
|
| 3435 | + $airline_array = $this->getAllAirlineInfo('NA'); |
|
| 3436 | + } |
|
| 3437 | + if (count($aircraft_array) == 0) |
|
| 3438 | + { |
|
| 3439 | + $aircraft_array = $this->getAllAircraftInfo('NA'); |
|
| 3440 | + } |
|
| 3441 | + if (count($departure_airport_array) == 0) |
|
| 3442 | + { |
|
| 3443 | + $departure_airport_array = $this->getAllAirportInfo('NA'); |
|
| 3444 | + } |
|
| 3445 | + if (count($arrival_airport_array) == 0) |
|
| 3446 | + { |
|
| 3447 | + $arrival_airport_array = $this->getAllAirportInfo('NA'); |
|
| 3448 | + } |
|
| 3449 | + if ($registration == '') $registration = 'NA'; |
|
| 3450 | + if ($squawk == '' || $Common->isInteger($squawk) === false) $squawk = NULL; |
|
| 3451 | + if ($verticalrate == '' || $Common->isInteger($verticalrate) === false) $verticalrate = NULL; |
|
| 3452 | + if ($heading == '' || $Common->isInteger($heading) === false) $heading = 0; |
|
| 3453 | + if ($groundspeed == '' || $Common->isInteger($groundspeed) === false) $groundspeed = 0; |
|
| 3454 | + if (!isset($aircraft_owner)) $aircraft_owner = NULL; |
|
| 3455 | + $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) |
|
| 3456 | 3456 | 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)"; |
| 3457 | 3457 | |
| 3458 | - $airline_name = $airline_array[0]['name']; |
|
| 3459 | - $airline_icao = $airline_array[0]['icao']; |
|
| 3460 | - $airline_country = $airline_array[0]['country']; |
|
| 3461 | - $airline_type = $airline_array[0]['type']; |
|
| 3458 | + $airline_name = $airline_array[0]['name']; |
|
| 3459 | + $airline_icao = $airline_array[0]['icao']; |
|
| 3460 | + $airline_country = $airline_array[0]['country']; |
|
| 3461 | + $airline_type = $airline_array[0]['type']; |
|
| 3462 | 3462 | if ($airline_type == '') { |
| 3463 | 3463 | $timeelapsed = microtime(true); |
| 3464 | 3464 | $airline_type = $this->getAircraftTypeBymodeS($ModeS); |
| 3465 | 3465 | if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftTypeBymodes : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
| 3466 | 3466 | } |
| 3467 | 3467 | if ($airline_type == null) $airline_type = ''; |
| 3468 | - $aircraft_type = $aircraft_array[0]['type']; |
|
| 3469 | - $aircraft_manufacturer = $aircraft_array[0]['manufacturer']; |
|
| 3470 | - $departure_airport_name = $departure_airport_array[0]['name']; |
|
| 3471 | - $departure_airport_city = $departure_airport_array[0]['city']; |
|
| 3472 | - $departure_airport_country = $departure_airport_array[0]['country']; |
|
| 3473 | - $arrival_airport_name = $arrival_airport_array[0]['name']; |
|
| 3474 | - $arrival_airport_city = $arrival_airport_array[0]['city']; |
|
| 3475 | - $arrival_airport_country = $arrival_airport_array[0]['country']; |
|
| 3476 | - $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); |
|
| 3468 | + $aircraft_type = $aircraft_array[0]['type']; |
|
| 3469 | + $aircraft_manufacturer = $aircraft_array[0]['manufacturer']; |
|
| 3470 | + $departure_airport_name = $departure_airport_array[0]['name']; |
|
| 3471 | + $departure_airport_city = $departure_airport_array[0]['city']; |
|
| 3472 | + $departure_airport_country = $departure_airport_array[0]['country']; |
|
| 3473 | + $arrival_airport_name = $arrival_airport_array[0]['name']; |
|
| 3474 | + $arrival_airport_city = $arrival_airport_array[0]['city']; |
|
| 3475 | + $arrival_airport_country = $arrival_airport_array[0]['country']; |
|
| 3476 | + $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); |
|
| 3477 | 3477 | |
| 3478 | 3478 | try { |
| 3479 | 3479 | |
@@ -3481,7 +3481,7 @@ discard block |
||
| 3481 | 3481 | $sth->execute($query_values); |
| 3482 | 3482 | $this->db = null; |
| 3483 | 3483 | } catch (PDOException $e) { |
| 3484 | - return "error : ".$e->getMessage(); |
|
| 3484 | + return "error : ".$e->getMessage(); |
|
| 3485 | 3485 | } |
| 3486 | 3486 | |
| 3487 | 3487 | return "success"; |
@@ -3490,11 +3490,11 @@ discard block |
||
| 3490 | 3490 | |
| 3491 | 3491 | |
| 3492 | 3492 | /** |
| 3493 | - * Gets the aircraft ident within the last hour |
|
| 3494 | - * |
|
| 3495 | - * @return String the ident |
|
| 3496 | - * |
|
| 3497 | - */ |
|
| 3493 | + * Gets the aircraft ident within the last hour |
|
| 3494 | + * |
|
| 3495 | + * @return String the ident |
|
| 3496 | + * |
|
| 3497 | + */ |
|
| 3498 | 3498 | public function getIdentFromLastHour($ident) |
| 3499 | 3499 | { |
| 3500 | 3500 | global $globalDBdriver, $globalTimezone; |
@@ -3510,11 +3510,11 @@ discard block |
||
| 3510 | 3510 | AND spotter_output.date >= now() AT TIME ZONE 'UTC' - INTERVAL '1 HOURS' |
| 3511 | 3511 | AND spotter_output.date < now() AT TIME ZONE 'UTC'"; |
| 3512 | 3512 | $query_data = array(':ident' => $ident); |
| 3513 | - } |
|
| 3513 | + } |
|
| 3514 | 3514 | |
| 3515 | 3515 | $sth = $this->db->prepare($query); |
| 3516 | 3516 | $sth->execute($query_data); |
| 3517 | - $ident_result=''; |
|
| 3517 | + $ident_result=''; |
|
| 3518 | 3518 | while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
| 3519 | 3519 | { |
| 3520 | 3520 | $ident_result = $row['ident']; |
@@ -3525,11 +3525,11 @@ discard block |
||
| 3525 | 3525 | |
| 3526 | 3526 | |
| 3527 | 3527 | /** |
| 3528 | - * Gets the aircraft data from the last 20 seconds |
|
| 3529 | - * |
|
| 3530 | - * @return Array the spotter data |
|
| 3531 | - * |
|
| 3532 | - */ |
|
| 3528 | + * Gets the aircraft data from the last 20 seconds |
|
| 3529 | + * |
|
| 3530 | + * @return Array the spotter data |
|
| 3531 | + * |
|
| 3532 | + */ |
|
| 3533 | 3533 | public function getRealTimeData($q = '') |
| 3534 | 3534 | { |
| 3535 | 3535 | global $globalDBdriver; |
@@ -3573,11 +3573,11 @@ discard block |
||
| 3573 | 3573 | |
| 3574 | 3574 | |
| 3575 | 3575 | /** |
| 3576 | - * Gets all airlines that have flown over |
|
| 3577 | - * |
|
| 3578 | - * @return Array the airline list |
|
| 3579 | - * |
|
| 3580 | - */ |
|
| 3576 | + * Gets all airlines that have flown over |
|
| 3577 | + * |
|
| 3578 | + * @return Array the airline list |
|
| 3579 | + * |
|
| 3580 | + */ |
|
| 3581 | 3581 | public function countAllAirlines($limit = true, $olderthanmonths = 0, $sincedate = '') |
| 3582 | 3582 | { |
| 3583 | 3583 | global $globalDBdriver; |
@@ -3591,7 +3591,7 @@ discard block |
||
| 3591 | 3591 | $query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
| 3592 | 3592 | } |
| 3593 | 3593 | } |
| 3594 | - if ($sincedate != '') { |
|
| 3594 | + if ($sincedate != '') { |
|
| 3595 | 3595 | if ($globalDBdriver == 'mysql') { |
| 3596 | 3596 | $query .= "AND spotter_output.date > '".$sincedate."' "; |
| 3597 | 3597 | } else { |
@@ -3618,26 +3618,26 @@ discard block |
||
| 3618 | 3618 | } |
| 3619 | 3619 | |
| 3620 | 3620 | /** |
| 3621 | - * Gets all pilots that have flown over |
|
| 3622 | - * |
|
| 3623 | - * @return Array the pilots list |
|
| 3624 | - * |
|
| 3625 | - */ |
|
| 3621 | + * Gets all pilots that have flown over |
|
| 3622 | + * |
|
| 3623 | + * @return Array the pilots list |
|
| 3624 | + * |
|
| 3625 | + */ |
|
| 3626 | 3626 | public function countAllPilots($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array()) |
| 3627 | 3627 | { |
| 3628 | 3628 | global $globalDBdriver; |
| 3629 | 3629 | $filter_query = $this->getFilter($filters,true,true); |
| 3630 | 3630 | $query = "SELECT DISTINCT spotter_output.pilot_id, spotter_output.pilot_name, COUNT(spotter_output.pilot_id) AS pilot_count |
| 3631 | 3631 | FROM spotter_output".$filter_query." spotter_output.pilot_id <> '' "; |
| 3632 | - if ($olderthanmonths > 0) { |
|
| 3633 | - if ($globalDBdriver == 'mysql') { |
|
| 3632 | + if ($olderthanmonths > 0) { |
|
| 3633 | + if ($globalDBdriver == 'mysql') { |
|
| 3634 | 3634 | $query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) '; |
| 3635 | 3635 | } else { |
| 3636 | 3636 | $query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
| 3637 | 3637 | } |
| 3638 | 3638 | } |
| 3639 | - if ($sincedate != '') { |
|
| 3640 | - if ($globalDBdriver == 'mysql') { |
|
| 3639 | + if ($sincedate != '') { |
|
| 3640 | + if ($globalDBdriver == 'mysql') { |
|
| 3641 | 3641 | $query .= "AND spotter_output.date > '".$sincedate."' "; |
| 3642 | 3642 | } else { |
| 3643 | 3643 | $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -3664,25 +3664,25 @@ discard block |
||
| 3664 | 3664 | } |
| 3665 | 3665 | |
| 3666 | 3666 | /** |
| 3667 | - * Gets all pilots that have flown over |
|
| 3668 | - * |
|
| 3669 | - * @return Array the pilots list |
|
| 3670 | - * |
|
| 3671 | - */ |
|
| 3667 | + * Gets all pilots that have flown over |
|
| 3668 | + * |
|
| 3669 | + * @return Array the pilots list |
|
| 3670 | + * |
|
| 3671 | + */ |
|
| 3672 | 3672 | public function countAllPilotsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '') |
| 3673 | 3673 | { |
| 3674 | 3674 | global $globalDBdriver; |
| 3675 | 3675 | $query = "SELECT DISTINCT spotter_output.airline_icao, spotter_output.pilot_id, spotter_output.pilot_name, COUNT(spotter_output.pilot_id) AS pilot_count |
| 3676 | 3676 | FROM spotter_output WHERE spotter_output.pilot_id <> '' "; |
| 3677 | - if ($olderthanmonths > 0) { |
|
| 3678 | - if ($globalDBdriver == 'mysql') { |
|
| 3677 | + if ($olderthanmonths > 0) { |
|
| 3678 | + if ($globalDBdriver == 'mysql') { |
|
| 3679 | 3679 | $query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) '; |
| 3680 | 3680 | } else { |
| 3681 | 3681 | $query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
| 3682 | 3682 | } |
| 3683 | 3683 | } |
| 3684 | - if ($sincedate != '') { |
|
| 3685 | - if ($globalDBdriver == 'mysql') { |
|
| 3684 | + if ($sincedate != '') { |
|
| 3685 | + if ($globalDBdriver == 'mysql') { |
|
| 3686 | 3686 | $query .= "AND spotter_output.date > '".$sincedate."' "; |
| 3687 | 3687 | } else { |
| 3688 | 3688 | $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -3710,26 +3710,26 @@ discard block |
||
| 3710 | 3710 | } |
| 3711 | 3711 | |
| 3712 | 3712 | /** |
| 3713 | - * Gets all owner that have flown over |
|
| 3714 | - * |
|
| 3715 | - * @return Array the pilots list |
|
| 3716 | - * |
|
| 3717 | - */ |
|
| 3713 | + * Gets all owner that have flown over |
|
| 3714 | + * |
|
| 3715 | + * @return Array the pilots list |
|
| 3716 | + * |
|
| 3717 | + */ |
|
| 3718 | 3718 | public function countAllOwners($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array()) |
| 3719 | 3719 | { |
| 3720 | 3720 | global $globalDBdriver; |
| 3721 | 3721 | $filter_query = $this->getFilter($filters,true,true); |
| 3722 | 3722 | $query = "SELECT DISTINCT spotter_output.owner_name, COUNT(spotter_output.owner_name) AS owner_count |
| 3723 | 3723 | FROM spotter_output".$filter_query." spotter_output.owner_name <> '' AND spotter_output.owner_name IS NOT NULL "; |
| 3724 | - if ($olderthanmonths > 0) { |
|
| 3725 | - if ($globalDBdriver == 'mysql') { |
|
| 3724 | + if ($olderthanmonths > 0) { |
|
| 3725 | + if ($globalDBdriver == 'mysql') { |
|
| 3726 | 3726 | $query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) '; |
| 3727 | 3727 | } else { |
| 3728 | 3728 | $query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
| 3729 | 3729 | } |
| 3730 | 3730 | } |
| 3731 | - if ($sincedate != '') { |
|
| 3732 | - if ($globalDBdriver == 'mysql') { |
|
| 3731 | + if ($sincedate != '') { |
|
| 3732 | + if ($globalDBdriver == 'mysql') { |
|
| 3733 | 3733 | $query .= "AND spotter_output.date > '".$sincedate."' "; |
| 3734 | 3734 | } else { |
| 3735 | 3735 | $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -3755,25 +3755,25 @@ discard block |
||
| 3755 | 3755 | } |
| 3756 | 3756 | |
| 3757 | 3757 | /** |
| 3758 | - * Gets all owner that have flown over |
|
| 3759 | - * |
|
| 3760 | - * @return Array the pilots list |
|
| 3761 | - * |
|
| 3762 | - */ |
|
| 3758 | + * Gets all owner that have flown over |
|
| 3759 | + * |
|
| 3760 | + * @return Array the pilots list |
|
| 3761 | + * |
|
| 3762 | + */ |
|
| 3763 | 3763 | public function countAllOwnersByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '') |
| 3764 | 3764 | { |
| 3765 | 3765 | global $globalDBdriver; |
| 3766 | 3766 | $query = "SELECT DISTINCT spotter_output.airline_icao, spotter_output.owner_name, COUNT(spotter_output.owner_name) AS owner_count |
| 3767 | 3767 | FROM spotter_output WHERE spotter_output.owner_name <> '' AND spotter_output.owner_name IS NOT NULL "; |
| 3768 | - if ($olderthanmonths > 0) { |
|
| 3769 | - if ($globalDBdriver == 'mysql') { |
|
| 3768 | + if ($olderthanmonths > 0) { |
|
| 3769 | + if ($globalDBdriver == 'mysql') { |
|
| 3770 | 3770 | $query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) '; |
| 3771 | 3771 | } else { |
| 3772 | 3772 | $query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
| 3773 | 3773 | } |
| 3774 | 3774 | } |
| 3775 | - if ($sincedate != '') { |
|
| 3776 | - if ($globalDBdriver == 'mysql') { |
|
| 3775 | + if ($sincedate != '') { |
|
| 3776 | + if ($globalDBdriver == 'mysql') { |
|
| 3777 | 3777 | $query .= "AND spotter_output.date > '".$sincedate."' "; |
| 3778 | 3778 | } else { |
| 3779 | 3779 | $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -3800,11 +3800,11 @@ discard block |
||
| 3800 | 3800 | } |
| 3801 | 3801 | |
| 3802 | 3802 | /** |
| 3803 | - * Gets all airlines that have flown over by aircraft |
|
| 3804 | - * |
|
| 3805 | - * @return Array the airline list |
|
| 3806 | - * |
|
| 3807 | - */ |
|
| 3803 | + * Gets all airlines that have flown over by aircraft |
|
| 3804 | + * |
|
| 3805 | + * @return Array the airline list |
|
| 3806 | + * |
|
| 3807 | + */ |
|
| 3808 | 3808 | public function countAllAirlinesByAircraft($aircraft_icao) |
| 3809 | 3809 | { |
| 3810 | 3810 | $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
@@ -3837,11 +3837,11 @@ discard block |
||
| 3837 | 3837 | |
| 3838 | 3838 | |
| 3839 | 3839 | /** |
| 3840 | - * Gets all airline countries that have flown over by aircraft |
|
| 3841 | - * |
|
| 3842 | - * @return Array the airline country list |
|
| 3843 | - * |
|
| 3844 | - */ |
|
| 3840 | + * Gets all airline countries that have flown over by aircraft |
|
| 3841 | + * |
|
| 3842 | + * @return Array the airline country list |
|
| 3843 | + * |
|
| 3844 | + */ |
|
| 3845 | 3845 | public function countAllAirlineCountriesByAircraft($aircraft_icao) |
| 3846 | 3846 | { |
| 3847 | 3847 | $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
@@ -3874,11 +3874,11 @@ discard block |
||
| 3874 | 3874 | |
| 3875 | 3875 | |
| 3876 | 3876 | /** |
| 3877 | - * Gets all airlines that have flown over by airport |
|
| 3878 | - * |
|
| 3879 | - * @return Array the airline list |
|
| 3880 | - * |
|
| 3881 | - */ |
|
| 3877 | + * Gets all airlines that have flown over by airport |
|
| 3878 | + * |
|
| 3879 | + * @return Array the airline list |
|
| 3880 | + * |
|
| 3881 | + */ |
|
| 3882 | 3882 | public function countAllAirlinesByAirport($airport_icao) |
| 3883 | 3883 | { |
| 3884 | 3884 | $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
@@ -3910,11 +3910,11 @@ discard block |
||
| 3910 | 3910 | |
| 3911 | 3911 | |
| 3912 | 3912 | /** |
| 3913 | - * Gets all airline countries that have flown over by airport icao |
|
| 3914 | - * |
|
| 3915 | - * @return Array the airline country list |
|
| 3916 | - * |
|
| 3917 | - */ |
|
| 3913 | + * Gets all airline countries that have flown over by airport icao |
|
| 3914 | + * |
|
| 3915 | + * @return Array the airline country list |
|
| 3916 | + * |
|
| 3917 | + */ |
|
| 3918 | 3918 | public function countAllAirlineCountriesByAirport($airport_icao) |
| 3919 | 3919 | { |
| 3920 | 3920 | $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
@@ -3945,11 +3945,11 @@ discard block |
||
| 3945 | 3945 | |
| 3946 | 3946 | |
| 3947 | 3947 | /** |
| 3948 | - * Gets all airlines that have flown over by aircraft manufacturer |
|
| 3949 | - * |
|
| 3950 | - * @return Array the airline list |
|
| 3951 | - * |
|
| 3952 | - */ |
|
| 3948 | + * Gets all airlines that have flown over by aircraft manufacturer |
|
| 3949 | + * |
|
| 3950 | + * @return Array the airline list |
|
| 3951 | + * |
|
| 3952 | + */ |
|
| 3953 | 3953 | public function countAllAirlinesByManufacturer($aircraft_manufacturer) |
| 3954 | 3954 | { |
| 3955 | 3955 | $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
@@ -3981,11 +3981,11 @@ discard block |
||
| 3981 | 3981 | |
| 3982 | 3982 | |
| 3983 | 3983 | /** |
| 3984 | - * Gets all airline countries that have flown over by aircraft manufacturer |
|
| 3985 | - * |
|
| 3986 | - * @return Array the airline country list |
|
| 3987 | - * |
|
| 3988 | - */ |
|
| 3984 | + * Gets all airline countries that have flown over by aircraft manufacturer |
|
| 3985 | + * |
|
| 3986 | + * @return Array the airline country list |
|
| 3987 | + * |
|
| 3988 | + */ |
|
| 3989 | 3989 | public function countAllAirlineCountriesByManufacturer($aircraft_manufacturer) |
| 3990 | 3990 | { |
| 3991 | 3991 | $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
@@ -4015,11 +4015,11 @@ discard block |
||
| 4015 | 4015 | |
| 4016 | 4016 | |
| 4017 | 4017 | /** |
| 4018 | - * Gets all airlines that have flown over by date |
|
| 4019 | - * |
|
| 4020 | - * @return Array the airline list |
|
| 4021 | - * |
|
| 4022 | - */ |
|
| 4018 | + * Gets all airlines that have flown over by date |
|
| 4019 | + * |
|
| 4020 | + * @return Array the airline list |
|
| 4021 | + * |
|
| 4022 | + */ |
|
| 4023 | 4023 | public function countAllAirlinesByDate($date) |
| 4024 | 4024 | { |
| 4025 | 4025 | global $globalTimezone, $globalDBdriver; |
@@ -4065,11 +4065,11 @@ discard block |
||
| 4065 | 4065 | |
| 4066 | 4066 | |
| 4067 | 4067 | /** |
| 4068 | - * Gets all airline countries that have flown over by date |
|
| 4069 | - * |
|
| 4070 | - * @return Array the airline country list |
|
| 4071 | - * |
|
| 4072 | - */ |
|
| 4068 | + * Gets all airline countries that have flown over by date |
|
| 4069 | + * |
|
| 4070 | + * @return Array the airline country list |
|
| 4071 | + * |
|
| 4072 | + */ |
|
| 4073 | 4073 | public function countAllAirlineCountriesByDate($date) |
| 4074 | 4074 | { |
| 4075 | 4075 | global $globalTimezone, $globalDBdriver; |
@@ -4113,11 +4113,11 @@ discard block |
||
| 4113 | 4113 | |
| 4114 | 4114 | |
| 4115 | 4115 | /** |
| 4116 | - * Gets all airlines that have flown over by ident/callsign |
|
| 4117 | - * |
|
| 4118 | - * @return Array the airline list |
|
| 4119 | - * |
|
| 4120 | - */ |
|
| 4116 | + * Gets all airlines that have flown over by ident/callsign |
|
| 4117 | + * |
|
| 4118 | + * @return Array the airline list |
|
| 4119 | + * |
|
| 4120 | + */ |
|
| 4121 | 4121 | public function countAllAirlinesByIdent($ident) |
| 4122 | 4122 | { |
| 4123 | 4123 | $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
@@ -4148,11 +4148,11 @@ discard block |
||
| 4148 | 4148 | } |
| 4149 | 4149 | |
| 4150 | 4150 | /** |
| 4151 | - * Gets all airlines that have flown over by route |
|
| 4152 | - * |
|
| 4153 | - * @return Array the airline list |
|
| 4154 | - * |
|
| 4155 | - */ |
|
| 4151 | + * Gets all airlines that have flown over by route |
|
| 4152 | + * |
|
| 4153 | + * @return Array the airline list |
|
| 4154 | + * |
|
| 4155 | + */ |
|
| 4156 | 4156 | public function countAllAirlinesByRoute($departure_airport_icao, $arrival_airport_icao) |
| 4157 | 4157 | { |
| 4158 | 4158 | $departure_airport_icao = filter_var($departure_airport_icao,FILTER_SANITIZE_STRING); |
@@ -4184,11 +4184,11 @@ discard block |
||
| 4184 | 4184 | } |
| 4185 | 4185 | |
| 4186 | 4186 | /** |
| 4187 | - * Gets all airline countries that have flown over by route |
|
| 4188 | - * |
|
| 4189 | - * @return Array the airline country list |
|
| 4190 | - * |
|
| 4191 | - */ |
|
| 4187 | + * Gets all airline countries that have flown over by route |
|
| 4188 | + * |
|
| 4189 | + * @return Array the airline country list |
|
| 4190 | + * |
|
| 4191 | + */ |
|
| 4192 | 4192 | public function countAllAirlineCountriesByRoute($departure_airport_icao, $arrival_airport_icao) |
| 4193 | 4193 | { |
| 4194 | 4194 | $departure_airport_icao = filter_var($departure_airport_icao,FILTER_SANITIZE_STRING); |
@@ -4220,11 +4220,11 @@ discard block |
||
| 4220 | 4220 | |
| 4221 | 4221 | |
| 4222 | 4222 | /** |
| 4223 | - * Gets all airlines that have flown over by country |
|
| 4224 | - * |
|
| 4225 | - * @return Array the airline list |
|
| 4226 | - * |
|
| 4227 | - */ |
|
| 4223 | + * Gets all airlines that have flown over by country |
|
| 4224 | + * |
|
| 4225 | + * @return Array the airline list |
|
| 4226 | + * |
|
| 4227 | + */ |
|
| 4228 | 4228 | public function countAllAirlinesByCountry($country) |
| 4229 | 4229 | { |
| 4230 | 4230 | $country = filter_var($country,FILTER_SANITIZE_STRING); |
@@ -4255,11 +4255,11 @@ discard block |
||
| 4255 | 4255 | |
| 4256 | 4256 | |
| 4257 | 4257 | /** |
| 4258 | - * Gets all airline countries that have flown over by country |
|
| 4259 | - * |
|
| 4260 | - * @return Array the airline country list |
|
| 4261 | - * |
|
| 4262 | - */ |
|
| 4258 | + * Gets all airline countries that have flown over by country |
|
| 4259 | + * |
|
| 4260 | + * @return Array the airline country list |
|
| 4261 | + * |
|
| 4262 | + */ |
|
| 4263 | 4263 | public function countAllAirlineCountriesByCountry($country) |
| 4264 | 4264 | { |
| 4265 | 4265 | $country = filter_var($country,FILTER_SANITIZE_STRING); |
@@ -4289,11 +4289,11 @@ discard block |
||
| 4289 | 4289 | |
| 4290 | 4290 | |
| 4291 | 4291 | /** |
| 4292 | - * Gets all airlines countries |
|
| 4293 | - * |
|
| 4294 | - * @return Array the airline country list |
|
| 4295 | - * |
|
| 4296 | - */ |
|
| 4292 | + * Gets all airlines countries |
|
| 4293 | + * |
|
| 4294 | + * @return Array the airline country list |
|
| 4295 | + * |
|
| 4296 | + */ |
|
| 4297 | 4297 | public function countAllAirlineCountries($limit = true) |
| 4298 | 4298 | { |
| 4299 | 4299 | $query = "SELECT DISTINCT spotter_output.airline_country, COUNT(spotter_output.airline_country) AS airline_country_count |
@@ -4319,11 +4319,11 @@ discard block |
||
| 4319 | 4319 | } |
| 4320 | 4320 | |
| 4321 | 4321 | /** |
| 4322 | - * Gets all number of flight over countries |
|
| 4323 | - * |
|
| 4324 | - * @return Array the airline country list |
|
| 4325 | - * |
|
| 4326 | - */ |
|
| 4322 | + * Gets all number of flight over countries |
|
| 4323 | + * |
|
| 4324 | + * @return Array the airline country list |
|
| 4325 | + * |
|
| 4326 | + */ |
|
| 4327 | 4327 | public function countAllFlightOverCountries($limit = true,$olderthanmonths = 0,$sincedate = '') |
| 4328 | 4328 | { |
| 4329 | 4329 | global $globalDBdriver; |
@@ -4335,15 +4335,15 @@ discard block |
||
| 4335 | 4335 | $query = "SELECT c.name, c.iso3, c.iso2, count(c.name) as nb |
| 4336 | 4336 | FROM countries c, spotter_live s |
| 4337 | 4337 | WHERE c.iso2 = s.over_country "; |
| 4338 | - if ($olderthanmonths > 0) { |
|
| 4338 | + if ($olderthanmonths > 0) { |
|
| 4339 | 4339 | if ($globalDBdriver == 'mysql') { |
| 4340 | 4340 | $query .= 'AND spotter_live.date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
| 4341 | 4341 | } else { |
| 4342 | 4342 | $query .= "AND spotter_live.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
| 4343 | 4343 | } |
| 4344 | 4344 | } |
| 4345 | - if ($sincedate != '') { |
|
| 4346 | - if ($globalDBdriver == 'mysql') { |
|
| 4345 | + if ($sincedate != '') { |
|
| 4346 | + if ($globalDBdriver == 'mysql') { |
|
| 4347 | 4347 | $query .= "AND spotter_live.date > '".$sincedate."' "; |
| 4348 | 4348 | } else { |
| 4349 | 4349 | $query .= "AND spotter_live.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -4373,11 +4373,11 @@ discard block |
||
| 4373 | 4373 | |
| 4374 | 4374 | |
| 4375 | 4375 | /** |
| 4376 | - * Gets all aircraft types that have flown over |
|
| 4377 | - * |
|
| 4378 | - * @return Array the aircraft list |
|
| 4379 | - * |
|
| 4380 | - */ |
|
| 4376 | + * Gets all aircraft types that have flown over |
|
| 4377 | + * |
|
| 4378 | + * @return Array the aircraft list |
|
| 4379 | + * |
|
| 4380 | + */ |
|
| 4381 | 4381 | public function countAllAircraftTypes($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array()) |
| 4382 | 4382 | { |
| 4383 | 4383 | global $globalDBdriver; |
@@ -4420,11 +4420,11 @@ discard block |
||
| 4420 | 4420 | } |
| 4421 | 4421 | |
| 4422 | 4422 | /** |
| 4423 | - * Gets all aircraft types that have flown over by airline |
|
| 4424 | - * |
|
| 4425 | - * @return Array the aircraft list |
|
| 4426 | - * |
|
| 4427 | - */ |
|
| 4423 | + * Gets all aircraft types that have flown over by airline |
|
| 4424 | + * |
|
| 4425 | + * @return Array the aircraft list |
|
| 4426 | + * |
|
| 4427 | + */ |
|
| 4428 | 4428 | public function countAllAircraftTypesByAirlines($limit = true,$olderthanmonths = 0,$sincedate = '') |
| 4429 | 4429 | { |
| 4430 | 4430 | global $globalDBdriver; |
@@ -4468,11 +4468,11 @@ discard block |
||
| 4468 | 4468 | |
| 4469 | 4469 | |
| 4470 | 4470 | /** |
| 4471 | - * Gets all aircraft registration that have flown over by aircaft icao |
|
| 4472 | - * |
|
| 4473 | - * @return Array the aircraft list |
|
| 4474 | - * |
|
| 4475 | - */ |
|
| 4471 | + * Gets all aircraft registration that have flown over by aircaft icao |
|
| 4472 | + * |
|
| 4473 | + * @return Array the aircraft list |
|
| 4474 | + * |
|
| 4475 | + */ |
|
| 4476 | 4476 | public function countAllAircraftRegistrationByAircraft($aircraft_icao) |
| 4477 | 4477 | { |
| 4478 | 4478 | $Image = new Image($this->db); |
@@ -4511,11 +4511,11 @@ discard block |
||
| 4511 | 4511 | |
| 4512 | 4512 | |
| 4513 | 4513 | /** |
| 4514 | - * Gets all aircraft types that have flown over by airline icao |
|
| 4515 | - * |
|
| 4516 | - * @return Array the aircraft list |
|
| 4517 | - * |
|
| 4518 | - */ |
|
| 4514 | + * Gets all aircraft types that have flown over by airline icao |
|
| 4515 | + * |
|
| 4516 | + * @return Array the aircraft list |
|
| 4517 | + * |
|
| 4518 | + */ |
|
| 4519 | 4519 | public function countAllAircraftTypesByAirline($airline_icao) |
| 4520 | 4520 | { |
| 4521 | 4521 | $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING); |
@@ -4545,11 +4545,11 @@ discard block |
||
| 4545 | 4545 | |
| 4546 | 4546 | |
| 4547 | 4547 | /** |
| 4548 | - * Gets all aircraft registration that have flown over by airline icao |
|
| 4549 | - * |
|
| 4550 | - * @return Array the aircraft list |
|
| 4551 | - * |
|
| 4552 | - */ |
|
| 4548 | + * Gets all aircraft registration that have flown over by airline icao |
|
| 4549 | + * |
|
| 4550 | + * @return Array the aircraft list |
|
| 4551 | + * |
|
| 4552 | + */ |
|
| 4553 | 4553 | public function countAllAircraftRegistrationByAirline($airline_icao) |
| 4554 | 4554 | { |
| 4555 | 4555 | $Image = new Image($this->db); |
@@ -4587,11 +4587,11 @@ discard block |
||
| 4587 | 4587 | |
| 4588 | 4588 | |
| 4589 | 4589 | /** |
| 4590 | - * Gets all aircraft manufacturer that have flown over by airline icao |
|
| 4591 | - * |
|
| 4592 | - * @return Array the aircraft list |
|
| 4593 | - * |
|
| 4594 | - */ |
|
| 4590 | + * Gets all aircraft manufacturer that have flown over by airline icao |
|
| 4591 | + * |
|
| 4592 | + * @return Array the aircraft list |
|
| 4593 | + * |
|
| 4594 | + */ |
|
| 4595 | 4595 | public function countAllAircraftManufacturerByAirline($airline_icao) |
| 4596 | 4596 | { |
| 4597 | 4597 | $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING); |
@@ -4620,11 +4620,11 @@ discard block |
||
| 4620 | 4620 | |
| 4621 | 4621 | |
| 4622 | 4622 | /** |
| 4623 | - * Gets all aircraft types that have flown over by airline icao |
|
| 4624 | - * |
|
| 4625 | - * @return Array the aircraft list |
|
| 4626 | - * |
|
| 4627 | - */ |
|
| 4623 | + * Gets all aircraft types that have flown over by airline icao |
|
| 4624 | + * |
|
| 4625 | + * @return Array the aircraft list |
|
| 4626 | + * |
|
| 4627 | + */ |
|
| 4628 | 4628 | public function countAllAircraftTypesByAirport($airport_icao) |
| 4629 | 4629 | { |
| 4630 | 4630 | $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
@@ -4653,11 +4653,11 @@ discard block |
||
| 4653 | 4653 | |
| 4654 | 4654 | |
| 4655 | 4655 | /** |
| 4656 | - * Gets all aircraft registration that have flown over by airport icao |
|
| 4657 | - * |
|
| 4658 | - * @return Array the aircraft list |
|
| 4659 | - * |
|
| 4660 | - */ |
|
| 4656 | + * Gets all aircraft registration that have flown over by airport icao |
|
| 4657 | + * |
|
| 4658 | + * @return Array the aircraft list |
|
| 4659 | + * |
|
| 4660 | + */ |
|
| 4661 | 4661 | public function countAllAircraftRegistrationByAirport($airport_icao) |
| 4662 | 4662 | { |
| 4663 | 4663 | $Image = new Image($this->db); |
@@ -4695,11 +4695,11 @@ discard block |
||
| 4695 | 4695 | |
| 4696 | 4696 | |
| 4697 | 4697 | /** |
| 4698 | - * Gets all aircraft manufacturer that have flown over by airport icao |
|
| 4699 | - * |
|
| 4700 | - * @return Array the aircraft list |
|
| 4701 | - * |
|
| 4702 | - */ |
|
| 4698 | + * Gets all aircraft manufacturer that have flown over by airport icao |
|
| 4699 | + * |
|
| 4700 | + * @return Array the aircraft list |
|
| 4701 | + * |
|
| 4702 | + */ |
|
| 4703 | 4703 | public function countAllAircraftManufacturerByAirport($airport_icao) |
| 4704 | 4704 | { |
| 4705 | 4705 | $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
@@ -4726,11 +4726,11 @@ discard block |
||
| 4726 | 4726 | } |
| 4727 | 4727 | |
| 4728 | 4728 | /** |
| 4729 | - * Gets all aircraft types that have flown over by aircraft manufacturer |
|
| 4730 | - * |
|
| 4731 | - * @return Array the aircraft list |
|
| 4732 | - * |
|
| 4733 | - */ |
|
| 4729 | + * Gets all aircraft types that have flown over by aircraft manufacturer |
|
| 4730 | + * |
|
| 4731 | + * @return Array the aircraft list |
|
| 4732 | + * |
|
| 4733 | + */ |
|
| 4734 | 4734 | public function countAllAircraftTypesByManufacturer($aircraft_manufacturer) |
| 4735 | 4735 | { |
| 4736 | 4736 | $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
@@ -4757,11 +4757,11 @@ discard block |
||
| 4757 | 4757 | |
| 4758 | 4758 | |
| 4759 | 4759 | /** |
| 4760 | - * Gets all aircraft registration that have flown over by aircaft manufacturer |
|
| 4761 | - * |
|
| 4762 | - * @return Array the aircraft list |
|
| 4763 | - * |
|
| 4764 | - */ |
|
| 4760 | + * Gets all aircraft registration that have flown over by aircaft manufacturer |
|
| 4761 | + * |
|
| 4762 | + * @return Array the aircraft list |
|
| 4763 | + * |
|
| 4764 | + */ |
|
| 4765 | 4765 | public function countAllAircraftRegistrationByManufacturer($aircraft_manufacturer) |
| 4766 | 4766 | { |
| 4767 | 4767 | $Image = new Image($this->db); |
@@ -4797,11 +4797,11 @@ discard block |
||
| 4797 | 4797 | } |
| 4798 | 4798 | |
| 4799 | 4799 | /** |
| 4800 | - * Gets all aircraft types that have flown over by date |
|
| 4801 | - * |
|
| 4802 | - * @return Array the aircraft list |
|
| 4803 | - * |
|
| 4804 | - */ |
|
| 4800 | + * Gets all aircraft types that have flown over by date |
|
| 4801 | + * |
|
| 4802 | + * @return Array the aircraft list |
|
| 4803 | + * |
|
| 4804 | + */ |
|
| 4805 | 4805 | public function countAllAircraftTypesByDate($date) |
| 4806 | 4806 | { |
| 4807 | 4807 | global $globalTimezone, $globalDBdriver; |
@@ -4844,11 +4844,11 @@ discard block |
||
| 4844 | 4844 | |
| 4845 | 4845 | |
| 4846 | 4846 | /** |
| 4847 | - * Gets all aircraft registration that have flown over by date |
|
| 4848 | - * |
|
| 4849 | - * @return Array the aircraft list |
|
| 4850 | - * |
|
| 4851 | - */ |
|
| 4847 | + * Gets all aircraft registration that have flown over by date |
|
| 4848 | + * |
|
| 4849 | + * @return Array the aircraft list |
|
| 4850 | + * |
|
| 4851 | + */ |
|
| 4852 | 4852 | public function countAllAircraftRegistrationByDate($date) |
| 4853 | 4853 | { |
| 4854 | 4854 | global $globalTimezone, $globalDBdriver; |
@@ -4900,11 +4900,11 @@ discard block |
||
| 4900 | 4900 | |
| 4901 | 4901 | |
| 4902 | 4902 | /** |
| 4903 | - * Gets all aircraft manufacturer that have flown over by date |
|
| 4904 | - * |
|
| 4905 | - * @return Array the aircraft manufacturer list |
|
| 4906 | - * |
|
| 4907 | - */ |
|
| 4903 | + * Gets all aircraft manufacturer that have flown over by date |
|
| 4904 | + * |
|
| 4905 | + * @return Array the aircraft manufacturer list |
|
| 4906 | + * |
|
| 4907 | + */ |
|
| 4908 | 4908 | public function countAllAircraftManufacturerByDate($date) |
| 4909 | 4909 | { |
| 4910 | 4910 | global $globalTimezone, $globalDBdriver; |
@@ -4947,11 +4947,11 @@ discard block |
||
| 4947 | 4947 | |
| 4948 | 4948 | |
| 4949 | 4949 | /** |
| 4950 | - * Gets all aircraft types that have flown over by ident/callsign |
|
| 4951 | - * |
|
| 4952 | - * @return Array the aircraft list |
|
| 4953 | - * |
|
| 4954 | - */ |
|
| 4950 | + * Gets all aircraft types that have flown over by ident/callsign |
|
| 4951 | + * |
|
| 4952 | + * @return Array the aircraft list |
|
| 4953 | + * |
|
| 4954 | + */ |
|
| 4955 | 4955 | public function countAllAircraftTypesByIdent($ident) |
| 4956 | 4956 | { |
| 4957 | 4957 | $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
@@ -4981,11 +4981,11 @@ discard block |
||
| 4981 | 4981 | |
| 4982 | 4982 | |
| 4983 | 4983 | /** |
| 4984 | - * Gets all aircraft registration that have flown over by ident/callsign |
|
| 4985 | - * |
|
| 4986 | - * @return Array the aircraft list |
|
| 4987 | - * |
|
| 4988 | - */ |
|
| 4984 | + * Gets all aircraft registration that have flown over by ident/callsign |
|
| 4985 | + * |
|
| 4986 | + * @return Array the aircraft list |
|
| 4987 | + * |
|
| 4988 | + */ |
|
| 4989 | 4989 | public function countAllAircraftRegistrationByIdent($ident) |
| 4990 | 4990 | { |
| 4991 | 4991 | $Image = new Image($this->db); |
@@ -5025,11 +5025,11 @@ discard block |
||
| 5025 | 5025 | |
| 5026 | 5026 | |
| 5027 | 5027 | /** |
| 5028 | - * Gets all aircraft manufacturer that have flown over by ident/callsign |
|
| 5029 | - * |
|
| 5030 | - * @return Array the aircraft manufacturer list |
|
| 5031 | - * |
|
| 5032 | - */ |
|
| 5028 | + * Gets all aircraft manufacturer that have flown over by ident/callsign |
|
| 5029 | + * |
|
| 5030 | + * @return Array the aircraft manufacturer list |
|
| 5031 | + * |
|
| 5032 | + */ |
|
| 5033 | 5033 | public function countAllAircraftManufacturerByIdent($ident) |
| 5034 | 5034 | { |
| 5035 | 5035 | $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
@@ -5056,11 +5056,11 @@ discard block |
||
| 5056 | 5056 | |
| 5057 | 5057 | |
| 5058 | 5058 | /** |
| 5059 | - * Gets all aircraft types that have flown over by route |
|
| 5060 | - * |
|
| 5061 | - * @return Array the aircraft list |
|
| 5062 | - * |
|
| 5063 | - */ |
|
| 5059 | + * Gets all aircraft types that have flown over by route |
|
| 5060 | + * |
|
| 5061 | + * @return Array the aircraft list |
|
| 5062 | + * |
|
| 5063 | + */ |
|
| 5064 | 5064 | public function countAllAircraftTypesByRoute($departure_airport_icao, $arrival_airport_icao) |
| 5065 | 5065 | { |
| 5066 | 5066 | $departure_airport_icao = filter_var($departure_airport_icao,FILTER_SANITIZE_STRING); |
@@ -5089,11 +5089,11 @@ discard block |
||
| 5089 | 5089 | } |
| 5090 | 5090 | |
| 5091 | 5091 | /** |
| 5092 | - * Gets all aircraft registration that have flown over by route |
|
| 5093 | - * |
|
| 5094 | - * @return Array the aircraft list |
|
| 5095 | - * |
|
| 5096 | - */ |
|
| 5092 | + * Gets all aircraft registration that have flown over by route |
|
| 5093 | + * |
|
| 5094 | + * @return Array the aircraft list |
|
| 5095 | + * |
|
| 5096 | + */ |
|
| 5097 | 5097 | public function countAllAircraftRegistrationByRoute($departure_airport_icao, $arrival_airport_icao) |
| 5098 | 5098 | { |
| 5099 | 5099 | $Image = new Image($this->db); |
@@ -5135,11 +5135,11 @@ discard block |
||
| 5135 | 5135 | |
| 5136 | 5136 | |
| 5137 | 5137 | /** |
| 5138 | - * Gets all aircraft manufacturer that have flown over by route |
|
| 5139 | - * |
|
| 5140 | - * @return Array the aircraft manufacturer list |
|
| 5141 | - * |
|
| 5142 | - */ |
|
| 5138 | + * Gets all aircraft manufacturer that have flown over by route |
|
| 5139 | + * |
|
| 5140 | + * @return Array the aircraft manufacturer list |
|
| 5141 | + * |
|
| 5142 | + */ |
|
| 5143 | 5143 | public function countAllAircraftManufacturerByRoute($departure_airport_icao, $arrival_airport_icao) |
| 5144 | 5144 | { |
| 5145 | 5145 | $departure_airport_icao = filter_var($departure_airport_icao,FILTER_SANITIZE_STRING); |
@@ -5173,11 +5173,11 @@ discard block |
||
| 5173 | 5173 | |
| 5174 | 5174 | |
| 5175 | 5175 | /** |
| 5176 | - * Gets all aircraft types that have flown over by country |
|
| 5177 | - * |
|
| 5178 | - * @return Array the aircraft list |
|
| 5179 | - * |
|
| 5180 | - */ |
|
| 5176 | + * Gets all aircraft types that have flown over by country |
|
| 5177 | + * |
|
| 5178 | + * @return Array the aircraft list |
|
| 5179 | + * |
|
| 5180 | + */ |
|
| 5181 | 5181 | public function countAllAircraftTypesByCountry($country) |
| 5182 | 5182 | { |
| 5183 | 5183 | $country = filter_var($country,FILTER_SANITIZE_STRING); |
@@ -5209,11 +5209,11 @@ discard block |
||
| 5209 | 5209 | |
| 5210 | 5210 | |
| 5211 | 5211 | /** |
| 5212 | - * Gets all aircraft registration that have flown over by country |
|
| 5213 | - * |
|
| 5214 | - * @return Array the aircraft list |
|
| 5215 | - * |
|
| 5216 | - */ |
|
| 5212 | + * Gets all aircraft registration that have flown over by country |
|
| 5213 | + * |
|
| 5214 | + * @return Array the aircraft list |
|
| 5215 | + * |
|
| 5216 | + */ |
|
| 5217 | 5217 | public function countAllAircraftRegistrationByCountry($country) |
| 5218 | 5218 | { |
| 5219 | 5219 | $Image = new Image($this->db); |
@@ -5254,11 +5254,11 @@ discard block |
||
| 5254 | 5254 | |
| 5255 | 5255 | |
| 5256 | 5256 | /** |
| 5257 | - * Gets all aircraft manufacturer that have flown over by country |
|
| 5258 | - * |
|
| 5259 | - * @return Array the aircraft manufacturer list |
|
| 5260 | - * |
|
| 5261 | - */ |
|
| 5257 | + * Gets all aircraft manufacturer that have flown over by country |
|
| 5258 | + * |
|
| 5259 | + * @return Array the aircraft manufacturer list |
|
| 5260 | + * |
|
| 5261 | + */ |
|
| 5262 | 5262 | public function countAllAircraftManufacturerByCountry($country) |
| 5263 | 5263 | { |
| 5264 | 5264 | $country = filter_var($country,FILTER_SANITIZE_STRING); |
@@ -5290,17 +5290,17 @@ discard block |
||
| 5290 | 5290 | |
| 5291 | 5291 | |
| 5292 | 5292 | /** |
| 5293 | - * Gets all aircraft manufacturers that have flown over |
|
| 5294 | - * |
|
| 5295 | - * @return Array the aircraft list |
|
| 5296 | - * |
|
| 5297 | - */ |
|
| 5293 | + * Gets all aircraft manufacturers that have flown over |
|
| 5294 | + * |
|
| 5295 | + * @return Array the aircraft list |
|
| 5296 | + * |
|
| 5297 | + */ |
|
| 5298 | 5298 | public function countAllAircraftManufacturers($filter = array()) |
| 5299 | 5299 | { |
| 5300 | 5300 | $filter_query = $this->getFilter($filter,true,true); |
| 5301 | 5301 | $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
| 5302 | 5302 | FROM spotter_output ".$filter_query." spotter_output.aircraft_manufacturer <> '' AND spotter_output.aircraft_manufacturer <> 'Not Available'"; |
| 5303 | - $query .= " GROUP BY spotter_output.aircraft_manufacturer |
|
| 5303 | + $query .= " GROUP BY spotter_output.aircraft_manufacturer |
|
| 5304 | 5304 | ORDER BY aircraft_manufacturer_count DESC |
| 5305 | 5305 | LIMIT 10"; |
| 5306 | 5306 | |
@@ -5325,11 +5325,11 @@ discard block |
||
| 5325 | 5325 | |
| 5326 | 5326 | |
| 5327 | 5327 | /** |
| 5328 | - * Gets all aircraft registrations that have flown over |
|
| 5329 | - * |
|
| 5330 | - * @return Array the aircraft list |
|
| 5331 | - * |
|
| 5332 | - */ |
|
| 5328 | + * Gets all aircraft registrations that have flown over |
|
| 5329 | + * |
|
| 5330 | + * @return Array the aircraft list |
|
| 5331 | + * |
|
| 5332 | + */ |
|
| 5333 | 5333 | public function countAllAircraftRegistrations($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array()) |
| 5334 | 5334 | { |
| 5335 | 5335 | global $globalDBdriver; |
@@ -5337,15 +5337,15 @@ discard block |
||
| 5337 | 5337 | $filter_query = $this->getFilter($filters,true,true); |
| 5338 | 5338 | $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 |
| 5339 | 5339 | FROM spotter_output ".$filter_query." spotter_output.registration <> '' AND spotter_output.registration <> 'NA'"; |
| 5340 | - if ($olderthanmonths > 0) { |
|
| 5341 | - if ($globalDBdriver == 'mysql') { |
|
| 5340 | + if ($olderthanmonths > 0) { |
|
| 5341 | + if ($globalDBdriver == 'mysql') { |
|
| 5342 | 5342 | $query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)'; |
| 5343 | 5343 | } else { |
| 5344 | 5344 | $query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
| 5345 | 5345 | } |
| 5346 | 5346 | } |
| 5347 | - if ($sincedate != '') { |
|
| 5348 | - if ($globalDBdriver == 'mysql') { |
|
| 5347 | + if ($sincedate != '') { |
|
| 5348 | + if ($globalDBdriver == 'mysql') { |
|
| 5349 | 5349 | $query .= " AND spotter_output.date > '".$sincedate."'"; |
| 5350 | 5350 | } else { |
| 5351 | 5351 | $query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -5354,7 +5354,7 @@ discard block |
||
| 5354 | 5354 | |
| 5355 | 5355 | // if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
| 5356 | 5356 | //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
| 5357 | - $query .= " GROUP BY spotter_output.registration, spotter_output.aircraft_icao, spotter_output.aircraft_name, spotter_output.airline_name ORDER BY aircraft_registration_count DESC"; |
|
| 5357 | + $query .= " GROUP BY spotter_output.registration, spotter_output.aircraft_icao, spotter_output.aircraft_name, spotter_output.airline_name ORDER BY aircraft_registration_count DESC"; |
|
| 5358 | 5358 | if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
| 5359 | 5359 | |
| 5360 | 5360 | $sth = $this->db->prepare($query); |
@@ -5385,11 +5385,11 @@ discard block |
||
| 5385 | 5385 | |
| 5386 | 5386 | |
| 5387 | 5387 | /** |
| 5388 | - * Gets all aircraft registrations that have flown over |
|
| 5389 | - * |
|
| 5390 | - * @return Array the aircraft list |
|
| 5391 | - * |
|
| 5392 | - */ |
|
| 5388 | + * Gets all aircraft registrations that have flown over |
|
| 5389 | + * |
|
| 5390 | + * @return Array the aircraft list |
|
| 5391 | + * |
|
| 5392 | + */ |
|
| 5393 | 5393 | public function countAllAircraftRegistrationsByAirlines($limit = true,$olderthanmonths = 0,$sincedate = '') |
| 5394 | 5394 | { |
| 5395 | 5395 | global $globalDBdriver; |
@@ -5397,15 +5397,15 @@ discard block |
||
| 5397 | 5397 | $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 |
| 5398 | 5398 | FROM spotter_output |
| 5399 | 5399 | WHERE spotter_output.airline_icao <> '' AND spotter_output.registration <> '' AND spotter_output.registration <> 'NA' "; |
| 5400 | - if ($olderthanmonths > 0) { |
|
| 5401 | - if ($globalDBdriver == 'mysql') { |
|
| 5400 | + if ($olderthanmonths > 0) { |
|
| 5401 | + if ($globalDBdriver == 'mysql') { |
|
| 5402 | 5402 | $query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) '; |
| 5403 | 5403 | } else { |
| 5404 | 5404 | $query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
| 5405 | 5405 | } |
| 5406 | 5406 | } |
| 5407 | - if ($sincedate != '') { |
|
| 5408 | - if ($globalDBdriver == 'mysql') { |
|
| 5407 | + if ($sincedate != '') { |
|
| 5408 | + if ($globalDBdriver == 'mysql') { |
|
| 5409 | 5409 | $query .= "AND spotter_output.date > '".$sincedate."' "; |
| 5410 | 5410 | } else { |
| 5411 | 5411 | $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
@@ -5414,7 +5414,7 @@ discard block |
||
| 5414 | 5414 | |
| 5415 | 5415 | // if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
| 5416 | 5416 | //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
| 5417 | - $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"; |
|
| 5417 | + $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"; |
|
| 5418 | 5418 | if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
| 5419 | 5419 | |
| 5420 | 5420 | $sth = $this->db->prepare($query); |
@@ -5446,35 +5446,35 @@ discard block |
||
| 5446 | 5446 | |
| 5447 | 5447 | |
| 5448 | 5448 | /** |
| 5449 | - * Gets all departure airports of the airplanes that have flown over |
|
| 5450 | - * |
|
| 5451 | - * @return Array the airport list |
|
| 5452 | - * |
|
| 5453 | - */ |
|
| 5449 | + * Gets all departure airports of the airplanes that have flown over |
|
| 5450 | + * |
|
| 5451 | + * @return Array the airport list |
|
| 5452 | + * |
|
| 5453 | + */ |
|
| 5454 | 5454 | public function countAllDepartureAirports($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array()) |
| 5455 | 5455 | { |
| 5456 | 5456 | global $globalDBdriver; |
| 5457 | 5457 | $filter_query = $this->getFilter($filters,true,true); |
| 5458 | 5458 | $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 |
| 5459 | 5459 | FROM spotter_output".$filter_query." spotter_output.departure_airport_name <> '' AND spotter_output.departure_airport_icao <> 'NA'"; |
| 5460 | - if ($olderthanmonths > 0) { |
|
| 5461 | - if ($globalDBdriver == 'mysql') { |
|
| 5460 | + if ($olderthanmonths > 0) { |
|
| 5461 | + if ($globalDBdriver == 'mysql') { |
|
| 5462 | 5462 | $query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)'; |
| 5463 | 5463 | } else { |
| 5464 | 5464 | $query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
| 5465 | 5465 | } |
| 5466 | - } |
|
| 5467 | - if ($sincedate != '') { |
|
| 5468 | - if ($globalDBdriver == 'mysql') { |
|
| 5466 | + } |
|
| 5467 | + if ($sincedate != '') { |
|
| 5468 | + if ($globalDBdriver == 'mysql') { |
|
| 5469 | 5469 | $query .= " AND spotter_output.date > '".$sincedate."'"; |
| 5470 | 5470 | } else { |
| 5471 | 5471 | $query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
| 5472 | 5472 | } |
| 5473 | 5473 | } |
| 5474 | 5474 | |
| 5475 | - //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
| 5476 | - //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
| 5477 | - $query .= " GROUP BY spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country |
|
| 5475 | + //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
| 5476 | + //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
| 5477 | + $query .= " GROUP BY spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country |
|
| 5478 | 5478 | ORDER BY airport_departure_icao_count DESC"; |
| 5479 | 5479 | if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
| 5480 | 5480 | |
@@ -5498,35 +5498,35 @@ discard block |
||
| 5498 | 5498 | } |
| 5499 | 5499 | |
| 5500 | 5500 | /** |
| 5501 | - * Gets all departure airports of the airplanes that have flown over |
|
| 5502 | - * |
|
| 5503 | - * @return Array the airport list |
|
| 5504 | - * |
|
| 5505 | - */ |
|
| 5501 | + * Gets all departure airports of the airplanes that have flown over |
|
| 5502 | + * |
|
| 5503 | + * @return Array the airport list |
|
| 5504 | + * |
|
| 5505 | + */ |
|
| 5506 | 5506 | public function countAllDepartureAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '') |
| 5507 | 5507 | { |
| 5508 | 5508 | global $globalDBdriver; |
| 5509 | 5509 | $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 |
| 5510 | 5510 | FROM spotter_output |
| 5511 | 5511 | WHERE spotter_output.airline_icao <> '' AND spotter_output.departure_airport_name <> '' AND spotter_output.departure_airport_icao <> 'NA' "; |
| 5512 | - if ($olderthanmonths > 0) { |
|
| 5513 | - if ($globalDBdriver == 'mysql') { |
|
| 5512 | + if ($olderthanmonths > 0) { |
|
| 5513 | + if ($globalDBdriver == 'mysql') { |
|
| 5514 | 5514 | $query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) '; |
| 5515 | 5515 | } else { |
| 5516 | 5516 | $query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
| 5517 | 5517 | } |
| 5518 | - } |
|
| 5519 | - if ($sincedate != '') { |
|
| 5520 | - if ($globalDBdriver == 'mysql') { |
|
| 5518 | + } |
|
| 5519 | + if ($sincedate != '') { |
|
| 5520 | + if ($globalDBdriver == 'mysql') { |
|
| 5521 | 5521 | $query .= "AND spotter_output.date > '".$sincedate."' "; |
| 5522 | 5522 | } else { |
| 5523 | 5523 | $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
| 5524 | 5524 | } |
| 5525 | 5525 | } |
| 5526 | 5526 | |
| 5527 | - //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
| 5528 | - //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
| 5529 | - $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 |
|
| 5527 | + //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
| 5528 | + //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
| 5529 | + $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 |
|
| 5530 | 5530 | ORDER BY airport_departure_icao_count DESC"; |
| 5531 | 5531 | if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
| 5532 | 5532 | |
@@ -5551,34 +5551,34 @@ discard block |
||
| 5551 | 5551 | } |
| 5552 | 5552 | |
| 5553 | 5553 | /** |
| 5554 | - * Gets all detected departure airports of the airplanes that have flown over |
|
| 5555 | - * |
|
| 5556 | - * @return Array the airport list |
|
| 5557 | - * |
|
| 5558 | - */ |
|
| 5554 | + * Gets all detected departure airports of the airplanes that have flown over |
|
| 5555 | + * |
|
| 5556 | + * @return Array the airport list |
|
| 5557 | + * |
|
| 5558 | + */ |
|
| 5559 | 5559 | public function countAllDetectedDepartureAirports($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array()) |
| 5560 | 5560 | { |
| 5561 | 5561 | global $globalDBdriver; |
| 5562 | 5562 | $filter_query = $this->getFilter($filters,true,true); |
| 5563 | 5563 | $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 |
| 5564 | 5564 | FROM spotter_output, airport".$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"; |
| 5565 | - if ($olderthanmonths > 0) { |
|
| 5566 | - if ($globalDBdriver == 'mysql') { |
|
| 5565 | + if ($olderthanmonths > 0) { |
|
| 5566 | + if ($globalDBdriver == 'mysql') { |
|
| 5567 | 5567 | $query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)'; |
| 5568 | 5568 | } else { |
| 5569 | 5569 | $query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
| 5570 | 5570 | } |
| 5571 | - } |
|
| 5572 | - if ($sincedate != '') { |
|
| 5573 | - if ($globalDBdriver == 'mysql') { |
|
| 5571 | + } |
|
| 5572 | + if ($sincedate != '') { |
|
| 5573 | + if ($globalDBdriver == 'mysql') { |
|
| 5574 | 5574 | $query .= " AND spotter_output.date > '".$sincedate."'"; |
| 5575 | 5575 | } else { |
| 5576 | 5576 | $query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
| 5577 | 5577 | } |
| 5578 | 5578 | } |
| 5579 | - //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
| 5580 | - //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
| 5581 | - $query .= " GROUP BY spotter_output.real_departure_airport_icao, airport.name, airport.city, airport.country |
|
| 5579 | + //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
| 5580 | + //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
| 5581 | + $query .= " GROUP BY spotter_output.real_departure_airport_icao, airport.name, airport.city, airport.country |
|
| 5582 | 5582 | ORDER BY airport_departure_icao_count DESC"; |
| 5583 | 5583 | if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
| 5584 | 5584 | |
@@ -5602,35 +5602,35 @@ discard block |
||
| 5602 | 5602 | } |
| 5603 | 5603 | |
| 5604 | 5604 | /** |
| 5605 | - * Gets all detected departure airports of the airplanes that have flown over |
|
| 5606 | - * |
|
| 5607 | - * @return Array the airport list |
|
| 5608 | - * |
|
| 5609 | - */ |
|
| 5605 | + * Gets all detected departure airports of the airplanes that have flown over |
|
| 5606 | + * |
|
| 5607 | + * @return Array the airport list |
|
| 5608 | + * |
|
| 5609 | + */ |
|
| 5610 | 5610 | public function countAllDetectedDepartureAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '') |
| 5611 | 5611 | { |
| 5612 | 5612 | global $globalDBdriver; |
| 5613 | 5613 | $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 |
| 5614 | 5614 | FROM spotter_output, airport |
| 5615 | 5615 | WHERE 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 "; |
| 5616 | - if ($olderthanmonths > 0) { |
|
| 5617 | - if ($globalDBdriver == 'mysql') { |
|
| 5616 | + if ($olderthanmonths > 0) { |
|
| 5617 | + if ($globalDBdriver == 'mysql') { |
|
| 5618 | 5618 | $query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) '; |
| 5619 | 5619 | } else { |
| 5620 | 5620 | $query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
| 5621 | 5621 | } |
| 5622 | - } |
|
| 5623 | - if ($sincedate != '') { |
|
| 5624 | - if ($globalDBdriver == 'mysql') { |
|
| 5622 | + } |
|
| 5623 | + if ($sincedate != '') { |
|
| 5624 | + if ($globalDBdriver == 'mysql') { |
|
| 5625 | 5625 | $query .= "AND spotter_output.date > '".$sincedate."' "; |
| 5626 | 5626 | } else { |
| 5627 | 5627 | $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP) "; |
| 5628 | 5628 | } |
| 5629 | 5629 | } |
| 5630 | 5630 | |
| 5631 | - //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
| 5632 | - //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
| 5633 | - $query .= "GROUP BY spotter_output.airline_icao, spotter_output.real_departure_airport_icao, airport.name, airport.city, airport.country |
|
| 5631 | + //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
| 5632 | + //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
| 5633 | + $query .= "GROUP BY spotter_output.airline_icao, spotter_output.real_departure_airport_icao, airport.name, airport.city, airport.country |
|
| 5634 | 5634 | ORDER BY airport_departure_icao_count DESC"; |
| 5635 | 5635 | if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
| 5636 | 5636 | |
@@ -5655,11 +5655,11 @@ discard block |
||
| 5655 | 5655 | } |
| 5656 | 5656 | |
| 5657 | 5657 | /** |
| 5658 | - * Gets all departure airports of the airplanes that have flown over based on an airline icao |
|
| 5659 | - * |
|
| 5660 | - * @return Array the airport list |
|
| 5661 | - * |
|
| 5662 | - */ |
|
| 5658 | + * Gets all departure airports of the airplanes that have flown over based on an airline icao |
|
| 5659 | + * |
|
| 5660 | + * @return Array the airport list |
|
| 5661 | + * |
|
| 5662 | + */ |
|
| 5663 | 5663 | public function countAllDepartureAirportsByAirline($airline_icao) |
| 5664 | 5664 | { |
| 5665 | 5665 | $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING); |
@@ -5694,11 +5694,11 @@ discard block |
||
| 5694 | 5694 | |
| 5695 | 5695 | |
| 5696 | 5696 | /** |
| 5697 | - * Gets all departure airports by country of the airplanes that have flown over based on an airline icao |
|
| 5698 | - * |
|
| 5699 | - * @return Array the airport list |
|
| 5700 | - * |
|
| 5701 | - */ |
|
| 5697 | + * Gets all departure airports by country of the airplanes that have flown over based on an airline icao |
|
| 5698 | + * |
|
| 5699 | + * @return Array the airport list |
|
| 5700 | + * |
|
| 5701 | + */ |
|
| 5702 | 5702 | public function countAllDepartureAirportCountriesByAirline($airline_icao) |
| 5703 | 5703 | { |
| 5704 | 5704 | $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING); |
@@ -5730,11 +5730,11 @@ discard block |
||
| 5730 | 5730 | |
| 5731 | 5731 | |
| 5732 | 5732 | /** |
| 5733 | - * Gets all departure airports of the airplanes that have flown over based on an aircraft icao |
|
| 5734 | - * |
|
| 5735 | - * @return Array the airport list |
|
| 5736 | - * |
|
| 5737 | - */ |
|
| 5733 | + * Gets all departure airports of the airplanes that have flown over based on an aircraft icao |
|
| 5734 | + * |
|
| 5735 | + * @return Array the airport list |
|
| 5736 | + * |
|
| 5737 | + */ |
|
| 5738 | 5738 | public function countAllDepartureAirportsByAircraft($aircraft_icao) |
| 5739 | 5739 | { |
| 5740 | 5740 | $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
@@ -5768,11 +5768,11 @@ discard block |
||
| 5768 | 5768 | |
| 5769 | 5769 | |
| 5770 | 5770 | /** |
| 5771 | - * Gets all departure airports by country of the airplanes that have flown over based on an aircraft icao |
|
| 5772 | - * |
|
| 5773 | - * @return Array the airport list |
|
| 5774 | - * |
|
| 5775 | - */ |
|
| 5771 | + * Gets all departure airports by country of the airplanes that have flown over based on an aircraft icao |
|
| 5772 | + * |
|
| 5773 | + * @return Array the airport list |
|
| 5774 | + * |
|
| 5775 | + */ |
|
| 5776 | 5776 | public function countAllDepartureAirportCountriesByAircraft($aircraft_icao) |
| 5777 | 5777 | { |
| 5778 | 5778 | $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
@@ -5803,11 +5803,11 @@ discard block |
||
| 5803 | 5803 | |
| 5804 | 5804 | |
| 5805 | 5805 | /** |
| 5806 | - * Gets all departure airports of the airplanes that have flown over based on an aircraft registration |
|
| 5807 | - * |
|
| 5808 | - * @return Array the airport list |
|
| 5809 | - * |
|
| 5810 | - */ |
|
| 5806 | + * Gets all departure airports of the airplanes that have flown over based on an aircraft registration |
|
| 5807 | + * |
|
| 5808 | + * @return Array the airport list |
|
| 5809 | + * |
|
| 5810 | + */ |
|
| 5811 | 5811 | public function countAllDepartureAirportsByRegistration($registration) |
| 5812 | 5812 | { |
| 5813 | 5813 | $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
@@ -5841,11 +5841,11 @@ discard block |
||
| 5841 | 5841 | |
| 5842 | 5842 | |
| 5843 | 5843 | /** |
| 5844 | - * Gets all departure airports by country of the airplanes that have flown over based on an aircraft registration |
|
| 5845 | - * |
|
| 5846 | - * @return Array the airport list |
|
| 5847 | - * |
|
| 5848 | - */ |
|
| 5844 | + * Gets all departure airports by country of the airplanes that have flown over based on an aircraft registration |
|
| 5845 | + * |
|
| 5846 | + * @return Array the airport list |
|
| 5847 | + * |
|
| 5848 | + */ |
|
| 5849 | 5849 | public function countAllDepartureAirportCountriesByRegistration($registration) |
| 5850 | 5850 | { |
| 5851 | 5851 | $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
@@ -5876,11 +5876,11 @@ discard block |
||
| 5876 | 5876 | |
| 5877 | 5877 | |
| 5878 | 5878 | /** |
| 5879 | - * Gets all departure airports of the airplanes that have flown over based on an arrivl airport icao |
|
| 5880 | - * |
|
| 5881 | - * @return Array the airport list |
|
| 5882 | - * |
|
| 5883 | - */ |
|
| 5879 | + * Gets all departure airports of the airplanes that have flown over based on an arrivl airport icao |
|
| 5880 | + * |
|
| 5881 | + * @return Array the airport list |
|
| 5882 | + * |
|
| 5883 | + */ |
|
| 5884 | 5884 | public function countAllDepartureAirportsByAirport($airport_icao) |
| 5885 | 5885 | { |
| 5886 | 5886 | $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
@@ -5914,11 +5914,11 @@ discard block |
||
| 5914 | 5914 | |
| 5915 | 5915 | |
| 5916 | 5916 | /** |
| 5917 | - * Gets all departure airports by country of the airplanes that have flown over based on an airport icao |
|
| 5918 | - * |
|
| 5919 | - * @return Array the airport list |
|
| 5920 | - * |
|
| 5921 | - */ |
|
| 5917 | + * Gets all departure airports by country of the airplanes that have flown over based on an airport icao |
|
| 5918 | + * |
|
| 5919 | + * @return Array the airport list |
|
| 5920 | + * |
|
| 5921 | + */ |
|
| 5922 | 5922 | public function countAllDepartureAirportCountriesByAirport($airport_icao) |
| 5923 | 5923 | { |
| 5924 | 5924 | $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
@@ -5950,11 +5950,11 @@ discard block |
||
| 5950 | 5950 | |
| 5951 | 5951 | |
| 5952 | 5952 | /** |
| 5953 | - * Gets all departure airports of the airplanes that have flown over based on an aircraft manufacturer |
|
| 5954 | - * |
|
| 5955 | - * @return Array the airport list |
|
| 5956 | - * |
|
| 5957 | - */ |
|
| 5953 | + * Gets all departure airports of the airplanes that have flown over based on an aircraft manufacturer |
|
| 5954 | + * |
|
| 5955 | + * @return Array the airport list |
|
| 5956 | + * |
|
| 5957 | + */ |
|
| 5958 | 5958 | public function countAllDepartureAirportsByManufacturer($aircraft_manufacturer) |
| 5959 | 5959 | { |
| 5960 | 5960 | $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
@@ -5988,11 +5988,11 @@ discard block |
||
| 5988 | 5988 | |
| 5989 | 5989 | |
| 5990 | 5990 | /** |
| 5991 | - * Gets all departure airports by country of the airplanes that have flown over based on an aircraft manufacturer |
|
| 5992 | - * |
|
| 5993 | - * @return Array the airport list |
|
| 5994 | - * |
|
| 5995 | - */ |
|
| 5991 | + * Gets all departure airports by country of the airplanes that have flown over based on an aircraft manufacturer |
|
| 5992 | + * |
|
| 5993 | + * @return Array the airport list |
|
| 5994 | + * |
|
| 5995 | + */ |
|
| 5996 | 5996 | public function countAllDepartureAirportCountriesByManufacturer($aircraft_manufacturer) |
| 5997 | 5997 | { |
| 5998 | 5998 | $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
@@ -6023,11 +6023,11 @@ discard block |
||
| 6023 | 6023 | |
| 6024 | 6024 | |
| 6025 | 6025 | /** |
| 6026 | - * Gets all departure airports of the airplanes that have flown over based on a date |
|
| 6027 | - * |
|
| 6028 | - * @return Array the airport list |
|
| 6029 | - * |
|
| 6030 | - */ |
|
| 6026 | + * Gets all departure airports of the airplanes that have flown over based on a date |
|
| 6027 | + * |
|
| 6028 | + * @return Array the airport list |
|
| 6029 | + * |
|
| 6030 | + */ |
|
| 6031 | 6031 | public function countAllDepartureAirportsByDate($date) |
| 6032 | 6032 | { |
| 6033 | 6033 | global $globalTimezone, $globalDBdriver; |
@@ -6075,11 +6075,11 @@ discard block |
||
| 6075 | 6075 | |
| 6076 | 6076 | |
| 6077 | 6077 | /** |
| 6078 | - * Gets all departure airports by country of the airplanes that have flown over based on a date |
|
| 6079 | - * |
|
| 6080 | - * @return Array the airport list |
|
| 6081 | - * |
|
| 6082 | - */ |
|
| 6078 | + * Gets all departure airports by country of the airplanes that have flown over based on a date |
|
| 6079 | + * |
|
| 6080 | + * @return Array the airport list |
|
| 6081 | + * |
|
| 6082 | + */ |
|
| 6083 | 6083 | public function countAllDepartureAirportCountriesByDate($date) |
| 6084 | 6084 | { |
| 6085 | 6085 | global $globalTimezone, $globalDBdriver; |
@@ -6123,11 +6123,11 @@ discard block |
||
| 6123 | 6123 | |
| 6124 | 6124 | |
| 6125 | 6125 | /** |
| 6126 | - * Gets all departure airports of the airplanes that have flown over based on a ident/callsign |
|
| 6127 | - * |
|
| 6128 | - * @return Array the airport list |
|
| 6129 | - * |
|
| 6130 | - */ |
|
| 6126 | + * Gets all departure airports of the airplanes that have flown over based on a ident/callsign |
|
| 6127 | + * |
|
| 6128 | + * @return Array the airport list |
|
| 6129 | + * |
|
| 6130 | + */ |
|
| 6131 | 6131 | public function countAllDepartureAirportsByIdent($ident) |
| 6132 | 6132 | { |
| 6133 | 6133 | $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
@@ -6162,11 +6162,11 @@ discard block |
||
| 6162 | 6162 | |
| 6163 | 6163 | |
| 6164 | 6164 | /** |
| 6165 | - * Gets all departure airports by country of the airplanes that have flown over based on a callsign/ident |
|
| 6166 | - * |
|
| 6167 | - * @return Array the airport list |
|
| 6168 | - * |
|
| 6169 | - */ |
|
| 6165 | + * Gets all departure airports by country of the airplanes that have flown over based on a callsign/ident |
|
| 6166 | + * |
|
| 6167 | + * @return Array the airport list |
|
| 6168 | + * |
|
| 6169 | + */ |
|
| 6170 | 6170 | public function countAllDepartureAirportCountriesByIdent($ident) |
| 6171 | 6171 | { |
| 6172 | 6172 | $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
@@ -6198,11 +6198,11 @@ discard block |
||
| 6198 | 6198 | |
| 6199 | 6199 | |
| 6200 | 6200 | /** |
| 6201 | - * Gets all departure airports of the airplanes that have flown over based on a country |
|
| 6202 | - * |
|
| 6203 | - * @return Array the airport list |
|
| 6204 | - * |
|
| 6205 | - */ |
|
| 6201 | + * Gets all departure airports of the airplanes that have flown over based on a country |
|
| 6202 | + * |
|
| 6203 | + * @return Array the airport list |
|
| 6204 | + * |
|
| 6205 | + */ |
|
| 6206 | 6206 | public function countAllDepartureAirportsByCountry($country) |
| 6207 | 6207 | { |
| 6208 | 6208 | $country = filter_var($country,FILTER_SANITIZE_STRING); |
@@ -6236,11 +6236,11 @@ discard block |
||
| 6236 | 6236 | |
| 6237 | 6237 | |
| 6238 | 6238 | /** |
| 6239 | - * Gets all departure airports by country of the airplanes that have flown over based on an aircraft icao |
|
| 6240 | - * |
|
| 6241 | - * @return Array the airport list |
|
| 6242 | - * |
|
| 6243 | - */ |
|
| 6239 | + * Gets all departure airports by country of the airplanes that have flown over based on an aircraft icao |
|
| 6240 | + * |
|
| 6241 | + * @return Array the airport list |
|
| 6242 | + * |
|
| 6243 | + */ |
|
| 6244 | 6244 | public function countAllDepartureAirportCountriesByCountry($country) |
| 6245 | 6245 | { |
| 6246 | 6246 | $country = filter_var($country,FILTER_SANITIZE_STRING); |
@@ -6271,40 +6271,40 @@ discard block |
||
| 6271 | 6271 | |
| 6272 | 6272 | |
| 6273 | 6273 | /** |
| 6274 | - * Gets all arrival airports of the airplanes that have flown over |
|
| 6275 | - * |
|
| 6276 | - * @return Array the airport list |
|
| 6277 | - * |
|
| 6278 | - */ |
|
| 6274 | + * Gets all arrival airports of the airplanes that have flown over |
|
| 6275 | + * |
|
| 6276 | + * @return Array the airport list |
|
| 6277 | + * |
|
| 6278 | + */ |
|
| 6279 | 6279 | public function countAllArrivalAirports($limit = true, $olderthanmonths = 0, $sincedate = '', $icaoaskey = false,$filters = array()) |
| 6280 | 6280 | { |
| 6281 | 6281 | global $globalDBdriver; |
| 6282 | 6282 | $filter_query = $this->getFilter($filters,true,true); |
| 6283 | 6283 | $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 |
| 6284 | 6284 | FROM spotter_output".$filter_query." spotter_output.arrival_airport_name <> '' AND spotter_output.arrival_airport_icao <> 'NA'"; |
| 6285 | - if ($olderthanmonths > 0) { |
|
| 6286 | - if ($globalDBdriver == 'mysql') { |
|
| 6285 | + if ($olderthanmonths > 0) { |
|
| 6286 | + if ($globalDBdriver == 'mysql') { |
|
| 6287 | 6287 | $query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)'; |
| 6288 | 6288 | } else { |
| 6289 | 6289 | $query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
| 6290 | 6290 | } |
| 6291 | - if ($sincedate != '') { |
|
| 6292 | - if ($globalDBdriver == 'mysql') { |
|
| 6291 | + if ($sincedate != '') { |
|
| 6292 | + if ($globalDBdriver == 'mysql') { |
|
| 6293 | 6293 | $query .= " AND spotter_output.date > '".$sincedate."'"; |
| 6294 | 6294 | } else { |
| 6295 | 6295 | $query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
| 6296 | 6296 | } |
| 6297 | 6297 | } |
| 6298 | - if ($globalDBdriver == 'mysql') { |
|
| 6298 | + if ($globalDBdriver == 'mysql') { |
|
| 6299 | 6299 | $query .= " AND spotter_output.date > '".$sincedate."'"; |
| 6300 | 6300 | } else { |
| 6301 | 6301 | $query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
| 6302 | 6302 | } |
| 6303 | 6303 | } |
| 6304 | 6304 | |
| 6305 | - //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
| 6306 | - //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
| 6307 | - $query .= " GROUP BY spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
|
| 6305 | + //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
| 6306 | + //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
| 6307 | + $query .= " GROUP BY spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
|
| 6308 | 6308 | ORDER BY airport_arrival_icao_count DESC"; |
| 6309 | 6309 | if ($limit) $query .= " LIMIT 10"; |
| 6310 | 6310 | |
@@ -6333,40 +6333,40 @@ discard block |
||
| 6333 | 6333 | } |
| 6334 | 6334 | |
| 6335 | 6335 | /** |
| 6336 | - * Gets all arrival airports of the airplanes that have flown over |
|
| 6337 | - * |
|
| 6338 | - * @return Array the airport list |
|
| 6339 | - * |
|
| 6340 | - */ |
|
| 6336 | + * Gets all arrival airports of the airplanes that have flown over |
|
| 6337 | + * |
|
| 6338 | + * @return Array the airport list |
|
| 6339 | + * |
|
| 6340 | + */ |
|
| 6341 | 6341 | public function countAllArrivalAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '', $icaoaskey = false) |
| 6342 | 6342 | { |
| 6343 | 6343 | global $globalDBdriver; |
| 6344 | 6344 | $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 |
| 6345 | 6345 | FROM spotter_output |
| 6346 | 6346 | WHERE spotter_output.airline_icao <> '' AND spotter_output.arrival_airport_name <> '' AND spotter_output.arrival_airport_icao <> 'NA' "; |
| 6347 | - if ($olderthanmonths > 0) { |
|
| 6348 | - if ($globalDBdriver == 'mysql') { |
|
| 6347 | + if ($olderthanmonths > 0) { |
|
| 6348 | + if ($globalDBdriver == 'mysql') { |
|
| 6349 | 6349 | $query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) '; |
| 6350 | 6350 | } else { |
| 6351 | 6351 | $query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
| 6352 | 6352 | } |
| 6353 | - if ($sincedate != '') { |
|
| 6354 | - if ($globalDBdriver == 'mysql') { |
|
| 6353 | + if ($sincedate != '') { |
|
| 6354 | + if ($globalDBdriver == 'mysql') { |
|
| 6355 | 6355 | $query .= "AND spotter_output.date > '".$sincedate."' "; |
| 6356 | 6356 | } else { |
| 6357 | 6357 | $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
| 6358 | 6358 | } |
| 6359 | 6359 | } |
| 6360 | - if ($globalDBdriver == 'mysql') { |
|
| 6360 | + if ($globalDBdriver == 'mysql') { |
|
| 6361 | 6361 | $query .= "AND spotter_output.date > '".$sincedate."' "; |
| 6362 | 6362 | } else { |
| 6363 | 6363 | $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
| 6364 | 6364 | } |
| 6365 | 6365 | } |
| 6366 | 6366 | |
| 6367 | - //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
| 6368 | - //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
| 6369 | - $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 |
|
| 6367 | + //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
| 6368 | + //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
| 6369 | + $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 |
|
| 6370 | 6370 | ORDER BY airport_arrival_icao_count DESC"; |
| 6371 | 6371 | if ($limit) $query .= " LIMIT 10"; |
| 6372 | 6372 | |
@@ -6397,39 +6397,39 @@ discard block |
||
| 6397 | 6397 | |
| 6398 | 6398 | |
| 6399 | 6399 | /** |
| 6400 | - * Gets all detected arrival airports of the airplanes that have flown over |
|
| 6401 | - * |
|
| 6402 | - * @return Array the airport list |
|
| 6403 | - * |
|
| 6404 | - */ |
|
| 6400 | + * Gets all detected arrival airports of the airplanes that have flown over |
|
| 6401 | + * |
|
| 6402 | + * @return Array the airport list |
|
| 6403 | + * |
|
| 6404 | + */ |
|
| 6405 | 6405 | public function countAllDetectedArrivalAirports($limit = true, $olderthanmonths = 0, $sincedate = '',$icaoaskey = false,$filters = array()) |
| 6406 | 6406 | { |
| 6407 | 6407 | global $globalDBdriver; |
| 6408 | 6408 | $filter_query = $this->getFilter($filters,true,true); |
| 6409 | 6409 | $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 |
| 6410 | 6410 | FROM spotter_output, airport".$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"; |
| 6411 | - if ($olderthanmonths > 0) { |
|
| 6412 | - if ($globalDBdriver == 'mysql') { |
|
| 6411 | + if ($olderthanmonths > 0) { |
|
| 6412 | + if ($globalDBdriver == 'mysql') { |
|
| 6413 | 6413 | $query .= ' AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH)'; |
| 6414 | 6414 | } else { |
| 6415 | 6415 | $query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
| 6416 | 6416 | } |
| 6417 | - if ($sincedate != '') { |
|
| 6418 | - if ($globalDBdriver == 'mysql') { |
|
| 6417 | + if ($sincedate != '') { |
|
| 6418 | + if ($globalDBdriver == 'mysql') { |
|
| 6419 | 6419 | $query .= " AND spotter_output.date > '".$sincedate."'"; |
| 6420 | 6420 | } else { |
| 6421 | 6421 | $query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
| 6422 | 6422 | } |
| 6423 | 6423 | } |
| 6424 | - if ($globalDBdriver == 'mysql') { |
|
| 6424 | + if ($globalDBdriver == 'mysql') { |
|
| 6425 | 6425 | $query .= " AND spotter_output.date > '".$sincedate."'"; |
| 6426 | 6426 | } else { |
| 6427 | 6427 | $query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
| 6428 | 6428 | } |
| 6429 | 6429 | } |
| 6430 | - //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
| 6431 | - //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
| 6432 | - $query .= " GROUP BY spotter_output.real_arrival_airport_icao, airport.name, airport.city, airport.country |
|
| 6430 | + //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
| 6431 | + //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
| 6432 | + $query .= " GROUP BY spotter_output.real_arrival_airport_icao, airport.name, airport.city, airport.country |
|
| 6433 | 6433 | ORDER BY airport_arrival_icao_count DESC"; |
| 6434 | 6434 | if ($limit) $query .= " LIMIT 10"; |
| 6435 | 6435 | |
@@ -6458,40 +6458,40 @@ discard block |
||
| 6458 | 6458 | } |
| 6459 | 6459 | |
| 6460 | 6460 | /** |
| 6461 | - * Gets all detected arrival airports of the airplanes that have flown over |
|
| 6462 | - * |
|
| 6463 | - * @return Array the airport list |
|
| 6464 | - * |
|
| 6465 | - */ |
|
| 6461 | + * Gets all detected arrival airports of the airplanes that have flown over |
|
| 6462 | + * |
|
| 6463 | + * @return Array the airport list |
|
| 6464 | + * |
|
| 6465 | + */ |
|
| 6466 | 6466 | public function countAllDetectedArrivalAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '',$icaoaskey = false) |
| 6467 | 6467 | { |
| 6468 | 6468 | global $globalDBdriver; |
| 6469 | 6469 | $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 |
| 6470 | 6470 | FROM spotter_output, airport |
| 6471 | 6471 | WHERE 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 "; |
| 6472 | - if ($olderthanmonths > 0) { |
|
| 6473 | - if ($globalDBdriver == 'mysql') { |
|
| 6472 | + if ($olderthanmonths > 0) { |
|
| 6473 | + if ($globalDBdriver == 'mysql') { |
|
| 6474 | 6474 | $query .= 'AND spotter_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$olderthanmonths.' MONTH) '; |
| 6475 | 6475 | } else { |
| 6476 | 6476 | $query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
| 6477 | 6477 | } |
| 6478 | - if ($sincedate != '') { |
|
| 6479 | - if ($globalDBdriver == 'mysql') { |
|
| 6478 | + if ($sincedate != '') { |
|
| 6479 | + if ($globalDBdriver == 'mysql') { |
|
| 6480 | 6480 | $query .= "AND spotter_output.date > '".$sincedate."' "; |
| 6481 | 6481 | } else { |
| 6482 | 6482 | $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
| 6483 | 6483 | } |
| 6484 | 6484 | } |
| 6485 | - if ($globalDBdriver == 'mysql') { |
|
| 6485 | + if ($globalDBdriver == 'mysql') { |
|
| 6486 | 6486 | $query .= "AND spotter_output.date > '".$sincedate."' "; |
| 6487 | 6487 | } else { |
| 6488 | 6488 | $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
| 6489 | 6489 | } |
| 6490 | 6490 | } |
| 6491 | 6491 | |
| 6492 | - //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
| 6493 | - //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
| 6494 | - $query .= "GROUP BY spotter_output.airline_icao, spotter_output.real_arrival_airport_icao, airport.name, airport.city, airport.country |
|
| 6492 | + //if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
| 6493 | + //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
| 6494 | + $query .= "GROUP BY spotter_output.airline_icao, spotter_output.real_arrival_airport_icao, airport.name, airport.city, airport.country |
|
| 6495 | 6495 | ORDER BY airport_arrival_icao_count DESC"; |
| 6496 | 6496 | if ($limit) $query .= " LIMIT 10"; |
| 6497 | 6497 | |
@@ -6521,11 +6521,11 @@ discard block |
||
| 6521 | 6521 | } |
| 6522 | 6522 | |
| 6523 | 6523 | /** |
| 6524 | - * Gets all arrival airports of the airplanes that have flown over based on an airline icao |
|
| 6525 | - * |
|
| 6526 | - * @return Array the airport list |
|
| 6527 | - * |
|
| 6528 | - */ |
|
| 6524 | + * Gets all arrival airports of the airplanes that have flown over based on an airline icao |
|
| 6525 | + * |
|
| 6526 | + * @return Array the airport list |
|
| 6527 | + * |
|
| 6528 | + */ |
|
| 6529 | 6529 | public function countAllArrivalAirportsByAirline($airline_icao) |
| 6530 | 6530 | { |
| 6531 | 6531 | $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING); |
@@ -6559,11 +6559,11 @@ discard block |
||
| 6559 | 6559 | |
| 6560 | 6560 | |
| 6561 | 6561 | /** |
| 6562 | - * Gets all arrival airports by country of the airplanes that have flown over based on an airline icao |
|
| 6563 | - * |
|
| 6564 | - * @return Array the airport list |
|
| 6565 | - * |
|
| 6566 | - */ |
|
| 6562 | + * Gets all arrival airports by country of the airplanes that have flown over based on an airline icao |
|
| 6563 | + * |
|
| 6564 | + * @return Array the airport list |
|
| 6565 | + * |
|
| 6566 | + */ |
|
| 6567 | 6567 | public function countAllArrivalAirportCountriesByAirline($airline_icao) |
| 6568 | 6568 | { |
| 6569 | 6569 | $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING); |
@@ -6594,11 +6594,11 @@ discard block |
||
| 6594 | 6594 | |
| 6595 | 6595 | |
| 6596 | 6596 | /** |
| 6597 | - * Gets all arrival airports of the airplanes that have flown over based on an aircraft icao |
|
| 6598 | - * |
|
| 6599 | - * @return Array the airport list |
|
| 6600 | - * |
|
| 6601 | - */ |
|
| 6597 | + * Gets all arrival airports of the airplanes that have flown over based on an aircraft icao |
|
| 6598 | + * |
|
| 6599 | + * @return Array the airport list |
|
| 6600 | + * |
|
| 6601 | + */ |
|
| 6602 | 6602 | public function countAllArrivalAirportsByAircraft($aircraft_icao) |
| 6603 | 6603 | { |
| 6604 | 6604 | $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
@@ -6633,11 +6633,11 @@ discard block |
||
| 6633 | 6633 | |
| 6634 | 6634 | |
| 6635 | 6635 | /** |
| 6636 | - * Gets all arrival 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 arrival 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 countAllArrivalAirportCountriesByAircraft($aircraft_icao) |
| 6642 | 6642 | { |
| 6643 | 6643 | $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
@@ -6668,11 +6668,11 @@ discard block |
||
| 6668 | 6668 | |
| 6669 | 6669 | |
| 6670 | 6670 | /** |
| 6671 | - * Gets all arrival airports of the airplanes that have flown over based on an aircraft registration |
|
| 6672 | - * |
|
| 6673 | - * @return Array the airport list |
|
| 6674 | - * |
|
| 6675 | - */ |
|
| 6671 | + * Gets all arrival airports of the airplanes that have flown over based on an aircraft registration |
|
| 6672 | + * |
|
| 6673 | + * @return Array the airport list |
|
| 6674 | + * |
|
| 6675 | + */ |
|
| 6676 | 6676 | public function countAllArrivalAirportsByRegistration($registration) |
| 6677 | 6677 | { |
| 6678 | 6678 | $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
@@ -6706,11 +6706,11 @@ discard block |
||
| 6706 | 6706 | |
| 6707 | 6707 | |
| 6708 | 6708 | /** |
| 6709 | - * Gets all arrival airports by country of the airplanes that have flown over based on an aircraft registration |
|
| 6710 | - * |
|
| 6711 | - * @return Array the airport list |
|
| 6712 | - * |
|
| 6713 | - */ |
|
| 6709 | + * Gets all arrival airports by country of the airplanes that have flown over based on an aircraft registration |
|
| 6710 | + * |
|
| 6711 | + * @return Array the airport list |
|
| 6712 | + * |
|
| 6713 | + */ |
|
| 6714 | 6714 | public function countAllArrivalAirportCountriesByRegistration($registration) |
| 6715 | 6715 | { |
| 6716 | 6716 | $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
@@ -6742,11 +6742,11 @@ discard block |
||
| 6742 | 6742 | |
| 6743 | 6743 | |
| 6744 | 6744 | /** |
| 6745 | - * Gets all arrival airports of the airplanes that have flown over based on an departure airport |
|
| 6746 | - * |
|
| 6747 | - * @return Array the airport list |
|
| 6748 | - * |
|
| 6749 | - */ |
|
| 6745 | + * Gets all arrival airports of the airplanes that have flown over based on an departure airport |
|
| 6746 | + * |
|
| 6747 | + * @return Array the airport list |
|
| 6748 | + * |
|
| 6749 | + */ |
|
| 6750 | 6750 | public function countAllArrivalAirportsByAirport($airport_icao) |
| 6751 | 6751 | { |
| 6752 | 6752 | $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
@@ -6780,11 +6780,11 @@ discard block |
||
| 6780 | 6780 | |
| 6781 | 6781 | |
| 6782 | 6782 | /** |
| 6783 | - * Gets all arrival airports by country of the airplanes that have flown over based on an airport icao |
|
| 6784 | - * |
|
| 6785 | - * @return Array the airport list |
|
| 6786 | - * |
|
| 6787 | - */ |
|
| 6783 | + * Gets all arrival airports by country of the airplanes that have flown over based on an airport icao |
|
| 6784 | + * |
|
| 6785 | + * @return Array the airport list |
|
| 6786 | + * |
|
| 6787 | + */ |
|
| 6788 | 6788 | public function countAllArrivalAirportCountriesByAirport($airport_icao) |
| 6789 | 6789 | { |
| 6790 | 6790 | $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
@@ -6815,11 +6815,11 @@ discard block |
||
| 6815 | 6815 | |
| 6816 | 6816 | |
| 6817 | 6817 | /** |
| 6818 | - * Gets all arrival airports of the airplanes that have flown over based on a aircraft manufacturer |
|
| 6819 | - * |
|
| 6820 | - * @return Array the airport list |
|
| 6821 | - * |
|
| 6822 | - */ |
|
| 6818 | + * Gets all arrival airports of the airplanes that have flown over based on a aircraft manufacturer |
|
| 6819 | + * |
|
| 6820 | + * @return Array the airport list |
|
| 6821 | + * |
|
| 6822 | + */ |
|
| 6823 | 6823 | public function countAllArrivalAirportsByManufacturer($aircraft_manufacturer) |
| 6824 | 6824 | { |
| 6825 | 6825 | $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
@@ -6854,11 +6854,11 @@ discard block |
||
| 6854 | 6854 | |
| 6855 | 6855 | |
| 6856 | 6856 | /** |
| 6857 | - * Gets all arrival airports by country of the airplanes that have flown over based on a aircraft manufacturer |
|
| 6858 | - * |
|
| 6859 | - * @return Array the airport list |
|
| 6860 | - * |
|
| 6861 | - */ |
|
| 6857 | + * Gets all arrival airports by country of the airplanes that have flown over based on a aircraft manufacturer |
|
| 6858 | + * |
|
| 6859 | + * @return Array the airport list |
|
| 6860 | + * |
|
| 6861 | + */ |
|
| 6862 | 6862 | public function countAllArrivalAirportCountriesByManufacturer($aircraft_manufacturer) |
| 6863 | 6863 | { |
| 6864 | 6864 | $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
@@ -6890,11 +6890,11 @@ discard block |
||
| 6890 | 6890 | |
| 6891 | 6891 | |
| 6892 | 6892 | /** |
| 6893 | - * Gets all arrival airports of the airplanes that have flown over based on a date |
|
| 6894 | - * |
|
| 6895 | - * @return Array the airport list |
|
| 6896 | - * |
|
| 6897 | - */ |
|
| 6893 | + * Gets all arrival airports of the airplanes that have flown over based on a date |
|
| 6894 | + * |
|
| 6895 | + * @return Array the airport list |
|
| 6896 | + * |
|
| 6897 | + */ |
|
| 6898 | 6898 | public function countAllArrivalAirportsByDate($date) |
| 6899 | 6899 | { |
| 6900 | 6900 | global $globalTimezone, $globalDBdriver; |
@@ -6941,11 +6941,11 @@ discard block |
||
| 6941 | 6941 | |
| 6942 | 6942 | |
| 6943 | 6943 | /** |
| 6944 | - * Gets all arrival airports by country of the airplanes that have flown over based on a date |
|
| 6945 | - * |
|
| 6946 | - * @return Array the airport list |
|
| 6947 | - * |
|
| 6948 | - */ |
|
| 6944 | + * Gets all arrival airports by country of the airplanes that have flown over based on a date |
|
| 6945 | + * |
|
| 6946 | + * @return Array the airport list |
|
| 6947 | + * |
|
| 6948 | + */ |
|
| 6949 | 6949 | public function countAllArrivalAirportCountriesByDate($date) |
| 6950 | 6950 | { |
| 6951 | 6951 | global $globalTimezone, $globalDBdriver; |
@@ -6989,11 +6989,11 @@ discard block |
||
| 6989 | 6989 | |
| 6990 | 6990 | |
| 6991 | 6991 | /** |
| 6992 | - * Gets all arrival airports of the airplanes that have flown over based on a ident/callsign |
|
| 6993 | - * |
|
| 6994 | - * @return Array the airport list |
|
| 6995 | - * |
|
| 6996 | - */ |
|
| 6992 | + * Gets all arrival airports of the airplanes that have flown over based on a ident/callsign |
|
| 6993 | + * |
|
| 6994 | + * @return Array the airport list |
|
| 6995 | + * |
|
| 6996 | + */ |
|
| 6997 | 6997 | public function countAllArrivalAirportsByIdent($ident) |
| 6998 | 6998 | { |
| 6999 | 6999 | $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
@@ -7027,11 +7027,11 @@ discard block |
||
| 7027 | 7027 | |
| 7028 | 7028 | |
| 7029 | 7029 | /** |
| 7030 | - * Gets all arrival airports by country of the airplanes that have flown over based on a callsign/ident |
|
| 7031 | - * |
|
| 7032 | - * @return Array the airport list |
|
| 7033 | - * |
|
| 7034 | - */ |
|
| 7030 | + * Gets all arrival airports by country of the airplanes that have flown over based on a callsign/ident |
|
| 7031 | + * |
|
| 7032 | + * @return Array the airport list |
|
| 7033 | + * |
|
| 7034 | + */ |
|
| 7035 | 7035 | public function countAllArrivalAirportCountriesByIdent($ident) |
| 7036 | 7036 | { |
| 7037 | 7037 | $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
@@ -7063,11 +7063,11 @@ discard block |
||
| 7063 | 7063 | |
| 7064 | 7064 | |
| 7065 | 7065 | /** |
| 7066 | - * Gets all arrival airports of the airplanes that have flown over based on a country |
|
| 7067 | - * |
|
| 7068 | - * @return Array the airport list |
|
| 7069 | - * |
|
| 7070 | - */ |
|
| 7066 | + * Gets all arrival airports of the airplanes that have flown over based on a country |
|
| 7067 | + * |
|
| 7068 | + * @return Array the airport list |
|
| 7069 | + * |
|
| 7070 | + */ |
|
| 7071 | 7071 | public function countAllArrivalAirportsByCountry($country) |
| 7072 | 7072 | { |
| 7073 | 7073 | $country = filter_var($country,FILTER_SANITIZE_STRING); |
@@ -7101,11 +7101,11 @@ discard block |
||
| 7101 | 7101 | |
| 7102 | 7102 | |
| 7103 | 7103 | /** |
| 7104 | - * Gets all arrival airports by country of the airplanes that have flown over based on a country |
|
| 7105 | - * |
|
| 7106 | - * @return Array the airport list |
|
| 7107 | - * |
|
| 7108 | - */ |
|
| 7104 | + * Gets all arrival airports by country of the airplanes that have flown over based on a country |
|
| 7105 | + * |
|
| 7106 | + * @return Array the airport list |
|
| 7107 | + * |
|
| 7108 | + */ |
|
| 7109 | 7109 | public function countAllArrivalAirportCountriesByCountry($country) |
| 7110 | 7110 | { |
| 7111 | 7111 | $country = filter_var($country,FILTER_SANITIZE_STRING); |
@@ -7137,11 +7137,11 @@ discard block |
||
| 7137 | 7137 | |
| 7138 | 7138 | |
| 7139 | 7139 | /** |
| 7140 | - * Counts all airport departure countries |
|
| 7141 | - * |
|
| 7142 | - * @return Array the airport departure list |
|
| 7143 | - * |
|
| 7144 | - */ |
|
| 7140 | + * Counts all airport departure countries |
|
| 7141 | + * |
|
| 7142 | + * @return Array the airport departure list |
|
| 7143 | + * |
|
| 7144 | + */ |
|
| 7145 | 7145 | public function countAllDepartureCountries($filters = array()) |
| 7146 | 7146 | { |
| 7147 | 7147 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7171,11 +7171,11 @@ discard block |
||
| 7171 | 7171 | |
| 7172 | 7172 | |
| 7173 | 7173 | /** |
| 7174 | - * Counts all airport arrival countries |
|
| 7175 | - * |
|
| 7176 | - * @return Array the airport arrival list |
|
| 7177 | - * |
|
| 7178 | - */ |
|
| 7174 | + * Counts all airport arrival countries |
|
| 7175 | + * |
|
| 7176 | + * @return Array the airport arrival list |
|
| 7177 | + * |
|
| 7178 | + */ |
|
| 7179 | 7179 | public function countAllArrivalCountries($limit = true,$filters = array()) |
| 7180 | 7180 | { |
| 7181 | 7181 | $filter_query = $this->getFilter($filters,true,true); |
@@ -7208,11 +7208,11 @@ discard block |
||
| 7208 | 7208 | |
| 7209 | 7209 | |
| 7210 | 7210 | /** |
| 7211 | - * Gets all route combinations |
|
| 7212 | - * |
|
| 7213 | - * @return Array the route list |
|
| 7214 | - * |
|
| 7215 | - */ |
|
| 7211 | + * Gets all route combinations |
|
| 7212 | + * |
|
| 7213 | + * @return Array the route list |
|
| 7214 | + * |
|
| 7215 | + */ |
|
| 7216 | 7216 | public function countAllRoutes() |
| 7217 | 7217 | { |
| 7218 | 7218 | |
@@ -7252,11 +7252,11 @@ discard block |
||
| 7252 | 7252 | |
| 7253 | 7253 | |
| 7254 | 7254 | /** |
| 7255 | - * Gets all route combinations based on an aircraft |
|
| 7256 | - * |
|
| 7257 | - * @return Array the route list |
|
| 7258 | - * |
|
| 7259 | - */ |
|
| 7255 | + * Gets all route combinations based on an aircraft |
|
| 7256 | + * |
|
| 7257 | + * @return Array the route list |
|
| 7258 | + * |
|
| 7259 | + */ |
|
| 7260 | 7260 | public function countAllRoutesByAircraft($aircraft_icao) |
| 7261 | 7261 | { |
| 7262 | 7262 | $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
@@ -7294,11 +7294,11 @@ discard block |
||
| 7294 | 7294 | |
| 7295 | 7295 | |
| 7296 | 7296 | /** |
| 7297 | - * Gets all route combinations based on an aircraft registration |
|
| 7298 | - * |
|
| 7299 | - * @return Array the route list |
|
| 7300 | - * |
|
| 7301 | - */ |
|
| 7297 | + * Gets all route combinations based on an aircraft registration |
|
| 7298 | + * |
|
| 7299 | + * @return Array the route list |
|
| 7300 | + * |
|
| 7301 | + */ |
|
| 7302 | 7302 | public function countAllRoutesByRegistration($registration) |
| 7303 | 7303 | { |
| 7304 | 7304 | $registration = filter_var($registration, FILTER_SANITIZE_STRING); |
@@ -7337,11 +7337,11 @@ discard block |
||
| 7337 | 7337 | |
| 7338 | 7338 | |
| 7339 | 7339 | /** |
| 7340 | - * Gets all route combinations based on an airline |
|
| 7341 | - * |
|
| 7342 | - * @return Array the route list |
|
| 7343 | - * |
|
| 7344 | - */ |
|
| 7340 | + * Gets all route combinations based on an airline |
|
| 7341 | + * |
|
| 7342 | + * @return Array the route list |
|
| 7343 | + * |
|
| 7344 | + */ |
|
| 7345 | 7345 | public function countAllRoutesByAirline($airline_icao) |
| 7346 | 7346 | { |
| 7347 | 7347 | $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING); |
@@ -7380,11 +7380,11 @@ discard block |
||
| 7380 | 7380 | |
| 7381 | 7381 | |
| 7382 | 7382 | /** |
| 7383 | - * Gets all route combinations based on an airport |
|
| 7384 | - * |
|
| 7385 | - * @return Array the route list |
|
| 7386 | - * |
|
| 7387 | - */ |
|
| 7383 | + * Gets all route combinations based on an airport |
|
| 7384 | + * |
|
| 7385 | + * @return Array the route list |
|
| 7386 | + * |
|
| 7387 | + */ |
|
| 7388 | 7388 | public function countAllRoutesByAirport($airport_icao) |
| 7389 | 7389 | { |
| 7390 | 7390 | $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
@@ -7423,11 +7423,11 @@ discard block |
||
| 7423 | 7423 | |
| 7424 | 7424 | |
| 7425 | 7425 | /** |
| 7426 | - * Gets all route combinations based on an country |
|
| 7427 | - * |
|
| 7428 | - * @return Array the route list |
|
| 7429 | - * |
|
| 7430 | - */ |
|
| 7426 | + * Gets all route combinations based on an country |
|
| 7427 | + * |
|
| 7428 | + * @return Array the route list |
|
| 7429 | + * |
|
| 7430 | + */ |
|
| 7431 | 7431 | public function countAllRoutesByCountry($country) |
| 7432 | 7432 | { |
| 7433 | 7433 | $country = filter_var($country,FILTER_SANITIZE_STRING); |
@@ -7465,11 +7465,11 @@ discard block |
||
| 7465 | 7465 | |
| 7466 | 7466 | |
| 7467 | 7467 | /** |
| 7468 | - * Gets all route combinations based on an date |
|
| 7469 | - * |
|
| 7470 | - * @return Array the route list |
|
| 7471 | - * |
|
| 7472 | - */ |
|
| 7468 | + * Gets all route combinations based on an date |
|
| 7469 | + * |
|
| 7470 | + * @return Array the route list |
|
| 7471 | + * |
|
| 7472 | + */ |
|
| 7473 | 7473 | public function countAllRoutesByDate($date) |
| 7474 | 7474 | { |
| 7475 | 7475 | global $globalTimezone, $globalDBdriver; |
@@ -7520,11 +7520,11 @@ discard block |
||
| 7520 | 7520 | |
| 7521 | 7521 | |
| 7522 | 7522 | /** |
| 7523 | - * Gets all route combinations based on an ident/callsign |
|
| 7524 | - * |
|
| 7525 | - * @return Array the route list |
|
| 7526 | - * |
|
| 7527 | - */ |
|
| 7523 | + * Gets all route combinations based on an ident/callsign |
|
| 7524 | + * |
|
| 7525 | + * @return Array the route list |
|
| 7526 | + * |
|
| 7527 | + */ |
|
| 7528 | 7528 | public function countAllRoutesByIdent($ident) |
| 7529 | 7529 | { |
| 7530 | 7530 | $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
@@ -7562,11 +7562,11 @@ discard block |
||
| 7562 | 7562 | |
| 7563 | 7563 | |
| 7564 | 7564 | /** |
| 7565 | - * Gets all route combinations based on an manufacturer |
|
| 7566 | - * |
|
| 7567 | - * @return Array the route list |
|
| 7568 | - * |
|
| 7569 | - */ |
|
| 7565 | + * Gets all route combinations based on an manufacturer |
|
| 7566 | + * |
|
| 7567 | + * @return Array the route list |
|
| 7568 | + * |
|
| 7569 | + */ |
|
| 7570 | 7570 | public function countAllRoutesByManufacturer($aircraft_manufacturer) |
| 7571 | 7571 | { |
| 7572 | 7572 | $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
@@ -7605,11 +7605,11 @@ discard block |
||
| 7605 | 7605 | |
| 7606 | 7606 | |
| 7607 | 7607 | /** |
| 7608 | - * Gets all route combinations with waypoints |
|
| 7609 | - * |
|
| 7610 | - * @return Array the route list |
|
| 7611 | - * |
|
| 7612 | - */ |
|
| 7608 | + * Gets all route combinations with waypoints |
|
| 7609 | + * |
|
| 7610 | + * @return Array the route list |
|
| 7611 | + * |
|
| 7612 | + */ |
|
| 7613 | 7613 | public function countAllRoutesWithWaypoints() |
| 7614 | 7614 | { |
| 7615 | 7615 | $query = "SELECT DISTINCT spotter_output.waypoints AS route, count(spotter_output.waypoints) AS route_count, spotter_output.spotter_id, spotter_output.departure_airport_icao, spotter_output.departure_airport_name AS airport_departure_name, spotter_output.departure_airport_city AS airport_departure_city, spotter_output.departure_airport_country AS airport_departure_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name AS airport_arrival_name, spotter_output.arrival_airport_city AS airport_arrival_city, spotter_output.arrival_airport_country AS airport_arrival_country |
@@ -7649,11 +7649,11 @@ discard block |
||
| 7649 | 7649 | |
| 7650 | 7650 | |
| 7651 | 7651 | /** |
| 7652 | - * Gets all callsigns that have flown over |
|
| 7653 | - * |
|
| 7654 | - * @return Array the callsign list |
|
| 7655 | - * |
|
| 7656 | - */ |
|
| 7652 | + * Gets all callsigns that have flown over |
|
| 7653 | + * |
|
| 7654 | + * @return Array the callsign list |
|
| 7655 | + * |
|
| 7656 | + */ |
|
| 7657 | 7657 | public function countAllCallsigns($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array()) |
| 7658 | 7658 | { |
| 7659 | 7659 | global $globalDBdriver; |
@@ -7691,11 +7691,11 @@ discard block |
||
| 7691 | 7691 | } |
| 7692 | 7692 | |
| 7693 | 7693 | /** |
| 7694 | - * Gets all callsigns that have flown over |
|
| 7695 | - * |
|
| 7696 | - * @return Array the callsign list |
|
| 7697 | - * |
|
| 7698 | - */ |
|
| 7694 | + * Gets all callsigns that have flown over |
|
| 7695 | + * |
|
| 7696 | + * @return Array the callsign list |
|
| 7697 | + * |
|
| 7698 | + */ |
|
| 7699 | 7699 | public function countAllCallsignsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '') |
| 7700 | 7700 | { |
| 7701 | 7701 | global $globalDBdriver; |
@@ -7736,11 +7736,11 @@ discard block |
||
| 7736 | 7736 | |
| 7737 | 7737 | |
| 7738 | 7738 | /** |
| 7739 | - * Counts all dates |
|
| 7740 | - * |
|
| 7741 | - * @return Array the date list |
|
| 7742 | - * |
|
| 7743 | - */ |
|
| 7739 | + * Counts all dates |
|
| 7740 | + * |
|
| 7741 | + * @return Array the date list |
|
| 7742 | + * |
|
| 7743 | + */ |
|
| 7744 | 7744 | public function countAllDates($filters = array()) |
| 7745 | 7745 | { |
| 7746 | 7746 | global $globalTimezone, $globalDBdriver; |
@@ -7785,11 +7785,11 @@ discard block |
||
| 7785 | 7785 | } |
| 7786 | 7786 | |
| 7787 | 7787 | /** |
| 7788 | - * Counts all dates |
|
| 7789 | - * |
|
| 7790 | - * @return Array the date list |
|
| 7791 | - * |
|
| 7792 | - */ |
|
| 7788 | + * Counts all dates |
|
| 7789 | + * |
|
| 7790 | + * @return Array the date list |
|
| 7791 | + * |
|
| 7792 | + */ |
|
| 7793 | 7793 | public function countAllDatesByAirlines() |
| 7794 | 7794 | { |
| 7795 | 7795 | global $globalTimezone, $globalDBdriver; |
@@ -7835,11 +7835,11 @@ discard block |
||
| 7835 | 7835 | } |
| 7836 | 7836 | |
| 7837 | 7837 | /** |
| 7838 | - * Counts all dates during the last 7 days |
|
| 7839 | - * |
|
| 7840 | - * @return Array the date list |
|
| 7841 | - * |
|
| 7842 | - */ |
|
| 7838 | + * Counts all dates during the last 7 days |
|
| 7839 | + * |
|
| 7840 | + * @return Array the date list |
|
| 7841 | + * |
|
| 7842 | + */ |
|
| 7843 | 7843 | public function countAllDatesLast7Days($filters = array()) |
| 7844 | 7844 | { |
| 7845 | 7845 | global $globalTimezone, $globalDBdriver; |
@@ -7861,7 +7861,7 @@ discard block |
||
| 7861 | 7861 | $query .= " GROUP BY date_name |
| 7862 | 7862 | ORDER BY date_name ASC"; |
| 7863 | 7863 | $query_data = array(':offset' => $offset); |
| 7864 | - } |
|
| 7864 | + } |
|
| 7865 | 7865 | |
| 7866 | 7866 | $sth = $this->db->prepare($query); |
| 7867 | 7867 | $sth->execute($query_data); |
@@ -7881,11 +7881,11 @@ discard block |
||
| 7881 | 7881 | } |
| 7882 | 7882 | |
| 7883 | 7883 | /** |
| 7884 | - * Counts all dates during the last month |
|
| 7885 | - * |
|
| 7886 | - * @return Array the date list |
|
| 7887 | - * |
|
| 7888 | - */ |
|
| 7884 | + * Counts all dates during the last month |
|
| 7885 | + * |
|
| 7886 | + * @return Array the date list |
|
| 7887 | + * |
|
| 7888 | + */ |
|
| 7889 | 7889 | public function countAllDatesLastMonth($filters = array()) |
| 7890 | 7890 | { |
| 7891 | 7891 | global $globalTimezone, $globalDBdriver; |
@@ -7907,7 +7907,7 @@ discard block |
||
| 7907 | 7907 | $query .= " GROUP BY date_name |
| 7908 | 7908 | ORDER BY date_name ASC"; |
| 7909 | 7909 | $query_data = array(':offset' => $offset); |
| 7910 | - } |
|
| 7910 | + } |
|
| 7911 | 7911 | |
| 7912 | 7912 | $sth = $this->db->prepare($query); |
| 7913 | 7913 | $sth->execute($query_data); |
@@ -7928,11 +7928,11 @@ discard block |
||
| 7928 | 7928 | |
| 7929 | 7929 | |
| 7930 | 7930 | /** |
| 7931 | - * Counts all dates during the last month |
|
| 7932 | - * |
|
| 7933 | - * @return Array the date list |
|
| 7934 | - * |
|
| 7935 | - */ |
|
| 7931 | + * Counts all dates during the last month |
|
| 7932 | + * |
|
| 7933 | + * @return Array the date list |
|
| 7934 | + * |
|
| 7935 | + */ |
|
| 7936 | 7936 | public function countAllDatesLastMonthByAirlines() |
| 7937 | 7937 | { |
| 7938 | 7938 | global $globalTimezone, $globalDBdriver; |
@@ -7956,7 +7956,7 @@ discard block |
||
| 7956 | 7956 | GROUP BY spotter_output.airline_icao, date_name |
| 7957 | 7957 | ORDER BY date_name ASC"; |
| 7958 | 7958 | $query_data = array(':offset' => $offset); |
| 7959 | - } |
|
| 7959 | + } |
|
| 7960 | 7960 | |
| 7961 | 7961 | $sth = $this->db->prepare($query); |
| 7962 | 7962 | $sth->execute($query_data); |
@@ -7978,11 +7978,11 @@ discard block |
||
| 7978 | 7978 | |
| 7979 | 7979 | |
| 7980 | 7980 | /** |
| 7981 | - * Counts all month |
|
| 7982 | - * |
|
| 7983 | - * @return Array the month list |
|
| 7984 | - * |
|
| 7985 | - */ |
|
| 7981 | + * Counts all month |
|
| 7982 | + * |
|
| 7983 | + * @return Array the month list |
|
| 7984 | + * |
|
| 7985 | + */ |
|
| 7986 | 7986 | public function countAllMonths($filters = array()) |
| 7987 | 7987 | { |
| 7988 | 7988 | global $globalTimezone, $globalDBdriver; |
@@ -8026,11 +8026,11 @@ discard block |
||
| 8026 | 8026 | } |
| 8027 | 8027 | |
| 8028 | 8028 | /** |
| 8029 | - * Counts all month |
|
| 8030 | - * |
|
| 8031 | - * @return Array the month list |
|
| 8032 | - * |
|
| 8033 | - */ |
|
| 8029 | + * Counts all month |
|
| 8030 | + * |
|
| 8031 | + * @return Array the month list |
|
| 8032 | + * |
|
| 8033 | + */ |
|
| 8034 | 8034 | public function countAllMonthsByAirlines() |
| 8035 | 8035 | { |
| 8036 | 8036 | global $globalTimezone, $globalDBdriver; |
@@ -8075,11 +8075,11 @@ discard block |
||
| 8075 | 8075 | } |
| 8076 | 8076 | |
| 8077 | 8077 | /** |
| 8078 | - * Counts all military month |
|
| 8079 | - * |
|
| 8080 | - * @return Array the month list |
|
| 8081 | - * |
|
| 8082 | - */ |
|
| 8078 | + * Counts all military month |
|
| 8079 | + * |
|
| 8080 | + * @return Array the month list |
|
| 8081 | + * |
|
| 8082 | + */ |
|
| 8083 | 8083 | public function countAllMilitaryMonths() |
| 8084 | 8084 | { |
| 8085 | 8085 | global $globalTimezone, $globalDBdriver; |
@@ -8122,11 +8122,11 @@ discard block |
||
| 8122 | 8122 | } |
| 8123 | 8123 | |
| 8124 | 8124 | /** |
| 8125 | - * Counts all month owners |
|
| 8126 | - * |
|
| 8127 | - * @return Array the month list |
|
| 8128 | - * |
|
| 8129 | - */ |
|
| 8125 | + * Counts all month owners |
|
| 8126 | + * |
|
| 8127 | + * @return Array the month list |
|
| 8128 | + * |
|
| 8129 | + */ |
|
| 8130 | 8130 | public function countAllMonthsOwners() |
| 8131 | 8131 | { |
| 8132 | 8132 | global $globalTimezone, $globalDBdriver; |
@@ -8169,11 +8169,11 @@ discard block |
||
| 8169 | 8169 | } |
| 8170 | 8170 | |
| 8171 | 8171 | /** |
| 8172 | - * Counts all month owners |
|
| 8173 | - * |
|
| 8174 | - * @return Array the month list |
|
| 8175 | - * |
|
| 8176 | - */ |
|
| 8172 | + * Counts all month owners |
|
| 8173 | + * |
|
| 8174 | + * @return Array the month list |
|
| 8175 | + * |
|
| 8176 | + */ |
|
| 8177 | 8177 | public function countAllMonthsOwnersByAirlines() |
| 8178 | 8178 | { |
| 8179 | 8179 | global $globalTimezone, $globalDBdriver; |
@@ -8217,11 +8217,11 @@ discard block |
||
| 8217 | 8217 | } |
| 8218 | 8218 | |
| 8219 | 8219 | /** |
| 8220 | - * Counts all month pilot |
|
| 8221 | - * |
|
| 8222 | - * @return Array the month list |
|
| 8223 | - * |
|
| 8224 | - */ |
|
| 8220 | + * Counts all month pilot |
|
| 8221 | + * |
|
| 8222 | + * @return Array the month list |
|
| 8223 | + * |
|
| 8224 | + */ |
|
| 8225 | 8225 | public function countAllMonthsPilots() |
| 8226 | 8226 | { |
| 8227 | 8227 | global $globalTimezone, $globalDBdriver; |
@@ -8264,11 +8264,11 @@ discard block |
||
| 8264 | 8264 | } |
| 8265 | 8265 | |
| 8266 | 8266 | /** |
| 8267 | - * Counts all month pilot |
|
| 8268 | - * |
|
| 8269 | - * @return Array the month list |
|
| 8270 | - * |
|
| 8271 | - */ |
|
| 8267 | + * Counts all month pilot |
|
| 8268 | + * |
|
| 8269 | + * @return Array the month list |
|
| 8270 | + * |
|
| 8271 | + */ |
|
| 8272 | 8272 | public function countAllMonthsPilotsByAirlines() |
| 8273 | 8273 | { |
| 8274 | 8274 | global $globalTimezone, $globalDBdriver; |
@@ -8312,11 +8312,11 @@ discard block |
||
| 8312 | 8312 | } |
| 8313 | 8313 | |
| 8314 | 8314 | /** |
| 8315 | - * Counts all month airline |
|
| 8316 | - * |
|
| 8317 | - * @return Array the month list |
|
| 8318 | - * |
|
| 8319 | - */ |
|
| 8315 | + * Counts all month airline |
|
| 8316 | + * |
|
| 8317 | + * @return Array the month list |
|
| 8318 | + * |
|
| 8319 | + */ |
|
| 8320 | 8320 | public function countAllMonthsAirlines() |
| 8321 | 8321 | { |
| 8322 | 8322 | global $globalTimezone, $globalDBdriver; |
@@ -8359,11 +8359,11 @@ discard block |
||
| 8359 | 8359 | } |
| 8360 | 8360 | |
| 8361 | 8361 | /** |
| 8362 | - * Counts all month aircraft |
|
| 8363 | - * |
|
| 8364 | - * @return Array the month list |
|
| 8365 | - * |
|
| 8366 | - */ |
|
| 8362 | + * Counts all month aircraft |
|
| 8363 | + * |
|
| 8364 | + * @return Array the month list |
|
| 8365 | + * |
|
| 8366 | + */ |
|
| 8367 | 8367 | public function countAllMonthsAircrafts() |
| 8368 | 8368 | { |
| 8369 | 8369 | global $globalTimezone, $globalDBdriver; |
@@ -8407,11 +8407,11 @@ discard block |
||
| 8407 | 8407 | |
| 8408 | 8408 | |
| 8409 | 8409 | /** |
| 8410 | - * Counts all month aircraft |
|
| 8411 | - * |
|
| 8412 | - * @return Array the month list |
|
| 8413 | - * |
|
| 8414 | - */ |
|
| 8410 | + * Counts all month aircraft |
|
| 8411 | + * |
|
| 8412 | + * @return Array the month list |
|
| 8413 | + * |
|
| 8414 | + */ |
|
| 8415 | 8415 | public function countAllMonthsAircraftsByAirlines() |
| 8416 | 8416 | { |
| 8417 | 8417 | global $globalTimezone, $globalDBdriver; |
@@ -8455,11 +8455,11 @@ discard block |
||
| 8455 | 8455 | } |
| 8456 | 8456 | |
| 8457 | 8457 | /** |
| 8458 | - * Counts all month real arrival |
|
| 8459 | - * |
|
| 8460 | - * @return Array the month list |
|
| 8461 | - * |
|
| 8462 | - */ |
|
| 8458 | + * Counts all month real arrival |
|
| 8459 | + * |
|
| 8460 | + * @return Array the month list |
|
| 8461 | + * |
|
| 8462 | + */ |
|
| 8463 | 8463 | public function countAllMonthsRealArrivals() |
| 8464 | 8464 | { |
| 8465 | 8465 | global $globalTimezone, $globalDBdriver; |
@@ -8503,11 +8503,11 @@ discard block |
||
| 8503 | 8503 | |
| 8504 | 8504 | |
| 8505 | 8505 | /** |
| 8506 | - * Counts all month real arrival |
|
| 8507 | - * |
|
| 8508 | - * @return Array the month list |
|
| 8509 | - * |
|
| 8510 | - */ |
|
| 8506 | + * Counts all month real arrival |
|
| 8507 | + * |
|
| 8508 | + * @return Array the month list |
|
| 8509 | + * |
|
| 8510 | + */ |
|
| 8511 | 8511 | public function countAllMonthsRealArrivalsByAirlines() |
| 8512 | 8512 | { |
| 8513 | 8513 | global $globalTimezone, $globalDBdriver; |
@@ -8552,11 +8552,11 @@ discard block |
||
| 8552 | 8552 | |
| 8553 | 8553 | |
| 8554 | 8554 | /** |
| 8555 | - * Counts all dates during the last year |
|
| 8556 | - * |
|
| 8557 | - * @return Array the date list |
|
| 8558 | - * |
|
| 8559 | - */ |
|
| 8555 | + * Counts all dates during the last year |
|
| 8556 | + * |
|
| 8557 | + * @return Array the date list |
|
| 8558 | + * |
|
| 8559 | + */ |
|
| 8560 | 8560 | public function countAllMonthsLastYear($filters) |
| 8561 | 8561 | { |
| 8562 | 8562 | global $globalTimezone, $globalDBdriver; |
@@ -8578,7 +8578,7 @@ discard block |
||
| 8578 | 8578 | $query .= " GROUP BY year_name, month_name |
| 8579 | 8579 | ORDER BY year_name, month_name ASC"; |
| 8580 | 8580 | $query_data = array(':offset' => $offset); |
| 8581 | - } |
|
| 8581 | + } |
|
| 8582 | 8582 | |
| 8583 | 8583 | $sth = $this->db->prepare($query); |
| 8584 | 8584 | $sth->execute($query_data); |
@@ -8601,11 +8601,11 @@ discard block |
||
| 8601 | 8601 | |
| 8602 | 8602 | |
| 8603 | 8603 | /** |
| 8604 | - * Counts all hours |
|
| 8605 | - * |
|
| 8606 | - * @return Array the hour list |
|
| 8607 | - * |
|
| 8608 | - */ |
|
| 8604 | + * Counts all hours |
|
| 8605 | + * |
|
| 8606 | + * @return Array the hour list |
|
| 8607 | + * |
|
| 8608 | + */ |
|
| 8609 | 8609 | public function countAllHours($orderby,$filters = array()) |
| 8610 | 8610 | { |
| 8611 | 8611 | global $globalTimezone, $globalDBdriver; |
@@ -8666,11 +8666,11 @@ discard block |
||
| 8666 | 8666 | } |
| 8667 | 8667 | |
| 8668 | 8668 | /** |
| 8669 | - * Counts all hours |
|
| 8670 | - * |
|
| 8671 | - * @return Array the hour list |
|
| 8672 | - * |
|
| 8673 | - */ |
|
| 8669 | + * Counts all hours |
|
| 8670 | + * |
|
| 8671 | + * @return Array the hour list |
|
| 8672 | + * |
|
| 8673 | + */ |
|
| 8674 | 8674 | public function countAllHoursByAirlines($orderby) |
| 8675 | 8675 | { |
| 8676 | 8676 | global $globalTimezone, $globalDBdriver; |
@@ -8734,11 +8734,11 @@ discard block |
||
| 8734 | 8734 | |
| 8735 | 8735 | |
| 8736 | 8736 | /** |
| 8737 | - * Counts all hours by airline |
|
| 8738 | - * |
|
| 8739 | - * @return Array the hour list |
|
| 8740 | - * |
|
| 8741 | - */ |
|
| 8737 | + * Counts all hours by airline |
|
| 8738 | + * |
|
| 8739 | + * @return Array the hour list |
|
| 8740 | + * |
|
| 8741 | + */ |
|
| 8742 | 8742 | public function countAllHoursByAirline($airline_icao) |
| 8743 | 8743 | { |
| 8744 | 8744 | global $globalTimezone, $globalDBdriver; |
@@ -8785,11 +8785,11 @@ discard block |
||
| 8785 | 8785 | |
| 8786 | 8786 | |
| 8787 | 8787 | /** |
| 8788 | - * Counts all hours by aircraft |
|
| 8789 | - * |
|
| 8790 | - * @return Array the hour list |
|
| 8791 | - * |
|
| 8792 | - */ |
|
| 8788 | + * Counts all hours by aircraft |
|
| 8789 | + * |
|
| 8790 | + * @return Array the hour list |
|
| 8791 | + * |
|
| 8792 | + */ |
|
| 8793 | 8793 | public function countAllHoursByAircraft($aircraft_icao) |
| 8794 | 8794 | { |
| 8795 | 8795 | global $globalTimezone, $globalDBdriver; |
@@ -8833,11 +8833,11 @@ discard block |
||
| 8833 | 8833 | |
| 8834 | 8834 | |
| 8835 | 8835 | /** |
| 8836 | - * Counts all hours by aircraft registration |
|
| 8837 | - * |
|
| 8838 | - * @return Array the hour list |
|
| 8839 | - * |
|
| 8840 | - */ |
|
| 8836 | + * Counts all hours by aircraft registration |
|
| 8837 | + * |
|
| 8838 | + * @return Array the hour list |
|
| 8839 | + * |
|
| 8840 | + */ |
|
| 8841 | 8841 | public function countAllHoursByRegistration($registration) |
| 8842 | 8842 | { |
| 8843 | 8843 | global $globalTimezone, $globalDBdriver; |
@@ -8881,11 +8881,11 @@ discard block |
||
| 8881 | 8881 | |
| 8882 | 8882 | |
| 8883 | 8883 | /** |
| 8884 | - * Counts all hours by airport |
|
| 8885 | - * |
|
| 8886 | - * @return Array the hour list |
|
| 8887 | - * |
|
| 8888 | - */ |
|
| 8884 | + * Counts all hours by airport |
|
| 8885 | + * |
|
| 8886 | + * @return Array the hour list |
|
| 8887 | + * |
|
| 8888 | + */ |
|
| 8889 | 8889 | public function countAllHoursByAirport($airport_icao) |
| 8890 | 8890 | { |
| 8891 | 8891 | global $globalTimezone, $globalDBdriver; |
@@ -8930,11 +8930,11 @@ discard block |
||
| 8930 | 8930 | |
| 8931 | 8931 | |
| 8932 | 8932 | /** |
| 8933 | - * Counts all hours by manufacturer |
|
| 8934 | - * |
|
| 8935 | - * @return Array the hour list |
|
| 8936 | - * |
|
| 8937 | - */ |
|
| 8933 | + * Counts all hours by manufacturer |
|
| 8934 | + * |
|
| 8935 | + * @return Array the hour list |
|
| 8936 | + * |
|
| 8937 | + */ |
|
| 8938 | 8938 | public function countAllHoursByManufacturer($aircraft_manufacturer) |
| 8939 | 8939 | { |
| 8940 | 8940 | global $globalTimezone, $globalDBdriver; |
@@ -8979,11 +8979,11 @@ discard block |
||
| 8979 | 8979 | |
| 8980 | 8980 | |
| 8981 | 8981 | /** |
| 8982 | - * Counts all hours by date |
|
| 8983 | - * |
|
| 8984 | - * @return Array the hour list |
|
| 8985 | - * |
|
| 8986 | - */ |
|
| 8982 | + * Counts all hours by date |
|
| 8983 | + * |
|
| 8984 | + * @return Array the hour list |
|
| 8985 | + * |
|
| 8986 | + */ |
|
| 8987 | 8987 | public function countAllHoursByDate($date) |
| 8988 | 8988 | { |
| 8989 | 8989 | global $globalTimezone, $globalDBdriver; |
@@ -9028,11 +9028,11 @@ discard block |
||
| 9028 | 9028 | |
| 9029 | 9029 | |
| 9030 | 9030 | /** |
| 9031 | - * Counts all hours by a ident/callsign |
|
| 9032 | - * |
|
| 9033 | - * @return Array the hour list |
|
| 9034 | - * |
|
| 9035 | - */ |
|
| 9031 | + * Counts all hours by a ident/callsign |
|
| 9032 | + * |
|
| 9033 | + * @return Array the hour list |
|
| 9034 | + * |
|
| 9035 | + */ |
|
| 9036 | 9036 | public function countAllHoursByIdent($ident) |
| 9037 | 9037 | { |
| 9038 | 9038 | global $globalTimezone, $globalDBdriver; |
@@ -9078,11 +9078,11 @@ discard block |
||
| 9078 | 9078 | |
| 9079 | 9079 | |
| 9080 | 9080 | /** |
| 9081 | - * Counts all hours by route |
|
| 9082 | - * |
|
| 9083 | - * @return Array the hour list |
|
| 9084 | - * |
|
| 9085 | - */ |
|
| 9081 | + * Counts all hours by route |
|
| 9082 | + * |
|
| 9083 | + * @return Array the hour list |
|
| 9084 | + * |
|
| 9085 | + */ |
|
| 9086 | 9086 | public function countAllHoursByRoute($departure_airport_icao, $arrival_airport_icao) |
| 9087 | 9087 | { |
| 9088 | 9088 | global $globalTimezone, $globalDBdriver; |
@@ -9127,11 +9127,11 @@ discard block |
||
| 9127 | 9127 | |
| 9128 | 9128 | |
| 9129 | 9129 | /** |
| 9130 | - * Counts all hours by country |
|
| 9131 | - * |
|
| 9132 | - * @return Array the hour list |
|
| 9133 | - * |
|
| 9134 | - */ |
|
| 9130 | + * Counts all hours by country |
|
| 9131 | + * |
|
| 9132 | + * @return Array the hour list |
|
| 9133 | + * |
|
| 9134 | + */ |
|
| 9135 | 9135 | public function countAllHoursByCountry($country) |
| 9136 | 9136 | { |
| 9137 | 9137 | global $globalTimezone, $globalDBdriver; |
@@ -9177,11 +9177,11 @@ discard block |
||
| 9177 | 9177 | |
| 9178 | 9178 | |
| 9179 | 9179 | /** |
| 9180 | - * Counts all aircraft that have flown over |
|
| 9181 | - * |
|
| 9182 | - * @return Integer the number of aircrafts |
|
| 9183 | - * |
|
| 9184 | - */ |
|
| 9180 | + * Counts all aircraft that have flown over |
|
| 9181 | + * |
|
| 9182 | + * @return Integer the number of aircrafts |
|
| 9183 | + * |
|
| 9184 | + */ |
|
| 9185 | 9185 | public function countOverallAircrafts($filters = array()) |
| 9186 | 9186 | { |
| 9187 | 9187 | $filter_query = $this->getFilter($filters,true,true); |
@@ -9193,11 +9193,11 @@ discard block |
||
| 9193 | 9193 | } |
| 9194 | 9194 | |
| 9195 | 9195 | /** |
| 9196 | - * Counts all flight that really arrival |
|
| 9197 | - * |
|
| 9198 | - * @return Integer the number of aircrafts |
|
| 9199 | - * |
|
| 9200 | - */ |
|
| 9196 | + * Counts all flight that really arrival |
|
| 9197 | + * |
|
| 9198 | + * @return Integer the number of aircrafts |
|
| 9199 | + * |
|
| 9200 | + */ |
|
| 9201 | 9201 | public function countOverallArrival($filters = array()) |
| 9202 | 9202 | { |
| 9203 | 9203 | $filter_query = $this->getFilter($filters,true,true); |
@@ -9210,11 +9210,11 @@ discard block |
||
| 9210 | 9210 | } |
| 9211 | 9211 | |
| 9212 | 9212 | /** |
| 9213 | - * Counts all pilots that have flown over |
|
| 9214 | - * |
|
| 9215 | - * @return Integer the number of pilots |
|
| 9216 | - * |
|
| 9217 | - */ |
|
| 9213 | + * Counts all pilots that have flown over |
|
| 9214 | + * |
|
| 9215 | + * @return Integer the number of pilots |
|
| 9216 | + * |
|
| 9217 | + */ |
|
| 9218 | 9218 | public function countOverallPilots($filters = array()) |
| 9219 | 9219 | { |
| 9220 | 9220 | $filter_query = $this->getFilter($filters,true,true); |
@@ -9226,11 +9226,11 @@ discard block |
||
| 9226 | 9226 | } |
| 9227 | 9227 | |
| 9228 | 9228 | /** |
| 9229 | - * Counts all owners that have flown over |
|
| 9230 | - * |
|
| 9231 | - * @return Integer the number of owners |
|
| 9232 | - * |
|
| 9233 | - */ |
|
| 9229 | + * Counts all owners that have flown over |
|
| 9230 | + * |
|
| 9231 | + * @return Integer the number of owners |
|
| 9232 | + * |
|
| 9233 | + */ |
|
| 9234 | 9234 | public function countOverallOwners($filters = array()) |
| 9235 | 9235 | { |
| 9236 | 9236 | $filter_query = $this->getFilter($filters,true,true); |
@@ -9243,11 +9243,11 @@ discard block |
||
| 9243 | 9243 | |
| 9244 | 9244 | |
| 9245 | 9245 | /** |
| 9246 | - * Counts all flights that have flown over |
|
| 9247 | - * |
|
| 9248 | - * @return Integer the number of flights |
|
| 9249 | - * |
|
| 9250 | - */ |
|
| 9246 | + * Counts all flights that have flown over |
|
| 9247 | + * |
|
| 9248 | + * @return Integer the number of flights |
|
| 9249 | + * |
|
| 9250 | + */ |
|
| 9251 | 9251 | public function countOverallFlights($filters = array()) |
| 9252 | 9252 | { |
| 9253 | 9253 | $query = "SELECT COUNT(spotter_output.spotter_id) AS flight_count |
@@ -9260,11 +9260,11 @@ discard block |
||
| 9260 | 9260 | } |
| 9261 | 9261 | |
| 9262 | 9262 | /** |
| 9263 | - * Counts all military flights that have flown over |
|
| 9264 | - * |
|
| 9265 | - * @return Integer the number of flights |
|
| 9266 | - * |
|
| 9267 | - */ |
|
| 9263 | + * Counts all military flights that have flown over |
|
| 9264 | + * |
|
| 9265 | + * @return Integer the number of flights |
|
| 9266 | + * |
|
| 9267 | + */ |
|
| 9268 | 9268 | public function countOverallMilitaryFlights($filters = array()) |
| 9269 | 9269 | { |
| 9270 | 9270 | $filter_query = $this->getFilter($filters,true,true); |
@@ -9279,11 +9279,11 @@ discard block |
||
| 9279 | 9279 | |
| 9280 | 9280 | |
| 9281 | 9281 | /** |
| 9282 | - * Counts all airlines that have flown over |
|
| 9283 | - * |
|
| 9284 | - * @return Integer the number of airlines |
|
| 9285 | - * |
|
| 9286 | - */ |
|
| 9282 | + * Counts all airlines that have flown over |
|
| 9283 | + * |
|
| 9284 | + * @return Integer the number of airlines |
|
| 9285 | + * |
|
| 9286 | + */ |
|
| 9287 | 9287 | public function countOverallAirlines($filters = array()) |
| 9288 | 9288 | { |
| 9289 | 9289 | $query = "SELECT COUNT(DISTINCT spotter_output.airline_name) AS airline_count |
@@ -9297,11 +9297,11 @@ discard block |
||
| 9297 | 9297 | |
| 9298 | 9298 | |
| 9299 | 9299 | /** |
| 9300 | - * Counts all hours of today |
|
| 9301 | - * |
|
| 9302 | - * @return Array the hour list |
|
| 9303 | - * |
|
| 9304 | - */ |
|
| 9300 | + * Counts all hours of today |
|
| 9301 | + * |
|
| 9302 | + * @return Array the hour list |
|
| 9303 | + * |
|
| 9304 | + */ |
|
| 9305 | 9305 | public function countAllHoursFromToday() |
| 9306 | 9306 | { |
| 9307 | 9307 | global $globalTimezone, $globalDBdriver; |
@@ -9342,11 +9342,11 @@ discard block |
||
| 9342 | 9342 | } |
| 9343 | 9343 | |
| 9344 | 9344 | /** |
| 9345 | - * Gets all the spotter information based on calculated upcoming flights |
|
| 9346 | - * |
|
| 9347 | - * @return Array the spotter information |
|
| 9348 | - * |
|
| 9349 | - */ |
|
| 9345 | + * Gets all the spotter information based on calculated upcoming flights |
|
| 9346 | + * |
|
| 9347 | + * @return Array the spotter information |
|
| 9348 | + * |
|
| 9349 | + */ |
|
| 9350 | 9350 | public function getUpcomingFlights($limit = '', $sort = '') |
| 9351 | 9351 | { |
| 9352 | 9352 | global $global_query, $globalDBdriver, $globalTimezone; |
@@ -9422,12 +9422,12 @@ discard block |
||
| 9422 | 9422 | } |
| 9423 | 9423 | |
| 9424 | 9424 | |
| 9425 | - /** |
|
| 9426 | - * Gets the Barrie Spotter ID based on the FlightAware ID |
|
| 9427 | - * |
|
| 9428 | - * @return Integer the Barrie Spotter ID |
|
| 9425 | + /** |
|
| 9426 | + * Gets the Barrie Spotter ID based on the FlightAware ID |
|
| 9427 | + * |
|
| 9428 | + * @return Integer the Barrie Spotter ID |
|
| 9429 | 9429 | q * |
| 9430 | - */ |
|
| 9430 | + */ |
|
| 9431 | 9431 | public function getSpotterIDBasedOnFlightAwareID($flightaware_id) |
| 9432 | 9432 | { |
| 9433 | 9433 | $flightaware_id = filter_var($flightaware_id,FILTER_SANITIZE_STRING); |
@@ -9448,13 +9448,13 @@ discard block |
||
| 9448 | 9448 | |
| 9449 | 9449 | |
| 9450 | 9450 | /** |
| 9451 | - * Parses a date string |
|
| 9452 | - * |
|
| 9453 | - * @param String $dateString the date string |
|
| 9454 | - * @param String $timezone the timezone of a user |
|
| 9455 | - * @return Array the time information |
|
| 9456 | - * |
|
| 9457 | - */ |
|
| 9451 | + * Parses a date string |
|
| 9452 | + * |
|
| 9453 | + * @param String $dateString the date string |
|
| 9454 | + * @param String $timezone the timezone of a user |
|
| 9455 | + * @return Array the time information |
|
| 9456 | + * |
|
| 9457 | + */ |
|
| 9458 | 9458 | public function parseDateString($dateString, $timezone = '') |
| 9459 | 9459 | { |
| 9460 | 9460 | $time_array = array(); |
@@ -9490,12 +9490,12 @@ discard block |
||
| 9490 | 9490 | |
| 9491 | 9491 | |
| 9492 | 9492 | /** |
| 9493 | - * Parses the direction degrees to working |
|
| 9494 | - * |
|
| 9495 | - * @param Float $direction the direction in degrees |
|
| 9496 | - * @return Array the direction information |
|
| 9497 | - * |
|
| 9498 | - */ |
|
| 9493 | + * Parses the direction degrees to working |
|
| 9494 | + * |
|
| 9495 | + * @param Float $direction the direction in degrees |
|
| 9496 | + * @return Array the direction information |
|
| 9497 | + * |
|
| 9498 | + */ |
|
| 9499 | 9499 | public function parseDirection($direction = 0) |
| 9500 | 9500 | { |
| 9501 | 9501 | if ($direction == '') $direction = 0; |
@@ -9574,12 +9574,12 @@ discard block |
||
| 9574 | 9574 | |
| 9575 | 9575 | |
| 9576 | 9576 | /** |
| 9577 | - * Gets the aircraft registration |
|
| 9578 | - * |
|
| 9579 | - * @param String $flightaware_id the flight aware id |
|
| 9580 | - * @return String the aircraft registration |
|
| 9581 | - * |
|
| 9582 | - */ |
|
| 9577 | + * Gets the aircraft registration |
|
| 9578 | + * |
|
| 9579 | + * @param String $flightaware_id the flight aware id |
|
| 9580 | + * @return String the aircraft registration |
|
| 9581 | + * |
|
| 9582 | + */ |
|
| 9583 | 9583 | |
| 9584 | 9584 | public function getAircraftRegistration($flightaware_id) |
| 9585 | 9585 | { |
@@ -9608,12 +9608,12 @@ discard block |
||
| 9608 | 9608 | |
| 9609 | 9609 | |
| 9610 | 9610 | /** |
| 9611 | - * Gets the aircraft registration from ModeS |
|
| 9612 | - * |
|
| 9613 | - * @param String $aircraft_modes the flight ModeS in hex |
|
| 9614 | - * @return String the aircraft registration |
|
| 9615 | - * |
|
| 9616 | - */ |
|
| 9611 | + * Gets the aircraft registration from ModeS |
|
| 9612 | + * |
|
| 9613 | + * @param String $aircraft_modes the flight ModeS in hex |
|
| 9614 | + * @return String the aircraft registration |
|
| 9615 | + * |
|
| 9616 | + */ |
|
| 9617 | 9617 | public function getAircraftRegistrationBymodeS($aircraft_modes) |
| 9618 | 9618 | { |
| 9619 | 9619 | $aircraft_modes = filter_var($aircraft_modes,FILTER_SANITIZE_STRING); |
@@ -9625,19 +9625,19 @@ discard block |
||
| 9625 | 9625 | |
| 9626 | 9626 | $row = $sth->fetch(PDO::FETCH_ASSOC); |
| 9627 | 9627 | if (count($row) > 0) { |
| 9628 | - //return $row['Registration']; |
|
| 9629 | - return $row['registration']; |
|
| 9628 | + //return $row['Registration']; |
|
| 9629 | + return $row['registration']; |
|
| 9630 | 9630 | } else return ''; |
| 9631 | 9631 | |
| 9632 | 9632 | } |
| 9633 | 9633 | |
| 9634 | 9634 | /** |
| 9635 | - * Gets the aircraft type from ModeS |
|
| 9636 | - * |
|
| 9637 | - * @param String $aircraft_modes the flight ModeS in hex |
|
| 9638 | - * @return String the aircraft type |
|
| 9639 | - * |
|
| 9640 | - */ |
|
| 9635 | + * Gets the aircraft type from ModeS |
|
| 9636 | + * |
|
| 9637 | + * @param String $aircraft_modes the flight ModeS in hex |
|
| 9638 | + * @return String the aircraft type |
|
| 9639 | + * |
|
| 9640 | + */ |
|
| 9641 | 9641 | public function getAircraftTypeBymodeS($aircraft_modes) |
| 9642 | 9642 | { |
| 9643 | 9643 | $aircraft_modes = filter_var($aircraft_modes,FILTER_SANITIZE_STRING); |
@@ -9649,19 +9649,19 @@ discard block |
||
| 9649 | 9649 | |
| 9650 | 9650 | $row = $sth->fetch(PDO::FETCH_ASSOC); |
| 9651 | 9651 | if (count($row) > 0) { |
| 9652 | - if ($row['type_flight'] == null) return ''; |
|
| 9653 | - else return $row['type_flight']; |
|
| 9652 | + if ($row['type_flight'] == null) return ''; |
|
| 9653 | + else return $row['type_flight']; |
|
| 9654 | 9654 | } else return ''; |
| 9655 | 9655 | |
| 9656 | 9656 | } |
| 9657 | 9657 | |
| 9658 | 9658 | /** |
| 9659 | - * Gets Countrie from latitude/longitude |
|
| 9660 | - * |
|
| 9661 | - * @param Float $latitude latitute of the flight |
|
| 9662 | - * @param Float $longitude longitute of the flight |
|
| 9663 | - * @return String the countrie |
|
| 9664 | - */ |
|
| 9659 | + * Gets Countrie from latitude/longitude |
|
| 9660 | + * |
|
| 9661 | + * @param Float $latitude latitute of the flight |
|
| 9662 | + * @param Float $longitude longitute of the flight |
|
| 9663 | + * @return String the countrie |
|
| 9664 | + */ |
|
| 9665 | 9665 | public function getCountryFromLatitudeLongitude($latitude,$longitude) |
| 9666 | 9666 | { |
| 9667 | 9667 | global $globalDBdriver, $globalDebug; |
@@ -9694,12 +9694,12 @@ discard block |
||
| 9694 | 9694 | } |
| 9695 | 9695 | |
| 9696 | 9696 | /** |
| 9697 | - * converts the registration code using the country prefix |
|
| 9698 | - * |
|
| 9699 | - * @param String $registration the aircraft registration |
|
| 9700 | - * @return String the aircraft registration |
|
| 9701 | - * |
|
| 9702 | - */ |
|
| 9697 | + * converts the registration code using the country prefix |
|
| 9698 | + * |
|
| 9699 | + * @param String $registration the aircraft registration |
|
| 9700 | + * @return String the aircraft registration |
|
| 9701 | + * |
|
| 9702 | + */ |
|
| 9703 | 9703 | public function convertAircraftRegistration($registration) |
| 9704 | 9704 | { |
| 9705 | 9705 | $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
@@ -9751,12 +9751,12 @@ discard block |
||
| 9751 | 9751 | } |
| 9752 | 9752 | |
| 9753 | 9753 | /** |
| 9754 | - * Country from the registration code |
|
| 9755 | - * |
|
| 9756 | - * @param String $registration the aircraft registration |
|
| 9757 | - * @return String the country |
|
| 9758 | - * |
|
| 9759 | - */ |
|
| 9754 | + * Country from the registration code |
|
| 9755 | + * |
|
| 9756 | + * @param String $registration the aircraft registration |
|
| 9757 | + * @return String the country |
|
| 9758 | + * |
|
| 9759 | + */ |
|
| 9760 | 9760 | public function countryFromAircraftRegistration($registration) |
| 9761 | 9761 | { |
| 9762 | 9762 | $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
@@ -9775,8 +9775,8 @@ discard block |
||
| 9775 | 9775 | $country = $row['country']; |
| 9776 | 9776 | } |
| 9777 | 9777 | } else { |
| 9778 | - $registration_1 = substr($registration, 0, 1); |
|
| 9779 | - $registration_2 = substr($registration, 0, 2); |
|
| 9778 | + $registration_1 = substr($registration, 0, 1); |
|
| 9779 | + $registration_2 = substr($registration, 0, 2); |
|
| 9780 | 9780 | |
| 9781 | 9781 | $country = ''; |
| 9782 | 9782 | //first get the prefix based on two characters |
@@ -9812,11 +9812,11 @@ discard block |
||
| 9812 | 9812 | } |
| 9813 | 9813 | |
| 9814 | 9814 | /** |
| 9815 | - * Set a new highlight value for a flight |
|
| 9816 | - * |
|
| 9817 | - * @param String $flightaware_id flightaware_id from spotter_output table |
|
| 9818 | - * @param String $highlight New highlight value |
|
| 9819 | - */ |
|
| 9815 | + * Set a new highlight value for a flight |
|
| 9816 | + * |
|
| 9817 | + * @param String $flightaware_id flightaware_id from spotter_output table |
|
| 9818 | + * @param String $highlight New highlight value |
|
| 9819 | + */ |
|
| 9820 | 9820 | public function setHighlightFlight($flightaware_id,$highlight) { |
| 9821 | 9821 | |
| 9822 | 9822 | $query = "UPDATE spotter_output SET highlight = :highlight WHERE flightaware_id = :flightaware_id"; |
@@ -9825,12 +9825,12 @@ discard block |
||
| 9825 | 9825 | } |
| 9826 | 9826 | |
| 9827 | 9827 | /** |
| 9828 | - * Gets the short url from bit.ly |
|
| 9829 | - * |
|
| 9830 | - * @param String $url the full url |
|
| 9831 | - * @return String the bit.ly url |
|
| 9832 | - * |
|
| 9833 | - */ |
|
| 9828 | + * Gets the short url from bit.ly |
|
| 9829 | + * |
|
| 9830 | + * @param String $url the full url |
|
| 9831 | + * @return String the bit.ly url |
|
| 9832 | + * |
|
| 9833 | + */ |
|
| 9834 | 9834 | public function getBitlyURL($url) |
| 9835 | 9835 | { |
| 9836 | 9836 | global $globalBitlyAccessToken; |
@@ -10119,11 +10119,11 @@ discard block |
||
| 10119 | 10119 | $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 |
| 10120 | 10120 | 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)) |
| 10121 | 10121 | 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;"; |
| 10122 | - } else { |
|
| 10122 | + } else { |
|
| 10123 | 10123 | $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 |
| 10124 | 10124 | 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)) |
| 10125 | 10125 | 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;"; |
| 10126 | - } |
|
| 10126 | + } |
|
| 10127 | 10127 | $sth = $this->db->prepare($query); |
| 10128 | 10128 | $sth->execute(); |
| 10129 | 10129 | return $sth->fetchAll(PDO::FETCH_ASSOC); |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | /** |
| 16 | 16 | * Get SQL query part for filter used |
| 17 | 17 | * @param Array $filter the filter |
| 18 | - * @return Array the SQL part |
|
| 18 | + * @return string the SQL part |
|
| 19 | 19 | */ |
| 20 | 20 | public function getFilter($filter = array(),$where = false,$and = false) { |
| 21 | 21 | global $globalFilter; |
@@ -8612,6 +8612,7 @@ discard block |
||
| 8612 | 8612 | /** |
| 8613 | 8613 | * Counts all hours |
| 8614 | 8614 | * |
| 8615 | + * @param string $orderby |
|
| 8615 | 8616 | * @return Array the hour list |
| 8616 | 8617 | * |
| 8617 | 8618 | */ |
@@ -8677,6 +8678,7 @@ discard block |
||
| 8677 | 8678 | /** |
| 8678 | 8679 | * Counts all hours |
| 8679 | 8680 | * |
| 8681 | + * @param string $orderby |
|
| 8680 | 8682 | * @return Array the hour list |
| 8681 | 8683 | * |
| 8682 | 8684 | */ |
@@ -9501,7 +9503,7 @@ discard block |
||
| 9501 | 9503 | /** |
| 9502 | 9504 | * Parses the direction degrees to working |
| 9503 | 9505 | * |
| 9504 | - * @param Float $direction the direction in degrees |
|
| 9506 | + * @param integer $direction the direction in degrees |
|
| 9505 | 9507 | * @return Array the direction information |
| 9506 | 9508 | * |
| 9507 | 9509 | */ |
@@ -19,7 +19,9 @@ discard block |
||
| 19 | 19 | */ |
| 20 | 20 | public function getFilter($filter = array(),$where = false,$and = false) { |
| 21 | 21 | global $globalFilter; |
| 22 | - if (is_array($globalFilter)) $filter = array_merge($globalFilter,$filter); |
|
| 22 | + if (is_array($globalFilter)) { |
|
| 23 | + $filter = array_merge($globalFilter,$filter); |
|
| 24 | + } |
|
| 23 | 25 | $filter_query_join = ''; |
| 24 | 26 | $filter_query_where = ''; |
| 25 | 27 | if (isset($filter['airlines']) && !empty($filter['airlines'])) { |
@@ -44,8 +46,11 @@ discard block |
||
| 44 | 46 | $filter_query_where .= " AND format_source = 'aprs' AND source_name IN ('".implode("','",$filter['source_aprs'])."')"; |
| 45 | 47 | } |
| 46 | 48 | } |
| 47 | - if ($filter_query_where == '' && $where) $filter_query_where = ' WHERE'; |
|
| 48 | - elseif ($filter_query_where != '' && $and) $filter_query_where .= ' AND'; |
|
| 49 | + if ($filter_query_where == '' && $where) { |
|
| 50 | + $filter_query_where = ' WHERE'; |
|
| 51 | + } elseif ($filter_query_where != '' && $and) { |
|
| 52 | + $filter_query_where .= ' AND'; |
|
| 53 | + } |
|
| 49 | 54 | $filter_query = $filter_query_join.$filter_query_where; |
| 50 | 55 | return $filter_query; |
| 51 | 56 | } |
@@ -65,10 +70,18 @@ discard block |
||
| 65 | 70 | $Image = new Image($this->db); |
| 66 | 71 | $Schedule = new Schedule($this->db); |
| 67 | 72 | $ACARS = new ACARS($this->db); |
| 68 | - if (!isset($globalIVAO)) $globalIVAO = FALSE; |
|
| 69 | - if (!isset($globalVATSIM)) $globalVATSIM = FALSE; |
|
| 70 | - if (!isset($globalphpVMS)) $globalphpVMS = FALSE; |
|
| 71 | - if (!isset($globalVAM)) $globalVAM = FALSE; |
|
| 73 | + if (!isset($globalIVAO)) { |
|
| 74 | + $globalIVAO = FALSE; |
|
| 75 | + } |
|
| 76 | + if (!isset($globalVATSIM)) { |
|
| 77 | + $globalVATSIM = FALSE; |
|
| 78 | + } |
|
| 79 | + if (!isset($globalphpVMS)) { |
|
| 80 | + $globalphpVMS = FALSE; |
|
| 81 | + } |
|
| 82 | + if (!isset($globalVAM)) { |
|
| 83 | + $globalVAM = FALSE; |
|
| 84 | + } |
|
| 72 | 85 | date_default_timezone_set('UTC'); |
| 73 | 86 | |
| 74 | 87 | if (!is_string($query)) |
@@ -115,21 +128,35 @@ discard block |
||
| 115 | 128 | } else { |
| 116 | 129 | $temp_array['spotter_id'] = ''; |
| 117 | 130 | } |
| 118 | - if (isset($row['flightaware_id'])) $temp_array['flightaware_id'] = $row['flightaware_id']; |
|
| 119 | - if (isset($row['modes'])) $temp_array['modes'] = $row['modes']; |
|
| 131 | + if (isset($row['flightaware_id'])) { |
|
| 132 | + $temp_array['flightaware_id'] = $row['flightaware_id']; |
|
| 133 | + } |
|
| 134 | + if (isset($row['modes'])) { |
|
| 135 | + $temp_array['modes'] = $row['modes']; |
|
| 136 | + } |
|
| 120 | 137 | $temp_array['ident'] = $row['ident']; |
| 121 | 138 | if (isset($row['registration']) && $row['registration'] != '') { |
| 122 | 139 | $temp_array['registration'] = $row['registration']; |
| 123 | 140 | } elseif (isset($temp_array['modes'])) { |
| 124 | 141 | $temp_array['registration'] = $this->getAircraftRegistrationBymodeS($temp_array['modes']); |
| 125 | - } else $temp_array['registration'] = ''; |
|
| 126 | - if (isset($row['aircraft_icao'])) $temp_array['aircraft_type'] = $row['aircraft_icao']; |
|
| 142 | + } else { |
|
| 143 | + $temp_array['registration'] = ''; |
|
| 144 | + } |
|
| 145 | + if (isset($row['aircraft_icao'])) { |
|
| 146 | + $temp_array['aircraft_type'] = $row['aircraft_icao']; |
|
| 147 | + } |
|
| 127 | 148 | |
| 128 | 149 | $temp_array['departure_airport'] = $row['departure_airport_icao']; |
| 129 | 150 | $temp_array['arrival_airport'] = $row['arrival_airport_icao']; |
| 130 | - if (isset($row['real_arrival_airport_icao']) && $row['real_arrival_airport_icao'] != NULL) $temp_array['real_arrival_airport'] = $row['real_arrival_airport_icao']; |
|
| 131 | - if (isset($row['latitude'])) $temp_array['latitude'] = $row['latitude']; |
|
| 132 | - if (isset($row['longitude'])) $temp_array['longitude'] = $row['longitude']; |
|
| 151 | + if (isset($row['real_arrival_airport_icao']) && $row['real_arrival_airport_icao'] != NULL) { |
|
| 152 | + $temp_array['real_arrival_airport'] = $row['real_arrival_airport_icao']; |
|
| 153 | + } |
|
| 154 | + if (isset($row['latitude'])) { |
|
| 155 | + $temp_array['latitude'] = $row['latitude']; |
|
| 156 | + } |
|
| 157 | + if (isset($row['longitude'])) { |
|
| 158 | + $temp_array['longitude'] = $row['longitude']; |
|
| 159 | + } |
|
| 133 | 160 | /* |
| 134 | 161 | if (Connection->tableExists('countries')) { |
| 135 | 162 | $country_info = $this->getCountryFromLatitudeLongitude($temp_array['latitude'],$temp_array['longitude']); |
@@ -139,8 +166,12 @@ discard block |
||
| 139 | 166 | } |
| 140 | 167 | } |
| 141 | 168 | */ |
| 142 | - if (isset($row['waypoints'])) $temp_array['waypoints'] = $row['waypoints']; |
|
| 143 | - if (isset($row['format_source'])) $temp_array['format_source'] = $row['format_source']; |
|
| 169 | + if (isset($row['waypoints'])) { |
|
| 170 | + $temp_array['waypoints'] = $row['waypoints']; |
|
| 171 | + } |
|
| 172 | + if (isset($row['format_source'])) { |
|
| 173 | + $temp_array['format_source'] = $row['format_source']; |
|
| 174 | + } |
|
| 144 | 175 | if (isset($row['route_stop'])) { |
| 145 | 176 | $temp_array['route_stop'] = $row['route_stop']; |
| 146 | 177 | if ($row['route_stop'] != '') { |
@@ -159,13 +190,19 @@ discard block |
||
| 159 | 190 | } |
| 160 | 191 | } |
| 161 | 192 | } |
| 162 | - if (isset($row['altitude'])) $temp_array['altitude'] = $row['altitude']; |
|
| 193 | + if (isset($row['altitude'])) { |
|
| 194 | + $temp_array['altitude'] = $row['altitude']; |
|
| 195 | + } |
|
| 163 | 196 | if (isset($row['heading'])) { |
| 164 | 197 | $temp_array['heading'] = $row['heading']; |
| 165 | 198 | $heading_direction = $this->parseDirection($row['heading']); |
| 166 | - if (isset($heading_direction[0]['direction_fullname'])) $temp_array['heading_name'] = $heading_direction[0]['direction_fullname']; |
|
| 199 | + if (isset($heading_direction[0]['direction_fullname'])) { |
|
| 200 | + $temp_array['heading_name'] = $heading_direction[0]['direction_fullname']; |
|
| 201 | + } |
|
| 202 | + } |
|
| 203 | + if (isset($row['ground_speed'])) { |
|
| 204 | + $temp_array['ground_speed'] = $row['ground_speed']; |
|
| 167 | 205 | } |
| 168 | - if (isset($row['ground_speed'])) $temp_array['ground_speed'] = $row['ground_speed']; |
|
| 169 | 206 | $temp_array['image'] = ""; |
| 170 | 207 | $temp_array['image_thumbnail'] = ""; |
| 171 | 208 | $temp_array['image_source'] = ""; |
@@ -173,7 +210,9 @@ discard block |
||
| 173 | 210 | |
| 174 | 211 | if (isset($row['highlight'])) { |
| 175 | 212 | $temp_array['highlight'] = $row['highlight']; |
| 176 | - } else $temp_array['highlight'] = ''; |
|
| 213 | + } else { |
|
| 214 | + $temp_array['highlight'] = ''; |
|
| 215 | + } |
|
| 177 | 216 | |
| 178 | 217 | if (isset($row['date'])) { |
| 179 | 218 | $dateArray = $this->parseDateString($row['date']); |
@@ -221,7 +260,9 @@ discard block |
||
| 221 | 260 | |
| 222 | 261 | if ($aircraft_array[0]['aircraft_shadow'] != NULL) { |
| 223 | 262 | $temp_array['aircraft_shadow'] = $aircraft_array[0]['aircraft_shadow']; |
| 224 | - } else $temp_array['aircraft_shadow'] = 'default.png'; |
|
| 263 | + } else { |
|
| 264 | + $temp_array['aircraft_shadow'] = 'default.png'; |
|
| 265 | + } |
|
| 225 | 266 | } else { |
| 226 | 267 | $temp_array['aircraft_shadow'] = 'default.png'; |
| 227 | 268 | $temp_array['aircraft_name'] = 'N/A'; |
@@ -229,11 +270,17 @@ discard block |
||
| 229 | 270 | } |
| 230 | 271 | } |
| 231 | 272 | $fromsource = NULL; |
| 232 | - if (isset($globalAirlinesSource) && $globalAirlinesSource != '') $fromsource = $globalAirlinesSource; |
|
| 233 | - elseif (isset($row['format_source']) && $row['format_source'] == 'vatsimtxt') $fromsource = 'vatsim'; |
|
| 234 | - elseif (isset($row['format_source']) && $row['format_source'] == 'whazzup') $fromsource = 'ivao'; |
|
| 235 | - elseif (isset($globalVATSIM) && $globalVATSIM) $fromsource = 'vatsim'; |
|
| 236 | - elseif (isset($globalIVAO) && $globalIVAO) $fromsource = 'ivao'; |
|
| 273 | + if (isset($globalAirlinesSource) && $globalAirlinesSource != '') { |
|
| 274 | + $fromsource = $globalAirlinesSource; |
|
| 275 | + } elseif (isset($row['format_source']) && $row['format_source'] == 'vatsimtxt') { |
|
| 276 | + $fromsource = 'vatsim'; |
|
| 277 | + } elseif (isset($row['format_source']) && $row['format_source'] == 'whazzup') { |
|
| 278 | + $fromsource = 'ivao'; |
|
| 279 | + } elseif (isset($globalVATSIM) && $globalVATSIM) { |
|
| 280 | + $fromsource = 'vatsim'; |
|
| 281 | + } elseif (isset($globalIVAO) && $globalIVAO) { |
|
| 282 | + $fromsource = 'ivao'; |
|
| 283 | + } |
|
| 237 | 284 | if (!isset($row['airline_name']) || $row['airline_name'] == '') { |
| 238 | 285 | if (!is_numeric(substr($row['ident'], 0, 3))) { |
| 239 | 286 | if (is_numeric(substr($row['ident'], 2, 1))) { |
@@ -256,12 +303,18 @@ discard block |
||
| 256 | 303 | } |
| 257 | 304 | } else { |
| 258 | 305 | $temp_array['airline_icao'] = $row['airline_icao']; |
| 259 | - if (isset($row['airline_iata'])) $temp_array['airline_iata'] = $row['airline_iata']; |
|
| 260 | - else $temp_array['airline_iata'] = ''; |
|
| 306 | + if (isset($row['airline_iata'])) { |
|
| 307 | + $temp_array['airline_iata'] = $row['airline_iata']; |
|
| 308 | + } else { |
|
| 309 | + $temp_array['airline_iata'] = ''; |
|
| 310 | + } |
|
| 261 | 311 | $temp_array['airline_name'] = $row['airline_name']; |
| 262 | 312 | $temp_array['airline_country'] = $row['airline_country']; |
| 263 | - if (isset($row['airline_callsign'])) $temp_array['airline_callsign'] = $row['airline_callsign']; |
|
| 264 | - else $temp_array['airline_callsign'] = 'N/A'; |
|
| 313 | + if (isset($row['airline_callsign'])) { |
|
| 314 | + $temp_array['airline_callsign'] = $row['airline_callsign']; |
|
| 315 | + } else { |
|
| 316 | + $temp_array['airline_callsign'] = 'N/A'; |
|
| 317 | + } |
|
| 265 | 318 | $temp_array['airline_type'] = $row['airline_type']; |
| 266 | 319 | } |
| 267 | 320 | if (isset($temp_array['airline_iata']) && $temp_array['airline_iata'] != '') { |
@@ -277,7 +330,9 @@ discard block |
||
| 277 | 330 | } |
| 278 | 331 | if ($temp_array['registration'] != "" && !$globalIVAO && !$globalVATSIM && !$globalphpVMS && !$globalVAM && !isset($temp_array['aircraft_owner'])) { |
| 279 | 332 | $owner_info = $this->getAircraftOwnerByRegistration($temp_array['registration']); |
| 280 | - if ($owner_info['owner'] != '') $temp_array['aircraft_owner'] = ucwords(strtolower($owner_info['owner'])); |
|
| 333 | + if ($owner_info['owner'] != '') { |
|
| 334 | + $temp_array['aircraft_owner'] = ucwords(strtolower($owner_info['owner'])); |
|
| 335 | + } |
|
| 281 | 336 | $temp_array['aircraft_base'] = $owner_info['base']; |
| 282 | 337 | $temp_array['aircraft_date_first_reg'] = $owner_info['date_first_reg']; |
| 283 | 338 | } |
@@ -285,9 +340,14 @@ discard block |
||
| 285 | 340 | if($temp_array['registration'] != "" || ($globalIVAO && isset($temp_array['aircraft_type']) && $temp_array['aircraft_type'] != '')) |
| 286 | 341 | { |
| 287 | 342 | if ($globalIVAO) { |
| 288 | - if (isset($temp_array['airline_icao'])) $image_array = $Image->getSpotterImage('',$temp_array['aircraft_type'],$temp_array['airline_icao']); |
|
| 289 | - else $image_array = $Image->getSpotterImage('',$temp_array['aircraft_type']); |
|
| 290 | - } else $image_array = $Image->getSpotterImage($temp_array['registration']); |
|
| 343 | + if (isset($temp_array['airline_icao'])) { |
|
| 344 | + $image_array = $Image->getSpotterImage('',$temp_array['aircraft_type'],$temp_array['airline_icao']); |
|
| 345 | + } else { |
|
| 346 | + $image_array = $Image->getSpotterImage('',$temp_array['aircraft_type']); |
|
| 347 | + } |
|
| 348 | + } else { |
|
| 349 | + $image_array = $Image->getSpotterImage($temp_array['registration']); |
|
| 350 | + } |
|
| 291 | 351 | if (count($image_array) > 0) { |
| 292 | 352 | $temp_array['image'] = $image_array[0]['image']; |
| 293 | 353 | $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
@@ -337,7 +397,9 @@ discard block |
||
| 337 | 397 | //if ($row['departure_airport_icao'] != '' && $row['departure_airport_name'] == '') { |
| 338 | 398 | if ($row['departure_airport_icao'] != '') { |
| 339 | 399 | $departure_airport_array = $this->getAllAirportInfo($row['departure_airport_icao']); |
| 340 | - if (!isset($departure_airport_array[0]['name'])) $departure_airport_array = $this->getAllAirportInfo('NA'); |
|
| 400 | + if (!isset($departure_airport_array[0]['name'])) { |
|
| 401 | + $departure_airport_array = $this->getAllAirportInfo('NA'); |
|
| 402 | + } |
|
| 341 | 403 | /* |
| 342 | 404 | } elseif ($row['departure_airport_name'] != '') { |
| 343 | 405 | $temp_array['departure_airport_name'] = $row['departure_airport_name']; |
@@ -345,7 +407,9 @@ discard block |
||
| 345 | 407 | $temp_array['departure_airport_country'] = $row['departure_airport_country']; |
| 346 | 408 | $temp_array['departure_airport_icao'] = $row['departure_airport_icao']; |
| 347 | 409 | */ |
| 348 | - } else $departure_airport_array = $this->getAllAirportInfo('NA'); |
|
| 410 | + } else { |
|
| 411 | + $departure_airport_array = $this->getAllAirportInfo('NA'); |
|
| 412 | + } |
|
| 349 | 413 | if (isset($departure_airport_array[0]['name'])) { |
| 350 | 414 | $temp_array['departure_airport_name'] = $departure_airport_array[0]['name']; |
| 351 | 415 | $temp_array['departure_airport_city'] = $departure_airport_array[0]['city']; |
@@ -365,8 +429,12 @@ discard block |
||
| 365 | 429 | |
| 366 | 430 | if ($row['arrival_airport_icao'] != '') { |
| 367 | 431 | $arrival_airport_array = $this->getAllAirportInfo($row['arrival_airport_icao']); |
| 368 | - if (count($arrival_airport_array) == 0) $arrival_airport_array = $this->getAllAirportInfo('NA'); |
|
| 369 | - } else $arrival_airport_array = $this->getAllAirportInfo('NA'); |
|
| 432 | + if (count($arrival_airport_array) == 0) { |
|
| 433 | + $arrival_airport_array = $this->getAllAirportInfo('NA'); |
|
| 434 | + } |
|
| 435 | + } else { |
|
| 436 | + $arrival_airport_array = $this->getAllAirportInfo('NA'); |
|
| 437 | + } |
|
| 370 | 438 | if (isset($arrival_airport_array[0]['name'])) { |
| 371 | 439 | $temp_array['arrival_airport_name'] = $arrival_airport_array[0]['name']; |
| 372 | 440 | $temp_array['arrival_airport_city'] = $arrival_airport_array[0]['city']; |
@@ -382,27 +450,45 @@ discard block |
||
| 382 | 450 | $temp_array['arrival_airport_time'] = $row['arrival_airport_time']; |
| 383 | 451 | } |
| 384 | 452 | */ |
| 385 | - if (isset($row['pilot_id']) && $row['pilot_id'] != '') $temp_array['pilot_id'] = $row['pilot_id']; |
|
| 386 | - if (isset($row['pilot_name']) && $row['pilot_name'] != '') $temp_array['pilot_name'] = $row['pilot_name']; |
|
| 387 | - if (isset($row['source_name']) && $row['source_name'] != '') $temp_array['source_name'] = $row['source_name']; |
|
| 388 | - if (isset($row['over_country']) && $row['over_country'] != '') $temp_array['over_country'] = $row['over_country']; |
|
| 389 | - if (isset($row['distance']) && $row['distance'] != '') $temp_array['distance'] = $row['distance']; |
|
| 453 | + if (isset($row['pilot_id']) && $row['pilot_id'] != '') { |
|
| 454 | + $temp_array['pilot_id'] = $row['pilot_id']; |
|
| 455 | + } |
|
| 456 | + if (isset($row['pilot_name']) && $row['pilot_name'] != '') { |
|
| 457 | + $temp_array['pilot_name'] = $row['pilot_name']; |
|
| 458 | + } |
|
| 459 | + if (isset($row['source_name']) && $row['source_name'] != '') { |
|
| 460 | + $temp_array['source_name'] = $row['source_name']; |
|
| 461 | + } |
|
| 462 | + if (isset($row['over_country']) && $row['over_country'] != '') { |
|
| 463 | + $temp_array['over_country'] = $row['over_country']; |
|
| 464 | + } |
|
| 465 | + if (isset($row['distance']) && $row['distance'] != '') { |
|
| 466 | + $temp_array['distance'] = $row['distance']; |
|
| 467 | + } |
|
| 390 | 468 | if (isset($row['squawk'])) { |
| 391 | 469 | $temp_array['squawk'] = $row['squawk']; |
| 392 | 470 | if ($row['squawk'] != '' && isset($temp_array['country_iso2'])) { |
| 393 | 471 | $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'],$temp_array['country_iso2']); |
| 394 | - if ($temp_array['squawk_usage'] == '' && isset($globalSquawkCountry)) $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'],$globalSquawkCountry); |
|
| 472 | + if ($temp_array['squawk_usage'] == '' && isset($globalSquawkCountry)) { |
|
| 473 | + $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'],$globalSquawkCountry); |
|
| 474 | + } |
|
| 395 | 475 | } elseif ($row['squawk'] != '' && isset($temp_array['over_country'])) { |
| 396 | 476 | $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'],$temp_array['over_country']); |
| 397 | - if ($temp_array['squawk_usage'] == '' && isset($globalSquawkCountry)) $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'],$globalSquawkCountry); |
|
| 398 | - } elseif ($row['squawk'] != '' && isset($globalSquawkCountry)) $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'],$globalSquawkCountry); |
|
| 477 | + if ($temp_array['squawk_usage'] == '' && isset($globalSquawkCountry)) { |
|
| 478 | + $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'],$globalSquawkCountry); |
|
| 479 | + } |
|
| 480 | + } elseif ($row['squawk'] != '' && isset($globalSquawkCountry)) { |
|
| 481 | + $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'],$globalSquawkCountry); |
|
| 482 | + } |
|
| 399 | 483 | } |
| 400 | 484 | |
| 401 | 485 | $temp_array['query_number_rows'] = $num_rows; |
| 402 | 486 | |
| 403 | 487 | $spotter_array[] = $temp_array; |
| 404 | 488 | } |
| 405 | - if ($num_rows == 0) return array(); |
|
| 489 | + if ($num_rows == 0) { |
|
| 490 | + return array(); |
|
| 491 | + } |
|
| 406 | 492 | $spotter_array[0]['query_number_rows'] = $num_rows; |
| 407 | 493 | return $spotter_array; |
| 408 | 494 | } |
@@ -435,7 +521,9 @@ discard block |
||
| 435 | 521 | foreach ($q_array as $q_item){ |
| 436 | 522 | $q_item = filter_var($q_item,FILTER_SANITIZE_STRING); |
| 437 | 523 | $additional_query .= " AND ("; |
| 438 | - if (is_int($q_item)) $additional_query .= "(spotter_output.spotter_id like '%".$q_item."%') OR "; |
|
| 524 | + if (is_int($q_item)) { |
|
| 525 | + $additional_query .= "(spotter_output.spotter_id like '%".$q_item."%') OR "; |
|
| 526 | + } |
|
| 439 | 527 | $additional_query .= "(spotter_output.aircraft_icao like '%".$q_item."%') OR "; |
| 440 | 528 | $additional_query .= "(spotter_output.aircraft_name like '%".$q_item."%') OR "; |
| 441 | 529 | $additional_query .= "(spotter_output.aircraft_manufacturer like '%".$q_item."%') OR "; |
@@ -456,7 +544,9 @@ discard block |
||
| 456 | 544 | $additional_query .= "(spotter_output.pilot_name like '%".$q_item."%') OR "; |
| 457 | 545 | $additional_query .= "(spotter_output.ident like '%".$q_item."%') OR "; |
| 458 | 546 | $translate = $Translation->ident2icao($q_item); |
| 459 | - if ($translate != $q_item) $additional_query .= "(spotter_output.ident like '%".$translate."%') OR "; |
|
| 547 | + if ($translate != $q_item) { |
|
| 548 | + $additional_query .= "(spotter_output.ident like '%".$translate."%') OR "; |
|
| 549 | + } |
|
| 460 | 550 | $additional_query .= "(spotter_output.highlight like '%".$q_item."%')"; |
| 461 | 551 | $additional_query .= ")"; |
| 462 | 552 | } |
@@ -683,7 +773,9 @@ discard block |
||
| 683 | 773 | date_default_timezone_set($globalTimezone); |
| 684 | 774 | $datetime = new DateTime(); |
| 685 | 775 | $offset = $datetime->format('P'); |
| 686 | - } else $offset = '+00:00'; |
|
| 776 | + } else { |
|
| 777 | + $offset = '+00:00'; |
|
| 778 | + } |
|
| 687 | 779 | |
| 688 | 780 | if ($date_array[1] != "") |
| 689 | 781 | { |
@@ -715,8 +807,12 @@ discard block |
||
| 715 | 807 | { |
| 716 | 808 | //$limit_query = " LIMIT ".$limit_array[0].",".$limit_array[1]; |
| 717 | 809 | $limit_query = " LIMIT ".$limit_array[1]." OFFSET ".$limit_array[0]; |
| 718 | - } else $limit_query = ""; |
|
| 719 | - } else $limit_query = ""; |
|
| 810 | + } else { |
|
| 811 | + $limit_query = ""; |
|
| 812 | + } |
|
| 813 | + } else { |
|
| 814 | + $limit_query = ""; |
|
| 815 | + } |
|
| 720 | 816 | |
| 721 | 817 | |
| 722 | 818 | if ($sort != "") |
@@ -784,8 +880,12 @@ discard block |
||
| 784 | 880 | { |
| 785 | 881 | //$limit_query = " LIMIT ".$limit_array[0].",".$limit_array[1]; |
| 786 | 882 | $limit_query = " LIMIT ".$limit_array[1]." OFFSET ".$limit_array[0]; |
| 787 | - } else $limit_query = ""; |
|
| 788 | - } else $limit_query = ""; |
|
| 883 | + } else { |
|
| 884 | + $limit_query = ""; |
|
| 885 | + } |
|
| 886 | + } else { |
|
| 887 | + $limit_query = ""; |
|
| 888 | + } |
|
| 789 | 889 | |
| 790 | 890 | if ($sort != "") |
| 791 | 891 | { |
@@ -1109,7 +1209,9 @@ discard block |
||
| 1109 | 1209 | global $global_query; |
| 1110 | 1210 | |
| 1111 | 1211 | date_default_timezone_set('UTC'); |
| 1112 | - if ($id == '') return array(); |
|
| 1212 | + if ($id == '') { |
|
| 1213 | + return array(); |
|
| 1214 | + } |
|
| 1113 | 1215 | $additional_query = "spotter_output.spotter_id = :id"; |
| 1114 | 1216 | $query_values = array(':id' => $id); |
| 1115 | 1217 | |
@@ -1746,7 +1848,9 @@ discard block |
||
| 1746 | 1848 | { |
| 1747 | 1849 | $highlight = $row['highlight']; |
| 1748 | 1850 | } |
| 1749 | - if (isset($highlight)) return $highlight; |
|
| 1851 | + if (isset($highlight)) { |
|
| 1852 | + return $highlight; |
|
| 1853 | + } |
|
| 1750 | 1854 | } |
| 1751 | 1855 | |
| 1752 | 1856 | |
@@ -1773,7 +1877,9 @@ discard block |
||
| 1773 | 1877 | $row = $sth->fetch(PDO::FETCH_ASSOC); |
| 1774 | 1878 | if (count($row) > 0) { |
| 1775 | 1879 | return $row['usage']; |
| 1776 | - } else return ''; |
|
| 1880 | + } else { |
|
| 1881 | + return ''; |
|
| 1882 | + } |
|
| 1777 | 1883 | } |
| 1778 | 1884 | |
| 1779 | 1885 | /** |
@@ -1797,7 +1903,9 @@ discard block |
||
| 1797 | 1903 | $row = $sth->fetch(PDO::FETCH_ASSOC); |
| 1798 | 1904 | if (count($row) > 0) { |
| 1799 | 1905 | return $row['icao']; |
| 1800 | - } else return ''; |
|
| 1906 | + } else { |
|
| 1907 | + return ''; |
|
| 1908 | + } |
|
| 1801 | 1909 | } |
| 1802 | 1910 | |
| 1803 | 1911 | /** |
@@ -1824,7 +1932,9 @@ discard block |
||
| 1824 | 1932 | $airport_longitude = $row['longitude']; |
| 1825 | 1933 | $Common = new Common(); |
| 1826 | 1934 | return $Common->distance($latitude,$longitude,$airport_latitude,$airport_longitude); |
| 1827 | - } else return ''; |
|
| 1935 | + } else { |
|
| 1936 | + return ''; |
|
| 1937 | + } |
|
| 1828 | 1938 | } |
| 1829 | 1939 | |
| 1830 | 1940 | /** |
@@ -1936,7 +2046,9 @@ discard block |
||
| 1936 | 2046 | $minlat = filter_var($coord[1],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
| 1937 | 2047 | $maxlong = filter_var($coord[2],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
| 1938 | 2048 | $maxlat = filter_var($coord[3],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
| 1939 | - } else return array(); |
|
| 2049 | + } else { |
|
| 2050 | + return array(); |
|
| 2051 | + } |
|
| 1940 | 2052 | if ($globalDBdriver == 'mysql') { |
| 1941 | 2053 | $query = "SELECT airport.* FROM airport WHERE airport.latitude BETWEEN ".$minlat." AND ".$maxlat." AND airport.longitude BETWEEN ".$minlong." AND ".$maxlong." AND airport.type != 'closed'"; |
| 1942 | 2054 | } else { |
@@ -1971,7 +2083,9 @@ discard block |
||
| 1971 | 2083 | $minlat = filter_var($coord[1],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
| 1972 | 2084 | $maxlong = filter_var($coord[2],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
| 1973 | 2085 | $maxlat = filter_var($coord[3],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
| 1974 | - } else return array(); |
|
| 2086 | + } else { |
|
| 2087 | + return array(); |
|
| 2088 | + } |
|
| 1975 | 2089 | //$query = "SELECT waypoints.* FROM waypoints WHERE waypoints.latitude_begin BETWEEN ".$minlat." AND ".$maxlat." AND waypoints.longitude_begin BETWEEN ".$minlong." AND ".$maxlong; |
| 1976 | 2090 | $query = "SELECT waypoints.* FROM waypoints WHERE (waypoints.latitude_begin BETWEEN ".$minlat." AND ".$maxlat." AND waypoints.longitude_begin BETWEEN ".$minlong." AND ".$maxlong.") OR (waypoints.latitude_end BETWEEN ".$minlat." AND ".$maxlat." AND waypoints.longitude_end BETWEEN ".$minlong." AND ".$maxlong.")"; |
| 1977 | 2091 | //$query = "SELECT waypoints.* FROM waypoints"; |
@@ -2006,7 +2120,9 @@ discard block |
||
| 2006 | 2120 | public function getAllAirlineInfo($airline_icao, $fromsource = NULL) |
| 2007 | 2121 | { |
| 2008 | 2122 | global $globalUseRealAirlines; |
| 2009 | - if (isset($globalUseRealAirlines) && $globalUseRealAirlines) $fromsource = NULL; |
|
| 2123 | + if (isset($globalUseRealAirlines) && $globalUseRealAirlines) { |
|
| 2124 | + $fromsource = NULL; |
|
| 2125 | + } |
|
| 2010 | 2126 | $airline_icao = strtoupper(filter_var($airline_icao,FILTER_SANITIZE_STRING)); |
| 2011 | 2127 | if ($airline_icao == 'NA') { |
| 2012 | 2128 | $airline_array = array(); |
@@ -2055,7 +2171,9 @@ discard block |
||
| 2055 | 2171 | $sth = $this->db->prepare($query); |
| 2056 | 2172 | $sth->execute(array(':fromsource' => $fromsource)); |
| 2057 | 2173 | $row = $sth->fetch(PDO::FETCH_ASSOC); |
| 2058 | - if ($row['nb'] == 0) $result = $this->getAllAirlineInfo($airline_icao); |
|
| 2174 | + if ($row['nb'] == 0) { |
|
| 2175 | + $result = $this->getAllAirlineInfo($airline_icao); |
|
| 2176 | + } |
|
| 2059 | 2177 | } |
| 2060 | 2178 | return $result; |
| 2061 | 2179 | } |
@@ -2119,15 +2237,20 @@ discard block |
||
| 2119 | 2237 | 'A320-211' => 'A320', |
| 2120 | 2238 | '747-8i' => 'B748', |
| 2121 | 2239 | 'A380' => 'A388'); |
| 2122 | - if (isset($all_aircraft[$aircraft_type])) return $all_aircraft[$aircraft_type]; |
|
| 2240 | + if (isset($all_aircraft[$aircraft_type])) { |
|
| 2241 | + return $all_aircraft[$aircraft_type]; |
|
| 2242 | + } |
|
| 2123 | 2243 | |
| 2124 | 2244 | $query = "SELECT aircraft.icao FROM aircraft WHERE aircraft.type LIKE :saircraft_type OR aircraft.type = :aircraft_type OR aircraft.icao = :aircraft_type LIMIT 1"; |
| 2125 | 2245 | $aircraft_type = strtoupper($aircraft_type); |
| 2126 | 2246 | $sth = $this->db->prepare($query); |
| 2127 | 2247 | $sth->execute(array(':saircraft_type' => '%'.$aircraft_type.'%',':aircraft_type' => $aircraft_type,)); |
| 2128 | 2248 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
| 2129 | - if (isset($result[0]['icao'])) return $result[0]['icao']; |
|
| 2130 | - else return ''; |
|
| 2249 | + if (isset($result[0]['icao'])) { |
|
| 2250 | + return $result[0]['icao']; |
|
| 2251 | + } else { |
|
| 2252 | + return ''; |
|
| 2253 | + } |
|
| 2131 | 2254 | } |
| 2132 | 2255 | |
| 2133 | 2256 | /** |
@@ -2149,7 +2272,9 @@ discard block |
||
| 2149 | 2272 | $row = $sth->fetch(PDO::FETCH_ASSOC); |
| 2150 | 2273 | if (isset($row['icaotypecode'])) { |
| 2151 | 2274 | return $row['icaotypecode']; |
| 2152 | - } else return ''; |
|
| 2275 | + } else { |
|
| 2276 | + return ''; |
|
| 2277 | + } |
|
| 2153 | 2278 | } |
| 2154 | 2279 | |
| 2155 | 2280 | /** |
@@ -2170,7 +2295,9 @@ discard block |
||
| 2170 | 2295 | $row = $sth->fetch(PDO::FETCH_ASSOC); |
| 2171 | 2296 | if (isset($row['operator_correct'])) { |
| 2172 | 2297 | return $row['operator_correct']; |
| 2173 | - } else return $operator; |
|
| 2298 | + } else { |
|
| 2299 | + return $operator; |
|
| 2300 | + } |
|
| 2174 | 2301 | } |
| 2175 | 2302 | |
| 2176 | 2303 | /** |
@@ -2183,7 +2310,9 @@ discard block |
||
| 2183 | 2310 | public function getRouteInfo($callsign) |
| 2184 | 2311 | { |
| 2185 | 2312 | $callsign = filter_var($callsign,FILTER_SANITIZE_STRING); |
| 2186 | - if ($callsign == '') return array(); |
|
| 2313 | + if ($callsign == '') { |
|
| 2314 | + return array(); |
|
| 2315 | + } |
|
| 2187 | 2316 | $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"; |
| 2188 | 2317 | |
| 2189 | 2318 | $sth = $this->db->prepare($query); |
@@ -2192,7 +2321,9 @@ discard block |
||
| 2192 | 2321 | $row = $sth->fetch(PDO::FETCH_ASSOC); |
| 2193 | 2322 | if (count($row) > 0) { |
| 2194 | 2323 | return $row; |
| 2195 | - } else return array(); |
|
| 2324 | + } else { |
|
| 2325 | + return array(); |
|
| 2326 | + } |
|
| 2196 | 2327 | } |
| 2197 | 2328 | |
| 2198 | 2329 | /** |
@@ -2244,7 +2375,9 @@ discard block |
||
| 2244 | 2375 | $sth->execute(array(':registration' => $registration)); |
| 2245 | 2376 | |
| 2246 | 2377 | return $sth->fetch(PDO::FETCH_ASSOC); |
| 2247 | - } else return array(); |
|
| 2378 | + } else { |
|
| 2379 | + return array(); |
|
| 2380 | + } |
|
| 2248 | 2381 | } |
| 2249 | 2382 | |
| 2250 | 2383 | |
@@ -2400,8 +2533,11 @@ discard block |
||
| 2400 | 2533 | $query .= " ORDER BY spotter_output.source_name ASC"; |
| 2401 | 2534 | |
| 2402 | 2535 | $sth = $this->db->prepare($query); |
| 2403 | - if (!empty($query_values)) $sth->execute($query_values); |
|
| 2404 | - else $sth->execute(); |
|
| 2536 | + if (!empty($query_values)) { |
|
| 2537 | + $sth->execute($query_values); |
|
| 2538 | + } else { |
|
| 2539 | + $sth->execute(); |
|
| 2540 | + } |
|
| 2405 | 2541 | |
| 2406 | 2542 | $source_array = array(); |
| 2407 | 2543 | $temp_array = array(); |
@@ -2433,9 +2569,13 @@ discard block |
||
| 2433 | 2569 | WHERE spotter_output.airline_icao <> '' |
| 2434 | 2570 | ORDER BY spotter_output.airline_name ASC"; |
| 2435 | 2571 | */ |
| 2436 | - if (isset($globalAirlinesSource) && $globalAirlinesSource != '') $forsource = $globalAirlinesSource; |
|
| 2437 | - elseif (isset($globalVATSIM) && $globalVATSIM) $forsource = 'vatsim'; |
|
| 2438 | - elseif (isset($globalIVAO) && $globalIVAO) $forsource = 'ivao'; |
|
| 2572 | + if (isset($globalAirlinesSource) && $globalAirlinesSource != '') { |
|
| 2573 | + $forsource = $globalAirlinesSource; |
|
| 2574 | + } elseif (isset($globalVATSIM) && $globalVATSIM) { |
|
| 2575 | + $forsource = 'vatsim'; |
|
| 2576 | + } elseif (isset($globalIVAO) && $globalIVAO) { |
|
| 2577 | + $forsource = 'ivao'; |
|
| 2578 | + } |
|
| 2439 | 2579 | if ($forsource === NULL) { |
| 2440 | 2580 | $query = "SELECT DISTINCT icao AS airline_icao, name AS airline_name, type AS airline_type FROM airlines WHERE forsource IS NULL ORDER BY name ASC"; |
| 2441 | 2581 | $query_data = array(); |
@@ -2733,7 +2873,9 @@ discard block |
||
| 2733 | 2873 | date_default_timezone_set($globalTimezone); |
| 2734 | 2874 | $datetime = new DateTime(); |
| 2735 | 2875 | $offset = $datetime->format('P'); |
| 2736 | - } else $offset = '+00:00'; |
|
| 2876 | + } else { |
|
| 2877 | + $offset = '+00:00'; |
|
| 2878 | + } |
|
| 2737 | 2879 | if ($airport_icao == '') { |
| 2738 | 2880 | if ($globalDBdriver == 'mysql') { |
| 2739 | 2881 | $query = "SELECT COUNT(departure_airport_icao) AS departure_airport_count, departure_airport_icao, departure_airport_name, departure_airport_city, departure_airport_country, DATE_FORMAT(DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)),'%Y-%m-%d') as date FROM `spotter_output` WHERE spotter_output.date >= DATE_SUB(UTC_TIMESTAMP(), INTERVAL 7 DAY) AND departure_airport_icao <> 'NA' GROUP BY departure_airport_icao, DATE_FORMAT(DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)),'%Y-%m-%d'), departure_airport_name, departure_airport_city, departure_airport_country ORDER BY departure_airport_count DESC"; |
@@ -2765,7 +2907,9 @@ discard block |
||
| 2765 | 2907 | date_default_timezone_set($globalTimezone); |
| 2766 | 2908 | $datetime = new DateTime(); |
| 2767 | 2909 | $offset = $datetime->format('P'); |
| 2768 | - } else $offset = '+00:00'; |
|
| 2910 | + } else { |
|
| 2911 | + $offset = '+00:00'; |
|
| 2912 | + } |
|
| 2769 | 2913 | if ($airport_icao == '') { |
| 2770 | 2914 | if ($globalDBdriver == 'mysql') { |
| 2771 | 2915 | $query = "SELECT spotter_output.airline_icao, COUNT(departure_airport_icao) AS departure_airport_count, departure_airport_icao, departure_airport_name, departure_airport_city, departure_airport_country, DATE_FORMAT(DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)),'%Y-%m-%d') as date FROM `spotter_output` WHERE spotter_output.date >= DATE_SUB(UTC_TIMESTAMP(), INTERVAL 7 DAY) AND departure_airport_icao <> 'NA' AND spotter_output.airline_icao <> '' GROUP BY spotter_output.airline_icao, departure_airport_icao, DATE_FORMAT(DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)),'%Y-%m-%d'), departure_airport_name, departure_airport_city, departure_airport_country ORDER BY departure_airport_count DESC"; |
@@ -2797,7 +2941,9 @@ discard block |
||
| 2797 | 2941 | date_default_timezone_set($globalTimezone); |
| 2798 | 2942 | $datetime = new DateTime(); |
| 2799 | 2943 | $offset = $datetime->format('P'); |
| 2800 | - } else $offset = '+00:00'; |
|
| 2944 | + } else { |
|
| 2945 | + $offset = '+00:00'; |
|
| 2946 | + } |
|
| 2801 | 2947 | if ($airport_icao == '') { |
| 2802 | 2948 | if ($globalDBdriver == 'mysql') { |
| 2803 | 2949 | $query = "SELECT COUNT(real_departure_airport_icao) AS departure_airport_count, real_departure_airport_icao AS departure_airport_icao, airport.name AS departure_airport_name, airport.city AS departure_airport_city, airport.country AS departure_airport_country, DATE_FORMAT(DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)),'%Y-%m-%d') as date |
@@ -2840,7 +2986,9 @@ discard block |
||
| 2840 | 2986 | date_default_timezone_set($globalTimezone); |
| 2841 | 2987 | $datetime = new DateTime(); |
| 2842 | 2988 | $offset = $datetime->format('P'); |
| 2843 | - } else $offset = '+00:00'; |
|
| 2989 | + } else { |
|
| 2990 | + $offset = '+00:00'; |
|
| 2991 | + } |
|
| 2844 | 2992 | if ($airport_icao == '') { |
| 2845 | 2993 | if ($globalDBdriver == 'mysql') { |
| 2846 | 2994 | $query = "SELECT spotter_output.airline_icao, COUNT(real_departure_airport_icao) AS departure_airport_count, real_departure_airport_icao AS departure_airport_icao, airport.name AS departure_airport_name, airport.city AS departure_airport_city, airport.country AS departure_airport_country, DATE_FORMAT(DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)),'%Y-%m-%d') as date |
@@ -2884,7 +3032,9 @@ discard block |
||
| 2884 | 3032 | date_default_timezone_set($globalTimezone); |
| 2885 | 3033 | $datetime = new DateTime(); |
| 2886 | 3034 | $offset = $datetime->format('P'); |
| 2887 | - } else $offset = '+00:00'; |
|
| 3035 | + } else { |
|
| 3036 | + $offset = '+00:00'; |
|
| 3037 | + } |
|
| 2888 | 3038 | if ($airport_icao == '') { |
| 2889 | 3039 | if ($globalDBdriver == 'mysql') { |
| 2890 | 3040 | $query = "SELECT COUNT(arrival_airport_icao) AS arrival_airport_count, arrival_airport_icao, arrival_airport_name, arrival_airport_city, arrival_airport_country, DATE_FORMAT(DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)),'%Y-%m-%d') as date FROM `spotter_output` WHERE spotter_output.date >= DATE_SUB(UTC_TIMESTAMP(), INTERVAL 7 DAY) AND arrival_airport_icao <> 'NA' GROUP BY arrival_airport_icao, DATE_FORMAT(DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)),'%Y-%m-%d'), arrival_airport_name, arrival_airport_city, arrival_airport_country ORDER BY arrival_airport_count DESC"; |
@@ -2918,7 +3068,9 @@ discard block |
||
| 2918 | 3068 | date_default_timezone_set($globalTimezone); |
| 2919 | 3069 | $datetime = new DateTime(); |
| 2920 | 3070 | $offset = $datetime->format('P'); |
| 2921 | - } else $offset = '+00:00'; |
|
| 3071 | + } else { |
|
| 3072 | + $offset = '+00:00'; |
|
| 3073 | + } |
|
| 2922 | 3074 | if ($airport_icao == '') { |
| 2923 | 3075 | if ($globalDBdriver == 'mysql') { |
| 2924 | 3076 | $query = "SELECT COUNT(real_arrival_airport_icao) AS arrival_airport_count, real_arrival_airport_icao AS arrival_airport_icao, airport.name AS arrival_airport_name, airport.city AS arrival_airport_city, airport.country AS arrival_airport_country, DATE_FORMAT(DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)),'%Y-%m-%d') as date |
@@ -2964,7 +3116,9 @@ discard block |
||
| 2964 | 3116 | date_default_timezone_set($globalTimezone); |
| 2965 | 3117 | $datetime = new DateTime(); |
| 2966 | 3118 | $offset = $datetime->format('P'); |
| 2967 | - } else $offset = '+00:00'; |
|
| 3119 | + } else { |
|
| 3120 | + $offset = '+00:00'; |
|
| 3121 | + } |
|
| 2968 | 3122 | if ($airport_icao == '') { |
| 2969 | 3123 | if ($globalDBdriver == 'mysql') { |
| 2970 | 3124 | $query = "SELECT spotter_output.airline_icao, COUNT(arrival_airport_icao) AS arrival_airport_count, arrival_airport_icao, arrival_airport_name, arrival_airport_city, arrival_airport_country, DATE_FORMAT(DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)),'%Y-%m-%d') as date FROM `spotter_output` WHERE spotter_output.date >= DATE_SUB(UTC_TIMESTAMP(), INTERVAL 7 DAY) AND arrival_airport_icao <> 'NA' AND spotter_output.airline_icao <> '' GROUP BY spotter_output.airline_icao, arrival_airport_icao, DATE_FORMAT(DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)),'%Y-%m-%d'), arrival_airport_name, arrival_airport_city, arrival_airport_country ORDER BY arrival_airport_count DESC"; |
@@ -2998,7 +3152,9 @@ discard block |
||
| 2998 | 3152 | date_default_timezone_set($globalTimezone); |
| 2999 | 3153 | $datetime = new DateTime(); |
| 3000 | 3154 | $offset = $datetime->format('P'); |
| 3001 | - } else $offset = '+00:00'; |
|
| 3155 | + } else { |
|
| 3156 | + $offset = '+00:00'; |
|
| 3157 | + } |
|
| 3002 | 3158 | if ($airport_icao == '') { |
| 3003 | 3159 | if ($globalDBdriver == 'mysql') { |
| 3004 | 3160 | $query = "SELECT spotter_output.airline_icao, COUNT(real_arrival_airport_icao) AS arrival_airport_count, real_arrival_airport_icao AS arrival_airport_icao, airport.name AS arrival_airport_name, airport.city AS arrival_airport_city, airport.country AS arrival_airport_country, DATE_FORMAT(DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)),'%Y-%m-%d') as date |
@@ -3046,7 +3202,9 @@ discard block |
||
| 3046 | 3202 | date_default_timezone_set($globalTimezone); |
| 3047 | 3203 | $datetime = new DateTime(); |
| 3048 | 3204 | $offset = $datetime->format('P'); |
| 3049 | - } else $offset = '+00:00'; |
|
| 3205 | + } else { |
|
| 3206 | + $offset = '+00:00'; |
|
| 3207 | + } |
|
| 3050 | 3208 | |
| 3051 | 3209 | if ($globalDBdriver == 'mysql') { |
| 3052 | 3210 | $query = "SELECT DISTINCT DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) as date |
@@ -3166,7 +3324,9 @@ discard block |
||
| 3166 | 3324 | */ |
| 3167 | 3325 | public function updateLatestSpotterData($flightaware_id = '', $ident = '', $latitude = '', $longitude = '', $altitude = '', $ground = false, $groundspeed = NULL, $date = '', $arrival_airport_icao = '',$arrival_airport_time = '') |
| 3168 | 3326 | { |
| 3169 | - if ($groundspeed == '') $groundspeed = NULL; |
|
| 3327 | + if ($groundspeed == '') { |
|
| 3328 | + $groundspeed = NULL; |
|
| 3329 | + } |
|
| 3170 | 3330 | $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'; |
| 3171 | 3331 | $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); |
| 3172 | 3332 | |
@@ -3216,10 +3376,18 @@ discard block |
||
| 3216 | 3376 | $Image = new Image($this->db); |
| 3217 | 3377 | $Common = new Common(); |
| 3218 | 3378 | |
| 3219 | - if (!isset($globalIVAO)) $globalIVAO = FALSE; |
|
| 3220 | - if (!isset($globalVATSIM)) $globalVATSIM = FALSE; |
|
| 3221 | - if (!isset($globalphpVMS)) $globalphpVMS = FALSE; |
|
| 3222 | - if (!isset($globalVAM)) $globalVAM = FALSE; |
|
| 3379 | + if (!isset($globalIVAO)) { |
|
| 3380 | + $globalIVAO = FALSE; |
|
| 3381 | + } |
|
| 3382 | + if (!isset($globalVATSIM)) { |
|
| 3383 | + $globalVATSIM = FALSE; |
|
| 3384 | + } |
|
| 3385 | + if (!isset($globalphpVMS)) { |
|
| 3386 | + $globalphpVMS = FALSE; |
|
| 3387 | + } |
|
| 3388 | + if (!isset($globalVAM)) { |
|
| 3389 | + $globalVAM = FALSE; |
|
| 3390 | + } |
|
| 3223 | 3391 | date_default_timezone_set('UTC'); |
| 3224 | 3392 | |
| 3225 | 3393 | //getting the registration |
@@ -3232,23 +3400,33 @@ discard block |
||
| 3232 | 3400 | if ($ModeS != '') { |
| 3233 | 3401 | $timeelapsed = microtime(true); |
| 3234 | 3402 | $registration = $this->getAircraftRegistrationBymodeS($ModeS); |
| 3235 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftRegistrationBymodes : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3403 | + if ($globalDebugTimeElapsed) { |
|
| 3404 | + echo 'ADD SPOTTER DATA : Time elapsed for getAircraftRegistrationBymodes : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3405 | + } |
|
| 3236 | 3406 | } else { |
| 3237 | 3407 | $myhex = explode('-',$flightaware_id); |
| 3238 | 3408 | if (count($myhex) > 0) { |
| 3239 | 3409 | $timeelapsed = microtime(true); |
| 3240 | 3410 | $registration = $this->getAircraftRegistrationBymodeS($myhex[0]); |
| 3241 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftRegistrationBymodes : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3411 | + if ($globalDebugTimeElapsed) { |
|
| 3412 | + echo 'ADD SPOTTER DATA : Time elapsed for getAircraftRegistrationBymodes : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3413 | + } |
|
| 3242 | 3414 | } |
| 3243 | 3415 | } |
| 3244 | 3416 | } |
| 3245 | 3417 | } |
| 3246 | 3418 | $fromsource = NULL; |
| 3247 | - if (isset($globalAirlinesSource) && $globalAirlinesSource != '') $fromsource = $globalAirlinesSource; |
|
| 3248 | - elseif ($format_source == 'vatsimtxt') $fromsource = 'vatsim'; |
|
| 3249 | - elseif ($format_source == 'whazzup') $fromsource = 'ivao'; |
|
| 3250 | - elseif (isset($globalVATSIM) && $globalVATSIM) $fromsource = 'vatsim'; |
|
| 3251 | - elseif (isset($globalIVAO) && $globalIVAO) $fromsource = 'ivao'; |
|
| 3419 | + if (isset($globalAirlinesSource) && $globalAirlinesSource != '') { |
|
| 3420 | + $fromsource = $globalAirlinesSource; |
|
| 3421 | + } elseif ($format_source == 'vatsimtxt') { |
|
| 3422 | + $fromsource = 'vatsim'; |
|
| 3423 | + } elseif ($format_source == 'whazzup') { |
|
| 3424 | + $fromsource = 'ivao'; |
|
| 3425 | + } elseif (isset($globalVATSIM) && $globalVATSIM) { |
|
| 3426 | + $fromsource = 'vatsim'; |
|
| 3427 | + } elseif (isset($globalIVAO) && $globalIVAO) { |
|
| 3428 | + $fromsource = 'ivao'; |
|
| 3429 | + } |
|
| 3252 | 3430 | //getting the airline information |
| 3253 | 3431 | if ($ident != "") |
| 3254 | 3432 | { |
@@ -3272,15 +3450,21 @@ discard block |
||
| 3272 | 3450 | if (!isset($airline_array[0]['icao']) || $airline_array[0]['icao'] == ""){ |
| 3273 | 3451 | $airline_array = $this->getAllAirlineInfo("NA"); |
| 3274 | 3452 | } |
| 3275 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAirlineInfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3453 | + if ($globalDebugTimeElapsed) { |
|
| 3454 | + echo 'ADD SPOTTER DATA : Time elapsed for getAirlineInfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3455 | + } |
|
| 3276 | 3456 | |
| 3277 | 3457 | } else { |
| 3278 | 3458 | $timeelapsed = microtime(true); |
| 3279 | 3459 | $airline_array = $this->getAllAirlineInfo("NA"); |
| 3280 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAirlineInfo(NA) : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3460 | + if ($globalDebugTimeElapsed) { |
|
| 3461 | + echo 'ADD SPOTTER DATA : Time elapsed for getAirlineInfo(NA) : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3462 | + } |
|
| 3281 | 3463 | } |
| 3282 | 3464 | } |
| 3283 | - } else $airline_array = array(); |
|
| 3465 | + } else { |
|
| 3466 | + $airline_array = array(); |
|
| 3467 | + } |
|
| 3284 | 3468 | |
| 3285 | 3469 | //getting the aircraft information |
| 3286 | 3470 | $aircraft_array = array(); |
@@ -3294,27 +3478,37 @@ discard block |
||
| 3294 | 3478 | { |
| 3295 | 3479 | $timeelapsed = microtime(true); |
| 3296 | 3480 | $aircraft_array = $this->getAllAircraftInfo("NA"); |
| 3297 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo(NA) : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3481 | + if ($globalDebugTimeElapsed) { |
|
| 3482 | + echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo(NA) : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3483 | + } |
|
| 3298 | 3484 | } else { |
| 3299 | 3485 | $timeelapsed = microtime(true); |
| 3300 | 3486 | $aircraft_array = $this->getAllAircraftInfo($aircraft_icao); |
| 3301 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3487 | + if ($globalDebugTimeElapsed) { |
|
| 3488 | + echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3489 | + } |
|
| 3302 | 3490 | } |
| 3303 | 3491 | } |
| 3304 | 3492 | } else { |
| 3305 | 3493 | if ($ModeS != '') { |
| 3306 | 3494 | $timeelapsed = microtime(true); |
| 3307 | 3495 | $aircraft_icao = $this->getAllAircraftType($ModeS); |
| 3308 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAllAircraftType : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3496 | + if ($globalDebugTimeElapsed) { |
|
| 3497 | + echo 'ADD SPOTTER DATA : Time elapsed for getAllAircraftType : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3498 | + } |
|
| 3309 | 3499 | if ($aircraft_icao == "" || $aircraft_icao == "XXXX") |
| 3310 | 3500 | { |
| 3311 | 3501 | $timeelapsed = microtime(true); |
| 3312 | 3502 | $aircraft_array = $this->getAllAircraftInfo("NA"); |
| 3313 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo(NA) : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3503 | + if ($globalDebugTimeElapsed) { |
|
| 3504 | + echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo(NA) : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3505 | + } |
|
| 3314 | 3506 | } else { |
| 3315 | 3507 | $timeelapsed = microtime(true); |
| 3316 | 3508 | $aircraft_array = $this->getAllAircraftInfo($aircraft_icao); |
| 3317 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3509 | + if ($globalDebugTimeElapsed) { |
|
| 3510 | + echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3511 | + } |
|
| 3318 | 3512 | } |
| 3319 | 3513 | } |
| 3320 | 3514 | } |
@@ -3329,7 +3523,9 @@ discard block |
||
| 3329 | 3523 | } else { |
| 3330 | 3524 | $timeelapsed = microtime(true); |
| 3331 | 3525 | $departure_airport_array = $this->getAllAirportInfo($departure_airport_icao); |
| 3332 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAllAirportInfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3526 | + if ($globalDebugTimeElapsed) { |
|
| 3527 | + echo 'ADD SPOTTER DATA : Time elapsed for getAllAirportInfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3528 | + } |
|
| 3333 | 3529 | } |
| 3334 | 3530 | } |
| 3335 | 3531 | |
@@ -3343,7 +3539,9 @@ discard block |
||
| 3343 | 3539 | } else { |
| 3344 | 3540 | $timeelapsed = microtime(true); |
| 3345 | 3541 | $arrival_airport_array = $this->getAllAirportInfo($arrival_airport_icao); |
| 3346 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAllAirportInfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3542 | + if ($globalDebugTimeElapsed) { |
|
| 3543 | + echo 'ADD SPOTTER DATA : Time elapsed for getAllAirportInfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3544 | + } |
|
| 3347 | 3545 | } |
| 3348 | 3546 | } |
| 3349 | 3547 | |
@@ -3378,7 +3576,9 @@ discard block |
||
| 3378 | 3576 | { |
| 3379 | 3577 | return false; |
| 3380 | 3578 | } |
| 3381 | - } else $altitude = 0; |
|
| 3579 | + } else { |
|
| 3580 | + $altitude = 0; |
|
| 3581 | + } |
|
| 3382 | 3582 | |
| 3383 | 3583 | if ($heading != "") |
| 3384 | 3584 | { |
@@ -3407,7 +3607,9 @@ discard block |
||
| 3407 | 3607 | { |
| 3408 | 3608 | $timeelapsed = microtime(true); |
| 3409 | 3609 | $image_array = $Image->getSpotterImage($registration); |
| 3410 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getSpotterImage : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3610 | + if ($globalDebugTimeElapsed) { |
|
| 3611 | + echo 'ADD SPOTTER DATA : Time elapsed for getSpotterImage : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3612 | + } |
|
| 3411 | 3613 | if (!isset($image_array[0]['registration'])) |
| 3412 | 3614 | { |
| 3413 | 3615 | //echo "Add image !!!! \n"; |
@@ -3415,14 +3617,21 @@ discard block |
||
| 3415 | 3617 | } |
| 3416 | 3618 | $timeelapsed = microtime(true); |
| 3417 | 3619 | $owner_info = $this->getAircraftOwnerByRegistration($registration); |
| 3418 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftOwnerByRegistration : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3419 | - if ($owner_info['owner'] != '') $aircraft_owner = ucwords(strtolower($owner_info['owner'])); |
|
| 3620 | + if ($globalDebugTimeElapsed) { |
|
| 3621 | + echo 'ADD SPOTTER DATA : Time elapsed for getAircraftOwnerByRegistration : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3622 | + } |
|
| 3623 | + if ($owner_info['owner'] != '') { |
|
| 3624 | + $aircraft_owner = ucwords(strtolower($owner_info['owner'])); |
|
| 3625 | + } |
|
| 3420 | 3626 | } |
| 3421 | 3627 | |
| 3422 | 3628 | if ($globalIVAO && $aircraft_icao != '') |
| 3423 | 3629 | { |
| 3424 | - if (isset($airline_array[0]['icao'])) $airline_icao = $airline_array[0]['icao']; |
|
| 3425 | - else $airline_icao = ''; |
|
| 3630 | + if (isset($airline_array[0]['icao'])) { |
|
| 3631 | + $airline_icao = $airline_array[0]['icao']; |
|
| 3632 | + } else { |
|
| 3633 | + $airline_icao = ''; |
|
| 3634 | + } |
|
| 3426 | 3635 | $image_array = $Image->getSpotterImage('',$aircraft_icao,$airline_icao); |
| 3427 | 3636 | if (!isset($image_array[0]['registration'])) |
| 3428 | 3637 | { |
@@ -3467,12 +3676,24 @@ discard block |
||
| 3467 | 3676 | { |
| 3468 | 3677 | $arrival_airport_array = $this->getAllAirportInfo('NA'); |
| 3469 | 3678 | } |
| 3470 | - if ($registration == '') $registration = 'NA'; |
|
| 3471 | - if ($squawk == '' || $Common->isInteger($squawk) === false) $squawk = NULL; |
|
| 3472 | - if ($verticalrate == '' || $Common->isInteger($verticalrate) === false) $verticalrate = NULL; |
|
| 3473 | - if ($heading == '' || $Common->isInteger($heading) === false) $heading = 0; |
|
| 3474 | - if ($groundspeed == '' || $Common->isInteger($groundspeed) === false) $groundspeed = 0; |
|
| 3475 | - if (!isset($aircraft_owner)) $aircraft_owner = NULL; |
|
| 3679 | + if ($registration == '') { |
|
| 3680 | + $registration = 'NA'; |
|
| 3681 | + } |
|
| 3682 | + if ($squawk == '' || $Common->isInteger($squawk) === false) { |
|
| 3683 | + $squawk = NULL; |
|
| 3684 | + } |
|
| 3685 | + if ($verticalrate == '' || $Common->isInteger($verticalrate) === false) { |
|
| 3686 | + $verticalrate = NULL; |
|
| 3687 | + } |
|
| 3688 | + if ($heading == '' || $Common->isInteger($heading) === false) { |
|
| 3689 | + $heading = 0; |
|
| 3690 | + } |
|
| 3691 | + if ($groundspeed == '' || $Common->isInteger($groundspeed) === false) { |
|
| 3692 | + $groundspeed = 0; |
|
| 3693 | + } |
|
| 3694 | + if (!isset($aircraft_owner)) { |
|
| 3695 | + $aircraft_owner = NULL; |
|
| 3696 | + } |
|
| 3476 | 3697 | $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) |
| 3477 | 3698 | 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)"; |
| 3478 | 3699 | |
@@ -3483,9 +3704,13 @@ discard block |
||
| 3483 | 3704 | if ($airline_type == '') { |
| 3484 | 3705 | $timeelapsed = microtime(true); |
| 3485 | 3706 | $airline_type = $this->getAircraftTypeBymodeS($ModeS); |
| 3486 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftTypeBymodes : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3707 | + if ($globalDebugTimeElapsed) { |
|
| 3708 | + echo 'ADD SPOTTER DATA : Time elapsed for getAircraftTypeBymodes : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3709 | + } |
|
| 3710 | + } |
|
| 3711 | + if ($airline_type == null) { |
|
| 3712 | + $airline_type = ''; |
|
| 3487 | 3713 | } |
| 3488 | - if ($airline_type == null) $airline_type = ''; |
|
| 3489 | 3714 | $aircraft_type = $aircraft_array[0]['type']; |
| 3490 | 3715 | $aircraft_manufacturer = $aircraft_array[0]['manufacturer']; |
| 3491 | 3716 | $departure_airport_name = $departure_airport_array[0]['name']; |
@@ -3620,7 +3845,9 @@ discard block |
||
| 3620 | 3845 | } |
| 3621 | 3846 | } |
| 3622 | 3847 | $query .= "GROUP BY spotter_output.airline_name,spotter_output.airline_icao, spotter_output.airline_country ORDER BY airline_count DESC"; |
| 3623 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
| 3848 | + if ($limit) { |
|
| 3849 | + $query .= " LIMIT 10 OFFSET 0"; |
|
| 3850 | + } |
|
| 3624 | 3851 | |
| 3625 | 3852 | $sth = $this->db->prepare($query); |
| 3626 | 3853 | $sth->execute(); |
@@ -3665,7 +3892,9 @@ discard block |
||
| 3665 | 3892 | } |
| 3666 | 3893 | } |
| 3667 | 3894 | $query .= "GROUP BY spotter_output.pilot_id,spotter_output.pilot_name ORDER BY pilot_count DESC"; |
| 3668 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
| 3895 | + if ($limit) { |
|
| 3896 | + $query .= " LIMIT 10 OFFSET 0"; |
|
| 3897 | + } |
|
| 3669 | 3898 | |
| 3670 | 3899 | |
| 3671 | 3900 | $sth = $this->db->prepare($query); |
@@ -3710,7 +3939,9 @@ discard block |
||
| 3710 | 3939 | } |
| 3711 | 3940 | } |
| 3712 | 3941 | $query .= "GROUP BY spotter_output.airline_icao, spotter_output.pilot_id,spotter_output.pilot_name ORDER BY pilot_count DESC"; |
| 3713 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
| 3942 | + if ($limit) { |
|
| 3943 | + $query .= " LIMIT 10 OFFSET 0"; |
|
| 3944 | + } |
|
| 3714 | 3945 | |
| 3715 | 3946 | |
| 3716 | 3947 | $sth = $this->db->prepare($query); |
@@ -3757,7 +3988,9 @@ discard block |
||
| 3757 | 3988 | } |
| 3758 | 3989 | } |
| 3759 | 3990 | $query .= "GROUP BY spotter_output.owner_name ORDER BY owner_count DESC"; |
| 3760 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
| 3991 | + if ($limit) { |
|
| 3992 | + $query .= " LIMIT 10 OFFSET 0"; |
|
| 3993 | + } |
|
| 3761 | 3994 | |
| 3762 | 3995 | |
| 3763 | 3996 | $sth = $this->db->prepare($query); |
@@ -3801,7 +4034,9 @@ discard block |
||
| 3801 | 4034 | } |
| 3802 | 4035 | } |
| 3803 | 4036 | $query .= "GROUP BY spotter_output.airline_icao, spotter_output.owner_name ORDER BY owner_count DESC"; |
| 3804 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
| 4037 | + if ($limit) { |
|
| 4038 | + $query .= " LIMIT 10 OFFSET 0"; |
|
| 4039 | + } |
|
| 3805 | 4040 | |
| 3806 | 4041 | |
| 3807 | 4042 | $sth = $this->db->prepare($query); |
@@ -4050,7 +4285,9 @@ discard block |
||
| 4050 | 4285 | date_default_timezone_set($globalTimezone); |
| 4051 | 4286 | $datetime = new DateTime($date); |
| 4052 | 4287 | $offset = $datetime->format('P'); |
| 4053 | - } else $offset = '+00:00'; |
|
| 4288 | + } else { |
|
| 4289 | + $offset = '+00:00'; |
|
| 4290 | + } |
|
| 4054 | 4291 | |
| 4055 | 4292 | if ($globalDBdriver == 'mysql') { |
| 4056 | 4293 | $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
@@ -4099,7 +4336,9 @@ discard block |
||
| 4099 | 4336 | date_default_timezone_set($globalTimezone); |
| 4100 | 4337 | $datetime = new DateTime($date); |
| 4101 | 4338 | $offset = $datetime->format('P'); |
| 4102 | - } else $offset = '+00:00'; |
|
| 4339 | + } else { |
|
| 4340 | + $offset = '+00:00'; |
|
| 4341 | + } |
|
| 4103 | 4342 | |
| 4104 | 4343 | if ($globalDBdriver == 'mysql') { |
| 4105 | 4344 | $query = "SELECT DISTINCT spotter_output.airline_country, COUNT(spotter_output.airline_country) AS airline_country_count |
@@ -4322,7 +4561,9 @@ discard block |
||
| 4322 | 4561 | WHERE spotter_output.airline_country <> '' AND spotter_output.airline_country <> 'NA' |
| 4323 | 4562 | GROUP BY spotter_output.airline_country |
| 4324 | 4563 | ORDER BY airline_country_count DESC"; |
| 4325 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
| 4564 | + if ($limit) { |
|
| 4565 | + $query .= " LIMIT 10 OFFSET 0"; |
|
| 4566 | + } |
|
| 4326 | 4567 | |
| 4327 | 4568 | $sth = $this->db->prepare($query); |
| 4328 | 4569 | $sth->execute(); |
@@ -4349,7 +4590,9 @@ discard block |
||
| 4349 | 4590 | { |
| 4350 | 4591 | global $globalDBdriver; |
| 4351 | 4592 | $Connection= new Connection($this->db); |
| 4352 | - if (!$Connection->tableExists('countries')) return array(); |
|
| 4593 | + if (!$Connection->tableExists('countries')) { |
|
| 4594 | + return array(); |
|
| 4595 | + } |
|
| 4353 | 4596 | /* |
| 4354 | 4597 | $query = "SELECT c.name, c.iso3, c.iso2, count(c.name) as nb |
| 4355 | 4598 | FROM countries c, spotter_output s |
@@ -4374,7 +4617,9 @@ discard block |
||
| 4374 | 4617 | } |
| 4375 | 4618 | |
| 4376 | 4619 | $query .= "GROUP BY c.name ORDER BY nb DESC"; |
| 4377 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
| 4620 | + if ($limit) { |
|
| 4621 | + $query .= " LIMIT 10 OFFSET 0"; |
|
| 4622 | + } |
|
| 4378 | 4623 | |
| 4379 | 4624 | |
| 4380 | 4625 | $sth = $this->db->prepare($query); |
@@ -4424,7 +4669,9 @@ discard block |
||
| 4424 | 4669 | } |
| 4425 | 4670 | |
| 4426 | 4671 | $query .= " GROUP BY spotter_output.aircraft_icao, spotter_output.aircraft_name, spotter_output.aircraft_manufacturer ORDER BY aircraft_icao_count DESC"; |
| 4427 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
| 4672 | + if ($limit) { |
|
| 4673 | + $query .= " LIMIT 10 OFFSET 0"; |
|
| 4674 | + } |
|
| 4428 | 4675 | |
| 4429 | 4676 | $sth = $this->db->prepare($query); |
| 4430 | 4677 | $sth->execute(); |
@@ -4470,7 +4717,9 @@ discard block |
||
| 4470 | 4717 | } |
| 4471 | 4718 | |
| 4472 | 4719 | $query .= "GROUP BY spotter_output.airline_icao, spotter_output.aircraft_icao, spotter_output.aircraft_name, spotter_output.aircraft_manufacturer ORDER BY aircraft_icao_count DESC"; |
| 4473 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
| 4720 | + if ($limit) { |
|
| 4721 | + $query .= " LIMIT 10 OFFSET 0"; |
|
| 4722 | + } |
|
| 4474 | 4723 | |
| 4475 | 4724 | $sth = $this->db->prepare($query); |
| 4476 | 4725 | $sth->execute(); |
@@ -4523,7 +4772,9 @@ discard block |
||
| 4523 | 4772 | if($row['registration'] != "") |
| 4524 | 4773 | { |
| 4525 | 4774 | $image_array = $Image->getSpotterImage($row['registration']); |
| 4526 | - if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
| 4775 | + if (isset($image_array[0]['image_thumbnail'])) { |
|
| 4776 | + $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
| 4777 | + } |
|
| 4527 | 4778 | } |
| 4528 | 4779 | $temp_array['registration_count'] = $row['registration_count']; |
| 4529 | 4780 | |
@@ -4599,7 +4850,9 @@ discard block |
||
| 4599 | 4850 | if($row['registration'] != "") |
| 4600 | 4851 | { |
| 4601 | 4852 | $image_array = $Image->getSpotterImage($row['registration']); |
| 4602 | - if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
| 4853 | + if (isset($image_array[0]['image_thumbnail'])) { |
|
| 4854 | + $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
| 4855 | + } |
|
| 4603 | 4856 | } |
| 4604 | 4857 | $temp_array['registration_count'] = $row['registration_count']; |
| 4605 | 4858 | |
@@ -4833,7 +5086,9 @@ discard block |
||
| 4833 | 5086 | date_default_timezone_set($globalTimezone); |
| 4834 | 5087 | $datetime = new DateTime($date); |
| 4835 | 5088 | $offset = $datetime->format('P'); |
| 4836 | - } else $offset = '+00:00'; |
|
| 5089 | + } else { |
|
| 5090 | + $offset = '+00:00'; |
|
| 5091 | + } |
|
| 4837 | 5092 | |
| 4838 | 5093 | if ($globalDBdriver == 'mysql') { |
| 4839 | 5094 | $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name |
@@ -4881,7 +5136,9 @@ discard block |
||
| 4881 | 5136 | date_default_timezone_set($globalTimezone); |
| 4882 | 5137 | $datetime = new DateTime($date); |
| 4883 | 5138 | $offset = $datetime->format('P'); |
| 4884 | - } else $offset = '+00:00'; |
|
| 5139 | + } else { |
|
| 5140 | + $offset = '+00:00'; |
|
| 5141 | + } |
|
| 4885 | 5142 | |
| 4886 | 5143 | if ($globalDBdriver == 'mysql') { |
| 4887 | 5144 | $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.registration) AS registration_count, spotter_output.aircraft_name, spotter_output.registration, spotter_output.airline_name |
@@ -4936,7 +5193,9 @@ discard block |
||
| 4936 | 5193 | date_default_timezone_set($globalTimezone); |
| 4937 | 5194 | $datetime = new DateTime($date); |
| 4938 | 5195 | $offset = $datetime->format('P'); |
| 4939 | - } else $offset = '+00:00'; |
|
| 5196 | + } else { |
|
| 5197 | + $offset = '+00:00'; |
|
| 5198 | + } |
|
| 4940 | 5199 | |
| 4941 | 5200 | if ($globalDBdriver == 'mysql') { |
| 4942 | 5201 | $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
@@ -5037,8 +5296,11 @@ discard block |
||
| 5037 | 5296 | if($row['registration'] != "") |
| 5038 | 5297 | { |
| 5039 | 5298 | $image_array = $Image->getSpotterImage($row['registration']); |
| 5040 | - if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
| 5041 | - else $temp_array['image_thumbnail'] = ''; |
|
| 5299 | + if (isset($image_array[0]['image_thumbnail'])) { |
|
| 5300 | + $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
| 5301 | + } else { |
|
| 5302 | + $temp_array['image_thumbnail'] = ''; |
|
| 5303 | + } |
|
| 5042 | 5304 | } |
| 5043 | 5305 | $temp_array['registration_count'] = $row['registration_count']; |
| 5044 | 5306 | $aircraft_array[] = $temp_array; |
@@ -5146,7 +5408,9 @@ discard block |
||
| 5146 | 5408 | if($row['registration'] != "") |
| 5147 | 5409 | { |
| 5148 | 5410 | $image_array = $Image->getSpotterImage($row['registration']); |
| 5149 | - if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
| 5411 | + if (isset($image_array[0]['image_thumbnail'])) { |
|
| 5412 | + $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
| 5413 | + } |
|
| 5150 | 5414 | } |
| 5151 | 5415 | $temp_array['registration_count'] = $row['registration_count']; |
| 5152 | 5416 | |
@@ -5265,7 +5529,9 @@ discard block |
||
| 5265 | 5529 | if($row['registration'] != "") |
| 5266 | 5530 | { |
| 5267 | 5531 | $image_array = $Image->getSpotterImage($row['registration']); |
| 5268 | - if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
| 5532 | + if (isset($image_array[0]['image_thumbnail'])) { |
|
| 5533 | + $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
| 5534 | + } |
|
| 5269 | 5535 | } |
| 5270 | 5536 | $temp_array['registration_count'] = $row['registration_count']; |
| 5271 | 5537 | |
@@ -5378,7 +5644,9 @@ discard block |
||
| 5378 | 5644 | // if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
| 5379 | 5645 | //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
| 5380 | 5646 | $query .= " GROUP BY spotter_output.registration, spotter_output.aircraft_icao, spotter_output.aircraft_name, spotter_output.airline_name ORDER BY aircraft_registration_count DESC"; |
| 5381 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
| 5647 | + if ($limit) { |
|
| 5648 | + $query .= " LIMIT 10 OFFSET 0"; |
|
| 5649 | + } |
|
| 5382 | 5650 | |
| 5383 | 5651 | $sth = $this->db->prepare($query); |
| 5384 | 5652 | $sth->execute(); |
@@ -5397,7 +5665,9 @@ discard block |
||
| 5397 | 5665 | if($row['registration'] != "") |
| 5398 | 5666 | { |
| 5399 | 5667 | $image_array = $Image->getSpotterImage($row['registration']); |
| 5400 | - if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
| 5668 | + if (isset($image_array[0]['image_thumbnail'])) { |
|
| 5669 | + $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
| 5670 | + } |
|
| 5401 | 5671 | } |
| 5402 | 5672 | |
| 5403 | 5673 | $aircraft_array[] = $temp_array; |
@@ -5438,7 +5708,9 @@ discard block |
||
| 5438 | 5708 | // if ($olderthanmonths > 0) $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
| 5439 | 5709 | //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
| 5440 | 5710 | $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"; |
| 5441 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
| 5711 | + if ($limit) { |
|
| 5712 | + $query .= " LIMIT 10 OFFSET 0"; |
|
| 5713 | + } |
|
| 5442 | 5714 | |
| 5443 | 5715 | $sth = $this->db->prepare($query); |
| 5444 | 5716 | $sth->execute(); |
@@ -5458,7 +5730,9 @@ discard block |
||
| 5458 | 5730 | if($row['registration'] != "") |
| 5459 | 5731 | { |
| 5460 | 5732 | $image_array = $Image->getSpotterImage($row['registration']); |
| 5461 | - if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
| 5733 | + if (isset($image_array[0]['image_thumbnail'])) { |
|
| 5734 | + $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
|
| 5735 | + } |
|
| 5462 | 5736 | } |
| 5463 | 5737 | |
| 5464 | 5738 | $aircraft_array[] = $temp_array; |
@@ -5499,7 +5773,9 @@ discard block |
||
| 5499 | 5773 | //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
| 5500 | 5774 | $query .= " GROUP BY spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country |
| 5501 | 5775 | ORDER BY airport_departure_icao_count DESC"; |
| 5502 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
| 5776 | + if ($limit) { |
|
| 5777 | + $query .= " LIMIT 10 OFFSET 0"; |
|
| 5778 | + } |
|
| 5503 | 5779 | |
| 5504 | 5780 | $sth = $this->db->prepare($query); |
| 5505 | 5781 | $sth->execute(); |
@@ -5551,7 +5827,9 @@ discard block |
||
| 5551 | 5827 | //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
| 5552 | 5828 | $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 |
| 5553 | 5829 | ORDER BY airport_departure_icao_count DESC"; |
| 5554 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
| 5830 | + if ($limit) { |
|
| 5831 | + $query .= " LIMIT 10 OFFSET 0"; |
|
| 5832 | + } |
|
| 5555 | 5833 | |
| 5556 | 5834 | $sth = $this->db->prepare($query); |
| 5557 | 5835 | $sth->execute(); |
@@ -5603,7 +5881,9 @@ discard block |
||
| 5603 | 5881 | //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
| 5604 | 5882 | $query .= " GROUP BY spotter_output.real_departure_airport_icao, airport.name, airport.city, airport.country |
| 5605 | 5883 | ORDER BY airport_departure_icao_count DESC"; |
| 5606 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
| 5884 | + if ($limit) { |
|
| 5885 | + $query .= " LIMIT 10 OFFSET 0"; |
|
| 5886 | + } |
|
| 5607 | 5887 | |
| 5608 | 5888 | $sth = $this->db->prepare($query); |
| 5609 | 5889 | $sth->execute(); |
@@ -5655,7 +5935,9 @@ discard block |
||
| 5655 | 5935 | //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
| 5656 | 5936 | $query .= "GROUP BY spotter_output.airline_icao, spotter_output.real_departure_airport_icao, airport.name, airport.city, airport.country |
| 5657 | 5937 | ORDER BY airport_departure_icao_count DESC"; |
| 5658 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
| 5938 | + if ($limit) { |
|
| 5939 | + $query .= " LIMIT 10 OFFSET 0"; |
|
| 5940 | + } |
|
| 5659 | 5941 | |
| 5660 | 5942 | $sth = $this->db->prepare($query); |
| 5661 | 5943 | $sth->execute(); |
@@ -6060,7 +6342,9 @@ discard block |
||
| 6060 | 6342 | date_default_timezone_set($globalTimezone); |
| 6061 | 6343 | $datetime = new DateTime($date); |
| 6062 | 6344 | $offset = $datetime->format('P'); |
| 6063 | - } else $offset = '+00:00'; |
|
| 6345 | + } else { |
|
| 6346 | + $offset = '+00:00'; |
|
| 6347 | + } |
|
| 6064 | 6348 | |
| 6065 | 6349 | if ($globalDBdriver == 'mysql') { |
| 6066 | 6350 | $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 |
@@ -6111,7 +6395,9 @@ discard block |
||
| 6111 | 6395 | date_default_timezone_set($globalTimezone); |
| 6112 | 6396 | $datetime = new DateTime($date); |
| 6113 | 6397 | $offset = $datetime->format('P'); |
| 6114 | - } else $offset = '+00:00'; |
|
| 6398 | + } else { |
|
| 6399 | + $offset = '+00:00'; |
|
| 6400 | + } |
|
| 6115 | 6401 | |
| 6116 | 6402 | if ($globalDBdriver == 'mysql') { |
| 6117 | 6403 | $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
@@ -6329,7 +6615,9 @@ discard block |
||
| 6329 | 6615 | //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
| 6330 | 6616 | $query .= " GROUP BY spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
| 6331 | 6617 | ORDER BY airport_arrival_icao_count DESC"; |
| 6332 | - if ($limit) $query .= " LIMIT 10"; |
|
| 6618 | + if ($limit) { |
|
| 6619 | + $query .= " LIMIT 10"; |
|
| 6620 | + } |
|
| 6333 | 6621 | |
| 6334 | 6622 | |
| 6335 | 6623 | $sth = $this->db->prepare($query); |
@@ -6349,7 +6637,9 @@ discard block |
||
| 6349 | 6637 | if ($icaoaskey) { |
| 6350 | 6638 | $icao = $row['arrival_airport_icao']; |
| 6351 | 6639 | $airport_array[$icao] = $temp_array; |
| 6352 | - } else $airport_array[] = $temp_array; |
|
| 6640 | + } else { |
|
| 6641 | + $airport_array[] = $temp_array; |
|
| 6642 | + } |
|
| 6353 | 6643 | } |
| 6354 | 6644 | |
| 6355 | 6645 | return $airport_array; |
@@ -6391,7 +6681,9 @@ discard block |
||
| 6391 | 6681 | //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
| 6392 | 6682 | $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 |
| 6393 | 6683 | ORDER BY airport_arrival_icao_count DESC"; |
| 6394 | - if ($limit) $query .= " LIMIT 10"; |
|
| 6684 | + if ($limit) { |
|
| 6685 | + $query .= " LIMIT 10"; |
|
| 6686 | + } |
|
| 6395 | 6687 | |
| 6396 | 6688 | |
| 6397 | 6689 | $sth = $this->db->prepare($query); |
@@ -6412,7 +6704,9 @@ discard block |
||
| 6412 | 6704 | if ($icaoaskey) { |
| 6413 | 6705 | $icao = $row['arrival_airport_icao']; |
| 6414 | 6706 | $airport_array[$icao] = $temp_array; |
| 6415 | - } else $airport_array[] = $temp_array; |
|
| 6707 | + } else { |
|
| 6708 | + $airport_array[] = $temp_array; |
|
| 6709 | + } |
|
| 6416 | 6710 | } |
| 6417 | 6711 | |
| 6418 | 6712 | return $airport_array; |
@@ -6454,7 +6748,9 @@ discard block |
||
| 6454 | 6748 | //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
| 6455 | 6749 | $query .= " GROUP BY spotter_output.real_arrival_airport_icao, airport.name, airport.city, airport.country |
| 6456 | 6750 | ORDER BY airport_arrival_icao_count DESC"; |
| 6457 | - if ($limit) $query .= " LIMIT 10"; |
|
| 6751 | + if ($limit) { |
|
| 6752 | + $query .= " LIMIT 10"; |
|
| 6753 | + } |
|
| 6458 | 6754 | |
| 6459 | 6755 | |
| 6460 | 6756 | $sth = $this->db->prepare($query); |
@@ -6474,7 +6770,9 @@ discard block |
||
| 6474 | 6770 | if ($icaoaskey) { |
| 6475 | 6771 | $icao = $row['arrival_airport_icao']; |
| 6476 | 6772 | $airport_array[$icao] = $temp_array; |
| 6477 | - } else $airport_array[] = $temp_array; |
|
| 6773 | + } else { |
|
| 6774 | + $airport_array[] = $temp_array; |
|
| 6775 | + } |
|
| 6478 | 6776 | } |
| 6479 | 6777 | |
| 6480 | 6778 | return $airport_array; |
@@ -6516,7 +6814,9 @@ discard block |
||
| 6516 | 6814 | //if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
| 6517 | 6815 | $query .= "GROUP BY spotter_output.airline_icao, spotter_output.real_arrival_airport_icao, airport.name, airport.city, airport.country |
| 6518 | 6816 | ORDER BY airport_arrival_icao_count DESC"; |
| 6519 | - if ($limit) $query .= " LIMIT 10"; |
|
| 6817 | + if ($limit) { |
|
| 6818 | + $query .= " LIMIT 10"; |
|
| 6819 | + } |
|
| 6520 | 6820 | |
| 6521 | 6821 | |
| 6522 | 6822 | $sth = $this->db->prepare($query); |
@@ -6537,7 +6837,9 @@ discard block |
||
| 6537 | 6837 | if ($icaoaskey) { |
| 6538 | 6838 | $icao = $row['arrival_airport_icao']; |
| 6539 | 6839 | $airport_array[$icao] = $temp_array; |
| 6540 | - } else $airport_array[] = $temp_array; |
|
| 6840 | + } else { |
|
| 6841 | + $airport_array[] = $temp_array; |
|
| 6842 | + } |
|
| 6541 | 6843 | } |
| 6542 | 6844 | |
| 6543 | 6845 | return $airport_array; |
@@ -6926,7 +7228,9 @@ discard block |
||
| 6926 | 7228 | date_default_timezone_set($globalTimezone); |
| 6927 | 7229 | $datetime = new DateTime($date); |
| 6928 | 7230 | $offset = $datetime->format('P'); |
| 6929 | - } else $offset = '+00:00'; |
|
| 7231 | + } else { |
|
| 7232 | + $offset = '+00:00'; |
|
| 7233 | + } |
|
| 6930 | 7234 | |
| 6931 | 7235 | if ($globalDBdriver == 'mysql') { |
| 6932 | 7236 | $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 |
@@ -6977,7 +7281,9 @@ discard block |
||
| 6977 | 7281 | date_default_timezone_set($globalTimezone); |
| 6978 | 7282 | $datetime = new DateTime($date); |
| 6979 | 7283 | $offset = $datetime->format('P'); |
| 6980 | - } else $offset = '+00:00'; |
|
| 7284 | + } else { |
|
| 7285 | + $offset = '+00:00'; |
|
| 7286 | + } |
|
| 6981 | 7287 | |
| 6982 | 7288 | if ($globalDBdriver == 'mysql') { |
| 6983 | 7289 | $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
@@ -7206,7 +7512,9 @@ discard block |
||
| 7206 | 7512 | FROM spotter_output".$filter_query." spotter_output.arrival_airport_country <> '' AND spotter_output.arrival_airport_icao <> 'NA'"; |
| 7207 | 7513 | $query .= " GROUP BY spotter_output.arrival_airport_country |
| 7208 | 7514 | ORDER BY airport_arrival_country_count DESC"; |
| 7209 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
| 7515 | + if ($limit) { |
|
| 7516 | + $query .= " LIMIT 10 OFFSET 0"; |
|
| 7517 | + } |
|
| 7210 | 7518 | |
| 7211 | 7519 | |
| 7212 | 7520 | $sth = $this->db->prepare($query); |
@@ -7501,7 +7809,9 @@ discard block |
||
| 7501 | 7809 | date_default_timezone_set($globalTimezone); |
| 7502 | 7810 | $datetime = new DateTime($date); |
| 7503 | 7811 | $offset = $datetime->format('P'); |
| 7504 | - } else $offset = '+00:00'; |
|
| 7812 | + } else { |
|
| 7813 | + $offset = '+00:00'; |
|
| 7814 | + } |
|
| 7505 | 7815 | |
| 7506 | 7816 | if ($globalDBdriver == 'mysql') { |
| 7507 | 7817 | $query = "SELECT DISTINCT concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao) AS route, count(concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao)) AS route_count, spotter_output.departure_airport_icao, spotter_output.departure_airport_name AS airport_departure_name, spotter_output.departure_airport_city AS airport_departure_city, spotter_output.departure_airport_country AS airport_departure_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name AS airport_arrival_name, spotter_output.arrival_airport_city AS airport_arrival_city, spotter_output.arrival_airport_country AS airport_arrival_country |
@@ -7684,15 +7994,23 @@ discard block |
||
| 7684 | 7994 | $query = "SELECT DISTINCT spotter_output.ident, COUNT(spotter_output.ident) AS callsign_icao_count, spotter_output.airline_name, spotter_output.airline_icao |
| 7685 | 7995 | FROM spotter_output".$filter_query." spotter_output.ident <> '' "; |
| 7686 | 7996 | if ($olderthanmonths > 0) { |
| 7687 | - if ($globalDBdriver == 'mysql') $query .= ' AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH)'; |
|
| 7688 | - else $query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
|
| 7997 | + if ($globalDBdriver == 'mysql') { |
|
| 7998 | + $query .= ' AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH)'; |
|
| 7999 | + } else { |
|
| 8000 | + $query .= " AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
|
| 8001 | + } |
|
| 7689 | 8002 | } |
| 7690 | 8003 | if ($sincedate != '') { |
| 7691 | - if ($globalDBdriver == 'mysql') $query .= " AND spotter_output.date > '".$sincedate."'"; |
|
| 7692 | - else $query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
|
| 8004 | + if ($globalDBdriver == 'mysql') { |
|
| 8005 | + $query .= " AND spotter_output.date > '".$sincedate."'"; |
|
| 8006 | + } else { |
|
| 8007 | + $query .= " AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP)"; |
|
| 8008 | + } |
|
| 7693 | 8009 | } |
| 7694 | 8010 | $query .= " GROUP BY spotter_output.ident, spotter_output.airline_name, spotter_output.airline_icao ORDER BY callsign_icao_count DESC"; |
| 7695 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
| 8011 | + if ($limit) { |
|
| 8012 | + $query .= " LIMIT 10 OFFSET 0"; |
|
| 8013 | + } |
|
| 7696 | 8014 | |
| 7697 | 8015 | $sth = $this->db->prepare($query); |
| 7698 | 8016 | $sth->execute(); |
@@ -7726,15 +8044,23 @@ discard block |
||
| 7726 | 8044 | FROM spotter_output |
| 7727 | 8045 | WHERE spotter_output.ident <> '' AND spotter_output.airline_icao <> '' "; |
| 7728 | 8046 | if ($olderthanmonths > 0) { |
| 7729 | - if ($globalDBdriver == 'mysql') $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
| 7730 | - else $query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
|
| 8047 | + if ($globalDBdriver == 'mysql') { |
|
| 8048 | + $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
|
| 8049 | + } else { |
|
| 8050 | + $query .= "AND spotter_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS' "; |
|
| 8051 | + } |
|
| 7731 | 8052 | } |
| 7732 | 8053 | if ($sincedate != '') { |
| 7733 | - if ($globalDBdriver == 'mysql') $query .= "AND spotter_output.date > '".$sincedate."' "; |
|
| 7734 | - else $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP) "; |
|
| 8054 | + if ($globalDBdriver == 'mysql') { |
|
| 8055 | + $query .= "AND spotter_output.date > '".$sincedate."' "; |
|
| 8056 | + } else { |
|
| 8057 | + $query .= "AND spotter_output.date > CAST('".$sincedate."' AS TIMESTAMP) "; |
|
| 8058 | + } |
|
| 7735 | 8059 | } |
| 7736 | 8060 | $query .= "GROUP BY spotter_output.airline_icao, spotter_output.ident, spotter_output.airline_name, spotter_output.airline_icao ORDER BY callsign_icao_count DESC"; |
| 7737 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
| 8061 | + if ($limit) { |
|
| 8062 | + $query .= " LIMIT 10 OFFSET 0"; |
|
| 8063 | + } |
|
| 7738 | 8064 | |
| 7739 | 8065 | $sth = $this->db->prepare($query); |
| 7740 | 8066 | $sth->execute(); |
@@ -7771,7 +8097,9 @@ discard block |
||
| 7771 | 8097 | date_default_timezone_set($globalTimezone); |
| 7772 | 8098 | $datetime = new DateTime(); |
| 7773 | 8099 | $offset = $datetime->format('P'); |
| 7774 | - } else $offset = '+00:00'; |
|
| 8100 | + } else { |
|
| 8101 | + $offset = '+00:00'; |
|
| 8102 | + } |
|
| 7775 | 8103 | |
| 7776 | 8104 | if ($globalDBdriver == 'mysql') { |
| 7777 | 8105 | $query = "SELECT DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS date_name, count(*) as date_count |
@@ -7820,7 +8148,9 @@ discard block |
||
| 7820 | 8148 | date_default_timezone_set($globalTimezone); |
| 7821 | 8149 | $datetime = new DateTime(); |
| 7822 | 8150 | $offset = $datetime->format('P'); |
| 7823 | - } else $offset = '+00:00'; |
|
| 8151 | + } else { |
|
| 8152 | + $offset = '+00:00'; |
|
| 8153 | + } |
|
| 7824 | 8154 | |
| 7825 | 8155 | if ($globalDBdriver == 'mysql') { |
| 7826 | 8156 | $query = "SELECT spotter_output.airline_icao, DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS date_name, count(*) as date_count |
@@ -7870,7 +8200,9 @@ discard block |
||
| 7870 | 8200 | date_default_timezone_set($globalTimezone); |
| 7871 | 8201 | $datetime = new DateTime(); |
| 7872 | 8202 | $offset = $datetime->format('P'); |
| 7873 | - } else $offset = '+00:00'; |
|
| 8203 | + } else { |
|
| 8204 | + $offset = '+00:00'; |
|
| 8205 | + } |
|
| 7874 | 8206 | $filter_query = $this->getFilter($filters,true,true); |
| 7875 | 8207 | if ($globalDBdriver == 'mysql') { |
| 7876 | 8208 | $query = "SELECT DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS date_name, count(*) as date_count |
@@ -7916,7 +8248,9 @@ discard block |
||
| 7916 | 8248 | date_default_timezone_set($globalTimezone); |
| 7917 | 8249 | $datetime = new DateTime(); |
| 7918 | 8250 | $offset = $datetime->format('P'); |
| 7919 | - } else $offset = '+00:00'; |
|
| 8251 | + } else { |
|
| 8252 | + $offset = '+00:00'; |
|
| 8253 | + } |
|
| 7920 | 8254 | $filter_query = $this->getFilter($filters,true,true); |
| 7921 | 8255 | if ($globalDBdriver == 'mysql') { |
| 7922 | 8256 | $query = "SELECT DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS date_name, count(*) as date_count |
@@ -7963,7 +8297,9 @@ discard block |
||
| 7963 | 8297 | date_default_timezone_set($globalTimezone); |
| 7964 | 8298 | $datetime = new DateTime(); |
| 7965 | 8299 | $offset = $datetime->format('P'); |
| 7966 | - } else $offset = '+00:00'; |
|
| 8300 | + } else { |
|
| 8301 | + $offset = '+00:00'; |
|
| 8302 | + } |
|
| 7967 | 8303 | |
| 7968 | 8304 | if ($globalDBdriver == 'mysql') { |
| 7969 | 8305 | $query = "SELECT spotter_output.airline_icao, DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS date_name, count(*) as date_count |
@@ -8013,7 +8349,9 @@ discard block |
||
| 8013 | 8349 | date_default_timezone_set($globalTimezone); |
| 8014 | 8350 | $datetime = new DateTime(); |
| 8015 | 8351 | $offset = $datetime->format('P'); |
| 8016 | - } else $offset = '+00:00'; |
|
| 8352 | + } else { |
|
| 8353 | + $offset = '+00:00'; |
|
| 8354 | + } |
|
| 8017 | 8355 | |
| 8018 | 8356 | if ($globalDBdriver == 'mysql') { |
| 8019 | 8357 | $query = "SELECT YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(*) as date_count |
@@ -8059,7 +8397,9 @@ discard block |
||
| 8059 | 8397 | date_default_timezone_set($globalTimezone); |
| 8060 | 8398 | $datetime = new DateTime(); |
| 8061 | 8399 | $offset = $datetime->format('P'); |
| 8062 | - } else $offset = '+00:00'; |
|
| 8400 | + } else { |
|
| 8401 | + $offset = '+00:00'; |
|
| 8402 | + } |
|
| 8063 | 8403 | |
| 8064 | 8404 | if ($globalDBdriver == 'mysql') { |
| 8065 | 8405 | $query = "SELECT spotter_output.airline_icao, YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(*) as date_count |
@@ -8108,7 +8448,9 @@ discard block |
||
| 8108 | 8448 | date_default_timezone_set($globalTimezone); |
| 8109 | 8449 | $datetime = new DateTime(); |
| 8110 | 8450 | $offset = $datetime->format('P'); |
| 8111 | - } else $offset = '+00:00'; |
|
| 8451 | + } else { |
|
| 8452 | + $offset = '+00:00'; |
|
| 8453 | + } |
|
| 8112 | 8454 | |
| 8113 | 8455 | if ($globalDBdriver == 'mysql') { |
| 8114 | 8456 | $query = "SELECT YEAR(CONVERT_TZ(s.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(s.date,'+00:00', :offset)) AS month_name, count(*) as date_count |
@@ -8155,7 +8497,9 @@ discard block |
||
| 8155 | 8497 | date_default_timezone_set($globalTimezone); |
| 8156 | 8498 | $datetime = new DateTime(); |
| 8157 | 8499 | $offset = $datetime->format('P'); |
| 8158 | - } else $offset = '+00:00'; |
|
| 8500 | + } else { |
|
| 8501 | + $offset = '+00:00'; |
|
| 8502 | + } |
|
| 8159 | 8503 | |
| 8160 | 8504 | if ($globalDBdriver == 'mysql') { |
| 8161 | 8505 | $query = "SELECT YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(distinct owner_name) as date_count |
@@ -8202,7 +8546,9 @@ discard block |
||
| 8202 | 8546 | date_default_timezone_set($globalTimezone); |
| 8203 | 8547 | $datetime = new DateTime(); |
| 8204 | 8548 | $offset = $datetime->format('P'); |
| 8205 | - } else $offset = '+00:00'; |
|
| 8549 | + } else { |
|
| 8550 | + $offset = '+00:00'; |
|
| 8551 | + } |
|
| 8206 | 8552 | |
| 8207 | 8553 | if ($globalDBdriver == 'mysql') { |
| 8208 | 8554 | $query = "SELECT spotter_output.airline_icao, YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(distinct owner_name) as date_count |
@@ -8250,7 +8596,9 @@ discard block |
||
| 8250 | 8596 | date_default_timezone_set($globalTimezone); |
| 8251 | 8597 | $datetime = new DateTime(); |
| 8252 | 8598 | $offset = $datetime->format('P'); |
| 8253 | - } else $offset = '+00:00'; |
|
| 8599 | + } else { |
|
| 8600 | + $offset = '+00:00'; |
|
| 8601 | + } |
|
| 8254 | 8602 | |
| 8255 | 8603 | if ($globalDBdriver == 'mysql') { |
| 8256 | 8604 | $query = "SELECT YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(distinct pilot_id) as date_count |
@@ -8297,7 +8645,9 @@ discard block |
||
| 8297 | 8645 | date_default_timezone_set($globalTimezone); |
| 8298 | 8646 | $datetime = new DateTime(); |
| 8299 | 8647 | $offset = $datetime->format('P'); |
| 8300 | - } else $offset = '+00:00'; |
|
| 8648 | + } else { |
|
| 8649 | + $offset = '+00:00'; |
|
| 8650 | + } |
|
| 8301 | 8651 | |
| 8302 | 8652 | if ($globalDBdriver == 'mysql') { |
| 8303 | 8653 | $query = "SELECT spotter_output.airline_icao, YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(distinct pilot_id) as date_count |
@@ -8345,7 +8695,9 @@ discard block |
||
| 8345 | 8695 | date_default_timezone_set($globalTimezone); |
| 8346 | 8696 | $datetime = new DateTime(); |
| 8347 | 8697 | $offset = $datetime->format('P'); |
| 8348 | - } else $offset = '+00:00'; |
|
| 8698 | + } else { |
|
| 8699 | + $offset = '+00:00'; |
|
| 8700 | + } |
|
| 8349 | 8701 | |
| 8350 | 8702 | if ($globalDBdriver == 'mysql') { |
| 8351 | 8703 | $query = "SELECT YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(distinct airline_icao) as date_count |
@@ -8392,7 +8744,9 @@ discard block |
||
| 8392 | 8744 | date_default_timezone_set($globalTimezone); |
| 8393 | 8745 | $datetime = new DateTime(); |
| 8394 | 8746 | $offset = $datetime->format('P'); |
| 8395 | - } else $offset = '+00:00'; |
|
| 8747 | + } else { |
|
| 8748 | + $offset = '+00:00'; |
|
| 8749 | + } |
|
| 8396 | 8750 | |
| 8397 | 8751 | if ($globalDBdriver == 'mysql') { |
| 8398 | 8752 | $query = "SELECT YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(distinct aircraft_icao) as date_count |
@@ -8440,7 +8794,9 @@ discard block |
||
| 8440 | 8794 | date_default_timezone_set($globalTimezone); |
| 8441 | 8795 | $datetime = new DateTime(); |
| 8442 | 8796 | $offset = $datetime->format('P'); |
| 8443 | - } else $offset = '+00:00'; |
|
| 8797 | + } else { |
|
| 8798 | + $offset = '+00:00'; |
|
| 8799 | + } |
|
| 8444 | 8800 | |
| 8445 | 8801 | if ($globalDBdriver == 'mysql') { |
| 8446 | 8802 | $query = "SELECT spotter_output.airline_icao,YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(distinct aircraft_icao) as date_count |
@@ -8488,7 +8844,9 @@ discard block |
||
| 8488 | 8844 | date_default_timezone_set($globalTimezone); |
| 8489 | 8845 | $datetime = new DateTime(); |
| 8490 | 8846 | $offset = $datetime->format('P'); |
| 8491 | - } else $offset = '+00:00'; |
|
| 8847 | + } else { |
|
| 8848 | + $offset = '+00:00'; |
|
| 8849 | + } |
|
| 8492 | 8850 | |
| 8493 | 8851 | if ($globalDBdriver == 'mysql') { |
| 8494 | 8852 | $query = "SELECT YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(real_arrival_airport_icao) as date_count |
@@ -8536,7 +8894,9 @@ discard block |
||
| 8536 | 8894 | date_default_timezone_set($globalTimezone); |
| 8537 | 8895 | $datetime = new DateTime(); |
| 8538 | 8896 | $offset = $datetime->format('P'); |
| 8539 | - } else $offset = '+00:00'; |
|
| 8897 | + } else { |
|
| 8898 | + $offset = '+00:00'; |
|
| 8899 | + } |
|
| 8540 | 8900 | |
| 8541 | 8901 | if ($globalDBdriver == 'mysql') { |
| 8542 | 8902 | $query = "SELECT spotter_output.airline_icao, YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(real_arrival_airport_icao) as date_count |
@@ -8585,7 +8945,9 @@ discard block |
||
| 8585 | 8945 | date_default_timezone_set($globalTimezone); |
| 8586 | 8946 | $datetime = new DateTime(); |
| 8587 | 8947 | $offset = $datetime->format('P'); |
| 8588 | - } else $offset = '+00:00'; |
|
| 8948 | + } else { |
|
| 8949 | + $offset = '+00:00'; |
|
| 8950 | + } |
|
| 8589 | 8951 | $filter_query = $this->getFilter($filters,true,true); |
| 8590 | 8952 | if ($globalDBdriver == 'mysql') { |
| 8591 | 8953 | $query = "SELECT MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name, count(*) as date_count |
@@ -8634,7 +8996,9 @@ discard block |
||
| 8634 | 8996 | date_default_timezone_set($globalTimezone); |
| 8635 | 8997 | $datetime = new DateTime(); |
| 8636 | 8998 | $offset = $datetime->format('P'); |
| 8637 | - } else $offset = '+00:00'; |
|
| 8999 | + } else { |
|
| 9000 | + $offset = '+00:00'; |
|
| 9001 | + } |
|
| 8638 | 9002 | |
| 8639 | 9003 | $orderby_sql = ''; |
| 8640 | 9004 | if ($orderby == "hour") |
@@ -8699,7 +9063,9 @@ discard block |
||
| 8699 | 9063 | date_default_timezone_set($globalTimezone); |
| 8700 | 9064 | $datetime = new DateTime(); |
| 8701 | 9065 | $offset = $datetime->format('P'); |
| 8702 | - } else $offset = '+00:00'; |
|
| 9066 | + } else { |
|
| 9067 | + $offset = '+00:00'; |
|
| 9068 | + } |
|
| 8703 | 9069 | |
| 8704 | 9070 | $orderby_sql = ''; |
| 8705 | 9071 | if ($orderby == "hour") |
@@ -8767,7 +9133,9 @@ discard block |
||
| 8767 | 9133 | date_default_timezone_set($globalTimezone); |
| 8768 | 9134 | $datetime = new DateTime(); |
| 8769 | 9135 | $offset = $datetime->format('P'); |
| 8770 | - } else $offset = '+00:00'; |
|
| 9136 | + } else { |
|
| 9137 | + $offset = '+00:00'; |
|
| 9138 | + } |
|
| 8771 | 9139 | |
| 8772 | 9140 | $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING); |
| 8773 | 9141 | |
@@ -8819,7 +9187,9 @@ discard block |
||
| 8819 | 9187 | date_default_timezone_set($globalTimezone); |
| 8820 | 9188 | $datetime = new DateTime(); |
| 8821 | 9189 | $offset = $datetime->format('P'); |
| 8822 | - } else $offset = '+00:00'; |
|
| 9190 | + } else { |
|
| 9191 | + $offset = '+00:00'; |
|
| 9192 | + } |
|
| 8823 | 9193 | |
| 8824 | 9194 | if ($globalDBdriver == 'mysql') { |
| 8825 | 9195 | $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
@@ -8867,7 +9237,9 @@ discard block |
||
| 8867 | 9237 | date_default_timezone_set($globalTimezone); |
| 8868 | 9238 | $datetime = new DateTime(); |
| 8869 | 9239 | $offset = $datetime->format('P'); |
| 8870 | - } else $offset = '+00:00'; |
|
| 9240 | + } else { |
|
| 9241 | + $offset = '+00:00'; |
|
| 9242 | + } |
|
| 8871 | 9243 | |
| 8872 | 9244 | if ($globalDBdriver == 'mysql') { |
| 8873 | 9245 | $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
@@ -8915,7 +9287,9 @@ discard block |
||
| 8915 | 9287 | date_default_timezone_set($globalTimezone); |
| 8916 | 9288 | $datetime = new DateTime(); |
| 8917 | 9289 | $offset = $datetime->format('P'); |
| 8918 | - } else $offset = '+00:00'; |
|
| 9290 | + } else { |
|
| 9291 | + $offset = '+00:00'; |
|
| 9292 | + } |
|
| 8919 | 9293 | |
| 8920 | 9294 | if ($globalDBdriver == 'mysql') { |
| 8921 | 9295 | $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
@@ -8964,7 +9338,9 @@ discard block |
||
| 8964 | 9338 | date_default_timezone_set($globalTimezone); |
| 8965 | 9339 | $datetime = new DateTime(); |
| 8966 | 9340 | $offset = $datetime->format('P'); |
| 8967 | - } else $offset = '+00:00'; |
|
| 9341 | + } else { |
|
| 9342 | + $offset = '+00:00'; |
|
| 9343 | + } |
|
| 8968 | 9344 | |
| 8969 | 9345 | if ($globalDBdriver == 'mysql') { |
| 8970 | 9346 | $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
@@ -9013,7 +9389,9 @@ discard block |
||
| 9013 | 9389 | date_default_timezone_set($globalTimezone); |
| 9014 | 9390 | $datetime = new DateTime($date); |
| 9015 | 9391 | $offset = $datetime->format('P'); |
| 9016 | - } else $offset = '+00:00'; |
|
| 9392 | + } else { |
|
| 9393 | + $offset = '+00:00'; |
|
| 9394 | + } |
|
| 9017 | 9395 | |
| 9018 | 9396 | if ($globalDBdriver == 'mysql') { |
| 9019 | 9397 | $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
@@ -9062,7 +9440,9 @@ discard block |
||
| 9062 | 9440 | date_default_timezone_set($globalTimezone); |
| 9063 | 9441 | $datetime = new DateTime(); |
| 9064 | 9442 | $offset = $datetime->format('P'); |
| 9065 | - } else $offset = '+00:00'; |
|
| 9443 | + } else { |
|
| 9444 | + $offset = '+00:00'; |
|
| 9445 | + } |
|
| 9066 | 9446 | |
| 9067 | 9447 | if ($globalDBdriver == 'mysql') { |
| 9068 | 9448 | $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
@@ -9113,7 +9493,9 @@ discard block |
||
| 9113 | 9493 | date_default_timezone_set($globalTimezone); |
| 9114 | 9494 | $datetime = new DateTime(); |
| 9115 | 9495 | $offset = $datetime->format('P'); |
| 9116 | - } else $offset = '+00:00'; |
|
| 9496 | + } else { |
|
| 9497 | + $offset = '+00:00'; |
|
| 9498 | + } |
|
| 9117 | 9499 | |
| 9118 | 9500 | if ($globalDBdriver == 'mysql') { |
| 9119 | 9501 | $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
@@ -9161,7 +9543,9 @@ discard block |
||
| 9161 | 9543 | date_default_timezone_set($globalTimezone); |
| 9162 | 9544 | $datetime = new DateTime(); |
| 9163 | 9545 | $offset = $datetime->format('P'); |
| 9164 | - } else $offset = '+00:00'; |
|
| 9546 | + } else { |
|
| 9547 | + $offset = '+00:00'; |
|
| 9548 | + } |
|
| 9165 | 9549 | |
| 9166 | 9550 | if ($globalDBdriver == 'mysql') { |
| 9167 | 9551 | $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
@@ -9330,7 +9714,9 @@ discard block |
||
| 9330 | 9714 | date_default_timezone_set($globalTimezone); |
| 9331 | 9715 | $datetime = new DateTime(); |
| 9332 | 9716 | $offset = $datetime->format('P'); |
| 9333 | - } else $offset = '+00:00'; |
|
| 9717 | + } else { |
|
| 9718 | + $offset = '+00:00'; |
|
| 9719 | + } |
|
| 9334 | 9720 | |
| 9335 | 9721 | if ($globalDBdriver == 'mysql') { |
| 9336 | 9722 | $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
@@ -9519,7 +9905,9 @@ discard block |
||
| 9519 | 9905 | */ |
| 9520 | 9906 | public function parseDirection($direction = 0) |
| 9521 | 9907 | { |
| 9522 | - if ($direction == '') $direction = 0; |
|
| 9908 | + if ($direction == '') { |
|
| 9909 | + $direction = 0; |
|
| 9910 | + } |
|
| 9523 | 9911 | $direction_array = array(); |
| 9524 | 9912 | $temp_array = array(); |
| 9525 | 9913 | |
@@ -9620,7 +10008,9 @@ discard block |
||
| 9620 | 10008 | if (isset($result->AirlineFlightInfoResult)) |
| 9621 | 10009 | { |
| 9622 | 10010 | $registration = $result->AirlineFlightInfoResult->tailnumber; |
| 9623 | - } else return ''; |
|
| 10011 | + } else { |
|
| 10012 | + return ''; |
|
| 10013 | + } |
|
| 9624 | 10014 | |
| 9625 | 10015 | $registration = $this->convertAircraftRegistration($registration); |
| 9626 | 10016 | |
@@ -9648,7 +10038,9 @@ discard block |
||
| 9648 | 10038 | if (count($row) > 0) { |
| 9649 | 10039 | //return $row['Registration']; |
| 9650 | 10040 | return $row['registration']; |
| 9651 | - } else return ''; |
|
| 10041 | + } else { |
|
| 10042 | + return ''; |
|
| 10043 | + } |
|
| 9652 | 10044 | |
| 9653 | 10045 | } |
| 9654 | 10046 | |
@@ -9670,9 +10062,14 @@ discard block |
||
| 9670 | 10062 | |
| 9671 | 10063 | $row = $sth->fetch(PDO::FETCH_ASSOC); |
| 9672 | 10064 | if (count($row) > 0) { |
| 9673 | - if ($row['type_flight'] == null) return ''; |
|
| 9674 | - else return $row['type_flight']; |
|
| 9675 | - } else return ''; |
|
| 10065 | + if ($row['type_flight'] == null) { |
|
| 10066 | + return ''; |
|
| 10067 | + } else { |
|
| 10068 | + return $row['type_flight']; |
|
| 10069 | + } |
|
| 10070 | + } else { |
|
| 10071 | + return ''; |
|
| 10072 | + } |
|
| 9676 | 10073 | |
| 9677 | 10074 | } |
| 9678 | 10075 | |
@@ -9690,7 +10087,9 @@ discard block |
||
| 9690 | 10087 | $longitude = filter_var($longitude,FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
| 9691 | 10088 | |
| 9692 | 10089 | $Connection = new Connection($this->db); |
| 9693 | - if (!$Connection->tableExists('countries')) return ''; |
|
| 10090 | + if (!$Connection->tableExists('countries')) { |
|
| 10091 | + return ''; |
|
| 10092 | + } |
|
| 9694 | 10093 | |
| 9695 | 10094 | try { |
| 9696 | 10095 | /* |
@@ -9709,9 +10108,13 @@ discard block |
||
| 9709 | 10108 | $row = $sth->fetch(PDO::FETCH_ASSOC); |
| 9710 | 10109 | if (count($row) > 0) { |
| 9711 | 10110 | return $row; |
| 9712 | - } else return ''; |
|
| 10111 | + } else { |
|
| 10112 | + return ''; |
|
| 10113 | + } |
|
| 9713 | 10114 | } catch (PDOException $e) { |
| 9714 | - if (isset($globalDebug) && $globalDebug) echo 'Error : '.$e->getMessage()."\n"; |
|
| 10115 | + if (isset($globalDebug) && $globalDebug) { |
|
| 10116 | + echo 'Error : '.$e->getMessage()."\n"; |
|
| 10117 | + } |
|
| 9715 | 10118 | return ''; |
| 9716 | 10119 | } |
| 9717 | 10120 | |
@@ -9859,7 +10262,9 @@ discard block |
||
| 9859 | 10262 | { |
| 9860 | 10263 | global $globalBitlyAccessToken; |
| 9861 | 10264 | |
| 9862 | - if ($globalBitlyAccessToken == '') return $url; |
|
| 10265 | + if ($globalBitlyAccessToken == '') { |
|
| 10266 | + return $url; |
|
| 10267 | + } |
|
| 9863 | 10268 | |
| 9864 | 10269 | $google_url = 'https://api-ssl.bitly.com/v3/shorten?access_token='.$globalBitlyAccessToken.'&longUrl='.$url; |
| 9865 | 10270 | |
@@ -10008,7 +10413,9 @@ discard block |
||
| 10008 | 10413 | |
| 10009 | 10414 | |
| 10010 | 10415 | // routes |
| 10011 | - if ($globalDebug) print "Routes...\n"; |
|
| 10416 | + if ($globalDebug) { |
|
| 10417 | + print "Routes...\n"; |
|
| 10418 | + } |
|
| 10012 | 10419 | if ($globalDBdriver == 'mysql') { |
| 10013 | 10420 | $query = "SELECT spotter_output.spotter_id, routes.FromAirport_ICAO, routes.ToAirport_ICAO FROM spotter_output, routes WHERE spotter_output.ident = routes.CallSign AND ( spotter_output.departure_airport_icao != routes.FromAirport_ICAO OR spotter_output.arrival_airport_icao != routes.ToAirport_ICAO) AND routes.FromAirport_ICAO != '' AND spotter_output.date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 15 DAY)"; |
| 10014 | 10421 | } else { |
@@ -10027,7 +10434,9 @@ discard block |
||
| 10027 | 10434 | } |
| 10028 | 10435 | } |
| 10029 | 10436 | |
| 10030 | - if ($globalDebug) print "Airlines...\n"; |
|
| 10437 | + if ($globalDebug) { |
|
| 10438 | + print "Airlines...\n"; |
|
| 10439 | + } |
|
| 10031 | 10440 | //airlines |
| 10032 | 10441 | if ($globalDBdriver == 'mysql') { |
| 10033 | 10442 | $query = "SELECT spotter_output.spotter_id, spotter_output.ident FROM spotter_output WHERE (spotter_output.airline_name = '' OR spotter_output.airline_name = 'Not Available') AND spotter_output.date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 15 DAY)"; |
@@ -10041,10 +10450,15 @@ discard block |
||
| 10041 | 10450 | if (is_numeric(substr($row['ident'], -1, 1))) |
| 10042 | 10451 | { |
| 10043 | 10452 | $fromsource = NULL; |
| 10044 | - if (isset($row['format_source']) && $row['format_source'] == 'vatsimtxt') $fromsource = 'vatsim'; |
|
| 10045 | - elseif (isset($row['format_source']) && $row['format_source'] == 'whazzup') $fromsource = 'ivao'; |
|
| 10046 | - elseif (isset($globalVATSIM) && $globalVATSIM) $fromsource = 'vatsim'; |
|
| 10047 | - elseif (isset($globalIVAO) && $globalIVAO) $fromsource = 'ivao'; |
|
| 10453 | + if (isset($row['format_source']) && $row['format_source'] == 'vatsimtxt') { |
|
| 10454 | + $fromsource = 'vatsim'; |
|
| 10455 | + } elseif (isset($row['format_source']) && $row['format_source'] == 'whazzup') { |
|
| 10456 | + $fromsource = 'ivao'; |
|
| 10457 | + } elseif (isset($globalVATSIM) && $globalVATSIM) { |
|
| 10458 | + $fromsource = 'vatsim'; |
|
| 10459 | + } elseif (isset($globalIVAO) && $globalIVAO) { |
|
| 10460 | + $fromsource = 'ivao'; |
|
| 10461 | + } |
|
| 10048 | 10462 | $airline_array = $this->getAllAirlineInfo(substr($row['ident'], 0, 3),$fromsource); |
| 10049 | 10463 | if (isset($airline_array[0]['name'])) { |
| 10050 | 10464 | $update_query = "UPDATE spotter_output SET spotter_output.airline_name = :airline_name, spotter_output.airline_icao = :airline_icao, spotter_output.airline_country = :airline_country, spotter_output.airline_type = :airline_type WHERE spotter_output.spotter_id = :spotter_id"; |
@@ -10054,13 +10468,17 @@ discard block |
||
| 10054 | 10468 | } |
| 10055 | 10469 | } |
| 10056 | 10470 | |
| 10057 | - if ($globalDebug) print "Remove Duplicate in aircraft_modes...\n"; |
|
| 10471 | + if ($globalDebug) { |
|
| 10472 | + print "Remove Duplicate in aircraft_modes...\n"; |
|
| 10473 | + } |
|
| 10058 | 10474 | //duplicate modes |
| 10059 | 10475 | $query = "DELETE aircraft_modes FROM aircraft_modes LEFT OUTER JOIN (SELECT max(`AircraftID`) as `AircraftID`,`ModeS` FROM `aircraft_modes` group by ModeS) as KeepRows ON aircraft_modes.AircraftID = KeepRows.AircraftID WHERE KeepRows.AircraftID IS NULL"; |
| 10060 | 10476 | $sth = $this->db->prepare($query); |
| 10061 | 10477 | $sth->execute(); |
| 10062 | 10478 | |
| 10063 | - if ($globalDebug) print "Aircraft...\n"; |
|
| 10479 | + if ($globalDebug) { |
|
| 10480 | + print "Aircraft...\n"; |
|
| 10481 | + } |
|
| 10064 | 10482 | //aircraft |
| 10065 | 10483 | if ($globalDBdriver == 'mysql') { |
| 10066 | 10484 | $query = "SELECT spotter_output.spotter_id, spotter_output.aircraft_icao, spotter_output.registration FROM spotter_output WHERE (spotter_output.aircraft_name = '' OR spotter_output.aircraft_name = 'Not Available') AND spotter_output.date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 7 DAY)"; |
@@ -10103,26 +10521,38 @@ discard block |
||
| 10103 | 10521 | if (isset($closestAirports[0])) { |
| 10104 | 10522 | if ($row['arrival_airport_icao'] == $closestAirports[0]['icao']) { |
| 10105 | 10523 | $airport_icao = $closestAirports[0]['icao']; |
| 10106 | - if ($globalDebug) echo "\o/ 1st ---++ Find arrival airport. airport_icao : ".$airport_icao."\n"; |
|
| 10524 | + if ($globalDebug) { |
|
| 10525 | + echo "\o/ 1st ---++ Find arrival airport. airport_icao : ".$airport_icao."\n"; |
|
| 10526 | + } |
|
| 10107 | 10527 | } elseif (count($closestAirports > 1) && $row['arrival_airport_icao'] != '' && $row['arrival_airport_icao'] != 'NA') { |
| 10108 | 10528 | foreach ($closestAirports as $airport) { |
| 10109 | 10529 | if ($row['arrival_airport_icao'] == $airport['icao']) { |
| 10110 | 10530 | $airport_icao = $airport['icao']; |
| 10111 | - if ($globalDebug) echo "\o/ try --++ Find arrival airport. airport_icao : ".$airport_icao."\n"; |
|
| 10531 | + if ($globalDebug) { |
|
| 10532 | + echo "\o/ try --++ Find arrival airport. airport_icao : ".$airport_icao."\n"; |
|
| 10533 | + } |
|
| 10112 | 10534 | break; |
| 10113 | 10535 | } |
| 10114 | 10536 | } |
| 10115 | 10537 | } elseif ($row['last_altitude'] == 0 || ($row['last_altitude'] != '' && ($closestAirports[0]['altitude'] <= $row['last_altitude']*100+1000 && $row['last_altitude']*100 < $closestAirports[0]['altitude']+5000))) { |
| 10116 | 10538 | $airport_icao = $closestAirports[0]['icao']; |
| 10117 | - if ($globalDebug) echo "\o/ NP --++ Find arrival airport. Airport ICAO : ".$airport_icao." ! Latitude : ".$row['last_latitude'].' - Longitude : '.$row['last_longitude'].' - MinDist : '.$globalClosestMinDist." - Airport altitude : ".$closestAirports[0]['altitude'].' - flight altitude : '.($row['last_altitude']*100)."\n"; |
|
| 10539 | + if ($globalDebug) { |
|
| 10540 | + echo "\o/ NP --++ Find arrival airport. Airport ICAO : ".$airport_icao." ! Latitude : ".$row['last_latitude'].' - Longitude : '.$row['last_longitude'].' - MinDist : '.$globalClosestMinDist." - Airport altitude : ".$closestAirports[0]['altitude'].' - flight altitude : '.($row['last_altitude']*100)."\n"; |
|
| 10541 | + } |
|
| 10118 | 10542 | } else { |
| 10119 | - if ($globalDebug) echo "----- Can't find arrival airport. Latitude : ".$row['last_latitude'].' - Longitude : '.$row['last_longitude'].' - MinDist : '.$globalClosestMinDist." - Airport altitude : ".$closestAirports[0]['altitude'].' - flight altitude : '.($row['last_altitude']*100)."\n"; |
|
| 10543 | + if ($globalDebug) { |
|
| 10544 | + echo "----- Can't find arrival airport. Latitude : ".$row['last_latitude'].' - Longitude : '.$row['last_longitude'].' - MinDist : '.$globalClosestMinDist." - Airport altitude : ".$closestAirports[0]['altitude'].' - flight altitude : '.($row['last_altitude']*100)."\n"; |
|
| 10545 | + } |
|
| 10120 | 10546 | } |
| 10121 | 10547 | } else { |
| 10122 | - if ($globalDebug) echo "----- No Airport near last coord. Latitude : ".$row['last_latitude'].' - Longitude : '.$row['last_longitude'].' - MinDist : '.$globalClosestMinDist."\n"; |
|
| 10548 | + if ($globalDebug) { |
|
| 10549 | + echo "----- No Airport near last coord. Latitude : ".$row['last_latitude'].' - Longitude : '.$row['last_longitude'].' - MinDist : '.$globalClosestMinDist."\n"; |
|
| 10550 | + } |
|
| 10123 | 10551 | } |
| 10124 | 10552 | if ($row['real_arrival_airport_icao'] != $airport_icao) { |
| 10125 | - if ($globalDebug) echo "Updating airport to ".$airport_icao."...\n"; |
|
| 10553 | + if ($globalDebug) { |
|
| 10554 | + echo "Updating airport to ".$airport_icao."...\n"; |
|
| 10555 | + } |
|
| 10126 | 10556 | $update_query="UPDATE spotter_output SET real_arrival_airport_icao = :airport_icao WHERE spotter_id = :spotter_id"; |
| 10127 | 10557 | $sthu = $this->db->prepare($update_query); |
| 10128 | 10558 | $sthu->execute(array(':airport_icao' => $airport_icao,':spotter_id' => $row['spotter_id'])); |
@@ -4,7 +4,7 @@ discard block |
||
| 4 | 4 | require_once(dirname(__FILE__).'/class.Image.php'); |
| 5 | 5 | $global_query = "SELECT spotter_output.* FROM spotter_output"; |
| 6 | 6 | |
| 7 | -class Spotter{ |
|
| 7 | +class Spotter { |
|
| 8 | 8 | public $db; |
| 9 | 9 | |
| 10 | 10 | public function __construct($dbc = null) { |
@@ -17,14 +17,14 @@ discard block |
||
| 17 | 17 | * @param Array $filter the filter |
| 18 | 18 | * @return Array the SQL part |
| 19 | 19 | */ |
| 20 | - public function getFilter($filter = array(),$where = false,$and = false) { |
|
| 20 | + public function getFilter($filter = array(), $where = false, $and = false) { |
|
| 21 | 21 | global $globalFilter; |
| 22 | - if (is_array($globalFilter)) $filter = array_merge($globalFilter,$filter); |
|
| 22 | + if (is_array($globalFilter)) $filter = array_merge($globalFilter, $filter); |
|
| 23 | 23 | $filter_query_join = ''; |
| 24 | 24 | $filter_query_where = ''; |
| 25 | 25 | if (isset($filter['airlines']) && !empty($filter['airlines'])) { |
| 26 | 26 | if ($filter['airlines'][0] != '') { |
| 27 | - $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.airline_icao IN ('".implode("','",$filter['airlines'])."')) so ON so.flightaware_id = spotter_output.flightaware_id"; |
|
| 27 | + $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.airline_icao IN ('".implode("','", $filter['airlines'])."')) so ON so.flightaware_id = spotter_output.flightaware_id"; |
|
| 28 | 28 | } |
| 29 | 29 | } |
| 30 | 30 | |
@@ -32,16 +32,16 @@ discard block |
||
| 32 | 32 | $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.airline_type = '".$filter['airlinestype']."') sa ON sa.flightaware_id = spotter_output.flightaware_id "; |
| 33 | 33 | } |
| 34 | 34 | if (isset($filter['pilots_id']) && !empty($filter['pilots_id'])) { |
| 35 | - $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.pilot_id IN ('".implode("','",$filter['pilots_id'])."')) so ON so.flightaware_id = spotter_output.flightaware_id"; |
|
| 35 | + $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.pilot_id IN ('".implode("','", $filter['pilots_id'])."')) so ON so.flightaware_id = spotter_output.flightaware_id"; |
|
| 36 | 36 | } |
| 37 | 37 | if (isset($filter['source']) && !empty($filter['source'])) { |
| 38 | - $filter_query_where = " WHERE format_source IN ('".implode("','",$filter['source'])."')"; |
|
| 38 | + $filter_query_where = " WHERE format_source IN ('".implode("','", $filter['source'])."')"; |
|
| 39 | 39 | } |
| 40 | 40 | if (isset($filter['source_aprs']) && !empty($filter['source_aprs'])) { |
| 41 | 41 | if ($filter_query_where == '') { |
| 42 | - $filter_query_where = " WHERE format_source = 'aprs' AND source_name IN ('".implode("','",$filter['source_aprs'])."')"; |
|
| 42 | + $filter_query_where = " WHERE format_source = 'aprs' AND source_name IN ('".implode("','", $filter['source_aprs'])."')"; |
|
| 43 | 43 | } else { |
| 44 | - $filter_query_where .= " AND format_source = 'aprs' AND source_name IN ('".implode("','",$filter['source_aprs'])."')"; |
|
| 44 | + $filter_query_where .= " AND format_source = 'aprs' AND source_name IN ('".implode("','", $filter['source_aprs'])."')"; |
|
| 45 | 45 | } |
| 46 | 46 | } |
| 47 | 47 | if ($filter_query_where == '' && $where) $filter_query_where = ' WHERE'; |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | $sth = $this->db->prepare($query.$limitQuery); |
| 90 | 90 | $sth->execute($params); |
| 91 | 91 | } catch (PDOException $e) { |
| 92 | - printf("Invalid query : %s\nWhole query: %s\n",$e->getMessage(), $query.$limitQuery); |
|
| 92 | + printf("Invalid query : %s\nWhole query: %s\n", $e->getMessage(), $query.$limitQuery); |
|
| 93 | 93 | exit(); |
| 94 | 94 | } |
| 95 | 95 | |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | $spotter_array = array(); |
| 100 | 100 | |
| 101 | 101 | |
| 102 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 102 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 103 | 103 | { |
| 104 | 104 | $num_rows++; |
| 105 | 105 | $temp_array = array(); |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | if (isset($row['route_stop'])) { |
| 145 | 145 | $temp_array['route_stop'] = $row['route_stop']; |
| 146 | 146 | if ($row['route_stop'] != '') { |
| 147 | - $allroute = explode(' ',$row['route_stop']); |
|
| 147 | + $allroute = explode(' ', $row['route_stop']); |
|
| 148 | 148 | |
| 149 | 149 | foreach ($allroute as $route) { |
| 150 | 150 | $route_airport_array = $this->getAllAirportInfo($route); |
@@ -199,11 +199,11 @@ discard block |
||
| 199 | 199 | { |
| 200 | 200 | $temp_array['date'] = "about ".$dateArray['hours']." hours ago"; |
| 201 | 201 | } else { |
| 202 | - $temp_array['date'] = date("M j Y, g:i a",strtotime($row['date']." UTC")); |
|
| 202 | + $temp_array['date'] = date("M j Y, g:i a", strtotime($row['date']." UTC")); |
|
| 203 | 203 | } |
| 204 | 204 | $temp_array['date_minutes_past'] = $dateArray['minutes']; |
| 205 | - $temp_array['date_iso_8601'] = date("c",strtotime($row['date']." UTC")); |
|
| 206 | - $temp_array['date_rfc_2822'] = date("r",strtotime($row['date']." UTC")); |
|
| 205 | + $temp_array['date_iso_8601'] = date("c", strtotime($row['date']." UTC")); |
|
| 206 | + $temp_array['date_rfc_2822'] = date("r", strtotime($row['date']." UTC")); |
|
| 207 | 207 | $temp_array['date_unix'] = strtotime($row['date']." UTC"); |
| 208 | 208 | } |
| 209 | 209 | |
@@ -237,9 +237,9 @@ discard block |
||
| 237 | 237 | if (!isset($row['airline_name']) || $row['airline_name'] == '') { |
| 238 | 238 | if (!is_numeric(substr($row['ident'], 0, 3))) { |
| 239 | 239 | if (is_numeric(substr($row['ident'], 2, 1))) { |
| 240 | - $airline_array = $this->getAllAirlineInfo(substr($row['ident'], 0, 2),$fromsource); |
|
| 240 | + $airline_array = $this->getAllAirlineInfo(substr($row['ident'], 0, 2), $fromsource); |
|
| 241 | 241 | } elseif (is_numeric(substr($row['ident'], 3, 1))) { |
| 242 | - $airline_array = $this->getAllAirlineInfo(substr($row['ident'], 0, 3),$fromsource); |
|
| 242 | + $airline_array = $this->getAllAirlineInfo(substr($row['ident'], 0, 3), $fromsource); |
|
| 243 | 243 | } else { |
| 244 | 244 | $airline_array = $this->getAllAirlineInfo('NA'); |
| 245 | 245 | } |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | $temp_array['airline_type'] = $row['airline_type']; |
| 266 | 266 | } |
| 267 | 267 | if (isset($temp_array['airline_iata']) && $temp_array['airline_iata'] != '') { |
| 268 | - $acars_array = $ACARS->getLiveAcarsData($temp_array['airline_iata'].substr($temp_array['ident'],3)); |
|
| 268 | + $acars_array = $ACARS->getLiveAcarsData($temp_array['airline_iata'].substr($temp_array['ident'], 3)); |
|
| 269 | 269 | //$acars_array = ACARS->getLiveAcarsData('BA40YL'); |
| 270 | 270 | if (count($acars_array) > 0) { |
| 271 | 271 | $temp_array['acars'] = $acars_array; |
@@ -282,11 +282,11 @@ discard block |
||
| 282 | 282 | $temp_array['aircraft_date_first_reg'] = $owner_info['date_first_reg']; |
| 283 | 283 | } |
| 284 | 284 | |
| 285 | - if($temp_array['registration'] != "" || ($globalIVAO && isset($temp_array['aircraft_type']) && $temp_array['aircraft_type'] != '')) |
|
| 285 | + if ($temp_array['registration'] != "" || ($globalIVAO && isset($temp_array['aircraft_type']) && $temp_array['aircraft_type'] != '')) |
|
| 286 | 286 | { |
| 287 | 287 | if ($globalIVAO) { |
| 288 | - if (isset($temp_array['airline_icao'])) $image_array = $Image->getSpotterImage('',$temp_array['aircraft_type'],$temp_array['airline_icao']); |
|
| 289 | - else $image_array = $Image->getSpotterImage('',$temp_array['aircraft_type']); |
|
| 288 | + if (isset($temp_array['airline_icao'])) $image_array = $Image->getSpotterImage('', $temp_array['aircraft_type'], $temp_array['airline_icao']); |
|
| 289 | + else $image_array = $Image->getSpotterImage('', $temp_array['aircraft_type']); |
|
| 290 | 290 | } else $image_array = $Image->getSpotterImage($temp_array['registration']); |
| 291 | 291 | if (count($image_array) > 0) { |
| 292 | 292 | $temp_array['image'] = $image_array[0]['image']; |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | if (isset($row['arrival_airport_time']) && $row['arrival_airport_time'] != '') { |
| 310 | 310 | $temp_array['arrival_airport_time'] = $row['arrival_airport_time']; |
| 311 | 311 | } |
| 312 | - if ((!isset($globalIVAO) || ! $globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS) && (!isset($globalVAM) || !$globalVAM)) { |
|
| 312 | + if ((!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS) && (!isset($globalVAM) || !$globalVAM)) { |
|
| 313 | 313 | $schedule_array = $Schedule->getSchedule($temp_array['ident']); |
| 314 | 314 | //print_r($schedule_array); |
| 315 | 315 | if (count($schedule_array) > 0) { |
@@ -390,12 +390,12 @@ discard block |
||
| 390 | 390 | if (isset($row['squawk'])) { |
| 391 | 391 | $temp_array['squawk'] = $row['squawk']; |
| 392 | 392 | if ($row['squawk'] != '' && isset($temp_array['country_iso2'])) { |
| 393 | - $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'],$temp_array['country_iso2']); |
|
| 394 | - if ($temp_array['squawk_usage'] == '' && isset($globalSquawkCountry)) $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'],$globalSquawkCountry); |
|
| 393 | + $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'], $temp_array['country_iso2']); |
|
| 394 | + if ($temp_array['squawk_usage'] == '' && isset($globalSquawkCountry)) $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'], $globalSquawkCountry); |
|
| 395 | 395 | } elseif ($row['squawk'] != '' && isset($temp_array['over_country'])) { |
| 396 | - $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'],$temp_array['over_country']); |
|
| 397 | - if ($temp_array['squawk_usage'] == '' && isset($globalSquawkCountry)) $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'],$globalSquawkCountry); |
|
| 398 | - } elseif ($row['squawk'] != '' && isset($globalSquawkCountry)) $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'],$globalSquawkCountry); |
|
| 396 | + $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'], $temp_array['over_country']); |
|
| 397 | + if ($temp_array['squawk_usage'] == '' && isset($globalSquawkCountry)) $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'], $globalSquawkCountry); |
|
| 398 | + } elseif ($row['squawk'] != '' && isset($globalSquawkCountry)) $temp_array['squawk_usage'] = $this->getSquawkUsage($row['squawk'], $globalSquawkCountry); |
|
| 399 | 399 | } |
| 400 | 400 | |
| 401 | 401 | $temp_array['query_number_rows'] = $num_rows; |
@@ -414,7 +414,7 @@ discard block |
||
| 414 | 414 | * @return Array the spotter information |
| 415 | 415 | * |
| 416 | 416 | */ |
| 417 | - 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 = '',$filter = array()) |
|
| 417 | + 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 = '', $filter = array()) |
|
| 418 | 418 | { |
| 419 | 419 | global $globalTimezone, $globalDBdriver; |
| 420 | 420 | require_once(dirname(__FILE__).'/class.Translation.php'); |
@@ -424,7 +424,7 @@ discard block |
||
| 424 | 424 | |
| 425 | 425 | $query_values = array(); |
| 426 | 426 | $additional_query = ''; |
| 427 | - $filter_query = $this->getFilter($filter,true,true); |
|
| 427 | + $filter_query = $this->getFilter($filter, true, true); |
|
| 428 | 428 | if ($q != "") |
| 429 | 429 | { |
| 430 | 430 | if (!is_string($q)) |
@@ -432,8 +432,8 @@ discard block |
||
| 432 | 432 | return false; |
| 433 | 433 | } else { |
| 434 | 434 | $q_array = explode(" ", $q); |
| 435 | - foreach ($q_array as $q_item){ |
|
| 436 | - $q_item = filter_var($q_item,FILTER_SANITIZE_STRING); |
|
| 435 | + foreach ($q_array as $q_item) { |
|
| 436 | + $q_item = filter_var($q_item, FILTER_SANITIZE_STRING); |
|
| 437 | 437 | $additional_query .= " AND ("; |
| 438 | 438 | if (is_int($q_item)) $additional_query .= "(spotter_output.spotter_id like '%".$q_item."%') OR "; |
| 439 | 439 | $additional_query .= "(spotter_output.aircraft_icao like '%".$q_item."%') OR "; |
@@ -465,37 +465,37 @@ discard block |
||
| 465 | 465 | |
| 466 | 466 | if ($registration != "") |
| 467 | 467 | { |
| 468 | - $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
|
| 468 | + $registration = filter_var($registration, FILTER_SANITIZE_STRING); |
|
| 469 | 469 | if (!is_string($registration)) |
| 470 | 470 | { |
| 471 | 471 | return false; |
| 472 | 472 | } else { |
| 473 | 473 | $additional_query .= " AND spotter_output.registration = :registration"; |
| 474 | - $query_values = array_merge($query_values,array(':registration' => $registration)); |
|
| 474 | + $query_values = array_merge($query_values, array(':registration' => $registration)); |
|
| 475 | 475 | } |
| 476 | 476 | } |
| 477 | 477 | |
| 478 | 478 | if ($aircraft_icao != "") |
| 479 | 479 | { |
| 480 | - $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
|
| 480 | + $aircraft_icao = filter_var($aircraft_icao, FILTER_SANITIZE_STRING); |
|
| 481 | 481 | if (!is_string($aircraft_icao)) |
| 482 | 482 | { |
| 483 | 483 | return false; |
| 484 | 484 | } else { |
| 485 | 485 | $additional_query .= " AND spotter_output.aircraft_icao = :aircraft_icao"; |
| 486 | - $query_values = array_merge($query_values,array(':aircraft_icao' => $aircraft_icao)); |
|
| 486 | + $query_values = array_merge($query_values, array(':aircraft_icao' => $aircraft_icao)); |
|
| 487 | 487 | } |
| 488 | 488 | } |
| 489 | 489 | |
| 490 | 490 | if ($aircraft_manufacturer != "") |
| 491 | 491 | { |
| 492 | - $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
|
| 492 | + $aircraft_manufacturer = filter_var($aircraft_manufacturer, FILTER_SANITIZE_STRING); |
|
| 493 | 493 | if (!is_string($aircraft_manufacturer)) |
| 494 | 494 | { |
| 495 | 495 | return false; |
| 496 | 496 | } else { |
| 497 | 497 | $additional_query .= " AND spotter_output.aircraft_manufacturer = :aircraft_manufacturer"; |
| 498 | - $query_values = array_merge($query_values,array(':aircraft_manufacturer' => $aircraft_manufacturer)); |
|
| 498 | + $query_values = array_merge($query_values, array(':aircraft_manufacturer' => $aircraft_manufacturer)); |
|
| 499 | 499 | } |
| 500 | 500 | } |
| 501 | 501 | |
@@ -511,25 +511,25 @@ discard block |
||
| 511 | 511 | |
| 512 | 512 | if ($airline_icao != "") |
| 513 | 513 | { |
| 514 | - $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING); |
|
| 514 | + $airline_icao = filter_var($airline_icao, FILTER_SANITIZE_STRING); |
|
| 515 | 515 | if (!is_string($airline_icao)) |
| 516 | 516 | { |
| 517 | 517 | return false; |
| 518 | 518 | } else { |
| 519 | 519 | $additional_query .= " AND spotter_output.airline_icao = :airline_icao"; |
| 520 | - $query_values = array_merge($query_values,array(':airline_icao' => $airline_icao)); |
|
| 520 | + $query_values = array_merge($query_values, array(':airline_icao' => $airline_icao)); |
|
| 521 | 521 | } |
| 522 | 522 | } |
| 523 | 523 | |
| 524 | 524 | if ($airline_country != "") |
| 525 | 525 | { |
| 526 | - $airline_country = filter_var($airline_country,FILTER_SANITIZE_STRING); |
|
| 526 | + $airline_country = filter_var($airline_country, FILTER_SANITIZE_STRING); |
|
| 527 | 527 | if (!is_string($airline_country)) |
| 528 | 528 | { |
| 529 | 529 | return false; |
| 530 | 530 | } else { |
| 531 | 531 | $additional_query .= " AND spotter_output.airline_country = :airline_country"; |
| 532 | - $query_values = array_merge($query_values,array(':airline_country' => $airline_country)); |
|
| 532 | + $query_values = array_merge($query_values, array(':airline_country' => $airline_country)); |
|
| 533 | 533 | } |
| 534 | 534 | } |
| 535 | 535 | |
@@ -556,31 +556,31 @@ discard block |
||
| 556 | 556 | |
| 557 | 557 | if ($airport != "") |
| 558 | 558 | { |
| 559 | - $airport = filter_var($airport,FILTER_SANITIZE_STRING); |
|
| 559 | + $airport = filter_var($airport, FILTER_SANITIZE_STRING); |
|
| 560 | 560 | if (!is_string($airport)) |
| 561 | 561 | { |
| 562 | 562 | return false; |
| 563 | 563 | } else { |
| 564 | 564 | $additional_query .= " AND (spotter_output.departure_airport_icao = :airport OR spotter_output.arrival_airport_icao = :airport)"; |
| 565 | - $query_values = array_merge($query_values,array(':airport' => $airport)); |
|
| 565 | + $query_values = array_merge($query_values, array(':airport' => $airport)); |
|
| 566 | 566 | } |
| 567 | 567 | } |
| 568 | 568 | |
| 569 | 569 | if ($airport_country != "") |
| 570 | 570 | { |
| 571 | - $airport_country = filter_var($airport_country,FILTER_SANITIZE_STRING); |
|
| 571 | + $airport_country = filter_var($airport_country, FILTER_SANITIZE_STRING); |
|
| 572 | 572 | if (!is_string($airport_country)) |
| 573 | 573 | { |
| 574 | 574 | return false; |
| 575 | 575 | } else { |
| 576 | 576 | $additional_query .= " AND (spotter_output.departure_airport_country = :airport_country OR spotter_output.arrival_airport_country = :airport_country)"; |
| 577 | - $query_values = array_merge($query_values,array(':airport_country' => $airport_country)); |
|
| 577 | + $query_values = array_merge($query_values, array(':airport_country' => $airport_country)); |
|
| 578 | 578 | } |
| 579 | 579 | } |
| 580 | 580 | |
| 581 | 581 | if ($callsign != "") |
| 582 | 582 | { |
| 583 | - $callsign = filter_var($callsign,FILTER_SANITIZE_STRING); |
|
| 583 | + $callsign = filter_var($callsign, FILTER_SANITIZE_STRING); |
|
| 584 | 584 | if (!is_string($callsign)) |
| 585 | 585 | { |
| 586 | 586 | return false; |
@@ -588,79 +588,79 @@ discard block |
||
| 588 | 588 | $translate = $Translation->ident2icao($callsign); |
| 589 | 589 | if ($translate != $callsign) { |
| 590 | 590 | $additional_query .= " AND (spotter_output.ident = :callsign OR spotter_output.ident = :translate)"; |
| 591 | - $query_values = array_merge($query_values,array(':callsign' => $callsign,':translate' => $translate)); |
|
| 591 | + $query_values = array_merge($query_values, array(':callsign' => $callsign, ':translate' => $translate)); |
|
| 592 | 592 | } else { |
| 593 | 593 | $additional_query .= " AND spotter_output.ident = :callsign"; |
| 594 | - $query_values = array_merge($query_values,array(':callsign' => $callsign)); |
|
| 594 | + $query_values = array_merge($query_values, array(':callsign' => $callsign)); |
|
| 595 | 595 | } |
| 596 | 596 | } |
| 597 | 597 | } |
| 598 | 598 | |
| 599 | 599 | if ($owner != "") |
| 600 | 600 | { |
| 601 | - $owner = filter_var($owner,FILTER_SANITIZE_STRING); |
|
| 601 | + $owner = filter_var($owner, FILTER_SANITIZE_STRING); |
|
| 602 | 602 | if (!is_string($owner)) |
| 603 | 603 | { |
| 604 | 604 | return false; |
| 605 | 605 | } else { |
| 606 | 606 | $additional_query .= " AND spotter_output.owner_name = :owner"; |
| 607 | - $query_values = array_merge($query_values,array(':owner' => $owner)); |
|
| 607 | + $query_values = array_merge($query_values, array(':owner' => $owner)); |
|
| 608 | 608 | } |
| 609 | 609 | } |
| 610 | 610 | |
| 611 | 611 | if ($pilot_name != "") |
| 612 | 612 | { |
| 613 | - $pilot_name = filter_var($pilot_name,FILTER_SANITIZE_STRING); |
|
| 613 | + $pilot_name = filter_var($pilot_name, FILTER_SANITIZE_STRING); |
|
| 614 | 614 | if (!is_string($pilot_name)) |
| 615 | 615 | { |
| 616 | 616 | return false; |
| 617 | 617 | } else { |
| 618 | 618 | $additional_query .= " AND spotter_output.pilot_name = :pilot_name"; |
| 619 | - $query_values = array_merge($query_values,array(':pilot_name' => $pilot_name)); |
|
| 619 | + $query_values = array_merge($query_values, array(':pilot_name' => $pilot_name)); |
|
| 620 | 620 | } |
| 621 | 621 | } |
| 622 | 622 | |
| 623 | 623 | if ($pilot_id != "") |
| 624 | 624 | { |
| 625 | - $pilot_id = filter_var($pilot_id,FILTER_SANITIZE_NUMBER_INT); |
|
| 625 | + $pilot_id = filter_var($pilot_id, FILTER_SANITIZE_NUMBER_INT); |
|
| 626 | 626 | if (!is_string($pilot_id)) |
| 627 | 627 | { |
| 628 | 628 | return false; |
| 629 | 629 | } else { |
| 630 | 630 | $additional_query .= " AND spotter_output.pilot_id = :pilot_id"; |
| 631 | - $query_values = array_merge($query_values,array(':pilot_id' => $pilot_id)); |
|
| 631 | + $query_values = array_merge($query_values, array(':pilot_id' => $pilot_id)); |
|
| 632 | 632 | } |
| 633 | 633 | } |
| 634 | 634 | |
| 635 | 635 | if ($departure_airport_route != "") |
| 636 | 636 | { |
| 637 | - $departure_airport_route = filter_var($departure_airport_route,FILTER_SANITIZE_STRING); |
|
| 637 | + $departure_airport_route = filter_var($departure_airport_route, FILTER_SANITIZE_STRING); |
|
| 638 | 638 | if (!is_string($departure_airport_route)) |
| 639 | 639 | { |
| 640 | 640 | return false; |
| 641 | 641 | } else { |
| 642 | 642 | $additional_query .= " AND spotter_output.departure_airport_icao = :departure_airport_route"; |
| 643 | - $query_values = array_merge($query_values,array(':departure_airport_route' => $departure_airport_route)); |
|
| 643 | + $query_values = array_merge($query_values, array(':departure_airport_route' => $departure_airport_route)); |
|
| 644 | 644 | } |
| 645 | 645 | } |
| 646 | 646 | |
| 647 | 647 | if ($arrival_airport_route != "") |
| 648 | 648 | { |
| 649 | - $arrival_airport_route = filter_var($arrival_airport_route,FILTER_SANITIZE_STRING); |
|
| 649 | + $arrival_airport_route = filter_var($arrival_airport_route, FILTER_SANITIZE_STRING); |
|
| 650 | 650 | if (!is_string($arrival_airport_route)) |
| 651 | 651 | { |
| 652 | 652 | return false; |
| 653 | 653 | } else { |
| 654 | 654 | $additional_query .= " AND spotter_output.arrival_airport_icao = :arrival_airport_route"; |
| 655 | - $query_values = array_merge($query_values,array(':arrival_airport_route' => $arrival_airport_route)); |
|
| 655 | + $query_values = array_merge($query_values, array(':arrival_airport_route' => $arrival_airport_route)); |
|
| 656 | 656 | } |
| 657 | 657 | } |
| 658 | 658 | |
| 659 | 659 | if ($altitude != "") |
| 660 | 660 | { |
| 661 | 661 | $altitude_array = explode(",", $altitude); |
| 662 | - $altitude_array[0] = filter_var($altitude_array[0],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 663 | - $altitude_array[1] = filter_var($altitude_array[1],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 662 | + $altitude_array[0] = filter_var($altitude_array[0], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 663 | + $altitude_array[1] = filter_var($altitude_array[1], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 664 | 664 | |
| 665 | 665 | if ($altitude_array[1] != "") |
| 666 | 666 | { |
@@ -676,8 +676,8 @@ discard block |
||
| 676 | 676 | if ($date_posted != "") |
| 677 | 677 | { |
| 678 | 678 | $date_array = explode(",", $date_posted); |
| 679 | - $date_array[0] = filter_var($date_array[0],FILTER_SANITIZE_STRING); |
|
| 680 | - $date_array[1] = filter_var($date_array[1],FILTER_SANITIZE_STRING); |
|
| 679 | + $date_array[0] = filter_var($date_array[0], FILTER_SANITIZE_STRING); |
|
| 680 | + $date_array[1] = filter_var($date_array[1], FILTER_SANITIZE_STRING); |
|
| 681 | 681 | |
| 682 | 682 | if ($globalTimezone != '') { |
| 683 | 683 | date_default_timezone_set($globalTimezone); |
@@ -708,8 +708,8 @@ discard block |
||
| 708 | 708 | { |
| 709 | 709 | $limit_array = explode(",", $limit); |
| 710 | 710 | |
| 711 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
| 712 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
| 711 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
| 712 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
| 713 | 713 | |
| 714 | 714 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
| 715 | 715 | { |
@@ -738,23 +738,23 @@ discard block |
||
| 738 | 738 | |
| 739 | 739 | |
| 740 | 740 | if ($origLat != "" && $origLon != "" && $dist != "") { |
| 741 | - $dist = number_format($dist*0.621371,2,'.',''); // convert km to mile |
|
| 741 | + $dist = number_format($dist*0.621371, 2, '.', ''); // convert km to mile |
|
| 742 | 742 | |
| 743 | 743 | if ($globalDBdriver == 'mysql') { |
| 744 | - $query="SELECT spotter_output.*, 1.60935*3956 * 2 * ASIN(SQRT( POWER(SIN(($origLat - spotter_archive.latitude)*pi()/180/2),2)+COS( $origLat *pi()/180)*COS(spotter_archive.latitude*pi()/180)*POWER(SIN(($origLon-spotter_archive.longitude)*pi()/180/2),2))) as distance |
|
| 744 | + $query = "SELECT spotter_output.*, 1.60935*3956 * 2 * ASIN(SQRT( POWER(SIN(($origLat - spotter_archive.latitude)*pi()/180/2),2)+COS( $origLat *pi()/180)*COS(spotter_archive.latitude*pi()/180)*POWER(SIN(($origLon-spotter_archive.longitude)*pi()/180/2),2))) as distance |
|
| 745 | 745 | FROM spotter_output, spotter_archive".$filter_query." spotter_output.flightaware_id = spotter_archive.flightaware_id AND spotter_output.ident <> '' ".$additional_query."AND spotter_archive.longitude between ($origLon-$dist/cos(radians($origLat))*69) and ($origLon+$dist/cos(radians($origLat)*69)) and spotter_archive.latitude between ($origLat-($dist/69)) and ($origLat+($dist/69)) |
| 746 | 746 | AND (3956 * 2 * ASIN(SQRT( POWER(SIN(($origLat - spotter_archive.latitude)*pi()/180/2),2)+COS( $origLat *pi()/180)*COS(spotter_archive.latitude*pi()/180)*POWER(SIN(($origLon-spotter_archive.longitude)*pi()/180/2),2)))) < $dist".$orderby_query; |
| 747 | 747 | } else { |
| 748 | - $query="SELECT spotter_output.*, 1.60935 * 3956 * 2 * ASIN(SQRT( POWER(SIN(($origLat - CAST(spotter_archive.latitude as double precision))*pi()/180/2),2)+COS( $origLat *pi()/180)*COS(CAST(spotter_archive.latitude as double precision)*pi()/180)*POWER(SIN(($origLon-CAST(spotter_archive.longitude as double precision))*pi()/180/2),2))) as distance |
|
| 748 | + $query = "SELECT spotter_output.*, 1.60935 * 3956 * 2 * ASIN(SQRT( POWER(SIN(($origLat - CAST(spotter_archive.latitude as double precision))*pi()/180/2),2)+COS( $origLat *pi()/180)*COS(CAST(spotter_archive.latitude as double precision)*pi()/180)*POWER(SIN(($origLon-CAST(spotter_archive.longitude as double precision))*pi()/180/2),2))) as distance |
|
| 749 | 749 | FROM spotter_output, spotter_archive".$filter_query." spotter_output.flightaware_id = spotter_archive.flightaware_id AND spotter_output.ident <> '' ".$additional_query."AND CAST(spotter_archive.longitude as double precision) between ($origLon-$dist/cos(radians($origLat))*69) and ($origLon+$dist/cos(radians($origLat))*69) and CAST(spotter_archive.latitude as double precision) between ($origLat-($dist/69)) and ($origLat+($dist/69)) |
| 750 | 750 | AND (3956 * 2 * ASIN(SQRT( POWER(SIN(($origLat - CAST(spotter_archive.latitude as double precision))*pi()/180/2),2)+COS( $origLat *pi()/180)*COS(CAST(spotter_archive.latitude as double precision)*pi()/180)*POWER(SIN(($origLon-CAST(spotter_archive.longitude as double precision))*pi()/180/2),2)))) < $dist".$filter_query.$orderby_query; |
| 751 | 751 | } |
| 752 | 752 | } else { |
| 753 | - $query = "SELECT spotter_output.* FROM spotter_output ".$filter_query." spotter_output.ident <> '' |
|
| 753 | + $query = "SELECT spotter_output.* FROM spotter_output ".$filter_query." spotter_output.ident <> '' |
|
| 754 | 754 | ".$additional_query." |
| 755 | 755 | ".$orderby_query; |
| 756 | 756 | } |
| 757 | - $spotter_array = $this->getDataFromDB($query, $query_values,$limit_query); |
|
| 757 | + $spotter_array = $this->getDataFromDB($query, $query_values, $limit_query); |
|
| 758 | 758 | return $spotter_array; |
| 759 | 759 | } |
| 760 | 760 | |
@@ -777,8 +777,8 @@ discard block |
||
| 777 | 777 | { |
| 778 | 778 | $limit_array = explode(",", $limit); |
| 779 | 779 | |
| 780 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
| 781 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
| 780 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
| 781 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
| 782 | 782 | |
| 783 | 783 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
| 784 | 784 | { |
@@ -795,9 +795,9 @@ discard block |
||
| 795 | 795 | $orderby_query = " ORDER BY spotter_output.date DESC"; |
| 796 | 796 | } |
| 797 | 797 | |
| 798 | - $query = $global_query.$filter_query." ".$orderby_query; |
|
| 798 | + $query = $global_query.$filter_query." ".$orderby_query; |
|
| 799 | 799 | |
| 800 | - $spotter_array = $this->getDataFromDB($query, array(),$limit_query); |
|
| 800 | + $spotter_array = $this->getDataFromDB($query, array(), $limit_query); |
|
| 801 | 801 | |
| 802 | 802 | return $spotter_array; |
| 803 | 803 | } |
@@ -843,34 +843,34 @@ discard block |
||
| 843 | 843 | { |
| 844 | 844 | return false; |
| 845 | 845 | } else { |
| 846 | - if ($interval == "30m"){ |
|
| 846 | + if ($interval == "30m") { |
|
| 847 | 847 | $additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 30 MINUTE) <= $this_output.date '; |
| 848 | - } else if ($interval == "1h"){ |
|
| 848 | + } else if ($interval == "1h") { |
|
| 849 | 849 | $additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 HOUR) <= $this_output.date '; |
| 850 | - } else if ($interval == "3h"){ |
|
| 850 | + } else if ($interval == "3h") { |
|
| 851 | 851 | $additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 3 HOUR) <= $this_output.date '; |
| 852 | - } else if ($interval == "6h"){ |
|
| 852 | + } else if ($interval == "6h") { |
|
| 853 | 853 | $additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 6 HOUR) <= $this_output.date '; |
| 854 | - } else if ($interval == "12h"){ |
|
| 854 | + } else if ($interval == "12h") { |
|
| 855 | 855 | $additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 12 HOUR) <= $this_output.date '; |
| 856 | - } else if ($interval == "24h"){ |
|
| 856 | + } else if ($interval == "24h") { |
|
| 857 | 857 | $additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 24 HOUR) <= $this_output.date '; |
| 858 | - } else if ($interval == "7d"){ |
|
| 858 | + } else if ($interval == "7d") { |
|
| 859 | 859 | $additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 7 DAY) <= $this_output.date '; |
| 860 | - } else if ($interval == "30d"){ |
|
| 860 | + } else if ($interval == "30d") { |
|
| 861 | 861 | $additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 30 DAY) <= $this_output.date '; |
| 862 | 862 | } |
| 863 | 863 | } |
| 864 | 864 | } |
| 865 | 865 | |
| 866 | - $query = "SELECT spotter_output.*, ( 6371 * acos( cos( radians($lat) ) * cos( radians( latitude ) ) * cos( radians( longitude ) - radians($lng) ) + sin( radians($lat) ) * sin( radians( latitude ) ) ) ) AS distance FROM spotter_output |
|
| 866 | + $query = "SELECT spotter_output.*, ( 6371 * acos( cos( radians($lat) ) * cos( radians( latitude ) ) * cos( radians( longitude ) - radians($lng) ) + sin( radians($lat) ) * sin( radians( latitude ) ) ) ) AS distance FROM spotter_output |
|
| 867 | 867 | WHERE spotter_output.latitude <> '' |
| 868 | 868 | AND spotter_output.longitude <> '' |
| 869 | 869 | ".$additional_query." |
| 870 | 870 | HAVING distance < :radius |
| 871 | 871 | ORDER BY distance"; |
| 872 | 872 | |
| 873 | - $spotter_array = $this->getDataFromDB($query, array(':radius' => $radius),$limit_query); |
|
| 873 | + $spotter_array = $this->getDataFromDB($query, array(':radius' => $radius), $limit_query); |
|
| 874 | 874 | |
| 875 | 875 | return $spotter_array; |
| 876 | 876 | } |
@@ -882,21 +882,21 @@ discard block |
||
| 882 | 882 | * @return Array the spotter information |
| 883 | 883 | * |
| 884 | 884 | */ |
| 885 | - public function getNewestSpotterDataSortedByAircraftType($limit = '', $sort = '',$filter = array()) |
|
| 885 | + public function getNewestSpotterDataSortedByAircraftType($limit = '', $sort = '', $filter = array()) |
|
| 886 | 886 | { |
| 887 | 887 | global $global_query; |
| 888 | 888 | |
| 889 | 889 | date_default_timezone_set('UTC'); |
| 890 | 890 | |
| 891 | - $filter_query = $this->getFilter($filter,true,true); |
|
| 891 | + $filter_query = $this->getFilter($filter, true, true); |
|
| 892 | 892 | |
| 893 | 893 | $limit_query = ''; |
| 894 | 894 | if ($limit != "") |
| 895 | 895 | { |
| 896 | 896 | $limit_array = explode(",", $limit); |
| 897 | 897 | |
| 898 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
| 899 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
| 898 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
| 899 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
| 900 | 900 | |
| 901 | 901 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
| 902 | 902 | { |
@@ -913,7 +913,7 @@ discard block |
||
| 913 | 913 | $orderby_query = " ORDER BY spotter_output.date DESC "; |
| 914 | 914 | } |
| 915 | 915 | |
| 916 | - $query = $global_query." ".$filter_query." spotter_output.aircraft_name <> '' GROUP BY spotter_output.aircraft_icao,spotter_output.ident,spotter_output.spotter_id, spotter_output.flightaware_id, spotter_output.registration,spotter_output.airline_name,spotter_output.airline_icao,spotter_output.airline_country,spotter_output.airline_type,spotter_output.aircraft_icao,spotter_output.aircraft_name,spotter_output.aircraft_manufacturer,spotter_output.departure_airport_icao,spotter_output.departure_airport_name,spotter_output.departure_airport_city,spotter_output.departure_airport_country,spotter_output.departure_airport_time,spotter_output.arrival_airport_icao,spotter_output.arrival_airport_name,spotter_output.arrival_airport_city,spotter_output.arrival_airport_country,spotter_output.arrival_airport_time,spotter_output.route_stop,spotter_output.date,spotter_output.latitude,spotter_output.longitude,spotter_output.waypoints,spotter_output.altitude,spotter_output.heading,spotter_output.ground_speed,spotter_output.highlight,spotter_output.squawk,spotter_output.ModeS,spotter_output.pilot_id,spotter_output.pilot_name,spotter_output.verticalrate,spotter_output.owner_name,spotter_output.format_source,spotter_output.source_name,spotter_output.ground,spotter_output.last_ground,spotter_output.last_seen,spotter_output.last_latitude,spotter_output.last_longitude,spotter_output.last_altitude,spotter_output.last_ground_speed,spotter_output.real_arrival_airport_icao,spotter_output.real_arrival_airport_time ".$orderby_query; |
|
| 916 | + $query = $global_query." ".$filter_query." spotter_output.aircraft_name <> '' GROUP BY spotter_output.aircraft_icao,spotter_output.ident,spotter_output.spotter_id, spotter_output.flightaware_id, spotter_output.registration,spotter_output.airline_name,spotter_output.airline_icao,spotter_output.airline_country,spotter_output.airline_type,spotter_output.aircraft_icao,spotter_output.aircraft_name,spotter_output.aircraft_manufacturer,spotter_output.departure_airport_icao,spotter_output.departure_airport_name,spotter_output.departure_airport_city,spotter_output.departure_airport_country,spotter_output.departure_airport_time,spotter_output.arrival_airport_icao,spotter_output.arrival_airport_name,spotter_output.arrival_airport_city,spotter_output.arrival_airport_country,spotter_output.arrival_airport_time,spotter_output.route_stop,spotter_output.date,spotter_output.latitude,spotter_output.longitude,spotter_output.waypoints,spotter_output.altitude,spotter_output.heading,spotter_output.ground_speed,spotter_output.highlight,spotter_output.squawk,spotter_output.ModeS,spotter_output.pilot_id,spotter_output.pilot_name,spotter_output.verticalrate,spotter_output.owner_name,spotter_output.format_source,spotter_output.source_name,spotter_output.ground,spotter_output.last_ground,spotter_output.last_seen,spotter_output.last_latitude,spotter_output.last_longitude,spotter_output.last_altitude,spotter_output.last_ground_speed,spotter_output.real_arrival_airport_icao,spotter_output.real_arrival_airport_time ".$orderby_query; |
|
| 917 | 917 | |
| 918 | 918 | $spotter_array = $this->getDataFromDB($query, array(), $limit_query); |
| 919 | 919 | |
@@ -932,15 +932,15 @@ discard block |
||
| 932 | 932 | global $global_query; |
| 933 | 933 | |
| 934 | 934 | date_default_timezone_set('UTC'); |
| 935 | - $filter_query = $this->getFilter($filter,true,true); |
|
| 935 | + $filter_query = $this->getFilter($filter, true, true); |
|
| 936 | 936 | |
| 937 | 937 | $limit_query = ''; |
| 938 | 938 | if ($limit != "") |
| 939 | 939 | { |
| 940 | 940 | $limit_array = explode(",", $limit); |
| 941 | 941 | |
| 942 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
| 943 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
| 942 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
| 943 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
| 944 | 944 | |
| 945 | 945 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
| 946 | 946 | { |
@@ -957,7 +957,7 @@ discard block |
||
| 957 | 957 | $orderby_query = " ORDER BY spotter_output.date DESC "; |
| 958 | 958 | } |
| 959 | 959 | |
| 960 | - $query = $global_query." ".$filter_query." spotter_output.registration <> '' GROUP BY spotter_output.registration,spotter_output.ident,spotter_output.spotter_id, spotter_output.flightaware_id, spotter_output.registration,spotter_output.airline_name,spotter_output.airline_icao,spotter_output.airline_country,spotter_output.airline_type,spotter_output.aircraft_icao,spotter_output.aircraft_name,spotter_output.aircraft_manufacturer,spotter_output.departure_airport_icao,spotter_output.departure_airport_name,spotter_output.departure_airport_city,spotter_output.departure_airport_country,spotter_output.departure_airport_time,spotter_output.arrival_airport_icao,spotter_output.arrival_airport_name,spotter_output.arrival_airport_city,spotter_output.arrival_airport_country,spotter_output.arrival_airport_time,spotter_output.route_stop,spotter_output.date,spotter_output.latitude,spotter_output.longitude,spotter_output.waypoints,spotter_output.altitude,spotter_output.heading,spotter_output.ground_speed,spotter_output.highlight,spotter_output.squawk,spotter_output.ModeS,spotter_output.pilot_id,spotter_output.pilot_name,spotter_output.verticalrate,spotter_output.owner_name,spotter_output.format_source,spotter_output.source_name,spotter_output.ground,spotter_output.last_ground,spotter_output.last_seen,spotter_output.last_latitude,spotter_output.last_longitude,spotter_output.last_altitude,spotter_output.last_ground_speed,spotter_output.real_arrival_airport_icao,spotter_output.real_arrival_airport_time ".$orderby_query; |
|
| 960 | + $query = $global_query." ".$filter_query." spotter_output.registration <> '' GROUP BY spotter_output.registration,spotter_output.ident,spotter_output.spotter_id, spotter_output.flightaware_id, spotter_output.registration,spotter_output.airline_name,spotter_output.airline_icao,spotter_output.airline_country,spotter_output.airline_type,spotter_output.aircraft_icao,spotter_output.aircraft_name,spotter_output.aircraft_manufacturer,spotter_output.departure_airport_icao,spotter_output.departure_airport_name,spotter_output.departure_airport_city,spotter_output.departure_airport_country,spotter_output.departure_airport_time,spotter_output.arrival_airport_icao,spotter_output.arrival_airport_name,spotter_output.arrival_airport_city,spotter_output.arrival_airport_country,spotter_output.arrival_airport_time,spotter_output.route_stop,spotter_output.date,spotter_output.latitude,spotter_output.longitude,spotter_output.waypoints,spotter_output.altitude,spotter_output.heading,spotter_output.ground_speed,spotter_output.highlight,spotter_output.squawk,spotter_output.ModeS,spotter_output.pilot_id,spotter_output.pilot_name,spotter_output.verticalrate,spotter_output.owner_name,spotter_output.format_source,spotter_output.source_name,spotter_output.ground,spotter_output.last_ground,spotter_output.last_seen,spotter_output.last_latitude,spotter_output.last_longitude,spotter_output.last_altitude,spotter_output.last_ground_speed,spotter_output.real_arrival_airport_icao,spotter_output.real_arrival_airport_time ".$orderby_query; |
|
| 961 | 961 | |
| 962 | 962 | $spotter_array = $this->getDataFromDB($query, array(), $limit_query); |
| 963 | 963 | |
@@ -971,20 +971,20 @@ discard block |
||
| 971 | 971 | * @return Array the spotter information |
| 972 | 972 | * |
| 973 | 973 | */ |
| 974 | - public function getNewestSpotterDataSortedByAirline($limit = '', $sort = '',$filter = array()) |
|
| 974 | + public function getNewestSpotterDataSortedByAirline($limit = '', $sort = '', $filter = array()) |
|
| 975 | 975 | { |
| 976 | 976 | global $global_query; |
| 977 | 977 | |
| 978 | 978 | date_default_timezone_set('UTC'); |
| 979 | - $filter_query = $this->getFilter($filter,true,true); |
|
| 979 | + $filter_query = $this->getFilter($filter, true, true); |
|
| 980 | 980 | |
| 981 | 981 | $limit_query = ''; |
| 982 | 982 | if ($limit != "") |
| 983 | 983 | { |
| 984 | 984 | $limit_array = explode(",", $limit); |
| 985 | 985 | |
| 986 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
| 987 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
| 986 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
| 987 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
| 988 | 988 | |
| 989 | 989 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
| 990 | 990 | { |
@@ -1001,7 +1001,7 @@ discard block |
||
| 1001 | 1001 | $orderby_query = " ORDER BY spotter_output.date DESC "; |
| 1002 | 1002 | } |
| 1003 | 1003 | |
| 1004 | - $query = $global_query." ".$filter_query." spotter_output.airline_name <> '' GROUP BY spotter_output.airline_icao,spotter_output.ident,spotter_output.spotter_id, spotter_output.flightaware_id, spotter_output.registration,spotter_output.airline_name,spotter_output.airline_icao,spotter_output.airline_country,spotter_output.airline_type,spotter_output.aircraft_icao,spotter_output.aircraft_name,spotter_output.aircraft_manufacturer,spotter_output.departure_airport_icao,spotter_output.departure_airport_name,spotter_output.departure_airport_city,spotter_output.departure_airport_country,spotter_output.departure_airport_time,spotter_output.arrival_airport_icao,spotter_output.arrival_airport_name,spotter_output.arrival_airport_city,spotter_output.arrival_airport_country,spotter_output.arrival_airport_time,spotter_output.route_stop,spotter_output.date,spotter_output.latitude,spotter_output.longitude,spotter_output.waypoints,spotter_output.altitude,spotter_output.heading,spotter_output.ground_speed,spotter_output.highlight,spotter_output.squawk,spotter_output.ModeS,spotter_output.pilot_id,spotter_output.pilot_name,spotter_output.verticalrate,spotter_output.owner_name,spotter_output.format_source,spotter_output.source_name,spotter_output.ground,spotter_output.last_ground,spotter_output.last_seen,spotter_output.last_latitude,spotter_output.last_longitude,spotter_output.last_altitude,spotter_output.last_ground_speed,spotter_output.real_arrival_airport_icao,spotter_output.real_arrival_airport_time ".$orderby_query; |
|
| 1004 | + $query = $global_query." ".$filter_query." spotter_output.airline_name <> '' GROUP BY spotter_output.airline_icao,spotter_output.ident,spotter_output.spotter_id, spotter_output.flightaware_id, spotter_output.registration,spotter_output.airline_name,spotter_output.airline_icao,spotter_output.airline_country,spotter_output.airline_type,spotter_output.aircraft_icao,spotter_output.aircraft_name,spotter_output.aircraft_manufacturer,spotter_output.departure_airport_icao,spotter_output.departure_airport_name,spotter_output.departure_airport_city,spotter_output.departure_airport_country,spotter_output.departure_airport_time,spotter_output.arrival_airport_icao,spotter_output.arrival_airport_name,spotter_output.arrival_airport_city,spotter_output.arrival_airport_country,spotter_output.arrival_airport_time,spotter_output.route_stop,spotter_output.date,spotter_output.latitude,spotter_output.longitude,spotter_output.waypoints,spotter_output.altitude,spotter_output.heading,spotter_output.ground_speed,spotter_output.highlight,spotter_output.squawk,spotter_output.ModeS,spotter_output.pilot_id,spotter_output.pilot_name,spotter_output.verticalrate,spotter_output.owner_name,spotter_output.format_source,spotter_output.source_name,spotter_output.ground,spotter_output.last_ground,spotter_output.last_seen,spotter_output.last_latitude,spotter_output.last_longitude,spotter_output.last_altitude,spotter_output.last_ground_speed,spotter_output.real_arrival_airport_icao,spotter_output.real_arrival_airport_time ".$orderby_query; |
|
| 1005 | 1005 | |
| 1006 | 1006 | $spotter_array = $this->getDataFromDB($query, array(), $limit_query); |
| 1007 | 1007 | |
@@ -1021,7 +1021,7 @@ discard block |
||
| 1021 | 1021 | |
| 1022 | 1022 | date_default_timezone_set('UTC'); |
| 1023 | 1023 | |
| 1024 | - $filter_query = $this->getFilter($filter,true,true); |
|
| 1024 | + $filter_query = $this->getFilter($filter, true, true); |
|
| 1025 | 1025 | |
| 1026 | 1026 | $limit_query = ''; |
| 1027 | 1027 | |
@@ -1029,8 +1029,8 @@ discard block |
||
| 1029 | 1029 | { |
| 1030 | 1030 | $limit_array = explode(",", $limit); |
| 1031 | 1031 | |
| 1032 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
| 1033 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
| 1032 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
| 1033 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
| 1034 | 1034 | |
| 1035 | 1035 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
| 1036 | 1036 | { |
@@ -1047,7 +1047,7 @@ discard block |
||
| 1047 | 1047 | $orderby_query = " ORDER BY spotter_output.date DESC "; |
| 1048 | 1048 | } |
| 1049 | 1049 | |
| 1050 | - $query = $global_query." ".$filter_query." spotter_output.departure_airport_name <> '' AND spotter_output.departure_airport_icao <> 'NA' GROUP BY spotter_output.departure_airport_icao,spotter_output.ident,spotter_output.spotter_id, spotter_output.flightaware_id, spotter_output.registration,spotter_output.airline_name,spotter_output.airline_icao,spotter_output.airline_country,spotter_output.airline_type,spotter_output.aircraft_icao,spotter_output.aircraft_name,spotter_output.aircraft_manufacturer,spotter_output.departure_airport_icao,spotter_output.departure_airport_name,spotter_output.departure_airport_city,spotter_output.departure_airport_country,spotter_output.departure_airport_time,spotter_output.arrival_airport_icao,spotter_output.arrival_airport_name,spotter_output.arrival_airport_city,spotter_output.arrival_airport_country,spotter_output.arrival_airport_time,spotter_output.route_stop,spotter_output.date,spotter_output.latitude,spotter_output.longitude,spotter_output.waypoints,spotter_output.altitude,spotter_output.heading,spotter_output.ground_speed,spotter_output.highlight,spotter_output.squawk,spotter_output.ModeS,spotter_output.pilot_id,spotter_output.pilot_name,spotter_output.verticalrate,spotter_output.owner_name,spotter_output.format_source,spotter_output.source_name,spotter_output.ground,spotter_output.last_ground,spotter_output.last_seen,spotter_output.last_latitude,spotter_output.last_longitude,spotter_output.last_altitude,spotter_output.last_ground_speed,spotter_output.real_arrival_airport_icao,spotter_output.real_arrival_airport_time ".$orderby_query; |
|
| 1050 | + $query = $global_query." ".$filter_query." spotter_output.departure_airport_name <> '' AND spotter_output.departure_airport_icao <> 'NA' GROUP BY spotter_output.departure_airport_icao,spotter_output.ident,spotter_output.spotter_id, spotter_output.flightaware_id, spotter_output.registration,spotter_output.airline_name,spotter_output.airline_icao,spotter_output.airline_country,spotter_output.airline_type,spotter_output.aircraft_icao,spotter_output.aircraft_name,spotter_output.aircraft_manufacturer,spotter_output.departure_airport_icao,spotter_output.departure_airport_name,spotter_output.departure_airport_city,spotter_output.departure_airport_country,spotter_output.departure_airport_time,spotter_output.arrival_airport_icao,spotter_output.arrival_airport_name,spotter_output.arrival_airport_city,spotter_output.arrival_airport_country,spotter_output.arrival_airport_time,spotter_output.route_stop,spotter_output.date,spotter_output.latitude,spotter_output.longitude,spotter_output.waypoints,spotter_output.altitude,spotter_output.heading,spotter_output.ground_speed,spotter_output.highlight,spotter_output.squawk,spotter_output.ModeS,spotter_output.pilot_id,spotter_output.pilot_name,spotter_output.verticalrate,spotter_output.owner_name,spotter_output.format_source,spotter_output.source_name,spotter_output.ground,spotter_output.last_ground,spotter_output.last_seen,spotter_output.last_latitude,spotter_output.last_longitude,spotter_output.last_altitude,spotter_output.last_ground_speed,spotter_output.real_arrival_airport_icao,spotter_output.real_arrival_airport_time ".$orderby_query; |
|
| 1051 | 1051 | |
| 1052 | 1052 | $spotter_array = $this->getDataFromDB($query, array(), $limit_query); |
| 1053 | 1053 | |
@@ -1066,14 +1066,14 @@ discard block |
||
| 1066 | 1066 | global $global_query; |
| 1067 | 1067 | |
| 1068 | 1068 | date_default_timezone_set('UTC'); |
| 1069 | - $filter_query = $this->getFilter($filter,true,true); |
|
| 1069 | + $filter_query = $this->getFilter($filter, true, true); |
|
| 1070 | 1070 | $limit_query = ''; |
| 1071 | 1071 | if ($limit != "") |
| 1072 | 1072 | { |
| 1073 | 1073 | $limit_array = explode(",", $limit); |
| 1074 | 1074 | |
| 1075 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
| 1076 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
| 1075 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
| 1076 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
| 1077 | 1077 | |
| 1078 | 1078 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
| 1079 | 1079 | { |
@@ -1090,7 +1090,7 @@ discard block |
||
| 1090 | 1090 | $orderby_query = " ORDER BY spotter_output.date DESC "; |
| 1091 | 1091 | } |
| 1092 | 1092 | |
| 1093 | - $query = $global_query.$filter_query." spotter_output.arrival_airport_name <> '' AND spotter_output.arrival_airport_icao <> 'NA' GROUP BY spotter_output.arrival_airport_icao,spotter_output.ident,spotter_output.spotter_id, spotter_output.flightaware_id, spotter_output.registration,spotter_output.airline_name,spotter_output.airline_icao,spotter_output.airline_country,spotter_output.airline_type,spotter_output.aircraft_icao,spotter_output.aircraft_name,spotter_output.aircraft_manufacturer,spotter_output.departure_airport_icao,spotter_output.departure_airport_name,spotter_output.departure_airport_city,spotter_output.departure_airport_country,spotter_output.departure_airport_time,spotter_output.arrival_airport_icao,spotter_output.arrival_airport_name,spotter_output.arrival_airport_city,spotter_output.arrival_airport_country,spotter_output.arrival_airport_time,spotter_output.route_stop,spotter_output.date,spotter_output.latitude,spotter_output.longitude,spotter_output.waypoints,spotter_output.altitude,spotter_output.heading,spotter_output.ground_speed,spotter_output.highlight,spotter_output.squawk,spotter_output.ModeS,spotter_output.pilot_id,spotter_output.pilot_name,spotter_output.verticalrate,spotter_output.owner_name,spotter_output.format_source,spotter_output.source_name,spotter_output.ground,spotter_output.last_ground,spotter_output.last_seen,spotter_output.last_latitude,spotter_output.last_longitude,spotter_output.last_altitude,spotter_output.last_ground_speed,spotter_output.real_arrival_airport_icao,spotter_output.real_arrival_airport_time ".$orderby_query; |
|
| 1093 | + $query = $global_query.$filter_query." spotter_output.arrival_airport_name <> '' AND spotter_output.arrival_airport_icao <> 'NA' GROUP BY spotter_output.arrival_airport_icao,spotter_output.ident,spotter_output.spotter_id, spotter_output.flightaware_id, spotter_output.registration,spotter_output.airline_name,spotter_output.airline_icao,spotter_output.airline_country,spotter_output.airline_type,spotter_output.aircraft_icao,spotter_output.aircraft_name,spotter_output.aircraft_manufacturer,spotter_output.departure_airport_icao,spotter_output.departure_airport_name,spotter_output.departure_airport_city,spotter_output.departure_airport_country,spotter_output.departure_airport_time,spotter_output.arrival_airport_icao,spotter_output.arrival_airport_name,spotter_output.arrival_airport_city,spotter_output.arrival_airport_country,spotter_output.arrival_airport_time,spotter_output.route_stop,spotter_output.date,spotter_output.latitude,spotter_output.longitude,spotter_output.waypoints,spotter_output.altitude,spotter_output.heading,spotter_output.ground_speed,spotter_output.highlight,spotter_output.squawk,spotter_output.ModeS,spotter_output.pilot_id,spotter_output.pilot_name,spotter_output.verticalrate,spotter_output.owner_name,spotter_output.format_source,spotter_output.source_name,spotter_output.ground,spotter_output.last_ground,spotter_output.last_seen,spotter_output.last_latitude,spotter_output.last_longitude,spotter_output.last_altitude,spotter_output.last_ground_speed,spotter_output.real_arrival_airport_icao,spotter_output.real_arrival_airport_time ".$orderby_query; |
|
| 1094 | 1094 | |
| 1095 | 1095 | $spotter_array = $this->getDataFromDB($query, array(), $limit_query); |
| 1096 | 1096 | |
@@ -1114,9 +1114,9 @@ discard block |
||
| 1114 | 1114 | $query_values = array(':id' => $id); |
| 1115 | 1115 | |
| 1116 | 1116 | //$query = $global_query." WHERE spotter_output.ident <> '' ".$additional_query." "; |
| 1117 | - $query = $global_query." WHERE ".$additional_query." "; |
|
| 1117 | + $query = $global_query." WHERE ".$additional_query." "; |
|
| 1118 | 1118 | |
| 1119 | - $spotter_array = $this->getDataFromDB($query,$query_values); |
|
| 1119 | + $spotter_array = $this->getDataFromDB($query, $query_values); |
|
| 1120 | 1120 | |
| 1121 | 1121 | return $spotter_array; |
| 1122 | 1122 | } |
@@ -1154,8 +1154,8 @@ discard block |
||
| 1154 | 1154 | { |
| 1155 | 1155 | $limit_array = explode(",", $limit); |
| 1156 | 1156 | |
| 1157 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
| 1158 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
| 1157 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
| 1158 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
| 1159 | 1159 | |
| 1160 | 1160 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
| 1161 | 1161 | { |
@@ -1196,7 +1196,7 @@ discard block |
||
| 1196 | 1196 | $query_values = array(); |
| 1197 | 1197 | $limit_query = ''; |
| 1198 | 1198 | $additional_query = ''; |
| 1199 | - $filter_query = $this->getFilter($filter,true,true); |
|
| 1199 | + $filter_query = $this->getFilter($filter, true, true); |
|
| 1200 | 1200 | |
| 1201 | 1201 | if ($aircraft_type != "") |
| 1202 | 1202 | { |
@@ -1213,8 +1213,8 @@ discard block |
||
| 1213 | 1213 | { |
| 1214 | 1214 | $limit_array = explode(",", $limit); |
| 1215 | 1215 | |
| 1216 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
| 1217 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
| 1216 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
| 1217 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
| 1218 | 1218 | |
| 1219 | 1219 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
| 1220 | 1220 | { |
@@ -1254,7 +1254,7 @@ discard block |
||
| 1254 | 1254 | $query_values = array(); |
| 1255 | 1255 | $limit_query = ''; |
| 1256 | 1256 | $additional_query = ''; |
| 1257 | - $filter_query = $this->getFilter($filter,true,true); |
|
| 1257 | + $filter_query = $this->getFilter($filter, true, true); |
|
| 1258 | 1258 | |
| 1259 | 1259 | if ($registration != "") |
| 1260 | 1260 | { |
@@ -1271,8 +1271,8 @@ discard block |
||
| 1271 | 1271 | { |
| 1272 | 1272 | $limit_array = explode(",", $limit); |
| 1273 | 1273 | |
| 1274 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
| 1275 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
| 1274 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
| 1275 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
| 1276 | 1276 | |
| 1277 | 1277 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
| 1278 | 1278 | { |
@@ -1330,8 +1330,8 @@ discard block |
||
| 1330 | 1330 | { |
| 1331 | 1331 | $limit_array = explode(",", $limit); |
| 1332 | 1332 | |
| 1333 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
| 1334 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
| 1333 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
| 1334 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
| 1335 | 1335 | |
| 1336 | 1336 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
| 1337 | 1337 | { |
@@ -1385,8 +1385,8 @@ discard block |
||
| 1385 | 1385 | { |
| 1386 | 1386 | $limit_array = explode(",", $limit); |
| 1387 | 1387 | |
| 1388 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
| 1389 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
| 1388 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
| 1389 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
| 1390 | 1390 | |
| 1391 | 1391 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
| 1392 | 1392 | { |
@@ -1418,7 +1418,7 @@ discard block |
||
| 1418 | 1418 | * @return Array the spotter information |
| 1419 | 1419 | * |
| 1420 | 1420 | */ |
| 1421 | - public function getSpotterDataByDate($date = '', $limit = '', $sort = '',$filter = array()) |
|
| 1421 | + public function getSpotterDataByDate($date = '', $limit = '', $sort = '', $filter = array()) |
|
| 1422 | 1422 | { |
| 1423 | 1423 | global $global_query, $globalTimezone, $globalDBdriver; |
| 1424 | 1424 | |
@@ -1428,19 +1428,19 @@ discard block |
||
| 1428 | 1428 | |
| 1429 | 1429 | $filter_query = ''; |
| 1430 | 1430 | if (isset($filter['source']) && !empty($filter['source'])) { |
| 1431 | - $filter_query = " AND format_source IN ('".implode("','",$filter['source'])."')"; |
|
| 1431 | + $filter_query = " AND format_source IN ('".implode("','", $filter['source'])."')"; |
|
| 1432 | 1432 | } |
| 1433 | 1433 | if (isset($filter['airlines']) && !empty($filter['airlines'])) { |
| 1434 | - $filter_query .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.airline_icao IN ('".implode("','",$filter['airlines'])."')) so ON so.flightaware_id = spotter_live.flightaware_id"; |
|
| 1434 | + $filter_query .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.airline_icao IN ('".implode("','", $filter['airlines'])."')) so ON so.flightaware_id = spotter_live.flightaware_id"; |
|
| 1435 | 1435 | } |
| 1436 | 1436 | if (isset($filter['airlinestype']) && !empty($filter['airlinestype'])) { |
| 1437 | 1437 | $filter_query .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.airline_type = '".$filter['airlinestype']."') sa ON sa.flightaware_id = spotter_live.flightaware_id "; |
| 1438 | 1438 | } |
| 1439 | 1439 | if (isset($filter['source_aprs']) && !empty($filter['source_aprs'])) { |
| 1440 | - $filter_query = " AND format_source = 'aprs' AND source_name IN ('".implode("','",$filter['source_aprs'])."')"; |
|
| 1440 | + $filter_query = " AND format_source = 'aprs' AND source_name IN ('".implode("','", $filter['source_aprs'])."')"; |
|
| 1441 | 1441 | } |
| 1442 | 1442 | if (isset($filter['pilots_id']) && !empty($filter['pilots_id'])) { |
| 1443 | - $filter_query .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.pilot_id IN ('".implode("','",$filter['pilots_id'])."')) so ON so.flightaware_id = spotter_live.flightaware_id"; |
|
| 1443 | + $filter_query .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.pilot_id IN ('".implode("','", $filter['pilots_id'])."')) so ON so.flightaware_id = spotter_live.flightaware_id"; |
|
| 1444 | 1444 | } |
| 1445 | 1445 | |
| 1446 | 1446 | |
@@ -1468,8 +1468,8 @@ discard block |
||
| 1468 | 1468 | { |
| 1469 | 1469 | $limit_array = explode(",", $limit); |
| 1470 | 1470 | |
| 1471 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
| 1472 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
| 1471 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
| 1472 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
| 1473 | 1473 | |
| 1474 | 1474 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
| 1475 | 1475 | { |
@@ -1524,8 +1524,8 @@ discard block |
||
| 1524 | 1524 | { |
| 1525 | 1525 | $limit_array = explode(",", $limit); |
| 1526 | 1526 | |
| 1527 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
| 1528 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
| 1527 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
| 1528 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
| 1529 | 1529 | |
| 1530 | 1530 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
| 1531 | 1531 | { |
@@ -1581,8 +1581,8 @@ discard block |
||
| 1581 | 1581 | { |
| 1582 | 1582 | $limit_array = explode(",", $limit); |
| 1583 | 1583 | |
| 1584 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
| 1585 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
| 1584 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
| 1585 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
| 1586 | 1586 | |
| 1587 | 1587 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
| 1588 | 1588 | { |
@@ -1630,7 +1630,7 @@ discard block |
||
| 1630 | 1630 | { |
| 1631 | 1631 | return false; |
| 1632 | 1632 | } else { |
| 1633 | - $departure_airport_icao = filter_var($departure_airport_icao,FILTER_SANITIZE_STRING); |
|
| 1633 | + $departure_airport_icao = filter_var($departure_airport_icao, FILTER_SANITIZE_STRING); |
|
| 1634 | 1634 | $additional_query .= " AND (spotter_output.departure_airport_icao = :departure_airport_icao)"; |
| 1635 | 1635 | $query_values = array(':departure_airport_icao' => $departure_airport_icao); |
| 1636 | 1636 | } |
@@ -1642,9 +1642,9 @@ discard block |
||
| 1642 | 1642 | { |
| 1643 | 1643 | return false; |
| 1644 | 1644 | } else { |
| 1645 | - $arrival_airport_icao = filter_var($arrival_airport_icao,FILTER_SANITIZE_STRING); |
|
| 1645 | + $arrival_airport_icao = filter_var($arrival_airport_icao, FILTER_SANITIZE_STRING); |
|
| 1646 | 1646 | $additional_query .= " AND (spotter_output.arrival_airport_icao = :arrival_airport_icao)"; |
| 1647 | - $query_values = array_merge($query_values,array(':arrival_airport_icao' => $arrival_airport_icao)); |
|
| 1647 | + $query_values = array_merge($query_values, array(':arrival_airport_icao' => $arrival_airport_icao)); |
|
| 1648 | 1648 | } |
| 1649 | 1649 | } |
| 1650 | 1650 | |
@@ -1652,8 +1652,8 @@ discard block |
||
| 1652 | 1652 | { |
| 1653 | 1653 | $limit_array = explode(",", $limit); |
| 1654 | 1654 | |
| 1655 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
| 1656 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
| 1655 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
| 1656 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
| 1657 | 1657 | |
| 1658 | 1658 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
| 1659 | 1659 | { |
@@ -1692,15 +1692,15 @@ discard block |
||
| 1692 | 1692 | global $global_query; |
| 1693 | 1693 | |
| 1694 | 1694 | date_default_timezone_set('UTC'); |
| 1695 | - $filter_query = $this->getFilter($filter,true,true); |
|
| 1695 | + $filter_query = $this->getFilter($filter, true, true); |
|
| 1696 | 1696 | $limit_query = ''; |
| 1697 | 1697 | |
| 1698 | 1698 | if ($limit != "") |
| 1699 | 1699 | { |
| 1700 | 1700 | $limit_array = explode(",", $limit); |
| 1701 | 1701 | |
| 1702 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
| 1703 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
| 1702 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
| 1703 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
| 1704 | 1704 | |
| 1705 | 1705 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
| 1706 | 1706 | { |
@@ -1717,7 +1717,7 @@ discard block |
||
| 1717 | 1717 | $orderby_query = " ORDER BY spotter_output.date DESC"; |
| 1718 | 1718 | } |
| 1719 | 1719 | |
| 1720 | - $query = $global_query.$filter_query." spotter_output.highlight <> '' ".$orderby_query; |
|
| 1720 | + $query = $global_query.$filter_query." spotter_output.highlight <> '' ".$orderby_query; |
|
| 1721 | 1721 | |
| 1722 | 1722 | $spotter_array = $this->getDataFromDB($query, array(), $limit_query); |
| 1723 | 1723 | |
@@ -1730,19 +1730,19 @@ discard block |
||
| 1730 | 1730 | * @return String the highlight text |
| 1731 | 1731 | * |
| 1732 | 1732 | */ |
| 1733 | - public function getHighlightByRegistration($registration,$filter = array()) |
|
| 1733 | + public function getHighlightByRegistration($registration, $filter = array()) |
|
| 1734 | 1734 | { |
| 1735 | 1735 | global $global_query; |
| 1736 | 1736 | |
| 1737 | 1737 | date_default_timezone_set('UTC'); |
| 1738 | - $filter_query = $this->getFilter($filter,true,true); |
|
| 1739 | - $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
|
| 1738 | + $filter_query = $this->getFilter($filter, true, true); |
|
| 1739 | + $registration = filter_var($registration, FILTER_SANITIZE_STRING); |
|
| 1740 | 1740 | |
| 1741 | - $query = $global_query.$filter_query." spotter_output.highlight <> '' AND spotter_output.registration = :registration"; |
|
| 1741 | + $query = $global_query.$filter_query." spotter_output.highlight <> '' AND spotter_output.registration = :registration"; |
|
| 1742 | 1742 | $sth = $this->db->prepare($query); |
| 1743 | 1743 | $sth->execute(array(':registration' => $registration)); |
| 1744 | 1744 | |
| 1745 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 1745 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 1746 | 1746 | { |
| 1747 | 1747 | $highlight = $row['highlight']; |
| 1748 | 1748 | } |
@@ -1758,14 +1758,14 @@ discard block |
||
| 1758 | 1758 | * @return String usage |
| 1759 | 1759 | * |
| 1760 | 1760 | */ |
| 1761 | - public function getSquawkUsage($squawk = '',$country = 'FR') |
|
| 1761 | + public function getSquawkUsage($squawk = '', $country = 'FR') |
|
| 1762 | 1762 | { |
| 1763 | 1763 | |
| 1764 | - $squawk = filter_var($squawk,FILTER_SANITIZE_STRING); |
|
| 1765 | - $country = filter_var($country,FILTER_SANITIZE_STRING); |
|
| 1764 | + $squawk = filter_var($squawk, FILTER_SANITIZE_STRING); |
|
| 1765 | + $country = filter_var($country, FILTER_SANITIZE_STRING); |
|
| 1766 | 1766 | |
| 1767 | 1767 | $query = "SELECT squawk.* FROM squawk WHERE squawk.code = :squawk AND squawk.country = :country LIMIT 1"; |
| 1768 | - $query_values = array(':squawk' => ltrim($squawk,'0'), ':country' => $country); |
|
| 1768 | + $query_values = array(':squawk' => ltrim($squawk, '0'), ':country' => $country); |
|
| 1769 | 1769 | |
| 1770 | 1770 | $sth = $this->db->prepare($query); |
| 1771 | 1771 | $sth->execute($query_values); |
@@ -1786,9 +1786,9 @@ discard block |
||
| 1786 | 1786 | public function getAirportIcao($airport_iata = '') |
| 1787 | 1787 | { |
| 1788 | 1788 | |
| 1789 | - $airport_iata = filter_var($airport_iata,FILTER_SANITIZE_STRING); |
|
| 1789 | + $airport_iata = filter_var($airport_iata, FILTER_SANITIZE_STRING); |
|
| 1790 | 1790 | |
| 1791 | - $query = "SELECT airport.* FROM airport WHERE airport.iata = :airport LIMIT 1"; |
|
| 1791 | + $query = "SELECT airport.* FROM airport WHERE airport.iata = :airport LIMIT 1"; |
|
| 1792 | 1792 | $query_values = array(':airport' => $airport_iata); |
| 1793 | 1793 | |
| 1794 | 1794 | $sth = $this->db->prepare($query); |
@@ -1809,12 +1809,12 @@ discard block |
||
| 1809 | 1809 | * @return Float distance to the airport |
| 1810 | 1810 | * |
| 1811 | 1811 | */ |
| 1812 | - public function getAirportDistance($airport_icao,$latitude,$longitude) |
|
| 1812 | + public function getAirportDistance($airport_icao, $latitude, $longitude) |
|
| 1813 | 1813 | { |
| 1814 | 1814 | |
| 1815 | - $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
|
| 1815 | + $airport_icao = filter_var($airport_icao, FILTER_SANITIZE_STRING); |
|
| 1816 | 1816 | |
| 1817 | - $query = "SELECT airport.latitude, airport.longitude FROM airport WHERE airport.icao = :airport LIMIT 1"; |
|
| 1817 | + $query = "SELECT airport.latitude, airport.longitude FROM airport WHERE airport.icao = :airport LIMIT 1"; |
|
| 1818 | 1818 | $query_values = array(':airport' => $airport_icao); |
| 1819 | 1819 | $sth = $this->db->prepare($query); |
| 1820 | 1820 | $sth->execute($query_values); |
@@ -1823,7 +1823,7 @@ discard block |
||
| 1823 | 1823 | $airport_latitude = $row['latitude']; |
| 1824 | 1824 | $airport_longitude = $row['longitude']; |
| 1825 | 1825 | $Common = new Common(); |
| 1826 | - return $Common->distance($latitude,$longitude,$airport_latitude,$airport_longitude); |
|
| 1826 | + return $Common->distance($latitude, $longitude, $airport_latitude, $airport_longitude); |
|
| 1827 | 1827 | } else return ''; |
| 1828 | 1828 | } |
| 1829 | 1829 | |
@@ -1837,11 +1837,11 @@ discard block |
||
| 1837 | 1837 | public function getAllAirportInfo($airport = '') |
| 1838 | 1838 | { |
| 1839 | 1839 | |
| 1840 | - $airport = filter_var($airport,FILTER_SANITIZE_STRING); |
|
| 1840 | + $airport = filter_var($airport, FILTER_SANITIZE_STRING); |
|
| 1841 | 1841 | |
| 1842 | 1842 | $query_values = array(); |
| 1843 | 1843 | if ($airport == 'NA') { |
| 1844 | - return array(array('name' => 'Not available','city' => 'N/A', 'country' => 'N/A','iata' => 'NA','icao' => 'NA','altitude' => NULL,'latitude' => 0,'longitude' => 0,'type' => 'NA','home_link' => '','wikipedia_link' => '','image_thumb' => '', 'image' => '')); |
|
| 1844 | + return array(array('name' => 'Not available', 'city' => 'N/A', 'country' => 'N/A', 'iata' => 'NA', 'icao' => 'NA', 'altitude' => NULL, 'latitude' => 0, 'longitude' => 0, 'type' => 'NA', 'home_link' => '', 'wikipedia_link' => '', 'image_thumb' => '', 'image' => '')); |
|
| 1845 | 1845 | } elseif ($airport == '') { |
| 1846 | 1846 | $query = "SELECT airport.name, airport.city, airport.country, airport.iata, airport.icao, airport.latitude, airport.longitude, airport.altitude, airport.type, airport.home_link, airport.wikipedia_link, airport.image_thumb, airport.image FROM airport"; |
| 1847 | 1847 | } else { |
@@ -1889,14 +1889,14 @@ discard block |
||
| 1889 | 1889 | { |
| 1890 | 1890 | $lst_countries = ''; |
| 1891 | 1891 | foreach ($countries as $country) { |
| 1892 | - $country = filter_var($country,FILTER_SANITIZE_STRING); |
|
| 1892 | + $country = filter_var($country, FILTER_SANITIZE_STRING); |
|
| 1893 | 1893 | if ($lst_countries == '') { |
| 1894 | 1894 | $lst_countries = "'".$country."'"; |
| 1895 | 1895 | } else { |
| 1896 | 1896 | $lst_countries .= ",'".$country."'"; |
| 1897 | 1897 | } |
| 1898 | 1898 | } |
| 1899 | - $query = "SELECT airport.* FROM airport WHERE airport.country IN (".$lst_countries.")"; |
|
| 1899 | + $query = "SELECT airport.* FROM airport WHERE airport.country IN (".$lst_countries.")"; |
|
| 1900 | 1900 | |
| 1901 | 1901 | $sth = $this->db->prepare($query); |
| 1902 | 1902 | $sth->execute(); |
@@ -1904,7 +1904,7 @@ discard block |
||
| 1904 | 1904 | $airport_array = array(); |
| 1905 | 1905 | $temp_array = array(); |
| 1906 | 1906 | |
| 1907 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 1907 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 1908 | 1908 | { |
| 1909 | 1909 | $temp_array['name'] = $row['name']; |
| 1910 | 1910 | $temp_array['city'] = $row['city']; |
@@ -1932,10 +1932,10 @@ discard block |
||
| 1932 | 1932 | { |
| 1933 | 1933 | global $globalDBdriver; |
| 1934 | 1934 | if (is_array($coord)) { |
| 1935 | - $minlong = filter_var($coord[0],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 1936 | - $minlat = filter_var($coord[1],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 1937 | - $maxlong = filter_var($coord[2],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 1938 | - $maxlat = filter_var($coord[3],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 1935 | + $minlong = filter_var($coord[0], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 1936 | + $minlat = filter_var($coord[1], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 1937 | + $maxlong = filter_var($coord[2], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 1938 | + $maxlat = filter_var($coord[3], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 1939 | 1939 | } else return array(); |
| 1940 | 1940 | if ($globalDBdriver == 'mysql') { |
| 1941 | 1941 | $query = "SELECT airport.* FROM airport WHERE airport.latitude BETWEEN ".$minlat." AND ".$maxlat." AND airport.longitude BETWEEN ".$minlong." AND ".$maxlong." AND airport.type != 'closed'"; |
@@ -1947,7 +1947,7 @@ discard block |
||
| 1947 | 1947 | |
| 1948 | 1948 | $airport_array = array(); |
| 1949 | 1949 | |
| 1950 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 1950 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 1951 | 1951 | { |
| 1952 | 1952 | $temp_array = $row; |
| 1953 | 1953 | |
@@ -1967,13 +1967,13 @@ discard block |
||
| 1967 | 1967 | public function getAllWaypointsInfobyCoord($coord) |
| 1968 | 1968 | { |
| 1969 | 1969 | if (is_array($coord)) { |
| 1970 | - $minlong = filter_var($coord[0],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 1971 | - $minlat = filter_var($coord[1],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 1972 | - $maxlong = filter_var($coord[2],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 1973 | - $maxlat = filter_var($coord[3],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 1970 | + $minlong = filter_var($coord[0], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 1971 | + $minlat = filter_var($coord[1], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 1972 | + $maxlong = filter_var($coord[2], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 1973 | + $maxlat = filter_var($coord[3], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 1974 | 1974 | } else return array(); |
| 1975 | 1975 | //$query = "SELECT waypoints.* FROM waypoints WHERE waypoints.latitude_begin BETWEEN ".$minlat." AND ".$maxlat." AND waypoints.longitude_begin BETWEEN ".$minlong." AND ".$maxlong; |
| 1976 | - $query = "SELECT waypoints.* FROM waypoints WHERE (waypoints.latitude_begin BETWEEN ".$minlat." AND ".$maxlat." AND waypoints.longitude_begin BETWEEN ".$minlong." AND ".$maxlong.") OR (waypoints.latitude_end BETWEEN ".$minlat." AND ".$maxlat." AND waypoints.longitude_end BETWEEN ".$minlong." AND ".$maxlong.")"; |
|
| 1976 | + $query = "SELECT waypoints.* FROM waypoints WHERE (waypoints.latitude_begin BETWEEN ".$minlat." AND ".$maxlat." AND waypoints.longitude_begin BETWEEN ".$minlong." AND ".$maxlong.") OR (waypoints.latitude_end BETWEEN ".$minlat." AND ".$maxlat." AND waypoints.longitude_end BETWEEN ".$minlong." AND ".$maxlong.")"; |
|
| 1977 | 1977 | //$query = "SELECT waypoints.* FROM waypoints"; |
| 1978 | 1978 | //$query = "SELECT waypoints.* FROM waypoints INNER JOIN (SELECT waypoints.* FROM waypoints WHERE waypoints.latitude_begin BETWEEN ".$minlat." AND ".$maxlat." AND waypoints.longitude_begin BETWEEN ".$minlong." AND ".$maxlong.") w ON w.name_end = waypoints.name_begin OR w.name_begin = waypoints.name_begin OR w.name_begin = waypoints.name_end OR w.name_end = waypoints.name_end"; |
| 1979 | 1979 | //$query = "SELECT * FROM waypoints LEFT JOIN waypoints w ON waypoints.name_end = w.name_begin WHERE waypoints.latitude_begin BETWEEN ".$minlat." AND ".$maxlat." AND waypoints.longitude_begin BETWEEN ".$minlong." AND ".$maxlong; |
@@ -1985,7 +1985,7 @@ discard block |
||
| 1985 | 1985 | |
| 1986 | 1986 | $waypoints_array = array(); |
| 1987 | 1987 | |
| 1988 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 1988 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 1989 | 1989 | { |
| 1990 | 1990 | $temp_array = $row; |
| 1991 | 1991 | |
@@ -2007,10 +2007,10 @@ discard block |
||
| 2007 | 2007 | { |
| 2008 | 2008 | global $globalUseRealAirlines; |
| 2009 | 2009 | if (isset($globalUseRealAirlines) && $globalUseRealAirlines) $fromsource = NULL; |
| 2010 | - $airline_icao = strtoupper(filter_var($airline_icao,FILTER_SANITIZE_STRING)); |
|
| 2010 | + $airline_icao = strtoupper(filter_var($airline_icao, FILTER_SANITIZE_STRING)); |
|
| 2011 | 2011 | if ($airline_icao == 'NA') { |
| 2012 | 2012 | $airline_array = array(); |
| 2013 | - $airline_array[] = array('name' => 'Not Available','iata' => 'NA', 'icao' => 'NA', 'callsign' => '', 'country' => 'NA', 'type' =>''); |
|
| 2013 | + $airline_array[] = array('name' => 'Not Available', 'iata' => 'NA', 'icao' => 'NA', 'callsign' => '', 'country' => 'NA', 'type' =>''); |
|
| 2014 | 2014 | return $airline_array; |
| 2015 | 2015 | } else { |
| 2016 | 2016 | if (strlen($airline_icao) == 2) { |
@@ -2031,7 +2031,7 @@ discard block |
||
| 2031 | 2031 | if ($fromsource === NULL) { |
| 2032 | 2032 | $sth->execute(array(':airline_icao' => $airline_icao)); |
| 2033 | 2033 | } else { |
| 2034 | - $sth->execute(array(':airline_icao' => $airline_icao,':fromsource' => $fromsource)); |
|
| 2034 | + $sth->execute(array(':airline_icao' => $airline_icao, ':fromsource' => $fromsource)); |
|
| 2035 | 2035 | } |
| 2036 | 2036 | /* |
| 2037 | 2037 | $airline_array = array(); |
@@ -2072,12 +2072,12 @@ discard block |
||
| 2072 | 2072 | */ |
| 2073 | 2073 | public function getAllAircraftInfo($aircraft_type) |
| 2074 | 2074 | { |
| 2075 | - $aircraft_type = filter_var($aircraft_type,FILTER_SANITIZE_STRING); |
|
| 2075 | + $aircraft_type = filter_var($aircraft_type, FILTER_SANITIZE_STRING); |
|
| 2076 | 2076 | |
| 2077 | 2077 | if ($aircraft_type == 'NA') { |
| 2078 | - return array(array('icao' => 'NA','type' => 'Not Available', 'manufacturer' => 'Not Available', 'aircraft_shadow' => NULL)); |
|
| 2078 | + return array(array('icao' => 'NA', 'type' => 'Not Available', 'manufacturer' => 'Not Available', 'aircraft_shadow' => NULL)); |
|
| 2079 | 2079 | } |
| 2080 | - $query = "SELECT aircraft.icao, aircraft.type,aircraft.manufacturer,aircraft.aircraft_shadow FROM aircraft WHERE aircraft.icao = :aircraft_type"; |
|
| 2080 | + $query = "SELECT aircraft.icao, aircraft.type,aircraft.manufacturer,aircraft.aircraft_shadow FROM aircraft WHERE aircraft.icao = :aircraft_type"; |
|
| 2081 | 2081 | |
| 2082 | 2082 | $sth = $this->db->prepare($query); |
| 2083 | 2083 | $sth->execute(array(':aircraft_type' => $aircraft_type)); |
@@ -2109,7 +2109,7 @@ discard block |
||
| 2109 | 2109 | */ |
| 2110 | 2110 | public function getAircraftIcao($aircraft_type) |
| 2111 | 2111 | { |
| 2112 | - $aircraft_type = filter_var($aircraft_type,FILTER_SANITIZE_STRING); |
|
| 2112 | + $aircraft_type = filter_var($aircraft_type, FILTER_SANITIZE_STRING); |
|
| 2113 | 2113 | $all_aircraft = array('737-300' => 'B733', |
| 2114 | 2114 | '777-200' => 'B772', |
| 2115 | 2115 | '777-200ER' => 'B772', |
@@ -2121,10 +2121,10 @@ discard block |
||
| 2121 | 2121 | 'A380' => 'A388'); |
| 2122 | 2122 | if (isset($all_aircraft[$aircraft_type])) return $all_aircraft[$aircraft_type]; |
| 2123 | 2123 | |
| 2124 | - $query = "SELECT aircraft.icao FROM aircraft WHERE aircraft.type LIKE :saircraft_type OR aircraft.type = :aircraft_type OR aircraft.icao = :aircraft_type LIMIT 1"; |
|
| 2124 | + $query = "SELECT aircraft.icao FROM aircraft WHERE aircraft.type LIKE :saircraft_type OR aircraft.type = :aircraft_type OR aircraft.icao = :aircraft_type LIMIT 1"; |
|
| 2125 | 2125 | $aircraft_type = strtoupper($aircraft_type); |
| 2126 | 2126 | $sth = $this->db->prepare($query); |
| 2127 | - $sth->execute(array(':saircraft_type' => '%'.$aircraft_type.'%',':aircraft_type' => $aircraft_type,)); |
|
| 2127 | + $sth->execute(array(':saircraft_type' => '%'.$aircraft_type.'%', ':aircraft_type' => $aircraft_type,)); |
|
| 2128 | 2128 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
| 2129 | 2129 | if (isset($result[0]['icao'])) return $result[0]['icao']; |
| 2130 | 2130 | else return ''; |
@@ -2139,9 +2139,9 @@ discard block |
||
| 2139 | 2139 | */ |
| 2140 | 2140 | public function getAllAircraftType($aircraft_modes) |
| 2141 | 2141 | { |
| 2142 | - $aircraft_modes = filter_var($aircraft_modes,FILTER_SANITIZE_STRING); |
|
| 2142 | + $aircraft_modes = filter_var($aircraft_modes, FILTER_SANITIZE_STRING); |
|
| 2143 | 2143 | |
| 2144 | - $query = "SELECT aircraft_modes.ICAOTypeCode FROM aircraft_modes WHERE aircraft_modes.ModeS = :aircraft_modes LIMIT 1"; |
|
| 2144 | + $query = "SELECT aircraft_modes.ICAOTypeCode FROM aircraft_modes WHERE aircraft_modes.ModeS = :aircraft_modes LIMIT 1"; |
|
| 2145 | 2145 | |
| 2146 | 2146 | $sth = $this->db->prepare($query); |
| 2147 | 2147 | $sth->execute(array(':aircraft_modes' => $aircraft_modes)); |
@@ -2161,8 +2161,8 @@ discard block |
||
| 2161 | 2161 | */ |
| 2162 | 2162 | public function getOperator($operator) |
| 2163 | 2163 | { |
| 2164 | - $operator = filter_var($operator,FILTER_SANITIZE_STRING); |
|
| 2165 | - $query = "SELECT translation.operator_correct FROM translation WHERE translation.operator = :operator LIMIT 1"; |
|
| 2164 | + $operator = filter_var($operator, FILTER_SANITIZE_STRING); |
|
| 2165 | + $query = "SELECT translation.operator_correct FROM translation WHERE translation.operator = :operator LIMIT 1"; |
|
| 2166 | 2166 | |
| 2167 | 2167 | $sth = $this->db->prepare($query); |
| 2168 | 2168 | $sth->execute(array(':operator' => $operator)); |
@@ -2182,9 +2182,9 @@ discard block |
||
| 2182 | 2182 | */ |
| 2183 | 2183 | public function getRouteInfo($callsign) |
| 2184 | 2184 | { |
| 2185 | - $callsign = filter_var($callsign,FILTER_SANITIZE_STRING); |
|
| 2185 | + $callsign = filter_var($callsign, FILTER_SANITIZE_STRING); |
|
| 2186 | 2186 | if ($callsign == '') return array(); |
| 2187 | - $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"; |
|
| 2187 | + $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"; |
|
| 2188 | 2188 | |
| 2189 | 2189 | $sth = $this->db->prepare($query); |
| 2190 | 2190 | $sth->execute(array(':callsign' => $callsign)); |
@@ -2204,9 +2204,9 @@ discard block |
||
| 2204 | 2204 | */ |
| 2205 | 2205 | public function getAircraftInfoByRegistration($registration) |
| 2206 | 2206 | { |
| 2207 | - $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
|
| 2207 | + $registration = filter_var($registration, FILTER_SANITIZE_STRING); |
|
| 2208 | 2208 | |
| 2209 | - $query = "SELECT spotter_output.aircraft_icao, spotter_output.aircraft_name, spotter_output.aircraft_manufacturer, spotter_output.airline_icao FROM spotter_output WHERE spotter_output.registration = :registration"; |
|
| 2209 | + $query = "SELECT spotter_output.aircraft_icao, spotter_output.aircraft_name, spotter_output.aircraft_manufacturer, spotter_output.airline_icao FROM spotter_output WHERE spotter_output.registration = :registration"; |
|
| 2210 | 2210 | |
| 2211 | 2211 | $sth = $this->db->prepare($query); |
| 2212 | 2212 | $sth->execute(array(':registration' => $registration)); |
@@ -2214,7 +2214,7 @@ discard block |
||
| 2214 | 2214 | $aircraft_array = array(); |
| 2215 | 2215 | $temp_array = array(); |
| 2216 | 2216 | |
| 2217 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2217 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2218 | 2218 | { |
| 2219 | 2219 | $temp_array['airline_icao'] = $row['airline_icao']; |
| 2220 | 2220 | $temp_array['aircraft_icao'] = $row['aircraft_icao']; |
@@ -2236,10 +2236,10 @@ discard block |
||
| 2236 | 2236 | */ |
| 2237 | 2237 | public function getAircraftOwnerByRegistration($registration) |
| 2238 | 2238 | { |
| 2239 | - $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
|
| 2239 | + $registration = filter_var($registration, FILTER_SANITIZE_STRING); |
|
| 2240 | 2240 | $Connection = new Connection($this->db); |
| 2241 | 2241 | if ($Connection->tableExists('aircraft_owner')) { |
| 2242 | - $query = "SELECT aircraft_owner.base, aircraft_owner.owner, aircraft_owner.date_first_reg FROM aircraft_owner WHERE registration = :registration LIMIT 1"; |
|
| 2242 | + $query = "SELECT aircraft_owner.base, aircraft_owner.owner, aircraft_owner.date_first_reg FROM aircraft_owner WHERE registration = :registration LIMIT 1"; |
|
| 2243 | 2243 | $sth = $this->db->prepare($query); |
| 2244 | 2244 | $sth->execute(array(':registration' => $registration)); |
| 2245 | 2245 | |
@@ -2257,7 +2257,7 @@ discard block |
||
| 2257 | 2257 | public function getAllFlightsforSitemap() |
| 2258 | 2258 | { |
| 2259 | 2259 | //$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 "; |
| 2260 | - $query = "SELECT spotter_output.spotter_id FROM spotter_output ORDER BY spotter_id DESC LIMIT 200 OFFSET 0"; |
|
| 2260 | + $query = "SELECT spotter_output.spotter_id FROM spotter_output ORDER BY spotter_id DESC LIMIT 200 OFFSET 0"; |
|
| 2261 | 2261 | |
| 2262 | 2262 | $sth = $this->db->prepare($query); |
| 2263 | 2263 | $sth->execute(); |
@@ -2304,7 +2304,7 @@ discard block |
||
| 2304 | 2304 | $manufacturer_array = array(); |
| 2305 | 2305 | $temp_array = array(); |
| 2306 | 2306 | |
| 2307 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2307 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2308 | 2308 | { |
| 2309 | 2309 | $temp_array['aircraft_manufacturer'] = $row['aircraft_manufacturer']; |
| 2310 | 2310 | |
@@ -2338,7 +2338,7 @@ discard block |
||
| 2338 | 2338 | $aircraft_array = array(); |
| 2339 | 2339 | $temp_array = array(); |
| 2340 | 2340 | |
| 2341 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2341 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2342 | 2342 | { |
| 2343 | 2343 | $temp_array['aircraft_icao'] = $row['aircraft_icao']; |
| 2344 | 2344 | $temp_array['aircraft_manufacturer'] = $row['aircraft_manufacturer']; |
@@ -2359,7 +2359,7 @@ discard block |
||
| 2359 | 2359 | */ |
| 2360 | 2360 | public function getAllAircraftRegistrations() |
| 2361 | 2361 | { |
| 2362 | - $query = "SELECT DISTINCT spotter_output.registration |
|
| 2362 | + $query = "SELECT DISTINCT spotter_output.registration |
|
| 2363 | 2363 | FROM spotter_output |
| 2364 | 2364 | WHERE spotter_output.registration <> '' |
| 2365 | 2365 | ORDER BY spotter_output.registration ASC"; |
@@ -2370,7 +2370,7 @@ discard block |
||
| 2370 | 2370 | $aircraft_array = array(); |
| 2371 | 2371 | $temp_array = array(); |
| 2372 | 2372 | |
| 2373 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2373 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2374 | 2374 | { |
| 2375 | 2375 | $temp_array['registration'] = $row['registration']; |
| 2376 | 2376 | |
@@ -2390,7 +2390,7 @@ discard block |
||
| 2390 | 2390 | public function getAllSourceName($type = '') |
| 2391 | 2391 | { |
| 2392 | 2392 | $query_values = array(); |
| 2393 | - $query = "SELECT DISTINCT spotter_output.source_name |
|
| 2393 | + $query = "SELECT DISTINCT spotter_output.source_name |
|
| 2394 | 2394 | FROM spotter_output |
| 2395 | 2395 | WHERE spotter_output.source_name <> ''"; |
| 2396 | 2396 | if ($type != '') { |
@@ -2406,7 +2406,7 @@ discard block |
||
| 2406 | 2406 | $source_array = array(); |
| 2407 | 2407 | $temp_array = array(); |
| 2408 | 2408 | |
| 2409 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2409 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2410 | 2410 | { |
| 2411 | 2411 | $temp_array['source_name'] = $row['source_name']; |
| 2412 | 2412 | $source_array[] = $temp_array; |
@@ -2422,10 +2422,10 @@ discard block |
||
| 2422 | 2422 | * @return Array list of airline names |
| 2423 | 2423 | * |
| 2424 | 2424 | */ |
| 2425 | - public function getAllAirlineNames($airline_type = '',$forsource = NULL) |
|
| 2425 | + public function getAllAirlineNames($airline_type = '', $forsource = NULL) |
|
| 2426 | 2426 | { |
| 2427 | - global $globalAirlinesSource,$globalVATSIM, $globalIVAO; |
|
| 2428 | - $airline_type = filter_var($airline_type,FILTER_SANITIZE_STRING); |
|
| 2427 | + global $globalAirlinesSource, $globalVATSIM, $globalIVAO; |
|
| 2428 | + $airline_type = filter_var($airline_type, FILTER_SANITIZE_STRING); |
|
| 2429 | 2429 | if ($airline_type == '' || $airline_type == 'all') { |
| 2430 | 2430 | /* |
| 2431 | 2431 | $query = "SELECT DISTINCT spotter_output.airline_icao AS airline_icao, spotter_output.airline_name AS airline_name, spotter_output.airline_type AS airline_type |
@@ -2444,7 +2444,7 @@ discard block |
||
| 2444 | 2444 | $query_data = array(':forsource' => $forsource); |
| 2445 | 2445 | } |
| 2446 | 2446 | } else { |
| 2447 | - $query = "SELECT DISTINCT spotter_output.airline_icao AS airline_icao, spotter_output.airline_name AS airline_name, spotter_output.airline_type AS airline_type |
|
| 2447 | + $query = "SELECT DISTINCT spotter_output.airline_icao AS airline_icao, spotter_output.airline_name AS airline_name, spotter_output.airline_type AS airline_type |
|
| 2448 | 2448 | FROM spotter_output |
| 2449 | 2449 | WHERE spotter_output.airline_icao <> '' |
| 2450 | 2450 | AND spotter_output.airline_type = :airline_type |
@@ -2458,7 +2458,7 @@ discard block |
||
| 2458 | 2458 | $airline_array = array(); |
| 2459 | 2459 | $temp_array = array(); |
| 2460 | 2460 | |
| 2461 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2461 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2462 | 2462 | { |
| 2463 | 2463 | $temp_array['airline_icao'] = $row['airline_icao']; |
| 2464 | 2464 | $temp_array['airline_name'] = $row['airline_name']; |
@@ -2479,7 +2479,7 @@ discard block |
||
| 2479 | 2479 | public function getAllAirlineCountries() |
| 2480 | 2480 | { |
| 2481 | 2481 | |
| 2482 | - $query = "SELECT DISTINCT spotter_output.airline_country AS airline_country |
|
| 2482 | + $query = "SELECT DISTINCT spotter_output.airline_country AS airline_country |
|
| 2483 | 2483 | FROM spotter_output |
| 2484 | 2484 | WHERE spotter_output.airline_country <> '' |
| 2485 | 2485 | ORDER BY spotter_output.airline_country ASC"; |
@@ -2491,7 +2491,7 @@ discard block |
||
| 2491 | 2491 | $airline_array = array(); |
| 2492 | 2492 | $temp_array = array(); |
| 2493 | 2493 | |
| 2494 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2494 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2495 | 2495 | { |
| 2496 | 2496 | $temp_array['airline_country'] = $row['airline_country']; |
| 2497 | 2497 | |
@@ -2513,7 +2513,7 @@ discard block |
||
| 2513 | 2513 | { |
| 2514 | 2514 | $airport_array = array(); |
| 2515 | 2515 | |
| 2516 | - $query = "SELECT DISTINCT spotter_output.departure_airport_icao AS airport_icao, spotter_output.departure_airport_name AS airport_name, spotter_output.departure_airport_city AS airport_city, spotter_output.departure_airport_country AS airport_country |
|
| 2516 | + $query = "SELECT DISTINCT spotter_output.departure_airport_icao AS airport_icao, spotter_output.departure_airport_name AS airport_name, spotter_output.departure_airport_city AS airport_city, spotter_output.departure_airport_country AS airport_country |
|
| 2517 | 2517 | FROM spotter_output |
| 2518 | 2518 | WHERE spotter_output.departure_airport_icao <> '' AND spotter_output.departure_airport_icao <> 'NA' |
| 2519 | 2519 | ORDER BY spotter_output.departure_airport_city ASC"; |
@@ -2523,7 +2523,7 @@ discard block |
||
| 2523 | 2523 | $sth->execute(); |
| 2524 | 2524 | |
| 2525 | 2525 | $temp_array = array(); |
| 2526 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2526 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2527 | 2527 | { |
| 2528 | 2528 | $temp_array['airport_icao'] = $row['airport_icao']; |
| 2529 | 2529 | $temp_array['airport_name'] = $row['airport_name']; |
@@ -2533,7 +2533,7 @@ discard block |
||
| 2533 | 2533 | $airport_array[$row['airport_city'].",".$row['airport_name']] = $temp_array; |
| 2534 | 2534 | } |
| 2535 | 2535 | |
| 2536 | - $query = "SELECT DISTINCT spotter_output.arrival_airport_icao AS airport_icao, spotter_output.arrival_airport_name AS airport_name, spotter_output.arrival_airport_city AS airport_city, spotter_output.arrival_airport_country AS airport_country |
|
| 2536 | + $query = "SELECT DISTINCT spotter_output.arrival_airport_icao AS airport_icao, spotter_output.arrival_airport_name AS airport_name, spotter_output.arrival_airport_city AS airport_city, spotter_output.arrival_airport_country AS airport_country |
|
| 2537 | 2537 | FROM spotter_output |
| 2538 | 2538 | WHERE spotter_output.arrival_airport_icao <> '' AND spotter_output.arrival_airport_icao <> 'NA' |
| 2539 | 2539 | ORDER BY spotter_output.arrival_airport_city ASC"; |
@@ -2541,7 +2541,7 @@ discard block |
||
| 2541 | 2541 | $sth = $this->db->prepare($query); |
| 2542 | 2542 | $sth->execute(); |
| 2543 | 2543 | |
| 2544 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2544 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2545 | 2545 | { |
| 2546 | 2546 | // if ($airport_array[$row['airport_city'].",".$row['airport_name']]['airport_icao'] != $row['airport_icao']) |
| 2547 | 2547 | // { |
@@ -2581,14 +2581,14 @@ discard block |
||
| 2581 | 2581 | |
| 2582 | 2582 | $temp_array = array(); |
| 2583 | 2583 | |
| 2584 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2584 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2585 | 2585 | { |
| 2586 | 2586 | $temp_array['airport_country'] = $row['airport_country']; |
| 2587 | 2587 | |
| 2588 | 2588 | $airport_array[$row['airport_country']] = $temp_array; |
| 2589 | 2589 | } |
| 2590 | 2590 | |
| 2591 | - $query = "SELECT DISTINCT spotter_output.arrival_airport_country AS airport_country |
|
| 2591 | + $query = "SELECT DISTINCT spotter_output.arrival_airport_country AS airport_country |
|
| 2592 | 2592 | FROM spotter_output |
| 2593 | 2593 | WHERE spotter_output.arrival_airport_country <> '' |
| 2594 | 2594 | ORDER BY spotter_output.arrival_airport_country ASC"; |
@@ -2596,7 +2596,7 @@ discard block |
||
| 2596 | 2596 | $sth = $this->db->prepare($query); |
| 2597 | 2597 | $sth->execute(); |
| 2598 | 2598 | |
| 2599 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2599 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2600 | 2600 | { |
| 2601 | 2601 | if (isset($airport_array[$row['airport_country']]['airport_country']) && $airport_array[$row['airport_country']]['airport_country'] != $row['airport_country']) |
| 2602 | 2602 | { |
@@ -2619,9 +2619,9 @@ discard block |
||
| 2619 | 2619 | */ |
| 2620 | 2620 | public function getAllCountries() |
| 2621 | 2621 | { |
| 2622 | - $Connection= new Connection($this->db); |
|
| 2622 | + $Connection = new Connection($this->db); |
|
| 2623 | 2623 | if ($Connection->tableExists('countries')) { |
| 2624 | - $query = "SELECT countries.name AS airport_country |
|
| 2624 | + $query = "SELECT countries.name AS airport_country |
|
| 2625 | 2625 | FROM countries |
| 2626 | 2626 | ORDER BY countries.name ASC"; |
| 2627 | 2627 | $sth = $this->db->prepare($query); |
@@ -2630,13 +2630,13 @@ discard block |
||
| 2630 | 2630 | $temp_array = array(); |
| 2631 | 2631 | $country_array = array(); |
| 2632 | 2632 | |
| 2633 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2633 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2634 | 2634 | { |
| 2635 | 2635 | $temp_array['country'] = $row['airport_country']; |
| 2636 | 2636 | $country_array[$row['airport_country']] = $temp_array; |
| 2637 | 2637 | } |
| 2638 | 2638 | } else { |
| 2639 | - $query = "SELECT DISTINCT spotter_output.departure_airport_country AS airport_country |
|
| 2639 | + $query = "SELECT DISTINCT spotter_output.departure_airport_country AS airport_country |
|
| 2640 | 2640 | FROM spotter_output |
| 2641 | 2641 | WHERE spotter_output.departure_airport_country <> '' |
| 2642 | 2642 | ORDER BY spotter_output.departure_airport_country ASC"; |
@@ -2646,13 +2646,13 @@ discard block |
||
| 2646 | 2646 | |
| 2647 | 2647 | $temp_array = array(); |
| 2648 | 2648 | $country_array = array(); |
| 2649 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2649 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2650 | 2650 | { |
| 2651 | 2651 | $temp_array['country'] = $row['airport_country']; |
| 2652 | 2652 | $country_array[$row['airport_country']] = $temp_array; |
| 2653 | 2653 | } |
| 2654 | 2654 | |
| 2655 | - $query = "SELECT DISTINCT spotter_output.arrival_airport_country AS airport_country |
|
| 2655 | + $query = "SELECT DISTINCT spotter_output.arrival_airport_country AS airport_country |
|
| 2656 | 2656 | FROM spotter_output |
| 2657 | 2657 | WHERE spotter_output.arrival_airport_country <> '' |
| 2658 | 2658 | ORDER BY spotter_output.arrival_airport_country ASC"; |
@@ -2660,7 +2660,7 @@ discard block |
||
| 2660 | 2660 | $sth = $this->db->prepare($query); |
| 2661 | 2661 | $sth->execute(); |
| 2662 | 2662 | |
| 2663 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2663 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2664 | 2664 | { |
| 2665 | 2665 | if ($country_array[$row['airport_country']]['country'] != $row['airport_country']) |
| 2666 | 2666 | { |
@@ -2670,7 +2670,7 @@ discard block |
||
| 2670 | 2670 | } |
| 2671 | 2671 | } |
| 2672 | 2672 | |
| 2673 | - $query = "SELECT DISTINCT spotter_output.airline_country AS airline_country |
|
| 2673 | + $query = "SELECT DISTINCT spotter_output.airline_country AS airline_country |
|
| 2674 | 2674 | FROM spotter_output |
| 2675 | 2675 | WHERE spotter_output.airline_country <> '' |
| 2676 | 2676 | ORDER BY spotter_output.airline_country ASC"; |
@@ -2678,7 +2678,7 @@ discard block |
||
| 2678 | 2678 | $sth = $this->db->prepare($query); |
| 2679 | 2679 | $sth->execute(); |
| 2680 | 2680 | |
| 2681 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2681 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2682 | 2682 | { |
| 2683 | 2683 | if (isset($country_array[$row['airline_country']]['country']) && $country_array[$row['airline_country']]['country'] != $row['airline_country']) |
| 2684 | 2684 | { |
@@ -2702,7 +2702,7 @@ discard block |
||
| 2702 | 2702 | */ |
| 2703 | 2703 | public function getAllIdents() |
| 2704 | 2704 | { |
| 2705 | - $query = "SELECT DISTINCT spotter_output.ident |
|
| 2705 | + $query = "SELECT DISTINCT spotter_output.ident |
|
| 2706 | 2706 | FROM spotter_output |
| 2707 | 2707 | WHERE spotter_output.ident <> '' |
| 2708 | 2708 | ORDER BY spotter_output.date ASC LIMIT 700 OFFSET 0"; |
@@ -2713,7 +2713,7 @@ discard block |
||
| 2713 | 2713 | $ident_array = array(); |
| 2714 | 2714 | $temp_array = array(); |
| 2715 | 2715 | |
| 2716 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2716 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 2717 | 2717 | { |
| 2718 | 2718 | $temp_array['ident'] = $row['ident']; |
| 2719 | 2719 | $ident_array[] = $temp_array; |
@@ -3049,12 +3049,12 @@ discard block |
||
| 3049 | 3049 | } else $offset = '+00:00'; |
| 3050 | 3050 | |
| 3051 | 3051 | if ($globalDBdriver == 'mysql') { |
| 3052 | - $query = "SELECT DISTINCT DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) as date |
|
| 3052 | + $query = "SELECT DISTINCT DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) as date |
|
| 3053 | 3053 | FROM spotter_output |
| 3054 | 3054 | WHERE spotter_output.date <> '' |
| 3055 | 3055 | ORDER BY spotter_output.date ASC LIMIT 0,200"; |
| 3056 | 3056 | } else { |
| 3057 | - $query = "SELECT DISTINCT to_char(spotter_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') as date |
|
| 3057 | + $query = "SELECT DISTINCT to_char(spotter_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') as date |
|
| 3058 | 3058 | FROM spotter_output |
| 3059 | 3059 | WHERE spotter_output.date <> '' |
| 3060 | 3060 | ORDER BY spotter_output.date ASC LIMIT 0,200"; |
@@ -3066,7 +3066,7 @@ discard block |
||
| 3066 | 3066 | $date_array = array(); |
| 3067 | 3067 | $temp_array = array(); |
| 3068 | 3068 | |
| 3069 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3069 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3070 | 3070 | { |
| 3071 | 3071 | $temp_array['date'] = $row['date']; |
| 3072 | 3072 | |
@@ -3086,7 +3086,7 @@ discard block |
||
| 3086 | 3086 | */ |
| 3087 | 3087 | public function getAllRoutes() |
| 3088 | 3088 | { |
| 3089 | - $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 |
|
| 3089 | + $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 |
|
| 3090 | 3090 | FROM spotter_output |
| 3091 | 3091 | WHERE spotter_output.ident <> '' |
| 3092 | 3092 | GROUP BY route |
@@ -3097,7 +3097,7 @@ discard block |
||
| 3097 | 3097 | |
| 3098 | 3098 | $routes_array = array(); |
| 3099 | 3099 | $temp_array = array(); |
| 3100 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3100 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3101 | 3101 | { |
| 3102 | 3102 | $temp_array['route'] = $row['route']; |
| 3103 | 3103 | $temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
@@ -3116,21 +3116,21 @@ discard block |
||
| 3116 | 3116 | * @return String success or false |
| 3117 | 3117 | * |
| 3118 | 3118 | */ |
| 3119 | - public function updateIdentSpotterData($flightaware_id = '', $ident = '',$fromsource = NULL) |
|
| 3119 | + public function updateIdentSpotterData($flightaware_id = '', $ident = '', $fromsource = NULL) |
|
| 3120 | 3120 | { |
| 3121 | 3121 | if (!is_numeric(substr($ident, 0, 3))) |
| 3122 | 3122 | { |
| 3123 | 3123 | if (is_numeric(substr(substr($ident, 0, 3), -1, 1))) { |
| 3124 | - $airline_array = $this->getAllAirlineInfo(substr($ident, 0, 2),$fromsource); |
|
| 3124 | + $airline_array = $this->getAllAirlineInfo(substr($ident, 0, 2), $fromsource); |
|
| 3125 | 3125 | } elseif (is_numeric(substr(substr($ident, 0, 4), -1, 1))) { |
| 3126 | - $airline_array = $this->getAllAirlineInfo(substr($ident, 0, 3),$fromsource); |
|
| 3126 | + $airline_array = $this->getAllAirlineInfo(substr($ident, 0, 3), $fromsource); |
|
| 3127 | 3127 | } else { |
| 3128 | 3128 | $airline_array = $this->getAllAirlineInfo("NA"); |
| 3129 | 3129 | } |
| 3130 | 3130 | if (count($airline_array) == 0) { |
| 3131 | 3131 | $airline_array = $this->getAllAirlineInfo("NA"); |
| 3132 | 3132 | } |
| 3133 | - if (!isset($airline_array[0]['icao']) || $airline_array[0]['icao'] == ""){ |
|
| 3133 | + if (!isset($airline_array[0]['icao']) || $airline_array[0]['icao'] == "") { |
|
| 3134 | 3134 | $airline_array = $this->getAllAirlineInfo("NA"); |
| 3135 | 3135 | } |
| 3136 | 3136 | } else { |
@@ -3143,7 +3143,7 @@ discard block |
||
| 3143 | 3143 | |
| 3144 | 3144 | |
| 3145 | 3145 | $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'; |
| 3146 | - $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); |
|
| 3146 | + $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); |
|
| 3147 | 3147 | |
| 3148 | 3148 | try { |
| 3149 | 3149 | $sth = $this->db->prepare($query); |
@@ -3164,11 +3164,11 @@ discard block |
||
| 3164 | 3164 | * @return String success or false |
| 3165 | 3165 | * |
| 3166 | 3166 | */ |
| 3167 | - public function updateLatestSpotterData($flightaware_id = '', $ident = '', $latitude = '', $longitude = '', $altitude = '', $ground = false, $groundspeed = NULL, $date = '', $arrival_airport_icao = '',$arrival_airport_time = '') |
|
| 3167 | + public function updateLatestSpotterData($flightaware_id = '', $ident = '', $latitude = '', $longitude = '', $altitude = '', $ground = false, $groundspeed = NULL, $date = '', $arrival_airport_icao = '', $arrival_airport_time = '') |
|
| 3168 | 3168 | { |
| 3169 | 3169 | if ($groundspeed == '') $groundspeed = NULL; |
| 3170 | 3170 | $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'; |
| 3171 | - $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); |
|
| 3171 | + $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); |
|
| 3172 | 3172 | |
| 3173 | 3173 | try { |
| 3174 | 3174 | $sth = $this->db->prepare($query); |
@@ -3208,7 +3208,7 @@ discard block |
||
| 3208 | 3208 | * @param String $verticalrate vertival rate of flight |
| 3209 | 3209 | * @return String success or false |
| 3210 | 3210 | */ |
| 3211 | - 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 = '') |
|
| 3211 | + 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 = '') |
|
| 3212 | 3212 | { |
| 3213 | 3213 | global $globalURL, $globalIVAO, $globalVATSIM, $globalphpVMS, $globalDebugTimeElapsed, $globalAirlinesSource, $globalVAM; |
| 3214 | 3214 | |
@@ -3232,13 +3232,13 @@ discard block |
||
| 3232 | 3232 | if ($ModeS != '') { |
| 3233 | 3233 | $timeelapsed = microtime(true); |
| 3234 | 3234 | $registration = $this->getAircraftRegistrationBymodeS($ModeS); |
| 3235 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftRegistrationBymodes : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3235 | + if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftRegistrationBymodes : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
| 3236 | 3236 | } else { |
| 3237 | - $myhex = explode('-',$flightaware_id); |
|
| 3237 | + $myhex = explode('-', $flightaware_id); |
|
| 3238 | 3238 | if (count($myhex) > 0) { |
| 3239 | 3239 | $timeelapsed = microtime(true); |
| 3240 | 3240 | $registration = $this->getAircraftRegistrationBymodeS($myhex[0]); |
| 3241 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftRegistrationBymodes : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3241 | + if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftRegistrationBymodes : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
| 3242 | 3242 | } |
| 3243 | 3243 | } |
| 3244 | 3244 | } |
@@ -3260,24 +3260,24 @@ discard block |
||
| 3260 | 3260 | { |
| 3261 | 3261 | $timeelapsed = microtime(true); |
| 3262 | 3262 | if (is_numeric(substr(substr($ident, 0, 3), -1, 1))) { |
| 3263 | - $airline_array = $this->getAllAirlineInfo(substr($ident, 0, 2),$fromsource); |
|
| 3263 | + $airline_array = $this->getAllAirlineInfo(substr($ident, 0, 2), $fromsource); |
|
| 3264 | 3264 | } elseif (is_numeric(substr(substr($ident, 0, 4), -1, 1))) { |
| 3265 | - $airline_array = $this->getAllAirlineInfo(substr($ident, 0, 3),$fromsource); |
|
| 3265 | + $airline_array = $this->getAllAirlineInfo(substr($ident, 0, 3), $fromsource); |
|
| 3266 | 3266 | } else { |
| 3267 | 3267 | $airline_array = $this->getAllAirlineInfo("NA"); |
| 3268 | 3268 | } |
| 3269 | 3269 | if (count($airline_array) == 0) { |
| 3270 | 3270 | $airline_array = $this->getAllAirlineInfo("NA"); |
| 3271 | 3271 | } |
| 3272 | - if (!isset($airline_array[0]['icao']) || $airline_array[0]['icao'] == ""){ |
|
| 3272 | + if (!isset($airline_array[0]['icao']) || $airline_array[0]['icao'] == "") { |
|
| 3273 | 3273 | $airline_array = $this->getAllAirlineInfo("NA"); |
| 3274 | 3274 | } |
| 3275 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAirlineInfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3275 | + if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAirlineInfo : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
| 3276 | 3276 | |
| 3277 | 3277 | } else { |
| 3278 | 3278 | $timeelapsed = microtime(true); |
| 3279 | 3279 | $airline_array = $this->getAllAirlineInfo("NA"); |
| 3280 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAirlineInfo(NA) : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3280 | + if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAirlineInfo(NA) : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
| 3281 | 3281 | } |
| 3282 | 3282 | } |
| 3283 | 3283 | } else $airline_array = array(); |
@@ -3294,27 +3294,27 @@ discard block |
||
| 3294 | 3294 | { |
| 3295 | 3295 | $timeelapsed = microtime(true); |
| 3296 | 3296 | $aircraft_array = $this->getAllAircraftInfo("NA"); |
| 3297 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo(NA) : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3297 | + if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo(NA) : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
| 3298 | 3298 | } else { |
| 3299 | 3299 | $timeelapsed = microtime(true); |
| 3300 | 3300 | $aircraft_array = $this->getAllAircraftInfo($aircraft_icao); |
| 3301 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3301 | + if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
| 3302 | 3302 | } |
| 3303 | 3303 | } |
| 3304 | 3304 | } else { |
| 3305 | 3305 | if ($ModeS != '') { |
| 3306 | 3306 | $timeelapsed = microtime(true); |
| 3307 | 3307 | $aircraft_icao = $this->getAllAircraftType($ModeS); |
| 3308 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAllAircraftType : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3308 | + if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAllAircraftType : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
| 3309 | 3309 | if ($aircraft_icao == "" || $aircraft_icao == "XXXX") |
| 3310 | 3310 | { |
| 3311 | 3311 | $timeelapsed = microtime(true); |
| 3312 | 3312 | $aircraft_array = $this->getAllAircraftInfo("NA"); |
| 3313 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo(NA) : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3313 | + if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo(NA) : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
| 3314 | 3314 | } else { |
| 3315 | 3315 | $timeelapsed = microtime(true); |
| 3316 | 3316 | $aircraft_array = $this->getAllAircraftInfo($aircraft_icao); |
| 3317 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3317 | + if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftInfo : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
| 3318 | 3318 | } |
| 3319 | 3319 | } |
| 3320 | 3320 | } |
@@ -3329,7 +3329,7 @@ discard block |
||
| 3329 | 3329 | } else { |
| 3330 | 3330 | $timeelapsed = microtime(true); |
| 3331 | 3331 | $departure_airport_array = $this->getAllAirportInfo($departure_airport_icao); |
| 3332 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAllAirportInfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3332 | + if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAllAirportInfo : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
| 3333 | 3333 | } |
| 3334 | 3334 | } |
| 3335 | 3335 | |
@@ -3343,7 +3343,7 @@ discard block |
||
| 3343 | 3343 | } else { |
| 3344 | 3344 | $timeelapsed = microtime(true); |
| 3345 | 3345 | $arrival_airport_array = $this->getAllAirportInfo($arrival_airport_icao); |
| 3346 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAllAirportInfo : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3346 | + if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAllAirportInfo : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
| 3347 | 3347 | } |
| 3348 | 3348 | } |
| 3349 | 3349 | |
@@ -3407,7 +3407,7 @@ discard block |
||
| 3407 | 3407 | { |
| 3408 | 3408 | $timeelapsed = microtime(true); |
| 3409 | 3409 | $image_array = $Image->getSpotterImage($registration); |
| 3410 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getSpotterImage : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3410 | + if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getSpotterImage : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
| 3411 | 3411 | if (!isset($image_array[0]['registration'])) |
| 3412 | 3412 | { |
| 3413 | 3413 | //echo "Add image !!!! \n"; |
@@ -3415,7 +3415,7 @@ discard block |
||
| 3415 | 3415 | } |
| 3416 | 3416 | $timeelapsed = microtime(true); |
| 3417 | 3417 | $owner_info = $this->getAircraftOwnerByRegistration($registration); |
| 3418 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftOwnerByRegistration : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3418 | + if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftOwnerByRegistration : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
| 3419 | 3419 | if ($owner_info['owner'] != '') $aircraft_owner = ucwords(strtolower($owner_info['owner'])); |
| 3420 | 3420 | } |
| 3421 | 3421 | |
@@ -3423,33 +3423,33 @@ discard block |
||
| 3423 | 3423 | { |
| 3424 | 3424 | if (isset($airline_array[0]['icao'])) $airline_icao = $airline_array[0]['icao']; |
| 3425 | 3425 | else $airline_icao = ''; |
| 3426 | - $image_array = $Image->getSpotterImage('',$aircraft_icao,$airline_icao); |
|
| 3426 | + $image_array = $Image->getSpotterImage('', $aircraft_icao, $airline_icao); |
|
| 3427 | 3427 | if (!isset($image_array[0]['registration'])) |
| 3428 | 3428 | { |
| 3429 | 3429 | //echo "Add image !!!! \n"; |
| 3430 | - $Image->addSpotterImage('',$aircraft_icao,$airline_icao); |
|
| 3430 | + $Image->addSpotterImage('', $aircraft_icao, $airline_icao); |
|
| 3431 | 3431 | } |
| 3432 | 3432 | } |
| 3433 | 3433 | |
| 3434 | - $flightaware_id = filter_var($flightaware_id,FILTER_SANITIZE_STRING); |
|
| 3435 | - $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
|
| 3436 | - $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
|
| 3437 | - $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
|
| 3438 | - $departure_airport_icao = filter_var($departure_airport_icao,FILTER_SANITIZE_STRING); |
|
| 3439 | - $arrival_airport_icao = filter_var($arrival_airport_icao,FILTER_SANITIZE_STRING); |
|
| 3440 | - $latitude = filter_var($latitude,FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 3441 | - $longitude = filter_var($longitude,FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 3442 | - $waypoints = filter_var($waypoints,FILTER_SANITIZE_STRING); |
|
| 3443 | - $altitude = filter_var($altitude,FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 3444 | - $heading = filter_var($heading,FILTER_SANITIZE_NUMBER_INT); |
|
| 3445 | - $groundspeed = filter_var($groundspeed,FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 3446 | - $squawk = filter_var($squawk,FILTER_SANITIZE_NUMBER_INT); |
|
| 3447 | - $route_stop = filter_var($route_stop,FILTER_SANITIZE_STRING); |
|
| 3448 | - $ModeS = filter_var($ModeS,FILTER_SANITIZE_STRING); |
|
| 3449 | - $pilot_id = filter_var($pilot_id,FILTER_SANITIZE_STRING); |
|
| 3450 | - $pilot_name = filter_var($pilot_name,FILTER_SANITIZE_STRING); |
|
| 3451 | - $format_source = filter_var($format_source,FILTER_SANITIZE_STRING); |
|
| 3452 | - $verticalrate = filter_var($verticalrate,FILTER_SANITIZE_NUMBER_INT); |
|
| 3434 | + $flightaware_id = filter_var($flightaware_id, FILTER_SANITIZE_STRING); |
|
| 3435 | + $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
|
| 3436 | + $registration = filter_var($registration, FILTER_SANITIZE_STRING); |
|
| 3437 | + $aircraft_icao = filter_var($aircraft_icao, FILTER_SANITIZE_STRING); |
|
| 3438 | + $departure_airport_icao = filter_var($departure_airport_icao, FILTER_SANITIZE_STRING); |
|
| 3439 | + $arrival_airport_icao = filter_var($arrival_airport_icao, FILTER_SANITIZE_STRING); |
|
| 3440 | + $latitude = filter_var($latitude, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 3441 | + $longitude = filter_var($longitude, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 3442 | + $waypoints = filter_var($waypoints, FILTER_SANITIZE_STRING); |
|
| 3443 | + $altitude = filter_var($altitude, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 3444 | + $heading = filter_var($heading, FILTER_SANITIZE_NUMBER_INT); |
|
| 3445 | + $groundspeed = filter_var($groundspeed, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 3446 | + $squawk = filter_var($squawk, FILTER_SANITIZE_NUMBER_INT); |
|
| 3447 | + $route_stop = filter_var($route_stop, FILTER_SANITIZE_STRING); |
|
| 3448 | + $ModeS = filter_var($ModeS, FILTER_SANITIZE_STRING); |
|
| 3449 | + $pilot_id = filter_var($pilot_id, FILTER_SANITIZE_STRING); |
|
| 3450 | + $pilot_name = filter_var($pilot_name, FILTER_SANITIZE_STRING); |
|
| 3451 | + $format_source = filter_var($format_source, FILTER_SANITIZE_STRING); |
|
| 3452 | + $verticalrate = filter_var($verticalrate, FILTER_SANITIZE_NUMBER_INT); |
|
| 3453 | 3453 | |
| 3454 | 3454 | if (count($airline_array) == 0) |
| 3455 | 3455 | { |
@@ -3473,7 +3473,7 @@ discard block |
||
| 3473 | 3473 | if ($heading == '' || $Common->isInteger($heading) === false) $heading = 0; |
| 3474 | 3474 | if ($groundspeed == '' || $Common->isInteger($groundspeed) === false) $groundspeed = 0; |
| 3475 | 3475 | if (!isset($aircraft_owner)) $aircraft_owner = NULL; |
| 3476 | - $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) |
|
| 3476 | + $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) |
|
| 3477 | 3477 | 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)"; |
| 3478 | 3478 | |
| 3479 | 3479 | $airline_name = $airline_array[0]['name']; |
@@ -3483,7 +3483,7 @@ discard block |
||
| 3483 | 3483 | if ($airline_type == '') { |
| 3484 | 3484 | $timeelapsed = microtime(true); |
| 3485 | 3485 | $airline_type = $this->getAircraftTypeBymodeS($ModeS); |
| 3486 | - if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftTypeBymodes : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
| 3486 | + if ($globalDebugTimeElapsed) echo 'ADD SPOTTER DATA : Time elapsed for getAircraftTypeBymodes : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
| 3487 | 3487 | } |
| 3488 | 3488 | if ($airline_type == null) $airline_type = ''; |
| 3489 | 3489 | $aircraft_type = $aircraft_array[0]['type']; |
@@ -3494,7 +3494,7 @@ discard block |
||
| 3494 | 3494 | $arrival_airport_name = $arrival_airport_array[0]['name']; |
| 3495 | 3495 | $arrival_airport_city = $arrival_airport_array[0]['city']; |
| 3496 | 3496 | $arrival_airport_country = $arrival_airport_array[0]['country']; |
| 3497 | - $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); |
|
| 3497 | + $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); |
|
| 3498 | 3498 | |
| 3499 | 3499 | try { |
| 3500 | 3500 | |
@@ -3520,13 +3520,13 @@ discard block |
||
| 3520 | 3520 | { |
| 3521 | 3521 | global $globalDBdriver, $globalTimezone; |
| 3522 | 3522 | if ($globalDBdriver == 'mysql') { |
| 3523 | - $query = "SELECT spotter_output.ident FROM spotter_output |
|
| 3523 | + $query = "SELECT spotter_output.ident FROM spotter_output |
|
| 3524 | 3524 | WHERE spotter_output.ident = :ident |
| 3525 | 3525 | AND spotter_output.date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 HOUR) |
| 3526 | 3526 | AND spotter_output.date < UTC_TIMESTAMP()"; |
| 3527 | 3527 | $query_data = array(':ident' => $ident); |
| 3528 | 3528 | } else { |
| 3529 | - $query = "SELECT spotter_output.ident FROM spotter_output |
|
| 3529 | + $query = "SELECT spotter_output.ident FROM spotter_output |
|
| 3530 | 3530 | WHERE spotter_output.ident = :ident |
| 3531 | 3531 | AND spotter_output.date >= now() AT TIME ZONE 'UTC' - INTERVAL '1 HOURS' |
| 3532 | 3532 | AND spotter_output.date < now() AT TIME ZONE 'UTC'"; |
@@ -3535,8 +3535,8 @@ discard block |
||
| 3535 | 3535 | |
| 3536 | 3536 | $sth = $this->db->prepare($query); |
| 3537 | 3537 | $sth->execute($query_data); |
| 3538 | - $ident_result=''; |
|
| 3539 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3538 | + $ident_result = ''; |
|
| 3539 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3540 | 3540 | { |
| 3541 | 3541 | $ident_result = $row['ident']; |
| 3542 | 3542 | } |
@@ -3562,8 +3562,8 @@ discard block |
||
| 3562 | 3562 | return false; |
| 3563 | 3563 | } else { |
| 3564 | 3564 | $q_array = explode(" ", $q); |
| 3565 | - foreach ($q_array as $q_item){ |
|
| 3566 | - $q_item = filter_var($q_item,FILTER_SANITIZE_STRING); |
|
| 3565 | + foreach ($q_array as $q_item) { |
|
| 3566 | + $q_item = filter_var($q_item, FILTER_SANITIZE_STRING); |
|
| 3567 | 3567 | $additional_query .= " AND ("; |
| 3568 | 3568 | $additional_query .= "(spotter_output.aircraft_icao like '%".$q_item."%') OR "; |
| 3569 | 3569 | $additional_query .= "(spotter_output.aircraft_name like '%".$q_item."%') OR "; |
@@ -3578,11 +3578,11 @@ discard block |
||
| 3578 | 3578 | } |
| 3579 | 3579 | } |
| 3580 | 3580 | if ($globalDBdriver == 'mysql') { |
| 3581 | - $query = "SELECT spotter_output.* FROM spotter_output |
|
| 3581 | + $query = "SELECT spotter_output.* FROM spotter_output |
|
| 3582 | 3582 | WHERE spotter_output.date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 20 SECOND) ".$additional_query." |
| 3583 | 3583 | AND spotter_output.date < UTC_TIMESTAMP()"; |
| 3584 | 3584 | } else { |
| 3585 | - $query = "SELECT spotter_output.* FROM spotter_output |
|
| 3585 | + $query = "SELECT spotter_output.* FROM spotter_output |
|
| 3586 | 3586 | WHERE spotter_output.date::timestamp >= CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '20 SECONDS' ".$additional_query." |
| 3587 | 3587 | AND spotter_output.date::timestamp < CURRENT_TIMESTAMP AT TIME ZONE 'UTC'"; |
| 3588 | 3588 | } |
@@ -3599,11 +3599,11 @@ discard block |
||
| 3599 | 3599 | * @return Array the airline list |
| 3600 | 3600 | * |
| 3601 | 3601 | */ |
| 3602 | - public function countAllAirlines($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array()) |
|
| 3602 | + public function countAllAirlines($limit = true, $olderthanmonths = 0, $sincedate = '', $filters = array()) |
|
| 3603 | 3603 | { |
| 3604 | 3604 | global $globalDBdriver; |
| 3605 | - $filter_query = $this->getFilter($filters,true,true); |
|
| 3606 | - $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
|
| 3605 | + $filter_query = $this->getFilter($filters, true, true); |
|
| 3606 | + $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
|
| 3607 | 3607 | FROM spotter_output".$filter_query." spotter_output.airline_name <> '' AND spotter_output.airline_icao <> 'NA' "; |
| 3608 | 3608 | if ($olderthanmonths > 0) { |
| 3609 | 3609 | if ($globalDBdriver == 'mysql') { |
@@ -3627,7 +3627,7 @@ discard block |
||
| 3627 | 3627 | |
| 3628 | 3628 | $airline_array = array(); |
| 3629 | 3629 | $temp_array = array(); |
| 3630 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3630 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3631 | 3631 | { |
| 3632 | 3632 | $temp_array['airline_name'] = $row['airline_name']; |
| 3633 | 3633 | $temp_array['airline_icao'] = $row['airline_icao']; |
@@ -3644,11 +3644,11 @@ discard block |
||
| 3644 | 3644 | * @return Array the pilots list |
| 3645 | 3645 | * |
| 3646 | 3646 | */ |
| 3647 | - public function countAllPilots($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array()) |
|
| 3647 | + public function countAllPilots($limit = true, $olderthanmonths = 0, $sincedate = '', $filters = array()) |
|
| 3648 | 3648 | { |
| 3649 | 3649 | global $globalDBdriver; |
| 3650 | - $filter_query = $this->getFilter($filters,true,true); |
|
| 3651 | - $query = "SELECT DISTINCT spotter_output.pilot_id, spotter_output.pilot_name, COUNT(spotter_output.pilot_id) AS pilot_count |
|
| 3650 | + $filter_query = $this->getFilter($filters, true, true); |
|
| 3651 | + $query = "SELECT DISTINCT spotter_output.pilot_id, spotter_output.pilot_name, COUNT(spotter_output.pilot_id) AS pilot_count |
|
| 3652 | 3652 | FROM spotter_output".$filter_query." spotter_output.pilot_id <> '' "; |
| 3653 | 3653 | if ($olderthanmonths > 0) { |
| 3654 | 3654 | if ($globalDBdriver == 'mysql') { |
@@ -3674,7 +3674,7 @@ discard block |
||
| 3674 | 3674 | $airline_array = array(); |
| 3675 | 3675 | $temp_array = array(); |
| 3676 | 3676 | |
| 3677 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3677 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3678 | 3678 | { |
| 3679 | 3679 | $temp_array['pilot_name'] = $row['pilot_name']; |
| 3680 | 3680 | $temp_array['pilot_id'] = $row['pilot_id']; |
@@ -3693,7 +3693,7 @@ discard block |
||
| 3693 | 3693 | public function countAllPilotsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '') |
| 3694 | 3694 | { |
| 3695 | 3695 | global $globalDBdriver; |
| 3696 | - $query = "SELECT DISTINCT spotter_output.airline_icao, spotter_output.pilot_id, spotter_output.pilot_name, COUNT(spotter_output.pilot_id) AS pilot_count |
|
| 3696 | + $query = "SELECT DISTINCT spotter_output.airline_icao, spotter_output.pilot_id, spotter_output.pilot_name, COUNT(spotter_output.pilot_id) AS pilot_count |
|
| 3697 | 3697 | FROM spotter_output WHERE spotter_output.pilot_id <> '' "; |
| 3698 | 3698 | if ($olderthanmonths > 0) { |
| 3699 | 3699 | if ($globalDBdriver == 'mysql') { |
@@ -3719,7 +3719,7 @@ discard block |
||
| 3719 | 3719 | $airline_array = array(); |
| 3720 | 3720 | $temp_array = array(); |
| 3721 | 3721 | |
| 3722 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3722 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3723 | 3723 | { |
| 3724 | 3724 | $temp_array['pilot_name'] = $row['pilot_name']; |
| 3725 | 3725 | $temp_array['pilot_id'] = $row['pilot_id']; |
@@ -3736,11 +3736,11 @@ discard block |
||
| 3736 | 3736 | * @return Array the pilots list |
| 3737 | 3737 | * |
| 3738 | 3738 | */ |
| 3739 | - public function countAllOwners($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array()) |
|
| 3739 | + public function countAllOwners($limit = true, $olderthanmonths = 0, $sincedate = '', $filters = array()) |
|
| 3740 | 3740 | { |
| 3741 | 3741 | global $globalDBdriver; |
| 3742 | - $filter_query = $this->getFilter($filters,true,true); |
|
| 3743 | - $query = "SELECT DISTINCT spotter_output.owner_name, COUNT(spotter_output.owner_name) AS owner_count |
|
| 3742 | + $filter_query = $this->getFilter($filters, true, true); |
|
| 3743 | + $query = "SELECT DISTINCT spotter_output.owner_name, COUNT(spotter_output.owner_name) AS owner_count |
|
| 3744 | 3744 | FROM spotter_output".$filter_query." spotter_output.owner_name <> '' AND spotter_output.owner_name IS NOT NULL "; |
| 3745 | 3745 | if ($olderthanmonths > 0) { |
| 3746 | 3746 | if ($globalDBdriver == 'mysql') { |
@@ -3766,7 +3766,7 @@ discard block |
||
| 3766 | 3766 | $airline_array = array(); |
| 3767 | 3767 | $temp_array = array(); |
| 3768 | 3768 | |
| 3769 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3769 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3770 | 3770 | { |
| 3771 | 3771 | $temp_array['owner_name'] = $row['owner_name']; |
| 3772 | 3772 | $temp_array['owner_count'] = $row['owner_count']; |
@@ -3784,7 +3784,7 @@ discard block |
||
| 3784 | 3784 | public function countAllOwnersByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '') |
| 3785 | 3785 | { |
| 3786 | 3786 | global $globalDBdriver; |
| 3787 | - $query = "SELECT DISTINCT spotter_output.airline_icao, spotter_output.owner_name, COUNT(spotter_output.owner_name) AS owner_count |
|
| 3787 | + $query = "SELECT DISTINCT spotter_output.airline_icao, spotter_output.owner_name, COUNT(spotter_output.owner_name) AS owner_count |
|
| 3788 | 3788 | FROM spotter_output WHERE spotter_output.owner_name <> '' AND spotter_output.owner_name IS NOT NULL "; |
| 3789 | 3789 | if ($olderthanmonths > 0) { |
| 3790 | 3790 | if ($globalDBdriver == 'mysql') { |
@@ -3810,7 +3810,7 @@ discard block |
||
| 3810 | 3810 | $airline_array = array(); |
| 3811 | 3811 | $temp_array = array(); |
| 3812 | 3812 | |
| 3813 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3813 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3814 | 3814 | { |
| 3815 | 3815 | $temp_array['owner_name'] = $row['owner_name']; |
| 3816 | 3816 | $temp_array['owner_count'] = $row['owner_count']; |
@@ -3828,9 +3828,9 @@ discard block |
||
| 3828 | 3828 | */ |
| 3829 | 3829 | public function countAllAirlinesByAircraft($aircraft_icao) |
| 3830 | 3830 | { |
| 3831 | - $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
|
| 3831 | + $aircraft_icao = filter_var($aircraft_icao, FILTER_SANITIZE_STRING); |
|
| 3832 | 3832 | |
| 3833 | - $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
|
| 3833 | + $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
|
| 3834 | 3834 | FROM spotter_output |
| 3835 | 3835 | WHERE spotter_output.airline_name <> '' AND spotter_output.aircraft_icao = :aircraft_icao |
| 3836 | 3836 | GROUP BY spotter_output.airline_name |
@@ -3843,7 +3843,7 @@ discard block |
||
| 3843 | 3843 | $airline_array = array(); |
| 3844 | 3844 | $temp_array = array(); |
| 3845 | 3845 | |
| 3846 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3846 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3847 | 3847 | { |
| 3848 | 3848 | $temp_array['airline_name'] = $row['airline_name']; |
| 3849 | 3849 | $temp_array['airline_icao'] = $row['airline_icao']; |
@@ -3865,9 +3865,9 @@ discard block |
||
| 3865 | 3865 | */ |
| 3866 | 3866 | public function countAllAirlineCountriesByAircraft($aircraft_icao) |
| 3867 | 3867 | { |
| 3868 | - $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
|
| 3868 | + $aircraft_icao = filter_var($aircraft_icao, FILTER_SANITIZE_STRING); |
|
| 3869 | 3869 | |
| 3870 | - $query = "SELECT DISTINCT spotter_output.airline_country, COUNT(spotter_output.airline_country) AS airline_country_count |
|
| 3870 | + $query = "SELECT DISTINCT spotter_output.airline_country, COUNT(spotter_output.airline_country) AS airline_country_count |
|
| 3871 | 3871 | FROM spotter_output |
| 3872 | 3872 | WHERE spotter_output.airline_country <> '' AND spotter_output.aircraft_icao = :aircraft_icao |
| 3873 | 3873 | GROUP BY spotter_output.airline_country |
@@ -3881,7 +3881,7 @@ discard block |
||
| 3881 | 3881 | $airline_country_array = array(); |
| 3882 | 3882 | $temp_array = array(); |
| 3883 | 3883 | |
| 3884 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3884 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3885 | 3885 | { |
| 3886 | 3886 | $temp_array['airline_country_count'] = $row['airline_country_count']; |
| 3887 | 3887 | $temp_array['airline_country'] = $row['airline_country']; |
@@ -3902,9 +3902,9 @@ discard block |
||
| 3902 | 3902 | */ |
| 3903 | 3903 | public function countAllAirlinesByAirport($airport_icao) |
| 3904 | 3904 | { |
| 3905 | - $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
|
| 3905 | + $airport_icao = filter_var($airport_icao, FILTER_SANITIZE_STRING); |
|
| 3906 | 3906 | |
| 3907 | - $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
|
| 3907 | + $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
|
| 3908 | 3908 | FROM spotter_output |
| 3909 | 3909 | WHERE spotter_output.airline_name <> '' AND (spotter_output.departure_airport_icao = :airport_icao OR spotter_output.arrival_airport_icao = :airport_icao ) |
| 3910 | 3910 | GROUP BY spotter_output.airline_name |
@@ -3917,7 +3917,7 @@ discard block |
||
| 3917 | 3917 | $airline_array = array(); |
| 3918 | 3918 | $temp_array = array(); |
| 3919 | 3919 | |
| 3920 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3920 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3921 | 3921 | { |
| 3922 | 3922 | $temp_array['airline_name'] = $row['airline_name']; |
| 3923 | 3923 | $temp_array['airline_icao'] = $row['airline_icao']; |
@@ -3938,9 +3938,9 @@ discard block |
||
| 3938 | 3938 | */ |
| 3939 | 3939 | public function countAllAirlineCountriesByAirport($airport_icao) |
| 3940 | 3940 | { |
| 3941 | - $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
|
| 3941 | + $airport_icao = filter_var($airport_icao, FILTER_SANITIZE_STRING); |
|
| 3942 | 3942 | |
| 3943 | - $query = "SELECT DISTINCT spotter_output.airline_country, COUNT(spotter_output.airline_country) AS airline_country_count |
|
| 3943 | + $query = "SELECT DISTINCT spotter_output.airline_country, COUNT(spotter_output.airline_country) AS airline_country_count |
|
| 3944 | 3944 | FROM spotter_output |
| 3945 | 3945 | WHERE spotter_output.airline_country <> '' AND (spotter_output.departure_airport_icao = :airport_icao OR spotter_output.arrival_airport_icao = :airport_icao ) |
| 3946 | 3946 | GROUP BY spotter_output.airline_country |
@@ -3954,7 +3954,7 @@ discard block |
||
| 3954 | 3954 | $airline_country_array = array(); |
| 3955 | 3955 | $temp_array = array(); |
| 3956 | 3956 | |
| 3957 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3957 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3958 | 3958 | { |
| 3959 | 3959 | $temp_array['airline_country_count'] = $row['airline_country_count']; |
| 3960 | 3960 | $temp_array['airline_country'] = $row['airline_country']; |
@@ -3973,9 +3973,9 @@ discard block |
||
| 3973 | 3973 | */ |
| 3974 | 3974 | public function countAllAirlinesByManufacturer($aircraft_manufacturer) |
| 3975 | 3975 | { |
| 3976 | - $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
|
| 3976 | + $aircraft_manufacturer = filter_var($aircraft_manufacturer, FILTER_SANITIZE_STRING); |
|
| 3977 | 3977 | |
| 3978 | - $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
|
| 3978 | + $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
|
| 3979 | 3979 | FROM spotter_output |
| 3980 | 3980 | WHERE spotter_output.aircraft_manufacturer = :aircraft_manufacturer |
| 3981 | 3981 | GROUP BY spotter_output.airline_name |
@@ -3987,7 +3987,7 @@ discard block |
||
| 3987 | 3987 | $airline_array = array(); |
| 3988 | 3988 | $temp_array = array(); |
| 3989 | 3989 | |
| 3990 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3990 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 3991 | 3991 | { |
| 3992 | 3992 | $temp_array['airline_name'] = $row['airline_name']; |
| 3993 | 3993 | $temp_array['airline_icao'] = $row['airline_icao']; |
@@ -4009,9 +4009,9 @@ discard block |
||
| 4009 | 4009 | */ |
| 4010 | 4010 | public function countAllAirlineCountriesByManufacturer($aircraft_manufacturer) |
| 4011 | 4011 | { |
| 4012 | - $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
|
| 4012 | + $aircraft_manufacturer = filter_var($aircraft_manufacturer, FILTER_SANITIZE_STRING); |
|
| 4013 | 4013 | |
| 4014 | - $query = "SELECT DISTINCT spotter_output.airline_country, COUNT(spotter_output.airline_country) AS airline_country_count |
|
| 4014 | + $query = "SELECT DISTINCT spotter_output.airline_country, COUNT(spotter_output.airline_country) AS airline_country_count |
|
| 4015 | 4015 | FROM spotter_output |
| 4016 | 4016 | WHERE spotter_output.airline_country <> '' AND spotter_output.aircraft_manufacturer = :aircraft_manufacturer |
| 4017 | 4017 | GROUP BY spotter_output.airline_country |
@@ -4025,7 +4025,7 @@ discard block |
||
| 4025 | 4025 | $airline_country_array = array(); |
| 4026 | 4026 | $temp_array = array(); |
| 4027 | 4027 | |
| 4028 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4028 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4029 | 4029 | { |
| 4030 | 4030 | $temp_array['airline_country_count'] = $row['airline_country_count']; |
| 4031 | 4031 | $temp_array['airline_country'] = $row['airline_country']; |
@@ -4044,7 +4044,7 @@ discard block |
||
| 4044 | 4044 | public function countAllAirlinesByDate($date) |
| 4045 | 4045 | { |
| 4046 | 4046 | global $globalTimezone, $globalDBdriver; |
| 4047 | - $date = filter_var($date,FILTER_SANITIZE_STRING); |
|
| 4047 | + $date = filter_var($date, FILTER_SANITIZE_STRING); |
|
| 4048 | 4048 | |
| 4049 | 4049 | if ($globalTimezone != '') { |
| 4050 | 4050 | date_default_timezone_set($globalTimezone); |
@@ -4053,13 +4053,13 @@ discard block |
||
| 4053 | 4053 | } else $offset = '+00:00'; |
| 4054 | 4054 | |
| 4055 | 4055 | if ($globalDBdriver == 'mysql') { |
| 4056 | - $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
|
| 4056 | + $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
|
| 4057 | 4057 | FROM spotter_output |
| 4058 | 4058 | WHERE DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) = :date |
| 4059 | 4059 | GROUP BY spotter_output.airline_name |
| 4060 | 4060 | ORDER BY airline_count DESC"; |
| 4061 | 4061 | } else { |
| 4062 | - $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
|
| 4062 | + $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
|
| 4063 | 4063 | FROM spotter_output |
| 4064 | 4064 | WHERE to_char(spotter_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') = :date |
| 4065 | 4065 | GROUP BY spotter_output.airline_name |
@@ -4071,7 +4071,7 @@ discard block |
||
| 4071 | 4071 | |
| 4072 | 4072 | $airline_array = array(); |
| 4073 | 4073 | $temp_array = array(); |
| 4074 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4074 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4075 | 4075 | { |
| 4076 | 4076 | $temp_array['airline_name'] = $row['airline_name']; |
| 4077 | 4077 | $temp_array['airline_icao'] = $row['airline_icao']; |
@@ -4094,7 +4094,7 @@ discard block |
||
| 4094 | 4094 | public function countAllAirlineCountriesByDate($date) |
| 4095 | 4095 | { |
| 4096 | 4096 | global $globalTimezone, $globalDBdriver; |
| 4097 | - $date = filter_var($date,FILTER_SANITIZE_STRING); |
|
| 4097 | + $date = filter_var($date, FILTER_SANITIZE_STRING); |
|
| 4098 | 4098 | if ($globalTimezone != '') { |
| 4099 | 4099 | date_default_timezone_set($globalTimezone); |
| 4100 | 4100 | $datetime = new DateTime($date); |
@@ -4102,14 +4102,14 @@ discard block |
||
| 4102 | 4102 | } else $offset = '+00:00'; |
| 4103 | 4103 | |
| 4104 | 4104 | if ($globalDBdriver == 'mysql') { |
| 4105 | - $query = "SELECT DISTINCT spotter_output.airline_country, COUNT(spotter_output.airline_country) AS airline_country_count |
|
| 4105 | + $query = "SELECT DISTINCT spotter_output.airline_country, COUNT(spotter_output.airline_country) AS airline_country_count |
|
| 4106 | 4106 | FROM spotter_output |
| 4107 | 4107 | WHERE spotter_output.airline_country <> '' AND DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) = :date |
| 4108 | 4108 | GROUP BY spotter_output.airline_country |
| 4109 | 4109 | ORDER BY airline_country_count DESC |
| 4110 | 4110 | LIMIT 10 OFFSET 0"; |
| 4111 | 4111 | } else { |
| 4112 | - $query = "SELECT DISTINCT spotter_output.airline_country, COUNT(spotter_output.airline_country) AS airline_country_count |
|
| 4112 | + $query = "SELECT DISTINCT spotter_output.airline_country, COUNT(spotter_output.airline_country) AS airline_country_count |
|
| 4113 | 4113 | FROM spotter_output |
| 4114 | 4114 | WHERE spotter_output.airline_country <> '' AND to_char(spotter_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') = :date |
| 4115 | 4115 | GROUP BY spotter_output.airline_country |
@@ -4122,7 +4122,7 @@ discard block |
||
| 4122 | 4122 | |
| 4123 | 4123 | $airline_country_array = array(); |
| 4124 | 4124 | $temp_array = array(); |
| 4125 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4125 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4126 | 4126 | { |
| 4127 | 4127 | $temp_array['airline_country_count'] = $row['airline_country_count']; |
| 4128 | 4128 | $temp_array['airline_country'] = $row['airline_country']; |
@@ -4141,9 +4141,9 @@ discard block |
||
| 4141 | 4141 | */ |
| 4142 | 4142 | public function countAllAirlinesByIdent($ident) |
| 4143 | 4143 | { |
| 4144 | - $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
|
| 4144 | + $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
|
| 4145 | 4145 | |
| 4146 | - $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
|
| 4146 | + $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
|
| 4147 | 4147 | FROM spotter_output |
| 4148 | 4148 | WHERE spotter_output.ident = :ident |
| 4149 | 4149 | GROUP BY spotter_output.airline_name |
@@ -4156,7 +4156,7 @@ discard block |
||
| 4156 | 4156 | $airline_array = array(); |
| 4157 | 4157 | $temp_array = array(); |
| 4158 | 4158 | |
| 4159 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4159 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4160 | 4160 | { |
| 4161 | 4161 | $temp_array['airline_name'] = $row['airline_name']; |
| 4162 | 4162 | $temp_array['airline_icao'] = $row['airline_icao']; |
@@ -4176,10 +4176,10 @@ discard block |
||
| 4176 | 4176 | */ |
| 4177 | 4177 | public function countAllAirlinesByRoute($departure_airport_icao, $arrival_airport_icao) |
| 4178 | 4178 | { |
| 4179 | - $departure_airport_icao = filter_var($departure_airport_icao,FILTER_SANITIZE_STRING); |
|
| 4180 | - $arrival_airport_icao = filter_var($arrival_airport_icao,FILTER_SANITIZE_STRING); |
|
| 4179 | + $departure_airport_icao = filter_var($departure_airport_icao, FILTER_SANITIZE_STRING); |
|
| 4180 | + $arrival_airport_icao = filter_var($arrival_airport_icao, FILTER_SANITIZE_STRING); |
|
| 4181 | 4181 | |
| 4182 | - $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
|
| 4182 | + $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
|
| 4183 | 4183 | FROM spotter_output |
| 4184 | 4184 | WHERE (spotter_output.departure_airport_icao = :departure_airport_icao) AND (spotter_output.arrival_airport_icao = :arrival_airport_icao) |
| 4185 | 4185 | GROUP BY spotter_output.airline_name |
@@ -4187,12 +4187,12 @@ discard block |
||
| 4187 | 4187 | |
| 4188 | 4188 | |
| 4189 | 4189 | $sth = $this->db->prepare($query); |
| 4190 | - $sth->execute(array(':departure_airport_icao' => $departure_airport_icao,':arrival_airport_icao' => $arrival_airport_icao)); |
|
| 4190 | + $sth->execute(array(':departure_airport_icao' => $departure_airport_icao, ':arrival_airport_icao' => $arrival_airport_icao)); |
|
| 4191 | 4191 | |
| 4192 | 4192 | $airline_array = array(); |
| 4193 | 4193 | $temp_array = array(); |
| 4194 | 4194 | |
| 4195 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4195 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4196 | 4196 | { |
| 4197 | 4197 | $temp_array['airline_name'] = $row['airline_name']; |
| 4198 | 4198 | $temp_array['airline_icao'] = $row['airline_icao']; |
@@ -4212,10 +4212,10 @@ discard block |
||
| 4212 | 4212 | */ |
| 4213 | 4213 | public function countAllAirlineCountriesByRoute($departure_airport_icao, $arrival_airport_icao) |
| 4214 | 4214 | { |
| 4215 | - $departure_airport_icao = filter_var($departure_airport_icao,FILTER_SANITIZE_STRING); |
|
| 4216 | - $arrival_airport_icao = filter_var($arrival_airport_icao,FILTER_SANITIZE_STRING); |
|
| 4215 | + $departure_airport_icao = filter_var($departure_airport_icao, FILTER_SANITIZE_STRING); |
|
| 4216 | + $arrival_airport_icao = filter_var($arrival_airport_icao, FILTER_SANITIZE_STRING); |
|
| 4217 | 4217 | |
| 4218 | - $query = "SELECT DISTINCT spotter_output.airline_country, COUNT(spotter_output.airline_country) AS airline_country_count |
|
| 4218 | + $query = "SELECT DISTINCT spotter_output.airline_country, COUNT(spotter_output.airline_country) AS airline_country_count |
|
| 4219 | 4219 | FROM spotter_output |
| 4220 | 4220 | WHERE spotter_output.airline_country <> '' AND (spotter_output.departure_airport_icao = :departure_airport_icao) AND (spotter_output.arrival_airport_icao = :arrival_airport_icao) |
| 4221 | 4221 | GROUP BY spotter_output.airline_country |
@@ -4224,11 +4224,11 @@ discard block |
||
| 4224 | 4224 | |
| 4225 | 4225 | |
| 4226 | 4226 | $sth = $this->db->prepare($query); |
| 4227 | - $sth->execute(array(':departure_airport_icao' => $departure_airport_icao,':arrival_airport_icao' => $arrival_airport_icao)); |
|
| 4227 | + $sth->execute(array(':departure_airport_icao' => $departure_airport_icao, ':arrival_airport_icao' => $arrival_airport_icao)); |
|
| 4228 | 4228 | |
| 4229 | 4229 | $airline_country_array = array(); |
| 4230 | 4230 | $temp_array = array(); |
| 4231 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4231 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4232 | 4232 | { |
| 4233 | 4233 | $temp_array['airline_country_count'] = $row['airline_country_count']; |
| 4234 | 4234 | $temp_array['airline_country'] = $row['airline_country']; |
@@ -4248,9 +4248,9 @@ discard block |
||
| 4248 | 4248 | */ |
| 4249 | 4249 | public function countAllAirlinesByCountry($country) |
| 4250 | 4250 | { |
| 4251 | - $country = filter_var($country,FILTER_SANITIZE_STRING); |
|
| 4251 | + $country = filter_var($country, FILTER_SANITIZE_STRING); |
|
| 4252 | 4252 | |
| 4253 | - $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
|
| 4253 | + $query = "SELECT DISTINCT spotter_output.airline_name, spotter_output.airline_icao, spotter_output.airline_country, COUNT(spotter_output.airline_name) AS airline_count |
|
| 4254 | 4254 | FROM spotter_output |
| 4255 | 4255 | WHERE ((spotter_output.departure_airport_country = :country) OR (spotter_output.arrival_airport_country = :country)) OR spotter_output.airline_country = :country |
| 4256 | 4256 | GROUP BY spotter_output.airline_name |
@@ -4262,7 +4262,7 @@ discard block |
||
| 4262 | 4262 | |
| 4263 | 4263 | $airline_array = array(); |
| 4264 | 4264 | $temp_array = array(); |
| 4265 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4265 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4266 | 4266 | { |
| 4267 | 4267 | $temp_array['airline_name'] = $row['airline_name']; |
| 4268 | 4268 | $temp_array['airline_icao'] = $row['airline_icao']; |
@@ -4283,9 +4283,9 @@ discard block |
||
| 4283 | 4283 | */ |
| 4284 | 4284 | public function countAllAirlineCountriesByCountry($country) |
| 4285 | 4285 | { |
| 4286 | - $country = filter_var($country,FILTER_SANITIZE_STRING); |
|
| 4286 | + $country = filter_var($country, FILTER_SANITIZE_STRING); |
|
| 4287 | 4287 | |
| 4288 | - $query = "SELECT DISTINCT spotter_output.airline_country, COUNT(spotter_output.airline_country) AS airline_country_count |
|
| 4288 | + $query = "SELECT DISTINCT spotter_output.airline_country, COUNT(spotter_output.airline_country) AS airline_country_count |
|
| 4289 | 4289 | FROM spotter_output |
| 4290 | 4290 | WHERE spotter_output.airline_country <> '' AND ((spotter_output.departure_airport_country = :country) OR (spotter_output.arrival_airport_country = :country)) OR spotter_output.airline_country = :country |
| 4291 | 4291 | GROUP BY spotter_output.airline_country |
@@ -4298,7 +4298,7 @@ discard block |
||
| 4298 | 4298 | |
| 4299 | 4299 | $airline_country_array = array(); |
| 4300 | 4300 | $temp_array = array(); |
| 4301 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4301 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4302 | 4302 | { |
| 4303 | 4303 | $temp_array['airline_country_count'] = $row['airline_country_count']; |
| 4304 | 4304 | $temp_array['airline_country'] = $row['airline_country']; |
@@ -4317,8 +4317,8 @@ discard block |
||
| 4317 | 4317 | */ |
| 4318 | 4318 | public function countAllAirlineCountries($limit = true, $filters = array()) |
| 4319 | 4319 | { |
| 4320 | - $filter_query = $this->getFilter($filters,true,true); |
|
| 4321 | - $query = "SELECT DISTINCT spotter_output.airline_country, COUNT(spotter_output.airline_country) AS airline_country_count |
|
| 4320 | + $filter_query = $this->getFilter($filters, true, true); |
|
| 4321 | + $query = "SELECT DISTINCT spotter_output.airline_country, COUNT(spotter_output.airline_country) AS airline_country_count |
|
| 4322 | 4322 | FROM spotter_output".$filter_query." spotter_output.airline_country <> '' AND spotter_output.airline_country <> 'NA' |
| 4323 | 4323 | GROUP BY spotter_output.airline_country |
| 4324 | 4324 | ORDER BY airline_country_count DESC"; |
@@ -4329,7 +4329,7 @@ discard block |
||
| 4329 | 4329 | |
| 4330 | 4330 | $airline_array = array(); |
| 4331 | 4331 | $temp_array = array(); |
| 4332 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4332 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4333 | 4333 | { |
| 4334 | 4334 | $temp_array['airline_country_count'] = $row['airline_country_count']; |
| 4335 | 4335 | $temp_array['airline_country'] = $row['airline_country']; |
@@ -4345,10 +4345,10 @@ discard block |
||
| 4345 | 4345 | * @return Array the airline country list |
| 4346 | 4346 | * |
| 4347 | 4347 | */ |
| 4348 | - public function countAllFlightOverCountries($limit = true,$olderthanmonths = 0,$sincedate = '') |
|
| 4348 | + public function countAllFlightOverCountries($limit = true, $olderthanmonths = 0, $sincedate = '') |
|
| 4349 | 4349 | { |
| 4350 | 4350 | global $globalDBdriver; |
| 4351 | - $Connection= new Connection($this->db); |
|
| 4351 | + $Connection = new Connection($this->db); |
|
| 4352 | 4352 | if (!$Connection->tableExists('countries')) return array(); |
| 4353 | 4353 | /* |
| 4354 | 4354 | $query = "SELECT c.name, c.iso3, c.iso2, count(c.name) as nb |
@@ -4383,7 +4383,7 @@ discard block |
||
| 4383 | 4383 | $flight_array = array(); |
| 4384 | 4384 | $temp_array = array(); |
| 4385 | 4385 | |
| 4386 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4386 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4387 | 4387 | { |
| 4388 | 4388 | $temp_array['flight_count'] = $row['nb']; |
| 4389 | 4389 | $temp_array['flight_country'] = $row['name']; |
@@ -4401,12 +4401,12 @@ discard block |
||
| 4401 | 4401 | * @return Array the aircraft list |
| 4402 | 4402 | * |
| 4403 | 4403 | */ |
| 4404 | - public function countAllAircraftTypes($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array()) |
|
| 4404 | + public function countAllAircraftTypes($limit = true, $olderthanmonths = 0, $sincedate = '', $filters = array()) |
|
| 4405 | 4405 | { |
| 4406 | 4406 | global $globalDBdriver; |
| 4407 | - $filter_query = $this->getFilter($filters,true,true); |
|
| 4407 | + $filter_query = $this->getFilter($filters, true, true); |
|
| 4408 | 4408 | |
| 4409 | - $query = "SELECT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name, spotter_output.aircraft_manufacturer |
|
| 4409 | + $query = "SELECT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name, spotter_output.aircraft_manufacturer |
|
| 4410 | 4410 | FROM spotter_output ".$filter_query." spotter_output.aircraft_name <> '' AND spotter_output.aircraft_icao <> ''"; |
| 4411 | 4411 | if ($olderthanmonths > 0) { |
| 4412 | 4412 | if ($globalDBdriver == 'mysql') { |
@@ -4431,7 +4431,7 @@ discard block |
||
| 4431 | 4431 | |
| 4432 | 4432 | $aircraft_array = array(); |
| 4433 | 4433 | $temp_array = array(); |
| 4434 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4434 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4435 | 4435 | { |
| 4436 | 4436 | $temp_array['aircraft_icao'] = $row['aircraft_icao']; |
| 4437 | 4437 | $temp_array['aircraft_name'] = $row['aircraft_name']; |
@@ -4448,10 +4448,10 @@ discard block |
||
| 4448 | 4448 | * @return Array the aircraft list |
| 4449 | 4449 | * |
| 4450 | 4450 | */ |
| 4451 | - public function countAllAircraftTypesByAirlines($limit = true,$olderthanmonths = 0,$sincedate = '') |
|
| 4451 | + public function countAllAircraftTypesByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '') |
|
| 4452 | 4452 | { |
| 4453 | 4453 | global $globalDBdriver; |
| 4454 | - $query = "SELECT spotter_output.airline_icao, spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name, spotter_output.aircraft_manufacturer |
|
| 4454 | + $query = "SELECT spotter_output.airline_icao, spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name, spotter_output.aircraft_manufacturer |
|
| 4455 | 4455 | FROM spotter_output |
| 4456 | 4456 | WHERE spotter_output.aircraft_name <> '' AND spotter_output.aircraft_icao <> '' AND spotter_output.airline_icao <>'' AND spotter_output.airline_icao <> 'NA' "; |
| 4457 | 4457 | if ($olderthanmonths > 0) { |
@@ -4477,7 +4477,7 @@ discard block |
||
| 4477 | 4477 | |
| 4478 | 4478 | $aircraft_array = array(); |
| 4479 | 4479 | $temp_array = array(); |
| 4480 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4480 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4481 | 4481 | { |
| 4482 | 4482 | $temp_array['airline_icao'] = $row['airline_icao']; |
| 4483 | 4483 | $temp_array['aircraft_icao'] = $row['aircraft_icao']; |
@@ -4499,9 +4499,9 @@ discard block |
||
| 4499 | 4499 | public function countAllAircraftRegistrationByAircraft($aircraft_icao) |
| 4500 | 4500 | { |
| 4501 | 4501 | $Image = new Image($this->db); |
| 4502 | - $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
|
| 4502 | + $aircraft_icao = filter_var($aircraft_icao, FILTER_SANITIZE_STRING); |
|
| 4503 | 4503 | |
| 4504 | - $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.registration) AS registration_count, spotter_output.aircraft_name, spotter_output.registration, spotter_output.airline_name |
|
| 4504 | + $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.registration) AS registration_count, spotter_output.aircraft_name, spotter_output.registration, spotter_output.airline_name |
|
| 4505 | 4505 | FROM spotter_output |
| 4506 | 4506 | WHERE spotter_output.registration <> '' AND spotter_output.aircraft_icao = :aircraft_icao |
| 4507 | 4507 | GROUP BY spotter_output.registration |
@@ -4513,14 +4513,14 @@ discard block |
||
| 4513 | 4513 | $aircraft_array = array(); |
| 4514 | 4514 | $temp_array = array(); |
| 4515 | 4515 | |
| 4516 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4516 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4517 | 4517 | { |
| 4518 | 4518 | $temp_array['aircraft_icao'] = $row['aircraft_icao']; |
| 4519 | 4519 | $temp_array['aircraft_name'] = $row['aircraft_name']; |
| 4520 | 4520 | $temp_array['registration'] = $row['registration']; |
| 4521 | 4521 | $temp_array['airline_name'] = $row['airline_name']; |
| 4522 | 4522 | $temp_array['image_thumbnail'] = ""; |
| 4523 | - if($row['registration'] != "") |
|
| 4523 | + if ($row['registration'] != "") |
|
| 4524 | 4524 | { |
| 4525 | 4525 | $image_array = $Image->getSpotterImage($row['registration']); |
| 4526 | 4526 | if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
@@ -4541,9 +4541,9 @@ discard block |
||
| 4541 | 4541 | */ |
| 4542 | 4542 | public function countAllAircraftTypesByAirline($airline_icao) |
| 4543 | 4543 | { |
| 4544 | - $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING); |
|
| 4544 | + $airline_icao = filter_var($airline_icao, FILTER_SANITIZE_STRING); |
|
| 4545 | 4545 | |
| 4546 | - $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name |
|
| 4546 | + $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name |
|
| 4547 | 4547 | FROM spotter_output |
| 4548 | 4548 | WHERE spotter_output.aircraft_icao <> '' AND spotter_output.airline_icao = :airline_icao |
| 4549 | 4549 | GROUP BY spotter_output.aircraft_name |
@@ -4555,7 +4555,7 @@ discard block |
||
| 4555 | 4555 | $aircraft_array = array(); |
| 4556 | 4556 | $temp_array = array(); |
| 4557 | 4557 | |
| 4558 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4558 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4559 | 4559 | { |
| 4560 | 4560 | $temp_array['aircraft_icao'] = $row['aircraft_icao']; |
| 4561 | 4561 | $temp_array['aircraft_name'] = $row['aircraft_name']; |
@@ -4576,9 +4576,9 @@ discard block |
||
| 4576 | 4576 | public function countAllAircraftRegistrationByAirline($airline_icao) |
| 4577 | 4577 | { |
| 4578 | 4578 | $Image = new Image($this->db); |
| 4579 | - $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING); |
|
| 4579 | + $airline_icao = filter_var($airline_icao, FILTER_SANITIZE_STRING); |
|
| 4580 | 4580 | |
| 4581 | - $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.registration) AS registration_count, spotter_output.aircraft_name, spotter_output.registration, spotter_output.airline_name |
|
| 4581 | + $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.registration) AS registration_count, spotter_output.aircraft_name, spotter_output.registration, spotter_output.airline_name |
|
| 4582 | 4582 | FROM spotter_output |
| 4583 | 4583 | WHERE spotter_output.registration <> '' AND spotter_output.airline_icao = :airline_icao |
| 4584 | 4584 | GROUP BY spotter_output.registration |
@@ -4589,14 +4589,14 @@ discard block |
||
| 4589 | 4589 | |
| 4590 | 4590 | $aircraft_array = array(); |
| 4591 | 4591 | $temp_array = array(); |
| 4592 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4592 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4593 | 4593 | { |
| 4594 | 4594 | $temp_array['aircraft_icao'] = $row['aircraft_icao']; |
| 4595 | 4595 | $temp_array['aircraft_name'] = $row['aircraft_name']; |
| 4596 | 4596 | $temp_array['registration'] = $row['registration']; |
| 4597 | 4597 | $temp_array['airline_name'] = $row['airline_name']; |
| 4598 | 4598 | $temp_array['image_thumbnail'] = ""; |
| 4599 | - if($row['registration'] != "") |
|
| 4599 | + if ($row['registration'] != "") |
|
| 4600 | 4600 | { |
| 4601 | 4601 | $image_array = $Image->getSpotterImage($row['registration']); |
| 4602 | 4602 | if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
@@ -4617,9 +4617,9 @@ discard block |
||
| 4617 | 4617 | */ |
| 4618 | 4618 | public function countAllAircraftManufacturerByAirline($airline_icao) |
| 4619 | 4619 | { |
| 4620 | - $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING); |
|
| 4620 | + $airline_icao = filter_var($airline_icao, FILTER_SANITIZE_STRING); |
|
| 4621 | 4621 | |
| 4622 | - $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
|
| 4622 | + $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
|
| 4623 | 4623 | FROM spotter_output |
| 4624 | 4624 | WHERE spotter_output.aircraft_manufacturer <> '' AND spotter_output.airline_icao = :airline_icao |
| 4625 | 4625 | GROUP BY spotter_output.aircraft_manufacturer |
@@ -4631,7 +4631,7 @@ discard block |
||
| 4631 | 4631 | $aircraft_array = array(); |
| 4632 | 4632 | $temp_array = array(); |
| 4633 | 4633 | |
| 4634 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4634 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4635 | 4635 | { |
| 4636 | 4636 | $temp_array['aircraft_manufacturer'] = $row['aircraft_manufacturer']; |
| 4637 | 4637 | $temp_array['aircraft_manufacturer_count'] = $row['aircraft_manufacturer_count']; |
@@ -4650,9 +4650,9 @@ discard block |
||
| 4650 | 4650 | */ |
| 4651 | 4651 | public function countAllAircraftTypesByAirport($airport_icao) |
| 4652 | 4652 | { |
| 4653 | - $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
|
| 4653 | + $airport_icao = filter_var($airport_icao, FILTER_SANITIZE_STRING); |
|
| 4654 | 4654 | |
| 4655 | - $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name |
|
| 4655 | + $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name |
|
| 4656 | 4656 | FROM spotter_output |
| 4657 | 4657 | WHERE spotter_output.aircraft_icao <> '' AND (spotter_output.departure_airport_icao = :airport_icao OR spotter_output.arrival_airport_icao = :airport_icao) |
| 4658 | 4658 | GROUP BY spotter_output.aircraft_name |
@@ -4663,7 +4663,7 @@ discard block |
||
| 4663 | 4663 | |
| 4664 | 4664 | $aircraft_array = array(); |
| 4665 | 4665 | $temp_array = array(); |
| 4666 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4666 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4667 | 4667 | { |
| 4668 | 4668 | $temp_array['aircraft_icao'] = $row['aircraft_icao']; |
| 4669 | 4669 | $temp_array['aircraft_name'] = $row['aircraft_name']; |
@@ -4684,9 +4684,9 @@ discard block |
||
| 4684 | 4684 | public function countAllAircraftRegistrationByAirport($airport_icao) |
| 4685 | 4685 | { |
| 4686 | 4686 | $Image = new Image($this->db); |
| 4687 | - $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
|
| 4687 | + $airport_icao = filter_var($airport_icao, FILTER_SANITIZE_STRING); |
|
| 4688 | 4688 | |
| 4689 | - $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.registration) AS registration_count, spotter_output.aircraft_name, spotter_output.registration, spotter_output.airline_name |
|
| 4689 | + $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.registration) AS registration_count, spotter_output.aircraft_name, spotter_output.registration, spotter_output.airline_name |
|
| 4690 | 4690 | FROM spotter_output |
| 4691 | 4691 | WHERE spotter_output.registration <> '' AND (spotter_output.departure_airport_icao = :airport_icao OR spotter_output.arrival_airport_icao = :airport_icao) |
| 4692 | 4692 | GROUP BY spotter_output.registration |
@@ -4698,14 +4698,14 @@ discard block |
||
| 4698 | 4698 | |
| 4699 | 4699 | $aircraft_array = array(); |
| 4700 | 4700 | $temp_array = array(); |
| 4701 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4701 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4702 | 4702 | { |
| 4703 | 4703 | $temp_array['aircraft_icao'] = $row['aircraft_icao']; |
| 4704 | 4704 | $temp_array['aircraft_name'] = $row['aircraft_name']; |
| 4705 | 4705 | $temp_array['registration'] = $row['registration']; |
| 4706 | 4706 | $temp_array['airline_name'] = $row['airline_name']; |
| 4707 | 4707 | $temp_array['image_thumbnail'] = ""; |
| 4708 | - if($row['registration'] != "") |
|
| 4708 | + if ($row['registration'] != "") |
|
| 4709 | 4709 | { |
| 4710 | 4710 | $image_array = $Image->getSpotterImage($row['registration']); |
| 4711 | 4711 | $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
@@ -4725,9 +4725,9 @@ discard block |
||
| 4725 | 4725 | */ |
| 4726 | 4726 | public function countAllAircraftManufacturerByAirport($airport_icao) |
| 4727 | 4727 | { |
| 4728 | - $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
|
| 4728 | + $airport_icao = filter_var($airport_icao, FILTER_SANITIZE_STRING); |
|
| 4729 | 4729 | |
| 4730 | - $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
|
| 4730 | + $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
|
| 4731 | 4731 | FROM spotter_output |
| 4732 | 4732 | WHERE spotter_output.aircraft_manufacturer <> '' AND (spotter_output.departure_airport_icao = :airport_icao OR spotter_output.arrival_airport_icao = :airport_icao) |
| 4733 | 4733 | GROUP BY spotter_output.aircraft_manufacturer |
@@ -4739,7 +4739,7 @@ discard block |
||
| 4739 | 4739 | |
| 4740 | 4740 | $aircraft_array = array(); |
| 4741 | 4741 | $temp_array = array(); |
| 4742 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4742 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4743 | 4743 | { |
| 4744 | 4744 | $temp_array['aircraft_manufacturer'] = $row['aircraft_manufacturer']; |
| 4745 | 4745 | $temp_array['aircraft_manufacturer_count'] = $row['aircraft_manufacturer_count']; |
@@ -4756,9 +4756,9 @@ discard block |
||
| 4756 | 4756 | */ |
| 4757 | 4757 | public function countAllAircraftTypesByManufacturer($aircraft_manufacturer) |
| 4758 | 4758 | { |
| 4759 | - $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
|
| 4759 | + $aircraft_manufacturer = filter_var($aircraft_manufacturer, FILTER_SANITIZE_STRING); |
|
| 4760 | 4760 | |
| 4761 | - $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name |
|
| 4761 | + $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name |
|
| 4762 | 4762 | FROM spotter_output |
| 4763 | 4763 | WHERE spotter_output.aircraft_manufacturer = :aircraft_manufacturer |
| 4764 | 4764 | GROUP BY spotter_output.aircraft_name |
@@ -4768,7 +4768,7 @@ discard block |
||
| 4768 | 4768 | $sth->execute(array(':aircraft_manufacturer' => $aircraft_manufacturer)); |
| 4769 | 4769 | $aircraft_array = array(); |
| 4770 | 4770 | $temp_array = array(); |
| 4771 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4771 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4772 | 4772 | { |
| 4773 | 4773 | $temp_array['aircraft_icao'] = $row['aircraft_icao']; |
| 4774 | 4774 | $temp_array['aircraft_name'] = $row['aircraft_name']; |
@@ -4788,9 +4788,9 @@ discard block |
||
| 4788 | 4788 | public function countAllAircraftRegistrationByManufacturer($aircraft_manufacturer) |
| 4789 | 4789 | { |
| 4790 | 4790 | $Image = new Image($this->db); |
| 4791 | - $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
|
| 4791 | + $aircraft_manufacturer = filter_var($aircraft_manufacturer, FILTER_SANITIZE_STRING); |
|
| 4792 | 4792 | |
| 4793 | - $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.registration) AS registration_count, spotter_output.aircraft_name, spotter_output.registration, spotter_output.airline_name |
|
| 4793 | + $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.registration) AS registration_count, spotter_output.aircraft_name, spotter_output.registration, spotter_output.airline_name |
|
| 4794 | 4794 | FROM spotter_output |
| 4795 | 4795 | WHERE spotter_output.registration <> '' AND spotter_output.aircraft_manufacturer = :aircraft_manufacturer |
| 4796 | 4796 | GROUP BY spotter_output.registration |
@@ -4801,14 +4801,14 @@ discard block |
||
| 4801 | 4801 | $sth->execute(array(':aircraft_manufacturer' => $aircraft_manufacturer)); |
| 4802 | 4802 | $aircraft_array = array(); |
| 4803 | 4803 | $temp_array = array(); |
| 4804 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4804 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4805 | 4805 | { |
| 4806 | 4806 | $temp_array['aircraft_icao'] = $row['aircraft_icao']; |
| 4807 | 4807 | $temp_array['aircraft_name'] = $row['aircraft_name']; |
| 4808 | 4808 | $temp_array['registration'] = $row['registration']; |
| 4809 | 4809 | $temp_array['airline_name'] = $row['airline_name']; |
| 4810 | 4810 | $temp_array['image_thumbnail'] = ""; |
| 4811 | - if($row['registration'] != "") |
|
| 4811 | + if ($row['registration'] != "") |
|
| 4812 | 4812 | { |
| 4813 | 4813 | $image_array = $Image->getSpotterImage($row['registration']); |
| 4814 | 4814 | $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
@@ -4828,7 +4828,7 @@ discard block |
||
| 4828 | 4828 | public function countAllAircraftTypesByDate($date) |
| 4829 | 4829 | { |
| 4830 | 4830 | global $globalTimezone, $globalDBdriver; |
| 4831 | - $date = filter_var($date,FILTER_SANITIZE_STRING); |
|
| 4831 | + $date = filter_var($date, FILTER_SANITIZE_STRING); |
|
| 4832 | 4832 | if ($globalTimezone != '') { |
| 4833 | 4833 | date_default_timezone_set($globalTimezone); |
| 4834 | 4834 | $datetime = new DateTime($date); |
@@ -4836,13 +4836,13 @@ discard block |
||
| 4836 | 4836 | } else $offset = '+00:00'; |
| 4837 | 4837 | |
| 4838 | 4838 | if ($globalDBdriver == 'mysql') { |
| 4839 | - $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name |
|
| 4839 | + $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name |
|
| 4840 | 4840 | FROM spotter_output |
| 4841 | 4841 | WHERE DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) = :date |
| 4842 | 4842 | GROUP BY spotter_output.aircraft_name |
| 4843 | 4843 | ORDER BY aircraft_icao_count DESC"; |
| 4844 | 4844 | } else { |
| 4845 | - $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name |
|
| 4845 | + $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name |
|
| 4846 | 4846 | FROM spotter_output |
| 4847 | 4847 | WHERE to_char(spotter_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') = :date |
| 4848 | 4848 | GROUP BY spotter_output.aircraft_name |
@@ -4854,7 +4854,7 @@ discard block |
||
| 4854 | 4854 | |
| 4855 | 4855 | $aircraft_array = array(); |
| 4856 | 4856 | $temp_array = array(); |
| 4857 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4857 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4858 | 4858 | { |
| 4859 | 4859 | $temp_array['aircraft_icao'] = $row['aircraft_icao']; |
| 4860 | 4860 | $temp_array['aircraft_name'] = $row['aircraft_name']; |
@@ -4876,7 +4876,7 @@ discard block |
||
| 4876 | 4876 | { |
| 4877 | 4877 | global $globalTimezone, $globalDBdriver; |
| 4878 | 4878 | $Image = new Image($this->db); |
| 4879 | - $date = filter_var($date,FILTER_SANITIZE_STRING); |
|
| 4879 | + $date = filter_var($date, FILTER_SANITIZE_STRING); |
|
| 4880 | 4880 | if ($globalTimezone != '') { |
| 4881 | 4881 | date_default_timezone_set($globalTimezone); |
| 4882 | 4882 | $datetime = new DateTime($date); |
@@ -4884,13 +4884,13 @@ discard block |
||
| 4884 | 4884 | } else $offset = '+00:00'; |
| 4885 | 4885 | |
| 4886 | 4886 | if ($globalDBdriver == 'mysql') { |
| 4887 | - $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.registration) AS registration_count, spotter_output.aircraft_name, spotter_output.registration, spotter_output.airline_name |
|
| 4887 | + $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.registration) AS registration_count, spotter_output.aircraft_name, spotter_output.registration, spotter_output.airline_name |
|
| 4888 | 4888 | FROM spotter_output |
| 4889 | 4889 | WHERE spotter_output.registration <> '' AND DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) = :date |
| 4890 | 4890 | GROUP BY spotter_output.registration |
| 4891 | 4891 | ORDER BY registration_count DESC"; |
| 4892 | 4892 | } else { |
| 4893 | - $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.registration) AS registration_count, spotter_output.aircraft_name, spotter_output.registration, spotter_output.airline_name |
|
| 4893 | + $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.registration) AS registration_count, spotter_output.aircraft_name, spotter_output.registration, spotter_output.airline_name |
|
| 4894 | 4894 | FROM spotter_output |
| 4895 | 4895 | WHERE spotter_output.registration <> '' AND to_char(spotter_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') = :date |
| 4896 | 4896 | GROUP BY spotter_output.registration |
@@ -4902,14 +4902,14 @@ discard block |
||
| 4902 | 4902 | |
| 4903 | 4903 | $aircraft_array = array(); |
| 4904 | 4904 | $temp_array = array(); |
| 4905 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4905 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4906 | 4906 | { |
| 4907 | 4907 | $temp_array['aircraft_icao'] = $row['aircraft_icao']; |
| 4908 | 4908 | $temp_array['aircraft_name'] = $row['aircraft_name']; |
| 4909 | 4909 | $temp_array['registration'] = $row['registration']; |
| 4910 | 4910 | $temp_array['airline_name'] = $row['airline_name']; |
| 4911 | 4911 | $temp_array['image_thumbnail'] = ""; |
| 4912 | - if($row['registration'] != "") |
|
| 4912 | + if ($row['registration'] != "") |
|
| 4913 | 4913 | { |
| 4914 | 4914 | $image_array = $Image->getSpotterImage($row['registration']); |
| 4915 | 4915 | $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
@@ -4931,7 +4931,7 @@ discard block |
||
| 4931 | 4931 | public function countAllAircraftManufacturerByDate($date) |
| 4932 | 4932 | { |
| 4933 | 4933 | global $globalTimezone, $globalDBdriver; |
| 4934 | - $date = filter_var($date,FILTER_SANITIZE_STRING); |
|
| 4934 | + $date = filter_var($date, FILTER_SANITIZE_STRING); |
|
| 4935 | 4935 | if ($globalTimezone != '') { |
| 4936 | 4936 | date_default_timezone_set($globalTimezone); |
| 4937 | 4937 | $datetime = new DateTime($date); |
@@ -4939,13 +4939,13 @@ discard block |
||
| 4939 | 4939 | } else $offset = '+00:00'; |
| 4940 | 4940 | |
| 4941 | 4941 | if ($globalDBdriver == 'mysql') { |
| 4942 | - $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
|
| 4942 | + $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
|
| 4943 | 4943 | FROM spotter_output |
| 4944 | 4944 | WHERE spotter_output.aircraft_manufacturer <> '' AND DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) = :date |
| 4945 | 4945 | GROUP BY spotter_output.aircraft_manufacturer |
| 4946 | 4946 | ORDER BY aircraft_manufacturer_count DESC"; |
| 4947 | 4947 | } else { |
| 4948 | - $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
|
| 4948 | + $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
|
| 4949 | 4949 | FROM spotter_output |
| 4950 | 4950 | WHERE spotter_output.aircraft_manufacturer <> '' AND to_char(spotter_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') = :date |
| 4951 | 4951 | GROUP BY spotter_output.aircraft_manufacturer |
@@ -4958,7 +4958,7 @@ discard block |
||
| 4958 | 4958 | $aircraft_array = array(); |
| 4959 | 4959 | $temp_array = array(); |
| 4960 | 4960 | |
| 4961 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4961 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4962 | 4962 | { |
| 4963 | 4963 | $temp_array['aircraft_manufacturer'] = $row['aircraft_manufacturer']; |
| 4964 | 4964 | $temp_array['aircraft_manufacturer_count'] = $row['aircraft_manufacturer_count']; |
@@ -4977,9 +4977,9 @@ discard block |
||
| 4977 | 4977 | */ |
| 4978 | 4978 | public function countAllAircraftTypesByIdent($ident) |
| 4979 | 4979 | { |
| 4980 | - $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
|
| 4980 | + $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
|
| 4981 | 4981 | |
| 4982 | - $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name |
|
| 4982 | + $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name |
|
| 4983 | 4983 | FROM spotter_output |
| 4984 | 4984 | WHERE spotter_output.ident = :ident |
| 4985 | 4985 | GROUP BY spotter_output.aircraft_name, spotter_output.aircraft_icao |
@@ -4991,7 +4991,7 @@ discard block |
||
| 4991 | 4991 | $aircraft_array = array(); |
| 4992 | 4992 | $temp_array = array(); |
| 4993 | 4993 | |
| 4994 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4994 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 4995 | 4995 | { |
| 4996 | 4996 | $temp_array['aircraft_icao'] = $row['aircraft_icao']; |
| 4997 | 4997 | $temp_array['aircraft_name'] = $row['aircraft_name']; |
@@ -5012,9 +5012,9 @@ discard block |
||
| 5012 | 5012 | public function countAllAircraftRegistrationByIdent($ident) |
| 5013 | 5013 | { |
| 5014 | 5014 | $Image = new Image($this->db); |
| 5015 | - $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
|
| 5015 | + $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
|
| 5016 | 5016 | |
| 5017 | - $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.registration) AS registration_count, spotter_output.aircraft_name, spotter_output.registration, spotter_output.airline_name |
|
| 5017 | + $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.registration) AS registration_count, spotter_output.aircraft_name, spotter_output.registration, spotter_output.airline_name |
|
| 5018 | 5018 | FROM spotter_output |
| 5019 | 5019 | WHERE spotter_output.registration <> '' AND spotter_output.ident = :ident |
| 5020 | 5020 | GROUP BY spotter_output.registration,spotter_output.aircraft_icao, spotter_output.aircraft_name, spotter_output.airline_name |
@@ -5027,14 +5027,14 @@ discard block |
||
| 5027 | 5027 | $aircraft_array = array(); |
| 5028 | 5028 | $temp_array = array(); |
| 5029 | 5029 | |
| 5030 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5030 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5031 | 5031 | { |
| 5032 | 5032 | $temp_array['aircraft_icao'] = $row['aircraft_icao']; |
| 5033 | 5033 | $temp_array['aircraft_name'] = $row['aircraft_name']; |
| 5034 | 5034 | $temp_array['registration'] = $row['registration']; |
| 5035 | 5035 | $temp_array['airline_name'] = $row['airline_name']; |
| 5036 | 5036 | $temp_array['image_thumbnail'] = ""; |
| 5037 | - if($row['registration'] != "") |
|
| 5037 | + if ($row['registration'] != "") |
|
| 5038 | 5038 | { |
| 5039 | 5039 | $image_array = $Image->getSpotterImage($row['registration']); |
| 5040 | 5040 | if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
@@ -5055,9 +5055,9 @@ discard block |
||
| 5055 | 5055 | */ |
| 5056 | 5056 | public function countAllAircraftManufacturerByIdent($ident) |
| 5057 | 5057 | { |
| 5058 | - $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
|
| 5058 | + $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
|
| 5059 | 5059 | |
| 5060 | - $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
|
| 5060 | + $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
|
| 5061 | 5061 | FROM spotter_output |
| 5062 | 5062 | WHERE spotter_output.aircraft_manufacturer <> '' AND spotter_output.ident = :ident |
| 5063 | 5063 | GROUP BY spotter_output.aircraft_manufacturer |
@@ -5068,7 +5068,7 @@ discard block |
||
| 5068 | 5068 | $sth->execute(array(':ident' => $ident)); |
| 5069 | 5069 | $aircraft_array = array(); |
| 5070 | 5070 | $temp_array = array(); |
| 5071 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5071 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5072 | 5072 | { |
| 5073 | 5073 | $temp_array['aircraft_manufacturer'] = $row['aircraft_manufacturer']; |
| 5074 | 5074 | $temp_array['aircraft_manufacturer_count'] = $row['aircraft_manufacturer_count']; |
@@ -5086,11 +5086,11 @@ discard block |
||
| 5086 | 5086 | */ |
| 5087 | 5087 | public function countAllAircraftTypesByRoute($departure_airport_icao, $arrival_airport_icao) |
| 5088 | 5088 | { |
| 5089 | - $departure_airport_icao = filter_var($departure_airport_icao,FILTER_SANITIZE_STRING); |
|
| 5090 | - $arrival_airport_icao = filter_var($arrival_airport_icao,FILTER_SANITIZE_STRING); |
|
| 5089 | + $departure_airport_icao = filter_var($departure_airport_icao, FILTER_SANITIZE_STRING); |
|
| 5090 | + $arrival_airport_icao = filter_var($arrival_airport_icao, FILTER_SANITIZE_STRING); |
|
| 5091 | 5091 | |
| 5092 | 5092 | |
| 5093 | - $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name |
|
| 5093 | + $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name |
|
| 5094 | 5094 | FROM spotter_output |
| 5095 | 5095 | WHERE (spotter_output.departure_airport_icao = :departure_airport_icao) AND (spotter_output.arrival_airport_icao = :arrival_airport_icao) |
| 5096 | 5096 | GROUP BY spotter_output.aircraft_name |
@@ -5098,10 +5098,10 @@ discard block |
||
| 5098 | 5098 | |
| 5099 | 5099 | |
| 5100 | 5100 | $sth = $this->db->prepare($query); |
| 5101 | - $sth->execute(array(':departure_airport_icao' => $departure_airport_icao,':arrival_airport_icao' => $arrival_airport_icao)); |
|
| 5101 | + $sth->execute(array(':departure_airport_icao' => $departure_airport_icao, ':arrival_airport_icao' => $arrival_airport_icao)); |
|
| 5102 | 5102 | $aircraft_array = array(); |
| 5103 | 5103 | $temp_array = array(); |
| 5104 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5104 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5105 | 5105 | { |
| 5106 | 5106 | $temp_array['aircraft_icao'] = $row['aircraft_icao']; |
| 5107 | 5107 | $temp_array['aircraft_name'] = $row['aircraft_name']; |
@@ -5120,10 +5120,10 @@ discard block |
||
| 5120 | 5120 | public function countAllAircraftRegistrationByRoute($departure_airport_icao, $arrival_airport_icao) |
| 5121 | 5121 | { |
| 5122 | 5122 | $Image = new Image($this->db); |
| 5123 | - $departure_airport_icao = filter_var($departure_airport_icao,FILTER_SANITIZE_STRING); |
|
| 5124 | - $arrival_airport_icao = filter_var($arrival_airport_icao,FILTER_SANITIZE_STRING); |
|
| 5123 | + $departure_airport_icao = filter_var($departure_airport_icao, FILTER_SANITIZE_STRING); |
|
| 5124 | + $arrival_airport_icao = filter_var($arrival_airport_icao, FILTER_SANITIZE_STRING); |
|
| 5125 | 5125 | |
| 5126 | - $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.registration) AS registration_count, spotter_output.aircraft_name, spotter_output.registration, spotter_output.airline_name |
|
| 5126 | + $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.registration) AS registration_count, spotter_output.aircraft_name, spotter_output.registration, spotter_output.airline_name |
|
| 5127 | 5127 | FROM spotter_output |
| 5128 | 5128 | WHERE spotter_output.registration <> '' AND (spotter_output.departure_airport_icao = :departure_airport_icao) AND (spotter_output.arrival_airport_icao = :arrival_airport_icao) |
| 5129 | 5129 | GROUP BY spotter_output.registration |
@@ -5131,19 +5131,19 @@ discard block |
||
| 5131 | 5131 | |
| 5132 | 5132 | |
| 5133 | 5133 | $sth = $this->db->prepare($query); |
| 5134 | - $sth->execute(array(':departure_airport_icao' => $departure_airport_icao,':arrival_airport_icao' => $arrival_airport_icao)); |
|
| 5134 | + $sth->execute(array(':departure_airport_icao' => $departure_airport_icao, ':arrival_airport_icao' => $arrival_airport_icao)); |
|
| 5135 | 5135 | |
| 5136 | 5136 | $aircraft_array = array(); |
| 5137 | 5137 | $temp_array = array(); |
| 5138 | 5138 | |
| 5139 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5139 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5140 | 5140 | { |
| 5141 | 5141 | $temp_array['aircraft_icao'] = $row['aircraft_icao']; |
| 5142 | 5142 | $temp_array['aircraft_name'] = $row['aircraft_name']; |
| 5143 | 5143 | $temp_array['registration'] = $row['registration']; |
| 5144 | 5144 | $temp_array['airline_name'] = $row['airline_name']; |
| 5145 | 5145 | $temp_array['image_thumbnail'] = ""; |
| 5146 | - if($row['registration'] != "") |
|
| 5146 | + if ($row['registration'] != "") |
|
| 5147 | 5147 | { |
| 5148 | 5148 | $image_array = $Image->getSpotterImage($row['registration']); |
| 5149 | 5149 | if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
@@ -5165,10 +5165,10 @@ discard block |
||
| 5165 | 5165 | */ |
| 5166 | 5166 | public function countAllAircraftManufacturerByRoute($departure_airport_icao, $arrival_airport_icao) |
| 5167 | 5167 | { |
| 5168 | - $departure_airport_icao = filter_var($departure_airport_icao,FILTER_SANITIZE_STRING); |
|
| 5169 | - $arrival_airport_icao = filter_var($arrival_airport_icao,FILTER_SANITIZE_STRING); |
|
| 5168 | + $departure_airport_icao = filter_var($departure_airport_icao, FILTER_SANITIZE_STRING); |
|
| 5169 | + $arrival_airport_icao = filter_var($arrival_airport_icao, FILTER_SANITIZE_STRING); |
|
| 5170 | 5170 | |
| 5171 | - $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
|
| 5171 | + $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
|
| 5172 | 5172 | FROM spotter_output |
| 5173 | 5173 | WHERE spotter_output.aircraft_manufacturer <> '' AND (spotter_output.departure_airport_icao = :departure_airport_icao) AND (spotter_output.arrival_airport_icao = :arrival_airport_icao) |
| 5174 | 5174 | GROUP BY spotter_output.aircraft_manufacturer |
@@ -5176,12 +5176,12 @@ discard block |
||
| 5176 | 5176 | |
| 5177 | 5177 | |
| 5178 | 5178 | $sth = $this->db->prepare($query); |
| 5179 | - $sth->execute(array(':departure_airport_icao' => $departure_airport_icao,':arrival_airport_icao' => $arrival_airport_icao)); |
|
| 5179 | + $sth->execute(array(':departure_airport_icao' => $departure_airport_icao, ':arrival_airport_icao' => $arrival_airport_icao)); |
|
| 5180 | 5180 | |
| 5181 | 5181 | $aircraft_array = array(); |
| 5182 | 5182 | $temp_array = array(); |
| 5183 | 5183 | |
| 5184 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5184 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5185 | 5185 | { |
| 5186 | 5186 | $temp_array['aircraft_manufacturer'] = $row['aircraft_manufacturer']; |
| 5187 | 5187 | $temp_array['aircraft_manufacturer_count'] = $row['aircraft_manufacturer_count']; |
@@ -5203,9 +5203,9 @@ discard block |
||
| 5203 | 5203 | */ |
| 5204 | 5204 | public function countAllAircraftTypesByCountry($country) |
| 5205 | 5205 | { |
| 5206 | - $country = filter_var($country,FILTER_SANITIZE_STRING); |
|
| 5206 | + $country = filter_var($country, FILTER_SANITIZE_STRING); |
|
| 5207 | 5207 | |
| 5208 | - $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name |
|
| 5208 | + $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.aircraft_icao) AS aircraft_icao_count, spotter_output.aircraft_name |
|
| 5209 | 5209 | FROM spotter_output |
| 5210 | 5210 | WHERE ((spotter_output.departure_airport_country = :country) OR (spotter_output.arrival_airport_country = :country)) OR spotter_output.airline_country = :country |
| 5211 | 5211 | GROUP BY spotter_output.aircraft_name |
@@ -5218,7 +5218,7 @@ discard block |
||
| 5218 | 5218 | $aircraft_array = array(); |
| 5219 | 5219 | $temp_array = array(); |
| 5220 | 5220 | |
| 5221 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5221 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5222 | 5222 | { |
| 5223 | 5223 | $temp_array['aircraft_icao'] = $row['aircraft_icao']; |
| 5224 | 5224 | $temp_array['aircraft_name'] = $row['aircraft_name']; |
@@ -5240,9 +5240,9 @@ discard block |
||
| 5240 | 5240 | public function countAllAircraftRegistrationByCountry($country) |
| 5241 | 5241 | { |
| 5242 | 5242 | $Image = new Image($this->db); |
| 5243 | - $country = filter_var($country,FILTER_SANITIZE_STRING); |
|
| 5243 | + $country = filter_var($country, FILTER_SANITIZE_STRING); |
|
| 5244 | 5244 | |
| 5245 | - $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.registration) AS registration_count, spotter_output.aircraft_name, spotter_output.registration, spotter_output.airline_name |
|
| 5245 | + $query = "SELECT DISTINCT spotter_output.aircraft_icao, COUNT(spotter_output.registration) AS registration_count, spotter_output.aircraft_name, spotter_output.registration, spotter_output.airline_name |
|
| 5246 | 5246 | FROM spotter_output |
| 5247 | 5247 | WHERE spotter_output.registration <> '' AND (((spotter_output.departure_airport_country = :country) OR (spotter_output.arrival_airport_country = :country)) OR spotter_output.airline_country = :country) |
| 5248 | 5248 | GROUP BY spotter_output.registration |
@@ -5255,14 +5255,14 @@ discard block |
||
| 5255 | 5255 | $aircraft_array = array(); |
| 5256 | 5256 | $temp_array = array(); |
| 5257 | 5257 | |
| 5258 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5258 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5259 | 5259 | { |
| 5260 | 5260 | $temp_array['aircraft_icao'] = $row['aircraft_icao']; |
| 5261 | 5261 | $temp_array['aircraft_name'] = $row['aircraft_name']; |
| 5262 | 5262 | $temp_array['registration'] = $row['registration']; |
| 5263 | 5263 | $temp_array['airline_name'] = $row['airline_name']; |
| 5264 | 5264 | $temp_array['image_thumbnail'] = ""; |
| 5265 | - if($row['registration'] != "") |
|
| 5265 | + if ($row['registration'] != "") |
|
| 5266 | 5266 | { |
| 5267 | 5267 | $image_array = $Image->getSpotterImage($row['registration']); |
| 5268 | 5268 | if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
@@ -5284,9 +5284,9 @@ discard block |
||
| 5284 | 5284 | */ |
| 5285 | 5285 | public function countAllAircraftManufacturerByCountry($country) |
| 5286 | 5286 | { |
| 5287 | - $country = filter_var($country,FILTER_SANITIZE_STRING); |
|
| 5287 | + $country = filter_var($country, FILTER_SANITIZE_STRING); |
|
| 5288 | 5288 | |
| 5289 | - $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
|
| 5289 | + $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
|
| 5290 | 5290 | FROM spotter_output |
| 5291 | 5291 | WHERE spotter_output.aircraft_manufacturer <> '' AND (((spotter_output.departure_airport_country = :country) OR (spotter_output.arrival_airport_country = :country)) OR spotter_output.airline_country = :country) |
| 5292 | 5292 | GROUP BY spotter_output.aircraft_manufacturer |
@@ -5299,7 +5299,7 @@ discard block |
||
| 5299 | 5299 | $aircraft_array = array(); |
| 5300 | 5300 | $temp_array = array(); |
| 5301 | 5301 | |
| 5302 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5302 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5303 | 5303 | { |
| 5304 | 5304 | $temp_array['aircraft_manufacturer'] = $row['aircraft_manufacturer']; |
| 5305 | 5305 | $temp_array['aircraft_manufacturer_count'] = $row['aircraft_manufacturer_count']; |
@@ -5320,8 +5320,8 @@ discard block |
||
| 5320 | 5320 | */ |
| 5321 | 5321 | public function countAllAircraftManufacturers($filter = array()) |
| 5322 | 5322 | { |
| 5323 | - $filter_query = $this->getFilter($filter,true,true); |
|
| 5324 | - $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
|
| 5323 | + $filter_query = $this->getFilter($filter, true, true); |
|
| 5324 | + $query = "SELECT DISTINCT spotter_output.aircraft_manufacturer, COUNT(spotter_output.aircraft_manufacturer) AS aircraft_manufacturer_count |
|
| 5325 | 5325 | FROM spotter_output ".$filter_query." spotter_output.aircraft_manufacturer <> '' AND spotter_output.aircraft_manufacturer <> 'Not Available'"; |
| 5326 | 5326 | $query .= " GROUP BY spotter_output.aircraft_manufacturer |
| 5327 | 5327 | ORDER BY aircraft_manufacturer_count DESC |
@@ -5334,7 +5334,7 @@ discard block |
||
| 5334 | 5334 | $manufacturer_array = array(); |
| 5335 | 5335 | $temp_array = array(); |
| 5336 | 5336 | |
| 5337 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5337 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5338 | 5338 | { |
| 5339 | 5339 | $temp_array['aircraft_manufacturer'] = $row['aircraft_manufacturer']; |
| 5340 | 5340 | $temp_array['aircraft_manufacturer_count'] = $row['aircraft_manufacturer_count']; |
@@ -5353,12 +5353,12 @@ discard block |
||
| 5353 | 5353 | * @return Array the aircraft list |
| 5354 | 5354 | * |
| 5355 | 5355 | */ |
| 5356 | - public function countAllAircraftRegistrations($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array()) |
|
| 5356 | + public function countAllAircraftRegistrations($limit = true, $olderthanmonths = 0, $sincedate = '', $filters = array()) |
|
| 5357 | 5357 | { |
| 5358 | 5358 | global $globalDBdriver; |
| 5359 | 5359 | $Image = new Image($this->db); |
| 5360 | - $filter_query = $this->getFilter($filters,true,true); |
|
| 5361 | - $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 |
|
| 5360 | + $filter_query = $this->getFilter($filters, true, true); |
|
| 5361 | + $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 |
|
| 5362 | 5362 | FROM spotter_output ".$filter_query." spotter_output.registration <> '' AND spotter_output.registration <> 'NA'"; |
| 5363 | 5363 | if ($olderthanmonths > 0) { |
| 5364 | 5364 | if ($globalDBdriver == 'mysql') { |
@@ -5386,7 +5386,7 @@ discard block |
||
| 5386 | 5386 | $aircraft_array = array(); |
| 5387 | 5387 | $temp_array = array(); |
| 5388 | 5388 | |
| 5389 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5389 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5390 | 5390 | { |
| 5391 | 5391 | $temp_array['registration'] = $row['registration']; |
| 5392 | 5392 | $temp_array['aircraft_registration_count'] = $row['aircraft_registration_count']; |
@@ -5394,7 +5394,7 @@ discard block |
||
| 5394 | 5394 | $temp_array['aircraft_name'] = $row['aircraft_name']; |
| 5395 | 5395 | $temp_array['airline_name'] = $row['airline_name']; |
| 5396 | 5396 | $temp_array['image_thumbnail'] = ""; |
| 5397 | - if($row['registration'] != "") |
|
| 5397 | + if ($row['registration'] != "") |
|
| 5398 | 5398 | { |
| 5399 | 5399 | $image_array = $Image->getSpotterImage($row['registration']); |
| 5400 | 5400 | if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
@@ -5413,11 +5413,11 @@ discard block |
||
| 5413 | 5413 | * @return Array the aircraft list |
| 5414 | 5414 | * |
| 5415 | 5415 | */ |
| 5416 | - public function countAllAircraftRegistrationsByAirlines($limit = true,$olderthanmonths = 0,$sincedate = '') |
|
| 5416 | + public function countAllAircraftRegistrationsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '') |
|
| 5417 | 5417 | { |
| 5418 | 5418 | global $globalDBdriver; |
| 5419 | 5419 | $Image = new Image($this->db); |
| 5420 | - $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 |
|
| 5420 | + $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 |
|
| 5421 | 5421 | FROM spotter_output |
| 5422 | 5422 | WHERE spotter_output.airline_icao <> '' AND spotter_output.registration <> '' AND spotter_output.registration <> 'NA' "; |
| 5423 | 5423 | if ($olderthanmonths > 0) { |
@@ -5446,7 +5446,7 @@ discard block |
||
| 5446 | 5446 | $aircraft_array = array(); |
| 5447 | 5447 | $temp_array = array(); |
| 5448 | 5448 | |
| 5449 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5449 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5450 | 5450 | { |
| 5451 | 5451 | $temp_array['registration'] = $row['registration']; |
| 5452 | 5452 | $temp_array['aircraft_registration_count'] = $row['aircraft_registration_count']; |
@@ -5455,7 +5455,7 @@ discard block |
||
| 5455 | 5455 | $temp_array['aircraft_name'] = $row['aircraft_name']; |
| 5456 | 5456 | $temp_array['airline_name'] = $row['airline_name']; |
| 5457 | 5457 | $temp_array['image_thumbnail'] = ""; |
| 5458 | - if($row['registration'] != "") |
|
| 5458 | + if ($row['registration'] != "") |
|
| 5459 | 5459 | { |
| 5460 | 5460 | $image_array = $Image->getSpotterImage($row['registration']); |
| 5461 | 5461 | if (isset($image_array[0]['image_thumbnail'])) $temp_array['image_thumbnail'] = $image_array[0]['image_thumbnail']; |
@@ -5474,11 +5474,11 @@ discard block |
||
| 5474 | 5474 | * @return Array the airport list |
| 5475 | 5475 | * |
| 5476 | 5476 | */ |
| 5477 | - public function countAllDepartureAirports($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array()) |
|
| 5477 | + public function countAllDepartureAirports($limit = true, $olderthanmonths = 0, $sincedate = '', $filters = array()) |
|
| 5478 | 5478 | { |
| 5479 | 5479 | global $globalDBdriver; |
| 5480 | - $filter_query = $this->getFilter($filters,true,true); |
|
| 5481 | - $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 |
|
| 5480 | + $filter_query = $this->getFilter($filters, true, true); |
|
| 5481 | + $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 |
|
| 5482 | 5482 | FROM spotter_output".$filter_query." spotter_output.departure_airport_name <> '' AND spotter_output.departure_airport_icao <> 'NA'"; |
| 5483 | 5483 | if ($olderthanmonths > 0) { |
| 5484 | 5484 | if ($globalDBdriver == 'mysql') { |
@@ -5507,7 +5507,7 @@ discard block |
||
| 5507 | 5507 | $airport_array = array(); |
| 5508 | 5508 | $temp_array = array(); |
| 5509 | 5509 | |
| 5510 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5510 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5511 | 5511 | { |
| 5512 | 5512 | $temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
| 5513 | 5513 | $temp_array['airport_departure_icao_count'] = $row['airport_departure_icao_count']; |
@@ -5529,7 +5529,7 @@ discard block |
||
| 5529 | 5529 | public function countAllDepartureAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '') |
| 5530 | 5530 | { |
| 5531 | 5531 | global $globalDBdriver; |
| 5532 | - $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 |
|
| 5532 | + $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 |
|
| 5533 | 5533 | FROM spotter_output |
| 5534 | 5534 | WHERE spotter_output.airline_icao <> '' AND spotter_output.departure_airport_name <> '' AND spotter_output.departure_airport_icao <> 'NA' "; |
| 5535 | 5535 | if ($olderthanmonths > 0) { |
@@ -5559,7 +5559,7 @@ discard block |
||
| 5559 | 5559 | $airport_array = array(); |
| 5560 | 5560 | $temp_array = array(); |
| 5561 | 5561 | |
| 5562 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5562 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5563 | 5563 | { |
| 5564 | 5564 | $temp_array['airline_icao'] = $row['airline_icao']; |
| 5565 | 5565 | $temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
@@ -5579,11 +5579,11 @@ discard block |
||
| 5579 | 5579 | * @return Array the airport list |
| 5580 | 5580 | * |
| 5581 | 5581 | */ |
| 5582 | - public function countAllDetectedDepartureAirports($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array()) |
|
| 5582 | + public function countAllDetectedDepartureAirports($limit = true, $olderthanmonths = 0, $sincedate = '', $filters = array()) |
|
| 5583 | 5583 | { |
| 5584 | 5584 | global $globalDBdriver; |
| 5585 | - $filter_query = $this->getFilter($filters,true,true); |
|
| 5586 | - $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 |
|
| 5585 | + $filter_query = $this->getFilter($filters, true, true); |
|
| 5586 | + $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 |
|
| 5587 | 5587 | FROM spotter_output, airport".$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"; |
| 5588 | 5588 | if ($olderthanmonths > 0) { |
| 5589 | 5589 | if ($globalDBdriver == 'mysql') { |
@@ -5611,7 +5611,7 @@ discard block |
||
| 5611 | 5611 | $airport_array = array(); |
| 5612 | 5612 | $temp_array = array(); |
| 5613 | 5613 | |
| 5614 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5614 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5615 | 5615 | { |
| 5616 | 5616 | $temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
| 5617 | 5617 | $temp_array['airport_departure_icao_count'] = $row['airport_departure_icao_count']; |
@@ -5633,7 +5633,7 @@ discard block |
||
| 5633 | 5633 | public function countAllDetectedDepartureAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '') |
| 5634 | 5634 | { |
| 5635 | 5635 | global $globalDBdriver; |
| 5636 | - $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 |
|
| 5636 | + $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 |
|
| 5637 | 5637 | FROM spotter_output, airport |
| 5638 | 5638 | WHERE 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 "; |
| 5639 | 5639 | if ($olderthanmonths > 0) { |
@@ -5663,7 +5663,7 @@ discard block |
||
| 5663 | 5663 | $airport_array = array(); |
| 5664 | 5664 | $temp_array = array(); |
| 5665 | 5665 | |
| 5666 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5666 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5667 | 5667 | { |
| 5668 | 5668 | $temp_array['airline_icao'] = $row['airline_icao']; |
| 5669 | 5669 | $temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
@@ -5685,9 +5685,9 @@ discard block |
||
| 5685 | 5685 | */ |
| 5686 | 5686 | public function countAllDepartureAirportsByAirline($airline_icao) |
| 5687 | 5687 | { |
| 5688 | - $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING); |
|
| 5688 | + $airline_icao = filter_var($airline_icao, FILTER_SANITIZE_STRING); |
|
| 5689 | 5689 | |
| 5690 | - $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 |
|
| 5690 | + $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 |
|
| 5691 | 5691 | FROM spotter_output |
| 5692 | 5692 | WHERE spotter_output.departure_airport_name <> '' AND spotter_output.departure_airport_icao <> 'NA' AND spotter_output.airline_icao = :airline_icao |
| 5693 | 5693 | GROUP BY spotter_output.departure_airport_icao |
@@ -5700,7 +5700,7 @@ discard block |
||
| 5700 | 5700 | $airport_array = array(); |
| 5701 | 5701 | $temp_array = array(); |
| 5702 | 5702 | |
| 5703 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5703 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5704 | 5704 | { |
| 5705 | 5705 | $temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
| 5706 | 5706 | $temp_array['airport_departure_icao_count'] = $row['airport_departure_icao_count']; |
@@ -5724,9 +5724,9 @@ discard block |
||
| 5724 | 5724 | */ |
| 5725 | 5725 | public function countAllDepartureAirportCountriesByAirline($airline_icao) |
| 5726 | 5726 | { |
| 5727 | - $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING); |
|
| 5727 | + $airline_icao = filter_var($airline_icao, FILTER_SANITIZE_STRING); |
|
| 5728 | 5728 | |
| 5729 | - $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
| 5729 | + $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
| 5730 | 5730 | FROM spotter_output |
| 5731 | 5731 | WHERE spotter_output.departure_airport_country <> '' AND spotter_output.airline_icao = :airline_icao |
| 5732 | 5732 | GROUP BY spotter_output.departure_airport_country |
@@ -5739,7 +5739,7 @@ discard block |
||
| 5739 | 5739 | $airport_array = array(); |
| 5740 | 5740 | $temp_array = array(); |
| 5741 | 5741 | |
| 5742 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5742 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5743 | 5743 | { |
| 5744 | 5744 | $temp_array['departure_airport_country'] = $row['departure_airport_country']; |
| 5745 | 5745 | $temp_array['airport_departure_country_count'] = $row['airport_departure_country_count']; |
@@ -5760,9 +5760,9 @@ discard block |
||
| 5760 | 5760 | */ |
| 5761 | 5761 | public function countAllDepartureAirportsByAircraft($aircraft_icao) |
| 5762 | 5762 | { |
| 5763 | - $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
|
| 5763 | + $aircraft_icao = filter_var($aircraft_icao, FILTER_SANITIZE_STRING); |
|
| 5764 | 5764 | |
| 5765 | - $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 |
|
| 5765 | + $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 |
|
| 5766 | 5766 | FROM spotter_output |
| 5767 | 5767 | WHERE spotter_output.departure_airport_name <> '' AND spotter_output.departure_airport_icao <> 'NA' AND spotter_output.aircraft_icao = :aircraft_icao |
| 5768 | 5768 | GROUP BY spotter_output.departure_airport_icao |
@@ -5775,7 +5775,7 @@ discard block |
||
| 5775 | 5775 | $airport_array = array(); |
| 5776 | 5776 | $temp_array = array(); |
| 5777 | 5777 | |
| 5778 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5778 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5779 | 5779 | { |
| 5780 | 5780 | $temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
| 5781 | 5781 | $temp_array['airport_departure_icao_count'] = $row['airport_departure_icao_count']; |
@@ -5798,9 +5798,9 @@ discard block |
||
| 5798 | 5798 | */ |
| 5799 | 5799 | public function countAllDepartureAirportCountriesByAircraft($aircraft_icao) |
| 5800 | 5800 | { |
| 5801 | - $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
|
| 5801 | + $aircraft_icao = filter_var($aircraft_icao, FILTER_SANITIZE_STRING); |
|
| 5802 | 5802 | |
| 5803 | - $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
| 5803 | + $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
| 5804 | 5804 | FROM spotter_output |
| 5805 | 5805 | WHERE spotter_output.departure_airport_country <> '' AND spotter_output.aircraft_icao = :aircraft_icao |
| 5806 | 5806 | GROUP BY spotter_output.departure_airport_country |
@@ -5813,7 +5813,7 @@ discard block |
||
| 5813 | 5813 | $airport_array = array(); |
| 5814 | 5814 | $temp_array = array(); |
| 5815 | 5815 | |
| 5816 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5816 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5817 | 5817 | { |
| 5818 | 5818 | $temp_array['departure_airport_country'] = $row['departure_airport_country']; |
| 5819 | 5819 | $temp_array['airport_departure_country_count'] = $row['airport_departure_country_count']; |
@@ -5833,9 +5833,9 @@ discard block |
||
| 5833 | 5833 | */ |
| 5834 | 5834 | public function countAllDepartureAirportsByRegistration($registration) |
| 5835 | 5835 | { |
| 5836 | - $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
|
| 5836 | + $registration = filter_var($registration, FILTER_SANITIZE_STRING); |
|
| 5837 | 5837 | |
| 5838 | - $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 |
|
| 5838 | + $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 |
|
| 5839 | 5839 | FROM spotter_output |
| 5840 | 5840 | WHERE spotter_output.departure_airport_name <> '' AND spotter_output.departure_airport_icao <> 'NA' AND spotter_output.registration = :registration |
| 5841 | 5841 | GROUP BY spotter_output.departure_airport_icao |
@@ -5848,7 +5848,7 @@ discard block |
||
| 5848 | 5848 | $airport_array = array(); |
| 5849 | 5849 | $temp_array = array(); |
| 5850 | 5850 | |
| 5851 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5851 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5852 | 5852 | { |
| 5853 | 5853 | $temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
| 5854 | 5854 | $temp_array['airport_departure_icao_count'] = $row['airport_departure_icao_count']; |
@@ -5871,9 +5871,9 @@ discard block |
||
| 5871 | 5871 | */ |
| 5872 | 5872 | public function countAllDepartureAirportCountriesByRegistration($registration) |
| 5873 | 5873 | { |
| 5874 | - $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
|
| 5874 | + $registration = filter_var($registration, FILTER_SANITIZE_STRING); |
|
| 5875 | 5875 | |
| 5876 | - $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
| 5876 | + $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
| 5877 | 5877 | FROM spotter_output |
| 5878 | 5878 | WHERE spotter_output.departure_airport_country <> '' AND spotter_output.registration = :registration |
| 5879 | 5879 | GROUP BY spotter_output.departure_airport_country |
@@ -5886,7 +5886,7 @@ discard block |
||
| 5886 | 5886 | $airport_array = array(); |
| 5887 | 5887 | $temp_array = array(); |
| 5888 | 5888 | |
| 5889 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5889 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5890 | 5890 | { |
| 5891 | 5891 | $temp_array['departure_airport_country'] = $row['departure_airport_country']; |
| 5892 | 5892 | $temp_array['airport_departure_country_count'] = $row['airport_departure_country_count']; |
@@ -5906,9 +5906,9 @@ discard block |
||
| 5906 | 5906 | */ |
| 5907 | 5907 | public function countAllDepartureAirportsByAirport($airport_icao) |
| 5908 | 5908 | { |
| 5909 | - $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
|
| 5909 | + $airport_icao = filter_var($airport_icao, FILTER_SANITIZE_STRING); |
|
| 5910 | 5910 | |
| 5911 | - $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 |
|
| 5911 | + $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 |
|
| 5912 | 5912 | FROM spotter_output |
| 5913 | 5913 | WHERE spotter_output.departure_airport_name <> '' AND spotter_output.departure_airport_icao <> 'NA' AND spotter_output.arrival_airport_icao = :airport_icao |
| 5914 | 5914 | GROUP BY spotter_output.departure_airport_icao |
@@ -5921,7 +5921,7 @@ discard block |
||
| 5921 | 5921 | $airport_array = array(); |
| 5922 | 5922 | $temp_array = array(); |
| 5923 | 5923 | |
| 5924 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5924 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5925 | 5925 | { |
| 5926 | 5926 | $temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
| 5927 | 5927 | $temp_array['airport_departure_icao_count'] = $row['airport_departure_icao_count']; |
@@ -5944,9 +5944,9 @@ discard block |
||
| 5944 | 5944 | */ |
| 5945 | 5945 | public function countAllDepartureAirportCountriesByAirport($airport_icao) |
| 5946 | 5946 | { |
| 5947 | - $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
|
| 5947 | + $airport_icao = filter_var($airport_icao, FILTER_SANITIZE_STRING); |
|
| 5948 | 5948 | |
| 5949 | - $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
| 5949 | + $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
| 5950 | 5950 | FROM spotter_output |
| 5951 | 5951 | WHERE spotter_output.departure_airport_country <> '' AND spotter_output.arrival_airport_icao = :airport_icao |
| 5952 | 5952 | GROUP BY spotter_output.departure_airport_country |
@@ -5959,7 +5959,7 @@ discard block |
||
| 5959 | 5959 | $airport_array = array(); |
| 5960 | 5960 | $temp_array = array(); |
| 5961 | 5961 | |
| 5962 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5962 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5963 | 5963 | { |
| 5964 | 5964 | $temp_array['departure_airport_country'] = $row['departure_airport_country']; |
| 5965 | 5965 | $temp_array['airport_departure_country_count'] = $row['airport_departure_country_count']; |
@@ -5980,9 +5980,9 @@ discard block |
||
| 5980 | 5980 | */ |
| 5981 | 5981 | public function countAllDepartureAirportsByManufacturer($aircraft_manufacturer) |
| 5982 | 5982 | { |
| 5983 | - $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
|
| 5983 | + $aircraft_manufacturer = filter_var($aircraft_manufacturer, FILTER_SANITIZE_STRING); |
|
| 5984 | 5984 | |
| 5985 | - $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 |
|
| 5985 | + $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 |
|
| 5986 | 5986 | FROM spotter_output |
| 5987 | 5987 | WHERE spotter_output.departure_airport_name <> '' AND spotter_output.departure_airport_icao <> 'NA' AND spotter_output.aircraft_manufacturer = :aircraft_manufacturer |
| 5988 | 5988 | GROUP BY spotter_output.departure_airport_icao |
@@ -5995,7 +5995,7 @@ discard block |
||
| 5995 | 5995 | $airport_array = array(); |
| 5996 | 5996 | $temp_array = array(); |
| 5997 | 5997 | |
| 5998 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5998 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 5999 | 5999 | { |
| 6000 | 6000 | $temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
| 6001 | 6001 | $temp_array['airport_departure_icao_count'] = $row['airport_departure_icao_count']; |
@@ -6018,9 +6018,9 @@ discard block |
||
| 6018 | 6018 | */ |
| 6019 | 6019 | public function countAllDepartureAirportCountriesByManufacturer($aircraft_manufacturer) |
| 6020 | 6020 | { |
| 6021 | - $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
|
| 6021 | + $aircraft_manufacturer = filter_var($aircraft_manufacturer, FILTER_SANITIZE_STRING); |
|
| 6022 | 6022 | |
| 6023 | - $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
| 6023 | + $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
| 6024 | 6024 | FROM spotter_output |
| 6025 | 6025 | WHERE spotter_output.departure_airport_country <> '' AND spotter_output.aircraft_manufacturer = :aircraft_manufacturer |
| 6026 | 6026 | GROUP BY spotter_output.departure_airport_country |
@@ -6033,7 +6033,7 @@ discard block |
||
| 6033 | 6033 | $airport_array = array(); |
| 6034 | 6034 | $temp_array = array(); |
| 6035 | 6035 | |
| 6036 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6036 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6037 | 6037 | { |
| 6038 | 6038 | $temp_array['departure_airport_country'] = $row['departure_airport_country']; |
| 6039 | 6039 | $temp_array['airport_departure_country_count'] = $row['airport_departure_country_count']; |
@@ -6054,7 +6054,7 @@ discard block |
||
| 6054 | 6054 | public function countAllDepartureAirportsByDate($date) |
| 6055 | 6055 | { |
| 6056 | 6056 | global $globalTimezone, $globalDBdriver; |
| 6057 | - $date = filter_var($date,FILTER_SANITIZE_STRING); |
|
| 6057 | + $date = filter_var($date, FILTER_SANITIZE_STRING); |
|
| 6058 | 6058 | |
| 6059 | 6059 | if ($globalTimezone != '') { |
| 6060 | 6060 | date_default_timezone_set($globalTimezone); |
@@ -6063,13 +6063,13 @@ discard block |
||
| 6063 | 6063 | } else $offset = '+00:00'; |
| 6064 | 6064 | |
| 6065 | 6065 | if ($globalDBdriver == 'mysql') { |
| 6066 | - $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 |
|
| 6066 | + $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 |
|
| 6067 | 6067 | FROM spotter_output |
| 6068 | 6068 | WHERE spotter_output.departure_airport_name <> '' AND spotter_output.departure_airport_icao <> 'NA' AND DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) = :date |
| 6069 | 6069 | GROUP BY spotter_output.departure_airport_icao |
| 6070 | 6070 | ORDER BY airport_departure_icao_count DESC"; |
| 6071 | 6071 | } else { |
| 6072 | - $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 |
|
| 6072 | + $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 |
|
| 6073 | 6073 | FROM spotter_output |
| 6074 | 6074 | WHERE spotter_output.departure_airport_name <> '' AND spotter_output.departure_airport_icao <> 'NA' AND to_char(spotter_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') = :date |
| 6075 | 6075 | GROUP BY spotter_output.departure_airport_icao |
@@ -6082,7 +6082,7 @@ discard block |
||
| 6082 | 6082 | $airport_array = array(); |
| 6083 | 6083 | $temp_array = array(); |
| 6084 | 6084 | |
| 6085 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6085 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6086 | 6086 | { |
| 6087 | 6087 | $temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
| 6088 | 6088 | $temp_array['airport_departure_icao_count'] = $row['airport_departure_icao_count']; |
@@ -6106,7 +6106,7 @@ discard block |
||
| 6106 | 6106 | public function countAllDepartureAirportCountriesByDate($date) |
| 6107 | 6107 | { |
| 6108 | 6108 | global $globalTimezone, $globalDBdriver; |
| 6109 | - $date = filter_var($date,FILTER_SANITIZE_STRING); |
|
| 6109 | + $date = filter_var($date, FILTER_SANITIZE_STRING); |
|
| 6110 | 6110 | if ($globalTimezone != '') { |
| 6111 | 6111 | date_default_timezone_set($globalTimezone); |
| 6112 | 6112 | $datetime = new DateTime($date); |
@@ -6114,13 +6114,13 @@ discard block |
||
| 6114 | 6114 | } else $offset = '+00:00'; |
| 6115 | 6115 | |
| 6116 | 6116 | if ($globalDBdriver == 'mysql') { |
| 6117 | - $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
| 6117 | + $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
| 6118 | 6118 | FROM spotter_output |
| 6119 | 6119 | WHERE spotter_output.departure_airport_country <> '' AND DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) = :date |
| 6120 | 6120 | GROUP BY spotter_output.departure_airport_country |
| 6121 | 6121 | ORDER BY airport_departure_country_count DESC"; |
| 6122 | 6122 | } else { |
| 6123 | - $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
| 6123 | + $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
| 6124 | 6124 | FROM spotter_output |
| 6125 | 6125 | WHERE spotter_output.departure_airport_country <> '' AND to_char(spotter_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') = :date |
| 6126 | 6126 | GROUP BY spotter_output.departure_airport_country |
@@ -6133,7 +6133,7 @@ discard block |
||
| 6133 | 6133 | $airport_array = array(); |
| 6134 | 6134 | $temp_array = array(); |
| 6135 | 6135 | |
| 6136 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6136 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6137 | 6137 | { |
| 6138 | 6138 | $temp_array['departure_airport_country'] = $row['departure_airport_country']; |
| 6139 | 6139 | $temp_array['airport_departure_country_count'] = $row['airport_departure_country_count']; |
@@ -6153,9 +6153,9 @@ discard block |
||
| 6153 | 6153 | */ |
| 6154 | 6154 | public function countAllDepartureAirportsByIdent($ident) |
| 6155 | 6155 | { |
| 6156 | - $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
|
| 6156 | + $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
|
| 6157 | 6157 | |
| 6158 | - $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 |
|
| 6158 | + $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 |
|
| 6159 | 6159 | FROM spotter_output |
| 6160 | 6160 | WHERE spotter_output.departure_airport_name <> '' AND spotter_output.departure_airport_icao <> 'NA' AND spotter_output.ident = :ident |
| 6161 | 6161 | GROUP BY spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country |
@@ -6168,7 +6168,7 @@ discard block |
||
| 6168 | 6168 | $airport_array = array(); |
| 6169 | 6169 | $temp_array = array(); |
| 6170 | 6170 | |
| 6171 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6171 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6172 | 6172 | { |
| 6173 | 6173 | $temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
| 6174 | 6174 | $temp_array['airport_departure_icao_count'] = $row['airport_departure_icao_count']; |
@@ -6192,9 +6192,9 @@ discard block |
||
| 6192 | 6192 | */ |
| 6193 | 6193 | public function countAllDepartureAirportCountriesByIdent($ident) |
| 6194 | 6194 | { |
| 6195 | - $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
|
| 6195 | + $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
|
| 6196 | 6196 | |
| 6197 | - $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
| 6197 | + $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
| 6198 | 6198 | FROM spotter_output |
| 6199 | 6199 | WHERE spotter_output.departure_airport_country <> '' AND spotter_output.ident = :ident |
| 6200 | 6200 | GROUP BY spotter_output.departure_airport_country |
@@ -6207,7 +6207,7 @@ discard block |
||
| 6207 | 6207 | $airport_array = array(); |
| 6208 | 6208 | $temp_array = array(); |
| 6209 | 6209 | |
| 6210 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6210 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6211 | 6211 | { |
| 6212 | 6212 | $temp_array['departure_airport_country'] = $row['departure_airport_country']; |
| 6213 | 6213 | $temp_array['airport_departure_country_count'] = $row['airport_departure_country_count']; |
@@ -6228,9 +6228,9 @@ discard block |
||
| 6228 | 6228 | */ |
| 6229 | 6229 | public function countAllDepartureAirportsByCountry($country) |
| 6230 | 6230 | { |
| 6231 | - $country = filter_var($country,FILTER_SANITIZE_STRING); |
|
| 6231 | + $country = filter_var($country, FILTER_SANITIZE_STRING); |
|
| 6232 | 6232 | |
| 6233 | - $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 |
|
| 6233 | + $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 |
|
| 6234 | 6234 | FROM spotter_output |
| 6235 | 6235 | WHERE ((spotter_output.departure_airport_country = :country) OR (spotter_output.arrival_airport_country = :country)) OR spotter_output.airline_country = :country |
| 6236 | 6236 | GROUP BY spotter_output.departure_airport_icao |
@@ -6243,7 +6243,7 @@ discard block |
||
| 6243 | 6243 | $airport_array = array(); |
| 6244 | 6244 | $temp_array = array(); |
| 6245 | 6245 | |
| 6246 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6246 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6247 | 6247 | { |
| 6248 | 6248 | $temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
| 6249 | 6249 | $temp_array['airport_departure_icao_count'] = $row['airport_departure_icao_count']; |
@@ -6266,9 +6266,9 @@ discard block |
||
| 6266 | 6266 | */ |
| 6267 | 6267 | public function countAllDepartureAirportCountriesByCountry($country) |
| 6268 | 6268 | { |
| 6269 | - $country = filter_var($country,FILTER_SANITIZE_STRING); |
|
| 6269 | + $country = filter_var($country, FILTER_SANITIZE_STRING); |
|
| 6270 | 6270 | |
| 6271 | - $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
| 6271 | + $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
|
| 6272 | 6272 | FROM spotter_output |
| 6273 | 6273 | WHERE spotter_output.departure_airport_country <> '' AND ((spotter_output.departure_airport_country = :country) OR (spotter_output.arrival_airport_country = :country)) OR spotter_output.airline_country = :country |
| 6274 | 6274 | GROUP BY spotter_output.departure_airport_country |
@@ -6281,7 +6281,7 @@ discard block |
||
| 6281 | 6281 | $airport_array = array(); |
| 6282 | 6282 | $temp_array = array(); |
| 6283 | 6283 | |
| 6284 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6284 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6285 | 6285 | { |
| 6286 | 6286 | $temp_array['departure_airport_country'] = $row['departure_airport_country']; |
| 6287 | 6287 | $temp_array['airport_departure_country_count'] = $row['airport_departure_country_count']; |
@@ -6299,11 +6299,11 @@ discard block |
||
| 6299 | 6299 | * @return Array the airport list |
| 6300 | 6300 | * |
| 6301 | 6301 | */ |
| 6302 | - public function countAllArrivalAirports($limit = true, $olderthanmonths = 0, $sincedate = '', $icaoaskey = false,$filters = array()) |
|
| 6302 | + public function countAllArrivalAirports($limit = true, $olderthanmonths = 0, $sincedate = '', $icaoaskey = false, $filters = array()) |
|
| 6303 | 6303 | { |
| 6304 | 6304 | global $globalDBdriver; |
| 6305 | - $filter_query = $this->getFilter($filters,true,true); |
|
| 6306 | - $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 |
|
| 6305 | + $filter_query = $this->getFilter($filters, true, true); |
|
| 6306 | + $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 |
|
| 6307 | 6307 | FROM spotter_output".$filter_query." spotter_output.arrival_airport_name <> '' AND spotter_output.arrival_airport_icao <> 'NA'"; |
| 6308 | 6308 | if ($olderthanmonths > 0) { |
| 6309 | 6309 | if ($globalDBdriver == 'mysql') { |
@@ -6338,7 +6338,7 @@ discard block |
||
| 6338 | 6338 | $airport_array = array(); |
| 6339 | 6339 | $temp_array = array(); |
| 6340 | 6340 | |
| 6341 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6341 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6342 | 6342 | { |
| 6343 | 6343 | $temp_array['airport_arrival_icao'] = $row['arrival_airport_icao']; |
| 6344 | 6344 | $temp_array['airport_arrival_icao_count'] = $row['airport_arrival_icao_count']; |
@@ -6364,7 +6364,7 @@ discard block |
||
| 6364 | 6364 | public function countAllArrivalAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '', $icaoaskey = false) |
| 6365 | 6365 | { |
| 6366 | 6366 | global $globalDBdriver; |
| 6367 | - $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 |
|
| 6367 | + $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 |
|
| 6368 | 6368 | FROM spotter_output |
| 6369 | 6369 | WHERE spotter_output.airline_icao <> '' AND spotter_output.arrival_airport_name <> '' AND spotter_output.arrival_airport_icao <> 'NA' "; |
| 6370 | 6370 | if ($olderthanmonths > 0) { |
@@ -6400,7 +6400,7 @@ discard block |
||
| 6400 | 6400 | $airport_array = array(); |
| 6401 | 6401 | $temp_array = array(); |
| 6402 | 6402 | |
| 6403 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6403 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6404 | 6404 | { |
| 6405 | 6405 | $temp_array['airline_icao'] = $row['airline_icao']; |
| 6406 | 6406 | $temp_array['airport_arrival_icao'] = $row['arrival_airport_icao']; |
@@ -6425,11 +6425,11 @@ discard block |
||
| 6425 | 6425 | * @return Array the airport list |
| 6426 | 6426 | * |
| 6427 | 6427 | */ |
| 6428 | - public function countAllDetectedArrivalAirports($limit = true, $olderthanmonths = 0, $sincedate = '',$icaoaskey = false,$filters = array()) |
|
| 6428 | + public function countAllDetectedArrivalAirports($limit = true, $olderthanmonths = 0, $sincedate = '', $icaoaskey = false, $filters = array()) |
|
| 6429 | 6429 | { |
| 6430 | 6430 | global $globalDBdriver; |
| 6431 | - $filter_query = $this->getFilter($filters,true,true); |
|
| 6432 | - $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 |
|
| 6431 | + $filter_query = $this->getFilter($filters, true, true); |
|
| 6432 | + $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 |
|
| 6433 | 6433 | FROM spotter_output, airport".$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"; |
| 6434 | 6434 | if ($olderthanmonths > 0) { |
| 6435 | 6435 | if ($globalDBdriver == 'mysql') { |
@@ -6463,7 +6463,7 @@ discard block |
||
| 6463 | 6463 | $airport_array = array(); |
| 6464 | 6464 | $temp_array = array(); |
| 6465 | 6465 | |
| 6466 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6466 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6467 | 6467 | { |
| 6468 | 6468 | $temp_array['airport_arrival_icao'] = $row['arrival_airport_icao']; |
| 6469 | 6469 | $temp_array['airport_arrival_icao_count'] = $row['airport_arrival_icao_count']; |
@@ -6486,10 +6486,10 @@ discard block |
||
| 6486 | 6486 | * @return Array the airport list |
| 6487 | 6487 | * |
| 6488 | 6488 | */ |
| 6489 | - public function countAllDetectedArrivalAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '',$icaoaskey = false) |
|
| 6489 | + public function countAllDetectedArrivalAirportsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '', $icaoaskey = false) |
|
| 6490 | 6490 | { |
| 6491 | 6491 | global $globalDBdriver; |
| 6492 | - $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 |
|
| 6492 | + $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 |
|
| 6493 | 6493 | FROM spotter_output, airport |
| 6494 | 6494 | WHERE 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 "; |
| 6495 | 6495 | if ($olderthanmonths > 0) { |
@@ -6525,7 +6525,7 @@ discard block |
||
| 6525 | 6525 | $airport_array = array(); |
| 6526 | 6526 | $temp_array = array(); |
| 6527 | 6527 | |
| 6528 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6528 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6529 | 6529 | { |
| 6530 | 6530 | $temp_array['airport_arrival_icao'] = $row['arrival_airport_icao']; |
| 6531 | 6531 | $temp_array['airport_arrival_icao_count'] = $row['airport_arrival_icao_count']; |
@@ -6551,9 +6551,9 @@ discard block |
||
| 6551 | 6551 | */ |
| 6552 | 6552 | public function countAllArrivalAirportsByAirline($airline_icao) |
| 6553 | 6553 | { |
| 6554 | - $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING); |
|
| 6554 | + $airline_icao = filter_var($airline_icao, FILTER_SANITIZE_STRING); |
|
| 6555 | 6555 | |
| 6556 | - $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 |
|
| 6556 | + $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 |
|
| 6557 | 6557 | FROM spotter_output |
| 6558 | 6558 | WHERE spotter_output.arrival_airport_name <> '' AND spotter_output.arrival_airport_icao <> 'NA' AND spotter_output.airline_icao = :airline_icao |
| 6559 | 6559 | GROUP BY spotter_output.arrival_airport_icao |
@@ -6566,7 +6566,7 @@ discard block |
||
| 6566 | 6566 | $airport_array = array(); |
| 6567 | 6567 | $temp_array = array(); |
| 6568 | 6568 | |
| 6569 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6569 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6570 | 6570 | { |
| 6571 | 6571 | $temp_array['airport_arrival_icao'] = $row['arrival_airport_icao']; |
| 6572 | 6572 | $temp_array['airport_arrival_icao_count'] = $row['airport_arrival_icao_count']; |
@@ -6589,9 +6589,9 @@ discard block |
||
| 6589 | 6589 | */ |
| 6590 | 6590 | public function countAllArrivalAirportCountriesByAirline($airline_icao) |
| 6591 | 6591 | { |
| 6592 | - $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING); |
|
| 6592 | + $airline_icao = filter_var($airline_icao, FILTER_SANITIZE_STRING); |
|
| 6593 | 6593 | |
| 6594 | - $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
| 6594 | + $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
| 6595 | 6595 | FROM spotter_output |
| 6596 | 6596 | WHERE spotter_output.arrival_airport_country <> '' AND spotter_output.airline_icao = :airline_icao |
| 6597 | 6597 | GROUP BY spotter_output.arrival_airport_country |
@@ -6604,7 +6604,7 @@ discard block |
||
| 6604 | 6604 | $airport_array = array(); |
| 6605 | 6605 | $temp_array = array(); |
| 6606 | 6606 | |
| 6607 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6607 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6608 | 6608 | { |
| 6609 | 6609 | $temp_array['arrival_airport_country'] = $row['arrival_airport_country']; |
| 6610 | 6610 | $temp_array['airport_arrival_country_count'] = $row['airport_arrival_country_count']; |
@@ -6624,9 +6624,9 @@ discard block |
||
| 6624 | 6624 | */ |
| 6625 | 6625 | public function countAllArrivalAirportsByAircraft($aircraft_icao) |
| 6626 | 6626 | { |
| 6627 | - $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
|
| 6627 | + $aircraft_icao = filter_var($aircraft_icao, FILTER_SANITIZE_STRING); |
|
| 6628 | 6628 | |
| 6629 | - $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 |
|
| 6629 | + $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 |
|
| 6630 | 6630 | FROM spotter_output |
| 6631 | 6631 | WHERE spotter_output.arrival_airport_name <> '' AND spotter_output.arrival_airport_icao <> 'NA' AND spotter_output.aircraft_icao = :aircraft_icao |
| 6632 | 6632 | GROUP BY spotter_output.arrival_airport_icao |
@@ -6639,7 +6639,7 @@ discard block |
||
| 6639 | 6639 | $airport_array = array(); |
| 6640 | 6640 | $temp_array = array(); |
| 6641 | 6641 | |
| 6642 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6642 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6643 | 6643 | { |
| 6644 | 6644 | $temp_array['airport_arrival_icao'] = $row['arrival_airport_icao']; |
| 6645 | 6645 | $temp_array['airport_arrival_icao_count'] = $row['airport_arrival_icao_count']; |
@@ -6663,9 +6663,9 @@ discard block |
||
| 6663 | 6663 | */ |
| 6664 | 6664 | public function countAllArrivalAirportCountriesByAircraft($aircraft_icao) |
| 6665 | 6665 | { |
| 6666 | - $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
|
| 6666 | + $aircraft_icao = filter_var($aircraft_icao, FILTER_SANITIZE_STRING); |
|
| 6667 | 6667 | |
| 6668 | - $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
| 6668 | + $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
| 6669 | 6669 | FROM spotter_output |
| 6670 | 6670 | WHERE spotter_output.arrival_airport_country <> '' AND spotter_output.aircraft_icao = :aircraft_icao |
| 6671 | 6671 | GROUP BY spotter_output.arrival_airport_country |
@@ -6678,7 +6678,7 @@ discard block |
||
| 6678 | 6678 | $airport_array = array(); |
| 6679 | 6679 | $temp_array = array(); |
| 6680 | 6680 | |
| 6681 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6681 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6682 | 6682 | { |
| 6683 | 6683 | $temp_array['arrival_airport_country'] = $row['arrival_airport_country']; |
| 6684 | 6684 | $temp_array['airport_arrival_country_count'] = $row['airport_arrival_country_count']; |
@@ -6698,9 +6698,9 @@ discard block |
||
| 6698 | 6698 | */ |
| 6699 | 6699 | public function countAllArrivalAirportsByRegistration($registration) |
| 6700 | 6700 | { |
| 6701 | - $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
|
| 6701 | + $registration = filter_var($registration, FILTER_SANITIZE_STRING); |
|
| 6702 | 6702 | |
| 6703 | - $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 |
|
| 6703 | + $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 |
|
| 6704 | 6704 | FROM spotter_output |
| 6705 | 6705 | WHERE spotter_output.arrival_airport_name <> '' AND spotter_output.arrival_airport_icao <> 'NA' AND spotter_output.registration = :registration |
| 6706 | 6706 | GROUP BY spotter_output.arrival_airport_icao |
@@ -6713,7 +6713,7 @@ discard block |
||
| 6713 | 6713 | $airport_array = array(); |
| 6714 | 6714 | $temp_array = array(); |
| 6715 | 6715 | |
| 6716 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6716 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6717 | 6717 | { |
| 6718 | 6718 | $temp_array['airport_arrival_icao'] = $row['arrival_airport_icao']; |
| 6719 | 6719 | $temp_array['airport_arrival_icao_count'] = $row['airport_arrival_icao_count']; |
@@ -6736,9 +6736,9 @@ discard block |
||
| 6736 | 6736 | */ |
| 6737 | 6737 | public function countAllArrivalAirportCountriesByRegistration($registration) |
| 6738 | 6738 | { |
| 6739 | - $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
|
| 6739 | + $registration = filter_var($registration, FILTER_SANITIZE_STRING); |
|
| 6740 | 6740 | |
| 6741 | - $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
| 6741 | + $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
| 6742 | 6742 | FROM spotter_output |
| 6743 | 6743 | WHERE spotter_output.arrival_airport_country <> '' AND spotter_output.registration = :registration |
| 6744 | 6744 | GROUP BY spotter_output.arrival_airport_country |
@@ -6751,7 +6751,7 @@ discard block |
||
| 6751 | 6751 | $airport_array = array(); |
| 6752 | 6752 | $temp_array = array(); |
| 6753 | 6753 | |
| 6754 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6754 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6755 | 6755 | { |
| 6756 | 6756 | $temp_array['arrival_airport_country'] = $row['arrival_airport_country']; |
| 6757 | 6757 | $temp_array['airport_arrival_country_count'] = $row['airport_arrival_country_count']; |
@@ -6772,9 +6772,9 @@ discard block |
||
| 6772 | 6772 | */ |
| 6773 | 6773 | public function countAllArrivalAirportsByAirport($airport_icao) |
| 6774 | 6774 | { |
| 6775 | - $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
|
| 6775 | + $airport_icao = filter_var($airport_icao, FILTER_SANITIZE_STRING); |
|
| 6776 | 6776 | |
| 6777 | - $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 |
|
| 6777 | + $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 |
|
| 6778 | 6778 | FROM spotter_output |
| 6779 | 6779 | WHERE spotter_output.arrival_airport_name <> '' AND spotter_output.arrival_airport_icao <> 'NA' AND spotter_output.departure_airport_icao = :airport_icao |
| 6780 | 6780 | GROUP BY spotter_output.arrival_airport_icao |
@@ -6787,7 +6787,7 @@ discard block |
||
| 6787 | 6787 | $airport_array = array(); |
| 6788 | 6788 | $temp_array = array(); |
| 6789 | 6789 | |
| 6790 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6790 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6791 | 6791 | { |
| 6792 | 6792 | $temp_array['airport_arrival_icao'] = $row['arrival_airport_icao']; |
| 6793 | 6793 | $temp_array['airport_arrival_icao_count'] = $row['airport_arrival_icao_count']; |
@@ -6810,9 +6810,9 @@ discard block |
||
| 6810 | 6810 | */ |
| 6811 | 6811 | public function countAllArrivalAirportCountriesByAirport($airport_icao) |
| 6812 | 6812 | { |
| 6813 | - $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
|
| 6813 | + $airport_icao = filter_var($airport_icao, FILTER_SANITIZE_STRING); |
|
| 6814 | 6814 | |
| 6815 | - $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
| 6815 | + $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
| 6816 | 6816 | FROM spotter_output |
| 6817 | 6817 | WHERE spotter_output.arrival_airport_country <> '' AND spotter_output.departure_airport_icao = :airport_icao |
| 6818 | 6818 | GROUP BY spotter_output.arrival_airport_country |
@@ -6825,7 +6825,7 @@ discard block |
||
| 6825 | 6825 | $airport_array = array(); |
| 6826 | 6826 | $temp_array = array(); |
| 6827 | 6827 | |
| 6828 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6828 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6829 | 6829 | { |
| 6830 | 6830 | $temp_array['arrival_airport_country'] = $row['arrival_airport_country']; |
| 6831 | 6831 | $temp_array['airport_arrival_country_count'] = $row['airport_arrival_country_count']; |
@@ -6845,9 +6845,9 @@ discard block |
||
| 6845 | 6845 | */ |
| 6846 | 6846 | public function countAllArrivalAirportsByManufacturer($aircraft_manufacturer) |
| 6847 | 6847 | { |
| 6848 | - $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
|
| 6848 | + $aircraft_manufacturer = filter_var($aircraft_manufacturer, FILTER_SANITIZE_STRING); |
|
| 6849 | 6849 | |
| 6850 | - $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 |
|
| 6850 | + $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 |
|
| 6851 | 6851 | FROM spotter_output |
| 6852 | 6852 | WHERE spotter_output.arrival_airport_name <> '' AND spotter_output.arrival_airport_icao <> 'NA' AND spotter_output.aircraft_manufacturer = :aircraft_manufacturer |
| 6853 | 6853 | GROUP BY spotter_output.arrival_airport_icao |
@@ -6860,7 +6860,7 @@ discard block |
||
| 6860 | 6860 | $airport_array = array(); |
| 6861 | 6861 | $temp_array = array(); |
| 6862 | 6862 | |
| 6863 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6863 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6864 | 6864 | { |
| 6865 | 6865 | $temp_array['airport_arrival_icao'] = $row['arrival_airport_icao']; |
| 6866 | 6866 | $temp_array['airport_arrival_icao_count'] = $row['airport_arrival_icao_count']; |
@@ -6884,9 +6884,9 @@ discard block |
||
| 6884 | 6884 | */ |
| 6885 | 6885 | public function countAllArrivalAirportCountriesByManufacturer($aircraft_manufacturer) |
| 6886 | 6886 | { |
| 6887 | - $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
|
| 6887 | + $aircraft_manufacturer = filter_var($aircraft_manufacturer, FILTER_SANITIZE_STRING); |
|
| 6888 | 6888 | |
| 6889 | - $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
| 6889 | + $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
| 6890 | 6890 | FROM spotter_output |
| 6891 | 6891 | WHERE spotter_output.arrival_airport_country <> '' AND spotter_output.aircraft_manufacturer = :aircraft_manufacturer |
| 6892 | 6892 | GROUP BY spotter_output.arrival_airport_country |
@@ -6899,7 +6899,7 @@ discard block |
||
| 6899 | 6899 | $airport_array = array(); |
| 6900 | 6900 | $temp_array = array(); |
| 6901 | 6901 | |
| 6902 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6902 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6903 | 6903 | { |
| 6904 | 6904 | $temp_array['arrival_airport_country'] = $row['arrival_airport_country']; |
| 6905 | 6905 | $temp_array['airport_arrival_country_count'] = $row['airport_arrival_country_count']; |
@@ -6921,7 +6921,7 @@ discard block |
||
| 6921 | 6921 | public function countAllArrivalAirportsByDate($date) |
| 6922 | 6922 | { |
| 6923 | 6923 | global $globalTimezone, $globalDBdriver; |
| 6924 | - $date = filter_var($date,FILTER_SANITIZE_STRING); |
|
| 6924 | + $date = filter_var($date, FILTER_SANITIZE_STRING); |
|
| 6925 | 6925 | if ($globalTimezone != '') { |
| 6926 | 6926 | date_default_timezone_set($globalTimezone); |
| 6927 | 6927 | $datetime = new DateTime($date); |
@@ -6929,13 +6929,13 @@ discard block |
||
| 6929 | 6929 | } else $offset = '+00:00'; |
| 6930 | 6930 | |
| 6931 | 6931 | if ($globalDBdriver == 'mysql') { |
| 6932 | - $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 |
|
| 6932 | + $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 |
|
| 6933 | 6933 | FROM spotter_output |
| 6934 | 6934 | WHERE spotter_output.arrival_airport_name <> '' AND spotter_output.arrival_airport_icao <> 'NA' AND DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) = :date |
| 6935 | 6935 | GROUP BY spotter_output.arrival_airport_icao |
| 6936 | 6936 | ORDER BY airport_arrival_icao_count DESC"; |
| 6937 | 6937 | } else { |
| 6938 | - $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 |
|
| 6938 | + $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 |
|
| 6939 | 6939 | FROM spotter_output |
| 6940 | 6940 | WHERE spotter_output.arrival_airport_name <> '' AND spotter_output.arrival_airport_icao <> 'NA' AND to_char(spotter_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') = :date |
| 6941 | 6941 | GROUP BY spotter_output.arrival_airport_icao |
@@ -6948,7 +6948,7 @@ discard block |
||
| 6948 | 6948 | $airport_array = array(); |
| 6949 | 6949 | $temp_array = array(); |
| 6950 | 6950 | |
| 6951 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6951 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 6952 | 6952 | { |
| 6953 | 6953 | $temp_array['airport_arrival_icao'] = $row['arrival_airport_icao']; |
| 6954 | 6954 | $temp_array['airport_arrival_icao_count'] = $row['airport_arrival_icao_count']; |
@@ -6972,7 +6972,7 @@ discard block |
||
| 6972 | 6972 | public function countAllArrivalAirportCountriesByDate($date) |
| 6973 | 6973 | { |
| 6974 | 6974 | global $globalTimezone, $globalDBdriver; |
| 6975 | - $date = filter_var($date,FILTER_SANITIZE_STRING); |
|
| 6975 | + $date = filter_var($date, FILTER_SANITIZE_STRING); |
|
| 6976 | 6976 | if ($globalTimezone != '') { |
| 6977 | 6977 | date_default_timezone_set($globalTimezone); |
| 6978 | 6978 | $datetime = new DateTime($date); |
@@ -6980,13 +6980,13 @@ discard block |
||
| 6980 | 6980 | } else $offset = '+00:00'; |
| 6981 | 6981 | |
| 6982 | 6982 | if ($globalDBdriver == 'mysql') { |
| 6983 | - $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
| 6983 | + $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
| 6984 | 6984 | FROM spotter_output |
| 6985 | 6985 | WHERE spotter_output.arrival_airport_country <> '' AND DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) = :date |
| 6986 | 6986 | GROUP BY spotter_output.arrival_airport_country |
| 6987 | 6987 | ORDER BY airport_arrival_country_count DESC"; |
| 6988 | 6988 | } else { |
| 6989 | - $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
| 6989 | + $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
| 6990 | 6990 | FROM spotter_output |
| 6991 | 6991 | WHERE spotter_output.arrival_airport_country <> '' AND to_char(spotter_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') = :date |
| 6992 | 6992 | GROUP BY spotter_output.arrival_airport_country |
@@ -6999,7 +6999,7 @@ discard block |
||
| 6999 | 6999 | $airport_array = array(); |
| 7000 | 7000 | $temp_array = array(); |
| 7001 | 7001 | |
| 7002 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7002 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7003 | 7003 | { |
| 7004 | 7004 | $temp_array['arrival_airport_country'] = $row['arrival_airport_country']; |
| 7005 | 7005 | $temp_array['airport_arrival_country_count'] = $row['airport_arrival_country_count']; |
@@ -7019,9 +7019,9 @@ discard block |
||
| 7019 | 7019 | */ |
| 7020 | 7020 | public function countAllArrivalAirportsByIdent($ident) |
| 7021 | 7021 | { |
| 7022 | - $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
|
| 7022 | + $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
|
| 7023 | 7023 | |
| 7024 | - $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 |
|
| 7024 | + $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 |
|
| 7025 | 7025 | FROM spotter_output |
| 7026 | 7026 | WHERE spotter_output.arrival_airport_name <> '' AND spotter_output.arrival_airport_icao <> 'NA' AND spotter_output.ident = :ident |
| 7027 | 7027 | GROUP BY spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
@@ -7034,7 +7034,7 @@ discard block |
||
| 7034 | 7034 | $airport_array = array(); |
| 7035 | 7035 | $temp_array = array(); |
| 7036 | 7036 | |
| 7037 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7037 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7038 | 7038 | { |
| 7039 | 7039 | $temp_array['airport_arrival_icao'] = $row['arrival_airport_icao']; |
| 7040 | 7040 | $temp_array['airport_arrival_icao_count'] = $row['airport_arrival_icao_count']; |
@@ -7057,9 +7057,9 @@ discard block |
||
| 7057 | 7057 | */ |
| 7058 | 7058 | public function countAllArrivalAirportCountriesByIdent($ident) |
| 7059 | 7059 | { |
| 7060 | - $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
|
| 7060 | + $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
|
| 7061 | 7061 | |
| 7062 | - $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
| 7062 | + $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
| 7063 | 7063 | FROM spotter_output |
| 7064 | 7064 | WHERE spotter_output.arrival_airport_country <> '' AND spotter_output.ident = :ident |
| 7065 | 7065 | GROUP BY spotter_output.arrival_airport_country |
@@ -7072,7 +7072,7 @@ discard block |
||
| 7072 | 7072 | $airport_array = array(); |
| 7073 | 7073 | $temp_array = array(); |
| 7074 | 7074 | |
| 7075 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7075 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7076 | 7076 | { |
| 7077 | 7077 | $temp_array['arrival_airport_country'] = $row['arrival_airport_country']; |
| 7078 | 7078 | $temp_array['airport_arrival_country_count'] = $row['airport_arrival_country_count']; |
@@ -7093,9 +7093,9 @@ discard block |
||
| 7093 | 7093 | */ |
| 7094 | 7094 | public function countAllArrivalAirportsByCountry($country) |
| 7095 | 7095 | { |
| 7096 | - $country = filter_var($country,FILTER_SANITIZE_STRING); |
|
| 7096 | + $country = filter_var($country, FILTER_SANITIZE_STRING); |
|
| 7097 | 7097 | |
| 7098 | - $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 |
|
| 7098 | + $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 |
|
| 7099 | 7099 | FROM spotter_output |
| 7100 | 7100 | WHERE ((spotter_output.departure_airport_country = :country) OR (spotter_output.arrival_airport_country = :country)) OR spotter_output.airline_country = :country |
| 7101 | 7101 | GROUP BY spotter_output.arrival_airport_icao |
@@ -7108,7 +7108,7 @@ discard block |
||
| 7108 | 7108 | $airport_array = array(); |
| 7109 | 7109 | $temp_array = array(); |
| 7110 | 7110 | |
| 7111 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7111 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7112 | 7112 | { |
| 7113 | 7113 | $temp_array['airport_arrival_icao'] = $row['arrival_airport_icao']; |
| 7114 | 7114 | $temp_array['airport_arrival_icao_count'] = $row['airport_arrival_icao_count']; |
@@ -7131,9 +7131,9 @@ discard block |
||
| 7131 | 7131 | */ |
| 7132 | 7132 | public function countAllArrivalAirportCountriesByCountry($country) |
| 7133 | 7133 | { |
| 7134 | - $country = filter_var($country,FILTER_SANITIZE_STRING); |
|
| 7134 | + $country = filter_var($country, FILTER_SANITIZE_STRING); |
|
| 7135 | 7135 | |
| 7136 | - $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
| 7136 | + $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
|
| 7137 | 7137 | FROM spotter_output |
| 7138 | 7138 | WHERE spotter_output.arrival_airport_country <> '' AND ((spotter_output.departure_airport_country = :country) OR (spotter_output.arrival_airport_country = :country)) OR spotter_output.airline_country = :country |
| 7139 | 7139 | GROUP BY spotter_output.arrival_airport_country |
@@ -7146,7 +7146,7 @@ discard block |
||
| 7146 | 7146 | $airport_array = array(); |
| 7147 | 7147 | $temp_array = array(); |
| 7148 | 7148 | |
| 7149 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7149 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7150 | 7150 | { |
| 7151 | 7151 | $temp_array['arrival_airport_country'] = $row['arrival_airport_country']; |
| 7152 | 7152 | $temp_array['airport_arrival_country_count'] = $row['airport_arrival_country_count']; |
@@ -7167,7 +7167,7 @@ discard block |
||
| 7167 | 7167 | */ |
| 7168 | 7168 | public function countAllDepartureCountries($filters = array()) |
| 7169 | 7169 | { |
| 7170 | - $filter_query = $this->getFilter($filters,true,true); |
|
| 7170 | + $filter_query = $this->getFilter($filters, true, true); |
|
| 7171 | 7171 | $query = "SELECT DISTINCT spotter_output.departure_airport_country, COUNT(spotter_output.departure_airport_country) AS airport_departure_country_count |
| 7172 | 7172 | FROM spotter_output".$filter_query." spotter_output.departure_airport_country <> '' AND spotter_output.departure_airport_icao <> 'NA'"; |
| 7173 | 7173 | $query .= " GROUP BY spotter_output.departure_airport_country |
@@ -7181,7 +7181,7 @@ discard block |
||
| 7181 | 7181 | $airport_array = array(); |
| 7182 | 7182 | $temp_array = array(); |
| 7183 | 7183 | |
| 7184 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7184 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7185 | 7185 | { |
| 7186 | 7186 | $temp_array['airport_departure_country_count'] = $row['airport_departure_country_count']; |
| 7187 | 7187 | $temp_array['airport_departure_country'] = $row['departure_airport_country']; |
@@ -7199,9 +7199,9 @@ discard block |
||
| 7199 | 7199 | * @return Array the airport arrival list |
| 7200 | 7200 | * |
| 7201 | 7201 | */ |
| 7202 | - public function countAllArrivalCountries($limit = true,$filters = array()) |
|
| 7202 | + public function countAllArrivalCountries($limit = true, $filters = array()) |
|
| 7203 | 7203 | { |
| 7204 | - $filter_query = $this->getFilter($filters,true,true); |
|
| 7204 | + $filter_query = $this->getFilter($filters, true, true); |
|
| 7205 | 7205 | $query = "SELECT DISTINCT spotter_output.arrival_airport_country, COUNT(spotter_output.arrival_airport_country) AS airport_arrival_country_count |
| 7206 | 7206 | FROM spotter_output".$filter_query." spotter_output.arrival_airport_country <> '' AND spotter_output.arrival_airport_icao <> 'NA'"; |
| 7207 | 7207 | $query .= " GROUP BY spotter_output.arrival_airport_country |
@@ -7215,7 +7215,7 @@ discard block |
||
| 7215 | 7215 | $airport_array = array(); |
| 7216 | 7216 | $temp_array = array(); |
| 7217 | 7217 | |
| 7218 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7218 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7219 | 7219 | { |
| 7220 | 7220 | $temp_array['airport_arrival_country_count'] = $row['airport_arrival_country_count']; |
| 7221 | 7221 | $temp_array['airport_arrival_country'] = $row['arrival_airport_country']; |
@@ -7239,7 +7239,7 @@ discard block |
||
| 7239 | 7239 | public function countAllRoutes() |
| 7240 | 7240 | { |
| 7241 | 7241 | |
| 7242 | - $query = "SELECT DISTINCT concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao) AS route, count(concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao)) AS route_count, spotter_output.departure_airport_icao, spotter_output.departure_airport_name AS airport_departure_name, spotter_output.departure_airport_city AS airport_departure_city, spotter_output.departure_airport_country AS airport_departure_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name AS airport_arrival_name, spotter_output.arrival_airport_city AS airport_arrival_city, spotter_output.arrival_airport_country AS airport_arrival_country |
|
| 7242 | + $query = "SELECT DISTINCT concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao) AS route, count(concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao)) AS route_count, spotter_output.departure_airport_icao, spotter_output.departure_airport_name AS airport_departure_name, spotter_output.departure_airport_city AS airport_departure_city, spotter_output.departure_airport_country AS airport_departure_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name AS airport_arrival_name, spotter_output.arrival_airport_city AS airport_arrival_city, spotter_output.arrival_airport_country AS airport_arrival_country |
|
| 7243 | 7243 | FROM spotter_output |
| 7244 | 7244 | WHERE spotter_output.ident <> '' AND spotter_output.departure_airport_icao <> 'NA' AND spotter_output.arrival_airport_icao <> 'NA' |
| 7245 | 7245 | GROUP BY route,spotter_output.departure_airport_icao, spotter_output.arrival_airport_icao,spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country |
@@ -7253,7 +7253,7 @@ discard block |
||
| 7253 | 7253 | $routes_array = array(); |
| 7254 | 7254 | $temp_array = array(); |
| 7255 | 7255 | |
| 7256 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7256 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7257 | 7257 | { |
| 7258 | 7258 | $temp_array['route_count'] = $row['route_count']; |
| 7259 | 7259 | $temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
@@ -7282,9 +7282,9 @@ discard block |
||
| 7282 | 7282 | */ |
| 7283 | 7283 | public function countAllRoutesByAircraft($aircraft_icao) |
| 7284 | 7284 | { |
| 7285 | - $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
|
| 7285 | + $aircraft_icao = filter_var($aircraft_icao, FILTER_SANITIZE_STRING); |
|
| 7286 | 7286 | |
| 7287 | - $query = "SELECT DISTINCT concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao) AS route, count(concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao)) AS route_count, spotter_output.departure_airport_icao, spotter_output.departure_airport_name AS airport_departure_name, spotter_output.departure_airport_city AS airport_departure_city, spotter_output.departure_airport_country AS airport_departure_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name AS airport_arrival_name, spotter_output.arrival_airport_city AS airport_arrival_city, spotter_output.arrival_airport_country AS airport_arrival_country |
|
| 7287 | + $query = "SELECT DISTINCT concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao) AS route, count(concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao)) AS route_count, spotter_output.departure_airport_icao, spotter_output.departure_airport_name AS airport_departure_name, spotter_output.departure_airport_city AS airport_departure_city, spotter_output.departure_airport_country AS airport_departure_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name AS airport_arrival_name, spotter_output.arrival_airport_city AS airport_arrival_city, spotter_output.arrival_airport_country AS airport_arrival_country |
|
| 7288 | 7288 | FROM spotter_output |
| 7289 | 7289 | WHERE spotter_output.ident <> '' AND spotter_output.aircraft_icao = :aircraft_icao |
| 7290 | 7290 | GROUP BY route |
@@ -7297,7 +7297,7 @@ discard block |
||
| 7297 | 7297 | $routes_array = array(); |
| 7298 | 7298 | $temp_array = array(); |
| 7299 | 7299 | |
| 7300 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7300 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7301 | 7301 | { |
| 7302 | 7302 | $temp_array['route_count'] = $row['route_count']; |
| 7303 | 7303 | $temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
@@ -7326,7 +7326,7 @@ discard block |
||
| 7326 | 7326 | { |
| 7327 | 7327 | $registration = filter_var($registration, FILTER_SANITIZE_STRING); |
| 7328 | 7328 | |
| 7329 | - $query = "SELECT DISTINCT concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao) AS route, count(concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao)) AS route_count, spotter_output.departure_airport_icao, spotter_output.departure_airport_name AS airport_departure_name, spotter_output.departure_airport_city AS airport_departure_city, spotter_output.departure_airport_country AS airport_departure_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name AS airport_arrival_name, spotter_output.arrival_airport_city AS airport_arrival_city, spotter_output.arrival_airport_country AS airport_arrival_country |
|
| 7329 | + $query = "SELECT DISTINCT concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao) AS route, count(concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao)) AS route_count, spotter_output.departure_airport_icao, spotter_output.departure_airport_name AS airport_departure_name, spotter_output.departure_airport_city AS airport_departure_city, spotter_output.departure_airport_country AS airport_departure_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name AS airport_arrival_name, spotter_output.arrival_airport_city AS airport_arrival_city, spotter_output.arrival_airport_country AS airport_arrival_country |
|
| 7330 | 7330 | FROM spotter_output |
| 7331 | 7331 | WHERE spotter_output.ident <> '' AND spotter_output.registration = :registration |
| 7332 | 7332 | GROUP BY route |
@@ -7339,7 +7339,7 @@ discard block |
||
| 7339 | 7339 | $routes_array = array(); |
| 7340 | 7340 | $temp_array = array(); |
| 7341 | 7341 | |
| 7342 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7342 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7343 | 7343 | { |
| 7344 | 7344 | $temp_array['route_count'] = $row['route_count']; |
| 7345 | 7345 | $temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
@@ -7367,9 +7367,9 @@ discard block |
||
| 7367 | 7367 | */ |
| 7368 | 7368 | public function countAllRoutesByAirline($airline_icao) |
| 7369 | 7369 | { |
| 7370 | - $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING); |
|
| 7370 | + $airline_icao = filter_var($airline_icao, FILTER_SANITIZE_STRING); |
|
| 7371 | 7371 | |
| 7372 | - $query = "SELECT DISTINCT concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao) AS route, count(concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao)) AS route_count, spotter_output.departure_airport_icao, spotter_output.departure_airport_name AS airport_departure_name, spotter_output.departure_airport_city AS airport_departure_city, spotter_output.departure_airport_country AS airport_departure_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name AS airport_arrival_name, spotter_output.arrival_airport_city AS airport_arrival_city, spotter_output.arrival_airport_country AS airport_arrival_country |
|
| 7372 | + $query = "SELECT DISTINCT concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao) AS route, count(concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao)) AS route_count, spotter_output.departure_airport_icao, spotter_output.departure_airport_name AS airport_departure_name, spotter_output.departure_airport_city AS airport_departure_city, spotter_output.departure_airport_country AS airport_departure_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name AS airport_arrival_name, spotter_output.arrival_airport_city AS airport_arrival_city, spotter_output.arrival_airport_country AS airport_arrival_country |
|
| 7373 | 7373 | FROM spotter_output |
| 7374 | 7374 | WHERE spotter_output.ident <> '' AND spotter_output.airline_icao = :airline_icao |
| 7375 | 7375 | GROUP BY route |
@@ -7382,7 +7382,7 @@ discard block |
||
| 7382 | 7382 | $routes_array = array(); |
| 7383 | 7383 | $temp_array = array(); |
| 7384 | 7384 | |
| 7385 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7385 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7386 | 7386 | { |
| 7387 | 7387 | $temp_array['route_count'] = $row['route_count']; |
| 7388 | 7388 | $temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
@@ -7410,9 +7410,9 @@ discard block |
||
| 7410 | 7410 | */ |
| 7411 | 7411 | public function countAllRoutesByAirport($airport_icao) |
| 7412 | 7412 | { |
| 7413 | - $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
|
| 7413 | + $airport_icao = filter_var($airport_icao, FILTER_SANITIZE_STRING); |
|
| 7414 | 7414 | |
| 7415 | - $query = "SELECT DISTINCT concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao) AS route, count(concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao)) AS route_count, spotter_output.departure_airport_icao, spotter_output.departure_airport_name AS airport_departure_name, spotter_output.departure_airport_city AS airport_departure_city, spotter_output.departure_airport_country AS airport_departure_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name AS airport_arrival_name, spotter_output.arrival_airport_city AS airport_arrival_city, spotter_output.arrival_airport_country AS airport_arrival_country |
|
| 7415 | + $query = "SELECT DISTINCT concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao) AS route, count(concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao)) AS route_count, spotter_output.departure_airport_icao, spotter_output.departure_airport_name AS airport_departure_name, spotter_output.departure_airport_city AS airport_departure_city, spotter_output.departure_airport_country AS airport_departure_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name AS airport_arrival_name, spotter_output.arrival_airport_city AS airport_arrival_city, spotter_output.arrival_airport_country AS airport_arrival_country |
|
| 7416 | 7416 | FROM spotter_output |
| 7417 | 7417 | WHERE spotter_output.ident <> '' AND (spotter_output.departure_airport_icao = :airport_icao OR spotter_output.arrival_airport_icao = :airport_icao) |
| 7418 | 7418 | GROUP BY route |
@@ -7425,7 +7425,7 @@ discard block |
||
| 7425 | 7425 | $routes_array = array(); |
| 7426 | 7426 | $temp_array = array(); |
| 7427 | 7427 | |
| 7428 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7428 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7429 | 7429 | { |
| 7430 | 7430 | $temp_array['route_count'] = $row['route_count']; |
| 7431 | 7431 | $temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
@@ -7453,9 +7453,9 @@ discard block |
||
| 7453 | 7453 | */ |
| 7454 | 7454 | public function countAllRoutesByCountry($country) |
| 7455 | 7455 | { |
| 7456 | - $country = filter_var($country,FILTER_SANITIZE_STRING); |
|
| 7456 | + $country = filter_var($country, FILTER_SANITIZE_STRING); |
|
| 7457 | 7457 | |
| 7458 | - $query = "SELECT DISTINCT concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao) AS route, count(concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao)) AS route_count, spotter_output.departure_airport_icao, spotter_output.departure_airport_name AS airport_departure_name, spotter_output.departure_airport_city AS airport_departure_city, spotter_output.departure_airport_country AS airport_departure_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name AS airport_arrival_name, spotter_output.arrival_airport_city AS airport_arrival_city, spotter_output.arrival_airport_country AS airport_arrival_country |
|
| 7458 | + $query = "SELECT DISTINCT concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao) AS route, count(concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao)) AS route_count, spotter_output.departure_airport_icao, spotter_output.departure_airport_name AS airport_departure_name, spotter_output.departure_airport_city AS airport_departure_city, spotter_output.departure_airport_country AS airport_departure_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name AS airport_arrival_name, spotter_output.arrival_airport_city AS airport_arrival_city, spotter_output.arrival_airport_country AS airport_arrival_country |
|
| 7459 | 7459 | FROM spotter_output |
| 7460 | 7460 | WHERE spotter_output.ident <> '' AND ((spotter_output.departure_airport_country = :country) OR (spotter_output.arrival_airport_country = :country)) OR spotter_output.airline_country = :country |
| 7461 | 7461 | GROUP BY route |
@@ -7468,7 +7468,7 @@ discard block |
||
| 7468 | 7468 | $routes_array = array(); |
| 7469 | 7469 | $temp_array = array(); |
| 7470 | 7470 | |
| 7471 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7471 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7472 | 7472 | { |
| 7473 | 7473 | $temp_array['route_count'] = $row['route_count']; |
| 7474 | 7474 | $temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
@@ -7496,7 +7496,7 @@ discard block |
||
| 7496 | 7496 | public function countAllRoutesByDate($date) |
| 7497 | 7497 | { |
| 7498 | 7498 | global $globalTimezone, $globalDBdriver; |
| 7499 | - $date = filter_var($date,FILTER_SANITIZE_STRING); |
|
| 7499 | + $date = filter_var($date, FILTER_SANITIZE_STRING); |
|
| 7500 | 7500 | if ($globalTimezone != '') { |
| 7501 | 7501 | date_default_timezone_set($globalTimezone); |
| 7502 | 7502 | $datetime = new DateTime($date); |
@@ -7504,13 +7504,13 @@ discard block |
||
| 7504 | 7504 | } else $offset = '+00:00'; |
| 7505 | 7505 | |
| 7506 | 7506 | if ($globalDBdriver == 'mysql') { |
| 7507 | - $query = "SELECT DISTINCT concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao) AS route, count(concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao)) AS route_count, spotter_output.departure_airport_icao, spotter_output.departure_airport_name AS airport_departure_name, spotter_output.departure_airport_city AS airport_departure_city, spotter_output.departure_airport_country AS airport_departure_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name AS airport_arrival_name, spotter_output.arrival_airport_city AS airport_arrival_city, spotter_output.arrival_airport_country AS airport_arrival_country |
|
| 7507 | + $query = "SELECT DISTINCT concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao) AS route, count(concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao)) AS route_count, spotter_output.departure_airport_icao, spotter_output.departure_airport_name AS airport_departure_name, spotter_output.departure_airport_city AS airport_departure_city, spotter_output.departure_airport_country AS airport_departure_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name AS airport_arrival_name, spotter_output.arrival_airport_city AS airport_arrival_city, spotter_output.arrival_airport_country AS airport_arrival_country |
|
| 7508 | 7508 | FROM spotter_output |
| 7509 | 7509 | WHERE spotter_output.ident <> '' AND DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) = :date |
| 7510 | 7510 | GROUP BY route |
| 7511 | 7511 | ORDER BY route_count DESC"; |
| 7512 | 7512 | } else { |
| 7513 | - $query = "SELECT DISTINCT concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao) AS route, count(concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao)) AS route_count, spotter_output.departure_airport_icao, spotter_output.departure_airport_name AS airport_departure_name, spotter_output.departure_airport_city AS airport_departure_city, spotter_output.departure_airport_country AS airport_departure_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name AS airport_arrival_name, spotter_output.arrival_airport_city AS airport_arrival_city, spotter_output.arrival_airport_country AS airport_arrival_country |
|
| 7513 | + $query = "SELECT DISTINCT concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao) AS route, count(concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao)) AS route_count, spotter_output.departure_airport_icao, spotter_output.departure_airport_name AS airport_departure_name, spotter_output.departure_airport_city AS airport_departure_city, spotter_output.departure_airport_country AS airport_departure_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name AS airport_arrival_name, spotter_output.arrival_airport_city AS airport_arrival_city, spotter_output.arrival_airport_country AS airport_arrival_country |
|
| 7514 | 7514 | FROM spotter_output |
| 7515 | 7515 | WHERE spotter_output.ident <> '' AND to_char(spotter_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') = :date |
| 7516 | 7516 | GROUP BY route |
@@ -7523,7 +7523,7 @@ discard block |
||
| 7523 | 7523 | $routes_array = array(); |
| 7524 | 7524 | $temp_array = array(); |
| 7525 | 7525 | |
| 7526 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7526 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7527 | 7527 | { |
| 7528 | 7528 | $temp_array['route_count'] = $row['route_count']; |
| 7529 | 7529 | $temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
@@ -7550,9 +7550,9 @@ discard block |
||
| 7550 | 7550 | */ |
| 7551 | 7551 | public function countAllRoutesByIdent($ident) |
| 7552 | 7552 | { |
| 7553 | - $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
|
| 7553 | + $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
|
| 7554 | 7554 | |
| 7555 | - $query = "SELECT DISTINCT concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao) AS route, count(concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao)) AS route_count, spotter_output.departure_airport_icao, spotter_output.departure_airport_name AS airport_departure_name, spotter_output.departure_airport_city AS airport_departure_city, spotter_output.departure_airport_country AS airport_departure_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name AS airport_arrival_name, spotter_output.arrival_airport_city AS airport_arrival_city, spotter_output.arrival_airport_country AS airport_arrival_country |
|
| 7555 | + $query = "SELECT DISTINCT concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao) AS route, count(concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao)) AS route_count, spotter_output.departure_airport_icao, spotter_output.departure_airport_name AS airport_departure_name, spotter_output.departure_airport_city AS airport_departure_city, spotter_output.departure_airport_country AS airport_departure_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name AS airport_arrival_name, spotter_output.arrival_airport_city AS airport_arrival_city, spotter_output.arrival_airport_country AS airport_arrival_country |
|
| 7556 | 7556 | FROM spotter_output |
| 7557 | 7557 | WHERE spotter_output.ident <> '' AND spotter_output.ident = :ident |
| 7558 | 7558 | GROUP BY route, spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
@@ -7565,7 +7565,7 @@ discard block |
||
| 7565 | 7565 | $routes_array = array(); |
| 7566 | 7566 | $temp_array = array(); |
| 7567 | 7567 | |
| 7568 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7568 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7569 | 7569 | { |
| 7570 | 7570 | $temp_array['route_count'] = $row['route_count']; |
| 7571 | 7571 | $temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
@@ -7592,9 +7592,9 @@ discard block |
||
| 7592 | 7592 | */ |
| 7593 | 7593 | public function countAllRoutesByManufacturer($aircraft_manufacturer) |
| 7594 | 7594 | { |
| 7595 | - $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
|
| 7595 | + $aircraft_manufacturer = filter_var($aircraft_manufacturer, FILTER_SANITIZE_STRING); |
|
| 7596 | 7596 | |
| 7597 | - $query = "SELECT DISTINCT concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao) AS route, count(concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao)) AS route_count, spotter_output.departure_airport_icao, spotter_output.departure_airport_name AS airport_departure_name, spotter_output.departure_airport_city AS airport_departure_city, spotter_output.departure_airport_country AS airport_departure_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name AS airport_arrival_name, spotter_output.arrival_airport_city AS airport_arrival_city, spotter_output.arrival_airport_country AS airport_arrival_country |
|
| 7597 | + $query = "SELECT DISTINCT concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao) AS route, count(concat(spotter_output.departure_airport_icao, ' - ', spotter_output.arrival_airport_icao)) AS route_count, spotter_output.departure_airport_icao, spotter_output.departure_airport_name AS airport_departure_name, spotter_output.departure_airport_city AS airport_departure_city, spotter_output.departure_airport_country AS airport_departure_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name AS airport_arrival_name, spotter_output.arrival_airport_city AS airport_arrival_city, spotter_output.arrival_airport_country AS airport_arrival_country |
|
| 7598 | 7598 | FROM spotter_output |
| 7599 | 7599 | WHERE spotter_output.ident <> '' AND spotter_output.aircraft_manufacturer = :aircraft_manufacturer |
| 7600 | 7600 | GROUP BY route |
@@ -7607,7 +7607,7 @@ discard block |
||
| 7607 | 7607 | $routes_array = array(); |
| 7608 | 7608 | $temp_array = array(); |
| 7609 | 7609 | |
| 7610 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7610 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7611 | 7611 | { |
| 7612 | 7612 | $temp_array['route_count'] = $row['route_count']; |
| 7613 | 7613 | $temp_array['airport_departure_icao'] = $row['departure_airport_icao']; |
@@ -7635,7 +7635,7 @@ discard block |
||
| 7635 | 7635 | */ |
| 7636 | 7636 | public function countAllRoutesWithWaypoints() |
| 7637 | 7637 | { |
| 7638 | - $query = "SELECT DISTINCT spotter_output.waypoints AS route, count(spotter_output.waypoints) AS route_count, spotter_output.spotter_id, spotter_output.departure_airport_icao, spotter_output.departure_airport_name AS airport_departure_name, spotter_output.departure_airport_city AS airport_departure_city, spotter_output.departure_airport_country AS airport_departure_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name AS airport_arrival_name, spotter_output.arrival_airport_city AS airport_arrival_city, spotter_output.arrival_airport_country AS airport_arrival_country |
|
| 7638 | + $query = "SELECT DISTINCT spotter_output.waypoints AS route, count(spotter_output.waypoints) AS route_count, spotter_output.spotter_id, spotter_output.departure_airport_icao, spotter_output.departure_airport_name AS airport_departure_name, spotter_output.departure_airport_city AS airport_departure_city, spotter_output.departure_airport_country AS airport_departure_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name AS airport_arrival_name, spotter_output.arrival_airport_city AS airport_arrival_city, spotter_output.arrival_airport_country AS airport_arrival_country |
|
| 7639 | 7639 | FROM spotter_output |
| 7640 | 7640 | WHERE spotter_output.ident <> '' AND spotter_output.waypoints <> '' |
| 7641 | 7641 | GROUP BY route, spotter_output.spotter_id, spotter_output.departure_airport_icao, spotter_output.departure_airport_name, spotter_output.departure_airport_city, spotter_output.departure_airport_country, spotter_output.arrival_airport_icao, spotter_output.arrival_airport_name, spotter_output.arrival_airport_city, spotter_output.arrival_airport_country |
@@ -7649,7 +7649,7 @@ discard block |
||
| 7649 | 7649 | $routes_array = array(); |
| 7650 | 7650 | $temp_array = array(); |
| 7651 | 7651 | |
| 7652 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7652 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7653 | 7653 | { |
| 7654 | 7654 | $temp_array['spotter_id'] = $row['spotter_id']; |
| 7655 | 7655 | $temp_array['route_count'] = $row['route_count']; |
@@ -7677,11 +7677,11 @@ discard block |
||
| 7677 | 7677 | * @return Array the callsign list |
| 7678 | 7678 | * |
| 7679 | 7679 | */ |
| 7680 | - public function countAllCallsigns($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array()) |
|
| 7680 | + public function countAllCallsigns($limit = true, $olderthanmonths = 0, $sincedate = '', $filters = array()) |
|
| 7681 | 7681 | { |
| 7682 | 7682 | global $globalDBdriver; |
| 7683 | - $filter_query = $this->getFilter($filters,true,true); |
|
| 7684 | - $query = "SELECT DISTINCT spotter_output.ident, COUNT(spotter_output.ident) AS callsign_icao_count, spotter_output.airline_name, spotter_output.airline_icao |
|
| 7683 | + $filter_query = $this->getFilter($filters, true, true); |
|
| 7684 | + $query = "SELECT DISTINCT spotter_output.ident, COUNT(spotter_output.ident) AS callsign_icao_count, spotter_output.airline_name, spotter_output.airline_icao |
|
| 7685 | 7685 | FROM spotter_output".$filter_query." spotter_output.ident <> '' "; |
| 7686 | 7686 | if ($olderthanmonths > 0) { |
| 7687 | 7687 | if ($globalDBdriver == 'mysql') $query .= ' AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH)'; |
@@ -7700,7 +7700,7 @@ discard block |
||
| 7700 | 7700 | $callsign_array = array(); |
| 7701 | 7701 | $temp_array = array(); |
| 7702 | 7702 | |
| 7703 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7703 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7704 | 7704 | { |
| 7705 | 7705 | $temp_array['callsign_icao'] = $row['ident']; |
| 7706 | 7706 | $temp_array['airline_name'] = $row['airline_name']; |
@@ -7722,7 +7722,7 @@ discard block |
||
| 7722 | 7722 | public function countAllCallsignsByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '') |
| 7723 | 7723 | { |
| 7724 | 7724 | global $globalDBdriver; |
| 7725 | - $query = "SELECT DISTINCT spotter_output.airline_icao, spotter_output.ident, COUNT(spotter_output.ident) AS callsign_icao_count, spotter_output.airline_name |
|
| 7725 | + $query = "SELECT DISTINCT spotter_output.airline_icao, spotter_output.ident, COUNT(spotter_output.ident) AS callsign_icao_count, spotter_output.airline_name |
|
| 7726 | 7726 | FROM spotter_output |
| 7727 | 7727 | WHERE spotter_output.ident <> '' AND spotter_output.airline_icao <> '' "; |
| 7728 | 7728 | if ($olderthanmonths > 0) { |
@@ -7742,7 +7742,7 @@ discard block |
||
| 7742 | 7742 | $callsign_array = array(); |
| 7743 | 7743 | $temp_array = array(); |
| 7744 | 7744 | |
| 7745 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7745 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7746 | 7746 | { |
| 7747 | 7747 | $temp_array['callsign_icao'] = $row['ident']; |
| 7748 | 7748 | $temp_array['airline_name'] = $row['airline_name']; |
@@ -7796,7 +7796,7 @@ discard block |
||
| 7796 | 7796 | $date_array = array(); |
| 7797 | 7797 | $temp_array = array(); |
| 7798 | 7798 | |
| 7799 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7799 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7800 | 7800 | { |
| 7801 | 7801 | $temp_array['date_name'] = $row['date_name']; |
| 7802 | 7802 | $temp_array['date_count'] = $row['date_count']; |
@@ -7821,15 +7821,15 @@ discard block |
||
| 7821 | 7821 | $datetime = new DateTime(); |
| 7822 | 7822 | $offset = $datetime->format('P'); |
| 7823 | 7823 | } else $offset = '+00:00'; |
| 7824 | - $filter_query = $this->getFilter($filters,true,true); |
|
| 7824 | + $filter_query = $this->getFilter($filters, true, true); |
|
| 7825 | 7825 | if ($globalDBdriver == 'mysql') { |
| 7826 | - $query = "SELECT spotter_output.airline_icao, DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS date_name, count(*) as date_count |
|
| 7826 | + $query = "SELECT spotter_output.airline_icao, DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS date_name, count(*) as date_count |
|
| 7827 | 7827 | FROM spotter_output".$filter_query." spotter_output.airline_icao <> '' |
| 7828 | 7828 | GROUP BY spotter_output.airline_icao, date_name |
| 7829 | 7829 | ORDER BY date_count DESC |
| 7830 | 7830 | LIMIT 10 OFFSET 0"; |
| 7831 | 7831 | } else { |
| 7832 | - $query = "SELECT spotter_output.airline_icao, to_char(spotter_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') AS date_name, count(*) as date_count |
|
| 7832 | + $query = "SELECT spotter_output.airline_icao, to_char(spotter_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') AS date_name, count(*) as date_count |
|
| 7833 | 7833 | FROM spotter_output |
| 7834 | 7834 | WHERE spotter_output.airline_icao <> '' |
| 7835 | 7835 | GROUP BY spotter_output.airline_icao, date_name |
@@ -7844,7 +7844,7 @@ discard block |
||
| 7844 | 7844 | $date_array = array(); |
| 7845 | 7845 | $temp_array = array(); |
| 7846 | 7846 | |
| 7847 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7847 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7848 | 7848 | { |
| 7849 | 7849 | $temp_array['date_name'] = $row['date_name']; |
| 7850 | 7850 | $temp_array['date_count'] = $row['date_count']; |
@@ -7870,7 +7870,7 @@ discard block |
||
| 7870 | 7870 | $datetime = new DateTime(); |
| 7871 | 7871 | $offset = $datetime->format('P'); |
| 7872 | 7872 | } else $offset = '+00:00'; |
| 7873 | - $filter_query = $this->getFilter($filters,true,true); |
|
| 7873 | + $filter_query = $this->getFilter($filters, true, true); |
|
| 7874 | 7874 | if ($globalDBdriver == 'mysql') { |
| 7875 | 7875 | $query = "SELECT DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS date_name, count(*) as date_count |
| 7876 | 7876 | FROM spotter_output".$filter_query." spotter_output.date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 7 DAY)"; |
@@ -7891,7 +7891,7 @@ discard block |
||
| 7891 | 7891 | $date_array = array(); |
| 7892 | 7892 | $temp_array = array(); |
| 7893 | 7893 | |
| 7894 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7894 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7895 | 7895 | { |
| 7896 | 7896 | $temp_array['date_name'] = $row['date_name']; |
| 7897 | 7897 | $temp_array['date_count'] = $row['date_count']; |
@@ -7916,7 +7916,7 @@ discard block |
||
| 7916 | 7916 | $datetime = new DateTime(); |
| 7917 | 7917 | $offset = $datetime->format('P'); |
| 7918 | 7918 | } else $offset = '+00:00'; |
| 7919 | - $filter_query = $this->getFilter($filters,true,true); |
|
| 7919 | + $filter_query = $this->getFilter($filters, true, true); |
|
| 7920 | 7920 | if ($globalDBdriver == 'mysql') { |
| 7921 | 7921 | $query = "SELECT DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS date_name, count(*) as date_count |
| 7922 | 7922 | FROM spotter_output".$filter_query." spotter_output.date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 MONTH)"; |
@@ -7937,7 +7937,7 @@ discard block |
||
| 7937 | 7937 | $date_array = array(); |
| 7938 | 7938 | $temp_array = array(); |
| 7939 | 7939 | |
| 7940 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7940 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7941 | 7941 | { |
| 7942 | 7942 | $temp_array['date_name'] = $row['date_name']; |
| 7943 | 7943 | $temp_array['date_count'] = $row['date_count']; |
@@ -7965,14 +7965,14 @@ discard block |
||
| 7965 | 7965 | } else $offset = '+00:00'; |
| 7966 | 7966 | |
| 7967 | 7967 | if ($globalDBdriver == 'mysql') { |
| 7968 | - $query = "SELECT spotter_output.airline_icao, DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS date_name, count(*) as date_count |
|
| 7968 | + $query = "SELECT spotter_output.airline_icao, DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS date_name, count(*) as date_count |
|
| 7969 | 7969 | FROM spotter_output |
| 7970 | 7970 | WHERE spotter_output.airline_icao <> '' AND spotter_output.date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 MONTH) |
| 7971 | 7971 | GROUP BY spotter_output.airline_icao, date_name |
| 7972 | 7972 | ORDER BY spotter_output.date ASC"; |
| 7973 | 7973 | $query_data = array(':offset' => $offset); |
| 7974 | 7974 | } else { |
| 7975 | - $query = "SELECT spotter_output.airline_icao, to_char(spotter_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') AS date_name, count(*) as date_count |
|
| 7975 | + $query = "SELECT spotter_output.airline_icao, to_char(spotter_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') AS date_name, count(*) as date_count |
|
| 7976 | 7976 | FROM spotter_output |
| 7977 | 7977 | WHERE spotter_output.airline_icao <> '' AND spotter_output.date >= CURRENT_TIMESTAMP AT TIME ZONE INTERVAL :offset - INTERVAL '1 MONTHS' |
| 7978 | 7978 | GROUP BY spotter_output.airline_icao, date_name |
@@ -7986,7 +7986,7 @@ discard block |
||
| 7986 | 7986 | $date_array = array(); |
| 7987 | 7987 | $temp_array = array(); |
| 7988 | 7988 | |
| 7989 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7989 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 7990 | 7990 | { |
| 7991 | 7991 | $temp_array['date_name'] = $row['date_name']; |
| 7992 | 7992 | $temp_array['date_count'] = $row['date_count']; |
@@ -8033,7 +8033,7 @@ discard block |
||
| 8033 | 8033 | $date_array = array(); |
| 8034 | 8034 | $temp_array = array(); |
| 8035 | 8035 | |
| 8036 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8036 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8037 | 8037 | { |
| 8038 | 8038 | $temp_array['month_name'] = $row['month_name']; |
| 8039 | 8039 | $temp_array['year_name'] = $row['year_name']; |
@@ -8061,13 +8061,13 @@ discard block |
||
| 8061 | 8061 | } else $offset = '+00:00'; |
| 8062 | 8062 | |
| 8063 | 8063 | if ($globalDBdriver == 'mysql') { |
| 8064 | - $query = "SELECT spotter_output.airline_icao, YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(*) as date_count |
|
| 8064 | + $query = "SELECT spotter_output.airline_icao, YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(*) as date_count |
|
| 8065 | 8065 | FROM spotter_output |
| 8066 | 8066 | WHERE spotter_output.airline_icao <> '' |
| 8067 | 8067 | GROUP BY spotter_output.airline_icao, year_name, month_name |
| 8068 | 8068 | ORDER BY date_count DESC"; |
| 8069 | 8069 | } else { |
| 8070 | - $query = "SELECT spotter_output.airline_icao, EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, count(*) as date_count |
|
| 8070 | + $query = "SELECT spotter_output.airline_icao, EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, count(*) as date_count |
|
| 8071 | 8071 | FROM spotter_output |
| 8072 | 8072 | WHERE spotter_output.airline_icao <> '' |
| 8073 | 8073 | GROUP BY spotter_output.airline_icao, year_name, month_name |
@@ -8081,7 +8081,7 @@ discard block |
||
| 8081 | 8081 | $date_array = array(); |
| 8082 | 8082 | $temp_array = array(); |
| 8083 | 8083 | |
| 8084 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8084 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8085 | 8085 | { |
| 8086 | 8086 | $temp_array['month_name'] = $row['month_name']; |
| 8087 | 8087 | $temp_array['year_name'] = $row['year_name']; |
@@ -8108,14 +8108,14 @@ discard block |
||
| 8108 | 8108 | $datetime = new DateTime(); |
| 8109 | 8109 | $offset = $datetime->format('P'); |
| 8110 | 8110 | } else $offset = '+00:00'; |
| 8111 | - $filter_query = $this->getFilter($filters,true,true); |
|
| 8111 | + $filter_query = $this->getFilter($filters, true, true); |
|
| 8112 | 8112 | if ($globalDBdriver == 'mysql') { |
| 8113 | - $query = "SELECT YEAR(CONVERT_TZ(s.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(s.date,'+00:00', :offset)) AS month_name, count(*) as date_count |
|
| 8113 | + $query = "SELECT YEAR(CONVERT_TZ(s.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(s.date,'+00:00', :offset)) AS month_name, count(*) as date_count |
|
| 8114 | 8114 | FROM spotter_output s".$filter_query." s.airline_type = 'military' |
| 8115 | 8115 | GROUP BY year_name, month_name |
| 8116 | 8116 | ORDER BY date_count DESC"; |
| 8117 | 8117 | } else { |
| 8118 | - $query = "SELECT EXTRACT(YEAR FROM s.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM s.date AT TIME ZONE INTERVAL :offset) AS month_name, count(*) as date_count |
|
| 8118 | + $query = "SELECT EXTRACT(YEAR FROM s.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM s.date AT TIME ZONE INTERVAL :offset) AS month_name, count(*) as date_count |
|
| 8119 | 8119 | FROM spotter_output s".$filter_query." s.airline_type = 'military' |
| 8120 | 8120 | GROUP BY year_name, month_name |
| 8121 | 8121 | ORDER BY date_count DESC"; |
@@ -8127,7 +8127,7 @@ discard block |
||
| 8127 | 8127 | $date_array = array(); |
| 8128 | 8128 | $temp_array = array(); |
| 8129 | 8129 | |
| 8130 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8130 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8131 | 8131 | { |
| 8132 | 8132 | $temp_array['month_name'] = $row['month_name']; |
| 8133 | 8133 | $temp_array['year_name'] = $row['year_name']; |
@@ -8153,15 +8153,15 @@ discard block |
||
| 8153 | 8153 | $datetime = new DateTime(); |
| 8154 | 8154 | $offset = $datetime->format('P'); |
| 8155 | 8155 | } else $offset = '+00:00'; |
| 8156 | - $filter_query = $this->getFilter($filters,true,true); |
|
| 8156 | + $filter_query = $this->getFilter($filters, true, true); |
|
| 8157 | 8157 | |
| 8158 | 8158 | if ($globalDBdriver == 'mysql') { |
| 8159 | - $query = "SELECT YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(distinct owner_name) as date_count |
|
| 8159 | + $query = "SELECT YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(distinct owner_name) as date_count |
|
| 8160 | 8160 | FROM spotter_output".$filter_query." owner_name <> '' |
| 8161 | 8161 | GROUP BY year_name, month_name |
| 8162 | 8162 | ORDER BY date_count DESC"; |
| 8163 | 8163 | } else { |
| 8164 | - $query = "SELECT EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, count(distinct owner_name) as date_count |
|
| 8164 | + $query = "SELECT EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, count(distinct owner_name) as date_count |
|
| 8165 | 8165 | FROM spotter_output".$filter_query." owner_name <> '' |
| 8166 | 8166 | GROUP BY year_name, month_name |
| 8167 | 8167 | ORDER BY date_count DESC"; |
@@ -8173,7 +8173,7 @@ discard block |
||
| 8173 | 8173 | $date_array = array(); |
| 8174 | 8174 | $temp_array = array(); |
| 8175 | 8175 | |
| 8176 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8176 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8177 | 8177 | { |
| 8178 | 8178 | $temp_array['month_name'] = $row['month_name']; |
| 8179 | 8179 | $temp_array['year_name'] = $row['year_name']; |
@@ -8201,13 +8201,13 @@ discard block |
||
| 8201 | 8201 | } else $offset = '+00:00'; |
| 8202 | 8202 | |
| 8203 | 8203 | if ($globalDBdriver == 'mysql') { |
| 8204 | - $query = "SELECT spotter_output.airline_icao, YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(distinct owner_name) as date_count |
|
| 8204 | + $query = "SELECT spotter_output.airline_icao, YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(distinct owner_name) as date_count |
|
| 8205 | 8205 | FROM spotter_output |
| 8206 | 8206 | WHERE owner_name <> '' AND spotter_output.airline_icao <> '' |
| 8207 | 8207 | GROUP BY spotter_output.airline_icao, year_name, month_name |
| 8208 | 8208 | ORDER BY date_count DESC"; |
| 8209 | 8209 | } else { |
| 8210 | - $query = "SELECT spotter_output.airline_icao, EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, count(distinct owner_name) as date_count |
|
| 8210 | + $query = "SELECT spotter_output.airline_icao, EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, count(distinct owner_name) as date_count |
|
| 8211 | 8211 | FROM spotter_output |
| 8212 | 8212 | WHERE owner_name <> '' AND spotter_output.airline_icao <> '' |
| 8213 | 8213 | GROUP BY spotter_output.airline_icao, year_name, month_name |
@@ -8220,7 +8220,7 @@ discard block |
||
| 8220 | 8220 | $date_array = array(); |
| 8221 | 8221 | $temp_array = array(); |
| 8222 | 8222 | |
| 8223 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8223 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8224 | 8224 | { |
| 8225 | 8225 | $temp_array['month_name'] = $row['month_name']; |
| 8226 | 8226 | $temp_array['year_name'] = $row['year_name']; |
@@ -8247,15 +8247,15 @@ discard block |
||
| 8247 | 8247 | $datetime = new DateTime(); |
| 8248 | 8248 | $offset = $datetime->format('P'); |
| 8249 | 8249 | } else $offset = '+00:00'; |
| 8250 | - $filter_query = $this->getFilter($filters,true,true); |
|
| 8250 | + $filter_query = $this->getFilter($filters, true, true); |
|
| 8251 | 8251 | |
| 8252 | 8252 | if ($globalDBdriver == 'mysql') { |
| 8253 | - $query = "SELECT YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(distinct pilot_id) as date_count |
|
| 8253 | + $query = "SELECT YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(distinct pilot_id) as date_count |
|
| 8254 | 8254 | FROM spotter_output".$filter_query." pilot_id <> '' AND pilot_id IS NOT NULL |
| 8255 | 8255 | GROUP BY year_name, month_name |
| 8256 | 8256 | ORDER BY date_count DESC"; |
| 8257 | 8257 | } else { |
| 8258 | - $query = "SELECT EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, count(distinct pilot_id) as date_count |
|
| 8258 | + $query = "SELECT EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, count(distinct pilot_id) as date_count |
|
| 8259 | 8259 | FROM spotter_output".$filter_query." pilot_id <> '' AND pilot_id IS NOT NULL |
| 8260 | 8260 | GROUP BY year_name, month_name |
| 8261 | 8261 | ORDER BY date_count DESC"; |
@@ -8267,7 +8267,7 @@ discard block |
||
| 8267 | 8267 | $date_array = array(); |
| 8268 | 8268 | $temp_array = array(); |
| 8269 | 8269 | |
| 8270 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8270 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8271 | 8271 | { |
| 8272 | 8272 | $temp_array['month_name'] = $row['month_name']; |
| 8273 | 8273 | $temp_array['year_name'] = $row['year_name']; |
@@ -8295,13 +8295,13 @@ discard block |
||
| 8295 | 8295 | } else $offset = '+00:00'; |
| 8296 | 8296 | |
| 8297 | 8297 | if ($globalDBdriver == 'mysql') { |
| 8298 | - $query = "SELECT spotter_output.airline_icao, YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(distinct pilot_id) as date_count |
|
| 8298 | + $query = "SELECT spotter_output.airline_icao, YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(distinct pilot_id) as date_count |
|
| 8299 | 8299 | FROM spotter_output |
| 8300 | 8300 | WHERE spotter_output.airline_icao <> '' AND pilot_id <> '' AND pilot_id IS NOT NULL |
| 8301 | 8301 | GROUP BY spotter_output.airline_icao,year_name, month_name |
| 8302 | 8302 | ORDER BY date_count DESC"; |
| 8303 | 8303 | } else { |
| 8304 | - $query = "SELECT spotter_output.airline_icao, EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, count(distinct pilot_id) as date_count |
|
| 8304 | + $query = "SELECT spotter_output.airline_icao, EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, count(distinct pilot_id) as date_count |
|
| 8305 | 8305 | FROM spotter_output |
| 8306 | 8306 | WHERE spotter_output.airline_icao <> '' AND pilot_id <> '' AND pilot_id IS NOT NULL |
| 8307 | 8307 | GROUP BY spotter_output.airline_icao, year_name, month_name |
@@ -8314,7 +8314,7 @@ discard block |
||
| 8314 | 8314 | $date_array = array(); |
| 8315 | 8315 | $temp_array = array(); |
| 8316 | 8316 | |
| 8317 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8317 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8318 | 8318 | { |
| 8319 | 8319 | $temp_array['month_name'] = $row['month_name']; |
| 8320 | 8320 | $temp_array['year_name'] = $row['year_name']; |
@@ -8343,13 +8343,13 @@ discard block |
||
| 8343 | 8343 | } else $offset = '+00:00'; |
| 8344 | 8344 | |
| 8345 | 8345 | if ($globalDBdriver == 'mysql') { |
| 8346 | - $query = "SELECT YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(distinct airline_icao) as date_count |
|
| 8346 | + $query = "SELECT YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(distinct airline_icao) as date_count |
|
| 8347 | 8347 | FROM spotter_output |
| 8348 | 8348 | WHERE airline_icao <> '' |
| 8349 | 8349 | GROUP BY year_name, month_name |
| 8350 | 8350 | ORDER BY date_count DESC"; |
| 8351 | 8351 | } else { |
| 8352 | - $query = "SELECT EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, count(distinct airline_icao) as date_count |
|
| 8352 | + $query = "SELECT EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, count(distinct airline_icao) as date_count |
|
| 8353 | 8353 | FROM spotter_output |
| 8354 | 8354 | WHERE airline_icao <> '' |
| 8355 | 8355 | GROUP BY year_name, month_name |
@@ -8362,7 +8362,7 @@ discard block |
||
| 8362 | 8362 | $date_array = array(); |
| 8363 | 8363 | $temp_array = array(); |
| 8364 | 8364 | |
| 8365 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8365 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8366 | 8366 | { |
| 8367 | 8367 | $temp_array['month_name'] = $row['month_name']; |
| 8368 | 8368 | $temp_array['year_name'] = $row['year_name']; |
@@ -8388,15 +8388,15 @@ discard block |
||
| 8388 | 8388 | $datetime = new DateTime(); |
| 8389 | 8389 | $offset = $datetime->format('P'); |
| 8390 | 8390 | } else $offset = '+00:00'; |
| 8391 | - $filter_query = $this->getFilter($filters,true,true); |
|
| 8391 | + $filter_query = $this->getFilter($filters, true, true); |
|
| 8392 | 8392 | |
| 8393 | 8393 | if ($globalDBdriver == 'mysql') { |
| 8394 | - $query = "SELECT YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(distinct aircraft_icao) as date_count |
|
| 8394 | + $query = "SELECT YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(distinct aircraft_icao) as date_count |
|
| 8395 | 8395 | FROM spotter_output".$filter_query." aircraft_icao <> '' |
| 8396 | 8396 | GROUP BY year_name, month_name |
| 8397 | 8397 | ORDER BY date_count DESC"; |
| 8398 | 8398 | } else { |
| 8399 | - $query = "SELECT EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, count(distinct aircraft_icao) as date_count |
|
| 8399 | + $query = "SELECT EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, count(distinct aircraft_icao) as date_count |
|
| 8400 | 8400 | FROM spotter_output".$filter_query." aircraft_icao <> '' |
| 8401 | 8401 | GROUP BY year_name, month_name |
| 8402 | 8402 | ORDER BY date_count DESC"; |
@@ -8408,7 +8408,7 @@ discard block |
||
| 8408 | 8408 | $date_array = array(); |
| 8409 | 8409 | $temp_array = array(); |
| 8410 | 8410 | |
| 8411 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8411 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8412 | 8412 | { |
| 8413 | 8413 | $temp_array['month_name'] = $row['month_name']; |
| 8414 | 8414 | $temp_array['year_name'] = $row['year_name']; |
@@ -8437,13 +8437,13 @@ discard block |
||
| 8437 | 8437 | } else $offset = '+00:00'; |
| 8438 | 8438 | |
| 8439 | 8439 | if ($globalDBdriver == 'mysql') { |
| 8440 | - $query = "SELECT spotter_output.airline_icao,YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(distinct aircraft_icao) as date_count |
|
| 8440 | + $query = "SELECT spotter_output.airline_icao,YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(distinct aircraft_icao) as date_count |
|
| 8441 | 8441 | FROM spotter_output |
| 8442 | 8442 | WHERE aircraft_icao <> '' AND spotter_output.airline_icao <> '' |
| 8443 | 8443 | GROUP BY spotter_output.airline_icao, year_name, month_name |
| 8444 | 8444 | ORDER BY date_count DESC"; |
| 8445 | 8445 | } else { |
| 8446 | - $query = "SELECT spotter_output.airline_icao, EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, count(distinct aircraft_icao) as date_count |
|
| 8446 | + $query = "SELECT spotter_output.airline_icao, EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, count(distinct aircraft_icao) as date_count |
|
| 8447 | 8447 | FROM spotter_output |
| 8448 | 8448 | WHERE aircraft_icao <> '' AND spotter_output.airline_icao <> '' |
| 8449 | 8449 | GROUP BY spotter_output.airline_icao, year_name, month_name |
@@ -8456,7 +8456,7 @@ discard block |
||
| 8456 | 8456 | $date_array = array(); |
| 8457 | 8457 | $temp_array = array(); |
| 8458 | 8458 | |
| 8459 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8459 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8460 | 8460 | { |
| 8461 | 8461 | $temp_array['month_name'] = $row['month_name']; |
| 8462 | 8462 | $temp_array['year_name'] = $row['year_name']; |
@@ -8483,15 +8483,15 @@ discard block |
||
| 8483 | 8483 | $datetime = new DateTime(); |
| 8484 | 8484 | $offset = $datetime->format('P'); |
| 8485 | 8485 | } else $offset = '+00:00'; |
| 8486 | - $filter_query = $this->getFilter($filters,true,true); |
|
| 8486 | + $filter_query = $this->getFilter($filters, true, true); |
|
| 8487 | 8487 | |
| 8488 | 8488 | if ($globalDBdriver == 'mysql') { |
| 8489 | - $query = "SELECT YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(real_arrival_airport_icao) as date_count |
|
| 8489 | + $query = "SELECT YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(real_arrival_airport_icao) as date_count |
|
| 8490 | 8490 | FROM spotter_output".$filter_query." real_arrival_airport_icao <> '' |
| 8491 | 8491 | GROUP BY year_name, month_name |
| 8492 | 8492 | ORDER BY date_count DESC"; |
| 8493 | 8493 | } else { |
| 8494 | - $query = "SELECT EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, count(real_arrival_airport_icao) as date_count |
|
| 8494 | + $query = "SELECT EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, count(real_arrival_airport_icao) as date_count |
|
| 8495 | 8495 | FROM spotter_output".$filter_query." real_arrival_airport_icao <> '' |
| 8496 | 8496 | GROUP BY year_name, month_name |
| 8497 | 8497 | ORDER BY date_count DESC"; |
@@ -8503,7 +8503,7 @@ discard block |
||
| 8503 | 8503 | $date_array = array(); |
| 8504 | 8504 | $temp_array = array(); |
| 8505 | 8505 | |
| 8506 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8506 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8507 | 8507 | { |
| 8508 | 8508 | $temp_array['month_name'] = $row['month_name']; |
| 8509 | 8509 | $temp_array['year_name'] = $row['year_name']; |
@@ -8532,13 +8532,13 @@ discard block |
||
| 8532 | 8532 | } else $offset = '+00:00'; |
| 8533 | 8533 | |
| 8534 | 8534 | if ($globalDBdriver == 'mysql') { |
| 8535 | - $query = "SELECT spotter_output.airline_icao, YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(real_arrival_airport_icao) as date_count |
|
| 8535 | + $query = "SELECT spotter_output.airline_icao, YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, count(real_arrival_airport_icao) as date_count |
|
| 8536 | 8536 | FROM spotter_output |
| 8537 | 8537 | WHERE real_arrival_airport_icao <> '' AND spotter_output.airline_icao <> '' |
| 8538 | 8538 | GROUP BY spotter_output.airline_icao, year_name, month_name |
| 8539 | 8539 | ORDER BY date_count DESC"; |
| 8540 | 8540 | } else { |
| 8541 | - $query = "SELECT spotter_output.airline_icao, EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, count(real_arrival_airport_icao) as date_count |
|
| 8541 | + $query = "SELECT spotter_output.airline_icao, EXTRACT(YEAR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS year_name,EXTRACT(MONTH FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS month_name, count(real_arrival_airport_icao) as date_count |
|
| 8542 | 8542 | FROM spotter_output |
| 8543 | 8543 | WHERE real_arrival_airport_icao <> '' AND spotter_output.airline_icao <> '' |
| 8544 | 8544 | GROUP BY spotter_output.airline_icao, year_name, month_name |
@@ -8551,7 +8551,7 @@ discard block |
||
| 8551 | 8551 | $date_array = array(); |
| 8552 | 8552 | $temp_array = array(); |
| 8553 | 8553 | |
| 8554 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8554 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8555 | 8555 | { |
| 8556 | 8556 | $temp_array['month_name'] = $row['month_name']; |
| 8557 | 8557 | $temp_array['year_name'] = $row['year_name']; |
@@ -8579,7 +8579,7 @@ discard block |
||
| 8579 | 8579 | $datetime = new DateTime(); |
| 8580 | 8580 | $offset = $datetime->format('P'); |
| 8581 | 8581 | } else $offset = '+00:00'; |
| 8582 | - $filter_query = $this->getFilter($filters,true,true); |
|
| 8582 | + $filter_query = $this->getFilter($filters, true, true); |
|
| 8583 | 8583 | if ($globalDBdriver == 'mysql') { |
| 8584 | 8584 | $query = "SELECT MONTH(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS month_name, YEAR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS year_name, count(*) as date_count |
| 8585 | 8585 | FROM spotter_output".$filter_query." spotter_output.date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 YEAR)"; |
@@ -8600,7 +8600,7 @@ discard block |
||
| 8600 | 8600 | $date_array = array(); |
| 8601 | 8601 | $temp_array = array(); |
| 8602 | 8602 | |
| 8603 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8603 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8604 | 8604 | { |
| 8605 | 8605 | $temp_array['year_name'] = $row['year_name']; |
| 8606 | 8606 | $temp_array['month_name'] = $row['month_name']; |
@@ -8620,7 +8620,7 @@ discard block |
||
| 8620 | 8620 | * @return Array the hour list |
| 8621 | 8621 | * |
| 8622 | 8622 | */ |
| 8623 | - public function countAllHours($orderby,$filters = array()) |
|
| 8623 | + public function countAllHours($orderby, $filters = array()) |
|
| 8624 | 8624 | { |
| 8625 | 8625 | global $globalTimezone, $globalDBdriver; |
| 8626 | 8626 | if ($globalTimezone != '') { |
@@ -8668,7 +8668,7 @@ discard block |
||
| 8668 | 8668 | $hour_array = array(); |
| 8669 | 8669 | $temp_array = array(); |
| 8670 | 8670 | |
| 8671 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8671 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8672 | 8672 | { |
| 8673 | 8673 | $temp_array['hour_name'] = $row['hour_name']; |
| 8674 | 8674 | $temp_array['hour_count'] = $row['hour_count']; |
@@ -8705,7 +8705,7 @@ discard block |
||
| 8705 | 8705 | } |
| 8706 | 8706 | |
| 8707 | 8707 | if ($globalDBdriver == 'mysql') { |
| 8708 | - $query = "SELECT spotter_output.airline_icao, HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
| 8708 | + $query = "SELECT spotter_output.airline_icao, HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
| 8709 | 8709 | FROM spotter_output |
| 8710 | 8710 | WHERE spotter_output.airline_icao <> '' |
| 8711 | 8711 | GROUP BY spotter_output.airline_icao, hour_name |
@@ -8719,7 +8719,7 @@ discard block |
||
| 8719 | 8719 | */ |
| 8720 | 8720 | $query_data = array(':offset' => $offset); |
| 8721 | 8721 | } else { |
| 8722 | - $query = "SELECT spotter_output.airline_icao, EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
| 8722 | + $query = "SELECT spotter_output.airline_icao, EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
| 8723 | 8723 | FROM spotter_output |
| 8724 | 8724 | WHERE spotter_output.airline_icao <> '' |
| 8725 | 8725 | GROUP BY spotter_output.airline_icao, hour_name |
@@ -8733,7 +8733,7 @@ discard block |
||
| 8733 | 8733 | $hour_array = array(); |
| 8734 | 8734 | $temp_array = array(); |
| 8735 | 8735 | |
| 8736 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8736 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8737 | 8737 | { |
| 8738 | 8738 | $temp_array['hour_name'] = $row['hour_name']; |
| 8739 | 8739 | $temp_array['hour_count'] = $row['hour_count']; |
@@ -8762,16 +8762,16 @@ discard block |
||
| 8762 | 8762 | $offset = $datetime->format('P'); |
| 8763 | 8763 | } else $offset = '+00:00'; |
| 8764 | 8764 | |
| 8765 | - $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING); |
|
| 8765 | + $airline_icao = filter_var($airline_icao, FILTER_SANITIZE_STRING); |
|
| 8766 | 8766 | |
| 8767 | 8767 | if ($globalDBdriver == 'mysql') { |
| 8768 | - $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
| 8768 | + $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
| 8769 | 8769 | FROM spotter_output |
| 8770 | 8770 | WHERE spotter_output.airline_icao = :airline_icao |
| 8771 | 8771 | GROUP BY hour_name |
| 8772 | 8772 | ORDER BY hour_name ASC"; |
| 8773 | 8773 | } else { |
| 8774 | - $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
| 8774 | + $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
| 8775 | 8775 | FROM spotter_output |
| 8776 | 8776 | WHERE spotter_output.airline_icao = :airline_icao |
| 8777 | 8777 | GROUP BY hour_name |
@@ -8779,12 +8779,12 @@ discard block |
||
| 8779 | 8779 | } |
| 8780 | 8780 | |
| 8781 | 8781 | $sth = $this->db->prepare($query); |
| 8782 | - $sth->execute(array(':airline_icao' => $airline_icao,':offset' => $offset)); |
|
| 8782 | + $sth->execute(array(':airline_icao' => $airline_icao, ':offset' => $offset)); |
|
| 8783 | 8783 | |
| 8784 | 8784 | $hour_array = array(); |
| 8785 | 8785 | $temp_array = array(); |
| 8786 | 8786 | |
| 8787 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8787 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8788 | 8788 | { |
| 8789 | 8789 | $temp_array['hour_name'] = $row['hour_name']; |
| 8790 | 8790 | $temp_array['hour_count'] = $row['hour_count']; |
@@ -8807,7 +8807,7 @@ discard block |
||
| 8807 | 8807 | public function countAllHoursByAircraft($aircraft_icao) |
| 8808 | 8808 | { |
| 8809 | 8809 | global $globalTimezone, $globalDBdriver; |
| 8810 | - $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
|
| 8810 | + $aircraft_icao = filter_var($aircraft_icao, FILTER_SANITIZE_STRING); |
|
| 8811 | 8811 | if ($globalTimezone != '') { |
| 8812 | 8812 | date_default_timezone_set($globalTimezone); |
| 8813 | 8813 | $datetime = new DateTime(); |
@@ -8815,13 +8815,13 @@ discard block |
||
| 8815 | 8815 | } else $offset = '+00:00'; |
| 8816 | 8816 | |
| 8817 | 8817 | if ($globalDBdriver == 'mysql') { |
| 8818 | - $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
| 8818 | + $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
| 8819 | 8819 | FROM spotter_output |
| 8820 | 8820 | WHERE spotter_output.aircraft_icao = :aircraft_icao |
| 8821 | 8821 | GROUP BY hour_name |
| 8822 | 8822 | ORDER BY hour_name ASC"; |
| 8823 | 8823 | } else { |
| 8824 | - $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
| 8824 | + $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
| 8825 | 8825 | FROM spotter_output |
| 8826 | 8826 | WHERE spotter_output.aircraft_icao = :aircraft_icao |
| 8827 | 8827 | GROUP BY hour_name |
@@ -8829,12 +8829,12 @@ discard block |
||
| 8829 | 8829 | } |
| 8830 | 8830 | |
| 8831 | 8831 | $sth = $this->db->prepare($query); |
| 8832 | - $sth->execute(array(':aircraft_icao' => $aircraft_icao,':offset' => $offset)); |
|
| 8832 | + $sth->execute(array(':aircraft_icao' => $aircraft_icao, ':offset' => $offset)); |
|
| 8833 | 8833 | |
| 8834 | 8834 | $hour_array = array(); |
| 8835 | 8835 | $temp_array = array(); |
| 8836 | 8836 | |
| 8837 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8837 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8838 | 8838 | { |
| 8839 | 8839 | $temp_array['hour_name'] = $row['hour_name']; |
| 8840 | 8840 | $temp_array['hour_count'] = $row['hour_count']; |
@@ -8855,7 +8855,7 @@ discard block |
||
| 8855 | 8855 | public function countAllHoursByRegistration($registration) |
| 8856 | 8856 | { |
| 8857 | 8857 | global $globalTimezone, $globalDBdriver; |
| 8858 | - $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
|
| 8858 | + $registration = filter_var($registration, FILTER_SANITIZE_STRING); |
|
| 8859 | 8859 | if ($globalTimezone != '') { |
| 8860 | 8860 | date_default_timezone_set($globalTimezone); |
| 8861 | 8861 | $datetime = new DateTime(); |
@@ -8863,13 +8863,13 @@ discard block |
||
| 8863 | 8863 | } else $offset = '+00:00'; |
| 8864 | 8864 | |
| 8865 | 8865 | if ($globalDBdriver == 'mysql') { |
| 8866 | - $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
| 8866 | + $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
| 8867 | 8867 | FROM spotter_output |
| 8868 | 8868 | WHERE spotter_output.registration = :registration |
| 8869 | 8869 | GROUP BY hour_name |
| 8870 | 8870 | ORDER BY hour_name ASC"; |
| 8871 | 8871 | } else { |
| 8872 | - $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
| 8872 | + $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
| 8873 | 8873 | FROM spotter_output |
| 8874 | 8874 | WHERE spotter_output.registration = :registration |
| 8875 | 8875 | GROUP BY hour_name |
@@ -8877,12 +8877,12 @@ discard block |
||
| 8877 | 8877 | } |
| 8878 | 8878 | |
| 8879 | 8879 | $sth = $this->db->prepare($query); |
| 8880 | - $sth->execute(array(':registration' => $registration,':offset' => $offset)); |
|
| 8880 | + $sth->execute(array(':registration' => $registration, ':offset' => $offset)); |
|
| 8881 | 8881 | |
| 8882 | 8882 | $hour_array = array(); |
| 8883 | 8883 | $temp_array = array(); |
| 8884 | 8884 | |
| 8885 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8885 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8886 | 8886 | { |
| 8887 | 8887 | $temp_array['hour_name'] = $row['hour_name']; |
| 8888 | 8888 | $temp_array['hour_count'] = $row['hour_count']; |
@@ -8903,7 +8903,7 @@ discard block |
||
| 8903 | 8903 | public function countAllHoursByAirport($airport_icao) |
| 8904 | 8904 | { |
| 8905 | 8905 | global $globalTimezone, $globalDBdriver; |
| 8906 | - $airport_icao = filter_var($airport_icao,FILTER_SANITIZE_STRING); |
|
| 8906 | + $airport_icao = filter_var($airport_icao, FILTER_SANITIZE_STRING); |
|
| 8907 | 8907 | if ($globalTimezone != '') { |
| 8908 | 8908 | date_default_timezone_set($globalTimezone); |
| 8909 | 8909 | $datetime = new DateTime(); |
@@ -8911,13 +8911,13 @@ discard block |
||
| 8911 | 8911 | } else $offset = '+00:00'; |
| 8912 | 8912 | |
| 8913 | 8913 | if ($globalDBdriver == 'mysql') { |
| 8914 | - $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
| 8914 | + $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
| 8915 | 8915 | FROM spotter_output |
| 8916 | 8916 | WHERE (spotter_output.departure_airport_icao = :airport_icao OR spotter_output.arrival_airport_icao = :airport_icao) |
| 8917 | 8917 | GROUP BY hour_name |
| 8918 | 8918 | ORDER BY hour_name ASC"; |
| 8919 | 8919 | } else { |
| 8920 | - $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
| 8920 | + $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
| 8921 | 8921 | FROM spotter_output |
| 8922 | 8922 | WHERE (spotter_output.departure_airport_icao = :airport_icao OR spotter_output.arrival_airport_icao = :airport_icao) |
| 8923 | 8923 | GROUP BY hour_name |
@@ -8925,12 +8925,12 @@ discard block |
||
| 8925 | 8925 | } |
| 8926 | 8926 | |
| 8927 | 8927 | $sth = $this->db->prepare($query); |
| 8928 | - $sth->execute(array(':airport_icao' => $airport_icao,':offset' => $offset)); |
|
| 8928 | + $sth->execute(array(':airport_icao' => $airport_icao, ':offset' => $offset)); |
|
| 8929 | 8929 | |
| 8930 | 8930 | $hour_array = array(); |
| 8931 | 8931 | $temp_array = array(); |
| 8932 | 8932 | |
| 8933 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8933 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8934 | 8934 | { |
| 8935 | 8935 | $temp_array['hour_name'] = $row['hour_name']; |
| 8936 | 8936 | $temp_array['hour_count'] = $row['hour_count']; |
@@ -8952,7 +8952,7 @@ discard block |
||
| 8952 | 8952 | public function countAllHoursByManufacturer($aircraft_manufacturer) |
| 8953 | 8953 | { |
| 8954 | 8954 | global $globalTimezone, $globalDBdriver; |
| 8955 | - $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
|
| 8955 | + $aircraft_manufacturer = filter_var($aircraft_manufacturer, FILTER_SANITIZE_STRING); |
|
| 8956 | 8956 | if ($globalTimezone != '') { |
| 8957 | 8957 | date_default_timezone_set($globalTimezone); |
| 8958 | 8958 | $datetime = new DateTime(); |
@@ -8960,13 +8960,13 @@ discard block |
||
| 8960 | 8960 | } else $offset = '+00:00'; |
| 8961 | 8961 | |
| 8962 | 8962 | if ($globalDBdriver == 'mysql') { |
| 8963 | - $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
| 8963 | + $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
| 8964 | 8964 | FROM spotter_output |
| 8965 | 8965 | WHERE spotter_output.aircraft_manufacturer = :aircraft_manufacturer |
| 8966 | 8966 | GROUP BY hour_name |
| 8967 | 8967 | ORDER BY hour_name ASC"; |
| 8968 | 8968 | } else { |
| 8969 | - $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
| 8969 | + $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
| 8970 | 8970 | FROM spotter_output |
| 8971 | 8971 | WHERE spotter_output.aircraft_manufacturer = :aircraft_manufacturer |
| 8972 | 8972 | GROUP BY hour_name |
@@ -8974,12 +8974,12 @@ discard block |
||
| 8974 | 8974 | } |
| 8975 | 8975 | |
| 8976 | 8976 | $sth = $this->db->prepare($query); |
| 8977 | - $sth->execute(array(':aircraft_manufacturer' => $aircraft_manufacturer,':offset' => $offset)); |
|
| 8977 | + $sth->execute(array(':aircraft_manufacturer' => $aircraft_manufacturer, ':offset' => $offset)); |
|
| 8978 | 8978 | |
| 8979 | 8979 | $hour_array = array(); |
| 8980 | 8980 | $temp_array = array(); |
| 8981 | 8981 | |
| 8982 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8982 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 8983 | 8983 | { |
| 8984 | 8984 | $temp_array['hour_name'] = $row['hour_name']; |
| 8985 | 8985 | $temp_array['hour_count'] = $row['hour_count']; |
@@ -9001,7 +9001,7 @@ discard block |
||
| 9001 | 9001 | public function countAllHoursByDate($date) |
| 9002 | 9002 | { |
| 9003 | 9003 | global $globalTimezone, $globalDBdriver; |
| 9004 | - $date = filter_var($date,FILTER_SANITIZE_STRING); |
|
| 9004 | + $date = filter_var($date, FILTER_SANITIZE_STRING); |
|
| 9005 | 9005 | if ($globalTimezone != '') { |
| 9006 | 9006 | date_default_timezone_set($globalTimezone); |
| 9007 | 9007 | $datetime = new DateTime($date); |
@@ -9009,13 +9009,13 @@ discard block |
||
| 9009 | 9009 | } else $offset = '+00:00'; |
| 9010 | 9010 | |
| 9011 | 9011 | if ($globalDBdriver == 'mysql') { |
| 9012 | - $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
| 9012 | + $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
| 9013 | 9013 | FROM spotter_output |
| 9014 | 9014 | WHERE DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) = :date |
| 9015 | 9015 | GROUP BY hour_name |
| 9016 | 9016 | ORDER BY hour_name ASC"; |
| 9017 | 9017 | } else { |
| 9018 | - $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
| 9018 | + $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
| 9019 | 9019 | FROM spotter_output |
| 9020 | 9020 | WHERE to_char(spotter_output.date AT TIME ZONE INTERVAL :offset, 'YYYY-mm-dd') = :date |
| 9021 | 9021 | GROUP BY hour_name |
@@ -9028,7 +9028,7 @@ discard block |
||
| 9028 | 9028 | $hour_array = array(); |
| 9029 | 9029 | $temp_array = array(); |
| 9030 | 9030 | |
| 9031 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 9031 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 9032 | 9032 | { |
| 9033 | 9033 | $temp_array['hour_name'] = $row['hour_name']; |
| 9034 | 9034 | $temp_array['hour_count'] = $row['hour_count']; |
@@ -9050,7 +9050,7 @@ discard block |
||
| 9050 | 9050 | public function countAllHoursByIdent($ident) |
| 9051 | 9051 | { |
| 9052 | 9052 | global $globalTimezone, $globalDBdriver; |
| 9053 | - $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
|
| 9053 | + $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
|
| 9054 | 9054 | if ($globalTimezone != '') { |
| 9055 | 9055 | date_default_timezone_set($globalTimezone); |
| 9056 | 9056 | $datetime = new DateTime(); |
@@ -9058,13 +9058,13 @@ discard block |
||
| 9058 | 9058 | } else $offset = '+00:00'; |
| 9059 | 9059 | |
| 9060 | 9060 | if ($globalDBdriver == 'mysql') { |
| 9061 | - $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
| 9061 | + $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
| 9062 | 9062 | FROM spotter_output |
| 9063 | 9063 | WHERE spotter_output.ident = :ident |
| 9064 | 9064 | GROUP BY hour_name |
| 9065 | 9065 | ORDER BY hour_name ASC"; |
| 9066 | 9066 | } else { |
| 9067 | - $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
| 9067 | + $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
| 9068 | 9068 | FROM spotter_output |
| 9069 | 9069 | WHERE spotter_output.ident = :ident |
| 9070 | 9070 | GROUP BY hour_name |
@@ -9073,12 +9073,12 @@ discard block |
||
| 9073 | 9073 | |
| 9074 | 9074 | |
| 9075 | 9075 | $sth = $this->db->prepare($query); |
| 9076 | - $sth->execute(array(':ident' => $ident,':offset' => $offset)); |
|
| 9076 | + $sth->execute(array(':ident' => $ident, ':offset' => $offset)); |
|
| 9077 | 9077 | |
| 9078 | 9078 | $hour_array = array(); |
| 9079 | 9079 | $temp_array = array(); |
| 9080 | 9080 | |
| 9081 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 9081 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 9082 | 9082 | { |
| 9083 | 9083 | $temp_array['hour_name'] = $row['hour_name']; |
| 9084 | 9084 | $temp_array['hour_count'] = $row['hour_count']; |
@@ -9100,8 +9100,8 @@ discard block |
||
| 9100 | 9100 | public function countAllHoursByRoute($departure_airport_icao, $arrival_airport_icao) |
| 9101 | 9101 | { |
| 9102 | 9102 | global $globalTimezone, $globalDBdriver; |
| 9103 | - $departure_airport_icao = filter_var($departure_airport_icao,FILTER_SANITIZE_STRING); |
|
| 9104 | - $arrival_airport_icao = filter_var($arrival_airport_icao,FILTER_SANITIZE_STRING); |
|
| 9103 | + $departure_airport_icao = filter_var($departure_airport_icao, FILTER_SANITIZE_STRING); |
|
| 9104 | + $arrival_airport_icao = filter_var($arrival_airport_icao, FILTER_SANITIZE_STRING); |
|
| 9105 | 9105 | if ($globalTimezone != '') { |
| 9106 | 9106 | date_default_timezone_set($globalTimezone); |
| 9107 | 9107 | $datetime = new DateTime(); |
@@ -9109,13 +9109,13 @@ discard block |
||
| 9109 | 9109 | } else $offset = '+00:00'; |
| 9110 | 9110 | |
| 9111 | 9111 | if ($globalDBdriver == 'mysql') { |
| 9112 | - $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
| 9112 | + $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
| 9113 | 9113 | FROM spotter_output |
| 9114 | 9114 | WHERE (spotter_output.departure_airport_icao = :departure_airport_icao) AND (spotter_output.arrival_airport_icao = :arrival_airport_icao) |
| 9115 | 9115 | GROUP BY hour_name |
| 9116 | 9116 | ORDER BY hour_name ASC"; |
| 9117 | 9117 | } else { |
| 9118 | - $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
| 9118 | + $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
| 9119 | 9119 | FROM spotter_output |
| 9120 | 9120 | WHERE (spotter_output.departure_airport_icao = :departure_airport_icao) AND (spotter_output.arrival_airport_icao = :arrival_airport_icao) |
| 9121 | 9121 | GROUP BY hour_name |
@@ -9123,12 +9123,12 @@ discard block |
||
| 9123 | 9123 | } |
| 9124 | 9124 | |
| 9125 | 9125 | $sth = $this->db->prepare($query); |
| 9126 | - $sth->execute(array(':departure_airport_icao' => $departure_airport_icao,':arrival_airport_icao' => $arrival_airport_icao,':offset' => $offset)); |
|
| 9126 | + $sth->execute(array(':departure_airport_icao' => $departure_airport_icao, ':arrival_airport_icao' => $arrival_airport_icao, ':offset' => $offset)); |
|
| 9127 | 9127 | |
| 9128 | 9128 | $hour_array = array(); |
| 9129 | 9129 | $temp_array = array(); |
| 9130 | 9130 | |
| 9131 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 9131 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 9132 | 9132 | { |
| 9133 | 9133 | $temp_array['hour_name'] = $row['hour_name']; |
| 9134 | 9134 | $temp_array['hour_count'] = $row['hour_count']; |
@@ -9149,7 +9149,7 @@ discard block |
||
| 9149 | 9149 | public function countAllHoursByCountry($country) |
| 9150 | 9150 | { |
| 9151 | 9151 | global $globalTimezone, $globalDBdriver; |
| 9152 | - $country = filter_var($country,FILTER_SANITIZE_STRING); |
|
| 9152 | + $country = filter_var($country, FILTER_SANITIZE_STRING); |
|
| 9153 | 9153 | if ($globalTimezone != '') { |
| 9154 | 9154 | date_default_timezone_set($globalTimezone); |
| 9155 | 9155 | $datetime = new DateTime(); |
@@ -9157,13 +9157,13 @@ discard block |
||
| 9157 | 9157 | } else $offset = '+00:00'; |
| 9158 | 9158 | |
| 9159 | 9159 | if ($globalDBdriver == 'mysql') { |
| 9160 | - $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
| 9160 | + $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
| 9161 | 9161 | FROM spotter_output |
| 9162 | 9162 | WHERE ((spotter_output.departure_airport_country = :country) OR (spotter_output.arrival_airport_country = :country)) OR spotter_output.airline_country = :country |
| 9163 | 9163 | GROUP BY hour_name |
| 9164 | 9164 | ORDER BY hour_name ASC"; |
| 9165 | 9165 | } else { |
| 9166 | - $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
| 9166 | + $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
| 9167 | 9167 | FROM spotter_output |
| 9168 | 9168 | WHERE ((spotter_output.departure_airport_country = :country) OR (spotter_output.arrival_airport_country = :country)) OR spotter_output.airline_country = :country |
| 9169 | 9169 | GROUP BY hour_name |
@@ -9171,12 +9171,12 @@ discard block |
||
| 9171 | 9171 | } |
| 9172 | 9172 | |
| 9173 | 9173 | $sth = $this->db->prepare($query); |
| 9174 | - $sth->execute(array(':country' => $country,':offset' => $offset)); |
|
| 9174 | + $sth->execute(array(':country' => $country, ':offset' => $offset)); |
|
| 9175 | 9175 | |
| 9176 | 9176 | $hour_array = array(); |
| 9177 | 9177 | $temp_array = array(); |
| 9178 | 9178 | |
| 9179 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 9179 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 9180 | 9180 | { |
| 9181 | 9181 | $temp_array['hour_name'] = $row['hour_name']; |
| 9182 | 9182 | $temp_array['hour_count'] = $row['hour_count']; |
@@ -9198,8 +9198,8 @@ discard block |
||
| 9198 | 9198 | */ |
| 9199 | 9199 | public function countOverallAircrafts($filters = array()) |
| 9200 | 9200 | { |
| 9201 | - $filter_query = $this->getFilter($filters,true,true); |
|
| 9202 | - $query = "SELECT COUNT(DISTINCT spotter_output.aircraft_icao) AS aircraft_count |
|
| 9201 | + $filter_query = $this->getFilter($filters, true, true); |
|
| 9202 | + $query = "SELECT COUNT(DISTINCT spotter_output.aircraft_icao) AS aircraft_count |
|
| 9203 | 9203 | FROM spotter_output".$filter_query." spotter_output.ident <> ''"; |
| 9204 | 9204 | $sth = $this->db->prepare($query); |
| 9205 | 9205 | $sth->execute(); |
@@ -9214,8 +9214,8 @@ discard block |
||
| 9214 | 9214 | */ |
| 9215 | 9215 | public function countOverallArrival($filters = array()) |
| 9216 | 9216 | { |
| 9217 | - $filter_query = $this->getFilter($filters,true,true); |
|
| 9218 | - $query = "SELECT COUNT(spotter_output.real_arrival_airport_icao) AS arrival_count |
|
| 9217 | + $filter_query = $this->getFilter($filters, true, true); |
|
| 9218 | + $query = "SELECT COUNT(spotter_output.real_arrival_airport_icao) AS arrival_count |
|
| 9219 | 9219 | FROM spotter_output".$filter_query." spotter_output.arrival_airport_icao <> ''"; |
| 9220 | 9220 | |
| 9221 | 9221 | $sth = $this->db->prepare($query); |
@@ -9231,8 +9231,8 @@ discard block |
||
| 9231 | 9231 | */ |
| 9232 | 9232 | public function countOverallPilots($filters = array()) |
| 9233 | 9233 | { |
| 9234 | - $filter_query = $this->getFilter($filters,true,true); |
|
| 9235 | - $query = "SELECT COUNT(DISTINCT spotter_output.pilot_id) AS pilot_count |
|
| 9234 | + $filter_query = $this->getFilter($filters, true, true); |
|
| 9235 | + $query = "SELECT COUNT(DISTINCT spotter_output.pilot_id) AS pilot_count |
|
| 9236 | 9236 | FROM spotter_output".$filter_query." spotter_output.pilot_id <> ''"; |
| 9237 | 9237 | $sth = $this->db->prepare($query); |
| 9238 | 9238 | $sth->execute(); |
@@ -9247,8 +9247,8 @@ discard block |
||
| 9247 | 9247 | */ |
| 9248 | 9248 | public function countOverallOwners($filters = array()) |
| 9249 | 9249 | { |
| 9250 | - $filter_query = $this->getFilter($filters,true,true); |
|
| 9251 | - $query = "SELECT COUNT(DISTINCT spotter_output.owner_name) AS owner_count |
|
| 9250 | + $filter_query = $this->getFilter($filters, true, true); |
|
| 9251 | + $query = "SELECT COUNT(DISTINCT spotter_output.owner_name) AS owner_count |
|
| 9252 | 9252 | FROM spotter_output".$filter_query." spotter_output.owner_name <> ''"; |
| 9253 | 9253 | $sth = $this->db->prepare($query); |
| 9254 | 9254 | $sth->execute(); |
@@ -9281,8 +9281,8 @@ discard block |
||
| 9281 | 9281 | */ |
| 9282 | 9282 | public function countOverallMilitaryFlights($filters = array()) |
| 9283 | 9283 | { |
| 9284 | - $filter_query = $this->getFilter($filters,true,true); |
|
| 9285 | - $query = "SELECT COUNT(s.spotter_id) AS flight_count |
|
| 9284 | + $filter_query = $this->getFilter($filters, true, true); |
|
| 9285 | + $query = "SELECT COUNT(s.spotter_id) AS flight_count |
|
| 9286 | 9286 | FROM spotter_output s, airlines a".$filter_query." s.airline_icao = a.icao AND a.type = 'military'"; |
| 9287 | 9287 | |
| 9288 | 9288 | $sth = $this->db->prepare($query); |
@@ -9326,13 +9326,13 @@ discard block |
||
| 9326 | 9326 | } else $offset = '+00:00'; |
| 9327 | 9327 | |
| 9328 | 9328 | if ($globalDBdriver == 'mysql') { |
| 9329 | - $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
| 9329 | + $query = "SELECT HOUR(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count |
|
| 9330 | 9330 | FROM spotter_output |
| 9331 | 9331 | WHERE DATE(CONVERT_TZ(spotter_output.date,'+00:00', :offset)) = CURDATE() |
| 9332 | 9332 | GROUP BY hour_name |
| 9333 | 9333 | ORDER BY hour_name ASC"; |
| 9334 | 9334 | } else { |
| 9335 | - $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
| 9335 | + $query = "SELECT EXTRACT(HOUR FROM spotter_output.date AT TIME ZONE INTERVAL :offset) AS hour_name, count(*) as hour_count |
|
| 9336 | 9336 | FROM spotter_output |
| 9337 | 9337 | WHERE to_char(spotter_output.date AT TIME ZONE INTERVAL :offset,'YYYY-mm-dd') = CAST(NOW() AS date) |
| 9338 | 9338 | GROUP BY hour_name |
@@ -9345,7 +9345,7 @@ discard block |
||
| 9345 | 9345 | $hour_array = array(); |
| 9346 | 9346 | $temp_array = array(); |
| 9347 | 9347 | |
| 9348 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 9348 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 9349 | 9349 | { |
| 9350 | 9350 | $temp_array['hour_name'] = $row['hour_name']; |
| 9351 | 9351 | $temp_array['hour_count'] = $row['hour_count']; |
@@ -9369,8 +9369,8 @@ discard block |
||
| 9369 | 9369 | if ($limit != "") |
| 9370 | 9370 | { |
| 9371 | 9371 | $limit_array = explode(",", $limit); |
| 9372 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
| 9373 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
| 9372 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
| 9373 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
| 9374 | 9374 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
| 9375 | 9375 | { |
| 9376 | 9376 | //$limit_query = " LIMIT ".$limit_array[0].",".$limit_array[1]; |
@@ -9425,7 +9425,7 @@ discard block |
||
| 9425 | 9425 | GROUP BY spotter_output.ident,spotter_output.airline_name,spotter_output.airline_icao,spotter_output.airline_country,spotter_output.airline_type,spotter_output.departure_airport_icao,spotter_output.departure_airport_name,spotter_output.departure_airport_city,spotter_output.departure_airport_country,spotter_output.departure_airport_time,spotter_output.arrival_airport_icao,spotter_output.arrival_airport_name,spotter_output.arrival_airport_city,spotter_output.arrival_airport_country,spotter_output.arrival_airport_time, to_char(spotter_output.date,'HH') |
| 9426 | 9426 | HAVING count(spotter_output.ident) > 5$orderby_query"; |
| 9427 | 9427 | //echo $query; |
| 9428 | - $spotter_array = $this->getDataFromDB($query.$limit_query,array(':timezone' => $globalTimezone)); |
|
| 9428 | + $spotter_array = $this->getDataFromDB($query.$limit_query, array(':timezone' => $globalTimezone)); |
|
| 9429 | 9429 | /* |
| 9430 | 9430 | $sth = $this->db->prepare($query); |
| 9431 | 9431 | $sth->execute(array(':timezone' => $globalTimezone)); |
@@ -9444,9 +9444,9 @@ discard block |
||
| 9444 | 9444 | */ |
| 9445 | 9445 | public function getSpotterIDBasedOnFlightAwareID($flightaware_id) |
| 9446 | 9446 | { |
| 9447 | - $flightaware_id = filter_var($flightaware_id,FILTER_SANITIZE_STRING); |
|
| 9447 | + $flightaware_id = filter_var($flightaware_id, FILTER_SANITIZE_STRING); |
|
| 9448 | 9448 | |
| 9449 | - $query = "SELECT spotter_output.spotter_id |
|
| 9449 | + $query = "SELECT spotter_output.spotter_id |
|
| 9450 | 9450 | FROM spotter_output |
| 9451 | 9451 | WHERE spotter_output.flightaware_id = '".$flightaware_id."'"; |
| 9452 | 9452 | |
@@ -9454,7 +9454,7 @@ discard block |
||
| 9454 | 9454 | $sth = $this->db->prepare($query); |
| 9455 | 9455 | $sth->execute(); |
| 9456 | 9456 | |
| 9457 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 9457 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 9458 | 9458 | { |
| 9459 | 9459 | return $row['spotter_id']; |
| 9460 | 9460 | } |
@@ -9479,23 +9479,23 @@ discard block |
||
| 9479 | 9479 | } |
| 9480 | 9480 | |
| 9481 | 9481 | $current_date = date("Y-m-d H:i:s"); |
| 9482 | - $date = date("Y-m-d H:i:s",strtotime($dateString." UTC")); |
|
| 9482 | + $date = date("Y-m-d H:i:s", strtotime($dateString." UTC")); |
|
| 9483 | 9483 | |
| 9484 | 9484 | $diff = abs(strtotime($current_date) - strtotime($date)); |
| 9485 | 9485 | |
| 9486 | - $time_array['years'] = floor($diff / (365*60*60*24)); |
|
| 9486 | + $time_array['years'] = floor($diff/(365*60*60*24)); |
|
| 9487 | 9487 | $years = $time_array['years']; |
| 9488 | 9488 | |
| 9489 | - $time_array['months'] = floor(($diff - $years * 365*60*60*24) / (30*60*60*24)); |
|
| 9489 | + $time_array['months'] = floor(($diff - $years*365*60*60*24)/(30*60*60*24)); |
|
| 9490 | 9490 | $months = $time_array['months']; |
| 9491 | 9491 | |
| 9492 | - $time_array['days'] = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24)/ (60*60*24)); |
|
| 9492 | + $time_array['days'] = floor(($diff - $years*365*60*60*24 - $months*30*60*60*24)/(60*60*24)); |
|
| 9493 | 9493 | $days = $time_array['days']; |
| 9494 | - $time_array['hours'] = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24 - $days*60*60*24)/ (60*60)); |
|
| 9494 | + $time_array['hours'] = floor(($diff - $years*365*60*60*24 - $months*30*60*60*24 - $days*60*60*24)/(60*60)); |
|
| 9495 | 9495 | $hours = $time_array['hours']; |
| 9496 | - $time_array['minutes'] = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24 - $days*60*60*24 - $hours*60*60)/ 60); |
|
| 9496 | + $time_array['minutes'] = floor(($diff - $years*365*60*60*24 - $months*30*60*60*24 - $days*60*60*24 - $hours*60*60)/60); |
|
| 9497 | 9497 | $minutes = $time_array['minutes']; |
| 9498 | - $time_array['seconds'] = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24 - $days*60*60*24 - $hours*60*60 - $minutes*60)); |
|
| 9498 | + $time_array['seconds'] = floor(($diff - $years*365*60*60*24 - $months*30*60*60*24 - $days*60*60*24 - $hours*60*60 - $minutes*60)); |
|
| 9499 | 9499 | |
| 9500 | 9500 | return $time_array; |
| 9501 | 9501 | } |
@@ -9521,63 +9521,63 @@ discard block |
||
| 9521 | 9521 | $temp_array['direction_degree'] = $direction; |
| 9522 | 9522 | $temp_array['direction_shortname'] = "N"; |
| 9523 | 9523 | $temp_array['direction_fullname'] = "North"; |
| 9524 | - } elseif ($direction >= 22.5 && $direction < 45){ |
|
| 9524 | + } elseif ($direction >= 22.5 && $direction < 45) { |
|
| 9525 | 9525 | $temp_array['direction_degree'] = $direction; |
| 9526 | 9526 | $temp_array['direction_shortname'] = "NNE"; |
| 9527 | 9527 | $temp_array['direction_fullname'] = "North-Northeast"; |
| 9528 | - } elseif ($direction >= 45 && $direction < 67.5){ |
|
| 9528 | + } elseif ($direction >= 45 && $direction < 67.5) { |
|
| 9529 | 9529 | $temp_array['direction_degree'] = $direction; |
| 9530 | 9530 | $temp_array['direction_shortname'] = "NE"; |
| 9531 | 9531 | $temp_array['direction_fullname'] = "Northeast"; |
| 9532 | - } elseif ($direction >= 67.5 && $direction < 90){ |
|
| 9532 | + } elseif ($direction >= 67.5 && $direction < 90) { |
|
| 9533 | 9533 | $temp_array['direction_degree'] = $direction; |
| 9534 | 9534 | $temp_array['direction_shortname'] = "ENE"; |
| 9535 | 9535 | $temp_array['direction_fullname'] = "East-Northeast"; |
| 9536 | - } elseif ($direction >= 90 && $direction < 112.5){ |
|
| 9536 | + } elseif ($direction >= 90 && $direction < 112.5) { |
|
| 9537 | 9537 | $temp_array['direction_degree'] = $direction; |
| 9538 | 9538 | $temp_array['direction_shortname'] = "E"; |
| 9539 | 9539 | $temp_array['direction_fullname'] = "East"; |
| 9540 | - } elseif ($direction >= 112.5 && $direction < 135){ |
|
| 9540 | + } elseif ($direction >= 112.5 && $direction < 135) { |
|
| 9541 | 9541 | $temp_array['direction_degree'] = $direction; |
| 9542 | 9542 | $temp_array['direction_shortname'] = "ESE"; |
| 9543 | 9543 | $temp_array['direction_fullname'] = "East-Southeast"; |
| 9544 | - } elseif ($direction >= 135 && $direction < 157.5){ |
|
| 9544 | + } elseif ($direction >= 135 && $direction < 157.5) { |
|
| 9545 | 9545 | $temp_array['direction_degree'] = $direction; |
| 9546 | 9546 | $temp_array['direction_shortname'] = "SE"; |
| 9547 | 9547 | $temp_array['direction_fullname'] = "Southeast"; |
| 9548 | - } elseif ($direction >= 157.5 && $direction < 180){ |
|
| 9548 | + } elseif ($direction >= 157.5 && $direction < 180) { |
|
| 9549 | 9549 | $temp_array['direction_degree'] = $direction; |
| 9550 | 9550 | $temp_array['direction_shortname'] = "SSE"; |
| 9551 | 9551 | $temp_array['direction_fullname'] = "South-Southeast"; |
| 9552 | - } elseif ($direction >= 180 && $direction < 202.5){ |
|
| 9552 | + } elseif ($direction >= 180 && $direction < 202.5) { |
|
| 9553 | 9553 | $temp_array['direction_degree'] = $direction; |
| 9554 | 9554 | $temp_array['direction_shortname'] = "S"; |
| 9555 | 9555 | $temp_array['direction_fullname'] = "South"; |
| 9556 | - } elseif ($direction >= 202.5 && $direction < 225){ |
|
| 9556 | + } elseif ($direction >= 202.5 && $direction < 225) { |
|
| 9557 | 9557 | $temp_array['direction_degree'] = $direction; |
| 9558 | 9558 | $temp_array['direction_shortname'] = "SSW"; |
| 9559 | 9559 | $temp_array['direction_fullname'] = "South-Southwest"; |
| 9560 | - } elseif ($direction >= 225 && $direction < 247.5){ |
|
| 9560 | + } elseif ($direction >= 225 && $direction < 247.5) { |
|
| 9561 | 9561 | $temp_array['direction_degree'] = $direction; |
| 9562 | 9562 | $temp_array['direction_shortname'] = "SW"; |
| 9563 | 9563 | $temp_array['direction_fullname'] = "Southwest"; |
| 9564 | - } elseif ($direction >= 247.5 && $direction < 270){ |
|
| 9564 | + } elseif ($direction >= 247.5 && $direction < 270) { |
|
| 9565 | 9565 | $temp_array['direction_degree'] = $direction; |
| 9566 | 9566 | $temp_array['direction_shortname'] = "WSW"; |
| 9567 | 9567 | $temp_array['direction_fullname'] = "West-Southwest"; |
| 9568 | - } elseif ($direction >= 270 && $direction < 292.5){ |
|
| 9568 | + } elseif ($direction >= 270 && $direction < 292.5) { |
|
| 9569 | 9569 | $temp_array['direction_degree'] = $direction; |
| 9570 | 9570 | $temp_array['direction_shortname'] = "W"; |
| 9571 | 9571 | $temp_array['direction_fullname'] = "West"; |
| 9572 | - } elseif ($direction >= 292.5 && $direction < 315){ |
|
| 9572 | + } elseif ($direction >= 292.5 && $direction < 315) { |
|
| 9573 | 9573 | $temp_array['direction_degree'] = $direction; |
| 9574 | 9574 | $temp_array['direction_shortname'] = "WNW"; |
| 9575 | 9575 | $temp_array['direction_fullname'] = "West-Northwest"; |
| 9576 | - } elseif ($direction >= 315 && $direction < 337.5){ |
|
| 9576 | + } elseif ($direction >= 315 && $direction < 337.5) { |
|
| 9577 | 9577 | $temp_array['direction_degree'] = $direction; |
| 9578 | 9578 | $temp_array['direction_shortname'] = "NW"; |
| 9579 | 9579 | $temp_array['direction_fullname'] = "Northwest"; |
| 9580 | - } elseif ($direction >= 337.5 && $direction < 360){ |
|
| 9580 | + } elseif ($direction >= 337.5 && $direction < 360) { |
|
| 9581 | 9581 | $temp_array['direction_degree'] = $direction; |
| 9582 | 9582 | $temp_array['direction_shortname'] = "NNW"; |
| 9583 | 9583 | $temp_array['direction_fullname'] = "North-Northwest"; |
@@ -9630,9 +9630,9 @@ discard block |
||
| 9630 | 9630 | */ |
| 9631 | 9631 | public function getAircraftRegistrationBymodeS($aircraft_modes) |
| 9632 | 9632 | { |
| 9633 | - $aircraft_modes = filter_var($aircraft_modes,FILTER_SANITIZE_STRING); |
|
| 9633 | + $aircraft_modes = filter_var($aircraft_modes, FILTER_SANITIZE_STRING); |
|
| 9634 | 9634 | |
| 9635 | - $query = "SELECT aircraft_modes.Registration FROM aircraft_modes WHERE aircraft_modes.ModeS = :aircraft_modes LIMIT 1"; |
|
| 9635 | + $query = "SELECT aircraft_modes.Registration FROM aircraft_modes WHERE aircraft_modes.ModeS = :aircraft_modes LIMIT 1"; |
|
| 9636 | 9636 | |
| 9637 | 9637 | $sth = $this->db->prepare($query); |
| 9638 | 9638 | $sth->execute(array(':aircraft_modes' => $aircraft_modes)); |
@@ -9654,9 +9654,9 @@ discard block |
||
| 9654 | 9654 | */ |
| 9655 | 9655 | public function getAircraftTypeBymodeS($aircraft_modes) |
| 9656 | 9656 | { |
| 9657 | - $aircraft_modes = filter_var($aircraft_modes,FILTER_SANITIZE_STRING); |
|
| 9657 | + $aircraft_modes = filter_var($aircraft_modes, FILTER_SANITIZE_STRING); |
|
| 9658 | 9658 | |
| 9659 | - $query = "SELECT aircraft_modes.type_flight FROM aircraft_modes WHERE aircraft_modes.ModeS = :aircraft_modes LIMIT 1"; |
|
| 9659 | + $query = "SELECT aircraft_modes.type_flight FROM aircraft_modes WHERE aircraft_modes.ModeS = :aircraft_modes LIMIT 1"; |
|
| 9660 | 9660 | |
| 9661 | 9661 | $sth = $this->db->prepare($query); |
| 9662 | 9662 | $sth->execute(array(':aircraft_modes' => $aircraft_modes)); |
@@ -9676,11 +9676,11 @@ discard block |
||
| 9676 | 9676 | * @param Float $longitude longitute of the flight |
| 9677 | 9677 | * @return String the countrie |
| 9678 | 9678 | */ |
| 9679 | - public function getCountryFromLatitudeLongitude($latitude,$longitude) |
|
| 9679 | + public function getCountryFromLatitudeLongitude($latitude, $longitude) |
|
| 9680 | 9680 | { |
| 9681 | 9681 | global $globalDBdriver, $globalDebug; |
| 9682 | - $latitude = filter_var($latitude,FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 9683 | - $longitude = filter_var($longitude,FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
| 9682 | + $latitude = filter_var($latitude, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 9683 | + $longitude = filter_var($longitude, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
| 9684 | 9684 | |
| 9685 | 9685 | $Connection = new Connection($this->db); |
| 9686 | 9686 | if (!$Connection->tableExists('countries')) return ''; |
@@ -9719,19 +9719,19 @@ discard block |
||
| 9719 | 9719 | */ |
| 9720 | 9720 | public function convertAircraftRegistration($registration) |
| 9721 | 9721 | { |
| 9722 | - $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
|
| 9722 | + $registration = filter_var($registration, FILTER_SANITIZE_STRING); |
|
| 9723 | 9723 | $registration_prefix = ''; |
| 9724 | 9724 | $registration_1 = substr($registration, 0, 1); |
| 9725 | 9725 | $registration_2 = substr($registration, 0, 2); |
| 9726 | 9726 | |
| 9727 | 9727 | //first get the prefix based on two characters |
| 9728 | - $query = "SELECT aircraft_registration.registration_prefix FROM aircraft_registration WHERE registration_prefix = :registration_2"; |
|
| 9728 | + $query = "SELECT aircraft_registration.registration_prefix FROM aircraft_registration WHERE registration_prefix = :registration_2"; |
|
| 9729 | 9729 | |
| 9730 | 9730 | |
| 9731 | 9731 | $sth = $this->db->prepare($query); |
| 9732 | 9732 | $sth->execute(array(':registration_2' => $registration_2)); |
| 9733 | 9733 | |
| 9734 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 9734 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 9735 | 9735 | { |
| 9736 | 9736 | $registration_prefix = $row['registration_prefix']; |
| 9737 | 9737 | } |
@@ -9739,11 +9739,11 @@ discard block |
||
| 9739 | 9739 | //if we didn't find a two chracter prefix lets just search the one with one character |
| 9740 | 9740 | if ($registration_prefix == '') |
| 9741 | 9741 | { |
| 9742 | - $query = "SELECT aircraft_registration.registration_prefix FROM aircraft_registration WHERE registration_prefix = :registration_1"; |
|
| 9742 | + $query = "SELECT aircraft_registration.registration_prefix FROM aircraft_registration WHERE registration_prefix = :registration_1"; |
|
| 9743 | 9743 | $sth = $this->db->prepare($query); |
| 9744 | 9744 | $sth->execute(array(':registration_1' => $registration_1)); |
| 9745 | 9745 | |
| 9746 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 9746 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 9747 | 9747 | { |
| 9748 | 9748 | $registration_prefix = $row['registration_prefix']; |
| 9749 | 9749 | } |
@@ -9757,7 +9757,7 @@ discard block |
||
| 9757 | 9757 | } else { |
| 9758 | 9758 | $registration = preg_replace("/^(.{1})/", "$1-", $registration); |
| 9759 | 9759 | } |
| 9760 | - } else if(strlen($registration_prefix) == 2){ |
|
| 9760 | + } else if (strlen($registration_prefix) == 2) { |
|
| 9761 | 9761 | if (0 === strpos($registration, 'N')) { |
| 9762 | 9762 | $registration = preg_replace("/^(.{2})/", "$1", $registration); |
| 9763 | 9763 | } else { |
@@ -9776,17 +9776,17 @@ discard block |
||
| 9776 | 9776 | */ |
| 9777 | 9777 | public function countryFromAircraftRegistration($registration) |
| 9778 | 9778 | { |
| 9779 | - $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
|
| 9779 | + $registration = filter_var($registration, FILTER_SANITIZE_STRING); |
|
| 9780 | 9780 | |
| 9781 | 9781 | $registration_prefix = ''; |
| 9782 | - $registration_test = explode('-',$registration); |
|
| 9782 | + $registration_test = explode('-', $registration); |
|
| 9783 | 9783 | $country = ''; |
| 9784 | 9784 | if ($registration_test[0] != $registration) { |
| 9785 | 9785 | $query = "SELECT aircraft_registration.registration_prefix, aircraft_registration.country FROM aircraft_registration WHERE registration_prefix = :registration_1 LIMIT 1"; |
| 9786 | 9786 | |
| 9787 | 9787 | $sth = $this->db->prepare($query); |
| 9788 | 9788 | $sth->execute(array(':registration_1' => $registration_test[0])); |
| 9789 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 9789 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 9790 | 9790 | { |
| 9791 | 9791 | //$registration_prefix = $row['registration_prefix']; |
| 9792 | 9792 | $country = $row['country']; |
@@ -9797,13 +9797,13 @@ discard block |
||
| 9797 | 9797 | |
| 9798 | 9798 | $country = ''; |
| 9799 | 9799 | //first get the prefix based on two characters |
| 9800 | - $query = "SELECT aircraft_registration.registration_prefix, aircraft_registration.country FROM aircraft_registration WHERE registration_prefix = :registration_2 LIMIT 1"; |
|
| 9800 | + $query = "SELECT aircraft_registration.registration_prefix, aircraft_registration.country FROM aircraft_registration WHERE registration_prefix = :registration_2 LIMIT 1"; |
|
| 9801 | 9801 | |
| 9802 | 9802 | |
| 9803 | 9803 | $sth = $this->db->prepare($query); |
| 9804 | 9804 | $sth->execute(array(':registration_2' => $registration_2)); |
| 9805 | 9805 | |
| 9806 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 9806 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 9807 | 9807 | { |
| 9808 | 9808 | $registration_prefix = $row['registration_prefix']; |
| 9809 | 9809 | $country = $row['country']; |
@@ -9812,12 +9812,12 @@ discard block |
||
| 9812 | 9812 | //if we didn't find a two chracter prefix lets just search the one with one character |
| 9813 | 9813 | if ($registration_prefix == "") |
| 9814 | 9814 | { |
| 9815 | - $query = "SELECT aircraft_registration.registration_prefix, aircraft_registration.country FROM aircraft_registration WHERE registration_prefix = :registration_1 LIMIT 1"; |
|
| 9815 | + $query = "SELECT aircraft_registration.registration_prefix, aircraft_registration.country FROM aircraft_registration WHERE registration_prefix = :registration_1 LIMIT 1"; |
|
| 9816 | 9816 | |
| 9817 | 9817 | $sth = $this->db->prepare($query); |
| 9818 | 9818 | $sth->execute(array(':registration_1' => $registration_1)); |
| 9819 | 9819 | |
| 9820 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 9820 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 9821 | 9821 | { |
| 9822 | 9822 | //$registration_prefix = $row['registration_prefix']; |
| 9823 | 9823 | $country = $row['country']; |
@@ -9834,9 +9834,9 @@ discard block |
||
| 9834 | 9834 | * @param String $flightaware_id flightaware_id from spotter_output table |
| 9835 | 9835 | * @param String $highlight New highlight value |
| 9836 | 9836 | */ |
| 9837 | - public function setHighlightFlight($flightaware_id,$highlight) { |
|
| 9837 | + public function setHighlightFlight($flightaware_id, $highlight) { |
|
| 9838 | 9838 | |
| 9839 | - $query = "UPDATE spotter_output SET highlight = :highlight WHERE flightaware_id = :flightaware_id"; |
|
| 9839 | + $query = "UPDATE spotter_output SET highlight = :highlight WHERE flightaware_id = :flightaware_id"; |
|
| 9840 | 9840 | $sth = $this->db->prepare($query); |
| 9841 | 9841 | $sth->execute(array(':flightaware_id' => $flightaware_id, ':highlight' => $highlight)); |
| 9842 | 9842 | } |
@@ -9865,7 +9865,7 @@ discard block |
||
| 9865 | 9865 | |
| 9866 | 9866 | $bitly_data = json_decode($bitly_data); |
| 9867 | 9867 | $bitly_url = ''; |
| 9868 | - if ($bitly_data->status_txt = "OK"){ |
|
| 9868 | + if ($bitly_data->status_txt = "OK") { |
|
| 9869 | 9869 | $bitly_url = $bitly_data->data->url; |
| 9870 | 9870 | } |
| 9871 | 9871 | |
@@ -9875,7 +9875,7 @@ discard block |
||
| 9875 | 9875 | |
| 9876 | 9876 | public function getOrderBy() |
| 9877 | 9877 | { |
| 9878 | - $orderby = array("aircraft_asc" => array("key" => "aircraft_asc", "value" => "Aircraft Type - ASC", "sql" => "ORDER BY spotter_output.aircraft_icao ASC"), "aircraft_desc" => array("key" => "aircraft_desc", "value" => "Aircraft Type - DESC", "sql" => "ORDER BY spotter_output.aircraft_icao DESC"),"manufacturer_asc" => array("key" => "manufacturer_asc", "value" => "Aircraft Manufacturer - ASC", "sql" => "ORDER BY spotter_output.aircraft_manufacturer ASC"), "manufacturer_desc" => array("key" => "manufacturer_desc", "value" => "Aircraft Manufacturer - DESC", "sql" => "ORDER BY spotter_output.aircraft_manufacturer DESC"),"airline_name_asc" => array("key" => "airline_name_asc", "value" => "Airline Name - ASC", "sql" => "ORDER BY spotter_output.airline_name ASC"), "airline_name_desc" => array("key" => "airline_name_desc", "value" => "Airline Name - DESC", "sql" => "ORDER BY spotter_output.airline_name DESC"), "ident_asc" => array("key" => "ident_asc", "value" => "Ident - ASC", "sql" => "ORDER BY spotter_output.ident ASC"), "ident_desc" => array("key" => "ident_desc", "value" => "Ident - DESC", "sql" => "ORDER BY spotter_output.ident DESC"), "airport_departure_asc" => array("key" => "airport_departure_asc", "value" => "Departure Airport - ASC", "sql" => "ORDER BY spotter_output.departure_airport_city ASC"), "airport_departure_desc" => array("key" => "airport_departure_desc", "value" => "Departure Airport - DESC", "sql" => "ORDER BY spotter_output.departure_airport_city DESC"), "airport_arrival_asc" => array("key" => "airport_arrival_asc", "value" => "Arrival Airport - ASC", "sql" => "ORDER BY spotter_output.arrival_airport_city ASC"), "airport_arrival_desc" => array("key" => "airport_arrival_desc", "value" => "Arrival Airport - DESC", "sql" => "ORDER BY spotter_output.arrival_airport_city DESC"), "date_asc" => array("key" => "date_asc", "value" => "Date - ASC", "sql" => "ORDER BY spotter_output.date ASC"), "date_desc" => array("key" => "date_desc", "value" => "Date - DESC", "sql" => "ORDER BY spotter_output.date DESC"),"distance_asc" => array("key" => "distance_asc","value" => "Distance - ASC","sql" => "ORDER BY distance ASC"),"distance_desc" => array("key" => "distance_desc","value" => "Distance - DESC","sql" => "ORDER BY distance DESC")); |
|
| 9878 | + $orderby = array("aircraft_asc" => array("key" => "aircraft_asc", "value" => "Aircraft Type - ASC", "sql" => "ORDER BY spotter_output.aircraft_icao ASC"), "aircraft_desc" => array("key" => "aircraft_desc", "value" => "Aircraft Type - DESC", "sql" => "ORDER BY spotter_output.aircraft_icao DESC"), "manufacturer_asc" => array("key" => "manufacturer_asc", "value" => "Aircraft Manufacturer - ASC", "sql" => "ORDER BY spotter_output.aircraft_manufacturer ASC"), "manufacturer_desc" => array("key" => "manufacturer_desc", "value" => "Aircraft Manufacturer - DESC", "sql" => "ORDER BY spotter_output.aircraft_manufacturer DESC"), "airline_name_asc" => array("key" => "airline_name_asc", "value" => "Airline Name - ASC", "sql" => "ORDER BY spotter_output.airline_name ASC"), "airline_name_desc" => array("key" => "airline_name_desc", "value" => "Airline Name - DESC", "sql" => "ORDER BY spotter_output.airline_name DESC"), "ident_asc" => array("key" => "ident_asc", "value" => "Ident - ASC", "sql" => "ORDER BY spotter_output.ident ASC"), "ident_desc" => array("key" => "ident_desc", "value" => "Ident - DESC", "sql" => "ORDER BY spotter_output.ident DESC"), "airport_departure_asc" => array("key" => "airport_departure_asc", "value" => "Departure Airport - ASC", "sql" => "ORDER BY spotter_output.departure_airport_city ASC"), "airport_departure_desc" => array("key" => "airport_departure_desc", "value" => "Departure Airport - DESC", "sql" => "ORDER BY spotter_output.departure_airport_city DESC"), "airport_arrival_asc" => array("key" => "airport_arrival_asc", "value" => "Arrival Airport - ASC", "sql" => "ORDER BY spotter_output.arrival_airport_city ASC"), "airport_arrival_desc" => array("key" => "airport_arrival_desc", "value" => "Arrival Airport - DESC", "sql" => "ORDER BY spotter_output.arrival_airport_city DESC"), "date_asc" => array("key" => "date_asc", "value" => "Date - ASC", "sql" => "ORDER BY spotter_output.date ASC"), "date_desc" => array("key" => "date_desc", "value" => "Date - DESC", "sql" => "ORDER BY spotter_output.date DESC"), "distance_asc" => array("key" => "distance_asc", "value" => "Distance - ASC", "sql" => "ORDER BY distance ASC"), "distance_desc" => array("key" => "distance_desc", "value" => "Distance - DESC", "sql" => "ORDER BY distance DESC")); |
|
| 9879 | 9879 | |
| 9880 | 9880 | return $orderby; |
| 9881 | 9881 | |
@@ -10009,14 +10009,14 @@ discard block |
||
| 10009 | 10009 | } |
| 10010 | 10010 | $sth = $this->db->prepare($query); |
| 10011 | 10011 | $sth->execute(); |
| 10012 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 10012 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 10013 | 10013 | { |
| 10014 | 10014 | $departure_airport_array = $this->getAllAirportInfo($row['fromairport_icao']); |
| 10015 | 10015 | $arrival_airport_array = $this->getAllAirportInfo($row['toairport_icao']); |
| 10016 | 10016 | if (count($departure_airport_array) > 0 && count($arrival_airport_array) > 0) { |
| 10017 | - $update_query="UPDATE spotter_output SET departure_airport_icao = :fromicao, arrival_airport_icao = :toicao, departure_airport_name = :departure_airport_name, departure_airport_city = :departure_airport_city, departure_airport_country = :departure_airport_country, arrival_airport_name = :arrival_airport_name, arrival_airport_city = :arrival_airport_city, arrival_airport_country = :arrival_airport_country WHERE spotter_id = :spotter_id"; |
|
| 10017 | + $update_query = "UPDATE spotter_output SET departure_airport_icao = :fromicao, arrival_airport_icao = :toicao, departure_airport_name = :departure_airport_name, departure_airport_city = :departure_airport_city, departure_airport_country = :departure_airport_country, arrival_airport_name = :arrival_airport_name, arrival_airport_city = :arrival_airport_city, arrival_airport_country = :arrival_airport_country WHERE spotter_id = :spotter_id"; |
|
| 10018 | 10018 | $sthu = $this->db->prepare($update_query); |
| 10019 | - $sthu->execute(array(':fromicao' => $row['fromairport_icao'],':toicao' => $row['toairport_icao'],':spotter_id' => $row['spotter_id'],':departure_airport_name' => $departure_airport_array[0]['name'],':departure_airport_city' => $departure_airport_array[0]['city'],':departure_airport_country' => $departure_airport_array[0]['country'],':arrival_airport_name' => $arrival_airport_array[0]['name'],':arrival_airport_city' => $arrival_airport_array[0]['city'],':arrival_airport_country' => $arrival_airport_array[0]['country'])); |
|
| 10019 | + $sthu->execute(array(':fromicao' => $row['fromairport_icao'], ':toicao' => $row['toairport_icao'], ':spotter_id' => $row['spotter_id'], ':departure_airport_name' => $departure_airport_array[0]['name'], ':departure_airport_city' => $departure_airport_array[0]['city'], ':departure_airport_country' => $departure_airport_array[0]['country'], ':arrival_airport_name' => $arrival_airport_array[0]['name'], ':arrival_airport_city' => $arrival_airport_array[0]['city'], ':arrival_airport_country' => $arrival_airport_array[0]['country'])); |
|
| 10020 | 10020 | } |
| 10021 | 10021 | } |
| 10022 | 10022 | |
@@ -10029,7 +10029,7 @@ discard block |
||
| 10029 | 10029 | } |
| 10030 | 10030 | $sth = $this->db->prepare($query); |
| 10031 | 10031 | $sth->execute(); |
| 10032 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 10032 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 10033 | 10033 | { |
| 10034 | 10034 | if (is_numeric(substr($row['ident'], -1, 1))) |
| 10035 | 10035 | { |
@@ -10038,11 +10038,11 @@ discard block |
||
| 10038 | 10038 | elseif (isset($row['format_source']) && $row['format_source'] == 'whazzup') $fromsource = 'ivao'; |
| 10039 | 10039 | elseif (isset($globalVATSIM) && $globalVATSIM) $fromsource = 'vatsim'; |
| 10040 | 10040 | elseif (isset($globalIVAO) && $globalIVAO) $fromsource = 'ivao'; |
| 10041 | - $airline_array = $this->getAllAirlineInfo(substr($row['ident'], 0, 3),$fromsource); |
|
| 10041 | + $airline_array = $this->getAllAirlineInfo(substr($row['ident'], 0, 3), $fromsource); |
|
| 10042 | 10042 | if (isset($airline_array[0]['name'])) { |
| 10043 | - $update_query = "UPDATE spotter_output SET spotter_output.airline_name = :airline_name, spotter_output.airline_icao = :airline_icao, spotter_output.airline_country = :airline_country, spotter_output.airline_type = :airline_type WHERE spotter_output.spotter_id = :spotter_id"; |
|
| 10043 | + $update_query = "UPDATE spotter_output SET spotter_output.airline_name = :airline_name, spotter_output.airline_icao = :airline_icao, spotter_output.airline_country = :airline_country, spotter_output.airline_type = :airline_type WHERE spotter_output.spotter_id = :spotter_id"; |
|
| 10044 | 10044 | $sthu = $this->db->prepare($update_query); |
| 10045 | - $sthu->execute(array(':airline_name' => $airline_array[0]['name'],':airline_icao' => $airline_array[0]['icao'], ':airline_country' => $airline_array[0]['country'], ':airline_type' => $airline_array[0]['type'], ':spotter_id' => $row['spotter_id'])); |
|
| 10045 | + $sthu->execute(array(':airline_name' => $airline_array[0]['name'], ':airline_icao' => $airline_array[0]['icao'], ':airline_country' => $airline_array[0]['country'], ':airline_type' => $airline_array[0]['type'], ':spotter_id' => $row['spotter_id'])); |
|
| 10046 | 10046 | } |
| 10047 | 10047 | } |
| 10048 | 10048 | } |
@@ -10062,18 +10062,18 @@ discard block |
||
| 10062 | 10062 | } |
| 10063 | 10063 | $sth = $this->db->prepare($query); |
| 10064 | 10064 | $sth->execute(); |
| 10065 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 10065 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 10066 | 10066 | { |
| 10067 | 10067 | if ($row['aircraft_icao'] != '') { |
| 10068 | 10068 | $aircraft_name = $this->getAllAircraftInfo($row['aircraft_icao']); |
| 10069 | - if ($row['registration'] != ""){ |
|
| 10069 | + if ($row['registration'] != "") { |
|
| 10070 | 10070 | $image_array = $Image->getSpotterImage($row['registration']); |
| 10071 | 10071 | if (count($image_array) == 0) { |
| 10072 | 10072 | $Image->addSpotterImage($row['registration']); |
| 10073 | 10073 | } |
| 10074 | 10074 | } |
| 10075 | 10075 | if (count($aircraft_name) > 0) { |
| 10076 | - $update_query = "UPDATE spotter_output SET spotter_output.aircraft_name = :aircraft_name, spotter_output.aircraft_manufacturer = :aircraft_manufacturer WHERE spotter_output.spotter_id = :spotter_id"; |
|
| 10076 | + $update_query = "UPDATE spotter_output SET spotter_output.aircraft_name = :aircraft_name, spotter_output.aircraft_manufacturer = :aircraft_manufacturer WHERE spotter_output.spotter_id = :spotter_id"; |
|
| 10077 | 10077 | $sthu = $this->db->prepare($update_query); |
| 10078 | 10078 | $sthu->execute(array(':aircraft_name' => $aircraft_name[0]['type'], ':aircraft_manufacturer' => $aircraft_name[0]['manufacturer'], ':spotter_id' => $row['spotter_id'])); |
| 10079 | 10079 | } |
@@ -10088,10 +10088,10 @@ discard block |
||
| 10088 | 10088 | $query = "SELECT spotter_output.spotter_id, spotter_output.last_latitude, spotter_output.last_longitude, spotter_output.last_altitude, spotter_output.arrival_airport_icao, spotter_output.real_arrival_airport_icao FROM spotter_output"; |
| 10089 | 10089 | $sth = $this->db->prepare($query); |
| 10090 | 10090 | $sth->execute(); |
| 10091 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 10091 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 10092 | 10092 | { |
| 10093 | 10093 | if ($row['last_latitude'] != '' && $row['last_longitude'] != '') { |
| 10094 | - $closestAirports = $this->closestAirports($row['last_latitude'],$row['last_longitude'],$globalClosestMinDist); |
|
| 10094 | + $closestAirports = $this->closestAirports($row['last_latitude'], $row['last_longitude'], $globalClosestMinDist); |
|
| 10095 | 10095 | $airport_icao = ''; |
| 10096 | 10096 | if (isset($closestAirports[0])) { |
| 10097 | 10097 | if ($row['arrival_airport_icao'] == $closestAirports[0]['icao']) { |
@@ -10105,7 +10105,7 @@ discard block |
||
| 10105 | 10105 | break; |
| 10106 | 10106 | } |
| 10107 | 10107 | } |
| 10108 | - } elseif ($row['last_altitude'] == 0 || ($row['last_altitude'] != '' && ($closestAirports[0]['altitude'] <= $row['last_altitude']*100+1000 && $row['last_altitude']*100 < $closestAirports[0]['altitude']+5000))) { |
|
| 10108 | + } elseif ($row['last_altitude'] == 0 || ($row['last_altitude'] != '' && ($closestAirports[0]['altitude'] <= $row['last_altitude']*100 + 1000 && $row['last_altitude']*100 < $closestAirports[0]['altitude'] + 5000))) { |
|
| 10109 | 10109 | $airport_icao = $closestAirports[0]['icao']; |
| 10110 | 10110 | if ($globalDebug) echo "\o/ NP --++ Find arrival airport. Airport ICAO : ".$airport_icao." ! Latitude : ".$row['last_latitude'].' - Longitude : '.$row['last_longitude'].' - MinDist : '.$globalClosestMinDist." - Airport altitude : ".$closestAirports[0]['altitude'].' - flight altitude : '.($row['last_altitude']*100)."\n"; |
| 10111 | 10111 | } else { |
@@ -10116,28 +10116,28 @@ discard block |
||
| 10116 | 10116 | } |
| 10117 | 10117 | if ($row['real_arrival_airport_icao'] != $airport_icao) { |
| 10118 | 10118 | if ($globalDebug) echo "Updating airport to ".$airport_icao."...\n"; |
| 10119 | - $update_query="UPDATE spotter_output SET real_arrival_airport_icao = :airport_icao WHERE spotter_id = :spotter_id"; |
|
| 10119 | + $update_query = "UPDATE spotter_output SET real_arrival_airport_icao = :airport_icao WHERE spotter_id = :spotter_id"; |
|
| 10120 | 10120 | $sthu = $this->db->prepare($update_query); |
| 10121 | - $sthu->execute(array(':airport_icao' => $airport_icao,':spotter_id' => $row['spotter_id'])); |
|
| 10121 | + $sthu->execute(array(':airport_icao' => $airport_icao, ':spotter_id' => $row['spotter_id'])); |
|
| 10122 | 10122 | } |
| 10123 | 10123 | } |
| 10124 | 10124 | } |
| 10125 | 10125 | } |
| 10126 | 10126 | |
| 10127 | - public function closestAirports($origLat,$origLon,$dist = 10) { |
|
| 10127 | + public function closestAirports($origLat, $origLon, $dist = 10) { |
|
| 10128 | 10128 | global $globalDBdriver; |
| 10129 | - $dist = number_format($dist*0.621371,2,'.',''); // convert km to mile |
|
| 10129 | + $dist = number_format($dist*0.621371, 2, '.', ''); // convert km to mile |
|
| 10130 | 10130 | /* |
| 10131 | 10131 | $query="SELECT name, icao, latitude, longitude, altitude, 3956 * 2 * ASIN(SQRT( POWER(SIN(($origLat - abs(latitude))*pi()/180/2),2)+COS( $origLat *pi()/180)*COS(abs(latitude)*pi()/180)*POWER(SIN(($origLon-longitude)*pi()/180/2),2))) as distance |
| 10132 | 10132 | FROM airport WHERE longitude between ($origLon-$dist/abs(cos(radians($origLat))*69)) and ($origLon+$dist/abs(cos(radians($origLat))*69)) and latitude between ($origLat-($dist/69)) and ($origLat+($dist/69)) |
| 10133 | 10133 | having distance < $dist ORDER BY distance limit 100;"; |
| 10134 | 10134 | */ |
| 10135 | 10135 | if ($globalDBdriver == 'mysql') { |
| 10136 | - $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 |
|
| 10136 | + $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 |
|
| 10137 | 10137 | 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)) |
| 10138 | 10138 | 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;"; |
| 10139 | 10139 | } else { |
| 10140 | - $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 |
|
| 10140 | + $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 |
|
| 10141 | 10141 | 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)) |
| 10142 | 10142 | 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;"; |
| 10143 | 10143 | } |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | } else { |
| 14 | 14 | print '<option value="">All</option>'; |
| 15 | 15 | } |
| 16 | - foreach($airlines as $airline) { |
|
| 16 | + foreach ($airlines as $airline) { |
|
| 17 | 17 | if (isset($airline_icao) && $airline_icao == $airline['airline_icao']) { |
| 18 | 18 | print '<option value="'.$airline['airline_icao'].'" selected>'.$airline['airline_name'].'</option>'; |
| 19 | 19 | } else { |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | <div class="sub-menu sub-menu-container"> |
| 29 | 29 | <ul class="nav"> |
| 30 | 30 | <li class="dropdown"> |
| 31 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-aircraft" || strtolower($current_page) == "statistics-registration" || strtolower($current_page) == "statistics-manufacturer"){ print 'active'; } ?>" data-toggle="dropdown" href="#" > |
|
| 31 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-aircraft" || strtolower($current_page) == "statistics-registration" || strtolower($current_page) == "statistics-manufacturer") { print 'active'; } ?>" data-toggle="dropdown" href="#" > |
|
| 32 | 32 | <?php echo _("Aircraft"); ?> <span class="caret"></span> |
| 33 | 33 | </a> |
| 34 | 34 | <ul class="dropdown-menu"> |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | </ul> |
| 40 | 40 | </li> |
| 41 | 41 | <li class="dropdown"> |
| 42 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-airline" || strtolower($current_page) == "statistics-airline-country" || strtolower($current_page) == "statistics-callsign"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
| 42 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-airline" || strtolower($current_page) == "statistics-airline-country" || strtolower($current_page) == "statistics-callsign") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
| 43 | 43 | <?php echo _("Airline"); ?> <span class="caret"></span> |
| 44 | 44 | </a> |
| 45 | 45 | <ul class="dropdown-menu" role="menu"> |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | </ul> |
| 50 | 50 | </li> |
| 51 | 51 | <li class="dropdown"> |
| 52 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-airport-departure" || strtolower($current_page) == "statistics-airport-departure-country" || strtolower($current_page) == "statistics-airport-arrival" || strtolower($current_page) == "statistics-airport-arrival-country"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
| 52 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-airport-departure" || strtolower($current_page) == "statistics-airport-departure-country" || strtolower($current_page) == "statistics-airport-arrival" || strtolower($current_page) == "statistics-airport-arrival-country") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
| 53 | 53 | <?php echo _("Airport"); ?> <span class="caret"></span> |
| 54 | 54 | </a> |
| 55 | 55 | <ul class="dropdown-menu" role="menu"> |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | </ul> |
| 61 | 61 | </li> |
| 62 | 62 | <li class="dropdown"> |
| 63 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-route-airport" || strtolower($current_page) == "statistics-route-waypoint"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
| 63 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-route-airport" || strtolower($current_page) == "statistics-route-waypoint") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
| 64 | 64 | <?php echo _("Route"); ?> <span class="caret"></span> |
| 65 | 65 | </a> |
| 66 | 66 | <ul class="dropdown-menu" role="menu"> |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | </ul> |
| 70 | 70 | </li> |
| 71 | 71 | <li class="dropdown"> |
| 72 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-date" || strtolower($current_page) == "statistics-time"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
| 72 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-date" || strtolower($current_page) == "statistics-time") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
| 73 | 73 | <?php echo _("Date & Time"); ?> <span class="caret"></span> |
| 74 | 74 | </a> |
| 75 | 75 | <ul class="dropdown-menu" role="menu"> |
@@ -9,8 +9,10 @@ |
||
| 9 | 9 | if ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) { |
| 10 | 10 | $airline_icao = $_COOKIE['stats_airline_icao']; |
| 11 | 11 | } elseif ($airline_icao == '' && isset($globalFilter)) { |
| 12 | - if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
| 13 | -} |
|
| 12 | + if (isset($globalFilter['airline'])) { |
|
| 13 | + $airline_icao = $globalFilter['airline'][0]; |
|
| 14 | + } |
|
| 15 | + } |
|
| 14 | 16 | setcookie('stats_airline_icao',$airline_icao); |
| 15 | 17 | |
| 16 | 18 | require_once('header.php'); |
@@ -5,17 +5,17 @@ discard block |
||
| 5 | 5 | $Stats = new Stats(); |
| 6 | 6 | $title = _("Statistics").' - '._("Most common Departure Airport"); |
| 7 | 7 | |
| 8 | -$airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
|
| 8 | +$airline_icao = (string) filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING); |
|
| 9 | 9 | if ($airline_icao == 'all') { |
| 10 | 10 | unset($_COOKIE['stats_airline_icao']); |
| 11 | - setcookie('stats_airline_icao', '', time()-3600); |
|
| 11 | + setcookie('stats_airline_icao', '', time() - 3600); |
|
| 12 | 12 | $airline_icao = ''; |
| 13 | 13 | } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) { |
| 14 | 14 | $airline_icao = $_COOKIE['stats_airline_icao']; |
| 15 | 15 | } elseif ($airline_icao == '' && isset($globalFilter)) { |
| 16 | 16 | if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
| 17 | 17 | } |
| 18 | -setcookie('stats_airline_icao',$airline_icao); |
|
| 18 | +setcookie('stats_airline_icao', $airline_icao); |
|
| 19 | 19 | |
| 20 | 20 | require_once('header.php'); |
| 21 | 21 | |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | </div> |
| 27 | 27 | <p>'._("Below are the <strong>Top 10</strong> most common departure airports.").'</p>'; |
| 28 | 28 | |
| 29 | -$airport_airport_array = $Stats->countAllDepartureAirports(true,$airline_icao); |
|
| 29 | +$airport_airport_array = $Stats->countAllDepartureAirports(true, $airline_icao); |
|
| 30 | 30 | print '<script> |
| 31 | 31 | google.load("visualization", "1", {packages:["geochart"]}); |
| 32 | 32 | google.setOnLoadCallback(drawCharts); |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | ["'._("Airport").'", "'._("# of times").'"],'; |
| 40 | 40 | |
| 41 | 41 | $airport_data = ''; |
| 42 | -foreach($airport_airport_array as $airport_item) |
|
| 42 | +foreach ($airport_airport_array as $airport_item) |
|
| 43 | 43 | { |
| 44 | 44 | $name = $airport_item['airport_departure_city'].', '.$airport_item['airport_departure_country'].' ('.$airport_item['airport_departure_icao'].')'; |
| 45 | 45 | $name = str_replace("'", "", $name); |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | print '</thead>'; |
| 78 | 78 | print '<tbody>'; |
| 79 | 79 | $i = 1; |
| 80 | -foreach($airport_airport_array as $airport_item) |
|
| 80 | +foreach ($airport_airport_array as $airport_item) |
|
| 81 | 81 | { |
| 82 | 82 | print '<tr>'; |
| 83 | 83 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -7,13 +7,13 @@ |
||
| 7 | 7 | |
| 8 | 8 | $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
| 9 | 9 | if ($airline_icao == 'all') { |
| 10 | - unset($_COOKIE['stats_airline_icao']); |
|
| 11 | - setcookie('stats_airline_icao', '', time()-3600); |
|
| 12 | - $airline_icao = ''; |
|
| 10 | + unset($_COOKIE['stats_airline_icao']); |
|
| 11 | + setcookie('stats_airline_icao', '', time()-3600); |
|
| 12 | + $airline_icao = ''; |
|
| 13 | 13 | } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) { |
| 14 | - $airline_icao = $_COOKIE['stats_airline_icao']; |
|
| 14 | + $airline_icao = $_COOKIE['stats_airline_icao']; |
|
| 15 | 15 | } elseif ($airline_icao == '' && isset($globalFilter)) { |
| 16 | - if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
| 16 | + if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
| 17 | 17 | } |
| 18 | 18 | setcookie('stats_airline_icao',$airline_icao); |
| 19 | 19 | |
@@ -9,8 +9,10 @@ |
||
| 9 | 9 | if ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) { |
| 10 | 10 | $airline_icao = $_COOKIE['stats_airline_icao']; |
| 11 | 11 | } elseif ($airline_icao == '' && isset($globalFilter)) { |
| 12 | - if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
| 13 | -} |
|
| 12 | + if (isset($globalFilter['airline'])) { |
|
| 13 | + $airline_icao = $globalFilter['airline'][0]; |
|
| 14 | + } |
|
| 15 | + } |
|
| 14 | 16 | setcookie('stats_airline_icao',$airline_icao); |
| 15 | 17 | |
| 16 | 18 | require_once('header.php'); |
@@ -5,17 +5,17 @@ discard block |
||
| 5 | 5 | $Stats = new Stats(); |
| 6 | 6 | $title = _("Statistics").' - '._("Most common Aircraft"); |
| 7 | 7 | |
| 8 | -$airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
|
| 8 | +$airline_icao = (string) filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING); |
|
| 9 | 9 | if ($airline_icao == 'all') { |
| 10 | 10 | unset($_COOKIE['stats_airline_icao']); |
| 11 | - setcookie('stats_airline_icao', '', time()-3600); |
|
| 11 | + setcookie('stats_airline_icao', '', time() - 3600); |
|
| 12 | 12 | $airline_icao = ''; |
| 13 | 13 | } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) { |
| 14 | 14 | $airline_icao = $_COOKIE['stats_airline_icao']; |
| 15 | 15 | } elseif ($airline_icao == '' && isset($globalFilter)) { |
| 16 | 16 | if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
| 17 | 17 | } |
| 18 | -setcookie('stats_airline_icao',$airline_icao); |
|
| 18 | +setcookie('stats_airline_icao', $airline_icao); |
|
| 19 | 19 | |
| 20 | 20 | require_once('header.php'); |
| 21 | 21 | |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | </div> |
| 27 | 27 | <p>'._("Below are the <strong>Top 10</strong> most common aircraft types.").'</p>'; |
| 28 | 28 | |
| 29 | -$aircraft_array = $Stats->countAllAircraftTypes(true,$airline_icao); |
|
| 29 | +$aircraft_array = $Stats->countAllAircraftTypes(true, $airline_icao); |
|
| 30 | 30 | print '<div id="chart" class="chart" width="100%"></div> |
| 31 | 31 | <script> |
| 32 | 32 | google.load("visualization", "1", {packages:["corechart"]}); |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | var data = google.visualization.arrayToDataTable([ |
| 36 | 36 | ["'._("Aircraft").'", "'._("# of times").'"], '; |
| 37 | 37 | $aircraft_data = ''; |
| 38 | -foreach($aircraft_array as $aircraft_item) |
|
| 38 | +foreach ($aircraft_array as $aircraft_item) |
|
| 39 | 39 | { |
| 40 | 40 | $aircraft_data .= '[ "'.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],'; |
| 41 | 41 | } |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | print '</thead>'; |
| 69 | 69 | print '<tbody>'; |
| 70 | 70 | $i = 1; |
| 71 | - foreach($aircraft_array as $aircraft_item) |
|
| 71 | + foreach ($aircraft_array as $aircraft_item) |
|
| 72 | 72 | { |
| 73 | 73 | print '<tr>'; |
| 74 | 74 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -7,13 +7,13 @@ |
||
| 7 | 7 | |
| 8 | 8 | $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
| 9 | 9 | if ($airline_icao == 'all') { |
| 10 | - unset($_COOKIE['stats_airline_icao']); |
|
| 11 | - setcookie('stats_airline_icao', '', time()-3600); |
|
| 12 | - $airline_icao = ''; |
|
| 10 | + unset($_COOKIE['stats_airline_icao']); |
|
| 11 | + setcookie('stats_airline_icao', '', time()-3600); |
|
| 12 | + $airline_icao = ''; |
|
| 13 | 13 | } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) { |
| 14 | - $airline_icao = $_COOKIE['stats_airline_icao']; |
|
| 14 | + $airline_icao = $_COOKIE['stats_airline_icao']; |
|
| 15 | 15 | } elseif ($airline_icao == '' && isset($globalFilter)) { |
| 16 | - if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
| 16 | + if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
| 17 | 17 | } |
| 18 | 18 | setcookie('stats_airline_icao',$airline_icao); |
| 19 | 19 | |
@@ -9,8 +9,10 @@ |
||
| 9 | 9 | if ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) { |
| 10 | 10 | $airline_icao = $_COOKIE['stats_airline_icao']; |
| 11 | 11 | } elseif ($airline_icao == '' && isset($globalFilter)) { |
| 12 | - if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
| 13 | -} |
|
| 12 | + if (isset($globalFilter['airline'])) { |
|
| 13 | + $airline_icao = $globalFilter['airline'][0]; |
|
| 14 | + } |
|
| 15 | + } |
|
| 14 | 16 | setcookie('stats_airline_icao',$airline_icao); |
| 15 | 17 | |
| 16 | 18 | require_once('header.php'); |
@@ -5,17 +5,17 @@ discard block |
||
| 5 | 5 | $Stats = new Stats(); |
| 6 | 6 | $title = _("Statistics").' - '._("Busiest Day"); |
| 7 | 7 | |
| 8 | -$airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
|
| 8 | +$airline_icao = (string) filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING); |
|
| 9 | 9 | if ($airline_icao == 'all') { |
| 10 | 10 | unset($_COOKIE['stats_airline_icao']); |
| 11 | - setcookie('stats_airline_icao', '', time()-3600); |
|
| 11 | + setcookie('stats_airline_icao', '', time() - 3600); |
|
| 12 | 12 | $airline_icao = ''; |
| 13 | 13 | } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) { |
| 14 | 14 | $airline_icao = $_COOKIE['stats_airline_icao']; |
| 15 | 15 | } elseif ($airline_icao == '' && isset($globalFilter)) { |
| 16 | 16 | if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
| 17 | 17 | } |
| 18 | -setcookie('stats_airline_icao',$airline_icao); |
|
| 18 | +setcookie('stats_airline_icao', $airline_icao); |
|
| 19 | 19 | |
| 20 | 20 | require_once('header.php'); |
| 21 | 21 | include('statistics-sub-menu.php'); |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | ["'._("Date").'", "'._("# of Flights").'"], '; |
| 40 | 40 | |
| 41 | 41 | $date_data = ''; |
| 42 | -foreach($date_array as $date_item) |
|
| 42 | +foreach ($date_array as $date_item) |
|
| 43 | 43 | { |
| 44 | 44 | $date_data .= '[ "'.date("F j, Y", strtotime($date_item['date_name'])).'",'.$date_item['date_count'].'],'; |
| 45 | 45 | } |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | </script>'; |
| 66 | 66 | } |
| 67 | 67 | if (isset($globalDBArchiveMonths) && $globalDBArchiveMonths > 0) { |
| 68 | - print '<p>'.sprintf(_("Below are the <strong>Top 10</strong> most busiest dates of last %d month(s)."),$globalDBArchiveMonths).'</p>'; |
|
| 68 | + print '<p>'.sprintf(_("Below are the <strong>Top 10</strong> most busiest dates of last %d month(s)."), $globalDBArchiveMonths).'</p>'; |
|
| 69 | 69 | } else { |
| 70 | 70 | print '<p>'._("Below are the <strong>Top 10</strong> most busiest dates.").'</p>'; |
| 71 | 71 | } |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | print '</thead>'; |
| 82 | 82 | print '<tbody>'; |
| 83 | 83 | $i = 1; |
| 84 | - foreach($date_array as $date_item) |
|
| 84 | + foreach ($date_array as $date_item) |
|
| 85 | 85 | { |
| 86 | 86 | print '<tr>'; |
| 87 | 87 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -7,13 +7,13 @@ |
||
| 7 | 7 | |
| 8 | 8 | $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
| 9 | 9 | if ($airline_icao == 'all') { |
| 10 | - unset($_COOKIE['stats_airline_icao']); |
|
| 11 | - setcookie('stats_airline_icao', '', time()-3600); |
|
| 12 | - $airline_icao = ''; |
|
| 10 | + unset($_COOKIE['stats_airline_icao']); |
|
| 11 | + setcookie('stats_airline_icao', '', time()-3600); |
|
| 12 | + $airline_icao = ''; |
|
| 13 | 13 | } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) { |
| 14 | - $airline_icao = $_COOKIE['stats_airline_icao']; |
|
| 14 | + $airline_icao = $_COOKIE['stats_airline_icao']; |
|
| 15 | 15 | } elseif ($airline_icao == '' && isset($globalFilter)) { |
| 16 | - if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
| 16 | + if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
| 17 | 17 | } |
| 18 | 18 | setcookie('stats_airline_icao',$airline_icao); |
| 19 | 19 | |
@@ -9,8 +9,10 @@ |
||
| 9 | 9 | if ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) { |
| 10 | 10 | $airline_icao = $_COOKIE['stats_airline_icao']; |
| 11 | 11 | } elseif ($airline_icao == '' && isset($globalFilter)) { |
| 12 | - if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
| 13 | -} |
|
| 12 | + if (isset($globalFilter['airline'])) { |
|
| 13 | + $airline_icao = $globalFilter['airline'][0]; |
|
| 14 | + } |
|
| 15 | + } |
|
| 14 | 16 | setcookie('stats_airline_icao',$airline_icao); |
| 15 | 17 | |
| 16 | 18 | require_once('header.php'); |
@@ -5,17 +5,17 @@ discard block |
||
| 5 | 5 | $Stats = new Stats(); |
| 6 | 6 | $title = _("Statistics").' - '._("Most common Departure Airport by Country"); |
| 7 | 7 | |
| 8 | -$airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
|
| 8 | +$airline_icao = (string) filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING); |
|
| 9 | 9 | if ($airline_icao == 'all') { |
| 10 | 10 | unset($_COOKIE['stats_airline_icao']); |
| 11 | - setcookie('stats_airline_icao', '', time()-3600); |
|
| 11 | + setcookie('stats_airline_icao', '', time() - 3600); |
|
| 12 | 12 | $airline_icao = ''; |
| 13 | 13 | } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) { |
| 14 | 14 | $airline_icao = $_COOKIE['stats_airline_icao']; |
| 15 | 15 | } elseif ($airline_icao == '' && isset($globalFilter)) { |
| 16 | 16 | if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
| 17 | 17 | } |
| 18 | -setcookie('stats_airline_icao',$airline_icao); |
|
| 18 | +setcookie('stats_airline_icao', $airline_icao); |
|
| 19 | 19 | |
| 20 | 20 | require_once('header.php'); |
| 21 | 21 | include('statistics-sub-menu.php'); |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | </div> |
| 27 | 27 | <p>'._("Below are the <strong>Top 10</strong> most common countries of all the departure airports.").'</p>'; |
| 28 | 28 | |
| 29 | -$airport_country_array = $Stats->countAllDepartureCountries(true,$airline_icao); |
|
| 29 | +$airport_country_array = $Stats->countAllDepartureCountries(true, $airline_icao); |
|
| 30 | 30 | print '<script> |
| 31 | 31 | google.load("visualization", "1", {packages:["geochart"]}); |
| 32 | 32 | google.setOnLoadCallback(drawCharts); |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | ["'._("Country").'", "'._("# of times").'"],'; |
| 40 | 40 | |
| 41 | 41 | $country_data = ''; |
| 42 | -foreach($airport_country_array as $airport_item) |
|
| 42 | +foreach ($airport_country_array as $airport_item) |
|
| 43 | 43 | { |
| 44 | 44 | $country_data .= '[ "'.$airport_item['airport_departure_country'].'",'.$airport_item['airport_departure_country_count'].'],'; |
| 45 | 45 | } |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | print '</thead>'; |
| 75 | 75 | print '<tbody>'; |
| 76 | 76 | $i = 1; |
| 77 | -foreach($airport_country_array as $airport_item) |
|
| 77 | +foreach ($airport_country_array as $airport_item) |
|
| 78 | 78 | { |
| 79 | 79 | print '<tr>'; |
| 80 | 80 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -7,13 +7,13 @@ |
||
| 7 | 7 | |
| 8 | 8 | $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
| 9 | 9 | if ($airline_icao == 'all') { |
| 10 | - unset($_COOKIE['stats_airline_icao']); |
|
| 11 | - setcookie('stats_airline_icao', '', time()-3600); |
|
| 12 | - $airline_icao = ''; |
|
| 10 | + unset($_COOKIE['stats_airline_icao']); |
|
| 11 | + setcookie('stats_airline_icao', '', time()-3600); |
|
| 12 | + $airline_icao = ''; |
|
| 13 | 13 | } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) { |
| 14 | - $airline_icao = $_COOKIE['stats_airline_icao']; |
|
| 14 | + $airline_icao = $_COOKIE['stats_airline_icao']; |
|
| 15 | 15 | } elseif ($airline_icao == '' && isset($globalFilter)) { |
| 16 | - if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
| 16 | + if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
| 17 | 17 | } |
| 18 | 18 | setcookie('stats_airline_icao',$airline_icao); |
| 19 | 19 | |
@@ -9,8 +9,10 @@ |
||
| 9 | 9 | if ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) { |
| 10 | 10 | $airline_icao = $_COOKIE['stats_airline_icao']; |
| 11 | 11 | } elseif ($airline_icao == '' && isset($globalFilter)) { |
| 12 | - if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
| 13 | -} |
|
| 12 | + if (isset($globalFilter['airline'])) { |
|
| 13 | + $airline_icao = $globalFilter['airline'][0]; |
|
| 14 | + } |
|
| 15 | + } |
|
| 14 | 16 | setcookie('stats_airline_icao',$airline_icao); |
| 15 | 17 | |
| 16 | 18 | require_once('header.php'); |
@@ -7,13 +7,13 @@ discard block |
||
| 7 | 7 | |
| 8 | 8 | $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
| 9 | 9 | if ($airline_icao == 'all') { |
| 10 | - unset($_COOKIE['stats_airline_icao']); |
|
| 11 | - setcookie('stats_airline_icao', '', time()-3600); |
|
| 12 | - $airline_icao = ''; |
|
| 10 | + unset($_COOKIE['stats_airline_icao']); |
|
| 11 | + setcookie('stats_airline_icao', '', time()-3600); |
|
| 12 | + $airline_icao = ''; |
|
| 13 | 13 | } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) { |
| 14 | - $airline_icao = $_COOKIE['stats_airline_icao']; |
|
| 14 | + $airline_icao = $_COOKIE['stats_airline_icao']; |
|
| 15 | 15 | } elseif ($airline_icao == '' && isset($globalFilter)) { |
| 16 | - if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
| 16 | + if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
| 17 | 17 | } |
| 18 | 18 | setcookie('stats_airline_icao',$airline_icao); |
| 19 | 19 | |
@@ -34,14 +34,14 @@ discard block |
||
| 34 | 34 | function drawChart() { |
| 35 | 35 | var data = google.visualization.arrayToDataTable([ |
| 36 | 36 | ["'._("Pilot").'", "'._("# of times").'"], '; |
| 37 | - $pilot_data = ''; |
|
| 37 | + $pilot_data = ''; |
|
| 38 | 38 | foreach($pilot_array as $pilot_item) |
| 39 | 39 | { |
| 40 | 40 | $pilot_data .= '[ "'.$pilot_item['pilot_name'].' ('.$pilot_item['pilot_id'].')",'.$pilot_item['pilot_count'].'],'; |
| 41 | 41 | } |
| 42 | 42 | $pilot_data = substr($pilot_data, 0, -1); |
| 43 | 43 | print $pilot_data; |
| 44 | - print ']); |
|
| 44 | + print ']); |
|
| 45 | 45 | |
| 46 | 46 | var options = { |
| 47 | 47 | chartArea: {"width": "80%", "height": "60%"}, |
@@ -5,17 +5,17 @@ discard block |
||
| 5 | 5 | $Stats = new Stats(); |
| 6 | 6 | $title = _("Statistics").' - '._("Most common Pilots"); |
| 7 | 7 | |
| 8 | -$airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
|
| 8 | +$airline_icao = (string) filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING); |
|
| 9 | 9 | if ($airline_icao == 'all') { |
| 10 | 10 | unset($_COOKIE['stats_airline_icao']); |
| 11 | - setcookie('stats_airline_icao', '', time()-3600); |
|
| 11 | + setcookie('stats_airline_icao', '', time() - 3600); |
|
| 12 | 12 | $airline_icao = ''; |
| 13 | 13 | } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) { |
| 14 | 14 | $airline_icao = $_COOKIE['stats_airline_icao']; |
| 15 | 15 | } elseif ($airline_icao == '' && isset($globalFilter)) { |
| 16 | 16 | if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
| 17 | 17 | } |
| 18 | -setcookie('stats_airline_icao',$airline_icao); |
|
| 18 | +setcookie('stats_airline_icao', $airline_icao); |
|
| 19 | 19 | |
| 20 | 20 | require_once('header.php'); |
| 21 | 21 | include('statistics-sub-menu.php'); |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | </div> |
| 27 | 27 | <p>'._("Below are the <strong>Top 10</strong> most common pilot.").'</p>'; |
| 28 | 28 | |
| 29 | - $pilot_array = $Stats->countAllPilots(true,$airline_icao); |
|
| 29 | + $pilot_array = $Stats->countAllPilots(true, $airline_icao); |
|
| 30 | 30 | print '<div id="chart" class="chart" width="100%"></div> |
| 31 | 31 | <script> |
| 32 | 32 | google.load("visualization", "1", {packages:["corechart"]}); |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | var data = google.visualization.arrayToDataTable([ |
| 36 | 36 | ["'._("Pilot").'", "'._("# of times").'"], '; |
| 37 | 37 | $pilot_data = ''; |
| 38 | - foreach($pilot_array as $pilot_item) |
|
| 38 | + foreach ($pilot_array as $pilot_item) |
|
| 39 | 39 | { |
| 40 | 40 | $pilot_data .= '[ "'.$pilot_item['pilot_name'].' ('.$pilot_item['pilot_id'].')",'.$pilot_item['pilot_count'].'],'; |
| 41 | 41 | } |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | print '</thead>'; |
| 69 | 69 | print '<tbody>'; |
| 70 | 70 | $i = 1; |
| 71 | - foreach($pilot_array as $pilot_item) |
|
| 71 | + foreach ($pilot_array as $pilot_item) |
|
| 72 | 72 | { |
| 73 | 73 | print '<tr>'; |
| 74 | 74 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -9,8 +9,10 @@ |
||
| 9 | 9 | if ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) { |
| 10 | 10 | $airline_icao = $_COOKIE['stats_airline_icao']; |
| 11 | 11 | } elseif ($airline_icao == '' && isset($globalFilter)) { |
| 12 | - if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
| 13 | -} |
|
| 12 | + if (isset($globalFilter['airline'])) { |
|
| 13 | + $airline_icao = $globalFilter['airline'][0]; |
|
| 14 | + } |
|
| 15 | + } |
|
| 14 | 16 | setcookie('stats_airline_icao',$airline_icao); |
| 15 | 17 | |
| 16 | 18 | require_once('header.php'); |
@@ -5,17 +5,17 @@ discard block |
||
| 5 | 5 | $Stats = new Stats(); |
| 6 | 6 | $title = _("Statistics").' - '._("Busiest Month of Last Year"); |
| 7 | 7 | |
| 8 | -$airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
|
| 8 | +$airline_icao = (string) filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING); |
|
| 9 | 9 | if ($airline_icao == 'all') { |
| 10 | 10 | unset($_COOKIE['stats_airline_icao']); |
| 11 | - setcookie('stats_airline_icao', '', time()-3600); |
|
| 11 | + setcookie('stats_airline_icao', '', time() - 3600); |
|
| 12 | 12 | $airline_icao = ''; |
| 13 | 13 | } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) { |
| 14 | 14 | $airline_icao = $_COOKIE['stats_airline_icao']; |
| 15 | 15 | } elseif ($airline_icao == '' && isset($globalFilter)) { |
| 16 | 16 | if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
| 17 | 17 | } |
| 18 | -setcookie('stats_airline_icao',$airline_icao); |
|
| 18 | +setcookie('stats_airline_icao', $airline_icao); |
|
| 19 | 19 | |
| 20 | 20 | require_once('header.php'); |
| 21 | 21 | include('statistics-sub-menu.php'); |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | ["'._("Month").'", "'._("# of Flights").'"], '; |
| 37 | 37 | |
| 38 | 38 | $date_data = ''; |
| 39 | -foreach($date_array as $date_item) |
|
| 39 | +foreach ($date_array as $date_item) |
|
| 40 | 40 | { |
| 41 | 41 | $date_data .= '[ "'.date("F j, Y", strtotime($date_item['date_name'])).'",'.$date_item['date_count'].'],'; |
| 42 | 42 | } |
@@ -73,12 +73,12 @@ discard block |
||
| 73 | 73 | print '</thead>'; |
| 74 | 74 | print '<tbody>'; |
| 75 | 75 | $i = 1; |
| 76 | - foreach($date_array as $date_item) |
|
| 76 | + foreach ($date_array as $date_item) |
|
| 77 | 77 | { |
| 78 | 78 | print '<tr>'; |
| 79 | 79 | print '<td><strong>'.$i.'</strong></td>'; |
| 80 | 80 | print '<td>'; |
| 81 | - print '<a href="'.$globalURL.'/date/'.date('Y-m-d',strtotime($date_item['date_name'])).'">'.date("l F j, Y", strtotime($date_item['date_name'])).'</a>'; |
|
| 81 | + print '<a href="'.$globalURL.'/date/'.date('Y-m-d', strtotime($date_item['date_name'])).'">'.date("l F j, Y", strtotime($date_item['date_name'])).'</a>'; |
|
| 82 | 82 | print '</td>'; |
| 83 | 83 | print '<td>'; |
| 84 | 84 | print $date_item['date_count']; |
@@ -7,13 +7,13 @@ |
||
| 7 | 7 | |
| 8 | 8 | $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
| 9 | 9 | if ($airline_icao == 'all') { |
| 10 | - unset($_COOKIE['stats_airline_icao']); |
|
| 11 | - setcookie('stats_airline_icao', '', time()-3600); |
|
| 12 | - $airline_icao = ''; |
|
| 10 | + unset($_COOKIE['stats_airline_icao']); |
|
| 11 | + setcookie('stats_airline_icao', '', time()-3600); |
|
| 12 | + $airline_icao = ''; |
|
| 13 | 13 | } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) { |
| 14 | - $airline_icao = $_COOKIE['stats_airline_icao']; |
|
| 14 | + $airline_icao = $_COOKIE['stats_airline_icao']; |
|
| 15 | 15 | } elseif ($airline_icao == '' && isset($globalFilter)) { |
| 16 | - if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
| 16 | + if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
| 17 | 17 | } |
| 18 | 18 | setcookie('stats_airline_icao',$airline_icao); |
| 19 | 19 | |