Ysurac /
FlightAirMap
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
| 1 | <?php |
||
| 2 | require_once('require/class.Connection.php'); |
||
| 3 | require_once('require/class.Tracker.php'); |
||
| 4 | require_once('require/class.Language.php'); |
||
| 5 | require_once('require/class.TrackerLive.php'); |
||
| 6 | require_once('require/class.TrackerArchive.php'); |
||
| 7 | require_once('require/class.Elevation.php'); |
||
| 8 | $TrackerLive = new TrackerLive(); |
||
| 9 | $TrackerArchive = new TrackerArchive(); |
||
| 10 | $Elevation = new Elevation(); |
||
| 11 | |||
| 12 | $from_archive = false; |
||
| 13 | if (isset($_GET['ident'])) { |
||
| 14 | $ident = urldecode(filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING)); |
||
| 15 | if (isset($_GET['currenttime'])) { |
||
| 16 | $currenttime = filter_input(INPUT_GET,'currenttime',FILTER_SANITIZE_NUMBER_INT); |
||
| 17 | $currenttime = round($currenttime/1000); |
||
| 18 | $spotter_array = $TrackerLive->getDateLiveTrackerDataByIdent($ident,$currenttime); |
||
| 19 | if (empty($spotter_array)) { |
||
| 20 | $from_archive = true; |
||
| 21 | $spotter_array = $TrackerArchive->getDateArchiveTrackerDataByIdent($ident,$currenttime); |
||
| 22 | } |
||
| 23 | |||
| 24 | } else { |
||
| 25 | $spotter_array = $TrackerLive->getLastLiveTrackerDataByIdent($ident); |
||
| 26 | if (empty($spotter_array)) { |
||
| 27 | $from_archive = true; |
||
| 28 | $spotter_array = $TrackerArchive->getLastArchiveTrackerDataByIdent($ident); |
||
| 29 | } |
||
| 30 | } |
||
| 31 | } |
||
| 32 | if (isset($_GET['famtrackid'])) { |
||
| 33 | $famtrackid = urldecode(filter_input(INPUT_GET,'famtrackid',FILTER_SANITIZE_STRING)); |
||
| 34 | if (isset($_GET['currenttime'])) { |
||
| 35 | $currenttime = filter_input(INPUT_GET,'currenttime',FILTER_SANITIZE_NUMBER_INT); |
||
| 36 | $currenttime = round($currenttime/1000); |
||
| 37 | $spotter_array = $TrackerLive->getDateLiveTrackerDataById($famtrackid,$currenttime); |
||
| 38 | |||
| 39 | if (empty($spotter_array)) { |
||
| 40 | $from_archive = true; |
||
| 41 | // $spotter_array = $SpotterArchive->getLastArchiveSpotterDataById($flightaware_id); |
||
| 42 | $spotter_array = $TrackerArchive->getDateArchiveTrackerDataById($famtrackid,$currenttime); |
||
| 43 | } |
||
| 44 | |||
| 45 | } else { |
||
| 46 | $spotter_array = $TrackerLive->getLastLiveTrackerDataById($famtrackid); |
||
| 47 | if (empty($spotter_array)) { |
||
| 48 | $from_archive = true; |
||
| 49 | $spotter_array = $TrackerArchive->getLastArchiveTrackerDataById($famtrackid); |
||
| 50 | } |
||
| 51 | } |
||
| 52 | } |
||
| 53 | ?> |
||
| 54 | <div class="alldetails"> |
||
| 55 | <button type="button" class="close">×</button> |
||
| 56 | <?php |
||
| 57 | $spotter_item = $spotter_array[0]; |
||
| 58 | date_default_timezone_set('UTC'); |
||
| 59 | if (isset($spotter_item['image_thumbnail']) && $spotter_item['image_thumbnail'] != "") |
||
| 60 | { |
||
| 61 | if ($spotter_item['image_source'] == 'flickr' || $spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart') { |
||
| 62 | $image = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
||
| 63 | } else $image = $spotter_item['image_thumbnail']; |
||
| 64 | |||
| 65 | } |
||
| 66 | /* else { |
||
| 67 | $image = "images/placeholder_thumb.png"; |
||
| 68 | } */ |
||
| 69 | |||
| 70 | print '<div class="top">'; |
||
| 71 | if (isset($image)) { |
||
| 72 | print '<div class="left"><img src="'.$image.'" alt="'.$spotter_item['registration'].' '.$spotter_item['aircraft_name'].'" title="'.$spotter_item['registration'].' '.$spotter_item['aircraft_name'].' Image © '.$spotter_item['image_copyright'].'"/><br />Image © '.$spotter_item['image_copyright'].'</div>'; |
||
| 73 | } |
||
| 74 | //print '<div class="right"><div class="callsign-details"><div class="callsign"><a href="'.$globalURL.'/redirect/'.$spotter_item['famtrackid'].'" target="_blank">'.$spotter_item['ident'].'</a></div>'; |
||
| 75 | print '<div class="right"><div class="callsign-details"><div class="callsign">'.$spotter_item['ident'].'</div>'; |
||
| 76 | print '</div>'; |
||
| 77 | print '</div></div>'; |
||
| 78 | print '<div class="details">'; |
||
| 79 | print '<div><span>'._("Altitude").'</span>'; |
||
| 80 | if (isset($globalGroundAltitude) && $globalGroundAltitude) { |
||
| 81 | try { |
||
| 82 | $groundAltitude = $Elevation->getElevation($spotter_item['latitude'],$spotter_item['longitude']); |
||
| 83 | } catch(Exception $e) { |
||
|
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
Loading history...
|
|||
| 84 | } |
||
| 85 | } |
||
| 86 | if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) { |
||
| 87 | print $spotter_item['altitude'].' feet (FL'.$spotter_item['altitude'].')'; |
||
| 88 | } else { |
||
| 89 | print round($spotter_item['altitude']*0.3048).' m (FL'.round($spotter_item['altitude']/100).')'; |
||
| 90 | } |
||
| 91 | if (isset($groundAltitude) && $groundAltitude < $spotter_item['altitude']*0.3048) { |
||
| 92 | print '<br>'; |
||
| 93 | print '<span>'._("Ground Altitude").'</span>'; |
||
| 94 | if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) { |
||
| 95 | print round($groundAltitude*3.28084).' feet'; |
||
| 96 | } else { |
||
| 97 | print round($groundAltitude).' m'; |
||
| 98 | } |
||
| 99 | print '</i>'; |
||
| 100 | } |
||
| 101 | print '</div>'; |
||
| 102 | print '<div><span>'._("Speed").'</span>'; |
||
| 103 | if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'mph') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'mph')) { |
||
| 104 | print round($spotter_item['ground_speed']*0.621371).' mph'; |
||
| 105 | } elseif ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'knots') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'knots')) { |
||
| 106 | print round($spotter_item['ground_speed']*0.539957).' knots'; |
||
| 107 | } else { |
||
| 108 | print $spotter_item['ground_speed'].' km/h'; |
||
| 109 | } |
||
| 110 | print '</div>'; |
||
| 111 | print '<div><span>'._("Coordinates").'</span>'.$spotter_item['latitude'].', '.$spotter_item['longitude'].'</div>'; |
||
| 112 | print '<div><span>'._("Type").'</span>'.$spotter_item['type'].'</div>'; |
||
| 113 | print '<div><span>'._("Heading").'</span>'.$spotter_item['heading'].'°</div>'; |
||
| 114 | if (isset($spotter_item['over_country']) && $spotter_item['over_country'] != '') { |
||
| 115 | print '<div><span>'._("Over country").'</span>'; |
||
| 116 | print $spotter_item['over_country']; |
||
| 117 | print '</div>'; |
||
| 118 | } |
||
| 119 | if (isset($spotter_item['source_name']) && $spotter_item['source_name'] != '') { |
||
| 120 | print '<div><span>'._("Source").'</span>'; |
||
| 121 | print $spotter_item['source_name']; |
||
| 122 | print '</div>'; |
||
| 123 | } |
||
| 124 | if (isset($spotter_item['comment']) && $spotter_item['comment'] != '') { |
||
| 125 | print '<div><span>'._("Comment").'</span>'; |
||
| 126 | print $spotter_item['comment']; |
||
| 127 | print '</div>'; |
||
| 128 | } |
||
| 129 | if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') { |
||
| 130 | print '<a href="?3d&trackerid='.$spotter_item['famtrackid'].'">Track it link !</a>'; |
||
| 131 | } else { |
||
| 132 | print '<a href="?2d&trackerid='.$spotter_item['famtrackid'].'">Track it link !</a>'; |
||
| 133 | } |
||
| 134 | print '</div>'; |
||
| 135 | print '</div>'; |
||
| 136 | ?> |
||
| 137 | </div> |