@@ -27,15 +27,21 @@ discard block |
||
27 | 27 | } |
28 | 28 | } |
29 | 29 | } |
30 | -if ($authorize === false) die; |
|
30 | +if ($authorize === false) { |
|
31 | + die; |
|
32 | +} |
|
31 | 33 | |
32 | -if (isset($globalTracker) && $globalTracker) require_once(dirname(__FILE__).'/../require/class.TrackerImport.php'); |
|
34 | +if (isset($globalTracker) && $globalTracker) { |
|
35 | + require_once(dirname(__FILE__).'/../require/class.TrackerImport.php'); |
|
36 | +} |
|
33 | 37 | if (isset($globalMarine) && $globalMarine) { |
34 | 38 | require_once(dirname(__FILE__).'/../require/class.AIS.php'); |
35 | 39 | require_once(dirname(__FILE__).'/../require/class.MarineImport.php'); |
36 | 40 | } |
37 | 41 | |
38 | -if (!isset($globalDebug)) $globalDebug = FALSE; |
|
42 | +if (!isset($globalDebug)) { |
|
43 | + $globalDebug = FALSE; |
|
44 | +} |
|
39 | 45 | |
40 | 46 | // Check if schema is at latest version |
41 | 47 | $Connection = new Connection(); |
@@ -45,10 +51,16 @@ discard block |
||
45 | 51 | } |
46 | 52 | |
47 | 53 | if (isset($globalServer) && $globalServer) { |
48 | - if ($globalDebug) echo "Using Server Mode\n"; |
|
54 | + if ($globalDebug) { |
|
55 | + echo "Using Server Mode\n"; |
|
56 | + } |
|
49 | 57 | $SI=new SpotterServer(); |
50 | -} else $SI=new SpotterImport($Connection->db); |
|
51 | -if (isset($globalTracker) && $globalTracker) $TI = new TrackerImport($Connection->db); |
|
58 | +} else { |
|
59 | + $SI=new SpotterImport($Connection->db); |
|
60 | +} |
|
61 | +if (isset($globalTracker) && $globalTracker) { |
|
62 | + $TI = new TrackerImport($Connection->db); |
|
63 | +} |
|
52 | 64 | if (isset($globalMarine) && $globalMarine) { |
53 | 65 | $AIS = new AIS(); |
54 | 66 | $MI = new MarineImport($Connection->db); |
@@ -57,7 +69,9 @@ discard block |
||
57 | 69 | date_default_timezone_set('UTC'); |
58 | 70 | |
59 | 71 | $buffer = ''; |
60 | -if (isset($_POST)) $buffer = $_POST; |
|
72 | +if (isset($_POST)) { |
|
73 | + $buffer = $_POST; |
|
74 | +} |
|
61 | 75 | $data = array(); |
62 | 76 | if (isset($buffer['type_event']) && isset($buffer['lat']) && isset($buffer['lon'])) { |
63 | 77 | $data['ident'] = $buffer['device_id']; |
@@ -68,15 +82,27 @@ discard block |
||
68 | 82 | //$data['heading'] = $buffer['cap']; // Only N/S/E/W |
69 | 83 | $data['datetime'] = date('Y-m-d H:i:s',$buffer['timestamp']); |
70 | 84 | $data['comment'] = ''; |
71 | - if (isset($buffer['battery']) && $buffer['battery'] != '') $data['comment'] .= 'Battery: '.$buffer['battery'].'% '; |
|
85 | + if (isset($buffer['battery']) && $buffer['battery'] != '') { |
|
86 | + $data['comment'] .= 'Battery: '.$buffer['battery'].'% '; |
|
87 | + } |
|
72 | 88 | //if (isset($buffer['snr']) && $buffer['snr'] != '') $data['comment'] .= 'SNR: '.$buffer['snr'].' '; |
73 | - if (isset($buffer['temp']) && $buffer['temp'] != '') $data['comment'] .= 'Temperature: '.$buffer['temp'].'°C '; |
|
74 | - if (isset($buffer['press']) && $buffer['press'] != '') $data['comment'] .= 'Pressure: '.$buffer['press'].'hPa '; |
|
89 | + if (isset($buffer['temp']) && $buffer['temp'] != '') { |
|
90 | + $data['comment'] .= 'Temperature: '.$buffer['temp'].'°C '; |
|
91 | + } |
|
92 | + if (isset($buffer['press']) && $buffer['press'] != '') { |
|
93 | + $data['comment'] .= 'Pressure: '.$buffer['press'].'hPa '; |
|
94 | + } |
|
75 | 95 | $TI->add($data); |
76 | 96 | unset($data); |
77 | 97 | } |
78 | -if (isset($SI)) $SI->checkAll(); |
|
79 | -if (isset($MI)) $MI->checkAll(); |
|
80 | -if (isset($TI)) $TI->checkAll(); |
|
98 | +if (isset($SI)) { |
|
99 | + $SI->checkAll(); |
|
100 | +} |
|
101 | +if (isset($MI)) { |
|
102 | + $MI->checkAll(); |
|
103 | +} |
|
104 | +if (isset($TI)) { |
|
105 | + $TI->checkAll(); |
|
106 | +} |
|
81 | 107 | |
82 | 108 | ?> |
@@ -61,8 +61,11 @@ |
||
61 | 61 | print '<div class="col-sm-6">'.round($altitude-$geoid,3).'</div>'; |
62 | 62 | } |
63 | 63 | print '<div class="col-sm-6"><b>Earth Gravity Model</b></div>'; |
64 | - if (isset($globalGeoidSource) && $globalGeoidSource != '') $geoidsource = $globalGeoidSource; |
|
65 | - else $geoidsource = 'EGM96-15'; |
|
64 | + if (isset($globalGeoidSource) && $globalGeoidSource != '') { |
|
65 | + $geoidsource = $globalGeoidSource; |
|
66 | + } else { |
|
67 | + $geoidsource = 'EGM96-15'; |
|
68 | + } |
|
66 | 69 | print '<div class="col-sm-6">'.$geoidsource.'</div>'; |
67 | 70 | print '</div>'; |
68 | 71 | } |
@@ -19,20 +19,27 @@ discard block |
||
19 | 19 | if (is_array($globalStatsFilters) && isset($globalStatsFilters[$globalFilterName])) { |
20 | 20 | if (isset($globalStatsFilters[$globalFilterName][0]['source'])) { |
21 | 21 | foreach($globalStatsFilters[$globalFilterName] as $source) { |
22 | - if (isset($source['source'])) $filter['source'][] = $source['source']; |
|
22 | + if (isset($source['source'])) { |
|
23 | + $filter['source'][] = $source['source']; |
|
24 | + } |
|
23 | 25 | } |
24 | 26 | } else { |
25 | 27 | $filter = $globalStatsFilters[$globalFilterName]; |
26 | 28 | } |
27 | 29 | } |
28 | - if (is_array($globalFilter)) $filter = array_merge($filter,$globalFilter); |
|
30 | + if (is_array($globalFilter)) { |
|
31 | + $filter = array_merge($filter,$globalFilter); |
|
32 | + } |
|
29 | 33 | $filter_query_join = ''; |
30 | 34 | $filter_query_where = ''; |
31 | 35 | if (isset($filter['source']) && !empty($filter['source'])) { |
32 | 36 | $filter_query_where = " WHERE format_source IN ('".implode("','",$filter['source'])."')"; |
33 | 37 | } |
34 | - if ($filter_query_where == '' && $where) $filter_query_where = ' WHERE'; |
|
35 | - elseif ($filter_query_where != '' && $and) $filter_query_where .= ' AND'; |
|
38 | + if ($filter_query_where == '' && $where) { |
|
39 | + $filter_query_where = ' WHERE'; |
|
40 | + } elseif ($filter_query_where != '' && $and) { |
|
41 | + $filter_query_where .= ' AND'; |
|
42 | + } |
|
36 | 43 | $filter_query = $filter_query_join.$filter_query_where; |
37 | 44 | return $filter_query; |
38 | 45 | } |
@@ -89,7 +96,9 @@ discard block |
||
89 | 96 | $info = str_replace('^','<br />',$info); |
90 | 97 | $info = str_replace('&sect;','',$info); |
91 | 98 | $info = str_replace('"','',$info); |
92 | - if ($type == '') $type = NULL; |
|
99 | + if ($type == '') { |
|
100 | + $type = NULL; |
|
101 | + } |
|
93 | 102 | $query = "INSERT INTO atc (ident,frequency,latitude,longitude,atc_range,info,atc_lastseen,type,ivao_id,ivao_name,format_source,source_name) VALUES (:ident,:frequency,:latitude,:longitude,:range,:info,:date,:type,:ivao_id,:ivao_name,:format_source,:source_name)"; |
94 | 103 | $query_values = array(':ident' => $ident,':frequency' => $frequency,':latitude' => $latitude,':longitude' => $longitude,':range' => $range,':info' => $info,':date' => $date,':ivao_id' => $ivao_id,':ivao_name' => $ivao_name, ':type' => $type,':format_source' => $format_source,':source_name' => $source_name); |
95 | 104 | try { |
@@ -105,7 +114,9 @@ discard block |
||
105 | 114 | $info = str_replace('^','<br />',$info); |
106 | 115 | $info = str_replace('&sect;','',$info); |
107 | 116 | $info = str_replace('"','',$info); |
108 | - if ($type == '') $type = NULL; |
|
117 | + if ($type == '') { |
|
118 | + $type = NULL; |
|
119 | + } |
|
109 | 120 | $query = "UPDATE atc SET frequency = :frequency,latitude = :latitude,longitude = :longitude,atc_range = :range,info = :info,atc_lastseen = :date,type = :type,ivao_id = :ivao_id,ivao_name = :ivao_name WHERE ident = :ident AND format_source = :format_source AND source_name = :source_name"; |
110 | 121 | $query_values = array(':ident' => $ident,':frequency' => $frequency,':latitude' => $latitude,':longitude' => $longitude,':range' => $range,':info' => $info,':date' => $date,':ivao_id' => $ivao_id,':ivao_name' => $ivao_name, ':type' => $type,':format_source' => $format_source,':source_name' => $source_name); |
111 | 122 | try { |
@@ -59,8 +59,11 @@ discard block |
||
59 | 59 | } |
60 | 60 | $row = $sth->fetch(PDO::FETCH_ASSOC); |
61 | 61 | $sth->closeCursor(); |
62 | - if ($row['nb'] > 0) return false; |
|
63 | - else return true; |
|
62 | + if ($row['nb'] > 0) { |
|
63 | + return false; |
|
64 | + } else { |
|
65 | + return true; |
|
66 | + } |
|
64 | 67 | } |
65 | 68 | |
66 | 69 | public static function insert_last_update() { |
@@ -82,9 +85,14 @@ discard block |
||
82 | 85 | //$pieces = explode(' ',$data); |
83 | 86 | $pieces = preg_split('/\s/',$data); |
84 | 87 | $pos = 0; |
85 | - if ($pieces[0] == 'METAR') $pos++; |
|
86 | - elseif ($pieces[0] == 'SPECI') $pos++; |
|
87 | - if (strlen($pieces[$pos]) != 4) $pos++; |
|
88 | + if ($pieces[0] == 'METAR') { |
|
89 | + $pos++; |
|
90 | + } elseif ($pieces[0] == 'SPECI') { |
|
91 | + $pos++; |
|
92 | + } |
|
93 | + if (strlen($pieces[$pos]) != 4) { |
|
94 | + $pos++; |
|
95 | + } |
|
88 | 96 | $result = array(); |
89 | 97 | $result['location'] = $pieces[$pos]; |
90 | 98 | $pos++; |
@@ -93,16 +101,26 @@ discard block |
||
93 | 101 | $c = count($pieces); |
94 | 102 | for($pos++; $pos < $c; $pos++) { |
95 | 103 | $piece = $pieces[$pos]; |
96 | - if ($piece == 'RMK') break; |
|
97 | - if ($piece == 'AUTO') $result['auto'] = true; |
|
98 | - if ($piece == 'COR') $result['correction'] = true; |
|
104 | + if ($piece == 'RMK') { |
|
105 | + break; |
|
106 | + } |
|
107 | + if ($piece == 'AUTO') { |
|
108 | + $result['auto'] = true; |
|
109 | + } |
|
110 | + if ($piece == 'COR') { |
|
111 | + $result['correction'] = true; |
|
112 | + } |
|
99 | 113 | // Wind Speed |
100 | 114 | if (preg_match('#(VRB|\d\d\d)(\d\d)(?:G(\d\d))?(KT|MPS|KPH)(?: (\d{1,3})V(\d{1,3}))?$#', $piece, $matches)) { |
101 | 115 | $result['wind']['direction'] = (float)$matches[1]; |
102 | 116 | $result['wind']['unit'] = $matches[4]; |
103 | - if ($result['wind']['unit'] == 'KT') $result['wind']['speed'] = round(((float)$matches[2])*0.51444444444,2); |
|
104 | - elseif ($result['wind']['unit'] == 'KPH') $result['wind']['speed'] = round(((float)$matches[2])*1000,2); |
|
105 | - elseif ($result['wind']['unit'] == 'MPS') $result['wind']['speed'] = round(((float)$matches[2]),2); |
|
117 | + if ($result['wind']['unit'] == 'KT') { |
|
118 | + $result['wind']['speed'] = round(((float)$matches[2])*0.51444444444,2); |
|
119 | + } elseif ($result['wind']['unit'] == 'KPH') { |
|
120 | + $result['wind']['speed'] = round(((float)$matches[2])*1000,2); |
|
121 | + } elseif ($result['wind']['unit'] == 'MPS') { |
|
122 | + $result['wind']['speed'] = round(((float)$matches[2]),2); |
|
123 | + } |
|
106 | 124 | $result['wind']['gust'] = (float)$matches[3]; |
107 | 125 | $result['wind']['unit'] = $matches[4]; |
108 | 126 | $result['wind']['min_variation'] = array_key_exists(5,$matches) ? $matches[5] : 0; |
@@ -185,14 +203,23 @@ discard block |
||
185 | 203 | //$this->addCloudCover($matches[1], ((float)$matches[2]) * 100, isset($matches[3]) ? $matches[3] : ''); |
186 | 204 | $type = $matches[1]; |
187 | 205 | $cloud = array(); |
188 | - if ($type == 'SKC') $cloud['type'] = 'No cloud/Sky clear'; |
|
189 | - elseif ($type == 'CLR') $cloud['type'] = 'No cloud below 12,000ft (3700m)'; |
|
190 | - elseif ($type == 'NSC') $cloud['type'] = 'No significant cloud'; |
|
191 | - elseif ($type == 'FEW') $cloud['type'] = 'Few'; |
|
192 | - elseif ($type == 'SCT') $cloud['type'] = 'Scattered'; |
|
193 | - elseif ($type == 'BKN') $cloud['type'] = 'Broken'; |
|
194 | - elseif ($type == 'OVC') $cloud['type'] = 'Overcast/Full cloud coverage'; |
|
195 | - elseif ($type == 'VV') $cloud['type'] = 'Vertical visibility'; |
|
206 | + if ($type == 'SKC') { |
|
207 | + $cloud['type'] = 'No cloud/Sky clear'; |
|
208 | + } elseif ($type == 'CLR') { |
|
209 | + $cloud['type'] = 'No cloud below 12,000ft (3700m)'; |
|
210 | + } elseif ($type == 'NSC') { |
|
211 | + $cloud['type'] = 'No significant cloud'; |
|
212 | + } elseif ($type == 'FEW') { |
|
213 | + $cloud['type'] = 'Few'; |
|
214 | + } elseif ($type == 'SCT') { |
|
215 | + $cloud['type'] = 'Scattered'; |
|
216 | + } elseif ($type == 'BKN') { |
|
217 | + $cloud['type'] = 'Broken'; |
|
218 | + } elseif ($type == 'OVC') { |
|
219 | + $cloud['type'] = 'Overcast/Full cloud coverage'; |
|
220 | + } elseif ($type == 'VV') { |
|
221 | + $cloud['type'] = 'Vertical visibility'; |
|
222 | + } |
|
196 | 223 | $cloud['type_code'] = $type; |
197 | 224 | $cloud['level'] = round(((float)$matches[2]) * 100 * 0.3048); |
198 | 225 | $cloud['significant'] = isset($matches[3]) ? $matches[3] : ''; |
@@ -218,8 +245,11 @@ discard block |
||
218 | 245 | $result['RVR']['friction'] = $matches[5]; |
219 | 246 | } |
220 | 247 | if (preg_match('#^(R[A-Z0-9]{2,3})/([0-9]{4})(V([0-9]{4}))?(FT)?$#', $piece, $matches)) { |
221 | - if (isset($matches[5])) $range = array('exact' => (float)$matches[2], 'unit' => $matches[5] ? 'FT' : 'M'); |
|
222 | - else $range = array('exact' => (float)$matches[2], 'unit' => 'M'); |
|
248 | + if (isset($matches[5])) { |
|
249 | + $range = array('exact' => (float)$matches[2], 'unit' => $matches[5] ? 'FT' : 'M'); |
|
250 | + } else { |
|
251 | + $range = array('exact' => (float)$matches[2], 'unit' => 'M'); |
|
252 | + } |
|
223 | 253 | if (isset($matches[3])) { |
224 | 254 | $range = Array( |
225 | 255 | 'from' => (float)$matches[2], |
@@ -252,8 +282,11 @@ discard block |
||
252 | 282 | if (isset($matches[3])) { |
253 | 283 | $text[] = $this->texts[$matches[3]]; |
254 | 284 | } |
255 | - if (!isset($result['weather'])) $result['weather'] = implode(' ', $text); |
|
256 | - else $result['weather'] = $result['weather'].' / '.implode(' ', $text); |
|
285 | + if (!isset($result['weather'])) { |
|
286 | + $result['weather'] = implode(' ', $text); |
|
287 | + } else { |
|
288 | + $result['weather'] = $result['weather'].' / '.implode(' ', $text); |
|
289 | + } |
|
257 | 290 | } |
258 | 291 | } |
259 | 292 | return $result; |
@@ -264,8 +297,11 @@ discard block |
||
264 | 297 | if (isset($globalMETARcycle) && $globalMETARcycle) { |
265 | 298 | $query = "SELECT * FROM metar WHERE metar_location = :icao"; |
266 | 299 | } else { |
267 | - if ($globalDBdriver == 'mysql') $query = "SELECT * FROM metar WHERE metar_location = :icao AND metar_date >= DATE_SUB(UTC_TIMESTAMP(), INTERVAL 10 HOUR) LIMIT 1"; |
|
268 | - else $query = "SELECT * FROM metar WHERE metar_location = :icao AND metar_date >= now() AT TIMEZONE 'UTC' - '10 HOUR'->INTERVAL LIMIT 0,1"; |
|
300 | + if ($globalDBdriver == 'mysql') { |
|
301 | + $query = "SELECT * FROM metar WHERE metar_location = :icao AND metar_date >= DATE_SUB(UTC_TIMESTAMP(), INTERVAL 10 HOUR) LIMIT 1"; |
|
302 | + } else { |
|
303 | + $query = "SELECT * FROM metar WHERE metar_location = :icao AND metar_date >= now() AT TIMEZONE 'UTC' - '10 HOUR'->INTERVAL LIMIT 0,1"; |
|
304 | + } |
|
269 | 305 | } |
270 | 306 | $query_values = array(':icao' => $icao); |
271 | 307 | try { |
@@ -321,7 +357,9 @@ discard block |
||
321 | 357 | |
322 | 358 | public function addMETARCycle() { |
323 | 359 | global $globalDebug, $globalIVAO, $globalTransaction; |
324 | - if (isset($globalDebug) && $globalDebug) echo "Downloading METAR cycle..."; |
|
360 | + if (isset($globalDebug) && $globalDebug) { |
|
361 | + echo "Downloading METAR cycle..."; |
|
362 | + } |
|
325 | 363 | date_default_timezone_set("UTC"); |
326 | 364 | $Common = new Common(); |
327 | 365 | if (isset($globalIVAO) && $globalIVAO) { |
@@ -332,31 +370,47 @@ discard block |
||
332 | 370 | $handle = fopen(dirname(__FILE__).'/../install/tmp/'.date('H').'Z.TXT',"r"); |
333 | 371 | } |
334 | 372 | if ($handle) { |
335 | - if (isset($globalDebug) && $globalDebug) echo "Done - Updating DB..."; |
|
373 | + if (isset($globalDebug) && $globalDebug) { |
|
374 | + echo "Done - Updating DB..."; |
|
375 | + } |
|
336 | 376 | $date = ''; |
337 | - if ($globalTransaction) $this->db->beginTransaction(); |
|
377 | + if ($globalTransaction) { |
|
378 | + $this->db->beginTransaction(); |
|
379 | + } |
|
338 | 380 | while(($line = fgets($handle,4096)) !== false) { |
339 | 381 | if (preg_match('#^([0-9]{4})/([0-9]{2})/([0-9]{2}) ([0-9]{2}):([0-9]{2})$#',$line)) { |
340 | 382 | $date = $line; |
341 | 383 | } elseif ($line != '') { |
342 | - if ($date == '') $date = date('Y/m/d H:m'); |
|
384 | + if ($date == '') { |
|
385 | + $date = date('Y/m/d H:m'); |
|
386 | + } |
|
343 | 387 | $pos = 0; |
344 | 388 | $pieces = preg_split('/\s/',$line); |
345 | - if ($pieces[0] == 'METAR') $pos++; |
|
346 | - if (strlen($pieces[$pos]) != 4) $pos++; |
|
389 | + if ($pieces[0] == 'METAR') { |
|
390 | + $pos++; |
|
391 | + } |
|
392 | + if (strlen($pieces[$pos]) != 4) { |
|
393 | + $pos++; |
|
394 | + } |
|
347 | 395 | $location = $pieces[$pos]; |
348 | 396 | echo $this->addMETAR($location,$line,$date); |
349 | 397 | } |
350 | 398 | } |
351 | 399 | fclose($handle); |
352 | - if ($globalTransaction) $this->db->commit(); |
|
400 | + if ($globalTransaction) { |
|
401 | + $this->db->commit(); |
|
402 | + } |
|
403 | + } |
|
404 | + if (isset($globalDebug) && $globalDebug) { |
|
405 | + echo "Done\n"; |
|
353 | 406 | } |
354 | - if (isset($globalDebug) && $globalDebug) echo "Done\n"; |
|
355 | 407 | } |
356 | 408 | |
357 | 409 | public function downloadMETAR($icao) { |
358 | 410 | global $globalMETARurl; |
359 | - if ($globalMETARurl == '') return array(); |
|
411 | + if ($globalMETARurl == '') { |
|
412 | + return array(); |
|
413 | + } |
|
360 | 414 | date_default_timezone_set("UTC"); |
361 | 415 | $Common = new Common(); |
362 | 416 | $url = str_replace('{icao}',$icao,$globalMETARurl); |
@@ -367,16 +421,24 @@ discard block |
||
367 | 421 | $date = $line; |
368 | 422 | } |
369 | 423 | if ($line != '') { |
370 | - if ($date == '') $date = date('Y/m/d H:m'); |
|
424 | + if ($date == '') { |
|
425 | + $date = date('Y/m/d H:m'); |
|
426 | + } |
|
371 | 427 | $pos = 0; |
372 | 428 | $pieces = preg_split('/\s/',$line); |
373 | - if ($pieces[0] == 'METAR') $pos++; |
|
374 | - if (strlen($pieces[$pos]) != 4) $pos++; |
|
429 | + if ($pieces[0] == 'METAR') { |
|
430 | + $pos++; |
|
431 | + } |
|
432 | + if (strlen($pieces[$pos]) != 4) { |
|
433 | + $pos++; |
|
434 | + } |
|
375 | 435 | $location = $pieces[$pos]; |
376 | 436 | if (strlen($location == 4)) { |
377 | 437 | $this->addMETAR($location,$line,$date); |
378 | 438 | return array('0' => array('metar_date' => $date, 'metar_location' => $location, 'metar' => $line)); |
379 | - } else return array(); |
|
439 | + } else { |
|
440 | + return array(); |
|
441 | + } |
|
380 | 442 | } |
381 | 443 | } |
382 | 444 | return array(); |
@@ -48,7 +48,9 @@ discard block |
||
48 | 48 | $all_data = $SpotterArchive->getAltitudeSpeedArchiveSpotterDataById($spotter_array[0]['flightaware_id']); |
49 | 49 | if (isset($globalTimezone)) { |
50 | 50 | date_default_timezone_set($globalTimezone); |
51 | - } else date_default_timezone_set('UTC'); |
|
51 | + } else { |
|
52 | + date_default_timezone_set('UTC'); |
|
53 | + } |
|
52 | 54 | |
53 | 55 | if (is_array($all_data) && count($all_data) > 1) { |
54 | 56 | print '<br/>'; |
@@ -327,9 +329,13 @@ discard block |
||
327 | 329 | print '<div>'; |
328 | 330 | if (isset($spotter_item['pilot_id']) && $spotter_item['pilot_id'] != "") |
329 | 331 | { |
330 | - if ($spotter_item['format_source'] == 'whazzup') print '<a href="https://www.ivao.aero/Member.aspx?ID='.$spotter_item['pilot_id'].'">'.$spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')</a>'; |
|
331 | - elseif ($spotter_item['format_source'] == 'vatsimtxt') print '<a href="http://www.vataware.com/pilot/'.$spotter_item['pilot_id'].'">'.$spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')</a>'; |
|
332 | - else print $spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')'; |
|
332 | + if ($spotter_item['format_source'] == 'whazzup') { |
|
333 | + print '<a href="https://www.ivao.aero/Member.aspx?ID='.$spotter_item['pilot_id'].'">'.$spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')</a>'; |
|
334 | + } elseif ($spotter_item['format_source'] == 'vatsimtxt') { |
|
335 | + print '<a href="http://www.vataware.com/pilot/'.$spotter_item['pilot_id'].'">'.$spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')</a>'; |
|
336 | + } else { |
|
337 | + print $spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')'; |
|
338 | + } |
|
333 | 339 | } else { |
334 | 340 | if (isset($spotter_item['pilot_name']) && $spotter_item['pilot_name'] != "") |
335 | 341 | { |
@@ -118,8 +118,12 @@ discard block |
||
118 | 118 | { |
119 | 119 | $title = sprintf(_("Detailed View for %s"),$spotter_array[0]['ident']); |
120 | 120 | $ident = $spotter_array[0]['ident']; |
121 | - if (isset($spotter_array[0]['latitude'])) $latitude = $spotter_array[0]['latitude']; |
|
122 | - if (isset($spotter_array[0]['longitude'])) $longitude = $spotter_array[0]['longitude']; |
|
121 | + if (isset($spotter_array[0]['latitude'])) { |
|
122 | + $latitude = $spotter_array[0]['latitude']; |
|
123 | + } |
|
124 | + if (isset($spotter_array[0]['longitude'])) { |
|
125 | + $longitude = $spotter_array[0]['longitude']; |
|
126 | + } |
|
123 | 127 | require_once('header.php'); |
124 | 128 | if (isset($globalArchive) && $globalArchive && $type == 'aircraft') { |
125 | 129 | // Requirement for altitude graph |
@@ -127,7 +131,9 @@ discard block |
||
127 | 131 | $all_data = $SpotterArchive->getAltitudeSpeedArchiveSpotterDataById($spotter_array[0]['flightaware_id']); |
128 | 132 | if (isset($globalTimezone)) { |
129 | 133 | date_default_timezone_set($globalTimezone); |
130 | - } else date_default_timezone_set('UTC'); |
|
134 | + } else { |
|
135 | + date_default_timezone_set('UTC'); |
|
136 | + } |
|
131 | 137 | if (is_array($all_data) && count($all_data) > 1) { |
132 | 138 | print '<link href="'.$globalURL.'/css/c3.min.css" rel="stylesheet" type="text/css">'; |
133 | 139 | print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>'; |
@@ -204,14 +210,22 @@ discard block |
||
204 | 210 | if (isset($spotter_array[0]['airline_icao'])) { |
205 | 211 | print '<div><span class="label">'._("Airline").'</span><a href="'.$globalURL.'/airline/'.$spotter_array[0]['airline_icao'].'">'.$spotter_array[0]['airline_name'].'</a></div>'; |
206 | 212 | } |
207 | - if ($type == 'aircraft') print '<div><span class="label">'._("Flight History").'</span><a href="http://flightaware.com/live/flight/'.$spotter_array[0]['ident'].'" target="_blank">'._("View the Flight History of this callsign").'</a></div>'; |
|
213 | + if ($type == 'aircraft') { |
|
214 | + print '<div><span class="label">'._("Flight History").'</span><a href="http://flightaware.com/live/flight/'.$spotter_array[0]['ident'].'" target="_blank">'._("View the Flight History of this callsign").'</a></div>'; |
|
215 | + } |
|
208 | 216 | print '</div>'; |
209 | 217 | |
210 | - if ($type == 'aircraft') include('ident-sub-menu.php'); |
|
218 | + if ($type == 'aircraft') { |
|
219 | + include('ident-sub-menu.php'); |
|
220 | + } |
|
211 | 221 | print '<div class="table column">'; |
212 | - if ($type == 'aircraft') print '<p>'.sprintf(_("The table below shows the detailed information of all flights with the ident/callsign of <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>'; |
|
213 | - elseif ($type == 'marine') print '<p>'.sprintf(_("The table below shows the detailed information of all vessels with the ident/callsign of <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>'; |
|
214 | - elseif ($type == 'tracker') print '<p>'.sprintf(_("The table below shows the detailed information of all trackers with the ident/callsign of <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>'; |
|
222 | + if ($type == 'aircraft') { |
|
223 | + print '<p>'.sprintf(_("The table below shows the detailed information of all flights with the ident/callsign of <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>'; |
|
224 | + } elseif ($type == 'marine') { |
|
225 | + print '<p>'.sprintf(_("The table below shows the detailed information of all vessels with the ident/callsign of <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>'; |
|
226 | + } elseif ($type == 'tracker') { |
|
227 | + print '<p>'.sprintf(_("The table below shows the detailed information of all trackers with the ident/callsign of <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>'; |
|
228 | + } |
|
215 | 229 | |
216 | 230 | include('table-output.php'); |
217 | 231 | print '<div class="pagination">'; |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | $limit_start = 0; |
16 | 16 | $limit_end = 25; |
17 | 17 | $absolute_difference = 25; |
18 | - } else { |
|
18 | + } else { |
|
19 | 19 | $limit_explode = explode(",", $_GET['limit']); |
20 | 20 | $limit_start = $limit_explode[0]; |
21 | 21 | $limit_end = $limit_explode[1]; |
@@ -47,7 +47,9 @@ discard block |
||
47 | 47 | $METAR = new METAR(); |
48 | 48 | $metar_info = $METAR->getMETAR($airport_icao); |
49 | 49 | //print_r($metar_info); |
50 | - if (isset($metar_info[0]['metar'])) $metar_parse = $METAR->parse($metar_info[0]['metar']); |
|
50 | + if (isset($metar_info[0]['metar'])) { |
|
51 | + $metar_parse = $METAR->parse($metar_info[0]['metar']); |
|
52 | + } |
|
51 | 53 | //print_r($metar_parse); |
52 | 54 | } |
53 | 55 | |
@@ -61,7 +63,9 @@ discard block |
||
61 | 63 | print '<option></option>'; |
62 | 64 | $Stats = new Stats(); |
63 | 65 | $airport_names = $Stats->getAllAirportNames(); |
64 | - if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames(); |
|
66 | + if (empty($airport_names)) { |
|
67 | + $airport_names = $Spotter->getAllAirportNames(); |
|
68 | + } |
|
65 | 69 | ksort($airport_names); |
66 | 70 | foreach($airport_names as $airport_name) |
67 | 71 | { |
@@ -102,7 +106,9 @@ discard block |
||
102 | 106 | // Use spotter also |
103 | 107 | if (isset($globalTimezone)) { |
104 | 108 | date_default_timezone_set($globalTimezone); |
105 | - } else date_default_timezone_set('UTC'); |
|
109 | + } else { |
|
110 | + date_default_timezone_set('UTC'); |
|
111 | + } |
|
106 | 112 | if (count($all_data) > 0) { |
107 | 113 | print '<link href="'.$globalURL.'/css/c3.min.css" rel="stylesheet" type="text/css">'; |
108 | 114 | print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>'; |
@@ -45,15 +45,18 @@ |
||
45 | 45 | $output .= '"city": "'.$spotter_item['city'].'",'; |
46 | 46 | $output .= '"country": "'.$spotter_item['country'].'",'; |
47 | 47 | $output .= '"altitude": "'.$spotter_item['altitude'].'",'; |
48 | - if ($spotter_item['name'] != '' && $spotter_item['city'] != '' && $spotter_item['country'] != '') |
|
49 | - $output .= '"popupContent": "'.$spotter_item['name'].' : '.$spotter_item['city'].', '.$spotter_item['country'].'",'; |
|
50 | - elseif ($spotter_item['location_id'] != '') |
|
51 | - $output .= '"popupContent": "'.$spotter_item['location_id'].'",'; |
|
48 | + if ($spotter_item['name'] != '' && $spotter_item['city'] != '' && $spotter_item['country'] != '') { |
|
49 | + $output .= '"popupContent": "'.$spotter_item['name'].' : '.$spotter_item['city'].', '.$spotter_item['country'].'",'; |
|
50 | + } elseif ($spotter_item['location_id'] != '') { |
|
51 | + $output .= '"popupContent": "'.$spotter_item['location_id'].'",'; |
|
52 | + } |
|
52 | 53 | $output .= '"icon": "'.$globalURL.'/images/'.$spotter_item['logo'].'",'; |
53 | 54 | $output .= '"type": "'.$spotter_item['type'].'",'; |
54 | 55 | if ($spotter_item['type'] == 'wx') { |
55 | 56 | $weather = json_decode($spotter_item['description'],true); |
56 | - if (isset($weather['temp'])) $output.= '"temp": "'.$weather['temp'].'",'; |
|
57 | + if (isset($weather['temp'])) { |
|
58 | + $output.= '"temp": "'.$weather['temp'].'",'; |
|
59 | + } |
|
57 | 60 | } |
58 | 61 | $output .= '"image_thumb": "'.$spotter_item['image_thumb'].'"'; |
59 | 62 | $output .= '},'; |
@@ -8,8 +8,12 @@ discard block |
||
8 | 8 | } |
9 | 9 | $tracker = false; |
10 | 10 | $marine = false; |
11 | -if (isset($_GET['tracker'])) $tracker = true; |
|
12 | -if (isset($_GET['marine'])) $marine = true; |
|
11 | +if (isset($_GET['tracker'])) { |
|
12 | + $tracker = true; |
|
13 | +} |
|
14 | +if (isset($_GET['marine'])) { |
|
15 | + $marine = true; |
|
16 | +} |
|
13 | 17 | if ($tracker) { |
14 | 18 | require_once('require/class.Tracker.php'); |
15 | 19 | require_once('require/class.TrackerLive.php'); |
@@ -66,23 +70,46 @@ discard block |
||
66 | 70 | } |
67 | 71 | header('Content-Type: text/javascript'); |
68 | 72 | |
69 | -if (!isset($globalJsonCompress)) $compress = true; |
|
70 | -else $compress = $globalJsonCompress; |
|
73 | +if (!isset($globalJsonCompress)) { |
|
74 | + $compress = true; |
|
75 | +} else { |
|
76 | + $compress = $globalJsonCompress; |
|
77 | +} |
|
71 | 78 | |
72 | 79 | $from_archive = false; |
73 | 80 | $min = false; |
74 | 81 | $allhistory = false; |
75 | 82 | $filter['source'] = array(); |
76 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
77 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
78 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
79 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs')); |
|
80 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
81 | -if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
82 | -if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
83 | -if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
84 | -if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
85 | -if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING); |
|
83 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') { |
|
84 | + $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
85 | +} |
|
86 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') { |
|
87 | + $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
88 | +} |
|
89 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') { |
|
90 | + $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
91 | +} |
|
92 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') { |
|
93 | + $filter['source'] = array_merge($filter['source'],array('sbs','famaprs')); |
|
94 | +} |
|
95 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') { |
|
96 | + $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
97 | +} |
|
98 | +if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') { |
|
99 | + $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
100 | +} |
|
101 | +if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') { |
|
102 | + $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
103 | +} |
|
104 | +if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') { |
|
105 | + $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
106 | +} |
|
107 | +if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') { |
|
108 | + $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
109 | +} |
|
110 | +if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') { |
|
111 | + $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING); |
|
112 | +} |
|
86 | 113 | /* |
87 | 114 | if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) { |
88 | 115 | $min = true; |
@@ -167,8 +194,12 @@ discard block |
||
167 | 194 | } else { |
168 | 195 | $flightcnt = $SpotterLive->getLiveSpotterCount($filter); |
169 | 196 | } |
170 | - if ($flightcnt == '') $flightcnt = 0; |
|
171 | -} else $flightcnt = 0; |
|
197 | + if ($flightcnt == '') { |
|
198 | + $flightcnt = 0; |
|
199 | + } |
|
200 | + } else { |
|
201 | + $flightcnt = 0; |
|
202 | +} |
|
172 | 203 | |
173 | 204 | $sqltime = round(microtime(true)-$begintime,2); |
174 | 205 | $minitime = time(); |
@@ -191,7 +222,9 @@ discard block |
||
191 | 222 | $j = 0; |
192 | 223 | $prev_flightaware_id = ''; |
193 | 224 | $speed = 1; |
194 | -if (isset($archivespeed)) $speed = $archivespeed; |
|
225 | +if (isset($archivespeed)) { |
|
226 | + $speed = $archivespeed; |
|
227 | +} |
|
195 | 228 | $output = '['; |
196 | 229 | if ($tracker) { |
197 | 230 | $output .= '{"id" : "document", "name" : "tracker","version" : "1.0"'; |
@@ -226,9 +259,13 @@ discard block |
||
226 | 259 | $image = "images/placeholder_thumb.png"; |
227 | 260 | } |
228 | 261 | |
229 | - if (isset($spotter_item['flightaware_id'])) $id = $spotter_item['flightaware_id']; |
|
230 | - elseif (isset($spotter_item['famtrackid'])) $id = $spotter_item['famtrackid']; |
|
231 | - elseif (isset($spotter_item['fammarine_id'])) $id = $spotter_item['fammarine_id']; |
|
262 | + if (isset($spotter_item['flightaware_id'])) { |
|
263 | + $id = $spotter_item['flightaware_id']; |
|
264 | + } elseif (isset($spotter_item['famtrackid'])) { |
|
265 | + $id = $spotter_item['famtrackid']; |
|
266 | + } elseif (isset($spotter_item['fammarine_id'])) { |
|
267 | + $id = $spotter_item['fammarine_id']; |
|
268 | + } |
|
232 | 269 | if ($prev_flightaware_id != $id) { |
233 | 270 | if ($prev_flightaware_id != '') { |
234 | 271 | $output .= ']'; |
@@ -270,7 +307,9 @@ discard block |
||
270 | 307 | $spotter_item['engine_type'] = $aircraft_info[0]['engine_type']; |
271 | 308 | $spotter_item['wake_category'] = $aircraft_info[0]['wake_category']; |
272 | 309 | $spotter_item['engine_count'] = $aircraft_info[0]['engine_count']; |
273 | - } else $aircraft_shadow = ''; |
|
310 | + } else { |
|
311 | + $aircraft_shadow = ''; |
|
312 | + } |
|
274 | 313 | $output .= ' "billboard" : {"image" : "'.$globalURL.'/images/aircrafts/new/'.$aircraft_shadow.'","scale" : 0.5'; |
275 | 314 | if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] && isset($_COOKIE['IconColor'])) { |
276 | 315 | $rgb = $Common->hex2rgb($_COOKIE['IconColor']); |
@@ -278,7 +317,9 @@ discard block |
||
278 | 317 | } |
279 | 318 | $output .= '},'; |
280 | 319 | } |
281 | - } else $output .= ' "billboard" : {"image" : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAfCAYAAACVgY94AAAACXBIWXMAAC4jAAAuIwF4pT92AAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrI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jgTGFvhteV40EgPrgvTP7qlmZqFnl9WD+b2posN83E/NrEkOjlI/U1fkfUYa/pe5IE3qZPW8jFOqiyN7p3pAPX04c7AxYSoDDcAjKT2LgLXA6IR2M3Bviv59wDTgQGTPH84Qd8+HXfHcoUws2zM0HMjuUPep+xP2PWpnwtw0GJsldbBpewQwE/gbeDyt7H1gcW53O7AC+A3Yn6+/W+Ld9SnWA15DAVhc8xK2TuA9YHrCuhV4EngFuBx4YagG6qv8cF+T52kB2Zy+e1I8taUacNV+uBdXO7ABmJwJpwx8XQvF9TUCWM64tiQhbq/oMv+7BwFWpQzNT8vbVQul/wwAGzzdmXU1xuUAAAAASUVORK5CYII=","scale" : 0.5},'; |
|
320 | + } else { |
|
321 | + $output .= ' "billboard" : {"image" : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAfCAYAAACVgY94AAAACXBIWXMAAC4jAAAuIwF4pT92AAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIP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CYII=","scale" : 0.5},'; |
|
322 | + } |
|
282 | 323 | } elseif ($one3dmodel) { |
283 | 324 | if (isset($globalMap3DForceModel) && $globalMap3DForceModel != '') { |
284 | 325 | $output .= '"model": {"gltf" : "'.$globalURL.'/models/'.$globalMap3DForceModel.'","scale" : 1.0,"minimumPixelSize": 20'; |
@@ -309,7 +350,9 @@ discard block |
||
309 | 350 | $spotter_item['engine_type'] = $aircraft_info[0]['engine_type']; |
310 | 351 | $spotter_item['wake_category'] = $aircraft_info[0]['wake_category']; |
311 | 352 | $spotter_item['engine_count'] = $aircraft_info[0]['engine_count']; |
312 | - } else $aircraft_shadow = ''; |
|
353 | + } else { |
|
354 | + $aircraft_shadow = ''; |
|
355 | + } |
|
313 | 356 | if ($aircraft_shadow != '') { |
314 | 357 | if (isset($modelsdb[$aircraft_shadow])) { |
315 | 358 | $output .= '"model": {"gltf" : "'.$globalURL.'/models/'.$modelsdb[$aircraft_shadow].'","scale" : 1.0,"minimumPixelSize": 20'; |
@@ -446,7 +489,9 @@ discard block |
||
446 | 489 | } |
447 | 490 | $output .= '},'; |
448 | 491 | //if ($spotter_item['aircraft_shadow'] != '') $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",'; |
449 | - if ($spotter_item['aircraft_icao'] != '') $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
492 | + if ($spotter_item['aircraft_icao'] != '') { |
|
493 | + $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
494 | + } |
|
450 | 495 | $modelsdb[$aircraft_icao] = 'Cesium_Air.glb'; |
451 | 496 | } |
452 | 497 | } elseif (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'aprs') { |
@@ -468,7 +513,9 @@ discard block |
||
468 | 513 | } |
469 | 514 | $output .= '},'; |
470 | 515 | //if ($spotter_item['aircraft_shadow'] != '') $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",'; |
471 | - if ($spotter_item['aircraft_icao'] != '') $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
516 | + if ($spotter_item['aircraft_icao'] != '') { |
|
517 | + $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
518 | + } |
|
472 | 519 | $modelsdb[$aircraft_icao] = 'Cesium_Air.glb'; |
473 | 520 | } |
474 | 521 | } else { |
@@ -481,7 +528,9 @@ discard block |
||
481 | 528 | } |
482 | 529 | $output .= '},'; |
483 | 530 | //if ($spotter_item['aircraft_shadow'] != '') $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",'; |
484 | - if ($spotter_item['aircraft_icao'] != '') $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
531 | + if ($spotter_item['aircraft_icao'] != '') { |
|
532 | + $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
533 | + } |
|
485 | 534 | $modelsdb[$aircraft_icao] = 'Cesium_Air.glb'; |
486 | 535 | } |
487 | 536 | } elseif ($tracker && isset($spotter_item['type'])) { |
@@ -585,8 +634,11 @@ discard block |
||
585 | 634 | $output .= '},'; |
586 | 635 | } |
587 | 636 | } |
588 | - if ($onground) $output = str_replace('%onground%','true',$output); |
|
589 | - else $output = str_replace('%onground%','false',$output); |
|
637 | + if ($onground) { |
|
638 | + $output = str_replace('%onground%','true',$output); |
|
639 | + } else { |
|
640 | + $output = str_replace('%onground%','false',$output); |
|
641 | + } |
|
590 | 642 | |
591 | 643 | // $output .= '"heightReference": "CLAMP_TO_GROUND",'; |
592 | 644 | //$output .= '"heightReference": "'.$heightrelative.'",'; |
@@ -599,8 +651,12 @@ discard block |
||
599 | 651 | // $output .= '"interpolationDegree" : 5,'; |
600 | 652 | // $output .= '"epoch" : "'.date("c",strtotime($spotter_item['date'])).'", '; |
601 | 653 | $output .= '"cartographicDegrees": ['; |
602 | - if ($minitime > strtotime($spotter_item['date'])) $minitime = strtotime($spotter_item['date']); |
|
603 | - if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']); |
|
654 | + if ($minitime > strtotime($spotter_item['date'])) { |
|
655 | + $minitime = strtotime($spotter_item['date']); |
|
656 | + } |
|
657 | + if ($maxitime < strtotime($spotter_item['date'])) { |
|
658 | + $maxitime = strtotime($spotter_item['date']); |
|
659 | + } |
|
604 | 660 | $output .= '"'.date("c",strtotime($spotter_item['date'])).'", '; |
605 | 661 | $output .= $spotter_item['longitude'].', '; |
606 | 662 | $output .= $spotter_item['latitude']; |
@@ -623,20 +679,27 @@ discard block |
||
623 | 679 | $output .= ', '.round($spotter_item['altitude']*30.48); |
624 | 680 | $prevalt = round($spotter_item['altitude']*30.48); |
625 | 681 | } |
626 | - } else $output .= ', 0'; |
|
682 | + } else { |
|
683 | + $output .= ', 0'; |
|
684 | + } |
|
627 | 685 | //$orientation = '"orientation" : { '; |
628 | 686 | //$orientation .= '"unitQuaternion": ['; |
629 | 687 | //$quat = quaternionrotate(deg2rad($spotter_item['heading']),deg2rad(0),deg2rad(0)); |
630 | 688 | //$orientation .= '"'.date("c",strtotime($spotter_item['date'])).'",'.$quat['x'].','.$quat['y'].','.$quat['z'].','.$quat['w']; |
631 | 689 | } else { |
632 | 690 | $output .= ',"'.date("c",strtotime($spotter_item['date'])).'", '; |
633 | - if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']); |
|
691 | + if ($maxitime < strtotime($spotter_item['date'])) { |
|
692 | + $maxitime = strtotime($spotter_item['date']); |
|
693 | + } |
|
634 | 694 | if ($spotter_item['ground_speed'] == 0) { |
635 | 695 | $output .= $prevlong.', '; |
636 | 696 | $output .= $prevlat; |
637 | 697 | //if (!$marine && (!isset($onground) || !$onground)) $output .= ', '.$prevalt; |
638 | - if (!$marine) $output .= ', '.$prevalt; |
|
639 | - else $output .= ', 0'; |
|
698 | + if (!$marine) { |
|
699 | + $output .= ', '.$prevalt; |
|
700 | + } else { |
|
701 | + $output .= ', 0'; |
|
702 | + } |
|
640 | 703 | } else { |
641 | 704 | $output .= $spotter_item['longitude'].', '; |
642 | 705 | $output .= $spotter_item['latitude']; |
@@ -649,14 +712,17 @@ discard block |
||
649 | 712 | $output .= ', 0'; |
650 | 713 | } |
651 | 714 | } else { |
652 | - if (isset($spotter_item['real_altitude']) && $spotter_item['real_altitude'] != '') $output .= ', '.round($spotter_item['real_altitude']*0.3048); |
|
653 | - elseif ($tracker) { |
|
715 | + if (isset($spotter_item['real_altitude']) && $spotter_item['real_altitude'] != '') { |
|
716 | + $output .= ', '.round($spotter_item['real_altitude']*0.3048); |
|
717 | + } elseif ($tracker) { |
|
654 | 718 | $output .= ', '.round($spotter_item['altitude']*0.3048); |
655 | 719 | } else { |
656 | 720 | $output .= ', '.round($spotter_item['altitude']*30.48); |
657 | 721 | } |
658 | 722 | } |
659 | - } else $output .= ', 0'; |
|
723 | + } else { |
|
724 | + $output .= ', 0'; |
|
725 | + } |
|
660 | 726 | } |
661 | 727 | //$quat = quaternionrotate(deg2rad($spotter_item['heading']),deg2rad(0),deg2rad(0)); |
662 | 728 | //$orientation .= ',"'.date("c",strtotime($spotter_item['date'])).'",'.$quat['x'].','.$quat['y'].','.$quat['z'].','.$quat['w']; |
@@ -675,9 +741,12 @@ discard block |
||
675 | 741 | } else { |
676 | 742 | $output = str_replace('%minitime%',date("c",time()-$globalLiveInterval),$output); |
677 | 743 | } |
744 | + } else { |
|
745 | + $output = str_replace('%minitime%',date("c",$minitime),$output); |
|
678 | 746 | } |
679 | - else $output = str_replace('%minitime%',date("c",$minitime),$output); |
|
680 | -} else $output = str_replace('%minitime%',date("c",$minitime),$output); |
|
747 | + } else { |
|
748 | + $output = str_replace('%minitime%',date("c",$minitime),$output); |
|
749 | +} |
|
681 | 750 | $output = str_replace('%maxitime%',date("c",$maxitime),$output); |
682 | 751 | print $output; |
683 | 752 | ?> |