@@ -5,7 +5,9 @@ discard block |
||
5 | 5 | $Stats = new Stats(); |
6 | 6 | $title = _("Statistics").' - '._("Busiest Day"); |
7 | 7 | |
8 | -if (!isset($filter_name)) $filter_name = ''; |
|
8 | +if (!isset($filter_name)) { |
|
9 | + $filter_name = ''; |
|
10 | +} |
|
9 | 11 | $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
10 | 12 | if ($airline_icao == 'all') { |
11 | 13 | unset($_COOKIE['stats_airline_icao']); |
@@ -14,8 +16,10 @@ discard block |
||
14 | 16 | } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) { |
15 | 17 | $airline_icao = $_COOKIE['stats_airline_icao']; |
16 | 18 | } elseif ($airline_icao == '' && isset($globalFilter)) { |
17 | - if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
18 | -} |
|
19 | + if (isset($globalFilter['airline'])) { |
|
20 | + $airline_icao = $globalFilter['airline'][0]; |
|
21 | + } |
|
22 | + } |
|
19 | 23 | setcookie('stats_airline_icao',$airline_icao); |
20 | 24 | |
21 | 25 | require_once('header.php'); |
@@ -22,7 +22,9 @@ |
||
22 | 22 | print '<option></option>'; |
23 | 23 | $Stats = new Stats(); |
24 | 24 | $aircraft_types = $Stats->getAllAircraftTypes(); |
25 | - if (empty($aircraft_types)) $aircraft_types = $Spotter->getAllAircraftTypes(); |
|
25 | + if (empty($aircraft_types)) { |
|
26 | + $aircraft_types = $Spotter->getAllAircraftTypes(); |
|
27 | + } |
|
26 | 28 | foreach($aircraft_types as $aircraft_type) |
27 | 29 | { |
28 | 30 | if($aircraft_type == $aircrafttype['aircraft_icao']) |
@@ -6,7 +6,9 @@ discard block |
||
6 | 6 | $Stats = new Stats(); |
7 | 7 | $title = _("Statistics"); |
8 | 8 | |
9 | -if (!isset($filter_name)) $filter_name = ''; |
|
9 | +if (!isset($filter_name)) { |
|
10 | + $filter_name = ''; |
|
11 | +} |
|
10 | 12 | $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
11 | 13 | if ($airline_icao == 'all') { |
12 | 14 | unset($_COOKIE['stats_airline_icao']); |
@@ -15,8 +17,10 @@ discard block |
||
15 | 17 | } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) { |
16 | 18 | $airline_icao = $_COOKIE['stats_airline_icao']; |
17 | 19 | } elseif ($airline_icao == '' && isset($globalFilter)) { |
18 | - if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
19 | -} |
|
20 | + if (isset($globalFilter['airline'])) { |
|
21 | + $airline_icao = $globalFilter['airline'][0]; |
|
22 | + } |
|
23 | + } |
|
20 | 24 | setcookie('stats_airline_icao',$airline_icao); |
21 | 25 | require_once('header.php'); |
22 | 26 | |
@@ -36,7 +40,9 @@ discard block |
||
36 | 40 | if (isset($last_update[0]['value'])) { |
37 | 41 | date_default_timezone_set('UTC'); |
38 | 42 | $lastupdate = strtotime($last_update[0]['value']); |
39 | - if (isset($globalTimezone) && $globalTimezone != '') date_default_timezone_set($globalTimezone); |
|
43 | + if (isset($globalTimezone) && $globalTimezone != '') { |
|
44 | + date_default_timezone_set($globalTimezone); |
|
45 | + } |
|
40 | 46 | print '<i>Last update: '.date('Y-m-d G:i:s',$lastupdate).'</i>'; |
41 | 47 | } |
42 | 48 | ?> |
@@ -89,8 +95,9 @@ discard block |
||
89 | 95 | <h2><?php echo _("Top 10 Most Common Aircraft Type"); ?></h2> |
90 | 96 | <?php |
91 | 97 | $aircraft_array = $Stats->countAllAircraftTypes(true,$airline_icao,$filter_name); |
92 | - if (count($aircraft_array) == 0) print _("No data available"); |
|
93 | - else { |
|
98 | + if (count($aircraft_array) == 0) { |
|
99 | + print _("No data available"); |
|
100 | + } else { |
|
94 | 101 | |
95 | 102 | print '<div id="chart1" class="chart" width="100%"></div> |
96 | 103 | <script> |
@@ -136,8 +143,9 @@ discard block |
||
136 | 143 | <h2><?php echo _("Top 10 Most Common Airline"); ?></h2> |
137 | 144 | <?php |
138 | 145 | $airline_array = $Stats->countAllAirlines(true,$filter_name); |
139 | - if (count($airline_array) == 0) print _("No data available"); |
|
140 | - else { |
|
146 | + if (count($airline_array) == 0) { |
|
147 | + print _("No data available"); |
|
148 | + } else { |
|
141 | 149 | |
142 | 150 | print '<div id="chart2" class="chart" width="100%"></div> |
143 | 151 | <script> |
@@ -197,8 +205,9 @@ discard block |
||
197 | 205 | <h2><?php echo _("Top 10 Most Common Pilots"); ?></h2> |
198 | 206 | <?php |
199 | 207 | $pilot_array = $Stats->countAllPilots(true,$airline_icao,$filter_name); |
200 | - if (count($pilot_array) == 0) print _("No data available"); |
|
201 | - else { |
|
208 | + if (count($pilot_array) == 0) { |
|
209 | + print _("No data available"); |
|
210 | + } else { |
|
202 | 211 | |
203 | 212 | print '<div id="chart7" class="chart" width="100%"></div> |
204 | 213 | <script> |
@@ -244,8 +253,9 @@ discard block |
||
244 | 253 | <h2><?php echo _("Top 10 Most Common Owners"); ?></h2> |
245 | 254 | <?php |
246 | 255 | $owner_array = $Stats->countAllOwners(true,$airline_icao,$filter_name); |
247 | - if (count($owner_array) == 0) print _("No data available"); |
|
248 | - else { |
|
256 | + if (count($owner_array) == 0) { |
|
257 | + print _("No data available"); |
|
258 | + } else { |
|
249 | 259 | |
250 | 260 | print '<div id="chart7" class="chart" width="100%"></div> |
251 | 261 | <script> |
@@ -293,8 +303,9 @@ discard block |
||
293 | 303 | <h2><?php echo _("Top 20 Most Common Country a Flight was Over"); ?></h2> |
294 | 304 | <?php |
295 | 305 | //$flightover_array = $Stats->countAllFlightOverCountries(); |
296 | - if (count($flightover_array) == 0) print _("No data available"); |
|
297 | - else { |
|
306 | + if (count($flightover_array) == 0) { |
|
307 | + print _("No data available"); |
|
308 | + } else { |
|
298 | 309 | |
299 | 310 | print '<div id="chart10" class="chart" width="100%"></div> |
300 | 311 | <script> |
@@ -346,8 +357,9 @@ discard block |
||
346 | 357 | <h2><?php echo _("Top 10 Most Common Departure Airports"); ?></h2> |
347 | 358 | <?php |
348 | 359 | $airport_airport_array = $Stats->countAllDepartureAirports($airline_icao,$filter_name); |
349 | - if (count($airport_airport_array) == 0) print _("No data available"); |
|
350 | - else { |
|
360 | + if (count($airport_airport_array) == 0) { |
|
361 | + print _("No data available"); |
|
362 | + } else { |
|
351 | 363 | |
352 | 364 | print '<div id="chart3" class="chart" width="100%"></div> |
353 | 365 | <script> |
@@ -396,8 +408,9 @@ discard block |
||
396 | 408 | <h2><?php echo _("Top 10 Most Common Arrival Airports"); ?></h2> |
397 | 409 | <?php |
398 | 410 | $airport_airport_array2 = $Stats->countAllArrivalAirports($airline_icao,$filter_name); |
399 | - if (count($airport_airport_array2) == 0) print _("No data available"); |
|
400 | - else { |
|
411 | + if (count($airport_airport_array2) == 0) { |
|
412 | + print _("No data available"); |
|
413 | + } else { |
|
401 | 414 | |
402 | 415 | print '<div id="chart4" class="chart" width="100%"></div> |
403 | 416 | <script> |
@@ -448,8 +461,9 @@ discard block |
||
448 | 461 | <h2><?php echo _("Busiest Months of the last 12 Months"); ?></h2> |
449 | 462 | <?php |
450 | 463 | $year_array = $Stats->countAllMonthsLastYear($airline_icao,$filter_name); |
451 | - if (count($year_array) == 0) print _("No data available"); |
|
452 | - else { |
|
464 | + if (count($year_array) == 0) { |
|
465 | + print _("No data available"); |
|
466 | + } else { |
|
453 | 467 | print '<div id="chart8" class="chart" width="100%"></div> |
454 | 468 | <script> |
455 | 469 | google.load("visualization", "1", {packages:["corechart"]}); |
@@ -494,8 +508,9 @@ discard block |
||
494 | 508 | <h2><?php echo _("Busiest Day in the last Month"); ?></h2> |
495 | 509 | <?php |
496 | 510 | $month_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name); |
497 | - if (count($month_array) == 0) print _("No data available"); |
|
498 | - else { |
|
511 | + if (count($month_array) == 0) { |
|
512 | + print _("No data available"); |
|
513 | + } else { |
|
499 | 514 | print '<div id="chart9" class="chart" width="100%"></div> |
500 | 515 | <script> |
501 | 516 | google.load("visualization", "1", {packages:["corechart"]}); |
@@ -540,8 +555,9 @@ discard block |
||
540 | 555 | <h2><?php echo _("Busiest Day in the last 7 Days"); ?></h2> |
541 | 556 | <?php |
542 | 557 | $date_array = $Stats->countAllDatesLast7Days($airline_icao,$filter_name); |
543 | - if (empty($date_array)) print _("No data available"); |
|
544 | - else { |
|
558 | + if (empty($date_array)) { |
|
559 | + print _("No data available"); |
|
560 | + } else { |
|
545 | 561 | print '<div id="chart5" class="chart" width="100%"></div> |
546 | 562 | <script> |
547 | 563 | google.load("visualization", "1", {packages:["corechart"]}); |
@@ -587,8 +603,9 @@ discard block |
||
587 | 603 | <h2><?php echo _("Busiest Time of the Day"); ?></h2> |
588 | 604 | <?php |
589 | 605 | $hour_array = $Stats->countAllHours('hour',true,$airline_icao,$filter_name); |
590 | - if (empty($hour_array)) print _("No data available"); |
|
591 | - else { |
|
606 | + if (empty($hour_array)) { |
|
607 | + print _("No data available"); |
|
608 | + } else { |
|
592 | 609 | |
593 | 610 | print '<div id="chart6" class="chart" width="100%"></div> |
594 | 611 | <script> |
@@ -656,8 +673,11 @@ discard block |
||
656 | 673 | $distance = $distance; |
657 | 674 | $unit = 'km'; |
658 | 675 | } |
659 | - if (!isset($polar_data)) $polar_data = '{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
660 | - else $polar_data = $polar_data.',{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
676 | + if (!isset($polar_data)) { |
|
677 | + $polar_data = '{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
678 | + } else { |
|
679 | + $polar_data = $polar_data.',{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
680 | + } |
|
661 | 681 | } |
662 | 682 | ?> |
663 | 683 | <div class="col-md-6"> |
@@ -704,8 +724,11 @@ discard block |
||
704 | 724 | foreach ($msg as $eachmsg) { |
705 | 725 | //$eachmsg = $msg[0]; |
706 | 726 | $data = $eachmsg['source_data']; |
707 | - if ($data > 500) $max = (round(($data+100)/100))*100; |
|
708 | - else $max = 500; |
|
727 | + if ($data > 500) { |
|
728 | + $max = (round(($data+100)/100))*100; |
|
729 | + } else { |
|
730 | + $max = 500; |
|
731 | + } |
|
709 | 732 | ?> |
710 | 733 | <div id="msg-<?php print str_replace(' ','_',strtolower($eachmsg['source_name'])); ?>" class="col-md-4"></div> |
711 | 734 | <script> |
@@ -21,7 +21,9 @@ discard block |
||
21 | 21 | print '<option></option>'; |
22 | 22 | $Stats = new Stats(); |
23 | 23 | $airline_names = $Stats->getAllAirlineNames(); |
24 | - if (empty($airline_names)) $airline_names = $Spotter->getAllAirlineNames(); |
|
24 | + if (empty($airline_names)) { |
|
25 | + $airline_names = $Spotter->getAllAirlineNames(); |
|
26 | + } |
|
25 | 27 | foreach($airline_names as $airline_name) |
26 | 28 | { |
27 | 29 | if($airline == $airline_name['airline_icao']) |
@@ -43,8 +45,7 @@ discard block |
||
43 | 45 | if ($globalIVAO && @getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.gif')) |
44 | 46 | { |
45 | 47 | print '<img src="'.$globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.gif" alt="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" title="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" class="logo" />'; |
46 | - } |
|
47 | - elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png')) |
|
48 | + } elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png')) |
|
48 | 49 | { |
49 | 50 | print '<img src="'.$globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png" alt="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" title="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" class="logo" />'; |
50 | 51 | } |
@@ -22,7 +22,9 @@ |
||
22 | 22 | print '<option></option>'; |
23 | 23 | $Stats = new Stats(); |
24 | 24 | $airport_names = $tats->getAllAirportNames(); |
25 | - if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames(); |
|
25 | + if (empty($airport_names)) { |
|
26 | + $airport_names = $Spotter->getAllAirportNames(); |
|
27 | + } |
|
26 | 28 | ksort($airport_names); |
27 | 29 | foreach($airport_names as $airport_name) |
28 | 30 | { |
@@ -5,7 +5,9 @@ discard block |
||
5 | 5 | $Stats = new Stats(); |
6 | 6 | $title = _("Statistics").' - '._("Most common Arrival Airport by Country"); |
7 | 7 | |
8 | -if (!isset($filter_name)) $filter_name = ''; |
|
8 | +if (!isset($filter_name)) { |
|
9 | + $filter_name = ''; |
|
10 | +} |
|
9 | 11 | $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
10 | 12 | if ($airline_icao == 'all') { |
11 | 13 | unset($_COOKIE['stats_airline_icao']); |
@@ -14,8 +16,10 @@ discard block |
||
14 | 16 | } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) { |
15 | 17 | $airline_icao = $_COOKIE['stats_airline_icao']; |
16 | 18 | } elseif ($airline_icao == '' && isset($globalFilter)) { |
17 | - if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
18 | -} |
|
19 | + if (isset($globalFilter['airline'])) { |
|
20 | + $airline_icao = $globalFilter['airline'][0]; |
|
21 | + } |
|
22 | + } |
|
19 | 23 | setcookie('stats_airline_icao',$airline_icao); |
20 | 24 | |
21 | 25 | require_once('header.php'); |
@@ -5,7 +5,9 @@ discard block |
||
5 | 5 | $Stats = new Stats(); |
6 | 6 | $title = _("Statistics").' - '._("Most common Aircraft"); |
7 | 7 | |
8 | -if (!isset($filter_name)) $filter_name = ''; |
|
8 | +if (!isset($filter_name)) { |
|
9 | + $filter_name = ''; |
|
10 | +} |
|
9 | 11 | $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
10 | 12 | if ($airline_icao == 'all') { |
11 | 13 | unset($_COOKIE['stats_airline_icao']); |
@@ -14,8 +16,10 @@ discard block |
||
14 | 16 | } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) { |
15 | 17 | $airline_icao = $_COOKIE['stats_airline_icao']; |
16 | 18 | } elseif ($airline_icao == '' && isset($globalFilter)) { |
17 | - if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
18 | -} |
|
19 | + if (isset($globalFilter['airline'])) { |
|
20 | + $airline_icao = $globalFilter['airline'][0]; |
|
21 | + } |
|
22 | + } |
|
19 | 23 | setcookie('stats_airline_icao',$airline_icao); |
20 | 24 | |
21 | 25 | require_once('header.php'); |
@@ -22,7 +22,9 @@ |
||
22 | 22 | print '<option></option>'; |
23 | 23 | $Stats = new Stats(); |
24 | 24 | $aircraft_types = $Stats->getAllAircraftTypes(); |
25 | - if (empty($aircraft_types)) $aircraft_types = $Spotter->getAllAircraftTypes(); |
|
25 | + if (empty($aircraft_types)) { |
|
26 | + $aircraft_types = $Spotter->getAllAircraftTypes(); |
|
27 | + } |
|
26 | 28 | foreach($aircraft_types as $aircraft_type) |
27 | 29 | { |
28 | 30 | if($aircraft_type == $aircrafttype['aircraft_icao']) |
@@ -4,7 +4,9 @@ |
||
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | $Stats = new Stats(); |
6 | 6 | $title = _("Statistics").' - '._("Most common Airline by Country"); |
7 | -if (!isset($filter_name)) $filter_name = ''; |
|
7 | +if (!isset($filter_name)) { |
|
8 | + $filter_name = ''; |
|
9 | +} |
|
8 | 10 | require_once('header.php'); |
9 | 11 | include('statistics-sub-menu.php'); |
10 | 12 |