@@ -516,8 +516,8 @@ discard block |
||
516 | 516 | } |
517 | 517 | } |
518 | 518 | <?php |
519 | - } else { |
|
520 | - ?> |
|
519 | + } else { |
|
520 | + ?> |
|
521 | 521 | if (map.getZoom() > 7) { |
522 | 522 | var style = { |
523 | 523 | "color": "#1a3151", |
@@ -536,7 +536,7 @@ discard block |
||
536 | 536 | layer_marine_data.addLayer(layer); |
537 | 537 | } |
538 | 538 | <?php |
539 | - } |
|
539 | + } |
|
540 | 540 | ?> |
541 | 541 | } |
542 | 542 | } |
@@ -5,11 +5,18 @@ discard block |
||
5 | 5 | setcookie("MapFormat",'2d'); |
6 | 6 | |
7 | 7 | // Compressed GeoJson is used if true |
8 | -if (!isset($globalJsonCompress)) $compress = true; |
|
9 | -else $compress = $globalJsonCompress; |
|
10 | -if (isset($_COOKIE['MarineIconColor'])) $MarineIconColor = $_COOKIE['MarineIconColor']; |
|
11 | -elseif (isset($globalMarineIconColor)) $MarineIconColor = $globalMarineIconColor; |
|
12 | -else $MarineIconColor = '1a3151'; |
|
8 | +if (!isset($globalJsonCompress)) { |
|
9 | + $compress = true; |
|
10 | +} else { |
|
11 | + $compress = $globalJsonCompress; |
|
12 | +} |
|
13 | +if (isset($_COOKIE['MarineIconColor'])) { |
|
14 | + $MarineIconColor = $_COOKIE['MarineIconColor']; |
|
15 | +} elseif (isset($globalMarineIconColor)) { |
|
16 | + $MarineIconColor = $globalMarineIconColor; |
|
17 | +} else { |
|
18 | + $MarineIconColor = '1a3151'; |
|
19 | +} |
|
13 | 20 | |
14 | 21 | ?> |
15 | 22 | |
@@ -175,7 +182,12 @@ discard block |
||
175 | 182 | <?php |
176 | 183 | } else { |
177 | 184 | ?> |
178 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
185 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
186 | + print $archiveupdatetime*1000; |
|
187 | +} else { |
|
188 | + print $globalMapRefresh*1000+20000; |
|
189 | +} |
|
190 | +?>+feature.properties.sqt*1000); |
|
179 | 191 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
180 | 192 | <?php |
181 | 193 | } |
@@ -232,7 +244,12 @@ discard block |
||
232 | 244 | <?php |
233 | 245 | } else { |
234 | 246 | ?> |
235 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
247 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
248 | + print $archiveupdatetime*1000; |
|
249 | +} else { |
|
250 | + print $globalMapRefresh*1000+20000; |
|
251 | +} |
|
252 | +?>+feature.properties.sqt*1000); |
|
236 | 253 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
237 | 254 | <?php |
238 | 255 | } |
@@ -288,7 +305,12 @@ discard block |
||
288 | 305 | <?php |
289 | 306 | } else { |
290 | 307 | ?> |
291 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
308 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
309 | + print $archiveupdatetime*1000; |
|
310 | +} else { |
|
311 | + print $globalMapRefresh*1000+20000; |
|
312 | +} |
|
313 | +?>+feature.properties.sqt*1000); |
|
292 | 314 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
293 | 315 | <?php |
294 | 316 | } |
@@ -696,7 +718,12 @@ discard block |
||
696 | 718 | } else { |
697 | 719 | //then load it again every 30 seconds |
698 | 720 | reloadMarinePage = setInterval( |
699 | - function(){if (noTimeout) getLiveMarineData(0)},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000; else print '30000'; ?>); |
|
721 | + function(){if (noTimeout) getLiveMarineData(0)},<?php if (isset($globalMapRefresh)) { |
|
722 | + print $globalMapRefresh*1000; |
|
723 | +} else { |
|
724 | + print '30000'; |
|
725 | +} |
|
726 | +?>); |
|
700 | 727 | } |
701 | 728 | |
702 | 729 | function MarineiconColor(color) { |
@@ -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": '; |
@@ -123,15 +123,21 @@ discard block |
||
123 | 123 | { |
124 | 124 | $title = sprintf(_("Detailed View for %s"),$spotter_array[0]['ident']); |
125 | 125 | $ident = $spotter_array[0]['ident']; |
126 | - if (isset($spotter_array[0]['latitude'])) $latitude = $spotter_array[0]['latitude']; |
|
127 | - if (isset($spotter_array[0]['longitude'])) $longitude = $spotter_array[0]['longitude']; |
|
126 | + if (isset($spotter_array[0]['latitude'])) { |
|
127 | + $latitude = $spotter_array[0]['latitude']; |
|
128 | + } |
|
129 | + if (isset($spotter_array[0]['longitude'])) { |
|
130 | + $longitude = $spotter_array[0]['longitude']; |
|
131 | + } |
|
128 | 132 | require_once('header.php'); |
129 | 133 | if (isset($globalArchive) && $globalArchive && $type == 'aircraft') { |
130 | 134 | // Requirement for altitude graph |
131 | 135 | $all_data = $SpotterArchive->getAltitudeSpeedArchiveSpotterDataById($spotter_array[0]['flightaware_id']); |
132 | 136 | if (isset($globalTimezone)) { |
133 | 137 | date_default_timezone_set($globalTimezone); |
134 | - } else date_default_timezone_set('UTC'); |
|
138 | + } else { |
|
139 | + date_default_timezone_set('UTC'); |
|
140 | + } |
|
135 | 141 | if (is_array($all_data) && count($all_data) > 1) { |
136 | 142 | print '<link href="'.$globalURL.'/css/c3.min.css" rel="stylesheet" type="text/css">'; |
137 | 143 | print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>'; |
@@ -205,18 +211,28 @@ discard block |
||
205 | 211 | print '<br/><br/><br/>'; |
206 | 212 | print '<h1>'.$spotter_array[0]['ident'].'</h1>'; |
207 | 213 | print '<div><span class="label">'._("Ident").'</span>'.$spotter_array[0]['ident'].'</div>'; |
208 | - if (isset($spotter_array[0]['blocked']) && $spotter_array[0]['blocked'] === true) print '<div>'._("Callsign is in blocked FAA list").'</div>'; |
|
214 | + if (isset($spotter_array[0]['blocked']) && $spotter_array[0]['blocked'] === true) { |
|
215 | + print '<div>'._("Callsign is in blocked FAA list").'</div>'; |
|
216 | + } |
|
209 | 217 | if (isset($spotter_array[0]['airline_icao'])) { |
210 | 218 | print '<div><span class="label">'._("Airline").'</span><a href="'.$globalURL.'/airline/'.$spotter_array[0]['airline_icao'].'">'.$spotter_array[0]['airline_name'].'</a></div>'; |
211 | 219 | } |
212 | - if ($type == 'aircraft') print '<div><span class="label">'._("Flight History").'</span><a href="http://flightaware.com/live/flight/'.$spotter_array[0]['ident'].'" target="_blank">'._("View the Flight History of this callsign").'</a></div>'; |
|
220 | + if ($type == 'aircraft') { |
|
221 | + print '<div><span class="label">'._("Flight History").'</span><a href="http://flightaware.com/live/flight/'.$spotter_array[0]['ident'].'" target="_blank">'._("View the Flight History of this callsign").'</a></div>'; |
|
222 | + } |
|
213 | 223 | print '</div>'; |
214 | 224 | |
215 | - if ($type == 'aircraft') include('ident-sub-menu.php'); |
|
225 | + if ($type == 'aircraft') { |
|
226 | + include('ident-sub-menu.php'); |
|
227 | + } |
|
216 | 228 | print '<div class="table column">'; |
217 | - if ($type == 'aircraft') print '<p>'.sprintf(_("The table below shows the detailed information of all flights with the ident/callsign of <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>'; |
|
218 | - elseif ($type == 'marine') print '<p>'.sprintf(_("The table below shows the detailed information of all vessels with the ident/callsign of <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>'; |
|
219 | - elseif ($type == 'tracker') print '<p>'.sprintf(_("The table below shows the detailed information of all trackers with the ident/callsign of <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>'; |
|
229 | + if ($type == 'aircraft') { |
|
230 | + print '<p>'.sprintf(_("The table below shows the detailed information of all flights with the ident/callsign of <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>'; |
|
231 | + } elseif ($type == 'marine') { |
|
232 | + print '<p>'.sprintf(_("The table below shows the detailed information of all vessels with the ident/callsign of <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>'; |
|
233 | + } elseif ($type == 'tracker') { |
|
234 | + print '<p>'.sprintf(_("The table below shows the detailed information of all trackers with the ident/callsign of <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>'; |
|
235 | + } |
|
220 | 236 | |
221 | 237 | include('table-output.php'); |
222 | 238 | print '<div class="pagination">'; |
@@ -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 | ?> |
@@ -575,8 +575,8 @@ discard block |
||
575 | 575 | } |
576 | 576 | } |
577 | 577 | <?php |
578 | - } else { |
|
579 | - ?> |
|
578 | + } else { |
|
579 | + ?> |
|
580 | 580 | if (map.getZoom() > 7) { |
581 | 581 | var style = { |
582 | 582 | "color": "#1a3151", |
@@ -595,7 +595,7 @@ discard block |
||
595 | 595 | layer_tracker_data.addLayer(layer); |
596 | 596 | } |
597 | 597 | <?php |
598 | - } |
|
598 | + } |
|
599 | 599 | ?> |
600 | 600 | } |
601 | 601 | } |
@@ -740,11 +740,11 @@ discard block |
||
740 | 740 | $( document ).ready(function() { |
741 | 741 | map.on('moveend', function() { |
742 | 742 | <?php |
743 | - if (isset($globalMapUseBbox) && $globalMapUseBbox && (!isset($archive) || $archive === false)) { |
|
743 | + if (isset($globalMapUseBbox) && $globalMapUseBbox && (!isset($archive) || $archive === false)) { |
|
744 | 744 | ?> |
745 | 745 | getLiveTrackerData(1); |
746 | 746 | <?php |
747 | - } |
|
747 | + } |
|
748 | 748 | ?> |
749 | 749 | }); |
750 | 750 |
@@ -5,10 +5,15 @@ discard block |
||
5 | 5 | setcookie("MapFormat",'2d'); |
6 | 6 | |
7 | 7 | // Compressed GeoJson is used if true |
8 | -if (!isset($globalJsonCompress)) $compress = true; |
|
9 | -else $compress = $globalJsonCompress; |
|
8 | +if (!isset($globalJsonCompress)) { |
|
9 | + $compress = true; |
|
10 | +} else { |
|
11 | + $compress = $globalJsonCompress; |
|
12 | +} |
|
10 | 13 | $archive = false; |
11 | -if (isset($_COOKIE['archive_begin']) && $_COOKIE['archive_begin'] != '') $archive = true; |
|
14 | +if (isset($_COOKIE['archive_begin']) && $_COOKIE['archive_begin'] != '') { |
|
15 | + $archive = true; |
|
16 | +} |
|
12 | 17 | ?> |
13 | 18 | |
14 | 19 | |
@@ -166,9 +171,13 @@ discard block |
||
166 | 171 | if (callsign != ""){ markerTrackerLabel += callsign; } |
167 | 172 | if (type != ""){ markerTrackerLabel += ' - '+type; } |
168 | 173 | <?php |
169 | - if (isset($_COOKIE['TrackerIconColor'])) $IconColor = $_COOKIE['TrackerIconColor']; |
|
170 | - elseif (isset($globalTrackerIconColor)) $IconColor = $globalTrackerIconColor; |
|
171 | - else $IconColor = '1a3151'; |
|
174 | + if (isset($_COOKIE['TrackerIconColor'])) { |
|
175 | + $IconColor = $_COOKIE['TrackerIconColor']; |
|
176 | + } elseif (isset($globalTrackerIconColor)) { |
|
177 | + $IconColor = $globalTrackerIconColor; |
|
178 | + } else { |
|
179 | + $IconColor = '1a3151'; |
|
180 | + } |
|
172 | 181 | if (!isset($ident) && !isset($famtrackid)) { |
173 | 182 | ?> |
174 | 183 | //info_tracker_update(feature.properties.fc); |
@@ -202,7 +211,12 @@ discard block |
||
202 | 211 | <?php |
203 | 212 | } else { |
204 | 213 | ?> |
205 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
214 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
215 | + print $archiveupdatetime*1000; |
|
216 | +} else { |
|
217 | + print $globalMapRefresh*1000+20000; |
|
218 | +} |
|
219 | +?>+feature.properties.sqt*1000); |
|
206 | 220 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
207 | 221 | <?php |
208 | 222 | } |
@@ -259,7 +273,12 @@ discard block |
||
259 | 273 | <?php |
260 | 274 | } else { |
261 | 275 | ?> |
262 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
276 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
277 | + print $archiveupdatetime*1000; |
|
278 | +} else { |
|
279 | + print $globalMapRefresh*1000+20000; |
|
280 | +} |
|
281 | +?>+feature.properties.sqt*1000); |
|
263 | 282 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
264 | 283 | <?php |
265 | 284 | } |
@@ -315,7 +334,12 @@ discard block |
||
315 | 334 | <?php |
316 | 335 | } else { |
317 | 336 | ?> |
318 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
337 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
338 | + print $archiveupdatetime*1000; |
|
339 | +} else { |
|
340 | + print $globalMapRefresh*1000+20000; |
|
341 | +} |
|
342 | +?>+feature.properties.sqt*1000); |
|
319 | 343 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
320 | 344 | <?php |
321 | 345 | } |
@@ -762,7 +786,12 @@ discard block |
||
762 | 786 | getLiveTrackerData(0); |
763 | 787 | //then load it again every 30 seconds |
764 | 788 | reloadTrackerPage = setInterval( |
765 | - function(){if (noTimeout) getLiveTrackerData(0)},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000; else print '30000'; ?>); |
|
789 | + function(){if (noTimeout) getLiveTrackerData(0)},<?php if (isset($globalMapRefresh)) { |
|
790 | + print $globalMapRefresh*1000; |
|
791 | +} else { |
|
792 | + print '30000'; |
|
793 | +} |
|
794 | +?>); |
|
766 | 795 | <?php |
767 | 796 | } |
768 | 797 | ?> |
@@ -98,21 +98,21 @@ discard block |
||
98 | 98 | var entityid = entity.id; |
99 | 99 | var lastupdateentity = entity.properties.valueOf('lastupdate')._lastupdate._value; |
100 | 100 | <?php |
101 | - if (isset($globalMapUseBbox) && $globalMapUseBbox) { |
|
101 | + if (isset($globalMapUseBbox) && $globalMapUseBbox) { |
|
102 | 102 | ?> |
103 | 103 | if (lastupdateentity != lastupdatetracker) { |
104 | 104 | viewer.dataSources.get(dsn).entities.remove(entity); |
105 | 105 | czmldstracker.entities.removeById(entityid); |
106 | 106 | } |
107 | 107 | <?php |
108 | - } else { |
|
108 | + } else { |
|
109 | 109 | ?> |
110 | 110 | if (parseInt(lastupdateentity) < Math.floor(Date.now()-<?php if (isset($globalMapRefresh)) print $globalMapRefresh*2000; else print '60000'; ?>)) { |
111 | 111 | viewer.dataSources.get(dsn).entities.remove(entity); |
112 | 112 | czmldstracker.entities.removeById(entityid); |
113 | 113 | } |
114 | 114 | <?php |
115 | - } |
|
115 | + } |
|
116 | 116 | ?> |
117 | 117 | } |
118 | 118 | } |
@@ -145,15 +145,15 @@ discard block |
||
145 | 145 | function updateTrackerData() { |
146 | 146 | lastupdatetracker = Date.now(); |
147 | 147 | <?php |
148 | - if (isset($globalMapUseBbox) && $globalMapUseBbox) { |
|
148 | + if (isset($globalMapUseBbox) && $globalMapUseBbox) { |
|
149 | 149 | ?> |
150 | 150 | var livetrackerdata = czmldstracker.process('<?php print $globalURL; ?>/live-czml.php?tracker&coord='+bbox()+'&update=' + lastupdatetracker); |
151 | 151 | <?php |
152 | - } else { |
|
152 | + } else { |
|
153 | 153 | ?> |
154 | 154 | var livetrackerdata = czmldstracker.process('<?php print $globalURL; ?>/live-czml.php?tracker&update=' + lastupdatetracker); |
155 | 155 | <?php |
156 | - } |
|
156 | + } |
|
157 | 157 | ?> |
158 | 158 | livetrackerdata.then(function (data) { |
159 | 159 | displayTrackerData(data); |
@@ -209,13 +209,13 @@ discard block |
||
209 | 209 | }, Cesium.ScreenSpaceEventType.LEFT_CLICK); |
210 | 210 | camera.moveEnd.addEventListener(function() { |
211 | 211 | <?php |
212 | - if (isset($globalMapUseBbox) && $globalMapUseBbox) { |
|
212 | + if (isset($globalMapUseBbox) && $globalMapUseBbox) { |
|
213 | 213 | ?> |
214 | 214 | if (typeof archive == 'undefined' || archive == false) { |
215 | 215 | updateTrackerData(); |
216 | 216 | } |
217 | 217 | <?php |
218 | - } |
|
218 | + } |
|
219 | 219 | ?> |
220 | 220 | }); |
221 | 221 |
@@ -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) { |
@@ -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 |
@@ -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 = $TrackerLive->getLiveTrackerCount($begindate,$enddate,$filter); |
|
254 | + $flightcnt = $TrackerLive->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 = $MarineLive->getLiveMarineCount($begindate,$enddate,$filter); |
|
260 | + $flightcnt = $MarineLive->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 | ?> |
@@ -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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8Beo2deoA9TWp76pd6g0q9cDNwKvAD8A84EfglLRBe2g+JWAfcEF68bPABOCoAl/gIPA5MA64FVgGnNhP292W3r0SeB1YVlJXAjcBP8XwyQUj9AKwAzg2+/fQSsBhoJxBAaALaIzenZGnD911wA7gEDAD2FFSpwOzgDHZ5T7+ZSlGd2d6AXgi5+qAn+O5U0PbBVwKtAD3AHuB8f3YGBUdncCGoQ4LE9XtGRqK9LnduVPRIu2BPqwD65IYbS7Qpql7Ql9YoJcy9bwzkgPrfOCj5G33+h54E/g0PAr5thq4ApgyEgNrc27aWwVaPTA1QJ4BjgTGFvhteV40EgPrgvTP7qlmZqFnl9WD+b2posN83E/NrEkOjlI/U1fkfUYa/pe5IE3qZPW8jFOqiyN7p3pAPX04c7AxYSoDDcAjKT2LgLXA6IR2M3Bviv59wDTgQGTPH84Qd8+HXfHcoUws2zM0HMjuUPep+xP2PWpnwtw0GJsldbBpewQwE/gbeDyt7H1gcW53O7AC+A3Yn6+/W+Ld9SnWA15DAVhc8xK2TuA9YHrCuhV4EngFuBx4YagG6qv8cF+T52kB2Zy+e1I8taUacNV+uBdXO7ABmJwJpwx8XQvF9TUCWM64tiQhbq/oMv+7BwFWpQzNT8vbVQul/wwAGzzdmXU1xuUAAAAASUVORK5CYII=","scale" : 0.5},'; |
|
511 | + } else { |
|
512 | + $output .= ' "billboard" : {"image" : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAfCAYAAACVgY94AAAACXBIWXMAAC4jAAAuIwF4pT92AAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLC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NrEkOjlI/U1fkfUYa/pe5IE3qZPW8jFOqiyN7p3pAPX04c7AxYSoDDcAjKT2LgLXA6IR2M3Bviv59wDTgQGTPH84Qd8+HXfHcoUws2zM0HMjuUPep+xP2PWpnwtw0GJsldbBpewQwE/gbeDyt7H1gcW53O7AC+A3Yn6+/W+Ld9SnWA15DAVhc8xK2TuA9YHrCuhV4EngFuBx4YagG6qv8cF+T52kB2Zy+e1I8taUacNV+uBdXO7ABmJwJpwx8XQvF9TUCWM64tiQhbq/oMv+7BwFWpQzNT8vbVQul/wwAGzzdmXU1xuUAAAAASUVORK5CYII=","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 | ?> |