@@ -8,31 +8,31 @@ discard block |
||
8 | 8 | if (isset($_COOKIE['MapType']) && $_COOKIE['MapType'] != '') $MapType = $_COOKIE['MapType']; |
9 | 9 | else $MapType = $globalMapProvider; |
10 | 10 | if (isset($_GET['3d'])) { |
11 | - setcookie('MapFormat','3d'); |
|
11 | + setcookie('MapFormat', '3d'); |
|
12 | 12 | } else if (isset($_GET['2d'])) { |
13 | - setcookie('MapFormat','2d'); |
|
13 | + setcookie('MapFormat', '2d'); |
|
14 | 14 | } |
15 | 15 | |
16 | 16 | if (isset($_POST['archive'])) { |
17 | - setcookie('archive','true'); |
|
18 | - setcookie('archive_begin',strtotime($_POST['start_date'])); |
|
19 | - setcookie('archive_end',strtotime($_POST['end_date'])); |
|
20 | - setcookie('archive_speed',$_POST['archivespeed']); |
|
17 | + setcookie('archive', 'true'); |
|
18 | + setcookie('archive_begin', strtotime($_POST['start_date'])); |
|
19 | + setcookie('archive_end', strtotime($_POST['end_date'])); |
|
20 | + setcookie('archive_speed', $_POST['archivespeed']); |
|
21 | 21 | } |
22 | 22 | if (isset($_POST['noarchive'])) { |
23 | - setcookie('archive','false',-1); |
|
24 | - setcookie('archive_begin','',-1); |
|
25 | - setcookie('archive_end','',-1); |
|
26 | - setcookie('archive_speed','',-1); |
|
23 | + setcookie('archive', 'false', -1); |
|
24 | + setcookie('archive_begin', '', -1); |
|
25 | + setcookie('archive_end', '', -1); |
|
26 | + setcookie('archive_speed', '', -1); |
|
27 | 27 | } |
28 | 28 | // When button "Remove all filters" is clicked |
29 | 29 | if (isset($_POST['removefilters'])) { |
30 | - $allfilters = array_filter(array_keys($_COOKIE),function($key) { |
|
31 | - return strpos($key,'filter_') === 0; |
|
30 | + $allfilters = array_filter(array_keys($_COOKIE), function($key) { |
|
31 | + return strpos($key, 'filter_') === 0; |
|
32 | 32 | }); |
33 | 33 | foreach ($allfilters as $filt) { |
34 | 34 | unset($_COOKIE[$filt]); |
35 | - setcookie($filt,null,-1); |
|
35 | + setcookie($filt, null, -1); |
|
36 | 36 | } |
37 | 37 | } |
38 | 38 | |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | <script src="<?php print $globalURL; ?>/js/Marker.Rotate.js"></script> |
217 | 217 | <script src="<?php print $globalURL; ?>/js/MovingMarker.js"></script> |
218 | 218 | <script src="<?php print $globalURL; ?>/js/jquery.idle.min.js"></script> |
219 | -<script src="<?php print $globalURL; ?>/js/map.js.php?ident=<?php print $ident; ?><?php if(isset($latitude)) print '&latitude='.$latitude; ?><?php if(isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script> |
|
219 | +<script src="<?php print $globalURL; ?>/js/map.js.php?ident=<?php print $ident; ?><?php if (isset($latitude)) print '&latitude='.$latitude; ?><?php if (isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script> |
|
220 | 220 | <?php |
221 | 221 | if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '' && ($MapType == 'Google-Roadmap' || $MapType == 'Google-Satellite' || $MapType == 'Google-Hybrid' || $MapType == 'Google-Terrain')) { |
222 | 222 | ?> |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | <script src="<?php print $globalURL; ?>/js/Marker.Rotate.js"></script> |
271 | 271 | <script src="<?php print $globalURL; ?>/js/MovingMarker.js"></script> |
272 | 272 | <script src="<?php print $globalURL; ?>/js/jquery.idle.min.js"></script> |
273 | -<script src="<?php print $globalURL; ?>/js/map.js.php?flightaware_id=<?php print $flightaware_id; ?><?php if(isset($latitude)) print '&latitude='.$latitude; ?><?php if(isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script> |
|
273 | +<script src="<?php print $globalURL; ?>/js/map.js.php?flightaware_id=<?php print $flightaware_id; ?><?php if (isset($latitude)) print '&latitude='.$latitude; ?><?php if (isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script> |
|
274 | 274 | <?php |
275 | 275 | if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '' && ($MapType == 'Google-Roadmap' || $MapType == 'Google-Satellite' || $MapType == 'Google-Hybrid' || $MapType == 'Google-Terrain')) { |
276 | 276 | ?> |
@@ -433,7 +433,7 @@ discard block |
||
433 | 433 | ?> |
434 | 434 | <div class="search"> |
435 | 435 | <form action="<?php print $globalURL; ?>/search" method="get"> |
436 | - <input type="text" name="q" value="<?php if (isset($GET['q'])) { if ($_GET['q'] != ""){ print $_GET['q']; } else { print _("Search"); } } else { print _("Search"); } ?>" onfocus="if (this.value=='search'){this.value='';}" /><button type="submit"><i class="fa fa-search"></i></button> |
|
436 | + <input type="text" name="q" value="<?php if (isset($GET['q'])) { if ($_GET['q'] != "") { print $_GET['q']; } else { print _("Search"); } } else { print _("Search"); } ?>" onfocus="if (this.value=='search'){this.value='';}" /><button type="submit"><i class="fa fa-search"></i></button> |
|
437 | 437 | </form> |
438 | 438 | </div> |
439 | 439 | <div class="social"> |
@@ -451,14 +451,14 @@ discard block |
||
451 | 451 | print '</div>'; |
452 | 452 | } |
453 | 453 | |
454 | -if (strtolower($current_page) =='ident-detailed' || strtolower($current_page) == 'flightid-overview') { |
|
454 | +if (strtolower($current_page) == 'ident-detailed' || strtolower($current_page) == 'flightid-overview') { |
|
455 | 455 | ?> |
456 | 456 | <div class="top-header clear" role="main"> |
457 | 457 | <div id="archive-map"></div> |
458 | 458 | </div> |
459 | 459 | <?php |
460 | 460 | } |
461 | -if ((strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false) || (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false)) |
|
461 | +if ((strpos(strtolower($current_page), 'airport-') !== false && strpos(strtolower($current_page), 'statistics-') === false) || (strpos(strtolower($current_page), 'route-') !== false && strpos(strtolower($current_page), 'statistics-') === false)) |
|
462 | 462 | { |
463 | 463 | ?> |
464 | 464 | <div class="top-header clear" role="main"> |
@@ -471,15 +471,15 @@ discard block |
||
471 | 471 | var zoom = 13; |
472 | 472 | //create the map |
473 | 473 | <?php |
474 | - if (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($airport_array[0]['latitude'])) { |
|
474 | + if (strpos(strtolower($current_page), 'airport-') !== false && strpos(strtolower($current_page), 'statistics-') === false && isset($airport_array[0]['latitude'])) { |
|
475 | 475 | ?> |
476 | 476 | map = L.map('map', { zoomControl:true }).setView([<?php print $airport_array[0]['latitude']; ?>,<?php print $airport_array[0]['longitude']; ?>], zoom); |
477 | 477 | <?php |
478 | - } elseif (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false) { |
|
478 | + } elseif (strpos(strtolower($current_page), 'airport-') !== false && strpos(strtolower($current_page), 'statistics-') === false) { |
|
479 | 479 | ?> |
480 | 480 | map = L.map('map', { zoomControl:true }); |
481 | 481 | <?php |
482 | - } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($spotter_array[0]['departure_airport_latitude'])) { |
|
482 | + } elseif (strpos(strtolower($current_page), 'route-') !== false && strpos(strtolower($current_page), 'statistics-') === false && isset($spotter_array[0]['departure_airport_latitude'])) { |
|
483 | 483 | ?> |
484 | 484 | map = L.map('map', { zoomControl:true }).setView([<?php print $spotter_array[0]['departure_airport_latitude']; ?>,<?php print $spotter_array[0]['arrival_airport_longitude']; ?>]); |
485 | 485 | var line = L.polyline([[<?php print $spotter_array[0]['departure_airport_latitude']; ?>, <?php print $spotter_array[0]['departure_airport_longitude']; ?>],[<?php print $spotter_array[0]['arrival_airport_latitude']; ?>, <?php print $spotter_array[0]['arrival_airport_longitude']; ?>]]).addTo(map); |
@@ -487,7 +487,7 @@ discard block |
||
487 | 487 | var departure_airport = L.marker([<?php print $spotter_array[0]['departure_airport_latitude']; ?>, <?php print $spotter_array[0]['departure_airport_longitude']; ?>], {icon: L.icon({iconUrl: '<?php print $globalURL; ?>/images/departure_airport.png',iconSize: [16,18],iconAnchor: [8,16]})}).addTo(map); |
488 | 488 | var arrival_airport = L.marker([<?php print $spotter_array[0]['arrival_airport_latitude']; ?>, <?php print $spotter_array[0]['arrival_airport_longitude']; ?>], {icon: L.icon({iconUrl: '<?php print $globalURL; ?>/images/arrival_airport.png',iconSize: [16,18],iconAnchor: [8,16]})}).addTo(map); |
489 | 489 | <?php |
490 | - } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && !isset($spotter_array[0]['departure_airport_latitude'])) { |
|
490 | + } elseif (strpos(strtolower($current_page), 'route-') !== false && strpos(strtolower($current_page), 'statistics-') === false && !isset($spotter_array[0]['departure_airport_latitude'])) { |
|
491 | 491 | ?> |
492 | 492 | map = L.map('map', { zoomControl:true }).setView([<?php print $spotter_array[0]['latitude']; ?>,<?php print $spotter_array[0]['longitude']; ?>]); |
493 | 493 | <?php |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | $Connection = new Connection(); |
55 | 55 | $sth = $Connection->db->prepare($query); |
56 | 56 | $sth->execute(); |
57 | - } catch(PDOException $e) { |
|
57 | + } catch (PDOException $e) { |
|
58 | 58 | return "error : ".$e->getMessage(); |
59 | 59 | } |
60 | 60 | $row = $sth->fetch(PDO::FETCH_ASSOC); |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | $Connection = new Connection(); |
71 | 71 | $sth = $Connection->db->prepare($query); |
72 | 72 | $sth->execute(); |
73 | - } catch(PDOException $e) { |
|
73 | + } catch (PDOException $e) { |
|
74 | 74 | return "error : ".$e->getMessage(); |
75 | 75 | } |
76 | 76 | } |
@@ -80,9 +80,9 @@ discard block |
||
80 | 80 | public function parse($data) { |
81 | 81 | //$data = str_replace(array('\n','\r','\r','\n'),'',$data); |
82 | 82 | $codes = implode('|', array_keys($this->texts)); |
83 | - $regWeather = '#^(\+|\-|VC)?(' . $codes . ')(' . $codes . ')?$#'; |
|
83 | + $regWeather = '#^(\+|\-|VC)?('.$codes.')('.$codes.')?$#'; |
|
84 | 84 | //$pieces = explode(' ',$data); |
85 | - $pieces = preg_split('/\s/',$data); |
|
85 | + $pieces = preg_split('/\s/', $data); |
|
86 | 86 | $pos = 0; |
87 | 87 | if ($pieces[0] == 'METAR') $pos++; |
88 | 88 | elseif ($pieces[0] == 'SPECI') $pos++; |
@@ -90,25 +90,25 @@ discard block |
||
90 | 90 | $result = array(); |
91 | 91 | $result['location'] = $pieces[$pos]; |
92 | 92 | $pos++; |
93 | - $result['dayofmonth'] = substr($pieces[$pos],0,2); |
|
94 | - $result['time'] = substr($pieces[$pos],2,4); |
|
93 | + $result['dayofmonth'] = substr($pieces[$pos], 0, 2); |
|
94 | + $result['time'] = substr($pieces[$pos], 2, 4); |
|
95 | 95 | $c = count($pieces); |
96 | - for($pos++; $pos < $c; $pos++) { |
|
96 | + for ($pos++; $pos < $c; $pos++) { |
|
97 | 97 | $piece = $pieces[$pos]; |
98 | 98 | if ($piece == 'RMK') break; |
99 | 99 | if ($piece == 'AUTO') $result['auto'] = true; |
100 | 100 | if ($piece == 'COR') $result['correction'] = true; |
101 | 101 | // Wind Speed |
102 | 102 | if (preg_match('#(VRB|\d\d\d)(\d\d)(?:G(\d\d))?(KT|MPS|KPH)(?: (\d{1,3})V(\d{1,3}))?$#', $piece, $matches)) { |
103 | - $result['wind']['direction'] = (float)$matches[1]; |
|
103 | + $result['wind']['direction'] = (float) $matches[1]; |
|
104 | 104 | $result['wind']['unit'] = $matches[4]; |
105 | - if ($result['wind']['unit'] == 'KT') $result['wind']['speed'] = round(((float)$matches[2])*0.51444444444,2); |
|
106 | - elseif ($result['wind']['unit'] == 'KPH') $result['wind']['speed'] = round(((float)$matches[2])*1000,2); |
|
107 | - elseif ($result['wind']['unit'] == 'MPS') $result['wind']['speed'] = round(((float)$matches[2]),2); |
|
108 | - $result['wind']['gust'] = (float)$matches[3]; |
|
105 | + if ($result['wind']['unit'] == 'KT') $result['wind']['speed'] = round(((float) $matches[2])*0.51444444444, 2); |
|
106 | + elseif ($result['wind']['unit'] == 'KPH') $result['wind']['speed'] = round(((float) $matches[2])*1000, 2); |
|
107 | + elseif ($result['wind']['unit'] == 'MPS') $result['wind']['speed'] = round(((float) $matches[2]), 2); |
|
108 | + $result['wind']['gust'] = (float) $matches[3]; |
|
109 | 109 | $result['wind']['unit'] = $matches[4]; |
110 | - $result['wind']['min_variation'] = array_key_exists(5,$matches) ? $matches[5] : 0; |
|
111 | - $result['wind']['max_variation'] = array_key_exists(6,$matches) ? $matches[6] : 0; |
|
110 | + $result['wind']['min_variation'] = array_key_exists(5, $matches) ? $matches[5] : 0; |
|
111 | + $result['wind']['max_variation'] = array_key_exists(6, $matches) ? $matches[6] : 0; |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | /* if (preg_match('#^([0-9]{3})([0-9]{2})(G([0-9]{2}))?(KT|MPS)$#', $piece, $matches)) { |
@@ -128,14 +128,14 @@ discard block |
||
128 | 128 | */ |
129 | 129 | // Temperature |
130 | 130 | if (preg_match('#^(M?[0-9]{2,})/(M?[0-9]{2,})$#', $piece, $matches)) { |
131 | - $temp = (float)$matches[1]; |
|
131 | + $temp = (float) $matches[1]; |
|
132 | 132 | if ($matches[1]{0} == 'M') { |
133 | - $temp = ((float)substr($matches[1], 1)) * -1; |
|
133 | + $temp = ((float) substr($matches[1], 1))*-1; |
|
134 | 134 | } |
135 | 135 | $result['temperature'] = $temp; |
136 | - $dew = (float)$matches[2]; |
|
136 | + $dew = (float) $matches[2]; |
|
137 | 137 | if ($matches[2]{0} == 'M') { |
138 | - $dew = ((float)substr($matches[2], 1)) * -1; |
|
138 | + $dew = ((float) substr($matches[2], 1))*-1; |
|
139 | 139 | } |
140 | 140 | $result['dew'] = $dew; |
141 | 141 | } |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | $result['QNH'] = $matches[2]; |
148 | 148 | } else { |
149 | 149 | // inHg |
150 | - $result['QNH'] = round(($matches[2] / 100)*33.86389,2); |
|
150 | + $result['QNH'] = round(($matches[2]/100)*33.86389, 2); |
|
151 | 151 | } |
152 | 152 | /* |
153 | 153 | $result['QNH'] = $matches[1] == 'Q' ? $matches[2] : ($matches[2] / 100); |
@@ -168,12 +168,12 @@ discard block |
||
168 | 168 | // Visibility |
169 | 169 | if (preg_match('#^([0-9]{4})|(([0-9]{1,4})SM)$#', $piece, $matches)) { |
170 | 170 | if (isset($matches[3]) && strlen($matches[3]) > 0) { |
171 | - $result['visibility'] = (float)$matches[3] * 1609.34; |
|
171 | + $result['visibility'] = (float) $matches[3]*1609.34; |
|
172 | 172 | } else { |
173 | 173 | if ($matches[1] == '9999') { |
174 | 174 | $result['visibility'] = '> 10000'; |
175 | 175 | } else { |
176 | - $result['visibility'] = (float)$matches[1]; |
|
176 | + $result['visibility'] = (float) $matches[1]; |
|
177 | 177 | } |
178 | 178 | } |
179 | 179 | if (preg_match('#^CAVOK$#', $piece, $matches)) { |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | elseif ($type == 'OVC') $cloud['type'] = 'Overcast/Full cloud coverage'; |
196 | 196 | elseif ($type == 'VV') $cloud['type'] = 'Vertical visibility'; |
197 | 197 | $cloud['type_code'] = $type; |
198 | - $cloud['level'] = round(((float)$matches[2]) * 100 * 0.3048); |
|
198 | + $cloud['level'] = round(((float) $matches[2])*100*0.3048); |
|
199 | 199 | $cloud['significant'] = isset($matches[3]) ? $matches[3] : ''; |
200 | 200 | $result['cloud'][] = $cloud; |
201 | 201 | } |
@@ -205,8 +205,8 @@ discard block |
||
205 | 205 | $rvr['runway'] = $matches[1]; |
206 | 206 | $rvr['assessment'] = $matches[2]; |
207 | 207 | $rvr['rvr'] = $matches[3]; |
208 | - $rvr['rvr_max'] = array_key_exists(4,$matches) ? $matches[4] : 0; |
|
209 | - $rvr['unit'] = array_key_exists(5,$matches) ? $matches[5] : ''; |
|
208 | + $rvr['rvr_max'] = array_key_exists(4, $matches) ? $matches[4] : 0; |
|
209 | + $rvr['unit'] = array_key_exists(5, $matches) ? $matches[5] : ''; |
|
210 | 210 | $result['RVR'] = $rvr; |
211 | 211 | } |
212 | 212 | |
@@ -223,12 +223,12 @@ discard block |
||
223 | 223 | if (preg_match('#^(R[A-Z0-9]{2,3})/([0-9]{4})(V([0-9]{4}))?(FT)?$#', $piece, $matches)) { |
224 | 224 | //echo $piece; |
225 | 225 | //print_r($matches); |
226 | - if (isset($matches[5])) $range = array('exact' => (float)$matches[2], 'unit' => $matches[5] ? 'FT' : 'M'); |
|
227 | - else $range = array('exact' => (float)$matches[2], 'unit' => 'M'); |
|
226 | + if (isset($matches[5])) $range = array('exact' => (float) $matches[2], 'unit' => $matches[5] ? 'FT' : 'M'); |
|
227 | + else $range = array('exact' => (float) $matches[2], 'unit' => 'M'); |
|
228 | 228 | if (isset($matches[3])) { |
229 | 229 | $range = Array( |
230 | - 'from' => (float)$matches[2], |
|
231 | - 'to' => (float)$matches[4], |
|
230 | + 'from' => (float) $matches[2], |
|
231 | + 'to' => (float) $matches[4], |
|
232 | 232 | 'unit' => $matches[5] ? 'FT' : 'M' |
233 | 233 | ); |
234 | 234 | } |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | try { |
278 | 278 | $sth = $this->db->prepare($query); |
279 | 279 | $sth->execute($query_values); |
280 | - } catch(PDOException $e) { |
|
280 | + } catch (PDOException $e) { |
|
281 | 281 | return "error : ".$e->getMessage(); |
282 | 282 | } |
283 | 283 | $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
@@ -287,19 +287,19 @@ discard block |
||
287 | 287 | return $all; |
288 | 288 | } |
289 | 289 | |
290 | - public function addMETAR($location,$metar,$date) { |
|
290 | + public function addMETAR($location, $metar, $date) { |
|
291 | 291 | global $globalDBdriver; |
292 | - $date = date('Y-m-d H:i:s',strtotime($date)); |
|
292 | + $date = date('Y-m-d H:i:s', strtotime($date)); |
|
293 | 293 | if ($globalDBdriver == 'mysql') { |
294 | 294 | $query = "INSERT INTO metar (metar_location,metar_date,metar) VALUES (:location,:date,:metar) ON DUPLICATE KEY UPDATE metar_date = :date, metar = :metar"; |
295 | 295 | } else { |
296 | 296 | $query = "UPDATE metar SET metar_date = :date, metar = metar WHERE metar_location = :location;INSERT INTO metar (metar_location,metar_date,metar) SELECT :location,:date,:metar WHERE NOT EXISTS (SELECT 1 FROM metar WHERE metar_location = :location);"; |
297 | 297 | } |
298 | - $query_values = array(':location' => $location,':date' => $date,':metar' => utf8_encode($metar)); |
|
298 | + $query_values = array(':location' => $location, ':date' => $date, ':metar' => utf8_encode($metar)); |
|
299 | 299 | try { |
300 | 300 | $sth = $this->db->prepare($query); |
301 | 301 | $sth->execute($query_values); |
302 | - } catch(PDOException $e) { |
|
302 | + } catch (PDOException $e) { |
|
303 | 303 | return "error : ".$e->getMessage(); |
304 | 304 | } |
305 | 305 | } |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | try { |
311 | 311 | $sth = $this->db->prepare($query); |
312 | 312 | $sth->execute($query_values); |
313 | - } catch(PDOException $e) { |
|
313 | + } catch (PDOException $e) { |
|
314 | 314 | return "error : ".$e->getMessage(); |
315 | 315 | } |
316 | 316 | } |
@@ -319,7 +319,7 @@ discard block |
||
319 | 319 | try { |
320 | 320 | $sth = $this->db->prepare($query); |
321 | 321 | $sth->execute(); |
322 | - } catch(PDOException $e) { |
|
322 | + } catch (PDOException $e) { |
|
323 | 323 | return "error : ".$e->getMessage(); |
324 | 324 | } |
325 | 325 | } |
@@ -336,8 +336,8 @@ discard block |
||
336 | 336 | } |
337 | 337 | if (isset($globalDebug) && $globalDebug) echo "Done - Updating DB..."; |
338 | 338 | $date = ''; |
339 | - foreach(explode("\n",$cycle) as $line) { |
|
340 | - if (preg_match('#^([0-9]{4})/([0-9]{2})/([0-9]{2}) ([0-9]{2}):([0-9]{2})$#',$line)) { |
|
339 | + foreach (explode("\n", $cycle) as $line) { |
|
340 | + if (preg_match('#^([0-9]{4})/([0-9]{2})/([0-9]{2}) ([0-9]{2}):([0-9]{2})$#', $line)) { |
|
341 | 341 | //echo "date : ".$line."\n"; |
342 | 342 | $date = $line; |
343 | 343 | } |
@@ -346,11 +346,11 @@ discard block |
||
346 | 346 | //echo $line; |
347 | 347 | if ($date == '') $date = date('Y/m/d H:m'); |
348 | 348 | $pos = 0; |
349 | - $pieces = preg_split('/\s/',$line); |
|
349 | + $pieces = preg_split('/\s/', $line); |
|
350 | 350 | if ($pieces[0] == 'METAR') $pos++; |
351 | 351 | if (strlen($pieces[$pos]) != 4) $pos++; |
352 | 352 | $location = $pieces[$pos]; |
353 | - echo $this->addMETAR($location,$line,$date); |
|
353 | + echo $this->addMETAR($location, $line, $date); |
|
354 | 354 | } |
355 | 355 | //echo $line."\n"; |
356 | 356 | } |
@@ -362,11 +362,11 @@ discard block |
||
362 | 362 | if ($globalMETARurl == '') return array(); |
363 | 363 | date_default_timezone_set("UTC"); |
364 | 364 | $Common = new Common(); |
365 | - $url = str_replace('{icao}',$icao,$globalMETARurl); |
|
365 | + $url = str_replace('{icao}', $icao, $globalMETARurl); |
|
366 | 366 | $cycle = $Common->getData($url); |
367 | 367 | $date = ''; |
368 | - foreach(explode("\n",$cycle) as $line) { |
|
369 | - if (preg_match('#^([0-9]{4})/([0-9]{2})/([0-9]{2}) ([0-9]{2}):([0-9]{2})$#',$line)) { |
|
368 | + foreach (explode("\n", $cycle) as $line) { |
|
369 | + if (preg_match('#^([0-9]{4})/([0-9]{2})/([0-9]{2}) ([0-9]{2}):([0-9]{2})$#', $line)) { |
|
370 | 370 | //echo "date : ".$line."\n"; |
371 | 371 | $date = $line; |
372 | 372 | } |
@@ -375,12 +375,12 @@ discard block |
||
375 | 375 | //echo $line; |
376 | 376 | if ($date == '') $date = date('Y/m/d H:m'); |
377 | 377 | $pos = 0; |
378 | - $pieces = preg_split('/\s/',$line); |
|
378 | + $pieces = preg_split('/\s/', $line); |
|
379 | 379 | if ($pieces[0] == 'METAR') $pos++; |
380 | 380 | if (strlen($pieces[$pos]) != 4) $pos++; |
381 | 381 | $location = $pieces[$pos]; |
382 | 382 | if (strlen($location == 4)) { |
383 | - $this->addMETAR($location,$line,$date); |
|
383 | + $this->addMETAR($location, $line, $date); |
|
384 | 384 | return array('0' => array('metar_date' => $date, 'metar_location' => $location, 'metar' => $line)); |
385 | 385 | } else return array(); |
386 | 386 | } |
@@ -7,17 +7,17 @@ discard block |
||
7 | 7 | $title = _("Statistics"); |
8 | 8 | |
9 | 9 | if (!isset($filter_name)) $filter_name = ''; |
10 | -$airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
|
10 | +$airline_icao = (string) filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING); |
|
11 | 11 | if ($airline_icao == 'all') { |
12 | 12 | unset($_COOKIE['stats_airline_icao']); |
13 | - setcookie('stats_airline_icao', '', time()-3600); |
|
13 | + setcookie('stats_airline_icao', '', time() - 3600); |
|
14 | 14 | $airline_icao = ''; |
15 | 15 | } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) { |
16 | 16 | $airline_icao = $_COOKIE['stats_airline_icao']; |
17 | 17 | } elseif ($airline_icao == '' && isset($globalFilter)) { |
18 | 18 | if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
19 | 19 | } |
20 | -setcookie('stats_airline_icao',$airline_icao); |
|
20 | +setcookie('stats_airline_icao', $airline_icao); |
|
21 | 21 | require_once('header.php'); |
22 | 22 | |
23 | 23 | ?> |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | date_default_timezone_set('UTC'); |
38 | 38 | $lastupdate = strtotime($last_update[0]['value']); |
39 | 39 | if (isset($globalTimezone) && $globalTimezone != '') date_default_timezone_set($globalTimezone); |
40 | - print '<i>Last update: '.date('Y-m-d G:i:s',$lastupdate).'</i>'; |
|
40 | + print '<i>Last update: '.date('Y-m-d G:i:s', $lastupdate).'</i>'; |
|
41 | 41 | } |
42 | 42 | ?> |
43 | 43 | </div> |
@@ -46,30 +46,30 @@ discard block |
||
46 | 46 | ?> |
47 | 47 | <?php include('statistics-sub-menu.php'); ?> |
48 | 48 | <div class="row global-stats"> |
49 | - <div class="col-md-2"><span class="type"><?php echo _("Flights"); ?></span><span><?php print number_format($Stats->countOverallFlights($airline_icao,$filter_name)); ?></span></div> |
|
50 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
51 | - <div class="col-md-2"><span class="type"><?php echo _("Arrivals seen"); ?></span><span><?php print number_format($Stats->countOverallArrival($airline_icao,$filter_name)); ?></span></div> |
|
52 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
49 | + <div class="col-md-2"><span class="type"><?php echo _("Flights"); ?></span><span><?php print number_format($Stats->countOverallFlights($airline_icao, $filter_name)); ?></span></div> |
|
50 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
51 | + <div class="col-md-2"><span class="type"><?php echo _("Arrivals seen"); ?></span><span><?php print number_format($Stats->countOverallArrival($airline_icao, $filter_name)); ?></span></div> |
|
52 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
53 | 53 | <?php |
54 | 54 | if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) { |
55 | 55 | ?> |
56 | - <div class="col-md-2"><span class="type"><?php echo _("Pilots"); ?></span><span><?php print number_format($Stats->countOverallPilots($airline_icao,$filter_name)); ?></span></div> |
|
57 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
56 | + <div class="col-md-2"><span class="type"><?php echo _("Pilots"); ?></span><span><?php print number_format($Stats->countOverallPilots($airline_icao, $filter_name)); ?></span></div> |
|
57 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
58 | 58 | <?php |
59 | 59 | } else { |
60 | 60 | ?> |
61 | - <div class="col-md-2"><span class="type"><?php echo _("Owners"); ?></span><span><?php print number_format($Stats->countOverallOwners($airline_icao,$filter_name)); ?></span></div> |
|
62 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
61 | + <div class="col-md-2"><span class="type"><?php echo _("Owners"); ?></span><span><?php print number_format($Stats->countOverallOwners($airline_icao, $filter_name)); ?></span></div> |
|
62 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
63 | 63 | <?php |
64 | 64 | } |
65 | 65 | ?> |
66 | - <div class="col-md-2"><span class="type"><?php echo _("Aircrafts"); ?></span><span><?php print number_format($Stats->countOverallAircrafts($airline_icao,$filter_name)); ?></span></div> |
|
67 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
66 | + <div class="col-md-2"><span class="type"><?php echo _("Aircrafts"); ?></span><span><?php print number_format($Stats->countOverallAircrafts($airline_icao, $filter_name)); ?></span></div> |
|
67 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
68 | 68 | <?php |
69 | 69 | if ($airline_icao == '') { |
70 | 70 | ?> |
71 | 71 | <div class="col-md-2"><span class="type"><?php echo _("Airlines"); ?></span><span><?php print number_format($Stats->countOverallAirlines($filter_name)); ?></span></div> |
72 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
72 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
73 | 73 | <?php |
74 | 74 | } |
75 | 75 | ?> |
@@ -77,18 +77,18 @@ discard block |
||
77 | 77 | if (!(isset($globalIVAO) && $globalIVAO) && !(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalphpVMS) && $globalphpVMS)) { |
78 | 78 | ?> |
79 | 79 | <div class="col-md-2"><span class="type"><?php echo _("Military"); ?></span><span><?php print number_format($Stats->countOverallMilitaryFlights($filter_name)); ?></span></div> |
80 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
80 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
81 | 81 | <?php |
82 | 82 | } |
83 | 83 | ?> |
84 | 84 | </div> |
85 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
85 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
86 | 86 | <div class="specific-stats"> |
87 | 87 | <div class="row column"> |
88 | 88 | <div class="col-md-6"> |
89 | 89 | <h2><?php echo _("Top 10 Most Common Aircraft Type"); ?></h2> |
90 | 90 | <?php |
91 | - $aircraft_array = $Stats->countAllAircraftTypes(true,$airline_icao,$filter_name); |
|
91 | + $aircraft_array = $Stats->countAllAircraftTypes(true, $airline_icao, $filter_name); |
|
92 | 92 | if (count($aircraft_array) == 0) print _("No data available"); |
93 | 93 | else { |
94 | 94 | |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | var data = google.visualization.arrayToDataTable([ |
101 | 101 | ["'._("Aircraft").'", "'._("# of times").'"], '; |
102 | 102 | $aircraft_data = ''; |
103 | - foreach($aircraft_array as $aircraft_item) |
|
103 | + foreach ($aircraft_array as $aircraft_item) |
|
104 | 104 | { |
105 | 105 | $aircraft_data .= '[ "'.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],'; |
106 | 106 | } |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | <a href="<?php print $globalURL; ?>/statistics/aircraft" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
128 | 128 | </div> |
129 | 129 | </div> |
130 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
130 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
131 | 131 | <?php |
132 | 132 | // echo $airline_icao; |
133 | 133 | if ($airline_icao == '' || $airline_icao == 'all') { |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | <div class="col-md-6"> |
136 | 136 | <h2><?php echo _("Top 10 Most Common Airline"); ?></h2> |
137 | 137 | <?php |
138 | - $airline_array = $Stats->countAllAirlines(true,$filter_name); |
|
138 | + $airline_array = $Stats->countAllAirlines(true, $filter_name); |
|
139 | 139 | if (count($airline_array) == 0) print _("No data available"); |
140 | 140 | else { |
141 | 141 | |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | var data = google.visualization.arrayToDataTable([ |
148 | 148 | ["'._("Airline").'", "'._("# of times").'"], '; |
149 | 149 | $airline_data = ''; |
150 | - foreach($airline_array as $airline_item) |
|
150 | + foreach ($airline_array as $airline_item) |
|
151 | 151 | { |
152 | 152 | $airline_data .= '[ "'.$airline_item['airline_name'].' ('.$airline_item['airline_icao'].')",'.$airline_item['airline_count'].'],'; |
153 | 153 | } |
@@ -175,14 +175,14 @@ discard block |
||
175 | 175 | </div> |
176 | 176 | </div> |
177 | 177 | </div> |
178 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
178 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
179 | 179 | <?php |
180 | 180 | } |
181 | 181 | ?> |
182 | 182 | <div class="row column"> |
183 | 183 | |
184 | 184 | <?php |
185 | - $flightover_array = $Stats->countAllFlightOverCountries($airline_icao,$filter_name); |
|
185 | + $flightover_array = $Stats->countAllFlightOverCountries($airline_icao, $filter_name); |
|
186 | 186 | if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) { |
187 | 187 | if (empty($flightover_array)) { |
188 | 188 | ?> |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | ?> |
197 | 197 | <h2><?php echo _("Top 10 Most Common Pilots"); ?></h2> |
198 | 198 | <?php |
199 | - $pilot_array = $Stats->countAllPilots(true,$airline_icao,$filter_name); |
|
199 | + $pilot_array = $Stats->countAllPilots(true, $airline_icao, $filter_name); |
|
200 | 200 | if (count($pilot_array) == 0) print _("No data available"); |
201 | 201 | else { |
202 | 202 | |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | var data = google.visualization.arrayToDataTable([ |
209 | 209 | ["'._("Pilots").'", "'._("# of times").'"], '; |
210 | 210 | $pilot_data = ''; |
211 | - foreach($pilot_array as $pilot_item) |
|
211 | + foreach ($pilot_array as $pilot_item) |
|
212 | 212 | { |
213 | 213 | $pilot_data .= '[ "'.$pilot_item['pilot_name'].' ('.$pilot_item['pilot_id'].')",'.$pilot_item['pilot_count'].'],'; |
214 | 214 | } |
@@ -236,14 +236,14 @@ discard block |
||
236 | 236 | </div> |
237 | 237 | </div> |
238 | 238 | |
239 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
239 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
240 | 240 | <?php |
241 | 241 | } else { |
242 | 242 | ?> |
243 | 243 | <div class="col-md-6"> |
244 | 244 | <h2><?php echo _("Top 10 Most Common Owners"); ?></h2> |
245 | 245 | <?php |
246 | - $owner_array = $Stats->countAllOwners(true,$airline_icao,$filter_name); |
|
246 | + $owner_array = $Stats->countAllOwners(true, $airline_icao, $filter_name); |
|
247 | 247 | if (count($owner_array) == 0) print _("No data available"); |
248 | 248 | else { |
249 | 249 | |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | var data = google.visualization.arrayToDataTable([ |
256 | 256 | ["'._("Owner").'", "'._("# of times").'"], '; |
257 | 257 | $owner_data = ''; |
258 | - foreach($owner_array as $owner_item) |
|
258 | + foreach ($owner_array as $owner_item) |
|
259 | 259 | { |
260 | 260 | $owner_data .= '[ "'.$owner_item['owner_name'].'",'.$owner_item['owner_count'].'],'; |
261 | 261 | } |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | </div> |
284 | 284 | </div> |
285 | 285 | |
286 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
286 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
287 | 287 | <?php |
288 | 288 | } |
289 | 289 | if (!empty($flightover_array)) { |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | var data = google.visualization.arrayToDataTable([ |
305 | 305 | ["'._("Country").'", "'._("# of times").'"], '; |
306 | 306 | $flightover_data = ''; |
307 | - foreach($flightover_array as $flightover_item) |
|
307 | + foreach ($flightover_array as $flightover_item) |
|
308 | 308 | { |
309 | 309 | $flightover_data .= '[ "'.$flightover_item['flight_country'].' ('.$flightover_item['flight_country_iso2'].')",'.$flightover_item['flight_count'].'],'; |
310 | 310 | } |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | } |
338 | 338 | ?> |
339 | 339 | </div> |
340 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
340 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
341 | 341 | |
342 | 342 | |
343 | 343 | </div> |
@@ -345,7 +345,7 @@ discard block |
||
345 | 345 | <div class="col-md-6"> |
346 | 346 | <h2><?php echo _("Top 10 Most Common Departure Airports"); ?></h2> |
347 | 347 | <?php |
348 | - $airport_airport_array = $Stats->countAllDepartureAirports(true,$airline_icao,$filter_name); |
|
348 | + $airport_airport_array = $Stats->countAllDepartureAirports(true, $airline_icao, $filter_name); |
|
349 | 349 | if (count($airport_airport_array) == 0) print _("No data available"); |
350 | 350 | else { |
351 | 351 | |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | var data = google.visualization.arrayToDataTable([ |
362 | 362 | ["'._("Airport").'", "'._("# of times").'"],'; |
363 | 363 | $airport_data = ''; |
364 | - foreach($airport_airport_array as $airport_item) |
|
364 | + foreach ($airport_airport_array as $airport_item) |
|
365 | 365 | { |
366 | 366 | $name = $airport_item['airport_departure_city'].', '.$airport_item['airport_departure_country'].' ('.$airport_item['airport_departure_icao'].')'; |
367 | 367 | $name = str_replace("'", "", $name); |
@@ -390,12 +390,12 @@ discard block |
||
390 | 390 | <a href="<?php print $globalURL; ?>/statistics/airport-departure" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
391 | 391 | </div> |
392 | 392 | </div> |
393 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
393 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
394 | 394 | |
395 | 395 | <div class="col-md-6"> |
396 | 396 | <h2><?php echo _("Top 10 Most Common Arrival Airports"); ?></h2> |
397 | 397 | <?php |
398 | - $airport_airport_array2 = $Stats->countAllArrivalAirports(true,$airline_icao,$filter_name); |
|
398 | + $airport_airport_array2 = $Stats->countAllArrivalAirports(true, $airline_icao, $filter_name); |
|
399 | 399 | if (count($airport_airport_array2) == 0) print _("No data available"); |
400 | 400 | else { |
401 | 401 | |
@@ -411,7 +411,7 @@ discard block |
||
411 | 411 | var data = google.visualization.arrayToDataTable([ |
412 | 412 | ["'._("Airport").'", "'._("# of times").'"],'; |
413 | 413 | $airport_data2 = ''; |
414 | - foreach($airport_airport_array2 as $airport_item2) |
|
414 | + foreach ($airport_airport_array2 as $airport_item2) |
|
415 | 415 | { |
416 | 416 | $name2 = $airport_item2['airport_arrival_city'].', '.$airport_item2['airport_arrival_country'].' ('.$airport_item2['airport_arrival_icao'].')'; |
417 | 417 | $name2 = str_replace("'", "", $name2); |
@@ -441,13 +441,13 @@ discard block |
||
441 | 441 | </div> |
442 | 442 | </div> |
443 | 443 | </div> |
444 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
444 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
445 | 445 | |
446 | 446 | <div class="row column"> |
447 | 447 | <div class="col-md-6"> |
448 | 448 | <h2><?php echo _("Busiest Months of the last 12 Months"); ?></h2> |
449 | 449 | <?php |
450 | - $year_array = $Stats->countAllMonthsLastYear(true,$airline_icao,$filter_name); |
|
450 | + $year_array = $Stats->countAllMonthsLastYear(true, $airline_icao, $filter_name); |
|
451 | 451 | if (count($year_array) == 0) print _("No data available"); |
452 | 452 | else { |
453 | 453 | print '<div id="chart8" class="chart" width="100%"></div> |
@@ -458,9 +458,9 @@ discard block |
||
458 | 458 | var data = google.visualization.arrayToDataTable([ |
459 | 459 | ["'._("Month").'", "'._("# of Flights").'"], '; |
460 | 460 | $year_data = ''; |
461 | - foreach($year_array as $year_item) |
|
461 | + foreach ($year_array as $year_item) |
|
462 | 462 | { |
463 | - $year_data .= '[ "'.date('F, Y',strtotime($year_item['year_name'].'-'.$year_item['month_name'].'-01')).'",'.$year_item['date_count'].'],'; |
|
463 | + $year_data .= '[ "'.date('F, Y', strtotime($year_item['year_name'].'-'.$year_item['month_name'].'-01')).'",'.$year_item['date_count'].'],'; |
|
464 | 464 | } |
465 | 465 | $year_data = substr($year_data, 0, -1); |
466 | 466 | print $year_data; |
@@ -488,12 +488,12 @@ discard block |
||
488 | 488 | <a href="<?php print $globalURL; ?>/statistics/year" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
489 | 489 | </div> |
490 | 490 | </div> |
491 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
491 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
492 | 492 | |
493 | 493 | <div class="col-md-6"> |
494 | 494 | <h2><?php echo _("Busiest Day in the last Month"); ?></h2> |
495 | 495 | <?php |
496 | - $month_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name); |
|
496 | + $month_array = $Stats->countAllDatesLastMonth($airline_icao, $filter_name); |
|
497 | 497 | if (count($month_array) == 0) print _("No data available"); |
498 | 498 | else { |
499 | 499 | print '<div id="chart9" class="chart" width="100%"></div> |
@@ -504,9 +504,9 @@ discard block |
||
504 | 504 | var data = google.visualization.arrayToDataTable([ |
505 | 505 | ["'._("Day").'", "'._("# of Flights").'"], '; |
506 | 506 | $month_data = ''; |
507 | - foreach($month_array as $month_item) |
|
507 | + foreach ($month_array as $month_item) |
|
508 | 508 | { |
509 | - $month_data .= '[ "'.date('F j, Y',strtotime($month_item['date_name'])).'",'.$month_item['date_count'].'],'; |
|
509 | + $month_data .= '[ "'.date('F j, Y', strtotime($month_item['date_name'])).'",'.$month_item['date_count'].'],'; |
|
510 | 510 | } |
511 | 511 | $month_data = substr($month_data, 0, -1); |
512 | 512 | print $month_data; |
@@ -534,12 +534,12 @@ discard block |
||
534 | 534 | <a href="<?php print $globalURL; ?>/statistics/month" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
535 | 535 | </div> |
536 | 536 | </div> |
537 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
537 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
538 | 538 | |
539 | 539 | <div class="col-md-6"> |
540 | 540 | <h2><?php echo _("Busiest Day in the last 7 Days"); ?></h2> |
541 | 541 | <?php |
542 | - $date_array = $Stats->countAllDatesLast7Days($airline_icao,$filter_name); |
|
542 | + $date_array = $Stats->countAllDatesLast7Days($airline_icao, $filter_name); |
|
543 | 543 | if (empty($date_array)) print _("No data available"); |
544 | 544 | else { |
545 | 545 | print '<div id="chart5" class="chart" width="100%"></div> |
@@ -551,7 +551,7 @@ discard block |
||
551 | 551 | ["'._("Date").'", "'._("# of Flights").'"], '; |
552 | 552 | $date_data = ''; |
553 | 553 | |
554 | - foreach($date_array as $date_item) |
|
554 | + foreach ($date_array as $date_item) |
|
555 | 555 | { |
556 | 556 | $date_data .= '[ "'.date("F j, Y", strtotime($date_item['date_name'])).'",'.$date_item['date_count'].'],'; |
557 | 557 | } |
@@ -581,12 +581,12 @@ discard block |
||
581 | 581 | <a href="<?php print $globalURL; ?>/statistics/date" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
582 | 582 | </div> |
583 | 583 | </div> |
584 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
584 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
585 | 585 | |
586 | 586 | <div class="col-md-6"> |
587 | 587 | <h2><?php echo _("Busiest Time of the Day"); ?></h2> |
588 | 588 | <?php |
589 | - $hour_array = $Stats->countAllHours('hour',true,$airline_icao,$filter_name); |
|
589 | + $hour_array = $Stats->countAllHours('hour', true, $airline_icao, $filter_name); |
|
590 | 590 | if (empty($hour_array)) print _("No data available"); |
591 | 591 | else { |
592 | 592 | |
@@ -598,7 +598,7 @@ discard block |
||
598 | 598 | var data = google.visualization.arrayToDataTable([ |
599 | 599 | ["'._("Hour").'", "'._("# of Flights").'"], '; |
600 | 600 | $hour_data = ''; |
601 | - foreach($hour_array as $hour_item) |
|
601 | + foreach ($hour_array as $hour_item) |
|
602 | 602 | { |
603 | 603 | $hour_data .= '[ "'.$hour_item['hour_name'].':00",'.$hour_item['hour_count'].'],'; |
604 | 604 | } |
@@ -628,21 +628,21 @@ discard block |
||
628 | 628 | <a href="<?php print $globalURL; ?>/statistics/time" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
629 | 629 | </div> |
630 | 630 | </div> |
631 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
631 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
632 | 632 | </div> |
633 | 633 | <?php |
634 | 634 | if ($airline_icao == '' && $filter_name == '') { |
635 | 635 | ?> |
636 | 636 | <div class="row column"> |
637 | 637 | <?php |
638 | - $polar = $Stats->getStatsSource(date('Y-m-d'),'polar'); |
|
638 | + $polar = $Stats->getStatsSource(date('Y-m-d'), 'polar'); |
|
639 | 639 | if (!empty($polar)) { |
640 | 640 | print '<h2>'._("Coverage pattern").'</h2>'; |
641 | 641 | foreach ($polar as $eachpolar) { |
642 | 642 | unset($polar_data); |
643 | 643 | $Spotter = new Spotter(); |
644 | 644 | $data = json_decode($eachpolar['source_data']); |
645 | - foreach($data as $value => $key) { |
|
645 | + foreach ($data as $value => $key) { |
|
646 | 646 | $direction = $Spotter->parseDirection(($value*22.5)); |
647 | 647 | $distance = $key; |
648 | 648 | $unit = 'km'; |
@@ -662,7 +662,7 @@ discard block |
||
662 | 662 | ?> |
663 | 663 | <div class="col-md-6"> |
664 | 664 | <h4><?php print $eachpolar['source_name']; ?></h4> |
665 | - <div id="polar-<?php print str_replace(' ','_',strtolower($eachpolar['source_name'])); ?>" class="chart" width="100%"></div> |
|
665 | + <div id="polar-<?php print str_replace(' ', '_', strtolower($eachpolar['source_name'])); ?>" class="chart" width="100%"></div> |
|
666 | 666 | <script> |
667 | 667 | (function() { |
668 | 668 | var margin = {top: 100, right: 100, bottom: 100, left: 100}, |
@@ -686,7 +686,7 @@ discard block |
||
686 | 686 | color: color, |
687 | 687 | unit: '<?php echo $unit; ?>' |
688 | 688 | }; |
689 | - RadarChart("#polar-<?php print str_replace(' ','_',strtolower($eachpolar['source_name'])); ?>", data, radarChartOptions); |
|
689 | + RadarChart("#polar-<?php print str_replace(' ', '_', strtolower($eachpolar['source_name'])); ?>", data, radarChartOptions); |
|
690 | 690 | })(); |
691 | 691 | </script> |
692 | 692 | </div> |
@@ -698,19 +698,19 @@ discard block |
||
698 | 698 | <div class="row column"> |
699 | 699 | <div class="col-md-6"> |
700 | 700 | <?php |
701 | - $msg = $Stats->getStatsSource(date('Y-m-d'),'msg'); |
|
701 | + $msg = $Stats->getStatsSource(date('Y-m-d'), 'msg'); |
|
702 | 702 | if (!empty($msg)) { |
703 | 703 | print '<h2>'._("Messages received").'</h2>'; |
704 | 704 | foreach ($msg as $eachmsg) { |
705 | 705 | //$eachmsg = $msg[0]; |
706 | 706 | $data = $eachmsg['source_data']; |
707 | - if ($data > 500) $max = (round(($data+100)/100))*100; |
|
707 | + if ($data > 500) $max = (round(($data + 100)/100))*100; |
|
708 | 708 | else $max = 500; |
709 | 709 | ?> |
710 | - <div id="msg-<?php print str_replace(' ','_',strtolower($eachmsg['source_name'])); ?>" class="col-md-4"></div> |
|
710 | + <div id="msg-<?php print str_replace(' ', '_', strtolower($eachmsg['source_name'])); ?>" class="col-md-4"></div> |
|
711 | 711 | <script> |
712 | 712 | var g = new JustGage({ |
713 | - id: "msg-<?php print str_replace(' ','_',strtolower($eachmsg['source_name'])); ?>", |
|
713 | + id: "msg-<?php print str_replace(' ', '_', strtolower($eachmsg['source_name'])); ?>", |
|
714 | 714 | value: <?php echo $data; ?>, |
715 | 715 | min: 0, |
716 | 716 | max: <?php print $max; ?>, |
@@ -730,12 +730,12 @@ discard block |
||
730 | 730 | <div class="row column"> |
731 | 731 | |
732 | 732 | <?php |
733 | - $hist = $Stats->getStatsSource(date('Y-m-d'),'hist'); |
|
733 | + $hist = $Stats->getStatsSource(date('Y-m-d'), 'hist'); |
|
734 | 734 | foreach ($hist as $hists) { |
735 | 735 | $hist_data = ''; |
736 | 736 | $source = $hists['source_name']; |
737 | 737 | $hist_array = json_decode($hists['source_data']); |
738 | - foreach($hist_array as $distance => $nb) |
|
738 | + foreach ($hist_array as $distance => $nb) |
|
739 | 739 | { |
740 | 740 | $unit = 'km'; |
741 | 741 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
@@ -753,13 +753,13 @@ discard block |
||
753 | 753 | $hist_data = substr($hist_data, 0, -1); |
754 | 754 | ?> |
755 | 755 | <div class="col-md-6"> |
756 | - <h2><?php echo sprintf(_("Flights Distance for %s"),$source); ?></h2> |
|
756 | + <h2><?php echo sprintf(_("Flights Distance for %s"), $source); ?></h2> |
|
757 | 757 | <?php |
758 | - print '<div id="charthist-'.str_replace(' ','_',strtolower($source)).'" class="chart" width="100%"></div> |
|
758 | + print '<div id="charthist-'.str_replace(' ', '_', strtolower($source)).'" class="chart" width="100%"></div> |
|
759 | 759 | <script> |
760 | 760 | google.load("visualization", "1", {packages:["corechart"]}); |
761 | - google.setOnLoadCallback(drawCharthist_'.str_replace(' ','_',strtolower($source)).'); |
|
762 | - function drawCharthist_'.str_replace(' ','_',strtolower($source)).'() { |
|
761 | + google.setOnLoadCallback(drawCharthist_'.str_replace(' ', '_', strtolower($source)).'); |
|
762 | + function drawCharthist_'.str_replace(' ', '_', strtolower($source)).'() { |
|
763 | 763 | var data = google.visualization.arrayToDataTable([ |
764 | 764 | ["'._("Distance").'", "'._("# of Flights").'"], '; |
765 | 765 | print $hist_data; |
@@ -774,16 +774,16 @@ discard block |
||
774 | 774 | colors: ["#1a3151"] |
775 | 775 | }; |
776 | 776 | |
777 | - var chart = new google.visualization.AreaChart(document.getElementById("charthist-'.str_replace(' ','_',strtolower($source)).'")); |
|
777 | + var chart = new google.visualization.AreaChart(document.getElementById("charthist-'.str_replace(' ', '_', strtolower($source)).'")); |
|
778 | 778 | chart.draw(data, options); |
779 | 779 | } |
780 | 780 | $(window).resize(function(){ |
781 | - drawCharthist_'.str_replace(' ','_',strtolower($source)).'(); |
|
781 | + drawCharthist_'.str_replace(' ', '_', strtolower($source)).'(); |
|
782 | 782 | }); |
783 | 783 | </script>'; |
784 | 784 | ?> |
785 | 785 | </div> |
786 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
786 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
787 | 787 | <?php |
788 | 788 | } |
789 | 789 | ?> |
@@ -7,14 +7,14 @@ discard block |
||
7 | 7 | header('Location: '.$globalURL.'/airport'); |
8 | 8 | die(); |
9 | 9 | } |
10 | -$airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING); |
|
10 | +$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING); |
|
11 | 11 | $Spotter = new Spotter(); |
12 | -$spotter_array = $Spotter->getSpotterDataByAirport($airport,"0,1",""); |
|
12 | +$spotter_array = $Spotter->getSpotterDataByAirport($airport, "0,1", ""); |
|
13 | 13 | $airport_array = $Spotter->getAllAirportInfo($airport); |
14 | 14 | |
15 | 15 | if (!empty($airport_array)) |
16 | 16 | { |
17 | - $title = sprintf(_("Most Common Routes to/from %s, %s (%s)"),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']); |
|
17 | + $title = sprintf(_("Most Common Routes to/from %s, %s (%s)"), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']); |
|
18 | 18 | |
19 | 19 | require_once('header.php'); |
20 | 20 | print '<div class="select-item">'; |
@@ -25,9 +25,9 @@ discard block |
||
25 | 25 | $airport_names = $Stats->getAllAirportNames(); |
26 | 26 | if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames(); |
27 | 27 | ksort($airport_names); |
28 | - foreach($airport_names as $airport_name) |
|
28 | + foreach ($airport_names as $airport_name) |
|
29 | 29 | { |
30 | - if($airport == $airport_name['airport_icao']) |
|
30 | + if ($airport == $airport_name['airport_icao']) |
|
31 | 31 | { |
32 | 32 | print '<option value="'.$airport_name['airport_icao'].'" selected="selected">'.$airport_name['airport_city'].', '.$airport_name['airport_name'].', '.$airport_name['airport_country'].' ('.$airport_name['airport_icao'].')</option>'; |
33 | 33 | } else { |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | include('airport-sub-menu.php'); |
59 | 59 | print '<div class="column">'; |
60 | 60 | print '<h2>'._("Most Common Routes").'</h2>'; |
61 | - print '<p>'.sprintf(_("The statistic below shows the most common routes to/from <strong>%s, %s (%s)</strong>."),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']).'</p>'; |
|
61 | + print '<p>'.sprintf(_("The statistic below shows the most common routes to/from <strong>%s, %s (%s)</strong>."), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']).'</p>'; |
|
62 | 62 | |
63 | 63 | $route_array = $Spotter->countAllRoutesByAirport($airport); |
64 | 64 | if (!empty($route_array)) |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | print '</thead>'; |
75 | 75 | print '<tbody>'; |
76 | 76 | $i = 1; |
77 | - foreach($route_array as $route_item) |
|
77 | + foreach ($route_array as $route_item) |
|
78 | 78 | { |
79 | 79 | print '<tr>'; |
80 | 80 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -7,14 +7,14 @@ discard block |
||
7 | 7 | header('Location: '.$globalURL.'/aircraft'); |
8 | 8 | die(); |
9 | 9 | } |
10 | -$aircraft_type = filter_input(INPUT_GET,'aircraft_type',FILTER_SANITIZE_STRING); |
|
10 | +$aircraft_type = filter_input(INPUT_GET, 'aircraft_type', FILTER_SANITIZE_STRING); |
|
11 | 11 | $Spotter = new Spotter(); |
12 | -$spotter_array = $Spotter->getSpotterDataByAircraft($aircraft_type,"0,1",""); |
|
12 | +$spotter_array = $Spotter->getSpotterDataByAircraft($aircraft_type, "0,1", ""); |
|
13 | 13 | |
14 | 14 | |
15 | 15 | if (!empty($spotter_array)) |
16 | 16 | { |
17 | - $title = sprintf(_("Most Common Departure Airports for %s (%s)"),$spotter_array[0]['aircraft_name'],$spotter_array[0]['aircraft_type']); |
|
17 | + $title = sprintf(_("Most Common Departure Airports for %s (%s)"), $spotter_array[0]['aircraft_name'], $spotter_array[0]['aircraft_type']); |
|
18 | 18 | require_once('header.php'); |
19 | 19 | print '<div class="select-item">'; |
20 | 20 | print '<form action="'.$globalURL.'/aircraft" method="post">'; |
@@ -23,9 +23,9 @@ discard block |
||
23 | 23 | $Stats = new Stats(); |
24 | 24 | $aircraft_types = $Stats->getAllAircraftTypes(); |
25 | 25 | if (empty($aircraft_types)) $aircraft_types = $Spotter->getAllAircraftTypes(); |
26 | - foreach($aircraft_types as $aircrafttype) |
|
26 | + foreach ($aircraft_types as $aircrafttype) |
|
27 | 27 | { |
28 | - if($aircraft_type == $aircrafttype['aircraft_icao']) |
|
28 | + if ($aircraft_type == $aircrafttype['aircraft_icao']) |
|
29 | 29 | { |
30 | 30 | print '<option value="'.$aircrafttype['aircraft_icao'].'" selected="selected">'.$aircrafttype['aircraft_name'].' ('.$aircrafttype['aircraft_icao'].')</option>'; |
31 | 31 | } else { |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | include('aircraft-sub-menu.php'); |
53 | 53 | print '<div class="column">'; |
54 | 54 | print '<h2>'._("Most Common Departure Airports").'</h2>'; |
55 | - print '<p>'.sprintf(_("The statistic below shows all departure airports of flights from <strong>%s (%s)</strong>."),$spotter_array[0]['aircraft_name'],$spotter_array[0]['aircraft_type']).'</p>'; |
|
55 | + print '<p>'.sprintf(_("The statistic below shows all departure airports of flights from <strong>%s (%s)</strong>."), $spotter_array[0]['aircraft_name'], $spotter_array[0]['aircraft_type']).'</p>'; |
|
56 | 56 | $airport_airport_array = $Spotter->countAllDepartureAirportsByAircraft($aircraft_type); |
57 | 57 | print ' |
58 | 58 | <script type="text/javascript" src="https://www.google.com/jsapi"></script> |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | var data = google.visualization.arrayToDataTable([ |
68 | 68 | ["'._("Airport").'", "'._("# of times").'"],'; |
69 | 69 | $airport_data = ''; |
70 | - foreach($airport_airport_array as $airport_item) |
|
70 | + foreach ($airport_airport_array as $airport_item) |
|
71 | 71 | { |
72 | 72 | $name = $airport_item['airport_departure_city'].', '.$airport_item['airport_departure_country'].' ('.$airport_item['airport_departure_icao'].')'; |
73 | 73 | $name = str_replace("'", "", $name); |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | print '</thead>'; |
107 | 107 | print '<tbody>'; |
108 | 108 | $i = 1; |
109 | - foreach($airport_airport_array as $airport_item) |
|
109 | + foreach ($airport_airport_array as $airport_item) |
|
110 | 110 | { |
111 | 111 | print '<tr>'; |
112 | 112 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -7,14 +7,14 @@ discard block |
||
7 | 7 | header('Location: '.$globalURL.'/aircraft'); |
8 | 8 | die(); |
9 | 9 | } |
10 | -$aircraft_type = filter_input(INPUT_GET,'aircraft_type',FILTER_SANITIZE_STRING); |
|
10 | +$aircraft_type = filter_input(INPUT_GET, 'aircraft_type', FILTER_SANITIZE_STRING); |
|
11 | 11 | $Spotter = new Spotter(); |
12 | -$spotter_array = $Spotter->getSpotterDataByAircraft($aircraft_type,"0,1",""); |
|
12 | +$spotter_array = $Spotter->getSpotterDataByAircraft($aircraft_type, "0,1", ""); |
|
13 | 13 | |
14 | 14 | |
15 | 15 | if (!empty($spotter_array)) |
16 | 16 | { |
17 | - $title = sprintf(_("Most Common Aircraft by Registration from %s (%s)"),$spotter_array[0]['aircraft_name'],$spotter_array[0]['aircraft_type']); |
|
17 | + $title = sprintf(_("Most Common Aircraft by Registration from %s (%s)"), $spotter_array[0]['aircraft_name'], $spotter_array[0]['aircraft_type']); |
|
18 | 18 | require_once('header.php'); |
19 | 19 | print '<div class="select-item">'; |
20 | 20 | print '<form action="'.$globalURL.'/aircraft" method="post">'; |
@@ -23,9 +23,9 @@ discard block |
||
23 | 23 | $Stats = new Stats(); |
24 | 24 | $aircraft_types = $Stats->getAllAircraftTypes(); |
25 | 25 | if (empty($aircraft_types)) $aircraft_types = $Spotter->getAllAircraftTypes(); |
26 | - foreach($aircraft_types as $aircrafttype) |
|
26 | + foreach ($aircraft_types as $aircrafttype) |
|
27 | 27 | { |
28 | - if($aircraft_type == $aircrafttype['aircraft_icao']) |
|
28 | + if ($aircraft_type == $aircrafttype['aircraft_icao']) |
|
29 | 29 | { |
30 | 30 | print '<option value="'.$aircrafttype['aircraft_icao'].'" selected="selected">'.$aircrafttype['aircraft_name'].' ('.$aircrafttype['aircraft_icao'].')</option>'; |
31 | 31 | } else { |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | include('aircraft-sub-menu.php'); |
52 | 52 | print '<div class="column">'; |
53 | 53 | print '<h2>'._("Most Common Aircraft by Registration").'</h2>'; |
54 | - print '<p>'.sprintf(_("The statistic below shows the most common aircraft by registration of flights from aircraft type <strong>%s (%s)</strong>."),$spotter_array[0]['aircraft_name'],$spotter_array[0]['aircraft_type']).'</p>'; |
|
54 | + print '<p>'.sprintf(_("The statistic below shows the most common aircraft by registration of flights from aircraft type <strong>%s (%s)</strong>."), $spotter_array[0]['aircraft_name'], $spotter_array[0]['aircraft_type']).'</p>'; |
|
55 | 55 | |
56 | 56 | $aircraft_array = $Spotter->countAllAircraftRegistrationByAircraft($aircraft_type); |
57 | 57 | if (!empty($aircraft_array)) |
@@ -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,14 +7,14 @@ discard block |
||
7 | 7 | header('Location: '.$globalURL.'/aircraft'); |
8 | 8 | die(); |
9 | 9 | } |
10 | -$aircraft_type = filter_input(INPUT_GET,'aircraft_type',FILTER_SANITIZE_STRING); |
|
10 | +$aircraft_type = filter_input(INPUT_GET, 'aircraft_type', FILTER_SANITIZE_STRING); |
|
11 | 11 | $Spotter = new Spotter(); |
12 | -$spotter_array = $Spotter->getSpotterDataByAircraft($aircraft_type,"0,1",""); |
|
12 | +$spotter_array = $Spotter->getSpotterDataByAircraft($aircraft_type, "0,1", ""); |
|
13 | 13 | |
14 | 14 | |
15 | 15 | if (!empty($spotter_array)) |
16 | 16 | { |
17 | - $title = sprintf(_("Most Common Routes from %s (%s)"),$spotter_array[0]['aircraft_name'],$spotter_array[0]['aircraft_type']); |
|
17 | + $title = sprintf(_("Most Common Routes from %s (%s)"), $spotter_array[0]['aircraft_name'], $spotter_array[0]['aircraft_type']); |
|
18 | 18 | require_once('header.php'); |
19 | 19 | print '<div class="select-item">'; |
20 | 20 | print '<form action="'.$globalURL.'/aircraft" method="post">'; |
@@ -23,9 +23,9 @@ discard block |
||
23 | 23 | $Stats = new Stats(); |
24 | 24 | $aircraft_types = $Stats->getAllAircraftTypes(); |
25 | 25 | if (empty($aircraft_types)) $aircraft_types = $Spotter->getAllAircraftTypes(); |
26 | - foreach($aircraft_types as $aircrafttype) |
|
26 | + foreach ($aircraft_types as $aircrafttype) |
|
27 | 27 | { |
28 | - if($aircraft_type == $aircrafttype['aircraft_icao']) |
|
28 | + if ($aircraft_type == $aircrafttype['aircraft_icao']) |
|
29 | 29 | { |
30 | 30 | print '<option value="'.$aircrafttype['aircraft_icao'].'" selected="selected">'.$aircrafttype['aircraft_name'].' ('.$aircrafttype['aircraft_icao'].')</option>'; |
31 | 31 | } else { |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | include('aircraft-sub-menu.php'); |
52 | 52 | print '<div class="column">'; |
53 | 53 | print '<h2>'._("Most Common Routes").'</h2>'; |
54 | - print '<p>'.sprintf(_("The statistic below shows the most common routes from <strong>%s (%s)</strong>."),$spotter_array[0]['aircraft_name'],$spotter_array[0]['aircraft_type']).'</p>'; |
|
54 | + print '<p>'.sprintf(_("The statistic below shows the most common routes from <strong>%s (%s)</strong>."), $spotter_array[0]['aircraft_name'], $spotter_array[0]['aircraft_type']).'</p>'; |
|
55 | 55 | |
56 | 56 | $route_array = $Spotter->countAllRoutesByAircraft($aircraft_type); |
57 | 57 | if (!empty($route_array)) |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | print '</thead>'; |
69 | 69 | print '<tbody>'; |
70 | 70 | $i = 1; |
71 | - foreach($route_array as $route_item) |
|
71 | + foreach ($route_array as $route_item) |
|
72 | 72 | { |
73 | 73 | print '<tr>'; |
74 | 74 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -7,14 +7,14 @@ discard block |
||
7 | 7 | header('Location: '.$globalURL.'/airport'); |
8 | 8 | die(); |
9 | 9 | } |
10 | -$airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING); |
|
10 | +$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING); |
|
11 | 11 | $Spotter = new Spotter(); |
12 | -$spotter_array = $Spotter->getSpotterDataByAirport($airport,"0,1",""); |
|
12 | +$spotter_array = $Spotter->getSpotterDataByAirport($airport, "0,1", ""); |
|
13 | 13 | $airport_array = $Spotter->getAllAirportInfo($airport); |
14 | 14 | |
15 | 15 | if (!empty($airport_array)) |
16 | 16 | { |
17 | - $title = sprintf(_("Most Common Time of Day to/from %s, %s (%s)"),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']); |
|
17 | + $title = sprintf(_("Most Common Time of Day to/from %s, %s (%s)"), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']); |
|
18 | 18 | |
19 | 19 | require_once('header.php'); |
20 | 20 | print '<div class="select-item">'; |
@@ -25,9 +25,9 @@ discard block |
||
25 | 25 | $airport_names = $Stats->getAllAirportNames(); |
26 | 26 | if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames(); |
27 | 27 | ksort($airport_names); |
28 | - foreach($airport_names as $airport_name) |
|
28 | + foreach ($airport_names as $airport_name) |
|
29 | 29 | { |
30 | - if($airport == $airport_name['airport_icao']) |
|
30 | + if ($airport == $airport_name['airport_icao']) |
|
31 | 31 | { |
32 | 32 | print '<option value="'.$airport_name['airport_icao'].'" selected="selected">'.$airport_name['airport_city'].', '.$airport_name['airport_name'].', '.$airport_name['airport_country'].' ('.$airport_name['airport_icao'].')</option>'; |
33 | 33 | } else { |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | include('airport-sub-menu.php'); |
59 | 59 | print '<div class="column">'; |
60 | 60 | print '<h2>'._("Most Common Time of Day").'</h2>'; |
61 | - print '<p>'.sprintf(_("The statistic below shows the most common time of day to/from <strong>%s, %s (%s)</strong>."),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']).'</p>'; |
|
61 | + print '<p>'.sprintf(_("The statistic below shows the most common time of day to/from <strong>%s, %s (%s)</strong>."), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']).'</p>'; |
|
62 | 62 | |
63 | 63 | $hour_array = $Spotter->countAllHoursByAirport($airport); |
64 | 64 | print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>'; |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | var data = google.visualization.arrayToDataTable([ |
71 | 71 | ["'._("Hour").'", "'._("# of Flights").'"], '; |
72 | 72 | $hour_data = ''; |
73 | - foreach($hour_array as $hour_item) |
|
73 | + foreach ($hour_array as $hour_item) |
|
74 | 74 | { |
75 | 75 | $hour_data .= '[ "'.date("ga", strtotime($hour_item['hour_name'].":00")).'",'.$hour_item['hour_count'].'],'; |
76 | 76 | } |
@@ -8,14 +8,14 @@ discard block |
||
8 | 8 | die(); |
9 | 9 | } |
10 | 10 | |
11 | -$aircraft_type = filter_input(INPUT_GET,'aircraft_type',FILTER_SANITIZE_STRING); |
|
11 | +$aircraft_type = filter_input(INPUT_GET, 'aircraft_type', FILTER_SANITIZE_STRING); |
|
12 | 12 | $Spotter = new Spotter(); |
13 | -$spotter_array = $Spotter->getSpotterDataByAircraft($aircraft_type,"0,1",""); |
|
13 | +$spotter_array = $Spotter->getSpotterDataByAircraft($aircraft_type, "0,1", ""); |
|
14 | 14 | |
15 | 15 | |
16 | 16 | if (!empty($spotter_array)) |
17 | 17 | { |
18 | - $title = sprintf(_("Most Common Arrival Airports by Country for %s (%s)"),$spotter_array[0]['aircraft_name'],$spotter_array[0]['aircraft_type']); |
|
18 | + $title = sprintf(_("Most Common Arrival Airports by Country for %s (%s)"), $spotter_array[0]['aircraft_name'], $spotter_array[0]['aircraft_type']); |
|
19 | 19 | require_once('header.php'); |
20 | 20 | print '<div class="select-item">'; |
21 | 21 | print '<form action="'.$globalURL.'/aircraft" method="post">'; |
@@ -24,9 +24,9 @@ discard block |
||
24 | 24 | $Stats = new Stats(); |
25 | 25 | $aircraft_types = $Stats->getAllAircraftTypes(); |
26 | 26 | if (empty($aircraft_types)) $aircraft_types = $Spotter->getAllAircraftTypes(); |
27 | - foreach($aircraft_types as $aircrafttype) |
|
27 | + foreach ($aircraft_types as $aircrafttype) |
|
28 | 28 | { |
29 | - if($aircraft_type == $aircrafttype['aircraft_icao']) |
|
29 | + if ($aircraft_type == $aircrafttype['aircraft_icao']) |
|
30 | 30 | { |
31 | 31 | print '<option value="'.$aircrafttype['aircraft_icao'].'" selected="selected">'.$aircrafttype['aircraft_name'].' ('.$aircrafttype['aircraft_icao'].')</option>'; |
32 | 32 | } else { |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | include('aircraft-sub-menu.php'); |
54 | 54 | print '<div class="column">'; |
55 | 55 | print '<h2>'._("Most Common Arrival Airports by Country").'</h2>'; |
56 | - print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights from <strong>%s (%s)</strong>."),$spotter_array[0]['aircraft_name'],$spotter_array[0]['aircraft_type']).'</p>'; |
|
56 | + print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights from <strong>%s (%s)</strong>."), $spotter_array[0]['aircraft_name'], $spotter_array[0]['aircraft_type']).'</p>'; |
|
57 | 57 | $airport_country_array = $Spotter->countAllArrivalAirportCountriesByAircraft($aircraft_type); |
58 | 58 | print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>'; |
59 | 59 | print '<div id="chartCountry" class="chart" width="100%"></div> |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | var data = google.visualization.arrayToDataTable([ |
65 | 65 | ["'._("Country").'", "'._("# of times").'"], '; |
66 | 66 | $country_data = ''; |
67 | - foreach($airport_country_array as $airport_item) |
|
67 | + foreach ($airport_country_array as $airport_item) |
|
68 | 68 | { |
69 | 69 | $country_data .= '[ "'.$airport_item['arrival_airport_country'].'",'.$airport_item['airport_arrival_country_count'].'],'; |
70 | 70 | } |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | print '</thead>'; |
98 | 98 | print '<tbody>'; |
99 | 99 | $i = 1; |
100 | - foreach($airport_country_array as $airport_item) |
|
100 | + foreach ($airport_country_array as $airport_item) |
|
101 | 101 | { |
102 | 102 | print '<tr>'; |
103 | 103 | print '<td><strong>'.$i.'</strong></td>'; |