@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | header('Content-disposition: attachment; filename="flightairmap-sat.json"'); |
| 14 | 14 | } |
| 15 | 15 | } |
| 16 | -$history = urldecode(filter_input(INPUT_GET,'history',FILTER_SANITIZE_STRING)); |
|
| 16 | +$history = urldecode(filter_input(INPUT_GET, 'history', FILTER_SANITIZE_STRING)); |
|
| 17 | 17 | header('Content-Type: text/javascript'); |
| 18 | 18 | |
| 19 | 19 | $begintime = microtime(true); |
@@ -21,10 +21,10 @@ discard block |
||
| 21 | 21 | |
| 22 | 22 | $spotter_array = array(); |
| 23 | 23 | if (isset($_COOKIE['sattypes']) && $_COOKIE['sattypes'] != '') { |
| 24 | - $sattypes = explode(',',$_COOKIE['sattypes']); |
|
| 24 | + $sattypes = explode(',', $_COOKIE['sattypes']); |
|
| 25 | 25 | foreach ($sattypes as $sattype) { |
| 26 | 26 | //$spotter_array = array_merge($Satellite->position_all_type($sattype,$timeb-$globalLiveInterval,$timeb),$spotter_array); |
| 27 | - $spotter_array = array_merge($Satellite->position_all_type($sattype),$spotter_array); |
|
| 27 | + $spotter_array = array_merge($Satellite->position_all_type($sattype), $spotter_array); |
|
| 28 | 28 | } |
| 29 | 29 | } |
| 30 | 30 | /* |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | */ |
| 37 | 37 | //$spotter_array = array_unique($spotter_array,SORT_REGULAR); |
| 38 | 38 | //print_r($spotter_array); |
| 39 | -$sqltime = round(microtime(true)-$begintime,2); |
|
| 39 | +$sqltime = round(microtime(true) - $begintime, 2); |
|
| 40 | 40 | |
| 41 | 41 | $output = '{"type":"FeatureCollection","features":['; |
| 42 | 42 | if (!empty($spotter_array) && is_array($spotter_array)) |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | $last_name = ''; |
| 45 | 45 | $coordinatearray = ''; |
| 46 | 46 | $timearray = array(); |
| 47 | - foreach($spotter_array as $spotter_item) |
|
| 47 | + foreach ($spotter_array as $spotter_item) |
|
| 48 | 48 | { |
| 49 | 49 | $output_data = ''; |
| 50 | 50 | $output_data .= '{"type":"Feature","properties":{'; |
@@ -55,14 +55,14 @@ discard block |
||
| 55 | 55 | $output_data .= '"logo":"default.png",'; |
| 56 | 56 | $output_data .= '"altitude":0,'; |
| 57 | 57 | $output_data .= '"sqt":'.$sqltime.','; |
| 58 | - $nextlatlon = $Satellite->position($spotter_item['name'],time()+$globalMapRefresh+20); |
|
| 58 | + $nextlatlon = $Satellite->position($spotter_item['name'], time() + $globalMapRefresh + 20); |
|
| 59 | 59 | $nextlat = $nextlatlon['latitude']; |
| 60 | - if (abs($nextlat-$spotter_item['latitude']) > 90) { |
|
| 60 | + if (abs($nextlat - $spotter_item['latitude']) > 90) { |
|
| 61 | 61 | if ($spotter_item['latitude'] < 0) $nexlat = -90; |
| 62 | 62 | else $nexlat = 90; |
| 63 | 63 | } |
| 64 | 64 | $nextlon = $nextlatlon['longitude']; |
| 65 | - if (abs($nextlon-$spotter_item['longitude']) > 180) { |
|
| 65 | + if (abs($nextlon - $spotter_item['longitude']) > 180) { |
|
| 66 | 66 | if ($spotter_item['longitude'] < 0) $nextlon = -180; |
| 67 | 67 | else $nextlon = 180; |
| 68 | 68 | } |
@@ -74,27 +74,27 @@ discard block |
||
| 74 | 74 | $output_data .= ']}},'; |
| 75 | 75 | $output .= $output_data; |
| 76 | 76 | if ($history == $spotter_item['name']) { |
| 77 | - $spotter_history_array = $Satellite->position($spotter_item['name'],time()-6000,time()); |
|
| 77 | + $spotter_history_array = $Satellite->position($spotter_item['name'], time() - 6000, time()); |
|
| 78 | 78 | $spotter_history_array = array_reverse($spotter_history_array); |
| 79 | 79 | $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['name'].'","type": "history"},"geometry": {"type": "LineString","coordinates": ['; |
| 80 | 80 | foreach ($spotter_history_array as $key => $spotter_history) { |
| 81 | - if ((isset($previous_lon) && abs($previous_lon-$spotter_history['longitude']) > 180) || (isset($previous_lat) && abs($previous_lat-$spotter_history['latitude']) > 90)) { |
|
| 81 | + if ((isset($previous_lon) && abs($previous_lon - $spotter_history['longitude']) > 180) || (isset($previous_lat) && abs($previous_lat - $spotter_history['latitude']) > 90)) { |
|
| 82 | 82 | break; |
| 83 | 83 | } |
| 84 | 84 | $output_history .= '['; |
| 85 | - $output_history .= $spotter_history['longitude'].', '; |
|
| 86 | - $output_history .= $spotter_history['latitude']; |
|
| 85 | + $output_history .= $spotter_history['longitude'].', '; |
|
| 86 | + $output_history .= $spotter_history['latitude']; |
|
| 87 | 87 | $output_history .= '],'; |
| 88 | 88 | $previous_lon = $spotter_history['longitude']; |
| 89 | 89 | $previous_lat = $spotter_history['latitude']; |
| 90 | 90 | } |
| 91 | - $output_history = substr($output_history,0,-1); |
|
| 91 | + $output_history = substr($output_history, 0, -1); |
|
| 92 | 92 | $output_history .= ']}},'; |
| 93 | 93 | $output .= $output_history; |
| 94 | 94 | } |
| 95 | 95 | } |
| 96 | 96 | } |
| 97 | -if (isset($output_data)) $output = substr($output,0,-1); |
|
| 97 | +if (isset($output_data)) $output = substr($output, 0, -1); |
|
| 98 | 98 | $output .= ']}'; |
| 99 | 99 | print $output; |
| 100 | 100 | ?> |
@@ -2,7 +2,7 @@ discard block |
||
| 2 | 2 | require_once('../require/settings.php'); |
| 3 | 3 | require_once('../require/class.Language.php'); |
| 4 | 4 | |
| 5 | -setcookie("MapFormat",'2d'); |
|
| 5 | +setcookie("MapFormat", '2d'); |
|
| 6 | 6 | |
| 7 | 7 | // Compressed GeoJson is used if true |
| 8 | 8 | if (!isset($globalJsonCompress)) $compress = true; |
@@ -18,10 +18,10 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | <?php |
| 20 | 20 | if (isset($_GET['famsatid'])) { |
| 21 | - $famsatid = filter_input(INPUT_GET,'famsatid',FILTER_SANITIZE_STRING); |
|
| 21 | + $famsatid = filter_input(INPUT_GET, 'famsatid', FILTER_SANITIZE_STRING); |
|
| 22 | 22 | } |
| 23 | 23 | if (isset($_GET['ident'])) { |
| 24 | - $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
|
| 24 | + $ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING); |
|
| 25 | 25 | } |
| 26 | 26 | if (!isset($ident) && !isset($famsatid)) { |
| 27 | 27 | ?> |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | <?php |
| 195 | 195 | } else { |
| 196 | 196 | ?> |
| 197 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
| 197 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000 + 20000; ?>+feature.properties.sqt*1000); |
|
| 198 | 198 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
| 199 | 199 | <?php |
| 200 | 200 | } |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | /* |
| 211 | 211 | shadowUrl: iconURLShadowpath, |
| 212 | 212 | shadowSize: [<?php print $globalAircraftSize; ?>, <?php print $globalAircraftSize; ?>], |
| 213 | - shadowAnchor: [<?php print ($globalAircraftSize/2)+1; ?>, <?php print $globalAircraftSize; ?>] |
|
| 213 | + shadowAnchor: [<?php print ($globalAircraftSize/2) + 1; ?>, <?php print $globalAircraftSize; ?>] |
|
| 214 | 214 | */ |
| 215 | 215 | }) |
| 216 | 216 | }) |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | <?php |
| 251 | 251 | } else { |
| 252 | 252 | ?> |
| 253 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
| 253 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000 + 20000; ?>+feature.properties.sqt*1000); |
|
| 254 | 254 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
| 255 | 255 | <?php |
| 256 | 256 | } |
@@ -305,7 +305,7 @@ discard block |
||
| 305 | 305 | <?php |
| 306 | 306 | } else { |
| 307 | 307 | ?> |
| 308 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
| 308 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000 + 20000; ?>+feature.properties.sqt*1000); |
|
| 309 | 309 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
| 310 | 310 | <?php |
| 311 | 311 | } |
@@ -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($_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,11 +142,11 @@ 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 | |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | } else $flightcnt = 0; |
| 164 | 164 | */ |
| 165 | 165 | $flightcnt = 0; |
| 166 | -$sqltime = round(microtime(true)-$begintime,2); |
|
| 166 | +$sqltime = round(microtime(true) - $begintime, 2); |
|
| 167 | 167 | |
| 168 | 168 | if ((!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation == FALSE) || (isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'false')) $usenextlatlon = false; |
| 169 | 169 | else $usenextlatlon = true; |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | if (!empty($spotter_array) && is_array($spotter_array)) |
| 181 | 181 | { |
| 182 | 182 | $output .= '"features": ['; |
| 183 | - foreach($spotter_array as $spotter_item) |
|
| 183 | + foreach ($spotter_array as $spotter_item) |
|
| 184 | 184 | { |
| 185 | 185 | $j++; |
| 186 | 186 | date_default_timezone_set('UTC'); |
@@ -236,8 +236,8 @@ discard block |
||
| 236 | 236 | */ |
| 237 | 237 | //$output .= '"fc": "'.$spotter_item['nb'].'",'; |
| 238 | 238 | if (isset($spotter_item['ident']) && $spotter_item['ident'] != '') { |
| 239 | - if ($compress) $output .= '"c": "'.str_replace('\\','',$spotter_item['ident']).'",'; |
|
| 240 | - else $output .= '"callsign": "'.str_replace('\\','',$spotter_item['ident']).'",'; |
|
| 239 | + if ($compress) $output .= '"c": "'.str_replace('\\', '', $spotter_item['ident']).'",'; |
|
| 240 | + else $output .= '"callsign": "'.str_replace('\\', '', $spotter_item['ident']).'",'; |
|
| 241 | 241 | //" |
| 242 | 242 | } else { |
| 243 | 243 | if ($compress) $output .= '"c": "NA",'; |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | if (isset($spotter_item['registration'])) $output .= '"registration": "'.$spotter_item['registration'].'",'; |
| 247 | 247 | if (isset($spotter_item['aircraft_name']) && isset($spotter_item['aircraft_type'])) { |
| 248 | 248 | $output .= '"aircraft_name": "'.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')",'; |
| 249 | - $output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ','_',$spotter_item['aircraft_name'])).'",'; |
|
| 249 | + $output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ', '_', $spotter_item['aircraft_name'])).'",'; |
|
| 250 | 250 | } elseif (isset($spotter_item['aircraft_type'])) { |
| 251 | 251 | $output .= '"aircraft_name": "NA ('.$spotter_item['aircraft_type'].')",'; |
| 252 | 252 | } elseif (!$min) { |
@@ -387,16 +387,16 @@ discard block |
||
| 387 | 387 | else $output .= '"heading": "'.$spotter_item['heading'].'",'; |
| 388 | 388 | |
| 389 | 389 | if (isset($archivespeed)) { |
| 390 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading'],$archivespeed); |
|
| 390 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $spotter_item['heading'], $archivespeed); |
|
| 391 | 391 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
| 392 | 392 | } elseif ($usenextlatlon) { |
| 393 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading']); |
|
| 393 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $spotter_item['heading']); |
|
| 394 | 394 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
| 395 | 395 | } |
| 396 | 396 | |
| 397 | 397 | if (!$min) $output .= '"image": "'.$image.'",'; |
| 398 | 398 | if (isset($spotter_item['image_copyright']) && $spotter_item['image_copyright'] != '') { |
| 399 | - $output .= '"image_copyright": "'.str_replace('"',"'",trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'',$spotter_item['image_copyright']))).'",'; |
|
| 399 | + $output .= '"image_copyright": "'.str_replace('"', "'", trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '', $spotter_item['image_copyright']))).'",'; |
|
| 400 | 400 | } |
| 401 | 401 | if (isset($spotter_item['image_source_website'])) { |
| 402 | 402 | $output .= '"image_source_website": "'.urlencode($spotter_item['image_source_website']).'",'; |
@@ -418,7 +418,7 @@ discard block |
||
| 418 | 418 | $output .= '"waypoints": "'.$spotter_item['waypoints'].'",'; |
| 419 | 419 | } |
| 420 | 420 | if (isset($spotter_item['acars'])) { |
| 421 | - $output .= '"acars": "'.trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"), '<br />',$spotter_item['acars']['message'])).'",'; |
|
| 421 | + $output .= '"acars": "'.trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '<br />', $spotter_item['acars']['message'])).'",'; |
|
| 422 | 422 | } |
| 423 | 423 | // type when not aircraft ? |
| 424 | 424 | if (isset($spotter_item['type'])) { |
@@ -496,7 +496,7 @@ discard block |
||
| 496 | 496 | |
| 497 | 497 | } |
| 498 | 498 | */ |
| 499 | - $history = filter_input(INPUT_GET,'history',FILTER_SANITIZE_STRING); |
|
| 499 | + $history = filter_input(INPUT_GET, 'history', FILTER_SANITIZE_STRING); |
|
| 500 | 500 | if ($history == '' && isset($_COOKIE['history'])) $history = $_COOKIE['history']; |
| 501 | 501 | |
| 502 | 502 | if ( |
@@ -504,11 +504,11 @@ discard block |
||
| 504 | 504 | || ((isset($globalMapHistory) && $globalMapHistory) || $allhistory) |
| 505 | 505 | // || (isset($history) && $history != '' && $history != 'NA' && ($history == $spotter_item['ident'] || $history == $spotter_item['flightaware_id'])) |
| 506 | 506 | // || (isset($history) && $history != '' && $history != 'NA' && $history == $spotter_item['ident']) |
| 507 | - || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
|
| 507 | + || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id'])) |
|
| 508 | 508 | || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']) |
| 509 | - || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['fammarine_id'])) |
|
| 509 | + || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['fammarine_id'])) |
|
| 510 | 510 | || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['fammarine_id']) && $_GET['fammarine_id'] == $spotter_item['fammarine_id']) |
| 511 | - || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['famtrackid'])) |
|
| 511 | + || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['famtrackid'])) |
|
| 512 | 512 | || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['famtrackid']) && $_GET['famtrackid'] == $spotter_item['famtrackid']) |
| 513 | 513 | ) { |
| 514 | 514 | if ($tracker) { |
@@ -545,9 +545,9 @@ discard block |
||
| 545 | 545 | else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
| 546 | 546 | } |
| 547 | 547 | $output_history .= '['; |
| 548 | - $output_history .= $spotter_history['longitude'].', '; |
|
| 549 | - $output_history .= $spotter_history['latitude'].', '; |
|
| 550 | - $output_history .= $spotter_history['altitude']*30.48; |
|
| 548 | + $output_history .= $spotter_history['longitude'].', '; |
|
| 549 | + $output_history .= $spotter_history['latitude'].', '; |
|
| 550 | + $output_history .= $spotter_history['altitude']*30.48; |
|
| 551 | 551 | $output_history .= '],'; |
| 552 | 552 | /* |
| 553 | 553 | if ($from_archive === false) { |
@@ -565,8 +565,8 @@ discard block |
||
| 565 | 565 | else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history"},"geometry": {"type": "LineString","coordinates": ['; |
| 566 | 566 | } else $d = true; |
| 567 | 567 | $output_history .= '['; |
| 568 | - $output_history .= $spotter_history['longitude'].', '; |
|
| 569 | - $output_history .= $spotter_history['latitude']; |
|
| 568 | + $output_history .= $spotter_history['longitude'].', '; |
|
| 569 | + $output_history .= $spotter_history['latitude']; |
|
| 570 | 570 | $output_history .= '],'; |
| 571 | 571 | /* |
| 572 | 572 | if ($from_archive === false) { |
@@ -582,9 +582,9 @@ discard block |
||
| 582 | 582 | |
| 583 | 583 | if ($from_archive === false) { |
| 584 | 584 | $output_historyd = '['; |
| 585 | - $output_historyd .= $spotter_item['longitude'].', '; |
|
| 586 | - $output_historyd .= $spotter_item['latitude']; |
|
| 587 | - if (isset($spotter_history['altitude'])) $output_historyd .= ','.$spotter_item['altitude']*30.48; |
|
| 585 | + $output_historyd .= $spotter_item['longitude'].', '; |
|
| 586 | + $output_historyd .= $spotter_item['latitude']; |
|
| 587 | + if (isset($spotter_history['altitude'])) $output_historyd .= ','.$spotter_item['altitude']*30.48; |
|
| 588 | 588 | $output_historyd .= '],'; |
| 589 | 589 | //$output_history = $output_historyd.$output_history; |
| 590 | 590 | $output_history = $output_history.$output_historyd; |
@@ -598,7 +598,7 @@ discard block |
||
| 598 | 598 | } |
| 599 | 599 | } |
| 600 | 600 | |
| 601 | - if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
|
| 601 | + if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id'])) |
|
| 602 | 602 | || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
| 603 | 603 | && (isset($spotter_item['departure_airport']) |
| 604 | 604 | && $spotter_item['departure_airport'] != 'NA' |
@@ -632,7 +632,7 @@ discard block |
||
| 632 | 632 | |
| 633 | 633 | //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))))) { |
| 634 | 634 | //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))))) { |
| 635 | - if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
|
| 635 | + if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id'])) |
|
| 636 | 636 | || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
| 637 | 637 | && (isset($spotter_item['arrival_airport']) |
| 638 | 638 | && $spotter_item['arrival_airport'] != 'NA' |
@@ -663,7 +663,7 @@ discard block |
||
| 663 | 663 | $output = substr($output, 0, -1); |
| 664 | 664 | $output .= ']'; |
| 665 | 665 | $output .= ',"initial_sqltime": "'.$sqltime.'",'; |
| 666 | - $output .= '"totaltime": "'.round(microtime(true)-$begintime,2).'",'; |
|
| 666 | + $output .= '"totaltime": "'.round(microtime(true) - $begintime, 2).'",'; |
|
| 667 | 667 | if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",'; |
| 668 | 668 | $output .= '"fc": "'.$j.'"'; |
| 669 | 669 | } else { |