@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | } |
| 9 | 9 | header('Content-Type: text/javascript'); |
| 10 | 10 | |
| 11 | -$race_id = filter_input(INPUT_GET,'race_id',FILTER_SANITIZE_NUMBER_INT); |
|
| 11 | +$race_id = filter_input(INPUT_GET, 'race_id', FILTER_SANITIZE_NUMBER_INT); |
|
| 12 | 12 | if ($race_id != '') { |
| 13 | 13 | $race_array = $Marine->getRace($race_id); |
| 14 | 14 | } else { |
@@ -18,10 +18,10 @@ discard block |
||
| 18 | 18 | $output = '{"type": "FeatureCollection","features": ['; |
| 19 | 19 | if (!empty($race_array)) |
| 20 | 20 | { |
| 21 | - $course = json_decode($race_array['race_markers'],true); |
|
| 21 | + $course = json_decode($race_array['race_markers'], true); |
|
| 22 | 22 | $i = 0; |
| 23 | 23 | $f = count($course); |
| 24 | - foreach($course as $marker) |
|
| 24 | + foreach ($course as $marker) |
|
| 25 | 25 | { |
| 26 | 26 | date_default_timezone_set('UTC'); |
| 27 | 27 | $output .= '{"type": "Feature",'; |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | $output .= '"type": "'.$marker['type'].'",'; |
| 34 | 34 | if ($i == 0 || $i == 1) { |
| 35 | 35 | $output .= '"icon": "images/tsk/tsk-start.png",'; |
| 36 | - } elseif ($i == $f-1 || $i == $f-2) { |
|
| 36 | + } elseif ($i == $f - 1 || $i == $f - 2) { |
|
| 37 | 37 | $output .= '"icon": "images/tsk/tsk-finish.png",'; |
| 38 | 38 | } elseif ($marker['type'] == 4) { |
| 39 | 39 | $output .= '"icon": "images/kardinalstonne.png",'; |
@@ -66,11 +66,11 @@ discard block |
||
| 66 | 66 | $s3 = sin($bank/2); |
| 67 | 67 | $c1c2 = $c1*$c2; |
| 68 | 68 | $s1s2 = $s1*$s2; |
| 69 | - $w =$c1c2*$c3 - $s1s2*$s3; |
|
| 70 | - $x =$c1c2*$s3 + $s1s2*$c3; |
|
| 71 | - $y =$s1*$c2*$c3 + $c1*$s2*$s3; |
|
| 72 | - $z =$c1*$s2*$c3 - $s1*$c2*$s3; |
|
| 73 | - return array('x' => $x,'y' => $y,'z' => $z,'w' => $w); |
|
| 69 | + $w = $c1c2*$c3 - $s1s2*$s3; |
|
| 70 | + $x = $c1c2*$s3 + $s1s2*$c3; |
|
| 71 | + $y = $s1*$c2*$c3 + $c1*$s2*$s3; |
|
| 72 | + $z = $c1*$s2*$c3 - $s1*$c2*$s3; |
|
| 73 | + return array('x' => $x, 'y' => $y, 'z' => $z, 'w' => $w); |
|
| 74 | 74 | // return array('x' => '0.0','y' => '-0.931','z' => '0.0','w' => '0.365'); |
| 75 | 75 | |
| 76 | 76 | } |
@@ -91,18 +91,18 @@ discard block |
||
| 91 | 91 | $min = false; |
| 92 | 92 | $allhistory = false; |
| 93 | 93 | $filter['source'] = array(); |
| 94 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
| 95 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
| 96 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
| 97 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs')); |
|
| 98 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
| 99 | -if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
| 100 | -if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING); |
|
| 101 | -if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
| 102 | -if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
| 103 | -if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
| 104 | -if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING); |
|
| 105 | -if (isset($_COOKIE['filter_race']) && $_COOKIE['filter_race'] != 'all') $filter['race'] = filter_var($_COOKIE['filter_race'],FILTER_SANITIZE_NUMBER_INT); |
|
| 94 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'], array('vatsimtxt')); |
|
| 95 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'], array('whazzup')); |
|
| 96 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'], array('phpvmacars')); |
|
| 97 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'], array('sbs', 'famaprs')); |
|
| 98 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'], array('aprs')); |
|
| 99 | +if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'], FILTER_SANITIZE_STRING); |
|
| 100 | +if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'], FILTER_SANITIZE_STRING); |
|
| 101 | +if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',', $_COOKIE['filter_Airlines']), FILTER_SANITIZE_STRING); |
|
| 102 | +if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',', $_COOKIE['filter_Sources']), FILTER_SANITIZE_STRING); |
|
| 103 | +if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'], FILTER_SANITIZE_STRING); |
|
| 104 | +if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'], FILTER_SANITIZE_STRING); |
|
| 105 | +if (isset($_COOKIE['filter_race']) && $_COOKIE['filter_race'] != 'all') $filter['race'] = filter_var($_COOKIE['filter_race'], FILTER_SANITIZE_NUMBER_INT); |
|
| 106 | 106 | if (isset($_COOKIE['filter_blocked']) && $_COOKIE['filter_blocked'] == 'true') $filter['blocked'] = true; |
| 107 | 107 | /* |
| 108 | 108 | if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) { |
@@ -150,17 +150,17 @@ discard block |
||
| 150 | 150 | $from_archive = true; |
| 151 | 151 | // $begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
| 152 | 152 | // $enddate = filter_input(INPUT_GET,'enddate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
| 153 | - $begindate = filter_input(INPUT_GET,'begindate',FILTER_SANITIZE_NUMBER_INT); |
|
| 154 | - $enddate = filter_input(INPUT_GET,'enddate',FILTER_SANITIZE_NUMBER_INT); |
|
| 155 | - $archivespeed = filter_input(INPUT_GET,'speed',FILTER_SANITIZE_NUMBER_INT); |
|
| 156 | - $begindate = date('Y-m-d H:i:s',$begindate); |
|
| 157 | - $enddate = date('Y-m-d H:i:s',$enddate); |
|
| 153 | + $begindate = filter_input(INPUT_GET, 'begindate', FILTER_SANITIZE_NUMBER_INT); |
|
| 154 | + $enddate = filter_input(INPUT_GET, 'enddate', FILTER_SANITIZE_NUMBER_INT); |
|
| 155 | + $archivespeed = filter_input(INPUT_GET, 'speed', FILTER_SANITIZE_NUMBER_INT); |
|
| 156 | + $begindate = date('Y-m-d H:i:s', $begindate); |
|
| 157 | + $enddate = date('Y-m-d H:i:s', $enddate); |
|
| 158 | 158 | if ($tracker) { |
| 159 | - $spotter_array = $TrackerArchive->getMinLiveTrackerDataPlayback($begindate,$enddate,$filter); |
|
| 159 | + $spotter_array = $TrackerArchive->getMinLiveTrackerDataPlayback($begindate, $enddate, $filter); |
|
| 160 | 160 | } elseif ($marine) { |
| 161 | - $spotter_array = $MarineArchive->getMinLiveMarineDataPlayback($begindate,$enddate,$filter); |
|
| 161 | + $spotter_array = $MarineArchive->getMinLiveMarineDataPlayback($begindate, $enddate, $filter); |
|
| 162 | 162 | } else { |
| 163 | - $spotter_array = $SpotterArchive->getMinLiveSpotterDataPlayback($begindate,$enddate,$filter); |
|
| 163 | + $spotter_array = $SpotterArchive->getMinLiveSpotterDataPlayback($begindate, $enddate, $filter); |
|
| 164 | 164 | } |
| 165 | 165 | } elseif (isset($_COOKIE['archive']) && isset($_COOKIE['archive_begin']) && isset($_COOKIE['archive_end']) && isset($_COOKIE['archive_speed'])) { |
| 166 | 166 | $from_archive = true; |
@@ -177,36 +177,36 @@ discard block |
||
| 177 | 177 | } |
| 178 | 178 | $enddate = $_COOKIE['archive_end']; |
| 179 | 179 | $enddateinitial = $_COOKIE['archive_end']; |
| 180 | - $archivespeed = filter_var($_COOKIE['archive_speed'],FILTER_SANITIZE_NUMBER_INT); |
|
| 181 | - $begindate = date('Y-m-d H:i:s',$begindate); |
|
| 182 | - $enddate = date('Y-m-d H:i:s',$enddate); |
|
| 180 | + $archivespeed = filter_var($_COOKIE['archive_speed'], FILTER_SANITIZE_NUMBER_INT); |
|
| 181 | + $begindate = date('Y-m-d H:i:s', $begindate); |
|
| 182 | + $enddate = date('Y-m-d H:i:s', $enddate); |
|
| 183 | 183 | //echo 'Begin : '.$begindate.' - End : '.$enddate."\n"; |
| 184 | 184 | if ($tracker) { |
| 185 | - $spotter_array = $TrackerArchive->getMinLiveTrackerData($begindate,$enddate,$filter); |
|
| 185 | + $spotter_array = $TrackerArchive->getMinLiveTrackerData($begindate, $enddate, $filter); |
|
| 186 | 186 | } elseif ($marine) { |
| 187 | - $spotter_array = $MarineArchive->getMinLiveMarineData($begindate,$enddate,$filter); |
|
| 187 | + $spotter_array = $MarineArchive->getMinLiveMarineData($begindate, $enddate, $filter); |
|
| 188 | 188 | } else { |
| 189 | - $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate,$enddate,$filter); |
|
| 189 | + $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate, $enddate, $filter); |
|
| 190 | 190 | } |
| 191 | 191 | } elseif ($tracker) { |
| 192 | 192 | $coord = array(); |
| 193 | 193 | if (isset($_GET['coord']) && $_GET['coord'] != '') { |
| 194 | - $coord = explode(',',$_GET['coord']); |
|
| 195 | - 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) |
|
| 194 | + $coord = explode(',', $_GET['coord']); |
|
| 195 | + 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) |
|
| 196 | 196 | && $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)) { |
| 197 | 197 | $coord = array(); |
| 198 | 198 | } |
| 199 | 199 | } |
| 200 | 200 | $previous_filter = $filter; |
| 201 | 201 | if ((isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') && (isset($_COOKIE['MapTrackTracker']) && $_COOKIE['MapTrackTracker'] != '')) { |
| 202 | - $filter = array_merge($filter,array('id' => $_COOKIE['MapTrackTracker'])); |
|
| 203 | - $spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord,$filter,false); |
|
| 202 | + $filter = array_merge($filter, array('id' => $_COOKIE['MapTrackTracker'])); |
|
| 203 | + $spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord, $filter, false); |
|
| 204 | 204 | /* |
| 205 | 205 | } elseif (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '' && !empty($coord)) { |
| 206 | 206 | $spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord,$filter,true,$_COOKIE['MapTrack']); |
| 207 | 207 | */ |
| 208 | 208 | } elseif (!isset($_COOKIE['singlemodel']) || $_COOKIE['singlemodel'] == 'false') { |
| 209 | - $spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord,$filter,false); |
|
| 209 | + $spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord, $filter, false); |
|
| 210 | 210 | } else { |
| 211 | 211 | $spotter_array = array(); |
| 212 | 212 | } |
@@ -215,8 +215,8 @@ discard block |
||
| 215 | 215 | $coord = array(); |
| 216 | 216 | //if (isset($_GET['coord']) && $_GET['coord'] != '') { |
| 217 | 217 | if (!((isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') && (isset($_COOKIE['MapTrackMarine']) && $_COOKIE['MapTrackMarine'] != '')) && isset($_GET['coord']) && $_GET['coord'] != '') { |
| 218 | - $coord = explode(',',$_GET['coord']); |
|
| 219 | - 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) |
|
| 218 | + $coord = explode(',', $_GET['coord']); |
|
| 219 | + 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) |
|
| 220 | 220 | && $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)) { |
| 221 | 221 | $coord = array(); |
| 222 | 222 | } |
@@ -225,11 +225,11 @@ discard block |
||
| 225 | 225 | if (((isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') || (!isset($_COOKIE['singlemodel']) && isset($globalMap3DSelected) && $globalMap3DSelected)) && (isset($_COOKIE['MapTrackMarine']) && $_COOKIE['MapTrackMarine'] != '')) { |
| 226 | 226 | //$filter = array_merge($filter,array('id' => $_COOKIE['MapTrackMarine'])); |
| 227 | 227 | //$spotter_array = $MarineLive->getMinLastLiveMarineData($coord,$filter,false); |
| 228 | - $spotter_array = $MarineLive->getMinLastLiveMarineDataByID($_COOKIE['MapTrackMarine'],$filter,false); |
|
| 228 | + $spotter_array = $MarineLive->getMinLastLiveMarineDataByID($_COOKIE['MapTrackMarine'], $filter, false); |
|
| 229 | 229 | } elseif (isset($_COOKIE['MapTrackMarine']) && $_COOKIE['MapTrackMarine'] != '' && !empty($coord)) { |
| 230 | - $spotter_array = $MarineLive->getMinLastLiveMarineData($coord,$filter,false,$_COOKIE['MapTrack']); |
|
| 230 | + $spotter_array = $MarineLive->getMinLastLiveMarineData($coord, $filter, false, $_COOKIE['MapTrack']); |
|
| 231 | 231 | } elseif (!isset($_COOKIE['singlemodel']) || $_COOKIE['singlemodel'] == 'false') { |
| 232 | - $spotter_array = $MarineLive->getMinLastLiveMarineData($coord,$filter,false); |
|
| 232 | + $spotter_array = $MarineLive->getMinLastLiveMarineData($coord, $filter, false); |
|
| 233 | 233 | } else { |
| 234 | 234 | $spotter_array = array(); |
| 235 | 235 | } |
@@ -237,8 +237,8 @@ discard block |
||
| 237 | 237 | } else { |
| 238 | 238 | $coord = array(); |
| 239 | 239 | if (!((isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') && (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '')) && isset($_GET['coord']) && $_GET['coord'] != '') { |
| 240 | - $coord = explode(',',$_GET['coord']); |
|
| 241 | - 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) |
|
| 240 | + $coord = explode(',', $_GET['coord']); |
|
| 241 | + 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) |
|
| 242 | 242 | && $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)) { |
| 243 | 243 | $coord = array(); |
| 244 | 244 | } |
@@ -246,14 +246,14 @@ discard block |
||
| 246 | 246 | $previous_filter = $filter; |
| 247 | 247 | if (((isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') || (!isset($_COOKIE['singlemodel']) && isset($globalMap3DSelected) && $globalMap3DSelected)) && (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '')) { |
| 248 | 248 | //$filter = array_merge($filter,array('id' => $_COOKIE['MapTrack'])); |
| 249 | - $spotter_array = $SpotterLive->getMinLastLiveSpotterDataByID($_COOKIE['MapTrack'],$filter,false); |
|
| 249 | + $spotter_array = $SpotterLive->getMinLastLiveSpotterDataByID($_COOKIE['MapTrack'], $filter, false); |
|
| 250 | 250 | //$spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord,$filter,false); |
| 251 | 251 | } elseif (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '') { |
| 252 | 252 | //$spotter_array = $SpotterLive->getMinLastLiveSpotterDataByID($_COOKIE['MapTrack'],$filter,false); |
| 253 | 253 | //if (empty($spotter_array)) $spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord,$filter,false,$_COOKIE['MapTrack']); |
| 254 | - $spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord,$filter,false,$_COOKIE['MapTrack']); |
|
| 254 | + $spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord, $filter, false, $_COOKIE['MapTrack']); |
|
| 255 | 255 | } elseif (!isset($_COOKIE['singlemodel']) || $_COOKIE['singlemodel'] == 'false') { |
| 256 | - $spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord,$filter,false); |
|
| 256 | + $spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord, $filter, false); |
|
| 257 | 257 | } else { |
| 258 | 258 | $spotter_array = array(); |
| 259 | 259 | } |
@@ -263,19 +263,19 @@ discard block |
||
| 263 | 263 | if (!empty($spotter_array) && isset($coord)) { |
| 264 | 264 | if ($tracker) { |
| 265 | 265 | if (isset($_GET['archive'])) { |
| 266 | - $flightcnt = $TrackerArchive->getLiveTrackerCount($begindate,$enddate,$filter); |
|
| 266 | + $flightcnt = $TrackerArchive->getLiveTrackerCount($begindate, $enddate, $filter); |
|
| 267 | 267 | } else { |
| 268 | 268 | $flightcnt = $TrackerLive->getLiveTrackerCount($filter); |
| 269 | 269 | } |
| 270 | 270 | } elseif ($marine) { |
| 271 | 271 | if (isset($_GET['archive'])) { |
| 272 | - $flightcnt = $MarineArchive->getLiveMarineCount($begindate,$enddate,$filter); |
|
| 272 | + $flightcnt = $MarineArchive->getLiveMarineCount($begindate, $enddate, $filter); |
|
| 273 | 273 | } else { |
| 274 | 274 | $flightcnt = $MarineLive->getLiveMarineCount($filter); |
| 275 | 275 | } |
| 276 | 276 | } else { |
| 277 | 277 | if (isset($_GET['archive'])) { |
| 278 | - $flightcnt = $SpotterArchive->getLiveSpotterCount($begindate,$enddate,$filter); |
|
| 278 | + $flightcnt = $SpotterArchive->getLiveSpotterCount($begindate, $enddate, $filter); |
|
| 279 | 279 | } else { |
| 280 | 280 | $flightcnt = $SpotterLive->getLiveSpotterCount($filter); |
| 281 | 281 | } |
@@ -283,17 +283,17 @@ discard block |
||
| 283 | 283 | if ($flightcnt == '') $flightcnt = 0; |
| 284 | 284 | } else $flightcnt = 0; |
| 285 | 285 | |
| 286 | -$sqltime = round(microtime(true)-$begintime,2); |
|
| 286 | +$sqltime = round(microtime(true) - $begintime, 2); |
|
| 287 | 287 | $minitime = time(); |
| 288 | 288 | $minitracktime_begin = time(); |
| 289 | 289 | $minitracktime = $minitracktime_begin; |
| 290 | 290 | $maxitime = 0; |
| 291 | -$lastupdate = filter_input(INPUT_GET,'update',FILTER_SANITIZE_NUMBER_INT); |
|
| 291 | +$lastupdate = filter_input(INPUT_GET, 'update', FILTER_SANITIZE_NUMBER_INT); |
|
| 292 | 292 | $modelsdb = array(); |
| 293 | 293 | if (file_exists(dirname(__FILE__).'/models/modelsdb')) { |
| 294 | - if (($handle = fopen(dirname(__FILE__).'/models/modelsdb','r')) !== FALSE) { |
|
| 295 | - while (($row = fgetcsv($handle,1000)) !== FALSE) { |
|
| 296 | - if (isset($row[1]) ){ |
|
| 294 | + if (($handle = fopen(dirname(__FILE__).'/models/modelsdb', 'r')) !== FALSE) { |
|
| 295 | + while (($row = fgetcsv($handle, 1000)) !== FALSE) { |
|
| 296 | + if (isset($row[1])) { |
|
| 297 | 297 | $model = $row[0]; |
| 298 | 298 | $modelsdb[$model] = $row[1]; |
| 299 | 299 | } |
@@ -303,9 +303,9 @@ discard block |
||
| 303 | 303 | } |
| 304 | 304 | $modelsdb2 = array(); |
| 305 | 305 | if (file_exists(dirname(__FILE__).'/models/gltf2/modelsdb')) { |
| 306 | - if (($handle = fopen(dirname(__FILE__).'/models/gltf2/modelsdb','r')) !== FALSE) { |
|
| 307 | - while (($row = fgetcsv($handle,1000)) !== FALSE) { |
|
| 308 | - if (isset($row[1]) ){ |
|
| 306 | + if (($handle = fopen(dirname(__FILE__).'/models/gltf2/modelsdb', 'r')) !== FALSE) { |
|
| 307 | + while (($row = fgetcsv($handle, 1000)) !== FALSE) { |
|
| 308 | + if (isset($row[1])) { |
|
| 309 | 309 | $model = $row[0]; |
| 310 | 310 | $glb = $row[1]; |
| 311 | 311 | if (isset($row[2])) { |
@@ -351,7 +351,7 @@ discard block |
||
| 351 | 351 | if (!empty($spotter_array) && is_array($spotter_array)) |
| 352 | 352 | { |
| 353 | 353 | $nblatlong = 0; |
| 354 | - foreach($spotter_array as $spotter_item) |
|
| 354 | + foreach ($spotter_array as $spotter_item) |
|
| 355 | 355 | { |
| 356 | 356 | $j++; |
| 357 | 357 | //if (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'airwhere') $heightrelative = 'RELATIVE_TO_GROUND'; |
@@ -405,17 +405,17 @@ discard block |
||
| 405 | 405 | } |
| 406 | 406 | if (isset($spotter_item['registration'])) $output .= '"registration": "'.$spotter_item['registration'].'",'; |
| 407 | 407 | if (isset($spotter_item['format_source'])) $output .= '"format": "'.$spotter_item['format_source'].'",'; |
| 408 | - if (isset($spotter_item['ident'])) $output.= '"ident": '.json_encode($spotter_item['ident']).','; |
|
| 408 | + if (isset($spotter_item['ident'])) $output .= '"ident": '.json_encode($spotter_item['ident']).','; |
|
| 409 | 409 | if ($tracker) { |
| 410 | 410 | if (isset($spotter_item['type'])) $output .= '"tracker_type": '.json_encode($spotter_item['type']).','; |
| 411 | - $output.= '"type": "tracker"'; |
|
| 411 | + $output .= '"type": "tracker"'; |
|
| 412 | 412 | } elseif ($marine) { |
| 413 | 413 | if (isset($spotter_item['type'])) $output .= '"marine_type": '.json_encode($spotter_item['type']).','; |
| 414 | 414 | if (isset($spotter_item['captain_name'])) $output .= '"captain": '.json_encode($spotter_item['captain_name']).','; |
| 415 | 415 | if (isset($spotter_item['race_id'])) $output .= '"raceid": '.$spotter_item['race_id'].','; |
| 416 | 416 | if (isset($spotter_item['race_name'])) $output .= '"race": '.json_encode($spotter_item['race_name']).','; |
| 417 | 417 | if (isset($spotter_item['race_rank'])) $output .= '"rank": "'.$spotter_item['race_rank'].'",'; |
| 418 | - $output.= '"type": "marine"'; |
|
| 418 | + $output .= '"type": "marine"'; |
|
| 419 | 419 | } else { |
| 420 | 420 | if ($one3dmodel === false && isset($globalMap3DLiveries) && $globalMap3DLiveries) { |
| 421 | 421 | $aircraft_icao = $spotter_item['aircraft_icao']; |
@@ -429,14 +429,14 @@ discard block |
||
| 429 | 429 | if (isset($airline_icao)) { |
| 430 | 430 | $imagefile = $aircraft_icao.'-'.$airline_icao.'.png'; |
| 431 | 431 | if (file_exists(dirname(__FILE__).'/models/gltf2/liveries/'.$imagefile)) { |
| 432 | - $output.= '"liveries": "'.$globalURL.'/models/gltf2/liveries/'.$imagefile.'",'; |
|
| 432 | + $output .= '"liveries": "'.$globalURL.'/models/gltf2/liveries/'.$imagefile.'",'; |
|
| 433 | 433 | } |
| 434 | 434 | } |
| 435 | 435 | } |
| 436 | 436 | //if ($ident != '') $output.= '"ident": "'.$ident.'",'; |
| 437 | 437 | } |
| 438 | - $output.= '"gltf2": %gltf2%,'; |
|
| 439 | - $output.= '"type": "flight"'; |
|
| 438 | + $output .= '"gltf2": %gltf2%,'; |
|
| 439 | + $output .= '"type": "flight"'; |
|
| 440 | 440 | } |
| 441 | 441 | $output .= '},'; |
| 442 | 442 | |
@@ -811,8 +811,8 @@ discard block |
||
| 811 | 811 | $output .= '},'; |
| 812 | 812 | } |
| 813 | 813 | } |
| 814 | - if (isset($onground) && $onground) $output = str_replace('%onground%','true',$output); |
|
| 815 | - else $output = str_replace('%onground%','false',$output); |
|
| 814 | + if (isset($onground) && $onground) $output = str_replace('%onground%', 'true', $output); |
|
| 815 | + else $output = str_replace('%onground%', 'false', $output); |
|
| 816 | 816 | |
| 817 | 817 | // $output .= '"heightReference": "CLAMP_TO_GROUND",'; |
| 818 | 818 | //$output .= '"heightReference": "'.$heightrelative.'",'; |
@@ -828,7 +828,7 @@ discard block |
||
| 828 | 828 | if ($minitime > strtotime($spotter_item['date'])) $minitime = strtotime($spotter_item['date']); |
| 829 | 829 | if (isset($_COOKIE['MapTrack']) && $id == $_COOKIE['MapTrack'] && $minitracktime > strtotime($spotter_item['date'])) $minitracktime = strtotime($spotter_item['date']); |
| 830 | 830 | if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']); |
| 831 | - $output .= '"'.date("c",strtotime($spotter_item['date'])).'", '; |
|
| 831 | + $output .= '"'.date("c", strtotime($spotter_item['date'])).'", '; |
|
| 832 | 832 | $output .= $spotter_item['longitude'].', '; |
| 833 | 833 | $output .= $spotter_item['latitude']; |
| 834 | 834 | $prevlong = $spotter_item['longitude']; |
@@ -856,8 +856,8 @@ discard block |
||
| 856 | 856 | //$quat = quaternionrotate(deg2rad($spotter_item['heading']),deg2rad(0),deg2rad(0)); |
| 857 | 857 | //$orientation .= '"'.date("c",strtotime($spotter_item['date'])).'",'.$quat['x'].','.$quat['y'].','.$quat['z'].','.$quat['w']; |
| 858 | 858 | } else { |
| 859 | - $nblatlong = $nblatlong+1; |
|
| 860 | - $output .= ',"'.date("c",strtotime($spotter_item['date'])).'", '; |
|
| 859 | + $nblatlong = $nblatlong + 1; |
|
| 860 | + $output .= ',"'.date("c", strtotime($spotter_item['date'])).'", '; |
|
| 861 | 861 | if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']); |
| 862 | 862 | if ($spotter_item['ground_speed'] == 0) { |
| 863 | 863 | $output .= $prevlong.', '; |
@@ -898,26 +898,26 @@ discard block |
||
| 898 | 898 | $output .= ']'; |
| 899 | 899 | if (isset($globalArchive) && $globalArchive === TRUE) { |
| 900 | 900 | if (isset($begindateinitial)) { |
| 901 | - $output = str_replace('%minitime%',date("c",$begindateinitial),$output); |
|
| 902 | - } elseif ((time()-$globalLiveInterval) > $minitime) { |
|
| 903 | - if (time()-$globalLiveInterval > $maxitime) { |
|
| 904 | - $output = str_replace('%minitime%',date("c",$maxitime),$output); |
|
| 901 | + $output = str_replace('%minitime%', date("c", $begindateinitial), $output); |
|
| 902 | + } elseif ((time() - $globalLiveInterval) > $minitime) { |
|
| 903 | + if (time() - $globalLiveInterval > $maxitime) { |
|
| 904 | + $output = str_replace('%minitime%', date("c", $maxitime), $output); |
|
| 905 | 905 | } else { |
| 906 | - $output = str_replace('%minitime%',date("c",time()-$globalLiveInterval),$output); |
|
| 906 | + $output = str_replace('%minitime%', date("c", time() - $globalLiveInterval), $output); |
|
| 907 | 907 | } |
| 908 | 908 | } |
| 909 | - else $output = str_replace('%minitime%',date("c",$minitime),$output); |
|
| 909 | + else $output = str_replace('%minitime%', date("c", $minitime), $output); |
|
| 910 | 910 | } elseif (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '' && $minitracktime != $minitracktime_begin) { |
| 911 | - $output = str_replace('%minitime%',date("c",$minitracktime),$output); |
|
| 911 | + $output = str_replace('%minitime%', date("c", $minitracktime), $output); |
|
| 912 | 912 | } else { |
| 913 | - $output = str_replace('%minitime%',date("c",$minitime),$output); |
|
| 913 | + $output = str_replace('%minitime%', date("c", $minitime), $output); |
|
| 914 | 914 | } |
| 915 | 915 | if (isset($enddateinitial)) { |
| 916 | - $output = str_replace('%maxitime%',date("c",$enddateinitial),$output); |
|
| 916 | + $output = str_replace('%maxitime%', date("c", $enddateinitial), $output); |
|
| 917 | 917 | } else { |
| 918 | - $output = str_replace('%maxitime%',date("c",$maxitime),$output); |
|
| 918 | + $output = str_replace('%maxitime%', date("c", $maxitime), $output); |
|
| 919 | 919 | } |
| 920 | -if ($gltf2) $output = str_replace('%gltf2%','true',$output); |
|
| 921 | -else $output = str_replace('%gltf2%','false',$output); |
|
| 920 | +if ($gltf2) $output = str_replace('%gltf2%', 'true', $output); |
|
| 921 | +else $output = str_replace('%gltf2%', 'false', $output); |
|
| 922 | 922 | print $output; |
| 923 | 923 | ?> |
@@ -26,8 +26,12 @@ discard block |
||
| 26 | 26 | } |
| 27 | 27 | $tracker = false; |
| 28 | 28 | $marine = false; |
| 29 | -if (isset($_GET['tracker'])) $tracker = true; |
|
| 30 | -if (isset($_GET['marine'])) $marine = true; |
|
| 29 | +if (isset($_GET['tracker'])) { |
|
| 30 | + $tracker = true; |
|
| 31 | +} |
|
| 32 | +if (isset($_GET['marine'])) { |
|
| 33 | + $marine = true; |
|
| 34 | +} |
|
| 31 | 35 | if ($tracker) { |
| 32 | 36 | require_once('require/class.Tracker.php'); |
| 33 | 37 | require_once('require/class.TrackerLive.php'); |
@@ -84,26 +88,55 @@ discard block |
||
| 84 | 88 | } |
| 85 | 89 | header('Content-Type: text/javascript'); |
| 86 | 90 | |
| 87 | -if (!isset($globalJsonCompress)) $compress = true; |
|
| 88 | -else $compress = $globalJsonCompress; |
|
| 91 | +if (!isset($globalJsonCompress)) { |
|
| 92 | + $compress = true; |
|
| 93 | +} else { |
|
| 94 | + $compress = $globalJsonCompress; |
|
| 95 | +} |
|
| 89 | 96 | |
| 90 | 97 | $from_archive = false; |
| 91 | 98 | $min = false; |
| 92 | 99 | $allhistory = false; |
| 93 | 100 | $filter['source'] = array(); |
| 94 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
| 95 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
| 96 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
| 97 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs')); |
|
| 98 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
| 99 | -if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
| 100 | -if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING); |
|
| 101 | -if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
| 102 | -if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
| 103 | -if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
| 104 | -if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING); |
|
| 105 | -if (isset($_COOKIE['filter_race']) && $_COOKIE['filter_race'] != 'all') $filter['race'] = filter_var($_COOKIE['filter_race'],FILTER_SANITIZE_NUMBER_INT); |
|
| 106 | -if (isset($_COOKIE['filter_blocked']) && $_COOKIE['filter_blocked'] == 'true') $filter['blocked'] = true; |
|
| 101 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') { |
|
| 102 | + $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
| 103 | +} |
|
| 104 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') { |
|
| 105 | + $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
| 106 | +} |
|
| 107 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') { |
|
| 108 | + $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
| 109 | +} |
|
| 110 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') { |
|
| 111 | + $filter['source'] = array_merge($filter['source'],array('sbs','famaprs')); |
|
| 112 | +} |
|
| 113 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') { |
|
| 114 | + $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
| 115 | +} |
|
| 116 | +if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') { |
|
| 117 | + $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
| 118 | +} |
|
| 119 | +if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') { |
|
| 120 | + $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING); |
|
| 121 | +} |
|
| 122 | +if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') { |
|
| 123 | + $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
| 124 | +} |
|
| 125 | +if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') { |
|
| 126 | + $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
| 127 | +} |
|
| 128 | +if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') { |
|
| 129 | + $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
| 130 | +} |
|
| 131 | +if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') { |
|
| 132 | + $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING); |
|
| 133 | +} |
|
| 134 | +if (isset($_COOKIE['filter_race']) && $_COOKIE['filter_race'] != 'all') { |
|
| 135 | + $filter['race'] = filter_var($_COOKIE['filter_race'],FILTER_SANITIZE_NUMBER_INT); |
|
| 136 | +} |
|
| 137 | +if (isset($_COOKIE['filter_blocked']) && $_COOKIE['filter_blocked'] == 'true') { |
|
| 138 | + $filter['blocked'] = true; |
|
| 139 | +} |
|
| 107 | 140 | /* |
| 108 | 141 | if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) { |
| 109 | 142 | $min = true; |
@@ -280,8 +313,12 @@ discard block |
||
| 280 | 313 | $flightcnt = $SpotterLive->getLiveSpotterCount($filter); |
| 281 | 314 | } |
| 282 | 315 | } |
| 283 | - if ($flightcnt == '') $flightcnt = 0; |
|
| 284 | -} else $flightcnt = 0; |
|
| 316 | + if ($flightcnt == '') { |
|
| 317 | + $flightcnt = 0; |
|
| 318 | + } |
|
| 319 | + } else { |
|
| 320 | + $flightcnt = 0; |
|
| 321 | +} |
|
| 285 | 322 | |
| 286 | 323 | $sqltime = round(microtime(true)-$begintime,2); |
| 287 | 324 | $minitime = time(); |
@@ -327,7 +364,9 @@ discard block |
||
| 327 | 364 | $gltf2 = false; |
| 328 | 365 | $scale = 1.0; |
| 329 | 366 | $minimumpixelsize = 20; |
| 330 | -if (isset($archivespeed)) $speed = $archivespeed; |
|
| 367 | +if (isset($archivespeed)) { |
|
| 368 | + $speed = $archivespeed; |
|
| 369 | +} |
|
| 331 | 370 | $output = '['; |
| 332 | 371 | if ($tracker) { |
| 333 | 372 | $output .= '{"id" : "document", "name" : "tracker","version" : "1.0"'; |
@@ -363,9 +402,13 @@ discard block |
||
| 363 | 402 | $image = "images/placeholder_thumb.png"; |
| 364 | 403 | } |
| 365 | 404 | |
| 366 | - if (isset($spotter_item['flightaware_id'])) $id = $spotter_item['flightaware_id']; |
|
| 367 | - elseif (isset($spotter_item['famtrackid'])) $id = $spotter_item['famtrackid']; |
|
| 368 | - elseif (isset($spotter_item['fammarine_id'])) $id = $spotter_item['fammarine_id']; |
|
| 405 | + if (isset($spotter_item['flightaware_id'])) { |
|
| 406 | + $id = $spotter_item['flightaware_id']; |
|
| 407 | + } elseif (isset($spotter_item['famtrackid'])) { |
|
| 408 | + $id = $spotter_item['famtrackid']; |
|
| 409 | + } elseif (isset($spotter_item['fammarine_id'])) { |
|
| 410 | + $id = $spotter_item['fammarine_id']; |
|
| 411 | + } |
|
| 369 | 412 | if ($prev_flightaware_id != $id) { |
| 370 | 413 | if ($prev_flightaware_id != '') { |
| 371 | 414 | /* |
@@ -403,18 +446,36 @@ discard block |
||
| 403 | 446 | if (isset($spotter_item['squawk'])) { |
| 404 | 447 | $output .= '"squawk": "'.$spotter_item['squawk'].'",'; |
| 405 | 448 | } |
| 406 | - if (isset($spotter_item['registration'])) $output .= '"registration": "'.$spotter_item['registration'].'",'; |
|
| 407 | - if (isset($spotter_item['format_source'])) $output .= '"format": "'.$spotter_item['format_source'].'",'; |
|
| 408 | - if (isset($spotter_item['ident'])) $output.= '"ident": '.json_encode($spotter_item['ident']).','; |
|
| 449 | + if (isset($spotter_item['registration'])) { |
|
| 450 | + $output .= '"registration": "'.$spotter_item['registration'].'",'; |
|
| 451 | + } |
|
| 452 | + if (isset($spotter_item['format_source'])) { |
|
| 453 | + $output .= '"format": "'.$spotter_item['format_source'].'",'; |
|
| 454 | + } |
|
| 455 | + if (isset($spotter_item['ident'])) { |
|
| 456 | + $output.= '"ident": '.json_encode($spotter_item['ident']).','; |
|
| 457 | + } |
|
| 409 | 458 | if ($tracker) { |
| 410 | - if (isset($spotter_item['type'])) $output .= '"tracker_type": '.json_encode($spotter_item['type']).','; |
|
| 459 | + if (isset($spotter_item['type'])) { |
|
| 460 | + $output .= '"tracker_type": '.json_encode($spotter_item['type']).','; |
|
| 461 | + } |
|
| 411 | 462 | $output.= '"type": "tracker"'; |
| 412 | 463 | } elseif ($marine) { |
| 413 | - if (isset($spotter_item['type'])) $output .= '"marine_type": '.json_encode($spotter_item['type']).','; |
|
| 414 | - if (isset($spotter_item['captain_name'])) $output .= '"captain": '.json_encode($spotter_item['captain_name']).','; |
|
| 415 | - if (isset($spotter_item['race_id'])) $output .= '"raceid": '.$spotter_item['race_id'].','; |
|
| 416 | - if (isset($spotter_item['race_name'])) $output .= '"race": '.json_encode($spotter_item['race_name']).','; |
|
| 417 | - if (isset($spotter_item['race_rank'])) $output .= '"rank": "'.$spotter_item['race_rank'].'",'; |
|
| 464 | + if (isset($spotter_item['type'])) { |
|
| 465 | + $output .= '"marine_type": '.json_encode($spotter_item['type']).','; |
|
| 466 | + } |
|
| 467 | + if (isset($spotter_item['captain_name'])) { |
|
| 468 | + $output .= '"captain": '.json_encode($spotter_item['captain_name']).','; |
|
| 469 | + } |
|
| 470 | + if (isset($spotter_item['race_id'])) { |
|
| 471 | + $output .= '"raceid": '.$spotter_item['race_id'].','; |
|
| 472 | + } |
|
| 473 | + if (isset($spotter_item['race_name'])) { |
|
| 474 | + $output .= '"race": '.json_encode($spotter_item['race_name']).','; |
|
| 475 | + } |
|
| 476 | + if (isset($spotter_item['race_rank'])) { |
|
| 477 | + $output .= '"rank": "'.$spotter_item['race_rank'].'",'; |
|
| 478 | + } |
|
| 418 | 479 | $output.= '"type": "marine"'; |
| 419 | 480 | } else { |
| 420 | 481 | if ($one3dmodel === false && isset($globalMap3DLiveries) && $globalMap3DLiveries) { |
@@ -465,7 +526,9 @@ discard block |
||
| 465 | 526 | $spotter_item['engine_type'] = $aircraft_info[0]['engine_type']; |
| 466 | 527 | $spotter_item['wake_category'] = $aircraft_info[0]['wake_category']; |
| 467 | 528 | $spotter_item['engine_count'] = $aircraft_info[0]['engine_count']; |
| 468 | - } else $aircraft_shadow = ''; |
|
| 529 | + } else { |
|
| 530 | + $aircraft_shadow = ''; |
|
| 531 | + } |
|
| 469 | 532 | $output .= ' "billboard" : {"image" : "'.$globalURL.'/images/aircrafts/new/'.$aircraft_shadow.'","scale" : 0.5'; |
| 470 | 533 | if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true' && isset($_COOKIE['IconColor'])) { |
| 471 | 534 | $rgb = $Common->hex2rgb($_COOKIE['IconColor']); |
@@ -473,7 +536,9 @@ discard block |
||
| 473 | 536 | } |
| 474 | 537 | $output .= '},'; |
| 475 | 538 | } |
| 476 | - } else $output .= ' "billboard" : {"image" : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAfCAYAAACVgY94AAAACXBIWXMAAC4jAAAuIwF4pT92AAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC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K2TuA9YHrCuhV4EngFuBx4YagG6qv8cF+T52kB2Zy+e1I8taUacNV+uBdXO7ABmJwJpwx8XQvF9TUCWM64tiQhbq/oMv+7BwFWpQzNT8vbVQul/wwAGzzdmXU1xuUAAAAASUVORK5CYII=","scale" : 0.5},'; |
|
| 539 | + } else { |
|
| 540 | + $output .= ' "billboard" : {"image" : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAfCAYAAACVgY94AAAACXBIWXMAAC4jAAAuIwF4pT92AAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQA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ElDBThRXRtFd/Qh16puKIS3e7+clBjdy7kL1b3q4fzJQQGck5z6Nb97kxujblWf64HXov7Vl/E4YXWccP9AAd6dAx+ox/WTArNzY1t64B0f8K0DyLXuUvRGZfcpCo1VX4tg6wB76WMB0dALf526foAX8cqUot2pGP8B2Kz+krBeNYjS8636dh/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},'; |
|
| 541 | + } |
|
| 477 | 542 | } elseif ($one3dmodel) { |
| 478 | 543 | if (isset($globalMap3DForceModel) && $globalMap3DForceModel != '') { |
| 479 | 544 | $output .= '"model": {"gltf" : "'.$globalURL.'/models/'.$globalMap3DForceModel.'","scale" : '.$scale.',"minimumPixelSize": '.$minimumpixelsize.''; |
@@ -513,7 +578,9 @@ discard block |
||
| 513 | 578 | $spotter_item['engine_type'] = $aircraft_info[0]['engine_type']; |
| 514 | 579 | $spotter_item['wake_category'] = $aircraft_info[0]['wake_category']; |
| 515 | 580 | $spotter_item['engine_count'] = $aircraft_info[0]['engine_count']; |
| 516 | - } else $aircraft_shadow = ''; |
|
| 581 | + } else { |
|
| 582 | + $aircraft_shadow = ''; |
|
| 583 | + } |
|
| 517 | 584 | if ($aircraft_shadow != '') { |
| 518 | 585 | if (isset($modelsdb2[$aircraft_shadow])) { |
| 519 | 586 | $output .= '"model": {"gltf" : "'.$globalURL.'/models/gltf2/'.$modelsdb2[$aircraft_shadow]['glb'].'","scale" : '.$scale.',"minimumPixelSize": '.$modelsdb2[$aircraft_shadow]['size']; |
@@ -668,7 +735,9 @@ discard block |
||
| 668 | 735 | } |
| 669 | 736 | $output .= '},'; |
| 670 | 737 | //if ($spotter_item['aircraft_shadow'] != '') $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",'; |
| 671 | - if ($spotter_item['aircraft_icao'] != '') $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
| 738 | + if ($spotter_item['aircraft_icao'] != '') { |
|
| 739 | + $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
| 740 | + } |
|
| 672 | 741 | $modelsdb[$aircraft_icao] = 'Cesium_Air.glb'; |
| 673 | 742 | } |
| 674 | 743 | } elseif (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'aprs') { |
@@ -690,7 +759,9 @@ discard block |
||
| 690 | 759 | } |
| 691 | 760 | $output .= '},'; |
| 692 | 761 | //if ($spotter_item['aircraft_shadow'] != '') $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",'; |
| 693 | - if ($spotter_item['aircraft_icao'] != '') $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
| 762 | + if ($spotter_item['aircraft_icao'] != '') { |
|
| 763 | + $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
| 764 | + } |
|
| 694 | 765 | $modelsdb[$aircraft_icao] = 'Cesium_Air.glb'; |
| 695 | 766 | } |
| 696 | 767 | } else { |
@@ -703,7 +774,9 @@ discard block |
||
| 703 | 774 | } |
| 704 | 775 | $output .= '},'; |
| 705 | 776 | //if ($spotter_item['aircraft_shadow'] != '') $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",'; |
| 706 | - if ($spotter_item['aircraft_icao'] != '') $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
| 777 | + if ($spotter_item['aircraft_icao'] != '') { |
|
| 778 | + $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
| 779 | + } |
|
| 707 | 780 | $modelsdb[$aircraft_icao] = 'Cesium_Air.glb'; |
| 708 | 781 | } |
| 709 | 782 | } elseif ($tracker && isset($spotter_item['type'])) { |
@@ -811,8 +884,11 @@ discard block |
||
| 811 | 884 | $output .= '},'; |
| 812 | 885 | } |
| 813 | 886 | } |
| 814 | - if (isset($onground) && $onground) $output = str_replace('%onground%','true',$output); |
|
| 815 | - else $output = str_replace('%onground%','false',$output); |
|
| 887 | + if (isset($onground) && $onground) { |
|
| 888 | + $output = str_replace('%onground%','true',$output); |
|
| 889 | + } else { |
|
| 890 | + $output = str_replace('%onground%','false',$output); |
|
| 891 | + } |
|
| 816 | 892 | |
| 817 | 893 | // $output .= '"heightReference": "CLAMP_TO_GROUND",'; |
| 818 | 894 | //$output .= '"heightReference": "'.$heightrelative.'",'; |
@@ -825,9 +901,15 @@ discard block |
||
| 825 | 901 | // $output .= '"interpolationDegree" : 5,'; |
| 826 | 902 | // $output .= '"epoch" : "'.date("c",strtotime($spotter_item['date'])).'", '; |
| 827 | 903 | $output .= '"cartographicDegrees": ['; |
| 828 | - if ($minitime > strtotime($spotter_item['date'])) $minitime = strtotime($spotter_item['date']); |
|
| 829 | - if (isset($_COOKIE['MapTrack']) && $id == $_COOKIE['MapTrack'] && $minitracktime > strtotime($spotter_item['date'])) $minitracktime = strtotime($spotter_item['date']); |
|
| 830 | - if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']); |
|
| 904 | + if ($minitime > strtotime($spotter_item['date'])) { |
|
| 905 | + $minitime = strtotime($spotter_item['date']); |
|
| 906 | + } |
|
| 907 | + if (isset($_COOKIE['MapTrack']) && $id == $_COOKIE['MapTrack'] && $minitracktime > strtotime($spotter_item['date'])) { |
|
| 908 | + $minitracktime = strtotime($spotter_item['date']); |
|
| 909 | + } |
|
| 910 | + if ($maxitime < strtotime($spotter_item['date'])) { |
|
| 911 | + $maxitime = strtotime($spotter_item['date']); |
|
| 912 | + } |
|
| 831 | 913 | $output .= '"'.date("c",strtotime($spotter_item['date'])).'", '; |
| 832 | 914 | $output .= $spotter_item['longitude'].', '; |
| 833 | 915 | $output .= $spotter_item['latitude']; |
@@ -850,7 +932,9 @@ discard block |
||
| 850 | 932 | $output .= ', '.round($spotter_item['altitude']*30.48); |
| 851 | 933 | $prevalt = round($spotter_item['altitude']*30.48); |
| 852 | 934 | } |
| 853 | - } else $output .= ', 0'; |
|
| 935 | + } else { |
|
| 936 | + $output .= ', 0'; |
|
| 937 | + } |
|
| 854 | 938 | //$orientation = '"orientation" : { '; |
| 855 | 939 | //$orientation .= '"unitQuaternion": ['; |
| 856 | 940 | //$quat = quaternionrotate(deg2rad($spotter_item['heading']),deg2rad(0),deg2rad(0)); |
@@ -858,13 +942,18 @@ discard block |
||
| 858 | 942 | } else { |
| 859 | 943 | $nblatlong = $nblatlong+1; |
| 860 | 944 | $output .= ',"'.date("c",strtotime($spotter_item['date'])).'", '; |
| 861 | - if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']); |
|
| 945 | + if ($maxitime < strtotime($spotter_item['date'])) { |
|
| 946 | + $maxitime = strtotime($spotter_item['date']); |
|
| 947 | + } |
|
| 862 | 948 | if ($spotter_item['ground_speed'] == 0) { |
| 863 | 949 | $output .= $prevlong.', '; |
| 864 | 950 | $output .= $prevlat; |
| 865 | 951 | //if (!$marine && (!isset($onground) || !$onground)) $output .= ', '.$prevalt; |
| 866 | - if (!$marine) $output .= ', '.$prevalt; |
|
| 867 | - else $output .= ', 0'; |
|
| 952 | + if (!$marine) { |
|
| 953 | + $output .= ', '.$prevalt; |
|
| 954 | + } else { |
|
| 955 | + $output .= ', 0'; |
|
| 956 | + } |
|
| 868 | 957 | } else { |
| 869 | 958 | $output .= $spotter_item['longitude'].', '; |
| 870 | 959 | $output .= $spotter_item['latitude']; |
@@ -877,14 +966,17 @@ discard block |
||
| 877 | 966 | $output .= ', 0'; |
| 878 | 967 | } |
| 879 | 968 | } else { |
| 880 | - if (isset($spotter_item['real_altitude']) && $spotter_item['real_altitude'] != '') $output .= ', '.round($spotter_item['real_altitude']*0.3048); |
|
| 881 | - elseif ($tracker) { |
|
| 969 | + if (isset($spotter_item['real_altitude']) && $spotter_item['real_altitude'] != '') { |
|
| 970 | + $output .= ', '.round($spotter_item['real_altitude']*0.3048); |
|
| 971 | + } elseif ($tracker) { |
|
| 882 | 972 | $output .= ', '.round($spotter_item['altitude']*0.3048); |
| 883 | 973 | } else { |
| 884 | 974 | $output .= ', '.round($spotter_item['altitude']*30.48); |
| 885 | 975 | } |
| 886 | 976 | } |
| 887 | - } else $output .= ', 0'; |
|
| 977 | + } else { |
|
| 978 | + $output .= ', 0'; |
|
| 979 | + } |
|
| 888 | 980 | } |
| 889 | 981 | //$quat = quaternionrotate(deg2rad($spotter_item['heading']),deg2rad(0),deg2rad(0)); |
| 890 | 982 | //$orientation .= ',"'.date("c",strtotime($spotter_item['date'])).'",'.$quat['x'].','.$quat['y'].','.$quat['z'].','.$quat['w']; |
@@ -905,9 +997,10 @@ discard block |
||
| 905 | 997 | } else { |
| 906 | 998 | $output = str_replace('%minitime%',date("c",time()-$globalLiveInterval),$output); |
| 907 | 999 | } |
| 1000 | + } else { |
|
| 1001 | + $output = str_replace('%minitime%',date("c",$minitime),$output); |
|
| 908 | 1002 | } |
| 909 | - else $output = str_replace('%minitime%',date("c",$minitime),$output); |
|
| 910 | -} elseif (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '' && $minitracktime != $minitracktime_begin) { |
|
| 1003 | + } elseif (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '' && $minitracktime != $minitracktime_begin) { |
|
| 911 | 1004 | $output = str_replace('%minitime%',date("c",$minitracktime),$output); |
| 912 | 1005 | } else { |
| 913 | 1006 | $output = str_replace('%minitime%',date("c",$minitime),$output); |
@@ -917,7 +1010,10 @@ discard block |
||
| 917 | 1010 | } else { |
| 918 | 1011 | $output = str_replace('%maxitime%',date("c",$maxitime),$output); |
| 919 | 1012 | } |
| 920 | -if ($gltf2) $output = str_replace('%gltf2%','true',$output); |
|
| 921 | -else $output = str_replace('%gltf2%','false',$output); |
|
| 1013 | +if ($gltf2) { |
|
| 1014 | + $output = str_replace('%gltf2%','true',$output); |
|
| 1015 | +} else { |
|
| 1016 | + $output = str_replace('%gltf2%','false',$output); |
|
| 1017 | +} |
|
| 922 | 1018 | print $output; |
| 923 | 1019 | ?> |