Merge pull request #456 from Struart88/patch-2
[FlightAirMap.git] / table-output.php
blob657fd2f7d4cca495dd96137ee774cd475f584579
1 <?php
2 print '<div class="table-responsive">';
3 print '<table class="table-striped">';
5 require_once(dirname(__FILE__).'/require/class.Common.php');
6 $Common = new Common();
7 $showRouteStop = $Common->multiKeyExists($spotter_array,'route_stop');
8 if (isset($globalVM) && $globalVM && isset($type) && $type == 'marine') {
9 $showDuration = $Common->multiKeyExists($spotter_array,'race_time');
10 if ($showDuration === false) $showDuration = $Common->multiKeyExists($spotter_array,'duration');
11 } else {
12 $showDuration = $Common->multiKeyExists($spotter_array,'duration');
14 if (isset($globalVM) && $globalVM && isset($type) && $type == 'marine') {
15 $showDistance = $Common->multiKeyExists($spotter_array,'distance');
19 if (!isset($type)) $type = 'aircraft';
21 if (!isset($_GET['sort']))
23 $_GET['sort'] = '';
25 if (!isset($showSpecial))
27 $showSpecial = false;
29 if (!isset($hide_th_links))
31 $hide_th_links = false;
34 if (strtolower($current_page) == "search")
36 print '<thead>';
37 if ($type == 'marine' && isset($globalVM) && $globalVM) {
38 print '<th class="rank">'._("Rank").'</th>';
40 print '<th class="aircraft_thumbnail"></th>';
41 if ($type == 'aircraft') {
42 if (!isset($globalNoAirlines) || $globalNoAirlines === FALSE) {
43 if ($_GET['sort'] == "airline_name_asc")
45 print '<th class="logo"><a href="'.$page_url.'&sort=airline_name_desc" class="active">'._("Airline").'</a> <i class="fa fa-caret-up"></i></th>';
46 } else if ($_GET['sort'] == "airline_name_desc")
48 print '<th class="logo"><a href="'.$page_url.'&sort=airline_name_asc" class="active">'._("Airline").'</a> <i class="fa fa-caret-down"></i></th>';
49 } else {
50 print '<th class="logo"><a href="'.$page_url.'&sort=airline_name_asc">'._("Airline").'</a> <i class="fa fa-sort small"></i></th>';
54 if (!isset($globalNoIdents) || $globalNoIdents === FALSE) {
55 if ($_GET['sort'] == "ident_asc")
57 print '<th class="ident"><a href="'.$page_url.'&sort=ident_desc" class="active">'._("Ident").'</a> <i class="fa fa-caret-up"></i></th>';
58 } else if ($_GET['sort'] == "ident_desc")
60 print '<th class="ident"><a href="'.$page_url.'&sort=ident_asc" class="active">'._("Ident").'</a> <i class="fa fa-caret-down"></i></th>';
61 } else {
62 print '<th class="ident"><a href="'.$page_url.'&sort=ident_asc">'._("Ident").'</a> <i class="fa fa-sort small"></i></th>';
65 if ($type == 'aircraft') {
66 if ($_GET['sort'] == "aircraft_asc")
68 print '<th class="type"><a href="'.$page_url.'&sort=aircraft_desc" class="active">'._("Aircraft").'</a> <i class="fa fa-caret-up"></i></th>';
69 } else if ($_GET['sort'] == "aircraft_desc")
71 print '<th class="type"><a href="'.$page_url.'&sort=aircraft_asc" class="active">'._("Aircraft").'</a> <i class="fa fa-caret-down"></i></th>';
72 } else {
73 print '<th class="type"><a href="'.$page_url.'&sort=aircraft_asc">'._("Aircraft").'</a> <i class="fa fa-sort small"></i></th>';
75 } elseif ($type == 'marine') {
76 if ($_GET['sort'] == "type_asc")
78 print '<th class="type">'._("Type").'</th>';
79 } else if ($_GET['sort'] == "type_desc")
81 print '<th class="type">'._("Type").'</th>';
82 } else {
83 print '<th class="type">'._("Type").'</th>';
85 } elseif ($type == 'tracker') {
86 if ($_GET['sort'] == "type_asc")
88 print '<th class="type">'._("Type").'</th>';
89 } else if ($_GET['sort'] == "type_desc")
91 print '<th class="type">'._("Type").'</th>';
92 } else {
93 print '<th class="type">'._("Type").'</th>';
96 if ($type == 'aircraft') {
97 if ($_GET['sort'] == "airport_departure_asc")
99 print '<th class="departure"><a href="'.$page_url.'&sort=airport_departure_desc" class="active"><span class="nomobile">'._("Coming from").'</span><span class="mobile">'._("From").'</span></a> <i class="fa fa-caret-up"></i></th>';
100 } else if ($_GET['sort'] == "airport_departure_desc")
102 print '<th class="departure"><a href="'.$page_url.'&sort=airport_departure_asc" class="active"><span class="nomobile">'._("Coming from").'</span><span class="mobile">'._("From").'</span></a> <i class="fa fa-caret-down"></i></th>';
103 } else {
104 print '<th class="departure"><a href="'.$page_url.'&sort=airport_departure_asc"><span class="nomobile">'._("Coming from").'</span><span class="mobile">'._("From").'</span></a> <i class="fa fa-sort small"></i></th>';
107 if ($type == 'aircraft' || $type == 'marine') {
108 if (isset($globalVM) && $globalVM && $type == 'marine') {
109 if ($_GET['sort'] == "race_asc")
111 print '<th class="arrival"><a href="'.$page_url.'&sort=race_desc" class="active">'._("Races").'</a> <i class="fa fa-caret-up"></i></th>';
112 } else if ($_GET['sort'] == "race_desc")
114 print '<th class="arrival"><a href="'.$page_url.'&sort=race_asc" class="active">'._("Races").'</a> <i class="fa fa-caret-down"></i></th>';
115 } else {
116 print '<th class="arrival"><a href="'.$page_url.'&sort=race_asc">'._("Races").'</a> <i class="fa fa-sort small"></i></th>';
118 print '<th class="status">'._("Status").'</th>';
119 } else {
120 if ($_GET['sort'] == "airport_arrival_asc")
122 print '<th class="arrival"><a href="'.$page_url.'&sort=airport_arrival_desc" class="active"><span class="nomobile">'._("Going to").'</span><span class="mobile">'._("To").'</span></a> <i class="fa fa-caret-up"></i></th>';
123 } else if ($_GET['sort'] == "airport_arrival_desc")
125 print '<th class="arrival"><a href="'.$page_url.'&sort=airport_arrival_asc" class="active"><span class="nomobile">'._("Going to").'</span><span class="mobile">'._("To").'</span></a> <i class="fa fa-caret-down"></i></th>';
126 } else {
127 print '<th class="arrival"><a href="'.$page_url.'&sort=airport_arrival_asc"><span class="nomobile">'._("Going to").'</span><span class="mobile">'._("To").'</span></a> <i class="fa fa-sort small"></i></th>';
131 if ($type == 'aircraft') {
132 if ((isset($globalVA) && $globalVA) || (isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalVAM) && $globalVAM) || (isset($globalphpVMS) && $globalphpVMS)) {
133 print '<th class="routestop"><span class="nomobile">'._("Route stop").'</span><span class="mobile">'._("Stop").'</span></a></th>';
135 if (isset($_GET['dist']) && $_GET['dist'] != '') {
136 if ($_GET['sort'] == "distance_asc")
138 print '<th class="distance"><a href="'.$page_url.'&sort=distance_desc" class="active"><span class="nomobile">'._("Distance").'</span><span class="mobile">'._("Distance").'</span></a> <i class="fa fa-caret-up"></i></th>';
139 } elseif ($_GET['sort'] == "distance_desc")
141 print '<th class="distance"><a href="'.$page_url.'&sort=distance_asc" class="active"><span class="nomobile">'._("Distance").'</span><span class="mobile">'._("Distance").'</span></a> <i class="fa fa-caret-down"></i></th>';
142 } else {
143 print '<th class="distance"><a href="'.$page_url.'&sort=distance_desc" class="active"><span class="nomobile">'._("Distance").'</span><span class="mobile">'._("Distance").'</span></a> <i class="fa fa-sort small"></i></th>';
146 if ((isset($globalUsePilot) && $globalUsePilot) || !isset($globalUsePilot) && ((isset($globalVA) && $globalVA) || (isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS) || (isset($globalVAM) && $globalVAM))) {
147 print '<th class="pilot"><span class="nomobile">'._("Pilot name").'</span><span class="mobile">'._("Pilot").'</span></a></th>';
149 if ((isset($globalUseOwner) && $globalUseOwner) || (!isset($globalUseOwner) && (!isset($globalVA) || !$globalVA) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS) && (!isset($globalVAM) || !$globalVAM))) {
150 print '<th class="owner"><span class="nomobile">'._("Owner name").'</span><span class="mobile">'._("Owner").'</span></a></th>';
153 if ($type == 'marine' && isset($globalVM) && $globalVM) {
154 if ($_GET['sort'] == "distance_asc")
156 print '<th class="distance"><a href="'.$page_url.'&sort=distance_desc" class="active"><span class="nomobile">'._("Distance").'</span><span class="mobile">'._("Distance").'</span></a> <i class="fa fa-caret-up"></i></th>';
157 } elseif ($_GET['sort'] == "distance_desc")
159 print '<th class="distance"><a href="'.$page_url.'&sort=distance_asc" class="active"><span class="nomobile">'._("Distance").'</span><span class="mobile">'._("Distance").'</span></a> <i class="fa fa-caret-down"></i></th>';
160 } else {
161 print '<th class="distance"><a href="'.$page_url.'&sort=distance_desc"><span class="nomobile">'._("Distance").'</span><span class="mobile">'._("Distance").'</span></a> <i class="fa fa-sort small"></i></th>';
163 print '<th class="captain"><span class="nomobile">'._("Captain name").'</span><span class="mobile">'._("Captain").'</span></a></th>';
164 print '<th class="duration"><span class="nomobile">'._("Race duration").'</span><span class="mobile">'._("Race duration").'</span></th>';
167 if ($type == 'tracker') {
168 print '<th class="comment"><span class="nomobile">'._("Comment").'</span><span class="mobile">'._("Comment").'</span></th>';
170 if ($_GET['sort'] == "date_asc")
172 print '<th class="time"><a href="'.$page_url.'&sort=date_desc" class="active">'._("Date").'</a> <i class="fa fa-caret-up"></i></th>';
173 } else if ($_GET['sort'] == "date_desc")
175 print '<th class="time"><a href="'.$page_url.'&sort=date_asc" class="active">'._("Date").'</a> <i class="fa fa-caret-down"></i></th>';
176 } else {
177 print '<th class="time"><a href="'.$page_url.'&sort=date_asc">'._("Date").'</a> <i class="fa fa-sort small"></i></th>';
179 print '<th class="more"></th>';
180 print '</thead>';
181 } else if (strtolower($current_page) == "upcoming"){
182 print '<thead>';
183 if (!isset($globalNoAirlines) || $globalNoAirlines === FALSE) {
184 if ($_GET['sort'] == "airline_name_asc")
186 print '<th class="logo"><a href="'.$page_url.'/'.$limit_start.','.$limit_end.'/airline_name_desc" class="active">'._("Airline").'</a> <i class="fa fa-caret-up"></i></th>';
187 } else if ($_GET['sort'] == "airline_name_desc")
189 print '<th class="logo"><a href="'.$page_url.'/'.$limit_start.','.$limit_end.'/airline_name_asc" class="active">'._("Airline").'</a> <i class="fa fa-caret-down"></i></th>';
190 } else {
191 print '<th class="logo"><a href="'.$page_url.'/'.$limit_start.','.$limit_end.'/airline_name_asc">'._("Airline").'</a> <i class="fa fa-sort small"></i></th>';
194 if (!isset($globalNoIdents) || $globalNoIdents === FALSE) {
195 if ($_GET['sort'] == "ident_asc")
197 print '<th class="ident"><a href="'.$page_url.'/'.$limit_start.','.$limit_end.'/ident_desc" class="active">'._("Ident").'</a> <i class="fa fa-caret-up"></i></th>';
198 } else if ($_GET['sort'] == "ident_desc")
200 print '<th class="ident"><a href="'.$page_url.'/'.$limit_start.','.$limit_end.'/ident_asc" class="active">'._("Ident").'</a> <i class="fa fa-caret-down"></i></th>';
201 } else {
202 print '<th class="ident"><a href="'.$page_url.'/'.$limit_start.','.$limit_end.'/ident_asc">'._("Ident").'</a> <i class="fa fa-sort small"></i></th>';
205 if ($_GET['sort'] == "airport_departure_asc")
207 print '<th class="departure"><a href="'.$page_url.'/'.$limit_start.','.$limit_end.'/airport_departure_desc" class="active"><span class="nomobile">'._("Coming from").'</span><span class="mobile">'._("From").'</span></a> <i class="fa fa-caret-up"></i></th>';
208 } else if ($_GET['sort'] == "airport_departure_desc")
210 print '<th class="departure"><a href="'.$page_url.'/'.$limit_start.','.$limit_end.'/airport_departure_asc" class="active"><span class="nomobile">'._("Coming from").'</span><span class="mobile">'._("From").'</span></a> <i class="fa fa-caret-down"></i></th>';
211 } else {
212 print '<th class="departure"><a href="'.$page_url.'/'.$limit_start.','.$limit_end.'/airport_departure_asc"><span class="nomobile">'._("Coming from").'</span><span class="mobile">'._("From").'</span></a> <i class="fa fa-sort small"></i></th>';
214 if ($_GET['sort'] == "airport_arrival_asc")
216 print '<th class="arrival"><a href="'.$page_url.'/'.$limit_start.','.$limit_end.'/airport_arrival_desc" class="active"><span class="nomobile">'._("Flying to").'</span><span class="mobile">'._("To").'</span></a> <i class="fa fa-caret-up"></i></th>';
217 } else if ($_GET['sort'] == "airport_arrival_desc")
219 print '<th class="arrival"><a href="'.$page_url.'/'.$limit_start.','.$limit_end.'/airport_arrival_asc" class="active"><span class="nomobile">'._("Flying to").'</span><span class="mobile">'._("To").'</span></a> <i class="fa fa-caret-down"></i></th>';
220 } else {
221 print '<th class="arrival"><a href="'.$page_url.'/'.$limit_start.','.$limit_end.'/airport_arrival_asc"><span class="nomobile">'._("Flying to").'</span><span class="mobile">'._("To").'</span></a> <i class="fa fa-sort small"></i></th>';
224 if ($_GET['sort'] == "date_asc")
226 print '<th class="time"><a href="'.$page_url.'/'.$limit_start.','.$limit_end.'/date_desc" class="active">'._("Expected Time").'</a> <i class="fa fa-caret-up"></i></th>';
227 } else if ($_GET['sort'] == "date_desc")
229 print '<th class="time"><a href="'.$page_url.'/'.$limit_start.','.$limit_end.'/date_asc" class="active">'._("Expected Time").'</a> <i class="fa fa-caret-down"></i></th>';
230 } else {
231 print '<th class="time"><a href="'.$page_url.'/'.$limit_start.','.$limit_end.'/date_asc">'._("Expected Time").'</a> <i class="fa fa-sort small"></i></th>';
234 print '</thead>';
235 } else if (strtolower($current_page) == "acars-latest" || strtolower($current_page) == "acars-archive"){
236 print '<thead>';
237 print '<th class="aircraft_thumbnail"></th>';
238 print '<th class="logo">'._("Airline").'</th>';
239 print '<th class="ident">'._("Ident").'</th>';
240 print '<th class="message">'._("Message").'</th>';
241 print '<th class="time">'._("Date").'</th>';
242 print '<th class="more"></th>';
243 print '</thead>';
244 } else if (strtolower($current_page) == "accident-latest" || strtolower($current_page) == "accident-detailed") {
245 print '<thead>';
246 print '<th class="aircraft_thumbnail"></th>';
247 print '<th class="logo">'._("Airline").'</th>';
248 print '<th class="ident">'._("Ident").'</th>';
249 print '<th class="type">'._("Aircraft").'</th>';
250 print '<th class="owner">'._("Owner").'</th>';
251 // print '<th class="acctype">'._("Type").'</th>';
252 print '<th class="fatalities">'._("Fatalities").'</th>';
253 print '<th class="message">'._("Message").'</th>';
254 print '<th class="time">'._("Date").'</th>';
255 print '<th class="more"></th>';
256 print '</thead>';
257 } else if (strtolower($current_page) == "incident-latest" || strtolower($current_page) == "incident-detailed") {
258 print '<thead>';
259 print '<th class="aircraft_thumbnail"></th>';
260 print '<th class="logo">'._("Airline").'</th>';
261 print '<th class="ident">'._("Ident").'</th>';
262 print '<th class="type">'._("Aircraft").'</th>';
263 print '<th class="owner">'._("Owner").'</th>';
264 // print '<th class="acctype">'._("Type").'</th>';
265 // print '<th class="fatalities">'._("Fatalities").'</th>';
266 print '<th class="message">'._("Message").'</th>';
267 print '<th class="time">'._("Date").'</th>';
268 print '<th class="more"></th>';
269 print '</thead>';
270 } else {
272 if ($hide_th_links === true){
273 print '<thead>';
274 if ($type == 'marine' && isset($globalVM) && $globalVM) {
275 print '<th class="rank">'._("Rank").'</th>';
277 print '<th class="aircraft_thumbnail"></th>';
278 if ($type == 'aircraft') {
279 if (!isset($globalNoAirlines) || $globalNoAirlines === FALSE) {
280 if ($_GET['sort'] == "airline_name_asc")
282 print '<th class="logo">'._("Airline").'</th>';
283 } else if ($_GET['sort'] == "airline_name_desc")
285 print '<th class="logo">'._("Airline").'</th>';
286 } else {
287 print '<th class="logo">'._("Airline").'</th>';
291 if (!isset($globalNoIdents) || $globalNoIdents === FALSE) {
292 if ($_GET['sort'] == "ident_asc")
294 print '<th class="ident">'._("Ident").'</th>';
295 } else if ($_GET['sort'] == "ident_desc")
297 print '<th class="ident">'._("Ident").'</th>';
298 } else {
299 print '<th class="ident">'._("Ident").'</th>';
302 if ($type == 'aircraft') {
303 if ($_GET['sort'] == "aircraft_asc")
305 print '<th class="type">'._("Aircraft").'</th>';
306 } else if ($_GET['sort'] == "aircraft_desc")
308 print '<th class="type">'._("Aircraft").'</th>';
309 } else {
310 print '<th class="type">'._("Aircraft").'</th>';
312 } elseif ($type == 'marine') {
313 if ($_GET['sort'] == "type_asc")
315 print '<th class="type">'._("Type").'</th>';
316 } else if ($_GET['sort'] == "type_desc")
318 print '<th class="type">'._("Type").'</th>';
319 } else {
320 print '<th class="type">'._("Type").'</th>';
322 } elseif ($type == 'tracker') {
323 if ($_GET['sort'] == "type_asc")
325 print '<th class="type">'._("Type").'</th>';
326 } else if ($_GET['sort'] == "type_desc")
328 print '<th class="type">'._("Type").'</th>';
329 } else {
330 print '<th class="type">'._("Type").'</th>';
333 if ($type == 'aircraft') {
334 if ($_GET['sort'] == "airport_departure_asc")
336 print '<th class="departure"><span class="nomobile">'._("Coming from").'</span><span class="mobile">'._("From").'</span></th>';
337 } else if ($_GET['sort'] == "airport_departure_desc")
339 print '<th class="departure"><span class="nomobile">'._("Coming from").'</span><span class="mobile">'._("From").'</span></th>';
340 } else {
341 print '<th class="departure"><span class="nomobile">'._("Coming from").'</span><span class="mobile">'._("From").'</span></th>';
344 if ($type == 'aircraft' || $type == 'marine') {
345 if (isset($globalVM) && $globalVM && $type == 'marine') {
346 if ($_GET['sort'] == "race_asc")
348 print '<th class="arrival">'._("Race").''._("To").'</th>';
349 } else if ($_GET['sort'] == "race_desc")
351 print '<th class="arrival"><'._("Race").'</th>';
352 } else {
353 print '<th class="arrival">'._("Race").'</th>';
355 print '<th class="status">'._("Status").'</th>';
356 } else {
357 if ($_GET['sort'] == "airport_arrival_asc")
359 print '<th class="arrival"><span class="nomobile">'._("Going to").'</span><span class="mobile">'._("To").'</span></th>';
360 } else if ($_GET['sort'] == "airport_arrival_desc")
362 print '<th class="arrival"><span class="nomobile">'._("Going to").'</span><span class="mobile">'._("To").'</span></th>';
363 } else {
364 print '<th class="arrival"><span class="nomobile">'._("Going to").'</span><span class="mobile">'._("To").'</span></th>';
368 if ($type == 'aircraft') {
369 if ((isset($globalUsePilot) && $globalUsePilot) || (!isset($globalUsePilot) && ((isset($globalVA) && $globalVA) || (isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalVAM) && $globalVAM) || (isset($globalphpVMS) && $globalphpVMS)))) {
370 print '<th class="pilot"><span class="nomobile">'._("Pilot name").'</span><span class="mobile">'._("Pilot").'</span></a></th>';
372 if ((isset($globalUseOwner) && $globalUseOwner) || (!isset($globalUseOwner) && (!isset($globalVA) || !$globalVA) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS) && (!isset($globalVAM) || !$globalVAM))) {
373 print '<th class="owner"><span class="nomobile">'._("Owner name").'</span><span class="mobile">'._("Owner").'</span></a></th>';
375 if ($showRouteStop) {
376 print '<th class="route"><span class="nomobile">'._("Route").'</span><span class="mobile">'._("Route").'</span></th>';
379 if ($type == 'marine' && isset($globalVM) && $globalVM && $showDistance) {
380 if ($_GET['sort'] == "distance_asc")
382 print '<th class="distance">'._("Distance").'</th>';
383 } elseif ($_GET['sort'] == "distance_desc")
385 print '<th class="distance">'._("Distance").'</th>';
386 } else {
387 print '<th class="distance">'._("Distance").'</th>';
389 print '<th class="captain"><span class="nomobile">'._("Captain name").'</span><span class="mobile">'._("Captain").'</span></a></th>';
391 if ($type == 'tracker') {
392 print '<th class="comment"><span class="nomobile">'._("Comment").'</span><span class="mobile">'._("Comment").'</span></th>';
394 if ($showDuration && $type == 'marine' && isset($globalVM) && $globalVM === TRUE) {
395 print '<th class="duration"><span class="nomobile">'._("Race duration").'</span><span class="mobile">'._("Race duration").'</span></th>';
396 } elseif ($showDuration && strtolower($current_page) != "currently") {
397 print '<th class="duration"><span class="nomobile">'._("Spotted duration").'</span><span class="mobile">'._("Duration").'</span></th>';
399 if (strtolower($current_page) == "date")
401 if ($_GET['sort'] == "date_asc")
403 print '<th class="time">'._("Time").'</th>';
404 } else if ($_GET['sort'] == "date_desc")
406 print '<th class="time">'._("Time").'</th>';
407 } else {
408 print '<th class="time">'._("Time").'</th>';
410 } elseif (strtolower($current_page) == "currently") {
411 if ($_GET['sort'] == "date_asc")
413 print '<th class="time">'._("Date last seen").'</th>';
414 } else if ($_GET['sort'] == "date_desc")
416 print '<th class="time">'._("Date last seen").'</th>';
417 } else {
418 print '<th class="time">'._("Date last seen").'</th>';
420 } else {
421 if ($_GET['sort'] == "date_asc")
423 print '<th class="time">'._("Date").'</th>';
424 } else if ($_GET['sort'] == "date_desc")
426 print '<th class="time">'._("Date").'</th>';
427 } else {
428 print '<th class="time">'._("Date").'</th>';
431 print '<th class="more"></th>';
432 print '</thead>';
433 } else {
434 print '<thead>';
435 if ($type == 'marine' && isset($globalVM) && $globalVM) {
436 print '<th class="rank">'._("Rank").'</th>';
438 print '<th class="aircraft_thumbnail"></th>';
439 if ($type == 'aircraft') {
440 if (!isset($globalNoAirlines) || $globalNoAirlines === FALSE) {
441 if ($_GET['sort'] == "airline_name_asc")
443 print '<th class="logo"><a href="'.$page_url.'/'.$limit_start.','.$limit_end.'/airline_name_desc" class="active">'._("Airline").'</a> <i class="fa fa-caret-up"></i></th>';
444 } else if ($_GET['sort'] == "airline_name_desc")
446 print '<th class="logo"><a href="'.$page_url.'/'.$limit_start.','.$limit_end.'/airline_name_asc" class="active">'._("Airline").'</a> <i class="fa fa-caret-down"></i></th>';
447 } else {
448 print '<th class="logo"><a href="'.$page_url.'/'.$limit_start.','.$limit_end.'/airline_name_asc">'._("Airline").'</a> <i class="fa fa-sort small"></i></th>';
452 if (!isset($globalNoIdents) || $globalNoIdents === FALSE) {
453 if ($_GET['sort'] == "ident_asc")
455 print '<th class="ident"><a href="'.$page_url.'/'.$limit_start.','.$limit_end.'/ident_desc" class="active">'._("Ident").'</a> <i class="fa fa-caret-up"></i></th>';
456 } else if ($_GET['sort'] == "ident_desc")
458 print '<th class="ident"><a href="'.$page_url.'/'.$limit_start.','.$limit_end.'/ident_asc" class="active">'._("Ident").'</a> <i class="fa fa-caret-down"></i></th>';
459 } else {
460 print '<th class="ident"><a href="'.$page_url.'/'.$limit_start.','.$limit_end.'/ident_asc">'._("Ident").'</a> <i class="fa fa-sort small"></i></th>';
463 if ($type == 'aircraft') {
464 if ($_GET['sort'] == "aircraft_asc")
466 print '<th class="type"><a href="'.$page_url.'/'.$limit_start.','.$limit_end.'/aircraft_desc" class="active">'._("Aircraft").'</a> <i class="fa fa-caret-up"></i></th>';
467 } else if ($_GET['sort'] == "aircraft_desc")
469 print '<th class="type"><a href="'.$page_url.'/'.$limit_start.','.$limit_end.'/aircraft_asc" class="active">'._("Aircraft").'</a> <i class="fa fa-caret-down"></i></th>';
470 } else {
471 print '<th class="type"><a href="'.$page_url.'/'.$limit_start.','.$limit_end.'/aircraft_asc">'._("Aircraft").'</a> <i class="fa fa-sort small"></i></th>';
473 } elseif ($type == 'marine' || $type == 'tracker') {
474 if ($_GET['sort'] == "type_asc")
476 print '<th class="type"><a href="'.$page_url.'/'.$limit_start.','.$limit_end.'/type_desc" class="active">'._("Type").'</a> <i class="fa fa-caret-up"></i></th>';
477 } else if ($_GET['sort'] == "type_desc")
479 print '<th class="type"><a href="'.$page_url.'/'.$limit_start.','.$limit_end.'/type_asc" class="active">'._("Type").'</a> <i class="fa fa-caret-down"></i></th>';
480 } else {
481 print '<th class="type"><a href="'.$page_url.'/'.$limit_start.','.$limit_end.'/type_asc">'._("Type").'</a> <i class="fa fa-sort small"></i></th>';
484 if ($type == 'aircraft') {
485 if ($_GET['sort'] == "airport_departure_asc")
487 print '<th class="departure"><a href="'.$page_url.'/'.$limit_start.','.$limit_end.'/airport_departure_desc" class="active"><span class="nomobile">'._("Coming from").'</span><span class="mobile">'._("From").'</span></a> <i class="fa fa-caret-up"></i></th>';
488 } else if ($_GET['sort'] == "airport_departure_desc")
490 print '<th class="departure"><a href="'.$page_url.'/'.$limit_start.','.$limit_end.'/airport_departure_asc" class="active"><span class="nomobile">'._("Coming from").'</span><span class="mobile">'._("From").'</span></a> <i class="fa fa-caret-down"></i></th>';
491 } else {
492 print '<th class="departure"><a href="'.$page_url.'/'.$limit_start.','.$limit_end.'/airport_departure_asc"><span class="nomobile">'._("Coming from").'</span><span class="mobile">'._("From").'</span></a> <i class="fa fa-sort small"></i></th>';
495 if ($type == 'aircraft' || $type == 'marine') {
496 if (isset($globalVM) && $globalVM && $type == 'marine') {
497 if ($_GET['sort'] == "race_asc")
499 print '<th class="arrival"><a href="'.$page_url.'/'.$limit_start.','.$limit_end.'/race_desc" class="active">'._("Race").'</a> <i class="fa fa-caret-up"></i></th>';
500 } else if ($_GET['sort'] == "race_desc")
502 print '<th class="arrival"><a href="'.$page_url.'/'.$limit_start.','.$limit_end.'/race_asc" class="active">'._("Race").'</a> <i class="fa fa-caret-down"></i></th>';
503 } else {
504 print '<th class="arrival"><a href="'.$page_url.'/'.$limit_start.','.$limit_end.'/race_asc">'._("Race").'</a> <i class="fa fa-sort small"></i></th>';
506 print '<th class="status">'._("Status").'</th>';
507 } else {
508 if ($_GET['sort'] == "airport_arrival_asc")
510 print '<th class="arrival"><a href="'.$page_url.'/'.$limit_start.','.$limit_end.'/airport_arrival_desc" class="active"><span class="nomobile">'._("Going to").'</span><span class="mobile">'._("To").'</span></a> <i class="fa fa-caret-up"></i></th>';
511 } else if ($_GET['sort'] == "airport_arrival_desc")
513 print '<th class="arrival"><a href="'.$page_url.'/'.$limit_start.','.$limit_end.'/airport_arrival_asc" class="active"><span class="nomobile">'._("Going to").'</span><span class="mobile">'._("To").'</span></a> <i class="fa fa-caret-down"></i></th>';
514 } else {
515 print '<th class="arrival"><a href="'.$page_url.'/'.$limit_start.','.$limit_end.'/airport_arrival_asc"><span class="nomobile">'._("Going to").'</span><span class="mobile">'._("To").'</span></a> <i class="fa fa-sort small"></i></th>';
519 if ($type == 'aircraft') {
520 if ((isset($globalUsePilot) && $globalUsePilot) || !isset($globalUsePilot) && ((isset($globalVA) && $globalVA) || (isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS) || (isset($globalVAM) && $globalVAM))) {
521 print '<th class="pilot"><span class="nomobile">'._("Pilot name").'</span><span class="mobile">'._("Pilot").'</span></a></th>';
523 if ((isset($globalUseOwner) && $globalUseOwner) || (!isset($globalUseOwner) && (!isset($globalVA) || !$globalVA) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS) && (!isset($globalVAM) || !$globalVAM))) {
524 print '<th class="owner"><span class="nomobile">'._("Owner name").'</span><span class="mobile">'._("Owner").'</span></a></th>';
526 if ($showRouteStop) {
527 print '<th class="route"><span class="nomobile">'._("Route").'</span><span class="mobile">'._("Route").'</span></th>';
530 if ($type == 'marine' && isset($globalVM) && $globalVM) {
531 if ($showDistance) {
532 if ($_GET['sort'] == "distance_asc")
534 print '<th class="distance"><a href="'.$page_url.'/'.$limit_start.','.$limit_end.'/distance_desc" class="active">'._("Distance").'</a> <i class="fa fa-caret-up"></i></th>';
535 } elseif ($_GET['sort'] == "distance_desc")
537 print '<th class="distance"><a href="'.$page_url.'/'.$limit_start.','.$limit_end.'/distance_asc" class="active">'._("Distance").'</a> <i class="fa fa-caret-down"></i></th>';
538 } else {
539 print '<th class="distance"><a href="'.$page_url.'/'.$limit_start.','.$limit_end.'/distance_desc">'._("Distance").'</a> <i class="fa fa-sort small"></i></th>';
542 print '<th class="captain"><span class="nomobile">'._("Captain name").'</span><span class="mobile">'._("Captain").'</span></a></th>';
544 if ($type == 'tracker') {
545 print '<th class="comment"><span class="nomobile">'._("Comment").'</span><span class="mobile">'._("Comment").'</span></th>';
547 if ($showDuration && $type == 'marine' && isset($globalVM) && $globalVM === TRUE) {
548 print '<th class="duration"><span class="nomobile">'._("Race duration").'</span><span class="mobile">'._("Race duration").'</span></th>';
549 } elseif ($showDuration && strtolower($current_page) != "currently") {
550 print '<th class="duration"><span class="nomobile">'._("Spotted duration").'</span><span class="mobile">'._("Duration").'</span></th>';
552 if (strtolower($current_page) == "date")
554 if ($_GET['sort'] == "date_asc")
556 print '<th class="time"><a href="'.$page_url.'/'.$limit_start.','.$limit_end.'/date_desc" class="active">'._("Time").'</a> <i class="fa fa-caret-up"></i></th>';
557 } else if ($_GET['sort'] == "date_desc")
559 print '<th class="time"><a href="'.$page_url.'/'.$limit_start.','.$limit_end.'/date_asc" class="active">'._("Time").'</a> <i class="fa fa-caret-down"></i></th>';
560 } else {
561 print '<th class="time"><a href="'.$page_url.'/'.$limit_start.','.$limit_end.'/date_asc">'._("Time").'</a> <i class="fa fa-sort small"></i></th>';
563 } elseif (strtolower($current_page) == "currently") {
564 if ($_GET['sort'] == "date_asc")
566 print '<th class="time"><a href="'.$page_url.'/'.$limit_start.','.$limit_end.'/date_desc" class="active">'._("Date last seen").'</a> <i class="fa fa-caret-up"></i></th>';
567 } else if ($_GET['sort'] == "date_desc")
569 print '<th class="time"><a href="'.$page_url.'/'.$limit_start.','.$limit_end.'/date_asc" class="active">'._("Date last seen").'</a> <i class="fa fa-caret-down"></i></th>';
570 } else {
571 print '<th class="time"><a href="'.$page_url.'/'.$limit_start.','.$limit_end.'/date_asc">'._("Date last seen").'</a> <i class="fa fa-sort small"></i></th>';
573 } else {
574 if ($_GET['sort'] == "date_asc")
576 print '<th class="time"><a href="'.$page_url.'/'.$limit_start.','.$limit_end.'/date_desc" class="active">'._("Date").'</a> <i class="fa fa-caret-up"></i></th>';
577 } else if ($_GET['sort'] == "date_desc")
579 print '<th class="time"><a href="'.$page_url.'/'.$limit_start.','.$limit_end.'/date_asc" class="active">'._("Date").'</a> <i class="fa fa-caret-down"></i></th>';
580 } else {
581 print '<th class="time"><a href="'.$page_url.'/'.$limit_start.','.$limit_end.'/date_asc">'._("Date").'</a> <i class="fa fa-sort small"></i></th>';
584 print '<th class="more"></th>';
585 print '</thead>';
589 print '<tbody>'."\n";
590 foreach($spotter_array as $spotter_item)
592 if (isset($globalTimezone))
594 date_default_timezone_set($globalTimezone);
595 } else date_default_timezone_set('UTC');
596 if ($showSpecial === true)
598 print '<tr class="special">'."\n";
599 print '<td colspan="10"><h4>'.$spotter_item['registration'].' - '.$spotter_item['highlight'].'</h4></td>'."\n";
600 print '</tr>'."\n";
602 if (strtolower($current_page) == "upcoming" && isset($spotter_item['date_iso_8601']) && date("ga") == date("ga", strtotime($spotter_item['date_iso_8601'])))
604 print '<tr class="currentHour">';
605 } else {
606 if (isset($spotter_item['spotted'])) {
607 print '<tr class="active">';
608 } elseif (isset($spotter_item['spotted_registration'])) {
609 print '<tr class="info">';
610 } else print '<tr>';
612 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") {
613 if ($type == 'aircraft') {
614 if (isset($spotter_item['image_thumbnail']) && $spotter_item['image_thumbnail'] != "")
616 print '<td class="aircraft_thumbnail">'."\n";
617 if ($spotter_item['image_source'] == 'planespotters') {
618 if ($spotter_item['image_source_website'] != '') $image_src = $spotter_item['image_source_website'];
619 else {
620 $planespotter_url_array = explode("_", $spotter_item['image']);
621 $planespotter_id = str_replace(".jpg", "", $planespotter_url_array[1]);
622 $image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id;
624 if (isset($spotter_item['airline_name'])) {
625 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">&copy; '.$spotter_item['image_copyright'].'</div>';
626 } else {
627 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">&copy; '.$spotter_item['image_copyright'].'</div>';
629 } else {
630 if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') {
631 $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']);
632 } else $image_thumbnail = $spotter_item['image_thumbnail'];
633 if (isset($spotter_item['airline_name'])) {
634 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">&copy; '.$spotter_item['image_copyright'].'</div>';
635 } else {
636 print '<img src="'.$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" />'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
639 print '</td>'."\n";
640 } else {
641 print '<td class="aircraft_thumbnail">'."\n";
642 print '<img src="'.$globalURL.'/images/placeholder_thumb.png" 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" />'."\n";
643 print '</td>'."\n";
645 } elseif ($type == 'marine') {
646 if (isset($globalVM) && $globalVM) {
647 if (!isset($spotter_item['race_rank'])) {
648 print '<td class="rank"></td>'."\n";
649 } else {
650 print '<td class="rank">'.$spotter_item['race_rank'].'</td>'."\n";
653 if (isset($spotter_item['image_thumbnail']) && $spotter_item['image_thumbnail'] != "")
655 print '<td class="aircraft_thumbnail">'."\n";
656 if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') {
657 $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']);
658 } else $image_thumbnail = $spotter_item['image_thumbnail'];
659 if (isset($spotter_item['mmsi']) && $spotter_item['mmsi'] != '') {
660 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">&copy; '.$spotter_item['image_copyright'].'</div>';
661 } else {
662 print '<img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['ident'].'" alt="'.$spotter_item['ident'].'" data-content="'._("Ident:").' '.$spotter_item['ident'].'" data-html="true" width="100px" />'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
664 print '</td>'."\n";
665 } else {
666 print '<td class="aircraft_thumbnail">'."\n";
667 if (isset($spotter_item['mmsi']) && $spotter_item['mmsi'] != '') {
668 print '<img src="'.$globalURL.'/images/placeholder_marine_thumb.png" 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";
669 } else {
670 print '<img src="'.$globalURL.'/images/placeholder_marine_thumb.png" class="img-rounded" data-toggle="popover" title="'.$spotter_item['ident'].'" alt="'.$spotter_item['ident'].'" data-content="'._("Ident:").' '.$spotter_item['ident'].'" data-html="true" width="100px" />'."\n";
672 print '</td>'."\n";
674 } elseif ($type == 'tracker') {
675 if (isset($spotter_item['image_thumbnail']) && $spotter_item['image_thumbnail'] != "")
677 print '<td class="aircraft_thumbnail">'."\n";
678 if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') {
679 $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']);
680 } else $image_thumbnail = $spotter_item['image_thumbnail'];
681 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">&copy; '.$spotter_item['image_copyright'].'</div>';
682 print '</td>'."\n";
683 } else {
684 print '<td class="aircraft_thumbnail">'."\n";
685 if ($spotter_item['type'] == 'Truck' || $spotter_item['type'] == 'Truck (18 Wheeler)') {
686 print '<img src="'.$globalURL.'/images/placeholder_truck_thumb.png" 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";
687 } elseif ($spotter_item['type'] == 'Car') {
688 print '<img src="'.$globalURL.'/images/placeholder_car_thumb.png" 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";
689 } elseif ($spotter_item['type'] == 'Jogger') {
690 print '<img src="'.$globalURL.'/images/placeholder_pedestrian_thumb.png" 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";
691 } elseif ($spotter_item['type'] == 'Phone') {
692 print '<img src="'.$globalURL.'/images/placeholder_phone_thumb.png" 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";
693 } elseif ($spotter_item['type'] == 'Jeep') {
694 print '<img src="'.$globalURL.'/images/placeholder_jeep_thumb.png" 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";
695 } elseif ($spotter_item['type'] == 'Laptop') {
696 print '<img src="'.$globalURL.'/images/placeholder_laptop_thumb.png" 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";
697 } elseif ($spotter_item['type'] == 'Snowmobile') {
698 print '<img src="'.$globalURL.'/images/placeholder_snowmobile_thumb.png" 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";
699 } elseif ($spotter_item['type'] == 'Helicopter') {
700 print '<img src="'.$globalURL.'/images/placeholder_helicopter_thumb.png" 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";
701 } elseif ($spotter_item['type'] == 'Bike') {
702 print '<img src="'.$globalURL.'/images/placeholder_bike_thumb.png" 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";
703 } elseif ($spotter_item['type'] == 'Motorcycle') {
704 print '<img src="'.$globalURL.'/images/placeholder_motorbike_thumb.png" 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";
705 } elseif ($spotter_item['type'] == 'Balloon') {
706 print '<img src="'.$globalURL.'/images/placeholder_balloon_thumb.png" 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";
707 } elseif ($spotter_item['type'] == 'Bus') {
708 print '<img src="'.$globalURL.'/images/placeholder_bus_thumb.png" 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";
709 } elseif ($spotter_item['type'] == 'Ambulance') {
710 print '<img src="'.$globalURL.'/images/placeholder_ambulance_thumb.png" 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";
711 } elseif ($spotter_item['type'] == 'Police') {
712 print '<img src="'.$globalURL.'/images/placeholder_police_thumb.png" 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";
713 } elseif ($spotter_item['type'] == 'Van') {
714 print '<img src="'.$globalURL.'/images/placeholder_van_thumb.png" 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";
715 } elseif ($spotter_item['type'] == 'Railroad Engine') {
716 print '<img src="'.$globalURL.'/images/placeholder_rail_thumb.png" 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";
717 } else {
718 print '<img src="'.$globalURL.'/images/placeholder_antenna_thumb.png" 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";
720 print '</td>'."\n";
723 } 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"){
724 if ($type == 'aircraft') {
725 if (!isset($spotter_item['squawk']) || $spotter_item['squawk'] == 0) {
726 $spotter_item['squawk'] = '-';
728 if ($spotter_item['image_thumbnail'] != "")
730 print '<td class="aircraft_thumbnail">'."\n";
731 //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>';
732 if ($spotter_item['image_source'] == 'planespotters') {
733 if ($spotter_item['image_source_website'] != '') $image_src = $spotter_item['image_source_website'];
734 else {
735 $planespotter_url_array = explode("_", $spotter_array[0]['image']);
736 $planespotter_id = str_replace(".jpg", "", $planespotter_url_array[1]);
737 $image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id;
739 if (!isset($spotter_item['airline_name']) && isset($spotter_item['aircraft_name'])) {
740 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">&copy; '.$spotter_item['image_copyright'].'</div>';
741 } elseif (!isset($spotter_item['aircraft_name']) && isset($spotter_item['airline_name'])) {
742 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">&copy; '.$spotter_item['image_copyright'].'</div>';
743 } elseif (!isset($spotter_item['aircraft_name']) && !isset($spotter_item['airline_name'])) {
744 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">&copy; '.$spotter_item['image_copyright'].'</div>';
745 } else {
746 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">&copy; '.$spotter_item['image_copyright'].'</div>';
748 } else {
749 if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') {
750 $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']);
751 } else $image_thumbnail = $spotter_item['image_thumbnail'];
752 if (!isset($spotter_item['airline_name']) && isset($spotter_item['aircraft_name'])) {
753 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">&copy; '.$spotter_item['image_copyright'].'</div>';
754 } elseif (!isset($spotter_item['aircraft_name']) && isset($spotter_item['airline_name'])) {
755 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'].' - '.$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">&copy; '.$spotter_item['image_copyright'].'</div>';
756 } elseif (!isset($spotter_item['aircraft_name']) && !isset($spotter_item['airline_name'])) {
757 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_type'].')<br />Airline: Not available<br />Squawk: '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
758 } else {
759 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'].' - '.$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">&copy; '.$spotter_item['image_copyright'].'</div>';
762 print '</td>'."\n";
763 } else {
764 print '<td class="aircraft_thumbnail">'."\n";
765 // 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>';
767 if (!isset($spotter_item['airline_name']) && !isset($spotter_item['aircraft_name'])) {
768 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";
769 } elseif (!isset($spotter_item['aircraft_name'])) {
770 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'].' - '.$spotter_item['airline_name'].'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '.$spotter_item['airline_name'].'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' '._("Not available").' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '.$spotter_item['airline_name'].'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n";
771 } elseif (!isset($spotter_item['airline_name'])) {
772 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:").' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '._("Not available").'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n";
773 } else {
774 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'].' - '.$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";
776 print '</td>'."\n";
778 } elseif ($type == 'marine') {
779 if (isset($globalVM) && $globalVM) {
780 if (!isset($spotter_item['race_rank'])) {
781 print '<td class="rank"></td>'."\n";
782 } else {
783 print '<td class="rank">'.$spotter_item['race_rank'].'</td>'."\n";
786 if (isset($spotter_item['image_thumbnail']) && $spotter_item['image_thumbnail'] != "")
788 print '<td class="aircraft_thumbnail">'."\n";
789 if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') {
790 $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']);
791 } else $image_thumbnail = $spotter_item['image_thumbnail'];
792 if (isset($spotter_item['mmsi']) && $spotter_item['mmsi'] != '') {
793 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";
794 if ($spotter_item['image_copyright'] != '') print '<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
795 } else {
796 print '<img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['ident'].'" alt="'.$spotter_item['ident'].'" data-content="'._("Ident:").' '.$spotter_item['ident'].'" data-html="true" width="100px" />'."\n";
797 if ($spotter_item['image_copyright'] != '') print '<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
799 print '</td>'."\n";
800 } else {
801 print '<td class="aircraft_thumbnail">'."\n";
802 if (isset($spotter_item['mmsi']) && $spotter_item['mmsi'] != '') {
803 print '<img src="'.$globalURL.'/images/placeholder_marine_thumb.png" 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";
804 } else {
805 print '<img src="'.$globalURL.'/images/placeholder_marine_thumb.png" class="img-rounded" data-toggle="popover" title="'.$spotter_item['ident'].'" alt="'.$spotter_item['ident'].'" data-content="'._("Ident:").' '.$spotter_item['ident'].'" data-html="true" width="100px" />'."\n";
807 print '</td>'."\n";
809 } elseif ($type == 'tracker') {
810 if (isset($spotter_item['image_thumbnail']) && $spotter_item['image_thumbnail'] != "")
812 print '<td class="aircraft_thumbnail">'."\n";
813 if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') {
814 $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']);
815 } else $image_thumbnail = $spotter_item['image_thumbnail'];
816 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">&copy; '.$spotter_item['image_copyright'].'</div>';
817 print '</td>'."\n";
818 } else {
819 print '<td class="aircraft_thumbnail">'."\n";
820 if ($spotter_item['type'] == 'Truck' || $spotter_item['type'] == 'Truck (18 Wheeler)') {
821 print '<img src="'.$globalURL.'/images/placeholder_truck_thumb.png" 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";
822 } elseif ($spotter_item['type'] == 'Car') {
823 print '<img src="'.$globalURL.'/images/placeholder_car_thumb.png" 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";
824 } elseif ($spotter_item['type'] == 'Jogger') {
825 print '<img src="'.$globalURL.'/images/placeholder_pedestrian_thumb.png" 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";
826 } elseif ($spotter_item['type'] == 'Phone') {
827 print '<img src="'.$globalURL.'/images/placeholder_phone_thumb.png" 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";
828 } elseif ($spotter_item['type'] == 'Jeep') {
829 print '<img src="'.$globalURL.'/images/placeholder_jeep_thumb.png" 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";
830 } elseif ($spotter_item['type'] == 'Laptop') {
831 print '<img src="'.$globalURL.'/images/placeholder_laptop_thumb.png" 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";
832 } elseif ($spotter_item['type'] == 'Snowmobile') {
833 print '<img src="'.$globalURL.'/images/placeholder_snowmobile_thumb.png" 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";
834 } elseif ($spotter_item['type'] == 'Helicopter') {
835 print '<img src="'.$globalURL.'/images/placeholder_helicopter_thumb.png" 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";
836 } elseif ($spotter_item['type'] == 'Bike') {
837 print '<img src="'.$globalURL.'/images/placeholder_bike_thumb.png" 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";
838 } elseif ($spotter_item['type'] == 'Motorcycle') {
839 print '<img src="'.$globalURL.'/images/placeholder_motorbike_thumb.png" 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";
840 } elseif ($spotter_item['type'] == 'Balloon') {
841 print '<img src="'.$globalURL.'/images/placeholder_balloon_thumb.png" 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";
842 } elseif ($spotter_item['type'] == 'Bus') {
843 print '<img src="'.$globalURL.'/images/placeholder_bus_thumb.png" 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";
844 } elseif ($spotter_item['type'] == 'Ambulance') {
845 print '<img src="'.$globalURL.'/images/placeholder_ambulance_thumb.png" 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";
846 } elseif ($spotter_item['type'] == 'Police') {
847 print '<img src="'.$globalURL.'/images/placeholder_police_thumb.png" 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";
848 } elseif ($spotter_item['type'] == 'Van') {
849 print '<img src="'.$globalURL.'/images/placeholder_van_thumb.png" 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";
850 } elseif ($spotter_item['type'] == 'Railroad Engine') {
851 print '<img src="'.$globalURL.'/images/placeholder_rail_thumb.png" 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";
852 } else {
853 print '<img src="'.$globalURL.'/images/placeholder_antenna_thumb.png" 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";
855 print '</td>'."\n";
859 if ($type == 'aircraft') {
860 if (!isset($globalNoAirlines) || $globalNoAirlines === FALSE) {
861 if (isset($globalIVAO) && $globalIVAO && (@getimagesize('images/airlines/'.$spotter_item['airline_icao'].'.gif') || @getimagesize($globalURL.'/images/airlines/'.$spotter_item['airline_icao'].'.gif')))
863 print '<td class="logo">'."\n";
864 print '<a href="'.$globalURL.'/airline/'.$spotter_item['airline_icao'].'"><img src="'.$globalURL.'/images/airlines/'.$spotter_item['airline_icao'].'.gif" alt="'._("Click to see airline information").'" title="'._("Click to see airline information").'" /></a>'."\n";
865 print '</td>'."\n";
866 } elseif ((!isset($globalIVAO) || !$globalIVAO) && (@getimagesize('images/airlines/'.$spotter_item['airline_icao'].'.png') || @getimagesize($globalURL.'/images/airlines/'.$spotter_item['airline_icao'].'.png')))
868 print '<td class="logo">'."\n";
869 print '<a href="'.$globalURL.'/airline/'.$spotter_item['airline_icao'].'"><img src="'.$globalURL.'/images/airlines/'.$spotter_item['airline_icao'].'.png" alt="'._("Click to see airline information").'" title="'._("Click to see airline information").'" /></a>'."\n";
870 print '</td>'."\n";
871 } else {
872 print '<td class="logo-no-image">'."\n";
873 if (isset($spotter_item['airline_icao']) && $spotter_item['airline_icao'] != 'NA')
875 print '<a href="'.$globalURL.'/airline/'.$spotter_item['airline_icao'].'">'.$spotter_item['airline_name'].'</a>'."\n";
876 } else {
877 print '<a href="'.$globalURL.'/airline/NA">'._("Not Available").'</a>'."\n";
879 print '</td>'."\n";
883 if (!isset($globalNoIdents) || $globalNoIdents === FALSE) {
884 // Aircraft ident
885 print '<td class="ident">'."\n";
886 if ($type == 'aircraft') {
887 if (isset($spotter_item['ident']) && $spotter_item['ident'] != "")
889 if ($spotter_item['ident'] == "NA") {
890 print '<a href="'.$globalURL.'/ident/'.$spotter_item['ident'].'">'._("Not available").'</a>'."\n";
891 } else {
892 print '<a href="'.$globalURL.'/ident/'.$spotter_item['ident'].'">'.$spotter_item['ident'].'</a>'."\n";
894 } else {
895 print '<a href="'.$globalURL.'/ident/NA">'._("Not available").'</a>'."\n";
897 } elseif ($type == 'marine') {
898 if (isset($spotter_item['ident']) && $spotter_item['ident'] != "")
900 if ($spotter_item['ident'] == "NA") {
901 print '<a href="'.$globalURL.'/marine/ident/'.$spotter_item['ident'].'">'._("Not available").'</a>'."\n";
902 } else {
903 print '<a href="'.$globalURL.'/marine/ident/'.$spotter_item['ident'].'">'.$spotter_item['ident'].'</a>'."\n";
905 } else {
906 print '<a href="'.$globalURL.'/marine/ident/NA">'._("Not available").'</a>'."\n";
908 } elseif ($type == 'tracker') {
909 if (isset($spotter_item['ident']) && $spotter_item['ident'] != "")
911 if ($spotter_item['ident'] == "NA") {
912 print '<a href="'.$globalURL.'/tracker/ident/'.$spotter_item['ident'].'">'._("Not available").'</a>'."\n";
913 } else {
914 print '<a href="'.$globalURL.'/tracker/ident/'.$spotter_item['ident'].'">'.$spotter_item['ident'].'</a>'."\n";
916 } else {
917 print '<a href="'.$globalURL.'/tracker/ident/NA">'._("Not available").'</a>'."\n";
920 print '</td>'."\n";
922 // Aircraft type
923 if(strtolower($current_page) != "upcoming" && strtolower($current_page) != "acars-latest" && strtolower($current_page) != "acars-archive"){
924 print '<td class="type">'."\n";
925 if ($type == 'aircraft') {
926 if (!isset($spotter_item['aircraft_type']) && isset($spotter_item['aircraft_name'])) {
927 print '<span class="nomobile">'.$spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name'].'</span>'."\n";
928 } elseif (!isset($spotter_item['aircraft_name']) || ($spotter_item['aircraft_manufacturer'] == 'N/A' && $spotter_item['aircraft_name'] == 'N/A')) {
929 //print '<span class="nomobile"><a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'._("Not available").'</a></span>'."\n";
930 print '<span class="nomobile"><a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_type'].'</a></span>'."\n";
931 } else {
932 $aircraft_names = explode('/',$spotter_item['aircraft_name']);
933 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";
934 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";
936 print '<span class="mobile"><a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_type'].'</a></span>'."\n";
937 } elseif ($type == 'marine') {
938 if (isset($spotter_item['type_id'])) {
939 if ($spotter_item['type'] == '') {
940 print '<span class="nomobile"><a href="'.$globalURL.'/marine/type/'.$spotter_item['type_id'].'">'._("Not available").'</a></span>'."\n";
941 } else {
942 print '<span class="nomobile"><a href="'.$globalURL.'/marine/type/'.$spotter_item['type_id'].'">'.$spotter_item['type'].'</a></span>'."\n";
944 print '<span class="mobile"><a href="'.$globalURL.'/marine/type/'.$spotter_item['type_id'].'">'.$spotter_item['type'].'</a></span>'."\n";
945 } else {
946 if ($spotter_item['type'] == '') {
947 print '<span class="nomobile">'._("Not available").'</span>'."\n";
948 } else {
949 print '<span class="nomobile">'.$spotter_item['type'].'</span>'."\n";
951 print '<span class="mobile">'.$spotter_item['type'].'</span>'."\n";
953 } elseif ($type == 'tracker') {
954 if ($spotter_item['type'] == '') {
955 print '<span class="nomobile">'._("Not available").'</span>'."\n";
956 } else {
957 print '<span class="nomobile">'.$spotter_item['type'].'</span>'."\n";
959 print '<span class="mobile">'.$spotter_item['type'].'</span>'."\n";
961 print '</td>'."\n";
963 if (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") {
964 if ($type == 'aircraft') {
965 // Departure Airport
966 print '<td class="departure_airport">'."\n";
967 if (!isset($spotter_item['departure_airport']) || !isset($spotter_item['departure_airport_city']) || (isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] == 'NA')) {
968 print '<span class="nomobile"><a href="'.$globalURL.'/airport/NA">'._("Not available").'</a></span>'."\n";
969 print '<span class="mobile"><a href="'.$globalURL.'/airport/NA">'._("Not available").'</a></span>'."\n";
970 } else {
971 print '<span class="nomobile"><a href="'.$globalURL.'/airport/'.$spotter_item['departure_airport'].'">'.$spotter_item['departure_airport_city'].', '.$spotter_item['departure_airport_country'].' ('.$spotter_item['departure_airport'].')</a></span>'."\n";
972 print '<span class="mobile"><a href="'.$globalURL.'/airport/'.$spotter_item['departure_airport'].'">'.$spotter_item['departure_airport'].'</a></span>'."\n";
974 if (isset($spotter_item['departure_airport_time']) && isset($spotter_item['real_departure_airport_time'])) {
975 if ($spotter_item['departure_airport_time'] > 2460) {
976 $departure_airport_time = date('H:m',$spotter_item['departure_airport_time']);
977 } else $departure_airport_time = substr($spotter_item['departure_airport_time'],0,-2).':'.substr($spotter_item['departure_airport_time'],-2);
978 if ($spotter_item['real_departure_airport_time'] > 2460) {
979 $real_departure_airport_time = date('H:m',$spotter_item['real_departure_airport_time']);
980 } else $real_departure_airport_time = $spotter_item['real_departure_airport_time'];
981 print '<br /><span class="airport_time">'.$departure_airport_time.' ('.$real_departure_airport_time.')</span>'."\n";
982 } elseif (isset($spotter_item['real_departure_airport_time']) && $spotter_item['real_departure_airport_time'] != 'NULL') {
983 if ($spotter_item['real_departure_airport_time'] > 2460) {
984 $real_departure_airport_time = date('H:m',$spotter_item['real_departure_airport_time']);
985 } else $real_departure_airport_time = $spotter_item['real_departure_airport_time'];
986 print '<br /><span class="airport_time">'.$real_departure_airport_time.'</span>'."\n";
987 } elseif (isset($spotter_item['departure_airport_time']) && $spotter_item['departure_airport_time'] != 'NULL') {
988 if ($spotter_item['departure_airport_time'] > 2460) {
989 $departure_airport_time = date('H:m',$spotter_item['departure_airport_time']);
990 } else {
991 $departure_airport_time = substr($spotter_item['departure_airport_time'],0,-2).':'.substr($spotter_item['departure_airport_time'],-2);
993 print '<br /><span class="airport_time">'.$departure_airport_time.'</span>'."\n";
995 if ($spotter_item['departure_airport'] != 'NA') {
996 if (isset($spotter_item['latitude']) && $spotter_item['latitude'] != 0 && isset($spotter_item['longitude']) && $spotter_item['longitude'] != 0) {
997 require_once(dirname(__FILE__).'/require/class.Spotter.php');
998 $Spotter = new Spotter();
999 if (isset($spotter_item['last_latitude']) && $spotter_item['last_latitude'] != '' && isset($spotter_item['last_longitude']) && $spotter_item['last_longitude'] != '') {
1000 $latitude = $spotter_item['last_latitude'];
1001 $longitude = $spotter_item['last_longitude'];
1002 } else {
1003 $latitude = $spotter_item['latitude'];
1004 $longitude = $spotter_item['longitude'];
1006 $distance = $Spotter->getAirportDistance($spotter_item['departure_airport'],$latitude,$longitude);
1007 } else $distance = '';
1008 if ($distance != '') {
1009 if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) {
1010 echo '<br/><i>'.round($distance*0.539957).' nm</i>';
1011 } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) {
1012 echo '<br/><i>'.round($distance*0.621371).' mi</i>';
1013 } elseif ((!isset($_COOKIE['unitdistance']) && ((isset($globalUnitDistance) && $globalUnitDistance == 'km') || !isset($globalUnitDistance))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) {
1014 echo '<br/><i>'.$distance.' km</i>';
1018 print '</td>'."\n";
1020 if ($type == 'aircraft') {
1021 // Arrival Airport
1022 print '<td class="arrival_airport">'."\n";
1023 if (!isset($spotter_item['arrival_airport']) || !isset($spotter_item['arrival_airport_city'])) {
1024 if (isset($spotter_item['real_arrival_airport']) && $spotter_item['real_arrival_airport'] != 'NA') {
1025 print '<span class="nomobile"><a href="'.$globalURL.'/airport/'.$spotter_item['real_arrival_airport'].'">'.$spotter_item['real_arrival_airport'].'</a></span>'."\n";
1026 print '<span class="mobile"><a href="'.$globalURL.'/airport/'.$spotter_item['real_arrival_airport'].'">'.$spotter_item['real_arrival_airport'].'</a></span>'."\n";
1027 } else {
1028 print '<span class="nomobile"><a href="'.$globalURL.'/airport/NA">'._("Not available").'</a></span>'."\n";
1029 print '<span class="mobile"><a href="'.$globalURL.'/airport/NA">'._("Not available").'</a></span>'."\n";
1031 } else {
1032 if (isset($spotter_item['real_arrival_airport']) && $spotter_item['real_arrival_airport'] != $spotter_item['arrival_airport']) {
1033 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";
1034 if (!isset($Spotter)) $Spotter = new Spotter();
1035 $arrival_airport_info = $Spotter->getAllAirportInfo($spotter_item['real_arrival_airport']);
1036 if (isset($arrival_airport_info[0])) {
1037 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";
1039 print '<span class="mobile">'._("Scheduled:").' <a href="'.$globalURL.'/airport/'.$spotter_item['real_arrival_airport'].'">'.$spotter_item['real_arrival_airport'].'</a></span>'."\n";
1040 if (isset($arrival_airport_info[0])) {
1041 print '<span class="mobile">'._("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";
1043 } elseif ($spotter_item['arrival_airport'] != 'NA') {
1044 print '<span class="nomobile"><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";
1045 print '<span class="mobile"><a href="'.$globalURL.'/airport/'.$spotter_item['arrival_airport'].'">'.$spotter_item['arrival_airport'].'</a></span>'."\n";
1046 } else {
1047 print '<span class="nomobile"><a href="'.$globalURL.'/airport/NA">'._("Not Available").'</a></span>'."\n";
1048 print '<span class="mobile"><a href="'.$globalURL.'/airport/NA">'._("Not Available").'</a></span>'."\n";
1051 if (isset($spotter_item['arrival_airport_time']) && isset($spotter_item['real_arrival_airport_time'])) {
1052 if ($spotter_item['arrival_airport_time'] > 2460) {
1053 $arrival_airport_time = date('H:m',$spotter_item['arrival_airport_time']);
1054 } else $arrival_airport_time = $spotter_item['arrival_airport_time'];
1055 if ($spotter_item['real_arrival_airport_time'] > 2460) {
1056 $real_arrival_airport_time = date('H:m',$spotter_item['real_arrival_airport_time']);
1057 } else $real_arrival_airport_time = $spotter_item['real_arrival_airport_time'];
1058 print '<br /><span class="airport_time">'.$spotter_item['arrival_airport_time'].' ('.$spotter_item['real_arrival_airport_time'].')</span>'."\n";
1059 } elseif (isset($spotter_item['real_arrival_airport_time'])) {
1060 if ($spotter_item['real_arrival_airport_time'] > 2460) {
1061 $real_arrival_airport_time = date('H:m',$spotter_item['real_arrival_airport_time']);
1062 } else $real_arrival_airport_time = $spotter_item['real_arrival_airport_time'];
1063 print '<br /><span class="airport_time">'.$real_arrival_airport_time.'</span>'."\n";
1064 } elseif (isset($spotter_item['arrival_airport_time']) && $spotter_item['arrival_airport_time'] != 'NULL') {
1065 if ($spotter_item['arrival_airport_time'] > 2460) {
1066 $arrival_airport_time = date('H:m',$spotter_item['arrival_airport_time']);
1067 } else $arrival_airport_time = $spotter_item['arrival_airport_time'];
1068 print '<br /><span class="airport_time">'.$arrival_airport_time.'</span>'."\n";
1070 if (!isset($spotter_item['real_arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') {
1071 if (isset($spotter_item['latitude']) && $spotter_item['latitude'] != 0 && isset($spotter_item['longitude']) && $spotter_item['longitude'] != 0) {
1072 if (isset($spotter_item['last_latitude']) && $spotter_item['last_latitude'] != '' && isset($spotter_item['last_longitude']) && $spotter_item['last_longitude'] != '') {
1073 $latitude = $spotter_item['last_latitude'];
1074 $longitude = $spotter_item['last_longitude'];
1075 } else {
1076 $latitude = $spotter_item['latitude'];
1077 $longitude = $spotter_item['longitude'];
1079 $distance = $Spotter->getAirportDistance($spotter_item['arrival_airport'],$latitude,$longitude);
1080 } else $distance = '';
1081 if ($distance != '') {
1082 if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) {
1083 echo '<br/><i>'.round($distance*0.539957).' nm</i>';
1084 } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) {
1085 echo '<br/><i>'.round($distance*0.621371).' mi</i>';
1086 } elseif ((!isset($_COOKIE['unitdistance']) && ((isset($globalUnitDistance) && $globalUnitDistance == 'km') || !isset($globalUnitDistance))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) {
1087 echo '<br/><i>'.$distance.' km</i>';
1091 print '</td>'."\n";
1092 } elseif ($type == 'marine') {
1093 if (isset($globalVM) && $globalVM) {
1094 print '<td class="arrival_airport">'."\n";
1095 if (!isset($spotter_item['race_name']) || $spotter_item['race_name'] == '') {
1096 print '<span class="nomobile">'._("Not available").'</span>'."\n";
1097 print '<span class="mobile">'._("Not available").'</span>'."\n";
1098 } else {
1099 print '<span class="nomobile"><a href="'.$globalURL.'/marine/race/'.$spotter_item['race_id'].'">'.$spotter_item['race_name'].'</a></span>'."\n";
1100 print '<span class="mobile"><a href="'.$globalURL.'/marine/race/'.$spotter_item['race_id'].'">'.$spotter_item['race_name'].'</a></span>'."\n";
1102 print '</td>'."\n";
1103 print '<td class="status">';
1104 if (!isset($spotter_item['status']) || $spotter_item['status'] == '') {
1105 print _("Not available")."\n";
1106 } else {
1107 print $spotter_item['status']."\n";
1109 print '</td>';
1110 } else {
1111 print '<td class="arrival_airport">'."\n";
1112 if (!isset($spotter_item['arrival_port_name'])) {
1113 //print '<span class="nomobile"><a href="'.$globalURL.'/marine/port/NA">'._("Not available").'</a></span>'."\n";
1114 //print '<span class="mobile"><a href="'.$globalURL.'/marine/port/NA">'._("Not available").'</a></span>'."\n";
1115 print '<span class="nomobile">'._("Not available").'</span>'."\n";
1116 print '<span class="mobile">'._("Not available").'</span>'."\n";
1117 } else {
1118 //print '<span class="nomobile"><a href="'.$globalURL.'/marine/port/'.urlencode($spotter_item['arrival_port_name']).'">'.$spotter_item['arrival_port_name'].'</a></span>'."\n";
1119 //print '<span class="mobile"><a href="'.$globalURL.'/marine/port/'.urlencode($spotter_item['arrival_port_name']).'">'.$spotter_item['arrival_port_name'].'</a></span>'."\n";
1120 print '<span class="nomobile">'.$spotter_item['arrival_port_name'].'</span>'."\n";
1121 print '<span class="mobile">'.$spotter_item['arrival_port_name'].'</span>'."\n";
1123 print '</td>'."\n";
1127 if ($type == 'tracker') {
1128 print '<td class="comment">'."\n";
1129 print $spotter_item['comment'];
1130 print '</td>'."\n";
1134 if (isset($_GET['dist']) && $_GET['dist'] != '') {
1135 print '<td class="distance">'."\n";
1136 if (!isset($spotter_item['distance']) || $spotter_item['distance'] == '') {
1137 print '<span class="nomobile">-</span>'."\n";
1138 print '<span class="mobile">-</span>'."\n";
1139 } else {
1140 if ((!isset($_COOKIE['unitdistance']) && ((isset($globalUnitDistance) && $globalUnitDistance == 'km') || !isset($globalUnitDistance))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) {
1141 print '<span class="nomobile">'.round($spotter_item['distance'],2).' km</span>'."\n";
1142 print '<span class="mobile">'.round($spotter_item['distance'],2).' km</span><br />'."\n";
1143 } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) {
1144 print '<span class="nomobile">'.round($spotter_item['distance']*0.621371,2).' mi</span>'."\n";
1145 print '<span class="mobile">'.round($spotter_item['distance']*0.621371,2).' mi</span><br />'."\n";
1146 } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) {
1147 print '<span class="nomobile">'.round($spotter_item['distance']*0.539957,2).' nm</span>'."\n";
1148 print '<span class="mobile">'.round($spotter_item['distance']*0.539957,2).' nm</span><br />'."\n";
1151 print '</td>'."\n";
1153 if(strtolower($current_page) != "upcoming"){
1154 if ($type == 'aircraft') {
1155 //if ((isset($globalVA) && $globalVA) || (isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) {
1156 if ((isset($globalUsePilot) && $globalUsePilot) || !isset($globalUsePilot) && ((isset($globalVA) && $globalVA) || (isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS) || (isset($globalVAM) && $globalVAM))) {
1157 print '<td class="pilot">'."\n";
1158 if ((!isset($spotter_item['pilot_id']) || $spotter_item['pilot_id'] == '') && (!isset($spotter_item['pilot_name']) || $spotter_item['pilot_name'] == '')) {
1159 print '<span class="nomobile">-</span>'."\n";
1160 print '<span class="mobile">-</span>'."\n";
1161 } elseif ((!isset($spotter_item['pilot_id']) || $spotter_item['pilot_id'] == '') && (isset($spotter_item['pilot_name']) && $spotter_item['pilot_name'] != '')) {
1162 print '<span class="nomobile"><a href="'.$globalURL.'/pilot/'.$spotter_item['pilot_name'].'">'.$spotter_item['pilot_name'].'</a></span>'."\n";
1163 print '<span class="mobile"><a href="'.$globalURL.'/pilot/'.$spotter_item['pilot_name'].'">'.$spotter_item['pilot_name'].'</a></span>'."\n";
1164 } else {
1165 if (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'whazzup') {
1166 print '<span class="nomobile"><a href="'.$globalURL.'/pilot/'.$spotter_item['pilot_id'].'">'.$spotter_item['pilot_name'].'</a> (<a href="https://www.ivao.aero/Member.aspx?ID='.$spotter_item['pilot_id'].'">'.$spotter_item['pilot_id'].'</a>)</span>'."\n";
1167 print '<span class="mobile"><a href="'.$globalURL.'/pilot/'.$spotter_item['pilot_id'].'">'.$spotter_item['pilot_name'].'</a> (<a href="https://www.ivao.aero/Member.aspx?ID='.$spotter_item['pilot_id'].'">'.$spotter_item['pilot_id'].'</a>)</span>'."\n";
1168 } else {
1169 if (!isset($spotter_item['pilot_name'])) {
1170 print '<span class="nomobile"><a href="'.$globalURL.'/pilot/'.$spotter_item['pilot_id'].'">('.$spotter_item['pilot_id'].')</a></span>'."\n";
1171 print '<span class="mobile"><a href="'.$globalURL.'/pilot/'.$spotter_item['pilot_id'].'">('.$spotter_item['pilot_id'].')</a></span>'."\n";
1172 } else {
1173 print '<span class="nomobile"><a href="'.$globalURL.'/pilot/'.$spotter_item['pilot_id'].'">'.$spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')</a></span>'."\n";
1174 print '<span class="mobile"><a href="'.$globalURL.'/pilot/'.$spotter_item['pilot_id'].'">'.$spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')</a></span>'."\n";
1178 print '</td>'."\n";
1180 if ((isset($globalUseOwner) && $globalUseOwner) || (!isset($globalUseOwner) && (!isset($globalVA) || !$globalVA) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS) && (!isset($globalVAM) || !$globalVAM))) {
1181 print '<td class="owner">'."\n";
1182 if (!isset($spotter_item['aircraft_owner']) || $spotter_item['aircraft_owner'] == '') {
1183 print '<span class="nomobile">-</span>'."\n";
1184 print '<span class="mobile">-</span>'."\n";
1185 } else {
1186 print '<span class="nomobile"><a href="'.$globalURL.'/owner/'.$spotter_item['aircraft_owner'].'">'.$spotter_item['aircraft_owner'].'</a></span>'."\n";
1187 print '<span class="mobile"><a href="'.$globalURL.'/owner/'.$spotter_item['aircraft_owner'].'">'.$spotter_item['aircraft_owner'].'</a></span>'."\n";
1189 print '</td>'."\n";
1192 if ($type == 'marine') {
1193 if (isset($globalVM) && $globalVM) {
1194 if ($showDistance) {
1195 if (isset($spotter_item['distance'])) {
1196 print '<td class="distance">';
1197 if ((!isset($_COOKIE['unitdistance']) && ((isset($globalUnitDistance) && $globalUnitDistance == 'km') || !isset($globalUnitDistance))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) {
1198 print '<span class="nomobile">'.round($spotter_item['distance'],2).' km</span>'."\n";
1199 print '<span class="mobile">'.round($spotter_item['distance'],2).' km</span><br />'."\n";
1200 } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) {
1201 print '<span class="nomobile">'.round($spotter_item['distance']*0.621371,2).' mi</span>'."\n";
1202 print '<span class="mobile">'.round($spotter_item['distance']*0.621371,2).' mi</span><br />'."\n";
1203 } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) {
1204 print '<span class="nomobile">'.round($spotter_item['distance']*0.539957,2).' nm</span>'."\n";
1205 print '<span class="mobile">'.round($spotter_item['distance']*0.539957,2).' nm</span><br />'."\n";
1207 print '</td>'."\n";
1208 } else {
1209 print '<td class="distance"></td>'."\n";
1212 print '<td class="captain">'."\n";
1213 if ((!isset($spotter_item['captain_id']) || $spotter_item['captain_id'] == '') && (!isset($spotter_item['captain_name']) || $spotter_item['captain_name'] == '')) {
1214 print '<span class="nomobile">-</span>'."\n";
1215 print '<span class="mobile">-</span>'."\n";
1216 } elseif ((!isset($spotter_item['captain_id']) || $spotter_item['captain_id'] == '') && (isset($spotter_item['captain_name']) && $spotter_item['captain_name'] != '')) {
1217 print '<span class="nomobile"><a href="'.$globalURL.'/marine/captain/'.$spotter_item['captain_name'].'">'.$spotter_item['captain_name'].'</a></span>'."\n";
1218 print '<span class="mobile"><a href="'.$globalURL.'/marine/captain/'.$spotter_item['captain_name'].'">'.$spotter_item['captain_name'].'</a></span>'."\n";
1219 } else {
1220 if (!isset($spotter_item['captain_name'])) {
1221 print '<span class="nomobile"><a href="'.$globalURL.'/marine/captain/'.$spotter_item['captain_id'].'">('.$spotter_item['captain_id'].')</a></span>'."\n";
1222 print '<span class="mobile"><a href="'.$globalURL.'/marine/captain/'.$spotter_item['captain_id'].'">('.$spotter_item['captain_id'].')</a></span>'."\n";
1223 } else {
1224 print '<span class="nomobile"><a href="'.$globalURL.'/marine/captain/'.$spotter_item['captain_id'].'">'.$spotter_item['captain_name'].' ('.$spotter_item['captain_id'].')</a></span>'."\n";
1225 print '<span class="mobile"><a href="'.$globalURL.'/marine/captain/'.$spotter_item['captain_id'].'">'.$spotter_item['captain_name'].' ('.$spotter_item['captain_id'].')</a></span>'."\n";
1228 print '</td>'."\n";
1234 if ($showRouteStop) {
1235 // Route stop
1236 if(strtolower($current_page) != "upcoming"){
1237 print '<td class="route_stop">'."\n";
1238 if (!isset($spotter_item['route_stop']) || $spotter_item['route_stop'] == '' || $spotter_item['route_stop'] == 'NULL') {
1239 print '<span class="nomobile">-</span>'."\n";
1240 print '<span class="mobile">-</span>'."\n";
1241 } elseif (!isset($spotter_item['route_stop_details'])) {
1242 print '<span class="nomobile">'.$spotter_item['route_stop'].'</span>'."\n";
1243 print '<span class="mobile">'.$spotter_item['route_stop'].'</span>'."\n";
1244 } else {
1245 foreach ($spotter_item['route_stop_details'] as $rst) {
1246 print '<span class="nomobile"><a href="'.$globalURL.'/airport/'.$rst['airport_icao'].'">'.$rst['airport_city'].', '.$rst['airport_country'].' ('.$rst['airport_icao'].')</a></span>'."\n";
1247 print '<span class="mobile"><a href="'.$globalURL.'/airport/'.$rst['airport_icao'].'">'.$rst['airport_icao'].'</a></span><br />'."\n";
1250 print '</td>'."\n";
1253 if ($showDuration) {
1254 // Duration
1255 if (isset($globalVM) && $globalVM && $type == 'marine') {
1256 print '<td class="duration">'."\n";
1257 if (isset($spotter_item['race_time'])) {
1258 if ($spotter_item['race_time'] > 86400) {
1259 print '<span class="nomobile">'.gmdate("z\d. H\h. i\m. s\s.",$spotter_item['race_time']).'</span>'."\n";
1260 print '<span class="mobile">'.gmdate("z\d. H\h. i\m. s\s.",$spotter_item['race_time']).'</span>'."\n";
1261 } else {
1262 print '<span class="nomobile">'.gmdate("H\h. i\m. s\s.",$spotter_item['race_time']).'</span>'."\n";
1263 print '<span class="mobile">'.gmdate("H\h. i\m. s\s.",$spotter_item['race_time']).'</span>'."\n";
1265 } elseif (isset($spotter_item['duration'])) {
1266 if ($spotter_item['duration'] > 86400) {
1267 print '<span class="nomobile">'.gmdate('z\d. H\h. i\m. s\s.',$spotter_item['duration']).'</span>'."\n";
1268 print '<span class="mobile">'.gmdate('z\d. H\h. i\m. s\s.',$spotter_item['duration']).'</span>'."\n";
1269 } else {
1270 print '<span class="nomobile">'.gmdate('H\h. i\m. s\s.',$spotter_item['duration']).'</span>'."\n";
1271 print '<span class="mobile">'.gmdate('H\h. i\m. s\s.',$spotter_item['duration']).'</span>'."\n";
1273 } else {
1274 print '<span class="nomobile">-</span>'."\n";
1275 print '<span class="mobile">-</span>'."\n";
1277 print '</td>'."\n";
1278 } else {
1279 if(strtolower($current_page) != "upcoming"){
1280 print '<td class="duration">'."\n";
1281 if (isset($spotter_item['duration'])) {
1282 print '<span class="nomobile">'.gmdate('H:i:s',$spotter_item['duration']).'</span>'."\n";
1283 print '<span class="mobile">'.gmdate('H:i:s',$spotter_item['duration']).'</span>'."\n";
1284 } else {
1285 print '<span class="nomobile">-</span>'."\n";
1286 print '<span class="mobile">-</span>'."\n";
1288 print '</td>'."\n";
1294 if (strtolower($current_page) == "acars-latest" || strtolower($current_page) == "acars-archive") {
1295 if (isset($spotter_item['decode']) && $spotter_item['decode'] != '') {
1296 print '<td class="message"><p>'."\n";
1297 print str_replace(array("\r\n", "\n", "\r"),'<br />',$spotter_item['message']);
1298 print '</p><p class="decode">';
1299 $decode_array = json_decode($spotter_item['decode']);
1300 foreach ($decode_array as $key => $value) {
1301 print '<b>'.$key.'</b> : '.$value.' ';
1303 print '</p>';
1304 print '</td>'."\n";
1305 } else {
1306 print '<td class="message">'."\n";
1307 print str_replace(array("\r\n", "\n", "\r"),'<br />',$spotter_item['message']);
1308 print '</td>'."\n";
1311 if (strtolower($current_page) == "accident-latest" || strtolower($current_page) == "accident-detailed") {
1312 print '<td class="owner">'."\n";
1313 if (isset($spotter_item['aircraft_owner'])) {
1314 print $spotter_item['aircraft_owner'];
1315 } else {
1316 echo _('Not Available');
1318 print '</td>'."\n";
1320 print '<td class="acctype">'."\n";
1321 print $spotter_item['type'];
1322 print '</td>'."\n";
1324 print '<td class="fatalities">'."\n";
1325 if ($spotter_item['fatalities'] == '') {
1326 print _("Not available");
1327 } else {
1328 print $spotter_item['fatalities'];
1330 print '</td>'."\n";
1331 print '<td class="message">'."\n";
1332 print str_replace(array("\r\n", "\n", "\r"),'<br />',$spotter_item['message']);
1333 print '</td>'."\n";
1335 if (strtolower($current_page) == "incident-latest" || strtolower($current_page) == "incident-detailed") {
1336 print '<td class="owner">'."\n";
1337 if (isset($spotter_item['aircraft_owner'])) {
1338 print $spotter_item['aircraft_owner'];
1339 } else {
1340 echo _('Not Available');
1342 print '</td>'."\n";
1344 print '<td class="acctype">'."\n";
1345 print $spotter_item['type'];
1346 print '</td>'."\n";
1349 print '<td class="fatalities">'."\n";
1350 if ($spotter_item['fatalities'] == '') {
1351 print _("Not available");
1352 } else {
1353 print $spotter_item['fatalities'];
1355 print '</td>'."\n";
1357 print '<td class="message">'."\n";
1358 print str_replace(array("\r\n", "\n", "\r"),'<br />',$spotter_item['message']);
1359 print '</td>'."\n";
1362 // Date
1363 if (strtolower($current_page) == "date")
1365 print '<td class="time">'."\n";
1366 print '<span class="nomobile"><a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'">'.date("g:i a T", strtotime($spotter_item['date_iso_8601'])).'</a></span>'."\n";
1367 print '<span class="mobile"><a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'">'.date("g:i a T", strtotime($spotter_item['date_iso_8601'])).'</a></span>'."\n";
1368 if (isset($spotter_item['last_seen_date_iso_8601'])) {
1369 print '<hr />';
1370 print '<span class="nomobile"><a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'">'.date("g:i a T", strtotime($spotter_item['last_seen_date_iso_8601'])).'</a></span>'."\n";
1371 print '<span class="mobile"><a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'">'.date("g:i a T", strtotime($spotter_item['last_seen_date_iso_8601'])).'</a></span>'."\n";
1373 print '</td>'."\n";
1374 } else if (strtolower($current_page) == "index")
1376 print '<td class="time">'."\n";
1377 print '<span class="nomobile"><a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'">'.$spotter_item['date'].'</a></span>'."\n";
1378 print '<span class="mobile"><a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'">'.$spotter_item['date'].'</a></span>'."\n";
1379 print '</td>'."\n";
1380 } else if (strtolower($current_page) == "upcoming")
1382 if (isset($spotter_item['date_iso_8601'])) {
1383 print '<td class="time">';
1384 print '<span>'.date("g:i a", strtotime($spotter_item['date_iso_8601'])).'</span>';
1385 print '</td>';
1387 } elseif (strtolower($current_page) == "acars-latest" || strtolower($current_page) == "acars-archive")
1389 print '<td class="date">'."\n";
1390 print '<span class="nomobile">'.date("r", strtotime($spotter_item['date'].' UTC')).'</span>'."\n";
1391 print '<span class="mobile">'.date("j/n/Y g:i a", strtotime($spotter_item['date'].' UTC')).'</span>'."\n";
1392 print '</td>'."\n";
1393 } elseif (strtolower($current_page) == "accident-latest" || strtolower($current_page) == "accident-detailed")
1395 print '<td class="date">'."\n";
1396 print '<span class="nomobile">'.date("d/m/Y", strtotime($spotter_item['date'].' UTC')).'</span>'."\n";
1397 print '<span class="mobile">'.date("d/m/Y", strtotime($spotter_item['date'].' UTC')).'</span>'."\n";
1398 print '</td>'."\n";
1399 } elseif (strtolower($current_page) == "incident-latest" || strtolower($current_page) == "incident-detailed")
1401 print '<td class="date">'."\n";
1402 print '<span class="nomobile">'.date("d/m/Y", strtotime($spotter_item['date'].' UTC')).'</span>'."\n";
1403 print '<span class="mobile">'.date("d/m/Y", strtotime($spotter_item['date'].' UTC')).'</span>'."\n";
1404 print '</td>'."\n";
1405 } else {
1406 if ($type == 'aircraft') {
1407 print '<td class="date">'."\n";
1408 print '<span class="nomobile"><a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'">'.date("r", $spotter_item['date_unix']).'</a></span>'."\n";
1409 print '<span class="mobile"><a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'">'.date("j/n/Y g:i a", strtotime($spotter_item['date_iso_8601'])).'</a></span>'."\n";
1410 if (isset($spotter_item['last_seen_date_iso_8601'])) {
1411 print '<hr />';
1412 print '<span class="nomobile"><a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'">'.date("r", $spotter_item['last_seen_date_unix']).'</a></span>'."\n";
1413 print '<span class="mobile"><a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'">'.date("j/n/Y g:i a", strtotime($spotter_item['last_seen_date_iso_8601'])).'</a></span>'."\n";
1415 print '</td>'."\n";
1416 } elseif ($type == 'marine' || $type == 'tracker') {
1418 print '<td class="date">'."\n";
1419 print '<span class="nomobile"><a href="'.$globalURL.'/marineid/'.$spotter_item['marine_id'].'">'.date("r", $spotter_item['date_unix']).'</a></span>'."\n";
1420 print '<span class="mobile"><a href="'.$globalURL.'/marineid/'.$spotter_item['marine_id'].'">'.date("j/n/Y g:i a", strtotime($spotter_item['date_iso_8601'])).'</a></span>'."\n";
1421 if (isset($spotter_item['last_seen_date_iso_8601'])) {
1422 print '<hr />';
1423 print '<span class="nomobile"><a href="'.$globalURL.'/marineid/'.$spotter_item['marine_id'].'">'.date("r", $spotter_item['last_seen_date_unix']).'</a></span>'."\n";
1424 print '<span class="mobile"><a href="'.$globalURL.'/marineid/'.$spotter_item['marine_id'].'">'.date("j/n/Y g:i a", strtotime($spotter_item['last_seen_date_iso_8601'])).'</a></span>'."\n";
1426 print '</td>'."\n";
1428 print '<td class="date">'."\n";
1429 print '<span class="nomobile">'.date("r", $spotter_item['date_unix']).'</span>'."\n";
1430 print '<span class="mobile">'.date("j/n/Y g:i a", strtotime($spotter_item['date_iso_8601'])).'</span>'."\n";
1431 if (isset($spotter_item['last_seen_date_iso_8601'])) {
1432 print '<hr />';
1433 print '<span class="nomobile">'.date("r", $spotter_item['last_seen_date_unix']).'</span>'."\n";
1434 print '<span class="mobile">'.date("j/n/Y g:i a", strtotime($spotter_item['last_seen_date_iso_8601'])).'</span>'."\n";
1436 print '</td>'."\n";
1439 if ($type == 'marine' || $type == 'tracker') {
1440 print '<td class="more"></td>';
1441 } elseif (strtolower($current_page) != "upcoming")
1443 print '<td class="more">';
1444 print '<ul class="nav nav-pills">';
1445 print '<li class="dropdown">';
1446 print '<a class="dropdown-toggle " data-toggle="dropdown" href="#"><span class="caret"></span></a>';
1447 print '<ul class="dropdown-menu pull-right" role="menu">';
1448 if (isset($spotter_item['spotter_id'])) {
1449 print '<li><a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'">'._("Detailed Flight Information").'</a></li>';
1450 print '<li><a href="'.$globalURL.'/search/xml?q='.$spotter_item['spotter_id'].'&download=true"><i class="fa fa-download"></i>'._("Download Flight Data").' (XML)</a></li>';
1451 print '<li><hr /></li>';
1453 if (strtolower($current_page) == "accident-latest" || strtolower($current_page) == "accident-detailed" || strtolower($current_page) == "incident-latest" || strtolower($current_page) == "incident-detailed") {
1454 if (isset($spotter_item['flightaware_id'])) {
1455 print '<li><a href="'.$globalURL.'/registration/'.$spotter_item['registration'].'">'._("Aircraft History").' ('.$spotter_item['registration'].')</a></li>';
1457 } elseif (isset($spotter_item['registration']) && $spotter_item['registration'] != "")
1459 print '<li><a href="'.$globalURL.'/registration/'.$spotter_item['registration'].'">'._("Aircraft History").' ('.$spotter_item['registration'].')</a></li>';
1461 if (isset($spotter_item['aircraft_manufacturer']) && $spotter_item['aircraft_manufacturer'] != "")
1463 print '<li><a href="'.$globalURL.'/manufacturer/'.strtolower(str_replace(" ", "-", $spotter_item['aircraft_manufacturer'])).'">'._("Manufacturer Profile").'</a></li>';
1465 if (isset($spotter_item['aircraft_type']) && $spotter_item['aircraft_type'] != "" && isset($spotter_item['airline_icao']) && $spotter_item['airline_icao'] != "")
1467 print '<li><a href="'.$globalURL.'/search?aircraft='.$spotter_item['aircraft_type'].'&airline='.$spotter_item['airline_icao'].'">'._("Flights of Aircraft Type &amp; Airline").'</a></li>';
1468 print '<li><hr /></li>';
1470 if (isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != "" && $spotter_item['arrival_airport'] != "")
1472 print '<li><a href="'.$globalURL.'/route/'.$spotter_item['departure_airport'].'/'.$spotter_item['arrival_airport'].'">'._("Route Profile").'</a></li>';
1474 if (isset($spotter_item['airline_country']) && $spotter_item['airline_country'] != "" && $spotter_item['airline_country'] != "NA")
1476 print '<li><a href="'.$globalURL.'/country/'.strtolower(str_replace(" ", "-", $spotter_item['airline_country'])).'">'._("Airline Country Profile").'</a></li>';
1477 print '<li><hr /></li>';
1479 if (isset($spotter_item['departure_airport_country']) && $spotter_item['departure_airport_country'] != "" && $spotter_item['departure_airport_country'] != "N/A" && $spotter_item['departure_airport_country'] != "NA")
1481 print '<li><a href="'.$globalURL.'/country/'.strtolower(str_replace(" ", "-", $spotter_item['departure_airport_country'])).'">'._("Departure Airport Country Profile").'</a></li>';
1483 if (isset($spotter_item['arrival_airport_country']) && $spotter_item['arrival_airport_country'] != "" && $spotter_item['arrival_airport_country'] != "N/A" && $spotter_item['arrival_airport_country'] != "NA")
1485 print '<li><a href="'.$globalURL.'/country/'.strtolower(str_replace(" ", "-", $spotter_item['arrival_airport_country'])).'">'._("Arrival Airport Country Profile").'</a></li>';
1487 if (strtolower($current_page) == "accident-latest" || strtolower($current_page) == "incident-latest" || strtolower($current_page) == "accident-detailed" || strtolower($current_page) == "incident-detailed") {
1488 if (isset($spotter_item['url']) && $spotter_item['url'] != "")
1490 print '<li><a href="'.$spotter_item['url'].'">'._("Detailed information").'</a></li>';
1493 print '</ul>';
1494 print '</li>';
1495 print '</ul>';
1496 print '</td>';
1498 print '</tr>'."\n";
1500 print '<tbody>'."\n";
1501 print '</table>'."\n";
1502 print '</div>'."\n";