2 $id = filter_input(INPUT_GET
,'id',FILTER_SANITIZE_STRING
);
8 require_once('require/class.Connection.php');
9 require_once('require/class.Spotter.php');
10 require_once('require/class.ACARS.php');
11 require_once('require/class.Language.php');
12 require_once('require/class.SpotterArchive.php');
14 $Spotter = new Spotter();
15 $SpotterArchive = new SpotterArchive();
16 $spotter_array = $Spotter->getSpotterDataByID($id);
19 if (!empty($spotter_array))
21 if(isset($spotter_array[0]['flightaware_id'])) {
22 $flightaware_id = $spotter_array[0]['flightaware_id'];
24 if(isset($spotter_array[0]['last_latitude']) && $spotter_array[0]['last_latitude'] != '') {
25 $latitude = $spotter_array[0]['last_latitude'];
26 } elseif(isset($spotter_array[0]['latitude'])) {
27 $latitude = $spotter_array[0]['latitude'];
29 if(isset($spotter_array[0]['last_longitude']) && $spotter_array[0]['last_longitude'] != '') {
30 $longitude = $spotter_array[0]['last_longitude'];
31 } elseif(isset($spotter_array[0]['longitude'])) {
32 $longitude = $spotter_array[0]['longitude'];
35 if (isset($flightaware_id) && ((!isset($latitude) && !isset($longitude)) ||
($latitude == 0 && $longitude == 0))) {
36 require_once('require/class.SpotterLive.php');
37 $SpotterLive = new SpotterLive();
38 $live_data = $SpotterLive->getLastLiveSpotterDataById($flightaware_id);
39 $latitude = $live_data[0]['latitude'];
40 $longitude = $live_data[0]['longitude'];
44 if(isset($spotter_array[0]['ident'])) {
45 $title .= $spotter_array[0]['ident'];
47 if(isset($spotter_array[0]['airline_name'])) {
48 $title .= ' - '.$spotter_array[0]['airline_name'];
50 if(isset($spotter_array[0]['aircraft_name']) && $spotter_array[0]['aircraft_name'] != 'Not Available') {
51 $title .= ' - '.$spotter_array[0]['aircraft_name'].' ('.$spotter_array[0]['aircraft_type'].')';
53 if(isset($spotter_array[0]['registration']) && $spotter_array[0]['registration'] != 'NA' && $spotter_array[0]['registration'] != 'N/A') {
54 $title .= ' - '.$spotter_array[0]['registration'];
56 //$facebook_meta_image = $spotter_array[0]['image'];
57 require_once('header.php');
58 if (isset($globalArchive) && $globalArchive) {
59 $all_data = $SpotterArchive->getAltitudeSpeedArchiveSpotterDataById($spotter_array[0]['flightaware_id']);
60 if (isset($globalTimezone)) {
61 date_default_timezone_set($globalTimezone);
62 } else date_default_timezone_set('UTC');
64 if (is_array($all_data) && count($all_data) > 1) {
66 print '<link href="'.$globalURL.'/css/c3.min.css" rel="stylesheet" type="text/css">';
67 print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>';
68 print '<script type="text/javascript" src="'.$globalURL.'/js/c3.min.js"></script>';
69 print '<div id="chart" class="chart" width="100%"></div><script>';
73 foreach($all_data as $data)
75 $hour_data .= '"'.$data['date'].'",';
76 if (isset($data['real_altitude']) && $data['real_altitude'] != '') {
77 $altitude = $data['real_altitude'];
79 $altitude = $data['altitude'].'00';
81 if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') ||
(isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) {
85 $altitude = round($altitude*0.3048);
87 $altitude_data .= $altitude.',';
88 $speed = $data['ground_speed'];
89 if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'mph') ||
(isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'mph')) {
90 $speed = round($speed*1.15078);
92 } elseif ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'knots') ||
(isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'knots')) {
95 $speed = round($speed*1.852);
98 $speed_data .= $speed.',';
100 $hour_data = "['x',".substr($hour_data, 0, -1)."]";
101 $altitude_data = "['altitude',".substr($altitude_data,0,-1)."]";
102 $speed_data = "['speed',".substr($speed_data,0,-1)."]";
111 xFormat: "%Y-%m-%d %H:%M:%S",
112 columns: ['.$hour_data.','.$altitude_data.','.$speed_data.'],
120 type: "timeseries", tick: { format: "%H:%M:%S"}
123 label: "Altitude ('.$unit.')"
126 label: "Speed ('.$units.')",
130 legend: { show: false }});';
136 print '<div class="info column">';
137 print '<br/><br/><br/>';
139 if ($globalIVAO && @getimagesize
($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.gif')) {
140 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> ';
141 } elseif (@getimagesize
($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png')) {
142 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> ';
144 if (isset($spotter_array[0]['airline_name']) && $spotter_array[0]['airline_name'] != "") {
145 print '<a href="'.$globalURL.'/airline/'.$spotter_array[0]['airline_icao'].'">'.$spotter_array[0]['airline_name'].'</a> ';
148 if(isset($spotter_array[0]['ident'])) {
149 print $spotter_array[0]['ident'];
151 if(isset($spotter_array[0]['airline_name'])) {
152 print ' - '.$spotter_array[0]['airline_name'];
154 if(isset($spotter_array[0]['aircraft_name']) && $spotter_array[0]['aircraft_name'] != 'Not Available') {
155 print ' - '.$spotter_array[0]['aircraft_name'].' ('.$spotter_array[0]['aircraft_type'].')';
157 if(isset($spotter_array[0]['registration']) && $spotter_array[0]['registration'] != 'NA') {
158 print ' - '.$spotter_array[0]['registration'];
163 if ($spotter_array[0]['registration'] != "") {
164 //$highlight = $Spotter->getHighlightByRegistration($spotter_array[0]['registration']);
165 $highlight = $spotter_array[0]['highlight'];
166 if ($highlight != "") {
167 print '<div class="alert alert-warning">'.$highlight.'</div>';
171 include('flightid-sub-menu.php');
172 print '<div class="clear column">';
173 print '<div class="image">';
174 if ($spotter_array[0]['image'] != "")
176 if ($spotter_array[0]['image_source'] == 'planespotters') {
177 $planespotter_url_array = explode("_", $spotter_array[0]['image']);
178 $planespotter_id = str_replace(".jpg", "", $planespotter_url_array[1]);
179 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>';
180 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>';
181 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>';
183 if (isset($spotter_array[0]['image_source_website']) && $spotter_array[0]['image_source_website'] != '') {
184 print '<a href="'.$spotter_array[0]['image_source_website'].'"><img src="'.$spotter_array[0]['image'].'" width="100%" /></a>';
186 print '<img src="'.$spotter_array[0]['image'].'" width="100%" />';
188 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>';
191 //print '<img src="'.$globalURL.'/images/placeholder.png" alt="No image found!" title="No image found!" />';
195 /* print '<div class="col-sm-4 details">';
197 foreach($spotter_array as $spotter_item)
199 print '<div class="detail">';
200 if (@getimagesize($globalURL.'/images/airlines/'.$spotter_item['airline_icao'].'.png'))
202 print '<a href="'.$globalURL.'/airline/'.$spotter_item['airline_icao'].'"><img src="'.$globalURL.'/images/airlines/'.$spotter_item['airline_icao'].'.png" /></a>';
204 if (isset($spotter_item['airline_name']) && $spotter_item['airline_name'] != "")
206 print '<a href="'.$globalURL.'/airline/'.$spotter_item['airline_icao'].'">'.$spotter_item['airline_name'].'</a>';
213 print '<div class="detail">';
214 print '<div class="title">Ident/Callsign</div>';
216 if ($spotter_item['ident'] != "")
218 print '<a href="'.$globalURL.'/ident/'.$spotter_item['ident'].'">'.$spotter_item['ident'].'</a>';
225 print '<div class="detail">';
226 print '<div class="title">Aircraft</div>';
228 if (isset($spotter_item['aircraft_name']))
230 print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')</a>';
232 if ($spotter_item['aircraft_type'] != "")
234 print $spotter_item['aircraft_type'];
242 print '<div class="detail">';
243 print '<div class="title">Registration</div>';
245 if ($spotter_item['registration'] != "")
247 print '<a href="'.$globalURL.'/registration/'.$spotter_item['registration'].'">'.$spotter_item['registration'].'</a>';
254 print '<div class="detail">';
255 print '<div class="title">Coming from</div>';
257 if ($spotter_item['departure_airport_name'] != "")
259 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>';
261 print $spotter_item['departure_airport'];
266 print '<div class="detail">';
267 print '<div class="title">Flying to</div>';
269 if ($spotter_item['arrival_airport_name'] != "")
271 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>';
273 print $spotter_item['arrival_airport'];
278 print '<div class="detail">';
279 print '<div class="title">Date</div>';
282 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>';
290 print '<div class="col-sm-7 col-sm-offset-1 image">';
292 print '<div class="image">';
295 if ($spotter_array[0]['image'] != "")
297 $planespotter_url_array = explode("_", $spotter_array[0]['image']);
298 $planespotter_id = str_replace(".jpg", "", $planespotter_url_array[1]);
299 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>';
302 print '<img src="'.$globalURL.'/images/placeholder.png" alt="No image found!" title="No image found!" />';
306 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>';
311 foreach($spotter_array as $spotter_item)
313 print '<div class="details">';
314 print '<h3>'._("Flight Information").'</h3>';
315 print '<div class="detail callsign">';
316 print '<div class="title">'._("Ident/Callsign").'</div>';
318 if ($spotter_item['ident'] != "")
320 print '<a href="'.$globalURL.'/ident/'.$spotter_item['ident'].'">'.$spotter_item['ident'].'</a>';
327 if (isset($spotter_item['aircraft_owner']) && $spotter_item['aircraft_owner'] != '')
329 print '<div class="detail fa-user">';
330 print '<div class="title">'._("Owner").'</div>';
332 print $spotter_item['aircraft_owner'];
335 } elseif ((isset($globalVA) && $globalVA) ||
(isset($globalIVAO) && $globalIVAO) ||
(isset($globalVATSIM) && $globalVATSIM) ||
(isset($globalphpVMS) && $globalphpVMS)) {
336 print '<div class="detail fa-user">';
337 print '<div class="title">'._("Pilot Name").'</div>';
339 if (isset($spotter_item['pilot_id']) && $spotter_item['pilot_id'] != "")
341 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>';
342 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>';
343 else print $spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')';
345 if (isset($spotter_item['pilot_name']) && $spotter_item['pilot_name'] != "")
347 print $spotter_item['pilot_name'];
356 print '<div class="detail airline">';
357 print '<div class="title">'._("Airline").'</div>';
359 if ($spotter_item['airline_name'] != "")
361 print '<a href="'.$globalURL.'/airline/'.$spotter_item['airline_icao'].'">'.$spotter_item['airline_name'].'</a>';
368 print '<div class="detail aircraft">';
369 print '<div class="title">'._("Aircraft").'</div>';
371 if ($spotter_item['aircraft_name'] != "")
373 print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')</a>';
375 if ($spotter_item['aircraft_type'] != "")
377 print $spotter_item['aircraft_type'];
385 print '<div class="detail registration">';
386 print '<div class="title">'._("Registration").'</div>';
388 if ($spotter_item['registration'] != "")
390 print '<a href="'.$globalURL.'/registration/'.$spotter_item['registration'].'">'.$spotter_item['registration'].'</a>';
397 if ($spotter_item['departure_airport'] != 'NA') {
398 print '<div class="detail departure">';
399 print '<div class="title">'._("Departure Airport").'</div>';
401 if ($spotter_item['departure_airport_name'] != "")
403 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>';
405 print $spotter_item['departure_airport'];
408 if (isset($spotter_item['departure_airport_time']) && $spotter_item['departure_airport_time'] != '') {
409 if ($spotter_item['departure_airport_time'] > 2460) {
410 print '<div class="time">';
411 print 'at '.date('H:m',$spotter_item['departure_airport_time']);
414 print '<div class="time">';
415 print 'at '.$spotter_item['departure_airport_time'];
422 if ($spotter_item['arrival_airport'] != 'NA') {
423 print '<div class="detail arrival">';
424 print '<div class="title">'._("Arrival Airport").'</div>';
426 if ($spotter_item['arrival_airport_name'] != "")
428 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>';
430 print $spotter_item['arrival_airport'];
433 if (isset($spotter_item['arrival_airport_time']) && $spotter_item['arrival_airport_time'] != '') {
434 print '<div class="time">';
435 print 'at '.$spotter_item['arrival_airport_time'];
437 } elseif (isset($spotter_item['real_arrival_airport_time']) && $spotter_item['real_arrival_airport_time'] != '') {
438 print '<div class="time">';
439 print 'at '.$spotter_item['real_arrival_airport_time'];
445 if ($spotter_item['waypoints'] != "" ||
(isset($spotter_item['route_stop']) && $spotter_item['route_stop'] != ""))
447 print '<div class="detail coordinates">';
448 print '<div class="title">'._("Route").'</div>';
450 if ($spotter_item['waypoints'] != "")
452 print $spotter_item['waypoints'];
453 } elseif ($spotter_item['route_stop'] != "")
455 print $spotter_item['route_stop'];
462 print '<div class="details">';
463 print '<h3>Additional information as it flew nearby</h3>';
464 if ($spotter_item['latitude'] != 0 && $spotter_item['longitude'] != 0) {
465 print '<div class="detail speed">';
466 print '<div class="title">'._("Ground Speed").'</div>';
468 if (isset($spotter_item['last_ground_speed']) && $spotter_item['last_ground_speed'] != '') {
469 if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'mph') ||
(isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'mph')) {
470 print round($spotter_item['last_ground_speed']*1.15078).' mph';
471 } elseif ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'knots') ||
(isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'knots')) {
472 print $spotter_item['last_ground_speed'].' knots';
474 print round($spotter_item['last_ground_speed']*1.852).' km/h';
477 if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'mph') ||
(isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'mph')) {
478 print round($spotter_item['ground_speed']*1.15078).' mph';
479 } elseif ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'knots') ||
(isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'knots')) {
480 print $spotter_item['ground_speed'].' knots';
482 print round($spotter_item['ground_speed']*1.852).' km/h';
488 print '<div class="detail heading">';
489 print '<div class="title">'._("Heading (degrees)").'</div>';
491 print $spotter_item['heading'].' ('.$spotter_item['heading_name'].')';
495 print '<div class="detail altitude">';
496 print '<div class="title">'._("Altitude").'</div>';
498 if (isset($spotter_item['last_altitude']) && $spotter_item['last_altitude'] != '') {
499 if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') ||
(isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) {
500 print number_format($spotter_item['last_altitude'].'00').' feet';
502 print round($spotter_item['last_altitude']*30.48).' m';
505 if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') ||
(isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) {
506 print number_format($spotter_item['altitude'].'00').' feet';
508 print round($spotter_item['altitude']*30.48).' m';
514 print '<div class="detail coordinates">';
515 print '<div class="title">'._("Coordinates").'</div>';
517 //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>';
518 if (isset($spotter_item['last_latitude']) && $spotter_item['last_latitude'] != '') {
519 print 'Lat: '.$spotter_item['last_latitude'].' Lng: '.$spotter_item['last_longitude'];
521 print 'Lat: '.$spotter_item['latitude'].' Lng: '.$spotter_item['longitude'];
526 print '<div class="detail date">';
527 print '<div class="title">'._("Date").' ('.$globalTimezone.')</div>';
529 date_default_timezone_set($globalTimezone);
530 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>';
534 print '<div class="detail date">';
535 print '<div class="title">'._("Date").' (UTC)</div>';
537 date_default_timezone_set('UTC');
538 print date("M j, Y G:i", strtotime($spotter_item['date_iso_8601']));
542 if (isset($spotter_item['duration'])) {
543 print '<div class="detail duration">';
544 print '<div class="title">'._("Flight spotted duration").'</div>';
546 date_default_timezone_set('UTC');
547 print date("H:m:s", strtotime($spotter_item['duration']));
552 if (isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != '' && $spotter_item['departure_airport'] != 'NA' && $spotter_item['latitude'] != 0 && $spotter_item['longitude'] != 0) {
553 print '<div class="detail distance-departure">';
554 print '<div class="title">'._("Distance from Departure Airport").'</div>';
556 $Common = new Common();
557 $departure_airport_info = $Spotter->getAllAirportInfo($spotter_item['departure_airport']);
558 if (count($departure_airport_info) > 0) {
559 if (isset($spotter_item['last_latitude']) && $spotter_item['last_latitude'] != '') {
560 if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') ||
(isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) {
561 print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'nm').' nm';
562 } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') ||
(isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) {
563 print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'mi').' mi';
565 print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'km').' km';
568 if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') ||
(isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) {
569 print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'nm').' nm';
570 } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') ||
(isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) {
571 print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'mi').' mi';
573 print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'km').' km';
580 if (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != '' && $spotter_item['arrival_airport'] != 'NA' && $spotter_item['latitude'] != 0 && $spotter_item['longitude'] != 0) {
581 print '<div class="detail distance-arrival">';
582 print '<div class="title">'._("Distance to Arrival Airport").'</div>';
584 $Common = new Common();
585 $arrival_airport_info = $Spotter->getAllAirportInfo($spotter_item['arrival_airport']);
586 if (count($arrival_airport_info) > 0) {
587 if (isset($spotter_item['last_latitude']) && $spotter_item['last_latitude'] != '') {
588 if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') ||
(isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) {
589 print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'nm').' nm';
590 } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') ||
(isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) {
591 print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'mi').' mi';
593 print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'km').' km';
596 if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') ||
(isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) {
597 print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'nm').' nm';
598 } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') ||
(isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) {
599 print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'mi').' mi';
601 print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'km').' km';
608 $LatestACARS = $ACARS->getLiveAcarsData($spotter_item['ident']);
609 if ($LatestACARS != '') {
610 print '<div class="detail acars">';
611 print '<div class="title">'._("Latest ACARS message").'</div>';
621 print '<div id="archive-map"></div>';
622 //print '<div id="live-map"></div>';
624 if ($spotter_array[0]['registration'] != "" && $spotter_array[0]['registration'] != "NA" && $spotter_array[0]['registration'] != "N/A")
626 $registration = $spotter_array[0]['registration'];
627 print '<div class="last-flights">';
628 print '<h3>'._("Last 5 Flights of this Aircraft").' ('.$registration.')</h3>';
629 $hide_th_links = true;
630 $spotter_array = $Spotter->getSpotterDataByRegistration($registration,"0,5", "");
631 include('table-output.php');
632 print '<div class="more">';
633 print '<a href="'.$globalURL.'/registration/'.$registration.'" class="btn btn-default btn" role="button">See all Flights»</a>';
641 <span class='st_facebook' displayText='Facebook'></span>
642 <span class='st_twitter' displayText='Tweet'></span>
643 <span class='st_googleplus' displayText='Google +'></span>
644 <span class='st_pinterest' displayText='Pinterest'></span>
645 <span class='st_email' displayText='Email'></span>
647 <script type="text/javascript">var switchTo5x=true;</script>
648 <script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>
649 <script type="text/javascript">stLight.options({publisher: "ur-5a9fbd4d-de8a-6441-d567-29163a2526c7", doNotHash: false, doNotCopy: false, hashAddressBar: false});</script>
656 require_once('header.php');
657 print '<h1>'._("Error").'</h1>';
658 print '<p>'._("Sorry, this flight is not anymore in the database. :(").'</p>';
660 require_once('footer.php');