These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | $id = filter_input(INPUT_GET,'id',FILTER_SANITIZE_STRING); |
||
3 | if ($id == "") |
||
4 | { |
||
5 | header('Location: /'); |
||
6 | } |
||
7 | |||
8 | require_once('require/class.Connection.php'); |
||
9 | require_once('require/class.Spotter.php'); |
||
10 | require_once('require/class.Language.php'); |
||
11 | require_once('require/class.SpotterArchive.php'); |
||
12 | $Spotter = new Spotter(); |
||
13 | $SpotterArchive = new SpotterArchive(); |
||
14 | $spotter_array = $Spotter->getSpotterDataByID($id); |
||
15 | |||
16 | |||
17 | if (!empty($spotter_array)) |
||
18 | { |
||
19 | if(isset($spotter_array[0]['flightaware_id'])) { |
||
20 | $flightaware_id = $spotter_array[0]['flightaware_id']; |
||
21 | } |
||
22 | if(isset($spotter_array[0]['last_latitude']) && $spotter_array[0]['last_latitude'] != '') { |
||
23 | $latitude = $spotter_array[0]['last_latitude']; |
||
24 | } elseif(isset($spotter_array[0]['latitude'])) { |
||
25 | $latitude = $spotter_array[0]['latitude']; |
||
26 | } |
||
27 | if(isset($spotter_array[0]['last_longitude']) && $spotter_array[0]['last_longitude'] != '') { |
||
28 | $longitude = $spotter_array[0]['last_longitude']; |
||
29 | } elseif(isset($spotter_array[0]['longitude'])) { |
||
30 | $longitude = $spotter_array[0]['longitude']; |
||
31 | } |
||
32 | $title = ''; |
||
33 | if(isset($spotter_array[0]['ident'])) { |
||
34 | $title .= $spotter_array[0]['ident']; |
||
35 | } |
||
36 | if(isset($spotter_array[0]['airline_name'])) { |
||
37 | $title .= ' - '.$spotter_array[0]['airline_name']; |
||
38 | } |
||
39 | if(isset($spotter_array[0]['aircraft_name']) && $spotter_array[0]['aircraft_name'] != 'Not Available') { |
||
40 | $title .= ' - '.$spotter_array[0]['aircraft_name'].' ('.$spotter_array[0]['aircraft_type'].')'; |
||
41 | } |
||
42 | if(isset($spotter_array[0]['registration']) && $spotter_array[0]['registration'] != 'NA' && $spotter_array[0]['registration'] != 'N/A') { |
||
43 | $title .= ' - '.$spotter_array[0]['registration']; |
||
44 | } |
||
45 | //$facebook_meta_image = $spotter_array[0]['image']; |
||
46 | require_once('header.php'); |
||
47 | if (isset($globalArchive) && $globalArchive) { |
||
48 | $all_data = $SpotterArchive->getAltitudeSpeedArchiveSpotterDataById($spotter_array[0]['flightaware_id']); |
||
49 | if (isset($globalTimezone)) { |
||
50 | date_default_timezone_set($globalTimezone); |
||
51 | } else date_default_timezone_set('UTC'); |
||
52 | |||
53 | if (is_array($all_data) && count($all_data) > 1) { |
||
54 | print '<br/>'; |
||
55 | print '<link href="'.$globalURL.'/css/c3.min.css" rel="stylesheet" type="text/css">'; |
||
56 | print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>'; |
||
57 | print '<script type="text/javascript" src="'.$globalURL.'/js/c3.min.js"></script>'; |
||
58 | print '<div id="chart" class="chart" width="100%"></div><script>'; |
||
59 | $altitude_data = ''; |
||
60 | $hour_data = ''; |
||
61 | $speed_data = ''; |
||
62 | foreach($all_data as $data) |
||
63 | { |
||
64 | $hour_data .= '"'.$data['date'].'",'; |
||
65 | if (isset($data['real_altitude']) && $data['real_altitude'] != '') { |
||
66 | $altitude = $data['real_altitude']; |
||
67 | } else { |
||
68 | $altitude = $data['altitude'].'00'; |
||
69 | } |
||
70 | if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) { |
||
71 | $unit = 'feet'; |
||
72 | } else { |
||
73 | $unit = 'm'; |
||
74 | $altitude = round($altitude*0.3048); |
||
75 | } |
||
76 | $altitude_data .= $altitude.','; |
||
77 | $speed = $data['ground_speed']; |
||
78 | if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'mph') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'mph')) { |
||
79 | $speed = round($speed*1.15078); |
||
80 | $units = 'mph'; |
||
81 | } elseif ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'knots') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'knots')) { |
||
82 | $units = 'knots'; |
||
83 | } else { |
||
84 | $speed = round($speed*1.852); |
||
85 | $units = 'km/h'; |
||
86 | } |
||
87 | $speed_data .= $speed.','; |
||
88 | } |
||
89 | $hour_data = "['x',".substr($hour_data, 0, -1)."]"; |
||
90 | $altitude_data = "['altitude',".substr($altitude_data,0,-1)."]"; |
||
91 | $speed_data = "['speed',".substr($speed_data,0,-1)."]"; |
||
92 | print 'c3.generate({ |
||
93 | bindto: "#chart", |
||
94 | data: { |
||
95 | x: "x", |
||
96 | axes: { |
||
97 | altitude: "y", |
||
98 | speed: "y2" |
||
99 | }, |
||
100 | xFormat: "%Y-%m-%d %H:%M:%S", |
||
101 | columns: ['.$hour_data.','.$altitude_data.','.$speed_data.'], |
||
102 | colors: { |
||
103 | altitude: "#1a3151", |
||
104 | speed: "#aa0000" |
||
105 | } |
||
106 | }, |
||
107 | axis: { |
||
108 | x: { |
||
109 | type: "timeseries", tick: { format: "%H:%M:%S"} |
||
110 | }, |
||
111 | y: { |
||
112 | label: "Altitude ('.$unit.')" |
||
113 | }, |
||
114 | y2: { |
||
115 | label: "Speed ('.$units.')", |
||
116 | show: true |
||
117 | } |
||
118 | }, |
||
119 | legend: { show: false }});'; |
||
120 | print '</script>'; |
||
121 | } |
||
122 | } |
||
123 | |||
124 | |||
125 | print '<div class="info column">'; |
||
126 | print '<br/><br/><br/>'; |
||
127 | print '<h1>'; |
||
128 | if ($globalIVAO && @getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.gif')) { |
||
129 | print '<a href="'.$globalURL.'/airline/'.$spotter_array[0]['airline_icao'].'"><img src="'.$globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.gif" class="airline-logo" /></a> '; |
||
130 | } elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png')) { |
||
131 | print '<a href="'.$globalURL.'/airline/'.$spotter_array[0]['airline_icao'].'"><img src="'.$globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png" class="airline-logo" /></a> '; |
||
132 | } else { |
||
133 | if (isset($spotter_array[0]['airline_name']) && $spotter_array[0]['airline_name'] != "") { |
||
134 | print '<a href="'.$globalURL.'/airline/'.$spotter_array[0]['airline_icao'].'">'.$spotter_array[0]['airline_name'].'</a> '; |
||
135 | } |
||
136 | } |
||
137 | if(isset($spotter_array[0]['ident'])) { |
||
138 | print $spotter_array[0]['ident']; |
||
139 | } |
||
140 | if(isset($spotter_array[0]['airline_name'])) { |
||
141 | print ' - '.$spotter_array[0]['airline_name']; |
||
142 | } |
||
143 | if(isset($spotter_array[0]['aircraft_name']) && $spotter_array[0]['aircraft_name'] != 'Not Available') { |
||
144 | print ' - '.$spotter_array[0]['aircraft_name'].' ('.$spotter_array[0]['aircraft_type'].')'; |
||
145 | } |
||
146 | if(isset($spotter_array[0]['registration']) && $spotter_array[0]['registration'] != 'NA') { |
||
147 | print ' - '.$spotter_array[0]['registration']; |
||
148 | } |
||
149 | print '</h1>'; |
||
150 | print '</div>'; |
||
151 | |||
152 | if ($spotter_array[0]['registration'] != "") { |
||
153 | //$highlight = $Spotter->getHighlightByRegistration($spotter_array[0]['registration']); |
||
154 | $highlight = $spotter_array[0]['highlight']; |
||
155 | if ($highlight != "") { |
||
156 | print '<div class="alert alert-warning">'.$highlight.'</div>'; |
||
157 | } |
||
158 | } |
||
159 | |||
160 | include('flightid-sub-menu.php'); |
||
161 | print '<div class="clear column">'; |
||
162 | print '<div class="image">'; |
||
163 | if ($spotter_array[0]['image'] != "") |
||
164 | { |
||
165 | if ($spotter_array[0]['image_source'] == 'planespotters') { |
||
166 | $planespotter_url_array = explode("_", $spotter_array[0]['image']); |
||
167 | $planespotter_id = str_replace(".jpg", "", $planespotter_url_array[1]); |
||
168 | print '<a href="http://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id.'" target="_blank"><img src="'.$spotter_array[0]['image_thumbnail'].'" alt="Click image to view on Planespotters.net" title="Click image to view on Planespotters.net" width="100%" /></a>'; |
||
169 | print '<div class="note">Disclaimer: The images are courtesy of Planespotters.net and their respective uploaders. This system may not always 100% accuratly show the actual aircraft.</div>'; |
||
170 | print '<div class="note">Planespotters.net didn\'t allow us to show full size pics here. This pic is copyright '.$spotter_array[0]['image_copyright'].'</div>'; |
||
171 | } else { |
||
172 | if (isset($spotter_array[0]['image_source_website']) && $spotter_array[0]['image_source_website'] != '') { |
||
173 | print '<a href="'.$spotter_array[0]['image_source_website'].'"><img src="'.$spotter_array[0]['image'].'" width="100%" /></a>'; |
||
174 | } else { |
||
175 | print '<img src="'.$spotter_array[0]['image'].'" width="100%" />'; |
||
176 | } |
||
177 | print '<div class="note">Disclaimer: The source of the above image is '.$spotter_array[0]['image_source'].' and is copyright '.$spotter_array[0]['image_copyright'].'. This system may not show the actual aircraft with 100% accuracy.</div>'; |
||
178 | } |
||
179 | } else { |
||
0 ignored issues
–
show
|
|||
180 | //print '<img src="'.$globalURL.'/images/placeholder.png" alt="No image found!" title="No image found!" />'; |
||
181 | } |
||
182 | print '</div>'; |
||
183 | |||
184 | /* print '<div class="col-sm-4 details">'; |
||
185 | |||
186 | foreach($spotter_array as $spotter_item) |
||
187 | { |
||
188 | print '<div class="detail">'; |
||
189 | if (@getimagesize($globalURL.'/images/airlines/'.$spotter_item['airline_icao'].'.png')) |
||
190 | { |
||
191 | print '<a href="'.$globalURL.'/airline/'.$spotter_item['airline_icao'].'"><img src="'.$globalURL.'/images/airlines/'.$spotter_item['airline_icao'].'.png" /></a>'; |
||
192 | } else { |
||
193 | if (isset($spotter_item['airline_name']) && $spotter_item['airline_name'] != "") |
||
194 | { |
||
195 | print '<a href="'.$globalURL.'/airline/'.$spotter_item['airline_icao'].'">'.$spotter_item['airline_name'].'</a>'; |
||
196 | } else { |
||
197 | print 'N/A'; |
||
198 | } |
||
199 | } |
||
200 | print '</div>'; |
||
201 | |||
202 | print '<div class="detail">'; |
||
203 | print '<div class="title">Ident/Callsign</div>'; |
||
204 | print '<div>'; |
||
205 | if ($spotter_item['ident'] != "") |
||
206 | { |
||
207 | print '<a href="'.$globalURL.'/ident/'.$spotter_item['ident'].'">'.$spotter_item['ident'].'</a>'; |
||
208 | } else { |
||
209 | print 'N/A'; |
||
210 | } |
||
211 | print '</div>'; |
||
212 | print '</div>'; |
||
213 | |||
214 | print '<div class="detail">'; |
||
215 | print '<div class="title">Aircraft</div>'; |
||
216 | print '<div>'; |
||
217 | if (isset($spotter_item['aircraft_name'])) |
||
218 | { |
||
219 | print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')</a>'; |
||
220 | } else { |
||
221 | if ($spotter_item['aircraft_type'] != "") |
||
222 | { |
||
223 | print $spotter_item['aircraft_type']; |
||
224 | } else { |
||
225 | print 'N/A'; |
||
226 | } |
||
227 | } |
||
228 | print '</div>'; |
||
229 | print '</div>'; |
||
230 | |||
231 | print '<div class="detail">'; |
||
232 | print '<div class="title">Registration</div>'; |
||
233 | print '<div>'; |
||
234 | if ($spotter_item['registration'] != "") |
||
235 | { |
||
236 | print '<a href="'.$globalURL.'/registration/'.$spotter_item['registration'].'">'.$spotter_item['registration'].'</a>'; |
||
237 | } else { |
||
238 | print 'N/A'; |
||
239 | } |
||
240 | print '</div>'; |
||
241 | print '</div>'; |
||
242 | |||
243 | print '<div class="detail">'; |
||
244 | print '<div class="title">Coming from</div>'; |
||
245 | print '<div>'; |
||
246 | if ($spotter_item['departure_airport_name'] != "") |
||
247 | { |
||
248 | print '<a href="'.$globalURL.'/airport/'.$spotter_item['departure_airport'].'">'.$spotter_item['departure_airport_city'].', '.$spotter_item['departure_airport_name'].', '.$spotter_item['departure_airport_country'].' ('.$spotter_item['departure_airport'].')</a>'; |
||
249 | } else { |
||
250 | print $spotter_item['departure_airport']; |
||
251 | } |
||
252 | print '</div>'; |
||
253 | print '</div>'; |
||
254 | |||
255 | print '<div class="detail">'; |
||
256 | print '<div class="title">Flying to</div>'; |
||
257 | print '<div>'; |
||
258 | if ($spotter_item['arrival_airport_name'] != "") |
||
259 | { |
||
260 | print '<a href="'.$globalURL.'/airport/'.$spotter_item['arrival_airport'].'">'.$spotter_item['arrival_airport_city'].', '.$spotter_item['arrival_airport_name'].', '.$spotter_item['arrival_airport_country'].' ('.$spotter_item['arrival_airport'].')</a>'; |
||
261 | } else { |
||
262 | print $spotter_item['arrival_airport']; |
||
263 | } |
||
264 | print '</div>'; |
||
265 | print '</div>'; |
||
266 | |||
267 | print '<div class="detail">'; |
||
268 | print '<div class="title">Date</div>'; |
||
269 | print '<div>'; |
||
270 | |||
271 | print '<a href="'.$globalURL.'/date/'.date("Y-m-d", strtotime($spotter_item['date_iso_8601'])).'">'.date("M j, Y, g:i a", strtotime($spotter_item['date_iso_8601'])).'</a>'; |
||
272 | print '</div>'; |
||
273 | print '</div>'; |
||
274 | } |
||
275 | |||
276 | print '</div>'; |
||
277 | |||
278 | |||
279 | print '<div class="col-sm-7 col-sm-offset-1 image">'; |
||
280 | |||
281 | print '<div class="image">'; |
||
282 | |||
283 | |||
284 | if ($spotter_array[0]['image'] != "") |
||
285 | { |
||
286 | $planespotter_url_array = explode("_", $spotter_array[0]['image']); |
||
287 | $planespotter_id = str_replace(".jpg", "", $planespotter_url_array[1]); |
||
288 | print '<a href="http://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id.'" target="_blank"><img src="'.$spotter_array[0]['image'].'" alt="Click image to view on Planespotters.net" title="Click image to view on Planespotters.net" /></a>'; |
||
289 | |||
290 | } else { |
||
291 | print '<img src="'.$globalURL.'/images/placeholder.png" alt="No image found!" title="No image found!" />'; |
||
292 | } |
||
293 | |||
294 | print '</div>'; |
||
295 | print '<div class="note">Disclaimer: The images are courtesy of Planespotters.net and may not always be 100% accurate of the actual aircraft that has flown over.</div>'; |
||
296 | print '</div>'; |
||
297 | print '</div>'; |
||
298 | */ |
||
299 | |||
300 | foreach($spotter_array as $spotter_item) |
||
301 | { |
||
302 | print '<div class="details">'; |
||
303 | print '<h3>'._("Flight Information").'</h3>'; |
||
304 | print '<div class="detail callsign">'; |
||
305 | print '<div class="title">'._("Ident/Callsign").'</div>'; |
||
306 | print '<div>'; |
||
307 | if ($spotter_item['ident'] != "") |
||
308 | { |
||
309 | print '<a href="'.$globalURL.'/ident/'.$spotter_item['ident'].'">'.$spotter_item['ident'].'</a>'; |
||
310 | } else { |
||
311 | print 'N/A'; |
||
312 | } |
||
313 | print '</div>'; |
||
314 | print '</div>'; |
||
315 | |||
316 | if (isset($spotter_item['aircraft_owner']) && $spotter_item['aircraft_owner'] != '') |
||
317 | { |
||
318 | print '<div class="detail fa-user">'; |
||
319 | print '<div class="title">'._("Owner").'</div>'; |
||
320 | print '<div>'; |
||
321 | print $spotter_item['aircraft_owner']; |
||
322 | print '</div>'; |
||
323 | print '</div>'; |
||
324 | } elseif ((isset($globalVA) && $globalVA) || (isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) { |
||
325 | print '<div class="detail fa-user">'; |
||
326 | print '<div class="title">'._("Pilot Name").'</div>'; |
||
327 | print '<div>'; |
||
328 | if (isset($spotter_item['pilot_id']) && $spotter_item['pilot_id'] != "") |
||
329 | { |
||
330 | if ($spotter_item['format_source'] == 'whazzup') print '<a href="https://www.ivao.aero/Member.aspx?ID='.$spotter_item['pilot_id'].'">'.$spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')</a>'; |
||
331 | elseif ($spotter_item['format_source'] == 'vatsimtxt') print '<a href="http://www.vataware.com/pilot/'.$spotter_item['pilot_id'].'">'.$spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')</a>'; |
||
332 | else print $spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')'; |
||
333 | } else { |
||
334 | if (isset($spotter_item['pilot_name']) && $spotter_item['pilot_name'] != "") |
||
335 | { |
||
336 | print $spotter_item['pilot_name']; |
||
337 | } else { |
||
338 | print _("N/A"); |
||
339 | } |
||
340 | } |
||
341 | print '</div>'; |
||
342 | print '</div>'; |
||
343 | } |
||
344 | |||
345 | print '<div class="detail airline">'; |
||
346 | print '<div class="title">'._("Airline").'</div>'; |
||
347 | print '<div>'; |
||
348 | if ($spotter_item['airline_name'] != "") |
||
349 | { |
||
350 | print '<a href="'.$globalURL.'/airline/'.$spotter_item['airline_icao'].'">'.$spotter_item['airline_name'].'</a>'; |
||
351 | } else { |
||
352 | print _("N/A"); |
||
353 | } |
||
354 | print '</div>'; |
||
355 | print '</div>'; |
||
356 | |||
357 | print '<div class="detail aircraft">'; |
||
358 | print '<div class="title">'._("Aircraft").'</div>'; |
||
359 | print '<div>'; |
||
360 | if ($spotter_item['aircraft_name'] != "") |
||
361 | { |
||
362 | print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')</a>'; |
||
363 | } else { |
||
364 | if ($spotter_item['aircraft_type'] != "") |
||
365 | { |
||
366 | print $spotter_item['aircraft_type']; |
||
367 | } else { |
||
368 | print _("N/A"); |
||
369 | } |
||
370 | } |
||
371 | print '</div>'; |
||
372 | print '</div>'; |
||
373 | |||
374 | print '<div class="detail registration">'; |
||
375 | print '<div class="title">'._("Registration").'</div>'; |
||
376 | print '<div>'; |
||
377 | if ($spotter_item['registration'] != "") |
||
378 | { |
||
379 | print '<a href="'.$globalURL.'/registration/'.$spotter_item['registration'].'">'.$spotter_item['registration'].'</a>'; |
||
380 | } else { |
||
381 | print 'N/A'; |
||
382 | } |
||
383 | print '</div>'; |
||
384 | print '</div>'; |
||
385 | |||
386 | if ($spotter_item['departure_airport'] != 'NA') { |
||
387 | print '<div class="detail departure">'; |
||
388 | print '<div class="title">'._("Departure Airport").'</div>'; |
||
389 | print '<div>'; |
||
390 | if ($spotter_item['departure_airport_name'] != "") |
||
391 | { |
||
392 | print '<a href="'.$globalURL.'/airport/'.$spotter_item['departure_airport'].'">'.$spotter_item['departure_airport_city'].', '.$spotter_item['departure_airport_name'].', '.$spotter_item['departure_airport_country'].' ('.$spotter_item['departure_airport'].')</a>'; |
||
393 | } else { |
||
394 | print $spotter_item['departure_airport']; |
||
395 | } |
||
396 | print '</div>'; |
||
397 | if (isset($spotter_item['departure_airport_time']) && $spotter_item['departure_airport_time'] != '') { |
||
398 | if ($spotter_item['departure_airport_time'] > 2460) { |
||
399 | print '<div class="time">'; |
||
400 | print 'at '.date('H:m',$spotter_item['departure_airport_time']); |
||
401 | print '</div>'; |
||
402 | } else { |
||
403 | print '<div class="time">'; |
||
404 | print 'at '.$spotter_item['departure_airport_time']; |
||
405 | print '</div>'; |
||
406 | } |
||
407 | } |
||
408 | print '</div>'; |
||
409 | } |
||
410 | |||
411 | if ($spotter_item['arrival_airport'] != 'NA') { |
||
412 | print '<div class="detail arrival">'; |
||
413 | print '<div class="title">'._("Arrival Airport").'</div>'; |
||
414 | print '<div>'; |
||
415 | if ($spotter_item['arrival_airport_name'] != "") |
||
416 | { |
||
417 | print '<a href="'.$globalURL.'/airport/'.$spotter_item['arrival_airport'].'">'.$spotter_item['arrival_airport_city'].', '.$spotter_item['arrival_airport_name'].', '.$spotter_item['arrival_airport_country'].' ('.$spotter_item['arrival_airport'].')</a>'; |
||
418 | } else { |
||
419 | print $spotter_item['arrival_airport']; |
||
420 | } |
||
421 | print '</div>'; |
||
422 | if (isset($spotter_item['arrival_airport_time']) && $spotter_item['arrival_airport_time'] != '') { |
||
423 | print '<div class="time">'; |
||
424 | print 'at '.$spotter_item['arrival_airport_time']; |
||
425 | print '</div>'; |
||
426 | } elseif (isset($spotter_item['real_arrival_airport_time']) && $spotter_item['real_arrival_airport_time'] != '') { |
||
427 | print '<div class="time">'; |
||
428 | print 'at '.$spotter_item['real_arrival_airport_time']; |
||
429 | print '</div>'; |
||
430 | } |
||
431 | print '</div>'; |
||
432 | } |
||
433 | |||
434 | if ($spotter_item['waypoints'] != "" || (isset($spotter_item['route_stop']) && $spotter_item['route_stop'] != "")) |
||
435 | { |
||
436 | print '<div class="detail coordinates">'; |
||
437 | print '<div class="title">'._("Route").'</div>'; |
||
438 | print '<div>'; |
||
439 | if ($spotter_item['waypoints'] != "") |
||
440 | { |
||
441 | print $spotter_item['waypoints']; |
||
442 | } elseif ($spotter_item['route_stop'] != "") |
||
443 | { |
||
444 | print $spotter_item['route_stop']; |
||
445 | } |
||
446 | print '</div>'; |
||
447 | print '</div>'; |
||
448 | } |
||
449 | print '</div>'; |
||
450 | |||
451 | print '<div class="details">'; |
||
452 | print '<h3>Additional information as it flew nearby</h3>'; |
||
453 | if ($spotter_item['latitude'] != 0 && $spotter_item['longitude'] != 0) { |
||
454 | print '<div class="detail speed">'; |
||
455 | print '<div class="title">'._("Ground Speed").'</div>'; |
||
456 | print '<div>'; |
||
457 | if (isset($spotter_item['last_ground_speed']) && $spotter_item['last_ground_speed'] != '') { |
||
458 | if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'mph') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'mph')) { |
||
459 | print round($spotter_item['last_ground_speed']*1.15078).' mph'; |
||
460 | } elseif ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'knots') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'knots')) { |
||
461 | print $spotter_item['last_ground_speed'].' knots'; |
||
462 | } else { |
||
463 | print round($spotter_item['last_ground_speed']*1.852).' km/h'; |
||
464 | } |
||
465 | } else { |
||
466 | if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'mph') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'mph')) { |
||
467 | print round($spotter_item['ground_speed']*1.15078).' mph'; |
||
468 | } elseif ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'knots') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'knots')) { |
||
469 | print $spotter_item['ground_speed'].' knots'; |
||
470 | } else { |
||
471 | print round($spotter_item['ground_speed']*1.852).' km/h'; |
||
472 | } |
||
473 | } |
||
474 | print '</div>'; |
||
475 | print '</div>'; |
||
476 | |||
477 | print '<div class="detail heading">'; |
||
478 | print '<div class="title">'._("Heading (degrees)").'</div>'; |
||
479 | print '<div>'; |
||
480 | print $spotter_item['heading'].' ('.$spotter_item['heading_name'].')'; |
||
481 | print '</div>'; |
||
482 | print '</div>'; |
||
483 | |||
484 | print '<div class="detail altitude">'; |
||
485 | print '<div class="title">'._("Altitude").'</div>'; |
||
486 | print '<div>'; |
||
487 | if (isset($spotter_item['last_altitude']) && $spotter_item['last_altitude'] != '') { |
||
488 | if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) { |
||
489 | print number_format($spotter_item['last_altitude'].'00').' feet'; |
||
490 | } else { |
||
491 | print round($spotter_item['last_altitude']*30.48).' m'; |
||
492 | } |
||
493 | } else { |
||
494 | if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) { |
||
495 | print number_format($spotter_item['altitude'].'00').' feet'; |
||
496 | } else { |
||
497 | print round($spotter_item['altitude']*30.48).' m'; |
||
498 | } |
||
499 | } |
||
500 | print '</div>'; |
||
501 | print '</div>'; |
||
502 | |||
503 | print '<div class="detail coordinates">'; |
||
504 | print '<div class="title">'._("Coordinates").'</div>'; |
||
505 | print '<div>'; |
||
506 | //print '<a href="https://www.google.com/maps/place/'.$spotter_item['latitude'].','.$spotter_item['longitude'].'/@'.$spotter_item['latitude'].','.$spotter_item['longitude'].',10z" target="_blank">Lat: '.$spotter_item['latitude'].' Lng: '.$spotter_item['longitude'].'</a>'; |
||
507 | if (isset($spotter_item['last_latitude']) && $spotter_item['last_latitude'] != '') { |
||
508 | print 'Lat: '.$spotter_item['last_latitude'].' Lng: '.$spotter_item['last_longitude']; |
||
509 | } else { |
||
510 | print 'Lat: '.$spotter_item['latitude'].' Lng: '.$spotter_item['longitude']; |
||
511 | } |
||
512 | print '</div>'; |
||
513 | print '</div>'; |
||
514 | } |
||
515 | print '<div class="detail date">'; |
||
516 | print '<div class="title">'._("Date").' ('.$globalTimezone.')</div>'; |
||
517 | print '<div>'; |
||
518 | date_default_timezone_set($globalTimezone); |
||
519 | print '<a href="'.$globalURL.'/date/'.date("Y-m-d", strtotime($spotter_item['date_iso_8601'])).'">'.date("M j, Y g:i a", strtotime($spotter_item['date_iso_8601'])).'</a>'; |
||
520 | print '</div>'; |
||
521 | print '</div>'; |
||
522 | |||
523 | print '<div class="detail date">'; |
||
524 | print '<div class="title">'._("Date").' (UTC)</div>'; |
||
525 | print '<div>'; |
||
526 | date_default_timezone_set('UTC'); |
||
527 | print date("M j, Y G:i", strtotime($spotter_item['date_iso_8601'])); |
||
528 | print '</div>'; |
||
529 | print '</div>'; |
||
530 | |||
531 | if (isset($spotter_item['duration'])) { |
||
532 | print '<div class="detail duration">'; |
||
533 | print '<div class="title">'._("Flight spotted duration").'</div>'; |
||
534 | print '<div>'; |
||
535 | date_default_timezone_set('UTC'); |
||
536 | print date("H:m:s", strtotime($spotter_item['duration'])); |
||
537 | print '</div>'; |
||
538 | print '</div>'; |
||
539 | } |
||
540 | |||
541 | if (isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != '' && $spotter_item['departure_airport'] != 'NA' && $spotter_item['latitude'] != 0 && $spotter_item['longitude'] != 0) { |
||
542 | print '<div class="detail distance-departure">'; |
||
543 | print '<div class="title">'._("Distance from Departure Airport").'</div>'; |
||
544 | print '<div>'; |
||
545 | $Common = new Common(); |
||
546 | $departure_airport_info = $Spotter->getAllAirportInfo($spotter_item['departure_airport']); |
||
547 | if (count($departure_airport_info) > 0) { |
||
548 | if (isset($spotter_item['last_latitude']) && $spotter_item['last_latitude'] != '') { |
||
549 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
||
550 | print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'nm').' nm'; |
||
551 | } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
||
552 | print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'mi').' mi'; |
||
553 | } else { |
||
554 | print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'km').' km'; |
||
555 | } |
||
556 | } else { |
||
557 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
||
558 | print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'nm').' nm'; |
||
559 | } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
||
560 | print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'mi').' mi'; |
||
561 | } else { |
||
562 | print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'km').' km'; |
||
563 | } |
||
564 | } |
||
565 | } |
||
566 | print '</div>'; |
||
567 | print '</div>'; |
||
568 | } |
||
569 | if (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != '' && $spotter_item['arrival_airport'] != 'NA' && $spotter_item['latitude'] != 0 && $spotter_item['longitude'] != 0) { |
||
570 | print '<div class="detail distance-arrival">'; |
||
571 | print '<div class="title">'._("Distance to Arrival Airport").'</div>'; |
||
572 | print '<div>'; |
||
573 | $Common = new Common(); |
||
574 | $arrival_airport_info = $Spotter->getAllAirportInfo($spotter_item['arrival_airport']); |
||
575 | if (count($arrival_airport_info) > 0) { |
||
576 | if (isset($spotter_item['last_latitude']) && $spotter_item['last_latitude'] != '') { |
||
577 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
||
578 | print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'nm').' nm'; |
||
579 | } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
||
580 | print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'mi').' mi'; |
||
581 | } else { |
||
582 | print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'km').' km'; |
||
583 | } |
||
584 | } else { |
||
585 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
||
586 | print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'nm').' nm'; |
||
587 | } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
||
588 | print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'mi').' mi'; |
||
589 | } else { |
||
590 | print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'km').' km'; |
||
591 | } |
||
592 | } |
||
593 | } |
||
594 | print '</div>'; |
||
595 | print '</div>'; |
||
596 | } |
||
597 | print '</div>'; |
||
598 | } |
||
599 | print '</div>'; |
||
600 | |||
601 | // print '<div id="archive-map"></div>'; |
||
602 | |||
603 | if ($spotter_array[0]['registration'] != "" && $spotter_array[0]['registration'] != "NA" && $spotter_array[0]['registration'] != "N/A") |
||
604 | { |
||
605 | $registration = $spotter_array[0]['registration']; |
||
606 | print '<div class="last-flights">'; |
||
607 | print '<h3>'._("Last 5 Flights of this Aircraft").' ('.$registration.')</h3>'; |
||
608 | $hide_th_links = true; |
||
609 | $spotter_array = $Spotter->getSpotterDataByRegistration($registration,"0,5", ""); |
||
610 | include('table-output.php'); |
||
611 | print '<div class="more">'; |
||
612 | print '<a href="'.$globalURL.'/registration/'.$registration.'" class="btn btn-default btn" role="button">See all Flights»</a>'; |
||
613 | print '</div>'; |
||
614 | print '</div>'; |
||
615 | } |
||
616 | /* ?> |
||
617 | <div class="column"> |
||
618 | |||
619 | <div class="share"> |
||
620 | <span class='st_facebook' displayText='Facebook'></span> |
||
621 | <span class='st_twitter' displayText='Tweet'></span> |
||
622 | <span class='st_googleplus' displayText='Google +'></span> |
||
623 | <span class='st_pinterest' displayText='Pinterest'></span> |
||
624 | <span class='st_email' displayText='Email'></span> |
||
625 | </div> |
||
626 | <script type="text/javascript">var switchTo5x=true;</script> |
||
627 | <script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script> |
||
628 | <script type="text/javascript">stLight.options({publisher: "ur-5a9fbd4d-de8a-6441-d567-29163a2526c7", doNotHash: false, doNotCopy: false, hashAddressBar: false});</script> |
||
629 | |||
630 | <?php |
||
631 | print '</div>'; |
||
632 | */ |
||
633 | } else { |
||
634 | $title = "ID"; |
||
635 | require_once('header.php'); |
||
636 | print '<h1>'._("Error").'</h1>'; |
||
637 | print '<p>'._("Sorry, this flight is not in the database. :(").'</p>'; |
||
638 | } |
||
639 | require_once('footer.php'); |
||
640 | ?> |
This check looks for the
else
branches ofif
statements that have no statements or where all statements have been commented out. This may be the result of changes for debugging or the code may simply be obsolete.These
else
branches can be removed.could be turned into
This is much more concise to read.