@@ -25,30 +25,30 @@ discard block |
||
25 | 25 | |
26 | 26 | |
27 | 27 | function quaternionrotate($heading, $attitude = 0, $bank = 0) { |
28 | - // Assuming the angles are in radians. |
|
29 | - $c1 = cos($heading/2); |
|
30 | - $s1 = sin($heading/2); |
|
31 | - $c2 = cos($attitude/2); |
|
32 | - $s2 = sin($attitude/2); |
|
33 | - $c3 = cos($bank/2); |
|
34 | - $s3 = sin($bank/2); |
|
35 | - $c1c2 = $c1*$c2; |
|
36 | - $s1s2 = $s1*$s2; |
|
37 | - $w =$c1c2*$c3 - $s1s2*$s3; |
|
38 | - $x =$c1c2*$s3 + $s1s2*$c3; |
|
39 | - $y =$s1*$c2*$c3 + $c1*$s2*$s3; |
|
40 | - $z =$c1*$s2*$c3 - $s1*$c2*$s3; |
|
41 | - return array('x' => $x,'y' => $y,'z' => $z,'w' => $w); |
|
28 | + // Assuming the angles are in radians. |
|
29 | + $c1 = cos($heading/2); |
|
30 | + $s1 = sin($heading/2); |
|
31 | + $c2 = cos($attitude/2); |
|
32 | + $s2 = sin($attitude/2); |
|
33 | + $c3 = cos($bank/2); |
|
34 | + $s3 = sin($bank/2); |
|
35 | + $c1c2 = $c1*$c2; |
|
36 | + $s1s2 = $s1*$s2; |
|
37 | + $w =$c1c2*$c3 - $s1s2*$s3; |
|
38 | + $x =$c1c2*$s3 + $s1s2*$c3; |
|
39 | + $y =$s1*$c2*$c3 + $c1*$s2*$s3; |
|
40 | + $z =$c1*$s2*$c3 - $s1*$c2*$s3; |
|
41 | + return array('x' => $x,'y' => $y,'z' => $z,'w' => $w); |
|
42 | 42 | // return array('x' => '0.0','y' => '-0.931','z' => '0.0','w' => '0.365'); |
43 | 43 | |
44 | 44 | } |
45 | 45 | |
46 | 46 | |
47 | 47 | if (isset($_GET['download'])) { |
48 | - if ($_GET['download'] == "true") |
|
49 | - { |
|
48 | + if ($_GET['download'] == "true") |
|
49 | + { |
|
50 | 50 | header('Content-disposition: attachment; filename="flightairmap.json"'); |
51 | - } |
|
51 | + } |
|
52 | 52 | } |
53 | 53 | header('Content-Type: text/javascript'); |
54 | 54 | |
@@ -205,8 +205,8 @@ discard block |
||
205 | 205 | $image = "images/placeholder_thumb.png"; |
206 | 206 | } |
207 | 207 | |
208 | - if (isset($spotter_item['flightaware_id'])) $id = $spotter_item['flightaware_id']; |
|
209 | - elseif (isset($spotter_item['famtrackid'])) $id = $spotter_item['famtrackid']; |
|
208 | + if (isset($spotter_item['flightaware_id'])) $id = $spotter_item['flightaware_id']; |
|
209 | + elseif (isset($spotter_item['famtrackid'])) $id = $spotter_item['famtrackid']; |
|
210 | 210 | if ($prev_flightaware_id != $id) { |
211 | 211 | if ($prev_flightaware_id != '') { |
212 | 212 | $output .= ']'; |
@@ -34,11 +34,11 @@ discard block |
||
34 | 34 | $s3 = sin($bank/2); |
35 | 35 | $c1c2 = $c1*$c2; |
36 | 36 | $s1s2 = $s1*$s2; |
37 | - $w =$c1c2*$c3 - $s1s2*$s3; |
|
38 | - $x =$c1c2*$s3 + $s1s2*$c3; |
|
39 | - $y =$s1*$c2*$c3 + $c1*$s2*$s3; |
|
40 | - $z =$c1*$s2*$c3 - $s1*$c2*$s3; |
|
41 | - return array('x' => $x,'y' => $y,'z' => $z,'w' => $w); |
|
37 | + $w = $c1c2*$c3 - $s1s2*$s3; |
|
38 | + $x = $c1c2*$s3 + $s1s2*$c3; |
|
39 | + $y = $s1*$c2*$c3 + $c1*$s2*$s3; |
|
40 | + $z = $c1*$s2*$c3 - $s1*$c2*$s3; |
|
41 | + return array('x' => $x, 'y' => $y, 'z' => $z, 'w' => $w); |
|
42 | 42 | // return array('x' => '0.0','y' => '-0.931','z' => '0.0','w' => '0.365'); |
43 | 43 | |
44 | 44 | } |
@@ -59,16 +59,16 @@ discard block |
||
59 | 59 | $min = false; |
60 | 60 | $allhistory = false; |
61 | 61 | $filter['source'] = array(); |
62 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
63 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
64 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
65 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs')); |
|
66 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
67 | -if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
68 | -if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
69 | -if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
70 | -if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
71 | -if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING); |
|
62 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'], array('vatsimtxt')); |
|
63 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'], array('whazzup')); |
|
64 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'], array('phpvmacars')); |
|
65 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'], array('sbs')); |
|
66 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'], array('aprs')); |
|
67 | +if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'], FILTER_SANITIZE_STRING); |
|
68 | +if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',', $_COOKIE['filter_Airlines']), FILTER_SANITIZE_STRING); |
|
69 | +if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',', $_COOKIE['filter_Sources']), FILTER_SANITIZE_STRING); |
|
70 | +if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'], FILTER_SANITIZE_STRING); |
|
71 | +if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'], FILTER_SANITIZE_STRING); |
|
72 | 72 | /* |
73 | 73 | if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) { |
74 | 74 | $min = true; |
@@ -115,12 +115,12 @@ discard block |
||
115 | 115 | $from_archive = true; |
116 | 116 | // $begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
117 | 117 | // $enddate = filter_input(INPUT_GET,'enddate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
118 | - $begindate = filter_input(INPUT_GET,'begindate',FILTER_SANITIZE_NUMBER_INT); |
|
119 | - $enddate = filter_input(INPUT_GET,'enddate',FILTER_SANITIZE_NUMBER_INT); |
|
120 | - $archivespeed = filter_input(INPUT_GET,'speed',FILTER_SANITIZE_NUMBER_INT); |
|
121 | - $begindate = date('Y-m-d H:i:s',$begindate); |
|
122 | - $enddate = date('Y-m-d H:i:s',$enddate); |
|
123 | - $spotter_array = $SpotterArchive->getMinLiveSpotterDataPlayback($begindate,$enddate,$filter); |
|
118 | + $begindate = filter_input(INPUT_GET, 'begindate', FILTER_SANITIZE_NUMBER_INT); |
|
119 | + $enddate = filter_input(INPUT_GET, 'enddate', FILTER_SANITIZE_NUMBER_INT); |
|
120 | + $archivespeed = filter_input(INPUT_GET, 'speed', FILTER_SANITIZE_NUMBER_INT); |
|
121 | + $begindate = date('Y-m-d H:i:s', $begindate); |
|
122 | + $enddate = date('Y-m-d H:i:s', $enddate); |
|
123 | + $spotter_array = $SpotterArchive->getMinLiveSpotterDataPlayback($begindate, $enddate, $filter); |
|
124 | 124 | } elseif (isset($_COOKIE['archive']) && isset($_COOKIE['archive_begin']) && isset($_COOKIE['archive_end']) && isset($_COOKIE['archive_speed'])) { |
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}$~'))); |
@@ -130,11 +130,11 @@ discard block |
||
130 | 130 | $begindate = $_COOKIE['archive_begin']; |
131 | 131 | $enddate = $_COOKIE['archive_end']; |
132 | 132 | |
133 | - $archivespeed = filter_var($_COOKIE['archive_speed'],FILTER_SANITIZE_NUMBER_INT); |
|
134 | - $begindate = date('Y-m-d H:i:s',$begindate); |
|
135 | - $enddate = date('Y-m-d H:i:s',$enddate); |
|
133 | + $archivespeed = filter_var($_COOKIE['archive_speed'], FILTER_SANITIZE_NUMBER_INT); |
|
134 | + $begindate = date('Y-m-d H:i:s', $begindate); |
|
135 | + $enddate = date('Y-m-d H:i:s', $enddate); |
|
136 | 136 | // echo 'Begin : '.$begindate.' - End : '.$enddate."\n"; |
137 | - $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate,$enddate,$filter); |
|
137 | + $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate, $enddate, $filter); |
|
138 | 138 | } elseif ($tracker) { |
139 | 139 | $spotter_array = $TrackerLive->getMinLastLiveTrackerData($filter); |
140 | 140 | } else { |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | |
144 | 144 | if (!empty($spotter_array)) { |
145 | 145 | if (isset($_GET['archive'])) { |
146 | - $flightcnt = $SpotterArchive->getLiveSpotterCount($begindate,$enddate,$filter); |
|
146 | + $flightcnt = $SpotterArchive->getLiveSpotterCount($begindate, $enddate, $filter); |
|
147 | 147 | } elseif ($tracker) { |
148 | 148 | $flightcnt = $TrackerLive->getLiveTrackerCount($filter); |
149 | 149 | } else { |
@@ -152,16 +152,16 @@ discard block |
||
152 | 152 | if ($flightcnt == '') $flightcnt = 0; |
153 | 153 | } else $flightcnt = 0; |
154 | 154 | |
155 | -$sqltime = round(microtime(true)-$begintime,2); |
|
155 | +$sqltime = round(microtime(true) - $begintime, 2); |
|
156 | 156 | $minitime = time(); |
157 | 157 | $maxitime = 0; |
158 | 158 | |
159 | 159 | |
160 | 160 | $modelsdb = array(); |
161 | 161 | if (file_exists('models/modelsdb')) { |
162 | - if (($handle = fopen('models/modelsdb','r')) !== FALSE) { |
|
163 | - while (($row = fgetcsv($handle,1000)) !== FALSE) { |
|
164 | - if (isset($row[1]) ){ |
|
162 | + if (($handle = fopen('models/modelsdb', 'r')) !== FALSE) { |
|
163 | + while (($row = fgetcsv($handle, 1000)) !== FALSE) { |
|
164 | + if (isset($row[1])) { |
|
165 | 165 | $model = $row[0]; |
166 | 166 | $modelsdb[$model] = $row[1]; |
167 | 167 | } |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | $output .= '},'; |
195 | 195 | if (!empty($spotter_array) && is_array($spotter_array)) |
196 | 196 | { |
197 | - foreach($spotter_array as $spotter_item) |
|
197 | + foreach ($spotter_array as $spotter_item) |
|
198 | 198 | { |
199 | 199 | $j++; |
200 | 200 | date_default_timezone_set('UTC'); |
@@ -428,7 +428,7 @@ discard block |
||
428 | 428 | $output .= '"cartographicDegrees": ['; |
429 | 429 | if ($minitime > strtotime($spotter_item['date'])) $minitime = strtotime($spotter_item['date']); |
430 | 430 | if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']); |
431 | - $output .= '"'.date("c",strtotime($spotter_item['date'])).'", '; |
|
431 | + $output .= '"'.date("c", strtotime($spotter_item['date'])).'", '; |
|
432 | 432 | $output .= $spotter_item['longitude'].', '; |
433 | 433 | $output .= $spotter_item['latitude']; |
434 | 434 | $prevlong = $spotter_item['longitude']; |
@@ -442,7 +442,7 @@ discard block |
||
442 | 442 | //$quat = quaternionrotate(deg2rad($spotter_item['heading']),deg2rad(0),deg2rad(0)); |
443 | 443 | //$orientation .= '"'.date("c",strtotime($spotter_item['date'])).'",'.$quat['x'].','.$quat['y'].','.$quat['z'].','.$quat['w']; |
444 | 444 | } else { |
445 | - $output .= ',"'.date("c",strtotime($spotter_item['date'])).'", '; |
|
445 | + $output .= ',"'.date("c", strtotime($spotter_item['date'])).'", '; |
|
446 | 446 | if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']); |
447 | 447 | if ($spotter_item['ground_speed'] == 0) { |
448 | 448 | $output .= $prevlong.', '; |
@@ -474,7 +474,7 @@ discard block |
||
474 | 474 | $output = substr($output, 0, -1); |
475 | 475 | } |
476 | 476 | $output .= ']'; |
477 | -$output = str_replace('%minitime%',date("c",$minitime),$output); |
|
478 | -$output = str_replace('%maxitime%',date("c",$maxitime),$output); |
|
477 | +$output = str_replace('%minitime%', date("c", $minitime), $output); |
|
478 | +$output = str_replace('%maxitime%', date("c", $maxitime), $output); |
|
479 | 479 | print $output; |
480 | 480 | ?> |
@@ -2,7 +2,9 @@ discard block |
||
2 | 2 | require_once('require/class.Connection.php'); |
3 | 3 | require_once('require/class.Common.php'); |
4 | 4 | $tracker = false; |
5 | -if (isset($_GET['tracker'])) $tracker = true; |
|
5 | +if (isset($_GET['tracker'])) { |
|
6 | + $tracker = true; |
|
7 | +} |
|
6 | 8 | if ($tracker) { |
7 | 9 | require_once('require/class.Tracker.php'); |
8 | 10 | require_once('require/class.TrackerLive.php'); |
@@ -52,23 +54,46 @@ discard block |
||
52 | 54 | } |
53 | 55 | header('Content-Type: text/javascript'); |
54 | 56 | |
55 | -if (!isset($globalJsonCompress)) $compress = true; |
|
56 | -else $compress = $globalJsonCompress; |
|
57 | +if (!isset($globalJsonCompress)) { |
|
58 | + $compress = true; |
|
59 | +} else { |
|
60 | + $compress = $globalJsonCompress; |
|
61 | +} |
|
57 | 62 | |
58 | 63 | $from_archive = false; |
59 | 64 | $min = false; |
60 | 65 | $allhistory = false; |
61 | 66 | $filter['source'] = array(); |
62 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
63 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
64 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
65 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs')); |
|
66 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
67 | -if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
68 | -if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
69 | -if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
70 | -if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
71 | -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') { |
|
68 | + $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
69 | +} |
|
70 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') { |
|
71 | + $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
72 | +} |
|
73 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') { |
|
74 | + $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
75 | +} |
|
76 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') { |
|
77 | + $filter['source'] = array_merge($filter['source'],array('sbs')); |
|
78 | +} |
|
79 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') { |
|
80 | + $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
81 | +} |
|
82 | +if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') { |
|
83 | + $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
84 | +} |
|
85 | +if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') { |
|
86 | + $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
87 | +} |
|
88 | +if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') { |
|
89 | + $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
90 | +} |
|
91 | +if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') { |
|
92 | + $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
93 | +} |
|
94 | +if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') { |
|
95 | + $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING); |
|
96 | +} |
|
72 | 97 | /* |
73 | 98 | if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) { |
74 | 99 | $min = true; |
@@ -149,8 +174,12 @@ discard block |
||
149 | 174 | } else { |
150 | 175 | $flightcnt = $SpotterLive->getLiveSpotterCount($filter); |
151 | 176 | } |
152 | - if ($flightcnt == '') $flightcnt = 0; |
|
153 | -} else $flightcnt = 0; |
|
177 | + if ($flightcnt == '') { |
|
178 | + $flightcnt = 0; |
|
179 | + } |
|
180 | + } else { |
|
181 | + $flightcnt = 0; |
|
182 | +} |
|
154 | 183 | |
155 | 184 | $sqltime = round(microtime(true)-$begintime,2); |
156 | 185 | $minitime = time(); |
@@ -173,7 +202,9 @@ discard block |
||
173 | 202 | $j = 0; |
174 | 203 | $prev_flightaware_id = ''; |
175 | 204 | $speed = 1; |
176 | -if (isset($archivespeed)) $speed = $archivespeed; |
|
205 | +if (isset($archivespeed)) { |
|
206 | + $speed = $archivespeed; |
|
207 | +} |
|
177 | 208 | $output = '['; |
178 | 209 | if ($tracker) { |
179 | 210 | $output .= '{"id" : "document", "name" : "tracker","version" : "1.0"'; |
@@ -205,8 +236,11 @@ discard block |
||
205 | 236 | $image = "images/placeholder_thumb.png"; |
206 | 237 | } |
207 | 238 | |
208 | - if (isset($spotter_item['flightaware_id'])) $id = $spotter_item['flightaware_id']; |
|
209 | - elseif (isset($spotter_item['famtrackid'])) $id = $spotter_item['famtrackid']; |
|
239 | + if (isset($spotter_item['flightaware_id'])) { |
|
240 | + $id = $spotter_item['flightaware_id']; |
|
241 | + } elseif (isset($spotter_item['famtrackid'])) { |
|
242 | + $id = $spotter_item['famtrackid']; |
|
243 | + } |
|
210 | 244 | if ($prev_flightaware_id != $id) { |
211 | 245 | if ($prev_flightaware_id != '') { |
212 | 246 | $output .= ']'; |
@@ -248,7 +282,9 @@ discard block |
||
248 | 282 | $spotter_item['engine_type'] = $aircraft_info[0]['engine_type']; |
249 | 283 | $spotter_item['wake_category'] = $aircraft_info[0]['wake_category']; |
250 | 284 | $spotter_item['engine_count'] = $aircraft_info[0]['engine_count']; |
251 | - } else $aircraft_shadow = ''; |
|
285 | + } else { |
|
286 | + $aircraft_shadow = ''; |
|
287 | + } |
|
252 | 288 | if ($aircraft_shadow != '') { |
253 | 289 | if (isset($modelsdb[$aircraft_shadow])) { |
254 | 290 | $output .= '"model": {"gltf" : "'.$globalURL.'/models/'.$modelsdb[$aircraft_shadow].'","scale" : 1.0,"minimumPixelSize": 20'; |
@@ -353,7 +389,9 @@ discard block |
||
353 | 389 | $output .= ',"heightReference": "'.$heightrelative.'"'; |
354 | 390 | $output .= '},'; |
355 | 391 | //if ($spotter_item['aircraft_shadow'] != '') $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",'; |
356 | - if ($spotter_item['aircraft_icao'] != '') $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
392 | + if ($spotter_item['aircraft_icao'] != '') { |
|
393 | + $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
394 | + } |
|
357 | 395 | $modelsdb[$aircraft_icao] = 'Cesium_Air.glb'; |
358 | 396 | } |
359 | 397 | } elseif (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'aprs') { |
@@ -367,7 +405,9 @@ discard block |
||
367 | 405 | $output .= ',"heightReference": "'.$heightrelative.'"'; |
368 | 406 | $output .= '},'; |
369 | 407 | //if ($spotter_item['aircraft_shadow'] != '') $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",'; |
370 | - if ($spotter_item['aircraft_icao'] != '') $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
408 | + if ($spotter_item['aircraft_icao'] != '') { |
|
409 | + $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
410 | + } |
|
371 | 411 | $modelsdb[$aircraft_icao] = 'Cesium_Air.glb'; |
372 | 412 | } |
373 | 413 | } else { |
@@ -375,7 +415,9 @@ discard block |
||
375 | 415 | $output .= ',"heightReference": "'.$heightrelative.'"'; |
376 | 416 | $output .= '},'; |
377 | 417 | //if ($spotter_item['aircraft_shadow'] != '') $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",'; |
378 | - if ($spotter_item['aircraft_icao'] != '') $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
418 | + if ($spotter_item['aircraft_icao'] != '') { |
|
419 | + $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
420 | + } |
|
379 | 421 | $modelsdb[$aircraft_icao] = 'Cesium_Air.glb'; |
380 | 422 | } |
381 | 423 | } elseif ($tracker && isset($spotter_item['type'])) { |
@@ -426,8 +468,12 @@ discard block |
||
426 | 468 | // $output .= '"interpolationDegree" : 5,'; |
427 | 469 | // $output .= '"epoch" : "'.date("c",strtotime($spotter_item['date'])).'", '; |
428 | 470 | $output .= '"cartographicDegrees": ['; |
429 | - if ($minitime > strtotime($spotter_item['date'])) $minitime = strtotime($spotter_item['date']); |
|
430 | - if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']); |
|
471 | + if ($minitime > strtotime($spotter_item['date'])) { |
|
472 | + $minitime = strtotime($spotter_item['date']); |
|
473 | + } |
|
474 | + if ($maxitime < strtotime($spotter_item['date'])) { |
|
475 | + $maxitime = strtotime($spotter_item['date']); |
|
476 | + } |
|
431 | 477 | $output .= '"'.date("c",strtotime($spotter_item['date'])).'", '; |
432 | 478 | $output .= $spotter_item['longitude'].', '; |
433 | 479 | $output .= $spotter_item['latitude']; |
@@ -436,19 +482,26 @@ discard block |
||
436 | 482 | if (!$tracker) { |
437 | 483 | $output .= ', '.round($spotter_item['altitude']*30.48); |
438 | 484 | $prevalt = round($spotter_item['altitude']*30.48); |
439 | - } else $output .= ', 0'; |
|
485 | + } else { |
|
486 | + $output .= ', 0'; |
|
487 | + } |
|
440 | 488 | //$orientation = '"orientation" : { '; |
441 | 489 | //$orientation .= '"unitQuaternion": ['; |
442 | 490 | //$quat = quaternionrotate(deg2rad($spotter_item['heading']),deg2rad(0),deg2rad(0)); |
443 | 491 | //$orientation .= '"'.date("c",strtotime($spotter_item['date'])).'",'.$quat['x'].','.$quat['y'].','.$quat['z'].','.$quat['w']; |
444 | 492 | } else { |
445 | 493 | $output .= ',"'.date("c",strtotime($spotter_item['date'])).'", '; |
446 | - if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']); |
|
494 | + if ($maxitime < strtotime($spotter_item['date'])) { |
|
495 | + $maxitime = strtotime($spotter_item['date']); |
|
496 | + } |
|
447 | 497 | if ($spotter_item['ground_speed'] == 0) { |
448 | 498 | $output .= $prevlong.', '; |
449 | 499 | $output .= $prevlat; |
450 | - if (!$tracker) $output .= ', '.$prevalt; |
|
451 | - else $output .= ', 0'; |
|
500 | + if (!$tracker) { |
|
501 | + $output .= ', '.$prevalt; |
|
502 | + } else { |
|
503 | + $output .= ', 0'; |
|
504 | + } |
|
452 | 505 | } else { |
453 | 506 | $output .= $spotter_item['longitude'].', '; |
454 | 507 | $output .= $spotter_item['latitude']; |
@@ -462,7 +515,9 @@ discard block |
||
462 | 515 | } else { |
463 | 516 | $output .= ', '.round($spotter_item['altitude']*30.48); |
464 | 517 | } |
465 | - } else $output .= ', 0'; |
|
518 | + } else { |
|
519 | + $output .= ', 0'; |
|
520 | + } |
|
466 | 521 | } |
467 | 522 | //$quat = quaternionrotate(deg2rad($spotter_item['heading']),deg2rad(0),deg2rad(0)); |
468 | 523 | //$orientation .= ',"'.date("c",strtotime($spotter_item['date'])).'",'.$quat['x'].','.$quat['y'].','.$quat['z'].','.$quat['w']; |