@@ -40,15 +40,15 @@ |
||
40 | 40 | //print '<div><span>'._("Country").'</span>'.$spotter_item['country'].'</div>'; |
41 | 41 | print '<div><span>'._("Coordinates").'</span>'.round($spotter_item['latitude'],3).', '.round($spotter_item['longitude'],3).'</div>'; |
42 | 42 | if ($spotter_item['atc_range'] > 0) { |
43 | - print '<div><span>'._("Range").'</span>'; |
|
44 | - print $spotter_item['atc_range']; |
|
45 | - print '</div>'; |
|
43 | + print '<div><span>'._("Range").'</span>'; |
|
44 | + print $spotter_item['atc_range']; |
|
45 | + print '</div>'; |
|
46 | 46 | } |
47 | 47 | print '</div>'; |
48 | 48 | if ($spotter_item['info'] != '') { |
49 | - print '<div class="notamtext"><span>'._("Info").'</span>'; |
|
50 | - print $spotter_item['info']; |
|
51 | - print '</div>'; |
|
49 | + print '<div class="notamtext"><span>'._("Info").'</span>'; |
|
50 | + print $spotter_item['info']; |
|
51 | + print '</div>'; |
|
52 | 52 | } |
53 | 53 | print '</div>'; |
54 | 54 | } |
@@ -5,8 +5,8 @@ discard block |
||
5 | 5 | $ATC = new ATC(); |
6 | 6 | |
7 | 7 | if (isset($_GET['atcid'])) { |
8 | - $atcid = filter_input(INPUT_GET,'atcid',FILTER_SANITIZE_NUMBER_INT); |
|
9 | - $atcident = filter_input(INPUT_GET,'atcident',FILTER_SANITIZE_STRING); |
|
8 | + $atcid = filter_input(INPUT_GET, 'atcid', FILTER_SANITIZE_NUMBER_INT); |
|
9 | + $atcident = filter_input(INPUT_GET, 'atcident', FILTER_SANITIZE_STRING); |
|
10 | 10 | $atc_data = $ATC->getById($atcid); |
11 | 11 | if (!isset($atc_data[0])) $atc_data = $ATC->getByIdent($atcident); |
12 | 12 | ?> |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | print '</div>'; |
39 | 39 | |
40 | 40 | //print '<div><span>'._("Country").'</span>'.$spotter_item['country'].'</div>'; |
41 | -print '<div><span>'._("Coordinates").'</span>'.round($spotter_item['latitude'],3).', '.round($spotter_item['longitude'],3).'</div>'; |
|
41 | +print '<div><span>'._("Coordinates").'</span>'.round($spotter_item['latitude'], 3).', '.round($spotter_item['longitude'], 3).'</div>'; |
|
42 | 42 | if ($spotter_item['atc_range'] > 0) { |
43 | 43 | print '<div><span>'._("Range").'</span>'; |
44 | 44 | print $spotter_item['atc_range']; |
@@ -8,7 +8,9 @@ |
||
8 | 8 | $atcid = filter_input(INPUT_GET,'atcid',FILTER_SANITIZE_NUMBER_INT); |
9 | 9 | $atcident = filter_input(INPUT_GET,'atcident',FILTER_SANITIZE_STRING); |
10 | 10 | $atc_data = $ATC->getById($atcid); |
11 | - if (!isset($atc_data[0])) $atc_data = $ATC->getByIdent($atcident); |
|
11 | + if (!isset($atc_data[0])) { |
|
12 | + $atc_data = $ATC->getByIdent($atcident); |
|
13 | + } |
|
12 | 14 | ?> |
13 | 15 | <div class="alldetails"> |
14 | 16 | <button type="button" class="close">×</button> |
@@ -5,23 +5,23 @@ discard block |
||
5 | 5 | $marine = false; |
6 | 6 | $usecoord = false; |
7 | 7 | if (isset($_GET['tracker'])) { |
8 | - $tracker = true; |
|
8 | + $tracker = true; |
|
9 | 9 | } |
10 | 10 | if (isset($_GET['marine'])) { |
11 | - $marine = true; |
|
11 | + $marine = true; |
|
12 | 12 | } |
13 | 13 | if ($tracker) { |
14 | - require_once('require/class.Tracker.php'); |
|
15 | - require_once('require/class.TrackerLive.php'); |
|
16 | - require_once('require/class.TrackerArchive.php'); |
|
14 | + require_once('require/class.Tracker.php'); |
|
15 | + require_once('require/class.TrackerLive.php'); |
|
16 | + require_once('require/class.TrackerArchive.php'); |
|
17 | 17 | } elseif ($marine) { |
18 | - require_once('require/class.Marine.php'); |
|
19 | - require_once('require/class.MarineLive.php'); |
|
20 | - require_once('require/class.MarineArchive.php'); |
|
18 | + require_once('require/class.Marine.php'); |
|
19 | + require_once('require/class.MarineLive.php'); |
|
20 | + require_once('require/class.MarineArchive.php'); |
|
21 | 21 | } else { |
22 | - require_once('require/class.Spotter.php'); |
|
23 | - require_once('require/class.SpotterLive.php'); |
|
24 | - require_once('require/class.SpotterArchive.php'); |
|
22 | + require_once('require/class.Spotter.php'); |
|
23 | + require_once('require/class.SpotterLive.php'); |
|
24 | + require_once('require/class.SpotterArchive.php'); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | $begintime = microtime(true); |
@@ -41,10 +41,10 @@ discard block |
||
41 | 41 | $Common = new Common(); |
42 | 42 | |
43 | 43 | if (isset($_GET['download'])) { |
44 | - if ($_GET['download'] == "true") |
|
45 | - { |
|
44 | + if ($_GET['download'] == "true") |
|
45 | + { |
|
46 | 46 | header('Content-disposition: attachment; filename="flightairmap.json"'); |
47 | - } |
|
47 | + } |
|
48 | 48 | } |
49 | 49 | header('Content-Type: text/javascript'); |
50 | 50 | |
@@ -498,17 +498,17 @@ discard block |
||
498 | 498 | if ($history == '' && isset($_COOKIE['history'])) $history = $_COOKIE['history']; |
499 | 499 | |
500 | 500 | if ( |
501 | - (isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') |
|
502 | - || ((isset($globalMapHistory) && $globalMapHistory) || $allhistory) |
|
501 | + (isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') |
|
502 | + || ((isset($globalMapHistory) && $globalMapHistory) || $allhistory) |
|
503 | 503 | // || (isset($history) && $history != '' && $history != 'NA' && ($history == $spotter_item['ident'] || $history == $spotter_item['flightaware_id'])) |
504 | 504 | // || (isset($history) && $history != '' && $history != 'NA' && $history == $spotter_item['ident']) |
505 | - || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
|
506 | - || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']) |
|
507 | - || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['fammarine_id'])) |
|
508 | - || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['fammarine_id']) && $_GET['fammarine_id'] == $spotter_item['fammarine_id']) |
|
509 | - || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['famtrackid'])) |
|
510 | - || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['famtrackid']) && $_GET['famtrackid'] == $spotter_item['famtrackid']) |
|
511 | - ) { |
|
505 | + || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
|
506 | + || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']) |
|
507 | + || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['fammarine_id'])) |
|
508 | + || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['fammarine_id']) && $_GET['fammarine_id'] == $spotter_item['fammarine_id']) |
|
509 | + || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['famtrackid'])) |
|
510 | + || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['famtrackid']) && $_GET['famtrackid'] == $spotter_item['famtrackid']) |
|
511 | + ) { |
|
512 | 512 | if ($tracker) { |
513 | 513 | if ($from_archive || $globalArchive) { |
514 | 514 | $spotter_history_array = $TrackerArchive->getAllArchiveTrackerDataById($spotter_item['famtrackid']); |
@@ -597,65 +597,65 @@ discard block |
||
597 | 597 | } |
598 | 598 | |
599 | 599 | if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
600 | - || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
|
601 | - && (isset($spotter_item['departure_airport']) |
|
602 | - && $spotter_item['departure_airport'] != 'NA' |
|
603 | - && isset($spotter_item['arrival_airport']) |
|
604 | - && $spotter_item['arrival_airport'] != 'NA' |
|
605 | - && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") |
|
606 | - || (!isset($_COOKIE['MapRoute']) && isset($globalMapRoute) && $globalMapRoute)))) { |
|
607 | - if ($compress) $output_air = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
608 | - else $output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
609 | - if (isset($spotter_item['departure_airport_latitude'])) { |
|
600 | + || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
|
601 | + && (isset($spotter_item['departure_airport']) |
|
602 | + && $spotter_item['departure_airport'] != 'NA' |
|
603 | + && isset($spotter_item['arrival_airport']) |
|
604 | + && $spotter_item['arrival_airport'] != 'NA' |
|
605 | + && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") |
|
606 | + || (!isset($_COOKIE['MapRoute']) && isset($globalMapRoute) && $globalMapRoute)))) { |
|
607 | + if ($compress) $output_air = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
608 | + else $output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
609 | + if (isset($spotter_item['departure_airport_latitude'])) { |
|
610 | 610 | $output_air .= '['.$spotter_item['departure_airport_longitude'].','.$spotter_item['departure_airport_latitude'].'],'; |
611 | - } elseif (isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA') { |
|
611 | + } elseif (isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA') { |
|
612 | 612 | $dairport = $Spotter->getAllAirportInfo($spotter_item['departure_airport']); |
613 | 613 | if (isset($dairport[0]['latitude'])) { |
614 | - $output_air .= '['.$dairport[0]['longitude'].','.$dairport[0]['latitude'].'],'; |
|
614 | + $output_air .= '['.$dairport[0]['longitude'].','.$dairport[0]['latitude'].'],'; |
|
615 | 615 | } |
616 | - } |
|
617 | - if (isset($spotter_item['arrival_airport_latitude'])) { |
|
616 | + } |
|
617 | + if (isset($spotter_item['arrival_airport_latitude'])) { |
|
618 | 618 | $output_air .= '['.$spotter_item['arrival_airport_longitude'].','.$spotter_item['arrival_airport_latitude'].'],'; |
619 | - } elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { |
|
619 | + } elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { |
|
620 | 620 | $aairport = $Spotter->getAllAirportInfo($spotter_item['arrival_airport']); |
621 | 621 | if (isset($aairport[0]['latitude'])) { |
622 | - $output_air .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].'],'; |
|
622 | + $output_air .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].'],'; |
|
623 | 623 | } |
624 | - } |
|
625 | - $output_air = substr($output_air, 0, -1); |
|
626 | - $output_air .= ']}},'; |
|
627 | - $output .= $output_air; |
|
628 | - unset($output_air); |
|
624 | + } |
|
625 | + $output_air = substr($output_air, 0, -1); |
|
626 | + $output_air .= ']}},'; |
|
627 | + $output .= $output_air; |
|
628 | + unset($output_air); |
|
629 | 629 | } |
630 | 630 | |
631 | 631 | //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))))) { |
632 | 632 | //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))))) { |
633 | 633 | if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
634 | - || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
|
635 | - && (isset($spotter_item['arrival_airport']) |
|
636 | - && $spotter_item['arrival_airport'] != 'NA' |
|
637 | - && ((isset($_COOKIE['MapRemainingRoute']) && $_COOKIE['MapRemainingRoute'] == "true") |
|
638 | - || (!isset($_COOKIE['MapRemainaingRoute']) && (!isset($globalMapRemainingRoute) |
|
639 | - || (isset($globalMapRemainingRoute) && $globalMapRemainingRoute)))))) { |
|
640 | - $havedata = false; |
|
641 | - if ($compress) $output_dest = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
642 | - else $output_dest = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
643 | - $output_dest .= '['.$spotter_item['longitude'].','.$spotter_item['latitude'].'],'; |
|
634 | + || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
|
635 | + && (isset($spotter_item['arrival_airport']) |
|
636 | + && $spotter_item['arrival_airport'] != 'NA' |
|
637 | + && ((isset($_COOKIE['MapRemainingRoute']) && $_COOKIE['MapRemainingRoute'] == "true") |
|
638 | + || (!isset($_COOKIE['MapRemainaingRoute']) && (!isset($globalMapRemainingRoute) |
|
639 | + || (isset($globalMapRemainingRoute) && $globalMapRemainingRoute)))))) { |
|
640 | + $havedata = false; |
|
641 | + if ($compress) $output_dest = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
642 | + else $output_dest = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
643 | + $output_dest .= '['.$spotter_item['longitude'].','.$spotter_item['latitude'].'],'; |
|
644 | 644 | |
645 | - if (isset($spotter_item['arrival_airport_latitude'])) { |
|
645 | + if (isset($spotter_item['arrival_airport_latitude'])) { |
|
646 | 646 | $output_dest .= '['.$spotter_item['arrival_airport_longitude'].','.$spotter_item['arrival_airport_latitude'].']'; |
647 | 647 | $havedata = true; |
648 | - } elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { |
|
648 | + } elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { |
|
649 | 649 | $aairport = $Spotter->getAllAirportInfo($spotter_item['arrival_airport']); |
650 | 650 | if (isset($aairport[0]['latitude'])) { |
651 | - $output_dest .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].']'; |
|
652 | - $havedata = true; |
|
651 | + $output_dest .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].']'; |
|
652 | + $havedata = true; |
|
653 | 653 | } |
654 | - } |
|
655 | - //$output_dest = substr($output_dest, 0, -1); |
|
656 | - $output_dest .= ']}},'; |
|
657 | - if ($havedata) $output .= $output_dest; |
|
658 | - unset($output_dest); |
|
654 | + } |
|
655 | + //$output_dest = substr($output_dest, 0, -1); |
|
656 | + $output_dest .= ']}},'; |
|
657 | + if ($havedata) $output .= $output_dest; |
|
658 | + unset($output_dest); |
|
659 | 659 | } |
660 | 660 | } |
661 | 661 | $output = substr($output, 0, -1); |
@@ -48,27 +48,52 @@ discard block |
||
48 | 48 | } |
49 | 49 | header('Content-Type: text/javascript'); |
50 | 50 | |
51 | -if (!isset($globalJsonCompress)) $compress = true; |
|
52 | -else $compress = $globalJsonCompress; |
|
51 | +if (!isset($globalJsonCompress)) { |
|
52 | + $compress = true; |
|
53 | +} else { |
|
54 | + $compress = $globalJsonCompress; |
|
55 | +} |
|
53 | 56 | |
54 | 57 | $from_archive = false; |
55 | 58 | $min = true; |
56 | 59 | $allhistory = false; |
57 | 60 | $filter['source'] = array(); |
58 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
59 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
60 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
61 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs')); |
|
62 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
63 | -if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
64 | -if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
65 | -if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
66 | -if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
67 | -if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING); |
|
61 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') { |
|
62 | + $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
63 | +} |
|
64 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') { |
|
65 | + $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
66 | +} |
|
67 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') { |
|
68 | + $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
69 | +} |
|
70 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') { |
|
71 | + $filter['source'] = array_merge($filter['source'],array('sbs','famaprs')); |
|
72 | +} |
|
73 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') { |
|
74 | + $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
75 | +} |
|
76 | +if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') { |
|
77 | + $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
78 | +} |
|
79 | +if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') { |
|
80 | + $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
81 | +} |
|
82 | +if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') { |
|
83 | + $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
84 | +} |
|
85 | +if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') { |
|
86 | + $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
87 | +} |
|
88 | +if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') { |
|
89 | + $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING); |
|
90 | +} |
|
68 | 91 | |
69 | 92 | if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) { |
70 | 93 | $min = true; |
71 | -} else $min = false; |
|
94 | +} else { |
|
95 | + $min = false; |
|
96 | +} |
|
72 | 97 | |
73 | 98 | if (isset($_GET['ident'])) { |
74 | 99 | $ident = urldecode(filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING)); |
@@ -162,20 +187,30 @@ discard block |
||
162 | 187 | $flightcnt = $SpotterLive->getLiveSpotterCount($filter); |
163 | 188 | } |
164 | 189 | } |
165 | - if ($flightcnt == '') $flightcnt = 0; |
|
166 | -} else $flightcnt = 0; |
|
190 | + if ($flightcnt == '') { |
|
191 | + $flightcnt = 0; |
|
192 | + } |
|
193 | + } else { |
|
194 | + $flightcnt = 0; |
|
195 | +} |
|
167 | 196 | |
168 | 197 | $sqltime = round(microtime(true)-$begintime,2); |
169 | 198 | |
170 | -if ((!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation == FALSE) || (isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'false')) $usenextlatlon = false; |
|
171 | -else $usenextlatlon = true; |
|
199 | +if ((!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation == FALSE) || (isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'false')) { |
|
200 | + $usenextlatlon = false; |
|
201 | +} else { |
|
202 | + $usenextlatlon = true; |
|
203 | +} |
|
172 | 204 | $j = 0; |
173 | 205 | $prev_flightaware_id = ''; |
174 | 206 | $aircrafts_shadow = array(); |
175 | 207 | $output = '{'; |
176 | 208 | $output .= '"type": "FeatureCollection",'; |
177 | - if ($min) $output .= '"minimal": "true",'; |
|
178 | - else $output .= '"minimal": "false",'; |
|
209 | + if ($min) { |
|
210 | + $output .= '"minimal": "true",'; |
|
211 | + } else { |
|
212 | + $output .= '"minimal": "false",'; |
|
213 | + } |
|
179 | 214 | //$output .= '"fc": "'.$flightcnt.'",'; |
180 | 215 | $output .= '"sqt": "'.$sqltime.'",'; |
181 | 216 | |
@@ -219,18 +254,29 @@ discard block |
||
219 | 254 | } |
220 | 255 | $output .= '"properties": {'; |
221 | 256 | if (isset($spotter_item['flightaware_id'])) { |
222 | - if ($compress) $output .= '"fi": "'.$spotter_item['flightaware_id'].'",'; |
|
223 | - else $output .= '"flightaware_id": "'.$spotter_item['flightaware_id'].'",'; |
|
257 | + if ($compress) { |
|
258 | + $output .= '"fi": "'.$spotter_item['flightaware_id'].'",'; |
|
259 | + } else { |
|
260 | + $output .= '"flightaware_id": "'.$spotter_item['flightaware_id'].'",'; |
|
261 | + } |
|
224 | 262 | } elseif (isset($spotter_item['famtrackid'])) { |
225 | - if ($compress) $output .= '"fti": "'.$spotter_item['famtrackid'].'",'; |
|
226 | - else $output .= '"famtrackid": "'.$spotter_item['famtrackid'].'",'; |
|
263 | + if ($compress) { |
|
264 | + $output .= '"fti": "'.$spotter_item['famtrackid'].'",'; |
|
265 | + } else { |
|
266 | + $output .= '"famtrackid": "'.$spotter_item['famtrackid'].'",'; |
|
267 | + } |
|
227 | 268 | } elseif (isset($spotter_item['fammarine_id'])) { |
228 | - if ($compress) $output .= '"fmi": "'.$spotter_item['fammarine_id'].'",'; |
|
229 | - else $output .= '"fammarineid": "'.$spotter_item['fammarine_id'].'",'; |
|
269 | + if ($compress) { |
|
270 | + $output .= '"fmi": "'.$spotter_item['fammarine_id'].'",'; |
|
271 | + } else { |
|
272 | + $output .= '"fammarineid": "'.$spotter_item['fammarine_id'].'",'; |
|
273 | + } |
|
230 | 274 | } |
231 | 275 | $output .= '"fc": "'.$flightcnt.'",'; |
232 | 276 | $output .= '"sqt": "'.$sqltime.'",'; |
233 | - if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",'; |
|
277 | + if (isset($begindate)) { |
|
278 | + $output .= '"archive_date": "'.$begindate.'",'; |
|
279 | + } |
|
234 | 280 | |
235 | 281 | /* |
236 | 282 | if ($min) $output .= '"minimal": "true",'; |
@@ -238,14 +284,22 @@ discard block |
||
238 | 284 | */ |
239 | 285 | //$output .= '"fc": "'.$spotter_item['nb'].'",'; |
240 | 286 | if (isset($spotter_item['ident']) && $spotter_item['ident'] != '') { |
241 | - if ($compress) $output .= '"c": "'.str_replace('\\','',$spotter_item['ident']).'",'; |
|
242 | - else $output .= '"callsign": "'.str_replace('\\','',$spotter_item['ident']).'",'; |
|
287 | + if ($compress) { |
|
288 | + $output .= '"c": "'.str_replace('\\','',$spotter_item['ident']).'",'; |
|
289 | + } else { |
|
290 | + $output .= '"callsign": "'.str_replace('\\','',$spotter_item['ident']).'",'; |
|
291 | + } |
|
243 | 292 | //" |
244 | 293 | } else { |
245 | - if ($compress) $output .= '"c": "NA",'; |
|
246 | - else $output .= '"callsign": "NA",'; |
|
294 | + if ($compress) { |
|
295 | + $output .= '"c": "NA",'; |
|
296 | + } else { |
|
297 | + $output .= '"callsign": "NA",'; |
|
298 | + } |
|
299 | + } |
|
300 | + if (isset($spotter_item['registration'])) { |
|
301 | + $output .= '"registration": "'.$spotter_item['registration'].'",'; |
|
247 | 302 | } |
248 | - if (isset($spotter_item['registration'])) $output .= '"registration": "'.$spotter_item['registration'].'",'; |
|
249 | 303 | if (isset($spotter_item['aircraft_name']) && isset($spotter_item['aircraft_type'])) { |
250 | 304 | $output .= '"aircraft_name": "'.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')",'; |
251 | 305 | $output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ','_',$spotter_item['aircraft_name'])).'",'; |
@@ -258,16 +312,23 @@ discard block |
||
258 | 312 | $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
259 | 313 | } |
260 | 314 | if (!isset($spotter_item['aircraft_shadow']) && !$tracker) { |
261 | - if (!isset($spotter_item['aircraft_icao']) || $spotter_item['aircraft_icao'] == '') $spotter_item['aircraft_shadow'] = ''; |
|
262 | - else { |
|
315 | + if (!isset($spotter_item['aircraft_icao']) || $spotter_item['aircraft_icao'] == '') { |
|
316 | + $spotter_item['aircraft_shadow'] = ''; |
|
317 | + } else { |
|
263 | 318 | $aircraft_icao = $spotter_item['aircraft_icao']; |
264 | - if (isset($aircrafts_shadow[$aircraft_icao])) $spotter_item['aircraft_shadow'] = $aircrafts_shadow[$aircraft_icao]; |
|
265 | - else { |
|
319 | + if (isset($aircrafts_shadow[$aircraft_icao])) { |
|
320 | + $spotter_item['aircraft_shadow'] = $aircrafts_shadow[$aircraft_icao]; |
|
321 | + } else { |
|
266 | 322 | $aircraft_info = $Spotter->getAllAircraftInfo($spotter_item['aircraft_icao']); |
267 | - if (count($aircraft_info) > 0) $spotter_item['aircraft_shadow'] = $aircraft_info[0]['aircraft_shadow']; |
|
268 | - elseif (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'aprs') $spotter_item['aircraft_shadow'] = 'PA18.png'; |
|
269 | - elseif ($aircraft_icao == 'PARAGLIDER') $spotter_item['aircraft_shadow'] = 'PARAGLIDER.png'; |
|
270 | - else $spotter_item['aircraft_shadow'] = ''; |
|
323 | + if (count($aircraft_info) > 0) { |
|
324 | + $spotter_item['aircraft_shadow'] = $aircraft_info[0]['aircraft_shadow']; |
|
325 | + } elseif (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'aprs') { |
|
326 | + $spotter_item['aircraft_shadow'] = 'PA18.png'; |
|
327 | + } elseif ($aircraft_icao == 'PARAGLIDER') { |
|
328 | + $spotter_item['aircraft_shadow'] = 'PARAGLIDER.png'; |
|
329 | + } else { |
|
330 | + $spotter_item['aircraft_shadow'] = ''; |
|
331 | + } |
|
271 | 332 | $aircrafts_shadow[$aircraft_icao] = $spotter_item['aircraft_shadow']; |
272 | 333 | } |
273 | 334 | } |
@@ -275,73 +336,139 @@ discard block |
||
275 | 336 | if (!isset($spotter_item['aircraft_shadow']) || $spotter_item['aircraft_shadow'] == '') { |
276 | 337 | if ($tracker) { |
277 | 338 | if (isset($spotter_item['type']) && $spotter_item['type'] == 'Ambulance') { |
278 | - if ($compress) $output .= '"as": "ambulance.png",'; |
|
279 | - else $output .= '"aircraft_shadow": "ambulance.png",'; |
|
339 | + if ($compress) { |
|
340 | + $output .= '"as": "ambulance.png",'; |
|
341 | + } else { |
|
342 | + $output .= '"aircraft_shadow": "ambulance.png",'; |
|
343 | + } |
|
280 | 344 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Police') { |
281 | - if ($compress) $output .= '"as": "police.png",'; |
|
282 | - else $output .= '"aircraft_shadow": "police.png",'; |
|
345 | + if ($compress) { |
|
346 | + $output .= '"as": "police.png",'; |
|
347 | + } else { |
|
348 | + $output .= '"aircraft_shadow": "police.png",'; |
|
349 | + } |
|
283 | 350 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Yacht (Sail)') { |
284 | - if ($compress) $output .= '"as": "ship.png",'; |
|
285 | - else $output .= '"aircraft_shadow": "ship.png",'; |
|
351 | + if ($compress) { |
|
352 | + $output .= '"as": "ship.png",'; |
|
353 | + } else { |
|
354 | + $output .= '"aircraft_shadow": "ship.png",'; |
|
355 | + } |
|
286 | 356 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Ship (Power Boat)') { |
287 | - if ($compress) $output .= '"as": "ship.png",'; |
|
288 | - else $output .= '"aircraft_shadow": "ship.png",'; |
|
357 | + if ($compress) { |
|
358 | + $output .= '"as": "ship.png",'; |
|
359 | + } else { |
|
360 | + $output .= '"aircraft_shadow": "ship.png",'; |
|
361 | + } |
|
289 | 362 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Shuttle') { |
290 | - if ($compress) $output .= '"as": "ship.png",'; |
|
291 | - else $output .= '"aircraft_shadow": "ship.png",'; |
|
363 | + if ($compress) { |
|
364 | + $output .= '"as": "ship.png",'; |
|
365 | + } else { |
|
366 | + $output .= '"aircraft_shadow": "ship.png",'; |
|
367 | + } |
|
292 | 368 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Truck') { |
293 | - if ($compress) $output .= '"as": "truck.png",'; |
|
294 | - else $output .= '"aircraft_shadow": "truck.png",'; |
|
369 | + if ($compress) { |
|
370 | + $output .= '"as": "truck.png",'; |
|
371 | + } else { |
|
372 | + $output .= '"aircraft_shadow": "truck.png",'; |
|
373 | + } |
|
295 | 374 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Truck (18 Wheeler)') { |
296 | - if ($compress) $output .= '"as": "truck.png",'; |
|
297 | - else $output .= '"aircraft_shadow": "truck.png",'; |
|
375 | + if ($compress) { |
|
376 | + $output .= '"as": "truck.png",'; |
|
377 | + } else { |
|
378 | + $output .= '"aircraft_shadow": "truck.png",'; |
|
379 | + } |
|
298 | 380 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Aircraft (small)') { |
299 | - if ($compress) $output .= '"as": "aircraft.png",'; |
|
300 | - else $output .= '"aircraft_shadow": "aircraft.png",'; |
|
381 | + if ($compress) { |
|
382 | + $output .= '"as": "aircraft.png",'; |
|
383 | + } else { |
|
384 | + $output .= '"aircraft_shadow": "aircraft.png",'; |
|
385 | + } |
|
301 | 386 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Large Aircraft') { |
302 | - if ($compress) $output .= '"as": "aircraft.png",'; |
|
303 | - else $output .= '"aircraft_shadow": "aircraft.png",'; |
|
387 | + if ($compress) { |
|
388 | + $output .= '"as": "aircraft.png",'; |
|
389 | + } else { |
|
390 | + $output .= '"aircraft_shadow": "aircraft.png",'; |
|
391 | + } |
|
304 | 392 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Helicopter') { |
305 | - if ($compress) $output .= '"as": "helico.png",'; |
|
306 | - else $output .= '"aircraft_shadow": "helico.png",'; |
|
393 | + if ($compress) { |
|
394 | + $output .= '"as": "helico.png",'; |
|
395 | + } else { |
|
396 | + $output .= '"aircraft_shadow": "helico.png",'; |
|
397 | + } |
|
307 | 398 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Railroad Engine') { |
308 | - if ($compress) $output .= '"as": "rail.png",'; |
|
309 | - else $output .= '"aircraft_shadow": "rail.png",'; |
|
399 | + if ($compress) { |
|
400 | + $output .= '"as": "rail.png",'; |
|
401 | + } else { |
|
402 | + $output .= '"aircraft_shadow": "rail.png",'; |
|
403 | + } |
|
310 | 404 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Firetruck') { |
311 | - if ($compress) $output .= '"as": "firetruck.png",'; |
|
312 | - else $output .= '"aircraft_shadow": "firetruck.png",'; |
|
405 | + if ($compress) { |
|
406 | + $output .= '"as": "firetruck.png",'; |
|
407 | + } else { |
|
408 | + $output .= '"aircraft_shadow": "firetruck.png",'; |
|
409 | + } |
|
313 | 410 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Bus') { |
314 | - if ($compress) $output .= '"as": "bus.png",'; |
|
315 | - else $output .= '"aircraft_shadow": "bus.png",'; |
|
411 | + if ($compress) { |
|
412 | + $output .= '"as": "bus.png",'; |
|
413 | + } else { |
|
414 | + $output .= '"aircraft_shadow": "bus.png",'; |
|
415 | + } |
|
316 | 416 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Phone') { |
317 | - if ($compress) $output .= '"as": "phone.png",'; |
|
318 | - else $output .= '"aircraft_shadow": "phone.png",'; |
|
417 | + if ($compress) { |
|
418 | + $output .= '"as": "phone.png",'; |
|
419 | + } else { |
|
420 | + $output .= '"aircraft_shadow": "phone.png",'; |
|
421 | + } |
|
319 | 422 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Jogger') { |
320 | - if ($compress) $output .= '"as": "jogger.png",'; |
|
321 | - else $output .= '"aircraft_shadow": "jogger.png",'; |
|
423 | + if ($compress) { |
|
424 | + $output .= '"as": "jogger.png",'; |
|
425 | + } else { |
|
426 | + $output .= '"aircraft_shadow": "jogger.png",'; |
|
427 | + } |
|
322 | 428 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Bike') { |
323 | - if ($compress) $output .= '"as": "bike.png",'; |
|
324 | - else $output .= '"aircraft_shadow": "bike.png",'; |
|
429 | + if ($compress) { |
|
430 | + $output .= '"as": "bike.png",'; |
|
431 | + } else { |
|
432 | + $output .= '"aircraft_shadow": "bike.png",'; |
|
433 | + } |
|
325 | 434 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Motorcycle') { |
326 | - if ($compress) $output .= '"as": "motorcycle.png",'; |
|
327 | - else $output .= '"aircraft_shadow": "motorcycle.png",'; |
|
435 | + if ($compress) { |
|
436 | + $output .= '"as": "motorcycle.png",'; |
|
437 | + } else { |
|
438 | + $output .= '"aircraft_shadow": "motorcycle.png",'; |
|
439 | + } |
|
328 | 440 | } elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Balloon') { |
329 | - if ($compress) $output .= '"as": "balloon.png",'; |
|
330 | - else $output .= '"aircraft_shadow": "balloon.png",'; |
|
441 | + if ($compress) { |
|
442 | + $output .= '"as": "balloon.png",'; |
|
443 | + } else { |
|
444 | + $output .= '"aircraft_shadow": "balloon.png",'; |
|
445 | + } |
|
331 | 446 | } else { |
332 | - if ($compress) $output .= '"as": "car.png",'; |
|
333 | - else $output .= '"aircraft_shadow": "car.png",'; |
|
447 | + if ($compress) { |
|
448 | + $output .= '"as": "car.png",'; |
|
449 | + } else { |
|
450 | + $output .= '"aircraft_shadow": "car.png",'; |
|
451 | + } |
|
334 | 452 | } |
335 | 453 | } elseif ($marine) { |
336 | - if ($compress) $output .= '"as": "ship.png",'; |
|
337 | - else $output .= '"aircraft_shadow": "ship.png",'; |
|
454 | + if ($compress) { |
|
455 | + $output .= '"as": "ship.png",'; |
|
456 | + } else { |
|
457 | + $output .= '"aircraft_shadow": "ship.png",'; |
|
458 | + } |
|
338 | 459 | } else { |
339 | - if ($compress) $output .= '"as": "default.png",'; |
|
340 | - else $output .= '"aircraft_shadow": "default.png",'; |
|
460 | + if ($compress) { |
|
461 | + $output .= '"as": "default.png",'; |
|
462 | + } else { |
|
463 | + $output .= '"aircraft_shadow": "default.png",'; |
|
464 | + } |
|
341 | 465 | } |
342 | 466 | } else { |
343 | - if ($compress) $output .= '"as": "'.$spotter_item['aircraft_shadow'].'",'; |
|
344 | - else $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",'; |
|
467 | + if ($compress) { |
|
468 | + $output .= '"as": "'.$spotter_item['aircraft_shadow'].'",'; |
|
469 | + } else { |
|
470 | + $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",'; |
|
471 | + } |
|
345 | 472 | } |
346 | 473 | if (isset($spotter_item['airline_name'])) { |
347 | 474 | $output .= '"airline_name": "'.$spotter_item['airline_name'].'",'; |
@@ -349,8 +476,11 @@ discard block |
||
349 | 476 | $output .= '"airline_name": "NA",'; |
350 | 477 | } |
351 | 478 | if (isset($spotter_item['departure_airport'])) { |
352 | - if ($compress) $output .= '"dac": "'.$spotter_item['departure_airport'].'",'; |
|
353 | - else $output .= '"departure_airport_code": "'.$spotter_item['departure_airport'].'",'; |
|
479 | + if ($compress) { |
|
480 | + $output .= '"dac": "'.$spotter_item['departure_airport'].'",'; |
|
481 | + } else { |
|
482 | + $output .= '"departure_airport_code": "'.$spotter_item['departure_airport'].'",'; |
|
483 | + } |
|
354 | 484 | } |
355 | 485 | if (isset($spotter_item['departure_airport_city'])) { |
356 | 486 | $output .= '"departure_airport": "'.$spotter_item['departure_airport_city'].', '.$spotter_item['departure_airport_country'].'",'; |
@@ -362,8 +492,11 @@ discard block |
||
362 | 492 | $output .= '"arrival_airport_time": "'.$spotter_item['arrival_airport_time'].'",'; |
363 | 493 | } |
364 | 494 | if (isset($spotter_item['arrival_airport'])) { |
365 | - if ($compress) $output .= '"aac": "'.$spotter_item['arrival_airport'].'",'; |
|
366 | - else $output .= '"arrival_airport_code": "'.$spotter_item['arrival_airport'].'",'; |
|
495 | + if ($compress) { |
|
496 | + $output .= '"aac": "'.$spotter_item['arrival_airport'].'",'; |
|
497 | + } else { |
|
498 | + $output .= '"arrival_airport_code": "'.$spotter_item['arrival_airport'].'",'; |
|
499 | + } |
|
367 | 500 | } |
368 | 501 | if (isset($spotter_item['arrival_airport_city'])) { |
369 | 502 | $output .= '"arrival_airport": "'.$spotter_item['arrival_airport_city'].', '.$spotter_item['arrival_airport_country'].'",'; |
@@ -382,11 +515,17 @@ discard block |
||
382 | 515 | } |
383 | 516 | |
384 | 517 | if (isset($spotter_item['altitude'])) { |
385 | - if ($compress) $output .= '"a": "'.$spotter_item['altitude'].'",'; |
|
386 | - else $output .= '"altitude": "'.$spotter_item['altitude'].'",'; |
|
518 | + if ($compress) { |
|
519 | + $output .= '"a": "'.$spotter_item['altitude'].'",'; |
|
520 | + } else { |
|
521 | + $output .= '"altitude": "'.$spotter_item['altitude'].'",'; |
|
522 | + } |
|
523 | + } |
|
524 | + if ($compress) { |
|
525 | + $output .= '"h": "'.$spotter_item['heading'].'",'; |
|
526 | + } else { |
|
527 | + $output .= '"heading": "'.$spotter_item['heading'].'",'; |
|
387 | 528 | } |
388 | - if ($compress)$output .= '"h": "'.$spotter_item['heading'].'",'; |
|
389 | - else $output .= '"heading": "'.$spotter_item['heading'].'",'; |
|
390 | 529 | |
391 | 530 | if (isset($archivespeed)) { |
392 | 531 | $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading'],$archivespeed); |
@@ -396,7 +535,9 @@ discard block |
||
396 | 535 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
397 | 536 | } |
398 | 537 | |
399 | - if (!$min) $output .= '"image": "'.$image.'",'; |
|
538 | + if (!$min) { |
|
539 | + $output .= '"image": "'.$image.'",'; |
|
540 | + } |
|
400 | 541 | if (isset($spotter_item['image_copyright']) && $spotter_item['image_copyright'] != '') { |
401 | 542 | $output .= '"image_copyright": "'.str_replace('"',"'",trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'',$spotter_item['image_copyright']))).'",'; |
402 | 543 | } |
@@ -404,8 +545,11 @@ discard block |
||
404 | 545 | $output .= '"image_source_website": "'.urlencode($spotter_item['image_source_website']).'",'; |
405 | 546 | } |
406 | 547 | if (isset($spotter_item['squawk'])) { |
407 | - if ($compress) $output .= '"sq": "'.$spotter_item['squawk'].'",'; |
|
408 | - else $output .= '"squawk": "'.$spotter_item['squawk'].'",'; |
|
548 | + if ($compress) { |
|
549 | + $output .= '"sq": "'.$spotter_item['squawk'].'",'; |
|
550 | + } else { |
|
551 | + $output .= '"squawk": "'.$spotter_item['squawk'].'",'; |
|
552 | + } |
|
409 | 553 | } |
410 | 554 | if (isset($spotter_item['squawk_usage'])) { |
411 | 555 | $output .= '"squawk_usage": "'.$spotter_item['squawk_usage'].'",'; |
@@ -424,14 +568,23 @@ discard block |
||
424 | 568 | } |
425 | 569 | // type when not aircraft ? |
426 | 570 | if (isset($spotter_item['type'])) { |
427 | - if ($compress) $output .= '"t": "'.$spotter_item['type'].'"'; |
|
428 | - else $output .= '"type": "'.$spotter_item['type'].'"'; |
|
571 | + if ($compress) { |
|
572 | + $output .= '"t": "'.$spotter_item['type'].'"'; |
|
573 | + } else { |
|
574 | + $output .= '"type": "'.$spotter_item['type'].'"'; |
|
575 | + } |
|
429 | 576 | } elseif ($marine) { |
430 | - if ($compress) $output .= '"t": "ship"'; |
|
431 | - else $output .= '"type": "ship"'; |
|
577 | + if ($compress) { |
|
578 | + $output .= '"t": "ship"'; |
|
579 | + } else { |
|
580 | + $output .= '"type": "ship"'; |
|
581 | + } |
|
432 | 582 | } else { |
433 | - if ($compress) $output .= '"t": "aircraft"'; |
|
434 | - else $output .= '"type": "aircraft"'; |
|
583 | + if ($compress) { |
|
584 | + $output .= '"t": "aircraft"'; |
|
585 | + } else { |
|
586 | + $output .= '"type": "aircraft"'; |
|
587 | + } |
|
435 | 588 | } |
436 | 589 | $output .= '},'; |
437 | 590 | $output .= '"geometry": {'; |
@@ -499,7 +652,9 @@ discard block |
||
499 | 652 | } |
500 | 653 | */ |
501 | 654 | $history = filter_input(INPUT_GET,'history',FILTER_SANITIZE_STRING); |
502 | - if ($history == '' && isset($_COOKIE['history'])) $history = $_COOKIE['history']; |
|
655 | + if ($history == '' && isset($_COOKIE['history'])) { |
|
656 | + $history = $_COOKIE['history']; |
|
657 | + } |
|
503 | 658 | |
504 | 659 | if ( |
505 | 660 | (isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') |
@@ -543,8 +698,11 @@ discard block |
||
543 | 698 | $output_history .= ']}},'; |
544 | 699 | $output .= $output_history; |
545 | 700 | } |
546 | - if ($compress) $output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "history","a": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
|
547 | - else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
|
701 | + if ($compress) { |
|
702 | + $output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "history","a": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
|
703 | + } else { |
|
704 | + $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
|
705 | + } |
|
548 | 706 | } |
549 | 707 | $output_history .= '['; |
550 | 708 | $output_history .= $spotter_history['longitude'].', '; |
@@ -563,9 +721,14 @@ discard block |
||
563 | 721 | $prev_alt = $alt; |
564 | 722 | } else { |
565 | 723 | if ($d == false) { |
566 | - if ($compress) $output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "history"},"geometry": {"type": "LineString","coordinates": ['; |
|
567 | - else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history"},"geometry": {"type": "LineString","coordinates": ['; |
|
568 | - } else $d = true; |
|
724 | + if ($compress) { |
|
725 | + $output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "history"},"geometry": {"type": "LineString","coordinates": ['; |
|
726 | + } else { |
|
727 | + $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history"},"geometry": {"type": "LineString","coordinates": ['; |
|
728 | + } |
|
729 | + } else { |
|
730 | + $d = true; |
|
731 | + } |
|
569 | 732 | $output_history .= '['; |
570 | 733 | $output_history .= $spotter_history['longitude'].', '; |
571 | 734 | $output_history .= $spotter_history['latitude']; |
@@ -586,7 +749,9 @@ discard block |
||
586 | 749 | $output_historyd = '['; |
587 | 750 | $output_historyd .= $spotter_item['longitude'].', '; |
588 | 751 | $output_historyd .= $spotter_item['latitude']; |
589 | - if (isset($spotter_history['altitude'])) $output_historyd .= ','.$spotter_item['altitude']*30.48; |
|
752 | + if (isset($spotter_history['altitude'])) { |
|
753 | + $output_historyd .= ','.$spotter_item['altitude']*30.48; |
|
754 | + } |
|
590 | 755 | $output_historyd .= '],'; |
591 | 756 | //$output_history = $output_historyd.$output_history; |
592 | 757 | $output_history = $output_history.$output_historyd; |
@@ -608,8 +773,11 @@ discard block |
||
608 | 773 | && $spotter_item['arrival_airport'] != 'NA' |
609 | 774 | && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") |
610 | 775 | || (!isset($_COOKIE['MapRoute']) && isset($globalMapRoute) && $globalMapRoute)))) { |
611 | - if ($compress) $output_air = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
612 | - else $output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
776 | + if ($compress) { |
|
777 | + $output_air = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
778 | + } else { |
|
779 | + $output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": ['; |
|
780 | + } |
|
613 | 781 | if (isset($spotter_item['departure_airport_latitude'])) { |
614 | 782 | $output_air .= '['.$spotter_item['departure_airport_longitude'].','.$spotter_item['departure_airport_latitude'].'],'; |
615 | 783 | } elseif (isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA') { |
@@ -642,8 +810,11 @@ discard block |
||
642 | 810 | || (!isset($_COOKIE['MapRemainaingRoute']) && (!isset($globalMapRemainingRoute) |
643 | 811 | || (isset($globalMapRemainingRoute) && $globalMapRemainingRoute)))))) { |
644 | 812 | $havedata = false; |
645 | - if ($compress) $output_dest = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
646 | - else $output_dest = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
813 | + if ($compress) { |
|
814 | + $output_dest = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
815 | + } else { |
|
816 | + $output_dest = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "routedest"},"geometry": {"type": "LineString","coordinates": ['; |
|
817 | + } |
|
647 | 818 | $output_dest .= '['.$spotter_item['longitude'].','.$spotter_item['latitude'].'],'; |
648 | 819 | |
649 | 820 | if (isset($spotter_item['arrival_airport_latitude'])) { |
@@ -658,7 +829,9 @@ discard block |
||
658 | 829 | } |
659 | 830 | //$output_dest = substr($output_dest, 0, -1); |
660 | 831 | $output_dest .= ']}},'; |
661 | - if ($havedata) $output .= $output_dest; |
|
832 | + if ($havedata) { |
|
833 | + $output .= $output_dest; |
|
834 | + } |
|
662 | 835 | unset($output_dest); |
663 | 836 | } |
664 | 837 | } |
@@ -666,7 +839,9 @@ discard block |
||
666 | 839 | $output .= ']'; |
667 | 840 | $output .= ',"initial_sqltime": "'.$sqltime.'",'; |
668 | 841 | $output .= '"totaltime": "'.round(microtime(true)-$begintime,2).'",'; |
669 | - if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",'; |
|
842 | + if (isset($begindate)) { |
|
843 | + $output .= '"archive_date": "'.$begindate.'",'; |
|
844 | + } |
|
670 | 845 | $output .= '"fc": "'.$j.'"'; |
671 | 846 | } else { |
672 | 847 | $output .= '"features": '; |
@@ -55,23 +55,23 @@ discard block |
||
55 | 55 | $min = true; |
56 | 56 | $allhistory = false; |
57 | 57 | $filter['source'] = array(); |
58 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
59 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
60 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
61 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs')); |
|
62 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
63 | -if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
64 | -if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
65 | -if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
66 | -if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
67 | -if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING); |
|
58 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'], array('vatsimtxt')); |
|
59 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'], array('whazzup')); |
|
60 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'], array('phpvmacars')); |
|
61 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'], array('sbs', 'famaprs')); |
|
62 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'], array('aprs')); |
|
63 | +if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'], FILTER_SANITIZE_STRING); |
|
64 | +if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',', $_COOKIE['filter_Airlines']), FILTER_SANITIZE_STRING); |
|
65 | +if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',', $_COOKIE['filter_Sources']), FILTER_SANITIZE_STRING); |
|
66 | +if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'], FILTER_SANITIZE_STRING); |
|
67 | +if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'], FILTER_SANITIZE_STRING); |
|
68 | 68 | |
69 | 69 | if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) { |
70 | 70 | $min = true; |
71 | 71 | } else $min = false; |
72 | 72 | |
73 | 73 | if (isset($_GET['ident'])) { |
74 | - $ident = urldecode(filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING)); |
|
74 | + $ident = urldecode(filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING)); |
|
75 | 75 | if ($tracker) { |
76 | 76 | $spotter_array = $TrackerLive->getLastLiveTrackerDataByIdent($ident); |
77 | 77 | } elseif ($marine) { |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | } |
86 | 86 | $allhistory = true; |
87 | 87 | } elseif (isset($_GET['flightaware_id'])) { |
88 | - $flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING); |
|
88 | + $flightaware_id = filter_input(INPUT_GET, 'flightaware_id', FILTER_SANITIZE_STRING); |
|
89 | 89 | $spotter_array = $SpotterLive->getLastLiveSpotterDataById($flightaware_id); |
90 | 90 | if (empty($spotter_array)) { |
91 | 91 | $from_archive = true; |
@@ -93,44 +93,44 @@ discard block |
||
93 | 93 | } |
94 | 94 | $allhistory = true; |
95 | 95 | } elseif (isset($_GET['famtrack_id'])) { |
96 | - $famtrack_id = urldecode(filter_input(INPUT_GET,'famtrack_id',FILTER_SANITIZE_STRING)); |
|
96 | + $famtrack_id = urldecode(filter_input(INPUT_GET, 'famtrack_id', FILTER_SANITIZE_STRING)); |
|
97 | 97 | $spotter_array = $TrackerLive->getLastLiveTrackerDataById($famtrack_id); |
98 | 98 | $allhistory = true; |
99 | 99 | } elseif (isset($_GET['fammarine_id'])) { |
100 | - $fammarine_id = urldecode(filter_input(INPUT_GET,'fammarine_id',FILTER_SANITIZE_STRING)); |
|
100 | + $fammarine_id = urldecode(filter_input(INPUT_GET, 'fammarine_id', FILTER_SANITIZE_STRING)); |
|
101 | 101 | $spotter_array = $MarineLive->getLastLiveMarineDataById($fammarine_id); |
102 | 102 | $allhistory = true; |
103 | 103 | } elseif (isset($globalMapUseBbox) && $globalMapUseBbox && isset($_GET['coord']) && (!isset($globalMapPopup) || $globalMapPopup || (isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true'))) { |
104 | 104 | //} elseif (isset($_GET['coord'])) { |
105 | 105 | $usecoord = true; |
106 | - $coord = explode(',',$_GET['coord']); |
|
106 | + $coord = explode(',', $_GET['coord']); |
|
107 | 107 | if ($tracker) { |
108 | - $spotter_array = $TrackerLive->getLiveTrackerDatabyCoord($coord,$filter); |
|
108 | + $spotter_array = $TrackerLive->getLiveTrackerDatabyCoord($coord, $filter); |
|
109 | 109 | } elseif ($marine) { |
110 | - $spotter_array = $MarineLive->getLiveMarineDatabyCoord($coord,$filter); |
|
110 | + $spotter_array = $MarineLive->getLiveMarineDatabyCoord($coord, $filter); |
|
111 | 111 | } else { |
112 | - $spotter_array = $SpotterLive->getLiveSpotterDatabyCoord($coord,$filter); |
|
112 | + $spotter_array = $SpotterLive->getLiveSpotterDatabyCoord($coord, $filter); |
|
113 | 113 | } |
114 | 114 | } elseif (isset($globalMapUseBbox) && $globalMapUseBbox && isset($_GET['coord']) && $min) { |
115 | 115 | $usecoord = true; |
116 | - $coord = explode(',',$_GET['coord']); |
|
116 | + $coord = explode(',', $_GET['coord']); |
|
117 | 117 | if ($tracker) { |
118 | - $spotter_array = $TrackerLive->getMinLiveTrackerDatabyCoord($coord,$filter); |
|
118 | + $spotter_array = $TrackerLive->getMinLiveTrackerDatabyCoord($coord, $filter); |
|
119 | 119 | } elseif ($marine) { |
120 | - $spotter_array = $MarineLive->getMinLiveMarineDatabyCoord($coord,$filter); |
|
120 | + $spotter_array = $MarineLive->getMinLiveMarineDatabyCoord($coord, $filter); |
|
121 | 121 | } else { |
122 | - $spotter_array = $SpotterLive->getMinLiveSpotterDatabyCoord($coord,$filter); |
|
122 | + $spotter_array = $SpotterLive->getMinLiveSpotterDatabyCoord($coord, $filter); |
|
123 | 123 | } |
124 | 124 | } elseif (isset($_GET['archive']) && isset($_GET['begindate']) && isset($_GET['enddate']) && isset($_GET['speed']) && !isset($_GET['tracker']) && !isset($_GET['marine'])) { |
125 | 125 | $from_archive = true; |
126 | 126 | // $begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
127 | 127 | // $enddate = filter_input(INPUT_GET,'enddate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
128 | - $begindate = filter_input(INPUT_GET,'begindate',FILTER_SANITIZE_NUMBER_INT); |
|
129 | - $enddate = filter_input(INPUT_GET,'enddate',FILTER_SANITIZE_NUMBER_INT); |
|
130 | - $archivespeed = filter_input(INPUT_GET,'speed',FILTER_SANITIZE_NUMBER_INT); |
|
131 | - $begindate = date('Y-m-d H:i:s',$begindate); |
|
132 | - $enddate = date('Y-m-d H:i:s',$enddate); |
|
133 | - $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate,$enddate,$filter); |
|
128 | + $begindate = filter_input(INPUT_GET, 'begindate', FILTER_SANITIZE_NUMBER_INT); |
|
129 | + $enddate = filter_input(INPUT_GET, 'enddate', FILTER_SANITIZE_NUMBER_INT); |
|
130 | + $archivespeed = filter_input(INPUT_GET, 'speed', FILTER_SANITIZE_NUMBER_INT); |
|
131 | + $begindate = date('Y-m-d H:i:s', $begindate); |
|
132 | + $enddate = date('Y-m-d H:i:s', $enddate); |
|
133 | + $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate, $enddate, $filter); |
|
134 | 134 | } elseif ($min) { |
135 | 135 | if ($tracker) { |
136 | 136 | $spotter_array = $TrackerLive->getMinLiveTrackerData($filter); |
@@ -142,17 +142,17 @@ discard block |
||
142 | 142 | # $min = true; |
143 | 143 | } else { |
144 | 144 | if ($tracker) { |
145 | - $spotter_array = $TrackerLive->getLiveTrackerData('','',$filter); |
|
145 | + $spotter_array = $TrackerLive->getLiveTrackerData('', '', $filter); |
|
146 | 146 | } elseif ($marine) { |
147 | - $spotter_array = $marineLive->getLiveMarineData('','',$filter); |
|
147 | + $spotter_array = $marineLive->getLiveMarineData('', '', $filter); |
|
148 | 148 | } else { |
149 | - $spotter_array = $SpotterLive->getLiveSpotterData('','',$filter); |
|
149 | + $spotter_array = $SpotterLive->getLiveSpotterData('', '', $filter); |
|
150 | 150 | } |
151 | 151 | } |
152 | 152 | |
153 | 153 | if ($usecoord) { |
154 | 154 | if (isset($_GET['archive'])) { |
155 | - $flightcnt = $SpotterArchive->getLiveSpotterCount($begindate,$enddate,$filter); |
|
155 | + $flightcnt = $SpotterArchive->getLiveSpotterCount($begindate, $enddate, $filter); |
|
156 | 156 | } else { |
157 | 157 | if ($tracker) { |
158 | 158 | $flightcnt = $TrackerLive->getLiveTrackerCount($filter); |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | if ($flightcnt == '') $flightcnt = 0; |
166 | 166 | } else $flightcnt = 0; |
167 | 167 | |
168 | -$sqltime = round(microtime(true)-$begintime,2); |
|
168 | +$sqltime = round(microtime(true) - $begintime, 2); |
|
169 | 169 | |
170 | 170 | if ((!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation == FALSE) || (isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'false')) $usenextlatlon = false; |
171 | 171 | else $usenextlatlon = true; |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | if (!empty($spotter_array) && is_array($spotter_array)) |
183 | 183 | { |
184 | 184 | $output .= '"features": ['; |
185 | - foreach($spotter_array as $spotter_item) |
|
185 | + foreach ($spotter_array as $spotter_item) |
|
186 | 186 | { |
187 | 187 | $j++; |
188 | 188 | date_default_timezone_set('UTC'); |
@@ -238,8 +238,8 @@ discard block |
||
238 | 238 | */ |
239 | 239 | //$output .= '"fc": "'.$spotter_item['nb'].'",'; |
240 | 240 | if (isset($spotter_item['ident']) && $spotter_item['ident'] != '') { |
241 | - if ($compress) $output .= '"c": "'.str_replace('\\','',$spotter_item['ident']).'",'; |
|
242 | - else $output .= '"callsign": "'.str_replace('\\','',$spotter_item['ident']).'",'; |
|
241 | + if ($compress) $output .= '"c": "'.str_replace('\\', '', $spotter_item['ident']).'",'; |
|
242 | + else $output .= '"callsign": "'.str_replace('\\', '', $spotter_item['ident']).'",'; |
|
243 | 243 | //" |
244 | 244 | } else { |
245 | 245 | if ($compress) $output .= '"c": "NA",'; |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | if (isset($spotter_item['registration'])) $output .= '"registration": "'.$spotter_item['registration'].'",'; |
249 | 249 | if (isset($spotter_item['aircraft_name']) && isset($spotter_item['aircraft_type'])) { |
250 | 250 | $output .= '"aircraft_name": "'.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')",'; |
251 | - $output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ','_',$spotter_item['aircraft_name'])).'",'; |
|
251 | + $output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ', '_', $spotter_item['aircraft_name'])).'",'; |
|
252 | 252 | } elseif (isset($spotter_item['aircraft_type'])) { |
253 | 253 | $output .= '"aircraft_name": "NA ('.$spotter_item['aircraft_type'].')",'; |
254 | 254 | } elseif (!$min) { |
@@ -389,16 +389,16 @@ discard block |
||
389 | 389 | else $output .= '"heading": "'.$spotter_item['heading'].'",'; |
390 | 390 | |
391 | 391 | if (isset($archivespeed)) { |
392 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading'],$archivespeed); |
|
392 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $spotter_item['heading'], $archivespeed); |
|
393 | 393 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
394 | 394 | } elseif ($usenextlatlon) { |
395 | - $nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$spotter_item['heading']); |
|
395 | + $nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $spotter_item['heading']); |
|
396 | 396 | $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],'; |
397 | 397 | } |
398 | 398 | |
399 | 399 | if (!$min) $output .= '"image": "'.$image.'",'; |
400 | 400 | if (isset($spotter_item['image_copyright']) && $spotter_item['image_copyright'] != '') { |
401 | - $output .= '"image_copyright": "'.str_replace('"',"'",trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'',$spotter_item['image_copyright']))).'",'; |
|
401 | + $output .= '"image_copyright": "'.str_replace('"', "'", trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '', $spotter_item['image_copyright']))).'",'; |
|
402 | 402 | } |
403 | 403 | if (isset($spotter_item['image_source_website'])) { |
404 | 404 | $output .= '"image_source_website": "'.urlencode($spotter_item['image_source_website']).'",'; |
@@ -420,7 +420,7 @@ discard block |
||
420 | 420 | $output .= '"waypoints": "'.$spotter_item['waypoints'].'",'; |
421 | 421 | } |
422 | 422 | if (isset($spotter_item['acars'])) { |
423 | - $output .= '"acars": "'.trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"), '<br />',$spotter_item['acars']['message'])).'",'; |
|
423 | + $output .= '"acars": "'.trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '<br />', $spotter_item['acars']['message'])).'",'; |
|
424 | 424 | } |
425 | 425 | // type when not aircraft ? |
426 | 426 | if (isset($spotter_item['type'])) { |
@@ -498,7 +498,7 @@ discard block |
||
498 | 498 | |
499 | 499 | } |
500 | 500 | */ |
501 | - $history = filter_input(INPUT_GET,'history',FILTER_SANITIZE_STRING); |
|
501 | + $history = filter_input(INPUT_GET, 'history', FILTER_SANITIZE_STRING); |
|
502 | 502 | if ($history == '' && isset($_COOKIE['history'])) $history = $_COOKIE['history']; |
503 | 503 | |
504 | 504 | if ( |
@@ -506,11 +506,11 @@ discard block |
||
506 | 506 | || ((isset($globalMapHistory) && $globalMapHistory) || $allhistory) |
507 | 507 | // || (isset($history) && $history != '' && $history != 'NA' && ($history == $spotter_item['ident'] || $history == $spotter_item['flightaware_id'])) |
508 | 508 | // || (isset($history) && $history != '' && $history != 'NA' && $history == $spotter_item['ident']) |
509 | - || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
|
509 | + || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id'])) |
|
510 | 510 | || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']) |
511 | - || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['fammarine_id'])) |
|
511 | + || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['fammarine_id'])) |
|
512 | 512 | || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['fammarine_id']) && $_GET['fammarine_id'] == $spotter_item['fammarine_id']) |
513 | - || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['famtrackid'])) |
|
513 | + || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['famtrackid'])) |
|
514 | 514 | || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['famtrackid']) && $_GET['famtrackid'] == $spotter_item['famtrackid']) |
515 | 515 | ) { |
516 | 516 | if ($tracker) { |
@@ -547,9 +547,9 @@ discard block |
||
547 | 547 | else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": ['; |
548 | 548 | } |
549 | 549 | $output_history .= '['; |
550 | - $output_history .= $spotter_history['longitude'].', '; |
|
551 | - $output_history .= $spotter_history['latitude'].', '; |
|
552 | - $output_history .= $spotter_history['altitude']*30.48; |
|
550 | + $output_history .= $spotter_history['longitude'].', '; |
|
551 | + $output_history .= $spotter_history['latitude'].', '; |
|
552 | + $output_history .= $spotter_history['altitude']*30.48; |
|
553 | 553 | $output_history .= '],'; |
554 | 554 | /* |
555 | 555 | if ($from_archive === false) { |
@@ -567,8 +567,8 @@ discard block |
||
567 | 567 | else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history"},"geometry": {"type": "LineString","coordinates": ['; |
568 | 568 | } else $d = true; |
569 | 569 | $output_history .= '['; |
570 | - $output_history .= $spotter_history['longitude'].', '; |
|
571 | - $output_history .= $spotter_history['latitude']; |
|
570 | + $output_history .= $spotter_history['longitude'].', '; |
|
571 | + $output_history .= $spotter_history['latitude']; |
|
572 | 572 | $output_history .= '],'; |
573 | 573 | /* |
574 | 574 | if ($from_archive === false) { |
@@ -584,9 +584,9 @@ discard block |
||
584 | 584 | |
585 | 585 | if ($from_archive === false) { |
586 | 586 | $output_historyd = '['; |
587 | - $output_historyd .= $spotter_item['longitude'].', '; |
|
588 | - $output_historyd .= $spotter_item['latitude']; |
|
589 | - if (isset($spotter_history['altitude'])) $output_historyd .= ','.$spotter_item['altitude']*30.48; |
|
587 | + $output_historyd .= $spotter_item['longitude'].', '; |
|
588 | + $output_historyd .= $spotter_item['latitude']; |
|
589 | + if (isset($spotter_history['altitude'])) $output_historyd .= ','.$spotter_item['altitude']*30.48; |
|
590 | 590 | $output_historyd .= '],'; |
591 | 591 | //$output_history = $output_historyd.$output_history; |
592 | 592 | $output_history = $output_history.$output_historyd; |
@@ -600,7 +600,7 @@ discard block |
||
600 | 600 | } |
601 | 601 | } |
602 | 602 | |
603 | - if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
|
603 | + if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id'])) |
|
604 | 604 | || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
605 | 605 | && (isset($spotter_item['departure_airport']) |
606 | 606 | && $spotter_item['departure_airport'] != 'NA' |
@@ -634,7 +634,7 @@ discard block |
||
634 | 634 | |
635 | 635 | //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))))) { |
636 | 636 | //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))))) { |
637 | - if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id'])) |
|
637 | + if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id'])) |
|
638 | 638 | || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])) |
639 | 639 | && (isset($spotter_item['arrival_airport']) |
640 | 640 | && $spotter_item['arrival_airport'] != 'NA' |
@@ -665,7 +665,7 @@ discard block |
||
665 | 665 | $output = substr($output, 0, -1); |
666 | 666 | $output .= ']'; |
667 | 667 | $output .= ',"initial_sqltime": "'.$sqltime.'",'; |
668 | - $output .= '"totaltime": "'.round(microtime(true)-$begintime,2).'",'; |
|
668 | + $output .= '"totaltime": "'.round(microtime(true) - $begintime, 2).'",'; |
|
669 | 669 | if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",'; |
670 | 670 | $output .= '"fc": "'.$j.'"'; |
671 | 671 | } else { |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | require_once('../require/settings.php'); |
3 | 3 | require_once('../require/class.Language.php'); |
4 | 4 | |
5 | -setcookie("MapFormat",'2d'); |
|
5 | +setcookie("MapFormat", '2d'); |
|
6 | 6 | |
7 | 7 | if (!isset($globalOpenWeatherMapKey)) $globalOpenWeatherMapKey = ''; |
8 | 8 | // Compressed GeoJson is used if true |
@@ -20,10 +20,10 @@ discard block |
||
20 | 20 | $lastupd = $_GET['archivespeed']*$archiveupdatetime; |
21 | 21 | if (isset($_GET['enddate']) && $_GET['enddate'] != '') $enddate = $_GET['enddate']; |
22 | 22 | else $enddate = time(); |
23 | - setcookie("archive_begin",$begindate); |
|
24 | - setcookie("archive_end",$enddate); |
|
25 | - setcookie("archive_update",$lastupd); |
|
26 | - setcookie("archive_speed",$archivespeed); |
|
23 | + setcookie("archive_begin", $begindate); |
|
24 | + setcookie("archive_end", $enddate); |
|
25 | + setcookie("archive_update", $lastupd); |
|
26 | + setcookie("archive_speed", $archivespeed); |
|
27 | 27 | ?> |
28 | 28 | document.cookie = 'archive_begin=<?php print $begindate; ?>; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/'; |
29 | 29 | document.cookie = 'archive_end=<?php print $enddate; ?>; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/'; |
@@ -74,16 +74,16 @@ discard block |
||
74 | 74 | <?php |
75 | 75 | } |
76 | 76 | if (isset($_GET['ident'])) { |
77 | - $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
|
77 | + $ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING); |
|
78 | 78 | } |
79 | 79 | if (isset($_GET['flightaware_id'])) { |
80 | - $flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING); |
|
80 | + $flightaware_id = filter_input(INPUT_GET, 'flightaware_id', FILTER_SANITIZE_STRING); |
|
81 | 81 | } |
82 | 82 | if (isset($_GET['latitude'])) { |
83 | - $latitude = filter_input(INPUT_GET,'latitude',FILTER_SANITIZE_STRING); |
|
83 | + $latitude = filter_input(INPUT_GET, 'latitude', FILTER_SANITIZE_STRING); |
|
84 | 84 | } |
85 | 85 | if (isset($_GET['longitude'])) { |
86 | - $longitude = filter_input(INPUT_GET,'longitude',FILTER_SANITIZE_STRING); |
|
86 | + $longitude = filter_input(INPUT_GET, 'longitude', FILTER_SANITIZE_STRING); |
|
87 | 87 | } |
88 | 88 | ?> |
89 | 89 | |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | || navigator.userAgent.match(/BlackBerry/i) |
120 | 120 | || navigator.userAgent.match(/Windows Phone/i)) |
121 | 121 | { |
122 | - var zoom = <?php if (isset($globalLiveZoom)) print $globalLiveZoom-1; else print '8'; ?>; |
|
122 | + var zoom = <?php if (isset($globalLiveZoom)) print $globalLiveZoom - 1; else print '8'; ?>; |
|
123 | 123 | } else { |
124 | 124 | var zoom = <?php if (isset($globalLiveZoom)) print $globalLiveZoom; else print '9'; ?>; |
125 | 125 | } |
@@ -213,19 +213,19 @@ discard block |
||
213 | 213 | map.addLayer(yandexLayer); |
214 | 214 | <?php |
215 | 215 | } elseif ($MapType == 'Bing-Aerial') { |
216 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
216 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType', 'OpenStreetMap'); |
|
217 | 217 | ?> |
218 | 218 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'Aerial'}); |
219 | 219 | map.addLayer(bingLayer); |
220 | 220 | <?php |
221 | 221 | } elseif ($MapType == 'Bing-Hybrid') { |
222 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
222 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType', 'OpenStreetMap'); |
|
223 | 223 | ?> |
224 | 224 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'AerialWithLabels'}); |
225 | 225 | map.addLayer(bingLayer); |
226 | 226 | <?php |
227 | 227 | } elseif ($MapType == 'Bing-Road') { |
228 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
228 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType', 'OpenStreetMap'); |
|
229 | 229 | ?> |
230 | 230 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'Road'}); |
231 | 231 | map.addLayer(bingLayer); |
@@ -385,10 +385,10 @@ discard block |
||
385 | 385 | setInterval(function(){update_locationsLayer()},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>); |
386 | 386 | |
387 | 387 | <?php |
388 | - // Add support for custom json via $globalMapJson |
|
389 | - if (isset($globalMapJson) && is_array($globalMapJson)) { |
|
388 | + // Add support for custom json via $globalMapJson |
|
389 | + if (isset($globalMapJson) && is_array($globalMapJson)) { |
|
390 | 390 | foreach ($globalMapJson as $json) { |
391 | - if (isset($json['url'])) { |
|
391 | + if (isset($json['url'])) { |
|
392 | 392 | ?> |
393 | 393 | update_genLayer('<?php print $json['url']; ?>'); |
394 | 394 | <?php |
@@ -397,9 +397,9 @@ discard block |
||
397 | 397 | setInterval(function(){update_genLayer('<?php print $json['url']; ?>')}, <?php print $json['refresh']; ?>); |
398 | 398 | <?php |
399 | 399 | } |
400 | - } |
|
400 | + } |
|
401 | + } |
|
401 | 402 | } |
402 | - } |
|
403 | 403 | |
404 | 404 | ?> |
405 | 405 | //adds the bootstrap tooltip to the map icons |
@@ -4,10 +4,15 @@ discard block |
||
4 | 4 | |
5 | 5 | setcookie("MapFormat",'2d'); |
6 | 6 | |
7 | -if (!isset($globalOpenWeatherMapKey)) $globalOpenWeatherMapKey = ''; |
|
7 | +if (!isset($globalOpenWeatherMapKey)) { |
|
8 | + $globalOpenWeatherMapKey = ''; |
|
9 | +} |
|
8 | 10 | // Compressed GeoJson is used if true |
9 | -if (!isset($globalJsonCompress)) $compress = true; |
|
10 | -else $compress = $globalJsonCompress; |
|
11 | +if (!isset($globalJsonCompress)) { |
|
12 | + $compress = true; |
|
13 | +} else { |
|
14 | + $compress = $globalJsonCompress; |
|
15 | +} |
|
11 | 16 | if (isset($_GET['archive'])) { |
12 | 17 | $archive = true; |
13 | 18 | //$archiveupdatetime = 50; |
@@ -18,8 +23,11 @@ discard block |
||
18 | 23 | //$lastupd = round(($_GET['enddate']-$_GET['begindate'])/(($_GET['during']*60)/10)); |
19 | 24 | //$lastupd = 20; |
20 | 25 | $lastupd = $_GET['archivespeed']*$archiveupdatetime; |
21 | - if (isset($_GET['enddate']) && $_GET['enddate'] != '') $enddate = $_GET['enddate']; |
|
22 | - else $enddate = time(); |
|
26 | + if (isset($_GET['enddate']) && $_GET['enddate'] != '') { |
|
27 | + $enddate = $_GET['enddate']; |
|
28 | + } else { |
|
29 | + $enddate = time(); |
|
30 | + } |
|
23 | 31 | setcookie("archive_begin",$begindate); |
24 | 32 | setcookie("archive_end",$enddate); |
25 | 33 | setcookie("archive_update",$lastupd); |
@@ -106,7 +114,17 @@ discard block |
||
106 | 114 | } |
107 | 115 | |
108 | 116 | //create the map |
109 | - map = L.map('archive-map', { zoomControl:false }).setView([<?php if (isset($latitude)) print $latitude; else print $globalCenterLatitude; ?>,<?php if (isset($longitude)) print $longitude; else print $globalCenterLongitude; ?>], zoom); |
|
117 | + map = L.map('archive-map', { zoomControl:false }).setView([<?php if (isset($latitude)) { |
|
118 | + print $latitude; |
|
119 | +} else { |
|
120 | + print $globalCenterLatitude; |
|
121 | +} |
|
122 | +?>,<?php if (isset($longitude)) { |
|
123 | + print $longitude; |
|
124 | +} else { |
|
125 | + print $globalCenterLongitude; |
|
126 | +} |
|
127 | +?>], zoom); |
|
110 | 128 | <?php |
111 | 129 | } else { |
112 | 130 | ?> |
@@ -119,9 +137,19 @@ discard block |
||
119 | 137 | || navigator.userAgent.match(/BlackBerry/i) |
120 | 138 | || navigator.userAgent.match(/Windows Phone/i)) |
121 | 139 | { |
122 | - var zoom = <?php if (isset($globalLiveZoom)) print $globalLiveZoom-1; else print '8'; ?>; |
|
140 | + var zoom = <?php if (isset($globalLiveZoom)) { |
|
141 | + print $globalLiveZoom-1; |
|
142 | +} else { |
|
143 | + print '8'; |
|
144 | +} |
|
145 | +?>; |
|
123 | 146 | } else { |
124 | - var zoom = <?php if (isset($globalLiveZoom)) print $globalLiveZoom; else print '9'; ?>; |
|
147 | + var zoom = <?php if (isset($globalLiveZoom)) { |
|
148 | + print $globalLiveZoom; |
|
149 | +} else { |
|
150 | + print '9'; |
|
151 | +} |
|
152 | +?>; |
|
125 | 153 | } |
126 | 154 | |
127 | 155 | //create the map |
@@ -146,16 +174,27 @@ discard block |
||
146 | 174 | bounds = L.latLngBounds(southWest,northEast); |
147 | 175 | //a few title layers |
148 | 176 | <?php |
149 | - if (isset($_COOKIE['MapType'])) $MapType = $_COOKIE['MapType']; |
|
150 | - else $MapType = $globalMapProvider; |
|
177 | + if (isset($_COOKIE['MapType'])) { |
|
178 | + $MapType = $_COOKIE['MapType']; |
|
179 | + } else { |
|
180 | + $MapType = $globalMapProvider; |
|
181 | + } |
|
151 | 182 | |
152 | 183 | if ($MapType == 'Mapbox') { |
153 | - if ($_COOKIE['MapTypeId'] == 'default') $MapBoxId = $globalMapboxId; |
|
154 | - else $MapBoxId = $_COOKIE['MapTypeId']; |
|
155 | -?> |
|
184 | + if ($_COOKIE['MapTypeId'] == 'default') { |
|
185 | + $MapBoxId = $globalMapboxId; |
|
186 | + } else { |
|
187 | + $MapBoxId = $_COOKIE['MapTypeId']; |
|
188 | + } |
|
189 | + ?> |
|
156 | 190 | L.tileLayer('https://{s}.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={token}', { |
157 | 191 | maxZoom: 18, |
158 | - noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) print 'false'; else print 'true'; ?>, |
|
192 | + noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) { |
|
193 | + print 'false'; |
|
194 | +} else { |
|
195 | + print 'true'; |
|
196 | +} |
|
197 | +?>, |
|
159 | 198 | attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' + |
160 | 199 | '<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' + |
161 | 200 | 'Imagery © <a href="http://mapbox.com">Mapbox</a>', |
@@ -167,7 +206,12 @@ discard block |
||
167 | 206 | ?> |
168 | 207 | L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { |
169 | 208 | maxZoom: 18, |
170 | - noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) print 'false'; else print 'true'; ?>, |
|
209 | + noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) { |
|
210 | + print 'false'; |
|
211 | +} else { |
|
212 | + print 'true'; |
|
213 | +} |
|
214 | +?>, |
|
171 | 215 | attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' + |
172 | 216 | '<a href="www.openstreetmap.org/copyright">Open Database Licence</a>' |
173 | 217 | }).addTo(map); |
@@ -213,20 +257,26 @@ discard block |
||
213 | 257 | map.addLayer(yandexLayer); |
214 | 258 | <?php |
215 | 259 | } elseif ($MapType == 'Bing-Aerial') { |
216 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
217 | -?> |
|
260 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') { |
|
261 | + setcookie('MapType','OpenStreetMap'); |
|
262 | + } |
|
263 | + ?> |
|
218 | 264 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'Aerial'}); |
219 | 265 | map.addLayer(bingLayer); |
220 | 266 | <?php |
221 | 267 | } elseif ($MapType == 'Bing-Hybrid') { |
222 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
223 | -?> |
|
268 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') { |
|
269 | + setcookie('MapType','OpenStreetMap'); |
|
270 | + } |
|
271 | + ?> |
|
224 | 272 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'AerialWithLabels'}); |
225 | 273 | map.addLayer(bingLayer); |
226 | 274 | <?php |
227 | 275 | } elseif ($MapType == 'Bing-Road') { |
228 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
229 | -?> |
|
276 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') { |
|
277 | + setcookie('MapType','OpenStreetMap'); |
|
278 | + } |
|
279 | + ?> |
|
230 | 280 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'Road'}); |
231 | 281 | map.addLayer(bingLayer); |
232 | 282 | <?php |
@@ -249,9 +299,24 @@ discard block |
||
249 | 299 | $customid = $MapType; |
250 | 300 | ?> |
251 | 301 | L.tileLayer('<?php print $globalMapCustomLayer[$customid]['url']; ?>/{z}/{x}/{y}.png', { |
252 | - maxZoom: <?php if (isset($globalMapCustomLayer[$customid]['maxZoom'])) print $globalMapCustomLayer[$customid]['maxZoom']; else print '18'; ?>, |
|
253 | - minZoom: <?php if (isset($globalMapCustomLayer[$customid]['minZoom'])) print $globalMapCustomLayer[$customid]['minZoom']; else print '0'; ?>, |
|
254 | - noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) print 'false'; else print 'true'; ?>, |
|
302 | + maxZoom: <?php if (isset($globalMapCustomLayer[$customid]['maxZoom'])) { |
|
303 | + print $globalMapCustomLayer[$customid]['maxZoom']; |
|
304 | +} else { |
|
305 | + print '18'; |
|
306 | +} |
|
307 | +?>, |
|
308 | + minZoom: <?php if (isset($globalMapCustomLayer[$customid]['minZoom'])) { |
|
309 | + print $globalMapCustomLayer[$customid]['minZoom']; |
|
310 | +} else { |
|
311 | + print '0'; |
|
312 | +} |
|
313 | +?>, |
|
314 | + noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) { |
|
315 | + print 'false'; |
|
316 | +} else { |
|
317 | + print 'true'; |
|
318 | +} |
|
319 | +?>, |
|
255 | 320 | attribution: '<?php print $globalMapCustomLayer[$customid]['attribution']; ?>' |
256 | 321 | }).addTo(map); |
257 | 322 | |
@@ -285,7 +350,12 @@ discard block |
||
285 | 350 | } |
286 | 351 | } elseif ($globalBounding == 'circle') { |
287 | 352 | ?> |
288 | - var circle = L.circle([<?php print $globalCenterLatitude; ?>, <?php print $globalCenterLongitude; ?>],<?php if (isset($globalBoundingCircleSize)) print $globalBoundingCircleSize; else print '70000'; ?>,{ |
|
353 | + var circle = L.circle([<?php print $globalCenterLatitude; ?>, <?php print $globalCenterLongitude; ?>],<?php if (isset($globalBoundingCircleSize)) { |
|
354 | + print $globalBoundingCircleSize; |
|
355 | +} else { |
|
356 | + print '70000'; |
|
357 | +} |
|
358 | +?>,{ |
|
289 | 359 | color: '#92C7D1', |
290 | 360 | fillColor: '#92C7D1', |
291 | 361 | fillOpacity: 0.3, |
@@ -382,7 +452,12 @@ discard block |
||
382 | 452 | //} |
383 | 453 | }); |
384 | 454 | update_locationsLayer(); |
385 | -setInterval(function(){update_locationsLayer()},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>); |
|
455 | +setInterval(function(){update_locationsLayer()},<?php if (isset($globalMapRefresh)) { |
|
456 | + print $globalMapRefresh*1000*2; |
|
457 | +} else { |
|
458 | + print '60000'; |
|
459 | +} |
|
460 | +?>); |
|
386 | 461 | |
387 | 462 | <?php |
388 | 463 | // Add support for custom json via $globalMapJson |
@@ -52,6 +52,10 @@ discard block |
||
52 | 52 | $this->openedFiles = []; |
53 | 53 | } |
54 | 54 | |
55 | + /** |
|
56 | + * @param double $row |
|
57 | + * @param double $column |
|
58 | + */ |
|
55 | 59 | private function getElevationAtPosition($fileName, $row, $column) { |
56 | 60 | if (!array_key_exists($fileName, $this->openedFiles)) { |
57 | 61 | if (!file_exists($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName)) { |
@@ -85,7 +89,7 @@ discard block |
||
85 | 89 | * @param float $lon |
86 | 90 | * @param null $fName |
87 | 91 | * |
88 | - * @return mixed |
|
92 | + * @return double |
|
89 | 93 | * @throws \Exception |
90 | 94 | */ |
91 | 95 | public function getElevation($lat, $lon, &$fName = null) { |
@@ -142,6 +146,9 @@ discard block |
||
142 | 146 | return $zN; |
143 | 147 | } |
144 | 148 | |
149 | + /** |
|
150 | + * @param integer $numPrefix |
|
151 | + */ |
|
145 | 152 | private function getDeg($deg, $numPrefix) { |
146 | 153 | $deg = abs($deg); |
147 | 154 | $d = floor($deg); // round degrees |
@@ -156,6 +163,9 @@ discard block |
||
156 | 163 | return $d; |
157 | 164 | } |
158 | 165 | |
166 | + /** |
|
167 | + * @param double $deg |
|
168 | + */ |
|
159 | 169 | private function getSec($deg) { |
160 | 170 | $deg = abs($deg); |
161 | 171 | $sec = round($deg * 3600, 4); |
@@ -28,7 +28,9 @@ discard block |
||
28 | 28 | private $openedFiles = []; |
29 | 29 | |
30 | 30 | public function __construct($htgFilesDestination = '', $resolution = 3) { |
31 | - if ($htgFilesDestination == '') $htgFilesDestination = dirname(__FILE__).'/../data/'; |
|
31 | + if ($htgFilesDestination == '') { |
|
32 | + $htgFilesDestination = dirname(__FILE__).'/../data/'; |
|
33 | + } |
|
32 | 34 | $this->htgFilesDestination = $htgFilesDestination; |
33 | 35 | $this->resolution = $resolution; |
34 | 36 | switch ($resolution) { |
@@ -171,16 +173,26 @@ discard block |
||
171 | 173 | $fileName = "N{$N}E{$E}.hgt"; |
172 | 174 | if (!file_exists($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName)) { |
173 | 175 | $Common = new Common(); |
174 | - if ($debug) echo 'Downloading '.$fileName.'.gz ...'; |
|
176 | + if ($debug) { |
|
177 | + echo 'Downloading '.$fileName.'.gz ...'; |
|
178 | + } |
|
175 | 179 | $Common->download('https://s3.amazonaws.com/elevation-tiles-prod/skadi/N'.$N.'/'.$fileName.'.gz',$this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz'); |
176 | 180 | if (!file_exists($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz')) { |
177 | - if ($debug) echo "File '{$fileName}.gz' not exists."; |
|
181 | + if ($debug) { |
|
182 | + echo "File '{$fileName}.gz' not exists."; |
|
183 | + } |
|
178 | 184 | return false; |
179 | 185 | } |
180 | - if ($debug) echo 'Done'."\n"; |
|
181 | - if ($debug) echo 'Decompress '.$fileName.' ....'; |
|
186 | + if ($debug) { |
|
187 | + echo 'Done'."\n"; |
|
188 | + } |
|
189 | + if ($debug) { |
|
190 | + echo 'Decompress '.$fileName.' ....'; |
|
191 | + } |
|
182 | 192 | $Common->gunzip($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz',$this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName); |
183 | - if ($debug) echo 'Done'."\n"; |
|
193 | + if ($debug) { |
|
194 | + echo 'Done'."\n"; |
|
195 | + } |
|
184 | 196 | unlink($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz'); |
185 | 197 | } |
186 | 198 | return true; |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | default: |
42 | 42 | throw new \Exception("bad resolution can be only one of 1,3"); |
43 | 43 | } |
44 | - register_shutdown_function(function () { |
|
44 | + register_shutdown_function(function() { |
|
45 | 45 | $this->closeAllFiles(); |
46 | 46 | }); |
47 | 47 | } |
@@ -55,10 +55,10 @@ discard block |
||
55 | 55 | |
56 | 56 | private function getElevationAtPosition($fileName, $row, $column) { |
57 | 57 | if (!array_key_exists($fileName, $this->openedFiles)) { |
58 | - if (!file_exists($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName)) { |
|
58 | + if (!file_exists($this->htgFilesDestination.DIRECTORY_SEPARATOR.$fileName)) { |
|
59 | 59 | throw new \Exception("File '{$fileName}' not exists."); |
60 | 60 | } |
61 | - $file = fopen($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName, "r"); |
|
61 | + $file = fopen($this->htgFilesDestination.DIRECTORY_SEPARATOR.$fileName, "r"); |
|
62 | 62 | if ($file === false) { |
63 | 63 | throw new \Exception("Cant open file '{$fileName}' for reading."); |
64 | 64 | } |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | throw new \Exception("Not implemented yet"); |
73 | 73 | } |
74 | 74 | $aRow = $this->measPerDeg - $row; |
75 | - $position = ($this->measPerDeg * ($aRow - 1)) + $column; |
|
75 | + $position = ($this->measPerDeg*($aRow - 1)) + $column; |
|
76 | 76 | $position *= 2; |
77 | 77 | fseek($file, $position); |
78 | 78 | $short = fread($file, 2); |
@@ -100,8 +100,8 @@ discard block |
||
100 | 100 | $latSec = $this->getSec($lat); |
101 | 101 | $lonSec = $this->getSec($lon); |
102 | 102 | |
103 | - $Xn = round($latSec / $this->resolution, 3); |
|
104 | - $Yn = round($lonSec / $this->resolution, 3); |
|
103 | + $Xn = round($latSec/$this->resolution, 3); |
|
104 | + $Yn = round($lonSec/$this->resolution, 3); |
|
105 | 105 | |
106 | 106 | $a1 = round($Xn); |
107 | 107 | $a2 = round($Yn); |
@@ -133,55 +133,55 @@ discard block |
||
133 | 133 | $b3 = $this->getElevationAtPosition($fName, $b1, $b2); |
134 | 134 | $c3 = $this->getElevationAtPosition($fName, $c1, $c2); |
135 | 135 | |
136 | - $n1 = ($c2 - $a2) * ($b3 - $a3) - ($c3 - $a3) * ($b2 - $a2); |
|
137 | - $n2 = ($c3 - $a3) * ($b1 - $a1) - ($c1 - $a1) * ($b3 - $a3); |
|
138 | - $n3 = ($c1 - $a1) * ($b2 - $a2) - ($c2 - $a2) * ($b1 - $a1); |
|
136 | + $n1 = ($c2 - $a2)*($b3 - $a3) - ($c3 - $a3)*($b2 - $a2); |
|
137 | + $n2 = ($c3 - $a3)*($b1 - $a1) - ($c1 - $a1)*($b3 - $a3); |
|
138 | + $n3 = ($c1 - $a1)*($b2 - $a2) - ($c2 - $a2)*($b1 - $a1); |
|
139 | 139 | |
140 | - $d = -$n1 * $a1 - $n2 * $a2 - $n3 * $a3; |
|
141 | - $zN = (-$n1 * $Xn - $n2 * $Yn - $d) / $n3; |
|
140 | + $d = -$n1*$a1 - $n2*$a2 - $n3*$a3; |
|
141 | + $zN = (-$n1*$Xn - $n2*$Yn - $d)/$n3; |
|
142 | 142 | |
143 | 143 | return $zN; |
144 | 144 | } |
145 | 145 | |
146 | 146 | private function getDeg($deg, $numPrefix) { |
147 | 147 | $deg = abs($deg); |
148 | - $d = floor($deg); // round degrees |
|
148 | + $d = floor($deg); // round degrees |
|
149 | 149 | if ($numPrefix >= 3) { |
150 | 150 | if ($d < 100) { |
151 | - $d = '0' . $d; |
|
151 | + $d = '0'.$d; |
|
152 | 152 | } |
153 | 153 | } // pad with leading zeros |
154 | 154 | if ($d < 10) { |
155 | - $d = '0' . $d; |
|
155 | + $d = '0'.$d; |
|
156 | 156 | } |
157 | 157 | return $d; |
158 | 158 | } |
159 | 159 | |
160 | 160 | private function getSec($deg) { |
161 | 161 | $deg = abs($deg); |
162 | - $sec = round($deg * 3600, 4); |
|
163 | - $m = fmod(floor($sec / 60), 60); |
|
162 | + $sec = round($deg*3600, 4); |
|
163 | + $m = fmod(floor($sec/60), 60); |
|
164 | 164 | $s = round(fmod($sec, 60), 4); |
165 | - return ($m * 60) + $s; |
|
165 | + return ($m*60) + $s; |
|
166 | 166 | } |
167 | 167 | |
168 | - public function download($lat,$lon, $debug = false) { |
|
168 | + public function download($lat, $lon, $debug = false) { |
|
169 | 169 | $N = $this->getDeg($lat, 2); |
170 | 170 | $E = $this->getDeg($lon, 3); |
171 | - $fileName = "N{$N}E{$E}.hgt"; |
|
172 | - if (!file_exists($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName)) { |
|
171 | + $fileName = "N{$N}E{$E}.hgt"; |
|
172 | + if (!file_exists($this->htgFilesDestination.DIRECTORY_SEPARATOR.$fileName)) { |
|
173 | 173 | $Common = new Common(); |
174 | 174 | if ($debug) echo 'Downloading '.$fileName.'.gz ...'; |
175 | - $Common->download('https://s3.amazonaws.com/elevation-tiles-prod/skadi/N'.$N.'/'.$fileName.'.gz',$this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz'); |
|
176 | - if (!file_exists($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz')) { |
|
175 | + $Common->download('https://s3.amazonaws.com/elevation-tiles-prod/skadi/N'.$N.'/'.$fileName.'.gz', $this->htgFilesDestination.DIRECTORY_SEPARATOR.$fileName.'.gz'); |
|
176 | + if (!file_exists($this->htgFilesDestination.DIRECTORY_SEPARATOR.$fileName.'.gz')) { |
|
177 | 177 | if ($debug) echo "File '{$fileName}.gz' not exists."; |
178 | 178 | return false; |
179 | 179 | } |
180 | 180 | if ($debug) echo 'Done'."\n"; |
181 | 181 | if ($debug) echo 'Decompress '.$fileName.' ....'; |
182 | - $Common->gunzip($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz',$this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName); |
|
182 | + $Common->gunzip($this->htgFilesDestination.DIRECTORY_SEPARATOR.$fileName.'.gz', $this->htgFilesDestination.DIRECTORY_SEPARATOR.$fileName); |
|
183 | 183 | if ($debug) echo 'Done'."\n"; |
184 | - unlink($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz'); |
|
184 | + unlink($this->htgFilesDestination.DIRECTORY_SEPARATOR.$fileName.'.gz'); |
|
185 | 185 | } |
186 | 186 | return true; |
187 | 187 | } |
@@ -194,22 +194,22 @@ discard block |
||
194 | 194 | try { |
195 | 195 | $sth = $db->prepare($query); |
196 | 196 | $sth->execute($query_values); |
197 | - } catch(PDOException $e) { |
|
197 | + } catch (PDOException $e) { |
|
198 | 198 | return "error : ".$e->getMessage(); |
199 | 199 | } |
200 | 200 | while ($data = $sth->fetch(PDO::FETCH_ASSOC)) { |
201 | - $this->download($data['latitude'],$data['longitude'],true); |
|
201 | + $this->download($data['latitude'], $data['longitude'], true); |
|
202 | 202 | } |
203 | 203 | $query = 'SELECT latitude, longitude FROM tracker_output WHERE latitude <> 0 AND longitude <> 0 ORDER BY date DESC LIMIT 50'; |
204 | 204 | $query_values = array(); |
205 | 205 | try { |
206 | 206 | $sth = $db->prepare($query); |
207 | 207 | $sth->execute($query_values); |
208 | - } catch(PDOException $e) { |
|
208 | + } catch (PDOException $e) { |
|
209 | 209 | return "error : ".$e->getMessage(); |
210 | 210 | } |
211 | 211 | while ($data = $sth->fetch(PDO::FETCH_ASSOC)) { |
212 | - $this->download($data['latitude'],$data['longitude'],true); |
|
212 | + $this->download($data['latitude'], $data['longitude'], true); |
|
213 | 213 | } |
214 | 214 | } |
215 | 215 | } |
@@ -57,7 +57,9 @@ discard block |
||
57 | 57 | { |
58 | 58 | if ($spotter_item['image_source'] == 'flickr' || $spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart') { |
59 | 59 | $image = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
60 | - } else $image = $spotter_item['image_thumbnail']; |
|
60 | + } else { |
|
61 | + $image = $spotter_item['image_thumbnail']; |
|
62 | + } |
|
61 | 63 | |
62 | 64 | } |
63 | 65 | /* else { |
@@ -70,8 +72,12 @@ discard block |
||
70 | 72 | } |
71 | 73 | print '<div class="right">'; |
72 | 74 | print '<div class="callsign-details">'; |
73 | -if ($spotter_item['ident'] != 'Not Available') print '<div class="callsign"><a href="'.$globalURL.'/redirect/'.$spotter_item['flightaware_id'].'" target="_blank">'.$spotter_item['ident'].'</a></div>'; |
|
74 | -if (isset($spotter_item['airline_name']) && $spotter_item['airline_name'] != 'Not Available') print '<div class="airline">'.$spotter_item['airline_name'].'</div>'; |
|
75 | +if ($spotter_item['ident'] != 'Not Available') { |
|
76 | + print '<div class="callsign"><a href="'.$globalURL.'/redirect/'.$spotter_item['flightaware_id'].'" target="_blank">'.$spotter_item['ident'].'</a></div>'; |
|
77 | +} |
|
78 | +if (isset($spotter_item['airline_name']) && $spotter_item['airline_name'] != 'Not Available') { |
|
79 | + print '<div class="airline">'.$spotter_item['airline_name'].'</div>'; |
|
80 | +} |
|
75 | 81 | print '</div>'; |
76 | 82 | if ($spotter_item['departure_airport'] != 'NA' && $spotter_item['arrival_airport'] != 'NA') { |
77 | 83 | 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']; |
@@ -103,10 +109,16 @@ discard block |
||
103 | 109 | print '</div>'; |
104 | 110 | print '<div id="aircraft">'; |
105 | 111 | print '<span>'._("Aircraft").'</span>'; |
106 | -if (isset($spotter_item['aircraft_wiki'])) print '<a href="'.$spotter_item['aircraft_wiki'].'">'.$spotter_item['aircraft_name'].'</a>'; |
|
107 | -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') print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')</a>'; |
|
108 | -elseif (isset($spotter_item['aircraft_type'])) print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_type'].'</a>'; |
|
109 | -else print $spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name']; |
|
112 | +if (isset($spotter_item['aircraft_wiki'])) { |
|
113 | + print '<a href="'.$spotter_item['aircraft_wiki'].'">'.$spotter_item['aircraft_name'].'</a>'; |
|
114 | +} |
|
115 | +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') { |
|
116 | + print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')</a>'; |
|
117 | +} elseif (isset($spotter_item['aircraft_type'])) { |
|
118 | + print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_type'].'</a>'; |
|
119 | +} else { |
|
120 | + print $spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name']; |
|
121 | +} |
|
110 | 122 | print '</div>'; |
111 | 123 | print '<div id ="altitude"><span>'._("Altitude").'</span>'; |
112 | 124 | if (isset($globalGroundAltitude) && $globalGroundAltitude) { |
@@ -117,12 +129,18 @@ discard block |
||
117 | 129 | } |
118 | 130 | |
119 | 131 | if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) { |
120 | - if (isset($spotter_item['real_altitude']) && $spotter_item['real_altitude'] != '') print $spotter_item['real_altitude'].' feet (FL'.$spotter_item['altitude'].')'; |
|
121 | - else print $spotter_item['altitude'].'00 feet (FL'.$spotter_item['altitude'].')'; |
|
122 | -} else { |
|
123 | - if (isset($spotter_item['real_altitude']) && $spotter_item['real_altitude'] != '') print round($spotter_item['real_altitude']*0.3048).' m (FL'.$spotter_item['altitude'].')'; |
|
124 | - else print round($spotter_item['altitude']*30.48).' m (FL'.$spotter_item['altitude'].')'; |
|
125 | -} |
|
132 | + if (isset($spotter_item['real_altitude']) && $spotter_item['real_altitude'] != '') { |
|
133 | + print $spotter_item['real_altitude'].' feet (FL'.$spotter_item['altitude'].')'; |
|
134 | + } else { |
|
135 | + print $spotter_item['altitude'].'00 feet (FL'.$spotter_item['altitude'].')'; |
|
136 | + } |
|
137 | + } else { |
|
138 | + if (isset($spotter_item['real_altitude']) && $spotter_item['real_altitude'] != '') { |
|
139 | + print round($spotter_item['real_altitude']*0.3048).' m (FL'.$spotter_item['altitude'].')'; |
|
140 | + } else { |
|
141 | + print round($spotter_item['altitude']*30.48).' m (FL'.$spotter_item['altitude'].')'; |
|
142 | + } |
|
143 | + } |
|
126 | 144 | |
127 | 145 | if (isset($groundAltitude) && $groundAltitude < $spotter_item['altitude']*30.48) { |
128 | 146 | print '<br>'; |
@@ -136,7 +154,9 @@ discard block |
||
136 | 154 | } |
137 | 155 | |
138 | 156 | print '</div>'; |
139 | -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>'; |
|
157 | +if (isset($spotter_item['registration']) && $spotter_item['registration'] != '') { |
|
158 | + print '<div><span>'._("Registration").'</span><a href="'.$globalURL.'/registration/'.$spotter_item['registration'].'" target="_blank">'.$spotter_item['registration'].'</a></div>'; |
|
159 | +} |
|
140 | 160 | print '<div id="speed"><span>'._("Speed").'</span>'; |
141 | 161 | if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'mph') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'mph')) { |
142 | 162 | print round($spotter_item['ground_speed']*1.15078).' mph'; |
@@ -150,8 +170,11 @@ discard block |
||
150 | 170 | print '<div id="heading"><span>'._("Heading").'</span>'.$spotter_item['heading'].'°</div>'; |
151 | 171 | if (isset($spotter_item['pilot_name']) && $spotter_item['pilot_name'] != '') { |
152 | 172 | print '<div id="pilot"><span>'._("Pilot").'</span>'; |
153 | - if (isset($spotter_item['pilot_id'])) print $spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')'; |
|
154 | - else print $spotter_item['pilot_name']; |
|
173 | + if (isset($spotter_item['pilot_id'])) { |
|
174 | + print $spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')'; |
|
175 | + } else { |
|
176 | + print $spotter_item['pilot_name']; |
|
177 | + } |
|
155 | 178 | print '</div>'; |
156 | 179 | } |
157 | 180 | |
@@ -179,10 +202,18 @@ discard block |
||
179 | 202 | print '</div>'; |
180 | 203 | print '</div>'; |
181 | 204 | |
182 | -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>'; |
|
183 | -if (isset($spotter_item['waypoints']) && $spotter_item['waypoints'] != '') print '<div class="waypoints"><span>'._("Route").'</span>'.$spotter_item['waypoints'].'</div>'; |
|
184 | -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>'; |
|
185 | -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>'; |
|
205 | +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') { |
|
206 | + print '<div class="waypoints"><span>'._("Source").'</span>'.$spotter_item['format_source'].'</div>'; |
|
207 | +} |
|
208 | +if (isset($spotter_item['waypoints']) && $spotter_item['waypoints'] != '') { |
|
209 | + print '<div class="waypoints"><span>'._("Route").'</span>'.$spotter_item['waypoints'].'</div>'; |
|
210 | +} |
|
211 | +if (isset($spotter_item['acars']['message'])) { |
|
212 | + 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>'; |
|
213 | +} |
|
214 | +if (isset($spotter_item['squawk']) && $spotter_item['squawk'] != '' && $spotter_item['squawk'] != 0) { |
|
215 | + print '<div class="bottom">'._("Squawk:").' '.$spotter_item['squawk'].' - '.$spotter_item['squawk_usage'].'</div>'; |
|
216 | +} |
|
186 | 217 | print '</div>'; |
187 | 218 | ?> |
188 | 219 | </div> |
189 | 220 | \ No newline at end of file |
@@ -11,14 +11,14 @@ discard block |
||
11 | 11 | |
12 | 12 | $from_archive = false; |
13 | 13 | if (isset($_GET['ident'])) { |
14 | - $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
|
14 | + $ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING); |
|
15 | 15 | if (isset($_GET['currenttime'])) { |
16 | - $currenttime = filter_input(INPUT_GET,'currenttime',FILTER_SANITIZE_NUMBER_INT); |
|
16 | + $currenttime = filter_input(INPUT_GET, 'currenttime', FILTER_SANITIZE_NUMBER_INT); |
|
17 | 17 | $currenttime = round($currenttime/1000); |
18 | - $spotter_array = $SpotterLive->getDateLiveSpotterDataByIdent($ident,$currenttime); |
|
18 | + $spotter_array = $SpotterLive->getDateLiveSpotterDataByIdent($ident, $currenttime); |
|
19 | 19 | if (empty($spotter_array)) { |
20 | 20 | $from_archive = true; |
21 | - $spotter_array = $SpotterArchive->getDateArchiveSpotterDataByIdent($ident,$currenttime); |
|
21 | + $spotter_array = $SpotterArchive->getDateArchiveSpotterDataByIdent($ident, $currenttime); |
|
22 | 22 | } |
23 | 23 | } else { |
24 | 24 | $spotter_array = $SpotterLive->getLastLiveSpotterDataByIdent($ident); |
@@ -29,15 +29,15 @@ discard block |
||
29 | 29 | } |
30 | 30 | } |
31 | 31 | if (isset($_GET['flightaware_id'])) { |
32 | - $flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING); |
|
32 | + $flightaware_id = filter_input(INPUT_GET, 'flightaware_id', FILTER_SANITIZE_STRING); |
|
33 | 33 | if (isset($_GET['currenttime'])) { |
34 | - $currenttime = filter_input(INPUT_GET,'currenttime',FILTER_SANITIZE_NUMBER_INT); |
|
34 | + $currenttime = filter_input(INPUT_GET, 'currenttime', FILTER_SANITIZE_NUMBER_INT); |
|
35 | 35 | $currenttime = round($currenttime/1000); |
36 | - $spotter_array = $SpotterLive->getDateLiveSpotterDataById($flightaware_id,$currenttime); |
|
36 | + $spotter_array = $SpotterLive->getDateLiveSpotterDataById($flightaware_id, $currenttime); |
|
37 | 37 | if (empty($spotter_array)) { |
38 | 38 | $from_archive = true; |
39 | 39 | // $spotter_array = $SpotterArchive->getLastArchiveSpotterDataById($flightaware_id); |
40 | - $spotter_array = $SpotterArchive->getDateArchiveSpotterDataById($flightaware_id,$currenttime); |
|
40 | + $spotter_array = $SpotterArchive->getDateArchiveSpotterDataById($flightaware_id, $currenttime); |
|
41 | 41 | } |
42 | 42 | } else { |
43 | 43 | $spotter_array = $SpotterLive->getLastLiveSpotterDataById($flightaware_id); |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | if (isset($spotter_item['image_thumbnail']) && $spotter_item['image_thumbnail'] != "") |
57 | 57 | { |
58 | 58 | if ($spotter_item['image_source'] == 'flickr' || $spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart') { |
59 | - $image = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
|
59 | + $image = preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']); |
|
60 | 60 | } else $image = $spotter_item['image_thumbnail']; |
61 | 61 | |
62 | 62 | } |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | 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']; |
78 | 78 | if (isset($spotter_item['departure_airport_time']) && $spotter_item['departure_airport_time'] != 'NULL') { |
79 | 79 | if ($spotter_item['departure_airport_time'] > 2460) { |
80 | - print '<br /><span class="time">'.date('H:m',$spotter_item['departure_airport_time']).'</span>'; |
|
80 | + print '<br /><span class="time">'.date('H:m', $spotter_item['departure_airport_time']).'</span>'; |
|
81 | 81 | } else { |
82 | 82 | print '<br /><span class="time">'.$spotter_item['departure_airport_time'].'</span>'; |
83 | 83 | } |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | print '<span class="code"><a href="'.$globalURL.'/airport/'.$spotter_item['arrival_airport'].'" target="_blank">'.$spotter_item['arrival_airport'].'</a></span>'.$spotter_item['arrival_airport_city'].' '.$spotter_item['arrival_airport_country']; |
87 | 87 | if (isset($spotter_item['arrival_airport_time']) && $spotter_item['arrival_airport_time'] != 'NULL') { |
88 | 88 | if ($spotter_item['arrival_airport_time'] > 2460) { |
89 | - print '<br /><span class="time">'.date('H:m',$spotter_item['arrival_airport_time']).'</span>'; |
|
89 | + print '<br /><span class="time">'.date('H:m', $spotter_item['arrival_airport_time']).'</span>'; |
|
90 | 90 | } else { |
91 | 91 | print '<br /><span class="time">'.$spotter_item['arrival_airport_time'].'</span>'; |
92 | 92 | } |
@@ -111,8 +111,8 @@ discard block |
||
111 | 111 | print '<div id ="altitude"><span>'._("Altitude").'</span>'; |
112 | 112 | if (isset($globalGroundAltitude) && $globalGroundAltitude) { |
113 | 113 | try { |
114 | - $groundAltitude = $Elevation->getElevation($spotter_item['latitude'],$spotter_item['longitude']); |
|
115 | - } catch(Exception $e) { |
|
114 | + $groundAltitude = $Elevation->getElevation($spotter_item['latitude'], $spotter_item['longitude']); |
|
115 | + } catch (Exception $e) { |
|
116 | 116 | // If catched not exist |
117 | 117 | } |
118 | 118 | } |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | |
183 | 183 | 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>'; |
184 | 184 | if (isset($spotter_item['waypoints']) && $spotter_item['waypoints'] != '') print '<div class="waypoints"><span>'._("Route").'</span>'.$spotter_item['waypoints'].'</div>'; |
185 | -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>'; |
|
185 | +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>'; |
|
186 | 186 | 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>'; |
187 | 187 | print '</div>'; |
188 | 188 | ?> |
@@ -91,6 +91,10 @@ |
||
91 | 91 | $this->rlatres = (($this->height - 1) / 180.0); |
92 | 92 | } |
93 | 93 | |
94 | + /** |
|
95 | + * @param integer $ix |
|
96 | + * @param integer $iy |
|
97 | + */ |
|
94 | 98 | private function _rawval($ix,$iy) { |
95 | 99 | if (($iy < 0)) { |
96 | 100 | $iy = -$iy; |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | * Translated to PHP of GeographicLib/src/Geoid.cpp |
12 | 12 | * by Ycarus <[email protected]> in 2017 |
13 | 13 | */ |
14 | -class GeoidHeight { |
|
14 | +class GeoidHeight { |
|
15 | 15 | private $c0 = 240; |
16 | 16 | private $c3 = [[9, -18, -88, 0, 96, 90, 0, 0, -60, -20], [-9, 18, 8, 0, -96, 30, 0, 0, 60, -20], [9, -88, -18, 90, 96, 0, -20, -60, 0, 0], [186, -42, -42, -150, -96, -150, 60, 60, 60, 60], [54, 162, -78, 30, -24, -90, -60, 60, -60, 60], [-9, -32, 18, 30, 24, 0, 20, -60, 0, 0], [-9, 8, 18, 30, -96, 0, -20, 60, 0, 0], [54, -78, 162, -90, -24, 30, 60, -60, 60, -60], [-54, 78, 78, 90, 144, 90, -60, -60, -60, -60], [9, -8, -18, -30, -24, 0, 20, 60, 0, 0], [-9, 18, -32, 0, 24, 30, 0, 0, -60, 20], [9, -18, -8, 0, -24, -30, 0, 0, 60, 20]]; |
17 | 17 | private $c0n = 372; |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | private $v10 = null; |
35 | 35 | private $v11 = null; |
36 | 36 | |
37 | - public function __construct($name='') { |
|
37 | + public function __construct($name = '') { |
|
38 | 38 | global $globalGeoidSource; |
39 | 39 | //if ($name == '') $name = dirname(__FILE__).'/../install/tmp/egm2008-1.pgm'; |
40 | 40 | if ($name == '') { |
@@ -42,35 +42,35 @@ discard block |
||
42 | 42 | else $name = dirname(__FILE__).'/../data/egm96-15.pgm'; |
43 | 43 | } |
44 | 44 | |
45 | - $f = @fopen($name,"r"); |
|
45 | + $f = @fopen($name, "r"); |
|
46 | 46 | if ($f === FALSE) { |
47 | 47 | throw new Exception("Can't open ".$name); |
48 | 48 | } |
49 | - $line = fgets($f,4096); |
|
49 | + $line = fgets($f, 4096); |
|
50 | 50 | if (trim($line) != 'P5') { |
51 | 51 | throw new Exception('No PGM header'); |
52 | 52 | } |
53 | 53 | $headerlen = strlen($line); |
54 | 54 | while (true) { |
55 | - $line = fgets($f,4096); |
|
55 | + $line = fgets($f, 4096); |
|
56 | 56 | if ((strlen($line) == 0)) { |
57 | 57 | throw new Exception('EOF before end of file header'); |
58 | 58 | } |
59 | 59 | $headerlen += strlen($line); |
60 | - if (strpos($line,'# Offset ') !== FALSE) { |
|
60 | + if (strpos($line, '# Offset ') !== FALSE) { |
|
61 | 61 | $this->offset = substr($line, 9); |
62 | - } else if (strpos($line,'# Scale ') !== FALSE) { |
|
62 | + } else if (strpos($line, '# Scale ') !== FALSE) { |
|
63 | 63 | $this->scale = substr($line, 8); |
64 | - } else if ((strpos($line,'#') === FALSE)) { |
|
65 | - list($this->width, $this->height) = preg_split('/\s+/',$line); |
|
64 | + } else if ((strpos($line, '#') === FALSE)) { |
|
65 | + list($this->width, $this->height) = preg_split('/\s+/', $line); |
|
66 | 66 | break; |
67 | 67 | } |
68 | 68 | } |
69 | - $line = fgets($f,4096); |
|
69 | + $line = fgets($f, 4096); |
|
70 | 70 | $headerlen += strlen($line); |
71 | - $levels = (int)$line; |
|
72 | - $this->width = (int)$this->width; |
|
73 | - $this->height = (int)$this->height; |
|
71 | + $levels = (int) $line; |
|
72 | + $this->width = (int) $this->width; |
|
73 | + $this->height = (int) $this->height; |
|
74 | 74 | if (($levels != 65535)) { |
75 | 75 | throw new Exception('PGM file must have 65535 gray levels ('.$levels.')'); |
76 | 76 | } |
@@ -85,42 +85,42 @@ discard block |
||
85 | 85 | } |
86 | 86 | |
87 | 87 | $fullsize = filesize($name); |
88 | - if ((($fullsize - $headerlen) != (($this->width * $this->height) * 2))) { |
|
88 | + if ((($fullsize - $headerlen) != (($this->width*$this->height)*2))) { |
|
89 | 89 | throw new Exception('File has the wrong length'); |
90 | 90 | } |
91 | 91 | |
92 | 92 | $this->headerlen = $headerlen; |
93 | - $this->raw= $f; |
|
94 | - $this->rlonres = ($this->width / 360.0); |
|
95 | - $this->rlatres = (($this->height - 1) / 180.0); |
|
93 | + $this->raw = $f; |
|
94 | + $this->rlonres = ($this->width/360.0); |
|
95 | + $this->rlatres = (($this->height - 1)/180.0); |
|
96 | 96 | } |
97 | 97 | |
98 | - private function _rawval($ix,$iy) { |
|
98 | + private function _rawval($ix, $iy) { |
|
99 | 99 | if (($iy < 0)) { |
100 | 100 | $iy = -$iy; |
101 | - $ix += ($this->width / 2); |
|
101 | + $ix += ($this->width/2); |
|
102 | 102 | } else if (($iy >= $this->height)) { |
103 | - $iy = ((2 * ($this->height - 1)) - $iy); |
|
104 | - $ix += ($this->width / 2); |
|
103 | + $iy = ((2*($this->height - 1)) - $iy); |
|
104 | + $ix += ($this->width/2); |
|
105 | 105 | } |
106 | 106 | if (($ix < 0)) { |
107 | 107 | $ix += $this->width; |
108 | 108 | } else if (($ix >= $this->width)) { |
109 | 109 | $ix -= $this->width; |
110 | 110 | } |
111 | - $k = ((($iy * $this->width) + $ix) * 2) + $this->headerlen; |
|
112 | - fseek($this->raw,$k); |
|
113 | - return unpack('n',fread($this->raw,2))[1]; |
|
111 | + $k = ((($iy*$this->width) + $ix)*2) + $this->headerlen; |
|
112 | + fseek($this->raw, $k); |
|
113 | + return unpack('n', fread($this->raw, 2))[1]; |
|
114 | 114 | } |
115 | 115 | |
116 | - public function get($lat,$lon,$cubic=true) { |
|
116 | + public function get($lat, $lon, $cubic = true) { |
|
117 | 117 | if (($lon < 0)) { |
118 | 118 | $lon += 360; |
119 | 119 | } |
120 | - $fy = ((90 - $lat) * $this->rlatres); |
|
121 | - $fx = ($lon * $this->rlonres); |
|
122 | - $iy = (int)$fy; |
|
123 | - $ix = (int)$fx; |
|
120 | + $fy = ((90 - $lat)*$this->rlatres); |
|
121 | + $fx = ($lon*$this->rlonres); |
|
122 | + $iy = (int) $fy; |
|
123 | + $ix = (int) $fx; |
|
124 | 124 | $fx -= $ix; |
125 | 125 | $fy -= $iy; |
126 | 126 | $t = array(); |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | $c3x = $this->c3; |
148 | 148 | $c0x = $this->c0; |
149 | 149 | } |
150 | - for ($i = 0; $i < 10;++$i) { |
|
150 | + for ($i = 0; $i < 10; ++$i) { |
|
151 | 151 | $t[$i] = 0; |
152 | 152 | for ($j = 0; $j < 12; ++$j) { |
153 | 153 | $t[$i] += $v[$j]*$c3x[$j][$i]; |
@@ -158,13 +158,13 @@ discard block |
||
158 | 158 | $this->t = $t; |
159 | 159 | } else $t = $this->t; |
160 | 160 | if (!($cubic)) { |
161 | - $a = (((1 - $fx) * $this->v00) + ($fx * $this->v01)); |
|
162 | - $b = (((1 - $fx) * $this->v10) + ($fx * $this->v11)); |
|
163 | - $h = (((1 - $fy) * $a) + ($fy * $b)); |
|
161 | + $a = (((1 - $fx)*$this->v00) + ($fx*$this->v01)); |
|
162 | + $b = (((1 - $fx)*$this->v10) + ($fx*$this->v11)); |
|
163 | + $h = (((1 - $fy)*$a) + ($fy*$b)); |
|
164 | 164 | } else { |
165 | - $h = (($t[0] + ($fx * ($t[1] + ($fx * ($t[3] + ($fx * $t[6])))))) + ($fy * (($t[2] + ($fx * ($t[4] + ($fx * $t[7])))) + ($fy * (($t[5] + ($fx * $t[8])) + ($fy * $t[9])))))); |
|
165 | + $h = (($t[0] + ($fx*($t[1] + ($fx*($t[3] + ($fx*$t[6])))))) + ($fy*(($t[2] + ($fx*($t[4] + ($fx*$t[7])))) + ($fy*(($t[5] + ($fx*$t[8])) + ($fy*$t[9])))))); |
|
166 | 166 | } |
167 | - return ((float)$this->offset + ((float)$this->scale * (float)$h)); |
|
167 | + return ((float) $this->offset + ((float) $this->scale*(float) $h)); |
|
168 | 168 | } |
169 | 169 | } |
170 | 170 | /* |
@@ -38,8 +38,11 @@ discard block |
||
38 | 38 | global $globalGeoidSource; |
39 | 39 | //if ($name == '') $name = dirname(__FILE__).'/../install/tmp/egm2008-1.pgm'; |
40 | 40 | if ($name == '') { |
41 | - if (isset($globalGeoidSource) && $globalGeoidSource != '') $name = dirname(__FILE__).'/../data/'.$globalGeoidSource.'.pgm'; |
|
42 | - else $name = dirname(__FILE__).'/../data/egm96-15.pgm'; |
|
41 | + if (isset($globalGeoidSource) && $globalGeoidSource != '') { |
|
42 | + $name = dirname(__FILE__).'/../data/'.$globalGeoidSource.'.pgm'; |
|
43 | + } else { |
|
44 | + $name = dirname(__FILE__).'/../data/egm96-15.pgm'; |
|
45 | + } |
|
43 | 46 | } |
44 | 47 | |
45 | 48 | $f = @fopen($name,"r"); |
@@ -156,7 +159,9 @@ discard block |
||
156 | 159 | } |
157 | 160 | } |
158 | 161 | $this->t = $t; |
159 | - } else $t = $this->t; |
|
162 | + } else { |
|
163 | + $t = $this->t; |
|
164 | + } |
|
160 | 165 | if (!($cubic)) { |
161 | 166 | $a = (((1 - $fx) * $this->v00) + ($fx * $this->v01)); |
162 | 167 | $b = (((1 - $fx) * $this->v10) + ($fx * $this->v11)); |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | $globalLongitudeMin = '1.0'; //the minimum longitude (east) |
43 | 43 | |
44 | 44 | $globalCenterLatitude = '46.38'; //the latitude center of your coverage area |
45 | -$globalCenterLongitude = '5.29';//the longitude center of your coverage area |
|
45 | +$globalCenterLongitude = '5.29'; //the longitude center of your coverage area |
|
46 | 46 | |
47 | 47 | $globalLiveZoom = '9'; //default zoom on Live Map |
48 | 48 | $globalAirportZoom = '7'; //default zoom to begin to display airports icons |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | $globalACARS = FALSE; |
152 | 152 | $globalACARSHost = '0.0.0.0'; // Local IP to listen |
153 | 153 | $globalACARSPort = '9999'; |
154 | -$globalACARSArchive = array('10','80','81','82','3F'); // labels of messages to archive |
|
154 | +$globalACARSArchive = array('10', '80', '81', '82', '3F'); // labels of messages to archive |
|
155 | 155 | $globalACARSArchiveKeepMonths = '0'; |
156 | 156 | |
157 | 157 | //APRS configuration (for glidernet) |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | //Check by aircraft ICAO if image is not found by registration |
249 | 249 | $globalAircraftImageCheckICAO = TRUE; |
250 | 250 | //Sources for Aircraft image |
251 | -$globalAircraftImageSources = array('ivaomtl','wikimedia','airportdata','deviantart','flickr','bing','jetphotos','planepictures','planespotters','customsources'); |
|
251 | +$globalAircraftImageSources = array('ivaomtl', 'wikimedia', 'airportdata', 'deviantart', 'flickr', 'bing', 'jetphotos', 'planepictures', 'planespotters', 'customsources'); |
|
252 | 252 | // Custom source configuration {registration} will be replaced by aircraft registration (exif get copyright from exif data for each pic) |
253 | 253 | // example of config : $globalAircraftImageCustomSources = array('thumbnail' => 'http://pics.myurl.com/thumbnail/{registration}.jpg','original' => 'http://myurl/original/{registration}.jpg','source_website' => 'https://www.myurl.com', 'source' => 'customsite', 'copyright' => 'myself','exif' => true); |
254 | 254 | // ************************ |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | //Retrieve Image from externals sources |
258 | 258 | $globalMarineImageFetch = TRUE; |
259 | 259 | //Sources for Marine image |
260 | -$globalMarineImageSources = array('wikimedia','flickr','deviantart','bing','customsources'); |
|
260 | +$globalMarineImageSources = array('wikimedia', 'flickr', 'deviantart', 'bing', 'customsources'); |
|
261 | 261 | // Custom source configuration {mmsi} will be replaced by vessel mmsi, {name} by it's name (exif get copyright from exif data for each pic) |
262 | 262 | // example of config : $globalMarineImageCustomSources = array('thumbnail' => 'http://pics.myurl.com/thumbnail/{name}.jpg','original' => 'http://myurl/original/{name}.jpg','source_website' => 'https://www.myurl.com', 'source' => 'customsite', 'copyright' => 'myself','exif' => true); |
263 | 263 | // ************************ |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | //Retrieve schedules from externals sources (set to FALSE for IVAO or if $globalFork = FALSE) |
266 | 266 | $globalSchedulesFetch = TRUE; |
267 | 267 | //Sources for airline schedule if not official airline site |
268 | -$globalSchedulesSources = array('flightmapper','costtotravel','flightradar24','flightaware'); |
|
268 | +$globalSchedulesSources = array('flightmapper', 'costtotravel', 'flightradar24', 'flightaware'); |
|
269 | 269 | |
270 | 270 | //Retrieve translation from external sources (set to FALSE for IVAO) |
271 | 271 | $globalTranslationFetch = TRUE; |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | require_once('require/class.Satellite.php'); |
6 | 6 | |
7 | -$trackident = filter_input(INPUT_GET,'trackid',FILTER_SANITIZE_STRING); |
|
7 | +$trackident = filter_input(INPUT_GET, 'trackid', FILTER_SANITIZE_STRING); |
|
8 | 8 | if ($trackident != '') { |
9 | 9 | require_once('require/class.SpotterLive.php'); |
10 | 10 | $SpotterLive = new SpotterLive(); |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | $spotterid = $Spotter->getSpotterIDBasedOnFlightAwareID($trackident); |
15 | 15 | header('Location: '.$globalURL.'/flightid/'.$spotterid); |
16 | 16 | } else { |
17 | - setcookie('MapTrack',$resulttrackident[0]['flightaware_id']); |
|
17 | + setcookie('MapTrack', $resulttrackident[0]['flightaware_id']); |
|
18 | 18 | } |
19 | 19 | } else { |
20 | 20 | unset($_COOKIE['MapTrack']); |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | <div class="form-group"> |
190 | 190 | <label>From (UTC):</label> |
191 | 191 | <div class='input-group date' id='datetimepicker1'> |
192 | - <input type='text' name="start_date" class="form-control" value="<?php if (isset($_POST['start_date'])) print $_POST['start_date']; elseif (isset($_COOKIE['archive_begin'])) print date("m/d/Y h:i a",$_COOKIE['archive_begin']); ?>" required /> |
|
192 | + <input type='text' name="start_date" class="form-control" value="<?php if (isset($_POST['start_date'])) print $_POST['start_date']; elseif (isset($_COOKIE['archive_begin'])) print date("m/d/Y h:i a", $_COOKIE['archive_begin']); ?>" required /> |
|
193 | 193 | <span class="input-group-addon"> |
194 | 194 | <span class="glyphicon glyphicon-calendar"></span> |
195 | 195 | </span> |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | <div class="form-group"> |
199 | 199 | <label>To (UTC):</label> |
200 | 200 | <div class='input-group date' id='datetimepicker2'> |
201 | - <input type='text' name="end_date" class="form-control" value="<?php if (isset($_POST['end_date'])) print $_POST['end_date']; elseif (isset($_COOKIE['archive_end'])) print date("m/d/Y h:i a",$_COOKIE['archive_end']); ?>" /> |
|
201 | + <input type='text' name="end_date" class="form-control" value="<?php if (isset($_POST['end_date'])) print $_POST['end_date']; elseif (isset($_COOKIE['archive_end'])) print date("m/d/Y h:i a", $_COOKIE['archive_end']); ?>" /> |
|
202 | 202 | <span class="input-group-addon"> |
203 | 203 | <span class="glyphicon glyphicon-calendar"></span> |
204 | 204 | </span> |
@@ -323,9 +323,9 @@ discard block |
||
323 | 323 | <li><?php echo _("Type of Terrain:"); ?> |
324 | 324 | <select class="selectpicker" onchange="terrainType(this);"> |
325 | 325 | <option value="stk"<?php if (!isset($_COOKIE['MapTerrain']) || $_COOKIE['MapTerrain'] == 'stk') print ' selected'; ?>>stk terrain</option> |
326 | - <option value="ellipsoid"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'ellipsoid') print ' selected';?>>ellipsoid</option> |
|
327 | - <option value="vrterrain"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'vrterrain') print ' selected';?>>vr terrain</option> |
|
328 | - <option value="articdem"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'articdem') print ' selected';?>>ArticDEM</option> |
|
326 | + <option value="ellipsoid"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'ellipsoid') print ' selected'; ?>>ellipsoid</option> |
|
327 | + <option value="vrterrain"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'vrterrain') print ' selected'; ?>>vr terrain</option> |
|
328 | + <option value="articdem"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'articdem') print ' selected'; ?>>ArticDEM</option> |
|
329 | 329 | </select> |
330 | 330 | </li> |
331 | 331 | <?php |
@@ -351,7 +351,7 @@ discard block |
||
351 | 351 | <li><div class="checkbox"><label><input type="checkbox" name="displayminimap" value="1" onclick="clickDisplayMinimap(this)" <?php if (!isset($_COOKIE['displayminimap']) || (isset($_COOKIE['displayminimap']) && $_COOKIE['displayminimap'] == 'true')) print 'checked'; ?> ><?php echo _("Show mini-map"); ?></label></div></li> |
352 | 352 | <?php |
353 | 353 | } |
354 | - if (time() > mktime(0,0,0,12,1,date("Y")) && time() < mktime(0,0,0,12,31,date("Y"))) { |
|
354 | + if (time() > mktime(0, 0, 0, 12, 1, date("Y")) && time() < mktime(0, 0, 0, 12, 31, date("Y"))) { |
|
355 | 355 | ?> |
356 | 356 | <li><div class="checkbox"><label><input type="checkbox" name="displaysanta" value="1" onclick="clickSanta(this)"><i class="fa fa-snowflake-o" aria-hidden="true"></i> <?php echo _("Show Santa Claus now"); ?> <i class="fa fa-snowflake-o" aria-hidden="true"></i></label></div></li> |
357 | 357 | <?php |
@@ -507,10 +507,10 @@ discard block |
||
507 | 507 | $Spotter = new Spotter(); |
508 | 508 | $allairlinenames = $Spotter->getAllAirlineNames(); |
509 | 509 | } |
510 | - foreach($allairlinenames as $airline) { |
|
510 | + foreach ($allairlinenames as $airline) { |
|
511 | 511 | $airline_name = $airline['airline_name']; |
512 | - if (strlen($airline_name) > 30) $airline_name = substr($airline_name,0,30).'...'; |
|
513 | - if (isset($_COOKIE['filter_Airlines']) && in_array($airline['airline_icao'],explode(',',$_COOKIE['filter_Airlines']))) { |
|
512 | + if (strlen($airline_name) > 30) $airline_name = substr($airline_name, 0, 30).'...'; |
|
513 | + if (isset($_COOKIE['filter_Airlines']) && in_array($airline['airline_icao'], explode(',', $_COOKIE['filter_Airlines']))) { |
|
514 | 514 | echo '<option value="'.$airline['airline_icao'].'" selected>'.$airline_name.'</option>'; |
515 | 515 | } else { |
516 | 516 | echo '<option value="'.$airline['airline_icao'].'">'.$airline_name.'</option>'; |
@@ -529,7 +529,7 @@ discard block |
||
529 | 529 | <select class="selectpicker" onchange="alliance(this);" id="display_alliance"> |
530 | 530 | <option value="all"<?php if (!isset($_COOKIE['filter_alliance']) || $_COOKIE['filter_alliance'] == 'all' || $_COOKIE['filter_alliance'] == '') echo ' selected'; ?>><?php echo _("All"); ?></option> |
531 | 531 | <?php |
532 | - foreach($allalliancenames as $alliance) { |
|
532 | + foreach ($allalliancenames as $alliance) { |
|
533 | 533 | $alliance_name = $alliance['alliance']; |
534 | 534 | if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] == $alliance_name) { |
535 | 535 | echo '<option value="'.$alliance_name.'" selected>'.$alliance_name.'</option>'; |
@@ -553,8 +553,8 @@ discard block |
||
553 | 553 | <select class="selectpicker" multiple onchange="sources(this);"> |
554 | 554 | <?php |
555 | 555 | $Spotter = new Spotter(); |
556 | - foreach($Spotter->getAllSourceName('aprs') as $source) { |
|
557 | - if (isset($_COOKIE['filter_Sources']) && in_array($source['source_name'],explode(',',$_COOKIE['filter_Sources']))) { |
|
556 | + foreach ($Spotter->getAllSourceName('aprs') as $source) { |
|
557 | + if (isset($_COOKIE['filter_Sources']) && in_array($source['source_name'], explode(',', $_COOKIE['filter_Sources']))) { |
|
558 | 558 | echo '<option value="'.$source['source_name'].'" selected>'.$source['source_name'].'</option>'; |
559 | 559 | } else { |
560 | 560 | echo '<option value="'.$source['source_name'].'">'.$source['source_name'].'</option>'; |
@@ -632,7 +632,7 @@ discard block |
||
632 | 632 | else if ($type_name == 'radar') $type_name = 'Radar Calibration'; |
633 | 633 | else if ($type_name == 'tle-new') $type_name = 'Last 30 days launches'; |
634 | 634 | |
635 | - if (isset($_COOKIE['sattypes']) && in_array($type['tle_type'],explode(',',$_COOKIE['sattypes']))) { |
|
635 | + if (isset($_COOKIE['sattypes']) && in_array($type['tle_type'], explode(',', $_COOKIE['sattypes']))) { |
|
636 | 636 | print '<option value="'.$type['tle_type'].'" selected>'.$type_name.'</option>'; |
637 | 637 | } else { |
638 | 638 | print '<option value="'.$type['tle_type'].'">'.$type_name.'</option>'; |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | <?php }; if (isset($globalSatellite) && $globalSatellite) { ?><td><div id="ibxsatellite"><h4><?php echo _("Satellites Displayed"); ?></h4><br /><i class="fa fa-spinner fa-pulse fa-fw"></i></div></td><?php } ?> |
47 | 47 | </tr></table></div> |
48 | 48 | <?php |
49 | - if ((!isset($_COOKIE['MapFormat']) && isset($globalMap3Ddefault) && $globalMap3Ddefault) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d')) { |
|
49 | + if ((!isset($_COOKIE['MapFormat']) && isset($globalMap3Ddefault) && $globalMap3Ddefault) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d')) { |
|
50 | 50 | ?> |
51 | 51 | <script src="<?php echo $globalURL; ?>/js/map.3d.js.php"></script> |
52 | 52 | <?php |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | <script src="<?php echo $globalURL; ?>/js/map-marine.3d.js.php"></script> |
71 | 71 | <?php |
72 | 72 | } |
73 | - } |
|
73 | + } |
|
74 | 74 | ?> |
75 | 75 | |
76 | 76 | <div id="sidebar" class="sidebar collapsed"> |
@@ -81,34 +81,34 @@ discard block |
||
81 | 81 | <li><a href="#" onclick="getUserLocation(); return false;" title="<?php echo _("Plot your Location"); ?>"><i class="fa fa-map-marker"></i></a></li> |
82 | 82 | <li><a href="#" onclick="getCompassDirection(); return false;" title="<?php echo _("Compass Mode"); ?>"><i class="fa fa-compass"></i></a></li> |
83 | 83 | <?php |
84 | - if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') { |
|
84 | + if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') { |
|
85 | 85 | if (isset($globalArchive) && $globalArchive == TRUE) { |
86 | 86 | ?> |
87 | 87 | <li><a href="#archive" role="tab" title="<?php echo _("Archive"); ?>"><i class="fa fa-archive"></i></a></li> |
88 | 88 | <?php |
89 | 89 | } |
90 | - } |
|
90 | + } |
|
91 | 91 | ?> |
92 | 92 | <li><a href="#home" role="tab" title="<?php echo _("Layers"); ?>"><i class="fa fa-map"></i></a></li> |
93 | 93 | <li><a href="#filters" role="tab" title="<?php echo _("Filters"); ?>"><i class="fa fa-filter"></i></a></li> |
94 | 94 | <li><a href="#settings" role="tab" title="<?php echo _("Settings"); ?>"><i class="fa fa-gears"></i></a></li> |
95 | 95 | <?php |
96 | - if (isset($globalMap3D) && $globalMap3D) { |
|
96 | + if (isset($globalMap3D) && $globalMap3D) { |
|
97 | 97 | if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) { |
98 | 98 | ?> |
99 | 99 | <li><a href="#" onclick="show3D(); return false;" role="tab" title="3D"><b>3D</b></a></li> |
100 | 100 | <?php |
101 | - if (isset($globalSatellite) && $globalSatellite) { |
|
101 | + if (isset($globalSatellite) && $globalSatellite) { |
|
102 | 102 | ?> |
103 | 103 | <li><a href="#satellites" role="tab" title="<?php echo _("Satellites"); ?>"><i class="satellite"></i></a></li> |
104 | 104 | <?php |
105 | - } |
|
105 | + } |
|
106 | 106 | } else { |
107 | 107 | ?> |
108 | 108 | <li><a href="#" onclick="show2D(); return false;" role="tab" title="2D"><b>2D</b></a></li> |
109 | 109 | <?php |
110 | 110 | } |
111 | - } |
|
111 | + } |
|
112 | 112 | ?> |
113 | 113 | </ul> |
114 | 114 | |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | ?> |
184 | 184 | </div> |
185 | 185 | <?php |
186 | - if (isset($globalArchive) && $globalArchive == TRUE) { |
|
186 | + if (isset($globalArchive) && $globalArchive == TRUE) { |
|
187 | 187 | ?> |
188 | 188 | <div class="sidebar-pane" id="archive"> |
189 | 189 | <h1 class="sidebar-header"><?php echo _("Playback"); ?> <i>Bêta</i><span class="sidebar-close"><i class="fa fa-caret-left"></i></span></h1> |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | </form> |
244 | 244 | </div> |
245 | 245 | <?php |
246 | - } |
|
246 | + } |
|
247 | 247 | ?> |
248 | 248 | <div class="sidebar-pane" id="settings"> |
249 | 249 | <h1 class="sidebar-header"><?php echo _("Settings"); ?><span class="sidebar-close"><i class="fa fa-caret-left"></i></span></h1> |
@@ -254,56 +254,56 @@ discard block |
||
254 | 254 | <?php |
255 | 255 | if (!isset($_COOKIE['MapType']) || $_COOKIE['MapType'] == '') $MapType = $globalMapProvider; |
256 | 256 | else $MapType = $_COOKIE['MapType']; |
257 | - ?> |
|
257 | + ?> |
|
258 | 258 | <?php |
259 | 259 | if (isset($globalBingMapKey) && $globalBingMapKey != '') { |
260 | - ?> |
|
260 | + ?> |
|
261 | 261 | <option value="Bing-Aerial"<?php if ($MapType == 'Bing-Aerial') print ' selected'; ?>>Bing-Aerial</option> |
262 | 262 | <option value="Bing-Hybrid"<?php if ($MapType == 'Bing-Hybrid') print ' selected'; ?>>Bing-Hybrid</option> |
263 | 263 | <option value="Bing-Road"<?php if ($MapType == 'Bing-Road') print ' selected'; ?>>Bing-Road</option> |
264 | 264 | <?php |
265 | 265 | } |
266 | - ?> |
|
266 | + ?> |
|
267 | 267 | <?php |
268 | - if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) { |
|
269 | - ?> |
|
268 | + if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) { |
|
269 | + ?> |
|
270 | 270 | <?php |
271 | - if (isset($globalHereappId) && $globalHereappId != '' && isset($globalHereappCode) && $globalHereappCode != '') { |
|
272 | - ?> |
|
271 | + if (isset($globalHereappId) && $globalHereappId != '' && isset($globalHereappCode) && $globalHereappCode != '') { |
|
272 | + ?> |
|
273 | 273 | <option value="Here-Aerial"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Aerial</option> |
274 | 274 | <option value="Here-Hybrid"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Hybrid</option> |
275 | 275 | <option value="Here-Road"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Road</option> |
276 | 276 | <?php |
277 | - } |
|
278 | - ?> |
|
277 | + } |
|
278 | + ?> |
|
279 | 279 | <?php |
280 | - if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '') { |
|
281 | - ?> |
|
280 | + if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '') { |
|
281 | + ?> |
|
282 | 282 | <option value="Google-Roadmap"<?php if ($MapType == 'Google-Roadmap') print ' selected'; ?>>Google Roadmap</option> |
283 | 283 | <option value="Google-Satellite"<?php if ($MapType == 'Google-Satellite') print ' selected'; ?>>Google Satellite</option> |
284 | 284 | <option value="Google-Hybrid"<?php if ($MapType == 'Google-Hybrid') print ' selected'; ?>>Google Hybrid</option> |
285 | 285 | <option value="Google-Terrain"<?php if ($MapType == 'Google-Terrain') print ' selected'; ?>>Google Terrain</option> |
286 | 286 | <?php |
287 | - } |
|
288 | - ?> |
|
287 | + } |
|
288 | + ?> |
|
289 | 289 | <?php |
290 | - if (isset($globalMapQuestKey) && $globalMapQuestKey != '') { |
|
291 | - ?> |
|
290 | + if (isset($globalMapQuestKey) && $globalMapQuestKey != '') { |
|
291 | + ?> |
|
292 | 292 | <option value="MapQuest-OSM"<?php if ($MapType == 'MapQuest-OSM') print ' selected'; ?>>MapQuest-OSM</option> |
293 | 293 | <option value="MapQuest-Aerial"<?php if ($MapType == 'MapQuest-Aerial') print ' selected'; ?>>MapQuest-Aerial</option> |
294 | 294 | <option value="MapQuest-Hybrid"<?php if ($MapType == 'MapQuest-Hybrid') print ' selected'; ?>>MapQuest-Hybrid</option> |
295 | 295 | <?php |
296 | - } |
|
297 | - ?> |
|
296 | + } |
|
297 | + ?> |
|
298 | 298 | <option value="Yandex"<?php if ($MapType == 'Yandex') print ' selected'; ?>>Yandex</option> |
299 | 299 | <?php |
300 | 300 | } |
301 | - ?> |
|
301 | + ?> |
|
302 | 302 | <?php |
303 | - if (isset($globalMapboxToken) && $globalMapboxToken != '') { |
|
303 | + if (isset($globalMapboxToken) && $globalMapboxToken != '') { |
|
304 | 304 | if (!isset($_COOKIE['MapTypeId'])) $MapBoxId = 'default'; |
305 | 305 | else $MapBoxId = $_COOKIE['MapTypeId']; |
306 | - ?> |
|
306 | + ?> |
|
307 | 307 | <option value="Mapbox-default"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'default') print ' selected'; ?>>Mapbox default</option> |
308 | 308 | <option value="Mapbox-mapbox.streets"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets') print ' selected'; ?>>Mapbox streets</option> |
309 | 309 | <option value="Mapbox-mapbox.light"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.light') print ' selected'; ?>>Mapbox light</option> |
@@ -317,13 +317,13 @@ discard block |
||
317 | 317 | <option value="Mapbox-mapbox.pirates"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pirates') print ' selected'; ?>>Mapbox pirates</option> |
318 | 318 | <option value="Mapbox-mapbox.emerald"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.emerald') print ' selected'; ?>>Mapbox emerald</option> |
319 | 319 | <?php |
320 | - } |
|
321 | - ?> |
|
320 | + } |
|
321 | + ?> |
|
322 | 322 | <option value="OpenStreetMap"<?php if ($MapType == 'OpenStreetMap') print ' selected'; ?>>OpenStreetMap</option> |
323 | 323 | </select> |
324 | 324 | </li> |
325 | 325 | <?php |
326 | - if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') { |
|
326 | + if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') { |
|
327 | 327 | ?> |
328 | 328 | <li><?php echo _("Type of Terrain:"); ?> |
329 | 329 | <select class="selectpicker" onchange="terrainType(this);"> |
@@ -334,10 +334,10 @@ discard block |
||
334 | 334 | </select> |
335 | 335 | </li> |
336 | 336 | <?php |
337 | - } |
|
337 | + } |
|
338 | 338 | ?> |
339 | 339 | <?php |
340 | - if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') { |
|
340 | + if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') { |
|
341 | 341 | ?> |
342 | 342 | <?php |
343 | 343 | if (!isset($globalAircraft) || $globalAircraft === TRUE) { |
@@ -354,89 +354,89 @@ discard block |
||
354 | 354 | <li><div class="checkbox"><label><input type="checkbox" name="satelliteestimation" value="1" onclick="clickSatelliteEstimation(this)" <?php if ((isset($_COOKIE['satelliteestimation']) && $_COOKIE['satelliteestimation'] == 'true') || (!isset($_COOKIE['satelliteestimation']) && !isset($globalMapEstimation)) || (!isset($_COOKIE['satelliteestimation']) && isset($globalMapEstimation) && $globalMapEstimation)) print 'checked'; ?> ><?php echo _("Satellites animate between updates"); ?></label></div></li> |
355 | 355 | <?php |
356 | 356 | } |
357 | - } |
|
357 | + } |
|
358 | 358 | ?> |
359 | 359 | <li><div class="checkbox"><label><input type="checkbox" name="displayairports" value="1" onclick="clickDisplayAirports(this)" <?php if (isset($_COOKIE['displayairports']) && $_COOKIE['displayairports'] == 'true' || !isset($_COOKIE['displayairports'])) print 'checked'; ?> ><?php echo _("Display airports on map"); ?></label></div></li> |
360 | 360 | <li><div class="checkbox"><label><input type="checkbox" name="displaygroundstation" value="1" onclick="clickDisplayGroundStation(this)" <?php if ((isset($_COOKIE['show_GroundStation']) && $_COOKIE['show_GroundStation'] == 'true') || (!isset($_COOKIE['show_GroundStation']) && (!isset($globalMapGroundStation) || $globalMapGroundStation === TRUE))) print 'checked'; ?> ><?php echo _("Display ground station on map"); ?></label></div></li> |
361 | 361 | <li><div class="checkbox"><label><input type="checkbox" name="displayweatherstation" value="1" onclick="clickDisplayWeatherStation(this)" <?php if ((isset($_COOKIE['show_WeatherStation']) && $_COOKIE['show_WeatherStation'] == 'true') || (!isset($_COOKIE['show_WeatherStation']) && (!isset($globalMapWeatherStation) || $globalMapWeatherStation === TRUE))) print 'checked'; ?> ><?php echo _("Display weather station on map"); ?></label></div></li> |
362 | 362 | <li><div class="checkbox"><label><input type="checkbox" name="displaylightning" value="1" onclick="clickDisplayLightning(this)" <?php if ((isset($_COOKIE['show_Lightning']) && $_COOKIE['show_Lightning'] == 'true') || (!isset($_COOKIE['show_Lightning']) && (!isset($globalMapLightning) || $globalMapLightning === TRUE))) print 'checked'; ?> ><?php echo _("Display lightning on map"); ?></label></div></li> |
363 | 363 | <?php |
364 | - if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') { |
|
364 | + if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') { |
|
365 | 365 | ?> |
366 | 366 | <li><div class="checkbox"><label><input type="checkbox" name="displayminimap" value="1" onclick="clickDisplayMinimap(this)" <?php if (!isset($_COOKIE['displayminimap']) || (isset($_COOKIE['displayminimap']) && $_COOKIE['displayminimap'] == 'true')) print 'checked'; ?> ><?php echo _("Show mini-map"); ?></label></div></li> |
367 | 367 | <?php |
368 | - } |
|
369 | - if (time() > mktime(0,0,0,12,1,date("Y")) && time() < mktime(0,0,0,12,31,date("Y"))) { |
|
368 | + } |
|
369 | + if (time() > mktime(0,0,0,12,1,date("Y")) && time() < mktime(0,0,0,12,31,date("Y"))) { |
|
370 | 370 | ?> |
371 | 371 | <li><div class="checkbox"><label><input type="checkbox" name="displaysanta" value="1" onclick="clickSanta(this)"><i class="fa fa-snowflake-o" aria-hidden="true"></i> <?php echo _("Show Santa Claus now"); ?> <i class="fa fa-snowflake-o" aria-hidden="true"></i></label></div></li> |
372 | 372 | <?php |
373 | - } |
|
373 | + } |
|
374 | 374 | ?> |
375 | 375 | |
376 | 376 | <?php |
377 | 377 | if (function_exists('array_column')) { |
378 | - if (array_search(TRUE, array_column($globalSources, 'sourcestats')) !== FALSE) { |
|
379 | - ?> |
|
378 | + if (array_search(TRUE, array_column($globalSources, 'sourcestats')) !== FALSE) { |
|
379 | + ?> |
|
380 | 380 | <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) print 'checked'; ?> ><?php echo _("Display polar on map"); ?></label></div></li> |
381 | 381 | <?php |
382 | - } |
|
382 | + } |
|
383 | 383 | } elseif (isset($globalSources)) { |
384 | - $dispolar = false; |
|
385 | - foreach ($globalSources as $testsource) { |
|
386 | - if (isset($globalSources['sourcestats']) && $globalSources['sourcestats'] !== FALSE) $dispolar = true; |
|
387 | - } |
|
388 | - if ($dispolar) { |
|
389 | - ?> |
|
384 | + $dispolar = false; |
|
385 | + foreach ($globalSources as $testsource) { |
|
386 | + if (isset($globalSources['sourcestats']) && $globalSources['sourcestats'] !== FALSE) $dispolar = true; |
|
387 | + } |
|
388 | + if ($dispolar) { |
|
389 | + ?> |
|
390 | 390 | <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) print 'checked'; ?> ><?php echo _("Display polar on map"); ?></label></div></li> |
391 | 391 | <?php |
392 | - } |
|
393 | - } |
|
394 | - ?> |
|
392 | + } |
|
393 | + } |
|
394 | + ?> |
|
395 | 395 | <?php |
396 | - if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') { |
|
396 | + if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') { |
|
397 | 397 | ?> |
398 | 398 | |
399 | 399 | <?php |
400 | 400 | if (!isset($globalAircraft) || $globalAircraft === TRUE) { |
401 | - if (extension_loaded('gd') && function_exists('gd_info')) { |
|
402 | - ?> |
|
401 | + if (extension_loaded('gd') && function_exists('gd_info')) { |
|
402 | + ?> |
|
403 | 403 | <li><input type="checkbox" name="aircraftcoloraltitude" value="1" onclick="iconColorAltitude(this)" <?php if (isset($_COOKIE['IconColorAltitude']) && $_COOKIE['IconColorAltitude'] == 'true') print 'checked'; ?> ><?php echo _("Aircraft icon color based on altitude"); ?></li> |
404 | 404 | <?php |
405 | 405 | if (!isset($_COOKIE['IconColorAltitude']) || $_COOKIE['IconColorAltitude'] == 'false') { |
406 | - ?> |
|
406 | + ?> |
|
407 | 407 | <li><?php echo _("Aircraft icon color:"); ?> |
408 | 408 | <input type="color" name="aircraftcolor" id="html5colorpicker" onchange="iconColor(aircraftcolor.value);" value="#<?php if (isset($_COOKIE['IconColor'])) print $_COOKIE['IconColor']; elseif (isset($globalAircraftIconColor)) print $globalAircraftIconColor; else print '1a3151'; ?>"> |
409 | 409 | </li> |
410 | 410 | <?php |
411 | 411 | } |
412 | - } |
|
413 | - } |
|
414 | - ?> |
|
412 | + } |
|
413 | + } |
|
414 | + ?> |
|
415 | 415 | <?php |
416 | 416 | if (isset($globalMarine) && $globalMarine === TRUE) { |
417 | - if (extension_loaded('gd') && function_exists('gd_info')) { |
|
418 | - ?> |
|
417 | + if (extension_loaded('gd') && function_exists('gd_info')) { |
|
418 | + ?> |
|
419 | 419 | <li><?php echo _("Marine icon color:"); ?> |
420 | 420 | <input type="color" name="marinecolor" id="html5colorpicker" onchange="MarineiconColor(marinecolor.value);" value="#<?php if (isset($_COOKIE['MarineIconColor'])) print $_COOKIE['MarineIconColor']; elseif (isset($globalMarineIconColor)) print $globalMarineIconColor; else print '1a3151'; ?>"> |
421 | 421 | </li> |
422 | 422 | <?php |
423 | - } |
|
424 | - } |
|
425 | - ?> |
|
423 | + } |
|
424 | + } |
|
425 | + ?> |
|
426 | 426 | <?php |
427 | 427 | if (isset($globalTracker) && $globalTracker === TRUE) { |
428 | - if (extension_loaded('gd') && function_exists('gd_info')) { |
|
429 | - ?> |
|
428 | + if (extension_loaded('gd') && function_exists('gd_info')) { |
|
429 | + ?> |
|
430 | 430 | <li><?php echo _("Tracker icon color:"); ?> |
431 | 431 | <input type="color" name="trackercolor" id="html5colorpicker" onchange="TrackericonColor(trackercolor.value);" value="#<?php if (isset($_COOKIE['TrackerIconColor'])) print $_COOKIE['TrackerIconColor']; elseif (isset($globalTrackerIconColor)) print $globalTrackerIconColor; else print '1a3151'; ?>"> |
432 | 432 | </li> |
433 | 433 | <?php |
434 | - } |
|
435 | - } |
|
436 | - ?> |
|
434 | + } |
|
435 | + } |
|
436 | + ?> |
|
437 | 437 | <?php |
438 | 438 | if (!isset($globalAircraft) || $globalAircraft === TRUE) { |
439 | - ?> |
|
439 | + ?> |
|
440 | 440 | <li><?php echo _("Show airport icon at zoom level:"); ?> |
441 | 441 | <div class="range"> |
442 | 442 | <input type="range" min="0" max="19" step="1" name="airportzoom" onchange="range.value=value;airportDisplayZoom(airportzoom.value);" value="<?php if (isset($_COOKIE['AirportZoom'])) print $_COOKIE['AirportZoom']; elseif (isset($globalAirportZoom)) print $globalAirportZoom; else print '7'; ?>"> |
@@ -445,9 +445,9 @@ discard block |
||
445 | 445 | </li> |
446 | 446 | <?php |
447 | 447 | } |
448 | - ?> |
|
448 | + ?> |
|
449 | 449 | <?php |
450 | - } elseif (isset($_COOKIE['MapFormat']) || $_COOKIE['MapFOrmat'] == '3d') { |
|
450 | + } elseif (isset($_COOKIE['MapFormat']) || $_COOKIE['MapFOrmat'] == '3d') { |
|
451 | 451 | ?> |
452 | 452 | <?php |
453 | 453 | if (!isset($globalAircraft) || $globalAircraft === TRUE) { |
@@ -478,7 +478,7 @@ discard block |
||
478 | 478 | </li> |
479 | 479 | <?php |
480 | 480 | } |
481 | - } |
|
481 | + } |
|
482 | 482 | ?> |
483 | 483 | <li><?php echo _("Distance unit:"); ?> |
484 | 484 | <select class="selectpicker" onchange="unitdistance(this);"> |
@@ -511,19 +511,19 @@ discard block |
||
511 | 511 | <ul> |
512 | 512 | <?php |
513 | 513 | if (!isset($globalAircraft) || $globalAircraft) { |
514 | - ?> |
|
514 | + ?> |
|
515 | 515 | <?php |
516 | 516 | if (((isset($globalVATSIM) && $globalVATSIM) || isset($globalIVAO) && $globalIVAO || isset($globalphpVMS) && $globalphpVMS) && (!isset($globalMapVAchoose) || $globalMapVAchoose)) { |
517 | - ?> |
|
517 | + ?> |
|
518 | 518 | <?php if (isset($globalVATSIM) && $globalVATSIM) { ?><li><input type="checkbox" name="vatsim" value="1" onclick="clickVATSIM(this)" <?php if ((isset($_COOKIE['ShowVATSIM']) && $_COOKIE['ShowVATSIM'] == 'true') || !isset($_COOKIE['ShowVATSIM'])) print 'checked'; ?> ><?php echo _("Display VATSIM data"); ?></li><?php } ?> |
519 | 519 | <?php if (isset($globalIVAO) && $globalIVAO) { ?><li><input type="checkbox" name="ivao" value="1" onclick="clickIVAO(this)" <?php if ((isset($_COOKIE['ShowIVAO']) && $_COOKIE['ShowIVAO'] == 'true') || !isset($_COOKIE['ShowIVAO'])) print 'checked'; ?> ><?php echo _("Display IVAO data"); ?></li><?php } ?> |
520 | 520 | <?php if (isset($globalphpVMS) && $globalphpVMS) { ?><li><input type="checkbox" name="phpvms" value="1" onclick="clickphpVMS(this)" <?php if ((isset($_COOKIE['ShowVMS']) && $_COOKIE['ShowVMS'] == 'true') || !isset($_COOKIE['ShowVMS'])) print 'checked'; ?> ><?php echo _("Display phpVMS data"); ?></li><?php } ?> |
521 | 521 | <?php |
522 | 522 | } |
523 | - ?> |
|
523 | + ?> |
|
524 | 524 | <?php |
525 | 525 | if (!(isset($globalVA) && $globalVA) && !(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalIVAO) && $globalIVAO) && !(isset($globalphpVMS) && $globalphpVMS) && isset($globalSBS1) && $globalSBS1 && isset($globalAPRS) && $globalAPRS && (!isset($globalMapchoose) || $globalMapchoose)) { |
526 | - ?> |
|
526 | + ?> |
|
527 | 527 | <?php if (isset($globalSBS1) && $globalSBS1) { ?> |
528 | 528 | <li><div class="checkbox"><label><input type="checkbox" name="sbs" value="1" onclick="clickSBS1(this)" <?php if ((isset($_COOKIE['ShowSBS1']) && $_COOKIE['ShowSBS1'] == 'true') || !isset($_COOKIE['ShowSBS1'])) print 'checked'; ?> ><?php echo _("Display ADS-B data"); ?></label></div></li> |
529 | 529 | <?php } ?> |
@@ -532,7 +532,7 @@ discard block |
||
532 | 532 | <?php } ?> |
533 | 533 | <?php |
534 | 534 | } |
535 | - ?> |
|
535 | + ?> |
|
536 | 536 | <li><?php echo _("Display airlines:"); ?> |
537 | 537 | <br/> |
538 | 538 | <select class="selectpicker" multiple onchange="airlines(this);" id="display_airlines"> |
@@ -552,14 +552,14 @@ discard block |
||
552 | 552 | echo '<option value="'.$airline['airline_icao'].'">'.$airline_name.'</option>'; |
553 | 553 | } |
554 | 554 | } |
555 | - ?> |
|
555 | + ?> |
|
556 | 556 | </select> |
557 | 557 | </li> |
558 | 558 | <?php |
559 | 559 | $Spotter = new Spotter(); |
560 | 560 | $allalliancenames = $Spotter->getAllAllianceNames(); |
561 | 561 | if (!empty($allalliancenames)) { |
562 | - ?> |
|
562 | + ?> |
|
563 | 563 | <li><?php echo _("Display alliance:"); ?> |
564 | 564 | <br/> |
565 | 565 | <select class="selectpicker" onchange="alliance(this);" id="display_alliance"> |
@@ -573,18 +573,18 @@ discard block |
||
573 | 573 | echo '<option value="'.$alliance_name.'">'.$alliance_name.'</option>'; |
574 | 574 | } |
575 | 575 | } |
576 | - ?> |
|
576 | + ?> |
|
577 | 577 | </select> |
578 | 578 | </li> |
579 | 579 | <?php |
580 | 580 | } |
581 | - ?> |
|
581 | + ?> |
|
582 | 582 | <?php |
583 | 583 | } |
584 | - ?> |
|
584 | + ?> |
|
585 | 585 | <?php |
586 | 586 | if (isset($globalAPRS) && $globalAPRS) { |
587 | - ?> |
|
587 | + ?> |
|
588 | 588 | <li><?php echo _("Display APRS sources name:"); ?> |
589 | 589 | <select class="selectpicker" multiple onchange="sources(this);"> |
590 | 590 | <?php |
@@ -596,18 +596,18 @@ discard block |
||
596 | 596 | echo '<option value="'.$source['source_name'].'">'.$source['source_name'].'</option>'; |
597 | 597 | } |
598 | 598 | } |
599 | - ?> |
|
599 | + ?> |
|
600 | 600 | </select> |
601 | 601 | </li> |
602 | 602 | <?php |
603 | 603 | } |
604 | - ?> |
|
604 | + ?> |
|
605 | 605 | <?php |
606 | 606 | if (!isset($globalAircraft) && $globalAircraft) { |
607 | - ?> |
|
607 | + ?> |
|
608 | 608 | <?php |
609 | 609 | if (!(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalIVAO) && $globalIVAO) && !(isset($globalphpVMS) && $globalphpVMS)) { |
610 | - ?> |
|
610 | + ?> |
|
611 | 611 | <li><?php echo _("Display airlines of type:"); ?><br/> |
612 | 612 | <select class="selectpicker" onchange="airlinestype(this);"> |
613 | 613 | <option value="all"<?php if (!isset($_COOKIE['filter_airlinestype']) || $_COOKIE['filter_airlinestype'] == 'all' || $_COOKIE['filter_airlinestype'] == '') echo ' selected'; ?>><?php echo _("All"); ?></option> |
@@ -618,14 +618,14 @@ discard block |
||
618 | 618 | </li> |
619 | 619 | <?php |
620 | 620 | } |
621 | - ?> |
|
621 | + ?> |
|
622 | 622 | <li> |
623 | 623 | <?php echo _("Display flight with ident:"); ?> |
624 | 624 | <input type="text" name="identfilter" onchange="identfilter();" id="identfilter" value="<?php if (isset($_COOKIE['filter_ident'])) print $_COOKIE['filter_ident']; ?>" /> |
625 | 625 | </li> |
626 | 626 | <?php |
627 | 627 | } |
628 | - ?> |
|
628 | + ?> |
|
629 | 629 | </ul> |
630 | 630 | </form> |
631 | 631 | <form method="post"> |
@@ -634,7 +634,7 @@ discard block |
||
634 | 634 | </form> |
635 | 635 | </div> |
636 | 636 | <?php |
637 | - if (isset($globalSatellite) && $globalSatellite) { |
|
637 | + if (isset($globalSatellite) && $globalSatellite) { |
|
638 | 638 | ?> |
639 | 639 | <div class="sidebar-pane" id="satellites"> |
640 | 640 | <h1 class="sidebar-header"><?php echo _("Satellites"); ?><span class="sidebar-close"><i class="fa fa-caret-left"></i></span></h1> |
@@ -674,14 +674,14 @@ discard block |
||
674 | 674 | print '<option value="'.$type['tle_type'].'">'.$type_name.'</option>'; |
675 | 675 | } |
676 | 676 | } |
677 | - ?> |
|
677 | + ?> |
|
678 | 678 | </select> |
679 | 679 | </li> |
680 | 680 | </ul> |
681 | 681 | </form> |
682 | 682 | </div> |
683 | 683 | <?php |
684 | - } |
|
684 | + } |
|
685 | 685 | ?> |
686 | 686 | </div> |
687 | 687 | </div> |
@@ -162,11 +162,26 @@ discard block |
||
162 | 162 | <li><div class="checkbox"><label><input type="checkbox" name="notamcb" value="1" onclick="showNotam();" /><?php echo _("Display NOTAM"); ?></label></div></li> |
163 | 163 | <li><?php echo _("NOTAM scope:"); ?> |
164 | 164 | <select class="selectpicker" onchange="notamscope(this);"> |
165 | - <option<?php if (!isset($_COOKIE['notamscope']) || $_COOKIE['notamscope'] == 'All') print ' selected'; ?>>All</option> |
|
166 | - <option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport/Enroute warning') print ' selected'; ?>>Airport/Enroute warning</option> |
|
167 | - <option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport warning') print ' selected'; ?>>Airport warning</option> |
|
168 | - <option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Navigation warning') print ' selected'; ?>>Navigation warning</option> |
|
169 | - <option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Enroute warning') print ' selected'; ?>>Enroute warning</option> |
|
165 | + <option<?php if (!isset($_COOKIE['notamscope']) || $_COOKIE['notamscope'] == 'All') { |
|
166 | + print ' selected'; |
|
167 | +} |
|
168 | +?>>All</option> |
|
169 | + <option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport/Enroute warning') { |
|
170 | + print ' selected'; |
|
171 | +} |
|
172 | +?>>Airport/Enroute warning</option> |
|
173 | + <option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport warning') { |
|
174 | + print ' selected'; |
|
175 | +} |
|
176 | +?>>Airport warning</option> |
|
177 | + <option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Navigation warning') { |
|
178 | + print ' selected'; |
|
179 | +} |
|
180 | +?>>Navigation warning</option> |
|
181 | + <option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Enroute warning') { |
|
182 | + print ' selected'; |
|
183 | +} |
|
184 | +?>>Enroute warning</option> |
|
170 | 185 | </select |
171 | 186 | </li> |
172 | 187 | </ul> |
@@ -194,7 +209,12 @@ discard block |
||
194 | 209 | <div class="form-group"> |
195 | 210 | <label>From (UTC):</label> |
196 | 211 | <div class='input-group date' id='datetimepicker1'> |
197 | - <input type='text' name="start_date" class="form-control" value="<?php if (isset($_POST['start_date'])) print $_POST['start_date']; elseif (isset($_COOKIE['archive_begin'])) print date("m/d/Y h:i a",$_COOKIE['archive_begin']); ?>" required /> |
|
212 | + <input type='text' name="start_date" class="form-control" value="<?php if (isset($_POST['start_date'])) { |
|
213 | + print $_POST['start_date']; |
|
214 | +} elseif (isset($_COOKIE['archive_begin'])) { |
|
215 | + print date("m/d/Y h:i a",$_COOKIE['archive_begin']); |
|
216 | +} |
|
217 | +?>" required /> |
|
198 | 218 | <span class="input-group-addon"> |
199 | 219 | <span class="glyphicon glyphicon-calendar"></span> |
200 | 220 | </span> |
@@ -203,7 +223,12 @@ discard block |
||
203 | 223 | <div class="form-group"> |
204 | 224 | <label>To (UTC):</label> |
205 | 225 | <div class='input-group date' id='datetimepicker2'> |
206 | - <input type='text' name="end_date" class="form-control" value="<?php if (isset($_POST['end_date'])) print $_POST['end_date']; elseif (isset($_COOKIE['archive_end'])) print date("m/d/Y h:i a",$_COOKIE['archive_end']); ?>" /> |
|
226 | + <input type='text' name="end_date" class="form-control" value="<?php if (isset($_POST['end_date'])) { |
|
227 | + print $_POST['end_date']; |
|
228 | +} elseif (isset($_COOKIE['archive_end'])) { |
|
229 | + print date("m/d/Y h:i a",$_COOKIE['archive_end']); |
|
230 | +} |
|
231 | +?>" /> |
|
207 | 232 | <span class="input-group-addon"> |
208 | 233 | <span class="glyphicon glyphicon-calendar"></span> |
209 | 234 | </span> |
@@ -229,8 +254,20 @@ discard block |
||
229 | 254 | |
230 | 255 | <li><?php echo _("Playback speed:"); ?> |
231 | 256 | <div class="range"> |
232 | - <input type="range" min="0" max="50" step="1" name="archivespeed" onChange="archivespeedrange.value=value;" value="<?php if (isset($_POST['archivespeed'])) print $_POST['archivespeed']; elseif (isset($_COOKIE['archive_speed'])) print $_COOKIE['archive_speed']; else print '1'; ?>"> |
|
233 | - <output id="archivespeedrange"><?php if (isset($_COOKIE['archive_speed'])) print $_COOKIE['archive_speed']; else print '1'; ?></output> |
|
257 | + <input type="range" min="0" max="50" step="1" name="archivespeed" onChange="archivespeedrange.value=value;" value="<?php if (isset($_POST['archivespeed'])) { |
|
258 | + print $_POST['archivespeed']; |
|
259 | +} elseif (isset($_COOKIE['archive_speed'])) { |
|
260 | + print $_COOKIE['archive_speed']; |
|
261 | +} else { |
|
262 | + print '1'; |
|
263 | +} |
|
264 | +?>"> |
|
265 | + <output id="archivespeedrange"><?php if (isset($_COOKIE['archive_speed'])) { |
|
266 | + print $_COOKIE['archive_speed']; |
|
267 | +} else { |
|
268 | + print '1'; |
|
269 | +} |
|
270 | +?></output> |
|
234 | 271 | </div> |
235 | 272 | </li> |
236 | 273 | <li><input type="submit" name="archive" value="Show archive" class="btn btn-primary" /></li> |
@@ -252,15 +289,27 @@ discard block |
||
252 | 289 | <li><?php echo _("Type of Map:"); ?> |
253 | 290 | <select class="selectpicker" onchange="mapType(this);"> |
254 | 291 | <?php |
255 | - if (!isset($_COOKIE['MapType']) || $_COOKIE['MapType'] == '') $MapType = $globalMapProvider; |
|
256 | - else $MapType = $_COOKIE['MapType']; |
|
292 | + if (!isset($_COOKIE['MapType']) || $_COOKIE['MapType'] == '') { |
|
293 | + $MapType = $globalMapProvider; |
|
294 | + } else { |
|
295 | + $MapType = $_COOKIE['MapType']; |
|
296 | + } |
|
257 | 297 | ?> |
258 | 298 | <?php |
259 | 299 | if (isset($globalBingMapKey) && $globalBingMapKey != '') { |
260 | 300 | ?> |
261 | - <option value="Bing-Aerial"<?php if ($MapType == 'Bing-Aerial') print ' selected'; ?>>Bing-Aerial</option> |
|
262 | - <option value="Bing-Hybrid"<?php if ($MapType == 'Bing-Hybrid') print ' selected'; ?>>Bing-Hybrid</option> |
|
263 | - <option value="Bing-Road"<?php if ($MapType == 'Bing-Road') print ' selected'; ?>>Bing-Road</option> |
|
301 | + <option value="Bing-Aerial"<?php if ($MapType == 'Bing-Aerial') { |
|
302 | + print ' selected'; |
|
303 | +} |
|
304 | +?>>Bing-Aerial</option> |
|
305 | + <option value="Bing-Hybrid"<?php if ($MapType == 'Bing-Hybrid') { |
|
306 | + print ' selected'; |
|
307 | +} |
|
308 | +?>>Bing-Hybrid</option> |
|
309 | + <option value="Bing-Road"<?php if ($MapType == 'Bing-Road') { |
|
310 | + print ' selected'; |
|
311 | +} |
|
312 | +?>>Bing-Road</option> |
|
264 | 313 | <?php |
265 | 314 | } |
266 | 315 | ?> |
@@ -270,56 +319,131 @@ discard block |
||
270 | 319 | <?php |
271 | 320 | if (isset($globalHereappId) && $globalHereappId != '' && isset($globalHereappCode) && $globalHereappCode != '') { |
272 | 321 | ?> |
273 | - <option value="Here-Aerial"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Aerial</option> |
|
274 | - <option value="Here-Hybrid"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Hybrid</option> |
|
275 | - <option value="Here-Road"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Road</option> |
|
322 | + <option value="Here-Aerial"<?php if ($MapType == 'Here') { |
|
323 | + print ' selected'; |
|
324 | +} |
|
325 | +?>>Here-Aerial</option> |
|
326 | + <option value="Here-Hybrid"<?php if ($MapType == 'Here') { |
|
327 | + print ' selected'; |
|
328 | +} |
|
329 | +?>>Here-Hybrid</option> |
|
330 | + <option value="Here-Road"<?php if ($MapType == 'Here') { |
|
331 | + print ' selected'; |
|
332 | +} |
|
333 | +?>>Here-Road</option> |
|
276 | 334 | <?php |
277 | 335 | } |
278 | 336 | ?> |
279 | 337 | <?php |
280 | 338 | if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '') { |
281 | 339 | ?> |
282 | - <option value="Google-Roadmap"<?php if ($MapType == 'Google-Roadmap') print ' selected'; ?>>Google Roadmap</option> |
|
283 | - <option value="Google-Satellite"<?php if ($MapType == 'Google-Satellite') print ' selected'; ?>>Google Satellite</option> |
|
284 | - <option value="Google-Hybrid"<?php if ($MapType == 'Google-Hybrid') print ' selected'; ?>>Google Hybrid</option> |
|
285 | - <option value="Google-Terrain"<?php if ($MapType == 'Google-Terrain') print ' selected'; ?>>Google Terrain</option> |
|
340 | + <option value="Google-Roadmap"<?php if ($MapType == 'Google-Roadmap') { |
|
341 | + print ' selected'; |
|
342 | +} |
|
343 | +?>>Google Roadmap</option> |
|
344 | + <option value="Google-Satellite"<?php if ($MapType == 'Google-Satellite') { |
|
345 | + print ' selected'; |
|
346 | +} |
|
347 | +?>>Google Satellite</option> |
|
348 | + <option value="Google-Hybrid"<?php if ($MapType == 'Google-Hybrid') { |
|
349 | + print ' selected'; |
|
350 | +} |
|
351 | +?>>Google Hybrid</option> |
|
352 | + <option value="Google-Terrain"<?php if ($MapType == 'Google-Terrain') { |
|
353 | + print ' selected'; |
|
354 | +} |
|
355 | +?>>Google Terrain</option> |
|
286 | 356 | <?php |
287 | 357 | } |
288 | 358 | ?> |
289 | 359 | <?php |
290 | 360 | if (isset($globalMapQuestKey) && $globalMapQuestKey != '') { |
291 | 361 | ?> |
292 | - <option value="MapQuest-OSM"<?php if ($MapType == 'MapQuest-OSM') print ' selected'; ?>>MapQuest-OSM</option> |
|
293 | - <option value="MapQuest-Aerial"<?php if ($MapType == 'MapQuest-Aerial') print ' selected'; ?>>MapQuest-Aerial</option> |
|
294 | - <option value="MapQuest-Hybrid"<?php if ($MapType == 'MapQuest-Hybrid') print ' selected'; ?>>MapQuest-Hybrid</option> |
|
362 | + <option value="MapQuest-OSM"<?php if ($MapType == 'MapQuest-OSM') { |
|
363 | + print ' selected'; |
|
364 | +} |
|
365 | +?>>MapQuest-OSM</option> |
|
366 | + <option value="MapQuest-Aerial"<?php if ($MapType == 'MapQuest-Aerial') { |
|
367 | + print ' selected'; |
|
368 | +} |
|
369 | +?>>MapQuest-Aerial</option> |
|
370 | + <option value="MapQuest-Hybrid"<?php if ($MapType == 'MapQuest-Hybrid') { |
|
371 | + print ' selected'; |
|
372 | +} |
|
373 | +?>>MapQuest-Hybrid</option> |
|
295 | 374 | <?php |
296 | 375 | } |
297 | 376 | ?> |
298 | - <option value="Yandex"<?php if ($MapType == 'Yandex') print ' selected'; ?>>Yandex</option> |
|
377 | + <option value="Yandex"<?php if ($MapType == 'Yandex') { |
|
378 | + print ' selected'; |
|
379 | +} |
|
380 | +?>>Yandex</option> |
|
299 | 381 | <?php |
300 | 382 | } |
301 | 383 | ?> |
302 | 384 | <?php |
303 | 385 | if (isset($globalMapboxToken) && $globalMapboxToken != '') { |
304 | - if (!isset($_COOKIE['MapTypeId'])) $MapBoxId = 'default'; |
|
305 | - else $MapBoxId = $_COOKIE['MapTypeId']; |
|
386 | + if (!isset($_COOKIE['MapTypeId'])) { |
|
387 | + $MapBoxId = 'default'; |
|
388 | + } else { |
|
389 | + $MapBoxId = $_COOKIE['MapTypeId']; |
|
390 | + } |
|
306 | 391 | ?> |
307 | - <option value="Mapbox-default"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'default') print ' selected'; ?>>Mapbox default</option> |
|
308 | - <option value="Mapbox-mapbox.streets"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets') print ' selected'; ?>>Mapbox streets</option> |
|
309 | - <option value="Mapbox-mapbox.light"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.light') print ' selected'; ?>>Mapbox light</option> |
|
310 | - <option value="Mapbox-mapbox.dark"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.dark') print ' selected'; ?>>Mapbox dark</option> |
|
311 | - <option value="Mapbox-mapbox.satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.satellite') print ' selected'; ?>>Mapbox satellite</option> |
|
312 | - <option value="Mapbox-mapbox.streets-satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-satellite') print ' selected'; ?>>Mapbox streets-satellite</option> |
|
313 | - <option value="Mapbox-mapbox.streets-basic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-basic') print ' selected'; ?>>Mapbox streets-basic</option> |
|
314 | - <option value="Mapbox-mapbox.comic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.comic') print ' selected'; ?>>Mapbox comic</option> |
|
315 | - <option value="Mapbox-mapbox.outdoors"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.outdoors') print ' selected'; ?>>Mapbox outdoors</option> |
|
316 | - <option value="Mapbox-mapbox.pencil"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pencil') print ' selected'; ?>>Mapbox pencil</option> |
|
317 | - <option value="Mapbox-mapbox.pirates"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pirates') print ' selected'; ?>>Mapbox pirates</option> |
|
318 | - <option value="Mapbox-mapbox.emerald"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.emerald') print ' selected'; ?>>Mapbox emerald</option> |
|
392 | + <option value="Mapbox-default"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'default') { |
|
393 | + print ' selected'; |
|
394 | +} |
|
395 | +?>>Mapbox default</option> |
|
396 | + <option value="Mapbox-mapbox.streets"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets') { |
|
397 | + print ' selected'; |
|
398 | +} |
|
399 | +?>>Mapbox streets</option> |
|
400 | + <option value="Mapbox-mapbox.light"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.light') { |
|
401 | + print ' selected'; |
|
402 | +} |
|
403 | +?>>Mapbox light</option> |
|
404 | + <option value="Mapbox-mapbox.dark"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.dark') { |
|
405 | + print ' selected'; |
|
406 | +} |
|
407 | +?>>Mapbox dark</option> |
|
408 | + <option value="Mapbox-mapbox.satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.satellite') { |
|
409 | + print ' selected'; |
|
410 | +} |
|
411 | +?>>Mapbox satellite</option> |
|
412 | + <option value="Mapbox-mapbox.streets-satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-satellite') { |
|
413 | + print ' selected'; |
|
414 | +} |
|
415 | +?>>Mapbox streets-satellite</option> |
|
416 | + <option value="Mapbox-mapbox.streets-basic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-basic') { |
|
417 | + print ' selected'; |
|
418 | +} |
|
419 | +?>>Mapbox streets-basic</option> |
|
420 | + <option value="Mapbox-mapbox.comic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.comic') { |
|
421 | + print ' selected'; |
|
422 | +} |
|
423 | +?>>Mapbox comic</option> |
|
424 | + <option value="Mapbox-mapbox.outdoors"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.outdoors') { |
|
425 | + print ' selected'; |
|
426 | +} |
|
427 | +?>>Mapbox outdoors</option> |
|
428 | + <option value="Mapbox-mapbox.pencil"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pencil') { |
|
429 | + print ' selected'; |
|
430 | +} |
|
431 | +?>>Mapbox pencil</option> |
|
432 | + <option value="Mapbox-mapbox.pirates"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pirates') { |
|
433 | + print ' selected'; |
|
434 | +} |
|
435 | +?>>Mapbox pirates</option> |
|
436 | + <option value="Mapbox-mapbox.emerald"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.emerald') { |
|
437 | + print ' selected'; |
|
438 | +} |
|
439 | +?>>Mapbox emerald</option> |
|
319 | 440 | <?php |
320 | 441 | } |
321 | 442 | ?> |
322 | - <option value="OpenStreetMap"<?php if ($MapType == 'OpenStreetMap') print ' selected'; ?>>OpenStreetMap</option> |
|
443 | + <option value="OpenStreetMap"<?php if ($MapType == 'OpenStreetMap') { |
|
444 | + print ' selected'; |
|
445 | +} |
|
446 | +?>>OpenStreetMap</option> |
|
323 | 447 | </select> |
324 | 448 | </li> |
325 | 449 | <?php |
@@ -327,10 +451,22 @@ discard block |
||
327 | 451 | ?> |
328 | 452 | <li><?php echo _("Type of Terrain:"); ?> |
329 | 453 | <select class="selectpicker" onchange="terrainType(this);"> |
330 | - <option value="stk"<?php if (!isset($_COOKIE['MapTerrain']) || $_COOKIE['MapTerrain'] == 'stk') print ' selected'; ?>>stk terrain</option> |
|
331 | - <option value="ellipsoid"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'ellipsoid') print ' selected';?>>ellipsoid</option> |
|
332 | - <option value="vrterrain"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'vrterrain') print ' selected';?>>vr terrain</option> |
|
333 | - <option value="articdem"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'articdem') print ' selected';?>>ArticDEM</option> |
|
454 | + <option value="stk"<?php if (!isset($_COOKIE['MapTerrain']) || $_COOKIE['MapTerrain'] == 'stk') { |
|
455 | + print ' selected'; |
|
456 | +} |
|
457 | +?>>stk terrain</option> |
|
458 | + <option value="ellipsoid"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'ellipsoid') { |
|
459 | + print ' selected'; |
|
460 | +} |
|
461 | +?>>ellipsoid</option> |
|
462 | + <option value="vrterrain"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'vrterrain') { |
|
463 | + print ' selected'; |
|
464 | +} |
|
465 | +?>>vr terrain</option> |
|
466 | + <option value="articdem"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'articdem') { |
|
467 | + print ' selected'; |
|
468 | +} |
|
469 | +?>>ArticDEM</option> |
|
334 | 470 | </select> |
335 | 471 | </li> |
336 | 472 | <?php |
@@ -342,28 +478,61 @@ discard block |
||
342 | 478 | <?php |
343 | 479 | if (!isset($globalAircraft) || $globalAircraft === TRUE) { |
344 | 480 | ?> |
345 | - <li><div class="checkbox"><label><input type="checkbox" name="flightpopup" value="1" onclick="clickFlightPopup(this)" <?php if (isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true') print 'checked'; ?> ><?php echo _("Display flight info as popup"); ?></label></div></li> |
|
346 | - <li><div class="checkbox"><label><input type="checkbox" name="flightpath" value="1" onclick="clickFlightPath(this)" <?php if ((isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true')) print 'checked'; ?> ><?php echo _("Display flight path"); ?></label></div></li> |
|
347 | - <li><div class="checkbox"><label><input type="checkbox" name="flightroute" value="1" onclick="clickFlightRoute(this)" <?php if ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == 'true') || (isset($globalMapRoute) && $globalMapRoute)) print 'checked'; ?> ><?php echo _("Display flight route on click"); ?></label></div></li> |
|
348 | - <li><div class="checkbox"><label><input type="checkbox" name="flightremainingroute" value="1" onclick="clickFlightRemainingRoute(this)" <?php if ((isset($_COOKIE['MapRemainingRoute']) && $_COOKIE['MapRemainingRoute'] == 'true') || !isset($_COOKIE['MapRemainingRoute']) || (isset($globalMapRemainingRoute) && $globalMapRemainingRoute)) print 'checked'; ?> ><?php echo _("Display flight remaining route on click"); ?></label></div></li> |
|
349 | - <li><div class="checkbox"><label><input type="checkbox" name="flightestimation" value="1" onclick="clickFlightEstimation(this)" <?php if ((isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'true') || (!isset($_COOKIE['flightestimation']) && !isset($globalMapEstimation)) || (!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation)) print 'checked'; ?> ><?php echo _("Planes animate between updates"); ?></label></div></li> |
|
481 | + <li><div class="checkbox"><label><input type="checkbox" name="flightpopup" value="1" onclick="clickFlightPopup(this)" <?php if (isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true') { |
|
482 | + print 'checked'; |
|
483 | +} |
|
484 | +?> ><?php echo _("Display flight info as popup"); ?></label></div></li> |
|
485 | + <li><div class="checkbox"><label><input type="checkbox" name="flightpath" value="1" onclick="clickFlightPath(this)" <?php if ((isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true')) { |
|
486 | + print 'checked'; |
|
487 | +} |
|
488 | +?> ><?php echo _("Display flight path"); ?></label></div></li> |
|
489 | + <li><div class="checkbox"><label><input type="checkbox" name="flightroute" value="1" onclick="clickFlightRoute(this)" <?php if ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == 'true') || (isset($globalMapRoute) && $globalMapRoute)) { |
|
490 | + print 'checked'; |
|
491 | +} |
|
492 | +?> ><?php echo _("Display flight route on click"); ?></label></div></li> |
|
493 | + <li><div class="checkbox"><label><input type="checkbox" name="flightremainingroute" value="1" onclick="clickFlightRemainingRoute(this)" <?php if ((isset($_COOKIE['MapRemainingRoute']) && $_COOKIE['MapRemainingRoute'] == 'true') || !isset($_COOKIE['MapRemainingRoute']) || (isset($globalMapRemainingRoute) && $globalMapRemainingRoute)) { |
|
494 | + print 'checked'; |
|
495 | +} |
|
496 | +?> ><?php echo _("Display flight remaining route on click"); ?></label></div></li> |
|
497 | + <li><div class="checkbox"><label><input type="checkbox" name="flightestimation" value="1" onclick="clickFlightEstimation(this)" <?php if ((isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'true') || (!isset($_COOKIE['flightestimation']) && !isset($globalMapEstimation)) || (!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation)) { |
|
498 | + print 'checked'; |
|
499 | +} |
|
500 | +?> ><?php echo _("Planes animate between updates"); ?></label></div></li> |
|
350 | 501 | <?php |
351 | 502 | } |
352 | 503 | if (isset($globalSatellite) && $globalSatellite === TRUE) { |
353 | 504 | ?> |
354 | - <li><div class="checkbox"><label><input type="checkbox" name="satelliteestimation" value="1" onclick="clickSatelliteEstimation(this)" <?php if ((isset($_COOKIE['satelliteestimation']) && $_COOKIE['satelliteestimation'] == 'true') || (!isset($_COOKIE['satelliteestimation']) && !isset($globalMapEstimation)) || (!isset($_COOKIE['satelliteestimation']) && isset($globalMapEstimation) && $globalMapEstimation)) print 'checked'; ?> ><?php echo _("Satellites animate between updates"); ?></label></div></li> |
|
505 | + <li><div class="checkbox"><label><input type="checkbox" name="satelliteestimation" value="1" onclick="clickSatelliteEstimation(this)" <?php if ((isset($_COOKIE['satelliteestimation']) && $_COOKIE['satelliteestimation'] == 'true') || (!isset($_COOKIE['satelliteestimation']) && !isset($globalMapEstimation)) || (!isset($_COOKIE['satelliteestimation']) && isset($globalMapEstimation) && $globalMapEstimation)) { |
|
506 | + print 'checked'; |
|
507 | +} |
|
508 | +?> ><?php echo _("Satellites animate between updates"); ?></label></div></li> |
|
355 | 509 | <?php |
356 | 510 | } |
357 | 511 | } |
358 | 512 | ?> |
359 | - <li><div class="checkbox"><label><input type="checkbox" name="displayairports" value="1" onclick="clickDisplayAirports(this)" <?php if (isset($_COOKIE['displayairports']) && $_COOKIE['displayairports'] == 'true' || !isset($_COOKIE['displayairports'])) print 'checked'; ?> ><?php echo _("Display airports on map"); ?></label></div></li> |
|
360 | - <li><div class="checkbox"><label><input type="checkbox" name="displaygroundstation" value="1" onclick="clickDisplayGroundStation(this)" <?php if ((isset($_COOKIE['show_GroundStation']) && $_COOKIE['show_GroundStation'] == 'true') || (!isset($_COOKIE['show_GroundStation']) && (!isset($globalMapGroundStation) || $globalMapGroundStation === TRUE))) print 'checked'; ?> ><?php echo _("Display ground station on map"); ?></label></div></li> |
|
361 | - <li><div class="checkbox"><label><input type="checkbox" name="displayweatherstation" value="1" onclick="clickDisplayWeatherStation(this)" <?php if ((isset($_COOKIE['show_WeatherStation']) && $_COOKIE['show_WeatherStation'] == 'true') || (!isset($_COOKIE['show_WeatherStation']) && (!isset($globalMapWeatherStation) || $globalMapWeatherStation === TRUE))) print 'checked'; ?> ><?php echo _("Display weather station on map"); ?></label></div></li> |
|
362 | - <li><div class="checkbox"><label><input type="checkbox" name="displaylightning" value="1" onclick="clickDisplayLightning(this)" <?php if ((isset($_COOKIE['show_Lightning']) && $_COOKIE['show_Lightning'] == 'true') || (!isset($_COOKIE['show_Lightning']) && (!isset($globalMapLightning) || $globalMapLightning === TRUE))) print 'checked'; ?> ><?php echo _("Display lightning on map"); ?></label></div></li> |
|
513 | + <li><div class="checkbox"><label><input type="checkbox" name="displayairports" value="1" onclick="clickDisplayAirports(this)" <?php if (isset($_COOKIE['displayairports']) && $_COOKIE['displayairports'] == 'true' || !isset($_COOKIE['displayairports'])) { |
|
514 | + print 'checked'; |
|
515 | +} |
|
516 | +?> ><?php echo _("Display airports on map"); ?></label></div></li> |
|
517 | + <li><div class="checkbox"><label><input type="checkbox" name="displaygroundstation" value="1" onclick="clickDisplayGroundStation(this)" <?php if ((isset($_COOKIE['show_GroundStation']) && $_COOKIE['show_GroundStation'] == 'true') || (!isset($_COOKIE['show_GroundStation']) && (!isset($globalMapGroundStation) || $globalMapGroundStation === TRUE))) { |
|
518 | + print 'checked'; |
|
519 | +} |
|
520 | +?> ><?php echo _("Display ground station on map"); ?></label></div></li> |
|
521 | + <li><div class="checkbox"><label><input type="checkbox" name="displayweatherstation" value="1" onclick="clickDisplayWeatherStation(this)" <?php if ((isset($_COOKIE['show_WeatherStation']) && $_COOKIE['show_WeatherStation'] == 'true') || (!isset($_COOKIE['show_WeatherStation']) && (!isset($globalMapWeatherStation) || $globalMapWeatherStation === TRUE))) { |
|
522 | + print 'checked'; |
|
523 | +} |
|
524 | +?> ><?php echo _("Display weather station on map"); ?></label></div></li> |
|
525 | + <li><div class="checkbox"><label><input type="checkbox" name="displaylightning" value="1" onclick="clickDisplayLightning(this)" <?php if ((isset($_COOKIE['show_Lightning']) && $_COOKIE['show_Lightning'] == 'true') || (!isset($_COOKIE['show_Lightning']) && (!isset($globalMapLightning) || $globalMapLightning === TRUE))) { |
|
526 | + print 'checked'; |
|
527 | +} |
|
528 | +?> ><?php echo _("Display lightning on map"); ?></label></div></li> |
|
363 | 529 | <?php |
364 | 530 | if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') { |
365 | 531 | ?> |
366 | - <li><div class="checkbox"><label><input type="checkbox" name="displayminimap" value="1" onclick="clickDisplayMinimap(this)" <?php if (!isset($_COOKIE['displayminimap']) || (isset($_COOKIE['displayminimap']) && $_COOKIE['displayminimap'] == 'true')) print 'checked'; ?> ><?php echo _("Show mini-map"); ?></label></div></li> |
|
532 | + <li><div class="checkbox"><label><input type="checkbox" name="displayminimap" value="1" onclick="clickDisplayMinimap(this)" <?php if (!isset($_COOKIE['displayminimap']) || (isset($_COOKIE['displayminimap']) && $_COOKIE['displayminimap'] == 'true')) { |
|
533 | + print 'checked'; |
|
534 | +} |
|
535 | +?> ><?php echo _("Show mini-map"); ?></label></div></li> |
|
367 | 536 | <?php |
368 | 537 | } |
369 | 538 | if (time() > mktime(0,0,0,12,1,date("Y")) && time() < mktime(0,0,0,12,31,date("Y"))) { |
@@ -377,17 +546,25 @@ discard block |
||
377 | 546 | if (function_exists('array_column')) { |
378 | 547 | if (array_search(TRUE, array_column($globalSources, 'sourcestats')) !== FALSE) { |
379 | 548 | ?> |
380 | - <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) print 'checked'; ?> ><?php echo _("Display polar on map"); ?></label></div></li> |
|
549 | + <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) { |
|
550 | + print 'checked'; |
|
551 | +} |
|
552 | +?> ><?php echo _("Display polar on map"); ?></label></div></li> |
|
381 | 553 | <?php |
382 | 554 | } |
383 | 555 | } elseif (isset($globalSources)) { |
384 | 556 | $dispolar = false; |
385 | 557 | foreach ($globalSources as $testsource) { |
386 | - if (isset($globalSources['sourcestats']) && $globalSources['sourcestats'] !== FALSE) $dispolar = true; |
|
558 | + if (isset($globalSources['sourcestats']) && $globalSources['sourcestats'] !== FALSE) { |
|
559 | + $dispolar = true; |
|
560 | + } |
|
387 | 561 | } |
388 | 562 | if ($dispolar) { |
389 | 563 | ?> |
390 | - <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) print 'checked'; ?> ><?php echo _("Display polar on map"); ?></label></div></li> |
|
564 | + <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) { |
|
565 | + print 'checked'; |
|
566 | +} |
|
567 | +?> ><?php echo _("Display polar on map"); ?></label></div></li> |
|
391 | 568 | <?php |
392 | 569 | } |
393 | 570 | } |
@@ -400,12 +577,22 @@ discard block |
||
400 | 577 | if (!isset($globalAircraft) || $globalAircraft === TRUE) { |
401 | 578 | if (extension_loaded('gd') && function_exists('gd_info')) { |
402 | 579 | ?> |
403 | - <li><input type="checkbox" name="aircraftcoloraltitude" value="1" onclick="iconColorAltitude(this)" <?php if (isset($_COOKIE['IconColorAltitude']) && $_COOKIE['IconColorAltitude'] == 'true') print 'checked'; ?> ><?php echo _("Aircraft icon color based on altitude"); ?></li> |
|
580 | + <li><input type="checkbox" name="aircraftcoloraltitude" value="1" onclick="iconColorAltitude(this)" <?php if (isset($_COOKIE['IconColorAltitude']) && $_COOKIE['IconColorAltitude'] == 'true') { |
|
581 | + print 'checked'; |
|
582 | +} |
|
583 | +?> ><?php echo _("Aircraft icon color based on altitude"); ?></li> |
|
404 | 584 | <?php |
405 | 585 | if (!isset($_COOKIE['IconColorAltitude']) || $_COOKIE['IconColorAltitude'] == 'false') { |
406 | 586 | ?> |
407 | 587 | <li><?php echo _("Aircraft icon color:"); ?> |
408 | - <input type="color" name="aircraftcolor" id="html5colorpicker" onchange="iconColor(aircraftcolor.value);" value="#<?php if (isset($_COOKIE['IconColor'])) print $_COOKIE['IconColor']; elseif (isset($globalAircraftIconColor)) print $globalAircraftIconColor; else print '1a3151'; ?>"> |
|
588 | + <input type="color" name="aircraftcolor" id="html5colorpicker" onchange="iconColor(aircraftcolor.value);" value="#<?php if (isset($_COOKIE['IconColor'])) { |
|
589 | + print $_COOKIE['IconColor']; |
|
590 | +} elseif (isset($globalAircraftIconColor)) { |
|
591 | + print $globalAircraftIconColor; |
|
592 | +} else { |
|
593 | + print '1a3151'; |
|
594 | +} |
|
595 | +?>"> |
|
409 | 596 | </li> |
410 | 597 | <?php |
411 | 598 | } |
@@ -417,7 +604,14 @@ discard block |
||
417 | 604 | if (extension_loaded('gd') && function_exists('gd_info')) { |
418 | 605 | ?> |
419 | 606 | <li><?php echo _("Marine icon color:"); ?> |
420 | - <input type="color" name="marinecolor" id="html5colorpicker" onchange="MarineiconColor(marinecolor.value);" value="#<?php if (isset($_COOKIE['MarineIconColor'])) print $_COOKIE['MarineIconColor']; elseif (isset($globalMarineIconColor)) print $globalMarineIconColor; else print '1a3151'; ?>"> |
|
607 | + <input type="color" name="marinecolor" id="html5colorpicker" onchange="MarineiconColor(marinecolor.value);" value="#<?php if (isset($_COOKIE['MarineIconColor'])) { |
|
608 | + print $_COOKIE['MarineIconColor']; |
|
609 | +} elseif (isset($globalMarineIconColor)) { |
|
610 | + print $globalMarineIconColor; |
|
611 | +} else { |
|
612 | + print '1a3151'; |
|
613 | +} |
|
614 | +?>"> |
|
421 | 615 | </li> |
422 | 616 | <?php |
423 | 617 | } |
@@ -428,7 +622,14 @@ discard block |
||
428 | 622 | if (extension_loaded('gd') && function_exists('gd_info')) { |
429 | 623 | ?> |
430 | 624 | <li><?php echo _("Tracker icon color:"); ?> |
431 | - <input type="color" name="trackercolor" id="html5colorpicker" onchange="TrackericonColor(trackercolor.value);" value="#<?php if (isset($_COOKIE['TrackerIconColor'])) print $_COOKIE['TrackerIconColor']; elseif (isset($globalTrackerIconColor)) print $globalTrackerIconColor; else print '1a3151'; ?>"> |
|
625 | + <input type="color" name="trackercolor" id="html5colorpicker" onchange="TrackericonColor(trackercolor.value);" value="#<?php if (isset($_COOKIE['TrackerIconColor'])) { |
|
626 | + print $_COOKIE['TrackerIconColor']; |
|
627 | +} elseif (isset($globalTrackerIconColor)) { |
|
628 | + print $globalTrackerIconColor; |
|
629 | +} else { |
|
630 | + print '1a3151'; |
|
631 | +} |
|
632 | +?>"> |
|
432 | 633 | </li> |
433 | 634 | <?php |
434 | 635 | } |
@@ -439,8 +640,22 @@ discard block |
||
439 | 640 | ?> |
440 | 641 | <li><?php echo _("Show airport icon at zoom level:"); ?> |
441 | 642 | <div class="range"> |
442 | - <input type="range" min="0" max="19" step="1" name="airportzoom" onchange="range.value=value;airportDisplayZoom(airportzoom.value);" value="<?php if (isset($_COOKIE['AirportZoom'])) print $_COOKIE['AirportZoom']; elseif (isset($globalAirportZoom)) print $globalAirportZoom; else print '7'; ?>"> |
|
443 | - <output id="range"><?php if (isset($_COOKIE['AirportZoom'])) print $_COOKIE['AirportZoom']; elseif (isset($globalAirportZoom)) print $globalAirportZoom; else print '7'; ?></output> |
|
643 | + <input type="range" min="0" max="19" step="1" name="airportzoom" onchange="range.value=value;airportDisplayZoom(airportzoom.value);" value="<?php if (isset($_COOKIE['AirportZoom'])) { |
|
644 | + print $_COOKIE['AirportZoom']; |
|
645 | +} elseif (isset($globalAirportZoom)) { |
|
646 | + print $globalAirportZoom; |
|
647 | +} else { |
|
648 | + print '7'; |
|
649 | +} |
|
650 | +?>"> |
|
651 | + <output id="range"><?php if (isset($_COOKIE['AirportZoom'])) { |
|
652 | + print $_COOKIE['AirportZoom']; |
|
653 | +} elseif (isset($globalAirportZoom)) { |
|
654 | + print $globalAirportZoom; |
|
655 | +} else { |
|
656 | + print '7'; |
|
657 | +} |
|
658 | +?></output> |
|
444 | 659 | </div> |
445 | 660 | </li> |
446 | 661 | <?php |
@@ -452,9 +667,19 @@ discard block |
||
452 | 667 | <?php |
453 | 668 | if (!isset($globalAircraft) || $globalAircraft === TRUE) { |
454 | 669 | ?> |
455 | - <li><input type="checkbox" name="aircraftcolorforce" value="1" onclick="iconColorForce(this)" <?php if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true') print 'checked'; ?> ><?php echo _("Force Aircraft color"); ?></li> |
|
670 | + <li><input type="checkbox" name="aircraftcolorforce" value="1" onclick="iconColorForce(this)" <?php if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true') { |
|
671 | + print 'checked'; |
|
672 | +} |
|
673 | +?> ><?php echo _("Force Aircraft color"); ?></li> |
|
456 | 674 | <li><?php echo _("Aircraft icon color:"); ?> |
457 | - <input type="color" name="aircraftcolor" id="html5colorpicker" onchange="iconColor(aircraftcolor.value);" value="#<?php if (isset($_COOKIE['IconColor'])) print $_COOKIE['IconColor']; elseif (isset($globalAircraftIconColor)) print $globalAircraftIconColor; else print 'ff0000'; ?>"> |
|
675 | + <input type="color" name="aircraftcolor" id="html5colorpicker" onchange="iconColor(aircraftcolor.value);" value="#<?php if (isset($_COOKIE['IconColor'])) { |
|
676 | + print $_COOKIE['IconColor']; |
|
677 | +} elseif (isset($globalAircraftIconColor)) { |
|
678 | + print $globalAircraftIconColor; |
|
679 | +} else { |
|
680 | + print 'ff0000'; |
|
681 | +} |
|
682 | +?>"> |
|
458 | 683 | </li> |
459 | 684 | <?php |
460 | 685 | } |
@@ -462,9 +687,19 @@ discard block |
||
462 | 687 | <?php |
463 | 688 | if (isset($globalMarine) && $globalMarine === TRUE) { |
464 | 689 | ?> |
465 | - <li><input type="checkbox" name="marinecolorforce" value="1" onclick="MarineiconColorForce(this)" <?php if (isset($_COOKIE['MarineIconColorForce']) && $_COOKIE['MarineIconColorForce'] == 'true') print 'checked'; ?> ><?php echo _("Force Marine color"); ?></li> |
|
690 | + <li><input type="checkbox" name="marinecolorforce" value="1" onclick="MarineiconColorForce(this)" <?php if (isset($_COOKIE['MarineIconColorForce']) && $_COOKIE['MarineIconColorForce'] == 'true') { |
|
691 | + print 'checked'; |
|
692 | +} |
|
693 | +?> ><?php echo _("Force Marine color"); ?></li> |
|
466 | 694 | <li><?php echo _("Marine icon color:"); ?> |
467 | - <input type="color" name="marinecolor" id="html5colorpicker" onchange="MarineiconColor(marinecolor.value);" value="#<?php if (isset($_COOKIE['MarineIconColor'])) print $_COOKIE['MarineIconColor']; elseif (isset($globalMarineIconColor)) print $globalMarineIconColor; else print 'ff0000'; ?>"> |
|
695 | + <input type="color" name="marinecolor" id="html5colorpicker" onchange="MarineiconColor(marinecolor.value);" value="#<?php if (isset($_COOKIE['MarineIconColor'])) { |
|
696 | + print $_COOKIE['MarineIconColor']; |
|
697 | +} elseif (isset($globalMarineIconColor)) { |
|
698 | + print $globalMarineIconColor; |
|
699 | +} else { |
|
700 | + print 'ff0000'; |
|
701 | +} |
|
702 | +?>"> |
|
468 | 703 | </li> |
469 | 704 | <?php |
470 | 705 | } |
@@ -472,9 +707,19 @@ discard block |
||
472 | 707 | <?php |
473 | 708 | if (isset($globalTracker) && $globalTracker === TRUE) { |
474 | 709 | ?> |
475 | - <li><input type="checkbox" name="trackercolorforce" value="1" onclick="TrackericonColorForce(this)" <?php if (isset($_COOKIE['TrackerIconColorForce']) && $_COOKIE['TrackerIconColorForce'] == 'true') print 'checked'; ?> ><?php echo _("Force Tracker color"); ?></li> |
|
710 | + <li><input type="checkbox" name="trackercolorforce" value="1" onclick="TrackericonColorForce(this)" <?php if (isset($_COOKIE['TrackerIconColorForce']) && $_COOKIE['TrackerIconColorForce'] == 'true') { |
|
711 | + print 'checked'; |
|
712 | +} |
|
713 | +?> ><?php echo _("Force Tracker color"); ?></li> |
|
476 | 714 | <li><?php echo _("Tracker icon color:"); ?> |
477 | - <input type="color" name="trackercolor" id="html5colorpicker" onchange="TrackericonColor(trackercolor.value);" value="#<?php if (isset($_COOKIE['TrackerIconColor'])) print $_COOKIE['TrackerIconColor']; elseif (isset($globalTrackerIconColor)) print $globalTrackerIconColor; else print 'ff0000'; ?>"> |
|
715 | + <input type="color" name="trackercolor" id="html5colorpicker" onchange="TrackericonColor(trackercolor.value);" value="#<?php if (isset($_COOKIE['TrackerIconColor'])) { |
|
716 | + print $_COOKIE['TrackerIconColor']; |
|
717 | +} elseif (isset($globalTrackerIconColor)) { |
|
718 | + print $globalTrackerIconColor; |
|
719 | +} else { |
|
720 | + print 'ff0000'; |
|
721 | +} |
|
722 | +?>"> |
|
478 | 723 | </li> |
479 | 724 | <?php |
480 | 725 | } |
@@ -482,22 +727,46 @@ discard block |
||
482 | 727 | ?> |
483 | 728 | <li><?php echo _("Distance unit:"); ?> |
484 | 729 | <select class="selectpicker" onchange="unitdistance(this);"> |
485 | - <option value="km"<?php if ((!isset($_COOKIE['unitdistance']) && (!isset($globalUnitDistance) || (isset($globalUnitDistance) && $globalUnitDistance == 'km'))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) echo ' selected'; ?>>km</option> |
|
486 | - <option value="nm"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) echo ' selected'; ?>>nm</option> |
|
487 | - <option value="mi"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) echo ' selected'; ?>>mi</option> |
|
730 | + <option value="km"<?php if ((!isset($_COOKIE['unitdistance']) && (!isset($globalUnitDistance) || (isset($globalUnitDistance) && $globalUnitDistance == 'km'))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) { |
|
731 | + echo ' selected'; |
|
732 | +} |
|
733 | +?>>km</option> |
|
734 | + <option value="nm"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
|
735 | + echo ' selected'; |
|
736 | +} |
|
737 | +?>>nm</option> |
|
738 | + <option value="mi"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
|
739 | + echo ' selected'; |
|
740 | +} |
|
741 | +?>>mi</option> |
|
488 | 742 | </select> |
489 | 743 | </li> |
490 | 744 | <li><?php echo _("Altitude unit:"); ?> |
491 | 745 | <select class="selectpicker" onchange="unitaltitude(this);"> |
492 | - <option value="m"<?php if ((!isset($_COOKIE['unitaltitude']) && (!isset($globalUnitAltitude) || (isset($globalUnitAltitude) && $globalUnitAltitude == 'm'))) || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'm')) echo ' selected'; ?>>m</option> |
|
493 | - <option value="feet"<?php if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) echo ' selected'; ?>>feet</option> |
|
746 | + <option value="m"<?php if ((!isset($_COOKIE['unitaltitude']) && (!isset($globalUnitAltitude) || (isset($globalUnitAltitude) && $globalUnitAltitude == 'm'))) || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'm')) { |
|
747 | + echo ' selected'; |
|
748 | +} |
|
749 | +?>>m</option> |
|
750 | + <option value="feet"<?php if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) { |
|
751 | + echo ' selected'; |
|
752 | +} |
|
753 | +?>>feet</option> |
|
494 | 754 | </select> |
495 | 755 | </li> |
496 | 756 | <li><?php echo _("Speed unit:"); ?> |
497 | 757 | <select class="selectpicker" onchange="unitspeed(this);"> |
498 | - <option value="kmh"<?php if ((!isset($_COOKIE['unitspeed']) && (!isset($globalUnitSpeed) || (isset($globalUnitSpeed) && $globalUnitSpeed == 'kmh'))) || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'kmh')) echo ' selected'; ?>>km/h</option> |
|
499 | - <option value="mph"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'mph') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'mph')) echo ' selected'; ?>>mph</option> |
|
500 | - <option value="knots"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'knots') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'knots')) echo ' selected'; ?>>knots</option> |
|
758 | + <option value="kmh"<?php if ((!isset($_COOKIE['unitspeed']) && (!isset($globalUnitSpeed) || (isset($globalUnitSpeed) && $globalUnitSpeed == 'kmh'))) || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'kmh')) { |
|
759 | + echo ' selected'; |
|
760 | +} |
|
761 | +?>>km/h</option> |
|
762 | + <option value="mph"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'mph') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'mph')) { |
|
763 | + echo ' selected'; |
|
764 | +} |
|
765 | +?>>mph</option> |
|
766 | + <option value="knots"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'knots') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'knots')) { |
|
767 | + echo ' selected'; |
|
768 | +} |
|
769 | +?>>knots</option> |
|
501 | 770 | </select> |
502 | 771 | </li> |
503 | 772 | |
@@ -515,9 +784,18 @@ discard block |
||
515 | 784 | <?php |
516 | 785 | if (((isset($globalVATSIM) && $globalVATSIM) || isset($globalIVAO) && $globalIVAO || isset($globalphpVMS) && $globalphpVMS) && (!isset($globalMapVAchoose) || $globalMapVAchoose)) { |
517 | 786 | ?> |
518 | - <?php if (isset($globalVATSIM) && $globalVATSIM) { ?><li><input type="checkbox" name="vatsim" value="1" onclick="clickVATSIM(this)" <?php if ((isset($_COOKIE['ShowVATSIM']) && $_COOKIE['ShowVATSIM'] == 'true') || !isset($_COOKIE['ShowVATSIM'])) print 'checked'; ?> ><?php echo _("Display VATSIM data"); ?></li><?php } ?> |
|
519 | - <?php if (isset($globalIVAO) && $globalIVAO) { ?><li><input type="checkbox" name="ivao" value="1" onclick="clickIVAO(this)" <?php if ((isset($_COOKIE['ShowIVAO']) && $_COOKIE['ShowIVAO'] == 'true') || !isset($_COOKIE['ShowIVAO'])) print 'checked'; ?> ><?php echo _("Display IVAO data"); ?></li><?php } ?> |
|
520 | - <?php if (isset($globalphpVMS) && $globalphpVMS) { ?><li><input type="checkbox" name="phpvms" value="1" onclick="clickphpVMS(this)" <?php if ((isset($_COOKIE['ShowVMS']) && $_COOKIE['ShowVMS'] == 'true') || !isset($_COOKIE['ShowVMS'])) print 'checked'; ?> ><?php echo _("Display phpVMS data"); ?></li><?php } ?> |
|
787 | + <?php if (isset($globalVATSIM) && $globalVATSIM) { ?><li><input type="checkbox" name="vatsim" value="1" onclick="clickVATSIM(this)" <?php if ((isset($_COOKIE['ShowVATSIM']) && $_COOKIE['ShowVATSIM'] == 'true') || !isset($_COOKIE['ShowVATSIM'])) { |
|
788 | + print 'checked'; |
|
789 | +} |
|
790 | +?> ><?php echo _("Display VATSIM data"); ?></li><?php } ?> |
|
791 | + <?php if (isset($globalIVAO) && $globalIVAO) { ?><li><input type="checkbox" name="ivao" value="1" onclick="clickIVAO(this)" <?php if ((isset($_COOKIE['ShowIVAO']) && $_COOKIE['ShowIVAO'] == 'true') || !isset($_COOKIE['ShowIVAO'])) { |
|
792 | + print 'checked'; |
|
793 | +} |
|
794 | +?> ><?php echo _("Display IVAO data"); ?></li><?php } ?> |
|
795 | + <?php if (isset($globalphpVMS) && $globalphpVMS) { ?><li><input type="checkbox" name="phpvms" value="1" onclick="clickphpVMS(this)" <?php if ((isset($_COOKIE['ShowVMS']) && $_COOKIE['ShowVMS'] == 'true') || !isset($_COOKIE['ShowVMS'])) { |
|
796 | + print 'checked'; |
|
797 | +} |
|
798 | +?> ><?php echo _("Display phpVMS data"); ?></li><?php } ?> |
|
521 | 799 | <?php |
522 | 800 | } |
523 | 801 | ?> |
@@ -525,10 +803,16 @@ discard block |
||
525 | 803 | if (!(isset($globalVA) && $globalVA) && !(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalIVAO) && $globalIVAO) && !(isset($globalphpVMS) && $globalphpVMS) && isset($globalSBS1) && $globalSBS1 && isset($globalAPRS) && $globalAPRS && (!isset($globalMapchoose) || $globalMapchoose)) { |
526 | 804 | ?> |
527 | 805 | <?php if (isset($globalSBS1) && $globalSBS1) { ?> |
528 | - <li><div class="checkbox"><label><input type="checkbox" name="sbs" value="1" onclick="clickSBS1(this)" <?php if ((isset($_COOKIE['ShowSBS1']) && $_COOKIE['ShowSBS1'] == 'true') || !isset($_COOKIE['ShowSBS1'])) print 'checked'; ?> ><?php echo _("Display ADS-B data"); ?></label></div></li> |
|
806 | + <li><div class="checkbox"><label><input type="checkbox" name="sbs" value="1" onclick="clickSBS1(this)" <?php if ((isset($_COOKIE['ShowSBS1']) && $_COOKIE['ShowSBS1'] == 'true') || !isset($_COOKIE['ShowSBS1'])) { |
|
807 | + print 'checked'; |
|
808 | +} |
|
809 | +?> ><?php echo _("Display ADS-B data"); ?></label></div></li> |
|
529 | 810 | <?php } ?> |
530 | 811 | <?php if (isset($globalAPRS) && $globalAPRS) { ?> |
531 | - <li><div class="checkbox"><label><input type="checkbox" name="aprs" value="1" onclick="clickAPRS(this)" <?php if ((isset($_COOKIE['ShowAPRS']) && $_COOKIE['ShowAPRS'] == 'true') || !isset($_COOKIE['ShowAPRS'])) print 'checked'; ?> ><?php echo _("Display APRS data"); ?></label></div></li> |
|
812 | + <li><div class="checkbox"><label><input type="checkbox" name="aprs" value="1" onclick="clickAPRS(this)" <?php if ((isset($_COOKIE['ShowAPRS']) && $_COOKIE['ShowAPRS'] == 'true') || !isset($_COOKIE['ShowAPRS'])) { |
|
813 | + print 'checked'; |
|
814 | +} |
|
815 | +?> ><?php echo _("Display APRS data"); ?></label></div></li> |
|
532 | 816 | <?php } ?> |
533 | 817 | <?php |
534 | 818 | } |
@@ -545,7 +829,9 @@ discard block |
||
545 | 829 | } |
546 | 830 | foreach($allairlinenames as $airline) { |
547 | 831 | $airline_name = $airline['airline_name']; |
548 | - if (strlen($airline_name) > 30) $airline_name = substr($airline_name,0,30).'...'; |
|
832 | + if (strlen($airline_name) > 30) { |
|
833 | + $airline_name = substr($airline_name,0,30).'...'; |
|
834 | + } |
|
549 | 835 | if (isset($_COOKIE['filter_Airlines']) && in_array($airline['airline_icao'],explode(',',$_COOKIE['filter_Airlines']))) { |
550 | 836 | echo '<option value="'.$airline['airline_icao'].'" selected>'.$airline_name.'</option>'; |
551 | 837 | } else { |
@@ -563,7 +849,10 @@ discard block |
||
563 | 849 | <li><?php echo _("Display alliance:"); ?> |
564 | 850 | <br/> |
565 | 851 | <select class="selectpicker" onchange="alliance(this);" id="display_alliance"> |
566 | - <option value="all"<?php if (!isset($_COOKIE['filter_alliance']) || $_COOKIE['filter_alliance'] == 'all' || $_COOKIE['filter_alliance'] == '') echo ' selected'; ?>><?php echo _("All"); ?></option> |
|
852 | + <option value="all"<?php if (!isset($_COOKIE['filter_alliance']) || $_COOKIE['filter_alliance'] == 'all' || $_COOKIE['filter_alliance'] == '') { |
|
853 | + echo ' selected'; |
|
854 | +} |
|
855 | +?>><?php echo _("All"); ?></option> |
|
567 | 856 | <?php |
568 | 857 | foreach($allalliancenames as $alliance) { |
569 | 858 | $alliance_name = $alliance['alliance']; |
@@ -610,10 +899,22 @@ discard block |
||
610 | 899 | ?> |
611 | 900 | <li><?php echo _("Display airlines of type:"); ?><br/> |
612 | 901 | <select class="selectpicker" onchange="airlinestype(this);"> |
613 | - <option value="all"<?php if (!isset($_COOKIE['filter_airlinestype']) || $_COOKIE['filter_airlinestype'] == 'all' || $_COOKIE['filter_airlinestype'] == '') echo ' selected'; ?>><?php echo _("All"); ?></option> |
|
614 | - <option value="passenger"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'passenger') echo ' selected'; ?>><?php echo _("Passenger"); ?></option> |
|
615 | - <option value="cargo"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'cargo') echo ' selected'; ?>><?php echo _("Cargo"); ?></option> |
|
616 | - <option value="military"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'military') echo ' selected'; ?>><?php echo _("Military"); ?></option> |
|
902 | + <option value="all"<?php if (!isset($_COOKIE['filter_airlinestype']) || $_COOKIE['filter_airlinestype'] == 'all' || $_COOKIE['filter_airlinestype'] == '') { |
|
903 | + echo ' selected'; |
|
904 | +} |
|
905 | +?>><?php echo _("All"); ?></option> |
|
906 | + <option value="passenger"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'passenger') { |
|
907 | + echo ' selected'; |
|
908 | +} |
|
909 | +?>><?php echo _("Passenger"); ?></option> |
|
910 | + <option value="cargo"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'cargo') { |
|
911 | + echo ' selected'; |
|
912 | +} |
|
913 | +?>><?php echo _("Cargo"); ?></option> |
|
914 | + <option value="military"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'military') { |
|
915 | + echo ' selected'; |
|
916 | +} |
|
917 | +?>><?php echo _("Military"); ?></option> |
|
617 | 918 | </select> |
618 | 919 | </li> |
619 | 920 | <?php |
@@ -621,7 +922,10 @@ discard block |
||
621 | 922 | ?> |
622 | 923 | <li> |
623 | 924 | <?php echo _("Display flight with ident:"); ?> |
624 | - <input type="text" name="identfilter" onchange="identfilter();" id="identfilter" value="<?php if (isset($_COOKIE['filter_ident'])) print $_COOKIE['filter_ident']; ?>" /> |
|
925 | + <input type="text" name="identfilter" onchange="identfilter();" id="identfilter" value="<?php if (isset($_COOKIE['filter_ident'])) { |
|
926 | + print $_COOKIE['filter_ident']; |
|
927 | +} |
|
928 | +?>" /> |
|
625 | 929 | </li> |
626 | 930 | <?php |
627 | 931 | } |
@@ -640,7 +944,10 @@ discard block |
||
640 | 944 | <h1 class="sidebar-header"><?php echo _("Satellites"); ?><span class="sidebar-close"><i class="fa fa-caret-left"></i></span></h1> |
641 | 945 | <form> |
642 | 946 | <ul> |
643 | - <li><div class="checkbox"><label><input type="checkbox" name="displayiss" value="1" onclick="clickDisplayISS(this)" <?php if ((isset($_COOKIE['displayiss']) && $_COOKIE['displayiss'] == 'true') || !isset($_COOKIE['displayiss'])) print 'checked'; ?> ><?php echo _("Show ISS, Tiangong-1 and Tiangong-2 on map"); ?></label></div></li> |
|
947 | + <li><div class="checkbox"><label><input type="checkbox" name="displayiss" value="1" onclick="clickDisplayISS(this)" <?php if ((isset($_COOKIE['displayiss']) && $_COOKIE['displayiss'] == 'true') || !isset($_COOKIE['displayiss'])) { |
|
948 | + print 'checked'; |
|
949 | +} |
|
950 | +?> ><?php echo _("Show ISS, Tiangong-1 and Tiangong-2 on map"); ?></label></div></li> |
|
644 | 951 | <li><?php echo _("Type:"); ?> |
645 | 952 | <select class="selectpicker" multiple onchange="sattypes(this);"> |
646 | 953 | <?php |
@@ -648,25 +955,45 @@ discard block |
||
648 | 955 | $types = $Satellite->get_tle_types(); |
649 | 956 | foreach ($types as $type) { |
650 | 957 | $type_name = $type['tle_type']; |
651 | - if ($type_name == 'musson') $type_name = 'Russian LEO Navigation'; |
|
652 | - else if ($type_name == 'nnss') $type_name = 'Navi Navigation Satellite System'; |
|
653 | - else if ($type_name == 'sbas') $type_name = 'Satellite-Based Augmentation System'; |
|
654 | - else if ($type_name == 'glo-ops') $type_name = 'Glonass Operational'; |
|
655 | - else if ($type_name == 'gps-ops') $type_name = 'GPS Operational'; |
|
656 | - else if ($type_name == 'argos') $type_name = 'ARGOS Data Collection System'; |
|
657 | - else if ($type_name == 'tdrss') $type_name = 'Tracking and Data Relay Satellite System'; |
|
658 | - else if ($type_name == 'sarsat') $type_name = 'Search & Rescue'; |
|
659 | - else if ($type_name == 'dmc') $type_name = 'Disaster Monitoring'; |
|
660 | - else if ($type_name == 'resource') $type_name = 'Earth Resources'; |
|
661 | - else if ($type_name == 'stations') $type_name = 'Space Stations'; |
|
662 | - else if ($type_name == 'geo') $type_name = 'Geostationary'; |
|
663 | - else if ($type_name == 'amateur') $type_name = 'Amateur Radio'; |
|
664 | - else if ($type_name == 'x-comm') $type_name = 'Experimental'; |
|
665 | - else if ($type_name == 'other-comm') $type_name = 'Other Comm'; |
|
666 | - else if ($type_name == 'science') $type_name = 'Space & Earth Science'; |
|
667 | - else if ($type_name == 'military') $type_name = 'Miscellaneous Military'; |
|
668 | - else if ($type_name == 'radar') $type_name = 'Radar Calibration'; |
|
669 | - else if ($type_name == 'tle-new') $type_name = 'Last 30 days launches'; |
|
958 | + if ($type_name == 'musson') { |
|
959 | + $type_name = 'Russian LEO Navigation'; |
|
960 | + } else if ($type_name == 'nnss') { |
|
961 | + $type_name = 'Navi Navigation Satellite System'; |
|
962 | + } else if ($type_name == 'sbas') { |
|
963 | + $type_name = 'Satellite-Based Augmentation System'; |
|
964 | + } else if ($type_name == 'glo-ops') { |
|
965 | + $type_name = 'Glonass Operational'; |
|
966 | + } else if ($type_name == 'gps-ops') { |
|
967 | + $type_name = 'GPS Operational'; |
|
968 | + } else if ($type_name == 'argos') { |
|
969 | + $type_name = 'ARGOS Data Collection System'; |
|
970 | + } else if ($type_name == 'tdrss') { |
|
971 | + $type_name = 'Tracking and Data Relay Satellite System'; |
|
972 | + } else if ($type_name == 'sarsat') { |
|
973 | + $type_name = 'Search & Rescue'; |
|
974 | + } else if ($type_name == 'dmc') { |
|
975 | + $type_name = 'Disaster Monitoring'; |
|
976 | + } else if ($type_name == 'resource') { |
|
977 | + $type_name = 'Earth Resources'; |
|
978 | + } else if ($type_name == 'stations') { |
|
979 | + $type_name = 'Space Stations'; |
|
980 | + } else if ($type_name == 'geo') { |
|
981 | + $type_name = 'Geostationary'; |
|
982 | + } else if ($type_name == 'amateur') { |
|
983 | + $type_name = 'Amateur Radio'; |
|
984 | + } else if ($type_name == 'x-comm') { |
|
985 | + $type_name = 'Experimental'; |
|
986 | + } else if ($type_name == 'other-comm') { |
|
987 | + $type_name = 'Other Comm'; |
|
988 | + } else if ($type_name == 'science') { |
|
989 | + $type_name = 'Space & Earth Science'; |
|
990 | + } else if ($type_name == 'military') { |
|
991 | + $type_name = 'Miscellaneous Military'; |
|
992 | + } else if ($type_name == 'radar') { |
|
993 | + $type_name = 'Radar Calibration'; |
|
994 | + } else if ($type_name == 'tle-new') { |
|
995 | + $type_name = 'Last 30 days launches'; |
|
996 | + } |
|
670 | 997 | |
671 | 998 | if (isset($_COOKIE['sattypes']) && in_array($type['tle_type'],explode(',',$_COOKIE['sattypes']))) { |
672 | 999 | print '<option value="'.$type['tle_type'].'" selected>'.$type_name.'</option>'; |
@@ -27,15 +27,21 @@ discard block |
||
27 | 27 | } |
28 | 28 | } |
29 | 29 | } |
30 | -if ($authorize === false) die; |
|
30 | +if ($authorize === false) { |
|
31 | + die; |
|
32 | +} |
|
31 | 33 | |
32 | -if (isset($globalTracker) && $globalTracker) require_once(dirname(__FILE__).'/../require/class.TrackerImport.php'); |
|
34 | +if (isset($globalTracker) && $globalTracker) { |
|
35 | + require_once(dirname(__FILE__).'/../require/class.TrackerImport.php'); |
|
36 | +} |
|
33 | 37 | if (isset($globalMarine) && $globalMarine) { |
34 | 38 | require_once(dirname(__FILE__).'/../require/class.AIS.php'); |
35 | 39 | require_once(dirname(__FILE__).'/../require/class.MarineImport.php'); |
36 | 40 | } |
37 | 41 | |
38 | -if (!isset($globalDebug)) $globalDebug = FALSE; |
|
42 | +if (!isset($globalDebug)) { |
|
43 | + $globalDebug = FALSE; |
|
44 | +} |
|
39 | 45 | |
40 | 46 | // Check if schema is at latest version |
41 | 47 | $Connection = new Connection(); |
@@ -45,10 +51,16 @@ discard block |
||
45 | 51 | } |
46 | 52 | |
47 | 53 | if (isset($globalServer) && $globalServer) { |
48 | - if ($globalDebug) echo "Using Server Mode\n"; |
|
54 | + if ($globalDebug) { |
|
55 | + echo "Using Server Mode\n"; |
|
56 | + } |
|
49 | 57 | $SI=new SpotterServer(); |
50 | -} else $SI=new SpotterImport($Connection->db); |
|
51 | -if (isset($globalTracker) && $globalTracker) $TI = new TrackerImport($Connection->db); |
|
58 | +} else { |
|
59 | + $SI=new SpotterImport($Connection->db); |
|
60 | +} |
|
61 | +if (isset($globalTracker) && $globalTracker) { |
|
62 | + $TI = new TrackerImport($Connection->db); |
|
63 | +} |
|
52 | 64 | if (isset($globalMarine) && $globalMarine) { |
53 | 65 | $AIS = new AIS(); |
54 | 66 | $MI = new MarineImport($Connection->db); |
@@ -57,7 +69,9 @@ discard block |
||
57 | 69 | date_default_timezone_set('UTC'); |
58 | 70 | |
59 | 71 | $buffer = ''; |
60 | -if (isset($_POST)) $buffer = $_POST; |
|
72 | +if (isset($_POST)) { |
|
73 | + $buffer = $_POST; |
|
74 | +} |
|
61 | 75 | $data = array(); |
62 | 76 | if (isset($buffer['type_event']) && isset($buffer['lat']) && isset($buffer['lon'])) { |
63 | 77 | $data['ident'] = $buffer['device_id']; |
@@ -68,15 +82,27 @@ discard block |
||
68 | 82 | //$data['heading'] = $buffer['cap']; // Only N/S/E/W |
69 | 83 | $data['datetime'] = date('Y-m-d H:i:s',$buffer['timestamp']); |
70 | 84 | $data['comment'] = ''; |
71 | - if (isset($buffer['battery']) && $buffer['battery'] != '') $data['comment'] .= 'Battery: '.$buffer['battery'].'% '; |
|
85 | + if (isset($buffer['battery']) && $buffer['battery'] != '') { |
|
86 | + $data['comment'] .= 'Battery: '.$buffer['battery'].'% '; |
|
87 | + } |
|
72 | 88 | //if (isset($buffer['snr']) && $buffer['snr'] != '') $data['comment'] .= 'SNR: '.$buffer['snr'].' '; |
73 | - if (isset($buffer['temp']) && $buffer['temp'] != '') $data['comment'] .= 'Temperature: '.$buffer['temp'].'°C '; |
|
74 | - if (isset($buffer['press']) && $buffer['press'] != '') $data['comment'] .= 'Pressure: '.$buffer['press'].'hPa '; |
|
89 | + if (isset($buffer['temp']) && $buffer['temp'] != '') { |
|
90 | + $data['comment'] .= 'Temperature: '.$buffer['temp'].'°C '; |
|
91 | + } |
|
92 | + if (isset($buffer['press']) && $buffer['press'] != '') { |
|
93 | + $data['comment'] .= 'Pressure: '.$buffer['press'].'hPa '; |
|
94 | + } |
|
75 | 95 | $TI->add($data); |
76 | 96 | unset($data); |
77 | 97 | } |
78 | -if (isset($SI)) $SI->checkAll(); |
|
79 | -if (isset($MI)) $MI->checkAll(); |
|
80 | -if (isset($TI)) $TI->checkAll(); |
|
98 | +if (isset($SI)) { |
|
99 | + $SI->checkAll(); |
|
100 | +} |
|
101 | +if (isset($MI)) { |
|
102 | + $MI->checkAll(); |
|
103 | +} |
|
104 | +if (isset($TI)) { |
|
105 | + $TI->checkAll(); |
|
106 | +} |
|
81 | 107 | |
82 | 108 | ?> |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | require_once(dirname(__FILE__).'/../require/class.Source.php'); |
10 | 10 | require_once(dirname(__FILE__).'/../require/class.Connection.php'); |
11 | 11 | require_once(dirname(__FILE__).'/../require/class.Common.php'); |
12 | -$Common=new Common(); |
|
12 | +$Common = new Common(); |
|
13 | 13 | $authorize = false; |
14 | 14 | $params = array(); |
15 | 15 | $userip = $Common->getUserIP(); |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | $authorize = true; |
21 | 21 | break; |
22 | 22 | } |
23 | - if ($userip != '' && isset($cb['host']) && in_array($userip,explode(',',$cb['host']))) { |
|
23 | + if ($userip != '' && isset($cb['host']) && in_array($userip, explode(',', $cb['host']))) { |
|
24 | 24 | $params = $globalSources[$key]; |
25 | 25 | $authorize = true; |
26 | 26 | break; |
@@ -46,14 +46,14 @@ discard block |
||
46 | 46 | |
47 | 47 | if (isset($globalServer) && $globalServer) { |
48 | 48 | if ($globalDebug) echo "Using Server Mode\n"; |
49 | - $SI=new SpotterServer(); |
|
50 | -} else $SI=new SpotterImport($Connection->db); |
|
49 | + $SI = new SpotterServer(); |
|
50 | +} else $SI = new SpotterImport($Connection->db); |
|
51 | 51 | if (isset($globalTracker) && $globalTracker) $TI = new TrackerImport($Connection->db); |
52 | 52 | if (isset($globalMarine) && $globalMarine) { |
53 | 53 | $AIS = new AIS(); |
54 | 54 | $MI = new MarineImport($Connection->db); |
55 | 55 | } |
56 | -$Source=new Source($Connection->db); |
|
56 | +$Source = new Source($Connection->db); |
|
57 | 57 | date_default_timezone_set('UTC'); |
58 | 58 | |
59 | 59 | $buffer = ''; |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | $data['altitude'] = round($buffer['altitude']*3.28084); |
67 | 67 | $data['speed'] = $buffer['speed']; |
68 | 68 | //$data['heading'] = $buffer['cap']; // Only N/S/E/W |
69 | - $data['datetime'] = date('Y-m-d H:i:s',$buffer['timestamp']); |
|
69 | + $data['datetime'] = date('Y-m-d H:i:s', $buffer['timestamp']); |
|
70 | 70 | $data['comment'] = ''; |
71 | 71 | if (isset($buffer['battery']) && $buffer['battery'] != '') $data['comment'] .= 'Battery: '.$buffer['battery'].'% '; |
72 | 72 | //if (isset($buffer['snr']) && $buffer['snr'] != '') $data['comment'] .= 'SNR: '.$buffer['snr'].' '; |