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
![]() |
|||
84 | } |
||
85 | } |
||
86 | print '<span class="altitude">'; |
||
87 | if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) { |
||
88 | print $spotter_item['altitude'].' feet (FL'.$spotter_item['altitude'].')'; |
||
89 | } else { |
||
90 | print round($spotter_item['altitude']*0.3048).' m (FL'.round($spotter_item['altitude']/100).')'; |
||
91 | } |
||
92 | print '</span>'; |
||
93 | if (isset($groundAltitude) && $groundAltitude < $spotter_item['altitude']*0.3048) { |
||
94 | print '<br>'; |
||
95 | print '<span>'._("Ground Altitude").'</span>'; |
||
96 | print '<i>'; |
||
97 | print '<span class="groundaltitude">'; |
||
98 | if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) { |
||
99 | print round($groundAltitude*3.28084).' feet'; |
||
100 | } else { |
||
101 | print round($groundAltitude).' m'; |
||
102 | } |
||
103 | print '</span>'; |
||
104 | print '</i>'; |
||
105 | } |
||
106 | print '</div>'; |
||
107 | print '<div><span>'._("Speed").'</span>'; |
||
108 | if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'mph') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'mph')) { |
||
109 | print round($spotter_item['ground_speed']*0.621371).' mph'; |
||
110 | } elseif ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'knots') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'knots')) { |
||
111 | print round($spotter_item['ground_speed']*0.539957).' knots'; |
||
112 | } else { |
||
113 | print $spotter_item['ground_speed'].' km/h'; |
||
114 | } |
||
115 | print '</div>'; |
||
116 | print '<div><span>'._("Coordinates").'</span><span class="latitude">'.$spotter_item['latitude'].'</span>, <span class="longitude">'.$spotter_item['longitude'].'</span></div>'; |
||
117 | print '<div><span>'._("Type").'</span>'.$spotter_item['type'].'</div>'; |
||
118 | print '<div><span>'._("Heading").'</span><span class="heading">'.$spotter_item['heading'].'</span>°</div>'; |
||
119 | if (isset($spotter_item['over_country']) && $spotter_item['over_country'] != '') { |
||
120 | print '<div><span>'._("Over country").'</span>'; |
||
121 | print $spotter_item['over_country']; |
||
122 | print '</div>'; |
||
123 | } |
||
124 | if (isset($spotter_item['source_name']) && $spotter_item['source_name'] != '') { |
||
125 | print '<div><span>'._("Source").'</span>'; |
||
126 | print $spotter_item['source_name']; |
||
127 | print '</div>'; |
||
128 | } |
||
129 | if (isset($spotter_item['comment']) && $spotter_item['comment'] != '') { |
||
130 | print '<div><span>'._("Comment").'</span>'; |
||
131 | print $spotter_item['comment']; |
||
132 | print '</div>'; |
||
133 | } |
||
134 | if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') { |
||
135 | print '<a href="?3d&trackerid='.$spotter_item['famtrackid'].'">Track it link !</a>'; |
||
136 | } else { |
||
137 | print '<a href="?2d&trackerid='.$spotter_item['famtrackid'].'">Track it link !</a>'; |
||
138 | } |
||
139 | print '</div>'; |
||
140 | print '</div>'; |
||
141 | ?> |
||
142 | </div> |