@@ -9,7 +9,10 @@ |
||
| 9 | 9 | <?php |
| 10 | 10 | } |
| 11 | 11 | ?> |
| 12 | - <span>Developed in Barrie by <a href="http://mtru.nz/" target="_blank">Mario Trunz</a> & at <a href="http://www.zugaina.com" target="_blank">Zugaina</a> by Ycarus</span> - <span><a href="<?php if (isset($globalURL)) print $globalURL; ?>/about#source">Source & Credits</a></span> - <span><a href="https://github.com/Ysurac/FlightAirMap/issues" target="_blank">Report any issues</a></span> |
|
| 12 | + <span>Developed in Barrie by <a href="http://mtru.nz/" target="_blank">Mario Trunz</a> & at <a href="http://www.zugaina.com" target="_blank">Zugaina</a> by Ycarus</span> - <span><a href="<?php if (isset($globalURL)) { |
|
| 13 | + print $globalURL; |
|
| 14 | +} |
|
| 15 | +?>/about#source">Source & Credits</a></span> - <span><a href="https://github.com/Ysurac/FlightAirMap/issues" target="_blank">Report any issues</a></span> |
|
| 13 | 16 | </footer> |
| 14 | 17 | |
| 15 | 18 | <div class="notifications bottom-left"></div> |
@@ -18,7 +18,9 @@ discard block |
||
| 18 | 18 | */ |
| 19 | 19 | public function getFilter($filter = array(),$where = false,$and = false) { |
| 20 | 20 | global $globalFilter; |
| 21 | - if (is_array($globalFilter)) $filter = array_merge($globalFilter,$filter); |
|
| 21 | + if (is_array($globalFilter)) { |
|
| 22 | + $filter = array_merge($globalFilter,$filter); |
|
| 23 | + } |
|
| 22 | 24 | $filter_query_join = ''; |
| 23 | 25 | $filter_query_where = ''; |
| 24 | 26 | if (isset($filter['airlines']) && !empty($filter['airlines'])) { |
@@ -43,8 +45,11 @@ discard block |
||
| 43 | 45 | $filter_query_where .= " AND format_source = 'aprs' AND source_name IN ('".implode("','",$filter['source_aprs'])."')"; |
| 44 | 46 | } |
| 45 | 47 | } |
| 46 | - if ($filter_query_where == '' && $where) $filter_query_where = ' WHERE'; |
|
| 47 | - elseif ($filter_query_where != '' && $and) $filter_query_where .= ' AND'; |
|
| 48 | + if ($filter_query_where == '' && $where) { |
|
| 49 | + $filter_query_where = ' WHERE'; |
|
| 50 | + } elseif ($filter_query_where != '' && $and) { |
|
| 51 | + $filter_query_where .= ' AND'; |
|
| 52 | + } |
|
| 48 | 53 | $filter_query = $filter_query_join.$filter_query_where; |
| 49 | 54 | return $filter_query; |
| 50 | 55 | } |
@@ -80,7 +85,9 @@ discard block |
||
| 80 | 85 | $orderby_query = ' '.$search_orderby_array[$sort]['sql']; |
| 81 | 86 | } |
| 82 | 87 | |
| 83 | - if (!isset($globalLiveInterval)) $globalLiveInterval = '200'; |
|
| 88 | + if (!isset($globalLiveInterval)) { |
|
| 89 | + $globalLiveInterval = '200'; |
|
| 90 | + } |
|
| 84 | 91 | if ($globalDBdriver == 'mysql') { |
| 85 | 92 | //$query = "SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL 30 SECOND) <= l.date GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate"; |
| 86 | 93 | $query = 'SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= l.date GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate'.$filter_query.$orderby_query; |
@@ -105,7 +112,9 @@ discard block |
||
| 105 | 112 | |
| 106 | 113 | $filter_query = $this->getFilter($filter); |
| 107 | 114 | |
| 108 | - if (!isset($globalLiveInterval)) $globalLiveInterval = '200'; |
|
| 115 | + if (!isset($globalLiveInterval)) { |
|
| 116 | + $globalLiveInterval = '200'; |
|
| 117 | + } |
|
| 109 | 118 | if ($globalDBdriver == 'mysql') { |
| 110 | 119 | // $query = "SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL ".$globalLiveInterval." SECOND) <= l.date GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate$orderby_query"; |
| 111 | 120 | // $query = 'SELECT spotter_live.ident, spotter_live.flightaware_id, spotter_live.aircraft_icao, spotter_live.departure_airport_icao as departure_airport, spotter_live.arrival_airport_icao as arrival_airport, spotter_live.latitude, spotter_live.longitude, spotter_live.altitude, spotter_live.heading, spotter_live.ground_speed, spotter_live.squawk, a.aircraft_shadow FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= l.date GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate INNER JOIN (SELECT * FROM aircraft) a on spotter_live.aircraft_icao = a.icao'; |
@@ -154,7 +163,9 @@ discard block |
||
| 154 | 163 | |
| 155 | 164 | $filter_query = $this->getFilter($filter,true,true); |
| 156 | 165 | |
| 157 | - if (!isset($globalLiveInterval)) $globalLiveInterval = '200'; |
|
| 166 | + if (!isset($globalLiveInterval)) { |
|
| 167 | + $globalLiveInterval = '200'; |
|
| 168 | + } |
|
| 158 | 169 | if ($globalDBdriver == 'mysql') { |
| 159 | 170 | |
| 160 | 171 | $query = 'SELECT a.aircraft_shadow, a.engine_type, a.engine_count, a.wake_category, spotter_live.ident, spotter_live.flightaware_id, spotter_live.aircraft_icao, spotter_live.departure_airport_icao as departure_airport, spotter_live.arrival_airport_icao as arrival_airport, spotter_live.latitude, spotter_live.longitude, spotter_live.altitude, spotter_live.heading, spotter_live.ground_speed, spotter_live.squawk, spotter_live.date, spotter_live.format_source |
@@ -194,7 +205,9 @@ discard block |
||
| 194 | 205 | global $globalDBdriver, $globalLiveInterval; |
| 195 | 206 | $filter_query = $this->getFilter($filter); |
| 196 | 207 | |
| 197 | - if (!isset($globalLiveInterval)) $globalLiveInterval = '200'; |
|
| 208 | + if (!isset($globalLiveInterval)) { |
|
| 209 | + $globalLiveInterval = '200'; |
|
| 210 | + } |
|
| 198 | 211 | if ($globalDBdriver == 'mysql') { |
| 199 | 212 | //$query = 'SELECT COUNT(*) as nb FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= l.date GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate'.$filter_query; |
| 200 | 213 | $query = 'SELECT COUNT(DISTINCT flightaware_id) as nb FROM spotter_live WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= date'.$filter_query; |
@@ -223,7 +236,9 @@ discard block |
||
| 223 | 236 | { |
| 224 | 237 | global $globalDBdriver, $globalLiveInterval; |
| 225 | 238 | $Spotter = new Spotter($this->db); |
| 226 | - if (!isset($globalLiveInterval)) $globalLiveInterval = '200'; |
|
| 239 | + if (!isset($globalLiveInterval)) { |
|
| 240 | + $globalLiveInterval = '200'; |
|
| 241 | + } |
|
| 227 | 242 | $filter_query = $this->getFilter($filter); |
| 228 | 243 | |
| 229 | 244 | if (is_array($coord)) { |
@@ -231,7 +246,9 @@ discard block |
||
| 231 | 246 | $minlat = filter_var($coord[1],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
| 232 | 247 | $maxlong = filter_var($coord[2],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
| 233 | 248 | $maxlat = filter_var($coord[3],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
| 234 | - } else return array(); |
|
| 249 | + } else { |
|
| 250 | + return array(); |
|
| 251 | + } |
|
| 235 | 252 | if ($globalDBdriver == 'mysql') { |
| 236 | 253 | //$query = "SELECT spotter_output.* FROM spotter_output WHERE spotter_output.flightaware_id IN (SELECT spotter_live.flightaware_id FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL ".$globalLiveInterval." SECOND) <= l.date GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate AND spotter_live.latitude BETWEEN ".$minlat." AND ".$maxlat." AND spotter_live.longitude BETWEEN ".$minlong." AND ".$maxlong.")"; |
| 237 | 254 | $query = 'SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= l.date GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate AND spotter_live.latitude BETWEEN '.$minlat.' AND '.$maxlat.' AND spotter_live.longitude BETWEEN '.$minlong.' AND '.$maxlong.' GROUP BY spotter_live.flightaware_id'.$filter_query; |
@@ -422,11 +439,15 @@ discard block |
||
| 422 | 439 | //$query = self::$global_query.' WHERE spotter_live.flightaware_id = :id ORDER BY date'; |
| 423 | 440 | if ($globalDBdriver == 'mysql') { |
| 424 | 441 | $query = 'SELECT spotter_live.* FROM spotter_live WHERE spotter_live.flightaware_id = :id'; |
| 425 | - if ($liveinterval) $query .= ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= date'; |
|
| 442 | + if ($liveinterval) { |
|
| 443 | + $query .= ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= date'; |
|
| 444 | + } |
|
| 426 | 445 | $query .= ' ORDER BY date'; |
| 427 | 446 | } else { |
| 428 | 447 | $query = 'SELECT spotter_live.* FROM spotter_live WHERE spotter_live.flightaware_id = :id'; |
| 429 | - if ($liveinterval) $query .= " AND CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$globalLiveInterval." SECONDS' <= date"; |
|
| 448 | + if ($liveinterval) { |
|
| 449 | + $query .= " AND CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$globalLiveInterval." SECONDS' <= date"; |
|
| 450 | + } |
|
| 430 | 451 | $query .= ' ORDER BY date'; |
| 431 | 452 | } |
| 432 | 453 | |
@@ -521,7 +542,9 @@ discard block |
||
| 521 | 542 | $i++; |
| 522 | 543 | $j++; |
| 523 | 544 | if ($j == 30) { |
| 524 | - if ($globalDebug) echo "."; |
|
| 545 | + if ($globalDebug) { |
|
| 546 | + echo "."; |
|
| 547 | + } |
|
| 525 | 548 | try { |
| 526 | 549 | |
| 527 | 550 | $sth = $this->db->prepare(substr($query_delete,0,-1).")"); |
@@ -853,7 +876,9 @@ discard block |
||
| 853 | 876 | { |
| 854 | 877 | return false; |
| 855 | 878 | } |
| 856 | - } else $altitude = 0; |
|
| 879 | + } else { |
|
| 880 | + $altitude = 0; |
|
| 881 | + } |
|
| 857 | 882 | |
| 858 | 883 | if ($heading != '') |
| 859 | 884 | { |
@@ -861,7 +886,9 @@ discard block |
||
| 861 | 886 | { |
| 862 | 887 | return false; |
| 863 | 888 | } |
| 864 | - } else $heading = 0; |
|
| 889 | + } else { |
|
| 890 | + $heading = 0; |
|
| 891 | + } |
|
| 865 | 892 | |
| 866 | 893 | if ($groundspeed != '') |
| 867 | 894 | { |
@@ -869,9 +896,13 @@ discard block |
||
| 869 | 896 | { |
| 870 | 897 | return false; |
| 871 | 898 | } |
| 872 | - } else $groundspeed = 0; |
|
| 899 | + } else { |
|
| 900 | + $groundspeed = 0; |
|
| 901 | + } |
|
| 873 | 902 | date_default_timezone_set('UTC'); |
| 874 | - if ($date == '') $date = date("Y-m-d H:i:s", time()); |
|
| 903 | + if ($date == '') { |
|
| 904 | + $date = date("Y-m-d H:i:s", time()); |
|
| 905 | + } |
|
| 875 | 906 | |
| 876 | 907 | |
| 877 | 908 | $flightaware_id = filter_var($flightaware_id,FILTER_SANITIZE_STRING); |
@@ -915,10 +946,18 @@ discard block |
||
| 915 | 946 | $arrival_airport_country = ''; |
| 916 | 947 | |
| 917 | 948 | |
| 918 | - if ($squawk == '' || $Common->isInteger($squawk) === false ) $squawk = NULL; |
|
| 919 | - if ($verticalrate == '' || $Common->isInteger($verticalrate) === false ) $verticalrate = NULL; |
|
| 920 | - if ($groundspeed == '' || $Common->isInteger($groundspeed) === false ) $groundspeed = 0; |
|
| 921 | - if ($heading == '' || $Common->isInteger($heading) === false ) $heading = 0; |
|
| 949 | + if ($squawk == '' || $Common->isInteger($squawk) === false ) { |
|
| 950 | + $squawk = NULL; |
|
| 951 | + } |
|
| 952 | + if ($verticalrate == '' || $Common->isInteger($verticalrate) === false ) { |
|
| 953 | + $verticalrate = NULL; |
|
| 954 | + } |
|
| 955 | + if ($groundspeed == '' || $Common->isInteger($groundspeed) === false ) { |
|
| 956 | + $groundspeed = 0; |
|
| 957 | + } |
|
| 958 | + if ($heading == '' || $Common->isInteger($heading) === false ) { |
|
| 959 | + $heading = 0; |
|
| 960 | + } |
|
| 922 | 961 | |
| 923 | 962 | $query = 'INSERT INTO spotter_live (flightaware_id, ident, registration, airline_name, airline_icao, airline_country, airline_type, aircraft_icao, aircraft_shadow, 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, ModeS, pilot_id, pilot_name, verticalrate, ground, format_source, source_name, over_country) |
| 924 | 963 | VALUES (:flightaware_id,:ident,:registration,:airline_name,:airline_icao,:airline_country,:airline_type,:aircraft_icao,:aircraft_shadow,: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,:ModeS, :pilot_id, :pilot_name, :verticalrate, :ground, :format_source, :source_name, :over_country)'; |
@@ -933,9 +972,13 @@ discard block |
||
| 933 | 972 | return "error : ".$e->getMessage(); |
| 934 | 973 | } |
| 935 | 974 | if (isset($globalArchive) && $globalArchive && $putinarchive && !$noarchive) { |
| 936 | - if ($globalDebug) echo '(Add to SBS archive : '; |
|
| 975 | + if ($globalDebug) { |
|
| 976 | + echo '(Add to SBS archive : '; |
|
| 977 | + } |
|
| 937 | 978 | $result = $SpotterArchive->addSpotterArchiveData($flightaware_id, $ident, $registration, $airline_name, $airline_icao, $airline_country, $airline_type, $aircraft_icao, $aircraft_shadow, $aircraft_name, $aircraft_manufacturer, $departure_airport_icao, $departure_airport_name, $departure_airport_city, $departure_airport_country, $departure_airport_time,$arrival_airport_icao, $arrival_airport_name, $arrival_airport_city, $arrival_airport_country, $arrival_airport_time, $route_stop, $date,$latitude, $longitude, $waypoints, $altitude, $heading, $groundspeed, $squawk, $ModeS, $pilot_id, $pilot_name,$verticalrate,$format_source,$source_name, $over_country); |
| 938 | - if ($globalDebug) echo $result.')'; |
|
| 979 | + if ($globalDebug) { |
|
| 980 | + echo $result.')'; |
|
| 981 | + } |
|
| 939 | 982 | } |
| 940 | 983 | return "success"; |
| 941 | 984 | |
@@ -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> |
@@ -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'); |
@@ -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'); |
@@ -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'); |
@@ -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'); |
@@ -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'); |
@@ -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'); |