| @@ -4,7 +4,7 @@ discard block | ||
| 4 | 4 |  require_once('require/class.Language.php'); | 
| 5 | 5 |  require_once('require/class.Satellite.php'); | 
| 6 | 6 | |
| 7 | -$trackident = filter_input(INPUT_GET,'trackid',FILTER_SANITIZE_STRING); | |
| 7 | +$trackident = filter_input(INPUT_GET, 'trackid', FILTER_SANITIZE_STRING); | |
| 8 | 8 |  if ($trackident != '') { | 
| 9 | 9 |  	require_once('require/class.SpotterLive.php'); | 
| 10 | 10 | $SpotterLive = new SpotterLive(); | 
| @@ -14,7 +14,7 @@ discard block | ||
| 14 | 14 | $spotterid = $Spotter->getSpotterIDBasedOnFlightAwareID($trackident); | 
| 15 | 15 |  		header('Location: '.$globalURL.'/flightid/'.$spotterid); | 
| 16 | 16 |  	} else { | 
| 17 | -		setcookie('MapTrack',$resulttrackident[0]['flightaware_id']); | |
| 17 | +		setcookie('MapTrack', $resulttrackident[0]['flightaware_id']); | |
| 18 | 18 | } | 
| 19 | 19 | /* | 
| 20 | 20 |  } else { | 
| @@ -197,7 +197,7 @@ discard block | ||
| 197 | 197 | <div class="form-group"> | 
| 198 | 198 |  			<label><?php echo _("From:"); ?></label> | 
| 199 | 199 | <div class='input-group date' id='datetimepicker1'> | 
| 200 | -			    <input type='text' id="start_date" name="start_date" class="form-control" autocomplete="off" value="<?php if (isset($_COOKIE['archive_begin']) && $_COOKIE['archive_begin'] != '') print date("Y-m-d H:i",$_COOKIE['archive_begin']).' UTC'; ?>" required /> | |
| 200 | +			    <input type='text' id="start_date" name="start_date" class="form-control" autocomplete="off" value="<?php if (isset($_COOKIE['archive_begin']) && $_COOKIE['archive_begin'] != '') print date("Y-m-d H:i", $_COOKIE['archive_begin']).' UTC'; ?>" required /> | |
| 201 | 201 | <span class="input-group-addon"> | 
| 202 | 202 | <span class="glyphicon glyphicon-calendar"></span> | 
| 203 | 203 | </span> | 
| @@ -206,7 +206,7 @@ discard block | ||
| 206 | 206 | <div class="form-group"> | 
| 207 | 207 |  			<label><?php echo _("To:"); ?></label> | 
| 208 | 208 | <div class='input-group date' id='datetimepicker2'> | 
| 209 | -			    <input type='text' id="end_date" name="end_date" class="form-control" autocomplete="off" value="<?php if (isset($_COOKIE['archive_end']) && $_COOKIE['archive_end'] != '') print date("Y-m-d H:i",$_COOKIE['archive_end']).' UTC'; ?>" /> | |
| 209 | +			    <input type='text' id="end_date" name="end_date" class="form-control" autocomplete="off" value="<?php if (isset($_COOKIE['archive_end']) && $_COOKIE['archive_end'] != '') print date("Y-m-d H:i", $_COOKIE['archive_end']).' UTC'; ?>" /> | |
| 210 | 210 | <span class="input-group-addon"> | 
| 211 | 211 | <span class="glyphicon glyphicon-calendar"></span> | 
| 212 | 212 | </span> | 
| @@ -354,9 +354,9 @@ discard block | ||
| 354 | 354 |  		    <li><?php echo _("Type of Terrain:"); ?> | 
| 355 | 355 | <select class="selectpicker" onchange="terrainType(this);"> | 
| 356 | 356 | <option value="stk"<?php if (!isset($_COOKIE['MapTerrain']) || $_COOKIE['MapTerrain'] == 'stk') print ' selected'; ?>>stk terrain</option> | 
| 357 | - <option value="ellipsoid"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'ellipsoid') print ' selected';?>>ellipsoid</option> | |
| 358 | - <option value="vrterrain"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'vrterrain') print ' selected';?>>vr terrain</option> | |
| 359 | - <option value="articdem"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'articdem') print ' selected';?>>ArticDEM</option> | |
| 357 | + <option value="ellipsoid"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'ellipsoid') print ' selected'; ?>>ellipsoid</option> | |
| 358 | + <option value="vrterrain"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'vrterrain') print ' selected'; ?>>vr terrain</option> | |
| 359 | + <option value="articdem"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'articdem') print ' selected'; ?>>ArticDEM</option> | |
| 360 | 360 | </select> | 
| 361 | 361 | </li> | 
| 362 | 362 | <?php | 
| @@ -411,7 +411,7 @@ discard block | ||
| 411 | 411 |  		    <li><div class="checkbox"><label><input type="checkbox" name="one3dmodel" value="1" onclick="useOne3Dmodel(this)" <?php if ((isset($_COOKIE['one3dmodel']) && $_COOKIE['one3dmodel'] == 'true') || (!isset($_COOKIE['one3dmodel']) && isset($globalMap3DOneModel) && $globalMap3DOneModel)) print 'checked'; ?> ><?php echo _("Use same 3D model for all aircraft (use fewer resources)"); ?></label></div></li> | 
| 412 | 412 | <?php | 
| 413 | 413 | } | 
| 414 | -    if (time() > mktime(0,0,0,12,1,date("Y")) && time() < mktime(0,0,0,12,31,date("Y"))) { | |
| 414 | +    if (time() > mktime(0, 0, 0, 12, 1, date("Y")) && time() < mktime(0, 0, 0, 12, 31, date("Y"))) { | |
| 415 | 415 | ?> | 
| 416 | 416 |  		    <li><div class="checkbox"><label><input type="checkbox" name="displaysanta" value="1" onclick="clickSanta(this)"><i class="fa fa-snowflake-o" aria-hidden="true"></i> <?php echo _("Show Santa Claus now"); ?> <i class="fa fa-snowflake-o" aria-hidden="true"></i></label></div></li> | 
| 417 | 417 | <?php | 
| @@ -586,10 +586,10 @@ discard block | ||
| 586 | 586 | $Spotter = new Spotter(); | 
| 587 | 587 | $allairlinenames = $Spotter->getAllAirlineNames(); | 
| 588 | 588 | } | 
| 589 | -				foreach($allairlinenames as $airline) { | |
| 589 | +				foreach ($allairlinenames as $airline) { | |
| 590 | 590 | $airline_name = $airline['airline_name']; | 
| 591 | - if (strlen($airline_name) > 30) $airline_name = substr($airline_name,0,30).'...'; | |
| 592 | -					if (isset($_COOKIE['filter_Airlines']) && in_array($airline['airline_icao'],explode(',',$_COOKIE['filter_Airlines']))) { | |
| 591 | + if (strlen($airline_name) > 30) $airline_name = substr($airline_name, 0, 30).'...'; | |
| 592 | +					if (isset($_COOKIE['filter_Airlines']) && in_array($airline['airline_icao'], explode(',', $_COOKIE['filter_Airlines']))) { | |
| 593 | 593 | echo '<option value="'.$airline['airline_icao'].'" selected>'.$airline_name.'</option>'; | 
| 594 | 594 |  					} else { | 
| 595 | 595 | echo '<option value="'.$airline['airline_icao'].'">'.$airline_name.'</option>'; | 
| @@ -608,7 +608,7 @@ discard block | ||
| 608 | 608 | <select class="selectpicker" onchange="alliance(this);" id="display_alliance"> | 
| 609 | 609 |  			    <option value="all"<?php if (!isset($_COOKIE['filter_alliance']) || $_COOKIE['filter_alliance'] == 'all' || $_COOKIE['filter_alliance'] == '') echo ' selected'; ?>><?php echo _("All"); ?></option> | 
| 610 | 610 | <?php | 
| 611 | -				foreach($allalliancenames as $alliance) { | |
| 611 | +				foreach ($allalliancenames as $alliance) { | |
| 612 | 612 | $alliance_name = $alliance['alliance']; | 
| 613 | 613 |  					if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] == $alliance_name) { | 
| 614 | 614 | echo '<option value="'.$alliance_name.'" selected>'.$alliance_name.'</option>'; | 
| @@ -644,8 +644,8 @@ discard block | ||
| 644 | 644 | */ | 
| 645 | 645 | $Source = new Source(); | 
| 646 | 646 |  				$datasource = $Source->getLocationInfoByType('gs'); | 
| 647 | -				foreach($datasource as $src) { | |
| 648 | -					if (isset($_COOKIE['filter_Sources']) && in_array($src['name'],explode(',',$_COOKIE['filter_Sources']))) { | |
| 647 | +				foreach ($datasource as $src) { | |
| 648 | +					if (isset($_COOKIE['filter_Sources']) && in_array($src['name'], explode(',', $_COOKIE['filter_Sources']))) { | |
| 649 | 649 | echo '<option value="'.$src['name'].'" selected>'.$src['name'].'</option>'; | 
| 650 | 650 |  					} else { | 
| 651 | 651 | echo '<option value="'.$src['name'].'">'.$src['name'].'</option>'; | 
| @@ -733,7 +733,7 @@ discard block | ||
| 733 | 733 | else if ($type_name == 'radar') $type_name = 'Radar Calibration'; | 
| 734 | 734 | else if ($type_name == 'tle-new') $type_name = 'Last 30 days launches'; | 
| 735 | 735 | |
| 736 | -					if (isset($_COOKIE['sattypes']) && in_array($type['tle_type'],explode(',',$_COOKIE['sattypes']))) { | |
| 736 | +					if (isset($_COOKIE['sattypes']) && in_array($type['tle_type'], explode(',', $_COOKIE['sattypes']))) { | |
| 737 | 737 | print '<option value="'.$type['tle_type'].'" selected>'.$type_name.'</option>'; | 
| 738 | 738 |  					} else { | 
| 739 | 739 | print '<option value="'.$type['tle_type'].'">'.$type_name.'</option>'; | 
| @@ -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,12 +141,12 @@ 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); | |
| 149 | - $spotter_array = $SpotterArchive->getMinLiveSpotterDataPlayback($begindate,$enddate,$filter); | |
| 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 | + $spotter_array = $SpotterArchive->getMinLiveSpotterDataPlayback($begindate, $enddate, $filter); | |
| 150 | 150 |  } elseif (isset($_COOKIE['archive']) && isset($_COOKIE['archive_begin']) && isset($_COOKIE['archive_end']) && isset($_COOKIE['archive_speed'])) { | 
| 151 | 151 | $from_archive = true; | 
| 152 | 152 |  //	$begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); | 
| @@ -162,55 +162,55 @@ discard block | ||
| 162 | 162 | } | 
| 163 | 163 | $enddate = $_COOKIE['archive_end']; | 
| 164 | 164 | $enddateinitial = $_COOKIE['archive_end']; | 
| 165 | - $archivespeed = filter_var($_COOKIE['archive_speed'],FILTER_SANITIZE_NUMBER_INT); | |
| 166 | -	$begindate = date('Y-m-d H:i:s',$begindate); | |
| 167 | -	$enddate = date('Y-m-d H:i:s',$enddate); | |
| 165 | + $archivespeed = filter_var($_COOKIE['archive_speed'], FILTER_SANITIZE_NUMBER_INT); | |
| 166 | +	$begindate = date('Y-m-d H:i:s', $begindate); | |
| 167 | +	$enddate = date('Y-m-d H:i:s', $enddate); | |
| 168 | 168 | //echo 'Begin : '.$begindate.' - End : '.$enddate."\n"; | 
| 169 | - $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate,$enddate,$filter); | |
| 169 | + $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate, $enddate, $filter); | |
| 170 | 170 |  } elseif ($tracker) { | 
| 171 | 171 | $coord = array(); | 
| 172 | 172 |  	if (isset($_GET['coord']) && $_GET['coord'] != '') { | 
| 173 | -		$coord = explode(',',$_GET['coord']); | |
| 174 | - if (!(filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT) | |
| 173 | +		$coord = explode(',', $_GET['coord']); | |
| 174 | + if (!(filter_var($coord[0], FILTER_VALIDATE_FLOAT) && filter_var($coord[1], FILTER_VALIDATE_FLOAT) && filter_var($coord[2], FILTER_VALIDATE_FLOAT) && filter_var($coord[3], FILTER_VALIDATE_FLOAT) | |
| 175 | 175 |  		    && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) { | 
| 176 | 176 | $coord = array(); | 
| 177 | 177 | } | 
| 178 | 178 | } | 
| 179 | - $spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord,$filter,true); | |
| 179 | + $spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord, $filter, true); | |
| 180 | 180 |  } elseif ($marine) { | 
| 181 | 181 | $coord = array(); | 
| 182 | 182 |  	if (isset($_GET['coord']) && $_GET['coord'] != '') { | 
| 183 | -		$coord = explode(',',$_GET['coord']); | |
| 184 | - if (!(filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT) | |
| 183 | +		$coord = explode(',', $_GET['coord']); | |
| 184 | + if (!(filter_var($coord[0], FILTER_VALIDATE_FLOAT) && filter_var($coord[1], FILTER_VALIDATE_FLOAT) && filter_var($coord[2], FILTER_VALIDATE_FLOAT) && filter_var($coord[3], FILTER_VALIDATE_FLOAT) | |
| 185 | 185 |  		    && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) { | 
| 186 | 186 | $coord = array(); | 
| 187 | 187 | } | 
| 188 | 188 | } | 
| 189 | - $spotter_array = $MarineLive->getMinLastLiveMarineData($coord,$filter,true); | |
| 189 | + $spotter_array = $MarineLive->getMinLastLiveMarineData($coord, $filter, true); | |
| 190 | 190 |  } else { | 
| 191 | 191 | $coord = array(); | 
| 192 | 192 |  	if (!((isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') && (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '')) && isset($_GET['coord']) && $_GET['coord'] != '') { | 
| 193 | -		$coord = explode(',',$_GET['coord']); | |
| 194 | - if (!(filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT) | |
| 193 | +		$coord = explode(',', $_GET['coord']); | |
| 194 | + if (!(filter_var($coord[0], FILTER_VALIDATE_FLOAT) && filter_var($coord[1], FILTER_VALIDATE_FLOAT) && filter_var($coord[2], FILTER_VALIDATE_FLOAT) && filter_var($coord[3], FILTER_VALIDATE_FLOAT) | |
| 195 | 195 |  		    && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) { | 
| 196 | 196 | $coord = array(); | 
| 197 | 197 | } | 
| 198 | 198 | } | 
| 199 | 199 | $previous_filter = $filter; | 
| 200 | 200 |  	if ((isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') && (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '')) { | 
| 201 | -		$filter = array_merge($filter,array('id' => $_COOKIE['MapTrack'])); | |
| 202 | - $spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord,$filter,true); | |
| 201 | +		$filter = array_merge($filter, array('id' => $_COOKIE['MapTrack'])); | |
| 202 | + $spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord, $filter, true); | |
| 203 | 203 |  	} elseif (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '' && !empty($coord)) { | 
| 204 | - $spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord,$filter,true,$_COOKIE['MapTrack']); | |
| 204 | + $spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord, $filter, true, $_COOKIE['MapTrack']); | |
| 205 | 205 |  	} else { | 
| 206 | - $spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord,$filter,true); | |
| 206 | + $spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord, $filter, true); | |
| 207 | 207 | } | 
| 208 | 208 | $filter = $previous_filter; | 
| 209 | 209 | } | 
| 210 | 210 | //print_r($spotter_array); | 
| 211 | 211 |  if (!empty($spotter_array) && isset($coord)) { | 
| 212 | 212 |  	if (isset($_GET['archive'])) { | 
| 213 | - $flightcnt = $SpotterArchive->getLiveSpotterCount($begindate,$enddate,$filter); | |
| 213 | + $flightcnt = $SpotterArchive->getLiveSpotterCount($begindate, $enddate, $filter); | |
| 214 | 214 |  	} elseif ($tracker) { | 
| 215 | 215 | $flightcnt = $TrackerLive->getLiveTrackerCount($filter); | 
| 216 | 216 |  	} elseif ($marine) { | 
| @@ -221,17 +221,17 @@ discard block | ||
| 221 | 221 | if ($flightcnt == '') $flightcnt = 0; | 
| 222 | 222 | } else $flightcnt = 0; | 
| 223 | 223 | |
| 224 | -$sqltime = round(microtime(true)-$begintime,2); | |
| 224 | +$sqltime = round(microtime(true) - $begintime, 2); | |
| 225 | 225 | $minitime = time(); | 
| 226 | 226 | $minitracktime_begin = time(); | 
| 227 | 227 | $minitracktime = $minitracktime_begin; | 
| 228 | 228 | $maxitime = 0; | 
| 229 | -$lastupdate = filter_input(INPUT_GET,'update',FILTER_SANITIZE_NUMBER_INT); | |
| 229 | +$lastupdate = filter_input(INPUT_GET, 'update', FILTER_SANITIZE_NUMBER_INT); | |
| 230 | 230 | $modelsdb = array(); | 
| 231 | 231 |  if (file_exists(dirname(__FILE__).'/models/modelsdb')) { | 
| 232 | -	if (($handle = fopen(dirname(__FILE__).'/models/modelsdb','r')) !== FALSE) { | |
| 233 | -		while (($row = fgetcsv($handle,1000)) !== FALSE) { | |
| 234 | -			if (isset($row[1]) ){ | |
| 232 | +	if (($handle = fopen(dirname(__FILE__).'/models/modelsdb', 'r')) !== FALSE) { | |
| 233 | +		while (($row = fgetcsv($handle, 1000)) !== FALSE) { | |
| 234 | +			if (isset($row[1])) { | |
| 235 | 235 | $model = $row[0]; | 
| 236 | 236 | $modelsdb[$model] = $row[1]; | 
| 237 | 237 | } | 
| @@ -241,9 +241,9 @@ discard block | ||
| 241 | 241 | } | 
| 242 | 242 | $modelsdb2 = array(); | 
| 243 | 243 |  if (file_exists(dirname(__FILE__).'/models/gltf2/modelsdb')) { | 
| 244 | -	if (($handle = fopen(dirname(__FILE__).'/models/gltf2/modelsdb','r')) !== FALSE) { | |
| 245 | -		while (($row = fgetcsv($handle,1000)) !== FALSE) { | |
| 246 | -			if (isset($row[1]) ){ | |
| 244 | +	if (($handle = fopen(dirname(__FILE__).'/models/gltf2/modelsdb', 'r')) !== FALSE) { | |
| 245 | +		while (($row = fgetcsv($handle, 1000)) !== FALSE) { | |
| 246 | +			if (isset($row[1])) { | |
| 247 | 247 | $model = $row[0]; | 
| 248 | 248 | $glb = $row[1]; | 
| 249 | 249 |  				if (isset($row[2])) { | 
| @@ -287,7 +287,7 @@ discard block | ||
| 287 | 287 | if (!empty($spotter_array) && is_array($spotter_array)) | 
| 288 | 288 |  { | 
| 289 | 289 | $nblatlong = 0; | 
| 290 | - foreach($spotter_array as $spotter_item) | |
| 290 | + foreach ($spotter_array as $spotter_item) | |
| 291 | 291 |  	{ | 
| 292 | 292 | $j++; | 
| 293 | 293 | //if (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'airwhere') $heightrelative = 'RELATIVE_TO_GROUND'; | 
| @@ -329,9 +329,9 @@ discard block | ||
| 329 | 329 | $output .= '"lastupdate": "'.$lastupdate.'",'; | 
| 330 | 330 | if (isset($spotter_item['format_source'])) $output .= '"format": "'.$spotter_item['format_source'].'",'; | 
| 331 | 331 |  			if ($tracker) { | 
| 332 | - $output.= '"type": "tracker"'; | |
| 332 | + $output .= '"type": "tracker"'; | |
| 333 | 333 |  			} elseif ($marine) { | 
| 334 | - $output.= '"type": "marine"'; | |
| 334 | + $output .= '"type": "marine"'; | |
| 335 | 335 |  			} else { | 
| 336 | 336 |  				if ($one3dmodel === false && isset($globalMap3DLiveries) && $globalMap3DLiveries) { | 
| 337 | 337 | $aircraft_icao = $spotter_item['aircraft_icao']; | 
| @@ -345,14 +345,14 @@ discard block | ||
| 345 | 345 |  						if (isset($airline_icao)) { | 
| 346 | 346 | $imagefile = $aircraft_icao.'-'.$airline_icao.'.png'; | 
| 347 | 347 |  							if (file_exists(dirname(__FILE__).'/models/gltf2/liveries/'.$imagefile)) { | 
| 348 | - $output.= '"liveries": "'.$globalURL.'/models/gltf2/liveries/'.$imagefile.'",'; | |
| 348 | + $output .= '"liveries": "'.$globalURL.'/models/gltf2/liveries/'.$imagefile.'",'; | |
| 349 | 349 | } | 
| 350 | 350 | } | 
| 351 | 351 | } | 
| 352 | - if ($ident != '') $output.= '"ident": "'.$ident.'",'; | |
| 352 | + if ($ident != '') $output .= '"ident": "'.$ident.'",'; | |
| 353 | 353 | } | 
| 354 | - $output.= '"gltf2": %gltf2%,'; | |
| 355 | - $output.= '"type": "flight"'; | |
| 354 | + $output .= '"gltf2": %gltf2%,'; | |
| 355 | + $output .= '"type": "flight"'; | |
| 356 | 356 | } | 
| 357 | 357 | $output .= '},'; | 
| 358 | 358 | |
| @@ -723,8 +723,8 @@ discard block | ||
| 723 | 723 | $output .= '},'; | 
| 724 | 724 | } | 
| 725 | 725 | } | 
| 726 | -			if (isset($onground) && $onground) $output = str_replace('%onground%','true',$output); | |
| 727 | -			else $output = str_replace('%onground%','false',$output); | |
| 726 | +			if (isset($onground) && $onground) $output = str_replace('%onground%', 'true', $output); | |
| 727 | +			else $output = str_replace('%onground%', 'false', $output); | |
| 728 | 728 | |
| 729 | 729 | // $output .= '"heightReference": "CLAMP_TO_GROUND",'; | 
| 730 | 730 | //$output .= '"heightReference": "'.$heightrelative.'",'; | 
| @@ -740,7 +740,7 @@ discard block | ||
| 740 | 740 | if ($minitime > strtotime($spotter_item['date'])) $minitime = strtotime($spotter_item['date']); | 
| 741 | 741 | if (isset($_COOKIE['MapTrack']) && $id == $_COOKIE['MapTrack'] && $minitracktime > strtotime($spotter_item['date'])) $minitracktime = strtotime($spotter_item['date']); | 
| 742 | 742 | if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']); | 
| 743 | -			$output .= '"'.date("c",strtotime($spotter_item['date'])).'", '; | |
| 743 | +			$output .= '"'.date("c", strtotime($spotter_item['date'])).'", '; | |
| 744 | 744 | $output .= $spotter_item['longitude'].', '; | 
| 745 | 745 | $output .= $spotter_item['latitude']; | 
| 746 | 746 | $prevlong = $spotter_item['longitude']; | 
| @@ -768,8 +768,8 @@ discard block | ||
| 768 | 768 | //$quat = quaternionrotate(deg2rad($spotter_item['heading']),deg2rad(0),deg2rad(0)); | 
| 769 | 769 |  			//$orientation .= '"'.date("c",strtotime($spotter_item['date'])).'",'.$quat['x'].','.$quat['y'].','.$quat['z'].','.$quat['w']; | 
| 770 | 770 |  		} else { | 
| 771 | - $nblatlong = $nblatlong+1; | |
| 772 | -			$output .= ',"'.date("c",strtotime($spotter_item['date'])).'", '; | |
| 771 | + $nblatlong = $nblatlong + 1; | |
| 772 | +			$output .= ',"'.date("c", strtotime($spotter_item['date'])).'", '; | |
| 773 | 773 | if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']); | 
| 774 | 774 |  			if ($spotter_item['ground_speed'] == 0) { | 
| 775 | 775 | $output .= $prevlong.', '; | 
| @@ -810,26 +810,26 @@ discard block | ||
| 810 | 810 | $output .= ']'; | 
| 811 | 811 |  if (isset($globalArchive) && $globalArchive === TRUE) { | 
| 812 | 812 |  	if (isset($begindateinitial)) { | 
| 813 | -		$output = str_replace('%minitime%',date("c",$begindateinitial),$output); | |
| 814 | -	} elseif ((time()-$globalLiveInterval) > $minitime) { | |
| 815 | -		if (time()-$globalLiveInterval > $maxitime) { | |
| 816 | -			$output = str_replace('%minitime%',date("c",$maxitime),$output); | |
| 813 | +		$output = str_replace('%minitime%', date("c", $begindateinitial), $output); | |
| 814 | +	} elseif ((time() - $globalLiveInterval) > $minitime) { | |
| 815 | +		if (time() - $globalLiveInterval > $maxitime) { | |
| 816 | +			$output = str_replace('%minitime%', date("c", $maxitime), $output); | |
| 817 | 817 |  		} else { | 
| 818 | -			$output = str_replace('%minitime%',date("c",time()-$globalLiveInterval),$output); | |
| 818 | +			$output = str_replace('%minitime%', date("c", time() - $globalLiveInterval), $output); | |
| 819 | 819 | } | 
| 820 | 820 | } | 
| 821 | -	else $output = str_replace('%minitime%',date("c",$minitime),$output); | |
| 821 | +	else $output = str_replace('%minitime%', date("c", $minitime), $output); | |
| 822 | 822 |  } elseif (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '' && $minitracktime != $minitracktime_begin) { | 
| 823 | -	$output = str_replace('%minitime%',date("c",$minitracktime),$output); | |
| 823 | +	$output = str_replace('%minitime%', date("c", $minitracktime), $output); | |
| 824 | 824 |  } else { | 
| 825 | -	$output = str_replace('%minitime%',date("c",$minitime),$output); | |
| 825 | +	$output = str_replace('%minitime%', date("c", $minitime), $output); | |
| 826 | 826 | } | 
| 827 | 827 |  if (isset($enddateinitial)) { | 
| 828 | -	$output = str_replace('%maxitime%',date("c",$enddateinitial),$output); | |
| 828 | +	$output = str_replace('%maxitime%', date("c", $enddateinitial), $output); | |
| 829 | 829 |  } else { | 
| 830 | -	$output = str_replace('%maxitime%',date("c",$maxitime),$output); | |
| 830 | +	$output = str_replace('%maxitime%', date("c", $maxitime), $output); | |
| 831 | 831 | } | 
| 832 | -if ($gltf2) $output = str_replace('%gltf2%','true',$output); | |
| 833 | -else $output = str_replace('%gltf2%','false',$output); | |
| 832 | +if ($gltf2) $output = str_replace('%gltf2%', 'true', $output); | |
| 833 | +else $output = str_replace('%gltf2%', 'false', $output); | |
| 834 | 834 | print $output; | 
| 835 | 835 | ?> |