@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | break; |
315 | 315 | } |
316 | 316 | } |
317 | - var tsk_geojson = Cesium.loadJson("<?php print $globalURL; ?>/tsk-geojson.php?tsk=<?php print filter_input(INPUT_GET,'tsk',FILTER_SANITIZE_URL); ?>"); |
|
317 | + var tsk_geojson = Cesium.loadJson("<?php print $globalURL; ?>/tsk-geojson.php?tsk=<?php print filter_input(INPUT_GET, 'tsk', FILTER_SANITIZE_URL); ?>"); |
|
318 | 318 | tsk_geojson.then(function(geojsondata) { |
319 | 319 | tsk = new Cesium.CustomDataSource('tsk'); |
320 | 320 | for (var i =0;i < geojsondata.features.length; i++) { |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | <?php |
390 | 390 | if (isset($_COOKIE['lastcentercoord']) || (isset($globalCenterLatitude) && isset($globalCenterLongitude) && $globalCenterLatitude != '' && $globalCenterLongitude != '')) { |
391 | 391 | if (isset($_COOKIE['lastcentercoord'])) { |
392 | - $lastcentercoord = explode(',',$_COOKIE['lastcentercoord']); |
|
392 | + $lastcentercoord = explode(',', $_COOKIE['lastcentercoord']); |
|
393 | 393 | if (!isset($lastcentercoord[3])) $zoom = $lastcentercoord[2]*1000000.0; |
394 | 394 | else $zoom = $lastcentercoord[3]; |
395 | 395 | $viewcenterlatitude = $lastcentercoord[0]; |
@@ -27,21 +27,30 @@ discard block |
||
27 | 27 | |
28 | 28 | document.cookie = 'MapFormat=3d; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/' |
29 | 29 | <?php |
30 | - if (isset($_COOKIE['MapType3D'])) $MapType = $_COOKIE['MapType3D']; |
|
31 | - else $MapType = $globalMapProvider; |
|
32 | -// unset($_COOKIE['MapType']); |
|
30 | + if (isset($_COOKIE['MapType3D'])) { |
|
31 | + $MapType = $_COOKIE['MapType3D']; |
|
32 | + } else { |
|
33 | + $MapType = $globalMapProvider; |
|
34 | + } |
|
35 | + // unset($_COOKIE['MapType']); |
|
33 | 36 | |
34 | 37 | if ($MapType != 'Mapbox' && $MapType != 'OpenStreetMap' && $MapType != 'Bing-Aerial' && $MapType != 'Bing-Hybrid' && $MapType != 'Bing-Road' && $MapType != 'offline' && $MapType != 'ArcGIS-Streetmap' && $MapType != 'ArcGIS-Satellite' && $MapType != 'NatGeo-Street') { |
35 | - if (isset($globalBingMapKey) && $globalBingMapKey != '') $MapType = 'Bing-Aerial'; |
|
36 | - else $MapType = 'OpenStreetMap'; |
|
38 | + if (isset($globalBingMapKey) && $globalBingMapKey != '') { |
|
39 | + $MapType = 'Bing-Aerial'; |
|
40 | + } else { |
|
41 | + $MapType = 'OpenStreetMap'; |
|
42 | + } |
|
37 | 43 | } |
38 | 44 | if (($MapType == 'Bing-Aerial' || $MapType == 'Bing-Hybrid' || $MapType == 'Bing-Road') && (!isset($globalBingMapKey) || $globalBingMapKey == '')) { |
39 | 45 | $MapType = 'OpenStreetMap'; |
40 | 46 | } |
41 | 47 | if ($MapType == 'Mapbox') { |
42 | - if ($_COOKIE['MapTypeId'] == 'default') $MapBoxId = $globalMapboxId; |
|
43 | - else $MapBoxId = $_COOKIE['MapType3DId']; |
|
44 | -?> |
|
48 | + if ($_COOKIE['MapTypeId'] == 'default') { |
|
49 | + $MapBoxId = $globalMapboxId; |
|
50 | + } else { |
|
51 | + $MapBoxId = $_COOKIE['MapType3DId']; |
|
52 | + } |
|
53 | + ?> |
|
45 | 54 | var imProv = Cesium.MapboxImageryProvider({ |
46 | 55 | credit: 'Map data © OpenStreetMap contributors, ' + |
47 | 56 | 'CC-BY-SA, ' + |
@@ -108,13 +117,23 @@ discard block |
||
108 | 117 | credit : 'Imagery courtesy Natural Earth' |
109 | 118 | }); |
110 | 119 | <?php |
111 | - } elseif (isset($globalMapCustomLayer[$MapType])) { |
|
120 | + } elseif (isset($globalMapCustomLayer[$MapType])) { |
|
112 | 121 | $customid = $MapType; |
113 | 122 | ?> |
114 | 123 | var imProv = Cesium.createOpenStreetMapImageryProvider({ |
115 | 124 | url : '<?php print $globalMapCustomLayer[$customid]['url']; ?>', |
116 | - maximumLevel: <?php if (isset($globalMapCustomLayer[$customid]['maxZoom'])) print $globalMapCustomLayer[$customid]['maxZoom']; else print '99'; ?>, |
|
117 | - minimumLevel: <?php if (isset($globalMapCustomLayer[$customid]['minZoom'])) print $globalMapCustomLayer[$customid]['minZoom']; else print '0'; ?>, |
|
125 | + maximumLevel: <?php if (isset($globalMapCustomLayer[$customid]['maxZoom'])) { |
|
126 | + print $globalMapCustomLayer[$customid]['maxZoom']; |
|
127 | +} else { |
|
128 | + print '99'; |
|
129 | +} |
|
130 | +?>, |
|
131 | + minimumLevel: <?php if (isset($globalMapCustomLayer[$customid]['minZoom'])) { |
|
132 | + print $globalMapCustomLayer[$customid]['minZoom']; |
|
133 | +} else { |
|
134 | + print '0'; |
|
135 | +} |
|
136 | +?>, |
|
118 | 137 | credit: '<?php print $globalMapCustomLayer[$customid]['attribution']; ?>' |
119 | 138 | }); |
120 | 139 | <?php |
@@ -506,7 +525,12 @@ discard block |
||
506 | 525 | imageryProvider : imProv, |
507 | 526 | timeline : archive, |
508 | 527 | animation : false, |
509 | - shadows : <?php if ((isset($globalMap3DShadows) && $globalMap3DShadows === FALSE) || (isset($_COOKIE['map3dnoshadows']) && $_COOKIE['map3dnoshadows'] == 'true')) print 'false'; else print 'true'; ?>, |
|
528 | + shadows : <?php if ((isset($globalMap3DShadows) && $globalMap3DShadows === FALSE) || (isset($_COOKIE['map3dnoshadows']) && $_COOKIE['map3dnoshadows'] == 'true')) { |
|
529 | + print 'false'; |
|
530 | +} else { |
|
531 | + print 'true'; |
|
532 | +} |
|
533 | +?>, |
|
510 | 534 | infoBox : false, |
511 | 535 | navigationHelpButton : false, |
512 | 536 | geocoder : false, |
@@ -521,8 +545,11 @@ discard block |
||
521 | 545 | if (isset($_COOKIE['lastcentercoord']) || (isset($globalCenterLatitude) && isset($globalCenterLongitude) && $globalCenterLatitude != '' && $globalCenterLongitude != '')) { |
522 | 546 | if (isset($_COOKIE['lastcentercoord'])) { |
523 | 547 | $lastcentercoord = explode(',',$_COOKIE['lastcentercoord']); |
524 | - if (!isset($lastcentercoord[3])) $zoom = $lastcentercoord[2]*1000000.0; |
|
525 | - else $zoom = $lastcentercoord[3]; |
|
548 | + if (!isset($lastcentercoord[3])) { |
|
549 | + $zoom = $lastcentercoord[2]*1000000.0; |
|
550 | + } else { |
|
551 | + $zoom = $lastcentercoord[3]; |
|
552 | + } |
|
526 | 553 | $viewcenterlatitude = $lastcentercoord[0]; |
527 | 554 | $viewcenterlongitude = $lastcentercoord[1]; |
528 | 555 | } else { |
@@ -642,7 +669,12 @@ discard block |
||
642 | 669 | ?> |
643 | 670 | |
644 | 671 | update_locationsLayer(); |
645 | -setInterval(function(){update_locationsLayer()},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>); |
|
672 | +setInterval(function(){update_locationsLayer()},<?php if (isset($globalMapRefresh)) { |
|
673 | + print $globalMapRefresh*1000*2; |
|
674 | +} else { |
|
675 | + print '60000'; |
|
676 | +} |
|
677 | +?>); |
|
646 | 678 | |
647 | 679 | var currentposition; |
648 | 680 | viewer.camera.moveEnd.addEventListener(function() { |
@@ -11,13 +11,13 @@ discard block |
||
11 | 11 | $Connection = new Connection(); |
12 | 12 | |
13 | 13 | if (!$Connection->tableExists('airspace')) { |
14 | - die; |
|
14 | + die; |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | if (isset($_GET['coord'])) |
18 | 18 | { |
19 | 19 | $coords = explode(',',$_GET['coord']); |
20 | - if ($globalDBdriver == 'mysql') { |
|
20 | + if ($globalDBdriver == 'mysql') { |
|
21 | 21 | $query = "SELECT *, ST_AsWKB(SHAPE) AS wkb FROM airspace WHERE ST_Intersects(SHAPE, ST_Envelope(linestring(point(:minlon,:minlat), point(:maxlon,:maxlat))))"; |
22 | 22 | try { |
23 | 23 | $sth = $Connection->db->prepare($query); |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | } |
38 | 38 | } |
39 | 39 | } else { |
40 | - if ($globalDBdriver == 'mysql') { |
|
40 | + if ($globalDBdriver == 'mysql') { |
|
41 | 41 | $query = "SELECT *, ST_AsWKB(SHAPE) AS wkb FROM airspace"; |
42 | 42 | } else { |
43 | 43 | $query = "SELECT *, ST_AsBinary(wkb_geometry,'NDR') AS wkb FROM airspace"; |
@@ -51,8 +51,8 @@ discard block |
||
51 | 51 | } |
52 | 52 | |
53 | 53 | $geojson = array( |
54 | - 'type' => 'FeatureCollection', |
|
55 | - 'features' => array() |
|
54 | + 'type' => 'FeatureCollection', |
|
55 | + 'features' => array() |
|
56 | 56 | ); |
57 | 57 | |
58 | 58 | while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
@@ -115,9 +115,9 @@ discard block |
||
115 | 115 | } |
116 | 116 | if (isset($properties['type']) && $properties['type'] != '') { |
117 | 117 | $feature = array( |
118 | - 'type' => 'Feature', |
|
119 | - 'geometry' => json_decode($geom->out('json')), |
|
120 | - 'properties' => $properties |
|
118 | + 'type' => 'Feature', |
|
119 | + 'geometry' => json_decode($geom->out('json')), |
|
120 | + 'properties' => $properties |
|
121 | 121 | ); |
122 | 122 | array_push($geojson['features'], $feature); |
123 | 123 | } |
@@ -16,14 +16,14 @@ discard block |
||
16 | 16 | |
17 | 17 | if (isset($_GET['coord'])) |
18 | 18 | { |
19 | - $coords = explode(',',$_GET['coord']); |
|
19 | + $coords = explode(',', $_GET['coord']); |
|
20 | 20 | if ($globalDBdriver == 'mysql') { |
21 | 21 | $query = "SELECT *, ST_AsWKB(SHAPE) AS wkb FROM airspace WHERE ST_Intersects(SHAPE, ST_Envelope(linestring(point(:minlon,:minlat), point(:maxlon,:maxlat))))"; |
22 | 22 | try { |
23 | 23 | $sth = $Connection->db->prepare($query); |
24 | - $sth->execute(array(':minlon' => $coords[0],':minlat' => $coords[1],':maxlon' => $coords[2],':maxlat' => $coords[3])); |
|
24 | + $sth->execute(array(':minlon' => $coords[0], ':minlat' => $coords[1], ':maxlon' => $coords[2], ':maxlat' => $coords[3])); |
|
25 | 25 | //$sth->execute(); |
26 | - } catch(PDOException $e) { |
|
26 | + } catch (PDOException $e) { |
|
27 | 27 | echo "error"; |
28 | 28 | } |
29 | 29 | } else { |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | $sth = $Connection->db->prepare($query); |
33 | 33 | //$sth->execute(array(':minlon' => $coords[0],':minlat' => $coords[1],':maxlon' => $coords[2],':maxlat' => $coords[3])); |
34 | 34 | $sth->execute(); |
35 | - } catch(PDOException $e) { |
|
35 | + } catch (PDOException $e) { |
|
36 | 36 | echo "error"; |
37 | 37 | } |
38 | 38 | } |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | try { |
46 | 46 | $sth = $Connection->db->prepare($query); |
47 | 47 | $sth->execute(); |
48 | - } catch(PDOException $e) { |
|
48 | + } catch (PDOException $e) { |
|
49 | 49 | echo "error"; |
50 | 50 | } |
51 | 51 | } |
@@ -75,22 +75,22 @@ discard block |
||
75 | 75 | if (isset($properties['ceiling'])) $properties['tops'] = $properties['ceiling']; |
76 | 76 | if (isset($properties['floor'])) $properties['base'] = $properties['floor']; |
77 | 77 | if (isset($properties['tops'])) { |
78 | - if (preg_match('/^FL(\s)*(?<alt>\d+)/',strtoupper($properties['tops']),$matches)) { |
|
78 | + if (preg_match('/^FL(\s)*(?<alt>\d+)/', strtoupper($properties['tops']), $matches)) { |
|
79 | 79 | $properties['upper_limit'] = round($matches['alt']*100*0.38048); |
80 | - } elseif (preg_match('/^(?<alt>\d+)(\s)*(FT|AGL|ALT|MSL)/',strtoupper($properties['tops']),$matches)) { |
|
80 | + } elseif (preg_match('/^(?<alt>\d+)(\s)*(FT|AGL|ALT|MSL)/', strtoupper($properties['tops']), $matches)) { |
|
81 | 81 | $properties['upper_limit'] = round($matches['alt']*0.38048); |
82 | - } elseif (preg_match('/^(?<alt>\d+)(\s)*M/',strtoupper($properties['tops']),$matches)) { |
|
82 | + } elseif (preg_match('/^(?<alt>\d+)(\s)*M/', strtoupper($properties['tops']), $matches)) { |
|
83 | 83 | $properties['upper_limit'] = $matches['alt']; |
84 | 84 | } |
85 | 85 | } |
86 | 86 | if (isset($properties['base'])) { |
87 | 87 | if ($properties['base'] == 'SFC' || $properties['base'] == 'MSL' || $properties['base'] == 'GROUND' || $properties['base'] == 'GND') { |
88 | 88 | $properties['lower_limit'] = 0; |
89 | - } elseif (preg_match('/^FL(\s)*(?<alt>\d+)/',strtoupper($properties['base']),$matches)) { |
|
89 | + } elseif (preg_match('/^FL(\s)*(?<alt>\d+)/', strtoupper($properties['base']), $matches)) { |
|
90 | 90 | $properties['lower_limit'] = round($matches['alt']*100*0.38048); |
91 | - } elseif (preg_match('/^(?<alt>\d+)(\s)*(FT|AGL|ALT|MSL)/',strtoupper($properties['base']),$matches)) { |
|
91 | + } elseif (preg_match('/^(?<alt>\d+)(\s)*(FT|AGL|ALT|MSL)/', strtoupper($properties['base']), $matches)) { |
|
92 | 92 | $properties['lower_limit'] = round($matches['alt']*0.38048); |
93 | - } elseif (preg_match('/^(?<alt>\d+)(\s)*M/',strtoupper($properties['base']),$matches)) { |
|
93 | + } elseif (preg_match('/^(?<alt>\d+)(\s)*M/', strtoupper($properties['base']), $matches)) { |
|
94 | 94 | $properties['lower_limit'] = $matches['alt']; |
95 | 95 | } |
96 | 96 | } |
@@ -68,12 +68,22 @@ |
||
68 | 68 | } else { |
69 | 69 | $geom = geoPHP::load(stream_get_contents($row['wkb'])); |
70 | 70 | } |
71 | - if (isset($properties['type'])) $properties['type'] = trim($properties['type']); |
|
72 | - elseif (isset($properties['class'])) $properties['type'] = trim($properties['class']); |
|
73 | - if (isset($properties['ogr_fid'])) $properties['id'] = $properties['ogr_fid']; |
|
74 | - elseif (isset($properties['ogc_fid'])) $properties['id'] = $properties['ogc_fid']; |
|
75 | - if (isset($properties['ceiling'])) $properties['tops'] = $properties['ceiling']; |
|
76 | - if (isset($properties['floor'])) $properties['base'] = $properties['floor']; |
|
71 | + if (isset($properties['type'])) { |
|
72 | + $properties['type'] = trim($properties['type']); |
|
73 | + } elseif (isset($properties['class'])) { |
|
74 | + $properties['type'] = trim($properties['class']); |
|
75 | + } |
|
76 | + if (isset($properties['ogr_fid'])) { |
|
77 | + $properties['id'] = $properties['ogr_fid']; |
|
78 | + } elseif (isset($properties['ogc_fid'])) { |
|
79 | + $properties['id'] = $properties['ogc_fid']; |
|
80 | + } |
|
81 | + if (isset($properties['ceiling'])) { |
|
82 | + $properties['tops'] = $properties['ceiling']; |
|
83 | + } |
|
84 | + if (isset($properties['floor'])) { |
|
85 | + $properties['base'] = $properties['floor']; |
|
86 | + } |
|
77 | 87 | if (isset($properties['tops'])) { |
78 | 88 | if (preg_match('/^FL(\s)*(?<alt>\d+)/',strtoupper($properties['tops']),$matches)) { |
79 | 89 | $properties['upper_limit'] = round($matches['alt']*100*0.38048); |
@@ -275,7 +275,12 @@ discard block |
||
275 | 275 | <?php |
276 | 276 | } else { |
277 | 277 | ?> |
278 | - if (parseInt(lastupdateentity) < Math.floor(Date.now()-<?php if (isset($globalMapRefresh)) print $globalMapRefresh*2000; else print '60000'; ?>)) { |
|
278 | + if (parseInt(lastupdateentity) < Math.floor(Date.now()-<?php if (isset($globalMapRefresh)) { |
|
279 | + print $globalMapRefresh*2000; |
|
280 | +} else { |
|
281 | + print '60000'; |
|
282 | +} |
|
283 | +?>)) { |
|
279 | 284 | viewer.dataSources.get(dsn).entities.remove(entity); |
280 | 285 | czmlds.entities.removeById(entityid); |
281 | 286 | } |
@@ -564,7 +569,12 @@ discard block |
||
564 | 569 | if (!((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) && (isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) { |
565 | 570 | ?> |
566 | 571 | update_polarLayer(); |
567 | -setInterval(function(){update_polarLayer()},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>); |
|
572 | +setInterval(function(){update_polarLayer()},<?php if (isset($globalMapRefresh)) { |
|
573 | + print $globalMapRefresh*1000*2; |
|
574 | +} else { |
|
575 | + print '60000'; |
|
576 | +} |
|
577 | +?>); |
|
568 | 578 | <?php |
569 | 579 | } |
570 | 580 | ?> |
@@ -695,7 +705,12 @@ discard block |
||
695 | 705 | } |
696 | 706 | } |
697 | 707 | } |
698 | - ,<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000; else print '30000'; ?>); |
|
708 | + ,<?php if (isset($globalMapRefresh)) { |
|
709 | + print $globalMapRefresh*1000; |
|
710 | +} else { |
|
711 | + print '30000'; |
|
712 | +} |
|
713 | +?>); |
|
699 | 714 | } else { |
700 | 715 | var clockViewModel = new Cesium.ClockViewModel(viewer.clock); |
701 | 716 | var animationViewModel = new Cesium.AnimationViewModel(clockViewModel); |
@@ -724,7 +739,12 @@ discard block |
||
724 | 739 | if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM)) { |
725 | 740 | ?> |
726 | 741 | update_atcLayer(); |
727 | -setInterval(function(){update_atcLayer()},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>); |
|
742 | +setInterval(function(){update_atcLayer()},<?php if (isset($globalMapRefresh)) { |
|
743 | + print $globalMapRefresh*1000*2; |
|
744 | +} else { |
|
745 | + print '60000'; |
|
746 | +} |
|
747 | +?>); |
|
728 | 748 | <?php |
729 | 749 | } |
730 | 750 | ?> |
@@ -289,8 +289,8 @@ discard block |
||
289 | 289 | var entityid = entity.id; |
290 | 290 | var lastupdateentity = entity.properties.lastupdate; |
291 | 291 | <?php |
292 | - if (isset($globalMapUseBbox) && $globalMapUseBbox) { |
|
293 | - // Remove flights not in latest CZML |
|
292 | + if (isset($globalMapUseBbox) && $globalMapUseBbox) { |
|
293 | + // Remove flights not in latest CZML |
|
294 | 294 | ?> |
295 | 295 | if (lastupdateentity != lastupdate) { |
296 | 296 | console.log('Remove...'); |
@@ -298,14 +298,14 @@ discard block |
||
298 | 298 | czmlds.entities.removeById(entityid); |
299 | 299 | } |
300 | 300 | <?php |
301 | - } else { |
|
301 | + } else { |
|
302 | 302 | ?> |
303 | 303 | if (parseInt(lastupdateentity) < Math.floor(Date.now()-<?php if (isset($globalMapRefresh)) print $globalMapRefresh*2000; else print '60000'; ?>)) { |
304 | 304 | viewer.dataSources.get(dsn).entities.remove(entity); |
305 | 305 | czmlds.entities.removeById(entityid); |
306 | 306 | } |
307 | 307 | <?php |
308 | - } |
|
308 | + } |
|
309 | 309 | ?> |
310 | 310 | } |
311 | 311 | } |
@@ -762,12 +762,12 @@ discard block |
||
762 | 762 | } |
763 | 763 | |
764 | 764 | <?php |
765 | - if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM)) { |
|
765 | + if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM)) { |
|
766 | 766 | ?> |
767 | 767 | update_atcLayer(); |
768 | 768 | setInterval(function(){update_atcLayer()},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>); |
769 | 769 | <?php |
770 | - } |
|
770 | + } |
|
771 | 771 | ?> |
772 | 772 | |
773 | 773 | function iconColor(color) { |
@@ -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 |
@@ -56,16 +56,16 @@ discard block |
||
56 | 56 | <?php |
57 | 57 | } |
58 | 58 | if (isset($_GET['ident'])) { |
59 | - $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
|
59 | + $ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING); |
|
60 | 60 | } |
61 | 61 | if (isset($_GET['flightaware_id'])) { |
62 | - $flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING); |
|
62 | + $flightaware_id = filter_input(INPUT_GET, 'flightaware_id', FILTER_SANITIZE_STRING); |
|
63 | 63 | } |
64 | 64 | if (isset($_GET['latitude'])) { |
65 | - $latitude = filter_input(INPUT_GET,'latitude',FILTER_SANITIZE_STRING); |
|
65 | + $latitude = filter_input(INPUT_GET, 'latitude', FILTER_SANITIZE_STRING); |
|
66 | 66 | } |
67 | 67 | if (isset($_GET['longitude'])) { |
68 | - $longitude = filter_input(INPUT_GET,'longitude',FILTER_SANITIZE_STRING); |
|
68 | + $longitude = filter_input(INPUT_GET, 'longitude', FILTER_SANITIZE_STRING); |
|
69 | 69 | } |
70 | 70 | ?> |
71 | 71 | |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | } else { |
94 | 94 | if ((isset($globalCenterLatitude) && $globalCenterLatitude != '' && isset($globalCenterLongitude) && $globalCenterLongitude != '') || isset($_COOKIE['lastcentercoord'])) { |
95 | 95 | if (isset($_COOKIE['lastcentercoord'])) { |
96 | - $lastcentercoord = explode(',',$_COOKIE['lastcentercoord']); |
|
96 | + $lastcentercoord = explode(',', $_COOKIE['lastcentercoord']); |
|
97 | 97 | $viewcenterlatitude = $lastcentercoord[0]; |
98 | 98 | $viewcenterlongitude = $lastcentercoord[1]; |
99 | 99 | $viewzoom = $lastcentercoord[2]; |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | || navigator.userAgent.match(/BlackBerry/i) |
115 | 115 | || navigator.userAgent.match(/Windows Phone/i)) |
116 | 116 | { |
117 | - var zoom = <?php if (isset($viewzoom) && $viewzoom == $globalLiveZoom) print $viewzoom-1; elseif (isset($viewzoom)) print $viewzoom; else print '8'; ?>; |
|
117 | + var zoom = <?php if (isset($viewzoom) && $viewzoom == $globalLiveZoom) print $viewzoom - 1; elseif (isset($viewzoom)) print $viewzoom; else print '8'; ?>; |
|
118 | 118 | } else { |
119 | 119 | var zoom = <?php if (isset($viewzoom)) print $viewzoom; else print '9'; ?>; |
120 | 120 | } |
@@ -240,19 +240,19 @@ discard block |
||
240 | 240 | map.addLayer(yandexLayer); |
241 | 241 | <?php |
242 | 242 | } elseif ($MapType == 'Bing-Aerial') { |
243 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
243 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType', 'OpenStreetMap'); |
|
244 | 244 | ?> |
245 | 245 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'Aerial'}); |
246 | 246 | map.addLayer(bingLayer); |
247 | 247 | <?php |
248 | 248 | } elseif ($MapType == 'Bing-Hybrid') { |
249 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
249 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType', 'OpenStreetMap'); |
|
250 | 250 | ?> |
251 | 251 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'AerialWithLabels'}); |
252 | 252 | map.addLayer(bingLayer); |
253 | 253 | <?php |
254 | 254 | } elseif ($MapType == 'Bing-Road') { |
255 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
255 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType', 'OpenStreetMap'); |
|
256 | 256 | ?> |
257 | 257 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'Road'}); |
258 | 258 | map.addLayer(bingLayer); |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | |
391 | 391 | function update_tsk() { |
392 | 392 | var bbox = map.getBounds().toBBoxString(); |
393 | - var tskLayerQuery = $.getJSON("<?php print $globalURL; ?>/tsk-geojson.php?tsk=<?php echo filter_input(INPUT_GET,'tsk',FILTER_SANITIZE_URL); ?>",function (data) { |
|
393 | + var tskLayerQuery = $.getJSON("<?php print $globalURL; ?>/tsk-geojson.php?tsk=<?php echo filter_input(INPUT_GET, 'tsk', FILTER_SANITIZE_URL); ?>",function (data) { |
|
394 | 394 | tskLayer = L.geoJson(data,{ |
395 | 395 | onEachFeature: function (feature, layer) { |
396 | 396 | tskPopup(feature, layer); |
@@ -385,7 +385,7 @@ discard block |
||
385 | 385 | }; |
386 | 386 | |
387 | 387 | <?php |
388 | - if (isset($globalTSK) && $globalTSK && isset($_GET['tsk'])) { |
|
388 | + if (isset($globalTSK) && $globalTSK && isset($_GET['tsk'])) { |
|
389 | 389 | ?> |
390 | 390 | function tskPopup (feature, layer) { |
391 | 391 | var output = ''; |
@@ -420,7 +420,7 @@ discard block |
||
420 | 420 | }; |
421 | 421 | update_tsk(); |
422 | 422 | <?php |
423 | - } |
|
423 | + } |
|
424 | 424 | ?> |
425 | 425 | map.on('moveend', function() { |
426 | 426 | if (map.hasLayer(locationsLayer) == true) { |
@@ -434,10 +434,10 @@ discard block |
||
434 | 434 | setInterval(function(){if (noTimeout) { map.removeLayer(locationsLayer); update_locationsLayer();} },<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>); |
435 | 435 | } |
436 | 436 | <?php |
437 | - // Add support for custom json via $globalMapJson |
|
438 | - if (isset($globalMapJson) && is_array($globalMapJson)) { |
|
437 | + // Add support for custom json via $globalMapJson |
|
438 | + if (isset($globalMapJson) && is_array($globalMapJson)) { |
|
439 | 439 | foreach ($globalMapJson as $json) { |
440 | - if (isset($json['url'])) { |
|
440 | + if (isset($json['url'])) { |
|
441 | 441 | ?> |
442 | 442 | update_genLayer('<?php print $json['url']; ?>'); |
443 | 443 | <?php |
@@ -446,9 +446,9 @@ discard block |
||
446 | 446 | setInterval(function(){if (noTimeout) update_genLayer('<?php print $json['url']; ?>')}, <?php print $json['refresh']; ?>); |
447 | 447 | <?php |
448 | 448 | } |
449 | - } |
|
449 | + } |
|
450 | + } |
|
450 | 451 | } |
451 | - } |
|
452 | 452 | |
453 | 453 | ?> |
454 | 454 | //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 | |
12 | 17 | /* |
13 | 18 | if (isset($_COOKIE['archive_begin']) && $_COOKIE['archive_begin'] != '') { |
@@ -97,7 +102,17 @@ discard block |
||
97 | 102 | } |
98 | 103 | |
99 | 104 | //create the map |
100 | - 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); |
|
105 | + map = L.map('archive-map', { zoomControl:false }).setView([<?php if (isset($latitude)) { |
|
106 | + print $latitude; |
|
107 | +} else { |
|
108 | + print $globalCenterLatitude; |
|
109 | +} |
|
110 | +?>,<?php if (isset($longitude)) { |
|
111 | + print $longitude; |
|
112 | +} else { |
|
113 | + print $globalCenterLongitude; |
|
114 | +} |
|
115 | +?>], zoom); |
|
101 | 116 | <?php |
102 | 117 | } else { |
103 | 118 | if ((isset($globalCenterLatitude) && $globalCenterLatitude != '' && isset($globalCenterLongitude) && $globalCenterLongitude != '') || isset($_COOKIE['lastcentercoord'])) { |
@@ -123,9 +138,21 @@ discard block |
||
123 | 138 | || navigator.userAgent.match(/BlackBerry/i) |
124 | 139 | || navigator.userAgent.match(/Windows Phone/i)) |
125 | 140 | { |
126 | - var zoom = <?php if (isset($viewzoom) && $viewzoom == $globalLiveZoom) print $viewzoom-1; elseif (isset($viewzoom)) print $viewzoom; else print '8'; ?>; |
|
141 | + var zoom = <?php if (isset($viewzoom) && $viewzoom == $globalLiveZoom) { |
|
142 | + print $viewzoom-1; |
|
143 | +} elseif (isset($viewzoom)) { |
|
144 | + print $viewzoom; |
|
145 | +} else { |
|
146 | + print '8'; |
|
147 | +} |
|
148 | +?>; |
|
127 | 149 | } else { |
128 | - var zoom = <?php if (isset($viewzoom)) print $viewzoom; else print '9'; ?>; |
|
150 | + var zoom = <?php if (isset($viewzoom)) { |
|
151 | + print $viewzoom; |
|
152 | +} else { |
|
153 | + print '9'; |
|
154 | +} |
|
155 | +?>; |
|
129 | 156 | } |
130 | 157 | |
131 | 158 | //create the map |
@@ -151,16 +178,27 @@ discard block |
||
151 | 178 | bounds = L.latLngBounds(southWest,northEast); |
152 | 179 | //a few title layers |
153 | 180 | <?php |
154 | - if (isset($_COOKIE['MapType'])) $MapType = $_COOKIE['MapType']; |
|
155 | - else $MapType = $globalMapProvider; |
|
181 | + if (isset($_COOKIE['MapType'])) { |
|
182 | + $MapType = $_COOKIE['MapType']; |
|
183 | + } else { |
|
184 | + $MapType = $globalMapProvider; |
|
185 | + } |
|
156 | 186 | |
157 | 187 | if ($MapType == 'Mapbox') { |
158 | - if ($_COOKIE['MapTypeId'] == 'default') $MapBoxId = $globalMapboxId; |
|
159 | - else $MapBoxId = $_COOKIE['MapTypeId']; |
|
160 | -?> |
|
188 | + if ($_COOKIE['MapTypeId'] == 'default') { |
|
189 | + $MapBoxId = $globalMapboxId; |
|
190 | + } else { |
|
191 | + $MapBoxId = $_COOKIE['MapTypeId']; |
|
192 | + } |
|
193 | + ?> |
|
161 | 194 | L.tileLayer('https://{s}.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={token}', { |
162 | 195 | maxZoom: 18, |
163 | - noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) print 'false'; else print 'true'; ?>, |
|
196 | + noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) { |
|
197 | + print 'false'; |
|
198 | +} else { |
|
199 | + print 'true'; |
|
200 | +} |
|
201 | +?>, |
|
164 | 202 | attribution: '© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/" target="_blank">Improve this map</a></strong>', |
165 | 203 | id: '<?php print $MapBoxId; ?>', |
166 | 204 | token: '<?php print $globalMapboxToken; ?>' |
@@ -179,7 +217,12 @@ discard block |
||
179 | 217 | ?> |
180 | 218 | L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { |
181 | 219 | maxZoom: 18, |
182 | - noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) print 'false'; else print 'true'; ?>, |
|
220 | + noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) { |
|
221 | + print 'false'; |
|
222 | +} else { |
|
223 | + print 'true'; |
|
224 | +} |
|
225 | +?>, |
|
183 | 226 | attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' + |
184 | 227 | '<a href="www.openstreetmap.org/copyright">Open Database Licence</a>' |
185 | 228 | }).addTo(map); |
@@ -188,7 +231,12 @@ discard block |
||
188 | 231 | ?> |
189 | 232 | L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}', { |
190 | 233 | maxZoom: 18, |
191 | - noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) print 'false'; else print 'true'; ?>, |
|
234 | + noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) { |
|
235 | + print 'false'; |
|
236 | +} else { |
|
237 | + print 'true'; |
|
238 | +} |
|
239 | +?>, |
|
192 | 240 | attribution: 'Tiles © Esri — Source: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012' |
193 | 241 | }).addTo(map); |
194 | 242 | <?php |
@@ -196,7 +244,12 @@ discard block |
||
196 | 244 | ?> |
197 | 245 | L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', { |
198 | 246 | maxZoom: 18, |
199 | - noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) print 'false'; else print 'true'; ?>, |
|
247 | + noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) { |
|
248 | + print 'false'; |
|
249 | +} else { |
|
250 | + print 'true'; |
|
251 | +} |
|
252 | +?>, |
|
200 | 253 | attribution: 'Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community' |
201 | 254 | }).addTo(map); |
202 | 255 | <?php |
@@ -204,7 +257,12 @@ discard block |
||
204 | 257 | ?> |
205 | 258 | L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/tile/{z}/{y}/{x}', { |
206 | 259 | maxZoom: 18, |
207 | - noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) print 'false'; else print 'true'; ?>, |
|
260 | + noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) { |
|
261 | + print 'false'; |
|
262 | +} else { |
|
263 | + print 'true'; |
|
264 | +} |
|
265 | +?>, |
|
208 | 266 | attribution: 'Tiles © Esri — National Geographic, Esri, DeLorme, NAVTEQ, UNEP-WCMC, USGS, NASA, ESA, METI, NRCAN, GEBCO, NOAA, iPC' |
209 | 267 | }).addTo(map); |
210 | 268 | <?php |
@@ -249,20 +307,26 @@ discard block |
||
249 | 307 | map.addLayer(yandexLayer); |
250 | 308 | <?php |
251 | 309 | } elseif ($MapType == 'Bing-Aerial') { |
252 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
253 | -?> |
|
310 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') { |
|
311 | + setcookie('MapType','OpenStreetMap'); |
|
312 | + } |
|
313 | + ?> |
|
254 | 314 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'Aerial'}); |
255 | 315 | map.addLayer(bingLayer); |
256 | 316 | <?php |
257 | 317 | } elseif ($MapType == 'Bing-Hybrid') { |
258 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
259 | -?> |
|
318 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') { |
|
319 | + setcookie('MapType','OpenStreetMap'); |
|
320 | + } |
|
321 | + ?> |
|
260 | 322 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'AerialWithLabels'}); |
261 | 323 | map.addLayer(bingLayer); |
262 | 324 | <?php |
263 | 325 | } elseif ($MapType == 'Bing-Road') { |
264 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
265 | -?> |
|
326 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') { |
|
327 | + setcookie('MapType','OpenStreetMap'); |
|
328 | + } |
|
329 | + ?> |
|
266 | 330 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'Road'}); |
267 | 331 | map.addLayer(bingLayer); |
268 | 332 | <?php |
@@ -291,7 +355,12 @@ discard block |
||
291 | 355 | maxZoom: 5, |
292 | 356 | tms : true, |
293 | 357 | zindex : 3, |
294 | - noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) print 'false'; else print 'true'; ?>, |
|
358 | + noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) { |
|
359 | + print 'false'; |
|
360 | +} else { |
|
361 | + print 'true'; |
|
362 | +} |
|
363 | +?>, |
|
295 | 364 | attribution: 'Natural Earth' |
296 | 365 | }).addTo(map); |
297 | 366 | <?php |
@@ -299,9 +368,24 @@ discard block |
||
299 | 368 | $customid = $MapType; |
300 | 369 | ?> |
301 | 370 | L.tileLayer('<?php print $globalMapCustomLayer[$customid]['url']; ?>/{z}/{x}/{y}.png', { |
302 | - maxZoom: <?php if (isset($globalMapCustomLayer[$customid]['maxZoom'])) print $globalMapCustomLayer[$customid]['maxZoom']; else print '18'; ?>, |
|
303 | - minZoom: <?php if (isset($globalMapCustomLayer[$customid]['minZoom'])) print $globalMapCustomLayer[$customid]['minZoom']; else print '0'; ?>, |
|
304 | - noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) print 'false'; else print 'true'; ?>, |
|
371 | + maxZoom: <?php if (isset($globalMapCustomLayer[$customid]['maxZoom'])) { |
|
372 | + print $globalMapCustomLayer[$customid]['maxZoom']; |
|
373 | +} else { |
|
374 | + print '18'; |
|
375 | +} |
|
376 | +?>, |
|
377 | + minZoom: <?php if (isset($globalMapCustomLayer[$customid]['minZoom'])) { |
|
378 | + print $globalMapCustomLayer[$customid]['minZoom']; |
|
379 | +} else { |
|
380 | + print '0'; |
|
381 | +} |
|
382 | +?>, |
|
383 | + noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) { |
|
384 | + print 'false'; |
|
385 | +} else { |
|
386 | + print 'true'; |
|
387 | +} |
|
388 | +?>, |
|
305 | 389 | attribution: '<?php print $globalMapCustomLayer[$customid]['attribution']; ?>' |
306 | 390 | }).addTo(map); |
307 | 391 | |
@@ -341,7 +425,12 @@ discard block |
||
341 | 425 | } |
342 | 426 | } elseif ($globalBounding == 'circle') { |
343 | 427 | ?> |
344 | - var circle = L.circle([<?php print $globalCenterLatitude; ?>, <?php print $globalCenterLongitude; ?>],<?php if (isset($globalBoundingCircleSize)) print $globalBoundingCircleSize; else print '70000'; ?>,{ |
|
428 | + var circle = L.circle([<?php print $globalCenterLatitude; ?>, <?php print $globalCenterLongitude; ?>],<?php if (isset($globalBoundingCircleSize)) { |
|
429 | + print $globalBoundingCircleSize; |
|
430 | +} else { |
|
431 | + print '70000'; |
|
432 | +} |
|
433 | +?>,{ |
|
345 | 434 | color: '#92C7D1', |
346 | 435 | fillColor: '#92C7D1', |
347 | 436 | fillOpacity: 0.3, |
@@ -431,7 +520,12 @@ discard block |
||
431 | 520 | }); |
432 | 521 | if (archive === false) { |
433 | 522 | update_locationsLayer(); |
434 | - setInterval(function(){if (noTimeout) { map.removeLayer(locationsLayer); update_locationsLayer();} },<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>); |
|
523 | + setInterval(function(){if (noTimeout) { map.removeLayer(locationsLayer); update_locationsLayer();} },<?php if (isset($globalMapRefresh)) { |
|
524 | + print $globalMapRefresh*1000*2; |
|
525 | +} else { |
|
526 | + print '60000'; |
|
527 | +} |
|
528 | +?>); |
|
435 | 529 | } |
436 | 530 | <?php |
437 | 531 | // Add support for custom json via $globalMapJson |
@@ -50,30 +50,30 @@ discard block |
||
50 | 50 | |
51 | 51 | |
52 | 52 | function quaternionrotate($heading, $attitude = 0, $bank = 0) { |
53 | - // Assuming the angles are in radians. |
|
54 | - $c1 = cos($heading/2); |
|
55 | - $s1 = sin($heading/2); |
|
56 | - $c2 = cos($attitude/2); |
|
57 | - $s2 = sin($attitude/2); |
|
58 | - $c3 = cos($bank/2); |
|
59 | - $s3 = sin($bank/2); |
|
60 | - $c1c2 = $c1*$c2; |
|
61 | - $s1s2 = $s1*$s2; |
|
62 | - $w =$c1c2*$c3 - $s1s2*$s3; |
|
63 | - $x =$c1c2*$s3 + $s1s2*$c3; |
|
64 | - $y =$s1*$c2*$c3 + $c1*$s2*$s3; |
|
65 | - $z =$c1*$s2*$c3 - $s1*$c2*$s3; |
|
66 | - return array('x' => $x,'y' => $y,'z' => $z,'w' => $w); |
|
53 | + // Assuming the angles are in radians. |
|
54 | + $c1 = cos($heading/2); |
|
55 | + $s1 = sin($heading/2); |
|
56 | + $c2 = cos($attitude/2); |
|
57 | + $s2 = sin($attitude/2); |
|
58 | + $c3 = cos($bank/2); |
|
59 | + $s3 = sin($bank/2); |
|
60 | + $c1c2 = $c1*$c2; |
|
61 | + $s1s2 = $s1*$s2; |
|
62 | + $w =$c1c2*$c3 - $s1s2*$s3; |
|
63 | + $x =$c1c2*$s3 + $s1s2*$c3; |
|
64 | + $y =$s1*$c2*$c3 + $c1*$s2*$s3; |
|
65 | + $z =$c1*$s2*$c3 - $s1*$c2*$s3; |
|
66 | + return array('x' => $x,'y' => $y,'z' => $z,'w' => $w); |
|
67 | 67 | // return array('x' => '0.0','y' => '-0.931','z' => '0.0','w' => '0.365'); |
68 | 68 | |
69 | 69 | } |
70 | 70 | |
71 | 71 | |
72 | 72 | if (isset($_GET['download'])) { |
73 | - if ($_GET['download'] == "true") |
|
74 | - { |
|
73 | + if ($_GET['download'] == "true") |
|
74 | + { |
|
75 | 75 | header('Content-disposition: attachment; filename="flightairmap.json"'); |
76 | - } |
|
76 | + } |
|
77 | 77 | } |
78 | 78 | header('Content-Type: text/javascript'); |
79 | 79 | |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | if (isset($_GET['coord']) && $_GET['coord'] != '') { |
173 | 173 | $coord = explode(',',$_GET['coord']); |
174 | 174 | if (!(filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT) |
175 | - && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) { |
|
175 | + && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) { |
|
176 | 176 | $coord = array(); |
177 | 177 | } |
178 | 178 | } |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | if (isset($_GET['coord']) && $_GET['coord'] != '') { |
183 | 183 | $coord = explode(',',$_GET['coord']); |
184 | 184 | if (!(filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT) |
185 | - && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) { |
|
185 | + && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) { |
|
186 | 186 | $coord = array(); |
187 | 187 | } |
188 | 188 | } |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | if (!((isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') && (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '')) && isset($_GET['coord']) && $_GET['coord'] != '') { |
193 | 193 | $coord = explode(',',$_GET['coord']); |
194 | 194 | if (!(filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT) |
195 | - && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) { |
|
195 | + && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) { |
|
196 | 196 | $coord = array(); |
197 | 197 | } |
198 | 198 | } |
@@ -301,10 +301,10 @@ discard block |
||
301 | 301 | $image = "images/placeholder_thumb.png"; |
302 | 302 | } |
303 | 303 | |
304 | - if (isset($spotter_item['flightaware_id'])) $id = $spotter_item['flightaware_id']; |
|
305 | - elseif (isset($spotter_item['famtrackid'])) $id = $spotter_item['famtrackid']; |
|
306 | - elseif (isset($spotter_item['fammarine_id'])) $id = $spotter_item['fammarine_id']; |
|
307 | - if ($prev_flightaware_id != $id) { |
|
304 | + if (isset($spotter_item['flightaware_id'])) $id = $spotter_item['flightaware_id']; |
|
305 | + elseif (isset($spotter_item['famtrackid'])) $id = $spotter_item['famtrackid']; |
|
306 | + elseif (isset($spotter_item['fammarine_id'])) $id = $spotter_item['fammarine_id']; |
|
307 | + if ($prev_flightaware_id != $id) { |
|
308 | 308 | if ($prev_flightaware_id != '') { |
309 | 309 | /* |
310 | 310 | if ($nblatlong == 1) { |
@@ -384,7 +384,7 @@ discard block |
||
384 | 384 | $spotter_item['wake_category'] = $aircraft_info[0]['wake_category']; |
385 | 385 | $spotter_item['engine_count'] = $aircraft_info[0]['engine_count']; |
386 | 386 | } else $aircraft_shadow = ''; |
387 | - $output .= ' "billboard" : {"image" : "'.$globalURL.'/images/aircrafts/new/'.$aircraft_shadow.'","scale" : 0.5'; |
|
387 | + $output .= ' "billboard" : {"image" : "'.$globalURL.'/images/aircrafts/new/'.$aircraft_shadow.'","scale" : 0.5'; |
|
388 | 388 | if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true' && isset($_COOKIE['IconColor'])) { |
389 | 389 | $rgb = $Common->hex2rgb($_COOKIE['IconColor']); |
390 | 390 | $output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}'; |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | $rgb = $Common->hex2rgb($_COOKIE['IconColor']); |
416 | 416 | $output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}'; |
417 | 417 | } |
418 | - $output .= '},'; |
|
418 | + $output .= '},'; |
|
419 | 419 | } elseif (isset($modelsdb[$aircraft_icao]) && $aircraft_icao != '') { |
420 | 420 | $output .= '"model": {"gltf" : "'.$globalURL.'/models/'.$modelsdb[$aircraft_icao].'","scale" : '.$scale.',"minimumPixelSize": '.$minimumpixelsize.''; |
421 | 421 | $output .= ',"heightReference": "'.$heightrelative.'"'; |
@@ -423,7 +423,7 @@ discard block |
||
423 | 423 | $rgb = $Common->hex2rgb($_COOKIE['IconColor']); |
424 | 424 | $output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}'; |
425 | 425 | } |
426 | - $output .= '},'; |
|
426 | + $output .= '},'; |
|
427 | 427 | } elseif ($aircraft_icao != '') { |
428 | 428 | $aircraft_info = $Spotter->getAllAircraftInfo($aircraft_icao); |
429 | 429 | if (isset($aircraft_info[0]['engine_type'])) { |
@@ -19,8 +19,12 @@ discard block |
||
19 | 19 | } |
20 | 20 | $tracker = false; |
21 | 21 | $marine = false; |
22 | -if (isset($_GET['tracker'])) $tracker = true; |
|
23 | -if (isset($_GET['marine'])) $marine = true; |
|
22 | +if (isset($_GET['tracker'])) { |
|
23 | + $tracker = true; |
|
24 | +} |
|
25 | +if (isset($_GET['marine'])) { |
|
26 | + $marine = true; |
|
27 | +} |
|
24 | 28 | if ($tracker) { |
25 | 29 | require_once('require/class.Tracker.php'); |
26 | 30 | require_once('require/class.TrackerLive.php'); |
@@ -77,24 +81,49 @@ discard block |
||
77 | 81 | } |
78 | 82 | header('Content-Type: text/javascript'); |
79 | 83 | |
80 | -if (!isset($globalJsonCompress)) $compress = true; |
|
81 | -else $compress = $globalJsonCompress; |
|
84 | +if (!isset($globalJsonCompress)) { |
|
85 | + $compress = true; |
|
86 | +} else { |
|
87 | + $compress = $globalJsonCompress; |
|
88 | +} |
|
82 | 89 | |
83 | 90 | $from_archive = false; |
84 | 91 | $min = false; |
85 | 92 | $allhistory = false; |
86 | 93 | $filter['source'] = array(); |
87 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
88 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
89 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
90 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs')); |
|
91 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
92 | -if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
93 | -if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING); |
|
94 | -if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
95 | -if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
96 | -if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
97 | -if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING); |
|
94 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') { |
|
95 | + $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
96 | +} |
|
97 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') { |
|
98 | + $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
99 | +} |
|
100 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') { |
|
101 | + $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
102 | +} |
|
103 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') { |
|
104 | + $filter['source'] = array_merge($filter['source'],array('sbs','famaprs')); |
|
105 | +} |
|
106 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') { |
|
107 | + $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
108 | +} |
|
109 | +if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') { |
|
110 | + $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
111 | +} |
|
112 | +if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') { |
|
113 | + $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING); |
|
114 | +} |
|
115 | +if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') { |
|
116 | + $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
117 | +} |
|
118 | +if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') { |
|
119 | + $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
120 | +} |
|
121 | +if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') { |
|
122 | + $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
123 | +} |
|
124 | +if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') { |
|
125 | + $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING); |
|
126 | +} |
|
98 | 127 | /* |
99 | 128 | if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) { |
100 | 129 | $min = true; |
@@ -268,8 +297,12 @@ discard block |
||
268 | 297 | $flightcnt = $SpotterLive->getLiveSpotterCount($filter); |
269 | 298 | } |
270 | 299 | } |
271 | - if ($flightcnt == '') $flightcnt = 0; |
|
272 | -} else $flightcnt = 0; |
|
300 | + if ($flightcnt == '') { |
|
301 | + $flightcnt = 0; |
|
302 | + } |
|
303 | + } else { |
|
304 | + $flightcnt = 0; |
|
305 | +} |
|
273 | 306 | |
274 | 307 | $sqltime = round(microtime(true)-$begintime,2); |
275 | 308 | $minitime = time(); |
@@ -315,7 +348,9 @@ discard block |
||
315 | 348 | $gltf2 = false; |
316 | 349 | $scale = 1.0; |
317 | 350 | $minimumpixelsize = 20; |
318 | -if (isset($archivespeed)) $speed = $archivespeed; |
|
351 | +if (isset($archivespeed)) { |
|
352 | + $speed = $archivespeed; |
|
353 | +} |
|
319 | 354 | $output = '['; |
320 | 355 | if ($tracker) { |
321 | 356 | $output .= '{"id" : "document", "name" : "tracker","version" : "1.0"'; |
@@ -351,9 +386,13 @@ discard block |
||
351 | 386 | $image = "images/placeholder_thumb.png"; |
352 | 387 | } |
353 | 388 | |
354 | - if (isset($spotter_item['flightaware_id'])) $id = $spotter_item['flightaware_id']; |
|
355 | - elseif (isset($spotter_item['famtrackid'])) $id = $spotter_item['famtrackid']; |
|
356 | - elseif (isset($spotter_item['fammarine_id'])) $id = $spotter_item['fammarine_id']; |
|
389 | + if (isset($spotter_item['flightaware_id'])) { |
|
390 | + $id = $spotter_item['flightaware_id']; |
|
391 | + } elseif (isset($spotter_item['famtrackid'])) { |
|
392 | + $id = $spotter_item['famtrackid']; |
|
393 | + } elseif (isset($spotter_item['fammarine_id'])) { |
|
394 | + $id = $spotter_item['fammarine_id']; |
|
395 | + } |
|
357 | 396 | if ($prev_flightaware_id != $id) { |
358 | 397 | if ($prev_flightaware_id != '') { |
359 | 398 | /* |
@@ -391,14 +430,24 @@ discard block |
||
391 | 430 | if (isset($spotter_item['squawk'])) { |
392 | 431 | $output .= '"squawk": "'.$spotter_item['squawk'].'",'; |
393 | 432 | } |
394 | - if (isset($spotter_item['registration'])) $output .= '"registration": "'.$spotter_item['registration'].'",'; |
|
395 | - if (isset($spotter_item['format_source'])) $output .= '"format": "'.$spotter_item['format_source'].'",'; |
|
396 | - if (isset($spotter_item['ident'])) $output.= '"ident": "'.$spotter_item['ident'].'",'; |
|
433 | + if (isset($spotter_item['registration'])) { |
|
434 | + $output .= '"registration": "'.$spotter_item['registration'].'",'; |
|
435 | + } |
|
436 | + if (isset($spotter_item['format_source'])) { |
|
437 | + $output .= '"format": "'.$spotter_item['format_source'].'",'; |
|
438 | + } |
|
439 | + if (isset($spotter_item['ident'])) { |
|
440 | + $output.= '"ident": "'.$spotter_item['ident'].'",'; |
|
441 | + } |
|
397 | 442 | if ($tracker) { |
398 | - if (isset($spotter_item['type'])) $output .= '"tracker_type": "'.$spotter_item['type'].'",'; |
|
443 | + if (isset($spotter_item['type'])) { |
|
444 | + $output .= '"tracker_type": "'.$spotter_item['type'].'",'; |
|
445 | + } |
|
399 | 446 | $output.= '"type": "tracker"'; |
400 | 447 | } elseif ($marine) { |
401 | - if (isset($spotter_item['type'])) $output .= '"marine_type": "'.$spotter_item['type'].'",'; |
|
448 | + if (isset($spotter_item['type'])) { |
|
449 | + $output .= '"marine_type": "'.$spotter_item['type'].'",'; |
|
450 | + } |
|
402 | 451 | $output.= '"type": "marine"'; |
403 | 452 | } else { |
404 | 453 | if ($one3dmodel === false && isset($globalMap3DLiveries) && $globalMap3DLiveries) { |
@@ -449,7 +498,9 @@ discard block |
||
449 | 498 | $spotter_item['engine_type'] = $aircraft_info[0]['engine_type']; |
450 | 499 | $spotter_item['wake_category'] = $aircraft_info[0]['wake_category']; |
451 | 500 | $spotter_item['engine_count'] = $aircraft_info[0]['engine_count']; |
452 | - } else $aircraft_shadow = ''; |
|
501 | + } else { |
|
502 | + $aircraft_shadow = ''; |
|
503 | + } |
|
453 | 504 | $output .= ' "billboard" : {"image" : "'.$globalURL.'/images/aircrafts/new/'.$aircraft_shadow.'","scale" : 0.5'; |
454 | 505 | if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true' && isset($_COOKIE['IconColor'])) { |
455 | 506 | $rgb = $Common->hex2rgb($_COOKIE['IconColor']); |
@@ -457,7 +508,9 @@ discard block |
||
457 | 508 | } |
458 | 509 | $output .= '},'; |
459 | 510 | } |
460 | - } else $output .= ' "billboard" : {"image" : "data:image/png;base64,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","scale" : 0.5},'; |
|
511 | + } else { |
|
512 | + $output .= ' "billboard" : {"image" : "data:image/png;base64,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","scale" : 0.5},'; |
|
513 | + } |
|
461 | 514 | } elseif ($one3dmodel) { |
462 | 515 | if (isset($globalMap3DForceModel) && $globalMap3DForceModel != '') { |
463 | 516 | $output .= '"model": {"gltf" : "'.$globalURL.'/models/'.$globalMap3DForceModel.'","scale" : '.$scale.',"minimumPixelSize": '.$minimumpixelsize.''; |
@@ -497,7 +550,9 @@ discard block |
||
497 | 550 | $spotter_item['engine_type'] = $aircraft_info[0]['engine_type']; |
498 | 551 | $spotter_item['wake_category'] = $aircraft_info[0]['wake_category']; |
499 | 552 | $spotter_item['engine_count'] = $aircraft_info[0]['engine_count']; |
500 | - } else $aircraft_shadow = ''; |
|
553 | + } else { |
|
554 | + $aircraft_shadow = ''; |
|
555 | + } |
|
501 | 556 | if ($aircraft_shadow != '') { |
502 | 557 | if (isset($modelsdb2[$aircraft_shadow])) { |
503 | 558 | $output .= '"model": {"gltf" : "'.$globalURL.'/models/gltf2/'.$modelsdb2[$aircraft_shadow]['glb'].'","scale" : '.$scale.',"minimumPixelSize": '.$modelsdb2[$aircraft_shadow]['size']; |
@@ -652,7 +707,9 @@ discard block |
||
652 | 707 | } |
653 | 708 | $output .= '},'; |
654 | 709 | //if ($spotter_item['aircraft_shadow'] != '') $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",'; |
655 | - if ($spotter_item['aircraft_icao'] != '') $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
710 | + if ($spotter_item['aircraft_icao'] != '') { |
|
711 | + $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
712 | + } |
|
656 | 713 | $modelsdb[$aircraft_icao] = 'Cesium_Air.glb'; |
657 | 714 | } |
658 | 715 | } elseif (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'aprs') { |
@@ -674,7 +731,9 @@ discard block |
||
674 | 731 | } |
675 | 732 | $output .= '},'; |
676 | 733 | //if ($spotter_item['aircraft_shadow'] != '') $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",'; |
677 | - if ($spotter_item['aircraft_icao'] != '') $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
734 | + if ($spotter_item['aircraft_icao'] != '') { |
|
735 | + $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
736 | + } |
|
678 | 737 | $modelsdb[$aircraft_icao] = 'Cesium_Air.glb'; |
679 | 738 | } |
680 | 739 | } else { |
@@ -687,7 +746,9 @@ discard block |
||
687 | 746 | } |
688 | 747 | $output .= '},'; |
689 | 748 | //if ($spotter_item['aircraft_shadow'] != '') $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",'; |
690 | - if ($spotter_item['aircraft_icao'] != '') $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
749 | + if ($spotter_item['aircraft_icao'] != '') { |
|
750 | + $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
751 | + } |
|
691 | 752 | $modelsdb[$aircraft_icao] = 'Cesium_Air.glb'; |
692 | 753 | } |
693 | 754 | } elseif ($tracker && isset($spotter_item['type'])) { |
@@ -791,8 +852,11 @@ discard block |
||
791 | 852 | $output .= '},'; |
792 | 853 | } |
793 | 854 | } |
794 | - if (isset($onground) && $onground) $output = str_replace('%onground%','true',$output); |
|
795 | - else $output = str_replace('%onground%','false',$output); |
|
855 | + if (isset($onground) && $onground) { |
|
856 | + $output = str_replace('%onground%','true',$output); |
|
857 | + } else { |
|
858 | + $output = str_replace('%onground%','false',$output); |
|
859 | + } |
|
796 | 860 | |
797 | 861 | // $output .= '"heightReference": "CLAMP_TO_GROUND",'; |
798 | 862 | //$output .= '"heightReference": "'.$heightrelative.'",'; |
@@ -805,9 +869,15 @@ discard block |
||
805 | 869 | // $output .= '"interpolationDegree" : 5,'; |
806 | 870 | // $output .= '"epoch" : "'.date("c",strtotime($spotter_item['date'])).'", '; |
807 | 871 | $output .= '"cartographicDegrees": ['; |
808 | - if ($minitime > strtotime($spotter_item['date'])) $minitime = strtotime($spotter_item['date']); |
|
809 | - if (isset($_COOKIE['MapTrack']) && $id == $_COOKIE['MapTrack'] && $minitracktime > strtotime($spotter_item['date'])) $minitracktime = strtotime($spotter_item['date']); |
|
810 | - if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']); |
|
872 | + if ($minitime > strtotime($spotter_item['date'])) { |
|
873 | + $minitime = strtotime($spotter_item['date']); |
|
874 | + } |
|
875 | + if (isset($_COOKIE['MapTrack']) && $id == $_COOKIE['MapTrack'] && $minitracktime > strtotime($spotter_item['date'])) { |
|
876 | + $minitracktime = strtotime($spotter_item['date']); |
|
877 | + } |
|
878 | + if ($maxitime < strtotime($spotter_item['date'])) { |
|
879 | + $maxitime = strtotime($spotter_item['date']); |
|
880 | + } |
|
811 | 881 | $output .= '"'.date("c",strtotime($spotter_item['date'])).'", '; |
812 | 882 | $output .= $spotter_item['longitude'].', '; |
813 | 883 | $output .= $spotter_item['latitude']; |
@@ -830,7 +900,9 @@ discard block |
||
830 | 900 | $output .= ', '.round($spotter_item['altitude']*30.48); |
831 | 901 | $prevalt = round($spotter_item['altitude']*30.48); |
832 | 902 | } |
833 | - } else $output .= ', 0'; |
|
903 | + } else { |
|
904 | + $output .= ', 0'; |
|
905 | + } |
|
834 | 906 | //$orientation = '"orientation" : { '; |
835 | 907 | //$orientation .= '"unitQuaternion": ['; |
836 | 908 | //$quat = quaternionrotate(deg2rad($spotter_item['heading']),deg2rad(0),deg2rad(0)); |
@@ -838,13 +910,18 @@ discard block |
||
838 | 910 | } else { |
839 | 911 | $nblatlong = $nblatlong+1; |
840 | 912 | $output .= ',"'.date("c",strtotime($spotter_item['date'])).'", '; |
841 | - if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']); |
|
913 | + if ($maxitime < strtotime($spotter_item['date'])) { |
|
914 | + $maxitime = strtotime($spotter_item['date']); |
|
915 | + } |
|
842 | 916 | if ($spotter_item['ground_speed'] == 0) { |
843 | 917 | $output .= $prevlong.', '; |
844 | 918 | $output .= $prevlat; |
845 | 919 | //if (!$marine && (!isset($onground) || !$onground)) $output .= ', '.$prevalt; |
846 | - if (!$marine) $output .= ', '.$prevalt; |
|
847 | - else $output .= ', 0'; |
|
920 | + if (!$marine) { |
|
921 | + $output .= ', '.$prevalt; |
|
922 | + } else { |
|
923 | + $output .= ', 0'; |
|
924 | + } |
|
848 | 925 | } else { |
849 | 926 | $output .= $spotter_item['longitude'].', '; |
850 | 927 | $output .= $spotter_item['latitude']; |
@@ -857,14 +934,17 @@ discard block |
||
857 | 934 | $output .= ', 0'; |
858 | 935 | } |
859 | 936 | } else { |
860 | - if (isset($spotter_item['real_altitude']) && $spotter_item['real_altitude'] != '') $output .= ', '.round($spotter_item['real_altitude']*0.3048); |
|
861 | - elseif ($tracker) { |
|
937 | + if (isset($spotter_item['real_altitude']) && $spotter_item['real_altitude'] != '') { |
|
938 | + $output .= ', '.round($spotter_item['real_altitude']*0.3048); |
|
939 | + } elseif ($tracker) { |
|
862 | 940 | $output .= ', '.round($spotter_item['altitude']*0.3048); |
863 | 941 | } else { |
864 | 942 | $output .= ', '.round($spotter_item['altitude']*30.48); |
865 | 943 | } |
866 | 944 | } |
867 | - } else $output .= ', 0'; |
|
945 | + } else { |
|
946 | + $output .= ', 0'; |
|
947 | + } |
|
868 | 948 | } |
869 | 949 | //$quat = quaternionrotate(deg2rad($spotter_item['heading']),deg2rad(0),deg2rad(0)); |
870 | 950 | //$orientation .= ',"'.date("c",strtotime($spotter_item['date'])).'",'.$quat['x'].','.$quat['y'].','.$quat['z'].','.$quat['w']; |
@@ -885,9 +965,10 @@ discard block |
||
885 | 965 | } else { |
886 | 966 | $output = str_replace('%minitime%',date("c",time()-$globalLiveInterval),$output); |
887 | 967 | } |
968 | + } else { |
|
969 | + $output = str_replace('%minitime%',date("c",$minitime),$output); |
|
888 | 970 | } |
889 | - else $output = str_replace('%minitime%',date("c",$minitime),$output); |
|
890 | -} elseif (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '' && $minitracktime != $minitracktime_begin) { |
|
971 | + } elseif (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '' && $minitracktime != $minitracktime_begin) { |
|
891 | 972 | $output = str_replace('%minitime%',date("c",$minitracktime),$output); |
892 | 973 | } else { |
893 | 974 | $output = str_replace('%minitime%',date("c",$minitime),$output); |
@@ -897,7 +978,10 @@ discard block |
||
897 | 978 | } else { |
898 | 979 | $output = str_replace('%maxitime%',date("c",$maxitime),$output); |
899 | 980 | } |
900 | -if ($gltf2) $output = str_replace('%gltf2%','true',$output); |
|
901 | -else $output = str_replace('%gltf2%','false',$output); |
|
981 | +if ($gltf2) { |
|
982 | + $output = str_replace('%gltf2%','true',$output); |
|
983 | +} else { |
|
984 | + $output = str_replace('%gltf2%','false',$output); |
|
985 | +} |
|
902 | 986 | print $output; |
903 | 987 | ?> |
@@ -59,11 +59,11 @@ discard block |
||
59 | 59 | $s3 = sin($bank/2); |
60 | 60 | $c1c2 = $c1*$c2; |
61 | 61 | $s1s2 = $s1*$s2; |
62 | - $w =$c1c2*$c3 - $s1s2*$s3; |
|
63 | - $x =$c1c2*$s3 + $s1s2*$c3; |
|
64 | - $y =$s1*$c2*$c3 + $c1*$s2*$s3; |
|
65 | - $z =$c1*$s2*$c3 - $s1*$c2*$s3; |
|
66 | - return array('x' => $x,'y' => $y,'z' => $z,'w' => $w); |
|
62 | + $w = $c1c2*$c3 - $s1s2*$s3; |
|
63 | + $x = $c1c2*$s3 + $s1s2*$c3; |
|
64 | + $y = $s1*$c2*$c3 + $c1*$s2*$s3; |
|
65 | + $z = $c1*$s2*$c3 - $s1*$c2*$s3; |
|
66 | + return array('x' => $x, 'y' => $y, 'z' => $z, 'w' => $w); |
|
67 | 67 | // return array('x' => '0.0','y' => '-0.931','z' => '0.0','w' => '0.365'); |
68 | 68 | |
69 | 69 | } |
@@ -84,17 +84,17 @@ discard block |
||
84 | 84 | $min = false; |
85 | 85 | $allhistory = false; |
86 | 86 | $filter['source'] = array(); |
87 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
88 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
89 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
90 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs')); |
|
91 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
92 | -if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
93 | -if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING); |
|
94 | -if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
95 | -if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
96 | -if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
97 | -if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING); |
|
87 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'], array('vatsimtxt')); |
|
88 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'], array('whazzup')); |
|
89 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'], array('phpvmacars')); |
|
90 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'], array('sbs', 'famaprs')); |
|
91 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'], array('aprs')); |
|
92 | +if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'], FILTER_SANITIZE_STRING); |
|
93 | +if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'], FILTER_SANITIZE_STRING); |
|
94 | +if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',', $_COOKIE['filter_Airlines']), FILTER_SANITIZE_STRING); |
|
95 | +if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',', $_COOKIE['filter_Sources']), FILTER_SANITIZE_STRING); |
|
96 | +if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'], FILTER_SANITIZE_STRING); |
|
97 | +if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'], FILTER_SANITIZE_STRING); |
|
98 | 98 | /* |
99 | 99 | if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) { |
100 | 100 | $min = true; |
@@ -141,17 +141,17 @@ discard block |
||
141 | 141 | $from_archive = true; |
142 | 142 | // $begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
143 | 143 | // $enddate = filter_input(INPUT_GET,'enddate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
144 | - $begindate = filter_input(INPUT_GET,'begindate',FILTER_SANITIZE_NUMBER_INT); |
|
145 | - $enddate = filter_input(INPUT_GET,'enddate',FILTER_SANITIZE_NUMBER_INT); |
|
146 | - $archivespeed = filter_input(INPUT_GET,'speed',FILTER_SANITIZE_NUMBER_INT); |
|
147 | - $begindate = date('Y-m-d H:i:s',$begindate); |
|
148 | - $enddate = date('Y-m-d H:i:s',$enddate); |
|
144 | + $begindate = filter_input(INPUT_GET, 'begindate', FILTER_SANITIZE_NUMBER_INT); |
|
145 | + $enddate = filter_input(INPUT_GET, 'enddate', FILTER_SANITIZE_NUMBER_INT); |
|
146 | + $archivespeed = filter_input(INPUT_GET, 'speed', FILTER_SANITIZE_NUMBER_INT); |
|
147 | + $begindate = date('Y-m-d H:i:s', $begindate); |
|
148 | + $enddate = date('Y-m-d H:i:s', $enddate); |
|
149 | 149 | if ($tracker) { |
150 | - $spotter_array = $TrackerArchive->getMinLiveTrackerDataPlayback($begindate,$enddate,$filter); |
|
150 | + $spotter_array = $TrackerArchive->getMinLiveTrackerDataPlayback($begindate, $enddate, $filter); |
|
151 | 151 | } elseif ($marine) { |
152 | - $spotter_array = $MarineArchive->getMinLiveMarineDataPlayback($begindate,$enddate,$filter); |
|
152 | + $spotter_array = $MarineArchive->getMinLiveMarineDataPlayback($begindate, $enddate, $filter); |
|
153 | 153 | } else { |
154 | - $spotter_array = $SpotterArchive->getMinLiveSpotterDataPlayback($begindate,$enddate,$filter); |
|
154 | + $spotter_array = $SpotterArchive->getMinLiveSpotterDataPlayback($begindate, $enddate, $filter); |
|
155 | 155 | } |
156 | 156 | } elseif (isset($_COOKIE['archive']) && isset($_COOKIE['archive_begin']) && isset($_COOKIE['archive_end']) && isset($_COOKIE['archive_speed'])) { |
157 | 157 | $from_archive = true; |
@@ -168,36 +168,36 @@ discard block |
||
168 | 168 | } |
169 | 169 | $enddate = $_COOKIE['archive_end']; |
170 | 170 | $enddateinitial = $_COOKIE['archive_end']; |
171 | - $archivespeed = filter_var($_COOKIE['archive_speed'],FILTER_SANITIZE_NUMBER_INT); |
|
172 | - $begindate = date('Y-m-d H:i:s',$begindate); |
|
173 | - $enddate = date('Y-m-d H:i:s',$enddate); |
|
171 | + $archivespeed = filter_var($_COOKIE['archive_speed'], FILTER_SANITIZE_NUMBER_INT); |
|
172 | + $begindate = date('Y-m-d H:i:s', $begindate); |
|
173 | + $enddate = date('Y-m-d H:i:s', $enddate); |
|
174 | 174 | //echo 'Begin : '.$begindate.' - End : '.$enddate."\n"; |
175 | 175 | if ($tracker) { |
176 | - $spotter_array = $TrackerArchive->getMinLiveTrackerData($begindate,$enddate,$filter); |
|
176 | + $spotter_array = $TrackerArchive->getMinLiveTrackerData($begindate, $enddate, $filter); |
|
177 | 177 | } elseif ($marine) { |
178 | - $spotter_array = $MarineArchive->getMinLiveMarineData($begindate,$enddate,$filter); |
|
178 | + $spotter_array = $MarineArchive->getMinLiveMarineData($begindate, $enddate, $filter); |
|
179 | 179 | } else { |
180 | - $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate,$enddate,$filter); |
|
180 | + $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate, $enddate, $filter); |
|
181 | 181 | } |
182 | 182 | } elseif ($tracker) { |
183 | 183 | $coord = array(); |
184 | 184 | if (isset($_GET['coord']) && $_GET['coord'] != '') { |
185 | - $coord = explode(',',$_GET['coord']); |
|
186 | - if (!(filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT) |
|
185 | + $coord = explode(',', $_GET['coord']); |
|
186 | + if (!(filter_var($coord[0], FILTER_VALIDATE_FLOAT) && filter_var($coord[1], FILTER_VALIDATE_FLOAT) && filter_var($coord[2], FILTER_VALIDATE_FLOAT) && filter_var($coord[3], FILTER_VALIDATE_FLOAT) |
|
187 | 187 | && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) { |
188 | 188 | $coord = array(); |
189 | 189 | } |
190 | 190 | } |
191 | 191 | $previous_filter = $filter; |
192 | 192 | if ((isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') && (isset($_COOKIE['MapTrackTracker']) && $_COOKIE['MapTrackTracker'] != '')) { |
193 | - $filter = array_merge($filter,array('id' => $_COOKIE['MapTrackTracker'])); |
|
194 | - $spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord,$filter,true); |
|
193 | + $filter = array_merge($filter, array('id' => $_COOKIE['MapTrackTracker'])); |
|
194 | + $spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord, $filter, true); |
|
195 | 195 | /* |
196 | 196 | } elseif (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '' && !empty($coord)) { |
197 | 197 | $spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord,$filter,true,$_COOKIE['MapTrack']); |
198 | 198 | */ |
199 | 199 | } elseif (!isset($_COOKIE['singlemodel']) || $_COOKIE['singlemodel'] == 'false') { |
200 | - $spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord,$filter,true); |
|
200 | + $spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord, $filter, true); |
|
201 | 201 | } else { |
202 | 202 | $spotter_array = array(); |
203 | 203 | } |
@@ -205,22 +205,22 @@ discard block |
||
205 | 205 | } elseif ($marine) { |
206 | 206 | $coord = array(); |
207 | 207 | if (isset($_GET['coord']) && $_GET['coord'] != '') { |
208 | - $coord = explode(',',$_GET['coord']); |
|
209 | - if (!(filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT) |
|
208 | + $coord = explode(',', $_GET['coord']); |
|
209 | + if (!(filter_var($coord[0], FILTER_VALIDATE_FLOAT) && filter_var($coord[1], FILTER_VALIDATE_FLOAT) && filter_var($coord[2], FILTER_VALIDATE_FLOAT) && filter_var($coord[3], FILTER_VALIDATE_FLOAT) |
|
210 | 210 | && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) { |
211 | 211 | $coord = array(); |
212 | 212 | } |
213 | 213 | } |
214 | 214 | $previous_filter = $filter; |
215 | 215 | if ((isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') && (isset($_COOKIE['MapTrackMarine']) && $_COOKIE['MapTrackMarine'] != '')) { |
216 | - $filter = array_merge($filter,array('id' => $_COOKIE['MapTrackMarine'])); |
|
217 | - $spotter_array = $MarineLive->getMinLastLiveMarineData($coord,$filter,true); |
|
216 | + $filter = array_merge($filter, array('id' => $_COOKIE['MapTrackMarine'])); |
|
217 | + $spotter_array = $MarineLive->getMinLastLiveMarineData($coord, $filter, true); |
|
218 | 218 | /* |
219 | 219 | } elseif (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '' && !empty($coord)) { |
220 | 220 | $spotter_array = $MarineLive->getMinLastLiveMarineData($coord,$filter,true,$_COOKIE['MapTrack']); |
221 | 221 | */ |
222 | 222 | } elseif (!isset($_COOKIE['singlemodel']) || $_COOKIE['singlemodel'] == 'false') { |
223 | - $spotter_array = $MarineLive->getMinLastLiveMarineData($coord,$filter,true); |
|
223 | + $spotter_array = $MarineLive->getMinLastLiveMarineData($coord, $filter, true); |
|
224 | 224 | } else { |
225 | 225 | $spotter_array = array(); |
226 | 226 | } |
@@ -228,20 +228,20 @@ discard block |
||
228 | 228 | } else { |
229 | 229 | $coord = array(); |
230 | 230 | if (!((isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') && (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '')) && isset($_GET['coord']) && $_GET['coord'] != '') { |
231 | - $coord = explode(',',$_GET['coord']); |
|
232 | - if (!(filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT) |
|
231 | + $coord = explode(',', $_GET['coord']); |
|
232 | + if (!(filter_var($coord[0], FILTER_VALIDATE_FLOAT) && filter_var($coord[1], FILTER_VALIDATE_FLOAT) && filter_var($coord[2], FILTER_VALIDATE_FLOAT) && filter_var($coord[3], FILTER_VALIDATE_FLOAT) |
|
233 | 233 | && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) { |
234 | 234 | $coord = array(); |
235 | 235 | } |
236 | 236 | } |
237 | 237 | $previous_filter = $filter; |
238 | 238 | if ((isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') && (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '')) { |
239 | - $filter = array_merge($filter,array('id' => $_COOKIE['MapTrack'])); |
|
240 | - $spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord,$filter,true); |
|
239 | + $filter = array_merge($filter, array('id' => $_COOKIE['MapTrack'])); |
|
240 | + $spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord, $filter, true); |
|
241 | 241 | } elseif (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '' && !empty($coord)) { |
242 | - $spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord,$filter,true,$_COOKIE['MapTrack']); |
|
242 | + $spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord, $filter, true, $_COOKIE['MapTrack']); |
|
243 | 243 | } elseif (!isset($_COOKIE['singlemodel']) || $_COOKIE['singlemodel'] == 'false') { |
244 | - $spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord,$filter,true); |
|
244 | + $spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord, $filter, true); |
|
245 | 245 | } else { |
246 | 246 | $spotter_array = array(); |
247 | 247 | } |
@@ -251,19 +251,19 @@ discard block |
||
251 | 251 | if (!empty($spotter_array) && isset($coord)) { |
252 | 252 | if ($tracker) { |
253 | 253 | if (isset($_GET['archive'])) { |
254 | - $flightcnt = $TrackerArchive->getLiveTrackerCount($begindate,$enddate,$filter); |
|
254 | + $flightcnt = $TrackerArchive->getLiveTrackerCount($begindate, $enddate, $filter); |
|
255 | 255 | } else { |
256 | 256 | $flightcnt = $TrackerLive->getLiveTrackerCount($filter); |
257 | 257 | } |
258 | 258 | } elseif ($marine) { |
259 | 259 | if (isset($_GET['archive'])) { |
260 | - $flightcnt = $MarineArchive->getLiveMarineCount($begindate,$enddate,$filter); |
|
260 | + $flightcnt = $MarineArchive->getLiveMarineCount($begindate, $enddate, $filter); |
|
261 | 261 | } else { |
262 | 262 | $flightcnt = $MarineLive->getLiveMarineCount($filter); |
263 | 263 | } |
264 | 264 | } else { |
265 | 265 | if (isset($_GET['archive'])) { |
266 | - $flightcnt = $SpotterArchive->getLiveSpotterCount($begindate,$enddate,$filter); |
|
266 | + $flightcnt = $SpotterArchive->getLiveSpotterCount($begindate, $enddate, $filter); |
|
267 | 267 | } else { |
268 | 268 | $flightcnt = $SpotterLive->getLiveSpotterCount($filter); |
269 | 269 | } |
@@ -271,17 +271,17 @@ discard block |
||
271 | 271 | if ($flightcnt == '') $flightcnt = 0; |
272 | 272 | } else $flightcnt = 0; |
273 | 273 | |
274 | -$sqltime = round(microtime(true)-$begintime,2); |
|
274 | +$sqltime = round(microtime(true) - $begintime, 2); |
|
275 | 275 | $minitime = time(); |
276 | 276 | $minitracktime_begin = time(); |
277 | 277 | $minitracktime = $minitracktime_begin; |
278 | 278 | $maxitime = 0; |
279 | -$lastupdate = filter_input(INPUT_GET,'update',FILTER_SANITIZE_NUMBER_INT); |
|
279 | +$lastupdate = filter_input(INPUT_GET, 'update', FILTER_SANITIZE_NUMBER_INT); |
|
280 | 280 | $modelsdb = array(); |
281 | 281 | if (file_exists(dirname(__FILE__).'/models/modelsdb')) { |
282 | - if (($handle = fopen(dirname(__FILE__).'/models/modelsdb','r')) !== FALSE) { |
|
283 | - while (($row = fgetcsv($handle,1000)) !== FALSE) { |
|
284 | - if (isset($row[1]) ){ |
|
282 | + if (($handle = fopen(dirname(__FILE__).'/models/modelsdb', 'r')) !== FALSE) { |
|
283 | + while (($row = fgetcsv($handle, 1000)) !== FALSE) { |
|
284 | + if (isset($row[1])) { |
|
285 | 285 | $model = $row[0]; |
286 | 286 | $modelsdb[$model] = $row[1]; |
287 | 287 | } |
@@ -291,9 +291,9 @@ discard block |
||
291 | 291 | } |
292 | 292 | $modelsdb2 = array(); |
293 | 293 | if (file_exists(dirname(__FILE__).'/models/gltf2/modelsdb')) { |
294 | - if (($handle = fopen(dirname(__FILE__).'/models/gltf2/modelsdb','r')) !== FALSE) { |
|
295 | - while (($row = fgetcsv($handle,1000)) !== FALSE) { |
|
296 | - if (isset($row[1]) ){ |
|
294 | + if (($handle = fopen(dirname(__FILE__).'/models/gltf2/modelsdb', 'r')) !== FALSE) { |
|
295 | + while (($row = fgetcsv($handle, 1000)) !== FALSE) { |
|
296 | + if (isset($row[1])) { |
|
297 | 297 | $model = $row[0]; |
298 | 298 | $glb = $row[1]; |
299 | 299 | if (isset($row[2])) { |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | if (!empty($spotter_array) && is_array($spotter_array)) |
340 | 340 | { |
341 | 341 | $nblatlong = 0; |
342 | - foreach($spotter_array as $spotter_item) |
|
342 | + foreach ($spotter_array as $spotter_item) |
|
343 | 343 | { |
344 | 344 | $j++; |
345 | 345 | //if (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'airwhere') $heightrelative = 'RELATIVE_TO_GROUND'; |
@@ -393,13 +393,13 @@ discard block |
||
393 | 393 | } |
394 | 394 | if (isset($spotter_item['registration'])) $output .= '"registration": "'.$spotter_item['registration'].'",'; |
395 | 395 | if (isset($spotter_item['format_source'])) $output .= '"format": "'.$spotter_item['format_source'].'",'; |
396 | - if (isset($spotter_item['ident'])) $output.= '"ident": "'.$spotter_item['ident'].'",'; |
|
396 | + if (isset($spotter_item['ident'])) $output .= '"ident": "'.$spotter_item['ident'].'",'; |
|
397 | 397 | if ($tracker) { |
398 | 398 | if (isset($spotter_item['type'])) $output .= '"tracker_type": "'.$spotter_item['type'].'",'; |
399 | - $output.= '"type": "tracker"'; |
|
399 | + $output .= '"type": "tracker"'; |
|
400 | 400 | } elseif ($marine) { |
401 | 401 | if (isset($spotter_item['type'])) $output .= '"marine_type": "'.$spotter_item['type'].'",'; |
402 | - $output.= '"type": "marine"'; |
|
402 | + $output .= '"type": "marine"'; |
|
403 | 403 | } else { |
404 | 404 | if ($one3dmodel === false && isset($globalMap3DLiveries) && $globalMap3DLiveries) { |
405 | 405 | $aircraft_icao = $spotter_item['aircraft_icao']; |
@@ -413,14 +413,14 @@ discard block |
||
413 | 413 | if (isset($airline_icao)) { |
414 | 414 | $imagefile = $aircraft_icao.'-'.$airline_icao.'.png'; |
415 | 415 | if (file_exists(dirname(__FILE__).'/models/gltf2/liveries/'.$imagefile)) { |
416 | - $output.= '"liveries": "'.$globalURL.'/models/gltf2/liveries/'.$imagefile.'",'; |
|
416 | + $output .= '"liveries": "'.$globalURL.'/models/gltf2/liveries/'.$imagefile.'",'; |
|
417 | 417 | } |
418 | 418 | } |
419 | 419 | } |
420 | 420 | //if ($ident != '') $output.= '"ident": "'.$ident.'",'; |
421 | 421 | } |
422 | - $output.= '"gltf2": %gltf2%,'; |
|
423 | - $output.= '"type": "flight"'; |
|
422 | + $output .= '"gltf2": %gltf2%,'; |
|
423 | + $output .= '"type": "flight"'; |
|
424 | 424 | } |
425 | 425 | $output .= '},'; |
426 | 426 | |
@@ -791,8 +791,8 @@ discard block |
||
791 | 791 | $output .= '},'; |
792 | 792 | } |
793 | 793 | } |
794 | - if (isset($onground) && $onground) $output = str_replace('%onground%','true',$output); |
|
795 | - else $output = str_replace('%onground%','false',$output); |
|
794 | + if (isset($onground) && $onground) $output = str_replace('%onground%', 'true', $output); |
|
795 | + else $output = str_replace('%onground%', 'false', $output); |
|
796 | 796 | |
797 | 797 | // $output .= '"heightReference": "CLAMP_TO_GROUND",'; |
798 | 798 | //$output .= '"heightReference": "'.$heightrelative.'",'; |
@@ -808,7 +808,7 @@ discard block |
||
808 | 808 | if ($minitime > strtotime($spotter_item['date'])) $minitime = strtotime($spotter_item['date']); |
809 | 809 | if (isset($_COOKIE['MapTrack']) && $id == $_COOKIE['MapTrack'] && $minitracktime > strtotime($spotter_item['date'])) $minitracktime = strtotime($spotter_item['date']); |
810 | 810 | if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']); |
811 | - $output .= '"'.date("c",strtotime($spotter_item['date'])).'", '; |
|
811 | + $output .= '"'.date("c", strtotime($spotter_item['date'])).'", '; |
|
812 | 812 | $output .= $spotter_item['longitude'].', '; |
813 | 813 | $output .= $spotter_item['latitude']; |
814 | 814 | $prevlong = $spotter_item['longitude']; |
@@ -836,8 +836,8 @@ discard block |
||
836 | 836 | //$quat = quaternionrotate(deg2rad($spotter_item['heading']),deg2rad(0),deg2rad(0)); |
837 | 837 | //$orientation .= '"'.date("c",strtotime($spotter_item['date'])).'",'.$quat['x'].','.$quat['y'].','.$quat['z'].','.$quat['w']; |
838 | 838 | } else { |
839 | - $nblatlong = $nblatlong+1; |
|
840 | - $output .= ',"'.date("c",strtotime($spotter_item['date'])).'", '; |
|
839 | + $nblatlong = $nblatlong + 1; |
|
840 | + $output .= ',"'.date("c", strtotime($spotter_item['date'])).'", '; |
|
841 | 841 | if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']); |
842 | 842 | if ($spotter_item['ground_speed'] == 0) { |
843 | 843 | $output .= $prevlong.', '; |
@@ -878,26 +878,26 @@ discard block |
||
878 | 878 | $output .= ']'; |
879 | 879 | if (isset($globalArchive) && $globalArchive === TRUE) { |
880 | 880 | if (isset($begindateinitial)) { |
881 | - $output = str_replace('%minitime%',date("c",$begindateinitial),$output); |
|
882 | - } elseif ((time()-$globalLiveInterval) > $minitime) { |
|
883 | - if (time()-$globalLiveInterval > $maxitime) { |
|
884 | - $output = str_replace('%minitime%',date("c",$maxitime),$output); |
|
881 | + $output = str_replace('%minitime%', date("c", $begindateinitial), $output); |
|
882 | + } elseif ((time() - $globalLiveInterval) > $minitime) { |
|
883 | + if (time() - $globalLiveInterval > $maxitime) { |
|
884 | + $output = str_replace('%minitime%', date("c", $maxitime), $output); |
|
885 | 885 | } else { |
886 | - $output = str_replace('%minitime%',date("c",time()-$globalLiveInterval),$output); |
|
886 | + $output = str_replace('%minitime%', date("c", time() - $globalLiveInterval), $output); |
|
887 | 887 | } |
888 | 888 | } |
889 | - else $output = str_replace('%minitime%',date("c",$minitime),$output); |
|
889 | + else $output = str_replace('%minitime%', date("c", $minitime), $output); |
|
890 | 890 | } elseif (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '' && $minitracktime != $minitracktime_begin) { |
891 | - $output = str_replace('%minitime%',date("c",$minitracktime),$output); |
|
891 | + $output = str_replace('%minitime%', date("c", $minitracktime), $output); |
|
892 | 892 | } else { |
893 | - $output = str_replace('%minitime%',date("c",$minitime),$output); |
|
893 | + $output = str_replace('%minitime%', date("c", $minitime), $output); |
|
894 | 894 | } |
895 | 895 | if (isset($enddateinitial)) { |
896 | - $output = str_replace('%maxitime%',date("c",$enddateinitial),$output); |
|
896 | + $output = str_replace('%maxitime%', date("c", $enddateinitial), $output); |
|
897 | 897 | } else { |
898 | - $output = str_replace('%maxitime%',date("c",$maxitime),$output); |
|
898 | + $output = str_replace('%maxitime%', date("c", $maxitime), $output); |
|
899 | 899 | } |
900 | -if ($gltf2) $output = str_replace('%gltf2%','true',$output); |
|
901 | -else $output = str_replace('%gltf2%','false',$output); |
|
900 | +if ($gltf2) $output = str_replace('%gltf2%', 'true', $output); |
|
901 | +else $output = str_replace('%gltf2%', 'false', $output); |
|
902 | 902 | print $output; |
903 | 903 | ?> |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | // This script can be slow... |
3 | 3 | set_time_limit(0); |
4 | -ini_set('max_execution_time',6000); |
|
4 | +ini_set('max_execution_time', 6000); |
|
5 | 5 | require_once('require/class.Connection.php'); |
6 | 6 | require_once('require/class.Common.php'); |
7 | 7 | |
@@ -63,24 +63,24 @@ discard block |
||
63 | 63 | $min = false; |
64 | 64 | $allhistory = false; |
65 | 65 | $filter['source'] = array(); |
66 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
67 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
68 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
69 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs')); |
|
70 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
71 | -if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
72 | -if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING); |
|
73 | -if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
74 | -if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
75 | -if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
76 | -if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING); |
|
66 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'], array('vatsimtxt')); |
|
67 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'], array('whazzup')); |
|
68 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'], array('phpvmacars')); |
|
69 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'], array('sbs', 'famaprs')); |
|
70 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'], array('aprs')); |
|
71 | +if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'], FILTER_SANITIZE_STRING); |
|
72 | +if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'], FILTER_SANITIZE_STRING); |
|
73 | +if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',', $_COOKIE['filter_Airlines']), FILTER_SANITIZE_STRING); |
|
74 | +if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',', $_COOKIE['filter_Sources']), FILTER_SANITIZE_STRING); |
|
75 | +if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'], FILTER_SANITIZE_STRING); |
|
76 | +if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'], FILTER_SANITIZE_STRING); |
|
77 | 77 | |
78 | 78 | if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) { |
79 | 79 | $min = true; |
80 | 80 | } else $min = false; |
81 | 81 | |
82 | 82 | if (isset($_GET['ident'])) { |
83 | - $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
|
83 | + $ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING); |
|
84 | 84 | $from_archive = true; |
85 | 85 | if ($tracker) { |
86 | 86 | $spotter_array = $TrackerArchive->getLastArchiveTrackerDataByIdent($ident); |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | $allhistory = true; |
95 | 95 | } |
96 | 96 | elseif (isset($_GET['flightaware_id'])) { |
97 | - $flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING); |
|
97 | + $flightaware_id = filter_input(INPUT_GET, 'flightaware_id', FILTER_SANITIZE_STRING); |
|
98 | 98 | $from_archive = true; |
99 | 99 | if ($tracker) { |
100 | 100 | $spotter_array = $TrackerArchive->getLastArchiveTrackerDataById($flightaware_id); |
@@ -109,26 +109,26 @@ discard block |
||
109 | 109 | } |
110 | 110 | elseif (isset($_GET['archive']) && isset($_GET['begindate']) && isset($_GET['enddate']) && isset($_GET['speed'])) { |
111 | 111 | $from_archive = true; |
112 | - $begindate = filter_input(INPUT_GET,'begindate',FILTER_SANITIZE_NUMBER_INT); |
|
112 | + $begindate = filter_input(INPUT_GET, 'begindate', FILTER_SANITIZE_NUMBER_INT); |
|
113 | 113 | if (isset($globalAircraftMaxUpdate)) $begindate = $begindate - $globalAircraftMaxUpdate; |
114 | 114 | else $begindate = $begindate - 3000; |
115 | - $enddate = filter_input(INPUT_GET,'enddate',FILTER_SANITIZE_NUMBER_INT); |
|
116 | - $archivespeed = filter_input(INPUT_GET,'speed',FILTER_SANITIZE_NUMBER_INT); |
|
117 | - $part = filter_input(INPUT_GET,'part',FILTER_SANITIZE_NUMBER_INT); |
|
115 | + $enddate = filter_input(INPUT_GET, 'enddate', FILTER_SANITIZE_NUMBER_INT); |
|
116 | + $archivespeed = filter_input(INPUT_GET, 'speed', FILTER_SANITIZE_NUMBER_INT); |
|
117 | + $part = filter_input(INPUT_GET, 'part', FILTER_SANITIZE_NUMBER_INT); |
|
118 | 118 | if ($part == '') $part = 0; |
119 | 119 | |
120 | 120 | if ($begindate != '' && $enddate != '') { |
121 | - $begindate = date('Y-m-d H:i:s',$begindate); |
|
122 | - $enddate = date('Y-m-d H:i:s',$enddate); |
|
121 | + $begindate = date('Y-m-d H:i:s', $begindate); |
|
122 | + $enddate = date('Y-m-d H:i:s', $enddate); |
|
123 | 123 | //$spotter_array = $SpotterArchive->getMinLiveSpotterDataPlayback($begindate,$enddate,$filter); |
124 | 124 | if ($tracker) { |
125 | - $spotter_array = $TrackerArchive->getMinLiveTrackerData($begindate,$enddate,$filter); |
|
125 | + $spotter_array = $TrackerArchive->getMinLiveTrackerData($begindate, $enddate, $filter); |
|
126 | 126 | } |
127 | 127 | elseif ($marine) { |
128 | - $spotter_array = $MarineArchive->getMinLiveMarineData($begindate,$enddate,$filter); |
|
128 | + $spotter_array = $MarineArchive->getMinLiveMarineData($begindate, $enddate, $filter); |
|
129 | 129 | } |
130 | 130 | else { |
131 | - $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate,$enddate,$filter,$part); |
|
131 | + $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate, $enddate, $filter, $part); |
|
132 | 132 | } |
133 | 133 | } |
134 | 134 | } |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | if ($flightcnt == '') $flightcnt = 0; |
140 | 140 | } else $flightcnt = 0; |
141 | 141 | |
142 | -$sqltime = round(microtime(true)-$begintime,2); |
|
142 | +$sqltime = round(microtime(true) - $begintime, 2); |
|
143 | 143 | |
144 | 144 | $pfi = ''; |
145 | 145 | //var_dump($spotter_array); |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | $begin = true; |
155 | 155 | if (!empty($spotter_array) && is_array($spotter_array)) { |
156 | 156 | $output .= '"features": ['; |
157 | - foreach($spotter_array as $spotter_item) { |
|
157 | + foreach ($spotter_array as $spotter_item) { |
|
158 | 158 | $j++; |
159 | 159 | date_default_timezone_set('UTC'); |
160 | 160 | if ($tracker) { |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | if ($begin) { |
179 | 179 | if ($j > 1) { |
180 | 180 | if (isset($output_time)) { |
181 | - $output_time = substr($output_time, 0, -1); |
|
181 | + $output_time = substr($output_time, 0, -1); |
|
182 | 182 | $output .= '"time": ['.$output_time.']'; |
183 | 183 | } |
184 | 184 | $output .= '},'; |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | $output .= '"type": "LineString",'; |
188 | 188 | $output .= '"coordinates": ['; |
189 | 189 | if (isset($output_history)) { |
190 | - $output_history = substr($output_history, 0, -1); |
|
190 | + $output_history = substr($output_history, 0, -1); |
|
191 | 191 | $output .= $output_history; |
192 | 192 | } |
193 | 193 | $output .= ']}},'; |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | $output .= '"fi": "'.$pfi.'",'; |
219 | 219 | if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",'; |
220 | 220 | if (isset($spotter_item['ident']) && $spotter_item['ident'] != '') { |
221 | - $output .= '"c": "'.str_replace('\\','',$spotter_item['ident']).'",'; |
|
221 | + $output .= '"c": "'.str_replace('\\', '', $spotter_item['ident']).'",'; |
|
222 | 222 | //" |
223 | 223 | } else { |
224 | 224 | $output .= '"c": "NA",'; |
@@ -352,7 +352,7 @@ discard block |
||
352 | 352 | |
353 | 353 | if ($j > 1) { |
354 | 354 | if (isset($output_time)) { |
355 | - $output_time = substr($output_time, 0, -1); |
|
355 | + $output_time = substr($output_time, 0, -1); |
|
356 | 356 | $output .= '"time": ['.$output_time.']'; |
357 | 357 | } |
358 | 358 | $output .= '},'; |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | $output .= '"type": "LineString",'; |
362 | 362 | $output .= '"coordinates": ['; |
363 | 363 | if (isset($output_history)) { |
364 | - $output_history = substr($output_history, 0, -1); |
|
364 | + $output_history = substr($output_history, 0, -1); |
|
365 | 365 | $output .= $output_history; |
366 | 366 | } |
367 | 367 | $output .= ']'; |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | $output = substr($output, 0, -1); |
373 | 373 | $output .= ']'; |
374 | 374 | $output .= ',"initial_sqltime": "'.$sqltime.'",'; |
375 | - $output .= '"totaltime": "'.round(microtime(true)-$begintime,2).'",'; |
|
375 | + $output .= '"totaltime": "'.round(microtime(true) - $begintime, 2).'",'; |
|
376 | 376 | if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",'; |
377 | 377 | $output .= '"fc": "'.$flightcnt.'"'; |
378 | 378 | } else { |
@@ -25,12 +25,10 @@ discard block |
||
25 | 25 | if ($tracker) { |
26 | 26 | require_once('require/class.Tracker.php'); |
27 | 27 | require_once('require/class.TrackerArchive.php'); |
28 | -} |
|
29 | -elseif ($marine) { |
|
28 | +} elseif ($marine) { |
|
30 | 29 | require_once('require/class.Marine.php'); |
31 | 30 | require_once('require/class.MarineArchive.php'); |
32 | -} |
|
33 | -else { |
|
31 | +} else { |
|
34 | 32 | require_once('require/class.Spotter.php'); |
35 | 33 | require_once('require/class.SpotterArchive.php'); |
36 | 34 | } |
@@ -38,12 +36,10 @@ discard block |
||
38 | 36 | if ($tracker) { |
39 | 37 | $Tracker = new Tracker(); |
40 | 38 | $TrackerArchive = new TrackerArchive(); |
41 | -} |
|
42 | -elseif ($marine) { |
|
39 | +} elseif ($marine) { |
|
43 | 40 | $Marine = new Marine(); |
44 | 41 | $MarineArchive = new MarineArchive(); |
45 | -} |
|
46 | -else { |
|
42 | +} else { |
|
47 | 43 | $Spotter = new Spotter(); |
48 | 44 | $SpotterArchive = new SpotterArchive(); |
49 | 45 | } |
@@ -56,66 +52,92 @@ discard block |
||
56 | 52 | } |
57 | 53 | header('Content-Type: text/javascript'); |
58 | 54 | |
59 | -if (!isset($globalJsonCompress)) $compress = true; |
|
60 | -else $compress = $globalJsonCompress; |
|
55 | +if (!isset($globalJsonCompress)) { |
|
56 | + $compress = true; |
|
57 | +} else { |
|
58 | + $compress = $globalJsonCompress; |
|
59 | +} |
|
61 | 60 | |
62 | 61 | $from_archive = false; |
63 | 62 | $min = false; |
64 | 63 | $allhistory = false; |
65 | 64 | $filter['source'] = array(); |
66 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
67 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
68 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
69 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs')); |
|
70 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
71 | -if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
72 | -if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING); |
|
73 | -if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
74 | -if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
75 | -if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
76 | -if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING); |
|
65 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') { |
|
66 | + $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
67 | +} |
|
68 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') { |
|
69 | + $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
70 | +} |
|
71 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') { |
|
72 | + $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
73 | +} |
|
74 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') { |
|
75 | + $filter['source'] = array_merge($filter['source'],array('sbs','famaprs')); |
|
76 | +} |
|
77 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') { |
|
78 | + $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
79 | +} |
|
80 | +if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') { |
|
81 | + $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
82 | +} |
|
83 | +if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') { |
|
84 | + $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING); |
|
85 | +} |
|
86 | +if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') { |
|
87 | + $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
88 | +} |
|
89 | +if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') { |
|
90 | + $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
91 | +} |
|
92 | +if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') { |
|
93 | + $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
94 | +} |
|
95 | +if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') { |
|
96 | + $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING); |
|
97 | +} |
|
77 | 98 | |
78 | 99 | if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) { |
79 | 100 | $min = true; |
80 | -} else $min = false; |
|
101 | +} else { |
|
102 | + $min = false; |
|
103 | +} |
|
81 | 104 | |
82 | 105 | if (isset($_GET['ident'])) { |
83 | 106 | $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
84 | 107 | $from_archive = true; |
85 | 108 | if ($tracker) { |
86 | 109 | $spotter_array = $TrackerArchive->getLastArchiveTrackerDataByIdent($ident); |
87 | - } |
|
88 | - elseif ($marine) { |
|
110 | + } elseif ($marine) { |
|
89 | 111 | $spotter_array = $MarineArchive->getLastArchiveMarineDataByIdent($ident); |
90 | - } |
|
91 | - else { |
|
112 | + } else { |
|
92 | 113 | $spotter_array = $SpotterArchive->getLastArchiveSpotterDataByIdent($ident); |
93 | 114 | } |
94 | 115 | $allhistory = true; |
95 | -} |
|
96 | -elseif (isset($_GET['flightaware_id'])) { |
|
116 | +} elseif (isset($_GET['flightaware_id'])) { |
|
97 | 117 | $flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING); |
98 | 118 | $from_archive = true; |
99 | 119 | if ($tracker) { |
100 | 120 | $spotter_array = $TrackerArchive->getLastArchiveTrackerDataById($flightaware_id); |
101 | - } |
|
102 | - elseif ($marine) { |
|
121 | + } elseif ($marine) { |
|
103 | 122 | $spotter_array = $MarineArchive->getLastArchiveMarineDataById($flightaware_id); |
104 | - } |
|
105 | - else { |
|
123 | + } else { |
|
106 | 124 | $spotter_array = $SpotterArchive->getLastArchiveSpotterDataById($flightaware_id); |
107 | 125 | } |
108 | 126 | $allhistory = true; |
109 | -} |
|
110 | -elseif (isset($_GET['archive']) && isset($_GET['begindate']) && isset($_GET['enddate']) && isset($_GET['speed'])) { |
|
127 | +} elseif (isset($_GET['archive']) && isset($_GET['begindate']) && isset($_GET['enddate']) && isset($_GET['speed'])) { |
|
111 | 128 | $from_archive = true; |
112 | 129 | $begindate = filter_input(INPUT_GET,'begindate',FILTER_SANITIZE_NUMBER_INT); |
113 | - if (isset($globalAircraftMaxUpdate)) $begindate = $begindate - $globalAircraftMaxUpdate; |
|
114 | - else $begindate = $begindate - 3000; |
|
130 | + if (isset($globalAircraftMaxUpdate)) { |
|
131 | + $begindate = $begindate - $globalAircraftMaxUpdate; |
|
132 | + } else { |
|
133 | + $begindate = $begindate - 3000; |
|
134 | + } |
|
115 | 135 | $enddate = filter_input(INPUT_GET,'enddate',FILTER_SANITIZE_NUMBER_INT); |
116 | 136 | $archivespeed = filter_input(INPUT_GET,'speed',FILTER_SANITIZE_NUMBER_INT); |
117 | 137 | $part = filter_input(INPUT_GET,'part',FILTER_SANITIZE_NUMBER_INT); |
118 | - if ($part == '') $part = 0; |
|
138 | + if ($part == '') { |
|
139 | + $part = 0; |
|
140 | + } |
|
119 | 141 | |
120 | 142 | if ($begindate != '' && $enddate != '') { |
121 | 143 | $begindate = date('Y-m-d H:i:s',$begindate); |
@@ -123,11 +145,9 @@ discard block |
||
123 | 145 | //$spotter_array = $SpotterArchive->getMinLiveSpotterDataPlayback($begindate,$enddate,$filter); |
124 | 146 | if ($tracker) { |
125 | 147 | $spotter_array = $TrackerArchive->getMinLiveTrackerData($begindate,$enddate,$filter); |
126 | - } |
|
127 | - elseif ($marine) { |
|
148 | + } elseif ($marine) { |
|
128 | 149 | $spotter_array = $MarineArchive->getMinLiveMarineData($begindate,$enddate,$filter); |
129 | - } |
|
130 | - else { |
|
150 | + } else { |
|
131 | 151 | $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate,$enddate,$filter,$part); |
132 | 152 | } |
133 | 153 | } |
@@ -136,8 +156,12 @@ discard block |
||
136 | 156 | if (!empty($spotter_array)) { |
137 | 157 | //$flightcnt = $SpotterArchive->getLiveSpotterCount($begindate,$enddate,$filter); |
138 | 158 | $flightcnt = 0; |
139 | - if ($flightcnt == '') $flightcnt = 0; |
|
140 | -} else $flightcnt = 0; |
|
159 | + if ($flightcnt == '') { |
|
160 | + $flightcnt = 0; |
|
161 | + } |
|
162 | + } else { |
|
163 | + $flightcnt = 0; |
|
164 | +} |
|
141 | 165 | |
142 | 166 | $sqltime = round(microtime(true)-$begintime,2); |
143 | 167 | |
@@ -147,8 +171,11 @@ discard block |
||
147 | 171 | $aircrafts_shadow = array(); |
148 | 172 | $output = '{'; |
149 | 173 | $output .= '"type": "FeatureCollection",'; |
150 | -if ($min) $output .= '"minimal": "true",'; |
|
151 | -else $output .= '"minimal": "false",'; |
|
174 | +if ($min) { |
|
175 | + $output .= '"minimal": "true",'; |
|
176 | +} else { |
|
177 | + $output .= '"minimal": "false",'; |
|
178 | +} |
|
152 | 179 | $output .= '"fc": "'.$flightcnt.'",'; |
153 | 180 | $output .= '"sqt": "'.$sqltime.'",'; |
154 | 181 | $begin = true; |
@@ -161,15 +188,17 @@ discard block |
||
161 | 188 | if ($pfi != $spotter_item['famtrackid']) { |
162 | 189 | $pfi = $spotter_item['famtrackid']; |
163 | 190 | $begin = true; |
164 | - } else $spotter_history_array = 0; |
|
165 | - } |
|
166 | - elseif ($marine) { |
|
191 | + } else { |
|
192 | + $spotter_history_array = 0; |
|
193 | + } |
|
194 | + } elseif ($marine) { |
|
167 | 195 | if ($pfi != $spotter_item['fammarine_d']) { |
168 | 196 | $pfi = $spotter_item['fammarine_id']; |
169 | 197 | $begin = true; |
170 | - } else $spotter_history_array = 0; |
|
171 | - } |
|
172 | - else { |
|
198 | + } else { |
|
199 | + $spotter_history_array = 0; |
|
200 | + } |
|
201 | + } else { |
|
173 | 202 | if ($pfi != $spotter_item['flightaware_id']) { |
174 | 203 | $pfi = $spotter_item['flightaware_id']; |
175 | 204 | $begin = true; |
@@ -206,7 +235,9 @@ discard block |
||
206 | 235 | $output_history .= '['.$spotter_item['longitude'].', '.$spotter_item['latitude'].'],'; |
207 | 236 | $output_time .= (strtotime($spotter_item['date'])*1000).','; |
208 | 237 | $previousts = strtotime($spotter_item['date']); |
209 | - if ($k > 1 && (strtotime($spotter_item['date'])*1000 > $enddate)) $end = true; |
|
238 | + if ($k > 1 && (strtotime($spotter_item['date'])*1000 > $enddate)) { |
|
239 | + $end = true; |
|
240 | + } |
|
210 | 241 | } |
211 | 242 | |
212 | 243 | if ($begin) { |
@@ -216,7 +247,9 @@ discard block |
||
216 | 247 | $output .= '"type": "Feature",'; |
217 | 248 | $output .= '"properties": {'; |
218 | 249 | $output .= '"fi": "'.$pfi.'",'; |
219 | - if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",'; |
|
250 | + if (isset($begindate)) { |
|
251 | + $output .= '"archive_date": "'.$begindate.'",'; |
|
252 | + } |
|
220 | 253 | if (isset($spotter_item['ident']) && $spotter_item['ident'] != '') { |
221 | 254 | $output .= '"c": "'.str_replace('\\','',$spotter_item['ident']).'",'; |
222 | 255 | //" |
@@ -224,14 +257,20 @@ discard block |
||
224 | 257 | $output .= '"c": "NA",'; |
225 | 258 | } |
226 | 259 | if (!isset($spotter_item['aircraft_shadow']) && !$tracker && !$marine) { |
227 | - if (!isset($spotter_item['aircraft_icao']) || $spotter_item['aircraft_icao'] == '') $spotter_item['aircraft_shadow'] = ''; |
|
228 | - else { |
|
260 | + if (!isset($spotter_item['aircraft_icao']) || $spotter_item['aircraft_icao'] == '') { |
|
261 | + $spotter_item['aircraft_shadow'] = ''; |
|
262 | + } else { |
|
229 | 263 | $aircraft_icao = $spotter_item['aircraft_icao']; |
230 | 264 | $aircraft_info = $Spotter->getAllAircraftInfo($spotter_item['aircraft_icao']); |
231 | - if (count($aircraft_info) > 0) $spotter_item['aircraft_shadow'] = $aircraft_info[0]['aircraft_shadow']; |
|
232 | - elseif (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'aprs') $spotter_item['aircraft_shadow'] = 'PA18.png'; |
|
233 | - elseif ($aircraft_icao == 'PARAGLIDER') $spotter_item['aircraft_shadow'] = 'PARAGLIDER.png'; |
|
234 | - else $spotter_item['aircraft_shadow'] = ''; |
|
265 | + if (count($aircraft_info) > 0) { |
|
266 | + $spotter_item['aircraft_shadow'] = $aircraft_info[0]['aircraft_shadow']; |
|
267 | + } elseif (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'aprs') { |
|
268 | + $spotter_item['aircraft_shadow'] = 'PA18.png'; |
|
269 | + } elseif ($aircraft_icao == 'PARAGLIDER') { |
|
270 | + $spotter_item['aircraft_shadow'] = 'PARAGLIDER.png'; |
|
271 | + } else { |
|
272 | + $spotter_item['aircraft_shadow'] = ''; |
|
273 | + } |
|
235 | 274 | $aircrafts_shadow[$aircraft_icao] = $spotter_item['aircraft_shadow']; |
236 | 275 | } |
237 | 276 | } |
@@ -239,93 +278,139 @@ discard block |
||
239 | 278 | if (!isset($spotter_item['aircraft_shadow']) || $spotter_item['aircraft_shadow'] == '') { |
240 | 279 | if ($tracker) { |
241 | 280 | if (isset($spotter_item['type']) && $spotter_item['type'] == 'Ambulance') { |
242 | - if ($compress) $output .= '"as": "ambulance.png",'; |
|
243 | - else $output .= '"aircraft_shadow": "ambulance.png",'; |
|
244 | - } |
|
245 | - elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Police') { |
|
246 | - if ($compress) $output .= '"as": "police.png",'; |
|
247 | - else $output .= '"aircraft_shadow": "police.png",'; |
|
248 | - } |
|
249 | - elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Yacht (Sail)') { |
|
250 | - if ($compress) $output .= '"as": "ship.png",'; |
|
251 | - else $output .= '"aircraft_shadow": "ship.png",'; |
|
252 | - } |
|
253 | - elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Ship (Power Boat)') { |
|
254 | - if ($compress) $output .= '"as": "ship.png",'; |
|
255 | - else $output .= '"aircraft_shadow": "ship.png",'; |
|
256 | - } |
|
257 | - elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Shuttle') { |
|
258 | - if ($compress) $output .= '"as": "ship.png",'; |
|
259 | - else $output .= '"aircraft_shadow": "ship.png",'; |
|
281 | + if ($compress) { |
|
282 | + $output .= '"as": "ambulance.png",'; |
|
283 | + } else { |
|
284 | + $output .= '"aircraft_shadow": "ambulance.png",'; |
|
285 | + } |
|
286 | + } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Police') { |
|
287 | + if ($compress) { |
|
288 | + $output .= '"as": "police.png",'; |
|
289 | + } else { |
|
290 | + $output .= '"aircraft_shadow": "police.png",'; |
|
291 | + } |
|
292 | + } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Yacht (Sail)') { |
|
293 | + if ($compress) { |
|
294 | + $output .= '"as": "ship.png",'; |
|
295 | + } else { |
|
296 | + $output .= '"aircraft_shadow": "ship.png",'; |
|
297 | + } |
|
298 | + } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Ship (Power Boat)') { |
|
299 | + if ($compress) { |
|
300 | + $output .= '"as": "ship.png",'; |
|
301 | + } else { |
|
302 | + $output .= '"aircraft_shadow": "ship.png",'; |
|
303 | + } |
|
304 | + } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Shuttle') { |
|
305 | + if ($compress) { |
|
306 | + $output .= '"as": "ship.png",'; |
|
307 | + } else { |
|
308 | + $output .= '"aircraft_shadow": "ship.png",'; |
|
309 | + } |
|
310 | + } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Truck') { |
|
311 | + if ($compress) { |
|
312 | + $output .= '"as": "truck.png",'; |
|
313 | + } else { |
|
314 | + $output .= '"aircraft_shadow": "truck.png",'; |
|
315 | + } |
|
316 | + } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Truck (18 Wheeler)') { |
|
317 | + if ($compress) { |
|
318 | + $output .= '"as": "truck.png",'; |
|
319 | + } else { |
|
320 | + $output .= '"aircraft_shadow": "truck.png",'; |
|
321 | + } |
|
322 | + } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Aircraft (small)') { |
|
323 | + if ($compress) { |
|
324 | + $output .= '"as": "aircraft.png",'; |
|
325 | + } else { |
|
326 | + $output .= '"aircraft_shadow": "aircraft.png",'; |
|
327 | + } |
|
328 | + } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Large Aircraft') { |
|
329 | + if ($compress) { |
|
330 | + $output .= '"as": "aircraft.png",'; |
|
331 | + } else { |
|
332 | + $output .= '"aircraft_shadow": "aircraft.png",'; |
|
333 | + } |
|
334 | + } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Helicopter') { |
|
335 | + if ($compress) { |
|
336 | + $output .= '"as": "helico.png",'; |
|
337 | + } else { |
|
338 | + $output .= '"aircraft_shadow": "helico.png",'; |
|
339 | + } |
|
340 | + } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Railroad Engine') { |
|
341 | + if ($compress) { |
|
342 | + $output .= '"as": "rail.png",'; |
|
343 | + } else { |
|
344 | + $output .= '"aircraft_shadow": "rail.png",'; |
|
345 | + } |
|
346 | + } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Firetruck') { |
|
347 | + if ($compress) { |
|
348 | + $output .= '"as": "firetruck.png",'; |
|
349 | + } else { |
|
350 | + $output .= '"aircraft_shadow": "firetruck.png",'; |
|
351 | + } |
|
352 | + } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Bus') { |
|
353 | + if ($compress) { |
|
354 | + $output .= '"as": "bus.png",'; |
|
355 | + } else { |
|
356 | + $output .= '"aircraft_shadow": "bus.png",'; |
|
357 | + } |
|
358 | + } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Phone') { |
|
359 | + if ($compress) { |
|
360 | + $output .= '"as": "phone.png",'; |
|
361 | + } else { |
|
362 | + $output .= '"aircraft_shadow": "phone.png",'; |
|
363 | + } |
|
364 | + } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Jogger') { |
|
365 | + if ($compress) { |
|
366 | + $output .= '"as": "jogger.png",'; |
|
367 | + } else { |
|
368 | + $output .= '"aircraft_shadow": "jogger.png",'; |
|
369 | + } |
|
370 | + } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Bike') { |
|
371 | + if ($compress) { |
|
372 | + $output .= '"as": "bike.png",'; |
|
373 | + } else { |
|
374 | + $output .= '"aircraft_shadow": "bike.png",'; |
|
375 | + } |
|
376 | + } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Motorcycle') { |
|
377 | + if ($compress) { |
|
378 | + $output .= '"as": "motorcycle.png",'; |
|
379 | + } else { |
|
380 | + $output .= '"aircraft_shadow": "motorcycle.png",'; |
|
381 | + } |
|
382 | + } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Balloon') { |
|
383 | + if ($compress) { |
|
384 | + $output .= '"as": "balloon.png",'; |
|
385 | + } else { |
|
386 | + $output .= '"aircraft_shadow": "balloon.png",'; |
|
387 | + } |
|
388 | + } else { |
|
389 | + if ($compress) { |
|
390 | + $output .= '"as": "car.png",'; |
|
391 | + } else { |
|
392 | + $output .= '"aircraft_shadow": "car.png",'; |
|
393 | + } |
|
260 | 394 | } |
261 | - elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Truck') { |
|
262 | - if ($compress) $output .= '"as": "truck.png",'; |
|
263 | - else $output .= '"aircraft_shadow": "truck.png",'; |
|
395 | + } elseif ($marine) { |
|
396 | + if ($compress) { |
|
397 | + $output .= '"as": "ship.png",'; |
|
398 | + } else { |
|
399 | + $output .= '"aircraft_shadow": "ship.png",'; |
|
264 | 400 | } |
265 | - elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Truck (18 Wheeler)') { |
|
266 | - if ($compress) $output .= '"as": "truck.png",'; |
|
267 | - else $output .= '"aircraft_shadow": "truck.png",'; |
|
268 | - } |
|
269 | - elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Aircraft (small)') { |
|
270 | - if ($compress) $output .= '"as": "aircraft.png",'; |
|
271 | - else $output .= '"aircraft_shadow": "aircraft.png",'; |
|
272 | - } |
|
273 | - elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Large Aircraft') { |
|
274 | - if ($compress) $output .= '"as": "aircraft.png",'; |
|
275 | - else $output .= '"aircraft_shadow": "aircraft.png",'; |
|
276 | - } |
|
277 | - elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Helicopter') { |
|
278 | - if ($compress) $output .= '"as": "helico.png",'; |
|
279 | - else $output .= '"aircraft_shadow": "helico.png",'; |
|
280 | - } |
|
281 | - elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Railroad Engine') { |
|
282 | - if ($compress) $output .= '"as": "rail.png",'; |
|
283 | - else $output .= '"aircraft_shadow": "rail.png",'; |
|
284 | - } |
|
285 | - elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Firetruck') { |
|
286 | - if ($compress) $output .= '"as": "firetruck.png",'; |
|
287 | - else $output .= '"aircraft_shadow": "firetruck.png",'; |
|
288 | - } |
|
289 | - elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Bus') { |
|
290 | - if ($compress) $output .= '"as": "bus.png",'; |
|
291 | - else $output .= '"aircraft_shadow": "bus.png",'; |
|
292 | - } |
|
293 | - elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Phone') { |
|
294 | - if ($compress) $output .= '"as": "phone.png",'; |
|
295 | - else $output .= '"aircraft_shadow": "phone.png",'; |
|
296 | - } |
|
297 | - elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Jogger') { |
|
298 | - if ($compress) $output .= '"as": "jogger.png",'; |
|
299 | - else $output .= '"aircraft_shadow": "jogger.png",'; |
|
300 | - } |
|
301 | - elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Bike') { |
|
302 | - if ($compress) $output .= '"as": "bike.png",'; |
|
303 | - else $output .= '"aircraft_shadow": "bike.png",'; |
|
304 | - } |
|
305 | - elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Motorcycle') { |
|
306 | - if ($compress) $output .= '"as": "motorcycle.png",'; |
|
307 | - else $output .= '"aircraft_shadow": "motorcycle.png",'; |
|
308 | - } |
|
309 | - elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Balloon') { |
|
310 | - if ($compress) $output .= '"as": "balloon.png",'; |
|
311 | - else $output .= '"aircraft_shadow": "balloon.png",'; |
|
312 | - } |
|
313 | - else { |
|
314 | - if ($compress) $output .= '"as": "car.png",'; |
|
315 | - else $output .= '"aircraft_shadow": "car.png",'; |
|
401 | + } else { |
|
402 | + if ($compress) { |
|
403 | + $output .= '"as": "default.png",'; |
|
404 | + } else { |
|
405 | + $output .= '"aircraft_shadow": "default.png",'; |
|
316 | 406 | } |
317 | 407 | } |
318 | - elseif ($marine) { |
|
319 | - if ($compress) $output .= '"as": "ship.png",'; |
|
320 | - else $output .= '"aircraft_shadow": "ship.png",'; |
|
321 | - } |
|
322 | - else { |
|
323 | - if ($compress) $output .= '"as": "default.png",'; |
|
324 | - else $output .= '"aircraft_shadow": "default.png",'; |
|
325 | - } |
|
326 | 408 | } else { |
327 | - if ($compress) $output .= '"as": "'.$spotter_item['aircraft_shadow'].'",'; |
|
328 | - else $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",'; |
|
409 | + if ($compress) { |
|
410 | + $output .= '"as": "'.$spotter_item['aircraft_shadow'].'",'; |
|
411 | + } else { |
|
412 | + $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",'; |
|
413 | + } |
|
329 | 414 | } |
330 | 415 | |
331 | 416 | if (isset($spotter_item['date_iso_8601'])) { |
@@ -373,7 +458,9 @@ discard block |
||
373 | 458 | $output .= ']'; |
374 | 459 | $output .= ',"initial_sqltime": "'.$sqltime.'",'; |
375 | 460 | $output .= '"totaltime": "'.round(microtime(true)-$begintime,2).'",'; |
376 | - if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",'; |
|
461 | + if (isset($begindate)) { |
|
462 | + $output .= '"archive_date": "'.$begindate.'",'; |
|
463 | + } |
|
377 | 464 | $output .= '"fc": "'.$flightcnt.'"'; |
378 | 465 | } else { |
379 | 466 | $output .= '"features": '; |
@@ -6,8 +6,8 @@ discard block |
||
6 | 6 | if (!isset($globalJsonCompress)) $compress = true; |
7 | 7 | else $compress = $globalJsonCompress; |
8 | 8 | |
9 | -if (isset($_GET['ident'])) $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
|
10 | -if (isset($_GET['flightaware_id'])) $flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING); |
|
9 | +if (isset($_GET['ident'])) $ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING); |
|
10 | +if (isset($_GET['flightaware_id'])) $flightaware_id = filter_input(INPUT_GET, 'flightaware_id', FILTER_SANITIZE_STRING); |
|
11 | 11 | ?> |
12 | 12 | <?php |
13 | 13 | if (isset($_COOKIE['IconColor'])) $IconColor = $_COOKIE['IconColor']; |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | if (typeof props != 'undefined') { |
227 | 227 | var thedate = new Date(props); |
228 | 228 | $("#thedate").html(thedate.toUTCString()); |
229 | - // $("#archivebox").html('<h4><?php echo str_replace("'","\'",_("Archive Date & Time")); ?></h4>' + '<b><i class="fa fa-spinner fa-pulse fa-2x fa-fw margin-bottom"></i></b>'); |
|
229 | + // $("#archivebox").html('<h4><?php echo str_replace("'", "\'", _("Archive Date & Time")); ?></h4>' + '<b><i class="fa fa-spinner fa-pulse fa-2x fa-fw margin-bottom"></i></b>'); |
|
230 | 230 | } |
231 | 231 | } |
232 | 232 | } |
@@ -373,7 +373,7 @@ discard block |
||
373 | 373 | <?php |
374 | 374 | } else { |
375 | 375 | ?> |
376 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
376 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000 + 20000; ?>+feature.properties.sqt*1000); |
|
377 | 377 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
378 | 378 | <?php |
379 | 379 | } |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | /* |
391 | 391 | shadowUrl: iconURLShadowpath, |
392 | 392 | shadowSize: [<?php print $globalAircraftSize; ?>, <?php print $globalAircraftSize; ?>], |
393 | - shadowAnchor: [<?php print ($globalAircraftSize/2)+1; ?>, <?php print $globalAircraftSize; ?>] |
|
393 | + shadowAnchor: [<?php print ($globalAircraftSize/2) + 1; ?>, <?php print $globalAircraftSize; ?>] |
|
394 | 394 | */ |
395 | 395 | }) |
396 | 396 | }) |
@@ -424,7 +424,7 @@ discard block |
||
424 | 424 | <?php |
425 | 425 | } else { |
426 | 426 | ?> |
427 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
427 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000 + 20000; ?>+feature.properties.sqt*1000); |
|
428 | 428 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
429 | 429 | <?php |
430 | 430 | } |
@@ -472,7 +472,7 @@ discard block |
||
472 | 472 | <?php |
473 | 473 | } else { |
474 | 474 | ?> |
475 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
475 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000 + 20000; ?>+feature.properties.sqt*1000); |
|
476 | 476 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
477 | 477 | <?php |
478 | 478 | } |
@@ -3,16 +3,27 @@ discard block |
||
3 | 3 | require_once('../require/class.Language.php'); |
4 | 4 | |
5 | 5 | // Compressed GeoJson is used if true |
6 | -if (!isset($globalJsonCompress)) $compress = true; |
|
7 | -else $compress = $globalJsonCompress; |
|
6 | +if (!isset($globalJsonCompress)) { |
|
7 | + $compress = true; |
|
8 | +} else { |
|
9 | + $compress = $globalJsonCompress; |
|
10 | +} |
|
8 | 11 | |
9 | -if (isset($_GET['ident'])) $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
|
10 | -if (isset($_GET['flightaware_id'])) $flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING); |
|
12 | +if (isset($_GET['ident'])) { |
|
13 | + $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
|
14 | +} |
|
15 | +if (isset($_GET['flightaware_id'])) { |
|
16 | + $flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING); |
|
17 | +} |
|
11 | 18 | ?> |
12 | 19 | <?php |
13 | -if (isset($_COOKIE['IconColor'])) $IconColor = $_COOKIE['IconColor']; |
|
14 | -elseif (isset($globalAircraftIconColor)) $IconColor = $globalAircraftIconColor; |
|
15 | -else $IconColor = '1a3151'; |
|
20 | +if (isset($_COOKIE['IconColor'])) { |
|
21 | + $IconColor = $_COOKIE['IconColor']; |
|
22 | +} elseif (isset($globalAircraftIconColor)) { |
|
23 | + $IconColor = $globalAircraftIconColor; |
|
24 | +} else { |
|
25 | + $IconColor = '1a3151'; |
|
26 | +} |
|
16 | 27 | ?> |
17 | 28 | <?php |
18 | 29 | if (isset($globalDebug) && $globalDebug === TRUE) { |
@@ -90,9 +101,12 @@ discard block |
||
90 | 101 | |
91 | 102 | function update_airportsLayer() { |
92 | 103 | <?php |
93 | - if (isset($_COOKIE['AirportZoom'])) $getZoom = $_COOKIE['AirportZoom']; |
|
94 | - else $getZoom = '7'; |
|
95 | -?> |
|
104 | + if (isset($_COOKIE['AirportZoom'])) { |
|
105 | + $getZoom = $_COOKIE['AirportZoom']; |
|
106 | + } else { |
|
107 | + $getZoom = '7'; |
|
108 | + } |
|
109 | + ?> |
|
96 | 110 | if (typeof airportsLayer != 'undefined') { |
97 | 111 | if (map.hasLayer(airportsLayer) == true) { |
98 | 112 | map.removeLayer(airportsLayer); |
@@ -373,7 +387,12 @@ discard block |
||
373 | 387 | <?php |
374 | 388 | } else { |
375 | 389 | ?> |
376 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
390 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
391 | + print $archiveupdatetime*1000; |
|
392 | +} else { |
|
393 | + print $globalMapRefresh*1000+20000; |
|
394 | +} |
|
395 | +?>+feature.properties.sqt*1000); |
|
377 | 396 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
378 | 397 | <?php |
379 | 398 | } |
@@ -424,7 +443,12 @@ discard block |
||
424 | 443 | <?php |
425 | 444 | } else { |
426 | 445 | ?> |
427 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
446 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
447 | + print $archiveupdatetime*1000; |
|
448 | +} else { |
|
449 | + print $globalMapRefresh*1000+20000; |
|
450 | +} |
|
451 | +?>+feature.properties.sqt*1000); |
|
428 | 452 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
429 | 453 | <?php |
430 | 454 | } |
@@ -472,7 +496,12 @@ discard block |
||
472 | 496 | <?php |
473 | 497 | } else { |
474 | 498 | ?> |
475 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
499 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
500 | + print $archiveupdatetime*1000; |
|
501 | +} else { |
|
502 | + print $globalMapRefresh*1000+20000; |
|
503 | +} |
|
504 | +?>+feature.properties.sqt*1000); |
|
476 | 505 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
477 | 506 | <?php |
478 | 507 | } |
@@ -975,7 +1004,12 @@ discard block |
||
975 | 1004 | update_archiveLayer(0); |
976 | 1005 | } else { |
977 | 1006 | //then load it again every 30 seconds |
978 | - reloadPage = setInterval(function(){if (noTimeout) getLiveData(0)},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000; else print '30000'; ?>); |
|
1007 | + reloadPage = setInterval(function(){if (noTimeout) getLiveData(0)},<?php if (isset($globalMapRefresh)) { |
|
1008 | + print $globalMapRefresh*1000; |
|
1009 | +} else { |
|
1010 | + print '30000'; |
|
1011 | +} |
|
1012 | +?>); |
|
979 | 1013 | var currentdate = new Date(); |
980 | 1014 | var currentyear = new Date().getFullYear(); |
981 | 1015 | var begindate = new Date(Date.UTC(currentyear,11,24,2,0,0,0)); |
@@ -987,7 +1021,12 @@ discard block |
||
987 | 1021 | if (!((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) && (isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) { |
988 | 1022 | ?> |
989 | 1023 | update_polarLayer(); |
990 | - setInterval(function(){map.removeLayer(polarLayer);update_polarLayer()},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>); |
|
1024 | + setInterval(function(){map.removeLayer(polarLayer);update_polarLayer()},<?php if (isset($globalMapRefresh)) { |
|
1025 | + print $globalMapRefresh*1000*2; |
|
1026 | +} else { |
|
1027 | + print '60000'; |
|
1028 | +} |
|
1029 | +?>); |
|
991 | 1030 | <?php |
992 | 1031 | } |
993 | 1032 | ?> |
@@ -1000,7 +1039,12 @@ discard block |
||
1000 | 1039 | if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM)) { |
1001 | 1040 | ?> |
1002 | 1041 | update_atcLayer(); |
1003 | - setInterval(function(){map.removeLayer(atcLayer);update_atcLayer()},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>); |
|
1042 | + setInterval(function(){map.removeLayer(atcLayer);update_atcLayer()},<?php if (isset($globalMapRefresh)) { |
|
1043 | + print $globalMapRefresh*1000*2; |
|
1044 | +} else { |
|
1045 | + print '60000'; |
|
1046 | +} |
|
1047 | +?>); |
|
1004 | 1048 | <?php |
1005 | 1049 | } |
1006 | 1050 | ?> |
@@ -11,14 +11,14 @@ discard block |
||
11 | 11 | |
12 | 12 | $from_archive = false; |
13 | 13 | if (isset($_GET['ident'])) { |
14 | - $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
|
14 | + $ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING); |
|
15 | 15 | if (isset($_GET['currenttime'])) { |
16 | - $currenttime = filter_input(INPUT_GET,'currenttime',FILTER_SANITIZE_NUMBER_INT); |
|
16 | + $currenttime = filter_input(INPUT_GET, 'currenttime', FILTER_SANITIZE_NUMBER_INT); |
|
17 | 17 | $currenttime = round($currenttime/1000); |
18 | - $spotter_array = $SpotterLive->getDateLiveSpotterDataByIdent($ident,$currenttime); |
|
18 | + $spotter_array = $SpotterLive->getDateLiveSpotterDataByIdent($ident, $currenttime); |
|
19 | 19 | if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) { |
20 | 20 | $from_archive = true; |
21 | - $spotter_array = $SpotterArchive->getDateArchiveSpotterDataByIdent($ident,$currenttime); |
|
21 | + $spotter_array = $SpotterArchive->getDateArchiveSpotterDataByIdent($ident, $currenttime); |
|
22 | 22 | } |
23 | 23 | } else { |
24 | 24 | $spotter_array = $SpotterLive->getLastLiveSpotterDataByIdent($ident); |
@@ -29,15 +29,15 @@ discard block |
||
29 | 29 | } |
30 | 30 | } |
31 | 31 | if (isset($_GET['flightaware_id'])) { |
32 | - $flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING); |
|
32 | + $flightaware_id = filter_input(INPUT_GET, 'flightaware_id', FILTER_SANITIZE_STRING); |
|
33 | 33 | if (isset($_GET['currenttime'])) { |
34 | - $currenttime = filter_input(INPUT_GET,'currenttime',FILTER_SANITIZE_NUMBER_INT); |
|
34 | + $currenttime = filter_input(INPUT_GET, 'currenttime', FILTER_SANITIZE_NUMBER_INT); |
|
35 | 35 | $currenttime = round($currenttime/1000); |
36 | - $spotter_array = $SpotterLive->getDateLiveSpotterDataById($flightaware_id,$currenttime); |
|
36 | + $spotter_array = $SpotterLive->getDateLiveSpotterDataById($flightaware_id, $currenttime); |
|
37 | 37 | if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) { |
38 | 38 | $from_archive = true; |
39 | 39 | // $spotter_array = $SpotterArchive->getLastArchiveSpotterDataById($flightaware_id); |
40 | - $spotter_array = $SpotterArchive->getDateArchiveSpotterDataById($flightaware_id,$currenttime); |
|
40 | + $spotter_array = $SpotterArchive->getDateArchiveSpotterDataById($flightaware_id, $currenttime); |
|
41 | 41 | } |
42 | 42 | } else { |
43 | 43 | $spotter_array = $SpotterLive->getLastLiveSpotterDataById($flightaware_id); |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | if (isset($spotter_item['image_thumbnail']) && $spotter_item['image_thumbnail'] != "") |
58 | 58 | { |
59 | 59 | if ($spotter_item['image_source'] == 'flickr' || $spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart') { |
60 | - $image = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
|
60 | + $image = preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']); |
|
61 | 61 | } else $image = $spotter_item['image_thumbnail']; |
62 | 62 | } |
63 | 63 | /* else { |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | print '<div class="nomobile airports"><div class="airport"><span class="code"><a href="'.$globalURL.'/airport/'.$spotter_item['departure_airport'].'" target="_blank">'.$spotter_item['departure_airport'].'</a></span>'.$spotter_item['departure_airport_city'].' '.$spotter_item['departure_airport_country']; |
85 | 85 | if (isset($spotter_item['departure_airport_time']) && $spotter_item['departure_airport_time'] != 'NULL') { |
86 | 86 | if ($spotter_item['departure_airport_time'] > 2460) { |
87 | - print '<br /><span class="time">'.date('H:m',$spotter_item['departure_airport_time']).'</span>'; |
|
87 | + print '<br /><span class="time">'.date('H:m', $spotter_item['departure_airport_time']).'</span>'; |
|
88 | 88 | } else { |
89 | 89 | print '<br /><span class="time">'.$spotter_item['departure_airport_time'].'</span>'; |
90 | 90 | } |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | print '<span class="code"><a href="'.$globalURL.'/airport/'.$spotter_item['arrival_airport'].'" target="_blank">'.$spotter_item['arrival_airport'].'</a></span>'.$spotter_item['arrival_airport_city'].' '.$spotter_item['arrival_airport_country']; |
94 | 94 | if (isset($spotter_item['arrival_airport_time']) && $spotter_item['arrival_airport_time'] != 'NULL') { |
95 | 95 | if ($spotter_item['arrival_airport_time'] > 2460) { |
96 | - print '<br /><span class="time">'.date('H:m',$spotter_item['arrival_airport_time']).'</span>'; |
|
96 | + print '<br /><span class="time">'.date('H:m', $spotter_item['arrival_airport_time']).'</span>'; |
|
97 | 97 | } else { |
98 | 98 | print '<br /><span class="time">'.$spotter_item['arrival_airport_time'].'</span>'; |
99 | 99 | } |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | print '<span>'._("Aircraft").'</span>'; |
113 | 113 | if (isset($spotter_item['aircraft_wiki'])) print '<a href="'.$spotter_item['aircraft_wiki'].'">'.$spotter_item['aircraft_name'].'</a>'; |
114 | 114 | if (isset($spotter_item['aircraft_type']) && isset($spotter_item['aircraft_manufacturer']) && $spotter_item['aircraft_manufacturer'] != 'N/A' && isset($spotter_item['aircraft_name']) && $spotter_item['aircraft_name'] != 'N/A') { |
115 | - $aircraft_names = explode('/',$spotter_item['aircraft_name']); |
|
115 | + $aircraft_names = explode('/', $spotter_item['aircraft_name']); |
|
116 | 116 | if (count($aircraft_names) == 1) print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')</a>'; |
117 | 117 | else print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'" title="'.$spotter_item['aircraft_name'].'">'.$spotter_item['aircraft_manufacturer'].' '.$aircraft_names[0].' ('.$spotter_item['aircraft_type'].')</a>'; |
118 | 118 | } elseif (isset($spotter_item['aircraft_type'])) print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_type'].'</a>'; |
@@ -122,8 +122,8 @@ discard block |
||
122 | 122 | print '<div id="altitude"><span>'._("Altitude").'</span>'; |
123 | 123 | if (isset($globalGroundAltitude) && $globalGroundAltitude) { |
124 | 124 | try { |
125 | - $groundAltitude = $Elevation->getElevation($spotter_item['latitude'],$spotter_item['longitude']); |
|
126 | - } catch(Exception $e) { |
|
125 | + $groundAltitude = $Elevation->getElevation($spotter_item['latitude'], $spotter_item['longitude']); |
|
126 | + } catch (Exception $e) { |
|
127 | 127 | // If catched not exist |
128 | 128 | } |
129 | 129 | } |
@@ -167,9 +167,9 @@ discard block |
||
167 | 167 | if (isset($globalCam) && $globalCam) { |
168 | 168 | require_once(dirname(__FILE__).'/require/class.Common.php'); |
169 | 169 | $Common = new Common(); |
170 | - $azimuth = round($Common->azimuth($globalCenterLatitude,$globalCenterLongitude,$spotter_item['latitude'],$spotter_item['longitude'])); |
|
171 | - $distance = $Common->distance($globalCenterLatitude,$globalCenterLongitude,$spotter_item['latitude'],$spotter_item['longitude'],'m'); |
|
172 | - $plunge = round($Common->plunge($globalCenterAltitude,$spotter_item['real_altitude'],$distance)); |
|
170 | + $azimuth = round($Common->azimuth($globalCenterLatitude, $globalCenterLongitude, $spotter_item['latitude'], $spotter_item['longitude'])); |
|
171 | + $distance = $Common->distance($globalCenterLatitude, $globalCenterLongitude, $spotter_item['latitude'], $spotter_item['longitude'], 'm'); |
|
172 | + $plunge = round($Common->plunge($globalCenterAltitude, $spotter_item['real_altitude'], $distance)); |
|
173 | 173 | print '<div id="camcoordinates"><span>'._("Cam Coordinates").'</span>'; |
174 | 174 | print 'azimuth: '.$azimuth; |
175 | 175 | print ' / '; |
@@ -179,16 +179,16 @@ discard block |
||
179 | 179 | print '</div>'; |
180 | 180 | //echo $Common->getData('http://127.0.0.1/camera.php?azimuth='.$azimuth.'&plunge='.$plunge,'get','','','','','','',false,true); |
181 | 181 | //echo $Common->getData('file://'.dirname(__FILE__).'/camera.php?azimuth='.$azimuth.'&plunge='.$plunge,'get','','','','','','',false,true); |
182 | - echo $Common->getData('http://'.$_SERVER['SERVER_NAME'].'/camera.php?azimuth='.$azimuth.'&plunge='.$plunge,'get','','','','','','',false,true); |
|
182 | + echo $Common->getData('http://'.$_SERVER['SERVER_NAME'].'/camera.php?azimuth='.$azimuth.'&plunge='.$plunge, 'get', '', '', '', '', '', '', false, true); |
|
183 | 183 | } |
184 | 184 | |
185 | 185 | print '<div id="heading"><span>'._("Heading").'</span><span class="heading">'.$spotter_item['heading'].'</span>°</div>'; |
186 | 186 | if (isset($spotter_item['verticalrate']) && $spotter_item['verticalrate'] != '') { |
187 | 187 | print '<div id="verticalrate"><span>'._("Vertical rate").'</span>'; |
188 | 188 | if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) { |
189 | - print $spotter_item['verticalrate']. ' ft/min'; |
|
189 | + print $spotter_item['verticalrate'].' ft/min'; |
|
190 | 190 | } else { |
191 | - print round($spotter_item['verticalrate']*0.3048). ' m/min'; |
|
191 | + print round($spotter_item['verticalrate']*0.3048).' m/min'; |
|
192 | 192 | } |
193 | 193 | print '</div>'; |
194 | 194 | } |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | print '</div>'; |
224 | 224 | if (isset($globalVA) && $globalVA && isset($globalphpVMS) && $globalphpVMS && isset($globalVATSIM) && $globalVATSIM && isset($globalIVAO) && $globalIVAO && isset($spotter_item['format_source']) && $spotter_item['format_source'] != '' && $spotter_item['format_source'] != 'pireps') print '<div class="waypoints"><span>'._("Source").'</span>'.$spotter_item['format_source'].'</div>'; |
225 | 225 | if (isset($spotter_item['waypoints']) && $spotter_item['waypoints'] != '') print '<div class="waypoints"><span>'._("Route").'</span>'.$spotter_item['waypoints'].'</div>'; |
226 | - if (isset($spotter_item['acars']['message'])) print '<div class="acars"><span>'._("Latest ACARS message").'</span>'.trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'<br/>',$spotter_item['acars']['message'])).'</div>'; |
|
226 | + if (isset($spotter_item['acars']['message'])) print '<div class="acars"><span>'._("Latest ACARS message").'</span>'.trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '<br/>', $spotter_item['acars']['message'])).'</div>'; |
|
227 | 227 | if (isset($spotter_item['squawk']) && $spotter_item['squawk'] != '' && $spotter_item['squawk'] != 0) print '<div class="bottom">'._("Squawk:").' '.$spotter_item['squawk'].' - '.$spotter_item['squawk_usage'].'</div>'; |
228 | 228 | print '</div>'; |
229 | 229 | } |
@@ -58,7 +58,9 @@ discard block |
||
58 | 58 | { |
59 | 59 | if ($spotter_item['image_source'] == 'flickr' || $spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart') { |
60 | 60 | $image = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
61 | - } else $image = $spotter_item['image_thumbnail']; |
|
61 | + } else { |
|
62 | + $image = $spotter_item['image_thumbnail']; |
|
63 | + } |
|
62 | 64 | } |
63 | 65 | /* else { |
64 | 66 | $image = "images/placeholder_thumb.png"; |
@@ -75,10 +77,14 @@ discard block |
||
75 | 77 | print '<div class="callsign-details">'; |
76 | 78 | if ($spotter_item['ident'] != 'Not Available') { |
77 | 79 | print '<div class="callsign"><a href="'.$globalURL.'/redirect/'.$spotter_item['flightaware_id'].'" target="_blank">'.$spotter_item['ident'].'</a>'; |
78 | - if (isset($spotter_item['blocked']) && $spotter_item['blocked'] === true) print '<img src="'.$globalURL.'/images/forbidden.png" title="'._("Callsign is in blocked FAA list").'" class="blocked" />'; |
|
80 | + if (isset($spotter_item['blocked']) && $spotter_item['blocked'] === true) { |
|
81 | + print '<img src="'.$globalURL.'/images/forbidden.png" title="'._("Callsign is in blocked FAA list").'" class="blocked" />'; |
|
82 | + } |
|
79 | 83 | print '</div>'; |
80 | 84 | } |
81 | - if (isset($spotter_item['airline_name']) && $spotter_item['airline_name'] != 'Not Available') print '<div class="airline">'.$spotter_item['airline_name'].'</div>'; |
|
85 | + if (isset($spotter_item['airline_name']) && $spotter_item['airline_name'] != 'Not Available') { |
|
86 | + print '<div class="airline">'.$spotter_item['airline_name'].'</div>'; |
|
87 | + } |
|
82 | 88 | print '</div>'; |
83 | 89 | if ($spotter_item['departure_airport'] != 'NA' && $spotter_item['arrival_airport'] != 'NA') { |
84 | 90 | print '<div class="nomobile airports"><div class="airport"><span class="code"><a href="'.$globalURL.'/airport/'.$spotter_item['departure_airport'].'" target="_blank">'.$spotter_item['departure_airport'].'</a></span>'.$spotter_item['departure_airport_city'].' '.$spotter_item['departure_airport_country']; |
@@ -110,15 +116,25 @@ discard block |
||
110 | 116 | print '</div>'; |
111 | 117 | print '<div id="aircraft">'; |
112 | 118 | print '<span>'._("Aircraft").'</span>'; |
113 | - if (isset($spotter_item['aircraft_wiki'])) print '<a href="'.$spotter_item['aircraft_wiki'].'">'.$spotter_item['aircraft_name'].'</a>'; |
|
119 | + if (isset($spotter_item['aircraft_wiki'])) { |
|
120 | + print '<a href="'.$spotter_item['aircraft_wiki'].'">'.$spotter_item['aircraft_name'].'</a>'; |
|
121 | + } |
|
114 | 122 | if (isset($spotter_item['aircraft_type']) && isset($spotter_item['aircraft_manufacturer']) && $spotter_item['aircraft_manufacturer'] != 'N/A' && isset($spotter_item['aircraft_name']) && $spotter_item['aircraft_name'] != 'N/A') { |
115 | 123 | $aircraft_names = explode('/',$spotter_item['aircraft_name']); |
116 | - if (count($aircraft_names) == 1) print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')</a>'; |
|
117 | - else print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'" title="'.$spotter_item['aircraft_name'].'">'.$spotter_item['aircraft_manufacturer'].' '.$aircraft_names[0].' ('.$spotter_item['aircraft_type'].')</a>'; |
|
118 | - } elseif (isset($spotter_item['aircraft_type'])) print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_type'].'</a>'; |
|
119 | - else print $spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name']; |
|
124 | + if (count($aircraft_names) == 1) { |
|
125 | + print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')</a>'; |
|
126 | + } else { |
|
127 | + print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'" title="'.$spotter_item['aircraft_name'].'">'.$spotter_item['aircraft_manufacturer'].' '.$aircraft_names[0].' ('.$spotter_item['aircraft_type'].')</a>'; |
|
128 | + } |
|
129 | + } elseif (isset($spotter_item['aircraft_type'])) { |
|
130 | + print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_type'].'</a>'; |
|
131 | + } else { |
|
132 | + print $spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name']; |
|
133 | + } |
|
120 | 134 | print '</div>'; |
121 | - if (isset($spotter_item['registration']) && $spotter_item['registration'] != '') print '<div><span>'._("Registration").'</span><a href="'.$globalURL.'/registration/'.$spotter_item['registration'].'" target="_blank">'.$spotter_item['registration'].'</a></div>'; |
|
135 | + if (isset($spotter_item['registration']) && $spotter_item['registration'] != '') { |
|
136 | + print '<div><span>'._("Registration").'</span><a href="'.$globalURL.'/registration/'.$spotter_item['registration'].'" target="_blank">'.$spotter_item['registration'].'</a></div>'; |
|
137 | + } |
|
122 | 138 | |
123 | 139 | print '<div id="altitude"><span>'._("Altitude").'</span>'; |
124 | 140 | if (isset($globalGroundAltitude) && $globalGroundAltitude) { |
@@ -131,11 +147,17 @@ discard block |
||
131 | 147 | |
132 | 148 | print '<span class="altitude">'; |
133 | 149 | if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) { |
134 | - if (isset($spotter_item['real_altitude']) && $spotter_item['real_altitude'] != '') print $spotter_item['real_altitude'].' feet (FL'.$spotter_item['altitude'].')'; |
|
135 | - else print $spotter_item['altitude'].'00 feet (FL'.$spotter_item['altitude'].')'; |
|
150 | + if (isset($spotter_item['real_altitude']) && $spotter_item['real_altitude'] != '') { |
|
151 | + print $spotter_item['real_altitude'].' feet (FL'.$spotter_item['altitude'].')'; |
|
152 | + } else { |
|
153 | + print $spotter_item['altitude'].'00 feet (FL'.$spotter_item['altitude'].')'; |
|
154 | + } |
|
136 | 155 | } else { |
137 | - if (isset($spotter_item['real_altitude']) && $spotter_item['real_altitude'] != '') print round($spotter_item['real_altitude']*0.3048).' m (FL'.$spotter_item['altitude'].')'; |
|
138 | - else print round($spotter_item['altitude']*30.48).' m (FL'.$spotter_item['altitude'].')'; |
|
156 | + if (isset($spotter_item['real_altitude']) && $spotter_item['real_altitude'] != '') { |
|
157 | + print round($spotter_item['real_altitude']*0.3048).' m (FL'.$spotter_item['altitude'].')'; |
|
158 | + } else { |
|
159 | + print round($spotter_item['altitude']*30.48).' m (FL'.$spotter_item['altitude'].')'; |
|
160 | + } |
|
139 | 161 | } |
140 | 162 | print '</span>'; |
141 | 163 | |
@@ -200,8 +222,11 @@ discard block |
||
200 | 222 | } |
201 | 223 | if (isset($spotter_item['pilot_name']) && $spotter_item['pilot_name'] != '') { |
202 | 224 | print '<div id="pilot"><span>'._("Pilot").'</span>'; |
203 | - if (isset($spotter_item['pilot_id'])) print $spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')'; |
|
204 | - else print $spotter_item['pilot_name']; |
|
225 | + if (isset($spotter_item['pilot_id'])) { |
|
226 | + print $spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')'; |
|
227 | + } else { |
|
228 | + print $spotter_item['pilot_name']; |
|
229 | + } |
|
205 | 230 | print '</div>'; |
206 | 231 | } |
207 | 232 | if (isset($spotter_item['aircraft_owner']) && $spotter_item['aircraft_owner'] != '') { |
@@ -227,10 +252,18 @@ discard block |
||
227 | 252 | } |
228 | 253 | print '</div>'; |
229 | 254 | print '</div>'; |
230 | - if (isset($globalVA) && $globalVA && isset($globalphpVMS) && $globalphpVMS && isset($globalVATSIM) && $globalVATSIM && isset($globalIVAO) && $globalIVAO && isset($spotter_item['format_source']) && $spotter_item['format_source'] != '' && $spotter_item['format_source'] != 'pireps') print '<div class="waypoints"><span>'._("Source").'</span>'.$spotter_item['format_source'].'</div>'; |
|
231 | - if (isset($spotter_item['waypoints']) && $spotter_item['waypoints'] != '') print '<div class="waypoints"><span>'._("Route").'</span>'.$spotter_item['waypoints'].'</div>'; |
|
232 | - if (isset($spotter_item['acars']['message'])) print '<div class="acars"><span>'._("Latest ACARS message").'</span>'.trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'<br/>',$spotter_item['acars']['message'])).'</div>'; |
|
233 | - if (isset($spotter_item['squawk']) && $spotter_item['squawk'] != '' && $spotter_item['squawk'] != 0) print '<div class="bottom">'._("Squawk:").' '.$spotter_item['squawk'].' - '.$spotter_item['squawk_usage'].'</div>'; |
|
255 | + if (isset($globalVA) && $globalVA && isset($globalphpVMS) && $globalphpVMS && isset($globalVATSIM) && $globalVATSIM && isset($globalIVAO) && $globalIVAO && isset($spotter_item['format_source']) && $spotter_item['format_source'] != '' && $spotter_item['format_source'] != 'pireps') { |
|
256 | + print '<div class="waypoints"><span>'._("Source").'</span>'.$spotter_item['format_source'].'</div>'; |
|
257 | + } |
|
258 | + if (isset($spotter_item['waypoints']) && $spotter_item['waypoints'] != '') { |
|
259 | + print '<div class="waypoints"><span>'._("Route").'</span>'.$spotter_item['waypoints'].'</div>'; |
|
260 | + } |
|
261 | + if (isset($spotter_item['acars']['message'])) { |
|
262 | + print '<div class="acars"><span>'._("Latest ACARS message").'</span>'.trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'<br/>',$spotter_item['acars']['message'])).'</div>'; |
|
263 | + } |
|
264 | + if (isset($spotter_item['squawk']) && $spotter_item['squawk'] != '' && $spotter_item['squawk'] != 0) { |
|
265 | + print '<div class="bottom">'._("Squawk:").' '.$spotter_item['squawk'].' - '.$spotter_item['squawk_usage'].'</div>'; |
|
266 | + } |
|
234 | 267 | print '</div>'; |
235 | 268 | } |
236 | 269 | ?> |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | date_default_timezone_set('UTC'); |
28 | 28 | //waypoint plotting |
29 | 29 | $output .= '{"type": "Feature",'; |
30 | - $output .= '"properties": {'; |
|
30 | + $output .= '"properties": {'; |
|
31 | 31 | $output .= '"name": '.json_encode(str_replace('"',"'",$spotter_item['name'])).','; |
32 | 32 | $output .= '"city": '.json_encode(str_replace('"',"'",$spotter_item['city'])).','; |
33 | 33 | $output .= '"country": "'.$spotter_item['country'].'",'; |
@@ -50,13 +50,13 @@ discard block |
||
50 | 50 | $output .= '"homepage": "'.$spotter_item['home_link'].'",'; |
51 | 51 | $output .= '"image_thumb": "'.$spotter_item['image_thumb'].'"'; |
52 | 52 | // $output .= '"photo": "'.$spotter_item['image_thumbnail'].'",'; |
53 | - $output .= '},'; |
|
54 | - $output .= '"geometry": {'; |
|
53 | + $output .= '},'; |
|
54 | + $output .= '"geometry": {'; |
|
55 | 55 | $output .= '"type": "Point",'; |
56 | 56 | $output .= '"coordinates": ['; |
57 | - $output .= $spotter_item['longitude'].', '.$spotter_item['latitude']; |
|
57 | + $output .= $spotter_item['longitude'].', '.$spotter_item['latitude']; |
|
58 | 58 | $output .= ']'; |
59 | - $output .= '}'; |
|
59 | + $output .= '}'; |
|
60 | 60 | $output .= '},'; |
61 | 61 | } |
62 | 62 | $output = substr($output, 0, -1); |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | if (isset($_GET['coord'])) |
13 | 13 | { |
14 | - $coords = explode(',',$_GET['coord']); |
|
14 | + $coords = explode(',', $_GET['coord']); |
|
15 | 15 | $spotter_array = $Spotter->getAllAirportInfobyCoord($coords); |
16 | 16 | } else { |
17 | 17 | $spotter_array = $Spotter->getAllAirportInfo(); |
@@ -22,17 +22,17 @@ discard block |
||
22 | 22 | |
23 | 23 | if (!empty($spotter_array)) |
24 | 24 | { |
25 | - foreach($spotter_array as $spotter_item) |
|
25 | + foreach ($spotter_array as $spotter_item) |
|
26 | 26 | { |
27 | 27 | date_default_timezone_set('UTC'); |
28 | 28 | //waypoint plotting |
29 | 29 | $output .= '{"type": "Feature",'; |
30 | 30 | $output .= '"properties": {'; |
31 | - $output .= '"name": '.json_encode(str_replace('"',"'",$spotter_item['name'])).','; |
|
32 | - $output .= '"city": '.json_encode(str_replace('"',"'",$spotter_item['city'])).','; |
|
31 | + $output .= '"name": '.json_encode(str_replace('"', "'", $spotter_item['name'])).','; |
|
32 | + $output .= '"city": '.json_encode(str_replace('"', "'", $spotter_item['city'])).','; |
|
33 | 33 | $output .= '"country": "'.$spotter_item['country'].'",'; |
34 | 34 | $output .= '"altitude": "'.$spotter_item['altitude'].'",'; |
35 | - $output .= '"popupContent": '.json_encode(str_replace('"',"'",$spotter_item['name']).' : '.str_replace('"',"'",$spotter_item['city']).', '.$spotter_item['country']).','; |
|
35 | + $output .= '"popupContent": '.json_encode(str_replace('"', "'", $spotter_item['name']).' : '.str_replace('"', "'", $spotter_item['city']).', '.$spotter_item['country']).','; |
|
36 | 36 | if ($spotter_item['type'] == 'large_airport') { |
37 | 37 | $output .= '"icon": "'.$globalURL.'/images/airport.png",'; |
38 | 38 | } elseif ($spotter_item['type'] == 'heliport') { |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | $output .= '}'; |
60 | 60 | $output .= '},'; |
61 | 61 | } |
62 | - $output = substr($output, 0, -1); |
|
62 | + $output = substr($output, 0, -1); |
|
63 | 63 | } |
64 | 64 | $output .= ']}'; |
65 | 65 | print $output; |