@@ -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 | ?> |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | <script src="<?php print $globalURL; ?>/js/MovingMarker.js"></script> |
241 | 241 | <script src="<?php print $globalURL; ?>/js/jquery.idle.min.js"></script> |
242 | 242 | <script src="<?php print $globalURL; ?>/js/map.common.js"></script> |
243 | -<script src="<?php print $globalURL; ?>/js/map.2d.js.php?ident=<?php print $ident; ?><?php if(isset($latitude)) print '&latitude='.$latitude; ?><?php if(isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script> |
|
243 | +<script src="<?php print $globalURL; ?>/js/map.2d.js.php?ident=<?php print $ident; ?><?php if (isset($latitude)) print '&latitude='.$latitude; ?><?php if (isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script> |
|
244 | 244 | <?php |
245 | 245 | if (!isset($type) || $type == 'aircraft') { |
246 | 246 | ?> |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | <script src="<?php print $globalURL; ?>/js/MovingMarker.js"></script> |
311 | 311 | <script src="<?php print $globalURL; ?>/js/jquery.idle.min.js"></script> |
312 | 312 | <script src="<?php print $globalURL; ?>/js/map.common.js"></script> |
313 | -<script src="<?php print $globalURL; ?>/js/map.2d.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> |
|
313 | +<script src="<?php print $globalURL; ?>/js/map.2d.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> |
|
314 | 314 | <script src="<?php print $globalURL; ?>/js/map-aircraft.2d.js.php?flightaware_id=<?php print $flightaware_id; ?>&<?php print time(); ?>"></script> |
315 | 315 | <?php |
316 | 316 | if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '' && ($MapType == 'Google-Roadmap' || $MapType == 'Google-Satellite' || $MapType == 'Google-Hybrid' || $MapType == 'Google-Terrain')) { |
@@ -589,7 +589,7 @@ discard block |
||
589 | 589 | ?> |
590 | 590 | <div class="search"> |
591 | 591 | <form action="<?php print $globalURL; ?>/search" method="get"> |
592 | - <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> |
|
592 | + <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> |
|
593 | 593 | </form> |
594 | 594 | </div> |
595 | 595 | <div class="social"> |
@@ -607,7 +607,7 @@ discard block |
||
607 | 607 | print '</div>'; |
608 | 608 | } |
609 | 609 | |
610 | -if (strtolower($current_page) =='ident-detailed' || strtolower($current_page) == 'flightid-overview') { |
|
610 | +if (strtolower($current_page) == 'ident-detailed' || strtolower($current_page) == 'flightid-overview') { |
|
611 | 611 | ?> |
612 | 612 | <div class="top-header clear" role="main"> |
613 | 613 | <?php |
@@ -620,7 +620,7 @@ discard block |
||
620 | 620 | </div> |
621 | 621 | <?php |
622 | 622 | } |
623 | -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)) |
|
623 | +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)) |
|
624 | 624 | { |
625 | 625 | ?> |
626 | 626 | <div class="top-header clear" role="main"> |
@@ -633,15 +633,15 @@ discard block |
||
633 | 633 | var zoom = 13; |
634 | 634 | //create the map |
635 | 635 | <?php |
636 | - if (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($airport_array[0]['latitude'])) { |
|
636 | + if (strpos(strtolower($current_page), 'airport-') !== false && strpos(strtolower($current_page), 'statistics-') === false && isset($airport_array[0]['latitude'])) { |
|
637 | 637 | ?> |
638 | 638 | map = L.map('map', { zoomControl:true }).setView([<?php print $airport_array[0]['latitude']; ?>,<?php print $airport_array[0]['longitude']; ?>], zoom); |
639 | 639 | <?php |
640 | - } elseif (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false) { |
|
640 | + } elseif (strpos(strtolower($current_page), 'airport-') !== false && strpos(strtolower($current_page), 'statistics-') === false) { |
|
641 | 641 | ?> |
642 | 642 | map = L.map('map', { zoomControl:true }); |
643 | 643 | <?php |
644 | - } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($spotter_array[0]['departure_airport_latitude'])) { |
|
644 | + } elseif (strpos(strtolower($current_page), 'route-') !== false && strpos(strtolower($current_page), 'statistics-') === false && isset($spotter_array[0]['departure_airport_latitude'])) { |
|
645 | 645 | ?> |
646 | 646 | map = L.map('map', { zoomControl:true }).setView([<?php print $spotter_array[0]['departure_airport_latitude']; ?>,<?php print $spotter_array[0]['arrival_airport_longitude']; ?>]); |
647 | 647 | 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); |
@@ -649,7 +649,7 @@ discard block |
||
649 | 649 | 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); |
650 | 650 | 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); |
651 | 651 | <?php |
652 | - } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && !isset($spotter_array[0]['departure_airport_latitude'])) { |
|
652 | + } elseif (strpos(strtolower($current_page), 'route-') !== false && strpos(strtolower($current_page), 'statistics-') === false && !isset($spotter_array[0]['departure_airport_latitude'])) { |
|
653 | 653 | ?> |
654 | 654 | map = L.map('map', { zoomControl:true }).setView([<?php print $spotter_array[0]['latitude']; ?>,<?php print $spotter_array[0]['longitude']; ?>]); |
655 | 655 | <?php |
@@ -3,10 +3,15 @@ discard block |
||
3 | 3 | //gets the page file and stores it in a variable |
4 | 4 | $file_path = pathinfo($_SERVER['SCRIPT_NAME']); |
5 | 5 | $current_page = $file_path['filename']; |
6 | -if ($globalTimezone == '') $globalTimezone = 'UTC'; |
|
6 | +if ($globalTimezone == '') { |
|
7 | + $globalTimezone = 'UTC'; |
|
8 | +} |
|
7 | 9 | date_default_timezone_set($globalTimezone); |
8 | -if (isset($_COOKIE['MapType']) && $_COOKIE['MapType'] != '') $MapType = $_COOKIE['MapType']; |
|
9 | -else $MapType = $globalMapProvider; |
|
10 | +if (isset($_COOKIE['MapType']) && $_COOKIE['MapType'] != '') { |
|
11 | + $MapType = $_COOKIE['MapType']; |
|
12 | +} else { |
|
13 | + $MapType = $globalMapProvider; |
|
14 | +} |
|
10 | 15 | if (isset($_GET['3d'])) { |
11 | 16 | setcookie('MapFormat','3d'); |
12 | 17 | } else if (isset($_GET['2d'])) { |
@@ -231,7 +236,13 @@ discard block |
||
231 | 236 | <script src="<?php print $globalURL; ?>/js/MovingMarker.js"></script> |
232 | 237 | <script src="<?php print $globalURL; ?>/js/jquery.idle.min.js"></script> |
233 | 238 | <script src="<?php print $globalURL; ?>/js/map.common.js"></script> |
234 | -<script src="<?php print $globalURL; ?>/js/map.2d.js.php?ident=<?php print $ident; ?><?php if(isset($latitude)) print '&latitude='.$latitude; ?><?php if(isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script> |
|
239 | +<script src="<?php print $globalURL; ?>/js/map.2d.js.php?ident=<?php print $ident; ?><?php if(isset($latitude)) { |
|
240 | + print '&latitude='.$latitude; |
|
241 | +} |
|
242 | +?><?php if(isset($longitude)) { |
|
243 | + print '&longitude='.$longitude; |
|
244 | +} |
|
245 | +?>&<?php print time(); ?>"></script> |
|
235 | 246 | <?php |
236 | 247 | if (!isset($type) || $type == 'aircraft') { |
237 | 248 | ?> |
@@ -300,7 +311,13 @@ discard block |
||
300 | 311 | <script src="<?php print $globalURL; ?>/js/MovingMarker.js"></script> |
301 | 312 | <script src="<?php print $globalURL; ?>/js/jquery.idle.min.js"></script> |
302 | 313 | <script src="<?php print $globalURL; ?>/js/map.common.js"></script> |
303 | -<script src="<?php print $globalURL; ?>/js/map.2d.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> |
|
314 | +<script src="<?php print $globalURL; ?>/js/map.2d.js.php?flightaware_id=<?php print $flightaware_id; ?><?php if(isset($latitude)) { |
|
315 | + print '&latitude='.$latitude; |
|
316 | +} |
|
317 | +?><?php if(isset($longitude)) { |
|
318 | + print '&longitude='.$longitude; |
|
319 | +} |
|
320 | +?>&<?php print time(); ?>"></script> |
|
304 | 321 | <script src="<?php print $globalURL; ?>/js/map-aircraft.2d.js.php?flightaware_id=<?php print $flightaware_id; ?>&<?php print time(); ?>"></script> |
305 | 322 | <?php |
306 | 323 | if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '' && ($MapType == 'Google-Roadmap' || $MapType == 'Google-Satellite' || $MapType == 'Google-Hybrid' || $MapType == 'Google-Terrain')) { |
@@ -381,7 +398,12 @@ discard block |
||
381 | 398 | <span class="icon-bar"></span> |
382 | 399 | </button> |
383 | 400 | <a href="<?php print $globalURL; ?>/search" class="navbar-toggle navbar-toggle-search"><i class="fa fa-search"></i></a> |
384 | - <a class="navbar-brand" href="<?php if ($globalURL == '') print '/'; else print $globalURL; ?>"><img src="<?php print $globalURL.$logoURL; ?>" height="30px" /></a> |
|
401 | + <a class="navbar-brand" href="<?php if ($globalURL == '') { |
|
402 | + print '/'; |
|
403 | +} else { |
|
404 | + print $globalURL; |
|
405 | +} |
|
406 | +?>"><img src="<?php print $globalURL.$logoURL; ?>" height="30px" /></a> |
|
385 | 407 | </div> |
386 | 408 | <div class="collapse navbar-collapse"> |
387 | 409 | |
@@ -420,7 +442,10 @@ discard block |
||
420 | 442 | <?php |
421 | 443 | } |
422 | 444 | ?> |
423 | - <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a> |
|
445 | + <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) { |
|
446 | + echo 'right-'; |
|
447 | +} |
|
448 | +?>caret"></b></a> |
|
424 | 449 | <ul class="dropdown-menu"> |
425 | 450 | <li><a href="<?php print $globalURL; ?>/aircraft"><?php echo _("Aircrafts Types"); ?></a></li> |
426 | 451 | <?php |
@@ -491,8 +516,14 @@ discard block |
||
491 | 516 | </li> |
492 | 517 | <li><a href="<?php print $globalURL; ?>/search"><?php echo _("Search"); ?></a></li> |
493 | 518 | <li><a href="<?php print $globalURL; ?>/statistics"><?php echo _("Statistics"); ?></a></li> |
494 | - <li class="dropdown<?php if ($sub) echo '-submenu'; ?>"> |
|
495 | - <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Tools"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a> |
|
519 | + <li class="dropdown<?php if ($sub) { |
|
520 | + echo '-submenu'; |
|
521 | +} |
|
522 | +?>"> |
|
523 | + <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Tools"); ?> <b class="<?php if ($sub) { |
|
524 | + echo 'right-'; |
|
525 | +} |
|
526 | +?>caret"></b></a> |
|
496 | 527 | <ul class="dropdown-menu"> |
497 | 528 | <li><a href="<?php print $globalURL; ?>/tools/acars"><?php echo _("ACARS translator"); ?></a></li> |
498 | 529 | <li><a href="<?php print $globalURL; ?>/tools/metar"><?php echo _("METAR translator"); ?></a></li> |
@@ -528,7 +559,10 @@ discard block |
||
528 | 559 | <?php |
529 | 560 | } |
530 | 561 | ?> |
531 | - <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a> |
|
562 | + <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) { |
|
563 | + echo 'right-'; |
|
564 | +} |
|
565 | +?>caret"></b></a> |
|
532 | 566 | <ul class="dropdown-menu"> |
533 | 567 | <li><a href="<?php print $globalURL; ?>/marine/currently"><?php echo _("Current Activity"); ?></a></li> |
534 | 568 | <li><a href="<?php print $globalURL; ?>/marine/latest"><?php echo _("Latest Activity"); ?></a></li> |
@@ -560,7 +594,10 @@ discard block |
||
560 | 594 | <?php |
561 | 595 | } |
562 | 596 | ?> |
563 | - <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a> |
|
597 | + <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) { |
|
598 | + echo 'right-'; |
|
599 | +} |
|
600 | +?>caret"></b></a> |
|
564 | 601 | <ul class="dropdown-menu"> |
565 | 602 | <li><a href="<?php print $globalURL; ?>/tracker/currently"><?php echo _("Current Activity"); ?></a></li> |
566 | 603 | <li><a href="<?php print $globalURL; ?>/tracker/latest"><?php echo _("Latest Activity"); ?></a></li> |
@@ -593,7 +630,10 @@ discard block |
||
593 | 630 | } |
594 | 631 | ?> |
595 | 632 | <!-- |
596 | - <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a> |
|
633 | + <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) { |
|
634 | + echo 'right-'; |
|
635 | +} |
|
636 | +?>caret"></b></a> |
|
597 | 637 | <ul class="dropdown-menu"> |
598 | 638 | <li><a href="<?php print $globalURL; ?>/satellite/currently"><?php echo _("Current Activity"); ?></a></li> |
599 | 639 | <li><a href="<?php print $globalURL; ?>/satellite/latest"><?php echo _("Latest Activity"); ?></a></li> |
@@ -650,7 +690,9 @@ discard block |
||
650 | 690 | $alllang = $Language->getLanguages(); |
651 | 691 | foreach ($alllang as $key => $lang) { |
652 | 692 | print '<option value="'.$key.'"'; |
653 | - if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) print ' selected '; |
|
693 | + if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) { |
|
694 | + print ' selected '; |
|
695 | + } |
|
654 | 696 | print '>'.$lang[0].'</option>'; |
655 | 697 | } |
656 | 698 | ?> |
@@ -790,9 +832,24 @@ discard block |
||
790 | 832 | $customid = $globalMapProvider; |
791 | 833 | ?> |
792 | 834 | L.tileLayer('<?php print $globalMapCustomLayer[$customid]['url']; ?>/{z}/{x}/{y}.png', { |
793 | - maxZoom: <?php if (isset($globalMapCustomLayer[$customid]['maxZoom'])) print $globalMapCustomLayer[$customid]['maxZoom']; else print '18'; ?>, |
|
794 | - minZoom: <?php if (isset($globalMapCustomLayer[$customid]['minZoom'])) print $globalMapCustomLayer[$customid]['minZoom']; else print '0'; ?>, |
|
795 | - noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) print 'false'; else print 'true'; ?>, |
|
835 | + maxZoom: <?php if (isset($globalMapCustomLayer[$customid]['maxZoom'])) { |
|
836 | + print $globalMapCustomLayer[$customid]['maxZoom']; |
|
837 | +} else { |
|
838 | + print '18'; |
|
839 | +} |
|
840 | +?>, |
|
841 | + minZoom: <?php if (isset($globalMapCustomLayer[$customid]['minZoom'])) { |
|
842 | + print $globalMapCustomLayer[$customid]['minZoom']; |
|
843 | +} else { |
|
844 | + print '0'; |
|
845 | +} |
|
846 | +?>, |
|
847 | + noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) { |
|
848 | + print 'false'; |
|
849 | +} else { |
|
850 | + print 'true'; |
|
851 | +} |
|
852 | +?>, |
|
796 | 853 | attribution: '<?php print $globalMapCustomLayer[$customid]['attribution']; ?>' |
797 | 854 | }).addTo(map); |
798 | 855 | <?php |
@@ -815,4 +872,7 @@ discard block |
||
815 | 872 | |
816 | 873 | ?> |
817 | 874 | |
818 | -<section class="container main-content <?php if (strtolower($current_page) == 'index') print 'index '; ?>clear"> |
|
875 | +<section class="container main-content <?php if (strtolower($current_page) == 'index') { |
|
876 | + print 'index '; |
|
877 | +} |
|
878 | +?>clear"> |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | // When button "Remove all filters" is clicked |
29 | 29 | if (isset($_POST['removefilters'])) { |
30 | 30 | $allfilters = array_filter(array_keys($_COOKIE),function($key) { |
31 | - return strpos($key,'filter_') === 0; |
|
31 | + return strpos($key,'filter_') === 0; |
|
32 | 32 | }); |
33 | 33 | foreach ($allfilters as $filt) { |
34 | 34 | unset($_COOKIE[$filt]); |
@@ -160,17 +160,17 @@ discard block |
||
160 | 160 | } |
161 | 161 | ?> |
162 | 162 | <?php |
163 | - if (isset($_POST['archive'])) { |
|
163 | + if (isset($_POST['archive'])) { |
|
164 | 164 | ?> |
165 | 165 | <script src="<?php print $globalURL; ?>/js/map.common.js"></script> |
166 | 166 | <?php |
167 | - if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) { |
|
167 | + if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) { |
|
168 | 168 | ?> |
169 | 169 | |
170 | 170 | <script src="<?php print $globalURL; ?>/js/map.js.php?<?php print time(); ?>&archive&begindate=<?php print strtotime($_POST['start_date']); ?>&enddate=<?php print strtotime($_POST['end_date']); ?>&archivespeed=<?php print $_POST['archivespeed']; ?>"></script> |
171 | 171 | <?php |
172 | - } |
|
173 | - } else { |
|
172 | + } |
|
173 | + } else { |
|
174 | 174 | ?> |
175 | 175 | <?php |
176 | 176 | /* if (isset($globalBeta) && $globalBeta) { |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | */ |
183 | 183 | ?> |
184 | 184 | <?php |
185 | - if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) { |
|
185 | + if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) { |
|
186 | 186 | ?> |
187 | 187 | <?php |
188 | 188 | // if (isset($globalBeta) && $globalBeta) { |
@@ -213,13 +213,13 @@ discard block |
||
213 | 213 | <script src="<?php print $globalURL; ?>/js/map-satellite.2d.js.php?<?php print time(); ?>"></script> |
214 | 214 | <?php |
215 | 215 | } |
216 | - } |
|
216 | + } |
|
217 | 217 | ?> |
218 | 218 | <?php |
219 | 219 | // } |
220 | 220 | ?> |
221 | 221 | <?php |
222 | - } |
|
222 | + } |
|
223 | 223 | } |
224 | 224 | ?> |
225 | 225 | <?php |
@@ -397,61 +397,61 @@ discard block |
||
397 | 397 | <ul class="nav navbar-nav"> |
398 | 398 | |
399 | 399 | <?php |
400 | - $sub = false; |
|
401 | - if ( |
|
400 | + $sub = false; |
|
401 | + if ( |
|
402 | 402 | ( |
403 | - (!isset($globalAircraft) || (isset($globalAircraft) && $globalAircraft === TRUE)) && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalTracker) && $globalTracker === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE)) |
|
403 | + (!isset($globalAircraft) || (isset($globalAircraft) && $globalAircraft === TRUE)) && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalTracker) && $globalTracker === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE)) |
|
404 | 404 | ) || |
405 | 405 | ( |
406 | - isset($globalMarine) && $globalMarine === TRUE && ((isset($globalTracker) && $globalTracker === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE)) |
|
406 | + isset($globalMarine) && $globalMarine === TRUE && ((isset($globalTracker) && $globalTracker === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE)) |
|
407 | 407 | ) || |
408 | 408 | ( |
409 | - isset($globalTracker) && $globalTracker === TRUE && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE)) |
|
409 | + isset($globalTracker) && $globalTracker === TRUE && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE)) |
|
410 | 410 | ) || |
411 | 411 | ( |
412 | - isset($globalSatellite) && $globalSatellite === TRUE && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalTracker) && $globalTracker === TRUE)) |
|
412 | + isset($globalSatellite) && $globalSatellite === TRUE && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalTracker) && $globalTracker === TRUE)) |
|
413 | 413 | ) |
414 | - ) { |
|
414 | + ) { |
|
415 | 415 | $sub = true; |
416 | - } |
|
416 | + } |
|
417 | 417 | ?> |
418 | 418 | <?php |
419 | - if (!isset($globalAircraft) || $globalAircraft === TRUE) { |
|
419 | + if (!isset($globalAircraft) || $globalAircraft === TRUE) { |
|
420 | 420 | ?> |
421 | 421 | <li class="dropdown"> |
422 | 422 | <?php |
423 | - if ($sub) { |
|
423 | + if ($sub) { |
|
424 | 424 | ?> |
425 | 425 | <li class="dropdown"> |
426 | 426 | <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Aircrafts"); ?> <b class="caret"></b></a> |
427 | 427 | <ul class="dropdown-menu multi-level"> |
428 | 428 | <li class="dropdown-submenu"> |
429 | 429 | <?php |
430 | - } |
|
430 | + } |
|
431 | 431 | ?> |
432 | 432 | <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a> |
433 | 433 | <ul class="dropdown-menu"> |
434 | 434 | <li><a href="<?php print $globalURL; ?>/aircraft"><?php echo _("Aircrafts Types"); ?></a></li> |
435 | 435 | <?php |
436 | - if (!isset($globalNoAirlines) || $globalNoAirlines === FALSE) { |
|
436 | + if (!isset($globalNoAirlines) || $globalNoAirlines === FALSE) { |
|
437 | 437 | ?> |
438 | 438 | <li><a href="<?php print $globalURL; ?>/airline"><?php echo _("Airlines"); ?></a></li> |
439 | 439 | <?php |
440 | - } |
|
440 | + } |
|
441 | 441 | ?> |
442 | 442 | <li><a href="<?php print $globalURL; ?>/airport"><?php echo _("Airports"); ?></a></li> |
443 | 443 | <?php |
444 | - if ((isset($globalUseOwner) && $globalUseOwner) || (!isset($globalUseOwner) && (!isset($globalVA) || !$globalVA) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS) && (!isset($globalVAM) || !$globalVAM))) { |
|
444 | + if ((isset($globalUseOwner) && $globalUseOwner) || (!isset($globalUseOwner) && (!isset($globalVA) || !$globalVA) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS) && (!isset($globalVAM) || !$globalVAM))) { |
|
445 | 445 | ?> |
446 | 446 | <li><a href="<?php print $globalURL; ?>/owner"><?php echo _("Owners"); ?></a></li> |
447 | 447 | <?php |
448 | - } |
|
449 | - if ((isset($globalUsePilot) && $globalUsePilot) || !isset($globalUsePilot) && ((isset($globalVA) && $globalVA) || (isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS) || (isset($globalVAM) && $globalVAM))) { |
|
448 | + } |
|
449 | + if ((isset($globalUsePilot) && $globalUsePilot) || !isset($globalUsePilot) && ((isset($globalVA) && $globalVA) || (isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS) || (isset($globalVAM) && $globalVAM))) { |
|
450 | 450 | |
451 | 451 | ?> |
452 | 452 | <li><a href="<?php print $globalURL; ?>/pilot"><?php echo _("Pilots"); ?></a></li> |
453 | 453 | <?php |
454 | - } |
|
454 | + } |
|
455 | 455 | ?> |
456 | 456 | <li><hr /></li> |
457 | 457 | <li><a href="<?php print $globalURL; ?>/currently"><?php echo _("Current Activity"); ?></a></li> |
@@ -459,43 +459,43 @@ discard block |
||
459 | 459 | <li><a href="<?php print $globalURL; ?>/date/<?php print date("Y-m-d"); ?>"><?php echo _("Today's Activity"); ?></a></li> |
460 | 460 | <li><a href="<?php print $globalURL; ?>/newest"><?php echo _("Newest by Category"); ?></a></li> |
461 | 461 | <?php |
462 | - if ($globalACARS) { |
|
463 | - if (isset($globalDemo) && $globalDemo) { |
|
464 | - ?> |
|
462 | + if ($globalACARS) { |
|
463 | + if (isset($globalDemo) && $globalDemo) { |
|
464 | + ?> |
|
465 | 465 | <li><hr /></li> |
466 | 466 | <li><i><?php echo _('ACARS data not available publicly'); ?></i></li> |
467 | 467 | <li><a href=""><?php echo _('Latest ACARS messages'); ?></a></li> |
468 | 468 | <li><a href=""><?php echo _('Archive ACARS messages'); ?></a></li> |
469 | 469 | <?php |
470 | - } else { |
|
471 | - ?> |
|
470 | + } else { |
|
471 | + ?> |
|
472 | 472 | <li><hr /></li> |
473 | 473 | <li><a href="<?php print $globalURL; ?>/acars-latest"><?php echo _("Latest ACARS messages"); ?></a></li> |
474 | 474 | <li><a href="<?php print $globalURL; ?>/acars-archive"><?php echo _("Archive ACARS messages"); ?></a></li> |
475 | 475 | <?php |
476 | - } |
|
477 | - } |
|
478 | - ?> |
|
476 | + } |
|
477 | + } |
|
478 | + ?> |
|
479 | 479 | <?php |
480 | - if (isset($globalAccidents) && $globalAccidents) { |
|
481 | - ?> |
|
480 | + if (isset($globalAccidents) && $globalAccidents) { |
|
481 | + ?> |
|
482 | 482 | <li><hr /></li> |
483 | 483 | <li><a href="<?php print $globalURL; ?>/accident-latest"><?php echo _("Latest accident"); ?></a></li> |
484 | 484 | <li><a href="<?php print $globalURL; ?>/accident/<?php print date("Y-m-d"); ?>"><?php echo _("Today's Accident"); ?></a></li> |
485 | 485 | <li><a href="<?php print $globalURL; ?>/incident-latest"><?php echo _("Latest incident"); ?></a></li> |
486 | 486 | <li><a href="<?php print $globalURL; ?>/incident/<?php print date("Y-m-d"); ?>"><?php echo _("Today's Incident"); ?></a></li> |
487 | 487 | <?php |
488 | - } |
|
489 | - ?> |
|
488 | + } |
|
489 | + ?> |
|
490 | 490 | <li><hr /></li> |
491 | 491 | <li><a href="<?php print $globalURL; ?>/highlights/table"><?php echo _("Special Highlights"); ?></a></li> |
492 | 492 | <?php |
493 | 493 | if (!isset($globalNoUpcoming) || $globalNoUpcoming === FALSE) { |
494 | - ?> |
|
494 | + ?> |
|
495 | 495 | <li><a href="<?php print $globalURL; ?>/upcoming"><?php echo _("Upcoming Flights"); ?></a></li> |
496 | 496 | <?php |
497 | 497 | } |
498 | - ?> |
|
498 | + ?> |
|
499 | 499 | </ul> |
500 | 500 | </li> |
501 | 501 | <li><a href="<?php print $globalURL; ?>/search"><?php echo _("Search"); ?></a></li> |
@@ -522,14 +522,14 @@ discard block |
||
522 | 522 | </ul> |
523 | 523 | <?php |
524 | 524 | } |
525 | - } |
|
525 | + } |
|
526 | 526 | ?> |
527 | 527 | <?php |
528 | - if (isset($globalMarine) && $globalMarine) { |
|
528 | + if (isset($globalMarine) && $globalMarine) { |
|
529 | 529 | ?> |
530 | 530 | <li class="dropdown"> |
531 | 531 | <?php |
532 | - if ($sub) { |
|
532 | + if ($sub) { |
|
533 | 533 | ?> |
534 | 534 | <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Vessels"); ?> <b class="caret"></b></a> |
535 | 535 | <ul class="dropdown-menu multi-level"> |
@@ -554,14 +554,14 @@ discard block |
||
554 | 554 | } |
555 | 555 | ?> |
556 | 556 | <?php |
557 | - } |
|
557 | + } |
|
558 | 558 | ?> |
559 | 559 | <?php |
560 | - if (isset($globalTracker) && $globalTracker) { |
|
560 | + if (isset($globalTracker) && $globalTracker) { |
|
561 | 561 | ?> |
562 | 562 | <li class="dropdown"> |
563 | 563 | <?php |
564 | - if ($sub) { |
|
564 | + if ($sub) { |
|
565 | 565 | ?> |
566 | 566 | <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Trackers"); ?> <b class="caret"></b></a> |
567 | 567 | <ul class="dropdown-menu multi-level"> |
@@ -586,14 +586,14 @@ discard block |
||
586 | 586 | } |
587 | 587 | ?> |
588 | 588 | <?php |
589 | - } |
|
589 | + } |
|
590 | 590 | ?> |
591 | 591 | <?php |
592 | - if (isset($globalSatellite) && $globalSatellite) { |
|
592 | + if (isset($globalSatellite) && $globalSatellite) { |
|
593 | 593 | ?> |
594 | 594 | <li class="dropdown"> |
595 | 595 | <?php |
596 | - if ($sub) { |
|
596 | + if ($sub) { |
|
597 | 597 | ?> |
598 | 598 | <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Satellite"); ?> <b class="caret"></b></a> |
599 | 599 | <ul class="dropdown-menu multi-level"> |
@@ -620,7 +620,7 @@ discard block |
||
620 | 620 | } |
621 | 621 | ?> |
622 | 622 | <?php |
623 | - } |
|
623 | + } |
|
624 | 624 | ?> |
625 | 625 | |
626 | 626 | <li class="dropdown"> |
@@ -629,12 +629,12 @@ discard block |
||
629 | 629 | <li><a href="<?php print $globalURL; ?>/about"><?php echo _("About The Project"); ?></a></li> |
630 | 630 | <li><a href="<?php print $globalURL; ?>/about/export"><?php echo _("Exporting Data"); ?></a></li> |
631 | 631 | <?php |
632 | - if (!isset($globalAircraft) || $globalAircraft === TRUE) { |
|
632 | + if (!isset($globalAircraft) || $globalAircraft === TRUE) { |
|
633 | 633 | ?> |
634 | 634 | <li><hr /></li> |
635 | 635 | <li><a href="<?php print $globalURL; ?>/about/tv"><?php echo _("Spotter TV"); ?></a></li> |
636 | 636 | <?php |
637 | - } |
|
637 | + } |
|
638 | 638 | ?> |
639 | 639 | <?php if (isset($globalContribute) && $globalContribute) { ?> |
640 | 640 | <li><hr /></li> |
@@ -655,14 +655,14 @@ discard block |
||
655 | 655 | <form> |
656 | 656 | <select class="selectpicker" data-width="120px" onchange="language(this);"> |
657 | 657 | <?php |
658 | - $Language = new Language(); |
|
659 | - $alllang = $Language->getLanguages(); |
|
660 | - foreach ($alllang as $key => $lang) { |
|
661 | - print '<option value="'.$key.'"'; |
|
662 | - if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) print ' selected '; |
|
663 | - print '>'.$lang[0].'</option>'; |
|
664 | - } |
|
665 | - ?> |
|
658 | + $Language = new Language(); |
|
659 | + $alllang = $Language->getLanguages(); |
|
660 | + foreach ($alllang as $key => $lang) { |
|
661 | + print '<option value="'.$key.'"'; |
|
662 | + if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) print ' selected '; |
|
663 | + print '>'.$lang[0].'</option>'; |
|
664 | + } |
|
665 | + ?> |
|
666 | 666 | </select> |
667 | 667 | </form> |
668 | 668 | </div> |
@@ -693,18 +693,18 @@ discard block |
||
693 | 693 | ?> |
694 | 694 | <div class="top-header clear" role="main"> |
695 | 695 | <?php |
696 | - if (isset($longitude) && isset($latitude) && $longitude != 0 && $latitude != 0) { |
|
696 | + if (isset($longitude) && isset($latitude) && $longitude != 0 && $latitude != 0) { |
|
697 | 697 | ?> |
698 | 698 | <div id="archive-map"></div> |
699 | 699 | <?php |
700 | - } |
|
700 | + } |
|
701 | 701 | ?> |
702 | 702 | </div> |
703 | 703 | <?php |
704 | 704 | } |
705 | 705 | 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)) |
706 | 706 | { |
707 | - ?> |
|
707 | + ?> |
|
708 | 708 | <div class="top-header clear" role="main"> |
709 | 709 | <div id="map"></div> |
710 | 710 | <link rel="stylesheet" href="<?php print $globalURL; ?>/css/leaflet.css" /> |
@@ -715,15 +715,15 @@ discard block |
||
715 | 715 | var zoom = 13; |
716 | 716 | //create the map |
717 | 717 | <?php |
718 | - if (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($airport_array[0]['latitude'])) { |
|
718 | + if (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($airport_array[0]['latitude'])) { |
|
719 | 719 | ?> |
720 | 720 | map = L.map('map', { zoomControl:true }).setView([<?php print $airport_array[0]['latitude']; ?>,<?php print $airport_array[0]['longitude']; ?>], zoom); |
721 | 721 | <?php |
722 | - } elseif (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false) { |
|
722 | + } elseif (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false) { |
|
723 | 723 | ?> |
724 | 724 | map = L.map('map', { zoomControl:true }); |
725 | 725 | <?php |
726 | - } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($spotter_array[0]['departure_airport_latitude'])) { |
|
726 | + } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($spotter_array[0]['departure_airport_latitude'])) { |
|
727 | 727 | ?> |
728 | 728 | map = L.map('map', { zoomControl:true }).setView([<?php print $spotter_array[0]['departure_airport_latitude']; ?>,<?php print $spotter_array[0]['arrival_airport_longitude']; ?>]); |
729 | 729 | 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); |
@@ -731,22 +731,22 @@ discard block |
||
731 | 731 | 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); |
732 | 732 | 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); |
733 | 733 | <?php |
734 | - } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && !isset($spotter_array[0]['departure_airport_latitude'])) { |
|
734 | + } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && !isset($spotter_array[0]['departure_airport_latitude'])) { |
|
735 | 735 | ?> |
736 | 736 | map = L.map('map', { zoomControl:true }).setView([<?php print $spotter_array[0]['latitude']; ?>,<?php print $spotter_array[0]['longitude']; ?>]); |
737 | 737 | <?php |
738 | - } elseif (!isset($spotter_array[0]['latitude']) && !isset($spotter_array[0]['longitude'])) { |
|
738 | + } elseif (!isset($spotter_array[0]['latitude']) && !isset($spotter_array[0]['longitude'])) { |
|
739 | 739 | ?> |
740 | 740 | map = L.map('map', { zoomControl:true }); |
741 | 741 | <?php |
742 | - } |
|
742 | + } |
|
743 | 743 | ?> |
744 | 744 | //initialize the layer group for the aircrft markers |
745 | 745 | var layer_data = L.layerGroup(); |
746 | 746 | |
747 | 747 | //a few title layers |
748 | 748 | <?php |
749 | - if ($globalMapProvider == 'Mapbox') { |
|
749 | + if ($globalMapProvider == 'Mapbox') { |
|
750 | 750 | ?> |
751 | 751 | L.tileLayer('https://{s}.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={token}', { |
752 | 752 | maxZoom: 18, |
@@ -757,7 +757,7 @@ discard block |
||
757 | 757 | token : '<?php print $globalMapboxToken; ?>' |
758 | 758 | }).addTo(map); |
759 | 759 | <?php |
760 | - } elseif ($globalMapProvider == 'MapQuest-OSM') { |
|
760 | + } elseif ($globalMapProvider == 'MapQuest-OSM') { |
|
761 | 761 | ?> |
762 | 762 | L.tileLayer('http://otile1.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.png', { |
763 | 763 | maxZoom: 18, |
@@ -766,7 +766,7 @@ discard block |
||
766 | 766 | 'Tiles Courtesy of <a href="http://www.mapquest.com">MapQuest</a>' |
767 | 767 | }).addTo(map); |
768 | 768 | <?php |
769 | - } elseif ($globalMapProvider == 'MapQuest-Aerial') { |
|
769 | + } elseif ($globalMapProvider == 'MapQuest-Aerial') { |
|
770 | 770 | ?> |
771 | 771 | L.tileLayer('http://otile1.mqcdn.com/tiles/1.0.0/sat/{z}/{x}/{y}.png', { |
772 | 772 | maxZoom: 18, |
@@ -775,27 +775,27 @@ discard block |
||
775 | 775 | 'Tiles Courtesy of <a href="http://www.mapquest.com">MapQuest</a>, Portions Courtesy NASA/JPL-Caltech and U.S. Depart. of Agriculture, Farm Service Agency"' |
776 | 776 | }).addTo(map); |
777 | 777 | <?php |
778 | - } elseif ($globalMapProvider == 'Google-Roadmap') { |
|
778 | + } elseif ($globalMapProvider == 'Google-Roadmap') { |
|
779 | 779 | ?> |
780 | 780 | var googleLayer = new L.Google('ROADMAP'); |
781 | 781 | map.addLayer(googleLayer); |
782 | 782 | <?php |
783 | - } elseif ($globalMapProvider == 'Google-Satellite') { |
|
783 | + } elseif ($globalMapProvider == 'Google-Satellite') { |
|
784 | 784 | ?> |
785 | 785 | var googleLayer = new L.Google('SATELLITE'); |
786 | 786 | map.addLayer(googleLayer); |
787 | 787 | <?php |
788 | - } elseif ($globalMapProvider == 'Google-Hybrid') { |
|
788 | + } elseif ($globalMapProvider == 'Google-Hybrid') { |
|
789 | 789 | ?> |
790 | 790 | var googleLayer = new L.Google('HYBRID'); |
791 | 791 | map.addLayer(googleLayer); |
792 | 792 | <?php |
793 | - } elseif ($globalMapProvider == 'Google-Terrain') { |
|
793 | + } elseif ($globalMapProvider == 'Google-Terrain') { |
|
794 | 794 | ?> |
795 | 795 | var googleLayer = new L.Google('Terrain'); |
796 | 796 | map.addLayer(googleLayer); |
797 | 797 | <?php |
798 | - } elseif (isset($globalMapCustomLayer[$globalMapProvider])) { |
|
798 | + } elseif (isset($globalMapCustomLayer[$globalMapProvider])) { |
|
799 | 799 | $customid = $globalMapProvider; |
800 | 800 | ?> |
801 | 801 | L.tileLayer('<?php print $globalMapCustomLayer[$customid]['url']; ?>/{z}/{x}/{y}.png', { |
@@ -805,8 +805,8 @@ discard block |
||
805 | 805 | attribution: '<?php print $globalMapCustomLayer[$customid]['attribution']; ?>' |
806 | 806 | }).addTo(map); |
807 | 807 | <?php |
808 | - //} elseif ($globalMapProvider == 'OpenStreetMap') { |
|
809 | - } else { |
|
808 | + //} elseif ($globalMapProvider == 'OpenStreetMap') { |
|
809 | + } else { |
|
810 | 810 | ?> |
811 | 811 | L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { |
812 | 812 | maxZoom: 18, |
@@ -815,7 +815,7 @@ discard block |
||
815 | 815 | }).addTo(map); |
816 | 816 | |
817 | 817 | <?php |
818 | - } |
|
818 | + } |
|
819 | 819 | ?> |
820 | 820 | </script> |
821 | 821 | </div> |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | require_once('../require/settings.php'); |
3 | 3 | require_once('../require/class.Language.php'); |
4 | 4 | |
5 | -setcookie("MapFormat",'2d'); |
|
5 | +setcookie("MapFormat", '2d'); |
|
6 | 6 | |
7 | 7 | // Compressed GeoJson is used if true |
8 | 8 | if (!isset($globalJsonCompress)) $compress = true; |
@@ -16,10 +16,10 @@ discard block |
||
16 | 16 | |
17 | 17 | <?php |
18 | 18 | if (isset($_GET['fammarine_id'])) { |
19 | - $fammarine_id = filter_input(INPUT_GET,'fammarine_id',FILTER_SANITIZE_STRING); |
|
19 | + $fammarine_id = filter_input(INPUT_GET, 'fammarine_id', FILTER_SANITIZE_STRING); |
|
20 | 20 | } |
21 | 21 | if (isset($_GET['ident'])) { |
22 | - $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
|
22 | + $ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING); |
|
23 | 23 | } |
24 | 24 | if (!isset($ident) && !isset($fammarine_id)) { |
25 | 25 | ?> |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | <?php |
183 | 183 | } else { |
184 | 184 | ?> |
185 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
185 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000 + 20000; ?>+feature.properties.sqt*1000); |
|
186 | 186 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
187 | 187 | <?php |
188 | 188 | } |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | /* |
199 | 199 | shadowUrl: iconURLShadowpath, |
200 | 200 | shadowSize: [<?php print $globalAircraftSize; ?>, <?php print $globalAircraftSize; ?>], |
201 | - shadowAnchor: [<?php print ($globalAircraftSize/2)+1; ?>, <?php print $globalAircraftSize; ?>] |
|
201 | + shadowAnchor: [<?php print ($globalAircraftSize/2) + 1; ?>, <?php print $globalAircraftSize; ?>] |
|
202 | 202 | */ |
203 | 203 | }) |
204 | 204 | }) |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | <?php |
232 | 232 | } else { |
233 | 233 | ?> |
234 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
234 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000 + 20000; ?>+feature.properties.sqt*1000); |
|
235 | 235 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
236 | 236 | <?php |
237 | 237 | } |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | <?php |
280 | 280 | } else { |
281 | 281 | ?> |
282 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
282 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000 + 20000; ?>+feature.properties.sqt*1000); |
|
283 | 283 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
284 | 284 | <?php |
285 | 285 | } |
@@ -5,8 +5,11 @@ discard block |
||
5 | 5 | setcookie("MapFormat",'2d'); |
6 | 6 | |
7 | 7 | // Compressed GeoJson is used if true |
8 | -if (!isset($globalJsonCompress)) $compress = true; |
|
9 | -else $compress = $globalJsonCompress; |
|
8 | +if (!isset($globalJsonCompress)) { |
|
9 | + $compress = true; |
|
10 | +} else { |
|
11 | + $compress = $globalJsonCompress; |
|
12 | +} |
|
10 | 13 | ?> |
11 | 14 | |
12 | 15 | |
@@ -156,9 +159,13 @@ discard block |
||
156 | 159 | if (callsign != ""){ markerMarineLabel += callsign; } |
157 | 160 | if (type != ""){ markerMarineLabel += ' - '+type; } |
158 | 161 | <?php |
159 | - if (isset($_COOKIE['MarineIconColor'])) $MarineIconColor = $_COOKIE['MarineIconColor']; |
|
160 | - elseif (isset($globalMarineIconColor)) $MarineIconColor = $globalMarineIconColor; |
|
161 | - else $MarineIconColor = '1a3151'; |
|
162 | + if (isset($_COOKIE['MarineIconColor'])) { |
|
163 | + $MarineIconColor = $_COOKIE['MarineIconColor']; |
|
164 | + } elseif (isset($globalMarineIconColor)) { |
|
165 | + $MarineIconColor = $globalMarineIconColor; |
|
166 | + } else { |
|
167 | + $MarineIconColor = '1a3151'; |
|
168 | + } |
|
162 | 169 | if (!isset($ident) && !isset($fammarine_id)) { |
163 | 170 | ?> |
164 | 171 | //info_marine_update(feature.properties.fc); |
@@ -193,7 +200,12 @@ discard block |
||
193 | 200 | <?php |
194 | 201 | } else { |
195 | 202 | ?> |
196 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
203 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
204 | + print $archiveupdatetime*1000; |
|
205 | +} else { |
|
206 | + print $globalMapRefresh*1000+20000; |
|
207 | +} |
|
208 | +?>+feature.properties.sqt*1000); |
|
197 | 209 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
198 | 210 | <?php |
199 | 211 | } |
@@ -249,7 +261,12 @@ discard block |
||
249 | 261 | <?php |
250 | 262 | } else { |
251 | 263 | ?> |
252 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
264 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
265 | + print $archiveupdatetime*1000; |
|
266 | +} else { |
|
267 | + print $globalMapRefresh*1000+20000; |
|
268 | +} |
|
269 | +?>+feature.properties.sqt*1000); |
|
253 | 270 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
254 | 271 | <?php |
255 | 272 | } |
@@ -304,7 +321,12 @@ discard block |
||
304 | 321 | <?php |
305 | 322 | } else { |
306 | 323 | ?> |
307 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
324 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
325 | + print $archiveupdatetime*1000; |
|
326 | +} else { |
|
327 | + print $globalMapRefresh*1000+20000; |
|
328 | +} |
|
329 | +?>+feature.properties.sqt*1000); |
|
308 | 330 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
309 | 331 | <?php |
310 | 332 | } |
@@ -594,14 +616,24 @@ discard block |
||
594 | 616 | if (isset($archive) && $archive) { |
595 | 617 | ?> |
596 | 618 | //then load it again every 30 seconds |
597 | -// var reload = setInterval(function(){if (noTimeout) getLiveMarineData(0)},<?php if (isset($globalMapRefresh)) print ($globalMapRefresh*1000)/2; else print '15000'; ?>); |
|
619 | +// var reload = setInterval(function(){if (noTimeout) getLiveMarineData(0)},<?php if (isset($globalMapRefresh)) { |
|
620 | + print ($globalMapRefresh*1000)/2; |
|
621 | +} else { |
|
622 | + print '15000'; |
|
623 | +} |
|
624 | +?>); |
|
598 | 625 | reloadMarinePage = setInterval(function(){if (noTimeout) getLiveMarineData(0)},<?php print $archiveupdatetime*1000; ?>); |
599 | 626 | <?php |
600 | 627 | } else { |
601 | 628 | ?> |
602 | 629 | //then load it again every 30 seconds |
603 | 630 | reloadMarinePage = setInterval( |
604 | - function(){if (noTimeout) getLiveMarineData(0)},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000; else print '30000'; ?>); |
|
631 | + function(){if (noTimeout) getLiveMarineData(0)},<?php if (isset($globalMapRefresh)) { |
|
632 | + print $globalMapRefresh*1000; |
|
633 | +} else { |
|
634 | + print '30000'; |
|
635 | +} |
|
636 | +?>); |
|
605 | 637 | <?php |
606 | 638 | } |
607 | 639 | ?> |
@@ -553,8 +553,8 @@ discard block |
||
553 | 553 | } |
554 | 554 | } |
555 | 555 | <?php |
556 | - } else { |
|
557 | - ?> |
|
556 | + } else { |
|
557 | + ?> |
|
558 | 558 | if (map.getZoom() > 7) { |
559 | 559 | var style = { |
560 | 560 | "color": "#1a3151", |
@@ -573,7 +573,7 @@ discard block |
||
573 | 573 | layer_marine_data.addLayer(layer); |
574 | 574 | } |
575 | 575 | <?php |
576 | - } |
|
576 | + } |
|
577 | 577 | ?> |
578 | 578 | } |
579 | 579 | } |
@@ -598,11 +598,11 @@ discard block |
||
598 | 598 | $( document ).ready(function() { |
599 | 599 | map.on('moveend', function() { |
600 | 600 | <?php |
601 | - if (isset($globalMapUseBbox) && $globalMapUseBbox) { |
|
601 | + if (isset($globalMapUseBbox) && $globalMapUseBbox) { |
|
602 | 602 | ?> |
603 | 603 | getLiveMarineData(1); |
604 | 604 | <?php |
605 | - } |
|
605 | + } |
|
606 | 606 | ?> |
607 | 607 | }); |
608 | 608 | //load the function on startup |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | require_once('../require/settings.php'); |
3 | 3 | require_once('../require/class.Language.php'); |
4 | 4 | |
5 | -setcookie("MapFormat",'2d'); |
|
5 | +setcookie("MapFormat", '2d'); |
|
6 | 6 | |
7 | 7 | // Compressed GeoJson is used if true |
8 | 8 | if (!isset($globalJsonCompress)) $compress = true; |
@@ -17,10 +17,10 @@ discard block |
||
17 | 17 | |
18 | 18 | <?php |
19 | 19 | if (isset($_GET['famtrackid'])) { |
20 | - $famtrackid = filter_input(INPUT_GET,'famtrackid',FILTER_SANITIZE_STRING); |
|
20 | + $famtrackid = filter_input(INPUT_GET, 'famtrackid', FILTER_SANITIZE_STRING); |
|
21 | 21 | } |
22 | 22 | if (isset($_GET['ident'])) { |
23 | - $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
|
23 | + $ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING); |
|
24 | 24 | } |
25 | 25 | if (!isset($ident) && !isset($famtrackid)) { |
26 | 26 | ?> |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | <?php |
183 | 183 | } else { |
184 | 184 | ?> |
185 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
185 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000 + 20000; ?>+feature.properties.sqt*1000); |
|
186 | 186 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
187 | 187 | <?php |
188 | 188 | } |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | /* |
199 | 199 | shadowUrl: iconURLShadowpath, |
200 | 200 | shadowSize: [<?php print $globalAircraftSize; ?>, <?php print $globalAircraftSize; ?>], |
201 | - shadowAnchor: [<?php print ($globalAircraftSize/2)+1; ?>, <?php print $globalAircraftSize; ?>] |
|
201 | + shadowAnchor: [<?php print ($globalAircraftSize/2) + 1; ?>, <?php print $globalAircraftSize; ?>] |
|
202 | 202 | */ |
203 | 203 | }) |
204 | 204 | }) |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | <?php |
232 | 232 | } else { |
233 | 233 | ?> |
234 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
234 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000 + 20000; ?>+feature.properties.sqt*1000); |
|
235 | 235 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
236 | 236 | <?php |
237 | 237 | } |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | <?php |
280 | 280 | } else { |
281 | 281 | ?> |
282 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
282 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000 + 20000; ?>+feature.properties.sqt*1000); |
|
283 | 283 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
284 | 284 | <?php |
285 | 285 | } |
@@ -5,8 +5,11 @@ discard block |
||
5 | 5 | setcookie("MapFormat",'2d'); |
6 | 6 | |
7 | 7 | // Compressed GeoJson is used if true |
8 | -if (!isset($globalJsonCompress)) $compress = true; |
|
9 | -else $compress = $globalJsonCompress; |
|
8 | +if (!isset($globalJsonCompress)) { |
|
9 | + $compress = true; |
|
10 | +} else { |
|
11 | + $compress = $globalJsonCompress; |
|
12 | +} |
|
10 | 13 | ?> |
11 | 14 | |
12 | 15 | |
@@ -157,9 +160,13 @@ discard block |
||
157 | 160 | if (callsign != ""){ markerTrackerLabel += callsign; } |
158 | 161 | if (type != ""){ markerTrackerLabel += ' - '+type; } |
159 | 162 | <?php |
160 | - if (isset($_COOKIE['TrackerIconColor'])) $IconColor = $_COOKIE['TrackerIconColor']; |
|
161 | - elseif (isset($globalTrackerIconColor)) $IconColor = $globalTrackerIconColor; |
|
162 | - else $IconColor = '1a3151'; |
|
163 | + if (isset($_COOKIE['TrackerIconColor'])) { |
|
164 | + $IconColor = $_COOKIE['TrackerIconColor']; |
|
165 | + } elseif (isset($globalTrackerIconColor)) { |
|
166 | + $IconColor = $globalTrackerIconColor; |
|
167 | + } else { |
|
168 | + $IconColor = '1a3151'; |
|
169 | + } |
|
163 | 170 | if (!isset($ident) && !isset($famtrackid)) { |
164 | 171 | ?> |
165 | 172 | //info_tracker_update(feature.properties.fc); |
@@ -193,7 +200,12 @@ discard block |
||
193 | 200 | <?php |
194 | 201 | } else { |
195 | 202 | ?> |
196 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
203 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
204 | + print $archiveupdatetime*1000; |
|
205 | +} else { |
|
206 | + print $globalMapRefresh*1000+20000; |
|
207 | +} |
|
208 | +?>+feature.properties.sqt*1000); |
|
197 | 209 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
198 | 210 | <?php |
199 | 211 | } |
@@ -249,7 +261,12 @@ discard block |
||
249 | 261 | <?php |
250 | 262 | } else { |
251 | 263 | ?> |
252 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
264 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
265 | + print $archiveupdatetime*1000; |
|
266 | +} else { |
|
267 | + print $globalMapRefresh*1000+20000; |
|
268 | +} |
|
269 | +?>+feature.properties.sqt*1000); |
|
253 | 270 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
254 | 271 | <?php |
255 | 272 | } |
@@ -304,7 +321,12 @@ discard block |
||
304 | 321 | <?php |
305 | 322 | } else { |
306 | 323 | ?> |
307 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
324 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
325 | + print $archiveupdatetime*1000; |
|
326 | +} else { |
|
327 | + print $globalMapRefresh*1000+20000; |
|
328 | +} |
|
329 | +?>+feature.properties.sqt*1000); |
|
308 | 330 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
309 | 331 | <?php |
310 | 332 | } |
@@ -595,14 +617,24 @@ discard block |
||
595 | 617 | if (isset($archive) && $archive) { |
596 | 618 | ?> |
597 | 619 | //then load it again every 30 seconds |
598 | -// var reload = setInterval(function(){if (noTimeout) getLiveTrackerData(0)},<?php if (isset($globalMapRefresh)) print ($globalMapRefresh*1000)/2; else print '15000'; ?>); |
|
620 | +// var reload = setInterval(function(){if (noTimeout) getLiveTrackerData(0)},<?php if (isset($globalMapRefresh)) { |
|
621 | + print ($globalMapRefresh*1000)/2; |
|
622 | +} else { |
|
623 | + print '15000'; |
|
624 | +} |
|
625 | +?>); |
|
599 | 626 | reloadTrackerPage = setInterval(function(){if (noTimeout) getLiveTrackerData(0)},<?php print $archiveupdatetime*1000; ?>); |
600 | 627 | <?php |
601 | 628 | } else { |
602 | 629 | ?> |
603 | 630 | //then load it again every 30 seconds |
604 | 631 | reloadTrackerPage = setInterval( |
605 | - function(){if (noTimeout) getLiveTrackerData(0)},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000; else print '30000'; ?>); |
|
632 | + function(){if (noTimeout) getLiveTrackerData(0)},<?php if (isset($globalMapRefresh)) { |
|
633 | + print $globalMapRefresh*1000; |
|
634 | +} else { |
|
635 | + print '30000'; |
|
636 | +} |
|
637 | +?>); |
|
606 | 638 | <?php |
607 | 639 | } |
608 | 640 | ?> |
@@ -554,8 +554,8 @@ discard block |
||
554 | 554 | } |
555 | 555 | } |
556 | 556 | <?php |
557 | - } else { |
|
558 | - ?> |
|
557 | + } else { |
|
558 | + ?> |
|
559 | 559 | if (map.getZoom() > 7) { |
560 | 560 | var style = { |
561 | 561 | "color": "#1a3151", |
@@ -574,7 +574,7 @@ discard block |
||
574 | 574 | layer_tracker_data.addLayer(layer); |
575 | 575 | } |
576 | 576 | <?php |
577 | - } |
|
577 | + } |
|
578 | 578 | ?> |
579 | 579 | } |
580 | 580 | } |
@@ -599,11 +599,11 @@ discard block |
||
599 | 599 | $( document ).ready(function() { |
600 | 600 | map.on('moveend', function() { |
601 | 601 | <?php |
602 | - if (isset($globalMapUseBbox) && $globalMapUseBbox) { |
|
602 | + if (isset($globalMapUseBbox) && $globalMapUseBbox) { |
|
603 | 603 | ?> |
604 | 604 | getLiveTrackerData(1); |
605 | 605 | <?php |
606 | - } |
|
606 | + } |
|
607 | 607 | ?> |
608 | 608 | }); |
609 | 609 | //load the function on startup |
@@ -40,8 +40,12 @@ discard block |
||
40 | 40 | $year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
41 | 41 | $month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT); |
42 | 42 | $filter = array(); |
43 | - if ($year != '') $filter = array_merge($filter,array('year' => $year)); |
|
44 | - if ($month != '') $filter = array_merge($filter,array('month' => $month)); |
|
43 | + if ($year != '') { |
|
44 | + $filter = array_merge($filter,array('year' => $year)); |
|
45 | + } |
|
46 | + if ($month != '') { |
|
47 | + $filter = array_merge($filter,array('month' => $month)); |
|
48 | + } |
|
45 | 49 | if ($sort != '') |
46 | 50 | { |
47 | 51 | $spotter_array = $Spotter->getSpotterDataByPilot($pilot,$limit_start.",".$absolute_difference, $sort,$filter); |
@@ -59,8 +63,12 @@ discard block |
||
59 | 63 | { |
60 | 64 | $title = sprintf(_("Detailed View for %s"),$spotter_array[0]['pilot_name']); |
61 | 65 | $ident = $spotter_array[0]['ident']; |
62 | - if (isset($spotter_array[0]['latitude'])) $latitude = $spotter_array[0]['latitude']; |
|
63 | - if (isset($spotter_array[0]['longitude'])) $longitude = $spotter_array[0]['longitude']; |
|
66 | + if (isset($spotter_array[0]['latitude'])) { |
|
67 | + $latitude = $spotter_array[0]['latitude']; |
|
68 | + } |
|
69 | + if (isset($spotter_array[0]['longitude'])) { |
|
70 | + $longitude = $spotter_array[0]['longitude']; |
|
71 | + } |
|
64 | 72 | require_once('header.php'); |
65 | 73 | /* |
66 | 74 | if (isset($globalArchive) && $globalArchive) { |
@@ -113,12 +121,18 @@ discard block |
||
113 | 121 | */ |
114 | 122 | print '<div class="info column">'; |
115 | 123 | print '<h1>'.$spotter_array[0]['pilot_name'].'</h1>'; |
116 | - if (isset($spotter_array[0]['pilot_id']) && $spotter_array[0]['pilot_id'] != '') print '<div><span class="label">'._("Pilot ID").'</span>'.$spotter_array[0]['pilot_id'].'</div>'; |
|
124 | + if (isset($spotter_array[0]['pilot_id']) && $spotter_array[0]['pilot_id'] != '') { |
|
125 | + print '<div><span class="label">'._("Pilot ID").'</span>'.$spotter_array[0]['pilot_id'].'</div>'; |
|
126 | + } |
|
117 | 127 | if ($year == '' && $month == '') { |
118 | 128 | $Stats = new Stats(); |
119 | 129 | $flights = $Stats->getStatsPilot($pilot); |
120 | - } else $flights = 0; |
|
121 | - if ($flights == 0) $flights = $Spotter->countFlightsByPilot($pilot,$filter); |
|
130 | + } else { |
|
131 | + $flights = 0; |
|
132 | + } |
|
133 | + if ($flights == 0) { |
|
134 | + $flights = $Spotter->countFlightsByPilot($pilot,$filter); |
|
135 | + } |
|
122 | 136 | print '<div><span class="label">'._("Flights").'</span>'.$flights.'</div>'; |
123 | 137 | $aircraft_type = count($Spotter->countAllAircraftTypesByPilot($pilot,$filter)); |
124 | 138 | print '<div><span class="label">'._("Aircrafts type").'</span>'.$aircraft_type.'</div>'; |
@@ -129,7 +143,9 @@ discard block |
||
129 | 143 | $airlines = count($Spotter->countAllAirlinesByPilot($pilot,$filter)); |
130 | 144 | print '<div><span class="label">'._("Airlines").'</span>'.$airlines.'</div>'; |
131 | 145 | $duration = $Spotter->getFlightDurationByPilot($pilot,$filter); |
132 | - if ($duration != '0') print '<div><span class="label">'._("Total flights spotted duration").'</span>'.$duration.'</div>'; |
|
146 | + if ($duration != '0') { |
|
147 | + print '<div><span class="label">'._("Total flights spotted duration").'</span>'.$duration.'</div>'; |
|
148 | + } |
|
133 | 149 | print '</div>'; |
134 | 150 | |
135 | 151 | include('owner-sub-menu.php'); |
@@ -7,14 +7,14 @@ discard block |
||
7 | 7 | //require_once('require/class.SpotterLive.php'); |
8 | 8 | require_once('require/class.SpotterArchive.php'); |
9 | 9 | |
10 | -if (!isset($_GET['pilot'])){ |
|
10 | +if (!isset($_GET['pilot'])) { |
|
11 | 11 | header('Location: '.$globalURL.'/'); |
12 | 12 | } else { |
13 | 13 | $Spotter = new Spotter(); |
14 | 14 | $SpotterArchive = new SpotterArchive(); |
15 | 15 | $Translation = new Translation(); |
16 | 16 | //calculuation for the pagination |
17 | - if(!isset($_GET['limit'])) |
|
17 | + if (!isset($_GET['limit'])) |
|
18 | 18 | { |
19 | 19 | $limit_start = 0; |
20 | 20 | $limit_end = 25; |
@@ -35,29 +35,29 @@ discard block |
||
35 | 35 | |
36 | 36 | $page_url = $globalURL.'/pilot/'.$_GET['pilot']; |
37 | 37 | |
38 | - $pilot = filter_input(INPUT_GET,'pilot',FILTER_SANITIZE_STRING); |
|
39 | - $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
40 | - $year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
|
41 | - $month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT); |
|
38 | + $pilot = filter_input(INPUT_GET, 'pilot', FILTER_SANITIZE_STRING); |
|
39 | + $sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
40 | + $year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT); |
|
41 | + $month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT); |
|
42 | 42 | $filter = array(); |
43 | - if ($year != '') $filter = array_merge($filter,array('year' => $year)); |
|
44 | - if ($month != '') $filter = array_merge($filter,array('month' => $month)); |
|
43 | + if ($year != '') $filter = array_merge($filter, array('year' => $year)); |
|
44 | + if ($month != '') $filter = array_merge($filter, array('month' => $month)); |
|
45 | 45 | if ($sort != '') |
46 | 46 | { |
47 | - $spotter_array = $Spotter->getSpotterDataByPilot($pilot,$limit_start.",".$absolute_difference, $sort,$filter); |
|
47 | + $spotter_array = $Spotter->getSpotterDataByPilot($pilot, $limit_start.",".$absolute_difference, $sort, $filter); |
|
48 | 48 | if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) { |
49 | - $spotter_array = $SpotterArchive->getSpotterDataByPilot($pilot,$limit_start.",".$absolute_difference, $sort,$filter); |
|
49 | + $spotter_array = $SpotterArchive->getSpotterDataByPilot($pilot, $limit_start.",".$absolute_difference, $sort, $filter); |
|
50 | 50 | } |
51 | 51 | } else { |
52 | - $spotter_array = $Spotter->getSpotterDataByPilot($pilot,$limit_start.",".$absolute_difference,'',$filter); |
|
52 | + $spotter_array = $Spotter->getSpotterDataByPilot($pilot, $limit_start.",".$absolute_difference, '', $filter); |
|
53 | 53 | if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) { |
54 | - $spotter_array = $SpotterArchive->getSpotterDataByPilot($pilot,$limit_start.",".$absolute_difference,'',$filter); |
|
54 | + $spotter_array = $SpotterArchive->getSpotterDataByPilot($pilot, $limit_start.",".$absolute_difference, '', $filter); |
|
55 | 55 | } |
56 | 56 | } |
57 | 57 | |
58 | 58 | if (!empty($spotter_array)) |
59 | 59 | { |
60 | - $title = sprintf(_("Detailed View for %s"),$spotter_array[0]['pilot_name']); |
|
60 | + $title = sprintf(_("Detailed View for %s"), $spotter_array[0]['pilot_name']); |
|
61 | 61 | $ident = $spotter_array[0]['ident']; |
62 | 62 | if (isset($spotter_array[0]['latitude'])) $latitude = $spotter_array[0]['latitude']; |
63 | 63 | if (isset($spotter_array[0]['longitude'])) $longitude = $spotter_array[0]['longitude']; |
@@ -118,23 +118,23 @@ discard block |
||
118 | 118 | $Stats = new Stats(); |
119 | 119 | $flights = $Stats->getStatsPilot($pilot); |
120 | 120 | } else $flights = 0; |
121 | - if ($flights == 0) $flights = $Spotter->countFlightsByPilot($pilot,$filter); |
|
121 | + if ($flights == 0) $flights = $Spotter->countFlightsByPilot($pilot, $filter); |
|
122 | 122 | print '<div><span class="label">'._("Flights").'</span>'.$flights.'</div>'; |
123 | - $aircraft_type = count($Spotter->countAllAircraftTypesByPilot($pilot,$filter)); |
|
123 | + $aircraft_type = count($Spotter->countAllAircraftTypesByPilot($pilot, $filter)); |
|
124 | 124 | print '<div><span class="label">'._("Aircrafts type").'</span>'.$aircraft_type.'</div>'; |
125 | - $aircraft_registration = count($Spotter->countAllAircraftRegistrationByPilot($pilot,$filter)); |
|
125 | + $aircraft_registration = count($Spotter->countAllAircraftRegistrationByPilot($pilot, $filter)); |
|
126 | 126 | print '<div><span class="label">'._("Aircrafts").'</span>'.$aircraft_registration.'</div>'; |
127 | - $aircraft_manufacturer = count($Spotter->countAllAircraftManufacturerByPilot($pilot,$filter)); |
|
127 | + $aircraft_manufacturer = count($Spotter->countAllAircraftManufacturerByPilot($pilot, $filter)); |
|
128 | 128 | print '<div><span class="label">'._("Manufacturers").'</span>'.$aircraft_manufacturer.'</div>'; |
129 | - $airlines = count($Spotter->countAllAirlinesByPilot($pilot,$filter)); |
|
129 | + $airlines = count($Spotter->countAllAirlinesByPilot($pilot, $filter)); |
|
130 | 130 | print '<div><span class="label">'._("Airlines").'</span>'.$airlines.'</div>'; |
131 | - $duration = $Spotter->getFlightDurationByPilot($pilot,$filter); |
|
131 | + $duration = $Spotter->getFlightDurationByPilot($pilot, $filter); |
|
132 | 132 | if ($duration != '0') print '<div><span class="label">'._("Total flights spotted duration").'</span>'.$duration.'</div>'; |
133 | 133 | print '</div>'; |
134 | 134 | |
135 | 135 | include('owner-sub-menu.php'); |
136 | 136 | print '<div class="table column">'; |
137 | - print '<p>'.sprintf(_("The table below shows the detailed information of all flights with the pilot <strong>%s</strong>."),$spotter_array[0]['pilot_name']).'</p>'; |
|
137 | + print '<p>'.sprintf(_("The table below shows the detailed information of all flights with the pilot <strong>%s</strong>."), $spotter_array[0]['pilot_name']).'</p>'; |
|
138 | 138 | |
139 | 139 | include('table-output.php'); |
140 | 140 | print '<div class="pagination">'; |
@@ -21,7 +21,7 @@ |
||
21 | 21 | } |
22 | 22 | $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
23 | 23 | if ($airline_icao == '' && isset($globalFilter)) { |
24 | - if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
24 | + if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | require_once('header.php'); |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | } else { |
20 | 20 | $title = _("Statistics").' - '._("Most common Country a flight was over"); |
21 | 21 | } |
22 | -$airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
|
22 | +$airline_icao = (string) filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING); |
|
23 | 23 | if ($airline_icao == '' && isset($globalFilter)) { |
24 | 24 | if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
25 | 25 | } |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | } |
49 | 49 | |
50 | 50 | if ($type == 'aircraft') { |
51 | - $flightover_array = $Stats->countAllFlightOverCountries(false,$airline_icao,$filter_name); |
|
51 | + $flightover_array = $Stats->countAllFlightOverCountries(false, $airline_icao, $filter_name); |
|
52 | 52 | } elseif ($type == 'marine') { |
53 | 53 | $flightover_array = $Marine->countAllMarineOverCountries(); |
54 | 54 | } elseif ($type == 'tracker') { |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | print '<div id="chart" class="chart" width="100%"></div><script>'; |
63 | 63 | print 'var series = ['; |
64 | 64 | $flightover_data = ''; |
65 | -foreach($flightover_array as $flightover_item) |
|
65 | +foreach ($flightover_array as $flightover_item) |
|
66 | 66 | { |
67 | 67 | $flightover_data .= '[ "'.$flightover_item['flight_country_iso3'].'",'.$flightover_item['flight_count'].'],'; |
68 | 68 | } |
@@ -111,8 +111,8 @@ discard block |
||
111 | 111 | print '</thead>'; |
112 | 112 | print '<tbody>'; |
113 | 113 | $i = 1; |
114 | - array_splice($flightover_array,10); |
|
115 | - foreach($flightover_array as $flightover_item) |
|
114 | + array_splice($flightover_array, 10); |
|
115 | + foreach ($flightover_array as $flightover_item) |
|
116 | 116 | { |
117 | 117 | print '<tr>'; |
118 | 118 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -4,7 +4,9 @@ discard block |
||
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | $Stats = new Stats(); |
6 | 6 | |
7 | -if (!isset($filter_name)) $filter_name = ''; |
|
7 | +if (!isset($filter_name)) { |
|
8 | + $filter_name = ''; |
|
9 | +} |
|
8 | 10 | $type = 'aircraft'; |
9 | 11 | if (isset($_GET['marine'])) { |
10 | 12 | $type = 'marine'; |
@@ -21,8 +23,10 @@ discard block |
||
21 | 23 | } |
22 | 24 | $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
23 | 25 | if ($airline_icao == '' && isset($globalFilter)) { |
24 | - if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
25 | -} |
|
26 | + if (isset($globalFilter['airline'])) { |
|
27 | + $airline_icao = $globalFilter['airline'][0]; |
|
28 | + } |
|
29 | + } |
|
26 | 30 | |
27 | 31 | require_once('header.php'); |
28 | 32 | include('statistics-sub-menu.php'); |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | ?> |
38 | 38 | </div> |
39 | 39 | <?php |
40 | - if (!isset($year) || (isset($year) && $year == '') && !isset($month) || (isset($month) && $month == '')) { |
|
40 | + if (!isset($year) || (isset($year) && $year == '') && !isset($month) || (isset($month) && $month == '')) { |
|
41 | 41 | ?> |
42 | 42 | <div class="sub-menu sub-menu-container"> |
43 | 43 | <ul class="nav"> |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | </ul> |
96 | 96 | </li> |
97 | 97 | <?php |
98 | - if (isset($globalAccidents) && $globalAccidents && (!isset($airline_icao) || $airline_icao == '' || $airline_icao == 'all')) { |
|
98 | + if (isset($globalAccidents) && $globalAccidents && (!isset($airline_icao) || $airline_icao == '' || $airline_icao == 'all')) { |
|
99 | 99 | ?> |
100 | 100 | <li class="dropdown"> |
101 | 101 | <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-fatalities-year" || strtolower($current_page) == "statistics-fatalities-month"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | </ul> |
108 | 108 | </li> |
109 | 109 | <?php |
110 | - } |
|
110 | + } |
|
111 | 111 | ?> |
112 | 112 | <?php |
113 | 113 | } elseif ($type == 'marine' || $type == 'tracker') { |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | </ul> |
128 | 128 | </div> |
129 | 129 | <?php |
130 | - } else { |
|
130 | + } else { |
|
131 | 131 | ?> |
132 | 132 | <div class="sub-menu sub-menu-container"> |
133 | 133 | <ul class="nav"> |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | </li> |
190 | 190 | --> |
191 | 191 | <?php |
192 | - if (isset($globalAccidents) && $globalAccidents && (!isset($airline_icao) || $airline_icao == '' || $airline_icao == 'all')) { |
|
192 | + if (isset($globalAccidents) && $globalAccidents && (!isset($airline_icao) || $airline_icao == '' || $airline_icao == 'all')) { |
|
193 | 193 | ?> |
194 | 194 | <!-- |
195 | 195 | <li class="dropdown"> |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | </li> |
204 | 204 | --> |
205 | 205 | <?php |
206 | - } |
|
206 | + } |
|
207 | 207 | ?> |
208 | 208 | <?php |
209 | 209 | } elseif ($type == 'marine' || $type == 'tracker') { |
@@ -224,5 +224,5 @@ discard block |
||
224 | 224 | </ul> |
225 | 225 | </div> |
226 | 226 | <?php |
227 | - } |
|
227 | + } |
|
228 | 228 | ?> |
229 | 229 | \ No newline at end of file |
@@ -23,11 +23,11 @@ discard block |
||
23 | 23 | $Spotter = new Spotter(); |
24 | 24 | $alliances = $Spotter->getAllAllianceNames(); |
25 | 25 | if (!empty($alliances)) { |
26 | - foreach($alliances as $alliance) { |
|
27 | - if (isset($airline_icao) && str_replace('_',' ',str_replace('alliance_','',$airline_icao)) == $alliance['alliance']) { |
|
28 | - print '<option value="alliance_'.str_replace(' ','_',$alliance['alliance']).'" selected>'.$alliance['alliance'].'</option>'; |
|
26 | + foreach ($alliances as $alliance) { |
|
27 | + if (isset($airline_icao) && str_replace('_', ' ', str_replace('alliance_', '', $airline_icao)) == $alliance['alliance']) { |
|
28 | + print '<option value="alliance_'.str_replace(' ', '_', $alliance['alliance']).'" selected>'.$alliance['alliance'].'</option>'; |
|
29 | 29 | } else { |
30 | - print '<option value="alliance_'.str_replace(' ','_',$alliance['alliance']).'">'.$alliance['alliance'].'</option>'; |
|
30 | + print '<option value="alliance_'.str_replace(' ', '_', $alliance['alliance']).'">'.$alliance['alliance'].'</option>'; |
|
31 | 31 | } |
32 | 32 | } |
33 | 33 | print '<option disabled>──────────</option>'; |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | $Stats = new Stats(); |
36 | 36 | if (!isset($filter_name)) $filter_name = ''; |
37 | 37 | $airlines = $Stats->getAllAirlineNames($filter_name); |
38 | - foreach($airlines as $airline) { |
|
38 | + foreach ($airlines as $airline) { |
|
39 | 39 | if (isset($airline_icao) && $airline_icao == $airline['airline_icao']) { |
40 | 40 | print '<option value="'.$airline['airline_icao'].'" selected>'.$airline['airline_name'].'</option>'; |
41 | 41 | } else { |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | if (!isset($type) || $type == 'aircraft') { |
59 | 59 | ?> |
60 | 60 | <li class="dropdown"> |
61 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-aircraft" || strtolower($current_page) == "statistics-registration" || strtolower($current_page) == "statistics-manufacturer"){ print 'active'; } ?>" data-toggle="dropdown" href="#" > |
|
61 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-aircraft" || strtolower($current_page) == "statistics-registration" || strtolower($current_page) == "statistics-manufacturer") { print 'active'; } ?>" data-toggle="dropdown" href="#" > |
|
62 | 62 | <?php echo _("Aircraft"); ?> <span class="caret"></span> |
63 | 63 | </a> |
64 | 64 | <ul class="dropdown-menu"> |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | </ul> |
70 | 70 | </li> |
71 | 71 | <li class="dropdown"> |
72 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-airline" || strtolower($current_page) == "statistics-airline-country" || strtolower($current_page) == "statistics-callsign"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
72 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-airline" || strtolower($current_page) == "statistics-airline-country" || strtolower($current_page) == "statistics-callsign") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
73 | 73 | <?php echo _("Airline"); ?> <span class="caret"></span> |
74 | 74 | </a> |
75 | 75 | <ul class="dropdown-menu" role="menu"> |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | </ul> |
86 | 86 | </li> |
87 | 87 | <li class="dropdown"> |
88 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-airport-departure" || strtolower($current_page) == "statistics-airport-departure-country" || strtolower($current_page) == "statistics-airport-arrival" || strtolower($current_page) == "statistics-airport-arrival-country"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
88 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-airport-departure" || strtolower($current_page) == "statistics-airport-departure-country" || strtolower($current_page) == "statistics-airport-arrival" || strtolower($current_page) == "statistics-airport-arrival-country") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
89 | 89 | <?php echo _("Airport"); ?> <span class="caret"></span> |
90 | 90 | </a> |
91 | 91 | <ul class="dropdown-menu" role="menu"> |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | </ul> |
97 | 97 | </li> |
98 | 98 | <li class="dropdown"> |
99 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-route-airport" || strtolower($current_page) == "statistics-route-waypoint"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
99 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-route-airport" || strtolower($current_page) == "statistics-route-waypoint") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
100 | 100 | <?php echo _("Route"); ?> <span class="caret"></span> |
101 | 101 | </a> |
102 | 102 | <ul class="dropdown-menu" role="menu"> |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | </ul> |
106 | 106 | </li> |
107 | 107 | <li class="dropdown"> |
108 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-date" || strtolower($current_page) == "statistics-time"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
108 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-date" || strtolower($current_page) == "statistics-time") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
109 | 109 | <?php echo _("Date & Time"); ?> <span class="caret"></span> |
110 | 110 | </a> |
111 | 111 | <ul class="dropdown-menu" role="menu"> |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | if (isset($globalAccidents) && $globalAccidents && (!isset($airline_icao) || $airline_icao == '' || $airline_icao == 'all')) { |
118 | 118 | ?> |
119 | 119 | <li class="dropdown"> |
120 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-fatalities-year" || strtolower($current_page) == "statistics-fatalities-month"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
120 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-fatalities-year" || strtolower($current_page) == "statistics-fatalities-month") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
121 | 121 | <?php echo _("Fatalities"); ?> <span class="caret"></span> |
122 | 122 | </a> |
123 | 123 | <ul class="dropdown-menu" role="menu"> |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | } elseif ($type == 'marine' || $type == 'tracker') { |
133 | 133 | ?> |
134 | 134 | <li class="dropdown"> |
135 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-date" || strtolower($current_page) == "statistics-time"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
135 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-date" || strtolower($current_page) == "statistics-time") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
136 | 136 | <?php echo _("Date & Time"); ?> <span class="caret"></span> |
137 | 137 | </a> |
138 | 138 | <ul class="dropdown-menu" role="menu"> |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | if (!isset($type) || $type == 'aircraft') { |
155 | 155 | ?> |
156 | 156 | <li class="dropdown"> |
157 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-aircraft" || strtolower($current_page) == "statistics-registration" || strtolower($current_page) == "statistics-manufacturer"){ print 'active'; } ?>" data-toggle="dropdown" href="#" > |
|
157 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-aircraft" || strtolower($current_page) == "statistics-registration" || strtolower($current_page) == "statistics-manufacturer") { print 'active'; } ?>" data-toggle="dropdown" href="#" > |
|
158 | 158 | <?php echo _("Aircraft"); ?> <span class="caret"></span> |
159 | 159 | </a> |
160 | 160 | <ul class="dropdown-menu"> |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | </ul> |
166 | 166 | </li> |
167 | 167 | <li class="dropdown"> |
168 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-airline" || strtolower($current_page) == "statistics-airline-country" || strtolower($current_page) == "statistics-callsign"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
168 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-airline" || strtolower($current_page) == "statistics-airline-country" || strtolower($current_page) == "statistics-callsign") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
169 | 169 | <?php echo _("Airline"); ?> <span class="caret"></span> |
170 | 170 | </a> |
171 | 171 | <ul class="dropdown-menu" role="menu"> |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | </ul> |
182 | 182 | </li> |
183 | 183 | <li class="dropdown"> |
184 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-airport-departure" || strtolower($current_page) == "statistics-airport-departure-country" || strtolower($current_page) == "statistics-airport-arrival" || strtolower($current_page) == "statistics-airport-arrival-country"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
184 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-airport-departure" || strtolower($current_page) == "statistics-airport-departure-country" || strtolower($current_page) == "statistics-airport-arrival" || strtolower($current_page) == "statistics-airport-arrival-country") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
185 | 185 | <?php echo _("Airport"); ?> <span class="caret"></span> |
186 | 186 | </a> |
187 | 187 | <ul class="dropdown-menu" role="menu"> |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | </li> |
194 | 194 | <!-- |
195 | 195 | <li class="dropdown"> |
196 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-route-airport" || strtolower($current_page) == "statistics-route-waypoint"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
196 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-route-airport" || strtolower($current_page) == "statistics-route-waypoint") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
197 | 197 | <?php echo _("Route"); ?> <span class="caret"></span> |
198 | 198 | </a> |
199 | 199 | <ul class="dropdown-menu" role="menu"> |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | --> |
205 | 205 | <!-- |
206 | 206 | <li class="dropdown"> |
207 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-date" || strtolower($current_page) == "statistics-time"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
207 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-date" || strtolower($current_page) == "statistics-time") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
208 | 208 | <?php echo _("Date & Time"); ?> <span class="caret"></span> |
209 | 209 | </a> |
210 | 210 | <ul class="dropdown-menu" role="menu"> |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | ?> |
219 | 219 | <!-- |
220 | 220 | <li class="dropdown"> |
221 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-fatalities-year" || strtolower($current_page) == "statistics-fatalities-month"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
221 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-fatalities-year" || strtolower($current_page) == "statistics-fatalities-month") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
222 | 222 | <?php echo _("Fatalities"); ?> <span class="caret"></span> |
223 | 223 | </a> |
224 | 224 | <ul class="dropdown-menu" role="menu"> |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | } elseif ($type == 'marine' || $type == 'tracker') { |
235 | 235 | ?> |
236 | 236 | <li class="dropdown"> |
237 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-date" || strtolower($current_page) == "statistics-time"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
237 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-date" || strtolower($current_page) == "statistics-time") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
238 | 238 | <?php echo _("Date & Time"); ?> <span class="caret"></span> |
239 | 239 | </a> |
240 | 240 | <ul class="dropdown-menu" role="menu"> |
@@ -6,7 +6,13 @@ discard block |
||
6 | 6 | if (!isset($type) || $type != 'satellite') { |
7 | 7 | ?> |
8 | 8 | <form id="changedate" method="post"> |
9 | - <input type="month" name="date" onchange="statsdatechange(this);" value="<?php if (isset($year) && $year != '') echo $year.'-'; ?><?php if (isset($month) && $month != '') echo $month; ?>" /> |
|
9 | + <input type="month" name="date" onchange="statsdatechange(this);" value="<?php if (isset($year) && $year != '') { |
|
10 | + echo $year.'-'; |
|
11 | +} |
|
12 | +?><?php if (isset($month) && $month != '') { |
|
13 | + echo $month; |
|
14 | +} |
|
15 | +?>" /> |
|
10 | 16 | </form> |
11 | 17 | <?php |
12 | 18 | } |
@@ -38,7 +44,9 @@ discard block |
||
38 | 44 | print '<option disabled>──────────</option>'; |
39 | 45 | } |
40 | 46 | $Stats = new Stats(); |
41 | - if (!isset($filter_name)) $filter_name = ''; |
|
47 | + if (!isset($filter_name)) { |
|
48 | + $filter_name = ''; |
|
49 | + } |
|
42 | 50 | $airlines = $Stats->getAllAirlineNames($filter_name); |
43 | 51 | foreach($airlines as $airline) { |
44 | 52 | if (isset($airline_icao) && $airline_icao == $airline['airline_icao']) { |
@@ -67,10 +75,22 @@ discard block |
||
67 | 75 | <?php echo _("Aircraft"); ?> <span class="caret"></span> |
68 | 76 | </a> |
69 | 77 | <ul class="dropdown-menu"> |
70 | - <li><a href="<?php print $globalURL; ?>/statistics/aircraft<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Aircraft"); ?></a></li> |
|
71 | - <li><a href="<?php print $globalURL; ?>/statistics/registration<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Registration"); ?></a></li> |
|
72 | - <li><a href="<?php print $globalURL; ?>/statistics/manufacturer<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Manufacturer"); ?></a></li> |
|
73 | - <li><a href="<?php print $globalURL; ?>/statistics/country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Country"); ?></a></li> |
|
78 | + <li><a href="<?php print $globalURL; ?>/statistics/aircraft<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
79 | + echo '/'.$airline_icao; |
|
80 | +} |
|
81 | +?>"><?php echo _("Aircraft"); ?></a></li> |
|
82 | + <li><a href="<?php print $globalURL; ?>/statistics/registration<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
83 | + echo '/'.$airline_icao; |
|
84 | +} |
|
85 | +?>"><?php echo _("Registration"); ?></a></li> |
|
86 | + <li><a href="<?php print $globalURL; ?>/statistics/manufacturer<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
87 | + echo '/'.$airline_icao; |
|
88 | +} |
|
89 | +?>"><?php echo _("Manufacturer"); ?></a></li> |
|
90 | + <li><a href="<?php print $globalURL; ?>/statistics/country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
91 | + echo '/'.$airline_icao; |
|
92 | +} |
|
93 | +?>"><?php echo _("Country"); ?></a></li> |
|
74 | 94 | </ul> |
75 | 95 | </li> |
76 | 96 | <li class="dropdown"> |
@@ -81,12 +101,21 @@ discard block |
||
81 | 101 | <?php |
82 | 102 | if (!isset($airline_icao) || $airline_icao == 'all') { |
83 | 103 | ?> |
84 | - <li><a href="<?php print $globalURL; ?>/statistics/airline<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Airline"); ?></a></li> |
|
85 | - <li><a href="<?php print $globalURL; ?>/statistics/airline-country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Airline by Country"); ?></a></li> |
|
104 | + <li><a href="<?php print $globalURL; ?>/statistics/airline<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
105 | + echo '/'.$airline_icao; |
|
106 | +} |
|
107 | +?>"><?php echo _("Airline"); ?></a></li> |
|
108 | + <li><a href="<?php print $globalURL; ?>/statistics/airline-country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
109 | + echo '/'.$airline_icao; |
|
110 | +} |
|
111 | +?>"><?php echo _("Airline by Country"); ?></a></li> |
|
86 | 112 | <?php |
87 | 113 | } |
88 | 114 | ?> |
89 | - <li><a href="<?php print $globalURL; ?>/statistics/callsign<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Callsign"); ?></a></li> |
|
115 | + <li><a href="<?php print $globalURL; ?>/statistics/callsign<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
116 | + echo '/'.$airline_icao; |
|
117 | +} |
|
118 | +?>"><?php echo _("Callsign"); ?></a></li> |
|
90 | 119 | </ul> |
91 | 120 | </li> |
92 | 121 | <li class="dropdown"> |
@@ -94,10 +123,22 @@ discard block |
||
94 | 123 | <?php echo _("Airport"); ?> <span class="caret"></span> |
95 | 124 | </a> |
96 | 125 | <ul class="dropdown-menu" role="menu"> |
97 | - <li><a href="<?php print $globalURL; ?>/statistics/airport-departure<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Departure Airport"); ?></a></li> |
|
98 | - <li><a href="<?php print $globalURL; ?>/statistics/airport-departure-country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Departure Airport by Country"); ?></a></li> |
|
99 | - <li><a href="<?php print $globalURL; ?>/statistics/airport-arrival<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Arrival Airport"); ?></a></li> |
|
100 | - <li><a href="<?php print $globalURL; ?>/statistics/airport-arrival-country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Arrival Airport by Country"); ?></a></li> |
|
126 | + <li><a href="<?php print $globalURL; ?>/statistics/airport-departure<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
127 | + echo '/'.$airline_icao; |
|
128 | +} |
|
129 | +?>"><?php echo _("Departure Airport"); ?></a></li> |
|
130 | + <li><a href="<?php print $globalURL; ?>/statistics/airport-departure-country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
131 | + echo '/'.$airline_icao; |
|
132 | +} |
|
133 | +?>"><?php echo _("Departure Airport by Country"); ?></a></li> |
|
134 | + <li><a href="<?php print $globalURL; ?>/statistics/airport-arrival<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
135 | + echo '/'.$airline_icao; |
|
136 | +} |
|
137 | +?>"><?php echo _("Arrival Airport"); ?></a></li> |
|
138 | + <li><a href="<?php print $globalURL; ?>/statistics/airport-arrival-country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
139 | + echo '/'.$airline_icao; |
|
140 | +} |
|
141 | +?>"><?php echo _("Arrival Airport by Country"); ?></a></li> |
|
101 | 142 | </ul> |
102 | 143 | </li> |
103 | 144 | <li class="dropdown"> |
@@ -105,8 +146,14 @@ discard block |
||
105 | 146 | <?php echo _("Route"); ?> <span class="caret"></span> |
106 | 147 | </a> |
107 | 148 | <ul class="dropdown-menu" role="menu"> |
108 | - <li><a href="<?php print $globalURL; ?>/statistics/route-airport<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Route by Airport"); ?></a></li> |
|
109 | - <li><a href="<?php print $globalURL; ?>/statistics/route-waypoint<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Route by Waypoint"); ?></a></li> |
|
149 | + <li><a href="<?php print $globalURL; ?>/statistics/route-airport<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
150 | + echo '/'.$airline_icao; |
|
151 | +} |
|
152 | +?>"><?php echo _("Route by Airport"); ?></a></li> |
|
153 | + <li><a href="<?php print $globalURL; ?>/statistics/route-waypoint<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
154 | + echo '/'.$airline_icao; |
|
155 | +} |
|
156 | +?>"><?php echo _("Route by Waypoint"); ?></a></li> |
|
110 | 157 | </ul> |
111 | 158 | </li> |
112 | 159 | <li class="dropdown"> |
@@ -114,8 +161,14 @@ discard block |
||
114 | 161 | <?php echo _("Date & Time"); ?> <span class="caret"></span> |
115 | 162 | </a> |
116 | 163 | <ul class="dropdown-menu" role="menu"> |
117 | - <li><a href="<?php print $globalURL; ?>/statistics/date<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Date"); ?></a></li> |
|
118 | - <li><a href="<?php print $globalURL; ?>/statistics/time<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Time"); ?></a></li> |
|
164 | + <li><a href="<?php print $globalURL; ?>/statistics/date<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
165 | + echo '/'.$airline_icao; |
|
166 | +} |
|
167 | +?>"><?php echo _("Date"); ?></a></li> |
|
168 | + <li><a href="<?php print $globalURL; ?>/statistics/time<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
169 | + echo '/'.$airline_icao; |
|
170 | +} |
|
171 | +?>"><?php echo _("Time"); ?></a></li> |
|
119 | 172 | </ul> |
120 | 173 | </li> |
121 | 174 | <?php |
@@ -163,9 +216,18 @@ discard block |
||
163 | 216 | <?php echo _("Aircraft"); ?> <span class="caret"></span> |
164 | 217 | </a> |
165 | 218 | <ul class="dropdown-menu"> |
166 | - <li><a href="<?php print $globalURL; ?>/statistics/aircraft<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Aircraft"); ?></a></li> |
|
167 | - <li><a href="<?php print $globalURL; ?>/statistics/registration<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Registration"); ?></a></li> |
|
168 | - <li><a href="<?php print $globalURL; ?>/statistics/manufacturer<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Manufacturer"); ?></a></li> |
|
219 | + <li><a href="<?php print $globalURL; ?>/statistics/aircraft<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
220 | + echo '/'.$airline_icao; |
|
221 | +} |
|
222 | +?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Aircraft"); ?></a></li> |
|
223 | + <li><a href="<?php print $globalURL; ?>/statistics/registration<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
224 | + echo '/'.$airline_icao; |
|
225 | +} |
|
226 | +?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Registration"); ?></a></li> |
|
227 | + <li><a href="<?php print $globalURL; ?>/statistics/manufacturer<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
228 | + echo '/'.$airline_icao; |
|
229 | +} |
|
230 | +?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Manufacturer"); ?></a></li> |
|
169 | 231 | <!-- <li><a href="<?php print $globalURL; ?>/statistics/country"><?php echo _("Country"); ?></a></li> --> |
170 | 232 | </ul> |
171 | 233 | </li> |
@@ -177,12 +239,21 @@ discard block |
||
177 | 239 | <?php |
178 | 240 | if (!isset($airline_icao) || $airline_icao == 'all') { |
179 | 241 | ?> |
180 | - <li><a href="<?php print $globalURL; ?>/statistics/airline<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Airline"); ?></a></li> |
|
181 | - <li><a href="<?php print $globalURL; ?>/statistics/airline-country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Airline by Country"); ?></a></li> |
|
242 | + <li><a href="<?php print $globalURL; ?>/statistics/airline<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
243 | + echo '/'.$airline_icao; |
|
244 | +} |
|
245 | +?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Airline"); ?></a></li> |
|
246 | + <li><a href="<?php print $globalURL; ?>/statistics/airline-country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
247 | + echo '/'.$airline_icao; |
|
248 | +} |
|
249 | +?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Airline by Country"); ?></a></li> |
|
182 | 250 | <?php |
183 | 251 | } |
184 | 252 | ?> |
185 | - <li><a href="<?php print $globalURL; ?>/statistics/callsign<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Callsign"); ?></a></li> |
|
253 | + <li><a href="<?php print $globalURL; ?>/statistics/callsign<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
254 | + echo '/'.$airline_icao; |
|
255 | +} |
|
256 | +?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Callsign"); ?></a></li> |
|
186 | 257 | </ul> |
187 | 258 | </li> |
188 | 259 | <li class="dropdown"> |
@@ -190,10 +261,22 @@ discard block |
||
190 | 261 | <?php echo _("Airport"); ?> <span class="caret"></span> |
191 | 262 | </a> |
192 | 263 | <ul class="dropdown-menu" role="menu"> |
193 | - <li><a href="<?php print $globalURL; ?>/statistics/airport-departure<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Departure Airport"); ?></a></li> |
|
194 | - <li><a href="<?php print $globalURL; ?>/statistics/airport-departure-country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Departure Airport by Country"); ?></a></li> |
|
195 | - <li><a href="<?php print $globalURL; ?>/statistics/airport-arrival<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Arrival Airport"); ?></a></li> |
|
196 | - <li><a href="<?php print $globalURL; ?>/statistics/airport-arrival-country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Arrival Airport by Country"); ?></a></li> |
|
264 | + <li><a href="<?php print $globalURL; ?>/statistics/airport-departure<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
265 | + echo '/'.$airline_icao; |
|
266 | +} |
|
267 | +?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Departure Airport"); ?></a></li> |
|
268 | + <li><a href="<?php print $globalURL; ?>/statistics/airport-departure-country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
269 | + echo '/'.$airline_icao; |
|
270 | +} |
|
271 | +?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Departure Airport by Country"); ?></a></li> |
|
272 | + <li><a href="<?php print $globalURL; ?>/statistics/airport-arrival<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
273 | + echo '/'.$airline_icao; |
|
274 | +} |
|
275 | +?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Arrival Airport"); ?></a></li> |
|
276 | + <li><a href="<?php print $globalURL; ?>/statistics/airport-arrival-country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
277 | + echo '/'.$airline_icao; |
|
278 | +} |
|
279 | +?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Arrival Airport by Country"); ?></a></li> |
|
197 | 280 | </ul> |
198 | 281 | </li> |
199 | 282 | <!-- |
@@ -40,15 +40,15 @@ |
||
40 | 40 | //print '<div><span>'._("Country").'</span>'.$spotter_item['country'].'</div>'; |
41 | 41 | print '<div><span>'._("Coordinates").'</span>'.round($spotter_item['latitude'],3).', '.round($spotter_item['longitude'],3).'</div>'; |
42 | 42 | if ($spotter_item['atc_range'] > 0) { |
43 | - print '<div><span>'._("Range").'</span>'; |
|
44 | - print $spotter_item['atc_range']; |
|
45 | - print '</div>'; |
|
43 | + print '<div><span>'._("Range").'</span>'; |
|
44 | + print $spotter_item['atc_range']; |
|
45 | + print '</div>'; |
|
46 | 46 | } |
47 | 47 | print '</div>'; |
48 | 48 | if ($spotter_item['info'] != '') { |
49 | - print '<div class="notamtext"><span>'._("Info").'</span>'; |
|
50 | - print $spotter_item['info']; |
|
51 | - print '</div>'; |
|
49 | + print '<div class="notamtext"><span>'._("Info").'</span>'; |
|
50 | + print $spotter_item['info']; |
|
51 | + print '</div>'; |
|
52 | 52 | } |
53 | 53 | print '</div>'; |
54 | 54 | } |
@@ -5,8 +5,8 @@ discard block |
||
5 | 5 | $ATC = new ATC(); |
6 | 6 | |
7 | 7 | if (isset($_GET['atcid'])) { |
8 | - $atcid = filter_input(INPUT_GET,'atcid',FILTER_SANITIZE_NUMBER_INT); |
|
9 | - $atcident = filter_input(INPUT_GET,'atcident',FILTER_SANITIZE_STRING); |
|
8 | + $atcid = filter_input(INPUT_GET, 'atcid', FILTER_SANITIZE_NUMBER_INT); |
|
9 | + $atcident = filter_input(INPUT_GET, 'atcident', FILTER_SANITIZE_STRING); |
|
10 | 10 | $atc_data = $ATC->getById($atcid); |
11 | 11 | if (!isset($atc_data[0])) $atc_data = $ATC->getByIdent($atcident); |
12 | 12 | ?> |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | print '</div>'; |
39 | 39 | |
40 | 40 | //print '<div><span>'._("Country").'</span>'.$spotter_item['country'].'</div>'; |
41 | -print '<div><span>'._("Coordinates").'</span>'.round($spotter_item['latitude'],3).', '.round($spotter_item['longitude'],3).'</div>'; |
|
41 | +print '<div><span>'._("Coordinates").'</span>'.round($spotter_item['latitude'], 3).', '.round($spotter_item['longitude'], 3).'</div>'; |
|
42 | 42 | if ($spotter_item['atc_range'] > 0) { |
43 | 43 | print '<div><span>'._("Range").'</span>'; |
44 | 44 | print $spotter_item['atc_range']; |
@@ -8,7 +8,9 @@ |
||
8 | 8 | $atcid = filter_input(INPUT_GET,'atcid',FILTER_SANITIZE_NUMBER_INT); |
9 | 9 | $atcident = filter_input(INPUT_GET,'atcident',FILTER_SANITIZE_STRING); |
10 | 10 | $atc_data = $ATC->getById($atcid); |
11 | - if (!isset($atc_data[0])) $atc_data = $ATC->getByIdent($atcident); |
|
11 | + if (!isset($atc_data[0])) { |
|
12 | + $atc_data = $ATC->getByIdent($atcident); |
|
13 | + } |
|
12 | 14 | ?> |
13 | 15 | <div class="alldetails"> |
14 | 16 | <button type="button" class="close">×</button> |
@@ -5,23 +5,23 @@ discard block |
||
5 | 5 | $marine = false; |
6 | 6 | $usecoord = false; |
7 | 7 | if (isset($_GET['tracker'])) { |
8 | - $tracker = true; |
|
8 | + $tracker = true; |
|
9 | 9 | } |
10 | 10 | if (isset($_GET['marine'])) { |
11 | - $marine = true; |
|
11 | + $marine = true; |
|
12 | 12 | } |
13 | 13 | if ($tracker) { |
14 | - require_once('require/class.Tracker.php'); |
|
15 | - require_once('require/class.TrackerLive.php'); |
|
16 | - require_once('require/class.TrackerArchive.php'); |
|
14 | + require_once('require/class.Tracker.php'); |
|
15 | + require_once('require/class.TrackerLive.php'); |
|
16 | + require_once('require/class.TrackerArchive.php'); |
|
17 | 17 | } elseif ($marine) { |
18 | - require_once('require/class.Marine.php'); |
|
19 | - require_once('require/class.MarineLive.php'); |
|
20 | - require_once('require/class.MarineArchive.php'); |
|
18 | + require_once('require/class.Marine.php'); |
|
19 | + require_once('require/class.MarineLive.php'); |
|
20 | + require_once('require/class.MarineArchive.php'); |
|
21 | 21 | } else { |
22 | - require_once('require/class.Spotter.php'); |
|
23 | - require_once('require/class.SpotterLive.php'); |
|
24 | - require_once('require/class.SpotterArchive.php'); |
|
22 | + require_once('require/class.Spotter.php'); |
|
23 | + require_once('require/class.SpotterLive.php'); |
|
24 | + require_once('require/class.SpotterArchive.php'); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | $begintime = microtime(true); |
@@ -41,10 +41,10 @@ discard block |
||
41 | 41 | $Common = new Common(); |
42 | 42 | |
43 | 43 | if (isset($_GET['download'])) { |
44 | - if ($_GET['download'] == "true") |
|
45 | - { |
|
44 | + if ($_GET['download'] == "true") |
|
45 | + { |
|
46 | 46 | header('Content-disposition: attachment; filename="flightairmap.json"'); |
47 | - } |
|
47 | + } |
|
48 | 48 | } |
49 | 49 | header('Content-Type: text/javascript'); |
50 | 50 | |
@@ -498,17 +498,17 @@ discard block |
||
498 | 498 | if ($history == '' && isset($_COOKIE['history'])) $history = $_COOKIE['history']; |
499 | 499 | |
500 | 500 | if ( |
501 | - (isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') |
|
502 | - || ((isset($globalMapHistory) && $globalMapHistory) || $allhistory) |
|
501 | + (isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') |
|
502 | + || ((isset($globalMapHistory) && $globalMapHistory) || $allhistory) |
|
503 | 503 | // || (isset($history) && $history != '' && $history != 'NA' && ($history == $spotter_item['ident'] || $history == $spotter_item['flightaware_id'])) |
504 | 504 | // || (isset($history) && $history != '' && $history != 'NA' && $history == $spotter_item['ident']) |
505 | - || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
|
506 | - || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']) |
|
507 | - || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['fammarine_id'])) |
|
508 | - || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['fammarine_id']) && $_GET['fammarine_id'] == $spotter_item['fammarine_id']) |
|
509 | - || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['famtrackid'])) |
|
510 | - || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['famtrackid']) && $_GET['famtrackid'] == $spotter_item['famtrackid']) |
|
511 | - ) { |
|
505 | + || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
|
506 | + || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']) |
|
507 | + || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['fammarine_id'])) |
|
508 | + || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['fammarine_id']) && $_GET['fammarine_id'] == $spotter_item['fammarine_id']) |
|
509 | + || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['famtrackid'])) |
|
510 | + || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['famtrackid']) && $_GET['famtrackid'] == $spotter_item['famtrackid']) |
|
511 | + ) { |
|
512 | 512 | if ($tracker) { |
513 | 513 | if ($from_archive || $globalArchive) { |
514 | 514 | $spotter_history_array = $TrackerArchive->getAllArchiveTrackerDataById($spotter_item['famtrackid']); |
@@ -597,65 +597,65 @@ discard block |
||
597 | 597 | } |
598 | 598 | |
599 | 599 | if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
600 | - || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
|
601 | - && (isset($spotter_item['departure_airport']) |
|
602 | - && $spotter_item['departure_airport'] != 'NA' |
|
603 | - && isset($spotter_item['arrival_airport']) |
|
604 | - && $spotter_item['arrival_airport'] != 'NA' |
|
605 | - && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") |
|
606 | - || (!isset($_COOKIE['MapRoute']) && isset($globalMapRoute) && $globalMapRoute)))) { |
|
607 | - if ($compress) $output_air = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
608 | - else $output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
609 | - if (isset($spotter_item['departure_airport_latitude'])) { |
|
600 | + || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
|
601 | + && (isset($spotter_item['departure_airport']) |
|
602 | + && $spotter_item['departure_airport'] != 'NA' |
|
603 | + && isset($spotter_item['arrival_airport']) |
|
604 | + && $spotter_item['arrival_airport'] != 'NA' |
|
605 | + && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") |
|
606 | + || (!isset($_COOKIE['MapRoute']) && isset($globalMapRoute) && $globalMapRoute)))) { |
|
607 | + if ($compress) $output_air = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
608 | + else $output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
609 | + if (isset($spotter_item['departure_airport_latitude'])) { |
|
610 | 610 | $output_air .= '['.$spotter_item['departure_airport_longitude'].','.$spotter_item['departure_airport_latitude'].'],'; |
611 | - } elseif (isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA') { |
|
611 | + } elseif (isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA') { |
|
612 | 612 | $dairport = $Spotter->getAllAirportInfo($spotter_item['departure_airport']); |
613 | 613 | if (isset($dairport[0]['latitude'])) { |
614 | - $output_air .= '['.$dairport[0]['longitude'].','.$dairport[0]['latitude'].'],'; |
|
614 | + $output_air .= '['.$dairport[0]['longitude'].','.$dairport[0]['latitude'].'],'; |
|
615 | 615 | } |
616 | - } |
|
617 | - if (isset($spotter_item['arrival_airport_latitude'])) { |
|
616 | + } |
|
617 | + if (isset($spotter_item['arrival_airport_latitude'])) { |
|
618 | 618 | $output_air .= '['.$spotter_item['arrival_airport_longitude'].','.$spotter_item['arrival_airport_latitude'].'],'; |
619 | - } elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { |
|
619 | + } elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { |
|
620 | 620 | $aairport = $Spotter->getAllAirportInfo($spotter_item['arrival_airport']); |
621 | 621 | if (isset($aairport[0]['latitude'])) { |
622 | - $output_air .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].'],'; |
|
622 | + $output_air .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].'],'; |
|
623 | 623 | } |
624 | - } |
|
625 | - $output_air = substr($output_air, 0, -1); |
|
626 | - $output_air .= ']}},'; |
|
627 | - $output .= $output_air; |
|
628 | - unset($output_air); |
|
624 | + } |
|
625 | + $output_air = substr($output_air, 0, -1); |
|
626 | + $output_air .= ']}},'; |
|
627 | + $output .= $output_air; |
|
628 | + unset($output_air); |
|
629 | 629 | } |
630 | 630 | |
631 | 631 | //if (isset($history) && $history != '' && $history == $spotter_item['ident'] && isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA' && isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA' && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") || (!isset($_COOKIE['MapRoute']) && (!isset($globalMapRoute) || (isset($globalMapRoute) && $globalMapRoute))))) { |
632 | 632 | //if (isset($history) && $history != '' && $history == $spotter_item['ident'] && isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA' && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") || (!isset($_COOKIE['MapRoute']) && (!isset($globalMapRoute) || (isset($globalMapRoute) && $globalMapRoute))))) { |
633 | 633 | if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
634 | - || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
|
635 | - && (isset($spotter_item['arrival_airport']) |
|
636 | - && $spotter_item['arrival_airport'] != 'NA' |
|
637 | - && ((isset($_COOKIE['MapRemainingRoute']) && $_COOKIE['MapRemainingRoute'] == "true") |
|
638 | - || (!isset($_COOKIE['MapRemainaingRoute']) && (!isset($globalMapRemainingRoute) |
|
639 | - || (isset($globalMapRemainingRoute) && $globalMapRemainingRoute)))))) { |
|
640 | - $havedata = false; |
|
641 | - if ($compress) $output_dest = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
642 | - else $output_dest = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
643 | - $output_dest .= '['.$spotter_item['longitude'].','.$spotter_item['latitude'].'],'; |
|
634 | + || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
|
635 | + && (isset($spotter_item['arrival_airport']) |
|
636 | + && $spotter_item['arrival_airport'] != 'NA' |
|
637 | + && ((isset($_COOKIE['MapRemainingRoute']) && $_COOKIE['MapRemainingRoute'] == "true") |
|
638 | + || (!isset($_COOKIE['MapRemainaingRoute']) && (!isset($globalMapRemainingRoute) |
|
639 | + || (isset($globalMapRemainingRoute) && $globalMapRemainingRoute)))))) { |
|
640 | + $havedata = false; |
|
641 | + if ($compress) $output_dest = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
642 | + else $output_dest = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
643 | + $output_dest .= '['.$spotter_item['longitude'].','.$spotter_item['latitude'].'],'; |
|
644 | 644 | |
645 | - if (isset($spotter_item['arrival_airport_latitude'])) { |
|
645 | + if (isset($spotter_item['arrival_airport_latitude'])) { |
|
646 | 646 | $output_dest .= '['.$spotter_item['arrival_airport_longitude'].','.$spotter_item['arrival_airport_latitude'].']'; |
647 | 647 | $havedata = true; |
648 | - } elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { |
|
648 | + } elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { |
|
649 | 649 | $aairport = $Spotter->getAllAirportInfo($spotter_item['arrival_airport']); |
650 | 650 | if (isset($aairport[0]['latitude'])) { |
651 | - $output_dest .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].']'; |
|
652 | - $havedata = true; |
|
651 | + $output_dest .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].']'; |
|
652 | + $havedata = true; |
|
653 | 653 | } |
654 | - } |
|
655 | - //$output_dest = substr($output_dest, 0, -1); |
|
656 | - $output_dest .= ']}},'; |
|
657 | - if ($havedata) $output .= $output_dest; |
|
658 | - unset($output_dest); |
|
654 | + } |
|
655 | + //$output_dest = substr($output_dest, 0, -1); |
|
656 | + $output_dest .= ']}},'; |
|
657 | + if ($havedata) $output .= $output_dest; |
|
658 | + unset($output_dest); |
|
659 | 659 | } |
660 | 660 | } |
661 | 661 | $output = substr($output, 0, -1); |
@@ -48,27 +48,52 @@ discard block |
||
48 | 48 | } |
49 | 49 | header('Content-Type: text/javascript'); |
50 | 50 | |
51 | -if (!isset($globalJsonCompress)) $compress = true; |
|
52 | -else $compress = $globalJsonCompress; |
|
51 | +if (!isset($globalJsonCompress)) { |
|
52 | + $compress = true; |
|
53 | +} else { |
|
54 | + $compress = $globalJsonCompress; |
|
55 | +} |
|
53 | 56 | |
54 | 57 | $from_archive = false; |
55 | 58 | $min = true; |
56 | 59 | $allhistory = false; |
57 | 60 | $filter['source'] = array(); |
58 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
59 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
60 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
61 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs')); |
|
62 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
63 | -if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
64 | -if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
65 | -if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
66 | -if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
67 | -if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING); |
|
61 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') { |
|
62 | + $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
63 | +} |
|
64 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') { |
|
65 | + $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
66 | +} |
|
67 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') { |
|
68 | + $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
69 | +} |
|
70 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') { |
|
71 | + $filter['source'] = array_merge($filter['source'],array('sbs','famaprs')); |
|
72 | +} |
|
73 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') { |
|
74 | + $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
75 | +} |
|
76 | +if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') { |
|
77 | + $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
78 | +} |
|
79 | +if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') { |
|
80 | + $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
81 | +} |
|
82 | +if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') { |
|
83 | + $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
84 | +} |
|
85 | +if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') { |
|
86 | + $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
87 | +} |
|
88 | +if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') { |
|
89 | + $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING); |
|
90 | +} |
|
68 | 91 | |
69 | 92 | if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) { |
70 | 93 | $min = true; |
71 | -} else $min = false; |
|
94 | +} else { |
|
95 | + $min = false; |
|
96 | +} |
|
72 | 97 | |
73 | 98 | if (isset($_GET['ident'])) { |
74 | 99 | $ident = urldecode(filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING)); |
@@ -162,20 +187,30 @@ discard block |
||
162 | 187 | $flightcnt = $SpotterLive->getLiveSpotterCount($filter); |
163 | 188 | } |
164 | 189 | } |
165 | - if ($flightcnt == '') $flightcnt = 0; |
|
166 | -} else $flightcnt = 0; |
|
190 | + if ($flightcnt == '') { |
|
191 | + $flightcnt = 0; |
|
192 | + } |
|
193 | + } else { |
|
194 | + $flightcnt = 0; |
|
195 | +} |
|
167 | 196 | |
168 | 197 | $sqltime = round(microtime(true)-$begintime,2); |
169 | 198 | |
170 | -if ((!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation == FALSE) || (isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'false')) $usenextlatlon = false; |
|
171 | -else $usenextlatlon = true; |
|
199 | +if ((!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation == FALSE) || (isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'false')) { |
|
200 | + $usenextlatlon = false; |
|
201 | +} else { |
|
202 | + $usenextlatlon = true; |
|
203 | +} |
|
172 | 204 | $j = 0; |
173 | 205 | $prev_flightaware_id = ''; |
174 | 206 | $aircrafts_shadow = array(); |
175 | 207 | $output = '{'; |
176 | 208 | $output .= '"type": "FeatureCollection",'; |
177 | - if ($min) $output .= '"minimal": "true",'; |
|
178 | - else $output .= '"minimal": "false",'; |
|
209 | + if ($min) { |
|
210 | + $output .= '"minimal": "true",'; |
|
211 | + } else { |
|
212 | + $output .= '"minimal": "false",'; |
|
213 | + } |
|
179 | 214 | //$output .= '"fc": "'.$flightcnt.'",'; |
180 | 215 | $output .= '"sqt": "'.$sqltime.'",'; |
181 | 216 | |
@@ -219,18 +254,29 @@ discard block |
||
219 | 254 | } |
220 | 255 | $output .= '"properties": {'; |
221 | 256 | if (isset($spotter_item['flightaware_id'])) { |
222 | - if ($compress) $output .= '"fi": "'.$spotter_item['flightaware_id'].'",'; |
|
223 | - else $output .= '"flightaware_id": "'.$spotter_item['flightaware_id'].'",'; |
|
257 | + if ($compress) { |
|
258 | + $output .= '"fi": "'.$spotter_item['flightaware_id'].'",'; |
|
259 | + } else { |
|
260 | + $output .= '"flightaware_id": "'.$spotter_item['flightaware_id'].'",'; |
|
261 | + } |
|
224 | 262 | } elseif (isset($spotter_item['famtrackid'])) { |
225 | - if ($compress) $output .= '"fti": "'.$spotter_item['famtrackid'].'",'; |
|
226 | - else $output .= '"famtrackid": "'.$spotter_item['famtrackid'].'",'; |
|
263 | + if ($compress) { |
|
264 | + $output .= '"fti": "'.$spotter_item['famtrackid'].'",'; |
|
265 | + } else { |
|
266 | + $output .= '"famtrackid": "'.$spotter_item['famtrackid'].'",'; |
|
267 | + } |
|
227 | 268 | } elseif (isset($spotter_item['fammarine_id'])) { |
228 | - if ($compress) $output .= '"fmi": "'.$spotter_item['fammarine_id'].'",'; |
|
229 | - else $output .= '"fammarineid": "'.$spotter_item['fammarine_id'].'",'; |
|
269 | + if ($compress) { |
|
270 | + $output .= '"fmi": "'.$spotter_item['fammarine_id'].'",'; |
|
271 | + } else { |
|
272 | + $output .= '"fammarineid": "'.$spotter_item['fammarine_id'].'",'; |
|
273 | + } |
|
230 | 274 | } |
231 | 275 | $output .= '"fc": "'.$flightcnt.'",'; |
232 | 276 | $output .= '"sqt": "'.$sqltime.'",'; |
233 | - if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",'; |
|
277 | + if (isset($begindate)) { |
|
278 | + $output .= '"archive_date": "'.$begindate.'",'; |
|
279 | + } |
|
234 | 280 | |
235 | 281 | /* |
236 | 282 | if ($min) $output .= '"minimal": "true",'; |
@@ -238,14 +284,22 @@ discard block |
||
238 | 284 | */ |
239 | 285 | //$output .= '"fc": "'.$spotter_item['nb'].'",'; |
240 | 286 | if (isset($spotter_item['ident']) && $spotter_item['ident'] != '') { |
241 | - if ($compress) $output .= '"c": "'.str_replace('\\','',$spotter_item['ident']).'",'; |
|
242 | - else $output .= '"callsign": "'.str_replace('\\','',$spotter_item['ident']).'",'; |
|
287 | + if ($compress) { |
|
288 | + $output .= '"c": "'.str_replace('\\','',$spotter_item['ident']).'",'; |
|
289 | + } else { |
|
290 | + $output .= '"callsign": "'.str_replace('\\','',$spotter_item['ident']).'",'; |
|
291 | + } |
|
243 | 292 | //" |
244 | 293 | } else { |
245 | - if ($compress) $output .= '"c": "NA",'; |
|
246 | - else $output .= '"callsign": "NA",'; |
|
294 | + if ($compress) { |
|
295 | + $output .= '"c": "NA",'; |
|
296 | + } else { |
|
297 | + $output .= '"callsign": "NA",'; |
|
298 | + } |
|
299 | + } |
|
300 | + if (isset($spotter_item['registration'])) { |
|
301 | + $output .= '"registration": "'.$spotter_item['registration'].'",'; |
|
247 | 302 | } |
248 | - if (isset($spotter_item['registration'])) $output .= '"registration": "'.$spotter_item['registration'].'",'; |
|
249 | 303 | if (isset($spotter_item['aircraft_name']) && isset($spotter_item['aircraft_type'])) { |
250 | 304 | $output .= '"aircraft_name": "'.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')",'; |
251 | 305 | $output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ','_',$spotter_item['aircraft_name'])).'",'; |
@@ -258,16 +312,23 @@ discard block |
||
258 | 312 | $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
259 | 313 | } |
260 | 314 | if (!isset($spotter_item['aircraft_shadow']) && !$tracker) { |
261 | - if (!isset($spotter_item['aircraft_icao']) || $spotter_item['aircraft_icao'] == '') $spotter_item['aircraft_shadow'] = ''; |
|
262 | - else { |
|
315 | + if (!isset($spotter_item['aircraft_icao']) || $spotter_item['aircraft_icao'] == '') { |
|
316 | + $spotter_item['aircraft_shadow'] = ''; |
|
317 | + } else { |
|
263 | 318 | $aircraft_icao = $spotter_item['aircraft_icao']; |
264 | - if (isset($aircrafts_shadow[$aircraft_icao])) $spotter_item['aircraft_shadow'] = $aircrafts_shadow[$aircraft_icao]; |
|
265 | - else { |
|
319 | + if (isset($aircrafts_shadow[$aircraft_icao])) { |
|
320 | + $spotter_item['aircraft_shadow'] = $aircrafts_shadow[$aircraft_icao]; |
|
321 | + } else { |
|
266 | 322 | $aircraft_info = $Spotter->getAllAircraftInfo($spotter_item['aircraft_icao']); |
267 | - if (count($aircraft_info) > 0) $spotter_item['aircraft_shadow'] = $aircraft_info[0]['aircraft_shadow']; |
|
268 | - elseif (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'aprs') $spotter_item['aircraft_shadow'] = 'PA18.png'; |
|
269 | - elseif ($aircraft_icao == 'PARAGLIDER') $spotter_item['aircraft_shadow'] = 'PARAGLIDER.png'; |
|
270 | - else $spotter_item['aircraft_shadow'] = ''; |
|
323 | + if (count($aircraft_info) > 0) { |
|
324 | + $spotter_item['aircraft_shadow'] = $aircraft_info[0]['aircraft_shadow']; |
|
325 | + } elseif (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'aprs') { |
|
326 | + $spotter_item['aircraft_shadow'] = 'PA18.png'; |
|
327 | + } elseif ($aircraft_icao == 'PARAGLIDER') { |
|
328 | + $spotter_item['aircraft_shadow'] = 'PARAGLIDER.png'; |
|
329 | + } else { |
|
330 | + $spotter_item['aircraft_shadow'] = ''; |
|
331 | + } |
|
271 | 332 | $aircrafts_shadow[$aircraft_icao] = $spotter_item['aircraft_shadow']; |
272 | 333 | } |
273 | 334 | } |
@@ -275,73 +336,139 @@ discard block |
||
275 | 336 | if (!isset($spotter_item['aircraft_shadow']) || $spotter_item['aircraft_shadow'] == '') { |
276 | 337 | if ($tracker) { |
277 | 338 | if (isset($spotter_item['type']) && $spotter_item['type'] == 'Ambulance') { |
278 | - if ($compress) $output .= '"as": "ambulance.png",'; |
|
279 | - else $output .= '"aircraft_shadow": "ambulance.png",'; |
|
339 | + if ($compress) { |
|
340 | + $output .= '"as": "ambulance.png",'; |
|
341 | + } else { |
|
342 | + $output .= '"aircraft_shadow": "ambulance.png",'; |
|
343 | + } |
|
280 | 344 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Police') { |
281 | - if ($compress) $output .= '"as": "police.png",'; |
|
282 | - else $output .= '"aircraft_shadow": "police.png",'; |
|
345 | + if ($compress) { |
|
346 | + $output .= '"as": "police.png",'; |
|
347 | + } else { |
|
348 | + $output .= '"aircraft_shadow": "police.png",'; |
|
349 | + } |
|
283 | 350 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Yacht (Sail)') { |
284 | - if ($compress) $output .= '"as": "ship.png",'; |
|
285 | - else $output .= '"aircraft_shadow": "ship.png",'; |
|
351 | + if ($compress) { |
|
352 | + $output .= '"as": "ship.png",'; |
|
353 | + } else { |
|
354 | + $output .= '"aircraft_shadow": "ship.png",'; |
|
355 | + } |
|
286 | 356 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Ship (Power Boat)') { |
287 | - if ($compress) $output .= '"as": "ship.png",'; |
|
288 | - else $output .= '"aircraft_shadow": "ship.png",'; |
|
357 | + if ($compress) { |
|
358 | + $output .= '"as": "ship.png",'; |
|
359 | + } else { |
|
360 | + $output .= '"aircraft_shadow": "ship.png",'; |
|
361 | + } |
|
289 | 362 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Shuttle') { |
290 | - if ($compress) $output .= '"as": "ship.png",'; |
|
291 | - else $output .= '"aircraft_shadow": "ship.png",'; |
|
363 | + if ($compress) { |
|
364 | + $output .= '"as": "ship.png",'; |
|
365 | + } else { |
|
366 | + $output .= '"aircraft_shadow": "ship.png",'; |
|
367 | + } |
|
292 | 368 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Truck') { |
293 | - if ($compress) $output .= '"as": "truck.png",'; |
|
294 | - else $output .= '"aircraft_shadow": "truck.png",'; |
|
369 | + if ($compress) { |
|
370 | + $output .= '"as": "truck.png",'; |
|
371 | + } else { |
|
372 | + $output .= '"aircraft_shadow": "truck.png",'; |
|
373 | + } |
|
295 | 374 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Truck (18 Wheeler)') { |
296 | - if ($compress) $output .= '"as": "truck.png",'; |
|
297 | - else $output .= '"aircraft_shadow": "truck.png",'; |
|
375 | + if ($compress) { |
|
376 | + $output .= '"as": "truck.png",'; |
|
377 | + } else { |
|
378 | + $output .= '"aircraft_shadow": "truck.png",'; |
|
379 | + } |
|
298 | 380 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Aircraft (small)') { |
299 | - if ($compress) $output .= '"as": "aircraft.png",'; |
|
300 | - else $output .= '"aircraft_shadow": "aircraft.png",'; |
|
381 | + if ($compress) { |
|
382 | + $output .= '"as": "aircraft.png",'; |
|
383 | + } else { |
|
384 | + $output .= '"aircraft_shadow": "aircraft.png",'; |
|
385 | + } |
|
301 | 386 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Large Aircraft') { |
302 | - if ($compress) $output .= '"as": "aircraft.png",'; |
|
303 | - else $output .= '"aircraft_shadow": "aircraft.png",'; |
|
387 | + if ($compress) { |
|
388 | + $output .= '"as": "aircraft.png",'; |
|
389 | + } else { |
|
390 | + $output .= '"aircraft_shadow": "aircraft.png",'; |
|
391 | + } |
|
304 | 392 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Helicopter') { |
305 | - if ($compress) $output .= '"as": "helico.png",'; |
|
306 | - else $output .= '"aircraft_shadow": "helico.png",'; |
|
393 | + if ($compress) { |
|
394 | + $output .= '"as": "helico.png",'; |
|
395 | + } else { |
|
396 | + $output .= '"aircraft_shadow": "helico.png",'; |
|
397 | + } |
|
307 | 398 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Railroad Engine') { |
308 | - if ($compress) $output .= '"as": "rail.png",'; |
|
309 | - else $output .= '"aircraft_shadow": "rail.png",'; |
|
399 | + if ($compress) { |
|
400 | + $output .= '"as": "rail.png",'; |
|
401 | + } else { |
|
402 | + $output .= '"aircraft_shadow": "rail.png",'; |
|
403 | + } |
|
310 | 404 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Firetruck') { |
311 | - if ($compress) $output .= '"as": "firetruck.png",'; |
|
312 | - else $output .= '"aircraft_shadow": "firetruck.png",'; |
|
405 | + if ($compress) { |
|
406 | + $output .= '"as": "firetruck.png",'; |
|
407 | + } else { |
|
408 | + $output .= '"aircraft_shadow": "firetruck.png",'; |
|
409 | + } |
|
313 | 410 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Bus') { |
314 | - if ($compress) $output .= '"as": "bus.png",'; |
|
315 | - else $output .= '"aircraft_shadow": "bus.png",'; |
|
411 | + if ($compress) { |
|
412 | + $output .= '"as": "bus.png",'; |
|
413 | + } else { |
|
414 | + $output .= '"aircraft_shadow": "bus.png",'; |
|
415 | + } |
|
316 | 416 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Phone') { |
317 | - if ($compress) $output .= '"as": "phone.png",'; |
|
318 | - else $output .= '"aircraft_shadow": "phone.png",'; |
|
417 | + if ($compress) { |
|
418 | + $output .= '"as": "phone.png",'; |
|
419 | + } else { |
|
420 | + $output .= '"aircraft_shadow": "phone.png",'; |
|
421 | + } |
|
319 | 422 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Jogger') { |
320 | - if ($compress) $output .= '"as": "jogger.png",'; |
|
321 | - else $output .= '"aircraft_shadow": "jogger.png",'; |
|
423 | + if ($compress) { |
|
424 | + $output .= '"as": "jogger.png",'; |
|
425 | + } else { |
|
426 | + $output .= '"aircraft_shadow": "jogger.png",'; |
|
427 | + } |
|
322 | 428 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Bike') { |
323 | - if ($compress) $output .= '"as": "bike.png",'; |
|
324 | - else $output .= '"aircraft_shadow": "bike.png",'; |
|
429 | + if ($compress) { |
|
430 | + $output .= '"as": "bike.png",'; |
|
431 | + } else { |
|
432 | + $output .= '"aircraft_shadow": "bike.png",'; |
|
433 | + } |
|
325 | 434 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Motorcycle') { |
326 | - if ($compress) $output .= '"as": "motorcycle.png",'; |
|
327 | - else $output .= '"aircraft_shadow": "motorcycle.png",'; |
|
435 | + if ($compress) { |
|
436 | + $output .= '"as": "motorcycle.png",'; |
|
437 | + } else { |
|
438 | + $output .= '"aircraft_shadow": "motorcycle.png",'; |
|
439 | + } |
|
328 | 440 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Balloon') { |
329 | - if ($compress) $output .= '"as": "balloon.png",'; |
|
330 | - else $output .= '"aircraft_shadow": "balloon.png",'; |
|
441 | + if ($compress) { |
|
442 | + $output .= '"as": "balloon.png",'; |
|
443 | + } else { |
|
444 | + $output .= '"aircraft_shadow": "balloon.png",'; |
|
445 | + } |
|
331 | 446 | } else { |
332 | - if ($compress) $output .= '"as": "car.png",'; |
|
333 | - else $output .= '"aircraft_shadow": "car.png",'; |
|
447 | + if ($compress) { |
|
448 | + $output .= '"as": "car.png",'; |
|
449 | + } else { |
|
450 | + $output .= '"aircraft_shadow": "car.png",'; |
|
451 | + } |
|
334 | 452 | } |
335 | 453 | } elseif ($marine) { |
336 | - if ($compress) $output .= '"as": "ship.png",'; |
|
337 | - else $output .= '"aircraft_shadow": "ship.png",'; |
|
454 | + if ($compress) { |
|
455 | + $output .= '"as": "ship.png",'; |
|
456 | + } else { |
|
457 | + $output .= '"aircraft_shadow": "ship.png",'; |
|
458 | + } |
|
338 | 459 | } else { |
339 | - if ($compress) $output .= '"as": "default.png",'; |
|
340 | - else $output .= '"aircraft_shadow": "default.png",'; |
|
460 | + if ($compress) { |
|
461 | + $output .= '"as": "default.png",'; |
|
462 | + } else { |
|
463 | + $output .= '"aircraft_shadow": "default.png",'; |
|
464 | + } |
|
341 | 465 | } |
342 | 466 | } else { |
343 | - if ($compress) $output .= '"as": "'.$spotter_item['aircraft_shadow'].'",'; |
|
344 | - else $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",'; |
|
467 | + if ($compress) { |
|
468 | + $output .= '"as": "'.$spotter_item['aircraft_shadow'].'",'; |
|
469 | + } else { |
|
470 | + $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",'; |
|
471 | + } |
|
345 | 472 | } |
346 | 473 | if (isset($spotter_item['airline_name'])) { |
347 | 474 | $output .= '"airline_name": "'.$spotter_item['airline_name'].'",'; |
@@ -349,8 +476,11 @@ discard block |
||
349 | 476 | $output .= '"airline_name": "NA",'; |
350 | 477 | } |
351 | 478 | if (isset($spotter_item['departure_airport'])) { |
352 | - if ($compress) $output .= '"dac": "'.$spotter_item['departure_airport'].'",'; |
|
353 | - else $output .= '"departure_airport_code": "'.$spotter_item['departure_airport'].'",'; |
|
479 | + if ($compress) { |
|
480 | + $output .= '"dac": "'.$spotter_item['departure_airport'].'",'; |
|
481 | + } else { |
|
482 | + $output .= '"departure_airport_code": "'.$spotter_item['departure_airport'].'",'; |
|
483 | + } |
|
354 | 484 | } |
355 | 485 | if (isset($spotter_item['departure_airport_city'])) { |
356 | 486 | $output .= '"departure_airport": "'.$spotter_item['departure_airport_city'].', '.$spotter_item['departure_airport_country'].'",'; |
@@ -362,8 +492,11 @@ discard block |
||
362 | 492 | $output .= '"arrival_airport_time": "'.$spotter_item['arrival_airport_time'].'",'; |
363 | 493 | } |
364 | 494 | if (isset($spotter_item['arrival_airport'])) { |
365 | - if ($compress) $output .= '"aac": "'.$spotter_item['arrival_airport'].'",'; |
|
366 | - else $output .= '"arrival_airport_code": "'.$spotter_item['arrival_airport'].'",'; |
|
495 | + if ($compress) { |
|
496 | + $output .= '"aac": "'.$spotter_item['arrival_airport'].'",'; |
|
497 | + } else { |
|
498 | + $output .= '"arrival_airport_code": "'.$spotter_item['arrival_airport'].'",'; |
|
499 | + } |
|
367 | 500 | } |
368 | 501 | if (isset($spotter_item['arrival_airport_city'])) { |
369 | 502 | $output .= '"arrival_airport": "'.$spotter_item['arrival_airport_city'].', '.$spotter_item['arrival_airport_country'].'",'; |
@@ -382,11 +515,17 @@ discard block |
||
382 | 515 | } |
383 | 516 | |
384 | 517 | if (isset($spotter_item['altitude'])) { |
385 | - if ($compress) $output .= '"a": "'.$spotter_item['altitude'].'",'; |
|
386 | - else $output .= '"altitude": "'.$spotter_item['altitude'].'",'; |
|
518 | + if ($compress) { |
|
519 | + $output .= '"a": "'.$spotter_item['altitude'].'",'; |
|
520 | + } else { |
|
521 | + $output .= '"altitude": "'.$spotter_item['altitude'].'",'; |
|
522 | + } |
|
523 | + } |
|
524 | + if ($compress) { |
|
525 | + $output .= '"h": "'.$spotter_item['heading'].'",'; |
|
526 | + } else { |
|
527 | + $output .= '"heading": "'.$spotter_item['heading'].'",'; |
|
387 | 528 | } |
388 | - if ($compress)$output .= '"h": "'.$spotter_item['heading'].'",'; |
|
389 | - else $output .= '"heading": "'.$spotter_item['heading'].'",'; |
|
390 | 529 | |
391 | 530 | if (isset($archivespeed)) { |
392 | 531 | $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading'],$archivespeed); |
@@ -396,7 +535,9 @@ discard block |
||
396 | 535 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
397 | 536 | } |
398 | 537 | |
399 | - if (!$min) $output .= '"image": "'.$image.'",'; |
|
538 | + if (!$min) { |
|
539 | + $output .= '"image": "'.$image.'",'; |
|
540 | + } |
|
400 | 541 | if (isset($spotter_item['image_copyright']) && $spotter_item['image_copyright'] != '') { |
401 | 542 | $output .= '"image_copyright": "'.str_replace('"',"'",trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'',$spotter_item['image_copyright']))).'",'; |
402 | 543 | } |
@@ -404,8 +545,11 @@ discard block |
||
404 | 545 | $output .= '"image_source_website": "'.urlencode($spotter_item['image_source_website']).'",'; |
405 | 546 | } |
406 | 547 | if (isset($spotter_item['squawk'])) { |
407 | - if ($compress) $output .= '"sq": "'.$spotter_item['squawk'].'",'; |
|
408 | - else $output .= '"squawk": "'.$spotter_item['squawk'].'",'; |
|
548 | + if ($compress) { |
|
549 | + $output .= '"sq": "'.$spotter_item['squawk'].'",'; |
|
550 | + } else { |
|
551 | + $output .= '"squawk": "'.$spotter_item['squawk'].'",'; |
|
552 | + } |
|
409 | 553 | } |
410 | 554 | if (isset($spotter_item['squawk_usage'])) { |
411 | 555 | $output .= '"squawk_usage": "'.$spotter_item['squawk_usage'].'",'; |
@@ -424,14 +568,23 @@ discard block |
||
424 | 568 | } |
425 | 569 | // type when not aircraft ? |
426 | 570 | if (isset($spotter_item['type'])) { |
427 | - if ($compress) $output .= '"t": "'.$spotter_item['type'].'"'; |
|
428 | - else $output .= '"type": "'.$spotter_item['type'].'"'; |
|
571 | + if ($compress) { |
|
572 | + $output .= '"t": "'.$spotter_item['type'].'"'; |
|
573 | + } else { |
|
574 | + $output .= '"type": "'.$spotter_item['type'].'"'; |
|
575 | + } |
|
429 | 576 | } elseif ($marine) { |
430 | - if ($compress) $output .= '"t": "ship"'; |
|
431 | - else $output .= '"type": "ship"'; |
|
577 | + if ($compress) { |
|
578 | + $output .= '"t": "ship"'; |
|
579 | + } else { |
|
580 | + $output .= '"type": "ship"'; |
|
581 | + } |
|
432 | 582 | } else { |
433 | - if ($compress) $output .= '"t": "aircraft"'; |
|
434 | - else $output .= '"type": "aircraft"'; |
|
583 | + if ($compress) { |
|
584 | + $output .= '"t": "aircraft"'; |
|
585 | + } else { |
|
586 | + $output .= '"type": "aircraft"'; |
|
587 | + } |
|
435 | 588 | } |
436 | 589 | $output .= '},'; |
437 | 590 | $output .= '"geometry": {'; |
@@ -499,7 +652,9 @@ discard block |
||
499 | 652 | } |
500 | 653 | */ |
501 | 654 | $history = filter_input(INPUT_GET,'history',FILTER_SANITIZE_STRING); |
502 | - if ($history == '' && isset($_COOKIE['history'])) $history = $_COOKIE['history']; |
|
655 | + if ($history == '' && isset($_COOKIE['history'])) { |
|
656 | + $history = $_COOKIE['history']; |
|
657 | + } |
|
503 | 658 | |
504 | 659 | if ( |
505 | 660 | (isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') |
@@ -543,8 +698,11 @@ discard block |
||
543 | 698 | $output_history .= ']}},'; |
544 | 699 | $output .= $output_history; |
545 | 700 | } |
546 | - if ($compress) $output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "history","a": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
|
547 | - else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
|
701 | + if ($compress) { |
|
702 | + $output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "history","a": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
|
703 | + } else { |
|
704 | + $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
|
705 | + } |
|
548 | 706 | } |
549 | 707 | $output_history .= '['; |
550 | 708 | $output_history .= $spotter_history['longitude'].', '; |
@@ -563,9 +721,14 @@ discard block |
||
563 | 721 | $prev_alt = $alt; |
564 | 722 | } else { |
565 | 723 | if ($d == false) { |
566 | - if ($compress) $output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "history"},"geometry": {"type": "LineString","coordinates": ['; |
|
567 | - else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history"},"geometry": {"type": "LineString","coordinates": ['; |
|
568 | - } else $d = true; |
|
724 | + if ($compress) { |
|
725 | + $output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "history"},"geometry": {"type": "LineString","coordinates": ['; |
|
726 | + } else { |
|
727 | + $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history"},"geometry": {"type": "LineString","coordinates": ['; |
|
728 | + } |
|
729 | + } else { |
|
730 | + $d = true; |
|
731 | + } |
|
569 | 732 | $output_history .= '['; |
570 | 733 | $output_history .= $spotter_history['longitude'].', '; |
571 | 734 | $output_history .= $spotter_history['latitude']; |
@@ -586,7 +749,9 @@ discard block |
||
586 | 749 | $output_historyd = '['; |
587 | 750 | $output_historyd .= $spotter_item['longitude'].', '; |
588 | 751 | $output_historyd .= $spotter_item['latitude']; |
589 | - if (isset($spotter_history['altitude'])) $output_historyd .= ','.$spotter_item['altitude']*30.48; |
|
752 | + if (isset($spotter_history['altitude'])) { |
|
753 | + $output_historyd .= ','.$spotter_item['altitude']*30.48; |
|
754 | + } |
|
590 | 755 | $output_historyd .= '],'; |
591 | 756 | //$output_history = $output_historyd.$output_history; |
592 | 757 | $output_history = $output_history.$output_historyd; |
@@ -608,8 +773,11 @@ discard block |
||
608 | 773 | && $spotter_item['arrival_airport'] != 'NA' |
609 | 774 | && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") |
610 | 775 | || (!isset($_COOKIE['MapRoute']) && isset($globalMapRoute) && $globalMapRoute)))) { |
611 | - if ($compress) $output_air = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
612 | - else $output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
776 | + if ($compress) { |
|
777 | + $output_air = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
778 | + } else { |
|
779 | + $output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
780 | + } |
|
613 | 781 | if (isset($spotter_item['departure_airport_latitude'])) { |
614 | 782 | $output_air .= '['.$spotter_item['departure_airport_longitude'].','.$spotter_item['departure_airport_latitude'].'],'; |
615 | 783 | } elseif (isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA') { |
@@ -642,8 +810,11 @@ discard block |
||
642 | 810 | || (!isset($_COOKIE['MapRemainaingRoute']) && (!isset($globalMapRemainingRoute) |
643 | 811 | || (isset($globalMapRemainingRoute) && $globalMapRemainingRoute)))))) { |
644 | 812 | $havedata = false; |
645 | - if ($compress) $output_dest = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
646 | - else $output_dest = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
813 | + if ($compress) { |
|
814 | + $output_dest = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
815 | + } else { |
|
816 | + $output_dest = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
817 | + } |
|
647 | 818 | $output_dest .= '['.$spotter_item['longitude'].','.$spotter_item['latitude'].'],'; |
648 | 819 | |
649 | 820 | if (isset($spotter_item['arrival_airport_latitude'])) { |
@@ -658,7 +829,9 @@ discard block |
||
658 | 829 | } |
659 | 830 | //$output_dest = substr($output_dest, 0, -1); |
660 | 831 | $output_dest .= ']}},'; |
661 | - if ($havedata) $output .= $output_dest; |
|
832 | + if ($havedata) { |
|
833 | + $output .= $output_dest; |
|
834 | + } |
|
662 | 835 | unset($output_dest); |
663 | 836 | } |
664 | 837 | } |
@@ -666,7 +839,9 @@ discard block |
||
666 | 839 | $output .= ']'; |
667 | 840 | $output .= ',"initial_sqltime": "'.$sqltime.'",'; |
668 | 841 | $output .= '"totaltime": "'.round(microtime(true)-$begintime,2).'",'; |
669 | - if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",'; |
|
842 | + if (isset($begindate)) { |
|
843 | + $output .= '"archive_date": "'.$begindate.'",'; |
|
844 | + } |
|
670 | 845 | $output .= '"fc": "'.$j.'"'; |
671 | 846 | } else { |
672 | 847 | $output .= '"features": '; |
@@ -55,23 +55,23 @@ discard block |
||
55 | 55 | $min = true; |
56 | 56 | $allhistory = false; |
57 | 57 | $filter['source'] = array(); |
58 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
59 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
60 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
61 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs')); |
|
62 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
63 | -if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
64 | -if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
65 | -if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
66 | -if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
67 | -if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING); |
|
58 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'], array('vatsimtxt')); |
|
59 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'], array('whazzup')); |
|
60 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'], array('phpvmacars')); |
|
61 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'], array('sbs', 'famaprs')); |
|
62 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'], array('aprs')); |
|
63 | +if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'], FILTER_SANITIZE_STRING); |
|
64 | +if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',', $_COOKIE['filter_Airlines']), FILTER_SANITIZE_STRING); |
|
65 | +if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',', $_COOKIE['filter_Sources']), FILTER_SANITIZE_STRING); |
|
66 | +if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'], FILTER_SANITIZE_STRING); |
|
67 | +if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'], FILTER_SANITIZE_STRING); |
|
68 | 68 | |
69 | 69 | if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) { |
70 | 70 | $min = true; |
71 | 71 | } else $min = false; |
72 | 72 | |
73 | 73 | if (isset($_GET['ident'])) { |
74 | - $ident = urldecode(filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING)); |
|
74 | + $ident = urldecode(filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING)); |
|
75 | 75 | if ($tracker) { |
76 | 76 | $spotter_array = $TrackerLive->getLastLiveTrackerDataByIdent($ident); |
77 | 77 | } elseif ($marine) { |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | } |
86 | 86 | $allhistory = true; |
87 | 87 | } elseif (isset($_GET['flightaware_id'])) { |
88 | - $flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING); |
|
88 | + $flightaware_id = filter_input(INPUT_GET, 'flightaware_id', FILTER_SANITIZE_STRING); |
|
89 | 89 | $spotter_array = $SpotterLive->getLastLiveSpotterDataById($flightaware_id); |
90 | 90 | if (empty($spotter_array)) { |
91 | 91 | $from_archive = true; |
@@ -93,44 +93,44 @@ discard block |
||
93 | 93 | } |
94 | 94 | $allhistory = true; |
95 | 95 | } elseif (isset($_GET['famtrack_id'])) { |
96 | - $famtrack_id = urldecode(filter_input(INPUT_GET,'famtrack_id',FILTER_SANITIZE_STRING)); |
|
96 | + $famtrack_id = urldecode(filter_input(INPUT_GET, 'famtrack_id', FILTER_SANITIZE_STRING)); |
|
97 | 97 | $spotter_array = $TrackerLive->getLastLiveTrackerDataById($famtrack_id); |
98 | 98 | $allhistory = true; |
99 | 99 | } elseif (isset($_GET['fammarine_id'])) { |
100 | - $fammarine_id = urldecode(filter_input(INPUT_GET,'fammarine_id',FILTER_SANITIZE_STRING)); |
|
100 | + $fammarine_id = urldecode(filter_input(INPUT_GET, 'fammarine_id', FILTER_SANITIZE_STRING)); |
|
101 | 101 | $spotter_array = $MarineLive->getLastLiveMarineDataById($fammarine_id); |
102 | 102 | $allhistory = true; |
103 | 103 | } elseif (isset($globalMapUseBbox) && $globalMapUseBbox && isset($_GET['coord']) && (!isset($globalMapPopup) || $globalMapPopup || (isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true'))) { |
104 | 104 | //} elseif (isset($_GET['coord'])) { |
105 | 105 | $usecoord = true; |
106 | - $coord = explode(',',$_GET['coord']); |
|
106 | + $coord = explode(',', $_GET['coord']); |
|
107 | 107 | if ($tracker) { |
108 | - $spotter_array = $TrackerLive->getLiveTrackerDatabyCoord($coord,$filter); |
|
108 | + $spotter_array = $TrackerLive->getLiveTrackerDatabyCoord($coord, $filter); |
|
109 | 109 | } elseif ($marine) { |
110 | - $spotter_array = $MarineLive->getLiveMarineDatabyCoord($coord,$filter); |
|
110 | + $spotter_array = $MarineLive->getLiveMarineDatabyCoord($coord, $filter); |
|
111 | 111 | } else { |
112 | - $spotter_array = $SpotterLive->getLiveSpotterDatabyCoord($coord,$filter); |
|
112 | + $spotter_array = $SpotterLive->getLiveSpotterDatabyCoord($coord, $filter); |
|
113 | 113 | } |
114 | 114 | } elseif (isset($globalMapUseBbox) && $globalMapUseBbox && isset($_GET['coord']) && $min) { |
115 | 115 | $usecoord = true; |
116 | - $coord = explode(',',$_GET['coord']); |
|
116 | + $coord = explode(',', $_GET['coord']); |
|
117 | 117 | if ($tracker) { |
118 | - $spotter_array = $TrackerLive->getMinLiveTrackerDatabyCoord($coord,$filter); |
|
118 | + $spotter_array = $TrackerLive->getMinLiveTrackerDatabyCoord($coord, $filter); |
|
119 | 119 | } elseif ($marine) { |
120 | - $spotter_array = $MarineLive->getMinLiveMarineDatabyCoord($coord,$filter); |
|
120 | + $spotter_array = $MarineLive->getMinLiveMarineDatabyCoord($coord, $filter); |
|
121 | 121 | } else { |
122 | - $spotter_array = $SpotterLive->getMinLiveSpotterDatabyCoord($coord,$filter); |
|
122 | + $spotter_array = $SpotterLive->getMinLiveSpotterDatabyCoord($coord, $filter); |
|
123 | 123 | } |
124 | 124 | } elseif (isset($_GET['archive']) && isset($_GET['begindate']) && isset($_GET['enddate']) && isset($_GET['speed']) && !isset($_GET['tracker']) && !isset($_GET['marine'])) { |
125 | 125 | $from_archive = true; |
126 | 126 | // $begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
127 | 127 | // $enddate = filter_input(INPUT_GET,'enddate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
128 | - $begindate = filter_input(INPUT_GET,'begindate',FILTER_SANITIZE_NUMBER_INT); |
|
129 | - $enddate = filter_input(INPUT_GET,'enddate',FILTER_SANITIZE_NUMBER_INT); |
|
130 | - $archivespeed = filter_input(INPUT_GET,'speed',FILTER_SANITIZE_NUMBER_INT); |
|
131 | - $begindate = date('Y-m-d H:i:s',$begindate); |
|
132 | - $enddate = date('Y-m-d H:i:s',$enddate); |
|
133 | - $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate,$enddate,$filter); |
|
128 | + $begindate = filter_input(INPUT_GET, 'begindate', FILTER_SANITIZE_NUMBER_INT); |
|
129 | + $enddate = filter_input(INPUT_GET, 'enddate', FILTER_SANITIZE_NUMBER_INT); |
|
130 | + $archivespeed = filter_input(INPUT_GET, 'speed', FILTER_SANITIZE_NUMBER_INT); |
|
131 | + $begindate = date('Y-m-d H:i:s', $begindate); |
|
132 | + $enddate = date('Y-m-d H:i:s', $enddate); |
|
133 | + $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate, $enddate, $filter); |
|
134 | 134 | } elseif ($min) { |
135 | 135 | if ($tracker) { |
136 | 136 | $spotter_array = $TrackerLive->getMinLiveTrackerData($filter); |
@@ -142,17 +142,17 @@ discard block |
||
142 | 142 | # $min = true; |
143 | 143 | } else { |
144 | 144 | if ($tracker) { |
145 | - $spotter_array = $TrackerLive->getLiveTrackerData('','',$filter); |
|
145 | + $spotter_array = $TrackerLive->getLiveTrackerData('', '', $filter); |
|
146 | 146 | } elseif ($marine) { |
147 | - $spotter_array = $marineLive->getLiveMarineData('','',$filter); |
|
147 | + $spotter_array = $marineLive->getLiveMarineData('', '', $filter); |
|
148 | 148 | } else { |
149 | - $spotter_array = $SpotterLive->getLiveSpotterData('','',$filter); |
|
149 | + $spotter_array = $SpotterLive->getLiveSpotterData('', '', $filter); |
|
150 | 150 | } |
151 | 151 | } |
152 | 152 | |
153 | 153 | if ($usecoord) { |
154 | 154 | if (isset($_GET['archive'])) { |
155 | - $flightcnt = $SpotterArchive->getLiveSpotterCount($begindate,$enddate,$filter); |
|
155 | + $flightcnt = $SpotterArchive->getLiveSpotterCount($begindate, $enddate, $filter); |
|
156 | 156 | } else { |
157 | 157 | if ($tracker) { |
158 | 158 | $flightcnt = $TrackerLive->getLiveTrackerCount($filter); |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | if ($flightcnt == '') $flightcnt = 0; |
166 | 166 | } else $flightcnt = 0; |
167 | 167 | |
168 | -$sqltime = round(microtime(true)-$begintime,2); |
|
168 | +$sqltime = round(microtime(true) - $begintime, 2); |
|
169 | 169 | |
170 | 170 | if ((!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation == FALSE) || (isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'false')) $usenextlatlon = false; |
171 | 171 | else $usenextlatlon = true; |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | if (!empty($spotter_array) && is_array($spotter_array)) |
183 | 183 | { |
184 | 184 | $output .= '"features": ['; |
185 | - foreach($spotter_array as $spotter_item) |
|
185 | + foreach ($spotter_array as $spotter_item) |
|
186 | 186 | { |
187 | 187 | $j++; |
188 | 188 | date_default_timezone_set('UTC'); |
@@ -238,8 +238,8 @@ discard block |
||
238 | 238 | */ |
239 | 239 | //$output .= '"fc": "'.$spotter_item['nb'].'",'; |
240 | 240 | if (isset($spotter_item['ident']) && $spotter_item['ident'] != '') { |
241 | - if ($compress) $output .= '"c": "'.str_replace('\\','',$spotter_item['ident']).'",'; |
|
242 | - else $output .= '"callsign": "'.str_replace('\\','',$spotter_item['ident']).'",'; |
|
241 | + if ($compress) $output .= '"c": "'.str_replace('\\', '', $spotter_item['ident']).'",'; |
|
242 | + else $output .= '"callsign": "'.str_replace('\\', '', $spotter_item['ident']).'",'; |
|
243 | 243 | //" |
244 | 244 | } else { |
245 | 245 | if ($compress) $output .= '"c": "NA",'; |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | if (isset($spotter_item['registration'])) $output .= '"registration": "'.$spotter_item['registration'].'",'; |
249 | 249 | if (isset($spotter_item['aircraft_name']) && isset($spotter_item['aircraft_type'])) { |
250 | 250 | $output .= '"aircraft_name": "'.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')",'; |
251 | - $output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ','_',$spotter_item['aircraft_name'])).'",'; |
|
251 | + $output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ', '_', $spotter_item['aircraft_name'])).'",'; |
|
252 | 252 | } elseif (isset($spotter_item['aircraft_type'])) { |
253 | 253 | $output .= '"aircraft_name": "NA ('.$spotter_item['aircraft_type'].')",'; |
254 | 254 | } elseif (!$min) { |
@@ -389,16 +389,16 @@ discard block |
||
389 | 389 | else $output .= '"heading": "'.$spotter_item['heading'].'",'; |
390 | 390 | |
391 | 391 | if (isset($archivespeed)) { |
392 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading'],$archivespeed); |
|
392 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $spotter_item['heading'], $archivespeed); |
|
393 | 393 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
394 | 394 | } elseif ($usenextlatlon) { |
395 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading']); |
|
395 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $spotter_item['heading']); |
|
396 | 396 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
397 | 397 | } |
398 | 398 | |
399 | 399 | if (!$min) $output .= '"image": "'.$image.'",'; |
400 | 400 | if (isset($spotter_item['image_copyright']) && $spotter_item['image_copyright'] != '') { |
401 | - $output .= '"image_copyright": "'.str_replace('"',"'",trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'',$spotter_item['image_copyright']))).'",'; |
|
401 | + $output .= '"image_copyright": "'.str_replace('"', "'", trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '', $spotter_item['image_copyright']))).'",'; |
|
402 | 402 | } |
403 | 403 | if (isset($spotter_item['image_source_website'])) { |
404 | 404 | $output .= '"image_source_website": "'.urlencode($spotter_item['image_source_website']).'",'; |
@@ -420,7 +420,7 @@ discard block |
||
420 | 420 | $output .= '"waypoints": "'.$spotter_item['waypoints'].'",'; |
421 | 421 | } |
422 | 422 | if (isset($spotter_item['acars'])) { |
423 | - $output .= '"acars": "'.trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"), '<br />',$spotter_item['acars']['message'])).'",'; |
|
423 | + $output .= '"acars": "'.trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '<br />', $spotter_item['acars']['message'])).'",'; |
|
424 | 424 | } |
425 | 425 | // type when not aircraft ? |
426 | 426 | if (isset($spotter_item['type'])) { |
@@ -498,7 +498,7 @@ discard block |
||
498 | 498 | |
499 | 499 | } |
500 | 500 | */ |
501 | - $history = filter_input(INPUT_GET,'history',FILTER_SANITIZE_STRING); |
|
501 | + $history = filter_input(INPUT_GET, 'history', FILTER_SANITIZE_STRING); |
|
502 | 502 | if ($history == '' && isset($_COOKIE['history'])) $history = $_COOKIE['history']; |
503 | 503 | |
504 | 504 | if ( |
@@ -506,11 +506,11 @@ discard block |
||
506 | 506 | || ((isset($globalMapHistory) && $globalMapHistory) || $allhistory) |
507 | 507 | // || (isset($history) && $history != '' && $history != 'NA' && ($history == $spotter_item['ident'] || $history == $spotter_item['flightaware_id'])) |
508 | 508 | // || (isset($history) && $history != '' && $history != 'NA' && $history == $spotter_item['ident']) |
509 | - || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
|
509 | + || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id'])) |
|
510 | 510 | || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']) |
511 | - || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['fammarine_id'])) |
|
511 | + || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['fammarine_id'])) |
|
512 | 512 | || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['fammarine_id']) && $_GET['fammarine_id'] == $spotter_item['fammarine_id']) |
513 | - || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['famtrackid'])) |
|
513 | + || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['famtrackid'])) |
|
514 | 514 | || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['famtrackid']) && $_GET['famtrackid'] == $spotter_item['famtrackid']) |
515 | 515 | ) { |
516 | 516 | if ($tracker) { |
@@ -547,9 +547,9 @@ discard block |
||
547 | 547 | else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
548 | 548 | } |
549 | 549 | $output_history .= '['; |
550 | - $output_history .= $spotter_history['longitude'].', '; |
|
551 | - $output_history .= $spotter_history['latitude'].', '; |
|
552 | - $output_history .= $spotter_history['altitude']*30.48; |
|
550 | + $output_history .= $spotter_history['longitude'].', '; |
|
551 | + $output_history .= $spotter_history['latitude'].', '; |
|
552 | + $output_history .= $spotter_history['altitude']*30.48; |
|
553 | 553 | $output_history .= '],'; |
554 | 554 | /* |
555 | 555 | if ($from_archive === false) { |
@@ -567,8 +567,8 @@ discard block |
||
567 | 567 | else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history"},"geometry": {"type": "LineString","coordinates": ['; |
568 | 568 | } else $d = true; |
569 | 569 | $output_history .= '['; |
570 | - $output_history .= $spotter_history['longitude'].', '; |
|
571 | - $output_history .= $spotter_history['latitude']; |
|
570 | + $output_history .= $spotter_history['longitude'].', '; |
|
571 | + $output_history .= $spotter_history['latitude']; |
|
572 | 572 | $output_history .= '],'; |
573 | 573 | /* |
574 | 574 | if ($from_archive === false) { |
@@ -584,9 +584,9 @@ discard block |
||
584 | 584 | |
585 | 585 | if ($from_archive === false) { |
586 | 586 | $output_historyd = '['; |
587 | - $output_historyd .= $spotter_item['longitude'].', '; |
|
588 | - $output_historyd .= $spotter_item['latitude']; |
|
589 | - if (isset($spotter_history['altitude'])) $output_historyd .= ','.$spotter_item['altitude']*30.48; |
|
587 | + $output_historyd .= $spotter_item['longitude'].', '; |
|
588 | + $output_historyd .= $spotter_item['latitude']; |
|
589 | + if (isset($spotter_history['altitude'])) $output_historyd .= ','.$spotter_item['altitude']*30.48; |
|
590 | 590 | $output_historyd .= '],'; |
591 | 591 | //$output_history = $output_historyd.$output_history; |
592 | 592 | $output_history = $output_history.$output_historyd; |
@@ -600,7 +600,7 @@ discard block |
||
600 | 600 | } |
601 | 601 | } |
602 | 602 | |
603 | - if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
|
603 | + if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id'])) |
|
604 | 604 | || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
605 | 605 | && (isset($spotter_item['departure_airport']) |
606 | 606 | && $spotter_item['departure_airport'] != 'NA' |
@@ -634,7 +634,7 @@ discard block |
||
634 | 634 | |
635 | 635 | //if (isset($history) && $history != '' && $history == $spotter_item['ident'] && isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA' && isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA' && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") || (!isset($_COOKIE['MapRoute']) && (!isset($globalMapRoute) || (isset($globalMapRoute) && $globalMapRoute))))) { |
636 | 636 | //if (isset($history) && $history != '' && $history == $spotter_item['ident'] && isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA' && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") || (!isset($_COOKIE['MapRoute']) && (!isset($globalMapRoute) || (isset($globalMapRoute) && $globalMapRoute))))) { |
637 | - if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
|
637 | + if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id'])) |
|
638 | 638 | || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
639 | 639 | && (isset($spotter_item['arrival_airport']) |
640 | 640 | && $spotter_item['arrival_airport'] != 'NA' |
@@ -665,7 +665,7 @@ discard block |
||
665 | 665 | $output = substr($output, 0, -1); |
666 | 666 | $output .= ']'; |
667 | 667 | $output .= ',"initial_sqltime": "'.$sqltime.'",'; |
668 | - $output .= '"totaltime": "'.round(microtime(true)-$begintime,2).'",'; |
|
668 | + $output .= '"totaltime": "'.round(microtime(true) - $begintime, 2).'",'; |
|
669 | 669 | if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",'; |
670 | 670 | $output .= '"fc": "'.$j.'"'; |
671 | 671 | } else { |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | require_once('../require/settings.php'); |
3 | 3 | require_once('../require/class.Language.php'); |
4 | 4 | |
5 | -setcookie("MapFormat",'2d'); |
|
5 | +setcookie("MapFormat", '2d'); |
|
6 | 6 | |
7 | 7 | if (!isset($globalOpenWeatherMapKey)) $globalOpenWeatherMapKey = ''; |
8 | 8 | // Compressed GeoJson is used if true |
@@ -20,10 +20,10 @@ discard block |
||
20 | 20 | $lastupd = $_GET['archivespeed']*$archiveupdatetime; |
21 | 21 | if (isset($_GET['enddate']) && $_GET['enddate'] != '') $enddate = $_GET['enddate']; |
22 | 22 | else $enddate = time(); |
23 | - setcookie("archive_begin",$begindate); |
|
24 | - setcookie("archive_end",$enddate); |
|
25 | - setcookie("archive_update",$lastupd); |
|
26 | - setcookie("archive_speed",$archivespeed); |
|
23 | + setcookie("archive_begin", $begindate); |
|
24 | + setcookie("archive_end", $enddate); |
|
25 | + setcookie("archive_update", $lastupd); |
|
26 | + setcookie("archive_speed", $archivespeed); |
|
27 | 27 | ?> |
28 | 28 | document.cookie = 'archive_begin=<?php print $begindate; ?>; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/'; |
29 | 29 | document.cookie = 'archive_end=<?php print $enddate; ?>; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/'; |
@@ -74,16 +74,16 @@ discard block |
||
74 | 74 | <?php |
75 | 75 | } |
76 | 76 | if (isset($_GET['ident'])) { |
77 | - $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
|
77 | + $ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING); |
|
78 | 78 | } |
79 | 79 | if (isset($_GET['flightaware_id'])) { |
80 | - $flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING); |
|
80 | + $flightaware_id = filter_input(INPUT_GET, 'flightaware_id', FILTER_SANITIZE_STRING); |
|
81 | 81 | } |
82 | 82 | if (isset($_GET['latitude'])) { |
83 | - $latitude = filter_input(INPUT_GET,'latitude',FILTER_SANITIZE_STRING); |
|
83 | + $latitude = filter_input(INPUT_GET, 'latitude', FILTER_SANITIZE_STRING); |
|
84 | 84 | } |
85 | 85 | if (isset($_GET['longitude'])) { |
86 | - $longitude = filter_input(INPUT_GET,'longitude',FILTER_SANITIZE_STRING); |
|
86 | + $longitude = filter_input(INPUT_GET, 'longitude', FILTER_SANITIZE_STRING); |
|
87 | 87 | } |
88 | 88 | ?> |
89 | 89 | |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | || navigator.userAgent.match(/BlackBerry/i) |
120 | 120 | || navigator.userAgent.match(/Windows Phone/i)) |
121 | 121 | { |
122 | - var zoom = <?php if (isset($globalLiveZoom)) print $globalLiveZoom-1; else print '8'; ?>; |
|
122 | + var zoom = <?php if (isset($globalLiveZoom)) print $globalLiveZoom - 1; else print '8'; ?>; |
|
123 | 123 | } else { |
124 | 124 | var zoom = <?php if (isset($globalLiveZoom)) print $globalLiveZoom; else print '9'; ?>; |
125 | 125 | } |
@@ -213,19 +213,19 @@ discard block |
||
213 | 213 | map.addLayer(yandexLayer); |
214 | 214 | <?php |
215 | 215 | } elseif ($MapType == 'Bing-Aerial') { |
216 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
216 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType', 'OpenStreetMap'); |
|
217 | 217 | ?> |
218 | 218 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'Aerial'}); |
219 | 219 | map.addLayer(bingLayer); |
220 | 220 | <?php |
221 | 221 | } elseif ($MapType == 'Bing-Hybrid') { |
222 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
222 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType', 'OpenStreetMap'); |
|
223 | 223 | ?> |
224 | 224 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'AerialWithLabels'}); |
225 | 225 | map.addLayer(bingLayer); |
226 | 226 | <?php |
227 | 227 | } elseif ($MapType == 'Bing-Road') { |
228 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
228 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType', 'OpenStreetMap'); |
|
229 | 229 | ?> |
230 | 230 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'Road'}); |
231 | 231 | map.addLayer(bingLayer); |
@@ -385,10 +385,10 @@ discard block |
||
385 | 385 | setInterval(function(){update_locationsLayer()},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>); |
386 | 386 | |
387 | 387 | <?php |
388 | - // Add support for custom json via $globalMapJson |
|
389 | - if (isset($globalMapJson) && is_array($globalMapJson)) { |
|
388 | + // Add support for custom json via $globalMapJson |
|
389 | + if (isset($globalMapJson) && is_array($globalMapJson)) { |
|
390 | 390 | foreach ($globalMapJson as $json) { |
391 | - if (isset($json['url'])) { |
|
391 | + if (isset($json['url'])) { |
|
392 | 392 | ?> |
393 | 393 | update_genLayer('<?php print $json['url']; ?>'); |
394 | 394 | <?php |
@@ -397,9 +397,9 @@ discard block |
||
397 | 397 | setInterval(function(){update_genLayer('<?php print $json['url']; ?>')}, <?php print $json['refresh']; ?>); |
398 | 398 | <?php |
399 | 399 | } |
400 | - } |
|
400 | + } |
|
401 | + } |
|
401 | 402 | } |
402 | - } |
|
403 | 403 | |
404 | 404 | ?> |
405 | 405 | //adds the bootstrap tooltip to the map icons |
@@ -4,10 +4,15 @@ discard block |
||
4 | 4 | |
5 | 5 | setcookie("MapFormat",'2d'); |
6 | 6 | |
7 | -if (!isset($globalOpenWeatherMapKey)) $globalOpenWeatherMapKey = ''; |
|
7 | +if (!isset($globalOpenWeatherMapKey)) { |
|
8 | + $globalOpenWeatherMapKey = ''; |
|
9 | +} |
|
8 | 10 | // Compressed GeoJson is used if true |
9 | -if (!isset($globalJsonCompress)) $compress = true; |
|
10 | -else $compress = $globalJsonCompress; |
|
11 | +if (!isset($globalJsonCompress)) { |
|
12 | + $compress = true; |
|
13 | +} else { |
|
14 | + $compress = $globalJsonCompress; |
|
15 | +} |
|
11 | 16 | if (isset($_GET['archive'])) { |
12 | 17 | $archive = true; |
13 | 18 | //$archiveupdatetime = 50; |
@@ -18,8 +23,11 @@ discard block |
||
18 | 23 | //$lastupd = round(($_GET['enddate']-$_GET['begindate'])/(($_GET['during']*60)/10)); |
19 | 24 | //$lastupd = 20; |
20 | 25 | $lastupd = $_GET['archivespeed']*$archiveupdatetime; |
21 | - if (isset($_GET['enddate']) && $_GET['enddate'] != '') $enddate = $_GET['enddate']; |
|
22 | - else $enddate = time(); |
|
26 | + if (isset($_GET['enddate']) && $_GET['enddate'] != '') { |
|
27 | + $enddate = $_GET['enddate']; |
|
28 | + } else { |
|
29 | + $enddate = time(); |
|
30 | + } |
|
23 | 31 | setcookie("archive_begin",$begindate); |
24 | 32 | setcookie("archive_end",$enddate); |
25 | 33 | setcookie("archive_update",$lastupd); |
@@ -106,7 +114,17 @@ discard block |
||
106 | 114 | } |
107 | 115 | |
108 | 116 | //create the map |
109 | - map = L.map('archive-map', { zoomControl:false }).setView([<?php if (isset($latitude)) print $latitude; else print $globalCenterLatitude; ?>,<?php if (isset($longitude)) print $longitude; else print $globalCenterLongitude; ?>], zoom); |
|
117 | + map = L.map('archive-map', { zoomControl:false }).setView([<?php if (isset($latitude)) { |
|
118 | + print $latitude; |
|
119 | +} else { |
|
120 | + print $globalCenterLatitude; |
|
121 | +} |
|
122 | +?>,<?php if (isset($longitude)) { |
|
123 | + print $longitude; |
|
124 | +} else { |
|
125 | + print $globalCenterLongitude; |
|
126 | +} |
|
127 | +?>], zoom); |
|
110 | 128 | <?php |
111 | 129 | } else { |
112 | 130 | ?> |
@@ -119,9 +137,19 @@ discard block |
||
119 | 137 | || navigator.userAgent.match(/BlackBerry/i) |
120 | 138 | || navigator.userAgent.match(/Windows Phone/i)) |
121 | 139 | { |
122 | - var zoom = <?php if (isset($globalLiveZoom)) print $globalLiveZoom-1; else print '8'; ?>; |
|
140 | + var zoom = <?php if (isset($globalLiveZoom)) { |
|
141 | + print $globalLiveZoom-1; |
|
142 | +} else { |
|
143 | + print '8'; |
|
144 | +} |
|
145 | +?>; |
|
123 | 146 | } else { |
124 | - var zoom = <?php if (isset($globalLiveZoom)) print $globalLiveZoom; else print '9'; ?>; |
|
147 | + var zoom = <?php if (isset($globalLiveZoom)) { |
|
148 | + print $globalLiveZoom; |
|
149 | +} else { |
|
150 | + print '9'; |
|
151 | +} |
|
152 | +?>; |
|
125 | 153 | } |
126 | 154 | |
127 | 155 | //create the map |
@@ -146,16 +174,27 @@ discard block |
||
146 | 174 | bounds = L.latLngBounds(southWest,northEast); |
147 | 175 | //a few title layers |
148 | 176 | <?php |
149 | - if (isset($_COOKIE['MapType'])) $MapType = $_COOKIE['MapType']; |
|
150 | - else $MapType = $globalMapProvider; |
|
177 | + if (isset($_COOKIE['MapType'])) { |
|
178 | + $MapType = $_COOKIE['MapType']; |
|
179 | + } else { |
|
180 | + $MapType = $globalMapProvider; |
|
181 | + } |
|
151 | 182 | |
152 | 183 | if ($MapType == 'Mapbox') { |
153 | - if ($_COOKIE['MapTypeId'] == 'default') $MapBoxId = $globalMapboxId; |
|
154 | - else $MapBoxId = $_COOKIE['MapTypeId']; |
|
155 | -?> |
|
184 | + if ($_COOKIE['MapTypeId'] == 'default') { |
|
185 | + $MapBoxId = $globalMapboxId; |
|
186 | + } else { |
|
187 | + $MapBoxId = $_COOKIE['MapTypeId']; |
|
188 | + } |
|
189 | + ?> |
|
156 | 190 | L.tileLayer('https://{s}.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={token}', { |
157 | 191 | maxZoom: 18, |
158 | - noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) print 'false'; else print 'true'; ?>, |
|
192 | + noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) { |
|
193 | + print 'false'; |
|
194 | +} else { |
|
195 | + print 'true'; |
|
196 | +} |
|
197 | +?>, |
|
159 | 198 | attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' + |
160 | 199 | '<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' + |
161 | 200 | 'Imagery © <a href="http://mapbox.com">Mapbox</a>', |
@@ -167,7 +206,12 @@ discard block |
||
167 | 206 | ?> |
168 | 207 | L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { |
169 | 208 | maxZoom: 18, |
170 | - noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) print 'false'; else print 'true'; ?>, |
|
209 | + noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) { |
|
210 | + print 'false'; |
|
211 | +} else { |
|
212 | + print 'true'; |
|
213 | +} |
|
214 | +?>, |
|
171 | 215 | attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' + |
172 | 216 | '<a href="www.openstreetmap.org/copyright">Open Database Licence</a>' |
173 | 217 | }).addTo(map); |
@@ -213,20 +257,26 @@ discard block |
||
213 | 257 | map.addLayer(yandexLayer); |
214 | 258 | <?php |
215 | 259 | } elseif ($MapType == 'Bing-Aerial') { |
216 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
217 | -?> |
|
260 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') { |
|
261 | + setcookie('MapType','OpenStreetMap'); |
|
262 | + } |
|
263 | + ?> |
|
218 | 264 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'Aerial'}); |
219 | 265 | map.addLayer(bingLayer); |
220 | 266 | <?php |
221 | 267 | } elseif ($MapType == 'Bing-Hybrid') { |
222 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
223 | -?> |
|
268 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') { |
|
269 | + setcookie('MapType','OpenStreetMap'); |
|
270 | + } |
|
271 | + ?> |
|
224 | 272 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'AerialWithLabels'}); |
225 | 273 | map.addLayer(bingLayer); |
226 | 274 | <?php |
227 | 275 | } elseif ($MapType == 'Bing-Road') { |
228 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
229 | -?> |
|
276 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') { |
|
277 | + setcookie('MapType','OpenStreetMap'); |
|
278 | + } |
|
279 | + ?> |
|
230 | 280 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'Road'}); |
231 | 281 | map.addLayer(bingLayer); |
232 | 282 | <?php |
@@ -249,9 +299,24 @@ discard block |
||
249 | 299 | $customid = $MapType; |
250 | 300 | ?> |
251 | 301 | L.tileLayer('<?php print $globalMapCustomLayer[$customid]['url']; ?>/{z}/{x}/{y}.png', { |
252 | - maxZoom: <?php if (isset($globalMapCustomLayer[$customid]['maxZoom'])) print $globalMapCustomLayer[$customid]['maxZoom']; else print '18'; ?>, |
|
253 | - minZoom: <?php if (isset($globalMapCustomLayer[$customid]['minZoom'])) print $globalMapCustomLayer[$customid]['minZoom']; else print '0'; ?>, |
|
254 | - noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) print 'false'; else print 'true'; ?>, |
|
302 | + maxZoom: <?php if (isset($globalMapCustomLayer[$customid]['maxZoom'])) { |
|
303 | + print $globalMapCustomLayer[$customid]['maxZoom']; |
|
304 | +} else { |
|
305 | + print '18'; |
|
306 | +} |
|
307 | +?>, |
|
308 | + minZoom: <?php if (isset($globalMapCustomLayer[$customid]['minZoom'])) { |
|
309 | + print $globalMapCustomLayer[$customid]['minZoom']; |
|
310 | +} else { |
|
311 | + print '0'; |
|
312 | +} |
|
313 | +?>, |
|
314 | + noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) { |
|
315 | + print 'false'; |
|
316 | +} else { |
|
317 | + print 'true'; |
|
318 | +} |
|
319 | +?>, |
|
255 | 320 | attribution: '<?php print $globalMapCustomLayer[$customid]['attribution']; ?>' |
256 | 321 | }).addTo(map); |
257 | 322 | |
@@ -285,7 +350,12 @@ discard block |
||
285 | 350 | } |
286 | 351 | } elseif ($globalBounding == 'circle') { |
287 | 352 | ?> |
288 | - var circle = L.circle([<?php print $globalCenterLatitude; ?>, <?php print $globalCenterLongitude; ?>],<?php if (isset($globalBoundingCircleSize)) print $globalBoundingCircleSize; else print '70000'; ?>,{ |
|
353 | + var circle = L.circle([<?php print $globalCenterLatitude; ?>, <?php print $globalCenterLongitude; ?>],<?php if (isset($globalBoundingCircleSize)) { |
|
354 | + print $globalBoundingCircleSize; |
|
355 | +} else { |
|
356 | + print '70000'; |
|
357 | +} |
|
358 | +?>,{ |
|
289 | 359 | color: '#92C7D1', |
290 | 360 | fillColor: '#92C7D1', |
291 | 361 | fillOpacity: 0.3, |
@@ -382,7 +452,12 @@ discard block |
||
382 | 452 | //} |
383 | 453 | }); |
384 | 454 | update_locationsLayer(); |
385 | -setInterval(function(){update_locationsLayer()},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>); |
|
455 | +setInterval(function(){update_locationsLayer()},<?php if (isset($globalMapRefresh)) { |
|
456 | + print $globalMapRefresh*1000*2; |
|
457 | +} else { |
|
458 | + print '60000'; |
|
459 | +} |
|
460 | +?>); |
|
386 | 461 | |
387 | 462 | <?php |
388 | 463 | // Add support for custom json via $globalMapJson |