@@ -59,11 +59,11 @@ discard block |
||
| 59 | 59 | $s3 = sin($bank/2); |
| 60 | 60 | $c1c2 = $c1*$c2; |
| 61 | 61 | $s1s2 = $s1*$s2; |
| 62 | - $w =$c1c2*$c3 - $s1s2*$s3; |
|
| 63 | - $x =$c1c2*$s3 + $s1s2*$c3; |
|
| 64 | - $y =$s1*$c2*$c3 + $c1*$s2*$s3; |
|
| 65 | - $z =$c1*$s2*$c3 - $s1*$c2*$s3; |
|
| 66 | - return array('x' => $x,'y' => $y,'z' => $z,'w' => $w); |
|
| 62 | + $w = $c1c2*$c3 - $s1s2*$s3; |
|
| 63 | + $x = $c1c2*$s3 + $s1s2*$c3; |
|
| 64 | + $y = $s1*$c2*$c3 + $c1*$s2*$s3; |
|
| 65 | + $z = $c1*$s2*$c3 - $s1*$c2*$s3; |
|
| 66 | + return array('x' => $x, 'y' => $y, 'z' => $z, 'w' => $w); |
|
| 67 | 67 | // return array('x' => '0.0','y' => '-0.931','z' => '0.0','w' => '0.365'); |
| 68 | 68 | |
| 69 | 69 | } |
@@ -84,17 +84,17 @@ discard block |
||
| 84 | 84 | $min = false; |
| 85 | 85 | $allhistory = false; |
| 86 | 86 | $filter['source'] = array(); |
| 87 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
| 88 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
| 89 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
| 90 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs')); |
|
| 91 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
| 92 | -if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
| 93 | -if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING); |
|
| 94 | -if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
| 95 | -if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
| 96 | -if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
| 97 | -if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING); |
|
| 87 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'], array('vatsimtxt')); |
|
| 88 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'], array('whazzup')); |
|
| 89 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'], array('phpvmacars')); |
|
| 90 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'], array('sbs', 'famaprs')); |
|
| 91 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'], array('aprs')); |
|
| 92 | +if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'], FILTER_SANITIZE_STRING); |
|
| 93 | +if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'], FILTER_SANITIZE_STRING); |
|
| 94 | +if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',', $_COOKIE['filter_Airlines']), FILTER_SANITIZE_STRING); |
|
| 95 | +if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',', $_COOKIE['filter_Sources']), FILTER_SANITIZE_STRING); |
|
| 96 | +if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'], FILTER_SANITIZE_STRING); |
|
| 97 | +if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'], FILTER_SANITIZE_STRING); |
|
| 98 | 98 | /* |
| 99 | 99 | if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) { |
| 100 | 100 | $min = true; |
@@ -141,17 +141,17 @@ discard block |
||
| 141 | 141 | $from_archive = true; |
| 142 | 142 | // $begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
| 143 | 143 | // $enddate = filter_input(INPUT_GET,'enddate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
| 144 | - $begindate = filter_input(INPUT_GET,'begindate',FILTER_SANITIZE_NUMBER_INT); |
|
| 145 | - $enddate = filter_input(INPUT_GET,'enddate',FILTER_SANITIZE_NUMBER_INT); |
|
| 146 | - $archivespeed = filter_input(INPUT_GET,'speed',FILTER_SANITIZE_NUMBER_INT); |
|
| 147 | - $begindate = date('Y-m-d H:i:s',$begindate); |
|
| 148 | - $enddate = date('Y-m-d H:i:s',$enddate); |
|
| 144 | + $begindate = filter_input(INPUT_GET, 'begindate', FILTER_SANITIZE_NUMBER_INT); |
|
| 145 | + $enddate = filter_input(INPUT_GET, 'enddate', FILTER_SANITIZE_NUMBER_INT); |
|
| 146 | + $archivespeed = filter_input(INPUT_GET, 'speed', FILTER_SANITIZE_NUMBER_INT); |
|
| 147 | + $begindate = date('Y-m-d H:i:s', $begindate); |
|
| 148 | + $enddate = date('Y-m-d H:i:s', $enddate); |
|
| 149 | 149 | if ($tracker) { |
| 150 | - $spotter_array = $TrackerArchive->getMinLiveTrackerDataPlayback($begindate,$enddate,$filter); |
|
| 150 | + $spotter_array = $TrackerArchive->getMinLiveTrackerDataPlayback($begindate, $enddate, $filter); |
|
| 151 | 151 | } elseif ($marine) { |
| 152 | - $spotter_array = $MarineArchive->getMinLiveMarineDataPlayback($begindate,$enddate,$filter); |
|
| 152 | + $spotter_array = $MarineArchive->getMinLiveMarineDataPlayback($begindate, $enddate, $filter); |
|
| 153 | 153 | } else { |
| 154 | - $spotter_array = $SpotterArchive->getMinLiveSpotterDataPlayback($begindate,$enddate,$filter); |
|
| 154 | + $spotter_array = $SpotterArchive->getMinLiveSpotterDataPlayback($begindate, $enddate, $filter); |
|
| 155 | 155 | } |
| 156 | 156 | } elseif (isset($_COOKIE['archive']) && isset($_COOKIE['archive_begin']) && isset($_COOKIE['archive_end']) && isset($_COOKIE['archive_speed'])) { |
| 157 | 157 | $from_archive = true; |
@@ -168,36 +168,36 @@ discard block |
||
| 168 | 168 | } |
| 169 | 169 | $enddate = $_COOKIE['archive_end']; |
| 170 | 170 | $enddateinitial = $_COOKIE['archive_end']; |
| 171 | - $archivespeed = filter_var($_COOKIE['archive_speed'],FILTER_SANITIZE_NUMBER_INT); |
|
| 172 | - $begindate = date('Y-m-d H:i:s',$begindate); |
|
| 173 | - $enddate = date('Y-m-d H:i:s',$enddate); |
|
| 171 | + $archivespeed = filter_var($_COOKIE['archive_speed'], FILTER_SANITIZE_NUMBER_INT); |
|
| 172 | + $begindate = date('Y-m-d H:i:s', $begindate); |
|
| 173 | + $enddate = date('Y-m-d H:i:s', $enddate); |
|
| 174 | 174 | //echo 'Begin : '.$begindate.' - End : '.$enddate."\n"; |
| 175 | 175 | if ($tracker) { |
| 176 | - $spotter_array = $TrackerArchive->getMinLiveTrackerData($begindate,$enddate,$filter); |
|
| 176 | + $spotter_array = $TrackerArchive->getMinLiveTrackerData($begindate, $enddate, $filter); |
|
| 177 | 177 | } elseif ($marine) { |
| 178 | - $spotter_array = $MarineArchive->getMinLiveMarineData($begindate,$enddate,$filter); |
|
| 178 | + $spotter_array = $MarineArchive->getMinLiveMarineData($begindate, $enddate, $filter); |
|
| 179 | 179 | } else { |
| 180 | - $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate,$enddate,$filter); |
|
| 180 | + $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate, $enddate, $filter); |
|
| 181 | 181 | } |
| 182 | 182 | } elseif ($tracker) { |
| 183 | 183 | $coord = array(); |
| 184 | 184 | if (isset($_GET['coord']) && $_GET['coord'] != '') { |
| 185 | - $coord = explode(',',$_GET['coord']); |
|
| 186 | - if (!(filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT) |
|
| 185 | + $coord = explode(',', $_GET['coord']); |
|
| 186 | + if (!(filter_var($coord[0], FILTER_VALIDATE_FLOAT) && filter_var($coord[1], FILTER_VALIDATE_FLOAT) && filter_var($coord[2], FILTER_VALIDATE_FLOAT) && filter_var($coord[3], FILTER_VALIDATE_FLOAT) |
|
| 187 | 187 | && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) { |
| 188 | 188 | $coord = array(); |
| 189 | 189 | } |
| 190 | 190 | } |
| 191 | 191 | $previous_filter = $filter; |
| 192 | 192 | if ((isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') && (isset($_COOKIE['MapTrackTracker']) && $_COOKIE['MapTrackTracker'] != '')) { |
| 193 | - $filter = array_merge($filter,array('id' => $_COOKIE['MapTrackTracker'])); |
|
| 194 | - $spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord,$filter,true); |
|
| 193 | + $filter = array_merge($filter, array('id' => $_COOKIE['MapTrackTracker'])); |
|
| 194 | + $spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord, $filter, true); |
|
| 195 | 195 | /* |
| 196 | 196 | } elseif (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '' && !empty($coord)) { |
| 197 | 197 | $spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord,$filter,true,$_COOKIE['MapTrack']); |
| 198 | 198 | */ |
| 199 | 199 | } elseif (!isset($_COOKIE['singlemodel']) || $_COOKIE['singlemodel'] == 'false') { |
| 200 | - $spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord,$filter,true); |
|
| 200 | + $spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord, $filter, true); |
|
| 201 | 201 | } else { |
| 202 | 202 | $spotter_array = array(); |
| 203 | 203 | } |
@@ -205,22 +205,22 @@ discard block |
||
| 205 | 205 | } elseif ($marine) { |
| 206 | 206 | $coord = array(); |
| 207 | 207 | if (isset($_GET['coord']) && $_GET['coord'] != '') { |
| 208 | - $coord = explode(',',$_GET['coord']); |
|
| 209 | - if (!(filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT) |
|
| 208 | + $coord = explode(',', $_GET['coord']); |
|
| 209 | + if (!(filter_var($coord[0], FILTER_VALIDATE_FLOAT) && filter_var($coord[1], FILTER_VALIDATE_FLOAT) && filter_var($coord[2], FILTER_VALIDATE_FLOAT) && filter_var($coord[3], FILTER_VALIDATE_FLOAT) |
|
| 210 | 210 | && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) { |
| 211 | 211 | $coord = array(); |
| 212 | 212 | } |
| 213 | 213 | } |
| 214 | 214 | $previous_filter = $filter; |
| 215 | 215 | if ((isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') && (isset($_COOKIE['MapTrackMarine']) && $_COOKIE['MapTrackMarine'] != '')) { |
| 216 | - $filter = array_merge($filter,array('id' => $_COOKIE['MapTrackMarine'])); |
|
| 217 | - $spotter_array = $MarineLive->getMinLastLiveMarineData($coord,$filter,true); |
|
| 216 | + $filter = array_merge($filter, array('id' => $_COOKIE['MapTrackMarine'])); |
|
| 217 | + $spotter_array = $MarineLive->getMinLastLiveMarineData($coord, $filter, true); |
|
| 218 | 218 | /* |
| 219 | 219 | } elseif (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '' && !empty($coord)) { |
| 220 | 220 | $spotter_array = $MarineLive->getMinLastLiveMarineData($coord,$filter,true,$_COOKIE['MapTrack']); |
| 221 | 221 | */ |
| 222 | 222 | } elseif (!isset($_COOKIE['singlemodel']) || $_COOKIE['singlemodel'] == 'false') { |
| 223 | - $spotter_array = $MarineLive->getMinLastLiveMarineData($coord,$filter,true); |
|
| 223 | + $spotter_array = $MarineLive->getMinLastLiveMarineData($coord, $filter, true); |
|
| 224 | 224 | } else { |
| 225 | 225 | $spotter_array = array(); |
| 226 | 226 | } |
@@ -228,20 +228,20 @@ discard block |
||
| 228 | 228 | } else { |
| 229 | 229 | $coord = array(); |
| 230 | 230 | if (!((isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') && (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '')) && isset($_GET['coord']) && $_GET['coord'] != '') { |
| 231 | - $coord = explode(',',$_GET['coord']); |
|
| 232 | - if (!(filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT) |
|
| 231 | + $coord = explode(',', $_GET['coord']); |
|
| 232 | + if (!(filter_var($coord[0], FILTER_VALIDATE_FLOAT) && filter_var($coord[1], FILTER_VALIDATE_FLOAT) && filter_var($coord[2], FILTER_VALIDATE_FLOAT) && filter_var($coord[3], FILTER_VALIDATE_FLOAT) |
|
| 233 | 233 | && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) { |
| 234 | 234 | $coord = array(); |
| 235 | 235 | } |
| 236 | 236 | } |
| 237 | 237 | $previous_filter = $filter; |
| 238 | 238 | if ((isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') && (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '')) { |
| 239 | - $filter = array_merge($filter,array('id' => $_COOKIE['MapTrack'])); |
|
| 240 | - $spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord,$filter,true); |
|
| 239 | + $filter = array_merge($filter, array('id' => $_COOKIE['MapTrack'])); |
|
| 240 | + $spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord, $filter, true); |
|
| 241 | 241 | } elseif (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '' && !empty($coord)) { |
| 242 | - $spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord,$filter,true,$_COOKIE['MapTrack']); |
|
| 242 | + $spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord, $filter, true, $_COOKIE['MapTrack']); |
|
| 243 | 243 | } elseif (!isset($_COOKIE['singlemodel']) || $_COOKIE['singlemodel'] == 'false') { |
| 244 | - $spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord,$filter,true); |
|
| 244 | + $spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord, $filter, true); |
|
| 245 | 245 | } else { |
| 246 | 246 | $spotter_array = array(); |
| 247 | 247 | } |
@@ -251,19 +251,19 @@ discard block |
||
| 251 | 251 | if (!empty($spotter_array) && isset($coord)) { |
| 252 | 252 | if ($tracker) { |
| 253 | 253 | if (isset($_GET['archive'])) { |
| 254 | - $flightcnt = $TrackerArchive->getLiveTrackerCount($begindate,$enddate,$filter); |
|
| 254 | + $flightcnt = $TrackerArchive->getLiveTrackerCount($begindate, $enddate, $filter); |
|
| 255 | 255 | } else { |
| 256 | 256 | $flightcnt = $TrackerLive->getLiveTrackerCount($filter); |
| 257 | 257 | } |
| 258 | 258 | } elseif ($marine) { |
| 259 | 259 | if (isset($_GET['archive'])) { |
| 260 | - $flightcnt = $MarineArchive->getLiveMarineCount($begindate,$enddate,$filter); |
|
| 260 | + $flightcnt = $MarineArchive->getLiveMarineCount($begindate, $enddate, $filter); |
|
| 261 | 261 | } else { |
| 262 | 262 | $flightcnt = $MarineLive->getLiveMarineCount($filter); |
| 263 | 263 | } |
| 264 | 264 | } else { |
| 265 | 265 | if (isset($_GET['archive'])) { |
| 266 | - $flightcnt = $SpotterArchive->getLiveSpotterCount($begindate,$enddate,$filter); |
|
| 266 | + $flightcnt = $SpotterArchive->getLiveSpotterCount($begindate, $enddate, $filter); |
|
| 267 | 267 | } else { |
| 268 | 268 | $flightcnt = $SpotterLive->getLiveSpotterCount($filter); |
| 269 | 269 | } |
@@ -271,17 +271,17 @@ discard block |
||
| 271 | 271 | if ($flightcnt == '') $flightcnt = 0; |
| 272 | 272 | } else $flightcnt = 0; |
| 273 | 273 | |
| 274 | -$sqltime = round(microtime(true)-$begintime,2); |
|
| 274 | +$sqltime = round(microtime(true) - $begintime, 2); |
|
| 275 | 275 | $minitime = time(); |
| 276 | 276 | $minitracktime_begin = time(); |
| 277 | 277 | $minitracktime = $minitracktime_begin; |
| 278 | 278 | $maxitime = 0; |
| 279 | -$lastupdate = filter_input(INPUT_GET,'update',FILTER_SANITIZE_NUMBER_INT); |
|
| 279 | +$lastupdate = filter_input(INPUT_GET, 'update', FILTER_SANITIZE_NUMBER_INT); |
|
| 280 | 280 | $modelsdb = array(); |
| 281 | 281 | if (file_exists(dirname(__FILE__).'/models/modelsdb')) { |
| 282 | - if (($handle = fopen(dirname(__FILE__).'/models/modelsdb','r')) !== FALSE) { |
|
| 283 | - while (($row = fgetcsv($handle,1000)) !== FALSE) { |
|
| 284 | - if (isset($row[1]) ){ |
|
| 282 | + if (($handle = fopen(dirname(__FILE__).'/models/modelsdb', 'r')) !== FALSE) { |
|
| 283 | + while (($row = fgetcsv($handle, 1000)) !== FALSE) { |
|
| 284 | + if (isset($row[1])) { |
|
| 285 | 285 | $model = $row[0]; |
| 286 | 286 | $modelsdb[$model] = $row[1]; |
| 287 | 287 | } |
@@ -291,9 +291,9 @@ discard block |
||
| 291 | 291 | } |
| 292 | 292 | $modelsdb2 = array(); |
| 293 | 293 | if (file_exists(dirname(__FILE__).'/models/gltf2/modelsdb')) { |
| 294 | - if (($handle = fopen(dirname(__FILE__).'/models/gltf2/modelsdb','r')) !== FALSE) { |
|
| 295 | - while (($row = fgetcsv($handle,1000)) !== FALSE) { |
|
| 296 | - if (isset($row[1]) ){ |
|
| 294 | + if (($handle = fopen(dirname(__FILE__).'/models/gltf2/modelsdb', 'r')) !== FALSE) { |
|
| 295 | + while (($row = fgetcsv($handle, 1000)) !== FALSE) { |
|
| 296 | + if (isset($row[1])) { |
|
| 297 | 297 | $model = $row[0]; |
| 298 | 298 | $glb = $row[1]; |
| 299 | 299 | if (isset($row[2])) { |
@@ -339,7 +339,7 @@ discard block |
||
| 339 | 339 | if (!empty($spotter_array) && is_array($spotter_array)) |
| 340 | 340 | { |
| 341 | 341 | $nblatlong = 0; |
| 342 | - foreach($spotter_array as $spotter_item) |
|
| 342 | + foreach ($spotter_array as $spotter_item) |
|
| 343 | 343 | { |
| 344 | 344 | $j++; |
| 345 | 345 | //if (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'airwhere') $heightrelative = 'RELATIVE_TO_GROUND'; |
@@ -393,13 +393,13 @@ discard block |
||
| 393 | 393 | } |
| 394 | 394 | if (isset($spotter_item['registration'])) $output .= '"registration": "'.$spotter_item['registration'].'",'; |
| 395 | 395 | if (isset($spotter_item['format_source'])) $output .= '"format": "'.$spotter_item['format_source'].'",'; |
| 396 | - if (isset($spotter_item['ident'])) $output.= '"ident": "'.$spotter_item['ident'].'",'; |
|
| 396 | + if (isset($spotter_item['ident'])) $output .= '"ident": "'.$spotter_item['ident'].'",'; |
|
| 397 | 397 | if ($tracker) { |
| 398 | 398 | if (isset($spotter_item['type'])) $output .= '"tracker_type": "'.$spotter_item['type'].'",'; |
| 399 | - $output.= '"type": "tracker"'; |
|
| 399 | + $output .= '"type": "tracker"'; |
|
| 400 | 400 | } elseif ($marine) { |
| 401 | 401 | if (isset($spotter_item['type'])) $output .= '"marine_type": "'.$spotter_item['type'].'",'; |
| 402 | - $output.= '"type": "marine"'; |
|
| 402 | + $output .= '"type": "marine"'; |
|
| 403 | 403 | } else { |
| 404 | 404 | if ($one3dmodel === false && isset($globalMap3DLiveries) && $globalMap3DLiveries) { |
| 405 | 405 | $aircraft_icao = $spotter_item['aircraft_icao']; |
@@ -413,14 +413,14 @@ discard block |
||
| 413 | 413 | if (isset($airline_icao)) { |
| 414 | 414 | $imagefile = $aircraft_icao.'-'.$airline_icao.'.png'; |
| 415 | 415 | if (file_exists(dirname(__FILE__).'/models/gltf2/liveries/'.$imagefile)) { |
| 416 | - $output.= '"liveries": "'.$globalURL.'/models/gltf2/liveries/'.$imagefile.'",'; |
|
| 416 | + $output .= '"liveries": "'.$globalURL.'/models/gltf2/liveries/'.$imagefile.'",'; |
|
| 417 | 417 | } |
| 418 | 418 | } |
| 419 | 419 | } |
| 420 | 420 | //if ($ident != '') $output.= '"ident": "'.$ident.'",'; |
| 421 | 421 | } |
| 422 | - $output.= '"gltf2": %gltf2%,'; |
|
| 423 | - $output.= '"type": "flight"'; |
|
| 422 | + $output .= '"gltf2": %gltf2%,'; |
|
| 423 | + $output .= '"type": "flight"'; |
|
| 424 | 424 | } |
| 425 | 425 | $output .= '},'; |
| 426 | 426 | |
@@ -791,8 +791,8 @@ discard block |
||
| 791 | 791 | $output .= '},'; |
| 792 | 792 | } |
| 793 | 793 | } |
| 794 | - if (isset($onground) && $onground) $output = str_replace('%onground%','true',$output); |
|
| 795 | - else $output = str_replace('%onground%','false',$output); |
|
| 794 | + if (isset($onground) && $onground) $output = str_replace('%onground%', 'true', $output); |
|
| 795 | + else $output = str_replace('%onground%', 'false', $output); |
|
| 796 | 796 | |
| 797 | 797 | // $output .= '"heightReference": "CLAMP_TO_GROUND",'; |
| 798 | 798 | //$output .= '"heightReference": "'.$heightrelative.'",'; |
@@ -808,7 +808,7 @@ discard block |
||
| 808 | 808 | if ($minitime > strtotime($spotter_item['date'])) $minitime = strtotime($spotter_item['date']); |
| 809 | 809 | if (isset($_COOKIE['MapTrack']) && $id == $_COOKIE['MapTrack'] && $minitracktime > strtotime($spotter_item['date'])) $minitracktime = strtotime($spotter_item['date']); |
| 810 | 810 | if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']); |
| 811 | - $output .= '"'.date("c",strtotime($spotter_item['date'])).'", '; |
|
| 811 | + $output .= '"'.date("c", strtotime($spotter_item['date'])).'", '; |
|
| 812 | 812 | $output .= $spotter_item['longitude'].', '; |
| 813 | 813 | $output .= $spotter_item['latitude']; |
| 814 | 814 | $prevlong = $spotter_item['longitude']; |
@@ -836,8 +836,8 @@ discard block |
||
| 836 | 836 | //$quat = quaternionrotate(deg2rad($spotter_item['heading']),deg2rad(0),deg2rad(0)); |
| 837 | 837 | //$orientation .= '"'.date("c",strtotime($spotter_item['date'])).'",'.$quat['x'].','.$quat['y'].','.$quat['z'].','.$quat['w']; |
| 838 | 838 | } else { |
| 839 | - $nblatlong = $nblatlong+1; |
|
| 840 | - $output .= ',"'.date("c",strtotime($spotter_item['date'])).'", '; |
|
| 839 | + $nblatlong = $nblatlong + 1; |
|
| 840 | + $output .= ',"'.date("c", strtotime($spotter_item['date'])).'", '; |
|
| 841 | 841 | if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']); |
| 842 | 842 | if ($spotter_item['ground_speed'] == 0) { |
| 843 | 843 | $output .= $prevlong.', '; |
@@ -878,26 +878,26 @@ discard block |
||
| 878 | 878 | $output .= ']'; |
| 879 | 879 | if (isset($globalArchive) && $globalArchive === TRUE) { |
| 880 | 880 | if (isset($begindateinitial)) { |
| 881 | - $output = str_replace('%minitime%',date("c",$begindateinitial),$output); |
|
| 882 | - } elseif ((time()-$globalLiveInterval) > $minitime) { |
|
| 883 | - if (time()-$globalLiveInterval > $maxitime) { |
|
| 884 | - $output = str_replace('%minitime%',date("c",$maxitime),$output); |
|
| 881 | + $output = str_replace('%minitime%', date("c", $begindateinitial), $output); |
|
| 882 | + } elseif ((time() - $globalLiveInterval) > $minitime) { |
|
| 883 | + if (time() - $globalLiveInterval > $maxitime) { |
|
| 884 | + $output = str_replace('%minitime%', date("c", $maxitime), $output); |
|
| 885 | 885 | } else { |
| 886 | - $output = str_replace('%minitime%',date("c",time()-$globalLiveInterval),$output); |
|
| 886 | + $output = str_replace('%minitime%', date("c", time() - $globalLiveInterval), $output); |
|
| 887 | 887 | } |
| 888 | 888 | } |
| 889 | - else $output = str_replace('%minitime%',date("c",$minitime),$output); |
|
| 889 | + else $output = str_replace('%minitime%', date("c", $minitime), $output); |
|
| 890 | 890 | } elseif (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '' && $minitracktime != $minitracktime_begin) { |
| 891 | - $output = str_replace('%minitime%',date("c",$minitracktime),$output); |
|
| 891 | + $output = str_replace('%minitime%', date("c", $minitracktime), $output); |
|
| 892 | 892 | } else { |
| 893 | - $output = str_replace('%minitime%',date("c",$minitime),$output); |
|
| 893 | + $output = str_replace('%minitime%', date("c", $minitime), $output); |
|
| 894 | 894 | } |
| 895 | 895 | if (isset($enddateinitial)) { |
| 896 | - $output = str_replace('%maxitime%',date("c",$enddateinitial),$output); |
|
| 896 | + $output = str_replace('%maxitime%', date("c", $enddateinitial), $output); |
|
| 897 | 897 | } else { |
| 898 | - $output = str_replace('%maxitime%',date("c",$maxitime),$output); |
|
| 898 | + $output = str_replace('%maxitime%', date("c", $maxitime), $output); |
|
| 899 | 899 | } |
| 900 | -if ($gltf2) $output = str_replace('%gltf2%','true',$output); |
|
| 901 | -else $output = str_replace('%gltf2%','false',$output); |
|
| 900 | +if ($gltf2) $output = str_replace('%gltf2%', 'true', $output); |
|
| 901 | +else $output = str_replace('%gltf2%', 'false', $output); |
|
| 902 | 902 | print $output; |
| 903 | 903 | ?> |
@@ -11,14 +11,14 @@ discard block |
||
| 11 | 11 | |
| 12 | 12 | $from_archive = false; |
| 13 | 13 | if (isset($_GET['ident'])) { |
| 14 | - $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
|
| 14 | + $ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING); |
|
| 15 | 15 | if (isset($_GET['currenttime'])) { |
| 16 | - $currenttime = filter_input(INPUT_GET,'currenttime',FILTER_SANITIZE_NUMBER_INT); |
|
| 16 | + $currenttime = filter_input(INPUT_GET, 'currenttime', FILTER_SANITIZE_NUMBER_INT); |
|
| 17 | 17 | $currenttime = round($currenttime/1000); |
| 18 | - $spotter_array = $SpotterLive->getDateLiveSpotterDataByIdent($ident,$currenttime); |
|
| 18 | + $spotter_array = $SpotterLive->getDateLiveSpotterDataByIdent($ident, $currenttime); |
|
| 19 | 19 | if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) { |
| 20 | 20 | $from_archive = true; |
| 21 | - $spotter_array = $SpotterArchive->getDateArchiveSpotterDataByIdent($ident,$currenttime); |
|
| 21 | + $spotter_array = $SpotterArchive->getDateArchiveSpotterDataByIdent($ident, $currenttime); |
|
| 22 | 22 | } |
| 23 | 23 | } else { |
| 24 | 24 | $spotter_array = $SpotterLive->getLastLiveSpotterDataByIdent($ident); |
@@ -29,15 +29,15 @@ discard block |
||
| 29 | 29 | } |
| 30 | 30 | } |
| 31 | 31 | if (isset($_GET['flightaware_id'])) { |
| 32 | - $flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING); |
|
| 32 | + $flightaware_id = filter_input(INPUT_GET, 'flightaware_id', FILTER_SANITIZE_STRING); |
|
| 33 | 33 | if (isset($_GET['currenttime'])) { |
| 34 | - $currenttime = filter_input(INPUT_GET,'currenttime',FILTER_SANITIZE_NUMBER_INT); |
|
| 34 | + $currenttime = filter_input(INPUT_GET, 'currenttime', FILTER_SANITIZE_NUMBER_INT); |
|
| 35 | 35 | $currenttime = round($currenttime/1000); |
| 36 | - $spotter_array = $SpotterLive->getDateLiveSpotterDataById($flightaware_id,$currenttime); |
|
| 36 | + $spotter_array = $SpotterLive->getDateLiveSpotterDataById($flightaware_id, $currenttime); |
|
| 37 | 37 | if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) { |
| 38 | 38 | $from_archive = true; |
| 39 | 39 | // $spotter_array = $SpotterArchive->getLastArchiveSpotterDataById($flightaware_id); |
| 40 | - $spotter_array = $SpotterArchive->getDateArchiveSpotterDataById($flightaware_id,$currenttime); |
|
| 40 | + $spotter_array = $SpotterArchive->getDateArchiveSpotterDataById($flightaware_id, $currenttime); |
|
| 41 | 41 | } |
| 42 | 42 | } else { |
| 43 | 43 | $spotter_array = $SpotterLive->getLastLiveSpotterDataById($flightaware_id); |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | if (isset($spotter_item['image_thumbnail']) && $spotter_item['image_thumbnail'] != "") |
| 58 | 58 | { |
| 59 | 59 | if ($spotter_item['image_source'] == 'flickr' || $spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart') { |
| 60 | - $image = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
|
| 60 | + $image = preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']); |
|
| 61 | 61 | } else $image = $spotter_item['image_thumbnail']; |
| 62 | 62 | } |
| 63 | 63 | /* else { |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | print '<div class="nomobile airports"><div class="airport"><span class="code"><a href="'.$globalURL.'/airport/'.$spotter_item['departure_airport'].'" target="_blank">'.$spotter_item['departure_airport'].'</a></span>'.$spotter_item['departure_airport_city'].' '.$spotter_item['departure_airport_country']; |
| 85 | 85 | if (isset($spotter_item['departure_airport_time']) && $spotter_item['departure_airport_time'] != 'NULL') { |
| 86 | 86 | if ($spotter_item['departure_airport_time'] > 2460) { |
| 87 | - print '<br /><span class="time">'.date('H:m',$spotter_item['departure_airport_time']).'</span>'; |
|
| 87 | + print '<br /><span class="time">'.date('H:m', $spotter_item['departure_airport_time']).'</span>'; |
|
| 88 | 88 | } else { |
| 89 | 89 | print '<br /><span class="time">'.$spotter_item['departure_airport_time'].'</span>'; |
| 90 | 90 | } |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | print '<span class="code"><a href="'.$globalURL.'/airport/'.$spotter_item['arrival_airport'].'" target="_blank">'.$spotter_item['arrival_airport'].'</a></span>'.$spotter_item['arrival_airport_city'].' '.$spotter_item['arrival_airport_country']; |
| 94 | 94 | if (isset($spotter_item['arrival_airport_time']) && $spotter_item['arrival_airport_time'] != 'NULL') { |
| 95 | 95 | if ($spotter_item['arrival_airport_time'] > 2460) { |
| 96 | - print '<br /><span class="time">'.date('H:m',$spotter_item['arrival_airport_time']).'</span>'; |
|
| 96 | + print '<br /><span class="time">'.date('H:m', $spotter_item['arrival_airport_time']).'</span>'; |
|
| 97 | 97 | } else { |
| 98 | 98 | print '<br /><span class="time">'.$spotter_item['arrival_airport_time'].'</span>'; |
| 99 | 99 | } |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | print '<span>'._("Aircraft").'</span>'; |
| 113 | 113 | if (isset($spotter_item['aircraft_wiki'])) print '<a href="'.$spotter_item['aircraft_wiki'].'">'.$spotter_item['aircraft_name'].'</a>'; |
| 114 | 114 | if (isset($spotter_item['aircraft_type']) && isset($spotter_item['aircraft_manufacturer']) && $spotter_item['aircraft_manufacturer'] != 'N/A' && isset($spotter_item['aircraft_name']) && $spotter_item['aircraft_name'] != 'N/A') { |
| 115 | - $aircraft_names = explode('/',$spotter_item['aircraft_name']); |
|
| 115 | + $aircraft_names = explode('/', $spotter_item['aircraft_name']); |
|
| 116 | 116 | if (count($aircraft_names) == 1) print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')</a>'; |
| 117 | 117 | else print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'" title="'.$spotter_item['aircraft_name'].'">'.$spotter_item['aircraft_manufacturer'].' '.$aircraft_names[0].' ('.$spotter_item['aircraft_type'].')</a>'; |
| 118 | 118 | } elseif (isset($spotter_item['aircraft_type'])) print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_type'].'</a>'; |
@@ -122,8 +122,8 @@ discard block |
||
| 122 | 122 | print '<div id ="altitude"><span>'._("Altitude").'</span>'; |
| 123 | 123 | if (isset($globalGroundAltitude) && $globalGroundAltitude) { |
| 124 | 124 | try { |
| 125 | - $groundAltitude = $Elevation->getElevation($spotter_item['latitude'],$spotter_item['longitude']); |
|
| 126 | - } catch(Exception $e) { |
|
| 125 | + $groundAltitude = $Elevation->getElevation($spotter_item['latitude'], $spotter_item['longitude']); |
|
| 126 | + } catch (Exception $e) { |
|
| 127 | 127 | // If catched not exist |
| 128 | 128 | } |
| 129 | 129 | } |
@@ -162,9 +162,9 @@ discard block |
||
| 162 | 162 | if (isset($globalCam) && $globalCam) { |
| 163 | 163 | require_once(dirname(__FILE__).'/require/class.Common.php'); |
| 164 | 164 | $Common = new Common(); |
| 165 | - $azimuth = round($Common->azimuth($globalCenterLatitude,$globalCenterLongitude,$spotter_item['latitude'],$spotter_item['longitude'])); |
|
| 166 | - $distance = $Common->distance($globalCenterLatitude,$globalCenterLongitude,$spotter_item['latitude'],$spotter_item['longitude'],'m'); |
|
| 167 | - $plunge = round($Common->plunge($globalCenterAltitude,$spotter_item['real_altitude'],$distance)); |
|
| 165 | + $azimuth = round($Common->azimuth($globalCenterLatitude, $globalCenterLongitude, $spotter_item['latitude'], $spotter_item['longitude'])); |
|
| 166 | + $distance = $Common->distance($globalCenterLatitude, $globalCenterLongitude, $spotter_item['latitude'], $spotter_item['longitude'], 'm'); |
|
| 167 | + $plunge = round($Common->plunge($globalCenterAltitude, $spotter_item['real_altitude'], $distance)); |
|
| 168 | 168 | print '<div id="camcoordinates"><span>'._("Cam Coordinates").'</span>'; |
| 169 | 169 | print 'azimuth: '.$azimuth; |
| 170 | 170 | print ' / '; |
@@ -174,16 +174,16 @@ discard block |
||
| 174 | 174 | print '</div>'; |
| 175 | 175 | //echo $Common->getData('http://127.0.0.1/camera.php?azimuth='.$azimuth.'&plunge='.$plunge,'get','','','','','','',false,true); |
| 176 | 176 | //echo $Common->getData('file://'.dirname(__FILE__).'/camera.php?azimuth='.$azimuth.'&plunge='.$plunge,'get','','','','','','',false,true); |
| 177 | - echo $Common->getData('http://'.$_SERVER['SERVER_NAME'].'/camera.php?azimuth='.$azimuth.'&plunge='.$plunge,'get','','','','','','',false,true); |
|
| 177 | + echo $Common->getData('http://'.$_SERVER['SERVER_NAME'].'/camera.php?azimuth='.$azimuth.'&plunge='.$plunge, 'get', '', '', '', '', '', '', false, true); |
|
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | print '<div id="heading"><span>'._("Heading").'</span><span class="heading">'.$spotter_item['heading'].'</span>°</div>'; |
| 181 | 181 | if (isset($spotter_item['verticalrate']) && $spotter_item['verticalrate'] != '') { |
| 182 | 182 | print '<div id="verticalrate"><span>'._("Vertical rate").'</span>'; |
| 183 | 183 | if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) { |
| 184 | - print $spotter_item['verticalrate']. ' ft/min'; |
|
| 184 | + print $spotter_item['verticalrate'].' ft/min'; |
|
| 185 | 185 | } else { |
| 186 | - print round($spotter_item['verticalrate']*0.3048). ' m/min'; |
|
| 186 | + print round($spotter_item['verticalrate']*0.3048).' m/min'; |
|
| 187 | 187 | } |
| 188 | 188 | print '</div>'; |
| 189 | 189 | } |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | print '</div>'; |
| 219 | 219 | if (isset($globalVA) && $globalVA && isset($globalphpVMS) && $globalphpVMS && isset($globalVATSIM) && $globalVATSIM && isset($globalIVAO) && $globalIVAO && isset($spotter_item['format_source']) && $spotter_item['format_source'] != '' && $spotter_item['format_source'] != 'pireps') print '<div class="waypoints"><span>'._("Source").'</span>'.$spotter_item['format_source'].'</div>'; |
| 220 | 220 | if (isset($spotter_item['waypoints']) && $spotter_item['waypoints'] != '') print '<div class="waypoints"><span>'._("Route").'</span>'.$spotter_item['waypoints'].'</div>'; |
| 221 | - if (isset($spotter_item['acars']['message'])) print '<div class="acars"><span>'._("Latest ACARS message").'</span>'.trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'<br/>',$spotter_item['acars']['message'])).'</div>'; |
|
| 221 | + if (isset($spotter_item['acars']['message'])) print '<div class="acars"><span>'._("Latest ACARS message").'</span>'.trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '<br/>', $spotter_item['acars']['message'])).'</div>'; |
|
| 222 | 222 | if (isset($spotter_item['squawk']) && $spotter_item['squawk'] != '' && $spotter_item['squawk'] != 0) print '<div class="bottom">'._("Squawk:").' '.$spotter_item['squawk'].' - '.$spotter_item['squawk_usage'].'</div>'; |
| 223 | 223 | print '</div>'; |
| 224 | 224 | } |