@@ -58,7 +58,9 @@ discard block |
||
58 | 58 | { |
59 | 59 | if ($spotter_item['image_source'] == 'flickr' || $spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart') { |
60 | 60 | $image = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
61 | - } else $image = $spotter_item['image_thumbnail']; |
|
61 | + } else { |
|
62 | + $image = $spotter_item['image_thumbnail']; |
|
63 | + } |
|
62 | 64 | } |
63 | 65 | /* else { |
64 | 66 | $image = "images/placeholder_thumb.png"; |
@@ -75,10 +77,14 @@ discard block |
||
75 | 77 | print '<div class="callsign-details">'; |
76 | 78 | if ($spotter_item['ident'] != 'Not Available') { |
77 | 79 | print '<div class="callsign"><a href="'.$globalURL.'/redirect/'.$spotter_item['flightaware_id'].'" target="_blank">'.$spotter_item['ident'].'</a>'; |
78 | - if (isset($spotter_item['blocked']) && $spotter_item['blocked'] === true) print '<img src="'.$globalURL.'/images/forbidden.png" title="'._("Callsign is in blocked FAA list").'" class="blocked" />'; |
|
80 | + if (isset($spotter_item['blocked']) && $spotter_item['blocked'] === true) { |
|
81 | + print '<img src="'.$globalURL.'/images/forbidden.png" title="'._("Callsign is in blocked FAA list").'" class="blocked" />'; |
|
82 | + } |
|
79 | 83 | print '</div>'; |
80 | 84 | } |
81 | - if (isset($spotter_item['airline_name']) && $spotter_item['airline_name'] != 'Not Available') print '<div class="airline">'.$spotter_item['airline_name'].'</div>'; |
|
85 | + if (isset($spotter_item['airline_name']) && $spotter_item['airline_name'] != 'Not Available') { |
|
86 | + print '<div class="airline">'.$spotter_item['airline_name'].'</div>'; |
|
87 | + } |
|
82 | 88 | print '</div>'; |
83 | 89 | if ($spotter_item['departure_airport'] != 'NA' && $spotter_item['arrival_airport'] != 'NA') { |
84 | 90 | print '<div class="nomobile airports"><div class="airport"><span class="code"><a href="'.$globalURL.'/airport/'.$spotter_item['departure_airport'].'" target="_blank">'.$spotter_item['departure_airport'].'</a></span>'.$spotter_item['departure_airport_city'].' '.$spotter_item['departure_airport_country']; |
@@ -110,13 +116,21 @@ discard block |
||
110 | 116 | print '</div>'; |
111 | 117 | print '<div id="aircraft">'; |
112 | 118 | print '<span>'._("Aircraft").'</span>'; |
113 | - if (isset($spotter_item['aircraft_wiki'])) print '<a href="'.$spotter_item['aircraft_wiki'].'">'.$spotter_item['aircraft_name'].'</a>'; |
|
119 | + if (isset($spotter_item['aircraft_wiki'])) { |
|
120 | + print '<a href="'.$spotter_item['aircraft_wiki'].'">'.$spotter_item['aircraft_name'].'</a>'; |
|
121 | + } |
|
114 | 122 | if (isset($spotter_item['aircraft_type']) && isset($spotter_item['aircraft_manufacturer']) && $spotter_item['aircraft_manufacturer'] != 'N/A' && isset($spotter_item['aircraft_name']) && $spotter_item['aircraft_name'] != 'N/A') { |
115 | 123 | $aircraft_names = explode('/',$spotter_item['aircraft_name']); |
116 | - if (count($aircraft_names) == 1) print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')</a>'; |
|
117 | - else print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'" title="'.$spotter_item['aircraft_name'].'">'.$spotter_item['aircraft_manufacturer'].' '.$aircraft_names[0].' ('.$spotter_item['aircraft_type'].')</a>'; |
|
118 | - } elseif (isset($spotter_item['aircraft_type'])) print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_type'].'</a>'; |
|
119 | - else print $spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name']; |
|
124 | + if (count($aircraft_names) == 1) { |
|
125 | + print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')</a>'; |
|
126 | + } else { |
|
127 | + print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'" title="'.$spotter_item['aircraft_name'].'">'.$spotter_item['aircraft_manufacturer'].' '.$aircraft_names[0].' ('.$spotter_item['aircraft_type'].')</a>'; |
|
128 | + } |
|
129 | + } elseif (isset($spotter_item['aircraft_type'])) { |
|
130 | + print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_type'].'</a>'; |
|
131 | + } else { |
|
132 | + print $spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name']; |
|
133 | + } |
|
120 | 134 | |
121 | 135 | print '</div>'; |
122 | 136 | print '<div id ="altitude"><span>'._("Altitude").'</span>'; |
@@ -129,11 +143,17 @@ discard block |
||
129 | 143 | } |
130 | 144 | |
131 | 145 | if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) { |
132 | - if (isset($spotter_item['real_altitude']) && $spotter_item['real_altitude'] != '') print $spotter_item['real_altitude'].' feet (FL'.$spotter_item['altitude'].')'; |
|
133 | - else print $spotter_item['altitude'].'00 feet (FL'.$spotter_item['altitude'].')'; |
|
146 | + if (isset($spotter_item['real_altitude']) && $spotter_item['real_altitude'] != '') { |
|
147 | + print $spotter_item['real_altitude'].' feet (FL'.$spotter_item['altitude'].')'; |
|
148 | + } else { |
|
149 | + print $spotter_item['altitude'].'00 feet (FL'.$spotter_item['altitude'].')'; |
|
150 | + } |
|
134 | 151 | } else { |
135 | - if (isset($spotter_item['real_altitude']) && $spotter_item['real_altitude'] != '') print round($spotter_item['real_altitude']*0.3048).' m (FL'.$spotter_item['altitude'].')'; |
|
136 | - else print round($spotter_item['altitude']*30.48).' m (FL'.$spotter_item['altitude'].')'; |
|
152 | + if (isset($spotter_item['real_altitude']) && $spotter_item['real_altitude'] != '') { |
|
153 | + print round($spotter_item['real_altitude']*0.3048).' m (FL'.$spotter_item['altitude'].')'; |
|
154 | + } else { |
|
155 | + print round($spotter_item['altitude']*30.48).' m (FL'.$spotter_item['altitude'].')'; |
|
156 | + } |
|
137 | 157 | } |
138 | 158 | |
139 | 159 | if (isset($groundAltitude) && $groundAltitude < $spotter_item['altitude']*30.48) { |
@@ -147,7 +167,9 @@ discard block |
||
147 | 167 | print '</i>'; |
148 | 168 | } |
149 | 169 | print '</div>'; |
150 | - if (isset($spotter_item['registration']) && $spotter_item['registration'] != '') print '<div><span>'._("Registration").'</span><a href="'.$globalURL.'/registration/'.$spotter_item['registration'].'" target="_blank">'.$spotter_item['registration'].'</a></div>'; |
|
170 | + if (isset($spotter_item['registration']) && $spotter_item['registration'] != '') { |
|
171 | + print '<div><span>'._("Registration").'</span><a href="'.$globalURL.'/registration/'.$spotter_item['registration'].'" target="_blank">'.$spotter_item['registration'].'</a></div>'; |
|
172 | + } |
|
151 | 173 | print '<div id="speed"><span>'._("Speed").'</span>'; |
152 | 174 | if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'mph') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'mph')) { |
153 | 175 | print round($spotter_item['ground_speed']*1.15078).' mph'; |
@@ -189,8 +211,11 @@ discard block |
||
189 | 211 | } |
190 | 212 | if (isset($spotter_item['pilot_name']) && $spotter_item['pilot_name'] != '') { |
191 | 213 | print '<div id="pilot"><span>'._("Pilot").'</span>'; |
192 | - if (isset($spotter_item['pilot_id'])) print $spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')'; |
|
193 | - else print $spotter_item['pilot_name']; |
|
214 | + if (isset($spotter_item['pilot_id'])) { |
|
215 | + print $spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')'; |
|
216 | + } else { |
|
217 | + print $spotter_item['pilot_name']; |
|
218 | + } |
|
194 | 219 | print '</div>'; |
195 | 220 | } |
196 | 221 | if (isset($spotter_item['aircraft_owner']) && $spotter_item['aircraft_owner'] != '') { |
@@ -216,10 +241,18 @@ discard block |
||
216 | 241 | } |
217 | 242 | print '</div>'; |
218 | 243 | print '</div>'; |
219 | - if (isset($globalVA) && $globalVA && isset($globalphpVMS) && $globalphpVMS && isset($globalVATSIM) && $globalVATSIM && isset($globalIVAO) && $globalIVAO && isset($spotter_item['format_source']) && $spotter_item['format_source'] != '' && $spotter_item['format_source'] != 'pireps') print '<div class="waypoints"><span>'._("Source").'</span>'.$spotter_item['format_source'].'</div>'; |
|
220 | - if (isset($spotter_item['waypoints']) && $spotter_item['waypoints'] != '') print '<div class="waypoints"><span>'._("Route").'</span>'.$spotter_item['waypoints'].'</div>'; |
|
221 | - if (isset($spotter_item['acars']['message'])) print '<div class="acars"><span>'._("Latest ACARS message").'</span>'.trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'<br/>',$spotter_item['acars']['message'])).'</div>'; |
|
222 | - if (isset($spotter_item['squawk']) && $spotter_item['squawk'] != '' && $spotter_item['squawk'] != 0) print '<div class="bottom">'._("Squawk:").' '.$spotter_item['squawk'].' - '.$spotter_item['squawk_usage'].'</div>'; |
|
244 | + if (isset($globalVA) && $globalVA && isset($globalphpVMS) && $globalphpVMS && isset($globalVATSIM) && $globalVATSIM && isset($globalIVAO) && $globalIVAO && isset($spotter_item['format_source']) && $spotter_item['format_source'] != '' && $spotter_item['format_source'] != 'pireps') { |
|
245 | + print '<div class="waypoints"><span>'._("Source").'</span>'.$spotter_item['format_source'].'</div>'; |
|
246 | + } |
|
247 | + if (isset($spotter_item['waypoints']) && $spotter_item['waypoints'] != '') { |
|
248 | + print '<div class="waypoints"><span>'._("Route").'</span>'.$spotter_item['waypoints'].'</div>'; |
|
249 | + } |
|
250 | + if (isset($spotter_item['acars']['message'])) { |
|
251 | + print '<div class="acars"><span>'._("Latest ACARS message").'</span>'.trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'<br/>',$spotter_item['acars']['message'])).'</div>'; |
|
252 | + } |
|
253 | + if (isset($spotter_item['squawk']) && $spotter_item['squawk'] != '' && $spotter_item['squawk'] != 0) { |
|
254 | + print '<div class="bottom">'._("Squawk:").' '.$spotter_item['squawk'].' - '.$spotter_item['squawk_usage'].'</div>'; |
|
255 | + } |
|
223 | 256 | print '</div>'; |
224 | 257 | } |
225 | 258 | ?> |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | // When button "Remove all filters" is clicked |
39 | 39 | if (isset($_POST['removefilters'])) { |
40 | 40 | $allfilters = array_filter(array_keys($_COOKIE),function($key) { |
41 | - return strpos($key,'filter_') === 0; |
|
41 | + return strpos($key,'filter_') === 0; |
|
42 | 42 | }); |
43 | 43 | foreach ($allfilters as $filt) { |
44 | 44 | unset($_COOKIE[$filt]); |
@@ -404,34 +404,34 @@ discard block |
||
404 | 404 | |
405 | 405 | <ul class="nav navbar-nav"> |
406 | 406 | <?php |
407 | - if (isset($globalNewsFeeds['global']) && !empty($globalNewsFeeds['global'])) { |
|
407 | + if (isset($globalNewsFeeds['global']) && !empty($globalNewsFeeds['global'])) { |
|
408 | 408 | ?> |
409 | 409 | <li><a href="<?php print $globalURL; ?>/news"><?php echo _("News"); ?></a></li> |
410 | 410 | <?php |
411 | - } |
|
411 | + } |
|
412 | 412 | ?> |
413 | 413 | |
414 | 414 | <?php |
415 | - $sub = false; |
|
416 | - if ( |
|
415 | + $sub = false; |
|
416 | + if ( |
|
417 | 417 | ( |
418 | - (!isset($globalAircraft) || (isset($globalAircraft) && $globalAircraft === TRUE)) && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalTracker) && $globalTracker === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE)) |
|
418 | + (!isset($globalAircraft) || (isset($globalAircraft) && $globalAircraft === TRUE)) && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalTracker) && $globalTracker === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE)) |
|
419 | 419 | ) || |
420 | 420 | ( |
421 | - isset($globalMarine) && $globalMarine === TRUE && ((isset($globalTracker) && $globalTracker === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE)) |
|
421 | + isset($globalMarine) && $globalMarine === TRUE && ((isset($globalTracker) && $globalTracker === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE)) |
|
422 | 422 | ) || |
423 | 423 | ( |
424 | - isset($globalTracker) && $globalTracker === TRUE && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE)) |
|
424 | + isset($globalTracker) && $globalTracker === TRUE && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE)) |
|
425 | 425 | ) || |
426 | 426 | ( |
427 | - isset($globalSatellite) && $globalSatellite === TRUE && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalTracker) && $globalTracker === TRUE)) |
|
427 | + isset($globalSatellite) && $globalSatellite === TRUE && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalTracker) && $globalTracker === TRUE)) |
|
428 | 428 | ) |
429 | - ) { |
|
429 | + ) { |
|
430 | 430 | $sub = true; |
431 | - } |
|
431 | + } |
|
432 | 432 | ?> |
433 | 433 | <?php |
434 | - if (!isset($globalAircraft) || $globalAircraft === TRUE) { |
|
434 | + if (!isset($globalAircraft) || $globalAircraft === TRUE) { |
|
435 | 435 | ?> |
436 | 436 | <li class="dropdown"> |
437 | 437 | <?php |
@@ -442,7 +442,7 @@ discard block |
||
442 | 442 | <ul class="dropdown-menu multi-level"> |
443 | 443 | <li class="dropdown-submenu"> |
444 | 444 | <?php |
445 | - } |
|
445 | + } |
|
446 | 446 | ?> |
447 | 447 | <?php |
448 | 448 | if (isset($globalNewsFeeds['aircraft']) && !empty($globalNewsFeeds['aircraft'])) { |
@@ -457,25 +457,25 @@ discard block |
||
457 | 457 | <ul class="dropdown-menu"> |
458 | 458 | <li><a href="<?php print $globalURL; ?>/aircraft"><?php echo _("Aircraft Types"); ?></a></li> |
459 | 459 | <?php |
460 | - if (!isset($globalNoAirlines) || $globalNoAirlines === FALSE) { |
|
460 | + if (!isset($globalNoAirlines) || $globalNoAirlines === FALSE) { |
|
461 | 461 | ?> |
462 | 462 | <li><a href="<?php print $globalURL; ?>/airline"><?php echo _("Airlines"); ?></a></li> |
463 | 463 | <?php |
464 | - } |
|
464 | + } |
|
465 | 465 | ?> |
466 | 466 | <li><a href="<?php print $globalURL; ?>/airport"><?php echo _("Airports"); ?></a></li> |
467 | 467 | <?php |
468 | - if ((isset($globalUseOwner) && $globalUseOwner) || (!isset($globalUseOwner) && (!isset($globalVA) || !$globalVA) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS) && (!isset($globalVAM) || !$globalVAM))) { |
|
468 | + if ((isset($globalUseOwner) && $globalUseOwner) || (!isset($globalUseOwner) && (!isset($globalVA) || !$globalVA) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS) && (!isset($globalVAM) || !$globalVAM))) { |
|
469 | 469 | ?> |
470 | 470 | <li><a href="<?php print $globalURL; ?>/owner"><?php echo _("Owners"); ?></a></li> |
471 | 471 | <?php |
472 | - } |
|
473 | - if ((isset($globalUsePilot) && $globalUsePilot) || !isset($globalUsePilot) && ((isset($globalVA) && $globalVA) || (isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS) || (isset($globalVAM) && $globalVAM))) { |
|
472 | + } |
|
473 | + if ((isset($globalUsePilot) && $globalUsePilot) || !isset($globalUsePilot) && ((isset($globalVA) && $globalVA) || (isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS) || (isset($globalVAM) && $globalVAM))) { |
|
474 | 474 | |
475 | 475 | ?> |
476 | 476 | <li><a href="<?php print $globalURL; ?>/pilot"><?php echo _("Pilots"); ?></a></li> |
477 | 477 | <?php |
478 | - } |
|
478 | + } |
|
479 | 479 | ?> |
480 | 480 | <li><hr /></li> |
481 | 481 | <li><a href="<?php print $globalURL; ?>/currently"><?php echo _("Current Activity"); ?></a></li> |
@@ -483,43 +483,43 @@ discard block |
||
483 | 483 | <li><a href="<?php print $globalURL; ?>/date/<?php print date("Y-m-d"); ?>"><?php echo _("Today's Activity"); ?></a></li> |
484 | 484 | <li><a href="<?php print $globalURL; ?>/newest"><?php echo _("Newest by Category"); ?></a></li> |
485 | 485 | <?php |
486 | - if ($globalACARS) { |
|
487 | - if (isset($globalDemo) && $globalDemo) { |
|
488 | - ?> |
|
486 | + if ($globalACARS) { |
|
487 | + if (isset($globalDemo) && $globalDemo) { |
|
488 | + ?> |
|
489 | 489 | <li><hr /></li> |
490 | 490 | <li><i><?php echo _('ACARS data not available publicly'); ?></i></li> |
491 | 491 | <li><a href=""><?php echo _('Latest ACARS messages'); ?></a></li> |
492 | 492 | <li><a href=""><?php echo _('Archive ACARS messages'); ?></a></li> |
493 | 493 | <?php |
494 | - } else { |
|
495 | - ?> |
|
494 | + } else { |
|
495 | + ?> |
|
496 | 496 | <li><hr /></li> |
497 | 497 | <li><a href="<?php print $globalURL; ?>/acars-latest"><?php echo _("Latest ACARS messages"); ?></a></li> |
498 | 498 | <li><a href="<?php print $globalURL; ?>/acars-archive"><?php echo _("Archive ACARS messages"); ?></a></li> |
499 | 499 | <?php |
500 | - } |
|
501 | - } |
|
502 | - ?> |
|
500 | + } |
|
501 | + } |
|
502 | + ?> |
|
503 | 503 | <?php |
504 | - if (isset($globalAccidents) && $globalAccidents) { |
|
505 | - ?> |
|
504 | + if (isset($globalAccidents) && $globalAccidents) { |
|
505 | + ?> |
|
506 | 506 | <li><hr /></li> |
507 | 507 | <li><a href="<?php print $globalURL; ?>/accident-latest"><?php echo _("Latest accident"); ?></a></li> |
508 | 508 | <li><a href="<?php print $globalURL; ?>/accident/<?php print date("Y-m-d"); ?>"><?php echo _("Today's Accident"); ?></a></li> |
509 | 509 | <li><a href="<?php print $globalURL; ?>/incident-latest"><?php echo _("Latest incident"); ?></a></li> |
510 | 510 | <li><a href="<?php print $globalURL; ?>/incident/<?php print date("Y-m-d"); ?>"><?php echo _("Today's Incident"); ?></a></li> |
511 | 511 | <?php |
512 | - } |
|
513 | - ?> |
|
512 | + } |
|
513 | + ?> |
|
514 | 514 | <li><hr /></li> |
515 | 515 | <li><a href="<?php print $globalURL; ?>/highlights/table"><?php echo _("Special Highlights"); ?></a></li> |
516 | 516 | <?php |
517 | 517 | if (!isset($globalNoUpcoming) || $globalNoUpcoming === FALSE) { |
518 | - ?> |
|
518 | + ?> |
|
519 | 519 | <li><a href="<?php print $globalURL; ?>/upcoming"><?php echo _("Upcoming Flights"); ?></a></li> |
520 | 520 | <?php |
521 | 521 | } |
522 | - ?> |
|
522 | + ?> |
|
523 | 523 | </ul> |
524 | 524 | </li> |
525 | 525 | <li><a href="<?php print $globalURL; ?>/search"><?php echo _("Search"); ?></a></li> |
@@ -546,14 +546,14 @@ discard block |
||
546 | 546 | </ul> |
547 | 547 | <?php |
548 | 548 | } |
549 | - } |
|
549 | + } |
|
550 | 550 | ?> |
551 | 551 | <?php |
552 | - if (isset($globalMarine) && $globalMarine) { |
|
552 | + if (isset($globalMarine) && $globalMarine) { |
|
553 | 553 | ?> |
554 | 554 | <li class="dropdown"> |
555 | 555 | <?php |
556 | - if ($sub) { |
|
556 | + if ($sub) { |
|
557 | 557 | ?> |
558 | 558 | <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Marines"); ?> <b class="caret"></b></a> |
559 | 559 | <ul class="dropdown-menu multi-level"> |
@@ -587,14 +587,14 @@ discard block |
||
587 | 587 | } |
588 | 588 | ?> |
589 | 589 | <?php |
590 | - } |
|
590 | + } |
|
591 | 591 | ?> |
592 | 592 | <?php |
593 | - if (isset($globalTracker) && $globalTracker) { |
|
593 | + if (isset($globalTracker) && $globalTracker) { |
|
594 | 594 | ?> |
595 | 595 | <li class="dropdown"> |
596 | 596 | <?php |
597 | - if ($sub) { |
|
597 | + if ($sub) { |
|
598 | 598 | ?> |
599 | 599 | <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Trackers"); ?> <b class="caret"></b></a> |
600 | 600 | <ul class="dropdown-menu multi-level"> |
@@ -628,14 +628,14 @@ discard block |
||
628 | 628 | } |
629 | 629 | ?> |
630 | 630 | <?php |
631 | - } |
|
631 | + } |
|
632 | 632 | ?> |
633 | 633 | <?php |
634 | - if (isset($globalSatellite) && $globalSatellite) { |
|
634 | + if (isset($globalSatellite) && $globalSatellite) { |
|
635 | 635 | ?> |
636 | 636 | <li class="dropdown"> |
637 | 637 | <?php |
638 | - if ($sub) { |
|
638 | + if ($sub) { |
|
639 | 639 | ?> |
640 | 640 | <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Satellites"); ?> <b class="caret"></b></a> |
641 | 641 | <ul class="dropdown-menu multi-level"> |
@@ -671,7 +671,7 @@ discard block |
||
671 | 671 | } |
672 | 672 | ?> |
673 | 673 | <?php |
674 | - } |
|
674 | + } |
|
675 | 675 | ?> |
676 | 676 | |
677 | 677 | <li class="dropdown"> |
@@ -680,12 +680,12 @@ discard block |
||
680 | 680 | <li><a href="<?php print $globalURL; ?>/about"><?php echo _("About The Project"); ?></a></li> |
681 | 681 | <li><a href="<?php print $globalURL; ?>/about/export"><?php echo _("Exporting Data"); ?></a></li> |
682 | 682 | <?php |
683 | - if (!isset($globalAircraft) || $globalAircraft === TRUE) { |
|
683 | + if (!isset($globalAircraft) || $globalAircraft === TRUE) { |
|
684 | 684 | ?> |
685 | 685 | <li><hr /></li> |
686 | 686 | <li><a href="<?php print $globalURL; ?>/about/tv"><?php echo _("Spotter TV"); ?></a></li> |
687 | 687 | <?php |
688 | - } |
|
688 | + } |
|
689 | 689 | ?> |
690 | 690 | <?php if (isset($globalContribute) && $globalContribute) { ?> |
691 | 691 | <li><hr /></li> |
@@ -709,13 +709,13 @@ discard block |
||
709 | 709 | <form> |
710 | 710 | <select class="selectpicker" data-width="120px" onchange="language(this);"> |
711 | 711 | <?php |
712 | - foreach ($alllang as $key => $lang) { |
|
713 | - print '<option value="'.$key.'"'; |
|
714 | - if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) print ' selected '; |
|
715 | - if ($lang[0] == 'Deutsch') print '>'.$lang[0].' (βeta)</option>'; |
|
716 | - else print '>'.$lang[0].'</option>'; |
|
717 | - } |
|
718 | - ?> |
|
712 | + foreach ($alllang as $key => $lang) { |
|
713 | + print '<option value="'.$key.'"'; |
|
714 | + if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) print ' selected '; |
|
715 | + if ($lang[0] == 'Deutsch') print '>'.$lang[0].' (βeta)</option>'; |
|
716 | + else print '>'.$lang[0].'</option>'; |
|
717 | + } |
|
718 | + ?> |
|
719 | 719 | </select> |
720 | 720 | </form> |
721 | 721 | </div> |
@@ -748,18 +748,18 @@ discard block |
||
748 | 748 | ?> |
749 | 749 | <div class="top-header clear" role="main"> |
750 | 750 | <?php |
751 | - if (isset($longitude) && isset($latitude) && $longitude != 0 && $latitude != 0) { |
|
751 | + if (isset($longitude) && isset($latitude) && $longitude != 0 && $latitude != 0) { |
|
752 | 752 | ?> |
753 | 753 | <div id="archive-map"></div> |
754 | 754 | <?php |
755 | - } |
|
755 | + } |
|
756 | 756 | ?> |
757 | 757 | </div> |
758 | 758 | <?php |
759 | 759 | } |
760 | 760 | if ((strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false) || (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false)) |
761 | 761 | { |
762 | - ?> |
|
762 | + ?> |
|
763 | 763 | <div class="top-header clear" role="main"> |
764 | 764 | <div id="map"></div> |
765 | 765 | <link rel="stylesheet" href="<?php print $globalURL; ?>/css/leaflet.css" /> |
@@ -770,15 +770,15 @@ discard block |
||
770 | 770 | var zoom = 13; |
771 | 771 | //create the map |
772 | 772 | <?php |
773 | - if (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($airport_array[0]['latitude'])) { |
|
773 | + if (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($airport_array[0]['latitude'])) { |
|
774 | 774 | ?> |
775 | 775 | map = L.map('map', { zoomControl:true }).setView([<?php print $airport_array[0]['latitude']; ?>,<?php print $airport_array[0]['longitude']; ?>], zoom); |
776 | 776 | <?php |
777 | - } elseif (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false) { |
|
777 | + } elseif (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false) { |
|
778 | 778 | ?> |
779 | 779 | map = L.map('map', { zoomControl:true }); |
780 | 780 | <?php |
781 | - } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($spotter_array[0]['departure_airport_latitude'])) { |
|
781 | + } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($spotter_array[0]['departure_airport_latitude'])) { |
|
782 | 782 | ?> |
783 | 783 | map = L.map('map', { zoomControl:true }).setView([<?php print $spotter_array[0]['departure_airport_latitude']; ?>,<?php print $spotter_array[0]['arrival_airport_longitude']; ?>]); |
784 | 784 | var line = L.polyline([[<?php print $spotter_array[0]['departure_airport_latitude']; ?>, <?php print $spotter_array[0]['departure_airport_longitude']; ?>],[<?php print $spotter_array[0]['arrival_airport_latitude']; ?>, <?php print $spotter_array[0]['arrival_airport_longitude']; ?>]]).addTo(map); |
@@ -786,22 +786,22 @@ discard block |
||
786 | 786 | var departure_airport = L.marker([<?php print $spotter_array[0]['departure_airport_latitude']; ?>, <?php print $spotter_array[0]['departure_airport_longitude']; ?>], {icon: L.icon({iconUrl: '<?php print $globalURL; ?>/images/departure_airport.png',iconSize: [16,18],iconAnchor: [8,16]})}).addTo(map); |
787 | 787 | var arrival_airport = L.marker([<?php print $spotter_array[0]['arrival_airport_latitude']; ?>, <?php print $spotter_array[0]['arrival_airport_longitude']; ?>], {icon: L.icon({iconUrl: '<?php print $globalURL; ?>/images/arrival_airport.png',iconSize: [16,18],iconAnchor: [8,16]})}).addTo(map); |
788 | 788 | <?php |
789 | - } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && !isset($spotter_array[0]['departure_airport_latitude']) && isset($spotter_array[0]['latitude'])) { |
|
789 | + } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && !isset($spotter_array[0]['departure_airport_latitude']) && isset($spotter_array[0]['latitude'])) { |
|
790 | 790 | ?> |
791 | 791 | map = L.map('map', { zoomControl:true }).setView([<?php print $spotter_array[0]['latitude']; ?>,<?php print $spotter_array[0]['longitude']; ?>]); |
792 | 792 | <?php |
793 | - } elseif (!isset($spotter_array[0]['latitude']) && !isset($spotter_array[0]['longitude'])) { |
|
793 | + } elseif (!isset($spotter_array[0]['latitude']) && !isset($spotter_array[0]['longitude'])) { |
|
794 | 794 | ?> |
795 | 795 | map = L.map('map', { zoomControl:true }); |
796 | 796 | <?php |
797 | - } |
|
797 | + } |
|
798 | 798 | ?> |
799 | 799 | //initialize the layer group for the aircrft markers |
800 | 800 | var layer_data = L.layerGroup(); |
801 | 801 | |
802 | 802 | //a few title layers |
803 | 803 | <?php |
804 | - if ($globalMapProvider == 'Mapbox') { |
|
804 | + if ($globalMapProvider == 'Mapbox') { |
|
805 | 805 | ?> |
806 | 806 | L.tileLayer('https://{s}.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={token}', { |
807 | 807 | maxZoom: 18, |
@@ -812,14 +812,14 @@ discard block |
||
812 | 812 | token : '<?php print $globalMapboxToken; ?>' |
813 | 813 | }).addTo(map); |
814 | 814 | <?php |
815 | - } elseif ($globalMapProvider == 'Mapbox-GL') { |
|
815 | + } elseif ($globalMapProvider == 'Mapbox-GL') { |
|
816 | 816 | ?> |
817 | 817 | L.mapboxGL({ |
818 | 818 | accessToken: '<?php print $globalMapboxToken; ?>', |
819 | 819 | style: 'mapbox://styles/mapbox/bright-v8' |
820 | 820 | }).addTo(map); |
821 | 821 | <?php |
822 | - } elseif ($globalMapProvider == 'MapQuest-OSM') { |
|
822 | + } elseif ($globalMapProvider == 'MapQuest-OSM') { |
|
823 | 823 | ?> |
824 | 824 | L.tileLayer('http://otile1.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.png', { |
825 | 825 | maxZoom: 18, |
@@ -828,7 +828,7 @@ discard block |
||
828 | 828 | 'Tiles Courtesy of <a href="http://www.mapquest.com">MapQuest</a>' |
829 | 829 | }).addTo(map); |
830 | 830 | <?php |
831 | - } elseif ($globalMapProvider == 'MapQuest-Aerial') { |
|
831 | + } elseif ($globalMapProvider == 'MapQuest-Aerial') { |
|
832 | 832 | ?> |
833 | 833 | L.tileLayer('http://otile1.mqcdn.com/tiles/1.0.0/sat/{z}/{x}/{y}.png', { |
834 | 834 | maxZoom: 18, |
@@ -837,27 +837,27 @@ discard block |
||
837 | 837 | 'Tiles Courtesy of <a href="http://www.mapquest.com">MapQuest</a>, Portions Courtesy NASA/JPL-Caltech and U.S. Depart. of Agriculture, Farm Service Agency"' |
838 | 838 | }).addTo(map); |
839 | 839 | <?php |
840 | - } elseif ($globalMapProvider == 'Google-Roadmap') { |
|
840 | + } elseif ($globalMapProvider == 'Google-Roadmap') { |
|
841 | 841 | ?> |
842 | 842 | var googleLayer = new L.Google('ROADMAP'); |
843 | 843 | map.addLayer(googleLayer); |
844 | 844 | <?php |
845 | - } elseif ($globalMapProvider == 'Google-Satellite') { |
|
845 | + } elseif ($globalMapProvider == 'Google-Satellite') { |
|
846 | 846 | ?> |
847 | 847 | var googleLayer = new L.Google('SATELLITE'); |
848 | 848 | map.addLayer(googleLayer); |
849 | 849 | <?php |
850 | - } elseif ($globalMapProvider == 'Google-Hybrid') { |
|
850 | + } elseif ($globalMapProvider == 'Google-Hybrid') { |
|
851 | 851 | ?> |
852 | 852 | var googleLayer = new L.Google('HYBRID'); |
853 | 853 | map.addLayer(googleLayer); |
854 | 854 | <?php |
855 | - } elseif ($globalMapProvider == 'Google-Terrain') { |
|
855 | + } elseif ($globalMapProvider == 'Google-Terrain') { |
|
856 | 856 | ?> |
857 | 857 | var googleLayer = new L.Google('Terrain'); |
858 | 858 | map.addLayer(googleLayer); |
859 | 859 | <?php |
860 | - } elseif (isset($globalMapCustomLayer[$globalMapProvider])) { |
|
860 | + } elseif (isset($globalMapCustomLayer[$globalMapProvider])) { |
|
861 | 861 | $customid = $globalMapProvider; |
862 | 862 | ?> |
863 | 863 | L.tileLayer('<?php print $globalMapCustomLayer[$customid]['url']; ?>/{z}/{x}/{y}.png', { |
@@ -867,7 +867,7 @@ discard block |
||
867 | 867 | attribution: '<?php print $globalMapCustomLayer[$customid]['attribution']; ?>' |
868 | 868 | }).addTo(map); |
869 | 869 | <?php |
870 | - } elseif ($globalMapProvider == 'offline' || (isset($globalMapOffline) && $globalMapOffline === TRUE)) { |
|
870 | + } elseif ($globalMapProvider == 'offline' || (isset($globalMapOffline) && $globalMapOffline === TRUE)) { |
|
871 | 871 | ?> |
872 | 872 | var center = map.getCenter(); |
873 | 873 | map.options.crs = L.CRS.EPSG4326; |
@@ -882,8 +882,8 @@ discard block |
||
882 | 882 | attribution: 'Natural Earth' |
883 | 883 | }).addTo(map); |
884 | 884 | <?php |
885 | - //} elseif ($globalMapProvider == 'OpenStreetMap') { |
|
886 | - } else { |
|
885 | + //} elseif ($globalMapProvider == 'OpenStreetMap') { |
|
886 | + } else { |
|
887 | 887 | ?> |
888 | 888 | L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { |
889 | 889 | maxZoom: 18, |
@@ -892,7 +892,7 @@ discard block |
||
892 | 892 | }).addTo(map); |
893 | 893 | |
894 | 894 | <?php |
895 | - } |
|
895 | + } |
|
896 | 896 | ?> |
897 | 897 | </script> |
898 | 898 | </div> |
@@ -6,12 +6,19 @@ discard block |
||
6 | 6 | //gets the page file and stores it in a variable |
7 | 7 | $file_path = pathinfo($_SERVER['SCRIPT_NAME']); |
8 | 8 | $current_page = $file_path['filename']; |
9 | -if ($globalTimezone == '') $globalTimezone = 'UTC'; |
|
9 | +if ($globalTimezone == '') { |
|
10 | + $globalTimezone = 'UTC'; |
|
11 | +} |
|
10 | 12 | date_default_timezone_set($globalTimezone); |
11 | -if (isset($_COOKIE['MapType']) && $_COOKIE['MapType'] != '') $MapType = $_COOKIE['MapType']; |
|
12 | -else $MapType = $globalMapProvider; |
|
13 | +if (isset($_COOKIE['MapType']) && $_COOKIE['MapType'] != '') { |
|
14 | + $MapType = $_COOKIE['MapType']; |
|
15 | +} else { |
|
16 | + $MapType = $globalMapProvider; |
|
17 | +} |
|
13 | 18 | |
14 | -if (isset($globalMapOffline) && $globalMapOffline) $MapType = 'offline'; |
|
19 | +if (isset($globalMapOffline) && $globalMapOffline) { |
|
20 | + $MapType = 'offline'; |
|
21 | +} |
|
15 | 22 | |
16 | 23 | if (isset($_GET['3d'])) { |
17 | 24 | setcookie('MapFormat','3d'); |
@@ -204,7 +211,10 @@ discard block |
||
204 | 211 | <?php |
205 | 212 | } else { |
206 | 213 | ?> |
207 | -<script src="<?php print $globalURL; ?>/js/map.2d.js.php?<?php print time(); ?><?php if (isset($tsk)) print '&tsk='.$tsk; ?>"></script> |
|
214 | +<script src="<?php print $globalURL; ?>/js/map.2d.js.php?<?php print time(); ?><?php if (isset($tsk)) { |
|
215 | + print '&tsk='.$tsk; |
|
216 | +} |
|
217 | +?>"></script> |
|
208 | 218 | <?php |
209 | 219 | } |
210 | 220 | if (!isset($globalAircraft) || $globalAircraft) { |
@@ -244,7 +254,13 @@ discard block |
||
244 | 254 | <script src="<?php print $globalURL; ?>/js/MovingMarker.js"></script> |
245 | 255 | <script src="<?php print $globalURL; ?>/js/jquery.idle.min.js"></script> |
246 | 256 | <script src="<?php print $globalURL; ?>/js/map.common.js"></script> |
247 | -<script src="<?php print $globalURL; ?>/js/map.2d.js.php?ident=<?php print $ident; ?><?php if(isset($latitude)) print '&latitude='.$latitude; ?><?php if(isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script> |
|
257 | +<script src="<?php print $globalURL; ?>/js/map.2d.js.php?ident=<?php print $ident; ?><?php if(isset($latitude)) { |
|
258 | + print '&latitude='.$latitude; |
|
259 | +} |
|
260 | +?><?php if(isset($longitude)) { |
|
261 | + print '&longitude='.$longitude; |
|
262 | +} |
|
263 | +?>&<?php print time(); ?>"></script> |
|
248 | 264 | <?php |
249 | 265 | if (!isset($type) || $type == 'aircraft') { |
250 | 266 | ?> |
@@ -317,7 +333,13 @@ discard block |
||
317 | 333 | <script src="<?php print $globalURL; ?>/js/MovingMarker.js"></script> |
318 | 334 | <script src="<?php print $globalURL; ?>/js/jquery.idle.min.js"></script> |
319 | 335 | <script src="<?php print $globalURL; ?>/js/map.common.js"></script> |
320 | -<script src="<?php print $globalURL; ?>/js/map.2d.js.php?flightaware_id=<?php print $flightaware_id; ?><?php if(isset($latitude)) print '&latitude='.$latitude; ?><?php if(isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script> |
|
336 | +<script src="<?php print $globalURL; ?>/js/map.2d.js.php?flightaware_id=<?php print $flightaware_id; ?><?php if(isset($latitude)) { |
|
337 | + print '&latitude='.$latitude; |
|
338 | +} |
|
339 | +?><?php if(isset($longitude)) { |
|
340 | + print '&longitude='.$longitude; |
|
341 | +} |
|
342 | +?>&<?php print time(); ?>"></script> |
|
321 | 343 | <script src="<?php print $globalURL; ?>/js/map-aircraft.2d.js.php?flightaware_id=<?php print $flightaware_id; ?>&<?php print time(); ?>"></script> |
322 | 344 | <?php |
323 | 345 | if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '' && ($MapType == 'Google-Roadmap' || $MapType == 'Google-Satellite' || $MapType == 'Google-Hybrid' || $MapType == 'Google-Terrain')) { |
@@ -398,7 +420,12 @@ discard block |
||
398 | 420 | <span class="icon-bar"></span> |
399 | 421 | </button> |
400 | 422 | <a href="<?php print $globalURL; ?>/search" class="navbar-toggle search"><i class="fa fa-search"></i></a> |
401 | - <a class="navbar-brand" href="<?php if ($globalURL == '') print '/'; else print $globalURL; ?>"><img src="<?php print $globalURL.$logoURL; ?>" height="30px" /></a> |
|
423 | + <a class="navbar-brand" href="<?php if ($globalURL == '') { |
|
424 | + print '/'; |
|
425 | +} else { |
|
426 | + print $globalURL; |
|
427 | +} |
|
428 | +?>"><img src="<?php print $globalURL.$logoURL; ?>" height="30px" /></a> |
|
402 | 429 | </div> |
403 | 430 | <div class="collapse navbar-collapse"> |
404 | 431 | |
@@ -453,7 +480,10 @@ discard block |
||
453 | 480 | } |
454 | 481 | ?> |
455 | 482 | |
456 | - <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a> |
|
483 | + <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) { |
|
484 | + echo 'right-'; |
|
485 | +} |
|
486 | +?>caret"></b></a> |
|
457 | 487 | <ul class="dropdown-menu"> |
458 | 488 | <li><a href="<?php print $globalURL; ?>/aircraft"><?php echo _("Aircraft Types"); ?></a></li> |
459 | 489 | <?php |
@@ -524,8 +554,14 @@ discard block |
||
524 | 554 | </li> |
525 | 555 | <li><a href="<?php print $globalURL; ?>/search"><?php echo _("Search"); ?></a></li> |
526 | 556 | <li><a href="<?php print $globalURL; ?>/statistics"><?php echo _("Statistics"); ?></a></li> |
527 | - <li class="dropdown<?php if ($sub) echo '-submenu'; ?>"> |
|
528 | - <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Tools"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a> |
|
557 | + <li class="dropdown<?php if ($sub) { |
|
558 | + echo '-submenu'; |
|
559 | +} |
|
560 | +?>"> |
|
561 | + <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Tools"); ?> <b class="<?php if ($sub) { |
|
562 | + echo 'right-'; |
|
563 | +} |
|
564 | +?>caret"></b></a> |
|
529 | 565 | <ul class="dropdown-menu"> |
530 | 566 | <li><a href="<?php print $globalURL; ?>/tools/acars"><?php echo _("ACARS translator"); ?></a></li> |
531 | 567 | <li><a href="<?php print $globalURL; ?>/tools/metar"><?php echo _("METAR translator"); ?></a></li> |
@@ -569,7 +605,10 @@ discard block |
||
569 | 605 | <?php |
570 | 606 | } |
571 | 607 | ?> |
572 | - <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a> |
|
608 | + <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) { |
|
609 | + echo 'right-'; |
|
610 | +} |
|
611 | +?>caret"></b></a> |
|
573 | 612 | <ul class="dropdown-menu"> |
574 | 613 | <li><a href="<?php print $globalURL; ?>/marine/currently"><?php echo _("Current Activity"); ?></a></li> |
575 | 614 | <li><a href="<?php print $globalURL; ?>/marine/latest"><?php echo _("Latest Activity"); ?></a></li> |
@@ -610,7 +649,10 @@ discard block |
||
610 | 649 | <?php |
611 | 650 | } |
612 | 651 | ?> |
613 | - <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a> |
|
652 | + <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) { |
|
653 | + echo 'right-'; |
|
654 | +} |
|
655 | +?>caret"></b></a> |
|
614 | 656 | <ul class="dropdown-menu"> |
615 | 657 | <li><a href="<?php print $globalURL; ?>/tracker/currently"><?php echo _("Current Activity"); ?></a></li> |
616 | 658 | <li><a href="<?php print $globalURL; ?>/tracker/latest"><?php echo _("Latest Activity"); ?></a></li> |
@@ -653,7 +695,10 @@ discard block |
||
653 | 695 | ?> |
654 | 696 | |
655 | 697 | <!-- |
656 | - <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a> |
|
698 | + <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) { |
|
699 | + echo 'right-'; |
|
700 | +} |
|
701 | +?>caret"></b></a> |
|
657 | 702 | <ul class="dropdown-menu"> |
658 | 703 | <li><a href="<?php print $globalURL; ?>/satellite/currently"><?php echo _("Current Activity"); ?></a></li> |
659 | 704 | <li><a href="<?php print $globalURL; ?>/satellite/latest"><?php echo _("Latest Activity"); ?></a></li> |
@@ -711,9 +756,14 @@ discard block |
||
711 | 756 | <?php |
712 | 757 | foreach ($alllang as $key => $lang) { |
713 | 758 | print '<option value="'.$key.'"'; |
714 | - if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) print ' selected '; |
|
715 | - if ($lang[0] == 'Deutsch') print '>'.$lang[0].' (βeta)</option>'; |
|
716 | - else print '>'.$lang[0].'</option>'; |
|
759 | + if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) { |
|
760 | + print ' selected '; |
|
761 | + } |
|
762 | + if ($lang[0] == 'Deutsch') { |
|
763 | + print '>'.$lang[0].' (βeta)</option>'; |
|
764 | + } else { |
|
765 | + print '>'.$lang[0].'</option>'; |
|
766 | + } |
|
717 | 767 | } |
718 | 768 | ?> |
719 | 769 | </select> |
@@ -861,9 +911,24 @@ discard block |
||
861 | 911 | $customid = $globalMapProvider; |
862 | 912 | ?> |
863 | 913 | L.tileLayer('<?php print $globalMapCustomLayer[$customid]['url']; ?>/{z}/{x}/{y}.png', { |
864 | - maxZoom: <?php if (isset($globalMapCustomLayer[$customid]['maxZoom'])) print $globalMapCustomLayer[$customid]['maxZoom']; else print '18'; ?>, |
|
865 | - minZoom: <?php if (isset($globalMapCustomLayer[$customid]['minZoom'])) print $globalMapCustomLayer[$customid]['minZoom']; else print '0'; ?>, |
|
866 | - noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) print 'false'; else print 'true'; ?>, |
|
914 | + maxZoom: <?php if (isset($globalMapCustomLayer[$customid]['maxZoom'])) { |
|
915 | + print $globalMapCustomLayer[$customid]['maxZoom']; |
|
916 | +} else { |
|
917 | + print '18'; |
|
918 | +} |
|
919 | +?>, |
|
920 | + minZoom: <?php if (isset($globalMapCustomLayer[$customid]['minZoom'])) { |
|
921 | + print $globalMapCustomLayer[$customid]['minZoom']; |
|
922 | +} else { |
|
923 | + print '0'; |
|
924 | +} |
|
925 | +?>, |
|
926 | + noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) { |
|
927 | + print 'false'; |
|
928 | +} else { |
|
929 | + print 'true'; |
|
930 | +} |
|
931 | +?>, |
|
867 | 932 | attribution: '<?php print $globalMapCustomLayer[$customid]['attribution']; ?>' |
868 | 933 | }).addTo(map); |
869 | 934 | <?php |
@@ -878,7 +943,12 @@ discard block |
||
878 | 943 | maxZoom: 5, |
879 | 944 | tms : true, |
880 | 945 | zindex : 3, |
881 | - noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) print 'false'; else print 'true'; ?>, |
|
946 | + noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) { |
|
947 | + print 'false'; |
|
948 | +} else { |
|
949 | + print 'true'; |
|
950 | +} |
|
951 | +?>, |
|
882 | 952 | attribution: 'Natural Earth' |
883 | 953 | }).addTo(map); |
884 | 954 | <?php |
@@ -901,4 +971,7 @@ discard block |
||
901 | 971 | |
902 | 972 | ?> |
903 | 973 | |
904 | -<section class="container main-content <?php if (strtolower($current_page) == 'index') print 'index '; ?>clear"> |
|
974 | +<section class="container main-content <?php if (strtolower($current_page) == 'index') { |
|
975 | + print 'index '; |
|
976 | +} |
|
977 | +?>clear"> |
@@ -64,17 +64,17 @@ discard block |
||
64 | 64 | $min = true; |
65 | 65 | $allhistory = false; |
66 | 66 | $filter['source'] = array(); |
67 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
68 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
69 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
70 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs')); |
|
71 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
72 | -if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
73 | -if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING); |
|
74 | -if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
75 | -if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
76 | -if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
77 | -if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING); |
|
67 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'], array('vatsimtxt')); |
|
68 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'], array('whazzup')); |
|
69 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'], array('phpvmacars')); |
|
70 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'], array('sbs', 'famaprs')); |
|
71 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'], array('aprs')); |
|
72 | +if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'], FILTER_SANITIZE_STRING); |
|
73 | +if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'], FILTER_SANITIZE_STRING); |
|
74 | +if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',', $_COOKIE['filter_Airlines']), FILTER_SANITIZE_STRING); |
|
75 | +if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',', $_COOKIE['filter_Sources']), FILTER_SANITIZE_STRING); |
|
76 | +if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'], FILTER_SANITIZE_STRING); |
|
77 | +if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'], FILTER_SANITIZE_STRING); |
|
78 | 78 | |
79 | 79 | if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) { |
80 | 80 | $min = true; |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | $spotter_array = array(); |
84 | 84 | |
85 | 85 | if (isset($_GET['ident'])) { |
86 | - $ident = urldecode(filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING)); |
|
86 | + $ident = urldecode(filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING)); |
|
87 | 87 | if ($tracker) { |
88 | 88 | $spotter_array = $TrackerLive->getLastLiveTrackerDataByIdent($ident); |
89 | 89 | } elseif ($marine) { |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | } |
98 | 98 | $allhistory = true; |
99 | 99 | } elseif (isset($_GET['flightaware_id'])) { |
100 | - $flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING); |
|
100 | + $flightaware_id = filter_input(INPUT_GET, 'flightaware_id', FILTER_SANITIZE_STRING); |
|
101 | 101 | $spotter_array = $SpotterLive->getLastLiveSpotterDataById($flightaware_id); |
102 | 102 | if (empty($spotter_array)) { |
103 | 103 | $from_archive = true; |
@@ -105,11 +105,11 @@ discard block |
||
105 | 105 | } |
106 | 106 | $allhistory = true; |
107 | 107 | } elseif (isset($_GET['famtrack_id'])) { |
108 | - $famtrack_id = urldecode(filter_input(INPUT_GET,'famtrack_id',FILTER_SANITIZE_STRING)); |
|
108 | + $famtrack_id = urldecode(filter_input(INPUT_GET, 'famtrack_id', FILTER_SANITIZE_STRING)); |
|
109 | 109 | $spotter_array = $TrackerLive->getLastLiveTrackerDataById($famtrack_id); |
110 | 110 | $allhistory = true; |
111 | 111 | } elseif (isset($_GET['fammarine_id'])) { |
112 | - $fammarine_id = urldecode(filter_input(INPUT_GET,'fammarine_id',FILTER_SANITIZE_STRING)); |
|
112 | + $fammarine_id = urldecode(filter_input(INPUT_GET, 'fammarine_id', FILTER_SANITIZE_STRING)); |
|
113 | 113 | $spotter_array = $MarineLive->getLastLiveMarineDataById($fammarine_id); |
114 | 114 | $allhistory = true; |
115 | 115 | /* |
@@ -129,15 +129,15 @@ discard block |
||
129 | 129 | */ |
130 | 130 | } elseif (isset($globalMapUseBbox) && $globalMapUseBbox && isset($_GET['coord']) && $min && !isset($_GET['archive'])) { |
131 | 131 | $usecoord = true; |
132 | - $coord = explode(',',$_GET['coord']); |
|
133 | - if (filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT) |
|
132 | + $coord = explode(',', $_GET['coord']); |
|
133 | + if (filter_var($coord[0], FILTER_VALIDATE_FLOAT) && filter_var($coord[1], FILTER_VALIDATE_FLOAT) && filter_var($coord[2], FILTER_VALIDATE_FLOAT) && filter_var($coord[3], FILTER_VALIDATE_FLOAT) |
|
134 | 134 | && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0) { |
135 | 135 | if ($tracker) { |
136 | - $spotter_array = $TrackerLive->getMinLiveTrackerDatabyCoord($coord,$filter); |
|
136 | + $spotter_array = $TrackerLive->getMinLiveTrackerDatabyCoord($coord, $filter); |
|
137 | 137 | } elseif ($marine) { |
138 | - $spotter_array = $MarineLive->getMinLiveMarineDatabyCoord($coord,$filter); |
|
138 | + $spotter_array = $MarineLive->getMinLiveMarineDatabyCoord($coord, $filter); |
|
139 | 139 | } else { |
140 | - $spotter_array = $SpotterLive->getMinLiveSpotterDatabyCoord($coord,$filter); |
|
140 | + $spotter_array = $SpotterLive->getMinLiveSpotterDatabyCoord($coord, $filter); |
|
141 | 141 | } |
142 | 142 | } else { |
143 | 143 | if ($tracker) { |
@@ -152,12 +152,12 @@ discard block |
||
152 | 152 | $from_archive = true; |
153 | 153 | // $begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
154 | 154 | // $enddate = filter_input(INPUT_GET,'enddate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
155 | - $begindate = filter_input(INPUT_GET,'begindate',FILTER_SANITIZE_NUMBER_INT); |
|
156 | - $enddate = filter_input(INPUT_GET,'enddate',FILTER_SANITIZE_NUMBER_INT); |
|
157 | - $archivespeed = filter_input(INPUT_GET,'speed',FILTER_SANITIZE_NUMBER_INT); |
|
158 | - $begindate = date('Y-m-d H:i:s',$begindate); |
|
159 | - $enddate = date('Y-m-d H:i:s',$enddate); |
|
160 | - $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate,$enddate,$filter); |
|
155 | + $begindate = filter_input(INPUT_GET, 'begindate', FILTER_SANITIZE_NUMBER_INT); |
|
156 | + $enddate = filter_input(INPUT_GET, 'enddate', FILTER_SANITIZE_NUMBER_INT); |
|
157 | + $archivespeed = filter_input(INPUT_GET, 'speed', FILTER_SANITIZE_NUMBER_INT); |
|
158 | + $begindate = date('Y-m-d H:i:s', $begindate); |
|
159 | + $enddate = date('Y-m-d H:i:s', $enddate); |
|
160 | + $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate, $enddate, $filter); |
|
161 | 161 | } elseif ($min) { |
162 | 162 | if ($tracker) { |
163 | 163 | $spotter_array = $TrackerLive->getMinLiveTrackerData($filter); |
@@ -169,17 +169,17 @@ discard block |
||
169 | 169 | # $min = true; |
170 | 170 | } else { |
171 | 171 | if ($tracker) { |
172 | - $spotter_array = $TrackerLive->getLiveTrackerData('','',$filter); |
|
172 | + $spotter_array = $TrackerLive->getLiveTrackerData('', '', $filter); |
|
173 | 173 | } elseif ($marine) { |
174 | - $spotter_array = $marineLive->getLiveMarineData('','',$filter); |
|
174 | + $spotter_array = $marineLive->getLiveMarineData('', '', $filter); |
|
175 | 175 | } else { |
176 | - $spotter_array = $SpotterLive->getLiveSpotterData('','',$filter); |
|
176 | + $spotter_array = $SpotterLive->getLiveSpotterData('', '', $filter); |
|
177 | 177 | } |
178 | 178 | } |
179 | 179 | |
180 | 180 | if ($usecoord) { |
181 | 181 | if (isset($_GET['archive'])) { |
182 | - $flightcnt = $SpotterArchive->getLiveSpotterCount($begindate,$enddate,$filter); |
|
182 | + $flightcnt = $SpotterArchive->getLiveSpotterCount($begindate, $enddate, $filter); |
|
183 | 183 | } else { |
184 | 184 | if ($tracker) { |
185 | 185 | $flightcnt = $TrackerLive->getLiveTrackerCount($filter); |
@@ -192,9 +192,9 @@ discard block |
||
192 | 192 | if ($flightcnt == '') $flightcnt = 0; |
193 | 193 | } else $flightcnt = 0; |
194 | 194 | |
195 | -$sqltime = round(microtime(true)-$begintime,2); |
|
195 | +$sqltime = round(microtime(true) - $begintime, 2); |
|
196 | 196 | |
197 | -$currenttime = filter_input(INPUT_GET,'currenttime',FILTER_SANITIZE_NUMBER_INT); |
|
197 | +$currenttime = filter_input(INPUT_GET, 'currenttime', FILTER_SANITIZE_NUMBER_INT); |
|
198 | 198 | if ($currenttime != '') $currenttime = round($currenttime/1000); |
199 | 199 | |
200 | 200 | if ((!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation == FALSE) || (isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'false')) $usenextlatlon = false; |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | if (!empty($spotter_array) && is_array($spotter_array)) |
214 | 214 | { |
215 | 215 | $output .= '"features": ['; |
216 | - foreach($spotter_array as $spotter_item) |
|
216 | + foreach ($spotter_array as $spotter_item) |
|
217 | 217 | { |
218 | 218 | $j++; |
219 | 219 | unset($idistance); |
@@ -270,8 +270,8 @@ discard block |
||
270 | 270 | */ |
271 | 271 | //$output .= '"fc": "'.$spotter_item['nb'].'",'; |
272 | 272 | if (isset($spotter_item['ident']) && $spotter_item['ident'] != '') { |
273 | - if ($compress) $output .= '"c": "'.str_replace('\\','',$spotter_item['ident']).'",'; |
|
274 | - else $output .= '"callsign": "'.str_replace('\\','',$spotter_item['ident']).'",'; |
|
273 | + if ($compress) $output .= '"c": "'.str_replace('\\', '', $spotter_item['ident']).'",'; |
|
274 | + else $output .= '"callsign": "'.str_replace('\\', '', $spotter_item['ident']).'",'; |
|
275 | 275 | //" |
276 | 276 | } else { |
277 | 277 | if ($compress) $output .= '"c": "NA",'; |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | if (isset($spotter_item['registration'])) $output .= '"registration": "'.$spotter_item['registration'].'",'; |
281 | 281 | if (isset($spotter_item['aircraft_name']) && isset($spotter_item['aircraft_type'])) { |
282 | 282 | $output .= '"aircraft_name": "'.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')",'; |
283 | - $output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ','_',$spotter_item['aircraft_name'])).'",'; |
|
283 | + $output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ', '_', $spotter_item['aircraft_name'])).'",'; |
|
284 | 284 | } elseif (isset($spotter_item['aircraft_type'])) { |
285 | 285 | $output .= '"aircraft_name": "NA ('.$spotter_item['aircraft_type'].')",'; |
286 | 286 | } elseif (!$min) { |
@@ -423,15 +423,15 @@ discard block |
||
423 | 423 | if (isset($archivespeed) || $usenextlatlon) { |
424 | 424 | if (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { |
425 | 425 | if (isset($spotter_item['arrival_airport_latitude'])) { |
426 | - $cheading = $Common->getHeading($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['arrival_airport_latitude'],$spotter_item['arrival_airport_longitude']); |
|
427 | - $idistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['arrival_airport_latitude'],$spotter_item['arrival_airport_longitude']); |
|
426 | + $cheading = $Common->getHeading($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['arrival_airport_latitude'], $spotter_item['arrival_airport_longitude']); |
|
427 | + $idistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['arrival_airport_latitude'], $spotter_item['arrival_airport_longitude']); |
|
428 | 428 | $farr_lat = $spotter_item['arrival_airport_latitude']; |
429 | 429 | $farr_lon = $spotter_item['arrival_airport_longitude']; |
430 | 430 | } else { |
431 | 431 | $aairport = $Spotter->getAllAirportInfo($spotter_item['arrival_airport']); |
432 | 432 | if (isset($aairport[0]['latitude'])) { |
433 | - $cheading = $Common->getHeading($spotter_item['latitude'],$spotter_item['longitude'],$aairport[0]['latitude'],$aairport[0]['longitude']); |
|
434 | - $idistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$aairport[0]['latitude'],$aairport[0]['longitude']); |
|
433 | + $cheading = $Common->getHeading($spotter_item['latitude'], $spotter_item['longitude'], $aairport[0]['latitude'], $aairport[0]['longitude']); |
|
434 | + $idistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $aairport[0]['latitude'], $aairport[0]['longitude']); |
|
435 | 435 | $farr_lat = $aairport[0]['latitude']; |
436 | 436 | $farr_lon = $aairport[0]['longitude']; |
437 | 437 | } |
@@ -444,59 +444,59 @@ discard block |
||
444 | 444 | if ($currenttime != '') { |
445 | 445 | if (strtotime($spotter_item['date']) < $currenttime) { |
446 | 446 | if (isset($archivespeed)) { |
447 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh)); |
|
448 | - $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
|
447 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading, $archivespeed, ($currenttime - strtotime($spotter_item['date']) + $globalMapRefresh)); |
|
448 | + $fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']); |
|
449 | 449 | if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
450 | 450 | else { |
451 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,$archivespeed,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh)); |
|
452 | - $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
|
451 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $cheading, $archivespeed, ($currenttime - strtotime($spotter_item['date']) + $globalMapRefresh)); |
|
452 | + $fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']); |
|
453 | 453 | if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
454 | 454 | else { |
455 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed); |
|
455 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading, $archivespeed); |
|
456 | 456 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
457 | 457 | } |
458 | 458 | } |
459 | 459 | } elseif ($usenextlatlon) { |
460 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,1,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh)); |
|
461 | - $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
|
460 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading, 1, ($currenttime - strtotime($spotter_item['date']) + $globalMapRefresh)); |
|
461 | + $fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']); |
|
462 | 462 | if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
463 | 463 | else { |
464 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,1,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh)); |
|
465 | - $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
|
464 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $cheading, 1, ($currenttime - strtotime($spotter_item['date']) + $globalMapRefresh)); |
|
465 | + $fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']); |
|
466 | 466 | if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
467 | 467 | else { |
468 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading); |
|
468 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading); |
|
469 | 469 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
470 | 470 | } |
471 | 471 | } |
472 | 472 | } |
473 | 473 | } else { |
474 | 474 | if (isset($archivespeed)) { |
475 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed); |
|
475 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading, $archivespeed); |
|
476 | 476 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
477 | 477 | } elseif ($usenextlatlon) { |
478 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading); |
|
478 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading); |
|
479 | 479 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
480 | 480 | } |
481 | 481 | } |
482 | 482 | } else { |
483 | 483 | if (isset($archivespeed)) { |
484 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed); |
|
485 | - $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
|
484 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading, $archivespeed); |
|
485 | + $fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']); |
|
486 | 486 | if (!isset($idistance) || $fdistance < $idistance) { |
487 | 487 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
488 | 488 | } else { |
489 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,$archivespeed); |
|
489 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $cheading, $archivespeed); |
|
490 | 490 | //$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
491 | 491 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
492 | 492 | } |
493 | 493 | } elseif ($usenextlatlon) { |
494 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading); |
|
495 | - $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
|
494 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading); |
|
495 | + $fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']); |
|
496 | 496 | if (!isset($idistance) || $fdistance < $idistance) { |
497 | 497 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
498 | 498 | } else { |
499 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading); |
|
499 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $cheading); |
|
500 | 500 | //$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
501 | 501 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
502 | 502 | } |
@@ -505,7 +505,7 @@ discard block |
||
505 | 505 | |
506 | 506 | if (!$min) $output .= '"image": "'.$image.'",'; |
507 | 507 | if (isset($spotter_item['image_copyright']) && $spotter_item['image_copyright'] != '') { |
508 | - $output .= '"image_copyright": "'.str_replace('"',"'",trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'',$spotter_item['image_copyright']))).'",'; |
|
508 | + $output .= '"image_copyright": "'.str_replace('"', "'", trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '', $spotter_item['image_copyright']))).'",'; |
|
509 | 509 | } |
510 | 510 | if (isset($spotter_item['image_source_website'])) { |
511 | 511 | $output .= '"image_source_website": "'.urlencode($spotter_item['image_source_website']).'",'; |
@@ -527,7 +527,7 @@ discard block |
||
527 | 527 | $output .= '"waypoints": "'.$spotter_item['waypoints'].'",'; |
528 | 528 | } |
529 | 529 | if (isset($spotter_item['acars'])) { |
530 | - $output .= '"acars": "'.trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"), '<br />',$spotter_item['acars']['message'])).'",'; |
|
530 | + $output .= '"acars": "'.trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '<br />', $spotter_item['acars']['message'])).'",'; |
|
531 | 531 | } |
532 | 532 | // type when not aircraft ? |
533 | 533 | if (isset($spotter_item['type'])) { |
@@ -547,12 +547,12 @@ discard block |
||
547 | 547 | if ($currenttime != '') { |
548 | 548 | if (strtotime($spotter_item['date']) < $currenttime) { |
549 | 549 | if (!isset($archivespeed)) $archivespeed = 1; |
550 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed,($currenttime-strtotime($spotter_item['date']))); |
|
551 | - $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
|
550 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading, $archivespeed, ($currenttime - strtotime($spotter_item['date']))); |
|
551 | + $fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']); |
|
552 | 552 | if (!isset($idistance) || $fdistance < $idistance) $output .= $nextcoord['longitude'].','.$nextcoord['latitude']; |
553 | 553 | else { |
554 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,$archivespeed,($currenttime-strtotime($spotter_item['date']))); |
|
555 | - $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
|
554 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $cheading, $archivespeed, ($currenttime - strtotime($spotter_item['date']))); |
|
555 | + $fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']); |
|
556 | 556 | if (!isset($idistance) || $fdistance < $idistance) $output .= $nextcoord['longitude'].','.$nextcoord['latitude']; |
557 | 557 | else { |
558 | 558 | $output .= $spotter_item['longitude'].', '; |
@@ -631,7 +631,7 @@ discard block |
||
631 | 631 | |
632 | 632 | } |
633 | 633 | */ |
634 | - $history = filter_input(INPUT_GET,'history',FILTER_SANITIZE_STRING); |
|
634 | + $history = filter_input(INPUT_GET, 'history', FILTER_SANITIZE_STRING); |
|
635 | 635 | if ($history == '' && isset($_COOKIE['history'])) $history = $_COOKIE['history']; |
636 | 636 | |
637 | 637 | if ( |
@@ -639,11 +639,11 @@ discard block |
||
639 | 639 | || ((isset($globalMapHistory) && $globalMapHistory) || $allhistory) |
640 | 640 | // || (isset($history) && $history != '' && $history != 'NA' && ($history == $spotter_item['ident'] || $history == $spotter_item['flightaware_id'])) |
641 | 641 | // || (isset($history) && $history != '' && $history != 'NA' && $history == $spotter_item['ident']) |
642 | - || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
|
642 | + || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id'])) |
|
643 | 643 | || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']) |
644 | - || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['fammarine_id'])) |
|
644 | + || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['fammarine_id'])) |
|
645 | 645 | || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['fammarine_id']) && $_GET['fammarine_id'] == $spotter_item['fammarine_id']) |
646 | - || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['famtrackid'])) |
|
646 | + || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['famtrackid'])) |
|
647 | 647 | || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['famtrackid']) && $_GET['famtrackid'] == $spotter_item['famtrackid']) |
648 | 648 | ) { |
649 | 649 | if ($tracker) { |
@@ -672,9 +672,9 @@ discard block |
||
672 | 672 | require(dirname(__FILE__).'/require/class.MapMatching.php'); |
673 | 673 | $MapMatching = new MapMatching(); |
674 | 674 | if (isset($spotter_item['date_iso_8601'])) { |
675 | - $spotter_history_array_mm = array_merge($spotter_history_array,array(array('latitude' => $spotter_item['latitude'],'longitude' => $spotter_item['longitude'],'date' => date('c',strtotime($spotter_item['date_iso_8601']))))); |
|
675 | + $spotter_history_array_mm = array_merge($spotter_history_array, array(array('latitude' => $spotter_item['latitude'], 'longitude' => $spotter_item['longitude'], 'date' => date('c', strtotime($spotter_item['date_iso_8601']))))); |
|
676 | 676 | } else { |
677 | - $spotter_history_array_mm = array_merge($spotter_history_array,array(array('latitude' => $spotter_item['latitude'],'longitude' => $spotter_item['longitude'],'date' => date('c',strtotime($spotter_item['date']))))); |
|
677 | + $spotter_history_array_mm = array_merge($spotter_history_array, array(array('latitude' => $spotter_item['latitude'], 'longitude' => $spotter_item['longitude'], 'date' => date('c', strtotime($spotter_item['date']))))); |
|
678 | 678 | } |
679 | 679 | $spotter_history_array = $MapMatching->match($spotter_history_array_mm); |
680 | 680 | } |
@@ -706,9 +706,9 @@ discard block |
||
706 | 706 | else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
707 | 707 | } |
708 | 708 | $output_history .= '['; |
709 | - $output_history .= $spotter_history['longitude'].', '; |
|
710 | - $output_history .= $spotter_history['latitude'].', '; |
|
711 | - $output_history .= $spotter_history['altitude']*30.48; |
|
709 | + $output_history .= $spotter_history['longitude'].', '; |
|
710 | + $output_history .= $spotter_history['latitude'].', '; |
|
711 | + $output_history .= $spotter_history['altitude']*30.48; |
|
712 | 712 | $output_history .= '],'; |
713 | 713 | /* |
714 | 714 | if ($from_archive === false) { |
@@ -731,8 +731,8 @@ discard block |
||
731 | 731 | $d = true; |
732 | 732 | } |
733 | 733 | $output_history .= '['; |
734 | - $output_history .= $spotter_history['longitude'].', '; |
|
735 | - $output_history .= $spotter_history['latitude']; |
|
734 | + $output_history .= $spotter_history['longitude'].', '; |
|
735 | + $output_history .= $spotter_history['latitude']; |
|
736 | 736 | $output_history .= '],'; |
737 | 737 | /* |
738 | 738 | if ($from_archive === false) { |
@@ -748,9 +748,9 @@ discard block |
||
748 | 748 | //echo $output_history; |
749 | 749 | if ($from_archive === false && !isset($spotter_history_array[0]['mapmatching_engine'])) { |
750 | 750 | $output_historyd = '['; |
751 | - $output_historyd .= $spotter_item['longitude'].', '; |
|
752 | - $output_historyd .= $spotter_item['latitude']; |
|
753 | - if (isset($spotter_history['altitude'])) $output_historyd .= ','.$spotter_item['altitude']*30.48; |
|
751 | + $output_historyd .= $spotter_item['longitude'].', '; |
|
752 | + $output_historyd .= $spotter_item['latitude']; |
|
753 | + if (isset($spotter_history['altitude'])) $output_historyd .= ','.$spotter_item['altitude']*30.48; |
|
754 | 754 | $output_historyd .= '],'; |
755 | 755 | //$output_history = $output_historyd.$output_history; |
756 | 756 | $output_history = $output_history.$output_historyd; |
@@ -758,7 +758,7 @@ discard block |
||
758 | 758 | $last = array_pop($spotter_history_array); |
759 | 759 | $latitude = $last['latitude']; |
760 | 760 | $longitude = $last['longitude']; |
761 | - $output = str_replace('"coordinates": ['.$spotter_item['longitude'].', '.$spotter_item['latitude'].']}','"coordinates": ['.$longitude.', '.$latitude.']}',$output); |
|
761 | + $output = str_replace('"coordinates": ['.$spotter_item['longitude'].', '.$spotter_item['latitude'].']}', '"coordinates": ['.$longitude.', '.$latitude.']}', $output); |
|
762 | 762 | } |
763 | 763 | |
764 | 764 | $output_history = substr($output_history, 0, -1); |
@@ -769,7 +769,7 @@ discard block |
||
769 | 769 | } |
770 | 770 | } |
771 | 771 | |
772 | - if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
|
772 | + if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id'])) |
|
773 | 773 | || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
774 | 774 | && (isset($spotter_item['departure_airport']) |
775 | 775 | && $spotter_item['departure_airport'] != 'NA' |
@@ -803,7 +803,7 @@ discard block |
||
803 | 803 | |
804 | 804 | //if (isset($history) && $history != '' && $history == $spotter_item['ident'] && isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA' && isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA' && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") || (!isset($_COOKIE['MapRoute']) && (!isset($globalMapRoute) || (isset($globalMapRoute) && $globalMapRoute))))) { |
805 | 805 | //if (isset($history) && $history != '' && $history == $spotter_item['ident'] && isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA' && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") || (!isset($_COOKIE['MapRoute']) && (!isset($globalMapRoute) || (isset($globalMapRoute) && $globalMapRoute))))) { |
806 | - if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
|
806 | + if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id'])) |
|
807 | 807 | || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
808 | 808 | && (isset($spotter_item['arrival_airport']) |
809 | 809 | && $spotter_item['arrival_airport'] != 'NA' |
@@ -830,11 +830,11 @@ discard block |
||
830 | 830 | } |
831 | 831 | } |
832 | 832 | if ($havedata) { |
833 | - $line = $Common->greatCircle($spotter_item['latitude'],$spotter_item['longitude'],$end_lat,$end_lon); |
|
833 | + $line = $Common->greatCircle($spotter_item['latitude'], $spotter_item['longitude'], $end_lat, $end_lon); |
|
834 | 834 | foreach ($line[0] as $coord) { |
835 | 835 | $output_dest .= '['.$coord[0].','.$coord[1].'],'; |
836 | 836 | } |
837 | - $output_dest = substr($output_dest, 0, -1); |
|
837 | + $output_dest = substr($output_dest, 0, -1); |
|
838 | 838 | } |
839 | 839 | $output_dest .= ']}},'; |
840 | 840 | if ($havedata) $output .= $output_dest; |
@@ -844,7 +844,7 @@ discard block |
||
844 | 844 | $output = substr($output, 0, -1); |
845 | 845 | $output .= ']'; |
846 | 846 | $output .= ',"initial_sqltime": "'.$sqltime.'",'; |
847 | - $output .= '"totaltime": "'.round(microtime(true)-$begintime,2).'",'; |
|
847 | + $output .= '"totaltime": "'.round(microtime(true) - $begintime, 2).'",'; |
|
848 | 848 | if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",'; |
849 | 849 | $output .= '"fc": "'.$j.'"'; |
850 | 850 | } else { |
@@ -12,7 +12,9 @@ discard block |
||
12 | 12 | $tracker = false; |
13 | 13 | $marine = false; |
14 | 14 | $usecoord = false; |
15 | -if (isset($_GET['test'])) exit(); |
|
15 | +if (isset($_GET['test'])) { |
|
16 | + exit(); |
|
17 | +} |
|
16 | 18 | if (isset($_GET['tracker'])) { |
17 | 19 | $tracker = true; |
18 | 20 | } |
@@ -57,28 +59,55 @@ discard block |
||
57 | 59 | } |
58 | 60 | header('Content-Type: text/javascript'); |
59 | 61 | |
60 | -if (!isset($globalJsonCompress)) $compress = true; |
|
61 | -else $compress = $globalJsonCompress; |
|
62 | +if (!isset($globalJsonCompress)) { |
|
63 | + $compress = true; |
|
64 | +} else { |
|
65 | + $compress = $globalJsonCompress; |
|
66 | +} |
|
62 | 67 | |
63 | 68 | $from_archive = false; |
64 | 69 | $min = true; |
65 | 70 | $allhistory = false; |
66 | 71 | $filter['source'] = array(); |
67 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
68 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
69 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
70 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs')); |
|
71 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
72 | -if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
73 | -if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING); |
|
74 | -if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
75 | -if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
76 | -if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
77 | -if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING); |
|
72 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') { |
|
73 | + $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
74 | +} |
|
75 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') { |
|
76 | + $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
77 | +} |
|
78 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') { |
|
79 | + $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
80 | +} |
|
81 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') { |
|
82 | + $filter['source'] = array_merge($filter['source'],array('sbs','famaprs')); |
|
83 | +} |
|
84 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') { |
|
85 | + $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
86 | +} |
|
87 | +if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') { |
|
88 | + $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
89 | +} |
|
90 | +if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') { |
|
91 | + $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING); |
|
92 | +} |
|
93 | +if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') { |
|
94 | + $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
95 | +} |
|
96 | +if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') { |
|
97 | + $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
98 | +} |
|
99 | +if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') { |
|
100 | + $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
101 | +} |
|
102 | +if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') { |
|
103 | + $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING); |
|
104 | +} |
|
78 | 105 | |
79 | 106 | if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) { |
80 | 107 | $min = true; |
81 | -} else $min = false; |
|
108 | +} else { |
|
109 | + $min = false; |
|
110 | +} |
|
82 | 111 | |
83 | 112 | $spotter_array = array(); |
84 | 113 | |
@@ -189,24 +218,38 @@ discard block |
||
189 | 218 | $flightcnt = $SpotterLive->getLiveSpotterCount($filter); |
190 | 219 | } |
191 | 220 | } |
192 | - if ($flightcnt == '') $flightcnt = 0; |
|
193 | -} else $flightcnt = 0; |
|
221 | + if ($flightcnt == '') { |
|
222 | + $flightcnt = 0; |
|
223 | + } |
|
224 | + } else { |
|
225 | + $flightcnt = 0; |
|
226 | +} |
|
194 | 227 | |
195 | 228 | $sqltime = round(microtime(true)-$begintime,2); |
196 | 229 | |
197 | 230 | $currenttime = filter_input(INPUT_GET,'currenttime',FILTER_SANITIZE_NUMBER_INT); |
198 | -if ($currenttime != '') $currenttime = round($currenttime/1000); |
|
231 | +if ($currenttime != '') { |
|
232 | + $currenttime = round($currenttime/1000); |
|
233 | +} |
|
199 | 234 | |
200 | -if ((!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation == FALSE) || (isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'false')) $usenextlatlon = false; |
|
201 | -else $usenextlatlon = true; |
|
202 | -if ($usenextlatlon === false) $currenttime = ''; |
|
235 | +if ((!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation == FALSE) || (isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'false')) { |
|
236 | + $usenextlatlon = false; |
|
237 | +} else { |
|
238 | + $usenextlatlon = true; |
|
239 | +} |
|
240 | +if ($usenextlatlon === false) { |
|
241 | + $currenttime = ''; |
|
242 | +} |
|
203 | 243 | $j = 0; |
204 | 244 | $prev_flightaware_id = ''; |
205 | 245 | $aircrafts_shadow = array(); |
206 | 246 | $output = '{'; |
207 | 247 | $output .= '"type": "FeatureCollection",'; |
208 | - if ($min) $output .= '"minimal": "true",'; |
|
209 | - else $output .= '"minimal": "false",'; |
|
248 | + if ($min) { |
|
249 | + $output .= '"minimal": "true",'; |
|
250 | + } else { |
|
251 | + $output .= '"minimal": "false",'; |
|
252 | + } |
|
210 | 253 | //$output .= '"fc": "'.$flightcnt.'",'; |
211 | 254 | $output .= '"sqt": "'.$sqltime.'",'; |
212 | 255 | |
@@ -251,18 +294,29 @@ discard block |
||
251 | 294 | } |
252 | 295 | $output .= '"properties": {'; |
253 | 296 | if (isset($spotter_item['flightaware_id'])) { |
254 | - if ($compress) $output .= '"fi": "'.$spotter_item['flightaware_id'].'",'; |
|
255 | - else $output .= '"flightaware_id": "'.$spotter_item['flightaware_id'].'",'; |
|
297 | + if ($compress) { |
|
298 | + $output .= '"fi": "'.$spotter_item['flightaware_id'].'",'; |
|
299 | + } else { |
|
300 | + $output .= '"flightaware_id": "'.$spotter_item['flightaware_id'].'",'; |
|
301 | + } |
|
256 | 302 | } elseif (isset($spotter_item['famtrackid'])) { |
257 | - if ($compress) $output .= '"fti": "'.$spotter_item['famtrackid'].'",'; |
|
258 | - else $output .= '"famtrackid": "'.$spotter_item['famtrackid'].'",'; |
|
303 | + if ($compress) { |
|
304 | + $output .= '"fti": "'.$spotter_item['famtrackid'].'",'; |
|
305 | + } else { |
|
306 | + $output .= '"famtrackid": "'.$spotter_item['famtrackid'].'",'; |
|
307 | + } |
|
259 | 308 | } elseif (isset($spotter_item['fammarine_id'])) { |
260 | - if ($compress) $output .= '"fmi": "'.$spotter_item['fammarine_id'].'",'; |
|
261 | - else $output .= '"fammarineid": "'.$spotter_item['fammarine_id'].'",'; |
|
309 | + if ($compress) { |
|
310 | + $output .= '"fmi": "'.$spotter_item['fammarine_id'].'",'; |
|
311 | + } else { |
|
312 | + $output .= '"fammarineid": "'.$spotter_item['fammarine_id'].'",'; |
|
313 | + } |
|
262 | 314 | } |
263 | 315 | $output .= '"fc": "'.$flightcnt.'",'; |
264 | 316 | $output .= '"sqt": "'.$sqltime.'",'; |
265 | - if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",'; |
|
317 | + if (isset($begindate)) { |
|
318 | + $output .= '"archive_date": "'.$begindate.'",'; |
|
319 | + } |
|
266 | 320 | |
267 | 321 | /* |
268 | 322 | if ($min) $output .= '"minimal": "true",'; |
@@ -270,14 +324,22 @@ discard block |
||
270 | 324 | */ |
271 | 325 | //$output .= '"fc": "'.$spotter_item['nb'].'",'; |
272 | 326 | if (isset($spotter_item['ident']) && $spotter_item['ident'] != '') { |
273 | - if ($compress) $output .= '"c": "'.str_replace('\\','',$spotter_item['ident']).'",'; |
|
274 | - else $output .= '"callsign": "'.str_replace('\\','',$spotter_item['ident']).'",'; |
|
327 | + if ($compress) { |
|
328 | + $output .= '"c": "'.str_replace('\\','',$spotter_item['ident']).'",'; |
|
329 | + } else { |
|
330 | + $output .= '"callsign": "'.str_replace('\\','',$spotter_item['ident']).'",'; |
|
331 | + } |
|
275 | 332 | //" |
276 | 333 | } else { |
277 | - if ($compress) $output .= '"c": "NA",'; |
|
278 | - else $output .= '"callsign": "NA",'; |
|
334 | + if ($compress) { |
|
335 | + $output .= '"c": "NA",'; |
|
336 | + } else { |
|
337 | + $output .= '"callsign": "NA",'; |
|
338 | + } |
|
339 | + } |
|
340 | + if (isset($spotter_item['registration'])) { |
|
341 | + $output .= '"registration": "'.$spotter_item['registration'].'",'; |
|
279 | 342 | } |
280 | - if (isset($spotter_item['registration'])) $output .= '"registration": "'.$spotter_item['registration'].'",'; |
|
281 | 343 | if (isset($spotter_item['aircraft_name']) && isset($spotter_item['aircraft_type'])) { |
282 | 344 | $output .= '"aircraft_name": "'.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')",'; |
283 | 345 | $output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ','_',$spotter_item['aircraft_name'])).'",'; |
@@ -290,16 +352,23 @@ discard block |
||
290 | 352 | $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
291 | 353 | } |
292 | 354 | if (!isset($spotter_item['aircraft_shadow']) && !$tracker) { |
293 | - if (!isset($spotter_item['aircraft_icao']) || $spotter_item['aircraft_icao'] == '') $spotter_item['aircraft_shadow'] = ''; |
|
294 | - else { |
|
355 | + if (!isset($spotter_item['aircraft_icao']) || $spotter_item['aircraft_icao'] == '') { |
|
356 | + $spotter_item['aircraft_shadow'] = ''; |
|
357 | + } else { |
|
295 | 358 | $aircraft_icao = $spotter_item['aircraft_icao']; |
296 | - if (isset($aircrafts_shadow[$aircraft_icao])) $spotter_item['aircraft_shadow'] = $aircrafts_shadow[$aircraft_icao]; |
|
297 | - else { |
|
359 | + if (isset($aircrafts_shadow[$aircraft_icao])) { |
|
360 | + $spotter_item['aircraft_shadow'] = $aircrafts_shadow[$aircraft_icao]; |
|
361 | + } else { |
|
298 | 362 | $aircraft_info = $Spotter->getAllAircraftInfo($spotter_item['aircraft_icao']); |
299 | - if (count($aircraft_info) > 0) $spotter_item['aircraft_shadow'] = $aircraft_info[0]['aircraft_shadow']; |
|
300 | - elseif (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'aprs') $spotter_item['aircraft_shadow'] = 'PA18.png'; |
|
301 | - elseif ($aircraft_icao == 'PARAGLIDER') $spotter_item['aircraft_shadow'] = 'PARAGLIDER.png'; |
|
302 | - else $spotter_item['aircraft_shadow'] = ''; |
|
363 | + if (count($aircraft_info) > 0) { |
|
364 | + $spotter_item['aircraft_shadow'] = $aircraft_info[0]['aircraft_shadow']; |
|
365 | + } elseif (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'aprs') { |
|
366 | + $spotter_item['aircraft_shadow'] = 'PA18.png'; |
|
367 | + } elseif ($aircraft_icao == 'PARAGLIDER') { |
|
368 | + $spotter_item['aircraft_shadow'] = 'PARAGLIDER.png'; |
|
369 | + } else { |
|
370 | + $spotter_item['aircraft_shadow'] = ''; |
|
371 | + } |
|
303 | 372 | $aircrafts_shadow[$aircraft_icao] = $spotter_item['aircraft_shadow']; |
304 | 373 | } |
305 | 374 | } |
@@ -307,73 +376,139 @@ discard block |
||
307 | 376 | if (!isset($spotter_item['aircraft_shadow']) || $spotter_item['aircraft_shadow'] == '') { |
308 | 377 | if ($tracker) { |
309 | 378 | if (isset($spotter_item['type']) && $spotter_item['type'] == 'Ambulance') { |
310 | - if ($compress) $output .= '"as": "ambulance.png",'; |
|
311 | - else $output .= '"aircraft_shadow": "ambulance.png",'; |
|
379 | + if ($compress) { |
|
380 | + $output .= '"as": "ambulance.png",'; |
|
381 | + } else { |
|
382 | + $output .= '"aircraft_shadow": "ambulance.png",'; |
|
383 | + } |
|
312 | 384 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Police') { |
313 | - if ($compress) $output .= '"as": "police.png",'; |
|
314 | - else $output .= '"aircraft_shadow": "police.png",'; |
|
385 | + if ($compress) { |
|
386 | + $output .= '"as": "police.png",'; |
|
387 | + } else { |
|
388 | + $output .= '"aircraft_shadow": "police.png",'; |
|
389 | + } |
|
315 | 390 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Yacht (Sail)') { |
316 | - if ($compress) $output .= '"as": "ship.png",'; |
|
317 | - else $output .= '"aircraft_shadow": "ship.png",'; |
|
391 | + if ($compress) { |
|
392 | + $output .= '"as": "ship.png",'; |
|
393 | + } else { |
|
394 | + $output .= '"aircraft_shadow": "ship.png",'; |
|
395 | + } |
|
318 | 396 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Ship (Power Boat)') { |
319 | - if ($compress) $output .= '"as": "ship.png",'; |
|
320 | - else $output .= '"aircraft_shadow": "ship.png",'; |
|
397 | + if ($compress) { |
|
398 | + $output .= '"as": "ship.png",'; |
|
399 | + } else { |
|
400 | + $output .= '"aircraft_shadow": "ship.png",'; |
|
401 | + } |
|
321 | 402 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Shuttle') { |
322 | - if ($compress) $output .= '"as": "ship.png",'; |
|
323 | - else $output .= '"aircraft_shadow": "ship.png",'; |
|
403 | + if ($compress) { |
|
404 | + $output .= '"as": "ship.png",'; |
|
405 | + } else { |
|
406 | + $output .= '"aircraft_shadow": "ship.png",'; |
|
407 | + } |
|
324 | 408 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Truck') { |
325 | - if ($compress) $output .= '"as": "truck.png",'; |
|
326 | - else $output .= '"aircraft_shadow": "truck.png",'; |
|
409 | + if ($compress) { |
|
410 | + $output .= '"as": "truck.png",'; |
|
411 | + } else { |
|
412 | + $output .= '"aircraft_shadow": "truck.png",'; |
|
413 | + } |
|
327 | 414 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Truck (18 Wheeler)') { |
328 | - if ($compress) $output .= '"as": "truck.png",'; |
|
329 | - else $output .= '"aircraft_shadow": "truck.png",'; |
|
415 | + if ($compress) { |
|
416 | + $output .= '"as": "truck.png",'; |
|
417 | + } else { |
|
418 | + $output .= '"aircraft_shadow": "truck.png",'; |
|
419 | + } |
|
330 | 420 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Aircraft (small)') { |
331 | - if ($compress) $output .= '"as": "aircraft.png",'; |
|
332 | - else $output .= '"aircraft_shadow": "aircraft.png",'; |
|
421 | + if ($compress) { |
|
422 | + $output .= '"as": "aircraft.png",'; |
|
423 | + } else { |
|
424 | + $output .= '"aircraft_shadow": "aircraft.png",'; |
|
425 | + } |
|
333 | 426 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Large Aircraft') { |
334 | - if ($compress) $output .= '"as": "aircraft.png",'; |
|
335 | - else $output .= '"aircraft_shadow": "aircraft.png",'; |
|
427 | + if ($compress) { |
|
428 | + $output .= '"as": "aircraft.png",'; |
|
429 | + } else { |
|
430 | + $output .= '"aircraft_shadow": "aircraft.png",'; |
|
431 | + } |
|
336 | 432 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Helicopter') { |
337 | - if ($compress) $output .= '"as": "helico.png",'; |
|
338 | - else $output .= '"aircraft_shadow": "helico.png",'; |
|
433 | + if ($compress) { |
|
434 | + $output .= '"as": "helico.png",'; |
|
435 | + } else { |
|
436 | + $output .= '"aircraft_shadow": "helico.png",'; |
|
437 | + } |
|
339 | 438 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Railroad Engine') { |
340 | - if ($compress) $output .= '"as": "rail.png",'; |
|
341 | - else $output .= '"aircraft_shadow": "rail.png",'; |
|
439 | + if ($compress) { |
|
440 | + $output .= '"as": "rail.png",'; |
|
441 | + } else { |
|
442 | + $output .= '"aircraft_shadow": "rail.png",'; |
|
443 | + } |
|
342 | 444 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Firetruck') { |
343 | - if ($compress) $output .= '"as": "firetruck.png",'; |
|
344 | - else $output .= '"aircraft_shadow": "firetruck.png",'; |
|
445 | + if ($compress) { |
|
446 | + $output .= '"as": "firetruck.png",'; |
|
447 | + } else { |
|
448 | + $output .= '"aircraft_shadow": "firetruck.png",'; |
|
449 | + } |
|
345 | 450 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Bus') { |
346 | - if ($compress) $output .= '"as": "bus.png",'; |
|
347 | - else $output .= '"aircraft_shadow": "bus.png",'; |
|
451 | + if ($compress) { |
|
452 | + $output .= '"as": "bus.png",'; |
|
453 | + } else { |
|
454 | + $output .= '"aircraft_shadow": "bus.png",'; |
|
455 | + } |
|
348 | 456 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Phone') { |
349 | - if ($compress) $output .= '"as": "phone.png",'; |
|
350 | - else $output .= '"aircraft_shadow": "phone.png",'; |
|
457 | + if ($compress) { |
|
458 | + $output .= '"as": "phone.png",'; |
|
459 | + } else { |
|
460 | + $output .= '"aircraft_shadow": "phone.png",'; |
|
461 | + } |
|
351 | 462 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Jogger') { |
352 | - if ($compress) $output .= '"as": "jogger.png",'; |
|
353 | - else $output .= '"aircraft_shadow": "jogger.png",'; |
|
463 | + if ($compress) { |
|
464 | + $output .= '"as": "jogger.png",'; |
|
465 | + } else { |
|
466 | + $output .= '"aircraft_shadow": "jogger.png",'; |
|
467 | + } |
|
354 | 468 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Bike') { |
355 | - if ($compress) $output .= '"as": "bike.png",'; |
|
356 | - else $output .= '"aircraft_shadow": "bike.png",'; |
|
469 | + if ($compress) { |
|
470 | + $output .= '"as": "bike.png",'; |
|
471 | + } else { |
|
472 | + $output .= '"aircraft_shadow": "bike.png",'; |
|
473 | + } |
|
357 | 474 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Motorcycle') { |
358 | - if ($compress) $output .= '"as": "motorcycle.png",'; |
|
359 | - else $output .= '"aircraft_shadow": "motorcycle.png",'; |
|
475 | + if ($compress) { |
|
476 | + $output .= '"as": "motorcycle.png",'; |
|
477 | + } else { |
|
478 | + $output .= '"aircraft_shadow": "motorcycle.png",'; |
|
479 | + } |
|
360 | 480 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Balloon') { |
361 | - if ($compress) $output .= '"as": "balloon.png",'; |
|
362 | - else $output .= '"aircraft_shadow": "balloon.png",'; |
|
481 | + if ($compress) { |
|
482 | + $output .= '"as": "balloon.png",'; |
|
483 | + } else { |
|
484 | + $output .= '"aircraft_shadow": "balloon.png",'; |
|
485 | + } |
|
363 | 486 | } else { |
364 | - if ($compress) $output .= '"as": "car.png",'; |
|
365 | - else $output .= '"aircraft_shadow": "car.png",'; |
|
487 | + if ($compress) { |
|
488 | + $output .= '"as": "car.png",'; |
|
489 | + } else { |
|
490 | + $output .= '"aircraft_shadow": "car.png",'; |
|
491 | + } |
|
366 | 492 | } |
367 | 493 | } elseif ($marine) { |
368 | - if ($compress) $output .= '"as": "ship.png",'; |
|
369 | - else $output .= '"aircraft_shadow": "ship.png",'; |
|
494 | + if ($compress) { |
|
495 | + $output .= '"as": "ship.png",'; |
|
496 | + } else { |
|
497 | + $output .= '"aircraft_shadow": "ship.png",'; |
|
498 | + } |
|
370 | 499 | } else { |
371 | - if ($compress) $output .= '"as": "default.png",'; |
|
372 | - else $output .= '"aircraft_shadow": "default.png",'; |
|
500 | + if ($compress) { |
|
501 | + $output .= '"as": "default.png",'; |
|
502 | + } else { |
|
503 | + $output .= '"aircraft_shadow": "default.png",'; |
|
504 | + } |
|
373 | 505 | } |
374 | 506 | } else { |
375 | - if ($compress) $output .= '"as": "'.$spotter_item['aircraft_shadow'].'",'; |
|
376 | - else $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",'; |
|
507 | + if ($compress) { |
|
508 | + $output .= '"as": "'.$spotter_item['aircraft_shadow'].'",'; |
|
509 | + } else { |
|
510 | + $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",'; |
|
511 | + } |
|
377 | 512 | } |
378 | 513 | if (isset($spotter_item['airline_name'])) { |
379 | 514 | $output .= '"airline_name": "'.$spotter_item['airline_name'].'",'; |
@@ -381,8 +516,11 @@ discard block |
||
381 | 516 | $output .= '"airline_name": "NA",'; |
382 | 517 | } |
383 | 518 | if (isset($spotter_item['departure_airport'])) { |
384 | - if ($compress) $output .= '"dac": "'.$spotter_item['departure_airport'].'",'; |
|
385 | - else $output .= '"departure_airport_code": "'.$spotter_item['departure_airport'].'",'; |
|
519 | + if ($compress) { |
|
520 | + $output .= '"dac": "'.$spotter_item['departure_airport'].'",'; |
|
521 | + } else { |
|
522 | + $output .= '"departure_airport_code": "'.$spotter_item['departure_airport'].'",'; |
|
523 | + } |
|
386 | 524 | } |
387 | 525 | if (isset($spotter_item['departure_airport_city'])) { |
388 | 526 | $output .= '"departure_airport": "'.$spotter_item['departure_airport_city'].', '.$spotter_item['departure_airport_country'].'",'; |
@@ -394,8 +532,11 @@ discard block |
||
394 | 532 | $output .= '"arrival_airport_time": "'.$spotter_item['arrival_airport_time'].'",'; |
395 | 533 | } |
396 | 534 | if (isset($spotter_item['arrival_airport'])) { |
397 | - if ($compress) $output .= '"aac": "'.$spotter_item['arrival_airport'].'",'; |
|
398 | - else $output .= '"arrival_airport_code": "'.$spotter_item['arrival_airport'].'",'; |
|
535 | + if ($compress) { |
|
536 | + $output .= '"aac": "'.$spotter_item['arrival_airport'].'",'; |
|
537 | + } else { |
|
538 | + $output .= '"arrival_airport_code": "'.$spotter_item['arrival_airport'].'",'; |
|
539 | + } |
|
399 | 540 | } |
400 | 541 | if (isset($spotter_item['arrival_airport_city'])) { |
401 | 542 | $output .= '"arrival_airport": "'.$spotter_item['arrival_airport_city'].', '.$spotter_item['arrival_airport_country'].'",'; |
@@ -414,8 +555,11 @@ discard block |
||
414 | 555 | } |
415 | 556 | |
416 | 557 | if (isset($spotter_item['altitude'])) { |
417 | - if ($compress) $output .= '"a": "'.$spotter_item['altitude'].'",'; |
|
418 | - else $output .= '"altitude": "'.$spotter_item['altitude'].'",'; |
|
558 | + if ($compress) { |
|
559 | + $output .= '"a": "'.$spotter_item['altitude'].'",'; |
|
560 | + } else { |
|
561 | + $output .= '"altitude": "'.$spotter_item['altitude'].'",'; |
|
562 | + } |
|
419 | 563 | } |
420 | 564 | |
421 | 565 | $heading = $spotter_item['heading']; |
@@ -439,19 +583,24 @@ discard block |
||
439 | 583 | } |
440 | 584 | } |
441 | 585 | |
442 | - if ($compress)$output .= '"h": "'.$heading.'",'; |
|
443 | - else $output .= '"heading": "'.$heading.'",'; |
|
586 | + if ($compress) { |
|
587 | + $output .= '"h": "'.$heading.'",'; |
|
588 | + } else { |
|
589 | + $output .= '"heading": "'.$heading.'",'; |
|
590 | + } |
|
444 | 591 | if ($currenttime != '') { |
445 | 592 | if (strtotime($spotter_item['date']) < $currenttime) { |
446 | 593 | if (isset($archivespeed)) { |
447 | 594 | $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh)); |
448 | 595 | $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
449 | - if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
|
450 | - else { |
|
596 | + if (!isset($idistance) || $fdistance < $idistance) { |
|
597 | + $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
|
598 | + } else { |
|
451 | 599 | $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,$archivespeed,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh)); |
452 | 600 | $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
453 | - if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
|
454 | - else { |
|
601 | + if (!isset($idistance) || $fdistance < $idistance) { |
|
602 | + $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
|
603 | + } else { |
|
455 | 604 | $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed); |
456 | 605 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
457 | 606 | } |
@@ -459,12 +608,14 @@ discard block |
||
459 | 608 | } elseif ($usenextlatlon) { |
460 | 609 | $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,1,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh)); |
461 | 610 | $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
462 | - if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
|
463 | - else { |
|
611 | + if (!isset($idistance) || $fdistance < $idistance) { |
|
612 | + $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
|
613 | + } else { |
|
464 | 614 | $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,1,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh)); |
465 | 615 | $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
466 | - if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
|
467 | - else { |
|
616 | + if (!isset($idistance) || $fdistance < $idistance) { |
|
617 | + $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
|
618 | + } else { |
|
468 | 619 | $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading); |
469 | 620 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
470 | 621 | } |
@@ -503,7 +654,9 @@ discard block |
||
503 | 654 | } |
504 | 655 | } |
505 | 656 | |
506 | - if (!$min) $output .= '"image": "'.$image.'",'; |
|
657 | + if (!$min) { |
|
658 | + $output .= '"image": "'.$image.'",'; |
|
659 | + } |
|
507 | 660 | if (isset($spotter_item['image_copyright']) && $spotter_item['image_copyright'] != '') { |
508 | 661 | $output .= '"image_copyright": "'.str_replace('"',"'",trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'',$spotter_item['image_copyright']))).'",'; |
509 | 662 | } |
@@ -511,8 +664,11 @@ discard block |
||
511 | 664 | $output .= '"image_source_website": "'.urlencode($spotter_item['image_source_website']).'",'; |
512 | 665 | } |
513 | 666 | if (isset($spotter_item['squawk'])) { |
514 | - if ($compress) $output .= '"sq": "'.$spotter_item['squawk'].'",'; |
|
515 | - else $output .= '"squawk": "'.$spotter_item['squawk'].'",'; |
|
667 | + if ($compress) { |
|
668 | + $output .= '"sq": "'.$spotter_item['squawk'].'",'; |
|
669 | + } else { |
|
670 | + $output .= '"squawk": "'.$spotter_item['squawk'].'",'; |
|
671 | + } |
|
516 | 672 | } |
517 | 673 | if (isset($spotter_item['squawk_usage'])) { |
518 | 674 | $output .= '"squawk_usage": "'.$spotter_item['squawk_usage'].'",'; |
@@ -531,14 +687,23 @@ discard block |
||
531 | 687 | } |
532 | 688 | // type when not aircraft ? |
533 | 689 | if (isset($spotter_item['type'])) { |
534 | - if ($compress) $output .= '"t": "'.$spotter_item['type'].'"'; |
|
535 | - else $output .= '"type": "'.$spotter_item['type'].'"'; |
|
690 | + if ($compress) { |
|
691 | + $output .= '"t": "'.$spotter_item['type'].'"'; |
|
692 | + } else { |
|
693 | + $output .= '"type": "'.$spotter_item['type'].'"'; |
|
694 | + } |
|
536 | 695 | } elseif ($marine) { |
537 | - if ($compress) $output .= '"t": "ship"'; |
|
538 | - else $output .= '"type": "ship"'; |
|
696 | + if ($compress) { |
|
697 | + $output .= '"t": "ship"'; |
|
698 | + } else { |
|
699 | + $output .= '"type": "ship"'; |
|
700 | + } |
|
539 | 701 | } else { |
540 | - if ($compress) $output .= '"t": "aircraft"'; |
|
541 | - else $output .= '"type": "aircraft"'; |
|
702 | + if ($compress) { |
|
703 | + $output .= '"t": "aircraft"'; |
|
704 | + } else { |
|
705 | + $output .= '"type": "aircraft"'; |
|
706 | + } |
|
542 | 707 | } |
543 | 708 | $output .= '},'; |
544 | 709 | $output .= '"geometry": {'; |
@@ -546,15 +711,19 @@ discard block |
||
546 | 711 | $output .= '"coordinates": ['; |
547 | 712 | if ($currenttime != '') { |
548 | 713 | if (strtotime($spotter_item['date']) < $currenttime) { |
549 | - if (!isset($archivespeed)) $archivespeed = 1; |
|
714 | + if (!isset($archivespeed)) { |
|
715 | + $archivespeed = 1; |
|
716 | + } |
|
550 | 717 | $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed,($currenttime-strtotime($spotter_item['date']))); |
551 | 718 | $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
552 | - if (!isset($idistance) || $fdistance < $idistance) $output .= $nextcoord['longitude'].','.$nextcoord['latitude']; |
|
553 | - else { |
|
719 | + if (!isset($idistance) || $fdistance < $idistance) { |
|
720 | + $output .= $nextcoord['longitude'].','.$nextcoord['latitude']; |
|
721 | + } else { |
|
554 | 722 | $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,$archivespeed,($currenttime-strtotime($spotter_item['date']))); |
555 | 723 | $fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']); |
556 | - if (!isset($idistance) || $fdistance < $idistance) $output .= $nextcoord['longitude'].','.$nextcoord['latitude']; |
|
557 | - else { |
|
724 | + if (!isset($idistance) || $fdistance < $idistance) { |
|
725 | + $output .= $nextcoord['longitude'].','.$nextcoord['latitude']; |
|
726 | + } else { |
|
558 | 727 | $output .= $spotter_item['longitude'].', '; |
559 | 728 | $output .= $spotter_item['latitude']; |
560 | 729 | } |
@@ -632,7 +801,9 @@ discard block |
||
632 | 801 | } |
633 | 802 | */ |
634 | 803 | $history = filter_input(INPUT_GET,'history',FILTER_SANITIZE_STRING); |
635 | - if ($history == '' && isset($_COOKIE['history'])) $history = $_COOKIE['history']; |
|
804 | + if ($history == '' && isset($_COOKIE['history'])) { |
|
805 | + $history = $_COOKIE['history']; |
|
806 | + } |
|
636 | 807 | |
637 | 808 | if ( |
638 | 809 | (isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') |
@@ -702,8 +873,11 @@ discard block |
||
702 | 873 | $output_history .= ']}},'; |
703 | 874 | $output .= $output_history; |
704 | 875 | } |
705 | - if ($compress) $output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "history","a": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
|
706 | - else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
|
876 | + if ($compress) { |
|
877 | + $output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "history","a": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
|
878 | + } else { |
|
879 | + $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
|
880 | + } |
|
707 | 881 | } |
708 | 882 | $output_history .= '['; |
709 | 883 | $output_history .= $spotter_history['longitude'].', '; |
@@ -724,10 +898,15 @@ discard block |
||
724 | 898 | if ($d == false) { |
725 | 899 | if ($compress) { |
726 | 900 | $output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'",'; |
727 | - if (isset($spotter_history_array[0]['mapmatching_engine']) && $spotter_history_array[0]['mapmatching_engine'] == 'graphhopper') $output_history .= '"atr": "Powered by <a href=\"https://www.graphhopper.com/\">GraphHopper API</a>", Map matching engine use data from © <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a>",'; |
|
728 | - elseif (isset($spotter_history_array[0]['mapmatching_engine'])) $output_history .= '"atr": "Map matching engine use data from © <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a>",'; |
|
901 | + if (isset($spotter_history_array[0]['mapmatching_engine']) && $spotter_history_array[0]['mapmatching_engine'] == 'graphhopper') { |
|
902 | + $output_history .= '"atr": "Powered by <a href=\"https://www.graphhopper.com/\">GraphHopper API</a>", Map matching engine use data from © <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a>",'; |
|
903 | + } elseif (isset($spotter_history_array[0]['mapmatching_engine'])) { |
|
904 | + $output_history .= '"atr": "Map matching engine use data from © <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a>",'; |
|
905 | + } |
|
729 | 906 | $output_history .= '"t": "history"},"geometry": {"type": "LineString","coordinates": ['; |
730 | - } else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history"},"geometry": {"type": "LineString","coordinates": ['; |
|
907 | + } else { |
|
908 | + $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history"},"geometry": {"type": "LineString","coordinates": ['; |
|
909 | + } |
|
731 | 910 | $d = true; |
732 | 911 | } |
733 | 912 | $output_history .= '['; |
@@ -750,7 +929,9 @@ discard block |
||
750 | 929 | $output_historyd = '['; |
751 | 930 | $output_historyd .= $spotter_item['longitude'].', '; |
752 | 931 | $output_historyd .= $spotter_item['latitude']; |
753 | - if (isset($spotter_history['altitude'])) $output_historyd .= ','.$spotter_item['altitude']*30.48; |
|
932 | + if (isset($spotter_history['altitude'])) { |
|
933 | + $output_historyd .= ','.$spotter_item['altitude']*30.48; |
|
934 | + } |
|
754 | 935 | $output_historyd .= '],'; |
755 | 936 | //$output_history = $output_historyd.$output_history; |
756 | 937 | $output_history = $output_history.$output_historyd; |
@@ -777,8 +958,11 @@ discard block |
||
777 | 958 | && $spotter_item['arrival_airport'] != 'NA' |
778 | 959 | && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") |
779 | 960 | || (!isset($_COOKIE['MapRoute']) && isset($globalMapRoute) && $globalMapRoute)))) { |
780 | - if ($compress) $output_air = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
781 | - else $output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
961 | + if ($compress) { |
|
962 | + $output_air = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
963 | + } else { |
|
964 | + $output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
965 | + } |
|
782 | 966 | if (isset($spotter_item['departure_airport_latitude'])) { |
783 | 967 | $output_air .= '['.$spotter_item['departure_airport_longitude'].','.$spotter_item['departure_airport_latitude'].'],'; |
784 | 968 | } elseif (isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA') { |
@@ -811,8 +995,11 @@ discard block |
||
811 | 995 | || (!isset($_COOKIE['MapRemainingRoute']) && (!isset($globalMapRemainingRoute) |
812 | 996 | || (isset($globalMapRemainingRoute) && $globalMapRemainingRoute)))))) { |
813 | 997 | $havedata = false; |
814 | - if ($compress) $output_dest = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
815 | - else $output_dest = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
998 | + if ($compress) { |
|
999 | + $output_dest = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
1000 | + } else { |
|
1001 | + $output_dest = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
1002 | + } |
|
816 | 1003 | |
817 | 1004 | //$output_dest .= '['.$spotter_item['longitude'].','.$spotter_item['latitude'].'],'; |
818 | 1005 | if (isset($spotter_item['arrival_airport_latitude'])) { |
@@ -837,7 +1024,9 @@ discard block |
||
837 | 1024 | $output_dest = substr($output_dest, 0, -1); |
838 | 1025 | } |
839 | 1026 | $output_dest .= ']}},'; |
840 | - if ($havedata) $output .= $output_dest; |
|
1027 | + if ($havedata) { |
|
1028 | + $output .= $output_dest; |
|
1029 | + } |
|
841 | 1030 | unset($output_dest); |
842 | 1031 | } |
843 | 1032 | } |
@@ -845,7 +1034,9 @@ discard block |
||
845 | 1034 | $output .= ']'; |
846 | 1035 | $output .= ',"initial_sqltime": "'.$sqltime.'",'; |
847 | 1036 | $output .= '"totaltime": "'.round(microtime(true)-$begintime,2).'",'; |
848 | - if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",'; |
|
1037 | + if (isset($begindate)) { |
|
1038 | + $output .= '"archive_date": "'.$begindate.'",'; |
|
1039 | + } |
|
849 | 1040 | $output .= '"fc": "'.$j.'"'; |
850 | 1041 | } else { |
851 | 1042 | $output .= '"features": '; |
@@ -232,12 +232,12 @@ discard block |
||
232 | 232 | $previousts = strtotime($spotter_history['date']); |
233 | 233 | } |
234 | 234 | if (isset($output_time)) { |
235 | - $output_time = substr($output_time, 0, -1); |
|
236 | - $output .= '"time": ['.$output_time.'],'; |
|
235 | + $output_time = substr($output_time, 0, -1); |
|
236 | + $output .= '"time": ['.$output_time.'],'; |
|
237 | 237 | } |
238 | 238 | if (isset($output_timediff)) { |
239 | - $output_timediff = substr($output_timediff, 0, -1); |
|
240 | - $output .= '"timediff": ['.$output_timediff.'],'; |
|
239 | + $output_timediff = substr($output_timediff, 0, -1); |
|
240 | + $output .= '"timediff": ['.$output_timediff.'],'; |
|
241 | 241 | } |
242 | 242 | // FIXME : type when not aircraft ? |
243 | 243 | if ($compress) $output .= '"t": "aircraft"'; |
@@ -249,8 +249,8 @@ discard block |
||
249 | 249 | $output .= '"coordinates": ['; |
250 | 250 | |
251 | 251 | if (isset($output_history)) { |
252 | - $output_history = substr($output_history, 0, -1); |
|
253 | - $output .= $output_history; |
|
252 | + $output_history = substr($output_history, 0, -1); |
|
253 | + $output .= $output_history; |
|
254 | 254 | } |
255 | 255 | $output .= ']'; |
256 | 256 | $output .= '}'; |
@@ -22,13 +22,13 @@ discard block |
||
22 | 22 | $min = false; |
23 | 23 | $allhistory = false; |
24 | 24 | $filter['source'] = array(); |
25 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['ShowVATSIM']) && $_COOKIE['ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
26 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['ShowIVAO']) && $_COOKIE['ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
27 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['ShowVMS']) && $_COOKIE['ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
28 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['ShowSBS1']) && $_COOKIE['ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs')); |
|
29 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['ShowAPRS']) && $_COOKIE['ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
30 | -if (isset($_COOKIE['Airlines']) && $_COOKIE['Airlines'] != '') $filter['airlines'] = explode(',',$_COOKIE['Airlines']); |
|
31 | -if (isset($_COOKIE['Sources']) && $_COOKIE['Sources'] != '') $filter['source_aprs'] = explode(',',$_COOKIE['Sources']); |
|
25 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['ShowVATSIM']) && $_COOKIE['ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'], array('vatsimtxt')); |
|
26 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['ShowIVAO']) && $_COOKIE['ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'], array('whazzup')); |
|
27 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['ShowVMS']) && $_COOKIE['ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'], array('phpvmacars')); |
|
28 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['ShowSBS1']) && $_COOKIE['ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'], array('sbs')); |
|
29 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['ShowAPRS']) && $_COOKIE['ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'], array('aprs')); |
|
30 | +if (isset($_COOKIE['Airlines']) && $_COOKIE['Airlines'] != '') $filter['airlines'] = explode(',', $_COOKIE['Airlines']); |
|
31 | +if (isset($_COOKIE['Sources']) && $_COOKIE['Sources'] != '') $filter['source_aprs'] = explode(',', $_COOKIE['Sources']); |
|
32 | 32 | if (isset($_COOKIE['airlinestype']) && $_COOKIE['airlinestype'] != 'all') $filter['airlinestype'] = $_COOKIE['airlinestype']; |
33 | 33 | |
34 | 34 | if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) { |
@@ -36,12 +36,12 @@ discard block |
||
36 | 36 | } |
37 | 37 | |
38 | 38 | if (isset($_GET['ident'])) { |
39 | - $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
|
39 | + $ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING); |
|
40 | 40 | $from_archive = true; |
41 | 41 | $spotter_array = $SpotterArchive->getLastArchiveSpotterDataByIdent($ident); |
42 | 42 | $allhistory = true; |
43 | 43 | } elseif (isset($_GET['flightaware_id'])) { |
44 | - $flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING); |
|
44 | + $flightaware_id = filter_input(INPUT_GET, 'flightaware_id', FILTER_SANITIZE_STRING); |
|
45 | 45 | $from_archive = true; |
46 | 46 | $spotter_array = $SpotterArchive->getLastArchiveSpotterDataById($flightaware_id); |
47 | 47 | $allhistory = true; |
@@ -49,13 +49,13 @@ discard block |
||
49 | 49 | $from_archive = true; |
50 | 50 | // $begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
51 | 51 | // $enddate = filter_input(INPUT_GET,'enddate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
52 | - $begindate = filter_input(INPUT_GET,'begindate',FILTER_SANITIZE_NUMBER_INT); |
|
53 | - $enddate = filter_input(INPUT_GET,'enddate',FILTER_SANITIZE_NUMBER_INT); |
|
54 | - $archivespeed = filter_input(INPUT_GET,'speed',FILTER_SANITIZE_NUMBER_INT); |
|
55 | - $begindate = date('Y-m-d H:i:s',$begindate); |
|
56 | - $enddate = date('Y-m-d H:i:s',$enddate); |
|
52 | + $begindate = filter_input(INPUT_GET, 'begindate', FILTER_SANITIZE_NUMBER_INT); |
|
53 | + $enddate = filter_input(INPUT_GET, 'enddate', FILTER_SANITIZE_NUMBER_INT); |
|
54 | + $archivespeed = filter_input(INPUT_GET, 'speed', FILTER_SANITIZE_NUMBER_INT); |
|
55 | + $begindate = date('Y-m-d H:i:s', $begindate); |
|
56 | + $enddate = date('Y-m-d H:i:s', $enddate); |
|
57 | 57 | //$spotter_array = $SpotterArchive->getMinLiveSpotterDataPlayback($begindate,$enddate,$filter); |
58 | - $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate,$enddate,$filter); |
|
58 | + $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate, $enddate, $filter); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | if (!empty($spotter_array)) { |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | if ($flightcnt == '') $flightcnt = 0; |
65 | 65 | } else $flightcnt = 0; |
66 | 66 | |
67 | -$sqltime = round(microtime(true)-$begintime,2); |
|
67 | +$sqltime = round(microtime(true) - $begintime, 2); |
|
68 | 68 | |
69 | 69 | //var_dump($spotter_array); |
70 | 70 | $j = 0; |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | if (!empty($spotter_array) && is_array($spotter_array)) |
80 | 80 | { |
81 | 81 | $output .= '"features": ['; |
82 | - foreach($spotter_array as $spotter_item) |
|
82 | + foreach ($spotter_array as $spotter_item) |
|
83 | 83 | { |
84 | 84 | $j++; |
85 | 85 | date_default_timezone_set('UTC'); |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | if (isset($spotter_item['registration'])) $output .= '"registration": "'.$spotter_item['registration'].'",'; |
120 | 120 | if (isset($spotter_item['aircraft_name']) && isset($spotter_item['aircraft_type'])) { |
121 | 121 | $output .= '"aircraft_name": "'.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')",'; |
122 | - $output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ','_',$spotter_item['aircraft_name'])).'",'; |
|
122 | + $output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ', '_', $spotter_item['aircraft_name'])).'",'; |
|
123 | 123 | } elseif (isset($spotter_item['aircraft_type'])) { |
124 | 124 | $output .= '"aircraft_name": "NA ('.$spotter_item['aircraft_type'].')",'; |
125 | 125 | } elseif (!$min) { |
@@ -186,15 +186,15 @@ discard block |
||
186 | 186 | if ($compress)$output .= '"h": "'.$spotter_item['heading'].'",'; |
187 | 187 | else $output .= '"heading": "'.$spotter_item['heading'].'",'; |
188 | 188 | |
189 | - if (isset($archivespeed)) $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading'],$archivespeed); |
|
190 | - else $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading']); |
|
189 | + if (isset($archivespeed)) $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $spotter_item['heading'], $archivespeed); |
|
190 | + else $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $spotter_item['heading']); |
|
191 | 191 | //$output .= '"nextlatitude": "'.$nextcoord['latitude'].'",'; |
192 | 192 | //$output .= '"nextlongitude": "'.$nextcoord['longitude'].'",'; |
193 | 193 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
194 | 194 | |
195 | 195 | if (!$min) $output .= '"image": "'.$image.'",'; |
196 | 196 | if (isset($spotter_item['image_copyright']) && $spotter_item['image_copyright'] != '') { |
197 | - $output .= '"image_copyright": "'.str_replace('"',"'",trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'',$spotter_item['image_copyright']))).'",'; |
|
197 | + $output .= '"image_copyright": "'.str_replace('"', "'", trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '', $spotter_item['image_copyright']))).'",'; |
|
198 | 198 | } |
199 | 199 | if (isset($spotter_item['image_source_website'])) { |
200 | 200 | $output .= '"image_source_website": "'.urlencode($spotter_item['image_source_website']).'",'; |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | $output .= '"waypoints": "'.$spotter_item['waypoints'].'",'; |
217 | 217 | } |
218 | 218 | if (isset($spotter_item['acars'])) { |
219 | - $output .= '"acars": "'.trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"), '<br />',$spotter_item['acars']['message'])).'",'; |
|
219 | + $output .= '"acars": "'.trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '<br />', $spotter_item['acars']['message'])).'",'; |
|
220 | 220 | } |
221 | 221 | $spotter_history_array = $SpotterArchive->getCoordArchiveSpotterDataById($spotter_item['flightaware_id']); |
222 | 222 | //$spotter_history_array = array(); |
@@ -228,15 +228,15 @@ discard block |
||
228 | 228 | { |
229 | 229 | $output_history .= '['.$spotter_history['longitude'].', '.$spotter_history['latitude'].'],'; |
230 | 230 | $output_time .= (strtotime($spotter_history['date'])*1000).','; |
231 | - if ($previousts != 0) $output_timediff .= (strtotime($spotter_history['date'])-$previousts).','; |
|
231 | + if ($previousts != 0) $output_timediff .= (strtotime($spotter_history['date']) - $previousts).','; |
|
232 | 232 | $previousts = strtotime($spotter_history['date']); |
233 | 233 | } |
234 | 234 | if (isset($output_time)) { |
235 | - $output_time = substr($output_time, 0, -1); |
|
235 | + $output_time = substr($output_time, 0, -1); |
|
236 | 236 | $output .= '"time": ['.$output_time.'],'; |
237 | 237 | } |
238 | 238 | if (isset($output_timediff)) { |
239 | - $output_timediff = substr($output_timediff, 0, -1); |
|
239 | + $output_timediff = substr($output_timediff, 0, -1); |
|
240 | 240 | $output .= '"timediff": ['.$output_timediff.'],'; |
241 | 241 | } |
242 | 242 | // FIXME : type when not aircraft ? |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | $output .= '"coordinates": ['; |
250 | 250 | |
251 | 251 | if (isset($output_history)) { |
252 | - $output_history = substr($output_history, 0, -1); |
|
252 | + $output_history = substr($output_history, 0, -1); |
|
253 | 253 | $output .= $output_history; |
254 | 254 | } |
255 | 255 | $output .= ']'; |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | $output = substr($output, 0, -1); |
260 | 260 | $output .= ']'; |
261 | 261 | $output .= ',"initial_sqltime": "'.$sqltime.'",'; |
262 | - $output .= '"totaltime": "'.round(microtime(true)-$begintime,2).'",'; |
|
262 | + $output .= '"totaltime": "'.round(microtime(true) - $begintime, 2).'",'; |
|
263 | 263 | if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",'; |
264 | 264 | $output .= '"fc": "'.$flightcnt.'"'; |
265 | 265 | } else { |
@@ -15,21 +15,40 @@ discard block |
||
15 | 15 | } |
16 | 16 | header('Content-Type: text/javascript'); |
17 | 17 | |
18 | -if (!isset($globalJsonCompress)) $compress = true; |
|
19 | -else $compress = $globalJsonCompress; |
|
18 | +if (!isset($globalJsonCompress)) { |
|
19 | + $compress = true; |
|
20 | +} else { |
|
21 | + $compress = $globalJsonCompress; |
|
22 | +} |
|
20 | 23 | |
21 | 24 | $from_archive = false; |
22 | 25 | $min = false; |
23 | 26 | $allhistory = false; |
24 | 27 | $filter['source'] = array(); |
25 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['ShowVATSIM']) && $_COOKIE['ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
26 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['ShowIVAO']) && $_COOKIE['ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
27 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['ShowVMS']) && $_COOKIE['ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
28 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['ShowSBS1']) && $_COOKIE['ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs')); |
|
29 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['ShowAPRS']) && $_COOKIE['ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
30 | -if (isset($_COOKIE['Airlines']) && $_COOKIE['Airlines'] != '') $filter['airlines'] = explode(',',$_COOKIE['Airlines']); |
|
31 | -if (isset($_COOKIE['Sources']) && $_COOKIE['Sources'] != '') $filter['source_aprs'] = explode(',',$_COOKIE['Sources']); |
|
32 | -if (isset($_COOKIE['airlinestype']) && $_COOKIE['airlinestype'] != 'all') $filter['airlinestype'] = $_COOKIE['airlinestype']; |
|
28 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['ShowVATSIM']) && $_COOKIE['ShowVATSIM'] == 'true') { |
|
29 | + $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
30 | +} |
|
31 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['ShowIVAO']) && $_COOKIE['ShowIVAO'] == 'true') { |
|
32 | + $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
33 | +} |
|
34 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['ShowVMS']) && $_COOKIE['ShowVMS'] == 'true') { |
|
35 | + $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
36 | +} |
|
37 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['ShowSBS1']) && $_COOKIE['ShowSBS1'] == 'true') { |
|
38 | + $filter['source'] = array_merge($filter['source'],array('sbs')); |
|
39 | +} |
|
40 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['ShowAPRS']) && $_COOKIE['ShowAPRS'] == 'true') { |
|
41 | + $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
42 | +} |
|
43 | +if (isset($_COOKIE['Airlines']) && $_COOKIE['Airlines'] != '') { |
|
44 | + $filter['airlines'] = explode(',',$_COOKIE['Airlines']); |
|
45 | +} |
|
46 | +if (isset($_COOKIE['Sources']) && $_COOKIE['Sources'] != '') { |
|
47 | + $filter['source_aprs'] = explode(',',$_COOKIE['Sources']); |
|
48 | +} |
|
49 | +if (isset($_COOKIE['airlinestype']) && $_COOKIE['airlinestype'] != 'all') { |
|
50 | + $filter['airlinestype'] = $_COOKIE['airlinestype']; |
|
51 | +} |
|
33 | 52 | |
34 | 53 | if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) { |
35 | 54 | $min = true; |
@@ -61,8 +80,12 @@ discard block |
||
61 | 80 | if (!empty($spotter_array)) { |
62 | 81 | //$flightcnt = $SpotterArchive->getLiveSpotterCount($begindate,$enddate,$filter); |
63 | 82 | $flightcnt = 0; |
64 | - if ($flightcnt == '') $flightcnt = 0; |
|
65 | -} else $flightcnt = 0; |
|
83 | + if ($flightcnt == '') { |
|
84 | + $flightcnt = 0; |
|
85 | + } |
|
86 | + } else { |
|
87 | + $flightcnt = 0; |
|
88 | +} |
|
66 | 89 | |
67 | 90 | $sqltime = round(microtime(true)-$begintime,2); |
68 | 91 | |
@@ -71,8 +94,11 @@ discard block |
||
71 | 94 | |
72 | 95 | $output = '{'; |
73 | 96 | $output .= '"type": "FeatureCollection",'; |
74 | - if ($min) $output .= '"minimal": "true",'; |
|
75 | - else $output .= '"minimal": "false",'; |
|
97 | + if ($min) { |
|
98 | + $output .= '"minimal": "true",'; |
|
99 | + } else { |
|
100 | + $output .= '"minimal": "false",'; |
|
101 | + } |
|
76 | 102 | $output .= '"fc": "'.$flightcnt.'",'; |
77 | 103 | $output .= '"sqt": "'.$sqltime.'",'; |
78 | 104 | |
@@ -98,11 +124,16 @@ discard block |
||
98 | 124 | //$output .= '"fc": "'.$flightcnt.'",'; |
99 | 125 | //$output .= '"sqt": "'.$sqltime.'",'; |
100 | 126 | $output .= '"properties": {'; |
101 | - if ($compress) $output .= '"fi": "'.$spotter_item['flightaware_id'].'",'; |
|
102 | - else $output .= '"flightaware_id": "'.$spotter_item['flightaware_id'].'",'; |
|
127 | + if ($compress) { |
|
128 | + $output .= '"fi": "'.$spotter_item['flightaware_id'].'",'; |
|
129 | + } else { |
|
130 | + $output .= '"flightaware_id": "'.$spotter_item['flightaware_id'].'",'; |
|
131 | + } |
|
103 | 132 | $output .= '"fc": "'.$flightcnt.'",'; |
104 | 133 | $output .= '"sqt": "'.$sqltime.'",'; |
105 | - if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",'; |
|
134 | + if (isset($begindate)) { |
|
135 | + $output .= '"archive_date": "'.$begindate.'",'; |
|
136 | + } |
|
106 | 137 | |
107 | 138 | /* |
108 | 139 | if ($min) $output .= '"minimal": "true",'; |
@@ -110,13 +141,21 @@ discard block |
||
110 | 141 | */ |
111 | 142 | //$output .= '"fc": "'.$spotter_item['nb'].'",'; |
112 | 143 | if (isset($spotter_item['ident']) && $spotter_item['ident'] != '') { |
113 | - if ($compress) $output .= '"c": "'.$spotter_item['ident'].'",'; |
|
114 | - else $output .= '"callsign": "'.$spotter_item['ident'].'",'; |
|
144 | + if ($compress) { |
|
145 | + $output .= '"c": "'.$spotter_item['ident'].'",'; |
|
146 | + } else { |
|
147 | + $output .= '"callsign": "'.$spotter_item['ident'].'",'; |
|
148 | + } |
|
115 | 149 | } else { |
116 | - if ($compress) $output .= '"c": "NA",'; |
|
117 | - else $output .= '"callsign": "NA",'; |
|
150 | + if ($compress) { |
|
151 | + $output .= '"c": "NA",'; |
|
152 | + } else { |
|
153 | + $output .= '"callsign": "NA",'; |
|
154 | + } |
|
155 | + } |
|
156 | + if (isset($spotter_item['registration'])) { |
|
157 | + $output .= '"registration": "'.$spotter_item['registration'].'",'; |
|
118 | 158 | } |
119 | - if (isset($spotter_item['registration'])) $output .= '"registration": "'.$spotter_item['registration'].'",'; |
|
120 | 159 | if (isset($spotter_item['aircraft_name']) && isset($spotter_item['aircraft_type'])) { |
121 | 160 | $output .= '"aircraft_name": "'.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')",'; |
122 | 161 | $output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ','_',$spotter_item['aircraft_name'])).'",'; |
@@ -129,19 +168,29 @@ discard block |
||
129 | 168 | $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
130 | 169 | } |
131 | 170 | if (!isset($spotter_item['aircraft_shadow'])) { |
132 | - if (!isset($spotter_item['aircraft_icao']) || $spotter_item['aircraft_icao'] == '') $spotter_item['aircraft_shadow'] = ''; |
|
133 | - else { |
|
171 | + if (!isset($spotter_item['aircraft_icao']) || $spotter_item['aircraft_icao'] == '') { |
|
172 | + $spotter_item['aircraft_shadow'] = ''; |
|
173 | + } else { |
|
134 | 174 | $aircraft_info = $Spotter->getAllAircraftInfo($spotter_item['aircraft_icao']); |
135 | - if (count($aircraft_info) > 0) $spotter_item['aircraft_shadow'] = $aircraft_info[0]['aircraft_shadow']; |
|
136 | - else $spotter_item['aircraft_shadow'] = ''; |
|
175 | + if (count($aircraft_info) > 0) { |
|
176 | + $spotter_item['aircraft_shadow'] = $aircraft_info[0]['aircraft_shadow']; |
|
177 | + } else { |
|
178 | + $spotter_item['aircraft_shadow'] = ''; |
|
179 | + } |
|
137 | 180 | } |
138 | 181 | } |
139 | 182 | if ($spotter_item['aircraft_shadow'] == '') { |
140 | - if ($compress) $output .= '"as": "default.png",'; |
|
141 | - else $output .= '"aircraft_shadow": "default.png",'; |
|
183 | + if ($compress) { |
|
184 | + $output .= '"as": "default.png",'; |
|
185 | + } else { |
|
186 | + $output .= '"aircraft_shadow": "default.png",'; |
|
187 | + } |
|
142 | 188 | } else { |
143 | - if ($compress) $output .= '"as": "'.$spotter_item['aircraft_shadow'].'",'; |
|
144 | - else $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",'; |
|
189 | + if ($compress) { |
|
190 | + $output .= '"as": "'.$spotter_item['aircraft_shadow'].'",'; |
|
191 | + } else { |
|
192 | + $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",'; |
|
193 | + } |
|
145 | 194 | } |
146 | 195 | if (isset($spotter_item['airline_name'])) { |
147 | 196 | $output .= '"airline_name": "'.$spotter_item['airline_name'].'",'; |
@@ -149,8 +198,11 @@ discard block |
||
149 | 198 | $output .= '"airline_name": "NA",'; |
150 | 199 | } |
151 | 200 | if (isset($spotter_item['departure_airport'])) { |
152 | - if ($compress) $output .= '"dac": "'.$spotter_item['departure_airport'].'",'; |
|
153 | - else $output .= '"departure_airport_code": "'.$spotter_item['departure_airport'].'",'; |
|
201 | + if ($compress) { |
|
202 | + $output .= '"dac": "'.$spotter_item['departure_airport'].'",'; |
|
203 | + } else { |
|
204 | + $output .= '"departure_airport_code": "'.$spotter_item['departure_airport'].'",'; |
|
205 | + } |
|
154 | 206 | } |
155 | 207 | if (isset($spotter_item['departure_airport_city'])) { |
156 | 208 | $output .= '"departure_airport": "'.$spotter_item['departure_airport_city'].', '.$spotter_item['departure_airport_country'].'",'; |
@@ -162,8 +214,11 @@ discard block |
||
162 | 214 | $output .= '"arrival_airport_time": "'.$spotter_item['arrival_airport_time'].'",'; |
163 | 215 | } |
164 | 216 | if (isset($spotter_item['arrival_airport'])) { |
165 | - if ($compress) $output .= '"aac": "'.$spotter_item['arrival_airport'].'",'; |
|
166 | - else $output .= '"arrival_airport_code": "'.$spotter_item['arrival_airport'].'",'; |
|
217 | + if ($compress) { |
|
218 | + $output .= '"aac": "'.$spotter_item['arrival_airport'].'",'; |
|
219 | + } else { |
|
220 | + $output .= '"arrival_airport_code": "'.$spotter_item['arrival_airport'].'",'; |
|
221 | + } |
|
167 | 222 | } |
168 | 223 | if (isset($spotter_item['arrival_airport_city'])) { |
169 | 224 | $output .= '"arrival_airport": "'.$spotter_item['arrival_airport_city'].', '.$spotter_item['arrival_airport_country'].'",'; |
@@ -181,18 +236,29 @@ discard block |
||
181 | 236 | $output .= '"ground_speed": "'.$spotter_item['ground_speed'].'",'; |
182 | 237 | } |
183 | 238 | |
184 | - if ($compress) $output .= '"a": "'.$spotter_item['altitude'].'",'; |
|
185 | - else $output .= '"altitude": "'.$spotter_item['altitude'].'",'; |
|
186 | - if ($compress)$output .= '"h": "'.$spotter_item['heading'].'",'; |
|
187 | - else $output .= '"heading": "'.$spotter_item['heading'].'",'; |
|
239 | + if ($compress) { |
|
240 | + $output .= '"a": "'.$spotter_item['altitude'].'",'; |
|
241 | + } else { |
|
242 | + $output .= '"altitude": "'.$spotter_item['altitude'].'",'; |
|
243 | + } |
|
244 | + if ($compress) { |
|
245 | + $output .= '"h": "'.$spotter_item['heading'].'",'; |
|
246 | + } else { |
|
247 | + $output .= '"heading": "'.$spotter_item['heading'].'",'; |
|
248 | + } |
|
188 | 249 | |
189 | - if (isset($archivespeed)) $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading'],$archivespeed); |
|
190 | - else $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading']); |
|
250 | + if (isset($archivespeed)) { |
|
251 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading'],$archivespeed); |
|
252 | + } else { |
|
253 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading']); |
|
254 | + } |
|
191 | 255 | //$output .= '"nextlatitude": "'.$nextcoord['latitude'].'",'; |
192 | 256 | //$output .= '"nextlongitude": "'.$nextcoord['longitude'].'",'; |
193 | 257 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
194 | 258 | |
195 | - if (!$min) $output .= '"image": "'.$image.'",'; |
|
259 | + if (!$min) { |
|
260 | + $output .= '"image": "'.$image.'",'; |
|
261 | + } |
|
196 | 262 | if (isset($spotter_item['image_copyright']) && $spotter_item['image_copyright'] != '') { |
197 | 263 | $output .= '"image_copyright": "'.str_replace('"',"'",trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'',$spotter_item['image_copyright']))).'",'; |
198 | 264 | } |
@@ -200,8 +266,11 @@ discard block |
||
200 | 266 | $output .= '"image_source_website": "'.urlencode($spotter_item['image_source_website']).'",'; |
201 | 267 | } |
202 | 268 | if (isset($spotter_item['squawk'])) { |
203 | - if ($compress) $output .= '"sq": "'.$spotter_item['squawk'].'",'; |
|
204 | - else $output .= '"squawk": "'.$spotter_item['squawk'].'",'; |
|
269 | + if ($compress) { |
|
270 | + $output .= '"sq": "'.$spotter_item['squawk'].'",'; |
|
271 | + } else { |
|
272 | + $output .= '"squawk": "'.$spotter_item['squawk'].'",'; |
|
273 | + } |
|
205 | 274 | } |
206 | 275 | if (isset($spotter_item['squawk_usage'])) { |
207 | 276 | $output .= '"squawk_usage": "'.$spotter_item['squawk_usage'].'",'; |
@@ -228,7 +297,9 @@ discard block |
||
228 | 297 | { |
229 | 298 | $output_history .= '['.$spotter_history['longitude'].', '.$spotter_history['latitude'].'],'; |
230 | 299 | $output_time .= (strtotime($spotter_history['date'])*1000).','; |
231 | - if ($previousts != 0) $output_timediff .= (strtotime($spotter_history['date'])-$previousts).','; |
|
300 | + if ($previousts != 0) { |
|
301 | + $output_timediff .= (strtotime($spotter_history['date'])-$previousts).','; |
|
302 | + } |
|
232 | 303 | $previousts = strtotime($spotter_history['date']); |
233 | 304 | } |
234 | 305 | if (isset($output_time)) { |
@@ -240,8 +311,11 @@ discard block |
||
240 | 311 | $output .= '"timediff": ['.$output_timediff.'],'; |
241 | 312 | } |
242 | 313 | // FIXME : type when not aircraft ? |
243 | - if ($compress) $output .= '"t": "aircraft"'; |
|
244 | - else $output .= '"type": "aircraft"'; |
|
314 | + if ($compress) { |
|
315 | + $output .= '"t": "aircraft"'; |
|
316 | + } else { |
|
317 | + $output .= '"type": "aircraft"'; |
|
318 | + } |
|
245 | 319 | $output .= '},'; |
246 | 320 | $output .= '"geometry": {'; |
247 | 321 | $output .= '"type": "MultiPoint",'; |
@@ -260,7 +334,9 @@ discard block |
||
260 | 334 | $output .= ']'; |
261 | 335 | $output .= ',"initial_sqltime": "'.$sqltime.'",'; |
262 | 336 | $output .= '"totaltime": "'.round(microtime(true)-$begintime,2).'",'; |
263 | - if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",'; |
|
337 | + if (isset($begindate)) { |
|
338 | + $output .= '"archive_date": "'.$begindate.'",'; |
|
339 | + } |
|
264 | 340 | $output .= '"fc": "'.$flightcnt.'"'; |
265 | 341 | } else { |
266 | 342 | $output .= '"features": '; |