@@ -188,13 +188,13 @@ discard block |
||
188 | 188 | <p> |
189 | 189 | <label for="siteurl">Site directory</label> |
190 | 190 | <?php |
191 | - // Try to detect site directory |
|
192 | - if ((!isset($globalURL) || $globalURL == '') && (!isset($globalDBuser) || $globalDBuser == '')) { |
|
191 | + // Try to detect site directory |
|
192 | + if ((!isset($globalURL) || $globalURL == '') && (!isset($globalDBuser) || $globalDBuser == '')) { |
|
193 | 193 | if (isset($_SERVER['REQUEST_URI'])) { |
194 | 194 | $URL = $_SERVER['REQUEST_URI']; |
195 | 195 | $globalURL = str_replace('/install','',str_replace('/install/','',str_replace('/install/index.php','',$URL))); |
196 | 196 | } |
197 | - } |
|
197 | + } |
|
198 | 198 | ?> |
199 | 199 | <input type="text" name="siteurl" id="siteurl" value="<?php if (isset($globalURL)) print $globalURL; ?>" /> |
200 | 200 | <p class="help-block">ex : <i>/flightairmap</i> if complete URL is <i>http://toto.com/flightairmap</i></p> |
@@ -373,17 +373,17 @@ discard block |
||
373 | 373 | </tr> |
374 | 374 | |
375 | 375 | <?php |
376 | - if (isset($globalDBuser) && isset($globalDBpass) && $globalDBuser != '' && $globalDBpass != '') { |
|
376 | + if (isset($globalDBuser) && isset($globalDBpass) && $globalDBuser != '' && $globalDBpass != '') { |
|
377 | 377 | ?> |
378 | 378 | <!-- |
379 | 379 | <?php |
380 | - require_once(dirname(__FILE__).'/../require/class.Connection.php'); |
|
381 | - $Connection = new Connection(); |
|
380 | + require_once(dirname(__FILE__).'/../require/class.Connection.php'); |
|
381 | + $Connection = new Connection(); |
|
382 | 382 | ?> |
383 | 383 | --> |
384 | 384 | <?php |
385 | 385 | if ($Connection->db != NULL) { |
386 | - if ($Connection->tableExists('source_location')) { |
|
386 | + if ($Connection->tableExists('source_location')) { |
|
387 | 387 | require_once(dirname(__FILE__).'/../require/class.Source.php'); |
388 | 388 | $Source = new Source(); |
389 | 389 | //$alllocations = $Source->getAllLocationInfo(); |
@@ -403,9 +403,9 @@ discard block |
||
403 | 403 | |
404 | 404 | <?php |
405 | 405 | } |
406 | - } |
|
406 | + } |
|
407 | + } |
|
407 | 408 | } |
408 | - } |
|
409 | 409 | ?> |
410 | 410 | |
411 | 411 | <tr> |
@@ -515,12 +515,12 @@ discard block |
||
515 | 515 | ?> |
516 | 516 | <tr> |
517 | 517 | <?php |
518 | - if (filter_var($source['host'],FILTER_VALIDATE_URL)) { |
|
518 | + if (filter_var($source['host'],FILTER_VALIDATE_URL)) { |
|
519 | 519 | ?> |
520 | 520 | <td><input type="text" name="host[]" id="host" value="<?php print $source['host']; ?>" /></td> |
521 | 521 | <td><input type="text" name="port[]" class="col-xs-2" id="port" value="<?php if (isset($source['port'])) print $source['port']; ?>" /></td> |
522 | 522 | <?php |
523 | - } else { |
|
523 | + } else { |
|
524 | 524 | $hostport = explode(':',$source['host']); |
525 | 525 | if (isset($hostport[1])) { |
526 | 526 | $host = $hostport[0]; |
@@ -533,7 +533,7 @@ discard block |
||
533 | 533 | <td><input type="text" name="host[]" id="host" value="<?php print $host; ?>" /></td> |
534 | 534 | <td><input type="text" name="port[]" class="col-xs-2" id="port" value="<?php print $port; ?>" /></td> |
535 | 535 | <?php |
536 | - } |
|
536 | + } |
|
537 | 537 | ?> |
538 | 538 | <td> |
539 | 539 | <select name="format[]" id="format"> |
@@ -673,9 +673,9 @@ discard block |
||
673 | 673 | </thead> |
674 | 674 | <tbody> |
675 | 675 | <?php |
676 | - if (isset($globalNewsFeeds) && !empty($globalNewsFeeds)) { |
|
676 | + if (isset($globalNewsFeeds) && !empty($globalNewsFeeds)) { |
|
677 | 677 | foreach ($globalNewsFeeds as $type => $feedslng) { |
678 | - foreach ($feedslng as $lng => $feeds) { |
|
678 | + foreach ($feedslng as $lng => $feeds) { |
|
679 | 679 | foreach ($feeds as $feed) { |
680 | 680 | ?> |
681 | 681 | <tr> |
@@ -700,9 +700,9 @@ discard block |
||
700 | 700 | |
701 | 701 | <?php |
702 | 702 | } |
703 | - } |
|
703 | + } |
|
704 | + } |
|
704 | 705 | } |
705 | - } |
|
706 | 706 | ?> |
707 | 707 | <tr> |
708 | 708 | <td><input type="url" name="newsurl[]" /></td> |
@@ -1092,7 +1092,7 @@ discard block |
||
1092 | 1092 | <br /> |
1093 | 1093 | <p> |
1094 | 1094 | <?php |
1095 | - if (extension_loaded('gd') && function_exists('gd_info')) { |
|
1095 | + if (extension_loaded('gd') && function_exists('gd_info')) { |
|
1096 | 1096 | ?> |
1097 | 1097 | <label for="aircrafticoncolor">Color of aircraft icon on map</label> |
1098 | 1098 | <input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) echo $globalAircraftIconColor; else echo '1a3151'; ?>" /> |
@@ -1102,11 +1102,11 @@ discard block |
||
1102 | 1102 | <b>The directory cache is not writable, aircraft icon will not be cached</b> |
1103 | 1103 | <?php |
1104 | 1104 | } |
1105 | - } else { |
|
1105 | + } else { |
|
1106 | 1106 | ?> |
1107 | 1107 | <b>PHP GD is not installed, you can't change color of aircraft icon on map</b> |
1108 | 1108 | <?php |
1109 | - } |
|
1109 | + } |
|
1110 | 1110 | ?> |
1111 | 1111 | </p> |
1112 | 1112 | <br /> |
@@ -1130,7 +1130,7 @@ discard block |
||
1130 | 1130 | </p> |
1131 | 1131 | <?php |
1132 | 1132 | require('../footer.php'); |
1133 | - exit; |
|
1133 | + exit; |
|
1134 | 1134 | } |
1135 | 1135 | // ' |
1136 | 1136 | $settings = array(); |
@@ -1221,8 +1221,8 @@ discard block |
||
1221 | 1221 | |
1222 | 1222 | $sources = array(); |
1223 | 1223 | foreach ($source_name as $keys => $name) { |
1224 | - if (isset($source_id[$keys])) $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'id' => $source_id[$keys],'source' => $source_ref[$keys]); |
|
1225 | - else $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'source' => $source_ref[$keys]); |
|
1224 | + if (isset($source_id[$keys])) $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'id' => $source_id[$keys],'source' => $source_ref[$keys]); |
|
1225 | + else $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'source' => $source_ref[$keys]); |
|
1226 | 1226 | } |
1227 | 1227 | if (count($sources) > 0) $_SESSION['sources'] = $sources; |
1228 | 1228 | |
@@ -1232,13 +1232,13 @@ discard block |
||
1232 | 1232 | |
1233 | 1233 | $newsfeeds = array(); |
1234 | 1234 | foreach($newsurl as $newskey => $url) { |
1235 | - if ($url != '') { |
|
1235 | + if ($url != '') { |
|
1236 | 1236 | $type = $newstype[$newskey]; |
1237 | 1237 | $lng = $newslng[$newskey]; |
1238 | 1238 | if (isset($newsfeeds[$type][$lng])) { |
1239 | - $newsfeeds[$type][$lng] = array_merge($newsfeeds[$type][$lng],array($url)); |
|
1239 | + $newsfeeds[$type][$lng] = array_merge($newsfeeds[$type][$lng],array($url)); |
|
1240 | 1240 | } else $newsfeeds[$type][$lng] = array($url); |
1241 | - } |
|
1241 | + } |
|
1242 | 1242 | } |
1243 | 1243 | $settings = array_merge($settings,array('globalNewsFeeds' => $newsfeeds)); |
1244 | 1244 | |
@@ -1681,14 +1681,14 @@ discard block |
||
1681 | 1681 | |
1682 | 1682 | // Set some defaults values... |
1683 | 1683 | if (!isset($globalAircraftImageSources)) { |
1684 | - $globalAircraftImageSources = array('ivaomtl','wikimedia','airportdata','deviantart','flickr','bing','jetphotos','planepictures','planespotters'); |
|
1685 | - $settings = array_merge($settings,array('globalAircraftImageSources' => $globalAircraftImageSources)); |
|
1684 | + $globalAircraftImageSources = array('ivaomtl','wikimedia','airportdata','deviantart','flickr','bing','jetphotos','planepictures','planespotters'); |
|
1685 | + $settings = array_merge($settings,array('globalAircraftImageSources' => $globalAircraftImageSources)); |
|
1686 | 1686 | } |
1687 | 1687 | |
1688 | 1688 | if (!isset($globalSchedulesSources)) { |
1689 | - $globalSchedulesSources = array('flightmapper','costtotravel','flightradar24','flightaware'); |
|
1690 | - $settings = array_merge($settings,array('globalSchedulesSources' => $globalSchedulesSources)); |
|
1691 | - } |
|
1689 | + $globalSchedulesSources = array('flightmapper','costtotravel','flightradar24','flightaware'); |
|
1690 | + $settings = array_merge($settings,array('globalSchedulesSources' => $globalSchedulesSources)); |
|
1691 | + } |
|
1692 | 1692 | |
1693 | 1693 | $settings = array_merge($settings,array('globalInstalled' => 'TRUE')); |
1694 | 1694 | |
@@ -1736,21 +1736,21 @@ discard block |
||
1736 | 1736 | $popi = false; |
1737 | 1737 | $popw = false; |
1738 | 1738 | foreach ($_SESSION['done'] as $done) { |
1739 | - print '<li>'.$done.'....<strong>SUCCESS</strong></li>'; |
|
1740 | - if ($done == 'Create database') $pop = true; |
|
1741 | - if ($_SESSION['install'] == 'database_create') $pop = true; |
|
1742 | - if ($_SESSION['install'] == 'database_import') $popi = true; |
|
1743 | - if ($_SESSION['install'] == 'waypoints') $popw = true; |
|
1739 | + print '<li>'.$done.'....<strong>SUCCESS</strong></li>'; |
|
1740 | + if ($done == 'Create database') $pop = true; |
|
1741 | + if ($_SESSION['install'] == 'database_create') $pop = true; |
|
1742 | + if ($_SESSION['install'] == 'database_import') $popi = true; |
|
1743 | + if ($_SESSION['install'] == 'waypoints') $popw = true; |
|
1744 | 1744 | } |
1745 | 1745 | if ($pop) { |
1746 | - sleep(5); |
|
1747 | - print '<li>Create database....<img src="../images/loading.gif" /></li>'; |
|
1746 | + sleep(5); |
|
1747 | + print '<li>Create database....<img src="../images/loading.gif" /></li>'; |
|
1748 | 1748 | } else if ($popi) { |
1749 | - sleep(5); |
|
1750 | - print '<li>Create and import tables....<img src="../images/loading.gif" /></li>'; |
|
1749 | + sleep(5); |
|
1750 | + print '<li>Create and import tables....<img src="../images/loading.gif" /></li>'; |
|
1751 | 1751 | } else if ($popw) { |
1752 | - sleep(5); |
|
1753 | - print '<li>Populate waypoints database....<img src="../images/loading.gif" /></li>'; |
|
1752 | + sleep(5); |
|
1753 | + print '<li>Populate waypoints database....<img src="../images/loading.gif" /></li>'; |
|
1754 | 1754 | } else print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>'; |
1755 | 1755 | print '</div></ul>'; |
1756 | 1756 | print '<div id="error"></div>'; |
@@ -1816,7 +1816,7 @@ discard block |
||
1816 | 1816 | unset($_COOKIE['install']); |
1817 | 1817 | print '<div class="info column"><ul>'; |
1818 | 1818 | foreach ($_SESSION['done'] as $done) { |
1819 | - print '<li>'.$done.'....<strong>SUCCESS</strong></li>'; |
|
1819 | + print '<li>'.$done.'....<strong>SUCCESS</strong></li>'; |
|
1820 | 1820 | } |
1821 | 1821 | print '<li>Reloading page to check all is now ok....<strong>SUCCESS</strong></li>'; |
1822 | 1822 | print '</ul></div>'; |
@@ -13,23 +13,23 @@ discard block |
||
13 | 13 | $marine = false; |
14 | 14 | $usecoord = false; |
15 | 15 | if (isset($_GET['tracker'])) { |
16 | - $tracker = true; |
|
16 | + $tracker = true; |
|
17 | 17 | } |
18 | 18 | if (isset($_GET['marine'])) { |
19 | - $marine = true; |
|
19 | + $marine = true; |
|
20 | 20 | } |
21 | 21 | if ($tracker) { |
22 | - require_once('require/class.Tracker.php'); |
|
23 | - require_once('require/class.TrackerLive.php'); |
|
24 | - require_once('require/class.TrackerArchive.php'); |
|
22 | + require_once('require/class.Tracker.php'); |
|
23 | + require_once('require/class.TrackerLive.php'); |
|
24 | + require_once('require/class.TrackerArchive.php'); |
|
25 | 25 | } elseif ($marine) { |
26 | - require_once('require/class.Marine.php'); |
|
27 | - require_once('require/class.MarineLive.php'); |
|
28 | - require_once('require/class.MarineArchive.php'); |
|
26 | + require_once('require/class.Marine.php'); |
|
27 | + require_once('require/class.MarineLive.php'); |
|
28 | + require_once('require/class.MarineArchive.php'); |
|
29 | 29 | } else { |
30 | - require_once('require/class.Spotter.php'); |
|
31 | - require_once('require/class.SpotterLive.php'); |
|
32 | - require_once('require/class.SpotterArchive.php'); |
|
30 | + require_once('require/class.Spotter.php'); |
|
31 | + require_once('require/class.SpotterLive.php'); |
|
32 | + require_once('require/class.SpotterArchive.php'); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | $begintime = microtime(true); |
@@ -49,10 +49,10 @@ discard block |
||
49 | 49 | $Common = new Common(); |
50 | 50 | |
51 | 51 | if (isset($_GET['download'])) { |
52 | - if ($_GET['download'] == "true") |
|
53 | - { |
|
52 | + if ($_GET['download'] == "true") |
|
53 | + { |
|
54 | 54 | header('Content-disposition: attachment; filename="flightairmap.json"'); |
55 | - } |
|
55 | + } |
|
56 | 56 | } |
57 | 57 | header('Content-Type: text/javascript'); |
58 | 58 | |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | $usecoord = true; |
131 | 131 | $coord = explode(',',$_GET['coord']); |
132 | 132 | 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) |
133 | - && $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) { |
|
133 | + && $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) { |
|
134 | 134 | if ($tracker) { |
135 | 135 | $spotter_array = $TrackerLive->getMinLiveTrackerDatabyCoord($coord,$filter); |
136 | 136 | } elseif ($marine) { |
@@ -634,17 +634,17 @@ discard block |
||
634 | 634 | if ($history == '' && isset($_COOKIE['history'])) $history = $_COOKIE['history']; |
635 | 635 | |
636 | 636 | if ( |
637 | - (isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') |
|
638 | - || ((isset($globalMapHistory) && $globalMapHistory) || $allhistory) |
|
637 | + (isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') |
|
638 | + || ((isset($globalMapHistory) && $globalMapHistory) || $allhistory) |
|
639 | 639 | // || (isset($history) && $history != '' && $history != 'NA' && ($history == $spotter_item['ident'] || $history == $spotter_item['flightaware_id'])) |
640 | 640 | // || (isset($history) && $history != '' && $history != 'NA' && $history == $spotter_item['ident']) |
641 | - || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
|
642 | - || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']) |
|
643 | - || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['fammarine_id'])) |
|
644 | - || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['fammarine_id']) && $_GET['fammarine_id'] == $spotter_item['fammarine_id']) |
|
645 | - || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['famtrackid'])) |
|
646 | - || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['famtrackid']) && $_GET['famtrackid'] == $spotter_item['famtrackid']) |
|
647 | - ) { |
|
641 | + || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
|
642 | + || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']) |
|
643 | + || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['fammarine_id'])) |
|
644 | + || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['fammarine_id']) && $_GET['fammarine_id'] == $spotter_item['fammarine_id']) |
|
645 | + || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['famtrackid'])) |
|
646 | + || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['famtrackid']) && $_GET['famtrackid'] == $spotter_item['famtrackid']) |
|
647 | + ) { |
|
648 | 648 | if ($tracker) { |
649 | 649 | if ($from_archive || $globalArchive) { |
650 | 650 | $spotter_history_array = $TrackerArchive->getAllArchiveTrackerDataById($spotter_item['famtrackid']); |
@@ -652,7 +652,7 @@ discard block |
||
652 | 652 | $spotter_history_array = $TrackerLive->getAllLiveTrackerDataById($spotter_item['famtrackid']); |
653 | 653 | } |
654 | 654 | if ($globalMapMatching === TRUE && isset($_GET['zoom']) && $_GET['zoom'] > 12 && |
655 | - isset($spotter_item['type']) && ( |
|
655 | + isset($spotter_item['type']) && ( |
|
656 | 656 | $spotter_item['type'] == 'Firetruck' || |
657 | 657 | $spotter_item['type'] == 'Ambulance' || |
658 | 658 | $spotter_item['type'] == 'Truck (18 Wheeler)' || |
@@ -664,7 +664,7 @@ discard block |
||
664 | 664 | $spotter_item['type'] == 'Jeep' || |
665 | 665 | $spotter_item['type'] == 'Motorcycle' || |
666 | 666 | $spotter_item['type'] == 'Car' |
667 | - ) |
|
667 | + ) |
|
668 | 668 | ) { |
669 | 669 | require(dirname(__FILE__).'/require/class.MapMatching.php'); |
670 | 670 | $MapMatching = new MapMatching(); |
@@ -753,65 +753,65 @@ discard block |
||
753 | 753 | } |
754 | 754 | |
755 | 755 | if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
756 | - || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
|
757 | - && (isset($spotter_item['departure_airport']) |
|
758 | - && $spotter_item['departure_airport'] != 'NA' |
|
759 | - && isset($spotter_item['arrival_airport']) |
|
760 | - && $spotter_item['arrival_airport'] != 'NA' |
|
761 | - && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") |
|
762 | - || (!isset($_COOKIE['MapRoute']) && isset($globalMapRoute) && $globalMapRoute)))) { |
|
763 | - if ($compress) $output_air = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
764 | - else $output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
765 | - if (isset($spotter_item['departure_airport_latitude'])) { |
|
756 | + || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
|
757 | + && (isset($spotter_item['departure_airport']) |
|
758 | + && $spotter_item['departure_airport'] != 'NA' |
|
759 | + && isset($spotter_item['arrival_airport']) |
|
760 | + && $spotter_item['arrival_airport'] != 'NA' |
|
761 | + && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") |
|
762 | + || (!isset($_COOKIE['MapRoute']) && isset($globalMapRoute) && $globalMapRoute)))) { |
|
763 | + if ($compress) $output_air = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
764 | + else $output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
765 | + if (isset($spotter_item['departure_airport_latitude'])) { |
|
766 | 766 | $output_air .= '['.$spotter_item['departure_airport_longitude'].','.$spotter_item['departure_airport_latitude'].'],'; |
767 | - } elseif (isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA') { |
|
767 | + } elseif (isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA') { |
|
768 | 768 | $dairport = $Spotter->getAllAirportInfo($spotter_item['departure_airport']); |
769 | 769 | if (isset($dairport[0]['latitude'])) { |
770 | - $output_air .= '['.$dairport[0]['longitude'].','.$dairport[0]['latitude'].'],'; |
|
770 | + $output_air .= '['.$dairport[0]['longitude'].','.$dairport[0]['latitude'].'],'; |
|
771 | 771 | } |
772 | - } |
|
773 | - if (isset($spotter_item['arrival_airport_latitude'])) { |
|
772 | + } |
|
773 | + if (isset($spotter_item['arrival_airport_latitude'])) { |
|
774 | 774 | $output_air .= '['.$spotter_item['arrival_airport_longitude'].','.$spotter_item['arrival_airport_latitude'].'],'; |
775 | - } elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { |
|
775 | + } elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { |
|
776 | 776 | $aairport = $Spotter->getAllAirportInfo($spotter_item['arrival_airport']); |
777 | 777 | if (isset($aairport[0]['latitude'])) { |
778 | - $output_air .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].'],'; |
|
778 | + $output_air .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].'],'; |
|
779 | 779 | } |
780 | - } |
|
781 | - $output_air = substr($output_air, 0, -1); |
|
782 | - $output_air .= ']}},'; |
|
783 | - $output .= $output_air; |
|
784 | - unset($output_air); |
|
780 | + } |
|
781 | + $output_air = substr($output_air, 0, -1); |
|
782 | + $output_air .= ']}},'; |
|
783 | + $output .= $output_air; |
|
784 | + unset($output_air); |
|
785 | 785 | } |
786 | 786 | |
787 | 787 | //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))))) { |
788 | 788 | //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))))) { |
789 | 789 | if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
790 | - || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
|
791 | - && (isset($spotter_item['arrival_airport']) |
|
792 | - && $spotter_item['arrival_airport'] != 'NA' |
|
793 | - && ((isset($_COOKIE['MapRemainingRoute']) && $_COOKIE['MapRemainingRoute'] == "true") |
|
794 | - || (!isset($_COOKIE['MapRemainingRoute']) && (!isset($globalMapRemainingRoute) |
|
795 | - || (isset($globalMapRemainingRoute) && $globalMapRemainingRoute)))))) { |
|
796 | - $havedata = false; |
|
797 | - if ($compress) $output_dest = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
798 | - else $output_dest = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
799 | - $output_dest .= '['.$spotter_item['longitude'].','.$spotter_item['latitude'].'],'; |
|
790 | + || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
|
791 | + && (isset($spotter_item['arrival_airport']) |
|
792 | + && $spotter_item['arrival_airport'] != 'NA' |
|
793 | + && ((isset($_COOKIE['MapRemainingRoute']) && $_COOKIE['MapRemainingRoute'] == "true") |
|
794 | + || (!isset($_COOKIE['MapRemainingRoute']) && (!isset($globalMapRemainingRoute) |
|
795 | + || (isset($globalMapRemainingRoute) && $globalMapRemainingRoute)))))) { |
|
796 | + $havedata = false; |
|
797 | + if ($compress) $output_dest = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
798 | + else $output_dest = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
799 | + $output_dest .= '['.$spotter_item['longitude'].','.$spotter_item['latitude'].'],'; |
|
800 | 800 | |
801 | - if (isset($spotter_item['arrival_airport_latitude'])) { |
|
801 | + if (isset($spotter_item['arrival_airport_latitude'])) { |
|
802 | 802 | $output_dest .= '['.$spotter_item['arrival_airport_longitude'].','.$spotter_item['arrival_airport_latitude'].']'; |
803 | 803 | $havedata = true; |
804 | - } elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { |
|
804 | + } elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { |
|
805 | 805 | $aairport = $Spotter->getAllAirportInfo($spotter_item['arrival_airport']); |
806 | 806 | if (isset($aairport[0]['latitude'])) { |
807 | - $output_dest .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].']'; |
|
808 | - $havedata = true; |
|
807 | + $output_dest .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].']'; |
|
808 | + $havedata = true; |
|
809 | 809 | } |
810 | - } |
|
811 | - //$output_dest = substr($output_dest, 0, -1); |
|
812 | - $output_dest .= ']}},'; |
|
813 | - if ($havedata) $output .= $output_dest; |
|
814 | - unset($output_dest); |
|
810 | + } |
|
811 | + //$output_dest = substr($output_dest, 0, -1); |
|
812 | + $output_dest .= ']}},'; |
|
813 | + if ($havedata) $output .= $output_dest; |
|
814 | + unset($output_dest); |
|
815 | 815 | } |
816 | 816 | } |
817 | 817 | $output = substr($output, 0, -1); |