@@ -21,7 +21,7 @@ |
||
21 | 21 | } |
22 | 22 | $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
23 | 23 | if ($airline_icao == '' && isset($globalFilter)) { |
24 | - if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
24 | + if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | require_once('header.php'); |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | } else { |
20 | 20 | $title = _("Statistics").' - '._("Most common Country a flight was over"); |
21 | 21 | } |
22 | -$airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
|
22 | +$airline_icao = (string) filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING); |
|
23 | 23 | if ($airline_icao == '' && isset($globalFilter)) { |
24 | 24 | if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
25 | 25 | } |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | } |
49 | 49 | |
50 | 50 | if ($type == 'aircraft') { |
51 | - $flightover_array = $Stats->countAllFlightOverCountries(false,$airline_icao,$filter_name); |
|
51 | + $flightover_array = $Stats->countAllFlightOverCountries(false, $airline_icao, $filter_name); |
|
52 | 52 | } elseif ($type == 'marine') { |
53 | 53 | $flightover_array = $Marine->countAllMarineOverCountries(); |
54 | 54 | } elseif ($type == 'tracker') { |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | print '<div id="chart" class="chart" width="100%"></div><script>'; |
63 | 63 | print 'var series = ['; |
64 | 64 | $flightover_data = ''; |
65 | -foreach($flightover_array as $flightover_item) |
|
65 | +foreach ($flightover_array as $flightover_item) |
|
66 | 66 | { |
67 | 67 | if ($type == 'aircraft') $flightover_data .= '[ "'.$flightover_item['flight_country_iso3'].'",'.$flightover_item['flight_count'].'],'; |
68 | 68 | elseif ($type == 'marine') $flightover_data .= '[ "'.$flightover_item['marine_country_iso3'].'",'.$flightover_item['marine_count'].'],'; |
@@ -113,8 +113,8 @@ discard block |
||
113 | 113 | print '</thead>'; |
114 | 114 | print '<tbody>'; |
115 | 115 | $i = 1; |
116 | - array_splice($flightover_array,10); |
|
117 | - foreach($flightover_array as $flightover_item) |
|
116 | + array_splice($flightover_array, 10); |
|
117 | + foreach ($flightover_array as $flightover_item) |
|
118 | 118 | { |
119 | 119 | print '<tr>'; |
120 | 120 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -4,7 +4,9 @@ discard block |
||
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | $Stats = new Stats(); |
6 | 6 | |
7 | -if (!isset($filter_name)) $filter_name = ''; |
|
7 | +if (!isset($filter_name)) { |
|
8 | + $filter_name = ''; |
|
9 | +} |
|
8 | 10 | $type = 'aircraft'; |
9 | 11 | if (isset($_GET['marine'])) { |
10 | 12 | $type = 'marine'; |
@@ -21,8 +23,10 @@ discard block |
||
21 | 23 | } |
22 | 24 | $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
23 | 25 | if ($airline_icao == '' && isset($globalFilter)) { |
24 | - if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
25 | -} |
|
26 | + if (isset($globalFilter['airline'])) { |
|
27 | + $airline_icao = $globalFilter['airline'][0]; |
|
28 | + } |
|
29 | + } |
|
26 | 30 | |
27 | 31 | require_once('header.php'); |
28 | 32 | include('statistics-sub-menu.php'); |
@@ -64,10 +68,14 @@ discard block |
||
64 | 68 | $flightover_data = ''; |
65 | 69 | foreach($flightover_array as $flightover_item) |
66 | 70 | { |
67 | - if ($type == 'aircraft') $flightover_data .= '[ "'.$flightover_item['flight_country_iso3'].'",'.$flightover_item['flight_count'].'],'; |
|
68 | - elseif ($type == 'marine') $flightover_data .= '[ "'.$flightover_item['marine_country_iso3'].'",'.$flightover_item['marine_count'].'],'; |
|
69 | - elseif ($type == 'tracker') $flightover_data .= '[ "'.$flightover_item['tracker_country_iso3'].'",'.$flightover_item['tracker_count'].'],'; |
|
70 | -} |
|
71 | + if ($type == 'aircraft') { |
|
72 | + $flightover_data .= '[ "'.$flightover_item['flight_country_iso3'].'",'.$flightover_item['flight_count'].'],'; |
|
73 | + } elseif ($type == 'marine') { |
|
74 | + $flightover_data .= '[ "'.$flightover_item['marine_country_iso3'].'",'.$flightover_item['marine_count'].'],'; |
|
75 | + } elseif ($type == 'tracker') { |
|
76 | + $flightover_data .= '[ "'.$flightover_item['tracker_country_iso3'].'",'.$flightover_item['tracker_count'].'],'; |
|
77 | + } |
|
78 | + } |
|
71 | 79 | $flightover_data = substr($flightover_data, 0, -1); |
72 | 80 | print $flightover_data; |
73 | 81 | print '];'; |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | ?> |
38 | 38 | </div> |
39 | 39 | <?php |
40 | - if (!isset($year) || (isset($year) && $year == '') && !isset($month) || (isset($month) && $month == '')) { |
|
40 | + if (!isset($year) || (isset($year) && $year == '') && !isset($month) || (isset($month) && $month == '')) { |
|
41 | 41 | ?> |
42 | 42 | <div class="sub-menu sub-menu-container"> |
43 | 43 | <ul class="nav"> |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | </ul> |
96 | 96 | </li> |
97 | 97 | <?php |
98 | - if (isset($globalAccidents) && $globalAccidents && (!isset($airline_icao) || $airline_icao == '' || $airline_icao == 'all')) { |
|
98 | + if (isset($globalAccidents) && $globalAccidents && (!isset($airline_icao) || $airline_icao == '' || $airline_icao == 'all')) { |
|
99 | 99 | ?> |
100 | 100 | <li class="dropdown"> |
101 | 101 | <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-fatalities-year" || strtolower($current_page) == "statistics-fatalities-month"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | </ul> |
108 | 108 | </li> |
109 | 109 | <?php |
110 | - } |
|
110 | + } |
|
111 | 111 | ?> |
112 | 112 | <?php |
113 | 113 | } elseif ($type == 'marine' || $type == 'tracker') { |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | </ul> |
128 | 128 | </div> |
129 | 129 | <?php |
130 | - } else { |
|
130 | + } else { |
|
131 | 131 | ?> |
132 | 132 | <div class="sub-menu sub-menu-container"> |
133 | 133 | <ul class="nav"> |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | </li> |
190 | 190 | --> |
191 | 191 | <?php |
192 | - if (isset($globalAccidents) && $globalAccidents && (!isset($airline_icao) || $airline_icao == '' || $airline_icao == 'all')) { |
|
192 | + if (isset($globalAccidents) && $globalAccidents && (!isset($airline_icao) || $airline_icao == '' || $airline_icao == 'all')) { |
|
193 | 193 | ?> |
194 | 194 | <!-- |
195 | 195 | <li class="dropdown"> |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | </li> |
204 | 204 | --> |
205 | 205 | <?php |
206 | - } |
|
206 | + } |
|
207 | 207 | ?> |
208 | 208 | <?php |
209 | 209 | } elseif ($type == 'marine' || $type == 'tracker') { |
@@ -224,5 +224,5 @@ discard block |
||
224 | 224 | </ul> |
225 | 225 | </div> |
226 | 226 | <?php |
227 | - } |
|
227 | + } |
|
228 | 228 | ?> |
229 | 229 | \ No newline at end of file |
@@ -28,11 +28,11 @@ discard block |
||
28 | 28 | $Spotter = new Spotter(); |
29 | 29 | $alliances = $Spotter->getAllAllianceNames(); |
30 | 30 | if (!empty($alliances)) { |
31 | - foreach($alliances as $alliance) { |
|
32 | - if (isset($airline_icao) && str_replace('_',' ',str_replace('alliance_','',$airline_icao)) == $alliance['alliance']) { |
|
33 | - print '<option value="alliance_'.str_replace(' ','_',$alliance['alliance']).'" selected>'.$alliance['alliance'].'</option>'; |
|
31 | + foreach ($alliances as $alliance) { |
|
32 | + if (isset($airline_icao) && str_replace('_', ' ', str_replace('alliance_', '', $airline_icao)) == $alliance['alliance']) { |
|
33 | + print '<option value="alliance_'.str_replace(' ', '_', $alliance['alliance']).'" selected>'.$alliance['alliance'].'</option>'; |
|
34 | 34 | } else { |
35 | - print '<option value="alliance_'.str_replace(' ','_',$alliance['alliance']).'">'.$alliance['alliance'].'</option>'; |
|
35 | + print '<option value="alliance_'.str_replace(' ', '_', $alliance['alliance']).'">'.$alliance['alliance'].'</option>'; |
|
36 | 36 | } |
37 | 37 | } |
38 | 38 | print '<option disabled>──────────</option>'; |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | $Stats = new Stats(); |
41 | 41 | if (!isset($filter_name)) $filter_name = ''; |
42 | 42 | $airlines = $Stats->getAllAirlineNames($filter_name); |
43 | - foreach($airlines as $airline) { |
|
43 | + foreach ($airlines as $airline) { |
|
44 | 44 | if ($airline['airline_icao'] != '') { |
45 | 45 | if (isset($airline_icao) && $airline_icao != 'all' && $airline_icao == $airline['airline_icao']) { |
46 | 46 | print '<option value="'.$airline['airline_icao'].'" selected>'.$airline['airline_name'].'</option>'; |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | if (!isset($type) || $type == 'aircraft') { |
66 | 66 | ?> |
67 | 67 | <li class="dropdown"> |
68 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-aircraft" || strtolower($current_page) == "statistics-registration" || strtolower($current_page) == "statistics-manufacturer"){ print 'active'; } ?>" data-toggle="dropdown" href="#" > |
|
68 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-aircraft" || strtolower($current_page) == "statistics-registration" || strtolower($current_page) == "statistics-manufacturer") { print 'active'; } ?>" data-toggle="dropdown" href="#" > |
|
69 | 69 | <?php echo _("Aircraft"); ?> <span class="caret"></span> |
70 | 70 | </a> |
71 | 71 | <ul class="dropdown-menu"> |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | </ul> |
77 | 77 | </li> |
78 | 78 | <li class="dropdown"> |
79 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-airline" || strtolower($current_page) == "statistics-airline-country" || strtolower($current_page) == "statistics-callsign"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
79 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-airline" || strtolower($current_page) == "statistics-airline-country" || strtolower($current_page) == "statistics-callsign") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
80 | 80 | <?php echo _("Airline"); ?> <span class="caret"></span> |
81 | 81 | </a> |
82 | 82 | <ul class="dropdown-menu" role="menu"> |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | </ul> |
93 | 93 | </li> |
94 | 94 | <li class="dropdown"> |
95 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-airport-departure" || strtolower($current_page) == "statistics-airport-departure-country" || strtolower($current_page) == "statistics-airport-arrival" || strtolower($current_page) == "statistics-airport-arrival-country"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
95 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-airport-departure" || strtolower($current_page) == "statistics-airport-departure-country" || strtolower($current_page) == "statistics-airport-arrival" || strtolower($current_page) == "statistics-airport-arrival-country") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
96 | 96 | <?php echo _("Airport"); ?> <span class="caret"></span> |
97 | 97 | </a> |
98 | 98 | <ul class="dropdown-menu" role="menu"> |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | </ul> |
104 | 104 | </li> |
105 | 105 | <li class="dropdown"> |
106 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-route-airport" || strtolower($current_page) == "statistics-route-waypoint"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
106 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-route-airport" || strtolower($current_page) == "statistics-route-waypoint") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
107 | 107 | <?php echo _("Route"); ?> <span class="caret"></span> |
108 | 108 | </a> |
109 | 109 | <ul class="dropdown-menu" role="menu"> |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | </ul> |
113 | 113 | </li> |
114 | 114 | <li class="dropdown"> |
115 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-date" || strtolower($current_page) == "statistics-time"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
115 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-date" || strtolower($current_page) == "statistics-time") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
116 | 116 | <?php echo _("Date & Time"); ?> <span class="caret"></span> |
117 | 117 | </a> |
118 | 118 | <ul class="dropdown-menu" role="menu"> |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | if (isset($globalAccidents) && $globalAccidents && (!isset($airline_icao) || $airline_icao == '' || $airline_icao == 'all')) { |
125 | 125 | ?> |
126 | 126 | <li class="dropdown"> |
127 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-fatalities-year" || strtolower($current_page) == "statistics-fatalities-month"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
127 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-fatalities-year" || strtolower($current_page) == "statistics-fatalities-month") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
128 | 128 | <?php echo _("Fatalities"); ?> <span class="caret"></span> |
129 | 129 | </a> |
130 | 130 | <ul class="dropdown-menu" role="menu"> |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | } elseif ($type == 'marine' || $type == 'tracker') { |
140 | 140 | ?> |
141 | 141 | <li class="dropdown"> |
142 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-date" || strtolower($current_page) == "statistics-time"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
142 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-date" || strtolower($current_page) == "statistics-time") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
143 | 143 | <?php echo _("Date & Time"); ?> <span class="caret"></span> |
144 | 144 | </a> |
145 | 145 | <ul class="dropdown-menu" role="menu"> |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | if (!isset($type) || $type == 'aircraft') { |
170 | 170 | ?> |
171 | 171 | <li class="dropdown"> |
172 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-aircraft" || strtolower($current_page) == "statistics-registration" || strtolower($current_page) == "statistics-manufacturer"){ print 'active'; } ?>" data-toggle="dropdown" href="#" > |
|
172 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-aircraft" || strtolower($current_page) == "statistics-registration" || strtolower($current_page) == "statistics-manufacturer") { print 'active'; } ?>" data-toggle="dropdown" href="#" > |
|
173 | 173 | <?php echo _("Aircraft"); ?> <span class="caret"></span> |
174 | 174 | </a> |
175 | 175 | <ul class="dropdown-menu"> |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | </ul> |
181 | 181 | </li> |
182 | 182 | <li class="dropdown"> |
183 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-airline" || strtolower($current_page) == "statistics-airline-country" || strtolower($current_page) == "statistics-callsign"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
183 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-airline" || strtolower($current_page) == "statistics-airline-country" || strtolower($current_page) == "statistics-callsign") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
184 | 184 | <?php echo _("Airline"); ?> <span class="caret"></span> |
185 | 185 | </a> |
186 | 186 | <ul class="dropdown-menu" role="menu"> |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | </ul> |
197 | 197 | </li> |
198 | 198 | <li class="dropdown"> |
199 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-airport-departure" || strtolower($current_page) == "statistics-airport-departure-country" || strtolower($current_page) == "statistics-airport-arrival" || strtolower($current_page) == "statistics-airport-arrival-country"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
199 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-airport-departure" || strtolower($current_page) == "statistics-airport-departure-country" || strtolower($current_page) == "statistics-airport-arrival" || strtolower($current_page) == "statistics-airport-arrival-country") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
200 | 200 | <?php echo _("Airport"); ?> <span class="caret"></span> |
201 | 201 | </a> |
202 | 202 | <ul class="dropdown-menu" role="menu"> |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | </li> |
209 | 209 | <!-- |
210 | 210 | <li class="dropdown"> |
211 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-route-airport" || strtolower($current_page) == "statistics-route-waypoint"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
211 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-route-airport" || strtolower($current_page) == "statistics-route-waypoint") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
212 | 212 | <?php echo _("Route"); ?> <span class="caret"></span> |
213 | 213 | </a> |
214 | 214 | <ul class="dropdown-menu" role="menu"> |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | --> |
220 | 220 | <!-- |
221 | 221 | <li class="dropdown"> |
222 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-date" || strtolower($current_page) == "statistics-time"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
222 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-date" || strtolower($current_page) == "statistics-time") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
223 | 223 | <?php echo _("Date & Time"); ?> <span class="caret"></span> |
224 | 224 | </a> |
225 | 225 | <ul class="dropdown-menu" role="menu"> |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | ?> |
234 | 234 | <!-- |
235 | 235 | <li class="dropdown"> |
236 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-fatalities-year" || strtolower($current_page) == "statistics-fatalities-month"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
236 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-fatalities-year" || strtolower($current_page) == "statistics-fatalities-month") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
237 | 237 | <?php echo _("Fatalities"); ?> <span class="caret"></span> |
238 | 238 | </a> |
239 | 239 | <ul class="dropdown-menu" role="menu"> |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | } elseif ($type == 'marine' || $type == 'tracker') { |
250 | 250 | ?> |
251 | 251 | <li class="dropdown"> |
252 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-date" || strtolower($current_page) == "statistics-time"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
252 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-date" || strtolower($current_page) == "statistics-time") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
253 | 253 | <?php echo _("Date & Time"); ?> <span class="caret"></span> |
254 | 254 | </a> |
255 | 255 | <ul class="dropdown-menu" role="menu"> |
@@ -6,7 +6,13 @@ discard block |
||
6 | 6 | if (!isset($type) || $type != 'satellite') { |
7 | 7 | ?> |
8 | 8 | <form id="changedate" method="post"> |
9 | - <input type="month" name="date" onchange="statsdatechange(this);" value="<?php if (isset($year) && $year != '') echo $year.'-'; ?><?php if (isset($month) && $month != '') echo $month; ?>" /> |
|
9 | + <input type="month" name="date" onchange="statsdatechange(this);" value="<?php if (isset($year) && $year != '') { |
|
10 | + echo $year.'-'; |
|
11 | +} |
|
12 | +?><?php if (isset($month) && $month != '') { |
|
13 | + echo $month; |
|
14 | +} |
|
15 | +?>" /> |
|
10 | 16 | </form> |
11 | 17 | <?php |
12 | 18 | } |
@@ -38,7 +44,9 @@ discard block |
||
38 | 44 | print '<option disabled>──────────</option>'; |
39 | 45 | } |
40 | 46 | $Stats = new Stats(); |
41 | - if (!isset($filter_name)) $filter_name = ''; |
|
47 | + if (!isset($filter_name)) { |
|
48 | + $filter_name = ''; |
|
49 | + } |
|
42 | 50 | $airlines = $Stats->getAllAirlineNames($filter_name); |
43 | 51 | foreach($airlines as $airline) { |
44 | 52 | if ($airline['airline_icao'] != '') { |
@@ -69,10 +77,22 @@ discard block |
||
69 | 77 | <?php echo _("Aircraft"); ?> <span class="caret"></span> |
70 | 78 | </a> |
71 | 79 | <ul class="dropdown-menu"> |
72 | - <li><a href="<?php print $globalURL; ?>/statistics/aircraft<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Aircraft"); ?></a></li> |
|
73 | - <li><a href="<?php print $globalURL; ?>/statistics/registration<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Registration"); ?></a></li> |
|
74 | - <li><a href="<?php print $globalURL; ?>/statistics/manufacturer<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Manufacturer"); ?></a></li> |
|
75 | - <li><a href="<?php print $globalURL; ?>/statistics/country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Country"); ?></a></li> |
|
80 | + <li><a href="<?php print $globalURL; ?>/statistics/aircraft<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
81 | + echo '/'.$airline_icao; |
|
82 | +} |
|
83 | +?>"><?php echo _("Aircraft"); ?></a></li> |
|
84 | + <li><a href="<?php print $globalURL; ?>/statistics/registration<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
85 | + echo '/'.$airline_icao; |
|
86 | +} |
|
87 | +?>"><?php echo _("Registration"); ?></a></li> |
|
88 | + <li><a href="<?php print $globalURL; ?>/statistics/manufacturer<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
89 | + echo '/'.$airline_icao; |
|
90 | +} |
|
91 | +?>"><?php echo _("Manufacturer"); ?></a></li> |
|
92 | + <li><a href="<?php print $globalURL; ?>/statistics/country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
93 | + echo '/'.$airline_icao; |
|
94 | +} |
|
95 | +?>"><?php echo _("Country"); ?></a></li> |
|
76 | 96 | </ul> |
77 | 97 | </li> |
78 | 98 | <li class="dropdown"> |
@@ -83,12 +103,21 @@ discard block |
||
83 | 103 | <?php |
84 | 104 | if (!isset($airline_icao) || $airline_icao == 'all') { |
85 | 105 | ?> |
86 | - <li><a href="<?php print $globalURL; ?>/statistics/airline<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Airline"); ?></a></li> |
|
87 | - <li><a href="<?php print $globalURL; ?>/statistics/airline-country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Airline by Country"); ?></a></li> |
|
106 | + <li><a href="<?php print $globalURL; ?>/statistics/airline<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
107 | + echo '/'.$airline_icao; |
|
108 | +} |
|
109 | +?>"><?php echo _("Airline"); ?></a></li> |
|
110 | + <li><a href="<?php print $globalURL; ?>/statistics/airline-country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
111 | + echo '/'.$airline_icao; |
|
112 | +} |
|
113 | +?>"><?php echo _("Airline by Country"); ?></a></li> |
|
88 | 114 | <?php |
89 | 115 | } |
90 | 116 | ?> |
91 | - <li><a href="<?php print $globalURL; ?>/statistics/callsign<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Callsign"); ?></a></li> |
|
117 | + <li><a href="<?php print $globalURL; ?>/statistics/callsign<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
118 | + echo '/'.$airline_icao; |
|
119 | +} |
|
120 | +?>"><?php echo _("Callsign"); ?></a></li> |
|
92 | 121 | </ul> |
93 | 122 | </li> |
94 | 123 | <li class="dropdown"> |
@@ -96,10 +125,22 @@ discard block |
||
96 | 125 | <?php echo _("Airport"); ?> <span class="caret"></span> |
97 | 126 | </a> |
98 | 127 | <ul class="dropdown-menu" role="menu"> |
99 | - <li><a href="<?php print $globalURL; ?>/statistics/airport-departure<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Departure Airport"); ?></a></li> |
|
100 | - <li><a href="<?php print $globalURL; ?>/statistics/airport-departure-country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Departure Airport by Country"); ?></a></li> |
|
101 | - <li><a href="<?php print $globalURL; ?>/statistics/airport-arrival<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Arrival Airport"); ?></a></li> |
|
102 | - <li><a href="<?php print $globalURL; ?>/statistics/airport-arrival-country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Arrival Airport by Country"); ?></a></li> |
|
128 | + <li><a href="<?php print $globalURL; ?>/statistics/airport-departure<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
129 | + echo '/'.$airline_icao; |
|
130 | +} |
|
131 | +?>"><?php echo _("Departure Airport"); ?></a></li> |
|
132 | + <li><a href="<?php print $globalURL; ?>/statistics/airport-departure-country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
133 | + echo '/'.$airline_icao; |
|
134 | +} |
|
135 | +?>"><?php echo _("Departure Airport by Country"); ?></a></li> |
|
136 | + <li><a href="<?php print $globalURL; ?>/statistics/airport-arrival<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
137 | + echo '/'.$airline_icao; |
|
138 | +} |
|
139 | +?>"><?php echo _("Arrival Airport"); ?></a></li> |
|
140 | + <li><a href="<?php print $globalURL; ?>/statistics/airport-arrival-country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
141 | + echo '/'.$airline_icao; |
|
142 | +} |
|
143 | +?>"><?php echo _("Arrival Airport by Country"); ?></a></li> |
|
103 | 144 | </ul> |
104 | 145 | </li> |
105 | 146 | <li class="dropdown"> |
@@ -107,8 +148,14 @@ discard block |
||
107 | 148 | <?php echo _("Route"); ?> <span class="caret"></span> |
108 | 149 | </a> |
109 | 150 | <ul class="dropdown-menu" role="menu"> |
110 | - <li><a href="<?php print $globalURL; ?>/statistics/route-airport<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Route by Airport"); ?></a></li> |
|
111 | - <li><a href="<?php print $globalURL; ?>/statistics/route-waypoint<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Route by Waypoint"); ?></a></li> |
|
151 | + <li><a href="<?php print $globalURL; ?>/statistics/route-airport<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
152 | + echo '/'.$airline_icao; |
|
153 | +} |
|
154 | +?>"><?php echo _("Route by Airport"); ?></a></li> |
|
155 | + <li><a href="<?php print $globalURL; ?>/statistics/route-waypoint<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
156 | + echo '/'.$airline_icao; |
|
157 | +} |
|
158 | +?>"><?php echo _("Route by Waypoint"); ?></a></li> |
|
112 | 159 | </ul> |
113 | 160 | </li> |
114 | 161 | <li class="dropdown"> |
@@ -116,8 +163,14 @@ discard block |
||
116 | 163 | <?php echo _("Date & Time"); ?> <span class="caret"></span> |
117 | 164 | </a> |
118 | 165 | <ul class="dropdown-menu" role="menu"> |
119 | - <li><a href="<?php print $globalURL; ?>/statistics/date<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Date"); ?></a></li> |
|
120 | - <li><a href="<?php print $globalURL; ?>/statistics/time<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Time"); ?></a></li> |
|
166 | + <li><a href="<?php print $globalURL; ?>/statistics/date<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
167 | + echo '/'.$airline_icao; |
|
168 | +} |
|
169 | +?>"><?php echo _("Date"); ?></a></li> |
|
170 | + <li><a href="<?php print $globalURL; ?>/statistics/time<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
171 | + echo '/'.$airline_icao; |
|
172 | +} |
|
173 | +?>"><?php echo _("Time"); ?></a></li> |
|
121 | 174 | </ul> |
122 | 175 | </li> |
123 | 176 | <?php |
@@ -173,9 +226,18 @@ discard block |
||
173 | 226 | <?php echo _("Aircraft"); ?> <span class="caret"></span> |
174 | 227 | </a> |
175 | 228 | <ul class="dropdown-menu"> |
176 | - <li><a href="<?php print $globalURL; ?>/statistics/aircraft<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Aircraft"); ?></a></li> |
|
177 | - <li><a href="<?php print $globalURL; ?>/statistics/registration<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Registration"); ?></a></li> |
|
178 | - <li><a href="<?php print $globalURL; ?>/statistics/manufacturer<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Manufacturer"); ?></a></li> |
|
229 | + <li><a href="<?php print $globalURL; ?>/statistics/aircraft<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
230 | + echo '/'.$airline_icao; |
|
231 | +} |
|
232 | +?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Aircraft"); ?></a></li> |
|
233 | + <li><a href="<?php print $globalURL; ?>/statistics/registration<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
234 | + echo '/'.$airline_icao; |
|
235 | +} |
|
236 | +?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Registration"); ?></a></li> |
|
237 | + <li><a href="<?php print $globalURL; ?>/statistics/manufacturer<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
238 | + echo '/'.$airline_icao; |
|
239 | +} |
|
240 | +?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Manufacturer"); ?></a></li> |
|
179 | 241 | <!-- <li><a href="<?php print $globalURL; ?>/statistics/country"><?php echo _("Country"); ?></a></li> --> |
180 | 242 | </ul> |
181 | 243 | </li> |
@@ -187,12 +249,21 @@ discard block |
||
187 | 249 | <?php |
188 | 250 | if (!isset($airline_icao) || $airline_icao == 'all') { |
189 | 251 | ?> |
190 | - <li><a href="<?php print $globalURL; ?>/statistics/airline<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Airline"); ?></a></li> |
|
191 | - <li><a href="<?php print $globalURL; ?>/statistics/airline-country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Airline by Country"); ?></a></li> |
|
252 | + <li><a href="<?php print $globalURL; ?>/statistics/airline<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
253 | + echo '/'.$airline_icao; |
|
254 | +} |
|
255 | +?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Airline"); ?></a></li> |
|
256 | + <li><a href="<?php print $globalURL; ?>/statistics/airline-country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
257 | + echo '/'.$airline_icao; |
|
258 | +} |
|
259 | +?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Airline by Country"); ?></a></li> |
|
192 | 260 | <?php |
193 | 261 | } |
194 | 262 | ?> |
195 | - <li><a href="<?php print $globalURL; ?>/statistics/callsign<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Callsign"); ?></a></li> |
|
263 | + <li><a href="<?php print $globalURL; ?>/statistics/callsign<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
264 | + echo '/'.$airline_icao; |
|
265 | +} |
|
266 | +?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Callsign"); ?></a></li> |
|
196 | 267 | </ul> |
197 | 268 | </li> |
198 | 269 | <li class="dropdown"> |
@@ -200,10 +271,22 @@ discard block |
||
200 | 271 | <?php echo _("Airport"); ?> <span class="caret"></span> |
201 | 272 | </a> |
202 | 273 | <ul class="dropdown-menu" role="menu"> |
203 | - <li><a href="<?php print $globalURL; ?>/statistics/airport-departure<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Departure Airport"); ?></a></li> |
|
204 | - <li><a href="<?php print $globalURL; ?>/statistics/airport-departure-country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Departure Airport by Country"); ?></a></li> |
|
205 | - <li><a href="<?php print $globalURL; ?>/statistics/airport-arrival<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Arrival Airport"); ?></a></li> |
|
206 | - <li><a href="<?php print $globalURL; ?>/statistics/airport-arrival-country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Arrival Airport by Country"); ?></a></li> |
|
274 | + <li><a href="<?php print $globalURL; ?>/statistics/airport-departure<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
275 | + echo '/'.$airline_icao; |
|
276 | +} |
|
277 | +?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Departure Airport"); ?></a></li> |
|
278 | + <li><a href="<?php print $globalURL; ?>/statistics/airport-departure-country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
279 | + echo '/'.$airline_icao; |
|
280 | +} |
|
281 | +?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Departure Airport by Country"); ?></a></li> |
|
282 | + <li><a href="<?php print $globalURL; ?>/statistics/airport-arrival<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
283 | + echo '/'.$airline_icao; |
|
284 | +} |
|
285 | +?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Arrival Airport"); ?></a></li> |
|
286 | + <li><a href="<?php print $globalURL; ?>/statistics/airport-arrival-country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
287 | + echo '/'.$airline_icao; |
|
288 | +} |
|
289 | +?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Arrival Airport by Country"); ?></a></li> |
|
207 | 290 | </ul> |
208 | 291 | </li> |
209 | 292 | <!-- |
@@ -40,15 +40,15 @@ |
||
40 | 40 | //print '<div><span>'._("Country").'</span>'.$spotter_item['country'].'</div>'; |
41 | 41 | print '<div><span>'._("Coordinates").'</span>'.round($spotter_item['latitude'],3).', '.round($spotter_item['longitude'],3).'</div>'; |
42 | 42 | if ($spotter_item['atc_range'] > 0) { |
43 | - print '<div><span>'._("Range").'</span>'; |
|
44 | - print $spotter_item['atc_range']; |
|
45 | - print '</div>'; |
|
43 | + print '<div><span>'._("Range").'</span>'; |
|
44 | + print $spotter_item['atc_range']; |
|
45 | + print '</div>'; |
|
46 | 46 | } |
47 | 47 | print '</div>'; |
48 | 48 | if ($spotter_item['info'] != '') { |
49 | - print '<div class="notamtext"><span>'._("Info").'</span>'; |
|
50 | - print $spotter_item['info']; |
|
51 | - print '</div>'; |
|
49 | + print '<div class="notamtext"><span>'._("Info").'</span>'; |
|
50 | + print $spotter_item['info']; |
|
51 | + print '</div>'; |
|
52 | 52 | } |
53 | 53 | print '</div>'; |
54 | 54 | } |
@@ -5,8 +5,8 @@ discard block |
||
5 | 5 | $ATC = new ATC(); |
6 | 6 | |
7 | 7 | if (isset($_GET['atcid'])) { |
8 | - $atcid = filter_input(INPUT_GET,'atcid',FILTER_SANITIZE_NUMBER_INT); |
|
9 | - $atcident = filter_input(INPUT_GET,'atcident',FILTER_SANITIZE_STRING); |
|
8 | + $atcid = filter_input(INPUT_GET, 'atcid', FILTER_SANITIZE_NUMBER_INT); |
|
9 | + $atcident = filter_input(INPUT_GET, 'atcident', FILTER_SANITIZE_STRING); |
|
10 | 10 | $atc_data = $ATC->getById($atcid); |
11 | 11 | if (!isset($atc_data[0])) $atc_data = $ATC->getByIdent($atcident); |
12 | 12 | ?> |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | print '</div>'; |
39 | 39 | |
40 | 40 | //print '<div><span>'._("Country").'</span>'.$spotter_item['country'].'</div>'; |
41 | -print '<div><span>'._("Coordinates").'</span>'.round($spotter_item['latitude'],3).', '.round($spotter_item['longitude'],3).'</div>'; |
|
41 | +print '<div><span>'._("Coordinates").'</span>'.round($spotter_item['latitude'], 3).', '.round($spotter_item['longitude'], 3).'</div>'; |
|
42 | 42 | if ($spotter_item['atc_range'] > 0) { |
43 | 43 | print '<div><span>'._("Range").'</span>'; |
44 | 44 | print $spotter_item['atc_range']; |
@@ -8,7 +8,9 @@ |
||
8 | 8 | $atcid = filter_input(INPUT_GET,'atcid',FILTER_SANITIZE_NUMBER_INT); |
9 | 9 | $atcident = filter_input(INPUT_GET,'atcident',FILTER_SANITIZE_STRING); |
10 | 10 | $atc_data = $ATC->getById($atcid); |
11 | - if (!isset($atc_data[0])) $atc_data = $ATC->getByIdent($atcident); |
|
11 | + if (!isset($atc_data[0])) { |
|
12 | + $atc_data = $ATC->getByIdent($atcident); |
|
13 | + } |
|
12 | 14 | ?> |
13 | 15 | <div class="alldetails"> |
14 | 16 | <button type="button" class="close">×</button> |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | print '<th class="arrival"><span class="nomobile">'._("Going to").'</span><span class="mobile">'._("To").'</span></th>'; |
278 | 278 | } |
279 | 279 | } |
280 | - if ($type == 'aircraft') { |
|
280 | + if ($type == 'aircraft') { |
|
281 | 281 | if ((isset($globalUsePilot) && $globalUsePilot) || (!isset($globalUsePilot) && ((isset($globalVA) && $globalVA) || (isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalVAM) && $globalVAM) || (isset($globalphpVMS) && $globalphpVMS)))) { |
282 | 282 | print '<th class="pilot"><span class="nomobile">'._("Pilot name").'</span><span class="mobile">'._("Pilot").'</span></a></th>'; |
283 | 283 | } |
@@ -579,7 +579,7 @@ discard block |
||
579 | 579 | } elseif(strtolower($current_page) != "currently" && strtolower($current_page) != "upcoming" && strtolower($current_page) != "acars-latest" && strtolower($current_page) != "acars-archive" && strtolower($current_page) != "accident-latest" && strtolower($current_page) != "incident-latest" && strtolower($current_page) != "accident-detailed" && strtolower($current_page) != "incident-detailed"){ |
580 | 580 | if ($type == 'aircraft') { |
581 | 581 | if (!isset($spotter_item['squawk']) || $spotter_item['squawk'] == 0) { |
582 | - $spotter_item['squawk'] = '-'; |
|
582 | + $spotter_item['squawk'] = '-'; |
|
583 | 583 | } |
584 | 584 | if ($spotter_item['image_thumbnail'] != "") |
585 | 585 | { |
@@ -618,7 +618,7 @@ discard block |
||
618 | 618 | print '</td>'."\n"; |
619 | 619 | } else { |
620 | 620 | print '<td class="aircraft_thumbnail">'."\n"; |
621 | - // print '<a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'"><img src="'.$globalURL.'/images/placeholder_thumb.png" alt="Click to see more information about this flight" title="Click to see more information about this flight" width="100px" /></a>'; |
|
621 | + // print '<a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'"><img src="'.$globalURL.'/images/placeholder_thumb.png" alt="Click to see more information about this flight" title="Click to see more information about this flight" width="100px" /></a>'; |
|
622 | 622 | //} |
623 | 623 | if (!isset($spotter_item['airline_name']) && !isset($spotter_item['aircraft_name'])) { |
624 | 624 | print '<a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'"><img src="'.$globalURL.'/images/placeholder_thumb.png" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' '._("Not available").' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '._("Not available").'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n"; |
@@ -4,8 +4,8 @@ discard block |
||
4 | 4 | |
5 | 5 | require_once(dirname(__FILE__).'/require/class.Common.php'); |
6 | 6 | $Common = new Common(); |
7 | -$showRouteStop = $Common->multiKeyExists($spotter_array,'route_stop'); |
|
8 | -$showDuration = $Common->multiKeyExists($spotter_array,'duration'); |
|
7 | +$showRouteStop = $Common->multiKeyExists($spotter_array, 'route_stop'); |
|
8 | +$showDuration = $Common->multiKeyExists($spotter_array, 'duration'); |
|
9 | 9 | |
10 | 10 | if (!isset($type)) $type = 'aircraft'; |
11 | 11 | |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | } |
140 | 140 | print '<th class="more"></th>'; |
141 | 141 | print '</thead>'; |
142 | -} else if (strtolower($current_page) == "upcoming"){ |
|
142 | +} else if (strtolower($current_page) == "upcoming") { |
|
143 | 143 | print '<thead>'; |
144 | 144 | if (!isset($globalNoAirlines) || $globalNoAirlines === FALSE) { |
145 | 145 | if ($_GET['sort'] == "airline_name_asc") |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | } |
194 | 194 | */ |
195 | 195 | print '</thead>'; |
196 | -} else if (strtolower($current_page) == "acars-latest" || strtolower($current_page) == "acars-archive"){ |
|
196 | +} else if (strtolower($current_page) == "acars-latest" || strtolower($current_page) == "acars-archive") { |
|
197 | 197 | print '<thead>'; |
198 | 198 | print '<th class="aircraft_thumbnail"></th>'; |
199 | 199 | print '<th class="logo">'._("Airline").'</th>'; |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | print '</thead>'; |
231 | 231 | } else { |
232 | 232 | |
233 | - if ($hide_th_links === true){ |
|
233 | + if ($hide_th_links === true) { |
|
234 | 234 | print '<thead>'; |
235 | 235 | print '<th class="aircraft_thumbnail"></th>'; |
236 | 236 | if ($type == 'aircraft') { |
@@ -487,7 +487,7 @@ discard block |
||
487 | 487 | } |
488 | 488 | |
489 | 489 | print '<tbody>'."\n"; |
490 | -foreach($spotter_array as $spotter_item) |
|
490 | +foreach ($spotter_array as $spotter_item) |
|
491 | 491 | { |
492 | 492 | if (isset($globalTimezone)) |
493 | 493 | { |
@@ -522,13 +522,13 @@ discard block |
||
522 | 522 | $image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id; |
523 | 523 | } |
524 | 524 | if (isset($spotter_item['airline_name'])) { |
525 | - print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" alt="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Airline:").' '.$spotter_item['airline_name'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
|
525 | + print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" alt="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Airline:").' '.$spotter_item['airline_name'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
|
526 | 526 | } else { |
527 | - print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Airline:").' '._("Not available").'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
|
527 | + print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Airline:").' '._("Not available").'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
|
528 | 528 | } |
529 | 529 | } else { |
530 | 530 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
531 | - $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
|
531 | + $image_thumbnail = preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']); |
|
532 | 532 | } else $image_thumbnail = $spotter_item['image_thumbnail']; |
533 | 533 | if (isset($spotter_item['airline_name'])) { |
534 | 534 | print '<img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" alt="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Airline:").' '.$spotter_item['airline_name'].'" data-html="true" width="100px" />'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
@@ -547,7 +547,7 @@ discard block |
||
547 | 547 | { |
548 | 548 | print '<td class="aircraft_thumbnail">'."\n"; |
549 | 549 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
550 | - $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
|
550 | + $image_thumbnail = preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']); |
|
551 | 551 | } else $image_thumbnail = $spotter_item['image_thumbnail']; |
552 | 552 | if (isset($spotter_item['airline_name'])) { |
553 | 553 | print '<img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['mmsi'].'" alt="'.$spotter_item['mmsi'].'" data-content="'._("MMSI:").' '.$spotter_item['mmsi'].'" data-html="true" width="100px" />'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
@@ -565,7 +565,7 @@ discard block |
||
565 | 565 | { |
566 | 566 | print '<td class="aircraft_thumbnail">'."\n"; |
567 | 567 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
568 | - $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
|
568 | + $image_thumbnail = preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']); |
|
569 | 569 | } else $image_thumbnail = $spotter_item['image_thumbnail']; |
570 | 570 | print '<img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['ident'].'" alt="'.$spotter_item['type'].'" data-content="'._("Type:").' '.$spotter_item['type'].'" data-html="true" width="100px" />'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
571 | 571 | print '</td>'."\n"; |
@@ -609,7 +609,7 @@ discard block |
||
609 | 609 | print '</td>'."\n"; |
610 | 610 | } |
611 | 611 | } |
612 | - } elseif(strtolower($current_page) != "currently" && strtolower($current_page) != "upcoming" && strtolower($current_page) != "acars-latest" && strtolower($current_page) != "acars-archive" && strtolower($current_page) != "accident-latest" && strtolower($current_page) != "incident-latest" && strtolower($current_page) != "accident-detailed" && strtolower($current_page) != "incident-detailed"){ |
|
612 | + } elseif (strtolower($current_page) != "currently" && strtolower($current_page) != "upcoming" && strtolower($current_page) != "acars-latest" && strtolower($current_page) != "acars-archive" && strtolower($current_page) != "accident-latest" && strtolower($current_page) != "incident-latest" && strtolower($current_page) != "accident-detailed" && strtolower($current_page) != "incident-detailed") { |
|
613 | 613 | if ($type == 'aircraft') { |
614 | 614 | if (!isset($spotter_item['squawk']) || $spotter_item['squawk'] == 0) { |
615 | 615 | $spotter_item['squawk'] = '-'; |
@@ -626,17 +626,17 @@ discard block |
||
626 | 626 | $image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id; |
627 | 627 | } |
628 | 628 | if (!isset($spotter_item['airline_name']) && isset($spotter_item['aircraft_name'])) { |
629 | - print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '._("Not available").'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
|
629 | + print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '._("Not available").'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
|
630 | 630 | } elseif (!isset($spotter_item['aircraft_name']) && isset($spotter_item['airline_name'])) { |
631 | - print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '.$spotter_item['airline_name'].'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '.$spotter_item['airline_name'].'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '.$spotter_item['airline_name'].'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
|
631 | + print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '.$spotter_item['airline_name'].'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '.$spotter_item['airline_name'].'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '.$spotter_item['airline_name'].'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
|
632 | 632 | } elseif (!isset($spotter_item['aircraft_name']) && !isset($spotter_item['airline_name'])) { |
633 | - print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '._("Not available").'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
|
633 | + print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '._("Not available").'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
|
634 | 634 | } else { |
635 | - print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '.$spotter_item['airline_name'].'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '.$spotter_item['airline_name'].'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '.$spotter_item['airline_name'].'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
|
635 | + print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '.$spotter_item['airline_name'].'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '.$spotter_item['airline_name'].'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '.$spotter_item['airline_name'].'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
|
636 | 636 | } |
637 | 637 | } else { |
638 | 638 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
639 | - $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
|
639 | + $image_thumbnail = preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']); |
|
640 | 640 | } else $image_thumbnail = $spotter_item['image_thumbnail']; |
641 | 641 | if (!isset($spotter_item['airline_name']) && isset($spotter_item['aircraft_name'])) { |
642 | 642 | print '<a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'"><img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '._("Not available").'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
@@ -669,7 +669,7 @@ discard block |
||
669 | 669 | { |
670 | 670 | print '<td class="aircraft_thumbnail">'."\n"; |
671 | 671 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
672 | - $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
|
672 | + $image_thumbnail = preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']); |
|
673 | 673 | } else $image_thumbnail = $spotter_item['image_thumbnail']; |
674 | 674 | print '<img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['mmsi'].'" alt="'.$spotter_item['mmsi'].'" data-content="'._("MMSI:").' '.$spotter_item['mmsi'].'" data-html="true" width="100px" />'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
675 | 675 | print '</td>'."\n"; |
@@ -683,7 +683,7 @@ discard block |
||
683 | 683 | { |
684 | 684 | print '<td class="aircraft_thumbnail">'."\n"; |
685 | 685 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
686 | - $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
|
686 | + $image_thumbnail = preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']); |
|
687 | 687 | } else $image_thumbnail = $spotter_item['image_thumbnail']; |
688 | 688 | print '<img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['ident'].'" alt="'.$spotter_item['type'].'" data-content="'._("Type:").' '.$spotter_item['type'].'" data-html="true" width="100px" />'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
689 | 689 | print '</td>'."\n"; |
@@ -792,7 +792,7 @@ discard block |
||
792 | 792 | print '</td>'."\n"; |
793 | 793 | } |
794 | 794 | // Aircraft type |
795 | - if(strtolower($current_page) != "upcoming" && strtolower($current_page) != "acars-latest" && strtolower($current_page) != "acars-archive"){ |
|
795 | + if (strtolower($current_page) != "upcoming" && strtolower($current_page) != "acars-latest" && strtolower($current_page) != "acars-archive") { |
|
796 | 796 | print '<td class="type">'."\n"; |
797 | 797 | if ($type == 'aircraft') { |
798 | 798 | if (!isset($spotter_item['aircraft_type']) && isset($spotter_item['aircraft_name'])) { |
@@ -801,7 +801,7 @@ discard block |
||
801 | 801 | //print '<span class="nomobile"><a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'._("Not available").'</a></span>'."\n"; |
802 | 802 | print '<span class="nomobile"><a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_type'].'</a></span>'."\n"; |
803 | 803 | } else { |
804 | - $aircraft_names = explode('/',$spotter_item['aircraft_name']); |
|
804 | + $aircraft_names = explode('/', $spotter_item['aircraft_name']); |
|
805 | 805 | if (count($aircraft_names) == 1) print '<span class="nomobile"><a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name'].'</a></span>'."\n"; |
806 | 806 | else print '<span class="nomobile"><a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'" title="'.$spotter_item['aircraft_name'].'">'.$spotter_item['aircraft_manufacturer'].' '.$aircraft_names[0].'</a></span>'."\n"; |
807 | 807 | } |
@@ -845,22 +845,22 @@ discard block |
||
845 | 845 | } |
846 | 846 | if (isset($spotter_item['departure_airport_time']) && isset($spotter_item['real_departure_airport_time'])) { |
847 | 847 | if ($spotter_item['departure_airport_time'] > 2460) { |
848 | - $departure_airport_time = date('H:m',$spotter_item['departure_airport_time']); |
|
849 | - } else $departure_airport_time = substr($spotter_item['departure_airport_time'],0,-2).':'.substr($spotter_item['departure_airport_time'],-2); |
|
848 | + $departure_airport_time = date('H:m', $spotter_item['departure_airport_time']); |
|
849 | + } else $departure_airport_time = substr($spotter_item['departure_airport_time'], 0, -2).':'.substr($spotter_item['departure_airport_time'], -2); |
|
850 | 850 | if ($spotter_item['real_departure_airport_time'] > 2460) { |
851 | - $real_departure_airport_time = date('H:m',$spotter_item['real_departure_airport_time']); |
|
851 | + $real_departure_airport_time = date('H:m', $spotter_item['real_departure_airport_time']); |
|
852 | 852 | } else $real_departure_airport_time = $spotter_item['real_departure_airport_time']; |
853 | 853 | print '<br /><span class="airport_time">'.$departure_airport_time.' ('.$real_departure_airport_time.')</span>'."\n"; |
854 | 854 | } elseif (isset($spotter_item['real_departure_airport_time']) && $spotter_item['real_departure_airport_time'] != 'NULL') { |
855 | 855 | if ($spotter_item['real_departure_airport_time'] > 2460) { |
856 | - $real_departure_airport_time = date('H:m',$spotter_item['real_departure_airport_time']); |
|
856 | + $real_departure_airport_time = date('H:m', $spotter_item['real_departure_airport_time']); |
|
857 | 857 | } else $real_departure_airport_time = $spotter_item['real_departure_airport_time']; |
858 | 858 | print '<br /><span class="airport_time">'.$real_departure_airport_time.'</span>'."\n"; |
859 | 859 | } elseif (isset($spotter_item['departure_airport_time']) && $spotter_item['departure_airport_time'] != 'NULL') { |
860 | 860 | if ($spotter_item['departure_airport_time'] > 2460) { |
861 | - $departure_airport_time = date('H:m',$spotter_item['departure_airport_time']); |
|
861 | + $departure_airport_time = date('H:m', $spotter_item['departure_airport_time']); |
|
862 | 862 | } else { |
863 | - $departure_airport_time = substr($spotter_item['departure_airport_time'],0,-2).':'.substr($spotter_item['departure_airport_time'],-2); |
|
863 | + $departure_airport_time = substr($spotter_item['departure_airport_time'], 0, -2).':'.substr($spotter_item['departure_airport_time'], -2); |
|
864 | 864 | } |
865 | 865 | print '<br /><span class="airport_time">'.$departure_airport_time.'</span>'."\n"; |
866 | 866 | } |
@@ -875,7 +875,7 @@ discard block |
||
875 | 875 | $latitude = $spotter_item['latitude']; |
876 | 876 | $longitude = $spotter_item['longitude']; |
877 | 877 | } |
878 | - $distance = $Spotter->getAirportDistance($spotter_item['departure_airport'],$latitude,$longitude); |
|
878 | + $distance = $Spotter->getAirportDistance($spotter_item['departure_airport'], $latitude, $longitude); |
|
879 | 879 | } else $distance = ''; |
880 | 880 | if ($distance != '') { |
881 | 881 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
@@ -918,20 +918,20 @@ discard block |
||
918 | 918 | } |
919 | 919 | if (isset($spotter_item['arrival_airport_time']) && isset($spotter_item['real_arrival_airport_time'])) { |
920 | 920 | if ($spotter_item['arrival_airport_time'] > 2460) { |
921 | - $arrival_airport_time = date('H:m',$spotter_item['arrival_airport_time']); |
|
921 | + $arrival_airport_time = date('H:m', $spotter_item['arrival_airport_time']); |
|
922 | 922 | } else $arrival_airport_time = $spotter_item['arrival_airport_time']; |
923 | 923 | if ($spotter_item['real_arrival_airport_time'] > 2460) { |
924 | - $real_arrival_airport_time = date('H:m',$spotter_item['real_arrival_airport_time']); |
|
924 | + $real_arrival_airport_time = date('H:m', $spotter_item['real_arrival_airport_time']); |
|
925 | 925 | } else $real_arrival_airport_time = $spotter_item['real_arrival_airport_time']; |
926 | 926 | print '<br /><span class="airport_time">'.$spotter_item['arrival_airport_time'].' ('.$spotter_item['real_arrival_airport_time'].')</span>'."\n"; |
927 | 927 | } elseif (isset($spotter_item['real_arrival_airport_time'])) { |
928 | 928 | if ($spotter_item['real_arrival_airport_time'] > 2460) { |
929 | - $real_arrival_airport_time = date('H:m',$spotter_item['real_arrival_airport_time']); |
|
929 | + $real_arrival_airport_time = date('H:m', $spotter_item['real_arrival_airport_time']); |
|
930 | 930 | } else $real_arrival_airport_time = $spotter_item['real_arrival_airport_time']; |
931 | 931 | print '<br /><span class="airport_time">'.$real_arrival_airport_time.'</span>'."\n"; |
932 | 932 | } elseif (isset($spotter_item['arrival_airport_time']) && $spotter_item['arrival_airport_time'] != 'NULL') { |
933 | 933 | if ($spotter_item['arrival_airport_time'] > 2460) { |
934 | - $arrival_airport_time = date('H:m',$spotter_item['arrival_airport_time']); |
|
934 | + $arrival_airport_time = date('H:m', $spotter_item['arrival_airport_time']); |
|
935 | 935 | } else $arrival_airport_time = $spotter_item['arrival_airport_time']; |
936 | 936 | print '<br /><span class="airport_time">'.$arrival_airport_time.'</span>'."\n"; |
937 | 937 | } |
@@ -944,7 +944,7 @@ discard block |
||
944 | 944 | $latitude = $spotter_item['latitude']; |
945 | 945 | $longitude = $spotter_item['longitude']; |
946 | 946 | } |
947 | - $distance = $Spotter->getAirportDistance($spotter_item['arrival_airport'],$latitude,$longitude); |
|
947 | + $distance = $Spotter->getAirportDistance($spotter_item['arrival_airport'], $latitude, $longitude); |
|
948 | 948 | } else $distance = ''; |
949 | 949 | if ($distance != '') { |
950 | 950 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
@@ -987,19 +987,19 @@ discard block |
||
987 | 987 | print '<span class="mobile">-</span>'."\n"; |
988 | 988 | } else { |
989 | 989 | if ((!isset($_COOKIE['unitdistance']) && ((isset($globalUnitDistance) && $globalUnitDistance == 'km') || !isset($globalUnitDistance))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) { |
990 | - print '<span class="nomobile">'.round($spotter_item['distance'],2).' km</span>'."\n"; |
|
991 | - print '<span class="mobile">'.round($spotter_item['distance'],2).' km</span><br />'."\n"; |
|
990 | + print '<span class="nomobile">'.round($spotter_item['distance'], 2).' km</span>'."\n"; |
|
991 | + print '<span class="mobile">'.round($spotter_item['distance'], 2).' km</span><br />'."\n"; |
|
992 | 992 | } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
993 | - print '<span class="nomobile">'.round($spotter_item['distance']*0.621371,2).' mi</span>'."\n"; |
|
994 | - print '<span class="mobile">'.round($spotter_item['distance']*0.621371,2).' mi</span><br />'."\n"; |
|
993 | + print '<span class="nomobile">'.round($spotter_item['distance']*0.621371, 2).' mi</span>'."\n"; |
|
994 | + print '<span class="mobile">'.round($spotter_item['distance']*0.621371, 2).' mi</span><br />'."\n"; |
|
995 | 995 | } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
996 | - print '<span class="nomobile">'.round($spotter_item['distance']*0.539957,2).' nm</span>'."\n"; |
|
997 | - print '<span class="mobile">'.round($spotter_item['distance']*0.539957,2).' nm</span><br />'."\n"; |
|
996 | + print '<span class="nomobile">'.round($spotter_item['distance']*0.539957, 2).' nm</span>'."\n"; |
|
997 | + print '<span class="mobile">'.round($spotter_item['distance']*0.539957, 2).' nm</span><br />'."\n"; |
|
998 | 998 | } |
999 | 999 | } |
1000 | 1000 | print '</td>'."\n"; |
1001 | 1001 | } |
1002 | - if(strtolower($current_page) != "upcoming"){ |
|
1002 | + if (strtolower($current_page) != "upcoming") { |
|
1003 | 1003 | if ($type == 'aircraft') { |
1004 | 1004 | //if ((isset($globalVA) && $globalVA) || (isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) { |
1005 | 1005 | if ((isset($globalUsePilot) && $globalUsePilot) || !isset($globalUsePilot) && ((isset($globalVA) && $globalVA) || (isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS) || (isset($globalVAM) && $globalVAM))) { |
@@ -1042,7 +1042,7 @@ discard block |
||
1042 | 1042 | |
1043 | 1043 | if ($showRouteStop) { |
1044 | 1044 | // Route stop |
1045 | - if(strtolower($current_page) != "upcoming"){ |
|
1045 | + if (strtolower($current_page) != "upcoming") { |
|
1046 | 1046 | print '<td class="route_stop">'."\n"; |
1047 | 1047 | if (!isset($spotter_item['route_stop']) || $spotter_item['route_stop'] == '' || $spotter_item['route_stop'] == 'NULL') { |
1048 | 1048 | print '<span class="nomobile">-</span>'."\n"; |
@@ -1061,11 +1061,11 @@ discard block |
||
1061 | 1061 | } |
1062 | 1062 | if ($showDuration) { |
1063 | 1063 | // Duration |
1064 | - if(strtolower($current_page) != "upcoming"){ |
|
1064 | + if (strtolower($current_page) != "upcoming") { |
|
1065 | 1065 | print '<td class="duration">'."\n"; |
1066 | 1066 | if (isset($spotter_item['duration'])) { |
1067 | - print '<span class="nomobile">'.gmdate('H:i:s',$spotter_item['duration']).'</span>'."\n"; |
|
1068 | - print '<span class="mobile">'.gmdate('H:i:s',$spotter_item['duration']).'</span>'."\n"; |
|
1067 | + print '<span class="nomobile">'.gmdate('H:i:s', $spotter_item['duration']).'</span>'."\n"; |
|
1068 | + print '<span class="mobile">'.gmdate('H:i:s', $spotter_item['duration']).'</span>'."\n"; |
|
1069 | 1069 | } else { |
1070 | 1070 | print '<span class="nomobile">-</span>'."\n"; |
1071 | 1071 | print '<span class="mobile">-</span>'."\n"; |
@@ -1078,7 +1078,7 @@ discard block |
||
1078 | 1078 | if (strtolower($current_page) == "acars-latest" || strtolower($current_page) == "acars-archive") { |
1079 | 1079 | if (isset($spotter_item['decode']) && $spotter_item['decode'] != '') { |
1080 | 1080 | print '<td class="message"><p>'."\n"; |
1081 | - print str_replace(array("\r\n", "\n", "\r"),'<br />',$spotter_item['message']); |
|
1081 | + print str_replace(array("\r\n", "\n", "\r"), '<br />', $spotter_item['message']); |
|
1082 | 1082 | print '</p><p class="decode">'; |
1083 | 1083 | $decode_array = json_decode($spotter_item['decode']); |
1084 | 1084 | foreach ($decode_array as $key => $value) { |
@@ -1088,7 +1088,7 @@ discard block |
||
1088 | 1088 | print '</td>'."\n"; |
1089 | 1089 | } else { |
1090 | 1090 | print '<td class="message">'."\n"; |
1091 | - print str_replace(array("\r\n", "\n", "\r"),'<br />',$spotter_item['message']); |
|
1091 | + print str_replace(array("\r\n", "\n", "\r"), '<br />', $spotter_item['message']); |
|
1092 | 1092 | print '</td>'."\n"; |
1093 | 1093 | } |
1094 | 1094 | } |
@@ -1113,7 +1113,7 @@ discard block |
||
1113 | 1113 | } |
1114 | 1114 | print '</td>'."\n"; |
1115 | 1115 | print '<td class="message">'."\n"; |
1116 | - print str_replace(array("\r\n", "\n", "\r"),'<br />',$spotter_item['message']); |
|
1116 | + print str_replace(array("\r\n", "\n", "\r"), '<br />', $spotter_item['message']); |
|
1117 | 1117 | print '</td>'."\n"; |
1118 | 1118 | } |
1119 | 1119 | if (strtolower($current_page) == "incident-latest" || strtolower($current_page) == "incident-detailed") { |
@@ -1139,7 +1139,7 @@ discard block |
||
1139 | 1139 | print '</td>'."\n"; |
1140 | 1140 | */ |
1141 | 1141 | print '<td class="message">'."\n"; |
1142 | - print str_replace(array("\r\n", "\n", "\r"),'<br />',$spotter_item['message']); |
|
1142 | + print str_replace(array("\r\n", "\n", "\r"), '<br />', $spotter_item['message']); |
|
1143 | 1143 | print '</td>'."\n"; |
1144 | 1144 | } |
1145 | 1145 |
@@ -7,7 +7,9 @@ discard block |
||
7 | 7 | $showRouteStop = $Common->multiKeyExists($spotter_array,'route_stop'); |
8 | 8 | $showDuration = $Common->multiKeyExists($spotter_array,'duration'); |
9 | 9 | |
10 | -if (!isset($type)) $type = 'aircraft'; |
|
10 | +if (!isset($type)) { |
|
11 | + $type = 'aircraft'; |
|
12 | +} |
|
11 | 13 | |
12 | 14 | if (!isset($_GET['sort'])) |
13 | 15 | { |
@@ -492,7 +494,9 @@ discard block |
||
492 | 494 | if (isset($globalTimezone)) |
493 | 495 | { |
494 | 496 | date_default_timezone_set($globalTimezone); |
495 | - } else date_default_timezone_set('UTC'); |
|
497 | + } else { |
|
498 | + date_default_timezone_set('UTC'); |
|
499 | + } |
|
496 | 500 | if ($showSpecial === true) |
497 | 501 | { |
498 | 502 | print '<tr class="special">'."\n"; |
@@ -507,7 +511,9 @@ discard block |
||
507 | 511 | print '<tr class="active">'; |
508 | 512 | } elseif (isset($spotter_item['spotted_registration'])) { |
509 | 513 | print '<tr class="info">'; |
510 | - } else print '<tr>'; |
|
514 | + } else { |
|
515 | + print '<tr>'; |
|
516 | + } |
|
511 | 517 | } |
512 | 518 | if (strtolower($current_page) == "acars-latest" || strtolower($current_page) == "acars-archive" || strtolower($current_page) == "currently" || strtolower($current_page) == "accident-latest" || strtolower($current_page) == "incident-latest" || strtolower($current_page) == "accident-detailed" || strtolower($current_page) == "incident-detailed") { |
513 | 519 | if ($type == 'aircraft') { |
@@ -515,8 +521,9 @@ discard block |
||
515 | 521 | { |
516 | 522 | print '<td class="aircraft_thumbnail">'."\n"; |
517 | 523 | if ($spotter_item['image_source'] == 'planespotters') { |
518 | - if ($spotter_item['image_source_website'] != '') $image_src = $spotter_item['image_source_website']; |
|
519 | - else { |
|
524 | + if ($spotter_item['image_source_website'] != '') { |
|
525 | + $image_src = $spotter_item['image_source_website']; |
|
526 | + } else { |
|
520 | 527 | $planespotter_url_array = explode("_", $spotter_item['image']); |
521 | 528 | $planespotter_id = str_replace(".jpg", "", $planespotter_url_array[1]); |
522 | 529 | $image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id; |
@@ -529,7 +536,9 @@ discard block |
||
529 | 536 | } else { |
530 | 537 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
531 | 538 | $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
532 | - } else $image_thumbnail = $spotter_item['image_thumbnail']; |
|
539 | + } else { |
|
540 | + $image_thumbnail = $spotter_item['image_thumbnail']; |
|
541 | + } |
|
533 | 542 | if (isset($spotter_item['airline_name'])) { |
534 | 543 | print '<img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" alt="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Airline:").' '.$spotter_item['airline_name'].'" data-html="true" width="100px" />'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
535 | 544 | } else { |
@@ -548,7 +557,9 @@ discard block |
||
548 | 557 | print '<td class="aircraft_thumbnail">'."\n"; |
549 | 558 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
550 | 559 | $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
551 | - } else $image_thumbnail = $spotter_item['image_thumbnail']; |
|
560 | + } else { |
|
561 | + $image_thumbnail = $spotter_item['image_thumbnail']; |
|
562 | + } |
|
552 | 563 | if (isset($spotter_item['airline_name'])) { |
553 | 564 | print '<img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['mmsi'].'" alt="'.$spotter_item['mmsi'].'" data-content="'._("MMSI:").' '.$spotter_item['mmsi'].'" data-html="true" width="100px" />'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
554 | 565 | } else { |
@@ -566,7 +577,9 @@ discard block |
||
566 | 577 | print '<td class="aircraft_thumbnail">'."\n"; |
567 | 578 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
568 | 579 | $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
569 | - } else $image_thumbnail = $spotter_item['image_thumbnail']; |
|
580 | + } else { |
|
581 | + $image_thumbnail = $spotter_item['image_thumbnail']; |
|
582 | + } |
|
570 | 583 | print '<img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['ident'].'" alt="'.$spotter_item['type'].'" data-content="'._("Type:").' '.$spotter_item['type'].'" data-html="true" width="100px" />'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
571 | 584 | print '</td>'."\n"; |
572 | 585 | } else { |
@@ -619,8 +632,9 @@ discard block |
||
619 | 632 | print '<td class="aircraft_thumbnail">'."\n"; |
620 | 633 | //print '<a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'"><img src="'.$spotter_item['image_thumbnail'].'" alt="Click to see more information about this flight" title="Click to see more information about this flight" width="100px" /></a>'; |
621 | 634 | if ($spotter_item['image_source'] == 'planespotters') { |
622 | - if ($spotter_item['image_source_website'] != '') $image_src = $spotter_item['image_source_website']; |
|
623 | - else { |
|
635 | + if ($spotter_item['image_source_website'] != '') { |
|
636 | + $image_src = $spotter_item['image_source_website']; |
|
637 | + } else { |
|
624 | 638 | $planespotter_url_array = explode("_", $spotter_array[0]['image']); |
625 | 639 | $planespotter_id = str_replace(".jpg", "", $planespotter_url_array[1]); |
626 | 640 | $image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id; |
@@ -637,7 +651,9 @@ discard block |
||
637 | 651 | } else { |
638 | 652 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
639 | 653 | $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
640 | - } else $image_thumbnail = $spotter_item['image_thumbnail']; |
|
654 | + } else { |
|
655 | + $image_thumbnail = $spotter_item['image_thumbnail']; |
|
656 | + } |
|
641 | 657 | if (!isset($spotter_item['airline_name']) && isset($spotter_item['aircraft_name'])) { |
642 | 658 | print '<a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'"><img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '._("Not available").'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
643 | 659 | } elseif (!isset($spotter_item['aircraft_name']) && isset($spotter_item['airline_name'])) { |
@@ -670,7 +686,9 @@ discard block |
||
670 | 686 | print '<td class="aircraft_thumbnail">'."\n"; |
671 | 687 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
672 | 688 | $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
673 | - } else $image_thumbnail = $spotter_item['image_thumbnail']; |
|
689 | + } else { |
|
690 | + $image_thumbnail = $spotter_item['image_thumbnail']; |
|
691 | + } |
|
674 | 692 | print '<img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['mmsi'].'" alt="'.$spotter_item['mmsi'].'" data-content="'._("MMSI:").' '.$spotter_item['mmsi'].'" data-html="true" width="100px" />'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
675 | 693 | print '</td>'."\n"; |
676 | 694 | } else { |
@@ -684,7 +702,9 @@ discard block |
||
684 | 702 | print '<td class="aircraft_thumbnail">'."\n"; |
685 | 703 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
686 | 704 | $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
687 | - } else $image_thumbnail = $spotter_item['image_thumbnail']; |
|
705 | + } else { |
|
706 | + $image_thumbnail = $spotter_item['image_thumbnail']; |
|
707 | + } |
|
688 | 708 | print '<img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['ident'].'" alt="'.$spotter_item['type'].'" data-content="'._("Type:").' '.$spotter_item['type'].'" data-html="true" width="100px" />'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
689 | 709 | print '</td>'."\n"; |
690 | 710 | } else { |
@@ -802,8 +822,11 @@ discard block |
||
802 | 822 | print '<span class="nomobile"><a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_type'].'</a></span>'."\n"; |
803 | 823 | } else { |
804 | 824 | $aircraft_names = explode('/',$spotter_item['aircraft_name']); |
805 | - if (count($aircraft_names) == 1) print '<span class="nomobile"><a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name'].'</a></span>'."\n"; |
|
806 | - else print '<span class="nomobile"><a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'" title="'.$spotter_item['aircraft_name'].'">'.$spotter_item['aircraft_manufacturer'].' '.$aircraft_names[0].'</a></span>'."\n"; |
|
825 | + if (count($aircraft_names) == 1) { |
|
826 | + print '<span class="nomobile"><a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name'].'</a></span>'."\n"; |
|
827 | + } else { |
|
828 | + print '<span class="nomobile"><a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'" title="'.$spotter_item['aircraft_name'].'">'.$spotter_item['aircraft_manufacturer'].' '.$aircraft_names[0].'</a></span>'."\n"; |
|
829 | + } |
|
807 | 830 | } |
808 | 831 | print '<span class="mobile"><a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_type'].'</a></span>'."\n"; |
809 | 832 | } elseif ($type == 'marine') { |
@@ -846,15 +869,21 @@ discard block |
||
846 | 869 | if (isset($spotter_item['departure_airport_time']) && isset($spotter_item['real_departure_airport_time'])) { |
847 | 870 | if ($spotter_item['departure_airport_time'] > 2460) { |
848 | 871 | $departure_airport_time = date('H:m',$spotter_item['departure_airport_time']); |
849 | - } else $departure_airport_time = substr($spotter_item['departure_airport_time'],0,-2).':'.substr($spotter_item['departure_airport_time'],-2); |
|
872 | + } else { |
|
873 | + $departure_airport_time = substr($spotter_item['departure_airport_time'],0,-2).':'.substr($spotter_item['departure_airport_time'],-2); |
|
874 | + } |
|
850 | 875 | if ($spotter_item['real_departure_airport_time'] > 2460) { |
851 | 876 | $real_departure_airport_time = date('H:m',$spotter_item['real_departure_airport_time']); |
852 | - } else $real_departure_airport_time = $spotter_item['real_departure_airport_time']; |
|
877 | + } else { |
|
878 | + $real_departure_airport_time = $spotter_item['real_departure_airport_time']; |
|
879 | + } |
|
853 | 880 | print '<br /><span class="airport_time">'.$departure_airport_time.' ('.$real_departure_airport_time.')</span>'."\n"; |
854 | 881 | } elseif (isset($spotter_item['real_departure_airport_time']) && $spotter_item['real_departure_airport_time'] != 'NULL') { |
855 | 882 | if ($spotter_item['real_departure_airport_time'] > 2460) { |
856 | 883 | $real_departure_airport_time = date('H:m',$spotter_item['real_departure_airport_time']); |
857 | - } else $real_departure_airport_time = $spotter_item['real_departure_airport_time']; |
|
884 | + } else { |
|
885 | + $real_departure_airport_time = $spotter_item['real_departure_airport_time']; |
|
886 | + } |
|
858 | 887 | print '<br /><span class="airport_time">'.$real_departure_airport_time.'</span>'."\n"; |
859 | 888 | } elseif (isset($spotter_item['departure_airport_time']) && $spotter_item['departure_airport_time'] != 'NULL') { |
860 | 889 | if ($spotter_item['departure_airport_time'] > 2460) { |
@@ -876,7 +905,9 @@ discard block |
||
876 | 905 | $longitude = $spotter_item['longitude']; |
877 | 906 | } |
878 | 907 | $distance = $Spotter->getAirportDistance($spotter_item['departure_airport'],$latitude,$longitude); |
879 | - } else $distance = ''; |
|
908 | + } else { |
|
909 | + $distance = ''; |
|
910 | + } |
|
880 | 911 | if ($distance != '') { |
881 | 912 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
882 | 913 | echo '<br/><i>'.round($distance*0.539957).' nm</i>'; |
@@ -903,7 +934,9 @@ discard block |
||
903 | 934 | } else { |
904 | 935 | if (isset($spotter_item['real_arrival_airport']) && $spotter_item['real_arrival_airport'] != $spotter_item['arrival_airport']) { |
905 | 936 | print '<span class="nomobile">Scheduled : <a href="'.$globalURL.'/airport/'.$spotter_item['arrival_airport'].'">'.$spotter_item['arrival_airport_city'].', '.$spotter_item['arrival_airport_country'].' ('.$spotter_item['arrival_airport'].')</a></span>'."\n"; |
906 | - if (!isset($Spotter)) $Spotter = new Spotter(); |
|
937 | + if (!isset($Spotter)) { |
|
938 | + $Spotter = new Spotter(); |
|
939 | + } |
|
907 | 940 | $arrival_airport_info = $Spotter->getAllAirportInfo($spotter_item['real_arrival_airport']); |
908 | 941 | print '<br /><span class="nomobile">'._("Real:").' <a href="'.$globalURL.'/airport/'.$spotter_item['real_arrival_airport'].'">'.$arrival_airport_info[0]['city'].','.$arrival_airport_info[0]['country'].' ('.$spotter_item['real_arrival_airport'].')</a></span>'."\n"; |
909 | 942 | print '<span class="mobile">'._("Scheduled:").' <a href="'.$globalURL.'/airport/'.$spotter_item['real_arrival_airport'].'">'.$spotter_item['real_arrival_airport'].'</a></span>'."\n"; |
@@ -919,20 +952,28 @@ discard block |
||
919 | 952 | if (isset($spotter_item['arrival_airport_time']) && isset($spotter_item['real_arrival_airport_time'])) { |
920 | 953 | if ($spotter_item['arrival_airport_time'] > 2460) { |
921 | 954 | $arrival_airport_time = date('H:m',$spotter_item['arrival_airport_time']); |
922 | - } else $arrival_airport_time = $spotter_item['arrival_airport_time']; |
|
955 | + } else { |
|
956 | + $arrival_airport_time = $spotter_item['arrival_airport_time']; |
|
957 | + } |
|
923 | 958 | if ($spotter_item['real_arrival_airport_time'] > 2460) { |
924 | 959 | $real_arrival_airport_time = date('H:m',$spotter_item['real_arrival_airport_time']); |
925 | - } else $real_arrival_airport_time = $spotter_item['real_arrival_airport_time']; |
|
960 | + } else { |
|
961 | + $real_arrival_airport_time = $spotter_item['real_arrival_airport_time']; |
|
962 | + } |
|
926 | 963 | print '<br /><span class="airport_time">'.$spotter_item['arrival_airport_time'].' ('.$spotter_item['real_arrival_airport_time'].')</span>'."\n"; |
927 | 964 | } elseif (isset($spotter_item['real_arrival_airport_time'])) { |
928 | 965 | if ($spotter_item['real_arrival_airport_time'] > 2460) { |
929 | 966 | $real_arrival_airport_time = date('H:m',$spotter_item['real_arrival_airport_time']); |
930 | - } else $real_arrival_airport_time = $spotter_item['real_arrival_airport_time']; |
|
967 | + } else { |
|
968 | + $real_arrival_airport_time = $spotter_item['real_arrival_airport_time']; |
|
969 | + } |
|
931 | 970 | print '<br /><span class="airport_time">'.$real_arrival_airport_time.'</span>'."\n"; |
932 | 971 | } elseif (isset($spotter_item['arrival_airport_time']) && $spotter_item['arrival_airport_time'] != 'NULL') { |
933 | 972 | if ($spotter_item['arrival_airport_time'] > 2460) { |
934 | 973 | $arrival_airport_time = date('H:m',$spotter_item['arrival_airport_time']); |
935 | - } else $arrival_airport_time = $spotter_item['arrival_airport_time']; |
|
974 | + } else { |
|
975 | + $arrival_airport_time = $spotter_item['arrival_airport_time']; |
|
976 | + } |
|
936 | 977 | print '<br /><span class="airport_time">'.$arrival_airport_time.'</span>'."\n"; |
937 | 978 | } |
938 | 979 | if (!isset($spotter_item['real_arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { |
@@ -945,7 +986,9 @@ discard block |
||
945 | 986 | $longitude = $spotter_item['longitude']; |
946 | 987 | } |
947 | 988 | $distance = $Spotter->getAirportDistance($spotter_item['arrival_airport'],$latitude,$longitude); |
948 | - } else $distance = ''; |
|
989 | + } else { |
|
990 | + $distance = ''; |
|
991 | + } |
|
949 | 992 | if ($distance != '') { |
950 | 993 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
951 | 994 | echo '<br/><i>'.round($distance*0.539957).' nm</i>'; |
@@ -52,6 +52,10 @@ discard block |
||
52 | 52 | $this->openedFiles = []; |
53 | 53 | } |
54 | 54 | |
55 | + /** |
|
56 | + * @param double $row |
|
57 | + * @param double $column |
|
58 | + */ |
|
55 | 59 | private function getElevationAtPosition($fileName, $row, $column) { |
56 | 60 | if (!array_key_exists($fileName, $this->openedFiles)) { |
57 | 61 | if (!file_exists($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName)) { |
@@ -85,7 +89,7 @@ discard block |
||
85 | 89 | * @param float $lon |
86 | 90 | * @param null $fName |
87 | 91 | * |
88 | - * @return mixed |
|
92 | + * @return double |
|
89 | 93 | * @throws \Exception |
90 | 94 | */ |
91 | 95 | public function getElevation($lat, $lon, &$fName = null) { |
@@ -142,6 +146,9 @@ discard block |
||
142 | 146 | return $zN; |
143 | 147 | } |
144 | 148 | |
149 | + /** |
|
150 | + * @param integer $numPrefix |
|
151 | + */ |
|
145 | 152 | private function getDeg($deg, $numPrefix) { |
146 | 153 | $deg = abs($deg); |
147 | 154 | $d = floor($deg); // round degrees |
@@ -156,6 +163,9 @@ discard block |
||
156 | 163 | return $d; |
157 | 164 | } |
158 | 165 | |
166 | + /** |
|
167 | + * @param double $deg |
|
168 | + */ |
|
159 | 169 | private function getSec($deg) { |
160 | 170 | $deg = abs($deg); |
161 | 171 | $sec = round($deg * 3600, 4); |
@@ -28,7 +28,9 @@ discard block |
||
28 | 28 | private $openedFiles = []; |
29 | 29 | |
30 | 30 | public function __construct($htgFilesDestination = '', $resolution = 3) { |
31 | - if ($htgFilesDestination == '') $htgFilesDestination = dirname(__FILE__).'/../data/'; |
|
31 | + if ($htgFilesDestination == '') { |
|
32 | + $htgFilesDestination = dirname(__FILE__).'/../data/'; |
|
33 | + } |
|
32 | 34 | $this->htgFilesDestination = $htgFilesDestination; |
33 | 35 | $this->resolution = $resolution; |
34 | 36 | switch ($resolution) { |
@@ -171,16 +173,26 @@ discard block |
||
171 | 173 | $fileName = "N{$N}E{$E}.hgt"; |
172 | 174 | if (!file_exists($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName)) { |
173 | 175 | $Common = new Common(); |
174 | - if ($debug) echo 'Downloading '.$fileName.'.gz ...'; |
|
176 | + if ($debug) { |
|
177 | + echo 'Downloading '.$fileName.'.gz ...'; |
|
178 | + } |
|
175 | 179 | $Common->download('https://s3.amazonaws.com/elevation-tiles-prod/skadi/N'.$N.'/'.$fileName.'.gz',$this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz'); |
176 | 180 | if (!file_exists($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz')) { |
177 | - if ($debug) echo "File '{$fileName}.gz' not exists."; |
|
181 | + if ($debug) { |
|
182 | + echo "File '{$fileName}.gz' not exists."; |
|
183 | + } |
|
178 | 184 | return false; |
179 | 185 | } |
180 | - if ($debug) echo 'Done'."\n"; |
|
181 | - if ($debug) echo 'Decompress '.$fileName.' ....'; |
|
186 | + if ($debug) { |
|
187 | + echo 'Done'."\n"; |
|
188 | + } |
|
189 | + if ($debug) { |
|
190 | + echo 'Decompress '.$fileName.' ....'; |
|
191 | + } |
|
182 | 192 | $Common->gunzip($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz',$this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName); |
183 | - if ($debug) echo 'Done'."\n"; |
|
193 | + if ($debug) { |
|
194 | + echo 'Done'."\n"; |
|
195 | + } |
|
184 | 196 | unlink($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz'); |
185 | 197 | } |
186 | 198 | return true; |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | default: |
42 | 42 | throw new \Exception("bad resolution can be only one of 1,3"); |
43 | 43 | } |
44 | - register_shutdown_function(function () { |
|
44 | + register_shutdown_function(function() { |
|
45 | 45 | $this->closeAllFiles(); |
46 | 46 | }); |
47 | 47 | } |
@@ -55,10 +55,10 @@ discard block |
||
55 | 55 | |
56 | 56 | private function getElevationAtPosition($fileName, $row, $column) { |
57 | 57 | if (!array_key_exists($fileName, $this->openedFiles)) { |
58 | - if (!file_exists($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName)) { |
|
58 | + if (!file_exists($this->htgFilesDestination.DIRECTORY_SEPARATOR.$fileName)) { |
|
59 | 59 | throw new \Exception("File '{$fileName}' not exists."); |
60 | 60 | } |
61 | - $file = fopen($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName, "r"); |
|
61 | + $file = fopen($this->htgFilesDestination.DIRECTORY_SEPARATOR.$fileName, "r"); |
|
62 | 62 | if ($file === false) { |
63 | 63 | throw new \Exception("Cant open file '{$fileName}' for reading."); |
64 | 64 | } |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | throw new \Exception("Not implemented yet"); |
73 | 73 | } |
74 | 74 | $aRow = $this->measPerDeg - $row; |
75 | - $position = ($this->measPerDeg * ($aRow - 1)) + $column; |
|
75 | + $position = ($this->measPerDeg*($aRow - 1)) + $column; |
|
76 | 76 | $position *= 2; |
77 | 77 | fseek($file, $position); |
78 | 78 | $short = fread($file, 2); |
@@ -100,8 +100,8 @@ discard block |
||
100 | 100 | $latSec = $this->getSec($lat); |
101 | 101 | $lonSec = $this->getSec($lon); |
102 | 102 | |
103 | - $Xn = round($latSec / $this->resolution, 3); |
|
104 | - $Yn = round($lonSec / $this->resolution, 3); |
|
103 | + $Xn = round($latSec/$this->resolution, 3); |
|
104 | + $Yn = round($lonSec/$this->resolution, 3); |
|
105 | 105 | |
106 | 106 | $a1 = round($Xn); |
107 | 107 | $a2 = round($Yn); |
@@ -133,55 +133,55 @@ discard block |
||
133 | 133 | $b3 = $this->getElevationAtPosition($fName, $b1, $b2); |
134 | 134 | $c3 = $this->getElevationAtPosition($fName, $c1, $c2); |
135 | 135 | |
136 | - $n1 = ($c2 - $a2) * ($b3 - $a3) - ($c3 - $a3) * ($b2 - $a2); |
|
137 | - $n2 = ($c3 - $a3) * ($b1 - $a1) - ($c1 - $a1) * ($b3 - $a3); |
|
138 | - $n3 = ($c1 - $a1) * ($b2 - $a2) - ($c2 - $a2) * ($b1 - $a1); |
|
136 | + $n1 = ($c2 - $a2)*($b3 - $a3) - ($c3 - $a3)*($b2 - $a2); |
|
137 | + $n2 = ($c3 - $a3)*($b1 - $a1) - ($c1 - $a1)*($b3 - $a3); |
|
138 | + $n3 = ($c1 - $a1)*($b2 - $a2) - ($c2 - $a2)*($b1 - $a1); |
|
139 | 139 | |
140 | - $d = -$n1 * $a1 - $n2 * $a2 - $n3 * $a3; |
|
141 | - $zN = (-$n1 * $Xn - $n2 * $Yn - $d) / $n3; |
|
140 | + $d = -$n1*$a1 - $n2*$a2 - $n3*$a3; |
|
141 | + $zN = (-$n1*$Xn - $n2*$Yn - $d)/$n3; |
|
142 | 142 | |
143 | 143 | return $zN; |
144 | 144 | } |
145 | 145 | |
146 | 146 | private function getDeg($deg, $numPrefix) { |
147 | 147 | $deg = abs($deg); |
148 | - $d = floor($deg); // round degrees |
|
148 | + $d = floor($deg); // round degrees |
|
149 | 149 | if ($numPrefix >= 3) { |
150 | 150 | if ($d < 100) { |
151 | - $d = '0' . $d; |
|
151 | + $d = '0'.$d; |
|
152 | 152 | } |
153 | 153 | } // pad with leading zeros |
154 | 154 | if ($d < 10) { |
155 | - $d = '0' . $d; |
|
155 | + $d = '0'.$d; |
|
156 | 156 | } |
157 | 157 | return $d; |
158 | 158 | } |
159 | 159 | |
160 | 160 | private function getSec($deg) { |
161 | 161 | $deg = abs($deg); |
162 | - $sec = round($deg * 3600, 4); |
|
163 | - $m = fmod(floor($sec / 60), 60); |
|
162 | + $sec = round($deg*3600, 4); |
|
163 | + $m = fmod(floor($sec/60), 60); |
|
164 | 164 | $s = round(fmod($sec, 60), 4); |
165 | - return ($m * 60) + $s; |
|
165 | + return ($m*60) + $s; |
|
166 | 166 | } |
167 | 167 | |
168 | - public function download($lat,$lon, $debug = false) { |
|
168 | + public function download($lat, $lon, $debug = false) { |
|
169 | 169 | $N = $this->getDeg($lat, 2); |
170 | 170 | $E = $this->getDeg($lon, 3); |
171 | - $fileName = "N{$N}E{$E}.hgt"; |
|
172 | - if (!file_exists($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName)) { |
|
171 | + $fileName = "N{$N}E{$E}.hgt"; |
|
172 | + if (!file_exists($this->htgFilesDestination.DIRECTORY_SEPARATOR.$fileName)) { |
|
173 | 173 | $Common = new Common(); |
174 | 174 | if ($debug) echo 'Downloading '.$fileName.'.gz ...'; |
175 | - $Common->download('https://s3.amazonaws.com/elevation-tiles-prod/skadi/N'.$N.'/'.$fileName.'.gz',$this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz'); |
|
176 | - if (!file_exists($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz')) { |
|
175 | + $Common->download('https://s3.amazonaws.com/elevation-tiles-prod/skadi/N'.$N.'/'.$fileName.'.gz', $this->htgFilesDestination.DIRECTORY_SEPARATOR.$fileName.'.gz'); |
|
176 | + if (!file_exists($this->htgFilesDestination.DIRECTORY_SEPARATOR.$fileName.'.gz')) { |
|
177 | 177 | if ($debug) echo "File '{$fileName}.gz' not exists."; |
178 | 178 | return false; |
179 | 179 | } |
180 | 180 | if ($debug) echo 'Done'."\n"; |
181 | 181 | if ($debug) echo 'Decompress '.$fileName.' ....'; |
182 | - $Common->gunzip($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz',$this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName); |
|
182 | + $Common->gunzip($this->htgFilesDestination.DIRECTORY_SEPARATOR.$fileName.'.gz', $this->htgFilesDestination.DIRECTORY_SEPARATOR.$fileName); |
|
183 | 183 | if ($debug) echo 'Done'."\n"; |
184 | - unlink($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz'); |
|
184 | + unlink($this->htgFilesDestination.DIRECTORY_SEPARATOR.$fileName.'.gz'); |
|
185 | 185 | } |
186 | 186 | return true; |
187 | 187 | } |
@@ -194,22 +194,22 @@ discard block |
||
194 | 194 | try { |
195 | 195 | $sth = $db->prepare($query); |
196 | 196 | $sth->execute($query_values); |
197 | - } catch(PDOException $e) { |
|
197 | + } catch (PDOException $e) { |
|
198 | 198 | return "error : ".$e->getMessage(); |
199 | 199 | } |
200 | 200 | while ($data = $sth->fetch(PDO::FETCH_ASSOC)) { |
201 | - $this->download($data['latitude'],$data['longitude'],true); |
|
201 | + $this->download($data['latitude'], $data['longitude'], true); |
|
202 | 202 | } |
203 | 203 | $query = 'SELECT latitude, longitude FROM tracker_output WHERE latitude <> 0 AND longitude <> 0 ORDER BY date DESC LIMIT 10'; |
204 | 204 | $query_values = array(); |
205 | 205 | try { |
206 | 206 | $sth = $db->prepare($query); |
207 | 207 | $sth->execute($query_values); |
208 | - } catch(PDOException $e) { |
|
208 | + } catch (PDOException $e) { |
|
209 | 209 | return "error : ".$e->getMessage(); |
210 | 210 | } |
211 | 211 | while ($data = $sth->fetch(PDO::FETCH_ASSOC)) { |
212 | - $this->download($data['latitude'],$data['longitude'],true); |
|
212 | + $this->download($data['latitude'], $data['longitude'], true); |
|
213 | 213 | } |
214 | 214 | } |
215 | 215 | } |
@@ -91,6 +91,10 @@ |
||
91 | 91 | $this->rlatres = (($this->height - 1) / 180.0); |
92 | 92 | } |
93 | 93 | |
94 | + /** |
|
95 | + * @param integer $ix |
|
96 | + * @param integer $iy |
|
97 | + */ |
|
94 | 98 | private function _rawval($ix,$iy) { |
95 | 99 | if (($iy < 0)) { |
96 | 100 | $iy = -$iy; |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | * Translated to PHP of GeographicLib/src/Geoid.cpp |
12 | 12 | * by Ycarus <[email protected]> in 2017 |
13 | 13 | */ |
14 | -class GeoidHeight { |
|
14 | +class GeoidHeight { |
|
15 | 15 | private $c0 = 240; |
16 | 16 | private $c3 = [[9, -18, -88, 0, 96, 90, 0, 0, -60, -20], [-9, 18, 8, 0, -96, 30, 0, 0, 60, -20], [9, -88, -18, 90, 96, 0, -20, -60, 0, 0], [186, -42, -42, -150, -96, -150, 60, 60, 60, 60], [54, 162, -78, 30, -24, -90, -60, 60, -60, 60], [-9, -32, 18, 30, 24, 0, 20, -60, 0, 0], [-9, 8, 18, 30, -96, 0, -20, 60, 0, 0], [54, -78, 162, -90, -24, 30, 60, -60, 60, -60], [-54, 78, 78, 90, 144, 90, -60, -60, -60, -60], [9, -8, -18, -30, -24, 0, 20, 60, 0, 0], [-9, 18, -32, 0, 24, 30, 0, 0, -60, 20], [9, -18, -8, 0, -24, -30, 0, 0, 60, 20]]; |
17 | 17 | private $c0n = 372; |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | private $v10 = null; |
35 | 35 | private $v11 = null; |
36 | 36 | |
37 | - public function __construct($name='') { |
|
37 | + public function __construct($name = '') { |
|
38 | 38 | global $globalGeoidSource; |
39 | 39 | //if ($name == '') $name = dirname(__FILE__).'/../install/tmp/egm2008-1.pgm'; |
40 | 40 | if ($name == '') { |
@@ -45,35 +45,35 @@ discard block |
||
45 | 45 | if (file_exists($name) === FALSE) { |
46 | 46 | throw new Exception($name." doesn't exist"); |
47 | 47 | } |
48 | - $f = @fopen($name,"r"); |
|
48 | + $f = @fopen($name, "r"); |
|
49 | 49 | if ($f === FALSE) { |
50 | 50 | throw new Exception("Can't open ".$name); |
51 | 51 | } |
52 | - $line = fgets($f,4096); |
|
52 | + $line = fgets($f, 4096); |
|
53 | 53 | if (trim($line) != 'P5') { |
54 | 54 | throw new Exception('No PGM header'); |
55 | 55 | } |
56 | 56 | $headerlen = strlen($line); |
57 | 57 | while (true) { |
58 | - $line = fgets($f,4096); |
|
58 | + $line = fgets($f, 4096); |
|
59 | 59 | if ((strlen($line) == 0)) { |
60 | 60 | throw new Exception('EOF before end of file header'); |
61 | 61 | } |
62 | 62 | $headerlen += strlen($line); |
63 | - if (strpos($line,'# Offset ') !== FALSE) { |
|
63 | + if (strpos($line, '# Offset ') !== FALSE) { |
|
64 | 64 | $this->offset = substr($line, 9); |
65 | - } else if (strpos($line,'# Scale ') !== FALSE) { |
|
65 | + } else if (strpos($line, '# Scale ') !== FALSE) { |
|
66 | 66 | $this->scale = substr($line, 8); |
67 | - } else if ((strpos($line,'#') === FALSE)) { |
|
68 | - list($this->width, $this->height) = preg_split('/\s+/',$line); |
|
67 | + } else if ((strpos($line, '#') === FALSE)) { |
|
68 | + list($this->width, $this->height) = preg_split('/\s+/', $line); |
|
69 | 69 | break; |
70 | 70 | } |
71 | 71 | } |
72 | - $line = fgets($f,4096); |
|
72 | + $line = fgets($f, 4096); |
|
73 | 73 | $headerlen += strlen($line); |
74 | - $levels = (int)$line; |
|
75 | - $this->width = (int)$this->width; |
|
76 | - $this->height = (int)$this->height; |
|
74 | + $levels = (int) $line; |
|
75 | + $this->width = (int) $this->width; |
|
76 | + $this->height = (int) $this->height; |
|
77 | 77 | if (($levels != 65535)) { |
78 | 78 | throw new Exception('PGM file must have 65535 gray levels ('.$levels.')'); |
79 | 79 | } |
@@ -88,42 +88,42 @@ discard block |
||
88 | 88 | } |
89 | 89 | |
90 | 90 | $fullsize = filesize($name); |
91 | - if ((($fullsize - $headerlen) != (($this->width * $this->height) * 2))) { |
|
91 | + if ((($fullsize - $headerlen) != (($this->width*$this->height)*2))) { |
|
92 | 92 | throw new Exception('File has the wrong length'); |
93 | 93 | } |
94 | 94 | |
95 | 95 | $this->headerlen = $headerlen; |
96 | - $this->raw= $f; |
|
97 | - $this->rlonres = ($this->width / 360.0); |
|
98 | - $this->rlatres = (($this->height - 1) / 180.0); |
|
96 | + $this->raw = $f; |
|
97 | + $this->rlonres = ($this->width/360.0); |
|
98 | + $this->rlatres = (($this->height - 1)/180.0); |
|
99 | 99 | } |
100 | 100 | |
101 | - private function _rawval($ix,$iy) { |
|
101 | + private function _rawval($ix, $iy) { |
|
102 | 102 | if (($iy < 0)) { |
103 | 103 | $iy = -$iy; |
104 | - $ix += ($this->width / 2); |
|
104 | + $ix += ($this->width/2); |
|
105 | 105 | } else if (($iy >= $this->height)) { |
106 | - $iy = ((2 * ($this->height - 1)) - $iy); |
|
107 | - $ix += ($this->width / 2); |
|
106 | + $iy = ((2*($this->height - 1)) - $iy); |
|
107 | + $ix += ($this->width/2); |
|
108 | 108 | } |
109 | 109 | if (($ix < 0)) { |
110 | 110 | $ix += $this->width; |
111 | 111 | } else if (($ix >= $this->width)) { |
112 | 112 | $ix -= $this->width; |
113 | 113 | } |
114 | - $k = ((($iy * $this->width) + $ix) * 2) + $this->headerlen; |
|
115 | - fseek($this->raw,$k); |
|
116 | - return unpack('n',fread($this->raw,2))[1]; |
|
114 | + $k = ((($iy*$this->width) + $ix)*2) + $this->headerlen; |
|
115 | + fseek($this->raw, $k); |
|
116 | + return unpack('n', fread($this->raw, 2))[1]; |
|
117 | 117 | } |
118 | 118 | |
119 | - public function get($lat,$lon,$cubic=true) { |
|
119 | + public function get($lat, $lon, $cubic = true) { |
|
120 | 120 | if (($lon < 0)) { |
121 | 121 | $lon += 360; |
122 | 122 | } |
123 | - $fy = ((90 - $lat) * $this->rlatres); |
|
124 | - $fx = ($lon * $this->rlonres); |
|
125 | - $iy = (int)$fy; |
|
126 | - $ix = (int)$fx; |
|
123 | + $fy = ((90 - $lat)*$this->rlatres); |
|
124 | + $fx = ($lon*$this->rlonres); |
|
125 | + $iy = (int) $fy; |
|
126 | + $ix = (int) $fx; |
|
127 | 127 | $fx -= $ix; |
128 | 128 | $fy -= $iy; |
129 | 129 | $t = array(); |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | $c3x = $this->c3; |
151 | 151 | $c0x = $this->c0; |
152 | 152 | } |
153 | - for ($i = 0; $i < 10;++$i) { |
|
153 | + for ($i = 0; $i < 10; ++$i) { |
|
154 | 154 | $t[$i] = 0; |
155 | 155 | for ($j = 0; $j < 12; ++$j) { |
156 | 156 | $t[$i] += $v[$j]*$c3x[$j][$i]; |
@@ -161,13 +161,13 @@ discard block |
||
161 | 161 | $this->t = $t; |
162 | 162 | } else $t = $this->t; |
163 | 163 | if (!($cubic)) { |
164 | - $a = (((1 - $fx) * $this->v00) + ($fx * $this->v01)); |
|
165 | - $b = (((1 - $fx) * $this->v10) + ($fx * $this->v11)); |
|
166 | - $h = (((1 - $fy) * $a) + ($fy * $b)); |
|
164 | + $a = (((1 - $fx)*$this->v00) + ($fx*$this->v01)); |
|
165 | + $b = (((1 - $fx)*$this->v10) + ($fx*$this->v11)); |
|
166 | + $h = (((1 - $fy)*$a) + ($fy*$b)); |
|
167 | 167 | } else { |
168 | - $h = (($t[0] + ($fx * ($t[1] + ($fx * ($t[3] + ($fx * $t[6])))))) + ($fy * (($t[2] + ($fx * ($t[4] + ($fx * $t[7])))) + ($fy * (($t[5] + ($fx * $t[8])) + ($fy * $t[9])))))); |
|
168 | + $h = (($t[0] + ($fx*($t[1] + ($fx*($t[3] + ($fx*$t[6])))))) + ($fy*(($t[2] + ($fx*($t[4] + ($fx*$t[7])))) + ($fy*(($t[5] + ($fx*$t[8])) + ($fy*$t[9])))))); |
|
169 | 169 | } |
170 | - return ((float)$this->offset + ((float)$this->scale * (float)$h)); |
|
170 | + return ((float) $this->offset + ((float) $this->scale*(float) $h)); |
|
171 | 171 | } |
172 | 172 | } |
173 | 173 | /* |
@@ -38,8 +38,11 @@ discard block |
||
38 | 38 | global $globalGeoidSource; |
39 | 39 | //if ($name == '') $name = dirname(__FILE__).'/../install/tmp/egm2008-1.pgm'; |
40 | 40 | if ($name == '') { |
41 | - if (isset($globalGeoidSource) && $globalGeoidSource != '') $name = dirname(__FILE__).'/../data/'.$globalGeoidSource.'.pgm'; |
|
42 | - else $name = dirname(__FILE__).'/../data/egm96-15.pgm'; |
|
41 | + if (isset($globalGeoidSource) && $globalGeoidSource != '') { |
|
42 | + $name = dirname(__FILE__).'/../data/'.$globalGeoidSource.'.pgm'; |
|
43 | + } else { |
|
44 | + $name = dirname(__FILE__).'/../data/egm96-15.pgm'; |
|
45 | + } |
|
43 | 46 | } |
44 | 47 | |
45 | 48 | if (file_exists($name) === FALSE) { |
@@ -159,7 +162,9 @@ discard block |
||
159 | 162 | } |
160 | 163 | } |
161 | 164 | $this->t = $t; |
162 | - } else $t = $this->t; |
|
165 | + } else { |
|
166 | + $t = $this->t; |
|
167 | + } |
|
163 | 168 | if (!($cubic)) { |
164 | 169 | $a = (((1 - $fx) * $this->v00) + ($fx * $this->v01)); |
165 | 170 | $b = (((1 - $fx) * $this->v10) + ($fx * $this->v11)); |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | $globalLongitudeMin = '1.0'; //the minimum longitude (east) |
43 | 43 | |
44 | 44 | $globalCenterLatitude = '46.38'; //the latitude center of your coverage area |
45 | -$globalCenterLongitude = '5.29';//the longitude center of your coverage area |
|
45 | +$globalCenterLongitude = '5.29'; //the longitude center of your coverage area |
|
46 | 46 | |
47 | 47 | $globalLiveZoom = '9'; //default zoom on Live Map |
48 | 48 | $globalAirportZoom = '7'; //default zoom to begin to display airports icons |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | $globalACARS = FALSE; |
152 | 152 | $globalACARSHost = '0.0.0.0'; // Local IP to listen |
153 | 153 | $globalACARSPort = '9999'; |
154 | -$globalACARSArchive = array('10','80','81','82','3F'); // labels of messages to archive |
|
154 | +$globalACARSArchive = array('10', '80', '81', '82', '3F'); // labels of messages to archive |
|
155 | 155 | $globalACARSArchiveKeepMonths = '0'; |
156 | 156 | |
157 | 157 | //APRS configuration (for glidernet) |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | //Check by aircraft ICAO if image is not found by registration |
249 | 249 | $globalAircraftImageCheckICAO = TRUE; |
250 | 250 | //Sources for Aircraft image |
251 | -$globalAircraftImageSources = array('ivaomtl','wikimedia','airportdata','deviantart','flickr','bing','jetphotos','planepictures','planespotters','customsources'); |
|
251 | +$globalAircraftImageSources = array('ivaomtl', 'wikimedia', 'airportdata', 'deviantart', 'flickr', 'bing', 'jetphotos', 'planepictures', 'planespotters', 'customsources'); |
|
252 | 252 | // Custom source configuration {registration} will be replaced by aircraft registration (exif get copyright from exif data for each pic) |
253 | 253 | // example of config : $globalAircraftImageCustomSources = array('thumbnail' => 'http://pics.myurl.com/thumbnail/{registration}.jpg','original' => 'http://myurl/original/{registration}.jpg','source_website' => 'https://www.myurl.com', 'source' => 'customsite', 'copyright' => 'myself','exif' => true); |
254 | 254 | // ************************ |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | //Retrieve Image from externals sources |
258 | 258 | $globalMarineImageFetch = TRUE; |
259 | 259 | //Sources for Marine image |
260 | -$globalMarineImageSources = array('wikimedia','flickr','deviantart','bing','customsources'); |
|
260 | +$globalMarineImageSources = array('wikimedia', 'flickr', 'deviantart', 'bing', 'customsources'); |
|
261 | 261 | // Custom source configuration {mmsi} will be replaced by vessel mmsi, {name} by it's name (exif get copyright from exif data for each pic) |
262 | 262 | // example of config : $globalMarineImageCustomSources = array('thumbnail' => 'http://pics.myurl.com/thumbnail/{name}.jpg','original' => 'http://myurl/original/{name}.jpg','source_website' => 'https://www.myurl.com', 'source' => 'customsite', 'copyright' => 'myself','exif' => true); |
263 | 263 | // ************************ |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | //Retrieve schedules from externals sources (set to FALSE for IVAO or if $globalFork = FALSE) |
266 | 266 | $globalSchedulesFetch = TRUE; |
267 | 267 | //Sources for airline schedule if not official airline site |
268 | -$globalSchedulesSources = array('flightmapper','costtotravel','flightradar24','flightaware'); |
|
268 | +$globalSchedulesSources = array('flightmapper', 'costtotravel', 'flightradar24', 'flightaware'); |
|
269 | 269 | |
270 | 270 | //Retrieve translation from external sources (set to FALSE for IVAO) |
271 | 271 | $globalTranslationFetch = TRUE; |
@@ -27,15 +27,21 @@ discard block |
||
27 | 27 | } |
28 | 28 | } |
29 | 29 | } |
30 | -if ($authorize === false) die; |
|
30 | +if ($authorize === false) { |
|
31 | + die; |
|
32 | +} |
|
31 | 33 | |
32 | -if (isset($globalTracker) && $globalTracker) require_once(dirname(__FILE__).'/../require/class.TrackerImport.php'); |
|
34 | +if (isset($globalTracker) && $globalTracker) { |
|
35 | + require_once(dirname(__FILE__).'/../require/class.TrackerImport.php'); |
|
36 | +} |
|
33 | 37 | if (isset($globalMarine) && $globalMarine) { |
34 | 38 | require_once(dirname(__FILE__).'/../require/class.AIS.php'); |
35 | 39 | require_once(dirname(__FILE__).'/../require/class.MarineImport.php'); |
36 | 40 | } |
37 | 41 | |
38 | -if (!isset($globalDebug)) $globalDebug = FALSE; |
|
42 | +if (!isset($globalDebug)) { |
|
43 | + $globalDebug = FALSE; |
|
44 | +} |
|
39 | 45 | |
40 | 46 | // Check if schema is at latest version |
41 | 47 | $Connection = new Connection(); |
@@ -45,10 +51,16 @@ discard block |
||
45 | 51 | } |
46 | 52 | |
47 | 53 | if (isset($globalServer) && $globalServer) { |
48 | - if ($globalDebug) echo "Using Server Mode\n"; |
|
54 | + if ($globalDebug) { |
|
55 | + echo "Using Server Mode\n"; |
|
56 | + } |
|
49 | 57 | $SI=new SpotterServer(); |
50 | -} else $SI=new SpotterImport($Connection->db); |
|
51 | -if (isset($globalTracker) && $globalTracker) $TI = new TrackerImport($Connection->db); |
|
58 | +} else { |
|
59 | + $SI=new SpotterImport($Connection->db); |
|
60 | +} |
|
61 | +if (isset($globalTracker) && $globalTracker) { |
|
62 | + $TI = new TrackerImport($Connection->db); |
|
63 | +} |
|
52 | 64 | if (isset($globalMarine) && $globalMarine) { |
53 | 65 | $AIS = new AIS(); |
54 | 66 | $MI = new MarineImport($Connection->db); |
@@ -57,7 +69,9 @@ discard block |
||
57 | 69 | date_default_timezone_set('UTC'); |
58 | 70 | |
59 | 71 | $buffer = ''; |
60 | -if (isset($_POST)) $buffer = $_POST; |
|
72 | +if (isset($_POST)) { |
|
73 | + $buffer = $_POST; |
|
74 | +} |
|
61 | 75 | $data = array(); |
62 | 76 | if (isset($buffer['type_event']) && isset($buffer['lat']) && isset($buffer['lon'])) { |
63 | 77 | $data['ident'] = $buffer['device_id']; |
@@ -68,15 +82,27 @@ discard block |
||
68 | 82 | //$data['heading'] = $buffer['cap']; // Only N/S/E/W |
69 | 83 | $data['datetime'] = date('Y-m-d H:i:s',$buffer['timestamp']); |
70 | 84 | $data['comment'] = ''; |
71 | - if (isset($buffer['battery']) && $buffer['battery'] != '') $data['comment'] .= 'Battery: '.$buffer['battery'].'% '; |
|
85 | + if (isset($buffer['battery']) && $buffer['battery'] != '') { |
|
86 | + $data['comment'] .= 'Battery: '.$buffer['battery'].'% '; |
|
87 | + } |
|
72 | 88 | //if (isset($buffer['snr']) && $buffer['snr'] != '') $data['comment'] .= 'SNR: '.$buffer['snr'].' '; |
73 | - if (isset($buffer['temp']) && $buffer['temp'] != '') $data['comment'] .= 'Temperature: '.$buffer['temp'].'°C '; |
|
74 | - if (isset($buffer['press']) && $buffer['press'] != '') $data['comment'] .= 'Pressure: '.$buffer['press'].'hPa '; |
|
89 | + if (isset($buffer['temp']) && $buffer['temp'] != '') { |
|
90 | + $data['comment'] .= 'Temperature: '.$buffer['temp'].'°C '; |
|
91 | + } |
|
92 | + if (isset($buffer['press']) && $buffer['press'] != '') { |
|
93 | + $data['comment'] .= 'Pressure: '.$buffer['press'].'hPa '; |
|
94 | + } |
|
75 | 95 | $TI->add($data); |
76 | 96 | unset($data); |
77 | 97 | } |
78 | -if (isset($SI)) $SI->checkAll(); |
|
79 | -if (isset($MI)) $MI->checkAll(); |
|
80 | -if (isset($TI)) $TI->checkAll(); |
|
98 | +if (isset($SI)) { |
|
99 | + $SI->checkAll(); |
|
100 | +} |
|
101 | +if (isset($MI)) { |
|
102 | + $MI->checkAll(); |
|
103 | +} |
|
104 | +if (isset($TI)) { |
|
105 | + $TI->checkAll(); |
|
106 | +} |
|
81 | 107 | |
82 | 108 | ?> |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | require_once(dirname(__FILE__).'/../require/class.Source.php'); |
10 | 10 | require_once(dirname(__FILE__).'/../require/class.Connection.php'); |
11 | 11 | require_once(dirname(__FILE__).'/../require/class.Common.php'); |
12 | -$Common=new Common(); |
|
12 | +$Common = new Common(); |
|
13 | 13 | $authorize = false; |
14 | 14 | $params = array(); |
15 | 15 | $userip = $Common->getUserIP(); |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | $authorize = true; |
21 | 21 | break; |
22 | 22 | } |
23 | - if ($userip != '' && isset($cb['host']) && in_array($userip,explode(',',$cb['host']))) { |
|
23 | + if ($userip != '' && isset($cb['host']) && in_array($userip, explode(',', $cb['host']))) { |
|
24 | 24 | $params = $globalSources[$key]; |
25 | 25 | $authorize = true; |
26 | 26 | break; |
@@ -46,14 +46,14 @@ discard block |
||
46 | 46 | |
47 | 47 | if (isset($globalServer) && $globalServer) { |
48 | 48 | if ($globalDebug) echo "Using Server Mode\n"; |
49 | - $SI=new SpotterServer(); |
|
50 | -} else $SI=new SpotterImport($Connection->db); |
|
49 | + $SI = new SpotterServer(); |
|
50 | +} else $SI = new SpotterImport($Connection->db); |
|
51 | 51 | if (isset($globalTracker) && $globalTracker) $TI = new TrackerImport($Connection->db); |
52 | 52 | if (isset($globalMarine) && $globalMarine) { |
53 | 53 | $AIS = new AIS(); |
54 | 54 | $MI = new MarineImport($Connection->db); |
55 | 55 | } |
56 | -$Source=new Source($Connection->db); |
|
56 | +$Source = new Source($Connection->db); |
|
57 | 57 | date_default_timezone_set('UTC'); |
58 | 58 | |
59 | 59 | $buffer = ''; |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | $data['altitude'] = round($buffer['altitude']*3.28084); |
67 | 67 | $data['speed'] = $buffer['speed']; |
68 | 68 | //$data['heading'] = $buffer['cap']; // Only N/S/E/W |
69 | - $data['datetime'] = date('Y-m-d H:i:s',$buffer['timestamp']); |
|
69 | + $data['datetime'] = date('Y-m-d H:i:s', $buffer['timestamp']); |
|
70 | 70 | $data['comment'] = ''; |
71 | 71 | if (isset($buffer['battery']) && $buffer['battery'] != '') $data['comment'] .= 'Battery: '.$buffer['battery'].'% '; |
72 | 72 | //if (isset($buffer['snr']) && $buffer['snr'] != '') $data['comment'] .= 'SNR: '.$buffer['snr'].' '; |
@@ -14,7 +14,7 @@ |
||
14 | 14 | /** |
15 | 15 | * Get SQL query part for filter used |
16 | 16 | * @param Array $filter the filter |
17 | - * @return Array the SQL part |
|
17 | + * @return string the SQL part |
|
18 | 18 | */ |
19 | 19 | public function getFilter($filter = array(),$where = false,$and = false) { |
20 | 20 | global $globalFilter, $globalStatsFilters, $globalFilterName; |
@@ -10,10 +10,10 @@ |
||
10 | 10 | } |
11 | 11 | |
12 | 12 | /** |
13 | - * Get SQL query part for filter used |
|
14 | - * @param Array $filter the filter |
|
15 | - * @return Array the SQL part |
|
16 | - */ |
|
13 | + * Get SQL query part for filter used |
|
14 | + * @param Array $filter the filter |
|
15 | + * @return Array the SQL part |
|
16 | + */ |
|
17 | 17 | public function getFilter($filter = array(),$where = false,$and = false) { |
18 | 18 | global $globalFilter, $globalStatsFilters, $globalFilterName; |
19 | 19 | if (is_array($globalStatsFilters) && isset($globalStatsFilters[$globalFilterName])) { |
@@ -7,7 +7,9 @@ discard block |
||
7 | 7 | public function __construct($dbc = null) { |
8 | 8 | $Connection = new Connection($dbc); |
9 | 9 | $this->db = $Connection->db; |
10 | - if ($this->db === null) die('Error: No DB connection. (ATC)'); |
|
10 | + if ($this->db === null) { |
|
11 | + die('Error: No DB connection. (ATC)'); |
|
12 | + } |
|
11 | 13 | } |
12 | 14 | |
13 | 15 | /** |
@@ -20,20 +22,27 @@ discard block |
||
20 | 22 | if (is_array($globalStatsFilters) && isset($globalStatsFilters[$globalFilterName])) { |
21 | 23 | if (isset($globalStatsFilters[$globalFilterName][0]['source'])) { |
22 | 24 | foreach($globalStatsFilters[$globalFilterName] as $source) { |
23 | - if (isset($source['source'])) $filter['source'][] = $source['source']; |
|
25 | + if (isset($source['source'])) { |
|
26 | + $filter['source'][] = $source['source']; |
|
27 | + } |
|
24 | 28 | } |
25 | 29 | } else { |
26 | 30 | $filter = $globalStatsFilters[$globalFilterName]; |
27 | 31 | } |
28 | 32 | } |
29 | - if (is_array($globalFilter)) $filter = array_merge($filter,$globalFilter); |
|
33 | + if (is_array($globalFilter)) { |
|
34 | + $filter = array_merge($filter,$globalFilter); |
|
35 | + } |
|
30 | 36 | $filter_query_join = ''; |
31 | 37 | $filter_query_where = ''; |
32 | 38 | if (isset($filter['source']) && !empty($filter['source'])) { |
33 | 39 | $filter_query_where = " WHERE format_source IN ('".implode("','",$filter['source'])."')"; |
34 | 40 | } |
35 | - if ($filter_query_where == '' && $where) $filter_query_where = ' WHERE'; |
|
36 | - elseif ($filter_query_where != '' && $and) $filter_query_where .= ' AND'; |
|
41 | + if ($filter_query_where == '' && $where) { |
|
42 | + $filter_query_where = ' WHERE'; |
|
43 | + } elseif ($filter_query_where != '' && $and) { |
|
44 | + $filter_query_where .= ' AND'; |
|
45 | + } |
|
37 | 46 | $filter_query = $filter_query_join.$filter_query_where; |
38 | 47 | return $filter_query; |
39 | 48 | } |
@@ -90,7 +99,9 @@ discard block |
||
90 | 99 | $info = str_replace('^','<br />',$info); |
91 | 100 | $info = str_replace('&sect;','',$info); |
92 | 101 | $info = str_replace('"','',$info); |
93 | - if ($type == '') $type = NULL; |
|
102 | + if ($type == '') { |
|
103 | + $type = NULL; |
|
104 | + } |
|
94 | 105 | $query = "INSERT INTO atc (ident,frequency,latitude,longitude,atc_range,info,atc_lastseen,type,ivao_id,ivao_name,format_source,source_name) VALUES (:ident,:frequency,:latitude,:longitude,:range,:info,:date,:type,:ivao_id,:ivao_name,:format_source,:source_name)"; |
95 | 106 | $query_values = array(':ident' => $ident,':frequency' => $frequency,':latitude' => $latitude,':longitude' => $longitude,':range' => $range,':info' => $info,':date' => $date,':ivao_id' => $ivao_id,':ivao_name' => $ivao_name, ':type' => $type,':format_source' => $format_source,':source_name' => $source_name); |
96 | 107 | try { |
@@ -106,7 +117,9 @@ discard block |
||
106 | 117 | $info = str_replace('^','<br />',$info); |
107 | 118 | $info = str_replace('&sect;','',$info); |
108 | 119 | $info = str_replace('"','',$info); |
109 | - if ($type == '') $type = NULL; |
|
120 | + if ($type == '') { |
|
121 | + $type = NULL; |
|
122 | + } |
|
110 | 123 | $query = "UPDATE atc SET frequency = :frequency,latitude = :latitude,longitude = :longitude,atc_range = :range,info = :info,atc_lastseen = :date,type = :type,ivao_id = :ivao_id,ivao_name = :ivao_name WHERE ident = :ident AND format_source = :format_source AND source_name = :source_name"; |
111 | 124 | $query_values = array(':ident' => $ident,':frequency' => $frequency,':latitude' => $latitude,':longitude' => $longitude,':range' => $range,':info' => $info,':date' => $date,':ivao_id' => $ivao_id,':ivao_name' => $ivao_name, ':type' => $type,':format_source' => $format_source,':source_name' => $source_name); |
112 | 125 | try { |
@@ -26,22 +26,22 @@ discard block |
||
26 | 26 | * @param Array $filter the filter |
27 | 27 | * @return Array the SQL part |
28 | 28 | */ |
29 | - public function getFilter($filter = array(),$where = false,$and = false) { |
|
29 | + public function getFilter($filter = array(), $where = false, $and = false) { |
|
30 | 30 | global $globalFilter, $globalStatsFilters, $globalFilterName; |
31 | 31 | if (is_array($globalStatsFilters) && isset($globalStatsFilters[$globalFilterName])) { |
32 | 32 | if (isset($globalStatsFilters[$globalFilterName][0]['source'])) { |
33 | - foreach($globalStatsFilters[$globalFilterName] as $source) { |
|
33 | + foreach ($globalStatsFilters[$globalFilterName] as $source) { |
|
34 | 34 | if (isset($source['source'])) $filter['source'][] = $source['source']; |
35 | 35 | } |
36 | 36 | } else { |
37 | 37 | $filter = $globalStatsFilters[$globalFilterName]; |
38 | 38 | } |
39 | 39 | } |
40 | - if (is_array($globalFilter)) $filter = array_merge($filter,$globalFilter); |
|
40 | + if (is_array($globalFilter)) $filter = array_merge($filter, $globalFilter); |
|
41 | 41 | $filter_query_join = ''; |
42 | 42 | $filter_query_where = ''; |
43 | 43 | if (isset($filter['source']) && !empty($filter['source'])) { |
44 | - $filter_query_where = " WHERE format_source IN ('".implode("','",$filter['source'])."')"; |
|
44 | + $filter_query_where = " WHERE format_source IN ('".implode("','", $filter['source'])."')"; |
|
45 | 45 | } |
46 | 46 | if ($filter_query_where == '' && $where) $filter_query_where = ' WHERE'; |
47 | 47 | elseif ($filter_query_where != '' && $and) $filter_query_where .= ' AND'; |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | try { |
61 | 61 | $sth = $this->db->prepare($query); |
62 | 62 | $sth->execute($query_values); |
63 | - } catch(PDOException $e) { |
|
63 | + } catch (PDOException $e) { |
|
64 | 64 | return "error : ".$e->getMessage(); |
65 | 65 | } |
66 | 66 | $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
@@ -73,13 +73,13 @@ discard block |
||
73 | 73 | * @return Array Return ATC |
74 | 74 | */ |
75 | 75 | public function getById($id) { |
76 | - $filter_query = $this->getFilter(array(),true,true); |
|
76 | + $filter_query = $this->getFilter(array(), true, true); |
|
77 | 77 | $query = "SELECT * FROM atc".$filter_query." atc_id = :id"; |
78 | 78 | $query_values = array(':id' => $id); |
79 | 79 | try { |
80 | 80 | $sth = $this->db->prepare($query); |
81 | 81 | $sth->execute($query_values); |
82 | - } catch(PDOException $e) { |
|
82 | + } catch (PDOException $e) { |
|
83 | 83 | return "error : ".$e->getMessage(); |
84 | 84 | } |
85 | 85 | $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
@@ -92,19 +92,19 @@ discard block |
||
92 | 92 | * @param String $format_source Format source |
93 | 93 | * @return Array Return ATC |
94 | 94 | */ |
95 | - public function getByIdent($ident,$format_source = '') { |
|
96 | - $filter_query = $this->getFilter(array(),true,true); |
|
95 | + public function getByIdent($ident, $format_source = '') { |
|
96 | + $filter_query = $this->getFilter(array(), true, true); |
|
97 | 97 | if ($format_source == '') { |
98 | 98 | $query = "SELECT * FROM atc".$filter_query." ident = :ident"; |
99 | 99 | $query_values = array(':ident' => $ident); |
100 | 100 | } else { |
101 | 101 | $query = "SELECT * FROM atc".$filter_query." ident = :ident AND format_source = :format_source"; |
102 | - $query_values = array(':ident' => $ident,':format_source' => $format_source); |
|
102 | + $query_values = array(':ident' => $ident, ':format_source' => $format_source); |
|
103 | 103 | } |
104 | 104 | try { |
105 | 105 | $sth = $this->db->prepare($query); |
106 | 106 | $sth->execute($query_values); |
107 | - } catch(PDOException $e) { |
|
107 | + } catch (PDOException $e) { |
|
108 | 108 | return "error : ".$e->getMessage(); |
109 | 109 | } |
110 | 110 | $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
@@ -126,18 +126,18 @@ discard block |
||
126 | 126 | * @param String $format_source Format source |
127 | 127 | * @param String $source_name Source name |
128 | 128 | */ |
129 | - public function add($ident,$frequency,$latitude,$longitude,$range,$info,$date,$type = '',$ivao_id = '',$ivao_name = '',$format_source = '',$source_name = '') { |
|
130 | - $info = preg_replace('/[^(\x20-\x7F)]*/','',$info); |
|
131 | - $info = str_replace('^','<br />',$info); |
|
132 | - $info = str_replace('&sect;','',$info); |
|
133 | - $info = str_replace('"','',$info); |
|
129 | + public function add($ident, $frequency, $latitude, $longitude, $range, $info, $date, $type = '', $ivao_id = '', $ivao_name = '', $format_source = '', $source_name = '') { |
|
130 | + $info = preg_replace('/[^(\x20-\x7F)]*/', '', $info); |
|
131 | + $info = str_replace('^', '<br />', $info); |
|
132 | + $info = str_replace('&sect;', '', $info); |
|
133 | + $info = str_replace('"', '', $info); |
|
134 | 134 | if ($type == '') $type = NULL; |
135 | 135 | $query = "INSERT INTO atc (ident,frequency,latitude,longitude,atc_range,info,atc_lastseen,type,ivao_id,ivao_name,format_source,source_name) VALUES (:ident,:frequency,:latitude,:longitude,:range,:info,:date,:type,:ivao_id,:ivao_name,:format_source,:source_name)"; |
136 | - $query_values = array(':ident' => $ident,':frequency' => $frequency,':latitude' => $latitude,':longitude' => $longitude,':range' => $range,':info' => $info,':date' => $date,':ivao_id' => $ivao_id,':ivao_name' => $ivao_name, ':type' => $type,':format_source' => $format_source,':source_name' => $source_name); |
|
136 | + $query_values = array(':ident' => $ident, ':frequency' => $frequency, ':latitude' => $latitude, ':longitude' => $longitude, ':range' => $range, ':info' => $info, ':date' => $date, ':ivao_id' => $ivao_id, ':ivao_name' => $ivao_name, ':type' => $type, ':format_source' => $format_source, ':source_name' => $source_name); |
|
137 | 137 | try { |
138 | 138 | $sth = $this->db->prepare($query); |
139 | 139 | $sth->execute($query_values); |
140 | - } catch(PDOException $e) { |
|
140 | + } catch (PDOException $e) { |
|
141 | 141 | return "error : ".$e->getMessage(); |
142 | 142 | } |
143 | 143 | } |
@@ -157,18 +157,18 @@ discard block |
||
157 | 157 | * @param String $format_source Format source |
158 | 158 | * @param String $source_name Source name |
159 | 159 | */ |
160 | - public function update($ident,$frequency,$latitude,$longitude,$range,$info,$date,$type = '',$ivao_id = '',$ivao_name = '',$format_source = '',$source_name = '') { |
|
161 | - $info = preg_replace('/[^(\x20-\x7F)]*/','',$info); |
|
162 | - $info = str_replace('^','<br />',$info); |
|
163 | - $info = str_replace('&sect;','',$info); |
|
164 | - $info = str_replace('"','',$info); |
|
160 | + public function update($ident, $frequency, $latitude, $longitude, $range, $info, $date, $type = '', $ivao_id = '', $ivao_name = '', $format_source = '', $source_name = '') { |
|
161 | + $info = preg_replace('/[^(\x20-\x7F)]*/', '', $info); |
|
162 | + $info = str_replace('^', '<br />', $info); |
|
163 | + $info = str_replace('&sect;', '', $info); |
|
164 | + $info = str_replace('"', '', $info); |
|
165 | 165 | if ($type == '') $type = NULL; |
166 | 166 | $query = "UPDATE atc SET frequency = :frequency,latitude = :latitude,longitude = :longitude,atc_range = :range,info = :info,atc_lastseen = :date,type = :type,ivao_id = :ivao_id,ivao_name = :ivao_name WHERE ident = :ident AND format_source = :format_source AND source_name = :source_name"; |
167 | - $query_values = array(':ident' => $ident,':frequency' => $frequency,':latitude' => $latitude,':longitude' => $longitude,':range' => $range,':info' => $info,':date' => $date,':ivao_id' => $ivao_id,':ivao_name' => $ivao_name, ':type' => $type,':format_source' => $format_source,':source_name' => $source_name); |
|
167 | + $query_values = array(':ident' => $ident, ':frequency' => $frequency, ':latitude' => $latitude, ':longitude' => $longitude, ':range' => $range, ':info' => $info, ':date' => $date, ':ivao_id' => $ivao_id, ':ivao_name' => $ivao_name, ':type' => $type, ':format_source' => $format_source, ':source_name' => $source_name); |
|
168 | 168 | try { |
169 | 169 | $sth = $this->db->prepare($query); |
170 | 170 | $sth->execute($query_values); |
171 | - } catch(PDOException $e) { |
|
171 | + } catch (PDOException $e) { |
|
172 | 172 | return "error : ".$e->getMessage(); |
173 | 173 | } |
174 | 174 | } |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | try { |
184 | 184 | $sth = $this->db->prepare($query); |
185 | 185 | $sth->execute($query_values); |
186 | - } catch(PDOException $e) { |
|
186 | + } catch (PDOException $e) { |
|
187 | 187 | return "error : ".$e->getMessage(); |
188 | 188 | } |
189 | 189 | } |
@@ -193,13 +193,13 @@ discard block |
||
193 | 193 | * @param String $ident Flight ident |
194 | 194 | * @param String $format_source Format source |
195 | 195 | */ |
196 | - public function deleteByIdent($ident,$format_source) { |
|
196 | + public function deleteByIdent($ident, $format_source) { |
|
197 | 197 | $query = "DELETE FROM atc WHERE ident = :ident AND format_source = :format_source"; |
198 | - $query_values = array(':ident' => $ident,':format_source' => $format_source); |
|
198 | + $query_values = array(':ident' => $ident, ':format_source' => $format_source); |
|
199 | 199 | try { |
200 | 200 | $sth = $this->db->prepare($query); |
201 | 201 | $sth->execute($query_values); |
202 | - } catch(PDOException $e) { |
|
202 | + } catch (PDOException $e) { |
|
203 | 203 | return "error : ".$e->getMessage(); |
204 | 204 | } |
205 | 205 | } |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | try { |
214 | 214 | $sth = $this->db->prepare($query); |
215 | 215 | $sth->execute($query_values); |
216 | - } catch(PDOException $e) { |
|
216 | + } catch (PDOException $e) { |
|
217 | 217 | return "error : ".$e->getMessage(); |
218 | 218 | } |
219 | 219 | } |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | try { |
232 | 232 | $sth = $this->db->prepare($query); |
233 | 233 | $sth->execute(); |
234 | - } catch(PDOException $e) { |
|
234 | + } catch (PDOException $e) { |
|
235 | 235 | return "error"; |
236 | 236 | } |
237 | 237 | return "success"; |