@@ -39,30 +39,30 @@ discard block |
||
| 39 | 39 | |
| 40 | 40 | |
| 41 | 41 | function quaternionrotate($heading, $attitude = 0, $bank = 0) { |
| 42 | - // Assuming the angles are in radians. |
|
| 43 | - $c1 = cos($heading/2); |
|
| 44 | - $s1 = sin($heading/2); |
|
| 45 | - $c2 = cos($attitude/2); |
|
| 46 | - $s2 = sin($attitude/2); |
|
| 47 | - $c3 = cos($bank/2); |
|
| 48 | - $s3 = sin($bank/2); |
|
| 49 | - $c1c2 = $c1*$c2; |
|
| 50 | - $s1s2 = $s1*$s2; |
|
| 51 | - $w =$c1c2*$c3 - $s1s2*$s3; |
|
| 52 | - $x =$c1c2*$s3 + $s1s2*$c3; |
|
| 53 | - $y =$s1*$c2*$c3 + $c1*$s2*$s3; |
|
| 54 | - $z =$c1*$s2*$c3 - $s1*$c2*$s3; |
|
| 55 | - return array('x' => $x,'y' => $y,'z' => $z,'w' => $w); |
|
| 42 | + // Assuming the angles are in radians. |
|
| 43 | + $c1 = cos($heading/2); |
|
| 44 | + $s1 = sin($heading/2); |
|
| 45 | + $c2 = cos($attitude/2); |
|
| 46 | + $s2 = sin($attitude/2); |
|
| 47 | + $c3 = cos($bank/2); |
|
| 48 | + $s3 = sin($bank/2); |
|
| 49 | + $c1c2 = $c1*$c2; |
|
| 50 | + $s1s2 = $s1*$s2; |
|
| 51 | + $w =$c1c2*$c3 - $s1s2*$s3; |
|
| 52 | + $x =$c1c2*$s3 + $s1s2*$c3; |
|
| 53 | + $y =$s1*$c2*$c3 + $c1*$s2*$s3; |
|
| 54 | + $z =$c1*$s2*$c3 - $s1*$c2*$s3; |
|
| 55 | + return array('x' => $x,'y' => $y,'z' => $z,'w' => $w); |
|
| 56 | 56 | // return array('x' => '0.0','y' => '-0.931','z' => '0.0','w' => '0.365'); |
| 57 | 57 | |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | |
| 61 | 61 | if (isset($_GET['download'])) { |
| 62 | - if ($_GET['download'] == "true") |
|
| 63 | - { |
|
| 62 | + if ($_GET['download'] == "true") |
|
| 63 | + { |
|
| 64 | 64 | header('Content-disposition: attachment; filename="flightairmap.json"'); |
| 65 | - } |
|
| 65 | + } |
|
| 66 | 66 | } |
| 67 | 67 | header('Content-Type: text/javascript'); |
| 68 | 68 | |
@@ -239,10 +239,10 @@ discard block |
||
| 239 | 239 | $image = "images/placeholder_thumb.png"; |
| 240 | 240 | } |
| 241 | 241 | |
| 242 | - if (isset($spotter_item['flightaware_id'])) $id = $spotter_item['flightaware_id']; |
|
| 243 | - elseif (isset($spotter_item['famtrackid'])) $id = $spotter_item['famtrackid']; |
|
| 244 | - elseif (isset($spotter_item['fammarine_id'])) $id = $spotter_item['fammarine_id']; |
|
| 245 | - if ($prev_flightaware_id != $id) { |
|
| 242 | + if (isset($spotter_item['flightaware_id'])) $id = $spotter_item['flightaware_id']; |
|
| 243 | + elseif (isset($spotter_item['famtrackid'])) $id = $spotter_item['famtrackid']; |
|
| 244 | + elseif (isset($spotter_item['fammarine_id'])) $id = $spotter_item['fammarine_id']; |
|
| 245 | + if ($prev_flightaware_id != $id) { |
|
| 246 | 246 | if ($prev_flightaware_id != '') { |
| 247 | 247 | if ($nblatlong == 1) { |
| 248 | 248 | $output .= ',"'.date("c").'", '; |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | $spotter_item['wake_category'] = $aircraft_info[0]['wake_category']; |
| 302 | 302 | $spotter_item['engine_count'] = $aircraft_info[0]['engine_count']; |
| 303 | 303 | } else $aircraft_shadow = ''; |
| 304 | - $output .= ' "billboard" : {"image" : "'.$globalURL.'/images/aircrafts/new/'.$aircraft_shadow.'","scale" : 0.5'; |
|
| 304 | + $output .= ' "billboard" : {"image" : "'.$globalURL.'/images/aircrafts/new/'.$aircraft_shadow.'","scale" : 0.5'; |
|
| 305 | 305 | if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] && isset($_COOKIE['IconColor'])) { |
| 306 | 306 | $rgb = $Common->hex2rgb($_COOKIE['IconColor']); |
| 307 | 307 | $output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}'; |
@@ -331,7 +331,7 @@ discard block |
||
| 331 | 331 | $rgb = $Common->hex2rgb($_COOKIE['IconColor']); |
| 332 | 332 | $output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}'; |
| 333 | 333 | } |
| 334 | - $output .= '},'; |
|
| 334 | + $output .= '},'; |
|
| 335 | 335 | } elseif ($aircraft_icao != '') { |
| 336 | 336 | $aircraft_info = $Spotter->getAllAircraftInfo($aircraft_icao); |
| 337 | 337 | if (isset($aircraft_info[0]['engine_type'])) { |
@@ -48,11 +48,11 @@ discard block |
||
| 48 | 48 | $s3 = sin($bank/2); |
| 49 | 49 | $c1c2 = $c1*$c2; |
| 50 | 50 | $s1s2 = $s1*$s2; |
| 51 | - $w =$c1c2*$c3 - $s1s2*$s3; |
|
| 52 | - $x =$c1c2*$s3 + $s1s2*$c3; |
|
| 53 | - $y =$s1*$c2*$c3 + $c1*$s2*$s3; |
|
| 54 | - $z =$c1*$s2*$c3 - $s1*$c2*$s3; |
|
| 55 | - return array('x' => $x,'y' => $y,'z' => $z,'w' => $w); |
|
| 51 | + $w = $c1c2*$c3 - $s1s2*$s3; |
|
| 52 | + $x = $c1c2*$s3 + $s1s2*$c3; |
|
| 53 | + $y = $s1*$c2*$c3 + $c1*$s2*$s3; |
|
| 54 | + $z = $c1*$s2*$c3 - $s1*$c2*$s3; |
|
| 55 | + return array('x' => $x, 'y' => $y, 'z' => $z, 'w' => $w); |
|
| 56 | 56 | // return array('x' => '0.0','y' => '-0.931','z' => '0.0','w' => '0.365'); |
| 57 | 57 | |
| 58 | 58 | } |
@@ -73,16 +73,16 @@ discard block |
||
| 73 | 73 | $min = false; |
| 74 | 74 | $allhistory = false; |
| 75 | 75 | $filter['source'] = array(); |
| 76 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
| 77 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
| 78 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
| 79 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs')); |
|
| 80 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
| 81 | -if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
| 82 | -if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
| 83 | -if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
| 84 | -if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
| 85 | -if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING); |
|
| 76 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'], array('vatsimtxt')); |
|
| 77 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'], array('whazzup')); |
|
| 78 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'], array('phpvmacars')); |
|
| 79 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'], array('sbs', 'famaprs')); |
|
| 80 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'], array('aprs')); |
|
| 81 | +if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'], FILTER_SANITIZE_STRING); |
|
| 82 | +if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',', $_COOKIE['filter_Airlines']), FILTER_SANITIZE_STRING); |
|
| 83 | +if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',', $_COOKIE['filter_Sources']), FILTER_SANITIZE_STRING); |
|
| 84 | +if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'], FILTER_SANITIZE_STRING); |
|
| 85 | +if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'], FILTER_SANITIZE_STRING); |
|
| 86 | 86 | /* |
| 87 | 87 | if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) { |
| 88 | 88 | $min = true; |
@@ -129,12 +129,12 @@ discard block |
||
| 129 | 129 | $from_archive = true; |
| 130 | 130 | // $begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
| 131 | 131 | // $enddate = filter_input(INPUT_GET,'enddate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
| 132 | - $begindate = filter_input(INPUT_GET,'begindate',FILTER_SANITIZE_NUMBER_INT); |
|
| 133 | - $enddate = filter_input(INPUT_GET,'enddate',FILTER_SANITIZE_NUMBER_INT); |
|
| 134 | - $archivespeed = filter_input(INPUT_GET,'speed',FILTER_SANITIZE_NUMBER_INT); |
|
| 135 | - $begindate = date('Y-m-d H:i:s',$begindate); |
|
| 136 | - $enddate = date('Y-m-d H:i:s',$enddate); |
|
| 137 | - $spotter_array = $SpotterArchive->getMinLiveSpotterDataPlayback($begindate,$enddate,$filter); |
|
| 132 | + $begindate = filter_input(INPUT_GET, 'begindate', FILTER_SANITIZE_NUMBER_INT); |
|
| 133 | + $enddate = filter_input(INPUT_GET, 'enddate', FILTER_SANITIZE_NUMBER_INT); |
|
| 134 | + $archivespeed = filter_input(INPUT_GET, 'speed', FILTER_SANITIZE_NUMBER_INT); |
|
| 135 | + $begindate = date('Y-m-d H:i:s', $begindate); |
|
| 136 | + $enddate = date('Y-m-d H:i:s', $enddate); |
|
| 137 | + $spotter_array = $SpotterArchive->getMinLiveSpotterDataPlayback($begindate, $enddate, $filter); |
|
| 138 | 138 | } elseif (isset($_COOKIE['archive']) && isset($_COOKIE['archive_begin']) && isset($_COOKIE['archive_end']) && isset($_COOKIE['archive_speed'])) { |
| 139 | 139 | $from_archive = true; |
| 140 | 140 | // $begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
@@ -144,34 +144,34 @@ discard block |
||
| 144 | 144 | $begindate = $_COOKIE['archive_begin']; |
| 145 | 145 | $enddate = $_COOKIE['archive_end']; |
| 146 | 146 | |
| 147 | - $archivespeed = filter_var($_COOKIE['archive_speed'],FILTER_SANITIZE_NUMBER_INT); |
|
| 148 | - $begindate = date('Y-m-d H:i:s',$begindate); |
|
| 149 | - $enddate = date('Y-m-d H:i:s',$enddate); |
|
| 147 | + $archivespeed = filter_var($_COOKIE['archive_speed'], FILTER_SANITIZE_NUMBER_INT); |
|
| 148 | + $begindate = date('Y-m-d H:i:s', $begindate); |
|
| 149 | + $enddate = date('Y-m-d H:i:s', $enddate); |
|
| 150 | 150 | // echo 'Begin : '.$begindate.' - End : '.$enddate."\n"; |
| 151 | - $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate,$enddate,$filter); |
|
| 151 | + $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate, $enddate, $filter); |
|
| 152 | 152 | } elseif ($tracker) { |
| 153 | 153 | $coord = array(); |
| 154 | 154 | if (isset($_GET['coord']) && $_GET['coord'] != '') { |
| 155 | - $coord = explode(',',$_GET['coord']); |
|
| 155 | + $coord = explode(',', $_GET['coord']); |
|
| 156 | 156 | } |
| 157 | - $spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord,$filter,true); |
|
| 157 | + $spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord, $filter, true); |
|
| 158 | 158 | } elseif ($marine) { |
| 159 | 159 | $coord = array(); |
| 160 | 160 | if (isset($_GET['coord']) && $_GET['coord'] != '') { |
| 161 | - $coord = explode(',',$_GET['coord']); |
|
| 161 | + $coord = explode(',', $_GET['coord']); |
|
| 162 | 162 | } |
| 163 | - $spotter_array = $MarineLive->getMinLastLiveMarineData($coord,$filter,true); |
|
| 163 | + $spotter_array = $MarineLive->getMinLastLiveMarineData($coord, $filter, true); |
|
| 164 | 164 | } else { |
| 165 | 165 | $coord = array(); |
| 166 | 166 | if (isset($_GET['coord']) && $_GET['coord'] != '') { |
| 167 | - $coord = explode(',',$_GET['coord']); |
|
| 167 | + $coord = explode(',', $_GET['coord']); |
|
| 168 | 168 | } |
| 169 | - $spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord,$filter,true); |
|
| 169 | + $spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord, $filter, true); |
|
| 170 | 170 | } |
| 171 | 171 | //print_r($spotter_array); |
| 172 | 172 | if (!empty($spotter_array) && isset($coord)) { |
| 173 | 173 | if (isset($_GET['archive'])) { |
| 174 | - $flightcnt = $SpotterArchive->getLiveSpotterCount($begindate,$enddate,$filter); |
|
| 174 | + $flightcnt = $SpotterArchive->getLiveSpotterCount($begindate, $enddate, $filter); |
|
| 175 | 175 | } elseif ($tracker) { |
| 176 | 176 | $flightcnt = $TrackerLive->getLiveTrackerCount($filter); |
| 177 | 177 | } elseif ($marine) { |
@@ -182,15 +182,15 @@ discard block |
||
| 182 | 182 | if ($flightcnt == '') $flightcnt = 0; |
| 183 | 183 | } else $flightcnt = 0; |
| 184 | 184 | |
| 185 | -$sqltime = round(microtime(true)-$begintime,2); |
|
| 185 | +$sqltime = round(microtime(true) - $begintime, 2); |
|
| 186 | 186 | $minitime = time(); |
| 187 | 187 | $maxitime = 0; |
| 188 | -$lastupdate = filter_input(INPUT_GET,'update',FILTER_SANITIZE_NUMBER_INT); |
|
| 188 | +$lastupdate = filter_input(INPUT_GET, 'update', FILTER_SANITIZE_NUMBER_INT); |
|
| 189 | 189 | $modelsdb = array(); |
| 190 | 190 | if (file_exists(dirname(__FILE__).'/models/modelsdb')) { |
| 191 | - if (($handle = fopen(dirname(__FILE__).'/models/modelsdb','r')) !== FALSE) { |
|
| 192 | - while (($row = fgetcsv($handle,1000)) !== FALSE) { |
|
| 193 | - if (isset($row[1]) ){ |
|
| 191 | + if (($handle = fopen(dirname(__FILE__).'/models/modelsdb', 'r')) !== FALSE) { |
|
| 192 | + while (($row = fgetcsv($handle, 1000)) !== FALSE) { |
|
| 193 | + if (isset($row[1])) { |
|
| 194 | 194 | $model = $row[0]; |
| 195 | 195 | $modelsdb[$model] = $row[1]; |
| 196 | 196 | } |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | if (!empty($spotter_array) && is_array($spotter_array)) |
| 228 | 228 | { |
| 229 | 229 | $nblatlong = 0; |
| 230 | - foreach($spotter_array as $spotter_item) |
|
| 230 | + foreach ($spotter_array as $spotter_item) |
|
| 231 | 231 | { |
| 232 | 232 | $j++; |
| 233 | 233 | //if (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'airwhere') $heightrelative = 'RELATIVE_TO_GROUND'; |
@@ -267,11 +267,11 @@ discard block |
||
| 267 | 267 | $output .= '"lastupdate": "'.$lastupdate.'",'; |
| 268 | 268 | $output .= '"format": "'.$spotter_item['format_source'].'",'; |
| 269 | 269 | if ($tracker) { |
| 270 | - $output.= '"type": "tracker"'; |
|
| 270 | + $output .= '"type": "tracker"'; |
|
| 271 | 271 | } elseif ($marine) { |
| 272 | - $output.= '"type": "marine"'; |
|
| 272 | + $output .= '"type": "marine"'; |
|
| 273 | 273 | } else { |
| 274 | - $output.= '"type": "flight"'; |
|
| 274 | + $output .= '"type": "flight"'; |
|
| 275 | 275 | } |
| 276 | 276 | $output .= '},'; |
| 277 | 277 | |
@@ -615,8 +615,8 @@ discard block |
||
| 615 | 615 | $output .= '},'; |
| 616 | 616 | } |
| 617 | 617 | } |
| 618 | - if (isset($onground) && $onground) $output = str_replace('%onground%','true',$output); |
|
| 619 | - else $output = str_replace('%onground%','false',$output); |
|
| 618 | + if (isset($onground) && $onground) $output = str_replace('%onground%', 'true', $output); |
|
| 619 | + else $output = str_replace('%onground%', 'false', $output); |
|
| 620 | 620 | |
| 621 | 621 | // $output .= '"heightReference": "CLAMP_TO_GROUND",'; |
| 622 | 622 | //$output .= '"heightReference": "'.$heightrelative.'",'; |
@@ -631,7 +631,7 @@ discard block |
||
| 631 | 631 | $output .= '"cartographicDegrees": ['; |
| 632 | 632 | if ($minitime > strtotime($spotter_item['date'])) $minitime = strtotime($spotter_item['date']); |
| 633 | 633 | if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']); |
| 634 | - $output .= '"'.date("c",strtotime($spotter_item['date'])).'", '; |
|
| 634 | + $output .= '"'.date("c", strtotime($spotter_item['date'])).'", '; |
|
| 635 | 635 | $output .= $spotter_item['longitude'].', '; |
| 636 | 636 | $output .= $spotter_item['latitude']; |
| 637 | 637 | $prevlong = $spotter_item['longitude']; |
@@ -659,8 +659,8 @@ discard block |
||
| 659 | 659 | //$quat = quaternionrotate(deg2rad($spotter_item['heading']),deg2rad(0),deg2rad(0)); |
| 660 | 660 | //$orientation .= '"'.date("c",strtotime($spotter_item['date'])).'",'.$quat['x'].','.$quat['y'].','.$quat['z'].','.$quat['w']; |
| 661 | 661 | } else { |
| 662 | - $nblatlong = $nblatlong+1; |
|
| 663 | - $output .= ',"'.date("c",strtotime($spotter_item['date'])).'", '; |
|
| 662 | + $nblatlong = $nblatlong + 1; |
|
| 663 | + $output .= ',"'.date("c", strtotime($spotter_item['date'])).'", '; |
|
| 664 | 664 | if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']); |
| 665 | 665 | if ($spotter_item['ground_speed'] == 0) { |
| 666 | 666 | $output .= $prevlong.', '; |
@@ -700,15 +700,15 @@ discard block |
||
| 700 | 700 | } |
| 701 | 701 | $output .= ']'; |
| 702 | 702 | if (isset($globalArchive) && $globalArchive === TRUE) { |
| 703 | - if ((time()-$globalLiveInterval) > $minitime) { |
|
| 704 | - if (time()-$globalLiveInterval > $maxitime) { |
|
| 705 | - $output = str_replace('%minitime%',date("c",$maxitime),$output); |
|
| 703 | + if ((time() - $globalLiveInterval) > $minitime) { |
|
| 704 | + if (time() - $globalLiveInterval > $maxitime) { |
|
| 705 | + $output = str_replace('%minitime%', date("c", $maxitime), $output); |
|
| 706 | 706 | } else { |
| 707 | - $output = str_replace('%minitime%',date("c",time()-$globalLiveInterval),$output); |
|
| 707 | + $output = str_replace('%minitime%', date("c", time() - $globalLiveInterval), $output); |
|
| 708 | 708 | } |
| 709 | 709 | } |
| 710 | - else $output = str_replace('%minitime%',date("c",$minitime),$output); |
|
| 711 | -} else $output = str_replace('%minitime%',date("c",$minitime),$output); |
|
| 712 | -$output = str_replace('%maxitime%',date("c",$maxitime),$output); |
|
| 710 | + else $output = str_replace('%minitime%', date("c", $minitime), $output); |
|
| 711 | +} else $output = str_replace('%minitime%', date("c", $minitime), $output); |
|
| 712 | +$output = str_replace('%maxitime%', date("c", $maxitime), $output); |
|
| 713 | 713 | print $output; |
| 714 | 714 | ?> |
@@ -8,8 +8,12 @@ discard block |
||
| 8 | 8 | } |
| 9 | 9 | $tracker = false; |
| 10 | 10 | $marine = false; |
| 11 | -if (isset($_GET['tracker'])) $tracker = true; |
|
| 12 | -if (isset($_GET['marine'])) $marine = true; |
|
| 11 | +if (isset($_GET['tracker'])) { |
|
| 12 | + $tracker = true; |
|
| 13 | +} |
|
| 14 | +if (isset($_GET['marine'])) { |
|
| 15 | + $marine = true; |
|
| 16 | +} |
|
| 13 | 17 | if ($tracker) { |
| 14 | 18 | require_once('require/class.Tracker.php'); |
| 15 | 19 | require_once('require/class.TrackerLive.php'); |
@@ -66,23 +70,46 @@ discard block |
||
| 66 | 70 | } |
| 67 | 71 | header('Content-Type: text/javascript'); |
| 68 | 72 | |
| 69 | -if (!isset($globalJsonCompress)) $compress = true; |
|
| 70 | -else $compress = $globalJsonCompress; |
|
| 73 | +if (!isset($globalJsonCompress)) { |
|
| 74 | + $compress = true; |
|
| 75 | +} else { |
|
| 76 | + $compress = $globalJsonCompress; |
|
| 77 | +} |
|
| 71 | 78 | |
| 72 | 79 | $from_archive = false; |
| 73 | 80 | $min = false; |
| 74 | 81 | $allhistory = false; |
| 75 | 82 | $filter['source'] = array(); |
| 76 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
| 77 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
| 78 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
| 79 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs')); |
|
| 80 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
| 81 | -if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
| 82 | -if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
| 83 | -if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
| 84 | -if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
| 85 | -if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING); |
|
| 83 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') { |
|
| 84 | + $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
| 85 | +} |
|
| 86 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') { |
|
| 87 | + $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
| 88 | +} |
|
| 89 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') { |
|
| 90 | + $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
| 91 | +} |
|
| 92 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') { |
|
| 93 | + $filter['source'] = array_merge($filter['source'],array('sbs','famaprs')); |
|
| 94 | +} |
|
| 95 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') { |
|
| 96 | + $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
| 97 | +} |
|
| 98 | +if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') { |
|
| 99 | + $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
| 100 | +} |
|
| 101 | +if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') { |
|
| 102 | + $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
| 103 | +} |
|
| 104 | +if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') { |
|
| 105 | + $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
| 106 | +} |
|
| 107 | +if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') { |
|
| 108 | + $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
| 109 | +} |
|
| 110 | +if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') { |
|
| 111 | + $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING); |
|
| 112 | +} |
|
| 86 | 113 | /* |
| 87 | 114 | if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) { |
| 88 | 115 | $min = true; |
@@ -179,8 +206,12 @@ discard block |
||
| 179 | 206 | } else { |
| 180 | 207 | $flightcnt = $SpotterLive->getLiveSpotterCount($filter); |
| 181 | 208 | } |
| 182 | - if ($flightcnt == '') $flightcnt = 0; |
|
| 183 | -} else $flightcnt = 0; |
|
| 209 | + if ($flightcnt == '') { |
|
| 210 | + $flightcnt = 0; |
|
| 211 | + } |
|
| 212 | + } else { |
|
| 213 | + $flightcnt = 0; |
|
| 214 | +} |
|
| 184 | 215 | |
| 185 | 216 | $sqltime = round(microtime(true)-$begintime,2); |
| 186 | 217 | $minitime = time(); |
@@ -203,7 +234,9 @@ discard block |
||
| 203 | 234 | $j = 0; |
| 204 | 235 | $prev_flightaware_id = ''; |
| 205 | 236 | $speed = 1; |
| 206 | -if (isset($archivespeed)) $speed = $archivespeed; |
|
| 237 | +if (isset($archivespeed)) { |
|
| 238 | + $speed = $archivespeed; |
|
| 239 | +} |
|
| 207 | 240 | $output = '['; |
| 208 | 241 | if ($tracker) { |
| 209 | 242 | $output .= '{"id" : "document", "name" : "tracker","version" : "1.0"'; |
@@ -239,17 +272,24 @@ discard block |
||
| 239 | 272 | $image = "images/placeholder_thumb.png"; |
| 240 | 273 | } |
| 241 | 274 | |
| 242 | - if (isset($spotter_item['flightaware_id'])) $id = $spotter_item['flightaware_id']; |
|
| 243 | - elseif (isset($spotter_item['famtrackid'])) $id = $spotter_item['famtrackid']; |
|
| 244 | - elseif (isset($spotter_item['fammarine_id'])) $id = $spotter_item['fammarine_id']; |
|
| 275 | + if (isset($spotter_item['flightaware_id'])) { |
|
| 276 | + $id = $spotter_item['flightaware_id']; |
|
| 277 | + } elseif (isset($spotter_item['famtrackid'])) { |
|
| 278 | + $id = $spotter_item['famtrackid']; |
|
| 279 | + } elseif (isset($spotter_item['fammarine_id'])) { |
|
| 280 | + $id = $spotter_item['fammarine_id']; |
|
| 281 | + } |
|
| 245 | 282 | if ($prev_flightaware_id != $id) { |
| 246 | 283 | if ($prev_flightaware_id != '') { |
| 247 | 284 | if ($nblatlong == 1) { |
| 248 | 285 | $output .= ',"'.date("c").'", '; |
| 249 | 286 | $output .= $prevlong.', '; |
| 250 | 287 | $output .= $prevlat; |
| 251 | - if (!$marine) $output .= ', '.$prevalt; |
|
| 252 | - else $output .= ', 0'; |
|
| 288 | + if (!$marine) { |
|
| 289 | + $output .= ', '.$prevalt; |
|
| 290 | + } else { |
|
| 291 | + $output .= ', 0'; |
|
| 292 | + } |
|
| 253 | 293 | } |
| 254 | 294 | $output .= ']'; |
| 255 | 295 | $output .= '}'; |
@@ -300,7 +340,9 @@ discard block |
||
| 300 | 340 | $spotter_item['engine_type'] = $aircraft_info[0]['engine_type']; |
| 301 | 341 | $spotter_item['wake_category'] = $aircraft_info[0]['wake_category']; |
| 302 | 342 | $spotter_item['engine_count'] = $aircraft_info[0]['engine_count']; |
| 303 | - } else $aircraft_shadow = ''; |
|
| 343 | + } else { |
|
| 344 | + $aircraft_shadow = ''; |
|
| 345 | + } |
|
| 304 | 346 | $output .= ' "billboard" : {"image" : "'.$globalURL.'/images/aircrafts/new/'.$aircraft_shadow.'","scale" : 0.5'; |
| 305 | 347 | if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] && isset($_COOKIE['IconColor'])) { |
| 306 | 348 | $rgb = $Common->hex2rgb($_COOKIE['IconColor']); |
@@ -308,7 +350,9 @@ discard block |
||
| 308 | 350 | } |
| 309 | 351 | $output .= '},'; |
| 310 | 352 | } |
| 311 | - } else $output .= ' "billboard" : {"image" : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAfCAYAAACVgY94AAAACXBIWXMAAC4jAAAuIwF4pT92AAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAE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W8jFOqiyN7p3pAPX04c7AxYSoDDcAjKT2LgLXA6IR2M3Bviv59wDTgQGTPH84Qd8+HXfHcoUws2zM0HMjuUPep+xP2PWpnwtw0GJsldbBpewQwE/gbeDyt7H1gcW53O7AC+A3Yn6+/W+Ld9SnWA15DAVhc8xK2TuA9YHrCuhV4EngFuBx4YagG6qv8cF+T52kB2Zy+e1I8taUacNV+uBdXO7ABmJwJpwx8XQvF9TUCWM64tiQhbq/oMv+7BwFWpQzNT8vbVQul/wwAGzzdmXU1xuUAAAAASUVORK5CYII=","scale" : 0.5},'; |
|
| 353 | + } else { |
|
| 354 | + $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/Pf14L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 357 | if (isset($globalMap3DForceModel) && $globalMap3DForceModel != '') { |
| 314 | 358 | $output .= '"model": {"gltf" : "'.$globalURL.'/models/'.$globalMap3DForceModel.'","scale" : 1.0,"minimumPixelSize": 20'; |
@@ -339,7 +383,9 @@ discard block |
||
| 339 | 383 | $spotter_item['engine_type'] = $aircraft_info[0]['engine_type']; |
| 340 | 384 | $spotter_item['wake_category'] = $aircraft_info[0]['wake_category']; |
| 341 | 385 | $spotter_item['engine_count'] = $aircraft_info[0]['engine_count']; |
| 342 | - } else $aircraft_shadow = ''; |
|
| 386 | + } else { |
|
| 387 | + $aircraft_shadow = ''; |
|
| 388 | + } |
|
| 343 | 389 | if ($aircraft_shadow != '') { |
| 344 | 390 | if (isset($modelsdb[$aircraft_shadow])) { |
| 345 | 391 | $output .= '"model": {"gltf" : "'.$globalURL.'/models/'.$modelsdb[$aircraft_shadow].'","scale" : 1.0,"minimumPixelSize": 20'; |
@@ -476,7 +522,9 @@ discard block |
||
| 476 | 522 | } |
| 477 | 523 | $output .= '},'; |
| 478 | 524 | //if ($spotter_item['aircraft_shadow'] != '') $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",'; |
| 479 | - if ($spotter_item['aircraft_icao'] != '') $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
| 525 | + if ($spotter_item['aircraft_icao'] != '') { |
|
| 526 | + $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
| 527 | + } |
|
| 480 | 528 | $modelsdb[$aircraft_icao] = 'Cesium_Air.glb'; |
| 481 | 529 | } |
| 482 | 530 | } elseif (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'aprs') { |
@@ -498,7 +546,9 @@ discard block |
||
| 498 | 546 | } |
| 499 | 547 | $output .= '},'; |
| 500 | 548 | //if ($spotter_item['aircraft_shadow'] != '') $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",'; |
| 501 | - if ($spotter_item['aircraft_icao'] != '') $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
| 549 | + if ($spotter_item['aircraft_icao'] != '') { |
|
| 550 | + $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
| 551 | + } |
|
| 502 | 552 | $modelsdb[$aircraft_icao] = 'Cesium_Air.glb'; |
| 503 | 553 | } |
| 504 | 554 | } else { |
@@ -511,7 +561,9 @@ discard block |
||
| 511 | 561 | } |
| 512 | 562 | $output .= '},'; |
| 513 | 563 | //if ($spotter_item['aircraft_shadow'] != '') $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",'; |
| 514 | - if ($spotter_item['aircraft_icao'] != '') $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
| 564 | + if ($spotter_item['aircraft_icao'] != '') { |
|
| 565 | + $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
| 566 | + } |
|
| 515 | 567 | $modelsdb[$aircraft_icao] = 'Cesium_Air.glb'; |
| 516 | 568 | } |
| 517 | 569 | } elseif ($tracker && isset($spotter_item['type'])) { |
@@ -615,8 +667,11 @@ discard block |
||
| 615 | 667 | $output .= '},'; |
| 616 | 668 | } |
| 617 | 669 | } |
| 618 | - if (isset($onground) && $onground) $output = str_replace('%onground%','true',$output); |
|
| 619 | - else $output = str_replace('%onground%','false',$output); |
|
| 670 | + if (isset($onground) && $onground) { |
|
| 671 | + $output = str_replace('%onground%','true',$output); |
|
| 672 | + } else { |
|
| 673 | + $output = str_replace('%onground%','false',$output); |
|
| 674 | + } |
|
| 620 | 675 | |
| 621 | 676 | // $output .= '"heightReference": "CLAMP_TO_GROUND",'; |
| 622 | 677 | //$output .= '"heightReference": "'.$heightrelative.'",'; |
@@ -629,8 +684,12 @@ discard block |
||
| 629 | 684 | // $output .= '"interpolationDegree" : 5,'; |
| 630 | 685 | // $output .= '"epoch" : "'.date("c",strtotime($spotter_item['date'])).'", '; |
| 631 | 686 | $output .= '"cartographicDegrees": ['; |
| 632 | - if ($minitime > strtotime($spotter_item['date'])) $minitime = strtotime($spotter_item['date']); |
|
| 633 | - if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']); |
|
| 687 | + if ($minitime > strtotime($spotter_item['date'])) { |
|
| 688 | + $minitime = strtotime($spotter_item['date']); |
|
| 689 | + } |
|
| 690 | + if ($maxitime < strtotime($spotter_item['date'])) { |
|
| 691 | + $maxitime = strtotime($spotter_item['date']); |
|
| 692 | + } |
|
| 634 | 693 | $output .= '"'.date("c",strtotime($spotter_item['date'])).'", '; |
| 635 | 694 | $output .= $spotter_item['longitude'].', '; |
| 636 | 695 | $output .= $spotter_item['latitude']; |
@@ -653,7 +712,9 @@ discard block |
||
| 653 | 712 | $output .= ', '.round($spotter_item['altitude']*30.48); |
| 654 | 713 | $prevalt = round($spotter_item['altitude']*30.48); |
| 655 | 714 | } |
| 656 | - } else $output .= ', 0'; |
|
| 715 | + } else { |
|
| 716 | + $output .= ', 0'; |
|
| 717 | + } |
|
| 657 | 718 | //$orientation = '"orientation" : { '; |
| 658 | 719 | //$orientation .= '"unitQuaternion": ['; |
| 659 | 720 | //$quat = quaternionrotate(deg2rad($spotter_item['heading']),deg2rad(0),deg2rad(0)); |
@@ -661,13 +722,18 @@ discard block |
||
| 661 | 722 | } else { |
| 662 | 723 | $nblatlong = $nblatlong+1; |
| 663 | 724 | $output .= ',"'.date("c",strtotime($spotter_item['date'])).'", '; |
| 664 | - if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']); |
|
| 725 | + if ($maxitime < strtotime($spotter_item['date'])) { |
|
| 726 | + $maxitime = strtotime($spotter_item['date']); |
|
| 727 | + } |
|
| 665 | 728 | if ($spotter_item['ground_speed'] == 0) { |
| 666 | 729 | $output .= $prevlong.', '; |
| 667 | 730 | $output .= $prevlat; |
| 668 | 731 | //if (!$marine && (!isset($onground) || !$onground)) $output .= ', '.$prevalt; |
| 669 | - if (!$marine) $output .= ', '.$prevalt; |
|
| 670 | - else $output .= ', 0'; |
|
| 732 | + if (!$marine) { |
|
| 733 | + $output .= ', '.$prevalt; |
|
| 734 | + } else { |
|
| 735 | + $output .= ', 0'; |
|
| 736 | + } |
|
| 671 | 737 | } else { |
| 672 | 738 | $output .= $spotter_item['longitude'].', '; |
| 673 | 739 | $output .= $spotter_item['latitude']; |
@@ -680,14 +746,17 @@ discard block |
||
| 680 | 746 | $output .= ', 0'; |
| 681 | 747 | } |
| 682 | 748 | } else { |
| 683 | - if (isset($spotter_item['real_altitude']) && $spotter_item['real_altitude'] != '') $output .= ', '.round($spotter_item['real_altitude']*0.3048); |
|
| 684 | - elseif ($tracker) { |
|
| 749 | + if (isset($spotter_item['real_altitude']) && $spotter_item['real_altitude'] != '') { |
|
| 750 | + $output .= ', '.round($spotter_item['real_altitude']*0.3048); |
|
| 751 | + } elseif ($tracker) { |
|
| 685 | 752 | $output .= ', '.round($spotter_item['altitude']*0.3048); |
| 686 | 753 | } else { |
| 687 | 754 | $output .= ', '.round($spotter_item['altitude']*30.48); |
| 688 | 755 | } |
| 689 | 756 | } |
| 690 | - } else $output .= ', 0'; |
|
| 757 | + } else { |
|
| 758 | + $output .= ', 0'; |
|
| 759 | + } |
|
| 691 | 760 | } |
| 692 | 761 | //$quat = quaternionrotate(deg2rad($spotter_item['heading']),deg2rad(0),deg2rad(0)); |
| 693 | 762 | //$orientation .= ',"'.date("c",strtotime($spotter_item['date'])).'",'.$quat['x'].','.$quat['y'].','.$quat['z'].','.$quat['w']; |
@@ -706,9 +775,12 @@ discard block |
||
| 706 | 775 | } else { |
| 707 | 776 | $output = str_replace('%minitime%',date("c",time()-$globalLiveInterval),$output); |
| 708 | 777 | } |
| 778 | + } else { |
|
| 779 | + $output = str_replace('%minitime%',date("c",$minitime),$output); |
|
| 709 | 780 | } |
| 710 | - else $output = str_replace('%minitime%',date("c",$minitime),$output); |
|
| 711 | -} else $output = str_replace('%minitime%',date("c",$minitime),$output); |
|
| 781 | + } else { |
|
| 782 | + $output = str_replace('%minitime%',date("c",$minitime),$output); |
|
| 783 | +} |
|
| 712 | 784 | $output = str_replace('%maxitime%',date("c",$maxitime),$output); |
| 713 | 785 | print $output; |
| 714 | 786 | ?> |
@@ -17,12 +17,19 @@ discard block |
||
| 17 | 17 | date_default_timezone_set('UTC'); |
| 18 | 18 | |
| 19 | 19 | print '<div class="top">'; |
| 20 | -if ($spotter_item['name'] != '') print '<div class="right"><div class="callsign-details"><div class="callsign">'.$spotter_item['name'].'</div>'; |
|
| 21 | -elseif ($spotter_item['location_id'] != 0) print '<div class="right"><div class="callsign-details"><div class="callsign">'.$spotter_item['location_id'].'</div>'; |
|
| 22 | -elseif ($spotter_item['type'] == 'lightning') print '<div class="right"><div class="callsign-details"><div class="callsign">'._("Lightning").'</div>'; |
|
| 23 | -elseif ($spotter_item['type'] == 'wx') print '<div class="right"><div class="callsign-details"><div class="callsign">'._("Weather Station").'</div>'; |
|
| 24 | -elseif ($spotter_item['type'] == 'fires') print '<div class="right"><div class="callsign-details"><div class="callsign">'._("Fire").'</div>'; |
|
| 25 | -else print '<div class="right"><div class="callsign-details"><div class="callsign"></div>'; |
|
| 20 | +if ($spotter_item['name'] != '') { |
|
| 21 | + print '<div class="right"><div class="callsign-details"><div class="callsign">'.$spotter_item['name'].'</div>'; |
|
| 22 | +} elseif ($spotter_item['location_id'] != 0) { |
|
| 23 | + print '<div class="right"><div class="callsign-details"><div class="callsign">'.$spotter_item['location_id'].'</div>'; |
|
| 24 | +} elseif ($spotter_item['type'] == 'lightning') { |
|
| 25 | + print '<div class="right"><div class="callsign-details"><div class="callsign">'._("Lightning").'</div>'; |
|
| 26 | +} elseif ($spotter_item['type'] == 'wx') { |
|
| 27 | + print '<div class="right"><div class="callsign-details"><div class="callsign">'._("Weather Station").'</div>'; |
|
| 28 | +} elseif ($spotter_item['type'] == 'fires') { |
|
| 29 | + print '<div class="right"><div class="callsign-details"><div class="callsign">'._("Fire").'</div>'; |
|
| 30 | +} else { |
|
| 31 | + print '<div class="right"><div class="callsign-details"><div class="callsign"></div>'; |
|
| 32 | +} |
|
| 26 | 33 | print '</div>'; |
| 27 | 34 | |
| 28 | 35 | print '</div></div>'; |
@@ -40,8 +47,12 @@ discard block |
||
| 40 | 47 | print $spotter_item['last_seen'].' UTC'; |
| 41 | 48 | print '</div>'; |
| 42 | 49 | |
| 43 | -if ($spotter_item['city'] != '') print '<div><span>'._("City").'</span>'.$spotter_item['city'].'</div>'; |
|
| 44 | -if ($spotter_item['country'] !='') print '<div><span>'._("Country").'</span>'.$spotter_item['country'].'</div>'; |
|
| 50 | +if ($spotter_item['city'] != '') { |
|
| 51 | + print '<div><span>'._("City").'</span>'.$spotter_item['city'].'</div>'; |
|
| 52 | +} |
|
| 53 | +if ($spotter_item['country'] !='') { |
|
| 54 | + print '<div><span>'._("Country").'</span>'.$spotter_item['country'].'</div>'; |
|
| 55 | +} |
|
| 45 | 56 | print '<div><span>'._("Coordinates").'</span>'.round($spotter_item['latitude'],4).', '.round($spotter_item['longitude'],4).'</div>'; |
| 46 | 57 | /* |
| 47 | 58 | if ($spotter_item['atc_range'] > 0) { |
@@ -53,13 +64,27 @@ discard block |
||
| 53 | 64 | if ($spotter_item['type'] == 'wx') { |
| 54 | 65 | $weather = json_decode($spotter_item['description'],true); |
| 55 | 66 | //print_r($weather); |
| 56 | - if (isset($weather['temp'])) print '<div><span>'._("Temperature").'</span>'.$weather['temp'].'°C</div>'; |
|
| 57 | - if (isset($weather['pressure'])) print '<div><span>'._("Pressure").'</span>'.$weather['pressure'].'hPa</div>'; |
|
| 58 | - if (isset($weather['wind_gust'])) print '<div><span>'._("Wind Gust").'</span>'.$weather['wind_gust'].' km/h</div>'; |
|
| 59 | - if (isset($weather['humidity'])) print '<div><span>'._("Humidity").'</span>'.$weather['humidity'].'%</div>'; |
|
| 60 | - if (isset($weather['rain'])) print '<div><span>'._("Rain").'</span>'.$weather['rain'].' mm</div>'; |
|
| 61 | - if (isset($weather['precipitation'])) print '<div><span>'._("Precipitation 24H").'</span>'.$weather['precipitation'].' mm</div>'; |
|
| 62 | - if (isset($weather['precipitation24h'])) print '<div><span>'._("Precipitation Today").'</span>'.$weather['precipitation24h'].' mm</div>'; |
|
| 67 | + if (isset($weather['temp'])) { |
|
| 68 | + print '<div><span>'._("Temperature").'</span>'.$weather['temp'].'°C</div>'; |
|
| 69 | + } |
|
| 70 | + if (isset($weather['pressure'])) { |
|
| 71 | + print '<div><span>'._("Pressure").'</span>'.$weather['pressure'].'hPa</div>'; |
|
| 72 | + } |
|
| 73 | + if (isset($weather['wind_gust'])) { |
|
| 74 | + print '<div><span>'._("Wind Gust").'</span>'.$weather['wind_gust'].' km/h</div>'; |
|
| 75 | + } |
|
| 76 | + if (isset($weather['humidity'])) { |
|
| 77 | + print '<div><span>'._("Humidity").'</span>'.$weather['humidity'].'%</div>'; |
|
| 78 | + } |
|
| 79 | + if (isset($weather['rain'])) { |
|
| 80 | + print '<div><span>'._("Rain").'</span>'.$weather['rain'].' mm</div>'; |
|
| 81 | + } |
|
| 82 | + if (isset($weather['precipitation'])) { |
|
| 83 | + print '<div><span>'._("Precipitation 24H").'</span>'.$weather['precipitation'].' mm</div>'; |
|
| 84 | + } |
|
| 85 | + if (isset($weather['precipitation24h'])) { |
|
| 86 | + print '<div><span>'._("Precipitation Today").'</span>'.$weather['precipitation24h'].' mm</div>'; |
|
| 87 | + } |
|
| 63 | 88 | $spotter_item['description'] = $weather['comment']; |
| 64 | 89 | } |
| 65 | 90 | print '</div>'; |