@@ -4,7 +4,7 @@ |
||
4 | 4 | |
5 | 5 | if (isset($_POST['country']) && $_POST['country'] != "") |
6 | 6 | { |
7 | - $country = filter_input(INPUT_POST,'country',FILTER_SANITIZE_STRING); |
|
7 | + $country = filter_input(INPUT_POST, 'country', FILTER_SANITIZE_STRING); |
|
8 | 8 | header('Location: '.$globalURL.'/country/'.$country); |
9 | 9 | } else { |
10 | 10 | if ($globalURL == '') { |
@@ -5,13 +5,13 @@ discard block |
||
5 | 5 | require_once('require/class.Language.php'); |
6 | 6 | require_once('require/class.SpotterArchive.php'); |
7 | 7 | |
8 | -if (!isset($_GET['pilot'])){ |
|
8 | +if (!isset($_GET['pilot'])) { |
|
9 | 9 | header('Location: '.$globalURL.'/'); |
10 | 10 | } else { |
11 | 11 | $Spotter = new Spotter(); |
12 | 12 | $SpotterArchive = new SpotterArchive(); |
13 | 13 | //calculuation for the pagination |
14 | - if(!isset($_GET['limit'])) |
|
14 | + if (!isset($_GET['limit'])) |
|
15 | 15 | { |
16 | 16 | $limit_start = 0; |
17 | 17 | $limit_end = 25; |
@@ -32,29 +32,29 @@ discard block |
||
32 | 32 | |
33 | 33 | $page_url = $globalURL.'/pilot/'.$_GET['pilot']; |
34 | 34 | |
35 | - $pilot = filter_input(INPUT_GET,'pilot',FILTER_SANITIZE_STRING); |
|
36 | - $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
37 | - $year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
|
38 | - $month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT); |
|
35 | + $pilot = filter_input(INPUT_GET, 'pilot', FILTER_SANITIZE_STRING); |
|
36 | + $sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
37 | + $year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT); |
|
38 | + $month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT); |
|
39 | 39 | $filter = array(); |
40 | - if ($year != '') $filter = array_merge($filter,array('year' => $year)); |
|
41 | - if ($month != '') $filter = array_merge($filter,array('month' => $month)); |
|
40 | + if ($year != '') $filter = array_merge($filter, array('year' => $year)); |
|
41 | + if ($month != '') $filter = array_merge($filter, array('month' => $month)); |
|
42 | 42 | if ($sort != '') |
43 | 43 | { |
44 | - $spotter_array = $Spotter->getSpotterDataByPilot($pilot,$limit_start.",".$absolute_difference, $sort,$filter); |
|
44 | + $spotter_array = $Spotter->getSpotterDataByPilot($pilot, $limit_start.",".$absolute_difference, $sort, $filter); |
|
45 | 45 | if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) { |
46 | - $spotter_array = $SpotterArchive->getSpotterDataByPilot($pilot,$limit_start.",".$absolute_difference, $sort,$filter); |
|
46 | + $spotter_array = $SpotterArchive->getSpotterDataByPilot($pilot, $limit_start.",".$absolute_difference, $sort, $filter); |
|
47 | 47 | } |
48 | 48 | } else { |
49 | - $spotter_array = $Spotter->getSpotterDataByPilot($pilot,$limit_start.",".$absolute_difference,'',$filter); |
|
49 | + $spotter_array = $Spotter->getSpotterDataByPilot($pilot, $limit_start.",".$absolute_difference, '', $filter); |
|
50 | 50 | if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) { |
51 | - $spotter_array = $SpotterArchive->getSpotterDataByPilot($pilot,$limit_start.",".$absolute_difference,'',$filter); |
|
51 | + $spotter_array = $SpotterArchive->getSpotterDataByPilot($pilot, $limit_start.",".$absolute_difference, '', $filter); |
|
52 | 52 | } |
53 | 53 | } |
54 | 54 | |
55 | 55 | if (!empty($spotter_array)) |
56 | 56 | { |
57 | - $title = sprintf(_("Detailed View for %s"),$spotter_array[0]['pilot_name']); |
|
57 | + $title = sprintf(_("Detailed View for %s"), $spotter_array[0]['pilot_name']); |
|
58 | 58 | $ident = $spotter_array[0]['ident']; |
59 | 59 | if (isset($spotter_array[0]['latitude'])) $latitude = $spotter_array[0]['latitude']; |
60 | 60 | if (isset($spotter_array[0]['longitude'])) $longitude = $spotter_array[0]['longitude']; |
@@ -115,23 +115,23 @@ discard block |
||
115 | 115 | $Stats = new Stats(); |
116 | 116 | $flights = $Stats->getStatsPilot($pilot); |
117 | 117 | } else $flights = 0; |
118 | - if ($flights == 0) $flights = $Spotter->countFlightsByPilot($pilot,$filter); |
|
118 | + if ($flights == 0) $flights = $Spotter->countFlightsByPilot($pilot, $filter); |
|
119 | 119 | print '<div><span class="label">'._("Flights").'</span>'.$flights.'</div>'; |
120 | - $aircraft_type = count($Spotter->countAllAircraftTypesByPilot($pilot,$filter)); |
|
120 | + $aircraft_type = count($Spotter->countAllAircraftTypesByPilot($pilot, $filter)); |
|
121 | 121 | print '<div><span class="label">'._("Aircrafts type").'</span>'.$aircraft_type.'</div>'; |
122 | - $aircraft_registration = count($Spotter->countAllAircraftRegistrationByPilot($pilot,$filter)); |
|
122 | + $aircraft_registration = count($Spotter->countAllAircraftRegistrationByPilot($pilot, $filter)); |
|
123 | 123 | print '<div><span class="label">'._("Aircrafts").'</span>'.$aircraft_registration.'</div>'; |
124 | - $aircraft_manufacturer = count($Spotter->countAllAircraftManufacturerByPilot($pilot,$filter)); |
|
124 | + $aircraft_manufacturer = count($Spotter->countAllAircraftManufacturerByPilot($pilot, $filter)); |
|
125 | 125 | print '<div><span class="label">'._("Manufacturers").'</span>'.$aircraft_manufacturer.'</div>'; |
126 | - $airlines = count($Spotter->countAllAirlinesByPilot($pilot,$filter)); |
|
126 | + $airlines = count($Spotter->countAllAirlinesByPilot($pilot, $filter)); |
|
127 | 127 | print '<div><span class="label">'._("Airlines").'</span>'.$airlines.'</div>'; |
128 | - $duration = $Spotter->getFlightDurationByPilot($pilot,$filter); |
|
128 | + $duration = $Spotter->getFlightDurationByPilot($pilot, $filter); |
|
129 | 129 | if ($duration != '0') print '<div><span class="label">'._("Total flights spotted duration").'</span>'.$duration.'</div>'; |
130 | 130 | print '</div>'; |
131 | 131 | |
132 | 132 | include('pilot-sub-menu.php'); |
133 | 133 | print '<div class="table column">'; |
134 | - print '<p>'.sprintf(_("The table below shows the detailed information of all flights with the pilot <strong>%s</strong>."),$spotter_array[0]['pilot_name']).'</p>'; |
|
134 | + print '<p>'.sprintf(_("The table below shows the detailed information of all flights with the pilot <strong>%s</strong>."), $spotter_array[0]['pilot_name']).'</p>'; |
|
135 | 135 | |
136 | 136 | include('table-output.php'); |
137 | 137 | print '<div class="pagination">'; |
@@ -37,8 +37,12 @@ discard block |
||
37 | 37 | $year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
38 | 38 | $month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT); |
39 | 39 | $filter = array(); |
40 | - if ($year != '') $filter = array_merge($filter,array('year' => $year)); |
|
41 | - if ($month != '') $filter = array_merge($filter,array('month' => $month)); |
|
40 | + if ($year != '') { |
|
41 | + $filter = array_merge($filter,array('year' => $year)); |
|
42 | + } |
|
43 | + if ($month != '') { |
|
44 | + $filter = array_merge($filter,array('month' => $month)); |
|
45 | + } |
|
42 | 46 | if ($sort != '') |
43 | 47 | { |
44 | 48 | $spotter_array = $Spotter->getSpotterDataByPilot($pilot,$limit_start.",".$absolute_difference, $sort,$filter); |
@@ -56,8 +60,12 @@ discard block |
||
56 | 60 | { |
57 | 61 | $title = sprintf(_("Detailed View for %s"),$spotter_array[0]['pilot_name']); |
58 | 62 | $ident = $spotter_array[0]['ident']; |
59 | - if (isset($spotter_array[0]['latitude'])) $latitude = $spotter_array[0]['latitude']; |
|
60 | - if (isset($spotter_array[0]['longitude'])) $longitude = $spotter_array[0]['longitude']; |
|
63 | + if (isset($spotter_array[0]['latitude'])) { |
|
64 | + $latitude = $spotter_array[0]['latitude']; |
|
65 | + } |
|
66 | + if (isset($spotter_array[0]['longitude'])) { |
|
67 | + $longitude = $spotter_array[0]['longitude']; |
|
68 | + } |
|
61 | 69 | require_once('header.php'); |
62 | 70 | /* |
63 | 71 | if (isset($globalArchive) && $globalArchive) { |
@@ -110,12 +118,18 @@ discard block |
||
110 | 118 | */ |
111 | 119 | print '<div class="info column">'; |
112 | 120 | print '<h1>'.$spotter_array[0]['pilot_name'].'</h1>'; |
113 | - if (isset($spotter_array[0]['pilot_id']) && $spotter_array[0]['pilot_id'] != '') print '<div><span class="label">'._("Pilot ID").'</span>'.$spotter_array[0]['pilot_id'].'</div>'; |
|
121 | + if (isset($spotter_array[0]['pilot_id']) && $spotter_array[0]['pilot_id'] != '') { |
|
122 | + print '<div><span class="label">'._("Pilot ID").'</span>'.$spotter_array[0]['pilot_id'].'</div>'; |
|
123 | + } |
|
114 | 124 | if ($year == '' && $month == '') { |
115 | 125 | $Stats = new Stats(); |
116 | 126 | $flights = $Stats->getStatsPilot($pilot); |
117 | - } else $flights = 0; |
|
118 | - if ($flights == 0) $flights = $Spotter->countFlightsByPilot($pilot,$filter); |
|
127 | + } else { |
|
128 | + $flights = 0; |
|
129 | + } |
|
130 | + if ($flights == 0) { |
|
131 | + $flights = $Spotter->countFlightsByPilot($pilot,$filter); |
|
132 | + } |
|
119 | 133 | print '<div><span class="label">'._("Flights").'</span>'.$flights.'</div>'; |
120 | 134 | $aircraft_type = count($Spotter->countAllAircraftTypesByPilot($pilot,$filter)); |
121 | 135 | print '<div><span class="label">'._("Aircrafts type").'</span>'.$aircraft_type.'</div>'; |
@@ -126,7 +140,9 @@ discard block |
||
126 | 140 | $airlines = count($Spotter->countAllAirlinesByPilot($pilot,$filter)); |
127 | 141 | print '<div><span class="label">'._("Airlines").'</span>'.$airlines.'</div>'; |
128 | 142 | $duration = $Spotter->getFlightDurationByPilot($pilot,$filter); |
129 | - if ($duration != '0') print '<div><span class="label">'._("Total flights spotted duration").'</span>'.$duration.'</div>'; |
|
143 | + if ($duration != '0') { |
|
144 | + print '<div><span class="label">'._("Total flights spotted duration").'</span>'.$duration.'</div>'; |
|
145 | + } |
|
130 | 146 | print '</div>'; |
131 | 147 | |
132 | 148 | include('pilot-sub-menu.php'); |
@@ -5,8 +5,8 @@ |
||
5 | 5 | |
6 | 6 | if (isset($_POST['departure_airport']) && $_POST['departure_airport'] != '') |
7 | 7 | { |
8 | - $departure_airport = filter_input(INPUT_POST,'departure_airport',FILTER_SANITIZE_STRING); |
|
9 | - $arrival_airport = filter_input(INPUT_POST,'arrival_airport',FILTER_SANITIZE_STRING); |
|
8 | + $departure_airport = filter_input(INPUT_POST, 'departure_airport', FILTER_SANITIZE_STRING); |
|
9 | + $arrival_airport = filter_input(INPUT_POST, 'arrival_airport', FILTER_SANITIZE_STRING); |
|
10 | 10 | header('Location: '.$globalURL.'/route/'.$departure_airport.'/'.$arrival_airport); |
11 | 11 | } else { |
12 | 12 | if ($globalURL == '') { |
@@ -3,17 +3,17 @@ discard block |
||
3 | 3 | require_once('require/class.Spotter.php'); |
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | |
6 | -if (!isset($_GET['country'])){ |
|
6 | +if (!isset($_GET['country'])) { |
|
7 | 7 | header('Location: '.$globalURL.''); |
8 | 8 | } else { |
9 | 9 | $Spotter = new Spotter(); |
10 | 10 | //calculuation for the pagination |
11 | - if(!isset($_GET['limit'])) |
|
11 | + if (!isset($_GET['limit'])) |
|
12 | 12 | { |
13 | 13 | $limit_start = 0; |
14 | 14 | $limit_end = 25; |
15 | 15 | $absolute_difference = 25; |
16 | - } else { |
|
16 | + } else { |
|
17 | 17 | $limit_explode = explode(",", $_GET['limit']); |
18 | 18 | if (isset($limit_explode[1])) { |
19 | 19 | $limit_start = $limit_explode[0]; |
@@ -32,10 +32,10 @@ discard block |
||
32 | 32 | $limit_previous_1 = $limit_start - $absolute_difference; |
33 | 33 | $limit_previous_2 = $limit_end - $absolute_difference; |
34 | 34 | |
35 | - $country = ucwords(str_replace("-", " ", urldecode(filter_input(INPUT_GET,'country',FILTER_SANITIZE_STRING)))); |
|
35 | + $country = ucwords(str_replace("-", " ", urldecode(filter_input(INPUT_GET, 'country', FILTER_SANITIZE_STRING)))); |
|
36 | 36 | |
37 | 37 | $page_url = $globalURL.'/country/'.$_GET['country']; |
38 | - $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
38 | + $sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
39 | 39 | if ($country == 'Na') { |
40 | 40 | $spotter_array = array(); |
41 | 41 | } else { |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | |
49 | 49 | if (!empty($spotter_array)) |
50 | 50 | { |
51 | - $title = sprintf(_("Detailed View for Airports & Airlines from %s"),$country); |
|
51 | + $title = sprintf(_("Detailed View for Airports & Airlines from %s"), $country); |
|
52 | 52 | |
53 | 53 | require_once('header.php'); |
54 | 54 | print '<div class="select-item">'; |
@@ -56,9 +56,9 @@ discard block |
||
56 | 56 | print '<select name="country" class="selectpicker" data-live-search="true">'; |
57 | 57 | print '<option></option>'; |
58 | 58 | $all_countries = $Spotter->getAllCountries(); |
59 | - foreach($all_countries as $all_country) |
|
59 | + foreach ($all_countries as $all_country) |
|
60 | 60 | { |
61 | - if($country == $all_country['country']) |
|
61 | + if ($country == $all_country['country']) |
|
62 | 62 | { |
63 | 63 | print '<option value="'.strtolower(str_replace(" ", "-", $all_country['country'])).'" selected="selected">'.$all_country['country'].'</option>'; |
64 | 64 | } else { |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | if ($_GET['country'] != "NA") |
74 | 74 | { |
75 | 75 | print '<div class="info column">'; |
76 | - print '<h1>'.sprintf(_("Airports & Airlines from %s"),$country).'</h1>'; |
|
76 | + print '<h1>'.sprintf(_("Airports & Airlines from %s"), $country).'</h1>'; |
|
77 | 77 | print '</div>'; |
78 | 78 | } else { |
79 | 79 | print '<div class="alert alert-warning">'._("This special country profile shows all flights that do <u>not</u> have a country of a airline or departure/arrival airport associated with them.").'</div>'; |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | |
82 | 82 | include('country-sub-menu.php'); |
83 | 83 | print '<div class="table column">'; |
84 | - print '<p>'.sprintf(_("The table below shows the detailed information of all flights of airports (both departure & arrival) OR airlines from <strong>%s</strong>."),$country).'</p>'; |
|
84 | + print '<p>'.sprintf(_("The table below shows the detailed information of all flights of airports (both departure & arrival) OR airlines from <strong>%s</strong>."), $country).'</p>'; |
|
85 | 85 | |
86 | 86 | include('table-output.php'); |
87 | 87 | print '<div class="pagination">'; |
@@ -13,7 +13,7 @@ |
||
13 | 13 | $limit_start = 0; |
14 | 14 | $limit_end = 25; |
15 | 15 | $absolute_difference = 25; |
16 | - } else { |
|
16 | + } else { |
|
17 | 17 | $limit_explode = explode(",", $_GET['limit']); |
18 | 18 | if (isset($limit_explode[1])) { |
19 | 19 | $limit_start = $limit_explode[0]; |
@@ -5,14 +5,14 @@ discard block |
||
5 | 5 | $Spotter = new Spotter(); |
6 | 6 | if (isset($_GET['start_date'])) { |
7 | 7 | //for the date manipulation into the query |
8 | - if($_GET['start_date'] != "" && $_GET['end_date'] != ""){ |
|
8 | + if ($_GET['start_date'] != "" && $_GET['end_date'] != "") { |
|
9 | 9 | $start_date = $_GET['start_date'].":00"; |
10 | 10 | $end_date = $_GET['end_date'].":00"; |
11 | 11 | $sql_date = $start_date.",".$end_date; |
12 | - } else if($_GET['start_date'] != ""){ |
|
12 | + } else if ($_GET['start_date'] != "") { |
|
13 | 13 | $start_date = $_GET['start_date'].":00"; |
14 | 14 | $sql_date = $start_date; |
15 | - } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){ |
|
15 | + } else if ($_GET['start_date'] == "" && $_GET['end_date'] != "") { |
|
16 | 16 | $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00"; |
17 | 17 | $sql_date = $end_date; |
18 | 18 | } else $sql_date = ''; |
@@ -20,38 +20,38 @@ discard block |
||
20 | 20 | |
21 | 21 | if (isset($_GET['highest_altitude'])) { |
22 | 22 | //for altitude manipulation |
23 | - if($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != ""){ |
|
24 | - $end_altitude = filter_input(INPUT_GET,'highest_altitude',FILTER_SANITIZE_NUMBER_INT); |
|
25 | - $start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT); |
|
23 | + if ($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != "") { |
|
24 | + $end_altitude = filter_input(INPUT_GET, 'highest_altitude', FILTER_SANITIZE_NUMBER_INT); |
|
25 | + $start_altitude = filter_input(INPUT_GET, 'lowest_altitude', FILTER_SANITIZE_NUMBER_INT); |
|
26 | 26 | $sql_altitude = $start_altitude.",".$end_altitude; |
27 | - } else if($_GET['highest_altitude'] != ""){ |
|
28 | - $end_altitude = filter_input(INPUT_GET,'highest_altitude',FILTER_SANITIZE_NUMBER_INT); |
|
27 | + } else if ($_GET['highest_altitude'] != "") { |
|
28 | + $end_altitude = filter_input(INPUT_GET, 'highest_altitude', FILTER_SANITIZE_NUMBER_INT); |
|
29 | 29 | $sql_altitude = $end_altitude; |
30 | - } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){ |
|
31 | - $start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT).",60000"; |
|
30 | + } else if ($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != "") { |
|
31 | + $start_altitude = filter_input(INPUT_GET, 'lowest_altitude', FILTER_SANITIZE_NUMBER_INT).",60000"; |
|
32 | 32 | $sql_altitude = $start_altitude; |
33 | 33 | } else $sql_altitude = ''; |
34 | 34 | } else $sql_altitude = ''; |
35 | 35 | |
36 | 36 | //calculuation for the pagination |
37 | -if(!isset($_GET['limit'])) |
|
37 | +if (!isset($_GET['limit'])) |
|
38 | 38 | { |
39 | 39 | if (!isset($_GET['number_results'])) { |
40 | 40 | $limit_start = 0; |
41 | 41 | $limit_end = 25; |
42 | 42 | $absolute_difference = 25; |
43 | 43 | } else { |
44 | - if ($_GET['number_results'] > 1000){ |
|
44 | + if ($_GET['number_results'] > 1000) { |
|
45 | 45 | $_GET['number_results'] = 1000; |
46 | 46 | } |
47 | 47 | $limit_start = 0; |
48 | - $limit_end = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT); |
|
49 | - $absolute_difference = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT); |
|
48 | + $limit_end = filter_input(INPUT_GET, 'number_results', FILTER_SANITIZE_NUMBER_INT); |
|
49 | + $absolute_difference = filter_input(INPUT_GET, 'number_results', FILTER_SANITIZE_NUMBER_INT); |
|
50 | 50 | } |
51 | -} else { |
|
51 | +} else { |
|
52 | 52 | $limit_explode = explode(",", $_GET['limit']); |
53 | - $limit_start = filter_var($limit_explode[0],FILTER_SANITIZE_NUMBER_INT); |
|
54 | - $limit_end = filter_var($limit_explode[1],FILTER_SANITIZE_NUMBER_INT); |
|
53 | + $limit_start = filter_var($limit_explode[0], FILTER_SANITIZE_NUMBER_INT); |
|
54 | + $limit_end = filter_var($limit_explode[1], FILTER_SANITIZE_NUMBER_INT); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | $absolute_difference = abs($limit_start - $limit_end); |
@@ -68,23 +68,23 @@ discard block |
||
68 | 68 | |
69 | 69 | if (isset($_GET['sort'])) $sort = $_GET['sort']; |
70 | 70 | else $sort = ''; |
71 | -$q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING); |
|
72 | -$registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING); |
|
73 | -$aircraft = filter_input(INPUT_GET,'aircraft',FILTER_SANITIZE_STRING); |
|
74 | -$manufacturer = filter_input(INPUT_GET,'manufacturer',FILTER_SANITIZE_STRING); |
|
75 | -$highlights = filter_input(INPUT_GET,'highlights',FILTER_SANITIZE_STRING); |
|
76 | -$airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
|
77 | -$airline_country = filter_input(INPUT_GET,'airline_country',FILTER_SANITIZE_STRING); |
|
78 | -$airline_type = filter_input(INPUT_GET,'airline_type',FILTER_SANITIZE_STRING); |
|
79 | -$airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING); |
|
80 | -$airport_country = filter_input(INPUT_GET,'airport_country',FILTER_SANITIZE_STRING); |
|
81 | -$callsign = filter_input(INPUT_GET,'callsign',FILTER_SANITIZE_STRING); |
|
82 | -$owner = filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING); |
|
83 | -$pilot_id = filter_input(INPUT_GET,'pilot_id',FILTER_SANITIZE_STRING); |
|
84 | -$pilot_name = filter_input(INPUT_GET,'pilot_name',FILTER_SANITIZE_STRING); |
|
85 | -$departure_airport_route = filter_input(INPUT_GET,'departure_airport_route',FILTER_SANITIZE_STRING); |
|
86 | -$arrival_airport_route = filter_input(INPUT_GET,'arrival_airport_route',FILTER_SANITIZE_STRING); |
|
87 | -$spotter_array = $Spotter->searchSpotterData($q,$registration,$aircraft,strtolower(str_replace("-", " ", $manufacturer)),$highlights,$airline,$airline_country,$airline_type,$airport,$airport_country,$callsign,$departure_airport_route,$arrival_airport_route,$owner,$pilot_id,$pilot_name,$sql_altitude,$sql_date,$limit_start.",".$absolute_difference,$sort,''); |
|
71 | +$q = filter_input(INPUT_GET, 'q', FILTER_SANITIZE_STRING); |
|
72 | +$registration = filter_input(INPUT_GET, 'registratrion', FILTER_SANITIZE_STRING); |
|
73 | +$aircraft = filter_input(INPUT_GET, 'aircraft', FILTER_SANITIZE_STRING); |
|
74 | +$manufacturer = filter_input(INPUT_GET, 'manufacturer', FILTER_SANITIZE_STRING); |
|
75 | +$highlights = filter_input(INPUT_GET, 'highlights', FILTER_SANITIZE_STRING); |
|
76 | +$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING); |
|
77 | +$airline_country = filter_input(INPUT_GET, 'airline_country', FILTER_SANITIZE_STRING); |
|
78 | +$airline_type = filter_input(INPUT_GET, 'airline_type', FILTER_SANITIZE_STRING); |
|
79 | +$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING); |
|
80 | +$airport_country = filter_input(INPUT_GET, 'airport_country', FILTER_SANITIZE_STRING); |
|
81 | +$callsign = filter_input(INPUT_GET, 'callsign', FILTER_SANITIZE_STRING); |
|
82 | +$owner = filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING); |
|
83 | +$pilot_id = filter_input(INPUT_GET, 'pilot_id', FILTER_SANITIZE_STRING); |
|
84 | +$pilot_name = filter_input(INPUT_GET, 'pilot_name', FILTER_SANITIZE_STRING); |
|
85 | +$departure_airport_route = filter_input(INPUT_GET, 'departure_airport_route', FILTER_SANITIZE_STRING); |
|
86 | +$arrival_airport_route = filter_input(INPUT_GET, 'arrival_airport_route', FILTER_SANITIZE_STRING); |
|
87 | +$spotter_array = $Spotter->searchSpotterData($q, $registration, $aircraft, strtolower(str_replace("-", " ", $manufacturer)), $highlights, $airline, $airline_country, $airline_type, $airport, $airport_country, $callsign, $departure_airport_route, $arrival_airport_route, $owner, $pilot_id, $pilot_name, $sql_altitude, $sql_date, $limit_start.",".$absolute_difference, $sort, ''); |
|
88 | 88 | |
89 | 89 | $output = '<?xml version="1.0" encoding="UTF-8"?>'; |
90 | 90 | $output .= '<kml xmlns="http://www.opengis.net/kml/2.2">'; |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | $output .= '</Style>'; |
113 | 113 | |
114 | 114 | if (!empty($spotter_array)) { |
115 | - foreach($spotter_array as $spotter_item) { |
|
115 | + foreach ($spotter_array as $spotter_item) { |
|
116 | 116 | $altitude = $spotter_item['altitude'].'00'; |
117 | 117 | if ($spotter_item['waypoints'] != '') { |
118 | 118 | //waypoint plotting |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | $waypoint_pieces = explode(' ', $spotter_item['waypoints']); |
124 | 124 | $waypoint_pieces = array_chunk($waypoint_pieces, 2); |
125 | 125 | foreach ($waypoint_pieces as $waypoint_coordinate) { |
126 | - if (isset($waypoint_coordinate[1])) $output .= $waypoint_coordinate[1].','.$waypoint_coordinate[0].','.$altitude.' '; |
|
126 | + if (isset($waypoint_coordinate[1])) $output .= $waypoint_coordinate[1].','.$waypoint_coordinate[0].','.$altitude.' '; |
|
127 | 127 | } |
128 | 128 | $output .= '</coordinates>'; |
129 | 129 | $output .= '<altitudeMode>absolute</altitudeMode>'; |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | $output .= ' ]]></description>'; |
168 | 168 | $output .= '<styleUrl>#departureAirport</styleUrl>'; |
169 | 169 | $output .= '<Point>'; |
170 | - $output .= '<coordinates>'.$spotter_item['departure_airport_longitude'].', '.$spotter_item['departure_airport_latitude'].', '.$spotter_item['departure_airport_altitude'].'</coordinates>'; |
|
170 | + $output .= '<coordinates>'.$spotter_item['departure_airport_longitude'].', '.$spotter_item['departure_airport_latitude'].', '.$spotter_item['departure_airport_altitude'].'</coordinates>'; |
|
171 | 171 | $output .= '<altitudeMode>absolute</altitudeMode>'; |
172 | 172 | $output .= '</Point>'; |
173 | 173 | $output .= '</Placemark>'; |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | $output .= ' ]]></description>'; |
209 | 209 | $output .= '<styleUrl>#arrivalAirport</styleUrl>'; |
210 | 210 | $output .= '<Point>'; |
211 | - $output .= '<coordinates>'.$spotter_item['arrival_airport_longitude'].', '.$spotter_item['arrival_airport_latitude'].', '.$spotter_item['arrival_airport_altitude'].'</coordinates>'; |
|
211 | + $output .= '<coordinates>'.$spotter_item['arrival_airport_longitude'].', '.$spotter_item['arrival_airport_latitude'].', '.$spotter_item['arrival_airport_altitude'].'</coordinates>'; |
|
212 | 212 | $output .= '<altitudeMode>absolute</altitudeMode>'; |
213 | 213 | $output .= '</Point>'; |
214 | 214 | $output .= '</Placemark>'; |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | $output .= ' ]]></description>'; |
253 | 253 | $output .= '<styleUrl>#aircraft_'.$spotter_item['spotter_id'].'</styleUrl>'; |
254 | 254 | $output .= '<Point>'; |
255 | - $output .= '<coordinates>'.$spotter_item['longitude'].', '.$spotter_item['latitude'].', '.$altitude.'</coordinates>'; |
|
255 | + $output .= '<coordinates>'.$spotter_item['longitude'].', '.$spotter_item['latitude'].', '.$altitude.'</coordinates>'; |
|
256 | 256 | $output .= '<altitudeMode>absolute</altitudeMode>'; |
257 | 257 | $output .= '</Point>'; |
258 | 258 | $output .= '</Placemark>'; |
@@ -15,8 +15,12 @@ discard block |
||
15 | 15 | } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){ |
16 | 16 | $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00"; |
17 | 17 | $sql_date = $end_date; |
18 | - } else $sql_date = ''; |
|
19 | -} else $sql_date = ''; |
|
18 | + } else { |
|
19 | + $sql_date = ''; |
|
20 | + } |
|
21 | + } else { |
|
22 | + $sql_date = ''; |
|
23 | +} |
|
20 | 24 | |
21 | 25 | if (isset($_GET['highest_altitude'])) { |
22 | 26 | //for altitude manipulation |
@@ -30,8 +34,12 @@ discard block |
||
30 | 34 | } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){ |
31 | 35 | $start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT).",60000"; |
32 | 36 | $sql_altitude = $start_altitude; |
33 | - } else $sql_altitude = ''; |
|
34 | -} else $sql_altitude = ''; |
|
37 | + } else { |
|
38 | + $sql_altitude = ''; |
|
39 | + } |
|
40 | + } else { |
|
41 | + $sql_altitude = ''; |
|
42 | +} |
|
35 | 43 | |
36 | 44 | //calculuation for the pagination |
37 | 45 | if(!isset($_GET['limit'])) |
@@ -48,7 +56,7 @@ discard block |
||
48 | 56 | $limit_end = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT); |
49 | 57 | $absolute_difference = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT); |
50 | 58 | } |
51 | -} else { |
|
59 | +} else { |
|
52 | 60 | $limit_explode = explode(",", $_GET['limit']); |
53 | 61 | $limit_start = filter_var($limit_explode[0],FILTER_SANITIZE_NUMBER_INT); |
54 | 62 | $limit_end = filter_var($limit_explode[1],FILTER_SANITIZE_NUMBER_INT); |
@@ -66,8 +74,11 @@ discard block |
||
66 | 74 | |
67 | 75 | header('Content-Type: text/xml'); |
68 | 76 | |
69 | -if (isset($_GET['sort'])) $sort = $_GET['sort']; |
|
70 | -else $sort = ''; |
|
77 | +if (isset($_GET['sort'])) { |
|
78 | + $sort = $_GET['sort']; |
|
79 | +} else { |
|
80 | + $sort = ''; |
|
81 | +} |
|
71 | 82 | $q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING); |
72 | 83 | $registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING); |
73 | 84 | $aircraft = filter_input(INPUT_GET,'aircraft',FILTER_SANITIZE_STRING); |
@@ -123,7 +134,9 @@ discard block |
||
123 | 134 | $waypoint_pieces = explode(' ', $spotter_item['waypoints']); |
124 | 135 | $waypoint_pieces = array_chunk($waypoint_pieces, 2); |
125 | 136 | foreach ($waypoint_pieces as $waypoint_coordinate) { |
126 | - if (isset($waypoint_coordinate[1])) $output .= $waypoint_coordinate[1].','.$waypoint_coordinate[0].','.$altitude.' '; |
|
137 | + if (isset($waypoint_coordinate[1])) { |
|
138 | + $output .= $waypoint_coordinate[1].','.$waypoint_coordinate[0].','.$altitude.' '; |
|
139 | + } |
|
127 | 140 | } |
128 | 141 | $output .= '</coordinates>'; |
129 | 142 | $output .= '<altitudeMode>absolute</altitudeMode>'; |
@@ -4,10 +4,15 @@ discard block |
||
4 | 4 | |
5 | 5 | setcookie("MapFormat",'2d'); |
6 | 6 | |
7 | -if (!isset($globalOpenWeatherMapKey)) $globalOpenWeatherMapKey = ''; |
|
7 | +if (!isset($globalOpenWeatherMapKey)) { |
|
8 | + $globalOpenWeatherMapKey = ''; |
|
9 | +} |
|
8 | 10 | // Compressed GeoJson is used if true |
9 | -if (!isset($globalJsonCompress)) $compress = true; |
|
10 | -else $compress = $globalJsonCompress; |
|
11 | +if (!isset($globalJsonCompress)) { |
|
12 | + $compress = true; |
|
13 | +} else { |
|
14 | + $compress = $globalJsonCompress; |
|
15 | +} |
|
11 | 16 | if (isset($_GET['archive'])) { |
12 | 17 | $archive = true; |
13 | 18 | //$archiveupdatetime = 50; |
@@ -18,8 +23,11 @@ discard block |
||
18 | 23 | //$lastupd = round(($_GET['enddate']-$_GET['begindate'])/(($_GET['during']*60)/10)); |
19 | 24 | //$lastupd = 20; |
20 | 25 | $lastupd = $_GET['archivespeed']*$archiveupdatetime; |
21 | - if (isset($_GET['enddate']) && $_GET['enddate'] != '') $enddate = $_GET['enddate']; |
|
22 | - else $enddate = time(); |
|
26 | + if (isset($_GET['enddate']) && $_GET['enddate'] != '') { |
|
27 | + $enddate = $_GET['enddate']; |
|
28 | + } else { |
|
29 | + $enddate = time(); |
|
30 | + } |
|
23 | 31 | setcookie("archive_begin",$begindate); |
24 | 32 | setcookie("archive_end",$enddate); |
25 | 33 | setcookie("archive_update",$lastupd); |
@@ -107,7 +115,17 @@ discard block |
||
107 | 115 | } |
108 | 116 | |
109 | 117 | //create the map |
110 | - map = L.map('archive-map', { zoomControl:false }).setView([<?php if (isset($latitude)) print $latitude; else print $globalCenterLatitude; ?>,<?php if (isset($longitude)) print $longitude; else print $globalCenterLongitude; ?>], zoom); |
|
118 | + map = L.map('archive-map', { zoomControl:false }).setView([<?php if (isset($latitude)) { |
|
119 | + print $latitude; |
|
120 | +} else { |
|
121 | + print $globalCenterLatitude; |
|
122 | +} |
|
123 | +?>,<?php if (isset($longitude)) { |
|
124 | + print $longitude; |
|
125 | +} else { |
|
126 | + print $globalCenterLongitude; |
|
127 | +} |
|
128 | +?>], zoom); |
|
111 | 129 | <?php |
112 | 130 | } else { |
113 | 131 | if ((isset($globalCenterLatitude) && $globalCenterLatitude != '' && isset($globalCenterLongitude) && $globalCenterLongitude != '') || isset($_COOKIE['lastcentercoord'])) { |
@@ -133,9 +151,21 @@ discard block |
||
133 | 151 | || navigator.userAgent.match(/BlackBerry/i) |
134 | 152 | || navigator.userAgent.match(/Windows Phone/i)) |
135 | 153 | { |
136 | - var zoom = <?php if (isset($viewzoom) && $viewzoom == $globalLiveZoom) print $viewzoom-1; elseif (isset($viewzoom)) print $viewzoom; else print '8'; ?>; |
|
154 | + var zoom = <?php if (isset($viewzoom) && $viewzoom == $globalLiveZoom) { |
|
155 | + print $viewzoom-1; |
|
156 | +} elseif (isset($viewzoom)) { |
|
157 | + print $viewzoom; |
|
158 | +} else { |
|
159 | + print '8'; |
|
160 | +} |
|
161 | +?>; |
|
137 | 162 | } else { |
138 | - var zoom = <?php if (isset($viewzoom)) print $viewzoom; else print '9'; ?>; |
|
163 | + var zoom = <?php if (isset($viewzoom)) { |
|
164 | + print $viewzoom; |
|
165 | +} else { |
|
166 | + print '9'; |
|
167 | +} |
|
168 | +?>; |
|
139 | 169 | } |
140 | 170 | |
141 | 171 | //create the map |
@@ -160,16 +190,27 @@ discard block |
||
160 | 190 | bounds = L.latLngBounds(southWest,northEast); |
161 | 191 | //a few title layers |
162 | 192 | <?php |
163 | - if (isset($_COOKIE['MapType'])) $MapType = $_COOKIE['MapType']; |
|
164 | - else $MapType = $globalMapProvider; |
|
193 | + if (isset($_COOKIE['MapType'])) { |
|
194 | + $MapType = $_COOKIE['MapType']; |
|
195 | + } else { |
|
196 | + $MapType = $globalMapProvider; |
|
197 | + } |
|
165 | 198 | |
166 | 199 | if ($MapType == 'Mapbox') { |
167 | - if ($_COOKIE['MapTypeId'] == 'default') $MapBoxId = $globalMapboxId; |
|
168 | - else $MapBoxId = $_COOKIE['MapTypeId']; |
|
169 | -?> |
|
200 | + if ($_COOKIE['MapTypeId'] == 'default') { |
|
201 | + $MapBoxId = $globalMapboxId; |
|
202 | + } else { |
|
203 | + $MapBoxId = $_COOKIE['MapTypeId']; |
|
204 | + } |
|
205 | + ?> |
|
170 | 206 | L.tileLayer('https://{s}.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={token}', { |
171 | 207 | maxZoom: 18, |
172 | - noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) print 'false'; else print 'true'; ?>, |
|
208 | + noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) { |
|
209 | + print 'false'; |
|
210 | +} else { |
|
211 | + print 'true'; |
|
212 | +} |
|
213 | +?>, |
|
173 | 214 | attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' + |
174 | 215 | '<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' + |
175 | 216 | 'Imagery © <a href="http://mapbox.com">Mapbox</a>', |
@@ -181,7 +222,12 @@ discard block |
||
181 | 222 | ?> |
182 | 223 | L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { |
183 | 224 | maxZoom: 18, |
184 | - noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) print 'false'; else print 'true'; ?>, |
|
225 | + noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) { |
|
226 | + print 'false'; |
|
227 | +} else { |
|
228 | + print 'true'; |
|
229 | +} |
|
230 | +?>, |
|
185 | 231 | attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' + |
186 | 232 | '<a href="www.openstreetmap.org/copyright">Open Database Licence</a>' |
187 | 233 | }).addTo(map); |
@@ -227,20 +273,26 @@ discard block |
||
227 | 273 | map.addLayer(yandexLayer); |
228 | 274 | <?php |
229 | 275 | } elseif ($MapType == 'Bing-Aerial') { |
230 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
231 | -?> |
|
276 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') { |
|
277 | + setcookie('MapType','OpenStreetMap'); |
|
278 | + } |
|
279 | + ?> |
|
232 | 280 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'Aerial'}); |
233 | 281 | map.addLayer(bingLayer); |
234 | 282 | <?php |
235 | 283 | } elseif ($MapType == 'Bing-Hybrid') { |
236 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
237 | -?> |
|
284 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') { |
|
285 | + setcookie('MapType','OpenStreetMap'); |
|
286 | + } |
|
287 | + ?> |
|
238 | 288 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'AerialWithLabels'}); |
239 | 289 | map.addLayer(bingLayer); |
240 | 290 | <?php |
241 | 291 | } elseif ($MapType == 'Bing-Road') { |
242 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
243 | -?> |
|
292 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') { |
|
293 | + setcookie('MapType','OpenStreetMap'); |
|
294 | + } |
|
295 | + ?> |
|
244 | 296 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'Road'}); |
245 | 297 | map.addLayer(bingLayer); |
246 | 298 | <?php |
@@ -263,9 +315,24 @@ discard block |
||
263 | 315 | $customid = $MapType; |
264 | 316 | ?> |
265 | 317 | L.tileLayer('<?php print $globalMapCustomLayer[$customid]['url']; ?>/{z}/{x}/{y}.png', { |
266 | - maxZoom: <?php if (isset($globalMapCustomLayer[$customid]['maxZoom'])) print $globalMapCustomLayer[$customid]['maxZoom']; else print '18'; ?>, |
|
267 | - minZoom: <?php if (isset($globalMapCustomLayer[$customid]['minZoom'])) print $globalMapCustomLayer[$customid]['minZoom']; else print '0'; ?>, |
|
268 | - noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) print 'false'; else print 'true'; ?>, |
|
318 | + maxZoom: <?php if (isset($globalMapCustomLayer[$customid]['maxZoom'])) { |
|
319 | + print $globalMapCustomLayer[$customid]['maxZoom']; |
|
320 | +} else { |
|
321 | + print '18'; |
|
322 | +} |
|
323 | +?>, |
|
324 | + minZoom: <?php if (isset($globalMapCustomLayer[$customid]['minZoom'])) { |
|
325 | + print $globalMapCustomLayer[$customid]['minZoom']; |
|
326 | +} else { |
|
327 | + print '0'; |
|
328 | +} |
|
329 | +?>, |
|
330 | + noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) { |
|
331 | + print 'false'; |
|
332 | +} else { |
|
333 | + print 'true'; |
|
334 | +} |
|
335 | +?>, |
|
269 | 336 | attribution: '<?php print $globalMapCustomLayer[$customid]['attribution']; ?>' |
270 | 337 | }).addTo(map); |
271 | 338 | |
@@ -299,7 +366,12 @@ discard block |
||
299 | 366 | } |
300 | 367 | } elseif ($globalBounding == 'circle') { |
301 | 368 | ?> |
302 | - var circle = L.circle([<?php print $globalCenterLatitude; ?>, <?php print $globalCenterLongitude; ?>],<?php if (isset($globalBoundingCircleSize)) print $globalBoundingCircleSize; else print '70000'; ?>,{ |
|
369 | + var circle = L.circle([<?php print $globalCenterLatitude; ?>, <?php print $globalCenterLongitude; ?>],<?php if (isset($globalBoundingCircleSize)) { |
|
370 | + print $globalBoundingCircleSize; |
|
371 | +} else { |
|
372 | + print '70000'; |
|
373 | +} |
|
374 | +?>,{ |
|
303 | 375 | color: '#92C7D1', |
304 | 376 | fillColor: '#92C7D1', |
305 | 377 | fillOpacity: 0.3, |
@@ -398,7 +470,12 @@ discard block |
||
398 | 470 | createCookie('lastcentercoord',map.getCenter().lat+','+map.getCenter().lng+','+map.getZoom(),2); |
399 | 471 | }); |
400 | 472 | update_locationsLayer(); |
401 | -setInterval(function(){update_locationsLayer()},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>); |
|
473 | +setInterval(function(){update_locationsLayer()},<?php if (isset($globalMapRefresh)) { |
|
474 | + print $globalMapRefresh*1000*2; |
|
475 | +} else { |
|
476 | + print '60000'; |
|
477 | +} |
|
478 | +?>); |
|
402 | 479 | |
403 | 480 | <?php |
404 | 481 | // Add support for custom json via $globalMapJson |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | require_once('../require/settings.php'); |
3 | 3 | require_once('../require/class.Language.php'); |
4 | 4 | |
5 | -setcookie("MapFormat",'2d'); |
|
5 | +setcookie("MapFormat", '2d'); |
|
6 | 6 | |
7 | 7 | if (!isset($globalOpenWeatherMapKey)) $globalOpenWeatherMapKey = ''; |
8 | 8 | // Compressed GeoJson is used if true |
@@ -20,10 +20,10 @@ discard block |
||
20 | 20 | $lastupd = $_GET['archivespeed']*$archiveupdatetime; |
21 | 21 | if (isset($_GET['enddate']) && $_GET['enddate'] != '') $enddate = $_GET['enddate']; |
22 | 22 | else $enddate = time(); |
23 | - setcookie("archive_begin",$begindate); |
|
24 | - setcookie("archive_end",$enddate); |
|
25 | - setcookie("archive_update",$lastupd); |
|
26 | - setcookie("archive_speed",$archivespeed); |
|
23 | + setcookie("archive_begin", $begindate); |
|
24 | + setcookie("archive_end", $enddate); |
|
25 | + setcookie("archive_update", $lastupd); |
|
26 | + setcookie("archive_speed", $archivespeed); |
|
27 | 27 | ?> |
28 | 28 | document.cookie = 'archive_begin=<?php print $begindate; ?>; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/'; |
29 | 29 | document.cookie = 'archive_end=<?php print $enddate; ?>; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/'; |
@@ -75,16 +75,16 @@ discard block |
||
75 | 75 | <?php |
76 | 76 | } |
77 | 77 | if (isset($_GET['ident'])) { |
78 | - $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
|
78 | + $ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING); |
|
79 | 79 | } |
80 | 80 | if (isset($_GET['flightaware_id'])) { |
81 | - $flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING); |
|
81 | + $flightaware_id = filter_input(INPUT_GET, 'flightaware_id', FILTER_SANITIZE_STRING); |
|
82 | 82 | } |
83 | 83 | if (isset($_GET['latitude'])) { |
84 | - $latitude = filter_input(INPUT_GET,'latitude',FILTER_SANITIZE_STRING); |
|
84 | + $latitude = filter_input(INPUT_GET, 'latitude', FILTER_SANITIZE_STRING); |
|
85 | 85 | } |
86 | 86 | if (isset($_GET['longitude'])) { |
87 | - $longitude = filter_input(INPUT_GET,'longitude',FILTER_SANITIZE_STRING); |
|
87 | + $longitude = filter_input(INPUT_GET, 'longitude', FILTER_SANITIZE_STRING); |
|
88 | 88 | } |
89 | 89 | ?> |
90 | 90 | |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | } else { |
113 | 113 | if ((isset($globalCenterLatitude) && $globalCenterLatitude != '' && isset($globalCenterLongitude) && $globalCenterLongitude != '') || isset($_COOKIE['lastcentercoord'])) { |
114 | 114 | if (isset($_COOKIE['lastcentercoord'])) { |
115 | - $lastcentercoord = explode(',',$_COOKIE['lastcentercoord']); |
|
115 | + $lastcentercoord = explode(',', $_COOKIE['lastcentercoord']); |
|
116 | 116 | $viewcenterlatitude = $lastcentercoord[0]; |
117 | 117 | $viewcenterlongitude = $lastcentercoord[1]; |
118 | 118 | $viewzoom = $lastcentercoord[2]; |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | || navigator.userAgent.match(/BlackBerry/i) |
134 | 134 | || navigator.userAgent.match(/Windows Phone/i)) |
135 | 135 | { |
136 | - var zoom = <?php if (isset($viewzoom) && $viewzoom == $globalLiveZoom) print $viewzoom-1; elseif (isset($viewzoom)) print $viewzoom; else print '8'; ?>; |
|
136 | + var zoom = <?php if (isset($viewzoom) && $viewzoom == $globalLiveZoom) print $viewzoom - 1; elseif (isset($viewzoom)) print $viewzoom; else print '8'; ?>; |
|
137 | 137 | } else { |
138 | 138 | var zoom = <?php if (isset($viewzoom)) print $viewzoom; else print '9'; ?>; |
139 | 139 | } |
@@ -227,19 +227,19 @@ discard block |
||
227 | 227 | map.addLayer(yandexLayer); |
228 | 228 | <?php |
229 | 229 | } elseif ($MapType == 'Bing-Aerial') { |
230 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
230 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType', 'OpenStreetMap'); |
|
231 | 231 | ?> |
232 | 232 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'Aerial'}); |
233 | 233 | map.addLayer(bingLayer); |
234 | 234 | <?php |
235 | 235 | } elseif ($MapType == 'Bing-Hybrid') { |
236 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
236 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType', 'OpenStreetMap'); |
|
237 | 237 | ?> |
238 | 238 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'AerialWithLabels'}); |
239 | 239 | map.addLayer(bingLayer); |
240 | 240 | <?php |
241 | 241 | } elseif ($MapType == 'Bing-Road') { |
242 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
242 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType', 'OpenStreetMap'); |
|
243 | 243 | ?> |
244 | 244 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'Road'}); |
245 | 245 | map.addLayer(bingLayer); |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | |
358 | 358 | function update_tsk() { |
359 | 359 | var bbox = map.getBounds().toBBoxString(); |
360 | - var tskLayerQuery = $.getJSON("<?php print $globalURL; ?>/tsk-geojson.php?tsk=<?php echo filter_input(INPUT_GET,'tsk',FILTER_SANITIZE_URL); ?>",function (data) { |
|
360 | + var tskLayerQuery = $.getJSON("<?php print $globalURL; ?>/tsk-geojson.php?tsk=<?php echo filter_input(INPUT_GET, 'tsk', FILTER_SANITIZE_URL); ?>",function (data) { |
|
361 | 361 | tskLayer = L.geoJson(data,{ |
362 | 362 | onEachFeature: function (feature, layer) { |
363 | 363 | tskPopup(feature, layer); |
@@ -343,7 +343,7 @@ discard block |
||
343 | 343 | }; |
344 | 344 | |
345 | 345 | <?php |
346 | - if (isset($globalTSK) && $globalTSK && isset($_GET['tsk'])) { |
|
346 | + if (isset($globalTSK) && $globalTSK && isset($_GET['tsk'])) { |
|
347 | 347 | ?> |
348 | 348 | function tskPopup (feature, layer) { |
349 | 349 | var output = ''; |
@@ -378,7 +378,7 @@ discard block |
||
378 | 378 | }; |
379 | 379 | update_tsk(); |
380 | 380 | <?php |
381 | - } |
|
381 | + } |
|
382 | 382 | ?> |
383 | 383 | map.on('moveend', function() { |
384 | 384 | //if (map.getZoom() > 7) { |
@@ -394,10 +394,10 @@ discard block |
||
394 | 394 | setInterval(function(){update_locationsLayer()},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>); |
395 | 395 | |
396 | 396 | <?php |
397 | - // Add support for custom json via $globalMapJson |
|
398 | - if (isset($globalMapJson) && is_array($globalMapJson)) { |
|
397 | + // Add support for custom json via $globalMapJson |
|
398 | + if (isset($globalMapJson) && is_array($globalMapJson)) { |
|
399 | 399 | foreach ($globalMapJson as $json) { |
400 | - if (isset($json['url'])) { |
|
400 | + if (isset($json['url'])) { |
|
401 | 401 | ?> |
402 | 402 | update_genLayer('<?php print $json['url']; ?>'); |
403 | 403 | <?php |
@@ -406,9 +406,9 @@ discard block |
||
406 | 406 | setInterval(function(){update_genLayer('<?php print $json['url']; ?>')}, <?php print $json['refresh']; ?>); |
407 | 407 | <?php |
408 | 408 | } |
409 | - } |
|
409 | + } |
|
410 | + } |
|
410 | 411 | } |
411 | - } |
|
412 | 412 | |
413 | 413 | ?> |
414 | 414 | //adds the bootstrap tooltip to the map icons |
@@ -39,30 +39,30 @@ discard block |
||
39 | 39 | |
40 | 40 | |
41 | 41 | function quaternionrotate($heading, $attitude = 0, $bank = 0) { |
42 | - // Assuming the angles are in radians. |
|
43 | - $c1 = cos($heading/2); |
|
44 | - $s1 = sin($heading/2); |
|
45 | - $c2 = cos($attitude/2); |
|
46 | - $s2 = sin($attitude/2); |
|
47 | - $c3 = cos($bank/2); |
|
48 | - $s3 = sin($bank/2); |
|
49 | - $c1c2 = $c1*$c2; |
|
50 | - $s1s2 = $s1*$s2; |
|
51 | - $w =$c1c2*$c3 - $s1s2*$s3; |
|
52 | - $x =$c1c2*$s3 + $s1s2*$c3; |
|
53 | - $y =$s1*$c2*$c3 + $c1*$s2*$s3; |
|
54 | - $z =$c1*$s2*$c3 - $s1*$c2*$s3; |
|
55 | - return array('x' => $x,'y' => $y,'z' => $z,'w' => $w); |
|
42 | + // Assuming the angles are in radians. |
|
43 | + $c1 = cos($heading/2); |
|
44 | + $s1 = sin($heading/2); |
|
45 | + $c2 = cos($attitude/2); |
|
46 | + $s2 = sin($attitude/2); |
|
47 | + $c3 = cos($bank/2); |
|
48 | + $s3 = sin($bank/2); |
|
49 | + $c1c2 = $c1*$c2; |
|
50 | + $s1s2 = $s1*$s2; |
|
51 | + $w =$c1c2*$c3 - $s1s2*$s3; |
|
52 | + $x =$c1c2*$s3 + $s1s2*$c3; |
|
53 | + $y =$s1*$c2*$c3 + $c1*$s2*$s3; |
|
54 | + $z =$c1*$s2*$c3 - $s1*$c2*$s3; |
|
55 | + return array('x' => $x,'y' => $y,'z' => $z,'w' => $w); |
|
56 | 56 | // return array('x' => '0.0','y' => '-0.931','z' => '0.0','w' => '0.365'); |
57 | 57 | |
58 | 58 | } |
59 | 59 | |
60 | 60 | |
61 | 61 | if (isset($_GET['download'])) { |
62 | - if ($_GET['download'] == "true") |
|
63 | - { |
|
62 | + if ($_GET['download'] == "true") |
|
63 | + { |
|
64 | 64 | header('Content-disposition: attachment; filename="flightairmap.json"'); |
65 | - } |
|
65 | + } |
|
66 | 66 | } |
67 | 67 | header('Content-Type: text/javascript'); |
68 | 68 | |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | if (isset($_GET['coord']) && $_GET['coord'] != '') { |
156 | 156 | $coord = explode(',',$_GET['coord']); |
157 | 157 | if (!(filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT) |
158 | - && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) { |
|
158 | + && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) { |
|
159 | 159 | $coord = array(); |
160 | 160 | } |
161 | 161 | } |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | if (isset($_GET['coord']) && $_GET['coord'] != '') { |
166 | 166 | $coord = explode(',',$_GET['coord']); |
167 | 167 | if (!(filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT) |
168 | - && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) { |
|
168 | + && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) { |
|
169 | 169 | $coord = array(); |
170 | 170 | } |
171 | 171 | } |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | if (isset($_GET['coord']) && $_GET['coord'] != '') { |
176 | 176 | $coord = explode(',',$_GET['coord']); |
177 | 177 | if (!(filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT) |
178 | - && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) { |
|
178 | + && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) { |
|
179 | 179 | $coord = array(); |
180 | 180 | } |
181 | 181 | } |
@@ -265,10 +265,10 @@ discard block |
||
265 | 265 | $image = "images/placeholder_thumb.png"; |
266 | 266 | } |
267 | 267 | |
268 | - if (isset($spotter_item['flightaware_id'])) $id = $spotter_item['flightaware_id']; |
|
269 | - elseif (isset($spotter_item['famtrackid'])) $id = $spotter_item['famtrackid']; |
|
270 | - elseif (isset($spotter_item['fammarine_id'])) $id = $spotter_item['fammarine_id']; |
|
271 | - if ($prev_flightaware_id != $id) { |
|
268 | + if (isset($spotter_item['flightaware_id'])) $id = $spotter_item['flightaware_id']; |
|
269 | + elseif (isset($spotter_item['famtrackid'])) $id = $spotter_item['famtrackid']; |
|
270 | + elseif (isset($spotter_item['fammarine_id'])) $id = $spotter_item['fammarine_id']; |
|
271 | + if ($prev_flightaware_id != $id) { |
|
272 | 272 | if ($prev_flightaware_id != '') { |
273 | 273 | /* |
274 | 274 | if ($nblatlong == 1) { |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | $spotter_item['wake_category'] = $aircraft_info[0]['wake_category']; |
349 | 349 | $spotter_item['engine_count'] = $aircraft_info[0]['engine_count']; |
350 | 350 | } else $aircraft_shadow = ''; |
351 | - $output .= ' "billboard" : {"image" : "'.$globalURL.'/images/aircrafts/new/'.$aircraft_shadow.'","scale" : 0.5'; |
|
351 | + $output .= ' "billboard" : {"image" : "'.$globalURL.'/images/aircrafts/new/'.$aircraft_shadow.'","scale" : 0.5'; |
|
352 | 352 | if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true' && isset($_COOKIE['IconColor'])) { |
353 | 353 | $rgb = $Common->hex2rgb($_COOKIE['IconColor']); |
354 | 354 | $output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}'; |
@@ -379,7 +379,7 @@ discard block |
||
379 | 379 | $rgb = $Common->hex2rgb($_COOKIE['IconColor']); |
380 | 380 | $output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}'; |
381 | 381 | } |
382 | - $output .= '},'; |
|
382 | + $output .= '},'; |
|
383 | 383 | } elseif (isset($modelsdb[$aircraft_icao]) && $aircraft_icao != '') { |
384 | 384 | $output .= '"model": {"gltf" : "'.$globalURL.'/models/'.$modelsdb[$aircraft_icao].'","scale" : 1.0,"minimumPixelSize": 20'; |
385 | 385 | $output .= ',"heightReference": "'.$heightrelative.'"'; |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | $rgb = $Common->hex2rgb($_COOKIE['IconColor']); |
388 | 388 | $output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}'; |
389 | 389 | } |
390 | - $output .= '},'; |
|
390 | + $output .= '},'; |
|
391 | 391 | } elseif ($aircraft_icao != '') { |
392 | 392 | $aircraft_info = $Spotter->getAllAircraftInfo($aircraft_icao); |
393 | 393 | if (isset($aircraft_info[0]['engine_type'])) { |
@@ -56,11 +56,11 @@ discard block |
||
56 | 56 | $s3 = sin($bank/2); |
57 | 57 | $c1c2 = $c1*$c2; |
58 | 58 | $s1s2 = $s1*$s2; |
59 | - $w =$c1c2*$c3 - $s1s2*$s3; |
|
60 | - $x =$c1c2*$s3 + $s1s2*$c3; |
|
61 | - $y =$s1*$c2*$c3 + $c1*$s2*$s3; |
|
62 | - $z =$c1*$s2*$c3 - $s1*$c2*$s3; |
|
63 | - return array('x' => $x,'y' => $y,'z' => $z,'w' => $w); |
|
59 | + $w = $c1c2*$c3 - $s1s2*$s3; |
|
60 | + $x = $c1c2*$s3 + $s1s2*$c3; |
|
61 | + $y = $s1*$c2*$c3 + $c1*$s2*$s3; |
|
62 | + $z = $c1*$s2*$c3 - $s1*$c2*$s3; |
|
63 | + return array('x' => $x, 'y' => $y, 'z' => $z, 'w' => $w); |
|
64 | 64 | // return array('x' => '0.0','y' => '-0.931','z' => '0.0','w' => '0.365'); |
65 | 65 | |
66 | 66 | } |
@@ -81,17 +81,17 @@ discard block |
||
81 | 81 | $min = false; |
82 | 82 | $allhistory = false; |
83 | 83 | $filter['source'] = array(); |
84 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
85 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
86 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
87 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs')); |
|
88 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
89 | -if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
90 | -if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING); |
|
91 | -if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
92 | -if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
93 | -if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
94 | -if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING); |
|
84 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'], array('vatsimtxt')); |
|
85 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'], array('whazzup')); |
|
86 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'], array('phpvmacars')); |
|
87 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'], array('sbs', 'famaprs')); |
|
88 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'], array('aprs')); |
|
89 | +if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'], FILTER_SANITIZE_STRING); |
|
90 | +if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'], FILTER_SANITIZE_STRING); |
|
91 | +if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',', $_COOKIE['filter_Airlines']), FILTER_SANITIZE_STRING); |
|
92 | +if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',', $_COOKIE['filter_Sources']), FILTER_SANITIZE_STRING); |
|
93 | +if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'], FILTER_SANITIZE_STRING); |
|
94 | +if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'], FILTER_SANITIZE_STRING); |
|
95 | 95 | /* |
96 | 96 | if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) { |
97 | 97 | $min = true; |
@@ -138,12 +138,12 @@ discard block |
||
138 | 138 | $from_archive = true; |
139 | 139 | // $begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
140 | 140 | // $enddate = filter_input(INPUT_GET,'enddate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
141 | - $begindate = filter_input(INPUT_GET,'begindate',FILTER_SANITIZE_NUMBER_INT); |
|
142 | - $enddate = filter_input(INPUT_GET,'enddate',FILTER_SANITIZE_NUMBER_INT); |
|
143 | - $archivespeed = filter_input(INPUT_GET,'speed',FILTER_SANITIZE_NUMBER_INT); |
|
144 | - $begindate = date('Y-m-d H:i:s',$begindate); |
|
145 | - $enddate = date('Y-m-d H:i:s',$enddate); |
|
146 | - $spotter_array = $SpotterArchive->getMinLiveSpotterDataPlayback($begindate,$enddate,$filter); |
|
141 | + $begindate = filter_input(INPUT_GET, 'begindate', FILTER_SANITIZE_NUMBER_INT); |
|
142 | + $enddate = filter_input(INPUT_GET, 'enddate', FILTER_SANITIZE_NUMBER_INT); |
|
143 | + $archivespeed = filter_input(INPUT_GET, 'speed', FILTER_SANITIZE_NUMBER_INT); |
|
144 | + $begindate = date('Y-m-d H:i:s', $begindate); |
|
145 | + $enddate = date('Y-m-d H:i:s', $enddate); |
|
146 | + $spotter_array = $SpotterArchive->getMinLiveSpotterDataPlayback($begindate, $enddate, $filter); |
|
147 | 147 | } elseif (isset($_COOKIE['archive']) && isset($_COOKIE['archive_begin']) && isset($_COOKIE['archive_end']) && isset($_COOKIE['archive_speed'])) { |
148 | 148 | $from_archive = true; |
149 | 149 | // $begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
@@ -153,46 +153,46 @@ discard block |
||
153 | 153 | $begindate = $_COOKIE['archive_begin']; |
154 | 154 | $enddate = $_COOKIE['archive_end']; |
155 | 155 | |
156 | - $archivespeed = filter_var($_COOKIE['archive_speed'],FILTER_SANITIZE_NUMBER_INT); |
|
157 | - $begindate = date('Y-m-d H:i:s',$begindate); |
|
158 | - $enddate = date('Y-m-d H:i:s',$enddate); |
|
156 | + $archivespeed = filter_var($_COOKIE['archive_speed'], FILTER_SANITIZE_NUMBER_INT); |
|
157 | + $begindate = date('Y-m-d H:i:s', $begindate); |
|
158 | + $enddate = date('Y-m-d H:i:s', $enddate); |
|
159 | 159 | // echo 'Begin : '.$begindate.' - End : '.$enddate."\n"; |
160 | - $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate,$enddate,$filter); |
|
160 | + $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate, $enddate, $filter); |
|
161 | 161 | } elseif ($tracker) { |
162 | 162 | $coord = array(); |
163 | 163 | if (isset($_GET['coord']) && $_GET['coord'] != '') { |
164 | - $coord = explode(',',$_GET['coord']); |
|
165 | - if (!(filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT) |
|
164 | + $coord = explode(',', $_GET['coord']); |
|
165 | + if (!(filter_var($coord[0], FILTER_VALIDATE_FLOAT) && filter_var($coord[1], FILTER_VALIDATE_FLOAT) && filter_var($coord[2], FILTER_VALIDATE_FLOAT) && filter_var($coord[3], FILTER_VALIDATE_FLOAT) |
|
166 | 166 | && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) { |
167 | 167 | $coord = array(); |
168 | 168 | } |
169 | 169 | } |
170 | - $spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord,$filter,true); |
|
170 | + $spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord, $filter, true); |
|
171 | 171 | } elseif ($marine) { |
172 | 172 | $coord = array(); |
173 | 173 | if (isset($_GET['coord']) && $_GET['coord'] != '') { |
174 | - $coord = explode(',',$_GET['coord']); |
|
175 | - if (!(filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT) |
|
174 | + $coord = explode(',', $_GET['coord']); |
|
175 | + if (!(filter_var($coord[0], FILTER_VALIDATE_FLOAT) && filter_var($coord[1], FILTER_VALIDATE_FLOAT) && filter_var($coord[2], FILTER_VALIDATE_FLOAT) && filter_var($coord[3], FILTER_VALIDATE_FLOAT) |
|
176 | 176 | && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) { |
177 | 177 | $coord = array(); |
178 | 178 | } |
179 | 179 | } |
180 | - $spotter_array = $MarineLive->getMinLastLiveMarineData($coord,$filter,true); |
|
180 | + $spotter_array = $MarineLive->getMinLastLiveMarineData($coord, $filter, true); |
|
181 | 181 | } else { |
182 | 182 | $coord = array(); |
183 | 183 | if (isset($_GET['coord']) && $_GET['coord'] != '') { |
184 | - $coord = explode(',',$_GET['coord']); |
|
185 | - if (!(filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT) |
|
184 | + $coord = explode(',', $_GET['coord']); |
|
185 | + if (!(filter_var($coord[0], FILTER_VALIDATE_FLOAT) && filter_var($coord[1], FILTER_VALIDATE_FLOAT) && filter_var($coord[2], FILTER_VALIDATE_FLOAT) && filter_var($coord[3], FILTER_VALIDATE_FLOAT) |
|
186 | 186 | && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) { |
187 | 187 | $coord = array(); |
188 | 188 | } |
189 | 189 | } |
190 | - $spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord,$filter,true); |
|
190 | + $spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord, $filter, true); |
|
191 | 191 | } |
192 | 192 | //print_r($spotter_array); |
193 | 193 | if (!empty($spotter_array) && isset($coord)) { |
194 | 194 | if (isset($_GET['archive'])) { |
195 | - $flightcnt = $SpotterArchive->getLiveSpotterCount($begindate,$enddate,$filter); |
|
195 | + $flightcnt = $SpotterArchive->getLiveSpotterCount($begindate, $enddate, $filter); |
|
196 | 196 | } elseif ($tracker) { |
197 | 197 | $flightcnt = $TrackerLive->getLiveTrackerCount($filter); |
198 | 198 | } elseif ($marine) { |
@@ -203,15 +203,15 @@ discard block |
||
203 | 203 | if ($flightcnt == '') $flightcnt = 0; |
204 | 204 | } else $flightcnt = 0; |
205 | 205 | |
206 | -$sqltime = round(microtime(true)-$begintime,2); |
|
206 | +$sqltime = round(microtime(true) - $begintime, 2); |
|
207 | 207 | $minitime = time(); |
208 | 208 | $maxitime = 0; |
209 | -$lastupdate = filter_input(INPUT_GET,'update',FILTER_SANITIZE_NUMBER_INT); |
|
209 | +$lastupdate = filter_input(INPUT_GET, 'update', FILTER_SANITIZE_NUMBER_INT); |
|
210 | 210 | $modelsdb = array(); |
211 | 211 | if (file_exists(dirname(__FILE__).'/models/modelsdb')) { |
212 | - if (($handle = fopen(dirname(__FILE__).'/models/modelsdb','r')) !== FALSE) { |
|
213 | - while (($row = fgetcsv($handle,1000)) !== FALSE) { |
|
214 | - if (isset($row[1]) ){ |
|
212 | + if (($handle = fopen(dirname(__FILE__).'/models/modelsdb', 'r')) !== FALSE) { |
|
213 | + while (($row = fgetcsv($handle, 1000)) !== FALSE) { |
|
214 | + if (isset($row[1])) { |
|
215 | 215 | $model = $row[0]; |
216 | 216 | $modelsdb[$model] = $row[1]; |
217 | 217 | } |
@@ -221,9 +221,9 @@ discard block |
||
221 | 221 | } |
222 | 222 | $modelsdb2 = array(); |
223 | 223 | if (file_exists(dirname(__FILE__).'/models/gltf2/modelsdb')) { |
224 | - if (($handle = fopen(dirname(__FILE__).'/models/gltf2/modelsdb','r')) !== FALSE) { |
|
225 | - while (($row = fgetcsv($handle,1000)) !== FALSE) { |
|
226 | - if (isset($row[1]) ){ |
|
224 | + if (($handle = fopen(dirname(__FILE__).'/models/gltf2/modelsdb', 'r')) !== FALSE) { |
|
225 | + while (($row = fgetcsv($handle, 1000)) !== FALSE) { |
|
226 | + if (isset($row[1])) { |
|
227 | 227 | $model = $row[0]; |
228 | 228 | $modelsdb2[$model] = $row[1]; |
229 | 229 | } |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | if (!empty($spotter_array) && is_array($spotter_array)) |
262 | 262 | { |
263 | 263 | $nblatlong = 0; |
264 | - foreach($spotter_array as $spotter_item) |
|
264 | + foreach ($spotter_array as $spotter_item) |
|
265 | 265 | { |
266 | 266 | $j++; |
267 | 267 | //if (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'airwhere') $heightrelative = 'RELATIVE_TO_GROUND'; |
@@ -303,9 +303,9 @@ discard block |
||
303 | 303 | $output .= '"lastupdate": "'.$lastupdate.'",'; |
304 | 304 | if (isset($spotter_item['format_source'])) $output .= '"format": "'.$spotter_item['format_source'].'",'; |
305 | 305 | if ($tracker) { |
306 | - $output.= '"type": "tracker"'; |
|
306 | + $output .= '"type": "tracker"'; |
|
307 | 307 | } elseif ($marine) { |
308 | - $output.= '"type": "marine"'; |
|
308 | + $output .= '"type": "marine"'; |
|
309 | 309 | } else { |
310 | 310 | if (isset($globalMap3DLiveries) && $globalMap3DLiveries) { |
311 | 311 | $aircraft_icao = $spotter_item['aircraft_icao']; |
@@ -319,14 +319,14 @@ discard block |
||
319 | 319 | if (isset($airline_icao)) { |
320 | 320 | $imagefile = $aircraft_icao.'-'.$airline_icao.'.png'; |
321 | 321 | if (file_exists(dirname(__FILE__).'/models/gltf2/liveries/'.$imagefile)) { |
322 | - $output.= '"liveries": "'.$globalURL.'/models/gltf2/liveries/'.$imagefile.'",'; |
|
322 | + $output .= '"liveries": "'.$globalURL.'/models/gltf2/liveries/'.$imagefile.'",'; |
|
323 | 323 | } |
324 | 324 | } |
325 | 325 | } |
326 | - if ($ident != '') $output.= '"ident": "'.$ident.'",'; |
|
326 | + if ($ident != '') $output .= '"ident": "'.$ident.'",'; |
|
327 | 327 | } |
328 | - $output.= '"gltf2": %gltf2%,'; |
|
329 | - $output.= '"type": "flight"'; |
|
328 | + $output .= '"gltf2": %gltf2%,'; |
|
329 | + $output .= '"type": "flight"'; |
|
330 | 330 | } |
331 | 331 | $output .= '},'; |
332 | 332 | |
@@ -679,8 +679,8 @@ discard block |
||
679 | 679 | $output .= '},'; |
680 | 680 | } |
681 | 681 | } |
682 | - if (isset($onground) && $onground) $output = str_replace('%onground%','true',$output); |
|
683 | - else $output = str_replace('%onground%','false',$output); |
|
682 | + if (isset($onground) && $onground) $output = str_replace('%onground%', 'true', $output); |
|
683 | + else $output = str_replace('%onground%', 'false', $output); |
|
684 | 684 | |
685 | 685 | // $output .= '"heightReference": "CLAMP_TO_GROUND",'; |
686 | 686 | //$output .= '"heightReference": "'.$heightrelative.'",'; |
@@ -695,7 +695,7 @@ discard block |
||
695 | 695 | $output .= '"cartographicDegrees": ['; |
696 | 696 | if ($minitime > strtotime($spotter_item['date'])) $minitime = strtotime($spotter_item['date']); |
697 | 697 | if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']); |
698 | - $output .= '"'.date("c",strtotime($spotter_item['date'])).'", '; |
|
698 | + $output .= '"'.date("c", strtotime($spotter_item['date'])).'", '; |
|
699 | 699 | $output .= $spotter_item['longitude'].', '; |
700 | 700 | $output .= $spotter_item['latitude']; |
701 | 701 | $prevlong = $spotter_item['longitude']; |
@@ -723,8 +723,8 @@ discard block |
||
723 | 723 | //$quat = quaternionrotate(deg2rad($spotter_item['heading']),deg2rad(0),deg2rad(0)); |
724 | 724 | //$orientation .= '"'.date("c",strtotime($spotter_item['date'])).'",'.$quat['x'].','.$quat['y'].','.$quat['z'].','.$quat['w']; |
725 | 725 | } else { |
726 | - $nblatlong = $nblatlong+1; |
|
727 | - $output .= ',"'.date("c",strtotime($spotter_item['date'])).'", '; |
|
726 | + $nblatlong = $nblatlong + 1; |
|
727 | + $output .= ',"'.date("c", strtotime($spotter_item['date'])).'", '; |
|
728 | 728 | if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']); |
729 | 729 | if ($spotter_item['ground_speed'] == 0) { |
730 | 730 | $output .= $prevlong.', '; |
@@ -764,17 +764,17 @@ discard block |
||
764 | 764 | } |
765 | 765 | $output .= ']'; |
766 | 766 | if (isset($globalArchive) && $globalArchive === TRUE) { |
767 | - if ((time()-$globalLiveInterval) > $minitime) { |
|
768 | - if (time()-$globalLiveInterval > $maxitime) { |
|
769 | - $output = str_replace('%minitime%',date("c",$maxitime),$output); |
|
767 | + if ((time() - $globalLiveInterval) > $minitime) { |
|
768 | + if (time() - $globalLiveInterval > $maxitime) { |
|
769 | + $output = str_replace('%minitime%', date("c", $maxitime), $output); |
|
770 | 770 | } else { |
771 | - $output = str_replace('%minitime%',date("c",time()-$globalLiveInterval),$output); |
|
771 | + $output = str_replace('%minitime%', date("c", time() - $globalLiveInterval), $output); |
|
772 | 772 | } |
773 | 773 | } |
774 | - else $output = str_replace('%minitime%',date("c",$minitime),$output); |
|
775 | -} else $output = str_replace('%minitime%',date("c",$minitime),$output); |
|
776 | -$output = str_replace('%maxitime%',date("c",$maxitime),$output); |
|
777 | -if ($gltf2) $output = str_replace('%gltf2%','true',$output); |
|
778 | -else $output = str_replace('%gltf2%','false',$output); |
|
774 | + else $output = str_replace('%minitime%', date("c", $minitime), $output); |
|
775 | +} else $output = str_replace('%minitime%', date("c", $minitime), $output); |
|
776 | +$output = str_replace('%maxitime%', date("c", $maxitime), $output); |
|
777 | +if ($gltf2) $output = str_replace('%gltf2%', 'true', $output); |
|
778 | +else $output = str_replace('%gltf2%', 'false', $output); |
|
779 | 779 | print $output; |
780 | 780 | ?> |
@@ -16,8 +16,12 @@ discard block |
||
16 | 16 | } |
17 | 17 | $tracker = false; |
18 | 18 | $marine = false; |
19 | -if (isset($_GET['tracker'])) $tracker = true; |
|
20 | -if (isset($_GET['marine'])) $marine = true; |
|
19 | +if (isset($_GET['tracker'])) { |
|
20 | + $tracker = true; |
|
21 | +} |
|
22 | +if (isset($_GET['marine'])) { |
|
23 | + $marine = true; |
|
24 | +} |
|
21 | 25 | if ($tracker) { |
22 | 26 | require_once('require/class.Tracker.php'); |
23 | 27 | require_once('require/class.TrackerLive.php'); |
@@ -74,24 +78,49 @@ discard block |
||
74 | 78 | } |
75 | 79 | header('Content-Type: text/javascript'); |
76 | 80 | |
77 | -if (!isset($globalJsonCompress)) $compress = true; |
|
78 | -else $compress = $globalJsonCompress; |
|
81 | +if (!isset($globalJsonCompress)) { |
|
82 | + $compress = true; |
|
83 | +} else { |
|
84 | + $compress = $globalJsonCompress; |
|
85 | +} |
|
79 | 86 | |
80 | 87 | $from_archive = false; |
81 | 88 | $min = false; |
82 | 89 | $allhistory = false; |
83 | 90 | $filter['source'] = array(); |
84 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
85 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
86 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
87 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs')); |
|
88 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
89 | -if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
90 | -if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING); |
|
91 | -if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
92 | -if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
93 | -if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
94 | -if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING); |
|
91 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') { |
|
92 | + $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
93 | +} |
|
94 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') { |
|
95 | + $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
96 | +} |
|
97 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') { |
|
98 | + $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
99 | +} |
|
100 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') { |
|
101 | + $filter['source'] = array_merge($filter['source'],array('sbs','famaprs')); |
|
102 | +} |
|
103 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') { |
|
104 | + $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
105 | +} |
|
106 | +if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') { |
|
107 | + $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
108 | +} |
|
109 | +if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') { |
|
110 | + $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING); |
|
111 | +} |
|
112 | +if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') { |
|
113 | + $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
114 | +} |
|
115 | +if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') { |
|
116 | + $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
117 | +} |
|
118 | +if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') { |
|
119 | + $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
120 | +} |
|
121 | +if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') { |
|
122 | + $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING); |
|
123 | +} |
|
95 | 124 | /* |
96 | 125 | if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) { |
97 | 126 | $min = true; |
@@ -200,8 +229,12 @@ discard block |
||
200 | 229 | } else { |
201 | 230 | $flightcnt = $SpotterLive->getLiveSpotterCount($filter); |
202 | 231 | } |
203 | - if ($flightcnt == '') $flightcnt = 0; |
|
204 | -} else $flightcnt = 0; |
|
232 | + if ($flightcnt == '') { |
|
233 | + $flightcnt = 0; |
|
234 | + } |
|
235 | + } else { |
|
236 | + $flightcnt = 0; |
|
237 | +} |
|
205 | 238 | |
206 | 239 | $sqltime = round(microtime(true)-$begintime,2); |
207 | 240 | $minitime = time(); |
@@ -237,7 +270,9 @@ discard block |
||
237 | 270 | $prev_flightaware_id = ''; |
238 | 271 | $speed = 1; |
239 | 272 | $gltf2 = false; |
240 | -if (isset($archivespeed)) $speed = $archivespeed; |
|
273 | +if (isset($archivespeed)) { |
|
274 | + $speed = $archivespeed; |
|
275 | +} |
|
241 | 276 | $output = '['; |
242 | 277 | if ($tracker) { |
243 | 278 | $output .= '{"id" : "document", "name" : "tracker","version" : "1.0"'; |
@@ -273,9 +308,13 @@ discard block |
||
273 | 308 | $image = "images/placeholder_thumb.png"; |
274 | 309 | } |
275 | 310 | |
276 | - if (isset($spotter_item['flightaware_id'])) $id = $spotter_item['flightaware_id']; |
|
277 | - elseif (isset($spotter_item['famtrackid'])) $id = $spotter_item['famtrackid']; |
|
278 | - elseif (isset($spotter_item['fammarine_id'])) $id = $spotter_item['fammarine_id']; |
|
311 | + if (isset($spotter_item['flightaware_id'])) { |
|
312 | + $id = $spotter_item['flightaware_id']; |
|
313 | + } elseif (isset($spotter_item['famtrackid'])) { |
|
314 | + $id = $spotter_item['famtrackid']; |
|
315 | + } elseif (isset($spotter_item['fammarine_id'])) { |
|
316 | + $id = $spotter_item['fammarine_id']; |
|
317 | + } |
|
279 | 318 | if ($prev_flightaware_id != $id) { |
280 | 319 | if ($prev_flightaware_id != '') { |
281 | 320 | /* |
@@ -301,7 +340,9 @@ discard block |
||
301 | 340 | $output .= '"flightcnt": "'.$flightcnt.'",'; |
302 | 341 | $output .= '"onground": %onground%,'; |
303 | 342 | $output .= '"lastupdate": "'.$lastupdate.'",'; |
304 | - if (isset($spotter_item['format_source'])) $output .= '"format": "'.$spotter_item['format_source'].'",'; |
|
343 | + if (isset($spotter_item['format_source'])) { |
|
344 | + $output .= '"format": "'.$spotter_item['format_source'].'",'; |
|
345 | + } |
|
305 | 346 | if ($tracker) { |
306 | 347 | $output.= '"type": "tracker"'; |
307 | 348 | } elseif ($marine) { |
@@ -323,7 +364,9 @@ discard block |
||
323 | 364 | } |
324 | 365 | } |
325 | 366 | } |
326 | - if ($ident != '') $output.= '"ident": "'.$ident.'",'; |
|
367 | + if ($ident != '') { |
|
368 | + $output.= '"ident": "'.$ident.'",'; |
|
369 | + } |
|
327 | 370 | } |
328 | 371 | $output.= '"gltf2": %gltf2%,'; |
329 | 372 | $output.= '"type": "flight"'; |
@@ -355,7 +398,9 @@ discard block |
||
355 | 398 | $spotter_item['engine_type'] = $aircraft_info[0]['engine_type']; |
356 | 399 | $spotter_item['wake_category'] = $aircraft_info[0]['wake_category']; |
357 | 400 | $spotter_item['engine_count'] = $aircraft_info[0]['engine_count']; |
358 | - } else $aircraft_shadow = ''; |
|
401 | + } else { |
|
402 | + $aircraft_shadow = ''; |
|
403 | + } |
|
359 | 404 | $output .= ' "billboard" : {"image" : "'.$globalURL.'/images/aircrafts/new/'.$aircraft_shadow.'","scale" : 0.5'; |
360 | 405 | if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true' && isset($_COOKIE['IconColor'])) { |
361 | 406 | $rgb = $Common->hex2rgb($_COOKIE['IconColor']); |
@@ -363,7 +408,9 @@ discard block |
||
363 | 408 | } |
364 | 409 | $output .= '},'; |
365 | 410 | } |
366 | - } else $output .= ' "billboard" : {"image" : "data:image/png;base64,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","scale" : 0.5},'; |
|
411 | + } else { |
|
412 | + $output .= ' "billboard" : {"image" : "data:image/png;base64,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","scale" : 0.5},'; |
|
413 | + } |
|
367 | 414 | } elseif ($one3dmodel) { |
368 | 415 | if (isset($globalMap3DForceModel) && $globalMap3DForceModel != '') { |
369 | 416 | $output .= '"model": {"gltf" : "'.$globalURL.'/models/'.$globalMap3DForceModel.'","scale" : 1.0,"minimumPixelSize": 20'; |
@@ -403,7 +450,9 @@ discard block |
||
403 | 450 | $spotter_item['engine_type'] = $aircraft_info[0]['engine_type']; |
404 | 451 | $spotter_item['wake_category'] = $aircraft_info[0]['wake_category']; |
405 | 452 | $spotter_item['engine_count'] = $aircraft_info[0]['engine_count']; |
406 | - } else $aircraft_shadow = ''; |
|
453 | + } else { |
|
454 | + $aircraft_shadow = ''; |
|
455 | + } |
|
407 | 456 | if ($aircraft_shadow != '') { |
408 | 457 | if (isset($modelsdb[$aircraft_shadow])) { |
409 | 458 | $output .= '"model": {"gltf" : "'.$globalURL.'/models/'.$modelsdb[$aircraft_shadow].'","scale" : 1.0,"minimumPixelSize": 20'; |
@@ -540,7 +589,9 @@ discard block |
||
540 | 589 | } |
541 | 590 | $output .= '},'; |
542 | 591 | //if ($spotter_item['aircraft_shadow'] != '') $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",'; |
543 | - if ($spotter_item['aircraft_icao'] != '') $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
592 | + if ($spotter_item['aircraft_icao'] != '') { |
|
593 | + $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
594 | + } |
|
544 | 595 | $modelsdb[$aircraft_icao] = 'Cesium_Air.glb'; |
545 | 596 | } |
546 | 597 | } elseif (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'aprs') { |
@@ -562,7 +613,9 @@ discard block |
||
562 | 613 | } |
563 | 614 | $output .= '},'; |
564 | 615 | //if ($spotter_item['aircraft_shadow'] != '') $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",'; |
565 | - if ($spotter_item['aircraft_icao'] != '') $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
616 | + if ($spotter_item['aircraft_icao'] != '') { |
|
617 | + $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
618 | + } |
|
566 | 619 | $modelsdb[$aircraft_icao] = 'Cesium_Air.glb'; |
567 | 620 | } |
568 | 621 | } else { |
@@ -575,7 +628,9 @@ discard block |
||
575 | 628 | } |
576 | 629 | $output .= '},'; |
577 | 630 | //if ($spotter_item['aircraft_shadow'] != '') $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",'; |
578 | - if ($spotter_item['aircraft_icao'] != '') $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
631 | + if ($spotter_item['aircraft_icao'] != '') { |
|
632 | + $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
633 | + } |
|
579 | 634 | $modelsdb[$aircraft_icao] = 'Cesium_Air.glb'; |
580 | 635 | } |
581 | 636 | } elseif ($tracker && isset($spotter_item['type'])) { |
@@ -679,8 +734,11 @@ discard block |
||
679 | 734 | $output .= '},'; |
680 | 735 | } |
681 | 736 | } |
682 | - if (isset($onground) && $onground) $output = str_replace('%onground%','true',$output); |
|
683 | - else $output = str_replace('%onground%','false',$output); |
|
737 | + if (isset($onground) && $onground) { |
|
738 | + $output = str_replace('%onground%','true',$output); |
|
739 | + } else { |
|
740 | + $output = str_replace('%onground%','false',$output); |
|
741 | + } |
|
684 | 742 | |
685 | 743 | // $output .= '"heightReference": "CLAMP_TO_GROUND",'; |
686 | 744 | //$output .= '"heightReference": "'.$heightrelative.'",'; |
@@ -693,8 +751,12 @@ discard block |
||
693 | 751 | // $output .= '"interpolationDegree" : 5,'; |
694 | 752 | // $output .= '"epoch" : "'.date("c",strtotime($spotter_item['date'])).'", '; |
695 | 753 | $output .= '"cartographicDegrees": ['; |
696 | - if ($minitime > strtotime($spotter_item['date'])) $minitime = strtotime($spotter_item['date']); |
|
697 | - if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']); |
|
754 | + if ($minitime > strtotime($spotter_item['date'])) { |
|
755 | + $minitime = strtotime($spotter_item['date']); |
|
756 | + } |
|
757 | + if ($maxitime < strtotime($spotter_item['date'])) { |
|
758 | + $maxitime = strtotime($spotter_item['date']); |
|
759 | + } |
|
698 | 760 | $output .= '"'.date("c",strtotime($spotter_item['date'])).'", '; |
699 | 761 | $output .= $spotter_item['longitude'].', '; |
700 | 762 | $output .= $spotter_item['latitude']; |
@@ -717,7 +779,9 @@ discard block |
||
717 | 779 | $output .= ', '.round($spotter_item['altitude']*30.48); |
718 | 780 | $prevalt = round($spotter_item['altitude']*30.48); |
719 | 781 | } |
720 | - } else $output .= ', 0'; |
|
782 | + } else { |
|
783 | + $output .= ', 0'; |
|
784 | + } |
|
721 | 785 | //$orientation = '"orientation" : { '; |
722 | 786 | //$orientation .= '"unitQuaternion": ['; |
723 | 787 | //$quat = quaternionrotate(deg2rad($spotter_item['heading']),deg2rad(0),deg2rad(0)); |
@@ -725,13 +789,18 @@ discard block |
||
725 | 789 | } else { |
726 | 790 | $nblatlong = $nblatlong+1; |
727 | 791 | $output .= ',"'.date("c",strtotime($spotter_item['date'])).'", '; |
728 | - if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']); |
|
792 | + if ($maxitime < strtotime($spotter_item['date'])) { |
|
793 | + $maxitime = strtotime($spotter_item['date']); |
|
794 | + } |
|
729 | 795 | if ($spotter_item['ground_speed'] == 0) { |
730 | 796 | $output .= $prevlong.', '; |
731 | 797 | $output .= $prevlat; |
732 | 798 | //if (!$marine && (!isset($onground) || !$onground)) $output .= ', '.$prevalt; |
733 | - if (!$marine) $output .= ', '.$prevalt; |
|
734 | - else $output .= ', 0'; |
|
799 | + if (!$marine) { |
|
800 | + $output .= ', '.$prevalt; |
|
801 | + } else { |
|
802 | + $output .= ', 0'; |
|
803 | + } |
|
735 | 804 | } else { |
736 | 805 | $output .= $spotter_item['longitude'].', '; |
737 | 806 | $output .= $spotter_item['latitude']; |
@@ -744,14 +813,17 @@ discard block |
||
744 | 813 | $output .= ', 0'; |
745 | 814 | } |
746 | 815 | } else { |
747 | - if (isset($spotter_item['real_altitude']) && $spotter_item['real_altitude'] != '') $output .= ', '.round($spotter_item['real_altitude']*0.3048); |
|
748 | - elseif ($tracker) { |
|
816 | + if (isset($spotter_item['real_altitude']) && $spotter_item['real_altitude'] != '') { |
|
817 | + $output .= ', '.round($spotter_item['real_altitude']*0.3048); |
|
818 | + } elseif ($tracker) { |
|
749 | 819 | $output .= ', '.round($spotter_item['altitude']*0.3048); |
750 | 820 | } else { |
751 | 821 | $output .= ', '.round($spotter_item['altitude']*30.48); |
752 | 822 | } |
753 | 823 | } |
754 | - } else $output .= ', 0'; |
|
824 | + } else { |
|
825 | + $output .= ', 0'; |
|
826 | + } |
|
755 | 827 | } |
756 | 828 | //$quat = quaternionrotate(deg2rad($spotter_item['heading']),deg2rad(0),deg2rad(0)); |
757 | 829 | //$orientation .= ',"'.date("c",strtotime($spotter_item['date'])).'",'.$quat['x'].','.$quat['y'].','.$quat['z'].','.$quat['w']; |
@@ -770,11 +842,17 @@ discard block |
||
770 | 842 | } else { |
771 | 843 | $output = str_replace('%minitime%',date("c",time()-$globalLiveInterval),$output); |
772 | 844 | } |
845 | + } else { |
|
846 | + $output = str_replace('%minitime%',date("c",$minitime),$output); |
|
773 | 847 | } |
774 | - else $output = str_replace('%minitime%',date("c",$minitime),$output); |
|
775 | -} else $output = str_replace('%minitime%',date("c",$minitime),$output); |
|
848 | + } else { |
|
849 | + $output = str_replace('%minitime%',date("c",$minitime),$output); |
|
850 | +} |
|
776 | 851 | $output = str_replace('%maxitime%',date("c",$maxitime),$output); |
777 | -if ($gltf2) $output = str_replace('%gltf2%','true',$output); |
|
778 | -else $output = str_replace('%gltf2%','false',$output); |
|
852 | +if ($gltf2) { |
|
853 | + $output = str_replace('%gltf2%','true',$output); |
|
854 | +} else { |
|
855 | + $output = str_replace('%gltf2%','false',$output); |
|
856 | +} |
|
779 | 857 | print $output; |
780 | 858 | ?> |
@@ -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 | |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | $usecoord = true; |
109 | 109 | $coord = explode(',',$_GET['coord']); |
110 | 110 | if (filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT) |
111 | - && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0) { |
|
111 | + && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0) { |
|
112 | 112 | if ($tracker) { |
113 | 113 | $spotter_array = $TrackerLive->getLiveTrackerDatabyCoord($coord,$filter); |
114 | 114 | } elseif ($marine) { |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | $usecoord = true; |
122 | 122 | $coord = explode(',',$_GET['coord']); |
123 | 123 | if (filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT) |
124 | - && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0) { |
|
124 | + && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0) { |
|
125 | 125 | if ($tracker) { |
126 | 126 | $spotter_array = $TrackerLive->getMinLiveTrackerDatabyCoord($coord,$filter); |
127 | 127 | } elseif ($marine) { |
@@ -538,17 +538,17 @@ discard block |
||
538 | 538 | if ($history == '' && isset($_COOKIE['history'])) $history = $_COOKIE['history']; |
539 | 539 | |
540 | 540 | if ( |
541 | - (isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') |
|
542 | - || ((isset($globalMapHistory) && $globalMapHistory) || $allhistory) |
|
541 | + (isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') |
|
542 | + || ((isset($globalMapHistory) && $globalMapHistory) || $allhistory) |
|
543 | 543 | // || (isset($history) && $history != '' && $history != 'NA' && ($history == $spotter_item['ident'] || $history == $spotter_item['flightaware_id'])) |
544 | 544 | // || (isset($history) && $history != '' && $history != 'NA' && $history == $spotter_item['ident']) |
545 | - || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
|
546 | - || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']) |
|
547 | - || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['fammarine_id'])) |
|
548 | - || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['fammarine_id']) && $_GET['fammarine_id'] == $spotter_item['fammarine_id']) |
|
549 | - || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['famtrackid'])) |
|
550 | - || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['famtrackid']) && $_GET['famtrackid'] == $spotter_item['famtrackid']) |
|
551 | - ) { |
|
545 | + || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
|
546 | + || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']) |
|
547 | + || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['fammarine_id'])) |
|
548 | + || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['fammarine_id']) && $_GET['fammarine_id'] == $spotter_item['fammarine_id']) |
|
549 | + || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['famtrackid'])) |
|
550 | + || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['famtrackid']) && $_GET['famtrackid'] == $spotter_item['famtrackid']) |
|
551 | + ) { |
|
552 | 552 | if ($tracker) { |
553 | 553 | if ($from_archive || $globalArchive) { |
554 | 554 | $spotter_history_array = $TrackerArchive->getAllArchiveTrackerDataById($spotter_item['famtrackid']); |
@@ -637,65 +637,65 @@ discard block |
||
637 | 637 | } |
638 | 638 | |
639 | 639 | if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
640 | - || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
|
641 | - && (isset($spotter_item['departure_airport']) |
|
642 | - && $spotter_item['departure_airport'] != 'NA' |
|
643 | - && isset($spotter_item['arrival_airport']) |
|
644 | - && $spotter_item['arrival_airport'] != 'NA' |
|
645 | - && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") |
|
646 | - || (!isset($_COOKIE['MapRoute']) && isset($globalMapRoute) && $globalMapRoute)))) { |
|
647 | - if ($compress) $output_air = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
648 | - else $output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
649 | - if (isset($spotter_item['departure_airport_latitude'])) { |
|
640 | + || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
|
641 | + && (isset($spotter_item['departure_airport']) |
|
642 | + && $spotter_item['departure_airport'] != 'NA' |
|
643 | + && isset($spotter_item['arrival_airport']) |
|
644 | + && $spotter_item['arrival_airport'] != 'NA' |
|
645 | + && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") |
|
646 | + || (!isset($_COOKIE['MapRoute']) && isset($globalMapRoute) && $globalMapRoute)))) { |
|
647 | + if ($compress) $output_air = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
648 | + else $output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
649 | + if (isset($spotter_item['departure_airport_latitude'])) { |
|
650 | 650 | $output_air .= '['.$spotter_item['departure_airport_longitude'].','.$spotter_item['departure_airport_latitude'].'],'; |
651 | - } elseif (isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA') { |
|
651 | + } elseif (isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA') { |
|
652 | 652 | $dairport = $Spotter->getAllAirportInfo($spotter_item['departure_airport']); |
653 | 653 | if (isset($dairport[0]['latitude'])) { |
654 | - $output_air .= '['.$dairport[0]['longitude'].','.$dairport[0]['latitude'].'],'; |
|
654 | + $output_air .= '['.$dairport[0]['longitude'].','.$dairport[0]['latitude'].'],'; |
|
655 | 655 | } |
656 | - } |
|
657 | - if (isset($spotter_item['arrival_airport_latitude'])) { |
|
656 | + } |
|
657 | + if (isset($spotter_item['arrival_airport_latitude'])) { |
|
658 | 658 | $output_air .= '['.$spotter_item['arrival_airport_longitude'].','.$spotter_item['arrival_airport_latitude'].'],'; |
659 | - } elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { |
|
659 | + } elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { |
|
660 | 660 | $aairport = $Spotter->getAllAirportInfo($spotter_item['arrival_airport']); |
661 | 661 | if (isset($aairport[0]['latitude'])) { |
662 | - $output_air .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].'],'; |
|
662 | + $output_air .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].'],'; |
|
663 | 663 | } |
664 | - } |
|
665 | - $output_air = substr($output_air, 0, -1); |
|
666 | - $output_air .= ']}},'; |
|
667 | - $output .= $output_air; |
|
668 | - unset($output_air); |
|
664 | + } |
|
665 | + $output_air = substr($output_air, 0, -1); |
|
666 | + $output_air .= ']}},'; |
|
667 | + $output .= $output_air; |
|
668 | + unset($output_air); |
|
669 | 669 | } |
670 | 670 | |
671 | 671 | //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))))) { |
672 | 672 | //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))))) { |
673 | 673 | if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
674 | - || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
|
675 | - && (isset($spotter_item['arrival_airport']) |
|
676 | - && $spotter_item['arrival_airport'] != 'NA' |
|
677 | - && ((isset($_COOKIE['MapRemainingRoute']) && $_COOKIE['MapRemainingRoute'] == "true") |
|
678 | - || (!isset($_COOKIE['MapRemainaingRoute']) && (!isset($globalMapRemainingRoute) |
|
679 | - || (isset($globalMapRemainingRoute) && $globalMapRemainingRoute)))))) { |
|
680 | - $havedata = false; |
|
681 | - if ($compress) $output_dest = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
682 | - else $output_dest = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
683 | - $output_dest .= '['.$spotter_item['longitude'].','.$spotter_item['latitude'].'],'; |
|
674 | + || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
|
675 | + && (isset($spotter_item['arrival_airport']) |
|
676 | + && $spotter_item['arrival_airport'] != 'NA' |
|
677 | + && ((isset($_COOKIE['MapRemainingRoute']) && $_COOKIE['MapRemainingRoute'] == "true") |
|
678 | + || (!isset($_COOKIE['MapRemainaingRoute']) && (!isset($globalMapRemainingRoute) |
|
679 | + || (isset($globalMapRemainingRoute) && $globalMapRemainingRoute)))))) { |
|
680 | + $havedata = false; |
|
681 | + if ($compress) $output_dest = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
682 | + else $output_dest = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
683 | + $output_dest .= '['.$spotter_item['longitude'].','.$spotter_item['latitude'].'],'; |
|
684 | 684 | |
685 | - if (isset($spotter_item['arrival_airport_latitude'])) { |
|
685 | + if (isset($spotter_item['arrival_airport_latitude'])) { |
|
686 | 686 | $output_dest .= '['.$spotter_item['arrival_airport_longitude'].','.$spotter_item['arrival_airport_latitude'].']'; |
687 | 687 | $havedata = true; |
688 | - } elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { |
|
688 | + } elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { |
|
689 | 689 | $aairport = $Spotter->getAllAirportInfo($spotter_item['arrival_airport']); |
690 | 690 | if (isset($aairport[0]['latitude'])) { |
691 | - $output_dest .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].']'; |
|
692 | - $havedata = true; |
|
691 | + $output_dest .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].']'; |
|
692 | + $havedata = true; |
|
693 | 693 | } |
694 | - } |
|
695 | - //$output_dest = substr($output_dest, 0, -1); |
|
696 | - $output_dest .= ']}},'; |
|
697 | - if ($havedata) $output .= $output_dest; |
|
698 | - unset($output_dest); |
|
694 | + } |
|
695 | + //$output_dest = substr($output_dest, 0, -1); |
|
696 | + $output_dest .= ']}},'; |
|
697 | + if ($havedata) $output .= $output_dest; |
|
698 | + unset($output_dest); |
|
699 | 699 | } |
700 | 700 | } |
701 | 701 | $output = substr($output, 0, -1); |
@@ -64,17 +64,17 @@ discard block |
||
64 | 64 | $min = true; |
65 | 65 | $allhistory = false; |
66 | 66 | $filter['source'] = array(); |
67 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
68 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
69 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
70 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs')); |
|
71 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
72 | -if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
73 | -if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING); |
|
74 | -if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
75 | -if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
76 | -if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
77 | -if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING); |
|
67 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'], array('vatsimtxt')); |
|
68 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'], array('whazzup')); |
|
69 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'], array('phpvmacars')); |
|
70 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'], array('sbs', 'famaprs')); |
|
71 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'], array('aprs')); |
|
72 | +if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'], FILTER_SANITIZE_STRING); |
|
73 | +if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'], FILTER_SANITIZE_STRING); |
|
74 | +if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',', $_COOKIE['filter_Airlines']), FILTER_SANITIZE_STRING); |
|
75 | +if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',', $_COOKIE['filter_Sources']), FILTER_SANITIZE_STRING); |
|
76 | +if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'], FILTER_SANITIZE_STRING); |
|
77 | +if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'], FILTER_SANITIZE_STRING); |
|
78 | 78 | |
79 | 79 | if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) { |
80 | 80 | $min = true; |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | $spotter_array = array(); |
84 | 84 | |
85 | 85 | if (isset($_GET['ident'])) { |
86 | - $ident = urldecode(filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING)); |
|
86 | + $ident = urldecode(filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING)); |
|
87 | 87 | if ($tracker) { |
88 | 88 | $spotter_array = $TrackerLive->getLastLiveTrackerDataByIdent($ident); |
89 | 89 | } elseif ($marine) { |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | } |
98 | 98 | $allhistory = true; |
99 | 99 | } elseif (isset($_GET['flightaware_id'])) { |
100 | - $flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING); |
|
100 | + $flightaware_id = filter_input(INPUT_GET, 'flightaware_id', FILTER_SANITIZE_STRING); |
|
101 | 101 | $spotter_array = $SpotterLive->getLastLiveSpotterDataById($flightaware_id); |
102 | 102 | if (empty($spotter_array)) { |
103 | 103 | $from_archive = true; |
@@ -105,38 +105,38 @@ discard block |
||
105 | 105 | } |
106 | 106 | $allhistory = true; |
107 | 107 | } elseif (isset($_GET['famtrack_id'])) { |
108 | - $famtrack_id = urldecode(filter_input(INPUT_GET,'famtrack_id',FILTER_SANITIZE_STRING)); |
|
108 | + $famtrack_id = urldecode(filter_input(INPUT_GET, 'famtrack_id', FILTER_SANITIZE_STRING)); |
|
109 | 109 | $spotter_array = $TrackerLive->getLastLiveTrackerDataById($famtrack_id); |
110 | 110 | $allhistory = true; |
111 | 111 | } elseif (isset($_GET['fammarine_id'])) { |
112 | - $fammarine_id = urldecode(filter_input(INPUT_GET,'fammarine_id',FILTER_SANITIZE_STRING)); |
|
112 | + $fammarine_id = urldecode(filter_input(INPUT_GET, 'fammarine_id', FILTER_SANITIZE_STRING)); |
|
113 | 113 | $spotter_array = $MarineLive->getLastLiveMarineDataById($fammarine_id); |
114 | 114 | $allhistory = true; |
115 | 115 | } elseif (isset($globalMapUseBbox) && $globalMapUseBbox && isset($_GET['coord']) && (!isset($globalMapPopup) || $globalMapPopup || (isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true'))) { |
116 | 116 | //} elseif (isset($_GET['coord'])) { |
117 | 117 | $usecoord = true; |
118 | - $coord = explode(',',$_GET['coord']); |
|
119 | - if (filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT) |
|
118 | + $coord = explode(',', $_GET['coord']); |
|
119 | + if (filter_var($coord[0], FILTER_VALIDATE_FLOAT) && filter_var($coord[1], FILTER_VALIDATE_FLOAT) && filter_var($coord[2], FILTER_VALIDATE_FLOAT) && filter_var($coord[3], FILTER_VALIDATE_FLOAT) |
|
120 | 120 | && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0) { |
121 | 121 | if ($tracker) { |
122 | - $spotter_array = $TrackerLive->getLiveTrackerDatabyCoord($coord,$filter); |
|
122 | + $spotter_array = $TrackerLive->getLiveTrackerDatabyCoord($coord, $filter); |
|
123 | 123 | } elseif ($marine) { |
124 | - $spotter_array = $MarineLive->getLiveMarineDatabyCoord($coord,$filter); |
|
124 | + $spotter_array = $MarineLive->getLiveMarineDatabyCoord($coord, $filter); |
|
125 | 125 | } else { |
126 | - $spotter_array = $SpotterLive->getLiveSpotterDatabyCoord($coord,$filter); |
|
126 | + $spotter_array = $SpotterLive->getLiveSpotterDatabyCoord($coord, $filter); |
|
127 | 127 | } |
128 | 128 | } |
129 | 129 | } elseif (isset($globalMapUseBbox) && $globalMapUseBbox && isset($_GET['coord']) && $min) { |
130 | 130 | $usecoord = true; |
131 | - $coord = explode(',',$_GET['coord']); |
|
132 | - if (filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT) |
|
131 | + $coord = explode(',', $_GET['coord']); |
|
132 | + if (filter_var($coord[0], FILTER_VALIDATE_FLOAT) && filter_var($coord[1], FILTER_VALIDATE_FLOAT) && filter_var($coord[2], FILTER_VALIDATE_FLOAT) && filter_var($coord[3], FILTER_VALIDATE_FLOAT) |
|
133 | 133 | && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0) { |
134 | 134 | if ($tracker) { |
135 | - $spotter_array = $TrackerLive->getMinLiveTrackerDatabyCoord($coord,$filter); |
|
135 | + $spotter_array = $TrackerLive->getMinLiveTrackerDatabyCoord($coord, $filter); |
|
136 | 136 | } elseif ($marine) { |
137 | - $spotter_array = $MarineLive->getMinLiveMarineDatabyCoord($coord,$filter); |
|
137 | + $spotter_array = $MarineLive->getMinLiveMarineDatabyCoord($coord, $filter); |
|
138 | 138 | } else { |
139 | - $spotter_array = $SpotterLive->getMinLiveSpotterDatabyCoord($coord,$filter); |
|
139 | + $spotter_array = $SpotterLive->getMinLiveSpotterDatabyCoord($coord, $filter); |
|
140 | 140 | } |
141 | 141 | } else { |
142 | 142 | if ($tracker) { |
@@ -151,12 +151,12 @@ discard block |
||
151 | 151 | $from_archive = true; |
152 | 152 | // $begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
153 | 153 | // $enddate = filter_input(INPUT_GET,'enddate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
154 | - $begindate = filter_input(INPUT_GET,'begindate',FILTER_SANITIZE_NUMBER_INT); |
|
155 | - $enddate = filter_input(INPUT_GET,'enddate',FILTER_SANITIZE_NUMBER_INT); |
|
156 | - $archivespeed = filter_input(INPUT_GET,'speed',FILTER_SANITIZE_NUMBER_INT); |
|
157 | - $begindate = date('Y-m-d H:i:s',$begindate); |
|
158 | - $enddate = date('Y-m-d H:i:s',$enddate); |
|
159 | - $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate,$enddate,$filter); |
|
154 | + $begindate = filter_input(INPUT_GET, 'begindate', FILTER_SANITIZE_NUMBER_INT); |
|
155 | + $enddate = filter_input(INPUT_GET, 'enddate', FILTER_SANITIZE_NUMBER_INT); |
|
156 | + $archivespeed = filter_input(INPUT_GET, 'speed', FILTER_SANITIZE_NUMBER_INT); |
|
157 | + $begindate = date('Y-m-d H:i:s', $begindate); |
|
158 | + $enddate = date('Y-m-d H:i:s', $enddate); |
|
159 | + $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate, $enddate, $filter); |
|
160 | 160 | } elseif ($min) { |
161 | 161 | if ($tracker) { |
162 | 162 | $spotter_array = $TrackerLive->getMinLiveTrackerData($filter); |
@@ -168,17 +168,17 @@ discard block |
||
168 | 168 | # $min = true; |
169 | 169 | } else { |
170 | 170 | if ($tracker) { |
171 | - $spotter_array = $TrackerLive->getLiveTrackerData('','',$filter); |
|
171 | + $spotter_array = $TrackerLive->getLiveTrackerData('', '', $filter); |
|
172 | 172 | } elseif ($marine) { |
173 | - $spotter_array = $marineLive->getLiveMarineData('','',$filter); |
|
173 | + $spotter_array = $marineLive->getLiveMarineData('', '', $filter); |
|
174 | 174 | } else { |
175 | - $spotter_array = $SpotterLive->getLiveSpotterData('','',$filter); |
|
175 | + $spotter_array = $SpotterLive->getLiveSpotterData('', '', $filter); |
|
176 | 176 | } |
177 | 177 | } |
178 | 178 | |
179 | 179 | if ($usecoord) { |
180 | 180 | if (isset($_GET['archive'])) { |
181 | - $flightcnt = $SpotterArchive->getLiveSpotterCount($begindate,$enddate,$filter); |
|
181 | + $flightcnt = $SpotterArchive->getLiveSpotterCount($begindate, $enddate, $filter); |
|
182 | 182 | } else { |
183 | 183 | if ($tracker) { |
184 | 184 | $flightcnt = $TrackerLive->getLiveTrackerCount($filter); |
@@ -191,9 +191,9 @@ discard block |
||
191 | 191 | if ($flightcnt == '') $flightcnt = 0; |
192 | 192 | } else $flightcnt = 0; |
193 | 193 | |
194 | -$sqltime = round(microtime(true)-$begintime,2); |
|
194 | +$sqltime = round(microtime(true) - $begintime, 2); |
|
195 | 195 | |
196 | -$currenttime = filter_input(INPUT_GET,'currenttime',FILTER_SANITIZE_NUMBER_INT); |
|
196 | +$currenttime = filter_input(INPUT_GET, 'currenttime', FILTER_SANITIZE_NUMBER_INT); |
|
197 | 197 | if ($currenttime != '') $currenttime = round($currenttime/1000); |
198 | 198 | |
199 | 199 | if ((!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation == FALSE) || (isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'false')) $usenextlatlon = false; |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | if (!empty($spotter_array) && is_array($spotter_array)) |
213 | 213 | { |
214 | 214 | $output .= '"features": ['; |
215 | - foreach($spotter_array as $spotter_item) |
|
215 | + foreach ($spotter_array as $spotter_item) |
|
216 | 216 | { |
217 | 217 | $j++; |
218 | 218 | unset($idistance); |
@@ -269,8 +269,8 @@ discard block |
||
269 | 269 | */ |
270 | 270 | //$output .= '"fc": "'.$spotter_item['nb'].'",'; |
271 | 271 | if (isset($spotter_item['ident']) && $spotter_item['ident'] != '') { |
272 | - if ($compress) $output .= '"c": "'.str_replace('\\','',$spotter_item['ident']).'",'; |
|
273 | - else $output .= '"callsign": "'.str_replace('\\','',$spotter_item['ident']).'",'; |
|
272 | + if ($compress) $output .= '"c": "'.str_replace('\\', '', $spotter_item['ident']).'",'; |
|
273 | + else $output .= '"callsign": "'.str_replace('\\', '', $spotter_item['ident']).'",'; |
|
274 | 274 | //" |
275 | 275 | } else { |
276 | 276 | if ($compress) $output .= '"c": "NA",'; |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | if (isset($spotter_item['registration'])) $output .= '"registration": "'.$spotter_item['registration'].'",'; |
280 | 280 | if (isset($spotter_item['aircraft_name']) && isset($spotter_item['aircraft_type'])) { |
281 | 281 | $output .= '"aircraft_name": "'.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')",'; |
282 | - $output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ','_',$spotter_item['aircraft_name'])).'",'; |
|
282 | + $output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ', '_', $spotter_item['aircraft_name'])).'",'; |
|
283 | 283 | } elseif (isset($spotter_item['aircraft_type'])) { |
284 | 284 | $output .= '"aircraft_name": "NA ('.$spotter_item['aircraft_type'].')",'; |
285 | 285 | } elseif (!$min) { |
@@ -422,15 +422,15 @@ discard block |
||
422 | 422 | if (isset($archivespeed) || $usenextlatlon) { |
423 | 423 | if (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { |
424 | 424 | if (isset($spotter_item['arrival_airport_latitude'])) { |
425 | - $cheading = $Common->getHeading($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['arrival_airport_latitude'],$spotter_item['arrival_airport_longitude']); |
|
426 | - $idistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['arrival_airport_latitude'],$spotter_item['arrival_airport_longitude']); |
|
425 | + $cheading = $Common->getHeading($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['arrival_airport_latitude'], $spotter_item['arrival_airport_longitude']); |
|
426 | + $idistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['arrival_airport_latitude'], $spotter_item['arrival_airport_longitude']); |
|
427 | 427 | $farr_lat = $spotter_item['arrival_airport_latitude']; |
428 | 428 | $farr_lon = $spotter_item['arrival_airport_longitude']; |
429 | 429 | } else { |
430 | 430 | $aairport = $Spotter->getAllAirportInfo($spotter_item['arrival_airport']); |
431 | 431 | if (isset($aairport[0]['latitude'])) { |
432 | - $cheading = $Common->getHeading($spotter_item['latitude'],$spotter_item['longitude'],$aairport[0]['latitude'],$aairport[0]['longitude']); |
|
433 | - $idistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$aairport[0]['latitude'],$aairport[0]['longitude']); |
|
432 | + $cheading = $Common->getHeading($spotter_item['latitude'], $spotter_item['longitude'], $aairport[0]['latitude'], $aairport[0]['longitude']); |
|
433 | + $idistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $aairport[0]['latitude'], $aairport[0]['longitude']); |
|
434 | 434 | $farr_lat = $aairport[0]['latitude']; |
435 | 435 | $farr_lon = $aairport[0]['longitude']; |
436 | 436 | } |
@@ -443,59 +443,59 @@ discard block |
||
443 | 443 | if ($currenttime != '') { |
444 | 444 | if (strtotime($spotter_item['date']) < $currenttime) { |
445 | 445 | if (isset($archivespeed)) { |
446 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh)); |
|
447 | - $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
|
446 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading, $archivespeed, ($currenttime - strtotime($spotter_item['date']) + $globalMapRefresh)); |
|
447 | + $fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']); |
|
448 | 448 | if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
449 | 449 | else { |
450 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,$archivespeed,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh)); |
|
451 | - $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
|
450 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $cheading, $archivespeed, ($currenttime - strtotime($spotter_item['date']) + $globalMapRefresh)); |
|
451 | + $fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']); |
|
452 | 452 | if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
453 | 453 | else { |
454 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed); |
|
454 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading, $archivespeed); |
|
455 | 455 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
456 | 456 | } |
457 | 457 | } |
458 | 458 | } elseif ($usenextlatlon) { |
459 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,1,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh)); |
|
460 | - $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
|
459 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading, 1, ($currenttime - strtotime($spotter_item['date']) + $globalMapRefresh)); |
|
460 | + $fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']); |
|
461 | 461 | if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
462 | 462 | else { |
463 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,1,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh)); |
|
464 | - $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
|
463 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $cheading, 1, ($currenttime - strtotime($spotter_item['date']) + $globalMapRefresh)); |
|
464 | + $fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']); |
|
465 | 465 | if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
466 | 466 | else { |
467 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading); |
|
467 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading); |
|
468 | 468 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
469 | 469 | } |
470 | 470 | } |
471 | 471 | } |
472 | 472 | } else { |
473 | 473 | if (isset($archivespeed)) { |
474 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed); |
|
474 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading, $archivespeed); |
|
475 | 475 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
476 | 476 | } elseif ($usenextlatlon) { |
477 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading); |
|
477 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading); |
|
478 | 478 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
479 | 479 | } |
480 | 480 | } |
481 | 481 | } else { |
482 | 482 | if (isset($archivespeed)) { |
483 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed); |
|
484 | - $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
|
483 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading, $archivespeed); |
|
484 | + $fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']); |
|
485 | 485 | if (!isset($idistance) || $fdistance < $idistance) { |
486 | 486 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
487 | 487 | } else { |
488 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,$archivespeed); |
|
488 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $cheading, $archivespeed); |
|
489 | 489 | //$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
490 | 490 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
491 | 491 | } |
492 | 492 | } elseif ($usenextlatlon) { |
493 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading); |
|
494 | - $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
|
493 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading); |
|
494 | + $fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']); |
|
495 | 495 | if (!isset($idistance) || $fdistance < $idistance) { |
496 | 496 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
497 | 497 | } else { |
498 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading); |
|
498 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $cheading); |
|
499 | 499 | //$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
500 | 500 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
501 | 501 | } |
@@ -504,7 +504,7 @@ discard block |
||
504 | 504 | |
505 | 505 | if (!$min) $output .= '"image": "'.$image.'",'; |
506 | 506 | if (isset($spotter_item['image_copyright']) && $spotter_item['image_copyright'] != '') { |
507 | - $output .= '"image_copyright": "'.str_replace('"',"'",trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'',$spotter_item['image_copyright']))).'",'; |
|
507 | + $output .= '"image_copyright": "'.str_replace('"', "'", trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '', $spotter_item['image_copyright']))).'",'; |
|
508 | 508 | } |
509 | 509 | if (isset($spotter_item['image_source_website'])) { |
510 | 510 | $output .= '"image_source_website": "'.urlencode($spotter_item['image_source_website']).'",'; |
@@ -526,7 +526,7 @@ discard block |
||
526 | 526 | $output .= '"waypoints": "'.$spotter_item['waypoints'].'",'; |
527 | 527 | } |
528 | 528 | if (isset($spotter_item['acars'])) { |
529 | - $output .= '"acars": "'.trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"), '<br />',$spotter_item['acars']['message'])).'",'; |
|
529 | + $output .= '"acars": "'.trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '<br />', $spotter_item['acars']['message'])).'",'; |
|
530 | 530 | } |
531 | 531 | // type when not aircraft ? |
532 | 532 | if (isset($spotter_item['type'])) { |
@@ -546,12 +546,12 @@ discard block |
||
546 | 546 | if ($currenttime != '') { |
547 | 547 | if (strtotime($spotter_item['date']) < $currenttime) { |
548 | 548 | if (!isset($archivespeed)) $archivespeed = 1; |
549 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed,($currenttime-strtotime($spotter_item['date']))); |
|
550 | - $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
|
549 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading, $archivespeed, ($currenttime - strtotime($spotter_item['date']))); |
|
550 | + $fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']); |
|
551 | 551 | if (!isset($idistance) || $fdistance < $idistance) $output .= $nextcoord['longitude'].','.$nextcoord['latitude']; |
552 | 552 | else { |
553 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,$archivespeed,($currenttime-strtotime($spotter_item['date']))); |
|
554 | - $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
|
553 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $cheading, $archivespeed, ($currenttime - strtotime($spotter_item['date']))); |
|
554 | + $fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']); |
|
555 | 555 | if (!isset($idistance) || $fdistance < $idistance) $output .= $nextcoord['longitude'].','.$nextcoord['latitude']; |
556 | 556 | else { |
557 | 557 | $output .= $spotter_item['longitude'].', '; |
@@ -630,7 +630,7 @@ discard block |
||
630 | 630 | |
631 | 631 | } |
632 | 632 | */ |
633 | - $history = filter_input(INPUT_GET,'history',FILTER_SANITIZE_STRING); |
|
633 | + $history = filter_input(INPUT_GET, 'history', FILTER_SANITIZE_STRING); |
|
634 | 634 | if ($history == '' && isset($_COOKIE['history'])) $history = $_COOKIE['history']; |
635 | 635 | |
636 | 636 | if ( |
@@ -638,11 +638,11 @@ discard block |
||
638 | 638 | || ((isset($globalMapHistory) && $globalMapHistory) || $allhistory) |
639 | 639 | // || (isset($history) && $history != '' && $history != 'NA' && ($history == $spotter_item['ident'] || $history == $spotter_item['flightaware_id'])) |
640 | 640 | // || (isset($history) && $history != '' && $history != 'NA' && $history == $spotter_item['ident']) |
641 | - || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
|
641 | + || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id'])) |
|
642 | 642 | || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']) |
643 | - || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['fammarine_id'])) |
|
643 | + || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['fammarine_id'])) |
|
644 | 644 | || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['fammarine_id']) && $_GET['fammarine_id'] == $spotter_item['fammarine_id']) |
645 | - || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['famtrackid'])) |
|
645 | + || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['famtrackid'])) |
|
646 | 646 | || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['famtrackid']) && $_GET['famtrackid'] == $spotter_item['famtrackid']) |
647 | 647 | ) { |
648 | 648 | if ($tracker) { |
@@ -679,9 +679,9 @@ discard block |
||
679 | 679 | else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
680 | 680 | } |
681 | 681 | $output_history .= '['; |
682 | - $output_history .= $spotter_history['longitude'].', '; |
|
683 | - $output_history .= $spotter_history['latitude'].', '; |
|
684 | - $output_history .= $spotter_history['altitude']*30.48; |
|
682 | + $output_history .= $spotter_history['longitude'].', '; |
|
683 | + $output_history .= $spotter_history['latitude'].', '; |
|
684 | + $output_history .= $spotter_history['altitude']*30.48; |
|
685 | 685 | $output_history .= '],'; |
686 | 686 | /* |
687 | 687 | if ($from_archive === false) { |
@@ -699,8 +699,8 @@ discard block |
||
699 | 699 | else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history"},"geometry": {"type": "LineString","coordinates": ['; |
700 | 700 | } else $d = true; |
701 | 701 | $output_history .= '['; |
702 | - $output_history .= $spotter_history['longitude'].', '; |
|
703 | - $output_history .= $spotter_history['latitude']; |
|
702 | + $output_history .= $spotter_history['longitude'].', '; |
|
703 | + $output_history .= $spotter_history['latitude']; |
|
704 | 704 | $output_history .= '],'; |
705 | 705 | /* |
706 | 706 | if ($from_archive === false) { |
@@ -716,9 +716,9 @@ discard block |
||
716 | 716 | |
717 | 717 | if ($from_archive === false) { |
718 | 718 | $output_historyd = '['; |
719 | - $output_historyd .= $spotter_item['longitude'].', '; |
|
720 | - $output_historyd .= $spotter_item['latitude']; |
|
721 | - if (isset($spotter_history['altitude'])) $output_historyd .= ','.$spotter_item['altitude']*30.48; |
|
719 | + $output_historyd .= $spotter_item['longitude'].', '; |
|
720 | + $output_historyd .= $spotter_item['latitude']; |
|
721 | + if (isset($spotter_history['altitude'])) $output_historyd .= ','.$spotter_item['altitude']*30.48; |
|
722 | 722 | $output_historyd .= '],'; |
723 | 723 | //$output_history = $output_historyd.$output_history; |
724 | 724 | $output_history = $output_history.$output_historyd; |
@@ -732,7 +732,7 @@ discard block |
||
732 | 732 | } |
733 | 733 | } |
734 | 734 | |
735 | - if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
|
735 | + if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id'])) |
|
736 | 736 | || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
737 | 737 | && (isset($spotter_item['departure_airport']) |
738 | 738 | && $spotter_item['departure_airport'] != 'NA' |
@@ -766,7 +766,7 @@ discard block |
||
766 | 766 | |
767 | 767 | //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))))) { |
768 | 768 | //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))))) { |
769 | - if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
|
769 | + if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id'])) |
|
770 | 770 | || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
771 | 771 | && (isset($spotter_item['arrival_airport']) |
772 | 772 | && $spotter_item['arrival_airport'] != 'NA' |
@@ -797,7 +797,7 @@ discard block |
||
797 | 797 | $output = substr($output, 0, -1); |
798 | 798 | $output .= ']'; |
799 | 799 | $output .= ',"initial_sqltime": "'.$sqltime.'",'; |
800 | - $output .= '"totaltime": "'.round(microtime(true)-$begintime,2).'",'; |
|
800 | + $output .= '"totaltime": "'.round(microtime(true) - $begintime, 2).'",'; |
|
801 | 801 | if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",'; |
802 | 802 | $output .= '"fc": "'.$j.'"'; |
803 | 803 | } else { |
@@ -57,28 +57,55 @@ discard block |
||
57 | 57 | } |
58 | 58 | header('Content-Type: text/javascript'); |
59 | 59 | |
60 | -if (!isset($globalJsonCompress)) $compress = true; |
|
61 | -else $compress = $globalJsonCompress; |
|
60 | +if (!isset($globalJsonCompress)) { |
|
61 | + $compress = true; |
|
62 | +} else { |
|
63 | + $compress = $globalJsonCompress; |
|
64 | +} |
|
62 | 65 | |
63 | 66 | $from_archive = false; |
64 | 67 | $min = true; |
65 | 68 | $allhistory = false; |
66 | 69 | $filter['source'] = array(); |
67 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
68 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
69 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
70 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs')); |
|
71 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
72 | -if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
73 | -if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING); |
|
74 | -if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
75 | -if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
76 | -if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
77 | -if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING); |
|
70 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') { |
|
71 | + $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
72 | +} |
|
73 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') { |
|
74 | + $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
75 | +} |
|
76 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') { |
|
77 | + $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
78 | +} |
|
79 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') { |
|
80 | + $filter['source'] = array_merge($filter['source'],array('sbs','famaprs')); |
|
81 | +} |
|
82 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') { |
|
83 | + $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
84 | +} |
|
85 | +if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') { |
|
86 | + $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
87 | +} |
|
88 | +if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') { |
|
89 | + $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING); |
|
90 | +} |
|
91 | +if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') { |
|
92 | + $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
93 | +} |
|
94 | +if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') { |
|
95 | + $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
96 | +} |
|
97 | +if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') { |
|
98 | + $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
99 | +} |
|
100 | +if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') { |
|
101 | + $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING); |
|
102 | +} |
|
78 | 103 | |
79 | 104 | if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) { |
80 | 105 | $min = true; |
81 | -} else $min = false; |
|
106 | +} else { |
|
107 | + $min = false; |
|
108 | +} |
|
82 | 109 | |
83 | 110 | $spotter_array = array(); |
84 | 111 | |
@@ -188,24 +215,38 @@ discard block |
||
188 | 215 | $flightcnt = $SpotterLive->getLiveSpotterCount($filter); |
189 | 216 | } |
190 | 217 | } |
191 | - if ($flightcnt == '') $flightcnt = 0; |
|
192 | -} else $flightcnt = 0; |
|
218 | + if ($flightcnt == '') { |
|
219 | + $flightcnt = 0; |
|
220 | + } |
|
221 | + } else { |
|
222 | + $flightcnt = 0; |
|
223 | +} |
|
193 | 224 | |
194 | 225 | $sqltime = round(microtime(true)-$begintime,2); |
195 | 226 | |
196 | 227 | $currenttime = filter_input(INPUT_GET,'currenttime',FILTER_SANITIZE_NUMBER_INT); |
197 | -if ($currenttime != '') $currenttime = round($currenttime/1000); |
|
228 | +if ($currenttime != '') { |
|
229 | + $currenttime = round($currenttime/1000); |
|
230 | +} |
|
198 | 231 | |
199 | -if ((!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation == FALSE) || (isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'false')) $usenextlatlon = false; |
|
200 | -else $usenextlatlon = true; |
|
201 | -if ($usenextlatlon === false) $currenttime = ''; |
|
232 | +if ((!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation == FALSE) || (isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'false')) { |
|
233 | + $usenextlatlon = false; |
|
234 | +} else { |
|
235 | + $usenextlatlon = true; |
|
236 | +} |
|
237 | +if ($usenextlatlon === false) { |
|
238 | + $currenttime = ''; |
|
239 | +} |
|
202 | 240 | $j = 0; |
203 | 241 | $prev_flightaware_id = ''; |
204 | 242 | $aircrafts_shadow = array(); |
205 | 243 | $output = '{'; |
206 | 244 | $output .= '"type": "FeatureCollection",'; |
207 | - if ($min) $output .= '"minimal": "true",'; |
|
208 | - else $output .= '"minimal": "false",'; |
|
245 | + if ($min) { |
|
246 | + $output .= '"minimal": "true",'; |
|
247 | + } else { |
|
248 | + $output .= '"minimal": "false",'; |
|
249 | + } |
|
209 | 250 | //$output .= '"fc": "'.$flightcnt.'",'; |
210 | 251 | $output .= '"sqt": "'.$sqltime.'",'; |
211 | 252 | |
@@ -250,18 +291,29 @@ discard block |
||
250 | 291 | } |
251 | 292 | $output .= '"properties": {'; |
252 | 293 | if (isset($spotter_item['flightaware_id'])) { |
253 | - if ($compress) $output .= '"fi": "'.$spotter_item['flightaware_id'].'",'; |
|
254 | - else $output .= '"flightaware_id": "'.$spotter_item['flightaware_id'].'",'; |
|
294 | + if ($compress) { |
|
295 | + $output .= '"fi": "'.$spotter_item['flightaware_id'].'",'; |
|
296 | + } else { |
|
297 | + $output .= '"flightaware_id": "'.$spotter_item['flightaware_id'].'",'; |
|
298 | + } |
|
255 | 299 | } elseif (isset($spotter_item['famtrackid'])) { |
256 | - if ($compress) $output .= '"fti": "'.$spotter_item['famtrackid'].'",'; |
|
257 | - else $output .= '"famtrackid": "'.$spotter_item['famtrackid'].'",'; |
|
300 | + if ($compress) { |
|
301 | + $output .= '"fti": "'.$spotter_item['famtrackid'].'",'; |
|
302 | + } else { |
|
303 | + $output .= '"famtrackid": "'.$spotter_item['famtrackid'].'",'; |
|
304 | + } |
|
258 | 305 | } elseif (isset($spotter_item['fammarine_id'])) { |
259 | - if ($compress) $output .= '"fmi": "'.$spotter_item['fammarine_id'].'",'; |
|
260 | - else $output .= '"fammarineid": "'.$spotter_item['fammarine_id'].'",'; |
|
306 | + if ($compress) { |
|
307 | + $output .= '"fmi": "'.$spotter_item['fammarine_id'].'",'; |
|
308 | + } else { |
|
309 | + $output .= '"fammarineid": "'.$spotter_item['fammarine_id'].'",'; |
|
310 | + } |
|
261 | 311 | } |
262 | 312 | $output .= '"fc": "'.$flightcnt.'",'; |
263 | 313 | $output .= '"sqt": "'.$sqltime.'",'; |
264 | - if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",'; |
|
314 | + if (isset($begindate)) { |
|
315 | + $output .= '"archive_date": "'.$begindate.'",'; |
|
316 | + } |
|
265 | 317 | |
266 | 318 | /* |
267 | 319 | if ($min) $output .= '"minimal": "true",'; |
@@ -269,14 +321,22 @@ discard block |
||
269 | 321 | */ |
270 | 322 | //$output .= '"fc": "'.$spotter_item['nb'].'",'; |
271 | 323 | if (isset($spotter_item['ident']) && $spotter_item['ident'] != '') { |
272 | - if ($compress) $output .= '"c": "'.str_replace('\\','',$spotter_item['ident']).'",'; |
|
273 | - else $output .= '"callsign": "'.str_replace('\\','',$spotter_item['ident']).'",'; |
|
324 | + if ($compress) { |
|
325 | + $output .= '"c": "'.str_replace('\\','',$spotter_item['ident']).'",'; |
|
326 | + } else { |
|
327 | + $output .= '"callsign": "'.str_replace('\\','',$spotter_item['ident']).'",'; |
|
328 | + } |
|
274 | 329 | //" |
275 | 330 | } else { |
276 | - if ($compress) $output .= '"c": "NA",'; |
|
277 | - else $output .= '"callsign": "NA",'; |
|
331 | + if ($compress) { |
|
332 | + $output .= '"c": "NA",'; |
|
333 | + } else { |
|
334 | + $output .= '"callsign": "NA",'; |
|
335 | + } |
|
336 | + } |
|
337 | + if (isset($spotter_item['registration'])) { |
|
338 | + $output .= '"registration": "'.$spotter_item['registration'].'",'; |
|
278 | 339 | } |
279 | - if (isset($spotter_item['registration'])) $output .= '"registration": "'.$spotter_item['registration'].'",'; |
|
280 | 340 | if (isset($spotter_item['aircraft_name']) && isset($spotter_item['aircraft_type'])) { |
281 | 341 | $output .= '"aircraft_name": "'.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')",'; |
282 | 342 | $output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ','_',$spotter_item['aircraft_name'])).'",'; |
@@ -289,16 +349,23 @@ discard block |
||
289 | 349 | $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
290 | 350 | } |
291 | 351 | if (!isset($spotter_item['aircraft_shadow']) && !$tracker) { |
292 | - if (!isset($spotter_item['aircraft_icao']) || $spotter_item['aircraft_icao'] == '') $spotter_item['aircraft_shadow'] = ''; |
|
293 | - else { |
|
352 | + if (!isset($spotter_item['aircraft_icao']) || $spotter_item['aircraft_icao'] == '') { |
|
353 | + $spotter_item['aircraft_shadow'] = ''; |
|
354 | + } else { |
|
294 | 355 | $aircraft_icao = $spotter_item['aircraft_icao']; |
295 | - if (isset($aircrafts_shadow[$aircraft_icao])) $spotter_item['aircraft_shadow'] = $aircrafts_shadow[$aircraft_icao]; |
|
296 | - else { |
|
356 | + if (isset($aircrafts_shadow[$aircraft_icao])) { |
|
357 | + $spotter_item['aircraft_shadow'] = $aircrafts_shadow[$aircraft_icao]; |
|
358 | + } else { |
|
297 | 359 | $aircraft_info = $Spotter->getAllAircraftInfo($spotter_item['aircraft_icao']); |
298 | - if (count($aircraft_info) > 0) $spotter_item['aircraft_shadow'] = $aircraft_info[0]['aircraft_shadow']; |
|
299 | - elseif (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'aprs') $spotter_item['aircraft_shadow'] = 'PA18.png'; |
|
300 | - elseif ($aircraft_icao == 'PARAGLIDER') $spotter_item['aircraft_shadow'] = 'PARAGLIDER.png'; |
|
301 | - else $spotter_item['aircraft_shadow'] = ''; |
|
360 | + if (count($aircraft_info) > 0) { |
|
361 | + $spotter_item['aircraft_shadow'] = $aircraft_info[0]['aircraft_shadow']; |
|
362 | + } elseif (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'aprs') { |
|
363 | + $spotter_item['aircraft_shadow'] = 'PA18.png'; |
|
364 | + } elseif ($aircraft_icao == 'PARAGLIDER') { |
|
365 | + $spotter_item['aircraft_shadow'] = 'PARAGLIDER.png'; |
|
366 | + } else { |
|
367 | + $spotter_item['aircraft_shadow'] = ''; |
|
368 | + } |
|
302 | 369 | $aircrafts_shadow[$aircraft_icao] = $spotter_item['aircraft_shadow']; |
303 | 370 | } |
304 | 371 | } |
@@ -306,73 +373,139 @@ discard block |
||
306 | 373 | if (!isset($spotter_item['aircraft_shadow']) || $spotter_item['aircraft_shadow'] == '') { |
307 | 374 | if ($tracker) { |
308 | 375 | if (isset($spotter_item['type']) && $spotter_item['type'] == 'Ambulance') { |
309 | - if ($compress) $output .= '"as": "ambulance.png",'; |
|
310 | - else $output .= '"aircraft_shadow": "ambulance.png",'; |
|
376 | + if ($compress) { |
|
377 | + $output .= '"as": "ambulance.png",'; |
|
378 | + } else { |
|
379 | + $output .= '"aircraft_shadow": "ambulance.png",'; |
|
380 | + } |
|
311 | 381 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Police') { |
312 | - if ($compress) $output .= '"as": "police.png",'; |
|
313 | - else $output .= '"aircraft_shadow": "police.png",'; |
|
382 | + if ($compress) { |
|
383 | + $output .= '"as": "police.png",'; |
|
384 | + } else { |
|
385 | + $output .= '"aircraft_shadow": "police.png",'; |
|
386 | + } |
|
314 | 387 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Yacht (Sail)') { |
315 | - if ($compress) $output .= '"as": "ship.png",'; |
|
316 | - else $output .= '"aircraft_shadow": "ship.png",'; |
|
388 | + if ($compress) { |
|
389 | + $output .= '"as": "ship.png",'; |
|
390 | + } else { |
|
391 | + $output .= '"aircraft_shadow": "ship.png",'; |
|
392 | + } |
|
317 | 393 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Ship (Power Boat)') { |
318 | - if ($compress) $output .= '"as": "ship.png",'; |
|
319 | - else $output .= '"aircraft_shadow": "ship.png",'; |
|
394 | + if ($compress) { |
|
395 | + $output .= '"as": "ship.png",'; |
|
396 | + } else { |
|
397 | + $output .= '"aircraft_shadow": "ship.png",'; |
|
398 | + } |
|
320 | 399 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Shuttle') { |
321 | - if ($compress) $output .= '"as": "ship.png",'; |
|
322 | - else $output .= '"aircraft_shadow": "ship.png",'; |
|
400 | + if ($compress) { |
|
401 | + $output .= '"as": "ship.png",'; |
|
402 | + } else { |
|
403 | + $output .= '"aircraft_shadow": "ship.png",'; |
|
404 | + } |
|
323 | 405 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Truck') { |
324 | - if ($compress) $output .= '"as": "truck.png",'; |
|
325 | - else $output .= '"aircraft_shadow": "truck.png",'; |
|
406 | + if ($compress) { |
|
407 | + $output .= '"as": "truck.png",'; |
|
408 | + } else { |
|
409 | + $output .= '"aircraft_shadow": "truck.png",'; |
|
410 | + } |
|
326 | 411 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Truck (18 Wheeler)') { |
327 | - if ($compress) $output .= '"as": "truck.png",'; |
|
328 | - else $output .= '"aircraft_shadow": "truck.png",'; |
|
412 | + if ($compress) { |
|
413 | + $output .= '"as": "truck.png",'; |
|
414 | + } else { |
|
415 | + $output .= '"aircraft_shadow": "truck.png",'; |
|
416 | + } |
|
329 | 417 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Aircraft (small)') { |
330 | - if ($compress) $output .= '"as": "aircraft.png",'; |
|
331 | - else $output .= '"aircraft_shadow": "aircraft.png",'; |
|
418 | + if ($compress) { |
|
419 | + $output .= '"as": "aircraft.png",'; |
|
420 | + } else { |
|
421 | + $output .= '"aircraft_shadow": "aircraft.png",'; |
|
422 | + } |
|
332 | 423 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Large Aircraft') { |
333 | - if ($compress) $output .= '"as": "aircraft.png",'; |
|
334 | - else $output .= '"aircraft_shadow": "aircraft.png",'; |
|
424 | + if ($compress) { |
|
425 | + $output .= '"as": "aircraft.png",'; |
|
426 | + } else { |
|
427 | + $output .= '"aircraft_shadow": "aircraft.png",'; |
|
428 | + } |
|
335 | 429 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Helicopter') { |
336 | - if ($compress) $output .= '"as": "helico.png",'; |
|
337 | - else $output .= '"aircraft_shadow": "helico.png",'; |
|
430 | + if ($compress) { |
|
431 | + $output .= '"as": "helico.png",'; |
|
432 | + } else { |
|
433 | + $output .= '"aircraft_shadow": "helico.png",'; |
|
434 | + } |
|
338 | 435 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Railroad Engine') { |
339 | - if ($compress) $output .= '"as": "rail.png",'; |
|
340 | - else $output .= '"aircraft_shadow": "rail.png",'; |
|
436 | + if ($compress) { |
|
437 | + $output .= '"as": "rail.png",'; |
|
438 | + } else { |
|
439 | + $output .= '"aircraft_shadow": "rail.png",'; |
|
440 | + } |
|
341 | 441 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Firetruck') { |
342 | - if ($compress) $output .= '"as": "firetruck.png",'; |
|
343 | - else $output .= '"aircraft_shadow": "firetruck.png",'; |
|
442 | + if ($compress) { |
|
443 | + $output .= '"as": "firetruck.png",'; |
|
444 | + } else { |
|
445 | + $output .= '"aircraft_shadow": "firetruck.png",'; |
|
446 | + } |
|
344 | 447 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Bus') { |
345 | - if ($compress) $output .= '"as": "bus.png",'; |
|
346 | - else $output .= '"aircraft_shadow": "bus.png",'; |
|
448 | + if ($compress) { |
|
449 | + $output .= '"as": "bus.png",'; |
|
450 | + } else { |
|
451 | + $output .= '"aircraft_shadow": "bus.png",'; |
|
452 | + } |
|
347 | 453 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Phone') { |
348 | - if ($compress) $output .= '"as": "phone.png",'; |
|
349 | - else $output .= '"aircraft_shadow": "phone.png",'; |
|
454 | + if ($compress) { |
|
455 | + $output .= '"as": "phone.png",'; |
|
456 | + } else { |
|
457 | + $output .= '"aircraft_shadow": "phone.png",'; |
|
458 | + } |
|
350 | 459 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Jogger') { |
351 | - if ($compress) $output .= '"as": "jogger.png",'; |
|
352 | - else $output .= '"aircraft_shadow": "jogger.png",'; |
|
460 | + if ($compress) { |
|
461 | + $output .= '"as": "jogger.png",'; |
|
462 | + } else { |
|
463 | + $output .= '"aircraft_shadow": "jogger.png",'; |
|
464 | + } |
|
353 | 465 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Bike') { |
354 | - if ($compress) $output .= '"as": "bike.png",'; |
|
355 | - else $output .= '"aircraft_shadow": "bike.png",'; |
|
466 | + if ($compress) { |
|
467 | + $output .= '"as": "bike.png",'; |
|
468 | + } else { |
|
469 | + $output .= '"aircraft_shadow": "bike.png",'; |
|
470 | + } |
|
356 | 471 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Motorcycle') { |
357 | - if ($compress) $output .= '"as": "motorcycle.png",'; |
|
358 | - else $output .= '"aircraft_shadow": "motorcycle.png",'; |
|
472 | + if ($compress) { |
|
473 | + $output .= '"as": "motorcycle.png",'; |
|
474 | + } else { |
|
475 | + $output .= '"aircraft_shadow": "motorcycle.png",'; |
|
476 | + } |
|
359 | 477 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Balloon') { |
360 | - if ($compress) $output .= '"as": "balloon.png",'; |
|
361 | - else $output .= '"aircraft_shadow": "balloon.png",'; |
|
478 | + if ($compress) { |
|
479 | + $output .= '"as": "balloon.png",'; |
|
480 | + } else { |
|
481 | + $output .= '"aircraft_shadow": "balloon.png",'; |
|
482 | + } |
|
362 | 483 | } else { |
363 | - if ($compress) $output .= '"as": "car.png",'; |
|
364 | - else $output .= '"aircraft_shadow": "car.png",'; |
|
484 | + if ($compress) { |
|
485 | + $output .= '"as": "car.png",'; |
|
486 | + } else { |
|
487 | + $output .= '"aircraft_shadow": "car.png",'; |
|
488 | + } |
|
365 | 489 | } |
366 | 490 | } elseif ($marine) { |
367 | - if ($compress) $output .= '"as": "ship.png",'; |
|
368 | - else $output .= '"aircraft_shadow": "ship.png",'; |
|
491 | + if ($compress) { |
|
492 | + $output .= '"as": "ship.png",'; |
|
493 | + } else { |
|
494 | + $output .= '"aircraft_shadow": "ship.png",'; |
|
495 | + } |
|
369 | 496 | } else { |
370 | - if ($compress) $output .= '"as": "default.png",'; |
|
371 | - else $output .= '"aircraft_shadow": "default.png",'; |
|
497 | + if ($compress) { |
|
498 | + $output .= '"as": "default.png",'; |
|
499 | + } else { |
|
500 | + $output .= '"aircraft_shadow": "default.png",'; |
|
501 | + } |
|
372 | 502 | } |
373 | 503 | } else { |
374 | - if ($compress) $output .= '"as": "'.$spotter_item['aircraft_shadow'].'",'; |
|
375 | - else $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",'; |
|
504 | + if ($compress) { |
|
505 | + $output .= '"as": "'.$spotter_item['aircraft_shadow'].'",'; |
|
506 | + } else { |
|
507 | + $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",'; |
|
508 | + } |
|
376 | 509 | } |
377 | 510 | if (isset($spotter_item['airline_name'])) { |
378 | 511 | $output .= '"airline_name": "'.$spotter_item['airline_name'].'",'; |
@@ -380,8 +513,11 @@ discard block |
||
380 | 513 | $output .= '"airline_name": "NA",'; |
381 | 514 | } |
382 | 515 | if (isset($spotter_item['departure_airport'])) { |
383 | - if ($compress) $output .= '"dac": "'.$spotter_item['departure_airport'].'",'; |
|
384 | - else $output .= '"departure_airport_code": "'.$spotter_item['departure_airport'].'",'; |
|
516 | + if ($compress) { |
|
517 | + $output .= '"dac": "'.$spotter_item['departure_airport'].'",'; |
|
518 | + } else { |
|
519 | + $output .= '"departure_airport_code": "'.$spotter_item['departure_airport'].'",'; |
|
520 | + } |
|
385 | 521 | } |
386 | 522 | if (isset($spotter_item['departure_airport_city'])) { |
387 | 523 | $output .= '"departure_airport": "'.$spotter_item['departure_airport_city'].', '.$spotter_item['departure_airport_country'].'",'; |
@@ -393,8 +529,11 @@ discard block |
||
393 | 529 | $output .= '"arrival_airport_time": "'.$spotter_item['arrival_airport_time'].'",'; |
394 | 530 | } |
395 | 531 | if (isset($spotter_item['arrival_airport'])) { |
396 | - if ($compress) $output .= '"aac": "'.$spotter_item['arrival_airport'].'",'; |
|
397 | - else $output .= '"arrival_airport_code": "'.$spotter_item['arrival_airport'].'",'; |
|
532 | + if ($compress) { |
|
533 | + $output .= '"aac": "'.$spotter_item['arrival_airport'].'",'; |
|
534 | + } else { |
|
535 | + $output .= '"arrival_airport_code": "'.$spotter_item['arrival_airport'].'",'; |
|
536 | + } |
|
398 | 537 | } |
399 | 538 | if (isset($spotter_item['arrival_airport_city'])) { |
400 | 539 | $output .= '"arrival_airport": "'.$spotter_item['arrival_airport_city'].', '.$spotter_item['arrival_airport_country'].'",'; |
@@ -413,8 +552,11 @@ discard block |
||
413 | 552 | } |
414 | 553 | |
415 | 554 | if (isset($spotter_item['altitude'])) { |
416 | - if ($compress) $output .= '"a": "'.$spotter_item['altitude'].'",'; |
|
417 | - else $output .= '"altitude": "'.$spotter_item['altitude'].'",'; |
|
555 | + if ($compress) { |
|
556 | + $output .= '"a": "'.$spotter_item['altitude'].'",'; |
|
557 | + } else { |
|
558 | + $output .= '"altitude": "'.$spotter_item['altitude'].'",'; |
|
559 | + } |
|
418 | 560 | } |
419 | 561 | |
420 | 562 | $heading = $spotter_item['heading']; |
@@ -438,19 +580,24 @@ discard block |
||
438 | 580 | } |
439 | 581 | } |
440 | 582 | |
441 | - if ($compress)$output .= '"h": "'.$heading.'",'; |
|
442 | - else $output .= '"heading": "'.$heading.'",'; |
|
583 | + if ($compress) { |
|
584 | + $output .= '"h": "'.$heading.'",'; |
|
585 | + } else { |
|
586 | + $output .= '"heading": "'.$heading.'",'; |
|
587 | + } |
|
443 | 588 | if ($currenttime != '') { |
444 | 589 | if (strtotime($spotter_item['date']) < $currenttime) { |
445 | 590 | if (isset($archivespeed)) { |
446 | 591 | $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh)); |
447 | 592 | $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
448 | - if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
|
449 | - else { |
|
593 | + if (!isset($idistance) || $fdistance < $idistance) { |
|
594 | + $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
|
595 | + } else { |
|
450 | 596 | $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,$archivespeed,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh)); |
451 | 597 | $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
452 | - if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
|
453 | - else { |
|
598 | + if (!isset($idistance) || $fdistance < $idistance) { |
|
599 | + $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
|
600 | + } else { |
|
454 | 601 | $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed); |
455 | 602 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
456 | 603 | } |
@@ -458,12 +605,14 @@ discard block |
||
458 | 605 | } elseif ($usenextlatlon) { |
459 | 606 | $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,1,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh)); |
460 | 607 | $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
461 | - if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
|
462 | - else { |
|
608 | + if (!isset($idistance) || $fdistance < $idistance) { |
|
609 | + $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
|
610 | + } else { |
|
463 | 611 | $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,1,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh)); |
464 | 612 | $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
465 | - if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
|
466 | - else { |
|
613 | + if (!isset($idistance) || $fdistance < $idistance) { |
|
614 | + $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
|
615 | + } else { |
|
467 | 616 | $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading); |
468 | 617 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
469 | 618 | } |
@@ -502,7 +651,9 @@ discard block |
||
502 | 651 | } |
503 | 652 | } |
504 | 653 | |
505 | - if (!$min) $output .= '"image": "'.$image.'",'; |
|
654 | + if (!$min) { |
|
655 | + $output .= '"image": "'.$image.'",'; |
|
656 | + } |
|
506 | 657 | if (isset($spotter_item['image_copyright']) && $spotter_item['image_copyright'] != '') { |
507 | 658 | $output .= '"image_copyright": "'.str_replace('"',"'",trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'',$spotter_item['image_copyright']))).'",'; |
508 | 659 | } |
@@ -510,8 +661,11 @@ discard block |
||
510 | 661 | $output .= '"image_source_website": "'.urlencode($spotter_item['image_source_website']).'",'; |
511 | 662 | } |
512 | 663 | if (isset($spotter_item['squawk'])) { |
513 | - if ($compress) $output .= '"sq": "'.$spotter_item['squawk'].'",'; |
|
514 | - else $output .= '"squawk": "'.$spotter_item['squawk'].'",'; |
|
664 | + if ($compress) { |
|
665 | + $output .= '"sq": "'.$spotter_item['squawk'].'",'; |
|
666 | + } else { |
|
667 | + $output .= '"squawk": "'.$spotter_item['squawk'].'",'; |
|
668 | + } |
|
515 | 669 | } |
516 | 670 | if (isset($spotter_item['squawk_usage'])) { |
517 | 671 | $output .= '"squawk_usage": "'.$spotter_item['squawk_usage'].'",'; |
@@ -530,14 +684,23 @@ discard block |
||
530 | 684 | } |
531 | 685 | // type when not aircraft ? |
532 | 686 | if (isset($spotter_item['type'])) { |
533 | - if ($compress) $output .= '"t": "'.$spotter_item['type'].'"'; |
|
534 | - else $output .= '"type": "'.$spotter_item['type'].'"'; |
|
687 | + if ($compress) { |
|
688 | + $output .= '"t": "'.$spotter_item['type'].'"'; |
|
689 | + } else { |
|
690 | + $output .= '"type": "'.$spotter_item['type'].'"'; |
|
691 | + } |
|
535 | 692 | } elseif ($marine) { |
536 | - if ($compress) $output .= '"t": "ship"'; |
|
537 | - else $output .= '"type": "ship"'; |
|
693 | + if ($compress) { |
|
694 | + $output .= '"t": "ship"'; |
|
695 | + } else { |
|
696 | + $output .= '"type": "ship"'; |
|
697 | + } |
|
538 | 698 | } else { |
539 | - if ($compress) $output .= '"t": "aircraft"'; |
|
540 | - else $output .= '"type": "aircraft"'; |
|
699 | + if ($compress) { |
|
700 | + $output .= '"t": "aircraft"'; |
|
701 | + } else { |
|
702 | + $output .= '"type": "aircraft"'; |
|
703 | + } |
|
541 | 704 | } |
542 | 705 | $output .= '},'; |
543 | 706 | $output .= '"geometry": {'; |
@@ -545,15 +708,19 @@ discard block |
||
545 | 708 | $output .= '"coordinates": ['; |
546 | 709 | if ($currenttime != '') { |
547 | 710 | if (strtotime($spotter_item['date']) < $currenttime) { |
548 | - if (!isset($archivespeed)) $archivespeed = 1; |
|
711 | + if (!isset($archivespeed)) { |
|
712 | + $archivespeed = 1; |
|
713 | + } |
|
549 | 714 | $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed,($currenttime-strtotime($spotter_item['date']))); |
550 | 715 | $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
551 | - if (!isset($idistance) || $fdistance < $idistance) $output .= $nextcoord['longitude'].','.$nextcoord['latitude']; |
|
552 | - else { |
|
716 | + if (!isset($idistance) || $fdistance < $idistance) { |
|
717 | + $output .= $nextcoord['longitude'].','.$nextcoord['latitude']; |
|
718 | + } else { |
|
553 | 719 | $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,$archivespeed,($currenttime-strtotime($spotter_item['date']))); |
554 | 720 | $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
555 | - if (!isset($idistance) || $fdistance < $idistance) $output .= $nextcoord['longitude'].','.$nextcoord['latitude']; |
|
556 | - else { |
|
721 | + if (!isset($idistance) || $fdistance < $idistance) { |
|
722 | + $output .= $nextcoord['longitude'].','.$nextcoord['latitude']; |
|
723 | + } else { |
|
557 | 724 | $output .= $spotter_item['longitude'].', '; |
558 | 725 | $output .= $spotter_item['latitude']; |
559 | 726 | } |
@@ -631,7 +798,9 @@ discard block |
||
631 | 798 | } |
632 | 799 | */ |
633 | 800 | $history = filter_input(INPUT_GET,'history',FILTER_SANITIZE_STRING); |
634 | - if ($history == '' && isset($_COOKIE['history'])) $history = $_COOKIE['history']; |
|
801 | + if ($history == '' && isset($_COOKIE['history'])) { |
|
802 | + $history = $_COOKIE['history']; |
|
803 | + } |
|
635 | 804 | |
636 | 805 | if ( |
637 | 806 | (isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') |
@@ -675,8 +844,11 @@ discard block |
||
675 | 844 | $output_history .= ']}},'; |
676 | 845 | $output .= $output_history; |
677 | 846 | } |
678 | - if ($compress) $output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "history","a": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
|
679 | - else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
|
847 | + if ($compress) { |
|
848 | + $output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "history","a": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
|
849 | + } else { |
|
850 | + $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
|
851 | + } |
|
680 | 852 | } |
681 | 853 | $output_history .= '['; |
682 | 854 | $output_history .= $spotter_history['longitude'].', '; |
@@ -695,9 +867,14 @@ discard block |
||
695 | 867 | $prev_alt = $alt; |
696 | 868 | } else { |
697 | 869 | if ($d == false) { |
698 | - if ($compress) $output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "history"},"geometry": {"type": "LineString","coordinates": ['; |
|
699 | - else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history"},"geometry": {"type": "LineString","coordinates": ['; |
|
700 | - } else $d = true; |
|
870 | + if ($compress) { |
|
871 | + $output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "history"},"geometry": {"type": "LineString","coordinates": ['; |
|
872 | + } else { |
|
873 | + $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history"},"geometry": {"type": "LineString","coordinates": ['; |
|
874 | + } |
|
875 | + } else { |
|
876 | + $d = true; |
|
877 | + } |
|
701 | 878 | $output_history .= '['; |
702 | 879 | $output_history .= $spotter_history['longitude'].', '; |
703 | 880 | $output_history .= $spotter_history['latitude']; |
@@ -718,7 +895,9 @@ discard block |
||
718 | 895 | $output_historyd = '['; |
719 | 896 | $output_historyd .= $spotter_item['longitude'].', '; |
720 | 897 | $output_historyd .= $spotter_item['latitude']; |
721 | - if (isset($spotter_history['altitude'])) $output_historyd .= ','.$spotter_item['altitude']*30.48; |
|
898 | + if (isset($spotter_history['altitude'])) { |
|
899 | + $output_historyd .= ','.$spotter_item['altitude']*30.48; |
|
900 | + } |
|
722 | 901 | $output_historyd .= '],'; |
723 | 902 | //$output_history = $output_historyd.$output_history; |
724 | 903 | $output_history = $output_history.$output_historyd; |
@@ -740,8 +919,11 @@ discard block |
||
740 | 919 | && $spotter_item['arrival_airport'] != 'NA' |
741 | 920 | && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") |
742 | 921 | || (!isset($_COOKIE['MapRoute']) && isset($globalMapRoute) && $globalMapRoute)))) { |
743 | - if ($compress) $output_air = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
744 | - else $output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
922 | + if ($compress) { |
|
923 | + $output_air = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
924 | + } else { |
|
925 | + $output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
926 | + } |
|
745 | 927 | if (isset($spotter_item['departure_airport_latitude'])) { |
746 | 928 | $output_air .= '['.$spotter_item['departure_airport_longitude'].','.$spotter_item['departure_airport_latitude'].'],'; |
747 | 929 | } elseif (isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA') { |
@@ -774,8 +956,11 @@ discard block |
||
774 | 956 | || (!isset($_COOKIE['MapRemainaingRoute']) && (!isset($globalMapRemainingRoute) |
775 | 957 | || (isset($globalMapRemainingRoute) && $globalMapRemainingRoute)))))) { |
776 | 958 | $havedata = false; |
777 | - if ($compress) $output_dest = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
778 | - else $output_dest = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
959 | + if ($compress) { |
|
960 | + $output_dest = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
961 | + } else { |
|
962 | + $output_dest = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
963 | + } |
|
779 | 964 | $output_dest .= '['.$spotter_item['longitude'].','.$spotter_item['latitude'].'],'; |
780 | 965 | |
781 | 966 | if (isset($spotter_item['arrival_airport_latitude'])) { |
@@ -790,7 +975,9 @@ discard block |
||
790 | 975 | } |
791 | 976 | //$output_dest = substr($output_dest, 0, -1); |
792 | 977 | $output_dest .= ']}},'; |
793 | - if ($havedata) $output .= $output_dest; |
|
978 | + if ($havedata) { |
|
979 | + $output .= $output_dest; |
|
980 | + } |
|
794 | 981 | unset($output_dest); |
795 | 982 | } |
796 | 983 | } |
@@ -798,7 +985,9 @@ discard block |
||
798 | 985 | $output .= ']'; |
799 | 986 | $output .= ',"initial_sqltime": "'.$sqltime.'",'; |
800 | 987 | $output .= '"totaltime": "'.round(microtime(true)-$begintime,2).'",'; |
801 | - if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",'; |
|
988 | + if (isset($begindate)) { |
|
989 | + $output .= '"archive_date": "'.$begindate.'",'; |
|
990 | + } |
|
802 | 991 | $output .= '"fc": "'.$j.'"'; |
803 | 992 | } else { |
804 | 993 | $output .= '"features": '; |
@@ -8,21 +8,21 @@ discard block |
||
8 | 8 | header('Location: '.$globalURL.'/airline'); |
9 | 9 | die(); |
10 | 10 | } |
11 | -$airline = urldecode(filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING)); |
|
11 | +$airline = urldecode(filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING)); |
|
12 | 12 | $Spotter = new Spotter(); |
13 | 13 | $alliance = false; |
14 | -if (strpos($airline,'alliance_') !== FALSE) { |
|
14 | +if (strpos($airline, 'alliance_') !== FALSE) { |
|
15 | 15 | $alliance = true; |
16 | 16 | } else { |
17 | - $spotter_array = $Spotter->getSpotterDataByAirline($airline,"0,1",""); |
|
17 | + $spotter_array = $Spotter->getSpotterDataByAirline($airline, "0,1", ""); |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | if (!empty($spotter_array) || $alliance === true) |
21 | 21 | { |
22 | 22 | if ($alliance) { |
23 | - $title = sprintf(_("Most Common Aircraft by Registration from %s"),str_replace('_',' ',str_replace('alliance_','',$airline))); |
|
23 | + $title = sprintf(_("Most Common Aircraft by Registration from %s"), str_replace('_', ' ', str_replace('alliance_', '', $airline))); |
|
24 | 24 | } else { |
25 | - $title = sprintf(_("Most Common Aircraft by Registration from %s (%s)"),$spotter_array[0]['airline_name'],$spotter_array[0]['airline_icao']); |
|
25 | + $title = sprintf(_("Most Common Aircraft by Registration from %s (%s)"), $spotter_array[0]['airline_name'], $spotter_array[0]['airline_icao']); |
|
26 | 26 | } |
27 | 27 | require_once('header.php'); |
28 | 28 | |
@@ -33,10 +33,10 @@ discard block |
||
33 | 33 | $alliances = $Spotter->getAllAllianceNames(); |
34 | 34 | if (!empty($alliances)) { |
35 | 35 | foreach ($alliances as $al) { |
36 | - if ($alliance && str_replace('_',' ',str_replace('alliance_','',$airline)) == $al['alliance']) { |
|
37 | - print '<option value="'.str_replace(' ','_',$al['alliance']).'" selected>'.$al['alliance'].'</option>'; |
|
36 | + if ($alliance && str_replace('_', ' ', str_replace('alliance_', '', $airline)) == $al['alliance']) { |
|
37 | + print '<option value="'.str_replace(' ', '_', $al['alliance']).'" selected>'.$al['alliance'].'</option>'; |
|
38 | 38 | } else { |
39 | - print '<option value="'.str_replace(' ','_',$al['alliance']).'">'.$al['alliance'].'</option>'; |
|
39 | + print '<option value="'.str_replace(' ', '_', $al['alliance']).'">'.$al['alliance'].'</option>'; |
|
40 | 40 | } |
41 | 41 | } |
42 | 42 | print '<option disabled>──────────────────</option>'; |
@@ -44,9 +44,9 @@ discard block |
||
44 | 44 | $Stats = new Stats($Spotter->db); |
45 | 45 | $airline_names = $Stats->getAllAirlineNames(); |
46 | 46 | if (empty($airline_names)) $airline_names = $Spotter->getAllAirlineNames(); |
47 | - foreach($airline_names as $airline_name) |
|
47 | + foreach ($airline_names as $airline_name) |
|
48 | 48 | { |
49 | - if($airline == $airline_name['airline_icao']) |
|
49 | + if ($airline == $airline_name['airline_icao']) |
|
50 | 50 | { |
51 | 51 | print '<option value="'.$airline_name['airline_icao'].'" selected="selected">'.$airline_name['airline_name'].' ('.$airline_name['airline_icao'].')</option>'; |
52 | 52 | } else { |
@@ -80,12 +80,12 @@ discard block |
||
80 | 80 | print '</div>'; |
81 | 81 | } else { |
82 | 82 | print '<div class="info column">'; |
83 | - print '<h1>'.str_replace('_',' ',str_replace('alliance_','',$airline)).'</h1>'; |
|
84 | - if (@getimagesize($globalURL.'/images/airlines/'.str_replace('alliance_','',$airline).'.png') || @getimagesize('images/airlines/'.str_replace('alliance_','',$airline).'.png')) |
|
83 | + print '<h1>'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'</h1>'; |
|
84 | + if (@getimagesize($globalURL.'/images/airlines/'.str_replace('alliance_', '', $airline).'.png') || @getimagesize('images/airlines/'.str_replace('alliance_', '', $airline).'.png')) |
|
85 | 85 | { |
86 | - print '<img src="'.$globalURL.'/images/airlines/'.str_replace('alliance_','',$airline).'.png" alt="'.str_replace('_',' ',str_replace('alliance_','',$airline)).'" title="'.str_replace('_',' ',str_replace('alliance_','',$airline)).'" class="logo" />'; |
|
86 | + print '<img src="'.$globalURL.'/images/airlines/'.str_replace('alliance_', '', $airline).'.png" alt="'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'" title="'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'" class="logo" />'; |
|
87 | 87 | } |
88 | - print '<div><span class="label">'._("Name").'</span>'.str_replace('_',' ',str_replace('alliance_','',$airline)).'</div>'; |
|
88 | + print '<div><span class="label">'._("Name").'</span>'.str_replace('_', ' ', str_replace('alliance_', '', $airline)).'</div>'; |
|
89 | 89 | print '</div>'; |
90 | 90 | } |
91 | 91 | } else { |
@@ -96,9 +96,9 @@ discard block |
||
96 | 96 | print '<div class="column">'; |
97 | 97 | print '<h2>'._("Most Common Aircraft by Registration").'</h2>'; |
98 | 98 | if ($alliance) { |
99 | - print '<p>'.sprintf(_("The statistic below shows the most common aircraft by their registration of flights from <strong>%s</strong>."),str_replace('_',' ',str_replace('alliance_','',$airline))).'</p>'; |
|
99 | + print '<p>'.sprintf(_("The statistic below shows the most common aircraft by their registration of flights from <strong>%s</strong>."), str_replace('_', ' ', str_replace('alliance_', '', $airline))).'</p>'; |
|
100 | 100 | } else { |
101 | - print '<p>'.sprintf(_("The statistic below shows the most common aircraft by their registration of flights from <strong>%s</strong>."),$spotter_array[0]['airline_name']).'</p>'; |
|
101 | + print '<p>'.sprintf(_("The statistic below shows the most common aircraft by their registration of flights from <strong>%s</strong>."), $spotter_array[0]['airline_name']).'</p>'; |
|
102 | 102 | } |
103 | 103 | /* |
104 | 104 | if ($alliance) { |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | $aircraft_array = $Spotter->countAllAircraftRegistrationByAirline($airline); |
108 | 108 | } |
109 | 109 | */ |
110 | - $aircraft_array = $Stats->countAllAircraftRegistrations(true,$airline); |
|
110 | + $aircraft_array = $Stats->countAllAircraftRegistrations(true, $airline); |
|
111 | 111 | if (!empty($aircraft_array)) |
112 | 112 | { |
113 | 113 | print '<div class="table-responsive">'; |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | print '</thead>'; |
123 | 123 | print '<tbody>'; |
124 | 124 | $i = 1; |
125 | - foreach($aircraft_array as $aircraft_item) |
|
125 | + foreach ($aircraft_array as $aircraft_item) |
|
126 | 126 | { |
127 | 127 | print '<tr>'; |
128 | 128 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -43,7 +43,9 @@ discard block |
||
43 | 43 | } |
44 | 44 | $Stats = new Stats($Spotter->db); |
45 | 45 | $airline_names = $Stats->getAllAirlineNames(); |
46 | - if (empty($airline_names)) $airline_names = $Spotter->getAllAirlineNames(); |
|
46 | + if (empty($airline_names)) { |
|
47 | + $airline_names = $Spotter->getAllAirlineNames(); |
|
48 | + } |
|
47 | 49 | foreach($airline_names as $airline_name) |
48 | 50 | { |
49 | 51 | if($airline == $airline_name['airline_icao']) |
@@ -66,8 +68,7 @@ discard block |
||
66 | 68 | if ($globalIVAO && @getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.gif')) |
67 | 69 | { |
68 | 70 | print '<img src="'.$globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.gif" alt="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" title="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" class="logo" />'; |
69 | - } |
|
70 | - elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png')) |
|
71 | + } elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png')) |
|
71 | 72 | { |
72 | 73 | print '<img src="'.$globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png" alt="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" title="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" class="logo" />'; |
73 | 74 | } |
@@ -131,7 +132,9 @@ discard block |
||
131 | 132 | $images = $Image->getSpotterImage($aircraft_item['registration']); |
132 | 133 | if (isset($images['image_thumbnail'])) { |
133 | 134 | $aircraft_item['image_thumbnail'] = $images['image_thumbnail']; |
134 | - } else $aircraft_item['image_thumbnail'] = ''; |
|
135 | + } else { |
|
136 | + $aircraft_item['image_thumbnail'] = ''; |
|
137 | + } |
|
135 | 138 | } |
136 | 139 | if ($aircraft_item['image_thumbnail'] != "") |
137 | 140 | { |