@@ -48,11 +48,11 @@ discard block |
||
48 | 48 | $s3 = sin($bank/2); |
49 | 49 | $c1c2 = $c1*$c2; |
50 | 50 | $s1s2 = $s1*$s2; |
51 | - $w =$c1c2*$c3 - $s1s2*$s3; |
|
52 | - $x =$c1c2*$s3 + $s1s2*$c3; |
|
53 | - $y =$s1*$c2*$c3 + $c1*$s2*$s3; |
|
54 | - $z =$c1*$s2*$c3 - $s1*$c2*$s3; |
|
55 | - return array('x' => $x,'y' => $y,'z' => $z,'w' => $w); |
|
51 | + $w = $c1c2*$c3 - $s1s2*$s3; |
|
52 | + $x = $c1c2*$s3 + $s1s2*$c3; |
|
53 | + $y = $s1*$c2*$c3 + $c1*$s2*$s3; |
|
54 | + $z = $c1*$s2*$c3 - $s1*$c2*$s3; |
|
55 | + return array('x' => $x, 'y' => $y, 'z' => $z, 'w' => $w); |
|
56 | 56 | // return array('x' => '0.0','y' => '-0.931','z' => '0.0','w' => '0.365'); |
57 | 57 | |
58 | 58 | } |
@@ -73,17 +73,17 @@ discard block |
||
73 | 73 | $min = false; |
74 | 74 | $allhistory = false; |
75 | 75 | $filter['source'] = array(); |
76 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
77 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
78 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
79 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs')); |
|
80 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
81 | -if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
82 | -if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING); |
|
83 | -if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
84 | -if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
85 | -if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
86 | -if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING); |
|
76 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'], array('vatsimtxt')); |
|
77 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'], array('whazzup')); |
|
78 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'], array('phpvmacars')); |
|
79 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'], array('sbs', 'famaprs')); |
|
80 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'], array('aprs')); |
|
81 | +if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'], FILTER_SANITIZE_STRING); |
|
82 | +if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'], FILTER_SANITIZE_STRING); |
|
83 | +if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',', $_COOKIE['filter_Airlines']), FILTER_SANITIZE_STRING); |
|
84 | +if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',', $_COOKIE['filter_Sources']), FILTER_SANITIZE_STRING); |
|
85 | +if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'], FILTER_SANITIZE_STRING); |
|
86 | +if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'], FILTER_SANITIZE_STRING); |
|
87 | 87 | /* |
88 | 88 | if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) { |
89 | 89 | $min = true; |
@@ -130,12 +130,12 @@ discard block |
||
130 | 130 | $from_archive = true; |
131 | 131 | // $begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
132 | 132 | // $enddate = filter_input(INPUT_GET,'enddate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
133 | - $begindate = filter_input(INPUT_GET,'begindate',FILTER_SANITIZE_NUMBER_INT); |
|
134 | - $enddate = filter_input(INPUT_GET,'enddate',FILTER_SANITIZE_NUMBER_INT); |
|
135 | - $archivespeed = filter_input(INPUT_GET,'speed',FILTER_SANITIZE_NUMBER_INT); |
|
136 | - $begindate = date('Y-m-d H:i:s',$begindate); |
|
137 | - $enddate = date('Y-m-d H:i:s',$enddate); |
|
138 | - $spotter_array = $SpotterArchive->getMinLiveSpotterDataPlayback($begindate,$enddate,$filter); |
|
133 | + $begindate = filter_input(INPUT_GET, 'begindate', FILTER_SANITIZE_NUMBER_INT); |
|
134 | + $enddate = filter_input(INPUT_GET, 'enddate', FILTER_SANITIZE_NUMBER_INT); |
|
135 | + $archivespeed = filter_input(INPUT_GET, 'speed', FILTER_SANITIZE_NUMBER_INT); |
|
136 | + $begindate = date('Y-m-d H:i:s', $begindate); |
|
137 | + $enddate = date('Y-m-d H:i:s', $enddate); |
|
138 | + $spotter_array = $SpotterArchive->getMinLiveSpotterDataPlayback($begindate, $enddate, $filter); |
|
139 | 139 | } elseif (isset($_COOKIE['archive']) && isset($_COOKIE['archive_begin']) && isset($_COOKIE['archive_end']) && isset($_COOKIE['archive_speed'])) { |
140 | 140 | $from_archive = true; |
141 | 141 | // $begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
@@ -145,46 +145,46 @@ discard block |
||
145 | 145 | $begindate = $_COOKIE['archive_begin']; |
146 | 146 | $enddate = $_COOKIE['archive_end']; |
147 | 147 | |
148 | - $archivespeed = filter_var($_COOKIE['archive_speed'],FILTER_SANITIZE_NUMBER_INT); |
|
149 | - $begindate = date('Y-m-d H:i:s',$begindate); |
|
150 | - $enddate = date('Y-m-d H:i:s',$enddate); |
|
148 | + $archivespeed = filter_var($_COOKIE['archive_speed'], FILTER_SANITIZE_NUMBER_INT); |
|
149 | + $begindate = date('Y-m-d H:i:s', $begindate); |
|
150 | + $enddate = date('Y-m-d H:i:s', $enddate); |
|
151 | 151 | // echo 'Begin : '.$begindate.' - End : '.$enddate."\n"; |
152 | - $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate,$enddate,$filter); |
|
152 | + $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate, $enddate, $filter); |
|
153 | 153 | } elseif ($tracker) { |
154 | 154 | $coord = array(); |
155 | 155 | if (isset($_GET['coord']) && $_GET['coord'] != '') { |
156 | - $coord = explode(',',$_GET['coord']); |
|
157 | - 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) |
|
156 | + $coord = explode(',', $_GET['coord']); |
|
157 | + 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) |
|
158 | 158 | && $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)) { |
159 | 159 | $coord = array(); |
160 | 160 | } |
161 | 161 | } |
162 | - $spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord,$filter,true); |
|
162 | + $spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord, $filter, true); |
|
163 | 163 | } elseif ($marine) { |
164 | 164 | $coord = array(); |
165 | 165 | if (isset($_GET['coord']) && $_GET['coord'] != '') { |
166 | - $coord = explode(',',$_GET['coord']); |
|
167 | - 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) |
|
166 | + $coord = explode(',', $_GET['coord']); |
|
167 | + 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) |
|
168 | 168 | && $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)) { |
169 | 169 | $coord = array(); |
170 | 170 | } |
171 | 171 | } |
172 | - $spotter_array = $MarineLive->getMinLastLiveMarineData($coord,$filter,true); |
|
172 | + $spotter_array = $MarineLive->getMinLastLiveMarineData($coord, $filter, true); |
|
173 | 173 | } else { |
174 | 174 | $coord = array(); |
175 | 175 | if (isset($_GET['coord']) && $_GET['coord'] != '') { |
176 | - $coord = explode(',',$_GET['coord']); |
|
177 | - 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) |
|
176 | + $coord = explode(',', $_GET['coord']); |
|
177 | + 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) |
|
178 | 178 | && $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)) { |
179 | 179 | $coord = array(); |
180 | 180 | } |
181 | 181 | } |
182 | - $spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord,$filter,true); |
|
182 | + $spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord, $filter, true); |
|
183 | 183 | } |
184 | 184 | //print_r($spotter_array); |
185 | 185 | if (!empty($spotter_array) && isset($coord)) { |
186 | 186 | if (isset($_GET['archive'])) { |
187 | - $flightcnt = $SpotterArchive->getLiveSpotterCount($begindate,$enddate,$filter); |
|
187 | + $flightcnt = $SpotterArchive->getLiveSpotterCount($begindate, $enddate, $filter); |
|
188 | 188 | } elseif ($tracker) { |
189 | 189 | $flightcnt = $TrackerLive->getLiveTrackerCount($filter); |
190 | 190 | } elseif ($marine) { |
@@ -195,15 +195,15 @@ discard block |
||
195 | 195 | if ($flightcnt == '') $flightcnt = 0; |
196 | 196 | } else $flightcnt = 0; |
197 | 197 | |
198 | -$sqltime = round(microtime(true)-$begintime,2); |
|
198 | +$sqltime = round(microtime(true) - $begintime, 2); |
|
199 | 199 | $minitime = time(); |
200 | 200 | $maxitime = 0; |
201 | -$lastupdate = filter_input(INPUT_GET,'update',FILTER_SANITIZE_NUMBER_INT); |
|
201 | +$lastupdate = filter_input(INPUT_GET, 'update', FILTER_SANITIZE_NUMBER_INT); |
|
202 | 202 | $modelsdb = array(); |
203 | 203 | if (file_exists(dirname(__FILE__).'/models/modelsdb')) { |
204 | - if (($handle = fopen(dirname(__FILE__).'/models/modelsdb','r')) !== FALSE) { |
|
205 | - while (($row = fgetcsv($handle,1000)) !== FALSE) { |
|
206 | - if (isset($row[1]) ){ |
|
204 | + if (($handle = fopen(dirname(__FILE__).'/models/modelsdb', 'r')) !== FALSE) { |
|
205 | + while (($row = fgetcsv($handle, 1000)) !== FALSE) { |
|
206 | + if (isset($row[1])) { |
|
207 | 207 | $model = $row[0]; |
208 | 208 | $modelsdb[$model] = $row[1]; |
209 | 209 | } |
@@ -213,9 +213,9 @@ discard block |
||
213 | 213 | } |
214 | 214 | $modelsdb2 = array(); |
215 | 215 | if (file_exists(dirname(__FILE__).'/models/gltf2/modelsdb')) { |
216 | - if (($handle = fopen(dirname(__FILE__).'/models/gltf2/modelsdb','r')) !== FALSE) { |
|
217 | - while (($row = fgetcsv($handle,1000)) !== FALSE) { |
|
218 | - if (isset($row[1]) ){ |
|
216 | + if (($handle = fopen(dirname(__FILE__).'/models/gltf2/modelsdb', 'r')) !== FALSE) { |
|
217 | + while (($row = fgetcsv($handle, 1000)) !== FALSE) { |
|
218 | + if (isset($row[1])) { |
|
219 | 219 | $model = $row[0]; |
220 | 220 | $modelsdb2[$model] = $row[1]; |
221 | 221 | } |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | if (!empty($spotter_array) && is_array($spotter_array)) |
254 | 254 | { |
255 | 255 | $nblatlong = 0; |
256 | - foreach($spotter_array as $spotter_item) |
|
256 | + foreach ($spotter_array as $spotter_item) |
|
257 | 257 | { |
258 | 258 | $j++; |
259 | 259 | //if (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'airwhere') $heightrelative = 'RELATIVE_TO_GROUND'; |
@@ -295,9 +295,9 @@ discard block |
||
295 | 295 | $output .= '"lastupdate": "'.$lastupdate.'",'; |
296 | 296 | $output .= '"format": "'.$spotter_item['format_source'].'",'; |
297 | 297 | if ($tracker) { |
298 | - $output.= '"type": "tracker"'; |
|
298 | + $output .= '"type": "tracker"'; |
|
299 | 299 | } elseif ($marine) { |
300 | - $output.= '"type": "marine"'; |
|
300 | + $output .= '"type": "marine"'; |
|
301 | 301 | } else { |
302 | 302 | if (isset($globalMap3DLiveries) && $globalMap3DLiveries) { |
303 | 303 | $aircraft_icao = $spotter_item['aircraft_icao']; |
@@ -311,14 +311,14 @@ discard block |
||
311 | 311 | if (isset($airline_icao)) { |
312 | 312 | $imagefile = $aircraft_icao.'-'.$airline_icao.'.png'; |
313 | 313 | if (file_exists(dirname(__FILE__).'/models/gltf2/liveries/'.$imagefile)) { |
314 | - $output.= '"liveries": "'.$globalURL.'/models/gltf2/liveries/'.$imagefile.'",'; |
|
314 | + $output .= '"liveries": "'.$globalURL.'/models/gltf2/liveries/'.$imagefile.'",'; |
|
315 | 315 | } |
316 | 316 | } |
317 | 317 | } |
318 | - if ($ident != '') $output.= '"ident": "'.$ident.'",'; |
|
318 | + if ($ident != '') $output .= '"ident": "'.$ident.'",'; |
|
319 | 319 | } |
320 | - $output.= '"gltf2": %gltf2%,'; |
|
321 | - $output.= '"type": "flight"'; |
|
320 | + $output .= '"gltf2": %gltf2%,'; |
|
321 | + $output .= '"type": "flight"'; |
|
322 | 322 | } |
323 | 323 | $output .= '},'; |
324 | 324 | |
@@ -671,8 +671,8 @@ discard block |
||
671 | 671 | $output .= '},'; |
672 | 672 | } |
673 | 673 | } |
674 | - if (isset($onground) && $onground) $output = str_replace('%onground%','true',$output); |
|
675 | - else $output = str_replace('%onground%','false',$output); |
|
674 | + if (isset($onground) && $onground) $output = str_replace('%onground%', 'true', $output); |
|
675 | + else $output = str_replace('%onground%', 'false', $output); |
|
676 | 676 | |
677 | 677 | // $output .= '"heightReference": "CLAMP_TO_GROUND",'; |
678 | 678 | //$output .= '"heightReference": "'.$heightrelative.'",'; |
@@ -687,7 +687,7 @@ discard block |
||
687 | 687 | $output .= '"cartographicDegrees": ['; |
688 | 688 | if ($minitime > strtotime($spotter_item['date'])) $minitime = strtotime($spotter_item['date']); |
689 | 689 | if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']); |
690 | - $output .= '"'.date("c",strtotime($spotter_item['date'])).'", '; |
|
690 | + $output .= '"'.date("c", strtotime($spotter_item['date'])).'", '; |
|
691 | 691 | $output .= $spotter_item['longitude'].', '; |
692 | 692 | $output .= $spotter_item['latitude']; |
693 | 693 | $prevlong = $spotter_item['longitude']; |
@@ -715,8 +715,8 @@ discard block |
||
715 | 715 | //$quat = quaternionrotate(deg2rad($spotter_item['heading']),deg2rad(0),deg2rad(0)); |
716 | 716 | //$orientation .= '"'.date("c",strtotime($spotter_item['date'])).'",'.$quat['x'].','.$quat['y'].','.$quat['z'].','.$quat['w']; |
717 | 717 | } else { |
718 | - $nblatlong = $nblatlong+1; |
|
719 | - $output .= ',"'.date("c",strtotime($spotter_item['date'])).'", '; |
|
718 | + $nblatlong = $nblatlong + 1; |
|
719 | + $output .= ',"'.date("c", strtotime($spotter_item['date'])).'", '; |
|
720 | 720 | if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']); |
721 | 721 | if ($spotter_item['ground_speed'] == 0) { |
722 | 722 | $output .= $prevlong.', '; |
@@ -756,17 +756,17 @@ discard block |
||
756 | 756 | } |
757 | 757 | $output .= ']'; |
758 | 758 | if (isset($globalArchive) && $globalArchive === TRUE) { |
759 | - if ((time()-$globalLiveInterval) > $minitime) { |
|
760 | - if (time()-$globalLiveInterval > $maxitime) { |
|
761 | - $output = str_replace('%minitime%',date("c",$maxitime),$output); |
|
759 | + if ((time() - $globalLiveInterval) > $minitime) { |
|
760 | + if (time() - $globalLiveInterval > $maxitime) { |
|
761 | + $output = str_replace('%minitime%', date("c", $maxitime), $output); |
|
762 | 762 | } else { |
763 | - $output = str_replace('%minitime%',date("c",time()-$globalLiveInterval),$output); |
|
763 | + $output = str_replace('%minitime%', date("c", time() - $globalLiveInterval), $output); |
|
764 | 764 | } |
765 | 765 | } |
766 | - else $output = str_replace('%minitime%',date("c",$minitime),$output); |
|
767 | -} else $output = str_replace('%minitime%',date("c",$minitime),$output); |
|
768 | -$output = str_replace('%maxitime%',date("c",$maxitime),$output); |
|
769 | -if ($gltf2) $output = str_replace('%gltf2%','true',$output); |
|
770 | -else $output = str_replace('%gltf2%','false',$output); |
|
766 | + else $output = str_replace('%minitime%', date("c", $minitime), $output); |
|
767 | +} else $output = str_replace('%minitime%', date("c", $minitime), $output); |
|
768 | +$output = str_replace('%maxitime%', date("c", $maxitime), $output); |
|
769 | +if ($gltf2) $output = str_replace('%gltf2%', 'true', $output); |
|
770 | +else $output = str_replace('%gltf2%', 'false', $output); |
|
771 | 771 | print $output; |
772 | 772 | ?> |
@@ -55,17 +55,17 @@ discard block |
||
55 | 55 | $min = true; |
56 | 56 | $allhistory = false; |
57 | 57 | $filter['source'] = array(); |
58 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
59 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
60 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
61 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs')); |
|
62 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
63 | -if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
64 | -if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING); |
|
65 | -if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
66 | -if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
67 | -if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
68 | -if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING); |
|
58 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'], array('vatsimtxt')); |
|
59 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'], array('whazzup')); |
|
60 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'], array('phpvmacars')); |
|
61 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'], array('sbs', 'famaprs')); |
|
62 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'], array('aprs')); |
|
63 | +if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'], FILTER_SANITIZE_STRING); |
|
64 | +if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'], FILTER_SANITIZE_STRING); |
|
65 | +if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',', $_COOKIE['filter_Airlines']), FILTER_SANITIZE_STRING); |
|
66 | +if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',', $_COOKIE['filter_Sources']), FILTER_SANITIZE_STRING); |
|
67 | +if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'], FILTER_SANITIZE_STRING); |
|
68 | +if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'], FILTER_SANITIZE_STRING); |
|
69 | 69 | |
70 | 70 | if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) { |
71 | 71 | $min = true; |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | $spotter_array = array(); |
75 | 75 | |
76 | 76 | if (isset($_GET['ident'])) { |
77 | - $ident = urldecode(filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING)); |
|
77 | + $ident = urldecode(filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING)); |
|
78 | 78 | if ($tracker) { |
79 | 79 | $spotter_array = $TrackerLive->getLastLiveTrackerDataByIdent($ident); |
80 | 80 | } elseif ($marine) { |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | } |
89 | 89 | $allhistory = true; |
90 | 90 | } elseif (isset($_GET['flightaware_id'])) { |
91 | - $flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING); |
|
91 | + $flightaware_id = filter_input(INPUT_GET, 'flightaware_id', FILTER_SANITIZE_STRING); |
|
92 | 92 | $spotter_array = $SpotterLive->getLastLiveSpotterDataById($flightaware_id); |
93 | 93 | if (empty($spotter_array)) { |
94 | 94 | $from_archive = true; |
@@ -96,50 +96,50 @@ discard block |
||
96 | 96 | } |
97 | 97 | $allhistory = true; |
98 | 98 | } elseif (isset($_GET['famtrack_id'])) { |
99 | - $famtrack_id = urldecode(filter_input(INPUT_GET,'famtrack_id',FILTER_SANITIZE_STRING)); |
|
99 | + $famtrack_id = urldecode(filter_input(INPUT_GET, 'famtrack_id', FILTER_SANITIZE_STRING)); |
|
100 | 100 | $spotter_array = $TrackerLive->getLastLiveTrackerDataById($famtrack_id); |
101 | 101 | $allhistory = true; |
102 | 102 | } elseif (isset($_GET['fammarine_id'])) { |
103 | - $fammarine_id = urldecode(filter_input(INPUT_GET,'fammarine_id',FILTER_SANITIZE_STRING)); |
|
103 | + $fammarine_id = urldecode(filter_input(INPUT_GET, 'fammarine_id', FILTER_SANITIZE_STRING)); |
|
104 | 104 | $spotter_array = $MarineLive->getLastLiveMarineDataById($fammarine_id); |
105 | 105 | $allhistory = true; |
106 | 106 | } elseif (isset($globalMapUseBbox) && $globalMapUseBbox && isset($_GET['coord']) && (!isset($globalMapPopup) || $globalMapPopup || (isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true'))) { |
107 | 107 | //} elseif (isset($_GET['coord'])) { |
108 | 108 | $usecoord = true; |
109 | - $coord = explode(',',$_GET['coord']); |
|
110 | - 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) |
|
109 | + $coord = explode(',', $_GET['coord']); |
|
110 | + 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) |
|
111 | 111 | && $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) { |
112 | 112 | if ($tracker) { |
113 | - $spotter_array = $TrackerLive->getLiveTrackerDatabyCoord($coord,$filter); |
|
113 | + $spotter_array = $TrackerLive->getLiveTrackerDatabyCoord($coord, $filter); |
|
114 | 114 | } elseif ($marine) { |
115 | - $spotter_array = $MarineLive->getLiveMarineDatabyCoord($coord,$filter); |
|
115 | + $spotter_array = $MarineLive->getLiveMarineDatabyCoord($coord, $filter); |
|
116 | 116 | } else { |
117 | - $spotter_array = $SpotterLive->getLiveSpotterDatabyCoord($coord,$filter); |
|
117 | + $spotter_array = $SpotterLive->getLiveSpotterDatabyCoord($coord, $filter); |
|
118 | 118 | } |
119 | 119 | } |
120 | 120 | } elseif (isset($globalMapUseBbox) && $globalMapUseBbox && isset($_GET['coord']) && $min) { |
121 | 121 | $usecoord = true; |
122 | - $coord = explode(',',$_GET['coord']); |
|
123 | - 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) |
|
122 | + $coord = explode(',', $_GET['coord']); |
|
123 | + 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) |
|
124 | 124 | && $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) { |
125 | 125 | if ($tracker) { |
126 | - $spotter_array = $TrackerLive->getMinLiveTrackerDatabyCoord($coord,$filter); |
|
126 | + $spotter_array = $TrackerLive->getMinLiveTrackerDatabyCoord($coord, $filter); |
|
127 | 127 | } elseif ($marine) { |
128 | - $spotter_array = $MarineLive->getMinLiveMarineDatabyCoord($coord,$filter); |
|
128 | + $spotter_array = $MarineLive->getMinLiveMarineDatabyCoord($coord, $filter); |
|
129 | 129 | } else { |
130 | - $spotter_array = $SpotterLive->getMinLiveSpotterDatabyCoord($coord,$filter); |
|
130 | + $spotter_array = $SpotterLive->getMinLiveSpotterDatabyCoord($coord, $filter); |
|
131 | 131 | } |
132 | 132 | } |
133 | 133 | } elseif (isset($_GET['archive']) && isset($_GET['begindate']) && isset($_GET['enddate']) && isset($_GET['speed']) && !isset($_GET['tracker']) && !isset($_GET['marine'])) { |
134 | 134 | $from_archive = true; |
135 | 135 | // $begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
136 | 136 | // $enddate = filter_input(INPUT_GET,'enddate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
137 | - $begindate = filter_input(INPUT_GET,'begindate',FILTER_SANITIZE_NUMBER_INT); |
|
138 | - $enddate = filter_input(INPUT_GET,'enddate',FILTER_SANITIZE_NUMBER_INT); |
|
139 | - $archivespeed = filter_input(INPUT_GET,'speed',FILTER_SANITIZE_NUMBER_INT); |
|
140 | - $begindate = date('Y-m-d H:i:s',$begindate); |
|
141 | - $enddate = date('Y-m-d H:i:s',$enddate); |
|
142 | - $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate,$enddate,$filter); |
|
137 | + $begindate = filter_input(INPUT_GET, 'begindate', FILTER_SANITIZE_NUMBER_INT); |
|
138 | + $enddate = filter_input(INPUT_GET, 'enddate', FILTER_SANITIZE_NUMBER_INT); |
|
139 | + $archivespeed = filter_input(INPUT_GET, 'speed', FILTER_SANITIZE_NUMBER_INT); |
|
140 | + $begindate = date('Y-m-d H:i:s', $begindate); |
|
141 | + $enddate = date('Y-m-d H:i:s', $enddate); |
|
142 | + $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate, $enddate, $filter); |
|
143 | 143 | } elseif ($min) { |
144 | 144 | if ($tracker) { |
145 | 145 | $spotter_array = $TrackerLive->getMinLiveTrackerData($filter); |
@@ -151,17 +151,17 @@ discard block |
||
151 | 151 | # $min = true; |
152 | 152 | } else { |
153 | 153 | if ($tracker) { |
154 | - $spotter_array = $TrackerLive->getLiveTrackerData('','',$filter); |
|
154 | + $spotter_array = $TrackerLive->getLiveTrackerData('', '', $filter); |
|
155 | 155 | } elseif ($marine) { |
156 | - $spotter_array = $marineLive->getLiveMarineData('','',$filter); |
|
156 | + $spotter_array = $marineLive->getLiveMarineData('', '', $filter); |
|
157 | 157 | } else { |
158 | - $spotter_array = $SpotterLive->getLiveSpotterData('','',$filter); |
|
158 | + $spotter_array = $SpotterLive->getLiveSpotterData('', '', $filter); |
|
159 | 159 | } |
160 | 160 | } |
161 | 161 | |
162 | 162 | if ($usecoord) { |
163 | 163 | if (isset($_GET['archive'])) { |
164 | - $flightcnt = $SpotterArchive->getLiveSpotterCount($begindate,$enddate,$filter); |
|
164 | + $flightcnt = $SpotterArchive->getLiveSpotterCount($begindate, $enddate, $filter); |
|
165 | 165 | } else { |
166 | 166 | if ($tracker) { |
167 | 167 | $flightcnt = $TrackerLive->getLiveTrackerCount($filter); |
@@ -174,9 +174,9 @@ discard block |
||
174 | 174 | if ($flightcnt == '') $flightcnt = 0; |
175 | 175 | } else $flightcnt = 0; |
176 | 176 | |
177 | -$sqltime = round(microtime(true)-$begintime,2); |
|
177 | +$sqltime = round(microtime(true) - $begintime, 2); |
|
178 | 178 | |
179 | -$currenttime = filter_input(INPUT_GET,'currenttime',FILTER_SANITIZE_NUMBER_INT); |
|
179 | +$currenttime = filter_input(INPUT_GET, 'currenttime', FILTER_SANITIZE_NUMBER_INT); |
|
180 | 180 | if ($currenttime != '') $currenttime = round($currenttime/1000); |
181 | 181 | |
182 | 182 | if ((!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation == FALSE) || (isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'false')) $usenextlatlon = false; |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | if (!empty($spotter_array) && is_array($spotter_array)) |
196 | 196 | { |
197 | 197 | $output .= '"features": ['; |
198 | - foreach($spotter_array as $spotter_item) |
|
198 | + foreach ($spotter_array as $spotter_item) |
|
199 | 199 | { |
200 | 200 | $j++; |
201 | 201 | date_default_timezone_set('UTC'); |
@@ -251,8 +251,8 @@ discard block |
||
251 | 251 | */ |
252 | 252 | //$output .= '"fc": "'.$spotter_item['nb'].'",'; |
253 | 253 | if (isset($spotter_item['ident']) && $spotter_item['ident'] != '') { |
254 | - if ($compress) $output .= '"c": "'.str_replace('\\','',$spotter_item['ident']).'",'; |
|
255 | - else $output .= '"callsign": "'.str_replace('\\','',$spotter_item['ident']).'",'; |
|
254 | + if ($compress) $output .= '"c": "'.str_replace('\\', '', $spotter_item['ident']).'",'; |
|
255 | + else $output .= '"callsign": "'.str_replace('\\', '', $spotter_item['ident']).'",'; |
|
256 | 256 | //" |
257 | 257 | } else { |
258 | 258 | if ($compress) $output .= '"c": "NA",'; |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | if (isset($spotter_item['registration'])) $output .= '"registration": "'.$spotter_item['registration'].'",'; |
262 | 262 | if (isset($spotter_item['aircraft_name']) && isset($spotter_item['aircraft_type'])) { |
263 | 263 | $output .= '"aircraft_name": "'.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')",'; |
264 | - $output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ','_',$spotter_item['aircraft_name'])).'",'; |
|
264 | + $output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ', '_', $spotter_item['aircraft_name'])).'",'; |
|
265 | 265 | } elseif (isset($spotter_item['aircraft_type'])) { |
266 | 266 | $output .= '"aircraft_name": "NA ('.$spotter_item['aircraft_type'].')",'; |
267 | 267 | } elseif (!$min) { |
@@ -404,26 +404,26 @@ discard block |
||
404 | 404 | if ($currenttime != '') { |
405 | 405 | if (strtotime($spotter_item['date']) < $currenttime) { |
406 | 406 | if (isset($archivespeed)) { |
407 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading'],$archivespeed,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh)); |
|
407 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $spotter_item['heading'], $archivespeed, ($currenttime - strtotime($spotter_item['date']) + $globalMapRefresh)); |
|
408 | 408 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
409 | 409 | } elseif ($usenextlatlon) { |
410 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading'],1,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh)); |
|
410 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $spotter_item['heading'], 1, ($currenttime - strtotime($spotter_item['date']) + $globalMapRefresh)); |
|
411 | 411 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
412 | 412 | } |
413 | 413 | } |
414 | 414 | } else { |
415 | 415 | if (isset($archivespeed)) { |
416 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading'],$archivespeed); |
|
416 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $spotter_item['heading'], $archivespeed); |
|
417 | 417 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
418 | 418 | } elseif ($usenextlatlon) { |
419 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading']); |
|
419 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $spotter_item['heading']); |
|
420 | 420 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
421 | 421 | } |
422 | 422 | } |
423 | 423 | |
424 | 424 | if (!$min) $output .= '"image": "'.$image.'",'; |
425 | 425 | if (isset($spotter_item['image_copyright']) && $spotter_item['image_copyright'] != '') { |
426 | - $output .= '"image_copyright": "'.str_replace('"',"'",trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'',$spotter_item['image_copyright']))).'",'; |
|
426 | + $output .= '"image_copyright": "'.str_replace('"', "'", trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '', $spotter_item['image_copyright']))).'",'; |
|
427 | 427 | } |
428 | 428 | if (isset($spotter_item['image_source_website'])) { |
429 | 429 | $output .= '"image_source_website": "'.urlencode($spotter_item['image_source_website']).'",'; |
@@ -445,7 +445,7 @@ discard block |
||
445 | 445 | $output .= '"waypoints": "'.$spotter_item['waypoints'].'",'; |
446 | 446 | } |
447 | 447 | if (isset($spotter_item['acars'])) { |
448 | - $output .= '"acars": "'.trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"), '<br />',$spotter_item['acars']['message'])).'",'; |
|
448 | + $output .= '"acars": "'.trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '<br />', $spotter_item['acars']['message'])).'",'; |
|
449 | 449 | } |
450 | 450 | // type when not aircraft ? |
451 | 451 | if (isset($spotter_item['type'])) { |
@@ -465,7 +465,7 @@ discard block |
||
465 | 465 | if ($currenttime != '') { |
466 | 466 | if (strtotime($spotter_item['date']) < $currenttime) { |
467 | 467 | if (!isset($archivespeed)) $archivespeed = 1; |
468 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading'],$archivespeed,$currenttime-strtotime($spotter_item['date'])); |
|
468 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $spotter_item['heading'], $archivespeed, $currenttime - strtotime($spotter_item['date'])); |
|
469 | 469 | $output .= $nextcoord['longitude'].','.$nextcoord['latitude']; |
470 | 470 | } else { |
471 | 471 | $output .= $spotter_item['longitude'].', '; |
@@ -534,7 +534,7 @@ discard block |
||
534 | 534 | |
535 | 535 | } |
536 | 536 | */ |
537 | - $history = filter_input(INPUT_GET,'history',FILTER_SANITIZE_STRING); |
|
537 | + $history = filter_input(INPUT_GET, 'history', FILTER_SANITIZE_STRING); |
|
538 | 538 | if ($history == '' && isset($_COOKIE['history'])) $history = $_COOKIE['history']; |
539 | 539 | |
540 | 540 | if ( |
@@ -542,11 +542,11 @@ discard block |
||
542 | 542 | || ((isset($globalMapHistory) && $globalMapHistory) || $allhistory) |
543 | 543 | // || (isset($history) && $history != '' && $history != 'NA' && ($history == $spotter_item['ident'] || $history == $spotter_item['flightaware_id'])) |
544 | 544 | // || (isset($history) && $history != '' && $history != 'NA' && $history == $spotter_item['ident']) |
545 | - || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
|
545 | + || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id'])) |
|
546 | 546 | || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']) |
547 | - || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['fammarine_id'])) |
|
547 | + || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['fammarine_id'])) |
|
548 | 548 | || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['fammarine_id']) && $_GET['fammarine_id'] == $spotter_item['fammarine_id']) |
549 | - || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['famtrackid'])) |
|
549 | + || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['famtrackid'])) |
|
550 | 550 | || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['famtrackid']) && $_GET['famtrackid'] == $spotter_item['famtrackid']) |
551 | 551 | ) { |
552 | 552 | if ($tracker) { |
@@ -583,9 +583,9 @@ discard block |
||
583 | 583 | else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
584 | 584 | } |
585 | 585 | $output_history .= '['; |
586 | - $output_history .= $spotter_history['longitude'].', '; |
|
587 | - $output_history .= $spotter_history['latitude'].', '; |
|
588 | - $output_history .= $spotter_history['altitude']*30.48; |
|
586 | + $output_history .= $spotter_history['longitude'].', '; |
|
587 | + $output_history .= $spotter_history['latitude'].', '; |
|
588 | + $output_history .= $spotter_history['altitude']*30.48; |
|
589 | 589 | $output_history .= '],'; |
590 | 590 | /* |
591 | 591 | if ($from_archive === false) { |
@@ -603,8 +603,8 @@ discard block |
||
603 | 603 | else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history"},"geometry": {"type": "LineString","coordinates": ['; |
604 | 604 | } else $d = true; |
605 | 605 | $output_history .= '['; |
606 | - $output_history .= $spotter_history['longitude'].', '; |
|
607 | - $output_history .= $spotter_history['latitude']; |
|
606 | + $output_history .= $spotter_history['longitude'].', '; |
|
607 | + $output_history .= $spotter_history['latitude']; |
|
608 | 608 | $output_history .= '],'; |
609 | 609 | /* |
610 | 610 | if ($from_archive === false) { |
@@ -620,9 +620,9 @@ discard block |
||
620 | 620 | |
621 | 621 | if ($from_archive === false) { |
622 | 622 | $output_historyd = '['; |
623 | - $output_historyd .= $spotter_item['longitude'].', '; |
|
624 | - $output_historyd .= $spotter_item['latitude']; |
|
625 | - if (isset($spotter_history['altitude'])) $output_historyd .= ','.$spotter_item['altitude']*30.48; |
|
623 | + $output_historyd .= $spotter_item['longitude'].', '; |
|
624 | + $output_historyd .= $spotter_item['latitude']; |
|
625 | + if (isset($spotter_history['altitude'])) $output_historyd .= ','.$spotter_item['altitude']*30.48; |
|
626 | 626 | $output_historyd .= '],'; |
627 | 627 | //$output_history = $output_historyd.$output_history; |
628 | 628 | $output_history = $output_history.$output_historyd; |
@@ -636,7 +636,7 @@ discard block |
||
636 | 636 | } |
637 | 637 | } |
638 | 638 | |
639 | - if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
|
639 | + if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id'])) |
|
640 | 640 | || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
641 | 641 | && (isset($spotter_item['departure_airport']) |
642 | 642 | && $spotter_item['departure_airport'] != 'NA' |
@@ -670,7 +670,7 @@ discard block |
||
670 | 670 | |
671 | 671 | //if (isset($history) && $history != '' && $history == $spotter_item['ident'] && isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA' && isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA' && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") || (!isset($_COOKIE['MapRoute']) && (!isset($globalMapRoute) || (isset($globalMapRoute) && $globalMapRoute))))) { |
672 | 672 | //if (isset($history) && $history != '' && $history == $spotter_item['ident'] && isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA' && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") || (!isset($_COOKIE['MapRoute']) && (!isset($globalMapRoute) || (isset($globalMapRoute) && $globalMapRoute))))) { |
673 | - if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
|
673 | + if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id'])) |
|
674 | 674 | || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
675 | 675 | && (isset($spotter_item['arrival_airport']) |
676 | 676 | && $spotter_item['arrival_airport'] != 'NA' |
@@ -701,7 +701,7 @@ discard block |
||
701 | 701 | $output = substr($output, 0, -1); |
702 | 702 | $output .= ']'; |
703 | 703 | $output .= ',"initial_sqltime": "'.$sqltime.'",'; |
704 | - $output .= '"totaltime": "'.round(microtime(true)-$begintime,2).'",'; |
|
704 | + $output .= '"totaltime": "'.round(microtime(true) - $begintime, 2).'",'; |
|
705 | 705 | if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",'; |
706 | 706 | $output .= '"fc": "'.$j.'"'; |
707 | 707 | } else { |