@@ -5,23 +5,23 @@ discard block |
||
5 | 5 | $marine = false; |
6 | 6 | $usecoord = false; |
7 | 7 | if (isset($_GET['tracker'])) { |
8 | - $tracker = true; |
|
8 | + $tracker = true; |
|
9 | 9 | } |
10 | 10 | if (isset($_GET['marine'])) { |
11 | - $marine = true; |
|
11 | + $marine = true; |
|
12 | 12 | } |
13 | 13 | if ($tracker) { |
14 | - require_once('require/class.Tracker.php'); |
|
15 | - require_once('require/class.TrackerLive.php'); |
|
16 | - require_once('require/class.TrackerArchive.php'); |
|
14 | + require_once('require/class.Tracker.php'); |
|
15 | + require_once('require/class.TrackerLive.php'); |
|
16 | + require_once('require/class.TrackerArchive.php'); |
|
17 | 17 | } elseif ($marine) { |
18 | - require_once('require/class.Marine.php'); |
|
19 | - require_once('require/class.MarineLive.php'); |
|
20 | - require_once('require/class.MarineArchive.php'); |
|
18 | + require_once('require/class.Marine.php'); |
|
19 | + require_once('require/class.MarineLive.php'); |
|
20 | + require_once('require/class.MarineArchive.php'); |
|
21 | 21 | } else { |
22 | - require_once('require/class.Spotter.php'); |
|
23 | - require_once('require/class.SpotterLive.php'); |
|
24 | - require_once('require/class.SpotterArchive.php'); |
|
22 | + require_once('require/class.Spotter.php'); |
|
23 | + require_once('require/class.SpotterLive.php'); |
|
24 | + require_once('require/class.SpotterArchive.php'); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | $begintime = microtime(true); |
@@ -41,10 +41,10 @@ discard block |
||
41 | 41 | $Common = new Common(); |
42 | 42 | |
43 | 43 | if (isset($_GET['download'])) { |
44 | - if ($_GET['download'] == "true") |
|
45 | - { |
|
44 | + if ($_GET['download'] == "true") |
|
45 | + { |
|
46 | 46 | header('Content-disposition: attachment; filename="flightairmap.json"'); |
47 | - } |
|
47 | + } |
|
48 | 48 | } |
49 | 49 | header('Content-Type: text/javascript'); |
50 | 50 | |
@@ -498,17 +498,17 @@ discard block |
||
498 | 498 | if ($history == '' && isset($_COOKIE['history'])) $history = $_COOKIE['history']; |
499 | 499 | |
500 | 500 | if ( |
501 | - (isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') |
|
502 | - || ((isset($globalMapHistory) && $globalMapHistory) || $allhistory) |
|
501 | + (isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') |
|
502 | + || ((isset($globalMapHistory) && $globalMapHistory) || $allhistory) |
|
503 | 503 | // || (isset($history) && $history != '' && $history != 'NA' && ($history == $spotter_item['ident'] || $history == $spotter_item['flightaware_id'])) |
504 | 504 | // || (isset($history) && $history != '' && $history != 'NA' && $history == $spotter_item['ident']) |
505 | - || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
|
506 | - || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']) |
|
507 | - || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['fammarine_id'])) |
|
508 | - || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['fammarine_id']) && $_GET['fammarine_id'] == $spotter_item['fammarine_id']) |
|
509 | - || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['famtrackid'])) |
|
510 | - || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['famtrackid']) && $_GET['famtrackid'] == $spotter_item['famtrackid']) |
|
511 | - ) { |
|
505 | + || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
|
506 | + || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']) |
|
507 | + || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['fammarine_id'])) |
|
508 | + || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['fammarine_id']) && $_GET['fammarine_id'] == $spotter_item['fammarine_id']) |
|
509 | + || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['famtrackid'])) |
|
510 | + || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['famtrackid']) && $_GET['famtrackid'] == $spotter_item['famtrackid']) |
|
511 | + ) { |
|
512 | 512 | if ($tracker) { |
513 | 513 | if ($from_archive || $globalArchive) { |
514 | 514 | $spotter_history_array = $TrackerArchive->getAllArchiveTrackerDataById($spotter_item['famtrackid']); |
@@ -597,65 +597,65 @@ discard block |
||
597 | 597 | } |
598 | 598 | |
599 | 599 | if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
600 | - || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
|
601 | - && (isset($spotter_item['departure_airport']) |
|
602 | - && $spotter_item['departure_airport'] != 'NA' |
|
603 | - && isset($spotter_item['arrival_airport']) |
|
604 | - && $spotter_item['arrival_airport'] != 'NA' |
|
605 | - && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") |
|
606 | - || (!isset($_COOKIE['MapRoute']) && isset($globalMapRoute) && $globalMapRoute)))) { |
|
607 | - if ($compress) $output_air = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
608 | - else $output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
609 | - if (isset($spotter_item['departure_airport_latitude'])) { |
|
600 | + || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
|
601 | + && (isset($spotter_item['departure_airport']) |
|
602 | + && $spotter_item['departure_airport'] != 'NA' |
|
603 | + && isset($spotter_item['arrival_airport']) |
|
604 | + && $spotter_item['arrival_airport'] != 'NA' |
|
605 | + && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") |
|
606 | + || (!isset($_COOKIE['MapRoute']) && isset($globalMapRoute) && $globalMapRoute)))) { |
|
607 | + if ($compress) $output_air = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
608 | + else $output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
609 | + if (isset($spotter_item['departure_airport_latitude'])) { |
|
610 | 610 | $output_air .= '['.$spotter_item['departure_airport_longitude'].','.$spotter_item['departure_airport_latitude'].'],'; |
611 | - } elseif (isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA') { |
|
611 | + } elseif (isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA') { |
|
612 | 612 | $dairport = $Spotter->getAllAirportInfo($spotter_item['departure_airport']); |
613 | 613 | if (isset($dairport[0]['latitude'])) { |
614 | - $output_air .= '['.$dairport[0]['longitude'].','.$dairport[0]['latitude'].'],'; |
|
614 | + $output_air .= '['.$dairport[0]['longitude'].','.$dairport[0]['latitude'].'],'; |
|
615 | 615 | } |
616 | - } |
|
617 | - if (isset($spotter_item['arrival_airport_latitude'])) { |
|
616 | + } |
|
617 | + if (isset($spotter_item['arrival_airport_latitude'])) { |
|
618 | 618 | $output_air .= '['.$spotter_item['arrival_airport_longitude'].','.$spotter_item['arrival_airport_latitude'].'],'; |
619 | - } elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { |
|
619 | + } elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { |
|
620 | 620 | $aairport = $Spotter->getAllAirportInfo($spotter_item['arrival_airport']); |
621 | 621 | if (isset($aairport[0]['latitude'])) { |
622 | - $output_air .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].'],'; |
|
622 | + $output_air .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].'],'; |
|
623 | 623 | } |
624 | - } |
|
625 | - $output_air = substr($output_air, 0, -1); |
|
626 | - $output_air .= ']}},'; |
|
627 | - $output .= $output_air; |
|
628 | - unset($output_air); |
|
624 | + } |
|
625 | + $output_air = substr($output_air, 0, -1); |
|
626 | + $output_air .= ']}},'; |
|
627 | + $output .= $output_air; |
|
628 | + unset($output_air); |
|
629 | 629 | } |
630 | 630 | |
631 | 631 | //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))))) { |
632 | 632 | //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))))) { |
633 | 633 | if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
634 | - || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
|
635 | - && (isset($spotter_item['arrival_airport']) |
|
636 | - && $spotter_item['arrival_airport'] != 'NA' |
|
637 | - && ((isset($_COOKIE['MapRemainingRoute']) && $_COOKIE['MapRemainingRoute'] == "true") |
|
638 | - || (!isset($_COOKIE['MapRemainaingRoute']) && (!isset($globalMapRemainingRoute) |
|
639 | - || (isset($globalMapRemainingRoute) && $globalMapRemainingRoute)))))) { |
|
640 | - $havedata = false; |
|
641 | - if ($compress) $output_dest = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
642 | - else $output_dest = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
643 | - $output_dest .= '['.$spotter_item['longitude'].','.$spotter_item['latitude'].'],'; |
|
634 | + || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
|
635 | + && (isset($spotter_item['arrival_airport']) |
|
636 | + && $spotter_item['arrival_airport'] != 'NA' |
|
637 | + && ((isset($_COOKIE['MapRemainingRoute']) && $_COOKIE['MapRemainingRoute'] == "true") |
|
638 | + || (!isset($_COOKIE['MapRemainaingRoute']) && (!isset($globalMapRemainingRoute) |
|
639 | + || (isset($globalMapRemainingRoute) && $globalMapRemainingRoute)))))) { |
|
640 | + $havedata = false; |
|
641 | + if ($compress) $output_dest = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
642 | + else $output_dest = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
643 | + $output_dest .= '['.$spotter_item['longitude'].','.$spotter_item['latitude'].'],'; |
|
644 | 644 | |
645 | - if (isset($spotter_item['arrival_airport_latitude'])) { |
|
645 | + if (isset($spotter_item['arrival_airport_latitude'])) { |
|
646 | 646 | $output_dest .= '['.$spotter_item['arrival_airport_longitude'].','.$spotter_item['arrival_airport_latitude'].']'; |
647 | 647 | $havedata = true; |
648 | - } elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { |
|
648 | + } elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { |
|
649 | 649 | $aairport = $Spotter->getAllAirportInfo($spotter_item['arrival_airport']); |
650 | 650 | if (isset($aairport[0]['latitude'])) { |
651 | - $output_dest .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].']'; |
|
652 | - $havedata = true; |
|
651 | + $output_dest .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].']'; |
|
652 | + $havedata = true; |
|
653 | 653 | } |
654 | - } |
|
655 | - //$output_dest = substr($output_dest, 0, -1); |
|
656 | - $output_dest .= ']}},'; |
|
657 | - if ($havedata) $output .= $output_dest; |
|
658 | - unset($output_dest); |
|
654 | + } |
|
655 | + //$output_dest = substr($output_dest, 0, -1); |
|
656 | + $output_dest .= ']}},'; |
|
657 | + if ($havedata) $output .= $output_dest; |
|
658 | + unset($output_dest); |
|
659 | 659 | } |
660 | 660 | } |
661 | 661 | $output = substr($output, 0, -1); |
@@ -48,27 +48,52 @@ discard block |
||
48 | 48 | } |
49 | 49 | header('Content-Type: text/javascript'); |
50 | 50 | |
51 | -if (!isset($globalJsonCompress)) $compress = true; |
|
52 | -else $compress = $globalJsonCompress; |
|
51 | +if (!isset($globalJsonCompress)) { |
|
52 | + $compress = true; |
|
53 | +} else { |
|
54 | + $compress = $globalJsonCompress; |
|
55 | +} |
|
53 | 56 | |
54 | 57 | $from_archive = false; |
55 | 58 | $min = true; |
56 | 59 | $allhistory = false; |
57 | 60 | $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); |
|
61 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') { |
|
62 | + $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
63 | +} |
|
64 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') { |
|
65 | + $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
66 | +} |
|
67 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') { |
|
68 | + $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
69 | +} |
|
70 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') { |
|
71 | + $filter['source'] = array_merge($filter['source'],array('sbs','famaprs')); |
|
72 | +} |
|
73 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') { |
|
74 | + $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
75 | +} |
|
76 | +if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') { |
|
77 | + $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
78 | +} |
|
79 | +if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') { |
|
80 | + $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
81 | +} |
|
82 | +if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') { |
|
83 | + $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
84 | +} |
|
85 | +if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') { |
|
86 | + $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
87 | +} |
|
88 | +if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') { |
|
89 | + $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING); |
|
90 | +} |
|
68 | 91 | |
69 | 92 | if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) { |
70 | 93 | $min = true; |
71 | -} else $min = false; |
|
94 | +} else { |
|
95 | + $min = false; |
|
96 | +} |
|
72 | 97 | |
73 | 98 | if (isset($_GET['ident'])) { |
74 | 99 | $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
@@ -157,21 +182,33 @@ discard block |
||
157 | 182 | } else { |
158 | 183 | $flightcnt = $SpotterLive->getLiveSpotterCount($filter); |
159 | 184 | } |
160 | - } else $flightcnt = count($spotter_array); |
|
161 | - if ($flightcnt == '') $flightcnt = 0; |
|
162 | -} else $flightcnt = 0; |
|
185 | + } else { |
|
186 | + $flightcnt = count($spotter_array); |
|
187 | + } |
|
188 | + if ($flightcnt == '') { |
|
189 | + $flightcnt = 0; |
|
190 | + } |
|
191 | + } else { |
|
192 | + $flightcnt = 0; |
|
193 | +} |
|
163 | 194 | |
164 | 195 | $sqltime = round(microtime(true)-$begintime,2); |
165 | 196 | |
166 | -if ((!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation == FALSE) || (isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'false')) $usenextlatlon = false; |
|
167 | -else $usenextlatlon = true; |
|
197 | +if ((!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation == FALSE) || (isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'false')) { |
|
198 | + $usenextlatlon = false; |
|
199 | +} else { |
|
200 | + $usenextlatlon = true; |
|
201 | +} |
|
168 | 202 | $j = 0; |
169 | 203 | $prev_flightaware_id = ''; |
170 | 204 | $aircrafts_shadow = array(); |
171 | 205 | $output = '{'; |
172 | 206 | $output .= '"type": "FeatureCollection",'; |
173 | - if ($min) $output .= '"minimal": "true",'; |
|
174 | - else $output .= '"minimal": "false",'; |
|
207 | + if ($min) { |
|
208 | + $output .= '"minimal": "true",'; |
|
209 | + } else { |
|
210 | + $output .= '"minimal": "false",'; |
|
211 | + } |
|
175 | 212 | //$output .= '"fc": "'.$flightcnt.'",'; |
176 | 213 | $output .= '"sqt": "'.$sqltime.'",'; |
177 | 214 | |
@@ -215,18 +252,29 @@ discard block |
||
215 | 252 | } |
216 | 253 | $output .= '"properties": {'; |
217 | 254 | if (isset($spotter_item['flightaware_id'])) { |
218 | - if ($compress) $output .= '"fi": "'.$spotter_item['flightaware_id'].'",'; |
|
219 | - else $output .= '"flightaware_id": "'.$spotter_item['flightaware_id'].'",'; |
|
255 | + if ($compress) { |
|
256 | + $output .= '"fi": "'.$spotter_item['flightaware_id'].'",'; |
|
257 | + } else { |
|
258 | + $output .= '"flightaware_id": "'.$spotter_item['flightaware_id'].'",'; |
|
259 | + } |
|
220 | 260 | } elseif (isset($spotter_item['famtrackid'])) { |
221 | - if ($compress) $output .= '"fti": "'.$spotter_item['famtrackid'].'",'; |
|
222 | - else $output .= '"famtrackid": "'.$spotter_item['famtrackid'].'",'; |
|
261 | + if ($compress) { |
|
262 | + $output .= '"fti": "'.$spotter_item['famtrackid'].'",'; |
|
263 | + } else { |
|
264 | + $output .= '"famtrackid": "'.$spotter_item['famtrackid'].'",'; |
|
265 | + } |
|
223 | 266 | } elseif (isset($spotter_item['fammarine_id'])) { |
224 | - if ($compress) $output .= '"fmi": "'.$spotter_item['fammarine_id'].'",'; |
|
225 | - else $output .= '"fammarineid": "'.$spotter_item['fammarine_id'].'",'; |
|
267 | + if ($compress) { |
|
268 | + $output .= '"fmi": "'.$spotter_item['fammarine_id'].'",'; |
|
269 | + } else { |
|
270 | + $output .= '"fammarineid": "'.$spotter_item['fammarine_id'].'",'; |
|
271 | + } |
|
226 | 272 | } |
227 | 273 | $output .= '"fc": "'.$flightcnt.'",'; |
228 | 274 | $output .= '"sqt": "'.$sqltime.'",'; |
229 | - if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",'; |
|
275 | + if (isset($begindate)) { |
|
276 | + $output .= '"archive_date": "'.$begindate.'",'; |
|
277 | + } |
|
230 | 278 | |
231 | 279 | /* |
232 | 280 | if ($min) $output .= '"minimal": "true",'; |
@@ -234,14 +282,22 @@ discard block |
||
234 | 282 | */ |
235 | 283 | //$output .= '"fc": "'.$spotter_item['nb'].'",'; |
236 | 284 | if (isset($spotter_item['ident']) && $spotter_item['ident'] != '') { |
237 | - if ($compress) $output .= '"c": "'.str_replace('\\','',$spotter_item['ident']).'",'; |
|
238 | - else $output .= '"callsign": "'.str_replace('\\','',$spotter_item['ident']).'",'; |
|
285 | + if ($compress) { |
|
286 | + $output .= '"c": "'.str_replace('\\','',$spotter_item['ident']).'",'; |
|
287 | + } else { |
|
288 | + $output .= '"callsign": "'.str_replace('\\','',$spotter_item['ident']).'",'; |
|
289 | + } |
|
239 | 290 | //" |
240 | 291 | } else { |
241 | - if ($compress) $output .= '"c": "NA",'; |
|
242 | - else $output .= '"callsign": "NA",'; |
|
292 | + if ($compress) { |
|
293 | + $output .= '"c": "NA",'; |
|
294 | + } else { |
|
295 | + $output .= '"callsign": "NA",'; |
|
296 | + } |
|
297 | + } |
|
298 | + if (isset($spotter_item['registration'])) { |
|
299 | + $output .= '"registration": "'.$spotter_item['registration'].'",'; |
|
243 | 300 | } |
244 | - if (isset($spotter_item['registration'])) $output .= '"registration": "'.$spotter_item['registration'].'",'; |
|
245 | 301 | if (isset($spotter_item['aircraft_name']) && isset($spotter_item['aircraft_type'])) { |
246 | 302 | $output .= '"aircraft_name": "'.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')",'; |
247 | 303 | $output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ','_',$spotter_item['aircraft_name'])).'",'; |
@@ -254,16 +310,23 @@ discard block |
||
254 | 310 | $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
255 | 311 | } |
256 | 312 | if (!isset($spotter_item['aircraft_shadow']) && !$tracker) { |
257 | - if (!isset($spotter_item['aircraft_icao']) || $spotter_item['aircraft_icao'] == '') $spotter_item['aircraft_shadow'] = ''; |
|
258 | - else { |
|
313 | + if (!isset($spotter_item['aircraft_icao']) || $spotter_item['aircraft_icao'] == '') { |
|
314 | + $spotter_item['aircraft_shadow'] = ''; |
|
315 | + } else { |
|
259 | 316 | $aircraft_icao = $spotter_item['aircraft_icao']; |
260 | - if (isset($aircrafts_shadow[$aircraft_icao])) $spotter_item['aircraft_shadow'] = $aircrafts_shadow[$aircraft_icao]; |
|
261 | - else { |
|
317 | + if (isset($aircrafts_shadow[$aircraft_icao])) { |
|
318 | + $spotter_item['aircraft_shadow'] = $aircrafts_shadow[$aircraft_icao]; |
|
319 | + } else { |
|
262 | 320 | $aircraft_info = $Spotter->getAllAircraftInfo($spotter_item['aircraft_icao']); |
263 | - if (count($aircraft_info) > 0) $spotter_item['aircraft_shadow'] = $aircraft_info[0]['aircraft_shadow']; |
|
264 | - elseif (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'aprs') $spotter_item['aircraft_shadow'] = 'PA18.png'; |
|
265 | - elseif ($aircraft_icao == 'PARAGLIDER') $spotter_item['aircraft_shadow'] = 'PARAGLIDER.png'; |
|
266 | - else $spotter_item['aircraft_shadow'] = ''; |
|
321 | + if (count($aircraft_info) > 0) { |
|
322 | + $spotter_item['aircraft_shadow'] = $aircraft_info[0]['aircraft_shadow']; |
|
323 | + } elseif (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'aprs') { |
|
324 | + $spotter_item['aircraft_shadow'] = 'PA18.png'; |
|
325 | + } elseif ($aircraft_icao == 'PARAGLIDER') { |
|
326 | + $spotter_item['aircraft_shadow'] = 'PARAGLIDER.png'; |
|
327 | + } else { |
|
328 | + $spotter_item['aircraft_shadow'] = ''; |
|
329 | + } |
|
267 | 330 | $aircrafts_shadow[$aircraft_icao] = $spotter_item['aircraft_shadow']; |
268 | 331 | } |
269 | 332 | } |
@@ -271,73 +334,139 @@ discard block |
||
271 | 334 | if (!isset($spotter_item['aircraft_shadow']) || $spotter_item['aircraft_shadow'] == '') { |
272 | 335 | if ($tracker) { |
273 | 336 | if (isset($spotter_item['type']) && $spotter_item['type'] == 'Ambulance') { |
274 | - if ($compress) $output .= '"as": "ambulance.png",'; |
|
275 | - else $output .= '"aircraft_shadow": "ambulance.png",'; |
|
337 | + if ($compress) { |
|
338 | + $output .= '"as": "ambulance.png",'; |
|
339 | + } else { |
|
340 | + $output .= '"aircraft_shadow": "ambulance.png",'; |
|
341 | + } |
|
276 | 342 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Police') { |
277 | - if ($compress) $output .= '"as": "police.png",'; |
|
278 | - else $output .= '"aircraft_shadow": "police.png",'; |
|
343 | + if ($compress) { |
|
344 | + $output .= '"as": "police.png",'; |
|
345 | + } else { |
|
346 | + $output .= '"aircraft_shadow": "police.png",'; |
|
347 | + } |
|
279 | 348 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Yacht (Sail)') { |
280 | - if ($compress) $output .= '"as": "ship.png",'; |
|
281 | - else $output .= '"aircraft_shadow": "ship.png",'; |
|
349 | + if ($compress) { |
|
350 | + $output .= '"as": "ship.png",'; |
|
351 | + } else { |
|
352 | + $output .= '"aircraft_shadow": "ship.png",'; |
|
353 | + } |
|
282 | 354 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Ship (Power Boat)') { |
283 | - if ($compress) $output .= '"as": "ship.png",'; |
|
284 | - else $output .= '"aircraft_shadow": "ship.png",'; |
|
355 | + if ($compress) { |
|
356 | + $output .= '"as": "ship.png",'; |
|
357 | + } else { |
|
358 | + $output .= '"aircraft_shadow": "ship.png",'; |
|
359 | + } |
|
285 | 360 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Shuttle') { |
286 | - if ($compress) $output .= '"as": "ship.png",'; |
|
287 | - else $output .= '"aircraft_shadow": "ship.png",'; |
|
361 | + if ($compress) { |
|
362 | + $output .= '"as": "ship.png",'; |
|
363 | + } else { |
|
364 | + $output .= '"aircraft_shadow": "ship.png",'; |
|
365 | + } |
|
288 | 366 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Truck') { |
289 | - if ($compress) $output .= '"as": "truck.png",'; |
|
290 | - else $output .= '"aircraft_shadow": "truck.png",'; |
|
367 | + if ($compress) { |
|
368 | + $output .= '"as": "truck.png",'; |
|
369 | + } else { |
|
370 | + $output .= '"aircraft_shadow": "truck.png",'; |
|
371 | + } |
|
291 | 372 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Truck (18 Wheeler)') { |
292 | - if ($compress) $output .= '"as": "truck.png",'; |
|
293 | - else $output .= '"aircraft_shadow": "truck.png",'; |
|
373 | + if ($compress) { |
|
374 | + $output .= '"as": "truck.png",'; |
|
375 | + } else { |
|
376 | + $output .= '"aircraft_shadow": "truck.png",'; |
|
377 | + } |
|
294 | 378 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Aircraft (small)') { |
295 | - if ($compress) $output .= '"as": "aircraft.png",'; |
|
296 | - else $output .= '"aircraft_shadow": "aircraft.png",'; |
|
379 | + if ($compress) { |
|
380 | + $output .= '"as": "aircraft.png",'; |
|
381 | + } else { |
|
382 | + $output .= '"aircraft_shadow": "aircraft.png",'; |
|
383 | + } |
|
297 | 384 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Large Aircraft') { |
298 | - if ($compress) $output .= '"as": "aircraft.png",'; |
|
299 | - else $output .= '"aircraft_shadow": "aircraft.png",'; |
|
385 | + if ($compress) { |
|
386 | + $output .= '"as": "aircraft.png",'; |
|
387 | + } else { |
|
388 | + $output .= '"aircraft_shadow": "aircraft.png",'; |
|
389 | + } |
|
300 | 390 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Helicopter') { |
301 | - if ($compress) $output .= '"as": "helico.png",'; |
|
302 | - else $output .= '"aircraft_shadow": "helico.png",'; |
|
391 | + if ($compress) { |
|
392 | + $output .= '"as": "helico.png",'; |
|
393 | + } else { |
|
394 | + $output .= '"aircraft_shadow": "helico.png",'; |
|
395 | + } |
|
303 | 396 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Railroad Engine') { |
304 | - if ($compress) $output .= '"as": "rail.png",'; |
|
305 | - else $output .= '"aircraft_shadow": "rail.png",'; |
|
397 | + if ($compress) { |
|
398 | + $output .= '"as": "rail.png",'; |
|
399 | + } else { |
|
400 | + $output .= '"aircraft_shadow": "rail.png",'; |
|
401 | + } |
|
306 | 402 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Firetruck') { |
307 | - if ($compress) $output .= '"as": "firetruck.png",'; |
|
308 | - else $output .= '"aircraft_shadow": "firetruck.png",'; |
|
403 | + if ($compress) { |
|
404 | + $output .= '"as": "firetruck.png",'; |
|
405 | + } else { |
|
406 | + $output .= '"aircraft_shadow": "firetruck.png",'; |
|
407 | + } |
|
309 | 408 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Bus') { |
310 | - if ($compress) $output .= '"as": "bus.png",'; |
|
311 | - else $output .= '"aircraft_shadow": "bus.png",'; |
|
409 | + if ($compress) { |
|
410 | + $output .= '"as": "bus.png",'; |
|
411 | + } else { |
|
412 | + $output .= '"aircraft_shadow": "bus.png",'; |
|
413 | + } |
|
312 | 414 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Phone') { |
313 | - if ($compress) $output .= '"as": "phone.png",'; |
|
314 | - else $output .= '"aircraft_shadow": "phone.png",'; |
|
415 | + if ($compress) { |
|
416 | + $output .= '"as": "phone.png",'; |
|
417 | + } else { |
|
418 | + $output .= '"aircraft_shadow": "phone.png",'; |
|
419 | + } |
|
315 | 420 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Jogger') { |
316 | - if ($compress) $output .= '"as": "jogger.png",'; |
|
317 | - else $output .= '"aircraft_shadow": "jogger.png",'; |
|
421 | + if ($compress) { |
|
422 | + $output .= '"as": "jogger.png",'; |
|
423 | + } else { |
|
424 | + $output .= '"aircraft_shadow": "jogger.png",'; |
|
425 | + } |
|
318 | 426 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Bike') { |
319 | - if ($compress) $output .= '"as": "bike.png",'; |
|
320 | - else $output .= '"aircraft_shadow": "bike.png",'; |
|
427 | + if ($compress) { |
|
428 | + $output .= '"as": "bike.png",'; |
|
429 | + } else { |
|
430 | + $output .= '"aircraft_shadow": "bike.png",'; |
|
431 | + } |
|
321 | 432 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Motorcycle') { |
322 | - if ($compress) $output .= '"as": "motorcycle.png",'; |
|
323 | - else $output .= '"aircraft_shadow": "motorcycle.png",'; |
|
433 | + if ($compress) { |
|
434 | + $output .= '"as": "motorcycle.png",'; |
|
435 | + } else { |
|
436 | + $output .= '"aircraft_shadow": "motorcycle.png",'; |
|
437 | + } |
|
324 | 438 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Balloon') { |
325 | - if ($compress) $output .= '"as": "balloon.png",'; |
|
326 | - else $output .= '"aircraft_shadow": "balloon.png",'; |
|
439 | + if ($compress) { |
|
440 | + $output .= '"as": "balloon.png",'; |
|
441 | + } else { |
|
442 | + $output .= '"aircraft_shadow": "balloon.png",'; |
|
443 | + } |
|
327 | 444 | } else { |
328 | - if ($compress) $output .= '"as": "car.png",'; |
|
329 | - else $output .= '"aircraft_shadow": "car.png",'; |
|
445 | + if ($compress) { |
|
446 | + $output .= '"as": "car.png",'; |
|
447 | + } else { |
|
448 | + $output .= '"aircraft_shadow": "car.png",'; |
|
449 | + } |
|
330 | 450 | } |
331 | 451 | } elseif ($marine) { |
332 | - if ($compress) $output .= '"as": "ship.png",'; |
|
333 | - else $output .= '"aircraft_shadow": "ship.png",'; |
|
452 | + if ($compress) { |
|
453 | + $output .= '"as": "ship.png",'; |
|
454 | + } else { |
|
455 | + $output .= '"aircraft_shadow": "ship.png",'; |
|
456 | + } |
|
334 | 457 | } else { |
335 | - if ($compress) $output .= '"as": "default.png",'; |
|
336 | - else $output .= '"aircraft_shadow": "default.png",'; |
|
458 | + if ($compress) { |
|
459 | + $output .= '"as": "default.png",'; |
|
460 | + } else { |
|
461 | + $output .= '"aircraft_shadow": "default.png",'; |
|
462 | + } |
|
337 | 463 | } |
338 | 464 | } else { |
339 | - if ($compress) $output .= '"as": "'.$spotter_item['aircraft_shadow'].'",'; |
|
340 | - else $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",'; |
|
465 | + if ($compress) { |
|
466 | + $output .= '"as": "'.$spotter_item['aircraft_shadow'].'",'; |
|
467 | + } else { |
|
468 | + $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",'; |
|
469 | + } |
|
341 | 470 | } |
342 | 471 | if (isset($spotter_item['airline_name'])) { |
343 | 472 | $output .= '"airline_name": "'.$spotter_item['airline_name'].'",'; |
@@ -345,8 +474,11 @@ discard block |
||
345 | 474 | $output .= '"airline_name": "NA",'; |
346 | 475 | } |
347 | 476 | if (isset($spotter_item['departure_airport'])) { |
348 | - if ($compress) $output .= '"dac": "'.$spotter_item['departure_airport'].'",'; |
|
349 | - else $output .= '"departure_airport_code": "'.$spotter_item['departure_airport'].'",'; |
|
477 | + if ($compress) { |
|
478 | + $output .= '"dac": "'.$spotter_item['departure_airport'].'",'; |
|
479 | + } else { |
|
480 | + $output .= '"departure_airport_code": "'.$spotter_item['departure_airport'].'",'; |
|
481 | + } |
|
350 | 482 | } |
351 | 483 | if (isset($spotter_item['departure_airport_city'])) { |
352 | 484 | $output .= '"departure_airport": "'.$spotter_item['departure_airport_city'].', '.$spotter_item['departure_airport_country'].'",'; |
@@ -358,8 +490,11 @@ discard block |
||
358 | 490 | $output .= '"arrival_airport_time": "'.$spotter_item['arrival_airport_time'].'",'; |
359 | 491 | } |
360 | 492 | if (isset($spotter_item['arrival_airport'])) { |
361 | - if ($compress) $output .= '"aac": "'.$spotter_item['arrival_airport'].'",'; |
|
362 | - else $output .= '"arrival_airport_code": "'.$spotter_item['arrival_airport'].'",'; |
|
493 | + if ($compress) { |
|
494 | + $output .= '"aac": "'.$spotter_item['arrival_airport'].'",'; |
|
495 | + } else { |
|
496 | + $output .= '"arrival_airport_code": "'.$spotter_item['arrival_airport'].'",'; |
|
497 | + } |
|
363 | 498 | } |
364 | 499 | if (isset($spotter_item['arrival_airport_city'])) { |
365 | 500 | $output .= '"arrival_airport": "'.$spotter_item['arrival_airport_city'].', '.$spotter_item['arrival_airport_country'].'",'; |
@@ -378,11 +513,17 @@ discard block |
||
378 | 513 | } |
379 | 514 | |
380 | 515 | if (isset($spotter_item['altitude'])) { |
381 | - if ($compress) $output .= '"a": "'.$spotter_item['altitude'].'",'; |
|
382 | - else $output .= '"altitude": "'.$spotter_item['altitude'].'",'; |
|
516 | + if ($compress) { |
|
517 | + $output .= '"a": "'.$spotter_item['altitude'].'",'; |
|
518 | + } else { |
|
519 | + $output .= '"altitude": "'.$spotter_item['altitude'].'",'; |
|
520 | + } |
|
521 | + } |
|
522 | + if ($compress) { |
|
523 | + $output .= '"h": "'.$spotter_item['heading'].'",'; |
|
524 | + } else { |
|
525 | + $output .= '"heading": "'.$spotter_item['heading'].'",'; |
|
383 | 526 | } |
384 | - if ($compress)$output .= '"h": "'.$spotter_item['heading'].'",'; |
|
385 | - else $output .= '"heading": "'.$spotter_item['heading'].'",'; |
|
386 | 527 | |
387 | 528 | if (isset($archivespeed)) { |
388 | 529 | $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading'],$archivespeed); |
@@ -392,7 +533,9 @@ discard block |
||
392 | 533 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
393 | 534 | } |
394 | 535 | |
395 | - if (!$min) $output .= '"image": "'.$image.'",'; |
|
536 | + if (!$min) { |
|
537 | + $output .= '"image": "'.$image.'",'; |
|
538 | + } |
|
396 | 539 | if (isset($spotter_item['image_copyright']) && $spotter_item['image_copyright'] != '') { |
397 | 540 | $output .= '"image_copyright": "'.str_replace('"',"'",trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'',$spotter_item['image_copyright']))).'",'; |
398 | 541 | } |
@@ -400,8 +543,11 @@ discard block |
||
400 | 543 | $output .= '"image_source_website": "'.urlencode($spotter_item['image_source_website']).'",'; |
401 | 544 | } |
402 | 545 | if (isset($spotter_item['squawk'])) { |
403 | - if ($compress) $output .= '"sq": "'.$spotter_item['squawk'].'",'; |
|
404 | - else $output .= '"squawk": "'.$spotter_item['squawk'].'",'; |
|
546 | + if ($compress) { |
|
547 | + $output .= '"sq": "'.$spotter_item['squawk'].'",'; |
|
548 | + } else { |
|
549 | + $output .= '"squawk": "'.$spotter_item['squawk'].'",'; |
|
550 | + } |
|
405 | 551 | } |
406 | 552 | if (isset($spotter_item['squawk_usage'])) { |
407 | 553 | $output .= '"squawk_usage": "'.$spotter_item['squawk_usage'].'",'; |
@@ -420,14 +566,23 @@ discard block |
||
420 | 566 | } |
421 | 567 | // type when not aircraft ? |
422 | 568 | if (isset($spotter_item['type'])) { |
423 | - if ($compress) $output .= '"t": "'.$spotter_item['type'].'"'; |
|
424 | - else $output .= '"type": "'.$spotter_item['type'].'"'; |
|
569 | + if ($compress) { |
|
570 | + $output .= '"t": "'.$spotter_item['type'].'"'; |
|
571 | + } else { |
|
572 | + $output .= '"type": "'.$spotter_item['type'].'"'; |
|
573 | + } |
|
425 | 574 | } elseif ($marine) { |
426 | - if ($compress) $output .= '"t": "ship"'; |
|
427 | - else $output .= '"type": "ship"'; |
|
575 | + if ($compress) { |
|
576 | + $output .= '"t": "ship"'; |
|
577 | + } else { |
|
578 | + $output .= '"type": "ship"'; |
|
579 | + } |
|
428 | 580 | } else { |
429 | - if ($compress) $output .= '"t": "aircraft"'; |
|
430 | - else $output .= '"type": "aircraft"'; |
|
581 | + if ($compress) { |
|
582 | + $output .= '"t": "aircraft"'; |
|
583 | + } else { |
|
584 | + $output .= '"type": "aircraft"'; |
|
585 | + } |
|
431 | 586 | } |
432 | 587 | $output .= '},'; |
433 | 588 | $output .= '"geometry": {'; |
@@ -495,7 +650,9 @@ discard block |
||
495 | 650 | } |
496 | 651 | */ |
497 | 652 | $history = filter_input(INPUT_GET,'history',FILTER_SANITIZE_STRING); |
498 | - if ($history == '' && isset($_COOKIE['history'])) $history = $_COOKIE['history']; |
|
653 | + if ($history == '' && isset($_COOKIE['history'])) { |
|
654 | + $history = $_COOKIE['history']; |
|
655 | + } |
|
499 | 656 | |
500 | 657 | if ( |
501 | 658 | (isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') |
@@ -539,8 +696,11 @@ discard block |
||
539 | 696 | $output_history .= ']}},'; |
540 | 697 | $output .= $output_history; |
541 | 698 | } |
542 | - if ($compress) $output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "history","a": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
|
543 | - else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
|
699 | + if ($compress) { |
|
700 | + $output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "history","a": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
|
701 | + } else { |
|
702 | + $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
|
703 | + } |
|
544 | 704 | } |
545 | 705 | $output_history .= '['; |
546 | 706 | $output_history .= $spotter_history['longitude'].', '; |
@@ -559,9 +719,14 @@ discard block |
||
559 | 719 | $prev_alt = $alt; |
560 | 720 | } else { |
561 | 721 | if ($d == false) { |
562 | - if ($compress) $output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "history"},"geometry": {"type": "LineString","coordinates": ['; |
|
563 | - else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history"},"geometry": {"type": "LineString","coordinates": ['; |
|
564 | - } else $d = true; |
|
722 | + if ($compress) { |
|
723 | + $output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "history"},"geometry": {"type": "LineString","coordinates": ['; |
|
724 | + } else { |
|
725 | + $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history"},"geometry": {"type": "LineString","coordinates": ['; |
|
726 | + } |
|
727 | + } else { |
|
728 | + $d = true; |
|
729 | + } |
|
565 | 730 | $output_history .= '['; |
566 | 731 | $output_history .= $spotter_history['longitude'].', '; |
567 | 732 | $output_history .= $spotter_history['latitude']; |
@@ -582,7 +747,9 @@ discard block |
||
582 | 747 | $output_historyd = '['; |
583 | 748 | $output_historyd .= $spotter_item['longitude'].', '; |
584 | 749 | $output_historyd .= $spotter_item['latitude']; |
585 | - if (isset($spotter_history['altitude'])) $output_historyd .= ','.$spotter_item['altitude']*30.48; |
|
750 | + if (isset($spotter_history['altitude'])) { |
|
751 | + $output_historyd .= ','.$spotter_item['altitude']*30.48; |
|
752 | + } |
|
586 | 753 | $output_historyd .= '],'; |
587 | 754 | //$output_history = $output_historyd.$output_history; |
588 | 755 | $output_history = $output_history.$output_historyd; |
@@ -604,8 +771,11 @@ discard block |
||
604 | 771 | && $spotter_item['arrival_airport'] != 'NA' |
605 | 772 | && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") |
606 | 773 | || (!isset($_COOKIE['MapRoute']) && isset($globalMapRoute) && $globalMapRoute)))) { |
607 | - if ($compress) $output_air = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
608 | - else $output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
774 | + if ($compress) { |
|
775 | + $output_air = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
776 | + } else { |
|
777 | + $output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
778 | + } |
|
609 | 779 | if (isset($spotter_item['departure_airport_latitude'])) { |
610 | 780 | $output_air .= '['.$spotter_item['departure_airport_longitude'].','.$spotter_item['departure_airport_latitude'].'],'; |
611 | 781 | } elseif (isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA') { |
@@ -638,8 +808,11 @@ discard block |
||
638 | 808 | || (!isset($_COOKIE['MapRemainaingRoute']) && (!isset($globalMapRemainingRoute) |
639 | 809 | || (isset($globalMapRemainingRoute) && $globalMapRemainingRoute)))))) { |
640 | 810 | $havedata = false; |
641 | - if ($compress) $output_dest = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
642 | - else $output_dest = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
811 | + if ($compress) { |
|
812 | + $output_dest = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
813 | + } else { |
|
814 | + $output_dest = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
815 | + } |
|
643 | 816 | $output_dest .= '['.$spotter_item['longitude'].','.$spotter_item['latitude'].'],'; |
644 | 817 | |
645 | 818 | if (isset($spotter_item['arrival_airport_latitude'])) { |
@@ -654,7 +827,9 @@ discard block |
||
654 | 827 | } |
655 | 828 | //$output_dest = substr($output_dest, 0, -1); |
656 | 829 | $output_dest .= ']}},'; |
657 | - if ($havedata) $output .= $output_dest; |
|
830 | + if ($havedata) { |
|
831 | + $output .= $output_dest; |
|
832 | + } |
|
658 | 833 | unset($output_dest); |
659 | 834 | } |
660 | 835 | } |
@@ -662,7 +837,9 @@ discard block |
||
662 | 837 | $output .= ']'; |
663 | 838 | $output .= ',"initial_sqltime": "'.$sqltime.'",'; |
664 | 839 | $output .= '"totaltime": "'.round(microtime(true)-$begintime,2).'",'; |
665 | - if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",'; |
|
840 | + if (isset($begindate)) { |
|
841 | + $output .= '"archive_date": "'.$begindate.'",'; |
|
842 | + } |
|
666 | 843 | $output .= '"fc": "'.$j.'"'; |
667 | 844 | } else { |
668 | 845 | $output .= '"features": '; |