@@ -64,17 +64,17 @@ discard block |
||
| 64 | 64 | $min = true; |
| 65 | 65 | $allhistory = false; |
| 66 | 66 | $filter['source'] = array(); |
| 67 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
| 68 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
| 69 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
| 70 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs')); |
|
| 71 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
| 72 | -if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
| 73 | -if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING); |
|
| 74 | -if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
| 75 | -if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
| 76 | -if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
| 77 | -if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING); |
|
| 67 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'], array('vatsimtxt')); |
|
| 68 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'], array('whazzup')); |
|
| 69 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'], array('phpvmacars')); |
|
| 70 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'], array('sbs', 'famaprs')); |
|
| 71 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'], array('aprs')); |
|
| 72 | +if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'], FILTER_SANITIZE_STRING); |
|
| 73 | +if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'], FILTER_SANITIZE_STRING); |
|
| 74 | +if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',', $_COOKIE['filter_Airlines']), FILTER_SANITIZE_STRING); |
|
| 75 | +if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',', $_COOKIE['filter_Sources']), FILTER_SANITIZE_STRING); |
|
| 76 | +if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'], FILTER_SANITIZE_STRING); |
|
| 77 | +if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'], FILTER_SANITIZE_STRING); |
|
| 78 | 78 | |
| 79 | 79 | if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) { |
| 80 | 80 | $min = true; |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | $spotter_array = array(); |
| 84 | 84 | |
| 85 | 85 | if (isset($_GET['ident'])) { |
| 86 | - $ident = urldecode(filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING)); |
|
| 86 | + $ident = urldecode(filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING)); |
|
| 87 | 87 | if ($tracker) { |
| 88 | 88 | $spotter_array = $TrackerLive->getLastLiveTrackerDataByIdent($ident); |
| 89 | 89 | } elseif ($marine) { |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | } |
| 98 | 98 | $allhistory = true; |
| 99 | 99 | } elseif (isset($_GET['flightaware_id'])) { |
| 100 | - $flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING); |
|
| 100 | + $flightaware_id = filter_input(INPUT_GET, 'flightaware_id', FILTER_SANITIZE_STRING); |
|
| 101 | 101 | $spotter_array = $SpotterLive->getLastLiveSpotterDataById($flightaware_id); |
| 102 | 102 | if (empty($spotter_array)) { |
| 103 | 103 | $from_archive = true; |
@@ -105,11 +105,11 @@ discard block |
||
| 105 | 105 | } |
| 106 | 106 | $allhistory = true; |
| 107 | 107 | } elseif (isset($_GET['famtrack_id'])) { |
| 108 | - $famtrack_id = urldecode(filter_input(INPUT_GET,'famtrack_id',FILTER_SANITIZE_STRING)); |
|
| 108 | + $famtrack_id = urldecode(filter_input(INPUT_GET, 'famtrack_id', FILTER_SANITIZE_STRING)); |
|
| 109 | 109 | $spotter_array = $TrackerLive->getLastLiveTrackerDataById($famtrack_id); |
| 110 | 110 | $allhistory = true; |
| 111 | 111 | } elseif (isset($_GET['fammarine_id'])) { |
| 112 | - $fammarine_id = urldecode(filter_input(INPUT_GET,'fammarine_id',FILTER_SANITIZE_STRING)); |
|
| 112 | + $fammarine_id = urldecode(filter_input(INPUT_GET, 'fammarine_id', FILTER_SANITIZE_STRING)); |
|
| 113 | 113 | $spotter_array = $MarineLive->getLastLiveMarineDataById($fammarine_id); |
| 114 | 114 | $allhistory = true; |
| 115 | 115 | /* |
@@ -129,15 +129,15 @@ discard block |
||
| 129 | 129 | */ |
| 130 | 130 | } elseif (isset($globalMapUseBbox) && $globalMapUseBbox && isset($_GET['coord']) && $min && !isset($_GET['archive'])) { |
| 131 | 131 | $usecoord = true; |
| 132 | - $coord = explode(',',$_GET['coord']); |
|
| 133 | - if (filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT) |
|
| 132 | + $coord = explode(',', $_GET['coord']); |
|
| 133 | + if (filter_var($coord[0], FILTER_VALIDATE_FLOAT) && filter_var($coord[1], FILTER_VALIDATE_FLOAT) && filter_var($coord[2], FILTER_VALIDATE_FLOAT) && filter_var($coord[3], FILTER_VALIDATE_FLOAT) |
|
| 134 | 134 | && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0) { |
| 135 | 135 | if ($tracker) { |
| 136 | - $spotter_array = $TrackerLive->getMinLiveTrackerDatabyCoord($coord,$filter); |
|
| 136 | + $spotter_array = $TrackerLive->getMinLiveTrackerDatabyCoord($coord, $filter); |
|
| 137 | 137 | } elseif ($marine) { |
| 138 | - $spotter_array = $MarineLive->getMinLiveMarineDatabyCoord($coord,$filter); |
|
| 138 | + $spotter_array = $MarineLive->getMinLiveMarineDatabyCoord($coord, $filter); |
|
| 139 | 139 | } else { |
| 140 | - $spotter_array = $SpotterLive->getMinLiveSpotterDatabyCoord($coord,$filter); |
|
| 140 | + $spotter_array = $SpotterLive->getMinLiveSpotterDatabyCoord($coord, $filter); |
|
| 141 | 141 | } |
| 142 | 142 | } else { |
| 143 | 143 | if ($tracker) { |
@@ -152,12 +152,12 @@ discard block |
||
| 152 | 152 | $from_archive = true; |
| 153 | 153 | // $begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
| 154 | 154 | // $enddate = filter_input(INPUT_GET,'enddate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
| 155 | - $begindate = filter_input(INPUT_GET,'begindate',FILTER_SANITIZE_NUMBER_INT); |
|
| 156 | - $enddate = filter_input(INPUT_GET,'enddate',FILTER_SANITIZE_NUMBER_INT); |
|
| 157 | - $archivespeed = filter_input(INPUT_GET,'speed',FILTER_SANITIZE_NUMBER_INT); |
|
| 158 | - $begindate = date('Y-m-d H:i:s',$begindate); |
|
| 159 | - $enddate = date('Y-m-d H:i:s',$enddate); |
|
| 160 | - $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate,$enddate,$filter); |
|
| 155 | + $begindate = filter_input(INPUT_GET, 'begindate', FILTER_SANITIZE_NUMBER_INT); |
|
| 156 | + $enddate = filter_input(INPUT_GET, 'enddate', FILTER_SANITIZE_NUMBER_INT); |
|
| 157 | + $archivespeed = filter_input(INPUT_GET, 'speed', FILTER_SANITIZE_NUMBER_INT); |
|
| 158 | + $begindate = date('Y-m-d H:i:s', $begindate); |
|
| 159 | + $enddate = date('Y-m-d H:i:s', $enddate); |
|
| 160 | + $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate, $enddate, $filter); |
|
| 161 | 161 | } elseif ($min) { |
| 162 | 162 | if ($tracker) { |
| 163 | 163 | $spotter_array = $TrackerLive->getMinLiveTrackerData($filter); |
@@ -169,17 +169,17 @@ discard block |
||
| 169 | 169 | # $min = true; |
| 170 | 170 | } else { |
| 171 | 171 | if ($tracker) { |
| 172 | - $spotter_array = $TrackerLive->getLiveTrackerData('','',$filter); |
|
| 172 | + $spotter_array = $TrackerLive->getLiveTrackerData('', '', $filter); |
|
| 173 | 173 | } elseif ($marine) { |
| 174 | - $spotter_array = $marineLive->getLiveMarineData('','',$filter); |
|
| 174 | + $spotter_array = $marineLive->getLiveMarineData('', '', $filter); |
|
| 175 | 175 | } else { |
| 176 | - $spotter_array = $SpotterLive->getLiveSpotterData('','',$filter); |
|
| 176 | + $spotter_array = $SpotterLive->getLiveSpotterData('', '', $filter); |
|
| 177 | 177 | } |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | if ($usecoord) { |
| 181 | 181 | if (isset($_GET['archive'])) { |
| 182 | - $flightcnt = $SpotterArchive->getLiveSpotterCount($begindate,$enddate,$filter); |
|
| 182 | + $flightcnt = $SpotterArchive->getLiveSpotterCount($begindate, $enddate, $filter); |
|
| 183 | 183 | } else { |
| 184 | 184 | if ($tracker) { |
| 185 | 185 | $flightcnt = $TrackerLive->getLiveTrackerCount($filter); |
@@ -192,9 +192,9 @@ discard block |
||
| 192 | 192 | if ($flightcnt == '') $flightcnt = 0; |
| 193 | 193 | } else $flightcnt = 0; |
| 194 | 194 | |
| 195 | -$sqltime = round(microtime(true)-$begintime,2); |
|
| 195 | +$sqltime = round(microtime(true) - $begintime, 2); |
|
| 196 | 196 | |
| 197 | -$currenttime = filter_input(INPUT_GET,'currenttime',FILTER_SANITIZE_NUMBER_INT); |
|
| 197 | +$currenttime = filter_input(INPUT_GET, 'currenttime', FILTER_SANITIZE_NUMBER_INT); |
|
| 198 | 198 | if ($currenttime != '') $currenttime = round($currenttime/1000); |
| 199 | 199 | |
| 200 | 200 | if ((!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation == FALSE) || (isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'false')) $usenextlatlon = false; |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | if (!empty($spotter_array) && is_array($spotter_array)) |
| 214 | 214 | { |
| 215 | 215 | $output .= '"features": ['; |
| 216 | - foreach($spotter_array as $spotter_item) |
|
| 216 | + foreach ($spotter_array as $spotter_item) |
|
| 217 | 217 | { |
| 218 | 218 | $j++; |
| 219 | 219 | unset($idistance); |
@@ -270,8 +270,8 @@ discard block |
||
| 270 | 270 | */ |
| 271 | 271 | //$output .= '"fc": "'.$spotter_item['nb'].'",'; |
| 272 | 272 | if (isset($spotter_item['ident']) && $spotter_item['ident'] != '') { |
| 273 | - if ($compress) $output .= '"c": "'.str_replace('\\','',$spotter_item['ident']).'",'; |
|
| 274 | - else $output .= '"callsign": "'.str_replace('\\','',$spotter_item['ident']).'",'; |
|
| 273 | + if ($compress) $output .= '"c": "'.str_replace('\\', '', $spotter_item['ident']).'",'; |
|
| 274 | + else $output .= '"callsign": "'.str_replace('\\', '', $spotter_item['ident']).'",'; |
|
| 275 | 275 | //" |
| 276 | 276 | } else { |
| 277 | 277 | if ($compress) $output .= '"c": "NA",'; |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | if (isset($spotter_item['registration'])) $output .= '"registration": "'.$spotter_item['registration'].'",'; |
| 281 | 281 | if (isset($spotter_item['aircraft_name']) && isset($spotter_item['aircraft_type'])) { |
| 282 | 282 | $output .= '"aircraft_name": "'.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')",'; |
| 283 | - $output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ','_',$spotter_item['aircraft_name'])).'",'; |
|
| 283 | + $output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ', '_', $spotter_item['aircraft_name'])).'",'; |
|
| 284 | 284 | } elseif (isset($spotter_item['aircraft_type'])) { |
| 285 | 285 | $output .= '"aircraft_name": "NA ('.$spotter_item['aircraft_type'].')",'; |
| 286 | 286 | } elseif (!$min) { |
@@ -423,15 +423,15 @@ discard block |
||
| 423 | 423 | if (isset($archivespeed) || $usenextlatlon) { |
| 424 | 424 | if (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { |
| 425 | 425 | if (isset($spotter_item['arrival_airport_latitude'])) { |
| 426 | - $cheading = $Common->getHeading($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['arrival_airport_latitude'],$spotter_item['arrival_airport_longitude']); |
|
| 427 | - $idistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['arrival_airport_latitude'],$spotter_item['arrival_airport_longitude']); |
|
| 426 | + $cheading = $Common->getHeading($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['arrival_airport_latitude'], $spotter_item['arrival_airport_longitude']); |
|
| 427 | + $idistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['arrival_airport_latitude'], $spotter_item['arrival_airport_longitude']); |
|
| 428 | 428 | $farr_lat = $spotter_item['arrival_airport_latitude']; |
| 429 | 429 | $farr_lon = $spotter_item['arrival_airport_longitude']; |
| 430 | 430 | } else { |
| 431 | 431 | $aairport = $Spotter->getAllAirportInfo($spotter_item['arrival_airport']); |
| 432 | 432 | if (isset($aairport[0]['latitude'])) { |
| 433 | - $cheading = $Common->getHeading($spotter_item['latitude'],$spotter_item['longitude'],$aairport[0]['latitude'],$aairport[0]['longitude']); |
|
| 434 | - $idistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$aairport[0]['latitude'],$aairport[0]['longitude']); |
|
| 433 | + $cheading = $Common->getHeading($spotter_item['latitude'], $spotter_item['longitude'], $aairport[0]['latitude'], $aairport[0]['longitude']); |
|
| 434 | + $idistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $aairport[0]['latitude'], $aairport[0]['longitude']); |
|
| 435 | 435 | $farr_lat = $aairport[0]['latitude']; |
| 436 | 436 | $farr_lon = $aairport[0]['longitude']; |
| 437 | 437 | } |
@@ -444,59 +444,59 @@ discard block |
||
| 444 | 444 | if ($currenttime != '') { |
| 445 | 445 | if (strtotime($spotter_item['date']) < $currenttime) { |
| 446 | 446 | if (isset($archivespeed)) { |
| 447 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh)); |
|
| 448 | - $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
|
| 447 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading, $archivespeed, ($currenttime - strtotime($spotter_item['date']) + $globalMapRefresh)); |
|
| 448 | + $fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']); |
|
| 449 | 449 | if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
| 450 | 450 | else { |
| 451 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,$archivespeed,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh)); |
|
| 452 | - $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
|
| 451 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $cheading, $archivespeed, ($currenttime - strtotime($spotter_item['date']) + $globalMapRefresh)); |
|
| 452 | + $fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']); |
|
| 453 | 453 | if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
| 454 | 454 | else { |
| 455 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed); |
|
| 455 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading, $archivespeed); |
|
| 456 | 456 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
| 457 | 457 | } |
| 458 | 458 | } |
| 459 | 459 | } elseif ($usenextlatlon) { |
| 460 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,1,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh)); |
|
| 461 | - $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
|
| 460 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading, 1, ($currenttime - strtotime($spotter_item['date']) + $globalMapRefresh)); |
|
| 461 | + $fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']); |
|
| 462 | 462 | if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
| 463 | 463 | else { |
| 464 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,1,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh)); |
|
| 465 | - $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
|
| 464 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $cheading, 1, ($currenttime - strtotime($spotter_item['date']) + $globalMapRefresh)); |
|
| 465 | + $fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']); |
|
| 466 | 466 | if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
| 467 | 467 | else { |
| 468 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading); |
|
| 468 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading); |
|
| 469 | 469 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
| 470 | 470 | } |
| 471 | 471 | } |
| 472 | 472 | } |
| 473 | 473 | } else { |
| 474 | 474 | if (isset($archivespeed)) { |
| 475 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed); |
|
| 475 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading, $archivespeed); |
|
| 476 | 476 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
| 477 | 477 | } elseif ($usenextlatlon) { |
| 478 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading); |
|
| 478 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading); |
|
| 479 | 479 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
| 480 | 480 | } |
| 481 | 481 | } |
| 482 | 482 | } else { |
| 483 | 483 | if (isset($archivespeed)) { |
| 484 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed); |
|
| 485 | - $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
|
| 484 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading, $archivespeed); |
|
| 485 | + $fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']); |
|
| 486 | 486 | if (!isset($idistance) || $fdistance < $idistance) { |
| 487 | 487 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
| 488 | 488 | } else { |
| 489 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,$archivespeed); |
|
| 489 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $cheading, $archivespeed); |
|
| 490 | 490 | //$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
| 491 | 491 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
| 492 | 492 | } |
| 493 | 493 | } elseif ($usenextlatlon) { |
| 494 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading); |
|
| 495 | - $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
|
| 494 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading); |
|
| 495 | + $fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']); |
|
| 496 | 496 | if (!isset($idistance) || $fdistance < $idistance) { |
| 497 | 497 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
| 498 | 498 | } else { |
| 499 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading); |
|
| 499 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $cheading); |
|
| 500 | 500 | //$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
| 501 | 501 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
| 502 | 502 | } |
@@ -505,7 +505,7 @@ discard block |
||
| 505 | 505 | |
| 506 | 506 | if (!$min) $output .= '"image": "'.$image.'",'; |
| 507 | 507 | if (isset($spotter_item['image_copyright']) && $spotter_item['image_copyright'] != '') { |
| 508 | - $output .= '"image_copyright": "'.str_replace('"',"'",trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'',$spotter_item['image_copyright']))).'",'; |
|
| 508 | + $output .= '"image_copyright": "'.str_replace('"', "'", trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '', $spotter_item['image_copyright']))).'",'; |
|
| 509 | 509 | } |
| 510 | 510 | if (isset($spotter_item['image_source_website'])) { |
| 511 | 511 | $output .= '"image_source_website": "'.urlencode($spotter_item['image_source_website']).'",'; |
@@ -527,7 +527,7 @@ discard block |
||
| 527 | 527 | $output .= '"waypoints": "'.$spotter_item['waypoints'].'",'; |
| 528 | 528 | } |
| 529 | 529 | if (isset($spotter_item['acars'])) { |
| 530 | - $output .= '"acars": "'.trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"), '<br />',$spotter_item['acars']['message'])).'",'; |
|
| 530 | + $output .= '"acars": "'.trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '<br />', $spotter_item['acars']['message'])).'",'; |
|
| 531 | 531 | } |
| 532 | 532 | // type when not aircraft ? |
| 533 | 533 | if (isset($spotter_item['type'])) { |
@@ -547,12 +547,12 @@ discard block |
||
| 547 | 547 | if ($currenttime != '') { |
| 548 | 548 | if (strtotime($spotter_item['date']) < $currenttime) { |
| 549 | 549 | if (!isset($archivespeed)) $archivespeed = 1; |
| 550 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed,($currenttime-strtotime($spotter_item['date']))); |
|
| 551 | - $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
|
| 550 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading, $archivespeed, ($currenttime - strtotime($spotter_item['date']))); |
|
| 551 | + $fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']); |
|
| 552 | 552 | if (!isset($idistance) || $fdistance < $idistance) $output .= $nextcoord['longitude'].','.$nextcoord['latitude']; |
| 553 | 553 | else { |
| 554 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,$archivespeed,($currenttime-strtotime($spotter_item['date']))); |
|
| 555 | - $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
|
| 554 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $cheading, $archivespeed, ($currenttime - strtotime($spotter_item['date']))); |
|
| 555 | + $fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']); |
|
| 556 | 556 | if (!isset($idistance) || $fdistance < $idistance) $output .= $nextcoord['longitude'].','.$nextcoord['latitude']; |
| 557 | 557 | else { |
| 558 | 558 | $output .= $spotter_item['longitude'].', '; |
@@ -631,7 +631,7 @@ discard block |
||
| 631 | 631 | |
| 632 | 632 | } |
| 633 | 633 | */ |
| 634 | - $history = filter_input(INPUT_GET,'history',FILTER_SANITIZE_STRING); |
|
| 634 | + $history = filter_input(INPUT_GET, 'history', FILTER_SANITIZE_STRING); |
|
| 635 | 635 | if ($history == '' && isset($_COOKIE['history'])) $history = $_COOKIE['history']; |
| 636 | 636 | |
| 637 | 637 | if ( |
@@ -639,11 +639,11 @@ discard block |
||
| 639 | 639 | || ((isset($globalMapHistory) && $globalMapHistory) || $allhistory) |
| 640 | 640 | // || (isset($history) && $history != '' && $history != 'NA' && ($history == $spotter_item['ident'] || $history == $spotter_item['flightaware_id'])) |
| 641 | 641 | // || (isset($history) && $history != '' && $history != 'NA' && $history == $spotter_item['ident']) |
| 642 | - || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
|
| 642 | + || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id'])) |
|
| 643 | 643 | || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']) |
| 644 | - || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['fammarine_id'])) |
|
| 644 | + || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['fammarine_id'])) |
|
| 645 | 645 | || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['fammarine_id']) && $_GET['fammarine_id'] == $spotter_item['fammarine_id']) |
| 646 | - || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['famtrackid'])) |
|
| 646 | + || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['famtrackid'])) |
|
| 647 | 647 | || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['famtrackid']) && $_GET['famtrackid'] == $spotter_item['famtrackid']) |
| 648 | 648 | ) { |
| 649 | 649 | if ($tracker) { |
@@ -672,9 +672,9 @@ discard block |
||
| 672 | 672 | require(dirname(__FILE__).'/require/class.MapMatching.php'); |
| 673 | 673 | $MapMatching = new MapMatching(); |
| 674 | 674 | if (isset($spotter_item['date_iso_8601'])) { |
| 675 | - $spotter_history_array_mm = array_merge($spotter_history_array,array(array('latitude' => $spotter_item['latitude'],'longitude' => $spotter_item['longitude'],'date' => date('c',strtotime($spotter_item['date_iso_8601']))))); |
|
| 675 | + $spotter_history_array_mm = array_merge($spotter_history_array, array(array('latitude' => $spotter_item['latitude'], 'longitude' => $spotter_item['longitude'], 'date' => date('c', strtotime($spotter_item['date_iso_8601']))))); |
|
| 676 | 676 | } else { |
| 677 | - $spotter_history_array_mm = array_merge($spotter_history_array,array(array('latitude' => $spotter_item['latitude'],'longitude' => $spotter_item['longitude'],'date' => date('c',strtotime($spotter_item['date']))))); |
|
| 677 | + $spotter_history_array_mm = array_merge($spotter_history_array, array(array('latitude' => $spotter_item['latitude'], 'longitude' => $spotter_item['longitude'], 'date' => date('c', strtotime($spotter_item['date']))))); |
|
| 678 | 678 | } |
| 679 | 679 | $spotter_history_array = $MapMatching->match($spotter_history_array_mm); |
| 680 | 680 | } |
@@ -706,9 +706,9 @@ discard block |
||
| 706 | 706 | else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
| 707 | 707 | } |
| 708 | 708 | $output_history .= '['; |
| 709 | - $output_history .= $spotter_history['longitude'].', '; |
|
| 710 | - $output_history .= $spotter_history['latitude'].', '; |
|
| 711 | - $output_history .= $spotter_history['altitude']*30.48; |
|
| 709 | + $output_history .= $spotter_history['longitude'].', '; |
|
| 710 | + $output_history .= $spotter_history['latitude'].', '; |
|
| 711 | + $output_history .= $spotter_history['altitude']*30.48; |
|
| 712 | 712 | $output_history .= '],'; |
| 713 | 713 | /* |
| 714 | 714 | if ($from_archive === false) { |
@@ -731,8 +731,8 @@ discard block |
||
| 731 | 731 | $d = true; |
| 732 | 732 | } |
| 733 | 733 | $output_history .= '['; |
| 734 | - $output_history .= $spotter_history['longitude'].', '; |
|
| 735 | - $output_history .= $spotter_history['latitude']; |
|
| 734 | + $output_history .= $spotter_history['longitude'].', '; |
|
| 735 | + $output_history .= $spotter_history['latitude']; |
|
| 736 | 736 | $output_history .= '],'; |
| 737 | 737 | /* |
| 738 | 738 | if ($from_archive === false) { |
@@ -748,9 +748,9 @@ discard block |
||
| 748 | 748 | //echo $output_history; |
| 749 | 749 | if ($from_archive === false && !isset($spotter_history_array[0]['mapmatching_engine'])) { |
| 750 | 750 | $output_historyd = '['; |
| 751 | - $output_historyd .= $spotter_item['longitude'].', '; |
|
| 752 | - $output_historyd .= $spotter_item['latitude']; |
|
| 753 | - if (isset($spotter_history['altitude'])) $output_historyd .= ','.$spotter_item['altitude']*30.48; |
|
| 751 | + $output_historyd .= $spotter_item['longitude'].', '; |
|
| 752 | + $output_historyd .= $spotter_item['latitude']; |
|
| 753 | + if (isset($spotter_history['altitude'])) $output_historyd .= ','.$spotter_item['altitude']*30.48; |
|
| 754 | 754 | $output_historyd .= '],'; |
| 755 | 755 | //$output_history = $output_historyd.$output_history; |
| 756 | 756 | $output_history = $output_history.$output_historyd; |
@@ -758,7 +758,7 @@ discard block |
||
| 758 | 758 | $last = array_pop($spotter_history_array); |
| 759 | 759 | $latitude = $last['latitude']; |
| 760 | 760 | $longitude = $last['longitude']; |
| 761 | - $output = str_replace('"coordinates": ['.$spotter_item['longitude'].', '.$spotter_item['latitude'].']}','"coordinates": ['.$longitude.', '.$latitude.']}',$output); |
|
| 761 | + $output = str_replace('"coordinates": ['.$spotter_item['longitude'].', '.$spotter_item['latitude'].']}', '"coordinates": ['.$longitude.', '.$latitude.']}', $output); |
|
| 762 | 762 | } |
| 763 | 763 | |
| 764 | 764 | $output_history = substr($output_history, 0, -1); |
@@ -769,7 +769,7 @@ discard block |
||
| 769 | 769 | } |
| 770 | 770 | } |
| 771 | 771 | |
| 772 | - if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
|
| 772 | + if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id'])) |
|
| 773 | 773 | || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
| 774 | 774 | && (isset($spotter_item['departure_airport']) |
| 775 | 775 | && $spotter_item['departure_airport'] != 'NA' |
@@ -803,7 +803,7 @@ discard block |
||
| 803 | 803 | |
| 804 | 804 | //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))))) { |
| 805 | 805 | //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))))) { |
| 806 | - if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
|
| 806 | + if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id'])) |
|
| 807 | 807 | || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
| 808 | 808 | && (isset($spotter_item['arrival_airport']) |
| 809 | 809 | && $spotter_item['arrival_airport'] != 'NA' |
@@ -830,11 +830,11 @@ discard block |
||
| 830 | 830 | } |
| 831 | 831 | } |
| 832 | 832 | if ($havedata) { |
| 833 | - $line = $Common->greatCircle($spotter_item['latitude'],$spotter_item['longitude'],$end_lat,$end_lon); |
|
| 833 | + $line = $Common->greatCircle($spotter_item['latitude'], $spotter_item['longitude'], $end_lat, $end_lon); |
|
| 834 | 834 | foreach ($line[0] as $coord) { |
| 835 | 835 | $output_dest .= '['.$coord[0].','.$coord[1].'],'; |
| 836 | 836 | } |
| 837 | - $output_dest = substr($output_dest, 0, -1); |
|
| 837 | + $output_dest = substr($output_dest, 0, -1); |
|
| 838 | 838 | } |
| 839 | 839 | $output_dest .= ']}},'; |
| 840 | 840 | if ($havedata) $output .= $output_dest; |
@@ -844,7 +844,7 @@ discard block |
||
| 844 | 844 | $output = substr($output, 0, -1); |
| 845 | 845 | $output .= ']'; |
| 846 | 846 | $output .= ',"initial_sqltime": "'.$sqltime.'",'; |
| 847 | - $output .= '"totaltime": "'.round(microtime(true)-$begintime,2).'",'; |
|
| 847 | + $output .= '"totaltime": "'.round(microtime(true) - $begintime, 2).'",'; |
|
| 848 | 848 | if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",'; |
| 849 | 849 | $output .= '"fc": "'.$j.'"'; |
| 850 | 850 | } else { |
@@ -22,13 +22,13 @@ discard block |
||
| 22 | 22 | $min = false; |
| 23 | 23 | $allhistory = false; |
| 24 | 24 | $filter['source'] = array(); |
| 25 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['ShowVATSIM']) && $_COOKIE['ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
| 26 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['ShowIVAO']) && $_COOKIE['ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
| 27 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['ShowVMS']) && $_COOKIE['ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
| 28 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['ShowSBS1']) && $_COOKIE['ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs')); |
|
| 29 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['ShowAPRS']) && $_COOKIE['ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
| 30 | -if (isset($_COOKIE['Airlines']) && $_COOKIE['Airlines'] != '') $filter['airlines'] = explode(',',$_COOKIE['Airlines']); |
|
| 31 | -if (isset($_COOKIE['Sources']) && $_COOKIE['Sources'] != '') $filter['source_aprs'] = explode(',',$_COOKIE['Sources']); |
|
| 25 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['ShowVATSIM']) && $_COOKIE['ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'], array('vatsimtxt')); |
|
| 26 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['ShowIVAO']) && $_COOKIE['ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'], array('whazzup')); |
|
| 27 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['ShowVMS']) && $_COOKIE['ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'], array('phpvmacars')); |
|
| 28 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['ShowSBS1']) && $_COOKIE['ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'], array('sbs')); |
|
| 29 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['ShowAPRS']) && $_COOKIE['ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'], array('aprs')); |
|
| 30 | +if (isset($_COOKIE['Airlines']) && $_COOKIE['Airlines'] != '') $filter['airlines'] = explode(',', $_COOKIE['Airlines']); |
|
| 31 | +if (isset($_COOKIE['Sources']) && $_COOKIE['Sources'] != '') $filter['source_aprs'] = explode(',', $_COOKIE['Sources']); |
|
| 32 | 32 | if (isset($_COOKIE['airlinestype']) && $_COOKIE['airlinestype'] != 'all') $filter['airlinestype'] = $_COOKIE['airlinestype']; |
| 33 | 33 | |
| 34 | 34 | if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) { |
@@ -36,12 +36,12 @@ discard block |
||
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | if (isset($_GET['ident'])) { |
| 39 | - $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
|
| 39 | + $ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING); |
|
| 40 | 40 | $from_archive = true; |
| 41 | 41 | $spotter_array = $SpotterArchive->getLastArchiveSpotterDataByIdent($ident); |
| 42 | 42 | $allhistory = true; |
| 43 | 43 | } elseif (isset($_GET['flightaware_id'])) { |
| 44 | - $flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING); |
|
| 44 | + $flightaware_id = filter_input(INPUT_GET, 'flightaware_id', FILTER_SANITIZE_STRING); |
|
| 45 | 45 | $from_archive = true; |
| 46 | 46 | $spotter_array = $SpotterArchive->getLastArchiveSpotterDataById($flightaware_id); |
| 47 | 47 | $allhistory = true; |
@@ -49,13 +49,13 @@ discard block |
||
| 49 | 49 | $from_archive = true; |
| 50 | 50 | // $begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
| 51 | 51 | // $enddate = filter_input(INPUT_GET,'enddate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
| 52 | - $begindate = filter_input(INPUT_GET,'begindate',FILTER_SANITIZE_NUMBER_INT); |
|
| 53 | - $enddate = filter_input(INPUT_GET,'enddate',FILTER_SANITIZE_NUMBER_INT); |
|
| 54 | - $archivespeed = filter_input(INPUT_GET,'speed',FILTER_SANITIZE_NUMBER_INT); |
|
| 55 | - $begindate = date('Y-m-d H:i:s',$begindate); |
|
| 56 | - $enddate = date('Y-m-d H:i:s',$enddate); |
|
| 52 | + $begindate = filter_input(INPUT_GET, 'begindate', FILTER_SANITIZE_NUMBER_INT); |
|
| 53 | + $enddate = filter_input(INPUT_GET, 'enddate', FILTER_SANITIZE_NUMBER_INT); |
|
| 54 | + $archivespeed = filter_input(INPUT_GET, 'speed', FILTER_SANITIZE_NUMBER_INT); |
|
| 55 | + $begindate = date('Y-m-d H:i:s', $begindate); |
|
| 56 | + $enddate = date('Y-m-d H:i:s', $enddate); |
|
| 57 | 57 | //$spotter_array = $SpotterArchive->getMinLiveSpotterDataPlayback($begindate,$enddate,$filter); |
| 58 | - $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate,$enddate,$filter); |
|
| 58 | + $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate, $enddate, $filter); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | if (!empty($spotter_array)) { |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | if ($flightcnt == '') $flightcnt = 0; |
| 65 | 65 | } else $flightcnt = 0; |
| 66 | 66 | |
| 67 | -$sqltime = round(microtime(true)-$begintime,2); |
|
| 67 | +$sqltime = round(microtime(true) - $begintime, 2); |
|
| 68 | 68 | |
| 69 | 69 | //var_dump($spotter_array); |
| 70 | 70 | $j = 0; |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | if (!empty($spotter_array) && is_array($spotter_array)) |
| 80 | 80 | { |
| 81 | 81 | $output .= '"features": ['; |
| 82 | - foreach($spotter_array as $spotter_item) |
|
| 82 | + foreach ($spotter_array as $spotter_item) |
|
| 83 | 83 | { |
| 84 | 84 | $j++; |
| 85 | 85 | date_default_timezone_set('UTC'); |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | if (isset($spotter_item['registration'])) $output .= '"registration": "'.$spotter_item['registration'].'",'; |
| 120 | 120 | if (isset($spotter_item['aircraft_name']) && isset($spotter_item['aircraft_type'])) { |
| 121 | 121 | $output .= '"aircraft_name": "'.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')",'; |
| 122 | - $output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ','_',$spotter_item['aircraft_name'])).'",'; |
|
| 122 | + $output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ', '_', $spotter_item['aircraft_name'])).'",'; |
|
| 123 | 123 | } elseif (isset($spotter_item['aircraft_type'])) { |
| 124 | 124 | $output .= '"aircraft_name": "NA ('.$spotter_item['aircraft_type'].')",'; |
| 125 | 125 | } elseif (!$min) { |
@@ -186,15 +186,15 @@ discard block |
||
| 186 | 186 | if ($compress)$output .= '"h": "'.$spotter_item['heading'].'",'; |
| 187 | 187 | else $output .= '"heading": "'.$spotter_item['heading'].'",'; |
| 188 | 188 | |
| 189 | - if (isset($archivespeed)) $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading'],$archivespeed); |
|
| 190 | - else $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading']); |
|
| 189 | + if (isset($archivespeed)) $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $spotter_item['heading'], $archivespeed); |
|
| 190 | + else $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $spotter_item['heading']); |
|
| 191 | 191 | //$output .= '"nextlatitude": "'.$nextcoord['latitude'].'",'; |
| 192 | 192 | //$output .= '"nextlongitude": "'.$nextcoord['longitude'].'",'; |
| 193 | 193 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
| 194 | 194 | |
| 195 | 195 | if (!$min) $output .= '"image": "'.$image.'",'; |
| 196 | 196 | if (isset($spotter_item['image_copyright']) && $spotter_item['image_copyright'] != '') { |
| 197 | - $output .= '"image_copyright": "'.str_replace('"',"'",trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'',$spotter_item['image_copyright']))).'",'; |
|
| 197 | + $output .= '"image_copyright": "'.str_replace('"', "'", trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '', $spotter_item['image_copyright']))).'",'; |
|
| 198 | 198 | } |
| 199 | 199 | if (isset($spotter_item['image_source_website'])) { |
| 200 | 200 | $output .= '"image_source_website": "'.urlencode($spotter_item['image_source_website']).'",'; |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | $output .= '"waypoints": "'.$spotter_item['waypoints'].'",'; |
| 217 | 217 | } |
| 218 | 218 | if (isset($spotter_item['acars'])) { |
| 219 | - $output .= '"acars": "'.trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"), '<br />',$spotter_item['acars']['message'])).'",'; |
|
| 219 | + $output .= '"acars": "'.trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '<br />', $spotter_item['acars']['message'])).'",'; |
|
| 220 | 220 | } |
| 221 | 221 | $spotter_history_array = $SpotterArchive->getCoordArchiveSpotterDataById($spotter_item['flightaware_id']); |
| 222 | 222 | //$spotter_history_array = array(); |
@@ -228,15 +228,15 @@ discard block |
||
| 228 | 228 | { |
| 229 | 229 | $output_history .= '['.$spotter_history['longitude'].', '.$spotter_history['latitude'].'],'; |
| 230 | 230 | $output_time .= (strtotime($spotter_history['date'])*1000).','; |
| 231 | - if ($previousts != 0) $output_timediff .= (strtotime($spotter_history['date'])-$previousts).','; |
|
| 231 | + if ($previousts != 0) $output_timediff .= (strtotime($spotter_history['date']) - $previousts).','; |
|
| 232 | 232 | $previousts = strtotime($spotter_history['date']); |
| 233 | 233 | } |
| 234 | 234 | if (isset($output_time)) { |
| 235 | - $output_time = substr($output_time, 0, -1); |
|
| 235 | + $output_time = substr($output_time, 0, -1); |
|
| 236 | 236 | $output .= '"time": ['.$output_time.'],'; |
| 237 | 237 | } |
| 238 | 238 | if (isset($output_timediff)) { |
| 239 | - $output_timediff = substr($output_timediff, 0, -1); |
|
| 239 | + $output_timediff = substr($output_timediff, 0, -1); |
|
| 240 | 240 | $output .= '"timediff": ['.$output_timediff.'],'; |
| 241 | 241 | } |
| 242 | 242 | // FIXME : type when not aircraft ? |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | $output .= '"coordinates": ['; |
| 250 | 250 | |
| 251 | 251 | if (isset($output_history)) { |
| 252 | - $output_history = substr($output_history, 0, -1); |
|
| 252 | + $output_history = substr($output_history, 0, -1); |
|
| 253 | 253 | $output .= $output_history; |
| 254 | 254 | } |
| 255 | 255 | $output .= ']'; |
@@ -259,7 +259,7 @@ discard block |
||
| 259 | 259 | $output = substr($output, 0, -1); |
| 260 | 260 | $output .= ']'; |
| 261 | 261 | $output .= ',"initial_sqltime": "'.$sqltime.'",'; |
| 262 | - $output .= '"totaltime": "'.round(microtime(true)-$begintime,2).'",'; |
|
| 262 | + $output .= '"totaltime": "'.round(microtime(true) - $begintime, 2).'",'; |
|
| 263 | 263 | if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",'; |
| 264 | 264 | $output .= '"fc": "'.$flightcnt.'"'; |
| 265 | 265 | } else { |