@@ -55,23 +55,23 @@ discard block |
||
| 55 | 55 | $min = true; |
| 56 | 56 | $allhistory = false; |
| 57 | 57 | $filter['source'] = array(); |
| 58 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
| 59 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
| 60 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
| 61 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs')); |
|
| 62 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
| 63 | -if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
| 64 | -if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
| 65 | -if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
| 66 | -if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
| 67 | -if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING); |
|
| 58 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'], array('vatsimtxt')); |
|
| 59 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'], array('whazzup')); |
|
| 60 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'], array('phpvmacars')); |
|
| 61 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'], array('sbs', 'famaprs')); |
|
| 62 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'], array('aprs')); |
|
| 63 | +if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'], FILTER_SANITIZE_STRING); |
|
| 64 | +if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',', $_COOKIE['filter_Airlines']), FILTER_SANITIZE_STRING); |
|
| 65 | +if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',', $_COOKIE['filter_Sources']), FILTER_SANITIZE_STRING); |
|
| 66 | +if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'], FILTER_SANITIZE_STRING); |
|
| 67 | +if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'], FILTER_SANITIZE_STRING); |
|
| 68 | 68 | |
| 69 | 69 | if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) { |
| 70 | 70 | $min = true; |
| 71 | 71 | } else $min = false; |
| 72 | 72 | |
| 73 | 73 | if (isset($_GET['ident'])) { |
| 74 | - $ident = urldecode(filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING)); |
|
| 74 | + $ident = urldecode(filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING)); |
|
| 75 | 75 | if ($tracker) { |
| 76 | 76 | $spotter_array = $TrackerLive->getLastLiveTrackerDataByIdent($ident); |
| 77 | 77 | } elseif ($marine) { |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | } |
| 86 | 86 | $allhistory = true; |
| 87 | 87 | } elseif (isset($_GET['flightaware_id'])) { |
| 88 | - $flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING); |
|
| 88 | + $flightaware_id = filter_input(INPUT_GET, 'flightaware_id', FILTER_SANITIZE_STRING); |
|
| 89 | 89 | $spotter_array = $SpotterLive->getLastLiveSpotterDataById($flightaware_id); |
| 90 | 90 | if (empty($spotter_array)) { |
| 91 | 91 | $from_archive = true; |
@@ -93,44 +93,44 @@ discard block |
||
| 93 | 93 | } |
| 94 | 94 | $allhistory = true; |
| 95 | 95 | } elseif (isset($_GET['famtrack_id'])) { |
| 96 | - $famtrack_id = urldecode(filter_input(INPUT_GET,'famtrack_id',FILTER_SANITIZE_STRING)); |
|
| 96 | + $famtrack_id = urldecode(filter_input(INPUT_GET, 'famtrack_id', FILTER_SANITIZE_STRING)); |
|
| 97 | 97 | $spotter_array = $TrackerLive->getLastLiveTrackerDataById($famtrack_id); |
| 98 | 98 | $allhistory = true; |
| 99 | 99 | } elseif (isset($_GET['fammarine_id'])) { |
| 100 | - $fammarine_id = urldecode(filter_input(INPUT_GET,'fammarine_id',FILTER_SANITIZE_STRING)); |
|
| 100 | + $fammarine_id = urldecode(filter_input(INPUT_GET, 'fammarine_id', FILTER_SANITIZE_STRING)); |
|
| 101 | 101 | $spotter_array = $MarineLive->getLastLiveMarineDataById($fammarine_id); |
| 102 | 102 | $allhistory = true; |
| 103 | 103 | } elseif (isset($globalMapUseBbox) && $globalMapUseBbox && isset($_GET['coord']) && (!isset($globalMapPopup) || $globalMapPopup || (isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true'))) { |
| 104 | 104 | //} elseif (isset($_GET['coord'])) { |
| 105 | 105 | $usecoord = true; |
| 106 | - $coord = explode(',',$_GET['coord']); |
|
| 106 | + $coord = explode(',', $_GET['coord']); |
|
| 107 | 107 | if ($tracker) { |
| 108 | - $spotter_array = $TrackerLive->getLiveTrackerDatabyCoord($coord,$filter); |
|
| 108 | + $spotter_array = $TrackerLive->getLiveTrackerDatabyCoord($coord, $filter); |
|
| 109 | 109 | } elseif ($marine) { |
| 110 | - $spotter_array = $MarineLive->getLiveMarineDatabyCoord($coord,$filter); |
|
| 110 | + $spotter_array = $MarineLive->getLiveMarineDatabyCoord($coord, $filter); |
|
| 111 | 111 | } else { |
| 112 | - $spotter_array = $SpotterLive->getLiveSpotterDatabyCoord($coord,$filter); |
|
| 112 | + $spotter_array = $SpotterLive->getLiveSpotterDatabyCoord($coord, $filter); |
|
| 113 | 113 | } |
| 114 | 114 | } elseif (isset($globalMapUseBbox) && $globalMapUseBbox && isset($_GET['coord']) && $min) { |
| 115 | 115 | $usecoord = true; |
| 116 | - $coord = explode(',',$_GET['coord']); |
|
| 116 | + $coord = explode(',', $_GET['coord']); |
|
| 117 | 117 | if ($tracker) { |
| 118 | - $spotter_array = $TrackerLive->getMinLiveTrackerDatabyCoord($coord,$filter); |
|
| 118 | + $spotter_array = $TrackerLive->getMinLiveTrackerDatabyCoord($coord, $filter); |
|
| 119 | 119 | } elseif ($marine) { |
| 120 | - $spotter_array = $MarineLive->getMinLiveMarineDatabyCoord($coord,$filter); |
|
| 120 | + $spotter_array = $MarineLive->getMinLiveMarineDatabyCoord($coord, $filter); |
|
| 121 | 121 | } else { |
| 122 | - $spotter_array = $SpotterLive->getMinLiveSpotterDatabyCoord($coord,$filter); |
|
| 122 | + $spotter_array = $SpotterLive->getMinLiveSpotterDatabyCoord($coord, $filter); |
|
| 123 | 123 | } |
| 124 | 124 | } elseif (isset($_GET['archive']) && isset($_GET['begindate']) && isset($_GET['enddate']) && isset($_GET['speed']) && !isset($_GET['tracker']) && !isset($_GET['marine'])) { |
| 125 | 125 | $from_archive = true; |
| 126 | 126 | // $begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
| 127 | 127 | // $enddate = filter_input(INPUT_GET,'enddate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
| 128 | - $begindate = filter_input(INPUT_GET,'begindate',FILTER_SANITIZE_NUMBER_INT); |
|
| 129 | - $enddate = filter_input(INPUT_GET,'enddate',FILTER_SANITIZE_NUMBER_INT); |
|
| 130 | - $archivespeed = filter_input(INPUT_GET,'speed',FILTER_SANITIZE_NUMBER_INT); |
|
| 131 | - $begindate = date('Y-m-d H:i:s',$begindate); |
|
| 132 | - $enddate = date('Y-m-d H:i:s',$enddate); |
|
| 133 | - $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate,$enddate,$filter); |
|
| 128 | + $begindate = filter_input(INPUT_GET, 'begindate', FILTER_SANITIZE_NUMBER_INT); |
|
| 129 | + $enddate = filter_input(INPUT_GET, 'enddate', FILTER_SANITIZE_NUMBER_INT); |
|
| 130 | + $archivespeed = filter_input(INPUT_GET, 'speed', FILTER_SANITIZE_NUMBER_INT); |
|
| 131 | + $begindate = date('Y-m-d H:i:s', $begindate); |
|
| 132 | + $enddate = date('Y-m-d H:i:s', $enddate); |
|
| 133 | + $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate, $enddate, $filter); |
|
| 134 | 134 | } elseif ($min) { |
| 135 | 135 | if ($tracker) { |
| 136 | 136 | $spotter_array = $TrackerLive->getMinLiveTrackerData($filter); |
@@ -142,17 +142,17 @@ discard block |
||
| 142 | 142 | # $min = true; |
| 143 | 143 | } else { |
| 144 | 144 | if ($tracker) { |
| 145 | - $spotter_array = $TrackerLive->getLiveTrackerData('','',$filter); |
|
| 145 | + $spotter_array = $TrackerLive->getLiveTrackerData('', '', $filter); |
|
| 146 | 146 | } elseif ($marine) { |
| 147 | - $spotter_array = $marineLive->getLiveMarineData('','',$filter); |
|
| 147 | + $spotter_array = $marineLive->getLiveMarineData('', '', $filter); |
|
| 148 | 148 | } else { |
| 149 | - $spotter_array = $SpotterLive->getLiveSpotterData('','',$filter); |
|
| 149 | + $spotter_array = $SpotterLive->getLiveSpotterData('', '', $filter); |
|
| 150 | 150 | } |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | if ($usecoord) { |
| 154 | 154 | if (isset($_GET['archive'])) { |
| 155 | - $flightcnt = $SpotterArchive->getLiveSpotterCount($begindate,$enddate,$filter); |
|
| 155 | + $flightcnt = $SpotterArchive->getLiveSpotterCount($begindate, $enddate, $filter); |
|
| 156 | 156 | } else { |
| 157 | 157 | if ($tracker) { |
| 158 | 158 | $flightcnt = $TrackerLive->getLiveTrackerCount($filter); |
@@ -165,9 +165,9 @@ discard block |
||
| 165 | 165 | if ($flightcnt == '') $flightcnt = 0; |
| 166 | 166 | } else $flightcnt = 0; |
| 167 | 167 | |
| 168 | -$sqltime = round(microtime(true)-$begintime,2); |
|
| 168 | +$sqltime = round(microtime(true) - $begintime, 2); |
|
| 169 | 169 | |
| 170 | -$currenttime = filter_input(INPUT_GET,'currenttime',FILTER_SANITIZE_NUMBER_INT); |
|
| 170 | +$currenttime = filter_input(INPUT_GET, 'currenttime', FILTER_SANITIZE_NUMBER_INT); |
|
| 171 | 171 | if ($currenttime != '') $currenttime = round($currenttime/1000); |
| 172 | 172 | |
| 173 | 173 | if ((!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation == FALSE) || (isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'false')) $usenextlatlon = false; |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | if (!empty($spotter_array) && is_array($spotter_array)) |
| 187 | 187 | { |
| 188 | 188 | $output .= '"features": ['; |
| 189 | - foreach($spotter_array as $spotter_item) |
|
| 189 | + foreach ($spotter_array as $spotter_item) |
|
| 190 | 190 | { |
| 191 | 191 | $j++; |
| 192 | 192 | date_default_timezone_set('UTC'); |
@@ -242,8 +242,8 @@ discard block |
||
| 242 | 242 | */ |
| 243 | 243 | //$output .= '"fc": "'.$spotter_item['nb'].'",'; |
| 244 | 244 | if (isset($spotter_item['ident']) && $spotter_item['ident'] != '') { |
| 245 | - if ($compress) $output .= '"c": "'.str_replace('\\','',$spotter_item['ident']).'",'; |
|
| 246 | - else $output .= '"callsign": "'.str_replace('\\','',$spotter_item['ident']).'",'; |
|
| 245 | + if ($compress) $output .= '"c": "'.str_replace('\\', '', $spotter_item['ident']).'",'; |
|
| 246 | + else $output .= '"callsign": "'.str_replace('\\', '', $spotter_item['ident']).'",'; |
|
| 247 | 247 | //" |
| 248 | 248 | } else { |
| 249 | 249 | if ($compress) $output .= '"c": "NA",'; |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | if (isset($spotter_item['registration'])) $output .= '"registration": "'.$spotter_item['registration'].'",'; |
| 253 | 253 | if (isset($spotter_item['aircraft_name']) && isset($spotter_item['aircraft_type'])) { |
| 254 | 254 | $output .= '"aircraft_name": "'.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')",'; |
| 255 | - $output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ','_',$spotter_item['aircraft_name'])).'",'; |
|
| 255 | + $output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ', '_', $spotter_item['aircraft_name'])).'",'; |
|
| 256 | 256 | } elseif (isset($spotter_item['aircraft_type'])) { |
| 257 | 257 | $output .= '"aircraft_name": "NA ('.$spotter_item['aircraft_type'].')",'; |
| 258 | 258 | } elseif (!$min) { |
@@ -395,26 +395,26 @@ discard block |
||
| 395 | 395 | if ($currenttime != '') { |
| 396 | 396 | if (strtotime($spotter_item['date']) < $currenttime) { |
| 397 | 397 | if (isset($archivespeed)) { |
| 398 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading'],$archivespeed,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh)); |
|
| 398 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $spotter_item['heading'], $archivespeed, ($currenttime - strtotime($spotter_item['date']) + $globalMapRefresh)); |
|
| 399 | 399 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
| 400 | 400 | } elseif ($usenextlatlon) { |
| 401 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading'],1,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh)); |
|
| 401 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $spotter_item['heading'], 1, ($currenttime - strtotime($spotter_item['date']) + $globalMapRefresh)); |
|
| 402 | 402 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
| 403 | 403 | } |
| 404 | 404 | } |
| 405 | 405 | } else { |
| 406 | 406 | if (isset($archivespeed)) { |
| 407 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading'],$archivespeed); |
|
| 407 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $spotter_item['heading'], $archivespeed); |
|
| 408 | 408 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
| 409 | 409 | } elseif ($usenextlatlon) { |
| 410 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading']); |
|
| 410 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $spotter_item['heading']); |
|
| 411 | 411 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
| 412 | 412 | } |
| 413 | 413 | } |
| 414 | 414 | |
| 415 | 415 | if (!$min) $output .= '"image": "'.$image.'",'; |
| 416 | 416 | if (isset($spotter_item['image_copyright']) && $spotter_item['image_copyright'] != '') { |
| 417 | - $output .= '"image_copyright": "'.str_replace('"',"'",trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'',$spotter_item['image_copyright']))).'",'; |
|
| 417 | + $output .= '"image_copyright": "'.str_replace('"', "'", trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '', $spotter_item['image_copyright']))).'",'; |
|
| 418 | 418 | } |
| 419 | 419 | if (isset($spotter_item['image_source_website'])) { |
| 420 | 420 | $output .= '"image_source_website": "'.urlencode($spotter_item['image_source_website']).'",'; |
@@ -436,7 +436,7 @@ discard block |
||
| 436 | 436 | $output .= '"waypoints": "'.$spotter_item['waypoints'].'",'; |
| 437 | 437 | } |
| 438 | 438 | if (isset($spotter_item['acars'])) { |
| 439 | - $output .= '"acars": "'.trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"), '<br />',$spotter_item['acars']['message'])).'",'; |
|
| 439 | + $output .= '"acars": "'.trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '<br />', $spotter_item['acars']['message'])).'",'; |
|
| 440 | 440 | } |
| 441 | 441 | // type when not aircraft ? |
| 442 | 442 | if (isset($spotter_item['type'])) { |
@@ -456,7 +456,7 @@ discard block |
||
| 456 | 456 | if ($currenttime != '') { |
| 457 | 457 | if (strtotime($spotter_item['date']) < $currenttime) { |
| 458 | 458 | if (!isset($archivespeed)) $archivespeed = 1; |
| 459 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading'],$archivespeed,$currenttime-strtotime($spotter_item['date'])); |
|
| 459 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $spotter_item['heading'], $archivespeed, $currenttime - strtotime($spotter_item['date'])); |
|
| 460 | 460 | $output .= $nextcoord['longitude'].','.$nextcoord['latitude']; |
| 461 | 461 | } else { |
| 462 | 462 | $output .= $spotter_item['longitude'].', '; |
@@ -525,7 +525,7 @@ discard block |
||
| 525 | 525 | |
| 526 | 526 | } |
| 527 | 527 | */ |
| 528 | - $history = filter_input(INPUT_GET,'history',FILTER_SANITIZE_STRING); |
|
| 528 | + $history = filter_input(INPUT_GET, 'history', FILTER_SANITIZE_STRING); |
|
| 529 | 529 | if ($history == '' && isset($_COOKIE['history'])) $history = $_COOKIE['history']; |
| 530 | 530 | |
| 531 | 531 | if ( |
@@ -533,11 +533,11 @@ discard block |
||
| 533 | 533 | || ((isset($globalMapHistory) && $globalMapHistory) || $allhistory) |
| 534 | 534 | // || (isset($history) && $history != '' && $history != 'NA' && ($history == $spotter_item['ident'] || $history == $spotter_item['flightaware_id'])) |
| 535 | 535 | // || (isset($history) && $history != '' && $history != 'NA' && $history == $spotter_item['ident']) |
| 536 | - || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
|
| 536 | + || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id'])) |
|
| 537 | 537 | || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']) |
| 538 | - || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['fammarine_id'])) |
|
| 538 | + || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['fammarine_id'])) |
|
| 539 | 539 | || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['fammarine_id']) && $_GET['fammarine_id'] == $spotter_item['fammarine_id']) |
| 540 | - || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['famtrackid'])) |
|
| 540 | + || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['famtrackid'])) |
|
| 541 | 541 | || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['famtrackid']) && $_GET['famtrackid'] == $spotter_item['famtrackid']) |
| 542 | 542 | ) { |
| 543 | 543 | if ($tracker) { |
@@ -574,9 +574,9 @@ discard block |
||
| 574 | 574 | else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
| 575 | 575 | } |
| 576 | 576 | $output_history .= '['; |
| 577 | - $output_history .= $spotter_history['longitude'].', '; |
|
| 578 | - $output_history .= $spotter_history['latitude'].', '; |
|
| 579 | - $output_history .= $spotter_history['altitude']*30.48; |
|
| 577 | + $output_history .= $spotter_history['longitude'].', '; |
|
| 578 | + $output_history .= $spotter_history['latitude'].', '; |
|
| 579 | + $output_history .= $spotter_history['altitude']*30.48; |
|
| 580 | 580 | $output_history .= '],'; |
| 581 | 581 | /* |
| 582 | 582 | if ($from_archive === false) { |
@@ -594,8 +594,8 @@ discard block |
||
| 594 | 594 | else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history"},"geometry": {"type": "LineString","coordinates": ['; |
| 595 | 595 | } else $d = true; |
| 596 | 596 | $output_history .= '['; |
| 597 | - $output_history .= $spotter_history['longitude'].', '; |
|
| 598 | - $output_history .= $spotter_history['latitude']; |
|
| 597 | + $output_history .= $spotter_history['longitude'].', '; |
|
| 598 | + $output_history .= $spotter_history['latitude']; |
|
| 599 | 599 | $output_history .= '],'; |
| 600 | 600 | /* |
| 601 | 601 | if ($from_archive === false) { |
@@ -611,9 +611,9 @@ discard block |
||
| 611 | 611 | |
| 612 | 612 | if ($from_archive === false) { |
| 613 | 613 | $output_historyd = '['; |
| 614 | - $output_historyd .= $spotter_item['longitude'].', '; |
|
| 615 | - $output_historyd .= $spotter_item['latitude']; |
|
| 616 | - if (isset($spotter_history['altitude'])) $output_historyd .= ','.$spotter_item['altitude']*30.48; |
|
| 614 | + $output_historyd .= $spotter_item['longitude'].', '; |
|
| 615 | + $output_historyd .= $spotter_item['latitude']; |
|
| 616 | + if (isset($spotter_history['altitude'])) $output_historyd .= ','.$spotter_item['altitude']*30.48; |
|
| 617 | 617 | $output_historyd .= '],'; |
| 618 | 618 | //$output_history = $output_historyd.$output_history; |
| 619 | 619 | $output_history = $output_history.$output_historyd; |
@@ -627,7 +627,7 @@ discard block |
||
| 627 | 627 | } |
| 628 | 628 | } |
| 629 | 629 | |
| 630 | - if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
|
| 630 | + if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id'])) |
|
| 631 | 631 | || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
| 632 | 632 | && (isset($spotter_item['departure_airport']) |
| 633 | 633 | && $spotter_item['departure_airport'] != 'NA' |
@@ -661,7 +661,7 @@ discard block |
||
| 661 | 661 | |
| 662 | 662 | //if (isset($history) && $history != '' && $history == $spotter_item['ident'] && isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA' && isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA' && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") || (!isset($_COOKIE['MapRoute']) && (!isset($globalMapRoute) || (isset($globalMapRoute) && $globalMapRoute))))) { |
| 663 | 663 | //if (isset($history) && $history != '' && $history == $spotter_item['ident'] && isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA' && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") || (!isset($_COOKIE['MapRoute']) && (!isset($globalMapRoute) || (isset($globalMapRoute) && $globalMapRoute))))) { |
| 664 | - if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
|
| 664 | + if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id'])) |
|
| 665 | 665 | || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
| 666 | 666 | && (isset($spotter_item['arrival_airport']) |
| 667 | 667 | && $spotter_item['arrival_airport'] != 'NA' |
@@ -692,7 +692,7 @@ discard block |
||
| 692 | 692 | $output = substr($output, 0, -1); |
| 693 | 693 | $output .= ']'; |
| 694 | 694 | $output .= ',"initial_sqltime": "'.$sqltime.'",'; |
| 695 | - $output .= '"totaltime": "'.round(microtime(true)-$begintime,2).'",'; |
|
| 695 | + $output .= '"totaltime": "'.round(microtime(true) - $begintime, 2).'",'; |
|
| 696 | 696 | if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",'; |
| 697 | 697 | $output .= '"fc": "'.$j.'"'; |
| 698 | 698 | } else { |
@@ -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 | |
@@ -252,10 +252,10 @@ discard block |
||
| 252 | 252 | $image = "images/placeholder_thumb.png"; |
| 253 | 253 | } |
| 254 | 254 | |
| 255 | - if (isset($spotter_item['flightaware_id'])) $id = $spotter_item['flightaware_id']; |
|
| 256 | - elseif (isset($spotter_item['famtrackid'])) $id = $spotter_item['famtrackid']; |
|
| 257 | - elseif (isset($spotter_item['fammarine_id'])) $id = $spotter_item['fammarine_id']; |
|
| 258 | - if ($prev_flightaware_id != $id) { |
|
| 255 | + if (isset($spotter_item['flightaware_id'])) $id = $spotter_item['flightaware_id']; |
|
| 256 | + elseif (isset($spotter_item['famtrackid'])) $id = $spotter_item['famtrackid']; |
|
| 257 | + elseif (isset($spotter_item['fammarine_id'])) $id = $spotter_item['fammarine_id']; |
|
| 258 | + if ($prev_flightaware_id != $id) { |
|
| 259 | 259 | if ($prev_flightaware_id != '') { |
| 260 | 260 | /* |
| 261 | 261 | if ($nblatlong == 1) { |
@@ -335,7 +335,7 @@ discard block |
||
| 335 | 335 | $spotter_item['wake_category'] = $aircraft_info[0]['wake_category']; |
| 336 | 336 | $spotter_item['engine_count'] = $aircraft_info[0]['engine_count']; |
| 337 | 337 | } else $aircraft_shadow = ''; |
| 338 | - $output .= ' "billboard" : {"image" : "'.$globalURL.'/images/aircrafts/new/'.$aircraft_shadow.'","scale" : 0.5'; |
|
| 338 | + $output .= ' "billboard" : {"image" : "'.$globalURL.'/images/aircrafts/new/'.$aircraft_shadow.'","scale" : 0.5'; |
|
| 339 | 339 | if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true' && isset($_COOKIE['IconColor'])) { |
| 340 | 340 | $rgb = $Common->hex2rgb($_COOKIE['IconColor']); |
| 341 | 341 | $output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}'; |
@@ -366,7 +366,7 @@ discard block |
||
| 366 | 366 | $rgb = $Common->hex2rgb($_COOKIE['IconColor']); |
| 367 | 367 | $output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}'; |
| 368 | 368 | } |
| 369 | - $output .= '},'; |
|
| 369 | + $output .= '},'; |
|
| 370 | 370 | } elseif (isset($modelsdb[$aircraft_icao]) && $aircraft_icao != '') { |
| 371 | 371 | $output .= '"model": {"gltf" : "'.$globalURL.'/models/'.$modelsdb[$aircraft_icao].'","scale" : 1.0,"minimumPixelSize": 20'; |
| 372 | 372 | $output .= ',"heightReference": "'.$heightrelative.'"'; |
@@ -374,7 +374,7 @@ discard block |
||
| 374 | 374 | $rgb = $Common->hex2rgb($_COOKIE['IconColor']); |
| 375 | 375 | $output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}'; |
| 376 | 376 | } |
| 377 | - $output .= '},'; |
|
| 377 | + $output .= '},'; |
|
| 378 | 378 | } elseif ($aircraft_icao != '') { |
| 379 | 379 | $aircraft_info = $Spotter->getAllAircraftInfo($aircraft_icao); |
| 380 | 380 | 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 | } |
@@ -200,9 +200,9 @@ discard block |
||
| 200 | 200 | } |
| 201 | 201 | $modelsdb2 = array(); |
| 202 | 202 | if (file_exists(dirname(__FILE__).'/models/gltf2/modelsdb')) { |
| 203 | - if (($handle = fopen(dirname(__FILE__).'/models/gltf2/modelsdb','r')) !== FALSE) { |
|
| 204 | - while (($row = fgetcsv($handle,1000)) !== FALSE) { |
|
| 205 | - if (isset($row[1]) ){ |
|
| 203 | + if (($handle = fopen(dirname(__FILE__).'/models/gltf2/modelsdb', 'r')) !== FALSE) { |
|
| 204 | + while (($row = fgetcsv($handle, 1000)) !== FALSE) { |
|
| 205 | + if (isset($row[1])) { |
|
| 206 | 206 | $model = $row[0]; |
| 207 | 207 | $modelsdb2[$model] = $row[1]; |
| 208 | 208 | } |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | if (!empty($spotter_array) && is_array($spotter_array)) |
| 241 | 241 | { |
| 242 | 242 | $nblatlong = 0; |
| 243 | - foreach($spotter_array as $spotter_item) |
|
| 243 | + foreach ($spotter_array as $spotter_item) |
|
| 244 | 244 | { |
| 245 | 245 | $j++; |
| 246 | 246 | //if (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'airwhere') $heightrelative = 'RELATIVE_TO_GROUND'; |
@@ -282,9 +282,9 @@ discard block |
||
| 282 | 282 | $output .= '"lastupdate": "'.$lastupdate.'",'; |
| 283 | 283 | $output .= '"format": "'.$spotter_item['format_source'].'",'; |
| 284 | 284 | if ($tracker) { |
| 285 | - $output.= '"type": "tracker"'; |
|
| 285 | + $output .= '"type": "tracker"'; |
|
| 286 | 286 | } elseif ($marine) { |
| 287 | - $output.= '"type": "marine"'; |
|
| 287 | + $output .= '"type": "marine"'; |
|
| 288 | 288 | } else { |
| 289 | 289 | if (isset($globalMap3DLiveries) && $globalMap3DLiveries) { |
| 290 | 290 | $aircraft_icao = $spotter_item['aircraft_icao']; |
@@ -298,14 +298,14 @@ discard block |
||
| 298 | 298 | if (isset($airline_icao)) { |
| 299 | 299 | $imagefile = $aircraft_icao.'-'.$airline_icao.'.png'; |
| 300 | 300 | if (file_exists(dirname(__FILE__).'/models/gltf2/liveries/'.$imagefile)) { |
| 301 | - $output.= '"liveries": "'.$globalURL.'/models/gltf2/liveries/'.$imagefile.'",'; |
|
| 301 | + $output .= '"liveries": "'.$globalURL.'/models/gltf2/liveries/'.$imagefile.'",'; |
|
| 302 | 302 | } |
| 303 | 303 | } |
| 304 | 304 | } |
| 305 | - if ($ident != '') $output.= '"ident": "'.$ident.'",'; |
|
| 305 | + if ($ident != '') $output .= '"ident": "'.$ident.'",'; |
|
| 306 | 306 | } |
| 307 | - $output.= '"gltf2": %gltf2%,'; |
|
| 308 | - $output.= '"type": "flight"'; |
|
| 307 | + $output .= '"gltf2": %gltf2%,'; |
|
| 308 | + $output .= '"type": "flight"'; |
|
| 309 | 309 | } |
| 310 | 310 | $output .= '},'; |
| 311 | 311 | |
@@ -658,8 +658,8 @@ discard block |
||
| 658 | 658 | $output .= '},'; |
| 659 | 659 | } |
| 660 | 660 | } |
| 661 | - if (isset($onground) && $onground) $output = str_replace('%onground%','true',$output); |
|
| 662 | - else $output = str_replace('%onground%','false',$output); |
|
| 661 | + if (isset($onground) && $onground) $output = str_replace('%onground%', 'true', $output); |
|
| 662 | + else $output = str_replace('%onground%', 'false', $output); |
|
| 663 | 663 | |
| 664 | 664 | // $output .= '"heightReference": "CLAMP_TO_GROUND",'; |
| 665 | 665 | //$output .= '"heightReference": "'.$heightrelative.'",'; |
@@ -674,7 +674,7 @@ discard block |
||
| 674 | 674 | $output .= '"cartographicDegrees": ['; |
| 675 | 675 | if ($minitime > strtotime($spotter_item['date'])) $minitime = strtotime($spotter_item['date']); |
| 676 | 676 | if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']); |
| 677 | - $output .= '"'.date("c",strtotime($spotter_item['date'])).'", '; |
|
| 677 | + $output .= '"'.date("c", strtotime($spotter_item['date'])).'", '; |
|
| 678 | 678 | $output .= $spotter_item['longitude'].', '; |
| 679 | 679 | $output .= $spotter_item['latitude']; |
| 680 | 680 | $prevlong = $spotter_item['longitude']; |
@@ -702,8 +702,8 @@ discard block |
||
| 702 | 702 | //$quat = quaternionrotate(deg2rad($spotter_item['heading']),deg2rad(0),deg2rad(0)); |
| 703 | 703 | //$orientation .= '"'.date("c",strtotime($spotter_item['date'])).'",'.$quat['x'].','.$quat['y'].','.$quat['z'].','.$quat['w']; |
| 704 | 704 | } else { |
| 705 | - $nblatlong = $nblatlong+1; |
|
| 706 | - $output .= ',"'.date("c",strtotime($spotter_item['date'])).'", '; |
|
| 705 | + $nblatlong = $nblatlong + 1; |
|
| 706 | + $output .= ',"'.date("c", strtotime($spotter_item['date'])).'", '; |
|
| 707 | 707 | if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']); |
| 708 | 708 | if ($spotter_item['ground_speed'] == 0) { |
| 709 | 709 | $output .= $prevlong.', '; |
@@ -743,17 +743,17 @@ discard block |
||
| 743 | 743 | } |
| 744 | 744 | $output .= ']'; |
| 745 | 745 | if (isset($globalArchive) && $globalArchive === TRUE) { |
| 746 | - if ((time()-$globalLiveInterval) > $minitime) { |
|
| 747 | - if (time()-$globalLiveInterval > $maxitime) { |
|
| 748 | - $output = str_replace('%minitime%',date("c",$maxitime),$output); |
|
| 746 | + if ((time() - $globalLiveInterval) > $minitime) { |
|
| 747 | + if (time() - $globalLiveInterval > $maxitime) { |
|
| 748 | + $output = str_replace('%minitime%', date("c", $maxitime), $output); |
|
| 749 | 749 | } else { |
| 750 | - $output = str_replace('%minitime%',date("c",time()-$globalLiveInterval),$output); |
|
| 750 | + $output = str_replace('%minitime%', date("c", time() - $globalLiveInterval), $output); |
|
| 751 | 751 | } |
| 752 | 752 | } |
| 753 | - else $output = str_replace('%minitime%',date("c",$minitime),$output); |
|
| 754 | -} else $output = str_replace('%minitime%',date("c",$minitime),$output); |
|
| 755 | -$output = str_replace('%maxitime%',date("c",$maxitime),$output); |
|
| 756 | -if ($gltf2) $output = str_replace('%gltf2%','true',$output); |
|
| 757 | -else $output = str_replace('%gltf2%','false',$output); |
|
| 753 | + else $output = str_replace('%minitime%', date("c", $minitime), $output); |
|
| 754 | +} else $output = str_replace('%minitime%', date("c", $minitime), $output); |
|
| 755 | +$output = str_replace('%maxitime%', date("c", $maxitime), $output); |
|
| 756 | +if ($gltf2) $output = str_replace('%gltf2%', 'true', $output); |
|
| 757 | +else $output = str_replace('%gltf2%', 'false', $output); |
|
| 758 | 758 | print $output; |
| 759 | 759 | ?> |
@@ -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(); |
@@ -216,7 +247,9 @@ discard block |
||
| 216 | 247 | $prev_flightaware_id = ''; |
| 217 | 248 | $speed = 1; |
| 218 | 249 | $gltf2 = false; |
| 219 | -if (isset($archivespeed)) $speed = $archivespeed; |
|
| 250 | +if (isset($archivespeed)) { |
|
| 251 | + $speed = $archivespeed; |
|
| 252 | +} |
|
| 220 | 253 | $output = '['; |
| 221 | 254 | if ($tracker) { |
| 222 | 255 | $output .= '{"id" : "document", "name" : "tracker","version" : "1.0"'; |
@@ -252,9 +285,13 @@ discard block |
||
| 252 | 285 | $image = "images/placeholder_thumb.png"; |
| 253 | 286 | } |
| 254 | 287 | |
| 255 | - if (isset($spotter_item['flightaware_id'])) $id = $spotter_item['flightaware_id']; |
|
| 256 | - elseif (isset($spotter_item['famtrackid'])) $id = $spotter_item['famtrackid']; |
|
| 257 | - elseif (isset($spotter_item['fammarine_id'])) $id = $spotter_item['fammarine_id']; |
|
| 288 | + if (isset($spotter_item['flightaware_id'])) { |
|
| 289 | + $id = $spotter_item['flightaware_id']; |
|
| 290 | + } elseif (isset($spotter_item['famtrackid'])) { |
|
| 291 | + $id = $spotter_item['famtrackid']; |
|
| 292 | + } elseif (isset($spotter_item['fammarine_id'])) { |
|
| 293 | + $id = $spotter_item['fammarine_id']; |
|
| 294 | + } |
|
| 258 | 295 | if ($prev_flightaware_id != $id) { |
| 259 | 296 | if ($prev_flightaware_id != '') { |
| 260 | 297 | /* |
@@ -302,7 +339,9 @@ discard block |
||
| 302 | 339 | } |
| 303 | 340 | } |
| 304 | 341 | } |
| 305 | - if ($ident != '') $output.= '"ident": "'.$ident.'",'; |
|
| 342 | + if ($ident != '') { |
|
| 343 | + $output.= '"ident": "'.$ident.'",'; |
|
| 344 | + } |
|
| 306 | 345 | } |
| 307 | 346 | $output.= '"gltf2": %gltf2%,'; |
| 308 | 347 | $output.= '"type": "flight"'; |
@@ -334,7 +373,9 @@ discard block |
||
| 334 | 373 | $spotter_item['engine_type'] = $aircraft_info[0]['engine_type']; |
| 335 | 374 | $spotter_item['wake_category'] = $aircraft_info[0]['wake_category']; |
| 336 | 375 | $spotter_item['engine_count'] = $aircraft_info[0]['engine_count']; |
| 337 | - } else $aircraft_shadow = ''; |
|
| 376 | + } else { |
|
| 377 | + $aircraft_shadow = ''; |
|
| 378 | + } |
|
| 338 | 379 | $output .= ' "billboard" : {"image" : "'.$globalURL.'/images/aircrafts/new/'.$aircraft_shadow.'","scale" : 0.5'; |
| 339 | 380 | if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true' && isset($_COOKIE['IconColor'])) { |
| 340 | 381 | $rgb = $Common->hex2rgb($_COOKIE['IconColor']); |
@@ -342,7 +383,9 @@ discard block |
||
| 342 | 383 | } |
| 343 | 384 | $output .= '},'; |
| 344 | 385 | } |
| 345 | - } else $output .= ' "billboard" : {"image" : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAfCAYAAACVgY94AAAACXBIWXMAAC4jAAAuIwF4pT92AAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8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F9TUCWM64tiQhbq/oMv+7BwFWpQzNT8vbVQul/wwAGzzdmXU1xuUAAAAASUVORK5CYII=","scale" : 0.5},'; |
|
| 386 | + } else { |
|
| 387 | + $output .= ' "billboard" : {"image" : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAfCAYAAACVgY94AAAACXBIWXMAAC4jAAAuIwF4pT92AAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQii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WccP9AAd6dAx+ox/WTArNzY1t64B0f8K0DyLXuUvRGZfcpCo1VX4tg6wB76WMB0dALf526foAX8cqUot2pGP8B2Kz+krBeNYjS8636dh/8Beo2deoA9TWp76pd6g0q9cDNwKvAD8A84EfglLRBe2g+JWAfcEF68bPABOCoAl/gIPA5MA64FVgGnNhP292W3r0SeB1YVlJXAjcBP8XwyQUj9AKwAzg2+/fQSsBhoJxBAaALaIzenZGnD911wA7gEDAD2FFSpwOzgDHZ5T7+ZSlGd2d6AXgi5+qAn+O5U0PbBVwKtAD3AHuB8f3YGBUdncCGoQ4LE9XtGRqK9LnduVPRIu2BPqwD65IYbS7Qpql7Ql9YoJcy9bwzkgPrfOCj5G33+h54E/g0PAr5thq4ApgyEgNrc27aWwVaPTA1QJ4BjgTGFvhteV40EgPrgvTP7qlmZqFnl9WD+b2posN83E/NrEkOjlI/U1fkfUYa/pe5IE3qZPW8jFOqiyN7p3pAPX04c7AxYSoDDcAjKT2LgLXA6IR2M3Bviv59wDTgQGTPH84Qd8+HXfHcoUws2zM0HMjuUPep+xP2PWpnwtw0GJsldbBpewQwE/gbeDyt7H1gcW53O7AC+A3Yn6+/W+Ld9SnWA15DAVhc8xK2TuA9YHrCuhV4EngFuBx4YagG6qv8cF+T52kB2Zy+e1I8taUacNV+uBdXO7ABmJwJpwx8XQvF9TUCWM64tiQhbq/oMv+7BwFWpQzNT8vbVQul/wwAGzzdmXU1xuUAAAAASUVORK5CYII=","scale" : 0.5},'; |
|
| 388 | + } |
|
| 346 | 389 | } elseif ($one3dmodel) { |
| 347 | 390 | if (isset($globalMap3DForceModel) && $globalMap3DForceModel != '') { |
| 348 | 391 | $output .= '"model": {"gltf" : "'.$globalURL.'/models/'.$globalMap3DForceModel.'","scale" : 1.0,"minimumPixelSize": 20'; |
@@ -382,7 +425,9 @@ discard block |
||
| 382 | 425 | $spotter_item['engine_type'] = $aircraft_info[0]['engine_type']; |
| 383 | 426 | $spotter_item['wake_category'] = $aircraft_info[0]['wake_category']; |
| 384 | 427 | $spotter_item['engine_count'] = $aircraft_info[0]['engine_count']; |
| 385 | - } else $aircraft_shadow = ''; |
|
| 428 | + } else { |
|
| 429 | + $aircraft_shadow = ''; |
|
| 430 | + } |
|
| 386 | 431 | if ($aircraft_shadow != '') { |
| 387 | 432 | if (isset($modelsdb[$aircraft_shadow])) { |
| 388 | 433 | $output .= '"model": {"gltf" : "'.$globalURL.'/models/'.$modelsdb[$aircraft_shadow].'","scale" : 1.0,"minimumPixelSize": 20'; |
@@ -519,7 +564,9 @@ discard block |
||
| 519 | 564 | } |
| 520 | 565 | $output .= '},'; |
| 521 | 566 | //if ($spotter_item['aircraft_shadow'] != '') $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",'; |
| 522 | - if ($spotter_item['aircraft_icao'] != '') $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
| 567 | + if ($spotter_item['aircraft_icao'] != '') { |
|
| 568 | + $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
| 569 | + } |
|
| 523 | 570 | $modelsdb[$aircraft_icao] = 'Cesium_Air.glb'; |
| 524 | 571 | } |
| 525 | 572 | } elseif (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'aprs') { |
@@ -541,7 +588,9 @@ discard block |
||
| 541 | 588 | } |
| 542 | 589 | $output .= '},'; |
| 543 | 590 | //if ($spotter_item['aircraft_shadow'] != '') $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",'; |
| 544 | - if ($spotter_item['aircraft_icao'] != '') $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
| 591 | + if ($spotter_item['aircraft_icao'] != '') { |
|
| 592 | + $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
| 593 | + } |
|
| 545 | 594 | $modelsdb[$aircraft_icao] = 'Cesium_Air.glb'; |
| 546 | 595 | } |
| 547 | 596 | } else { |
@@ -554,7 +603,9 @@ discard block |
||
| 554 | 603 | } |
| 555 | 604 | $output .= '},'; |
| 556 | 605 | //if ($spotter_item['aircraft_shadow'] != '') $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",'; |
| 557 | - if ($spotter_item['aircraft_icao'] != '') $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
| 606 | + if ($spotter_item['aircraft_icao'] != '') { |
|
| 607 | + $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
| 608 | + } |
|
| 558 | 609 | $modelsdb[$aircraft_icao] = 'Cesium_Air.glb'; |
| 559 | 610 | } |
| 560 | 611 | } elseif ($tracker && isset($spotter_item['type'])) { |
@@ -658,8 +709,11 @@ discard block |
||
| 658 | 709 | $output .= '},'; |
| 659 | 710 | } |
| 660 | 711 | } |
| 661 | - if (isset($onground) && $onground) $output = str_replace('%onground%','true',$output); |
|
| 662 | - else $output = str_replace('%onground%','false',$output); |
|
| 712 | + if (isset($onground) && $onground) { |
|
| 713 | + $output = str_replace('%onground%','true',$output); |
|
| 714 | + } else { |
|
| 715 | + $output = str_replace('%onground%','false',$output); |
|
| 716 | + } |
|
| 663 | 717 | |
| 664 | 718 | // $output .= '"heightReference": "CLAMP_TO_GROUND",'; |
| 665 | 719 | //$output .= '"heightReference": "'.$heightrelative.'",'; |
@@ -672,8 +726,12 @@ discard block |
||
| 672 | 726 | // $output .= '"interpolationDegree" : 5,'; |
| 673 | 727 | // $output .= '"epoch" : "'.date("c",strtotime($spotter_item['date'])).'", '; |
| 674 | 728 | $output .= '"cartographicDegrees": ['; |
| 675 | - if ($minitime > strtotime($spotter_item['date'])) $minitime = strtotime($spotter_item['date']); |
|
| 676 | - if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']); |
|
| 729 | + if ($minitime > strtotime($spotter_item['date'])) { |
|
| 730 | + $minitime = strtotime($spotter_item['date']); |
|
| 731 | + } |
|
| 732 | + if ($maxitime < strtotime($spotter_item['date'])) { |
|
| 733 | + $maxitime = strtotime($spotter_item['date']); |
|
| 734 | + } |
|
| 677 | 735 | $output .= '"'.date("c",strtotime($spotter_item['date'])).'", '; |
| 678 | 736 | $output .= $spotter_item['longitude'].', '; |
| 679 | 737 | $output .= $spotter_item['latitude']; |
@@ -696,7 +754,9 @@ discard block |
||
| 696 | 754 | $output .= ', '.round($spotter_item['altitude']*30.48); |
| 697 | 755 | $prevalt = round($spotter_item['altitude']*30.48); |
| 698 | 756 | } |
| 699 | - } else $output .= ', 0'; |
|
| 757 | + } else { |
|
| 758 | + $output .= ', 0'; |
|
| 759 | + } |
|
| 700 | 760 | //$orientation = '"orientation" : { '; |
| 701 | 761 | //$orientation .= '"unitQuaternion": ['; |
| 702 | 762 | //$quat = quaternionrotate(deg2rad($spotter_item['heading']),deg2rad(0),deg2rad(0)); |
@@ -704,13 +764,18 @@ discard block |
||
| 704 | 764 | } else { |
| 705 | 765 | $nblatlong = $nblatlong+1; |
| 706 | 766 | $output .= ',"'.date("c",strtotime($spotter_item['date'])).'", '; |
| 707 | - if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']); |
|
| 767 | + if ($maxitime < strtotime($spotter_item['date'])) { |
|
| 768 | + $maxitime = strtotime($spotter_item['date']); |
|
| 769 | + } |
|
| 708 | 770 | if ($spotter_item['ground_speed'] == 0) { |
| 709 | 771 | $output .= $prevlong.', '; |
| 710 | 772 | $output .= $prevlat; |
| 711 | 773 | //if (!$marine && (!isset($onground) || !$onground)) $output .= ', '.$prevalt; |
| 712 | - if (!$marine) $output .= ', '.$prevalt; |
|
| 713 | - else $output .= ', 0'; |
|
| 774 | + if (!$marine) { |
|
| 775 | + $output .= ', '.$prevalt; |
|
| 776 | + } else { |
|
| 777 | + $output .= ', 0'; |
|
| 778 | + } |
|
| 714 | 779 | } else { |
| 715 | 780 | $output .= $spotter_item['longitude'].', '; |
| 716 | 781 | $output .= $spotter_item['latitude']; |
@@ -723,14 +788,17 @@ discard block |
||
| 723 | 788 | $output .= ', 0'; |
| 724 | 789 | } |
| 725 | 790 | } else { |
| 726 | - if (isset($spotter_item['real_altitude']) && $spotter_item['real_altitude'] != '') $output .= ', '.round($spotter_item['real_altitude']*0.3048); |
|
| 727 | - elseif ($tracker) { |
|
| 791 | + if (isset($spotter_item['real_altitude']) && $spotter_item['real_altitude'] != '') { |
|
| 792 | + $output .= ', '.round($spotter_item['real_altitude']*0.3048); |
|
| 793 | + } elseif ($tracker) { |
|
| 728 | 794 | $output .= ', '.round($spotter_item['altitude']*0.3048); |
| 729 | 795 | } else { |
| 730 | 796 | $output .= ', '.round($spotter_item['altitude']*30.48); |
| 731 | 797 | } |
| 732 | 798 | } |
| 733 | - } else $output .= ', 0'; |
|
| 799 | + } else { |
|
| 800 | + $output .= ', 0'; |
|
| 801 | + } |
|
| 734 | 802 | } |
| 735 | 803 | //$quat = quaternionrotate(deg2rad($spotter_item['heading']),deg2rad(0),deg2rad(0)); |
| 736 | 804 | //$orientation .= ',"'.date("c",strtotime($spotter_item['date'])).'",'.$quat['x'].','.$quat['y'].','.$quat['z'].','.$quat['w']; |
@@ -749,11 +817,17 @@ discard block |
||
| 749 | 817 | } else { |
| 750 | 818 | $output = str_replace('%minitime%',date("c",time()-$globalLiveInterval),$output); |
| 751 | 819 | } |
| 820 | + } else { |
|
| 821 | + $output = str_replace('%minitime%',date("c",$minitime),$output); |
|
| 752 | 822 | } |
| 753 | - else $output = str_replace('%minitime%',date("c",$minitime),$output); |
|
| 754 | -} else $output = str_replace('%minitime%',date("c",$minitime),$output); |
|
| 823 | + } else { |
|
| 824 | + $output = str_replace('%minitime%',date("c",$minitime),$output); |
|
| 825 | +} |
|
| 755 | 826 | $output = str_replace('%maxitime%',date("c",$maxitime),$output); |
| 756 | -if ($gltf2) $output = str_replace('%gltf2%','true',$output); |
|
| 757 | -else $output = str_replace('%gltf2%','false',$output); |
|
| 827 | +if ($gltf2) { |
|
| 828 | + $output = str_replace('%gltf2%','true',$output); |
|
| 829 | +} else { |
|
| 830 | + $output = str_replace('%gltf2%','false',$output); |
|
| 831 | +} |
|
| 758 | 832 | print $output; |
| 759 | 833 | ?> |