@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | } |
9 | 9 | header('Content-Type: text/javascript'); |
10 | 10 | |
11 | -$tskfile = filter_input(INPUT_GET,'tsk',FILTER_SANITIZE_URL); |
|
11 | +$tskfile = filter_input(INPUT_GET, 'tsk', FILTER_SANITIZE_URL); |
|
12 | 12 | |
13 | 13 | $spotter_array = $TSK->parse_xml($tskfile); |
14 | 14 | |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | if (!empty($spotter_array)) |
17 | 17 | { |
18 | 18 | $j = 0; |
19 | - foreach($spotter_array['Point'] as $spotter_item) |
|
19 | + foreach ($spotter_array['Point'] as $spotter_item) |
|
20 | 20 | { |
21 | 21 | date_default_timezone_set('UTC'); |
22 | 22 | //waypoint plotting |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | $output .= '"geometry": {'; |
54 | 54 | $output .= '"type": "LineString",'; |
55 | 55 | $output .= '"coordinates": ['; |
56 | - foreach($spotter_array['Point'] as $spotter_item) |
|
56 | + foreach ($spotter_array['Point'] as $spotter_item) |
|
57 | 57 | { |
58 | 58 | $output .= '['.$spotter_item['Waypoint']['Location']['@attributes']['longitude'].', '.$spotter_item['Waypoint']['Location']['@attributes']['latitude'].'],'; |
59 | 59 | } |
@@ -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=/'; |
@@ -75,16 +75,16 @@ discard block |
||
75 | 75 | <?php |
76 | 76 | } |
77 | 77 | if (isset($_GET['ident'])) { |
78 | - $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
|
78 | + $ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING); |
|
79 | 79 | } |
80 | 80 | if (isset($_GET['flightaware_id'])) { |
81 | - $flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING); |
|
81 | + $flightaware_id = filter_input(INPUT_GET, 'flightaware_id', FILTER_SANITIZE_STRING); |
|
82 | 82 | } |
83 | 83 | if (isset($_GET['latitude'])) { |
84 | - $latitude = filter_input(INPUT_GET,'latitude',FILTER_SANITIZE_STRING); |
|
84 | + $latitude = filter_input(INPUT_GET, 'latitude', FILTER_SANITIZE_STRING); |
|
85 | 85 | } |
86 | 86 | if (isset($_GET['longitude'])) { |
87 | - $longitude = filter_input(INPUT_GET,'longitude',FILTER_SANITIZE_STRING); |
|
87 | + $longitude = filter_input(INPUT_GET, 'longitude', FILTER_SANITIZE_STRING); |
|
88 | 88 | } |
89 | 89 | ?> |
90 | 90 | |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | } else { |
113 | 113 | if ((isset($globalCenterLatitude) && $globalCenterLatitude != '' && isset($globalCenterLongitude) && $globalCenterLongitude != '') || isset($_COOKIE['lastcentercoord'])) { |
114 | 114 | if (isset($_COOKIE['lastcentercoord'])) { |
115 | - $lastcentercoord = explode(',',$_COOKIE['lastcentercoord']); |
|
115 | + $lastcentercoord = explode(',', $_COOKIE['lastcentercoord']); |
|
116 | 116 | $viewcenterlatitude = $lastcentercoord[0]; |
117 | 117 | $viewcenterlongitude = $lastcentercoord[1]; |
118 | 118 | $viewzoom = $lastcentercoord[2]; |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | || navigator.userAgent.match(/BlackBerry/i) |
134 | 134 | || navigator.userAgent.match(/Windows Phone/i)) |
135 | 135 | { |
136 | - var zoom = <?php if (isset($viewzoom) && $viewzoom == $globalLiveZoom) print $viewzoom-1; elseif (isset($viewzoom)) print $viewzoom; else print '8'; ?>; |
|
136 | + var zoom = <?php if (isset($viewzoom) && $viewzoom == $globalLiveZoom) print $viewzoom - 1; elseif (isset($viewzoom)) print $viewzoom; else print '8'; ?>; |
|
137 | 137 | } else { |
138 | 138 | var zoom = <?php if (isset($viewzoom)) print $viewzoom; else print '9'; ?>; |
139 | 139 | } |
@@ -227,19 +227,19 @@ discard block |
||
227 | 227 | map.addLayer(yandexLayer); |
228 | 228 | <?php |
229 | 229 | } elseif ($MapType == 'Bing-Aerial') { |
230 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
230 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType', 'OpenStreetMap'); |
|
231 | 231 | ?> |
232 | 232 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'Aerial'}); |
233 | 233 | map.addLayer(bingLayer); |
234 | 234 | <?php |
235 | 235 | } elseif ($MapType == 'Bing-Hybrid') { |
236 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
236 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType', 'OpenStreetMap'); |
|
237 | 237 | ?> |
238 | 238 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'AerialWithLabels'}); |
239 | 239 | map.addLayer(bingLayer); |
240 | 240 | <?php |
241 | 241 | } elseif ($MapType == 'Bing-Road') { |
242 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
242 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType', 'OpenStreetMap'); |
|
243 | 243 | ?> |
244 | 244 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'Road'}); |
245 | 245 | map.addLayer(bingLayer); |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | |
358 | 358 | function update_tsk() { |
359 | 359 | var bbox = map.getBounds().toBBoxString(); |
360 | - var tskLayerQuery = $.getJSON("<?php print $globalURL; ?>/tsk-geojson.php?tsk=<?php echo filter_input(INPUT_GET,'tsk',FILTER_SANITIZE_URL); ?>",function (data) { |
|
360 | + var tskLayerQuery = $.getJSON("<?php print $globalURL; ?>/tsk-geojson.php?tsk=<?php echo filter_input(INPUT_GET, 'tsk', FILTER_SANITIZE_URL); ?>",function (data) { |
|
361 | 361 | tskLayer = L.geoJson(data,{ |
362 | 362 | onEachFeature: function (feature, layer) { |
363 | 363 | tskPopup(feature, layer); |
@@ -13,35 +13,35 @@ discard block |
||
13 | 13 | |
14 | 14 | |
15 | 15 | if (isset($_GET['3d'])) { |
16 | - setcookie('MapFormat','3d'); |
|
16 | + setcookie('MapFormat', '3d'); |
|
17 | 17 | } else if (isset($_GET['2d'])) { |
18 | - setcookie('MapFormat','2d'); |
|
18 | + setcookie('MapFormat', '2d'); |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | if (isset($_GET['tsk'])) { |
22 | - $tsk = filter_input(INPUT_GET,'tsk',FILTER_SANITIZE_URL); |
|
22 | + $tsk = filter_input(INPUT_GET, 'tsk', FILTER_SANITIZE_URL); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | if (isset($_POST['archive'])) { |
26 | - setcookie('archive','true'); |
|
27 | - setcookie('archive_begin',strtotime($_POST['start_date'])); |
|
28 | - setcookie('archive_end',strtotime($_POST['end_date'])); |
|
29 | - setcookie('archive_speed',$_POST['archivespeed']); |
|
26 | + setcookie('archive', 'true'); |
|
27 | + setcookie('archive_begin', strtotime($_POST['start_date'])); |
|
28 | + setcookie('archive_end', strtotime($_POST['end_date'])); |
|
29 | + setcookie('archive_speed', $_POST['archivespeed']); |
|
30 | 30 | } |
31 | 31 | if (isset($_POST['noarchive'])) { |
32 | - setcookie('archive','false',-1); |
|
33 | - setcookie('archive_begin','',-1); |
|
34 | - setcookie('archive_end','',-1); |
|
35 | - setcookie('archive_speed','',-1); |
|
32 | + setcookie('archive', 'false', -1); |
|
33 | + setcookie('archive_begin', '', -1); |
|
34 | + setcookie('archive_end', '', -1); |
|
35 | + setcookie('archive_speed', '', -1); |
|
36 | 36 | } |
37 | 37 | // When button "Remove all filters" is clicked |
38 | 38 | if (isset($_POST['removefilters'])) { |
39 | - $allfilters = array_filter(array_keys($_COOKIE),function($key) { |
|
40 | - return strpos($key,'filter_') === 0; |
|
39 | + $allfilters = array_filter(array_keys($_COOKIE), function($key) { |
|
40 | + return strpos($key, 'filter_') === 0; |
|
41 | 41 | }); |
42 | 42 | foreach ($allfilters as $filt) { |
43 | 43 | unset($_COOKIE[$filt]); |
44 | - setcookie($filt,null,-1); |
|
44 | + setcookie($filt, null, -1); |
|
45 | 45 | } |
46 | 46 | } |
47 | 47 | ?> |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | <script src="<?php print $globalURL; ?>/js/MovingMarker.js"></script> |
247 | 247 | <script src="<?php print $globalURL; ?>/js/jquery.idle.min.js"></script> |
248 | 248 | <script src="<?php print $globalURL; ?>/js/map.common.js"></script> |
249 | -<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> |
|
249 | +<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> |
|
250 | 250 | <?php |
251 | 251 | if (!isset($type) || $type == 'aircraft') { |
252 | 252 | ?> |
@@ -319,7 +319,7 @@ discard block |
||
319 | 319 | <script src="<?php print $globalURL; ?>/js/MovingMarker.js"></script> |
320 | 320 | <script src="<?php print $globalURL; ?>/js/jquery.idle.min.js"></script> |
321 | 321 | <script src="<?php print $globalURL; ?>/js/map.common.js"></script> |
322 | -<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> |
|
322 | +<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> |
|
323 | 323 | <script src="<?php print $globalURL; ?>/js/map-aircraft.2d.js.php?flightaware_id=<?php print $flightaware_id; ?>&<?php print time(); ?>"></script> |
324 | 324 | <?php |
325 | 325 | if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '' && ($MapType == 'Google-Roadmap' || $MapType == 'Google-Satellite' || $MapType == 'Google-Hybrid' || $MapType == 'Google-Terrain')) { |
@@ -724,8 +724,8 @@ discard block |
||
724 | 724 | ?> |
725 | 725 | <div class="search"> |
726 | 726 | <form action="<?php print $globalURL; ?>/search" method="get"> |
727 | - <!--<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>--> |
|
728 | - <input type="text" name="callsign" value="<?php if (isset($GET['callsign'])) { if ($_GET['callsign'] != ""){ print $_GET['callsign']; } else { print _("Search"); } } else { print _("Search"); } ?>" onfocus="if (this.value=='search'){this.value='';}" /><button type="submit"><i class="fa fa-search"></i></button> |
|
727 | + <!--<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>--> |
|
728 | + <input type="text" name="callsign" value="<?php if (isset($GET['callsign'])) { if ($_GET['callsign'] != "") { print $_GET['callsign']; } else { print _("Search"); } } else { print _("Search"); } ?>" onfocus="if (this.value=='search'){this.value='';}" /><button type="submit"><i class="fa fa-search"></i></button> |
|
729 | 729 | </form> |
730 | 730 | </div> |
731 | 731 | <div class="social"> |
@@ -743,7 +743,7 @@ discard block |
||
743 | 743 | print '</div>'; |
744 | 744 | } |
745 | 745 | |
746 | -if (strtolower($current_page) =='ident-detailed' || strtolower($current_page) == 'flightid-overview') { |
|
746 | +if (strtolower($current_page) == 'ident-detailed' || strtolower($current_page) == 'flightid-overview') { |
|
747 | 747 | ?> |
748 | 748 | <div class="top-header clear" role="main"> |
749 | 749 | <?php |
@@ -756,7 +756,7 @@ discard block |
||
756 | 756 | </div> |
757 | 757 | <?php |
758 | 758 | } |
759 | -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)) |
|
759 | +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)) |
|
760 | 760 | { |
761 | 761 | ?> |
762 | 762 | <div class="top-header clear" role="main"> |
@@ -769,15 +769,15 @@ discard block |
||
769 | 769 | var zoom = 13; |
770 | 770 | //create the map |
771 | 771 | <?php |
772 | - if (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($airport_array[0]['latitude'])) { |
|
772 | + if (strpos(strtolower($current_page), 'airport-') !== false && strpos(strtolower($current_page), 'statistics-') === false && isset($airport_array[0]['latitude'])) { |
|
773 | 773 | ?> |
774 | 774 | map = L.map('map', { zoomControl:true }).setView([<?php print $airport_array[0]['latitude']; ?>,<?php print $airport_array[0]['longitude']; ?>], zoom); |
775 | 775 | <?php |
776 | - } elseif (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false) { |
|
776 | + } elseif (strpos(strtolower($current_page), 'airport-') !== false && strpos(strtolower($current_page), 'statistics-') === false) { |
|
777 | 777 | ?> |
778 | 778 | map = L.map('map', { zoomControl:true }); |
779 | 779 | <?php |
780 | - } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($spotter_array[0]['departure_airport_latitude'])) { |
|
780 | + } elseif (strpos(strtolower($current_page), 'route-') !== false && strpos(strtolower($current_page), 'statistics-') === false && isset($spotter_array[0]['departure_airport_latitude'])) { |
|
781 | 781 | ?> |
782 | 782 | map = L.map('map', { zoomControl:true }).setView([<?php print $spotter_array[0]['departure_airport_latitude']; ?>,<?php print $spotter_array[0]['arrival_airport_longitude']; ?>]); |
783 | 783 | 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); |
@@ -785,7 +785,7 @@ discard block |
||
785 | 785 | 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); |
786 | 786 | 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); |
787 | 787 | <?php |
788 | - } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && !isset($spotter_array[0]['departure_airport_latitude']) && isset($spotter_array[0]['latitude'])) { |
|
788 | + } elseif (strpos(strtolower($current_page), 'route-') !== false && strpos(strtolower($current_page), 'statistics-') === false && !isset($spotter_array[0]['departure_airport_latitude']) && isset($spotter_array[0]['latitude'])) { |
|
789 | 789 | ?> |
790 | 790 | map = L.map('map', { zoomControl:true }).setView([<?php print $spotter_array[0]['latitude']; ?>,<?php print $spotter_array[0]['longitude']; ?>]); |
791 | 791 | <?php |