@@ -3,8 +3,8 @@ discard block |
||
3 | 3 | require_once('require/class.Spotter.php'); |
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | if (!isset($_GET['country'])) { |
6 | - header('Location: '.$globalURL.'/country'); |
|
7 | - die(); |
|
6 | + header('Location: '.$globalURL.'/country'); |
|
7 | + die(); |
|
8 | 8 | } |
9 | 9 | $Spotter = new Spotter(); |
10 | 10 | $country = ucwords(str_replace("-", " ", urldecode(filter_input(INPUT_GET,'country',FILTER_SANITIZE_STRING)))); |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | include('country-sub-menu.php'); |
52 | 52 | print '<div class="column">'; |
53 | 53 | print '<h2>'._("Most Common Arrival Airports by Country").'</h2>'; |
54 | - print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights of airports & airlines from <strong>%s</strong>."),$country).'</p>'; |
|
54 | + print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights of airports & airlines from <strong>%s</strong>."),$country).'</p>'; |
|
55 | 55 | |
56 | 56 | $airport_country_array = $Spotter->countAllArrivalAirportCountriesByCountry($country); |
57 | 57 | print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>'; |
@@ -7,8 +7,8 @@ discard block |
||
7 | 7 | die(); |
8 | 8 | } |
9 | 9 | $Spotter = new Spotter(); |
10 | -$country = ucwords(str_replace("-", " ", urldecode(filter_input(INPUT_GET,'country',FILTER_SANITIZE_STRING)))); |
|
11 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
10 | +$country = ucwords(str_replace("-", " ", urldecode(filter_input(INPUT_GET, 'country', FILTER_SANITIZE_STRING)))); |
|
11 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
12 | 12 | |
13 | 13 | if (isset($_GET['sort'])) { |
14 | 14 | $spotter_array = $Spotter->getSpotterDataByCountry($country, "0,1", $sort); |
@@ -18,16 +18,16 @@ discard block |
||
18 | 18 | |
19 | 19 | if (!empty($spotter_array)) |
20 | 20 | { |
21 | - $title = sprintf(_("Most Common Arrival Airports by Country from %s"),$country); |
|
21 | + $title = sprintf(_("Most Common Arrival Airports by Country from %s"), $country); |
|
22 | 22 | require_once('header.php'); |
23 | 23 | print '<div class="select-item">'; |
24 | 24 | print '<form action="'.$globalURL.'/country" method="post">'; |
25 | 25 | print '<select name="country" class="selectpicker" data-live-search="true">'; |
26 | 26 | print '<option></option>'; |
27 | 27 | $all_countries = $Spotter->getAllCountries(); |
28 | - foreach($all_countries as $all_country) |
|
28 | + foreach ($all_countries as $all_country) |
|
29 | 29 | { |
30 | - if($country == $all_country['country']) |
|
30 | + if ($country == $all_country['country']) |
|
31 | 31 | { |
32 | 32 | print '<option value="'.strtolower(str_replace(" ", "-", $all_country['country'])).'" selected="selected">'.$all_country['country'].'</option>'; |
33 | 33 | } else { |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | if ($_GET['country'] != "NA") |
43 | 43 | { |
44 | 44 | print '<div class="info column">'; |
45 | - print '<h1>'.sprintf(_("Airports & Airlines from %s"),$country).'</h1>'; |
|
45 | + print '<h1>'.sprintf(_("Airports & Airlines from %s"), $country).'</h1>'; |
|
46 | 46 | print '</div>'; |
47 | 47 | } else { |
48 | 48 | print '<div class="alert alert-warning">'._("This special country profile shows all flights that do <u>not</u> have a country of a airline or departure/arrival airport associated with them.").'</div>'; |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | include('country-sub-menu.php'); |
52 | 52 | print '<div class="column">'; |
53 | 53 | print '<h2>'._("Most Common Arrival Airports by Country").'</h2>'; |
54 | - print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights of airports & airlines from <strong>%s</strong>."),$country).'</p>'; |
|
54 | + print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights of airports & airlines from <strong>%s</strong>."), $country).'</p>'; |
|
55 | 55 | |
56 | 56 | $airport_country_array = $Spotter->countAllArrivalAirportCountriesByCountry($country); |
57 | 57 | print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>'; |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | print '<div id="chartCountry" class="chart" width="100%"></div><script>'; |
62 | 62 | print 'var series = ['; |
63 | 63 | $country_data = ''; |
64 | - foreach($airport_country_array as $airport_item) |
|
64 | + foreach ($airport_country_array as $airport_item) |
|
65 | 65 | { |
66 | 66 | $country_data .= '[ "'.$airport_item['arrival_airport_country_iso3'].'",'.$airport_item['airport_arrival_country_count'].'],'; |
67 | 67 | } |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | print '</thead>'; |
110 | 110 | print '<tbody>'; |
111 | 111 | $i = 1; |
112 | - foreach($airport_country_array as $airport_item) |
|
112 | + foreach ($airport_country_array as $airport_item) |
|
113 | 113 | { |
114 | 114 | print '<tr>'; |
115 | 115 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -5,7 +5,7 @@ |
||
5 | 5 | |
6 | 6 | if ($_POST['registration'] != "") |
7 | 7 | { |
8 | - $registration = filter_input(INPUT_POST,'registration',FILTER_SANITIZE_STRING); |
|
8 | + $registration = filter_input(INPUT_POST, 'registration', FILTER_SANITIZE_STRING); |
|
9 | 9 | header('Location: '.$globalURL.'/registration/'.$registration); |
10 | 10 | } else { |
11 | 11 | if ($globalURL == '') { |
@@ -5,7 +5,7 @@ |
||
5 | 5 | $Spotter = new Spotter(); |
6 | 6 | if ($_GET['flightaware_id'] != "") |
7 | 7 | { |
8 | - $flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING); |
|
8 | + $flightaware_id = filter_input(INPUT_GET, 'flightaware_id', FILTER_SANITIZE_STRING); |
|
9 | 9 | $spotter_id = $Spotter->getSpotterIDBasedOnFlightAwareID($flightaware_id); |
10 | 10 | if ($spotter_id != "") |
11 | 11 | { |
@@ -4,7 +4,7 @@ |
||
4 | 4 | |
5 | 5 | if (isset($_POST['country']) && $_POST['country'] != "") |
6 | 6 | { |
7 | - $country = filter_input(INPUT_POST,'country',FILTER_SANITIZE_STRING); |
|
7 | + $country = filter_input(INPUT_POST, 'country', FILTER_SANITIZE_STRING); |
|
8 | 8 | header('Location: '.$globalURL.'/country/'.$country); |
9 | 9 | } else { |
10 | 10 | if ($globalURL == '') { |
@@ -5,13 +5,13 @@ discard block |
||
5 | 5 | require_once('require/class.Language.php'); |
6 | 6 | require_once('require/class.SpotterArchive.php'); |
7 | 7 | |
8 | -if (!isset($_GET['pilot'])){ |
|
8 | +if (!isset($_GET['pilot'])) { |
|
9 | 9 | header('Location: '.$globalURL.'/'); |
10 | 10 | } else { |
11 | 11 | $Spotter = new Spotter(); |
12 | 12 | $SpotterArchive = new SpotterArchive(); |
13 | 13 | //calculuation for the pagination |
14 | - if(!isset($_GET['limit'])) |
|
14 | + if (!isset($_GET['limit'])) |
|
15 | 15 | { |
16 | 16 | $limit_start = 0; |
17 | 17 | $limit_end = 25; |
@@ -32,29 +32,29 @@ discard block |
||
32 | 32 | |
33 | 33 | $page_url = $globalURL.'/pilot/'.$_GET['pilot']; |
34 | 34 | |
35 | - $pilot = filter_input(INPUT_GET,'pilot',FILTER_SANITIZE_STRING); |
|
36 | - $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
37 | - $year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
|
38 | - $month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT); |
|
35 | + $pilot = filter_input(INPUT_GET, 'pilot', FILTER_SANITIZE_STRING); |
|
36 | + $sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
37 | + $year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT); |
|
38 | + $month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT); |
|
39 | 39 | $filter = array(); |
40 | - if ($year != '') $filter = array_merge($filter,array('year' => $year)); |
|
41 | - if ($month != '') $filter = array_merge($filter,array('month' => $month)); |
|
40 | + if ($year != '') $filter = array_merge($filter, array('year' => $year)); |
|
41 | + if ($month != '') $filter = array_merge($filter, array('month' => $month)); |
|
42 | 42 | if ($sort != '') |
43 | 43 | { |
44 | - $spotter_array = $Spotter->getSpotterDataByPilot($pilot,$limit_start.",".$absolute_difference, $sort,$filter); |
|
44 | + $spotter_array = $Spotter->getSpotterDataByPilot($pilot, $limit_start.",".$absolute_difference, $sort, $filter); |
|
45 | 45 | if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) { |
46 | - $spotter_array = $SpotterArchive->getSpotterDataByPilot($pilot,$limit_start.",".$absolute_difference, $sort,$filter); |
|
46 | + $spotter_array = $SpotterArchive->getSpotterDataByPilot($pilot, $limit_start.",".$absolute_difference, $sort, $filter); |
|
47 | 47 | } |
48 | 48 | } else { |
49 | - $spotter_array = $Spotter->getSpotterDataByPilot($pilot,$limit_start.",".$absolute_difference,'',$filter); |
|
49 | + $spotter_array = $Spotter->getSpotterDataByPilot($pilot, $limit_start.",".$absolute_difference, '', $filter); |
|
50 | 50 | if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) { |
51 | - $spotter_array = $SpotterArchive->getSpotterDataByPilot($pilot,$limit_start.",".$absolute_difference,'',$filter); |
|
51 | + $spotter_array = $SpotterArchive->getSpotterDataByPilot($pilot, $limit_start.",".$absolute_difference, '', $filter); |
|
52 | 52 | } |
53 | 53 | } |
54 | 54 | |
55 | 55 | if (!empty($spotter_array)) |
56 | 56 | { |
57 | - $title = sprintf(_("Detailed View for %s"),$spotter_array[0]['pilot_name']); |
|
57 | + $title = sprintf(_("Detailed View for %s"), $spotter_array[0]['pilot_name']); |
|
58 | 58 | $ident = $spotter_array[0]['ident']; |
59 | 59 | if (isset($spotter_array[0]['latitude'])) $latitude = $spotter_array[0]['latitude']; |
60 | 60 | if (isset($spotter_array[0]['longitude'])) $longitude = $spotter_array[0]['longitude']; |
@@ -115,23 +115,23 @@ discard block |
||
115 | 115 | $Stats = new Stats(); |
116 | 116 | $flights = $Stats->getStatsPilot($pilot); |
117 | 117 | } else $flights = 0; |
118 | - if ($flights == 0) $flights = $Spotter->countFlightsByPilot($pilot,$filter); |
|
118 | + if ($flights == 0) $flights = $Spotter->countFlightsByPilot($pilot, $filter); |
|
119 | 119 | print '<div><span class="label">'._("Flights").'</span>'.$flights.'</div>'; |
120 | - $aircraft_type = count($Spotter->countAllAircraftTypesByPilot($pilot,$filter)); |
|
120 | + $aircraft_type = count($Spotter->countAllAircraftTypesByPilot($pilot, $filter)); |
|
121 | 121 | print '<div><span class="label">'._("Aircrafts type").'</span>'.$aircraft_type.'</div>'; |
122 | - $aircraft_registration = count($Spotter->countAllAircraftRegistrationByPilot($pilot,$filter)); |
|
122 | + $aircraft_registration = count($Spotter->countAllAircraftRegistrationByPilot($pilot, $filter)); |
|
123 | 123 | print '<div><span class="label">'._("Aircrafts").'</span>'.$aircraft_registration.'</div>'; |
124 | - $aircraft_manufacturer = count($Spotter->countAllAircraftManufacturerByPilot($pilot,$filter)); |
|
124 | + $aircraft_manufacturer = count($Spotter->countAllAircraftManufacturerByPilot($pilot, $filter)); |
|
125 | 125 | print '<div><span class="label">'._("Manufacturers").'</span>'.$aircraft_manufacturer.'</div>'; |
126 | - $airlines = count($Spotter->countAllAirlinesByPilot($pilot,$filter)); |
|
126 | + $airlines = count($Spotter->countAllAirlinesByPilot($pilot, $filter)); |
|
127 | 127 | print '<div><span class="label">'._("Airlines").'</span>'.$airlines.'</div>'; |
128 | - $duration = $Spotter->getFlightDurationByPilot($pilot,$filter); |
|
128 | + $duration = $Spotter->getFlightDurationByPilot($pilot, $filter); |
|
129 | 129 | if ($duration != '0') print '<div><span class="label">'._("Total flights spotted duration").'</span>'.$duration.'</div>'; |
130 | 130 | print '</div>'; |
131 | 131 | |
132 | 132 | include('pilot-sub-menu.php'); |
133 | 133 | print '<div class="table column">'; |
134 | - print '<p>'.sprintf(_("The table below shows the detailed information of all flights with the pilot <strong>%s</strong>."),$spotter_array[0]['pilot_name']).'</p>'; |
|
134 | + print '<p>'.sprintf(_("The table below shows the detailed information of all flights with the pilot <strong>%s</strong>."), $spotter_array[0]['pilot_name']).'</p>'; |
|
135 | 135 | |
136 | 136 | include('table-output.php'); |
137 | 137 | print '<div class="pagination">'; |
@@ -37,8 +37,12 @@ discard block |
||
37 | 37 | $year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
38 | 38 | $month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT); |
39 | 39 | $filter = array(); |
40 | - if ($year != '') $filter = array_merge($filter,array('year' => $year)); |
|
41 | - if ($month != '') $filter = array_merge($filter,array('month' => $month)); |
|
40 | + if ($year != '') { |
|
41 | + $filter = array_merge($filter,array('year' => $year)); |
|
42 | + } |
|
43 | + if ($month != '') { |
|
44 | + $filter = array_merge($filter,array('month' => $month)); |
|
45 | + } |
|
42 | 46 | if ($sort != '') |
43 | 47 | { |
44 | 48 | $spotter_array = $Spotter->getSpotterDataByPilot($pilot,$limit_start.",".$absolute_difference, $sort,$filter); |
@@ -56,8 +60,12 @@ discard block |
||
56 | 60 | { |
57 | 61 | $title = sprintf(_("Detailed View for %s"),$spotter_array[0]['pilot_name']); |
58 | 62 | $ident = $spotter_array[0]['ident']; |
59 | - if (isset($spotter_array[0]['latitude'])) $latitude = $spotter_array[0]['latitude']; |
|
60 | - if (isset($spotter_array[0]['longitude'])) $longitude = $spotter_array[0]['longitude']; |
|
63 | + if (isset($spotter_array[0]['latitude'])) { |
|
64 | + $latitude = $spotter_array[0]['latitude']; |
|
65 | + } |
|
66 | + if (isset($spotter_array[0]['longitude'])) { |
|
67 | + $longitude = $spotter_array[0]['longitude']; |
|
68 | + } |
|
61 | 69 | require_once('header.php'); |
62 | 70 | /* |
63 | 71 | if (isset($globalArchive) && $globalArchive) { |
@@ -110,12 +118,18 @@ discard block |
||
110 | 118 | */ |
111 | 119 | print '<div class="info column">'; |
112 | 120 | print '<h1>'.$spotter_array[0]['pilot_name'].'</h1>'; |
113 | - if (isset($spotter_array[0]['pilot_id']) && $spotter_array[0]['pilot_id'] != '') print '<div><span class="label">'._("Pilot ID").'</span>'.$spotter_array[0]['pilot_id'].'</div>'; |
|
121 | + if (isset($spotter_array[0]['pilot_id']) && $spotter_array[0]['pilot_id'] != '') { |
|
122 | + print '<div><span class="label">'._("Pilot ID").'</span>'.$spotter_array[0]['pilot_id'].'</div>'; |
|
123 | + } |
|
114 | 124 | if ($year == '' && $month == '') { |
115 | 125 | $Stats = new Stats(); |
116 | 126 | $flights = $Stats->getStatsPilot($pilot); |
117 | - } else $flights = 0; |
|
118 | - if ($flights == 0) $flights = $Spotter->countFlightsByPilot($pilot,$filter); |
|
127 | + } else { |
|
128 | + $flights = 0; |
|
129 | + } |
|
130 | + if ($flights == 0) { |
|
131 | + $flights = $Spotter->countFlightsByPilot($pilot,$filter); |
|
132 | + } |
|
119 | 133 | print '<div><span class="label">'._("Flights").'</span>'.$flights.'</div>'; |
120 | 134 | $aircraft_type = count($Spotter->countAllAircraftTypesByPilot($pilot,$filter)); |
121 | 135 | print '<div><span class="label">'._("Aircrafts type").'</span>'.$aircraft_type.'</div>'; |
@@ -126,7 +140,9 @@ discard block |
||
126 | 140 | $airlines = count($Spotter->countAllAirlinesByPilot($pilot,$filter)); |
127 | 141 | print '<div><span class="label">'._("Airlines").'</span>'.$airlines.'</div>'; |
128 | 142 | $duration = $Spotter->getFlightDurationByPilot($pilot,$filter); |
129 | - if ($duration != '0') print '<div><span class="label">'._("Total flights spotted duration").'</span>'.$duration.'</div>'; |
|
143 | + if ($duration != '0') { |
|
144 | + print '<div><span class="label">'._("Total flights spotted duration").'</span>'.$duration.'</div>'; |
|
145 | + } |
|
130 | 146 | print '</div>'; |
131 | 147 | |
132 | 148 | include('pilot-sub-menu.php'); |
@@ -5,8 +5,8 @@ |
||
5 | 5 | |
6 | 6 | if (isset($_POST['departure_airport']) && $_POST['departure_airport'] != '') |
7 | 7 | { |
8 | - $departure_airport = filter_input(INPUT_POST,'departure_airport',FILTER_SANITIZE_STRING); |
|
9 | - $arrival_airport = filter_input(INPUT_POST,'arrival_airport',FILTER_SANITIZE_STRING); |
|
8 | + $departure_airport = filter_input(INPUT_POST, 'departure_airport', FILTER_SANITIZE_STRING); |
|
9 | + $arrival_airport = filter_input(INPUT_POST, 'arrival_airport', FILTER_SANITIZE_STRING); |
|
10 | 10 | header('Location: '.$globalURL.'/route/'.$departure_airport.'/'.$arrival_airport); |
11 | 11 | } else { |
12 | 12 | if ($globalURL == '') { |
@@ -3,17 +3,17 @@ discard block |
||
3 | 3 | require_once('require/class.Spotter.php'); |
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | |
6 | -if (!isset($_GET['country'])){ |
|
6 | +if (!isset($_GET['country'])) { |
|
7 | 7 | header('Location: '.$globalURL.''); |
8 | 8 | } else { |
9 | 9 | $Spotter = new Spotter(); |
10 | 10 | //calculuation for the pagination |
11 | - if(!isset($_GET['limit'])) |
|
11 | + if (!isset($_GET['limit'])) |
|
12 | 12 | { |
13 | 13 | $limit_start = 0; |
14 | 14 | $limit_end = 25; |
15 | 15 | $absolute_difference = 25; |
16 | - } else { |
|
16 | + } else { |
|
17 | 17 | $limit_explode = explode(",", $_GET['limit']); |
18 | 18 | if (isset($limit_explode[1])) { |
19 | 19 | $limit_start = $limit_explode[0]; |
@@ -32,10 +32,10 @@ discard block |
||
32 | 32 | $limit_previous_1 = $limit_start - $absolute_difference; |
33 | 33 | $limit_previous_2 = $limit_end - $absolute_difference; |
34 | 34 | |
35 | - $country = ucwords(str_replace("-", " ", urldecode(filter_input(INPUT_GET,'country',FILTER_SANITIZE_STRING)))); |
|
35 | + $country = ucwords(str_replace("-", " ", urldecode(filter_input(INPUT_GET, 'country', FILTER_SANITIZE_STRING)))); |
|
36 | 36 | |
37 | 37 | $page_url = $globalURL.'/country/'.$_GET['country']; |
38 | - $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
38 | + $sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
39 | 39 | if ($country == 'Na') { |
40 | 40 | $spotter_array = array(); |
41 | 41 | } else { |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | |
49 | 49 | if (!empty($spotter_array)) |
50 | 50 | { |
51 | - $title = sprintf(_("Detailed View for Airports & Airlines from %s"),$country); |
|
51 | + $title = sprintf(_("Detailed View for Airports & Airlines from %s"), $country); |
|
52 | 52 | |
53 | 53 | require_once('header.php'); |
54 | 54 | print '<div class="select-item">'; |
@@ -56,9 +56,9 @@ discard block |
||
56 | 56 | print '<select name="country" class="selectpicker" data-live-search="true">'; |
57 | 57 | print '<option></option>'; |
58 | 58 | $all_countries = $Spotter->getAllCountries(); |
59 | - foreach($all_countries as $all_country) |
|
59 | + foreach ($all_countries as $all_country) |
|
60 | 60 | { |
61 | - if($country == $all_country['country']) |
|
61 | + if ($country == $all_country['country']) |
|
62 | 62 | { |
63 | 63 | print '<option value="'.strtolower(str_replace(" ", "-", $all_country['country'])).'" selected="selected">'.$all_country['country'].'</option>'; |
64 | 64 | } else { |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | if ($_GET['country'] != "NA") |
74 | 74 | { |
75 | 75 | print '<div class="info column">'; |
76 | - print '<h1>'.sprintf(_("Airports & Airlines from %s"),$country).'</h1>'; |
|
76 | + print '<h1>'.sprintf(_("Airports & Airlines from %s"), $country).'</h1>'; |
|
77 | 77 | print '</div>'; |
78 | 78 | } else { |
79 | 79 | print '<div class="alert alert-warning">'._("This special country profile shows all flights that do <u>not</u> have a country of a airline or departure/arrival airport associated with them.").'</div>'; |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | |
82 | 82 | include('country-sub-menu.php'); |
83 | 83 | print '<div class="table column">'; |
84 | - print '<p>'.sprintf(_("The table below shows the detailed information of all flights of airports (both departure & arrival) OR airlines from <strong>%s</strong>."),$country).'</p>'; |
|
84 | + print '<p>'.sprintf(_("The table below shows the detailed information of all flights of airports (both departure & arrival) OR airlines from <strong>%s</strong>."), $country).'</p>'; |
|
85 | 85 | |
86 | 86 | include('table-output.php'); |
87 | 87 | print '<div class="pagination">'; |
@@ -13,7 +13,7 @@ |
||
13 | 13 | $limit_start = 0; |
14 | 14 | $limit_end = 25; |
15 | 15 | $absolute_difference = 25; |
16 | - } else { |
|
16 | + } else { |
|
17 | 17 | $limit_explode = explode(",", $_GET['limit']); |
18 | 18 | if (isset($limit_explode[1])) { |
19 | 19 | $limit_start = $limit_explode[0]; |
@@ -5,14 +5,14 @@ discard block |
||
5 | 5 | $Spotter = new Spotter(); |
6 | 6 | if (isset($_GET['start_date'])) { |
7 | 7 | //for the date manipulation into the query |
8 | - if($_GET['start_date'] != "" && $_GET['end_date'] != ""){ |
|
8 | + if ($_GET['start_date'] != "" && $_GET['end_date'] != "") { |
|
9 | 9 | $start_date = $_GET['start_date'].":00"; |
10 | 10 | $end_date = $_GET['end_date'].":00"; |
11 | 11 | $sql_date = $start_date.",".$end_date; |
12 | - } else if($_GET['start_date'] != ""){ |
|
12 | + } else if ($_GET['start_date'] != "") { |
|
13 | 13 | $start_date = $_GET['start_date'].":00"; |
14 | 14 | $sql_date = $start_date; |
15 | - } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){ |
|
15 | + } else if ($_GET['start_date'] == "" && $_GET['end_date'] != "") { |
|
16 | 16 | $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00"; |
17 | 17 | $sql_date = $end_date; |
18 | 18 | } else $sql_date = ''; |
@@ -20,38 +20,38 @@ discard block |
||
20 | 20 | |
21 | 21 | if (isset($_GET['highest_altitude'])) { |
22 | 22 | //for altitude manipulation |
23 | - if($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != ""){ |
|
24 | - $end_altitude = filter_input(INPUT_GET,'highest_altitude',FILTER_SANITIZE_NUMBER_INT); |
|
25 | - $start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT); |
|
23 | + if ($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != "") { |
|
24 | + $end_altitude = filter_input(INPUT_GET, 'highest_altitude', FILTER_SANITIZE_NUMBER_INT); |
|
25 | + $start_altitude = filter_input(INPUT_GET, 'lowest_altitude', FILTER_SANITIZE_NUMBER_INT); |
|
26 | 26 | $sql_altitude = $start_altitude.",".$end_altitude; |
27 | - } else if($_GET['highest_altitude'] != ""){ |
|
28 | - $end_altitude = filter_input(INPUT_GET,'highest_altitude',FILTER_SANITIZE_NUMBER_INT); |
|
27 | + } else if ($_GET['highest_altitude'] != "") { |
|
28 | + $end_altitude = filter_input(INPUT_GET, 'highest_altitude', FILTER_SANITIZE_NUMBER_INT); |
|
29 | 29 | $sql_altitude = $end_altitude; |
30 | - } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){ |
|
31 | - $start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT).",60000"; |
|
30 | + } else if ($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != "") { |
|
31 | + $start_altitude = filter_input(INPUT_GET, 'lowest_altitude', FILTER_SANITIZE_NUMBER_INT).",60000"; |
|
32 | 32 | $sql_altitude = $start_altitude; |
33 | 33 | } else $sql_altitude = ''; |
34 | 34 | } else $sql_altitude = ''; |
35 | 35 | |
36 | 36 | //calculuation for the pagination |
37 | -if(!isset($_GET['limit'])) |
|
37 | +if (!isset($_GET['limit'])) |
|
38 | 38 | { |
39 | 39 | if (!isset($_GET['number_results'])) { |
40 | 40 | $limit_start = 0; |
41 | 41 | $limit_end = 25; |
42 | 42 | $absolute_difference = 25; |
43 | 43 | } else { |
44 | - if ($_GET['number_results'] > 1000){ |
|
44 | + if ($_GET['number_results'] > 1000) { |
|
45 | 45 | $_GET['number_results'] = 1000; |
46 | 46 | } |
47 | 47 | $limit_start = 0; |
48 | - $limit_end = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT); |
|
49 | - $absolute_difference = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT); |
|
48 | + $limit_end = filter_input(INPUT_GET, 'number_results', FILTER_SANITIZE_NUMBER_INT); |
|
49 | + $absolute_difference = filter_input(INPUT_GET, 'number_results', FILTER_SANITIZE_NUMBER_INT); |
|
50 | 50 | } |
51 | -} else { |
|
51 | +} else { |
|
52 | 52 | $limit_explode = explode(",", $_GET['limit']); |
53 | - $limit_start = filter_var($limit_explode[0],FILTER_SANITIZE_NUMBER_INT); |
|
54 | - $limit_end = filter_var($limit_explode[1],FILTER_SANITIZE_NUMBER_INT); |
|
53 | + $limit_start = filter_var($limit_explode[0], FILTER_SANITIZE_NUMBER_INT); |
|
54 | + $limit_end = filter_var($limit_explode[1], FILTER_SANITIZE_NUMBER_INT); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | $absolute_difference = abs($limit_start - $limit_end); |
@@ -68,23 +68,23 @@ discard block |
||
68 | 68 | |
69 | 69 | if (isset($_GET['sort'])) $sort = $_GET['sort']; |
70 | 70 | else $sort = ''; |
71 | -$q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING); |
|
72 | -$registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING); |
|
73 | -$aircraft = filter_input(INPUT_GET,'aircraft',FILTER_SANITIZE_STRING); |
|
74 | -$manufacturer = filter_input(INPUT_GET,'manufacturer',FILTER_SANITIZE_STRING); |
|
75 | -$highlights = filter_input(INPUT_GET,'highlights',FILTER_SANITIZE_STRING); |
|
76 | -$airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
|
77 | -$airline_country = filter_input(INPUT_GET,'airline_country',FILTER_SANITIZE_STRING); |
|
78 | -$airline_type = filter_input(INPUT_GET,'airline_type',FILTER_SANITIZE_STRING); |
|
79 | -$airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING); |
|
80 | -$airport_country = filter_input(INPUT_GET,'airport_country',FILTER_SANITIZE_STRING); |
|
81 | -$callsign = filter_input(INPUT_GET,'callsign',FILTER_SANITIZE_STRING); |
|
82 | -$owner = filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING); |
|
83 | -$pilot_id = filter_input(INPUT_GET,'pilot_id',FILTER_SANITIZE_STRING); |
|
84 | -$pilot_name = filter_input(INPUT_GET,'pilot_name',FILTER_SANITIZE_STRING); |
|
85 | -$departure_airport_route = filter_input(INPUT_GET,'departure_airport_route',FILTER_SANITIZE_STRING); |
|
86 | -$arrival_airport_route = filter_input(INPUT_GET,'arrival_airport_route',FILTER_SANITIZE_STRING); |
|
87 | -$spotter_array = $Spotter->searchSpotterData($q,$registration,$aircraft,strtolower(str_replace("-", " ", $manufacturer)),$highlights,$airline,$airline_country,$airline_type,$airport,$airport_country,$callsign,$departure_airport_route,$arrival_airport_route,$owner,$pilot_id,$pilot_name,$sql_altitude,$sql_date,$limit_start.",".$absolute_difference,$sort,''); |
|
71 | +$q = filter_input(INPUT_GET, 'q', FILTER_SANITIZE_STRING); |
|
72 | +$registration = filter_input(INPUT_GET, 'registratrion', FILTER_SANITIZE_STRING); |
|
73 | +$aircraft = filter_input(INPUT_GET, 'aircraft', FILTER_SANITIZE_STRING); |
|
74 | +$manufacturer = filter_input(INPUT_GET, 'manufacturer', FILTER_SANITIZE_STRING); |
|
75 | +$highlights = filter_input(INPUT_GET, 'highlights', FILTER_SANITIZE_STRING); |
|
76 | +$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING); |
|
77 | +$airline_country = filter_input(INPUT_GET, 'airline_country', FILTER_SANITIZE_STRING); |
|
78 | +$airline_type = filter_input(INPUT_GET, 'airline_type', FILTER_SANITIZE_STRING); |
|
79 | +$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING); |
|
80 | +$airport_country = filter_input(INPUT_GET, 'airport_country', FILTER_SANITIZE_STRING); |
|
81 | +$callsign = filter_input(INPUT_GET, 'callsign', FILTER_SANITIZE_STRING); |
|
82 | +$owner = filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING); |
|
83 | +$pilot_id = filter_input(INPUT_GET, 'pilot_id', FILTER_SANITIZE_STRING); |
|
84 | +$pilot_name = filter_input(INPUT_GET, 'pilot_name', FILTER_SANITIZE_STRING); |
|
85 | +$departure_airport_route = filter_input(INPUT_GET, 'departure_airport_route', FILTER_SANITIZE_STRING); |
|
86 | +$arrival_airport_route = filter_input(INPUT_GET, 'arrival_airport_route', FILTER_SANITIZE_STRING); |
|
87 | +$spotter_array = $Spotter->searchSpotterData($q, $registration, $aircraft, strtolower(str_replace("-", " ", $manufacturer)), $highlights, $airline, $airline_country, $airline_type, $airport, $airport_country, $callsign, $departure_airport_route, $arrival_airport_route, $owner, $pilot_id, $pilot_name, $sql_altitude, $sql_date, $limit_start.",".$absolute_difference, $sort, ''); |
|
88 | 88 | |
89 | 89 | $output = '<?xml version="1.0" encoding="UTF-8"?>'; |
90 | 90 | $output .= '<kml xmlns="http://www.opengis.net/kml/2.2">'; |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | $output .= '</Style>'; |
113 | 113 | |
114 | 114 | if (!empty($spotter_array)) { |
115 | - foreach($spotter_array as $spotter_item) { |
|
115 | + foreach ($spotter_array as $spotter_item) { |
|
116 | 116 | $altitude = $spotter_item['altitude'].'00'; |
117 | 117 | if ($spotter_item['waypoints'] != '') { |
118 | 118 | //waypoint plotting |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | $waypoint_pieces = explode(' ', $spotter_item['waypoints']); |
124 | 124 | $waypoint_pieces = array_chunk($waypoint_pieces, 2); |
125 | 125 | foreach ($waypoint_pieces as $waypoint_coordinate) { |
126 | - if (isset($waypoint_coordinate[1])) $output .= $waypoint_coordinate[1].','.$waypoint_coordinate[0].','.$altitude.' '; |
|
126 | + if (isset($waypoint_coordinate[1])) $output .= $waypoint_coordinate[1].','.$waypoint_coordinate[0].','.$altitude.' '; |
|
127 | 127 | } |
128 | 128 | $output .= '</coordinates>'; |
129 | 129 | $output .= '<altitudeMode>absolute</altitudeMode>'; |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | $output .= ' ]]></description>'; |
168 | 168 | $output .= '<styleUrl>#departureAirport</styleUrl>'; |
169 | 169 | $output .= '<Point>'; |
170 | - $output .= '<coordinates>'.$spotter_item['departure_airport_longitude'].', '.$spotter_item['departure_airport_latitude'].', '.$spotter_item['departure_airport_altitude'].'</coordinates>'; |
|
170 | + $output .= '<coordinates>'.$spotter_item['departure_airport_longitude'].', '.$spotter_item['departure_airport_latitude'].', '.$spotter_item['departure_airport_altitude'].'</coordinates>'; |
|
171 | 171 | $output .= '<altitudeMode>absolute</altitudeMode>'; |
172 | 172 | $output .= '</Point>'; |
173 | 173 | $output .= '</Placemark>'; |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | $output .= ' ]]></description>'; |
209 | 209 | $output .= '<styleUrl>#arrivalAirport</styleUrl>'; |
210 | 210 | $output .= '<Point>'; |
211 | - $output .= '<coordinates>'.$spotter_item['arrival_airport_longitude'].', '.$spotter_item['arrival_airport_latitude'].', '.$spotter_item['arrival_airport_altitude'].'</coordinates>'; |
|
211 | + $output .= '<coordinates>'.$spotter_item['arrival_airport_longitude'].', '.$spotter_item['arrival_airport_latitude'].', '.$spotter_item['arrival_airport_altitude'].'</coordinates>'; |
|
212 | 212 | $output .= '<altitudeMode>absolute</altitudeMode>'; |
213 | 213 | $output .= '</Point>'; |
214 | 214 | $output .= '</Placemark>'; |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | $output .= ' ]]></description>'; |
253 | 253 | $output .= '<styleUrl>#aircraft_'.$spotter_item['spotter_id'].'</styleUrl>'; |
254 | 254 | $output .= '<Point>'; |
255 | - $output .= '<coordinates>'.$spotter_item['longitude'].', '.$spotter_item['latitude'].', '.$altitude.'</coordinates>'; |
|
255 | + $output .= '<coordinates>'.$spotter_item['longitude'].', '.$spotter_item['latitude'].', '.$altitude.'</coordinates>'; |
|
256 | 256 | $output .= '<altitudeMode>absolute</altitudeMode>'; |
257 | 257 | $output .= '</Point>'; |
258 | 258 | $output .= '</Placemark>'; |
@@ -15,8 +15,12 @@ discard block |
||
15 | 15 | } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){ |
16 | 16 | $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00"; |
17 | 17 | $sql_date = $end_date; |
18 | - } else $sql_date = ''; |
|
19 | -} else $sql_date = ''; |
|
18 | + } else { |
|
19 | + $sql_date = ''; |
|
20 | + } |
|
21 | + } else { |
|
22 | + $sql_date = ''; |
|
23 | +} |
|
20 | 24 | |
21 | 25 | if (isset($_GET['highest_altitude'])) { |
22 | 26 | //for altitude manipulation |
@@ -30,8 +34,12 @@ discard block |
||
30 | 34 | } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){ |
31 | 35 | $start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT).",60000"; |
32 | 36 | $sql_altitude = $start_altitude; |
33 | - } else $sql_altitude = ''; |
|
34 | -} else $sql_altitude = ''; |
|
37 | + } else { |
|
38 | + $sql_altitude = ''; |
|
39 | + } |
|
40 | + } else { |
|
41 | + $sql_altitude = ''; |
|
42 | +} |
|
35 | 43 | |
36 | 44 | //calculuation for the pagination |
37 | 45 | if(!isset($_GET['limit'])) |
@@ -48,7 +56,7 @@ discard block |
||
48 | 56 | $limit_end = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT); |
49 | 57 | $absolute_difference = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT); |
50 | 58 | } |
51 | -} else { |
|
59 | +} else { |
|
52 | 60 | $limit_explode = explode(",", $_GET['limit']); |
53 | 61 | $limit_start = filter_var($limit_explode[0],FILTER_SANITIZE_NUMBER_INT); |
54 | 62 | $limit_end = filter_var($limit_explode[1],FILTER_SANITIZE_NUMBER_INT); |
@@ -66,8 +74,11 @@ discard block |
||
66 | 74 | |
67 | 75 | header('Content-Type: text/xml'); |
68 | 76 | |
69 | -if (isset($_GET['sort'])) $sort = $_GET['sort']; |
|
70 | -else $sort = ''; |
|
77 | +if (isset($_GET['sort'])) { |
|
78 | + $sort = $_GET['sort']; |
|
79 | +} else { |
|
80 | + $sort = ''; |
|
81 | +} |
|
71 | 82 | $q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING); |
72 | 83 | $registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING); |
73 | 84 | $aircraft = filter_input(INPUT_GET,'aircraft',FILTER_SANITIZE_STRING); |
@@ -123,7 +134,9 @@ discard block |
||
123 | 134 | $waypoint_pieces = explode(' ', $spotter_item['waypoints']); |
124 | 135 | $waypoint_pieces = array_chunk($waypoint_pieces, 2); |
125 | 136 | foreach ($waypoint_pieces as $waypoint_coordinate) { |
126 | - if (isset($waypoint_coordinate[1])) $output .= $waypoint_coordinate[1].','.$waypoint_coordinate[0].','.$altitude.' '; |
|
137 | + if (isset($waypoint_coordinate[1])) { |
|
138 | + $output .= $waypoint_coordinate[1].','.$waypoint_coordinate[0].','.$altitude.' '; |
|
139 | + } |
|
127 | 140 | } |
128 | 141 | $output .= '</coordinates>'; |
129 | 142 | $output .= '<altitudeMode>absolute</altitudeMode>'; |
@@ -39,30 +39,30 @@ discard block |
||
39 | 39 | |
40 | 40 | |
41 | 41 | function quaternionrotate($heading, $attitude = 0, $bank = 0) { |
42 | - // Assuming the angles are in radians. |
|
43 | - $c1 = cos($heading/2); |
|
44 | - $s1 = sin($heading/2); |
|
45 | - $c2 = cos($attitude/2); |
|
46 | - $s2 = sin($attitude/2); |
|
47 | - $c3 = cos($bank/2); |
|
48 | - $s3 = sin($bank/2); |
|
49 | - $c1c2 = $c1*$c2; |
|
50 | - $s1s2 = $s1*$s2; |
|
51 | - $w =$c1c2*$c3 - $s1s2*$s3; |
|
52 | - $x =$c1c2*$s3 + $s1s2*$c3; |
|
53 | - $y =$s1*$c2*$c3 + $c1*$s2*$s3; |
|
54 | - $z =$c1*$s2*$c3 - $s1*$c2*$s3; |
|
55 | - return array('x' => $x,'y' => $y,'z' => $z,'w' => $w); |
|
42 | + // Assuming the angles are in radians. |
|
43 | + $c1 = cos($heading/2); |
|
44 | + $s1 = sin($heading/2); |
|
45 | + $c2 = cos($attitude/2); |
|
46 | + $s2 = sin($attitude/2); |
|
47 | + $c3 = cos($bank/2); |
|
48 | + $s3 = sin($bank/2); |
|
49 | + $c1c2 = $c1*$c2; |
|
50 | + $s1s2 = $s1*$s2; |
|
51 | + $w =$c1c2*$c3 - $s1s2*$s3; |
|
52 | + $x =$c1c2*$s3 + $s1s2*$c3; |
|
53 | + $y =$s1*$c2*$c3 + $c1*$s2*$s3; |
|
54 | + $z =$c1*$s2*$c3 - $s1*$c2*$s3; |
|
55 | + return array('x' => $x,'y' => $y,'z' => $z,'w' => $w); |
|
56 | 56 | // return array('x' => '0.0','y' => '-0.931','z' => '0.0','w' => '0.365'); |
57 | 57 | |
58 | 58 | } |
59 | 59 | |
60 | 60 | |
61 | 61 | if (isset($_GET['download'])) { |
62 | - if ($_GET['download'] == "true") |
|
63 | - { |
|
62 | + if ($_GET['download'] == "true") |
|
63 | + { |
|
64 | 64 | header('Content-disposition: attachment; filename="flightairmap.json"'); |
65 | - } |
|
65 | + } |
|
66 | 66 | } |
67 | 67 | header('Content-Type: text/javascript'); |
68 | 68 | |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | if (isset($_GET['coord']) && $_GET['coord'] != '') { |
156 | 156 | $coord = explode(',',$_GET['coord']); |
157 | 157 | if (!(filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT) |
158 | - && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) { |
|
158 | + && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) { |
|
159 | 159 | $coord = array(); |
160 | 160 | } |
161 | 161 | } |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | if (isset($_GET['coord']) && $_GET['coord'] != '') { |
166 | 166 | $coord = explode(',',$_GET['coord']); |
167 | 167 | if (!(filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT) |
168 | - && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) { |
|
168 | + && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) { |
|
169 | 169 | $coord = array(); |
170 | 170 | } |
171 | 171 | } |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | if (isset($_GET['coord']) && $_GET['coord'] != '') { |
176 | 176 | $coord = explode(',',$_GET['coord']); |
177 | 177 | if (!(filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT) |
178 | - && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) { |
|
178 | + && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) { |
|
179 | 179 | $coord = array(); |
180 | 180 | } |
181 | 181 | } |
@@ -265,10 +265,10 @@ discard block |
||
265 | 265 | $image = "images/placeholder_thumb.png"; |
266 | 266 | } |
267 | 267 | |
268 | - if (isset($spotter_item['flightaware_id'])) $id = $spotter_item['flightaware_id']; |
|
269 | - elseif (isset($spotter_item['famtrackid'])) $id = $spotter_item['famtrackid']; |
|
270 | - elseif (isset($spotter_item['fammarine_id'])) $id = $spotter_item['fammarine_id']; |
|
271 | - if ($prev_flightaware_id != $id) { |
|
268 | + if (isset($spotter_item['flightaware_id'])) $id = $spotter_item['flightaware_id']; |
|
269 | + elseif (isset($spotter_item['famtrackid'])) $id = $spotter_item['famtrackid']; |
|
270 | + elseif (isset($spotter_item['fammarine_id'])) $id = $spotter_item['fammarine_id']; |
|
271 | + if ($prev_flightaware_id != $id) { |
|
272 | 272 | if ($prev_flightaware_id != '') { |
273 | 273 | /* |
274 | 274 | if ($nblatlong == 1) { |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | $spotter_item['wake_category'] = $aircraft_info[0]['wake_category']; |
349 | 349 | $spotter_item['engine_count'] = $aircraft_info[0]['engine_count']; |
350 | 350 | } else $aircraft_shadow = ''; |
351 | - $output .= ' "billboard" : {"image" : "'.$globalURL.'/images/aircrafts/new/'.$aircraft_shadow.'","scale" : 0.5'; |
|
351 | + $output .= ' "billboard" : {"image" : "'.$globalURL.'/images/aircrafts/new/'.$aircraft_shadow.'","scale" : 0.5'; |
|
352 | 352 | if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true' && isset($_COOKIE['IconColor'])) { |
353 | 353 | $rgb = $Common->hex2rgb($_COOKIE['IconColor']); |
354 | 354 | $output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}'; |
@@ -379,7 +379,7 @@ discard block |
||
379 | 379 | $rgb = $Common->hex2rgb($_COOKIE['IconColor']); |
380 | 380 | $output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}'; |
381 | 381 | } |
382 | - $output .= '},'; |
|
382 | + $output .= '},'; |
|
383 | 383 | } elseif (isset($modelsdb[$aircraft_icao]) && $aircraft_icao != '') { |
384 | 384 | $output .= '"model": {"gltf" : "'.$globalURL.'/models/'.$modelsdb[$aircraft_icao].'","scale" : 1.0,"minimumPixelSize": 20'; |
385 | 385 | $output .= ',"heightReference": "'.$heightrelative.'"'; |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | $rgb = $Common->hex2rgb($_COOKIE['IconColor']); |
388 | 388 | $output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}'; |
389 | 389 | } |
390 | - $output .= '},'; |
|
390 | + $output .= '},'; |
|
391 | 391 | } elseif ($aircraft_icao != '') { |
392 | 392 | $aircraft_info = $Spotter->getAllAircraftInfo($aircraft_icao); |
393 | 393 | if (isset($aircraft_info[0]['engine_type'])) { |
@@ -56,11 +56,11 @@ discard block |
||
56 | 56 | $s3 = sin($bank/2); |
57 | 57 | $c1c2 = $c1*$c2; |
58 | 58 | $s1s2 = $s1*$s2; |
59 | - $w =$c1c2*$c3 - $s1s2*$s3; |
|
60 | - $x =$c1c2*$s3 + $s1s2*$c3; |
|
61 | - $y =$s1*$c2*$c3 + $c1*$s2*$s3; |
|
62 | - $z =$c1*$s2*$c3 - $s1*$c2*$s3; |
|
63 | - return array('x' => $x,'y' => $y,'z' => $z,'w' => $w); |
|
59 | + $w = $c1c2*$c3 - $s1s2*$s3; |
|
60 | + $x = $c1c2*$s3 + $s1s2*$c3; |
|
61 | + $y = $s1*$c2*$c3 + $c1*$s2*$s3; |
|
62 | + $z = $c1*$s2*$c3 - $s1*$c2*$s3; |
|
63 | + return array('x' => $x, 'y' => $y, 'z' => $z, 'w' => $w); |
|
64 | 64 | // return array('x' => '0.0','y' => '-0.931','z' => '0.0','w' => '0.365'); |
65 | 65 | |
66 | 66 | } |
@@ -81,17 +81,17 @@ discard block |
||
81 | 81 | $min = false; |
82 | 82 | $allhistory = false; |
83 | 83 | $filter['source'] = array(); |
84 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
85 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
86 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
87 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs')); |
|
88 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
89 | -if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
90 | -if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING); |
|
91 | -if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
92 | -if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
93 | -if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
94 | -if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING); |
|
84 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'], array('vatsimtxt')); |
|
85 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'], array('whazzup')); |
|
86 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'], array('phpvmacars')); |
|
87 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'], array('sbs', 'famaprs')); |
|
88 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'], array('aprs')); |
|
89 | +if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'], FILTER_SANITIZE_STRING); |
|
90 | +if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'], FILTER_SANITIZE_STRING); |
|
91 | +if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',', $_COOKIE['filter_Airlines']), FILTER_SANITIZE_STRING); |
|
92 | +if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',', $_COOKIE['filter_Sources']), FILTER_SANITIZE_STRING); |
|
93 | +if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'], FILTER_SANITIZE_STRING); |
|
94 | +if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'], FILTER_SANITIZE_STRING); |
|
95 | 95 | /* |
96 | 96 | if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) { |
97 | 97 | $min = true; |
@@ -138,12 +138,12 @@ discard block |
||
138 | 138 | $from_archive = true; |
139 | 139 | // $begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
140 | 140 | // $enddate = filter_input(INPUT_GET,'enddate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
141 | - $begindate = filter_input(INPUT_GET,'begindate',FILTER_SANITIZE_NUMBER_INT); |
|
142 | - $enddate = filter_input(INPUT_GET,'enddate',FILTER_SANITIZE_NUMBER_INT); |
|
143 | - $archivespeed = filter_input(INPUT_GET,'speed',FILTER_SANITIZE_NUMBER_INT); |
|
144 | - $begindate = date('Y-m-d H:i:s',$begindate); |
|
145 | - $enddate = date('Y-m-d H:i:s',$enddate); |
|
146 | - $spotter_array = $SpotterArchive->getMinLiveSpotterDataPlayback($begindate,$enddate,$filter); |
|
141 | + $begindate = filter_input(INPUT_GET, 'begindate', FILTER_SANITIZE_NUMBER_INT); |
|
142 | + $enddate = filter_input(INPUT_GET, 'enddate', FILTER_SANITIZE_NUMBER_INT); |
|
143 | + $archivespeed = filter_input(INPUT_GET, 'speed', FILTER_SANITIZE_NUMBER_INT); |
|
144 | + $begindate = date('Y-m-d H:i:s', $begindate); |
|
145 | + $enddate = date('Y-m-d H:i:s', $enddate); |
|
146 | + $spotter_array = $SpotterArchive->getMinLiveSpotterDataPlayback($begindate, $enddate, $filter); |
|
147 | 147 | } elseif (isset($_COOKIE['archive']) && isset($_COOKIE['archive_begin']) && isset($_COOKIE['archive_end']) && isset($_COOKIE['archive_speed'])) { |
148 | 148 | $from_archive = true; |
149 | 149 | // $begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
@@ -153,46 +153,46 @@ discard block |
||
153 | 153 | $begindate = $_COOKIE['archive_begin']; |
154 | 154 | $enddate = $_COOKIE['archive_end']; |
155 | 155 | |
156 | - $archivespeed = filter_var($_COOKIE['archive_speed'],FILTER_SANITIZE_NUMBER_INT); |
|
157 | - $begindate = date('Y-m-d H:i:s',$begindate); |
|
158 | - $enddate = date('Y-m-d H:i:s',$enddate); |
|
156 | + $archivespeed = filter_var($_COOKIE['archive_speed'], FILTER_SANITIZE_NUMBER_INT); |
|
157 | + $begindate = date('Y-m-d H:i:s', $begindate); |
|
158 | + $enddate = date('Y-m-d H:i:s', $enddate); |
|
159 | 159 | // echo 'Begin : '.$begindate.' - End : '.$enddate."\n"; |
160 | - $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate,$enddate,$filter); |
|
160 | + $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate, $enddate, $filter); |
|
161 | 161 | } elseif ($tracker) { |
162 | 162 | $coord = array(); |
163 | 163 | if (isset($_GET['coord']) && $_GET['coord'] != '') { |
164 | - $coord = explode(',',$_GET['coord']); |
|
165 | - if (!(filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT) |
|
164 | + $coord = explode(',', $_GET['coord']); |
|
165 | + if (!(filter_var($coord[0], FILTER_VALIDATE_FLOAT) && filter_var($coord[1], FILTER_VALIDATE_FLOAT) && filter_var($coord[2], FILTER_VALIDATE_FLOAT) && filter_var($coord[3], FILTER_VALIDATE_FLOAT) |
|
166 | 166 | && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) { |
167 | 167 | $coord = array(); |
168 | 168 | } |
169 | 169 | } |
170 | - $spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord,$filter,true); |
|
170 | + $spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord, $filter, true); |
|
171 | 171 | } elseif ($marine) { |
172 | 172 | $coord = array(); |
173 | 173 | if (isset($_GET['coord']) && $_GET['coord'] != '') { |
174 | - $coord = explode(',',$_GET['coord']); |
|
175 | - if (!(filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT) |
|
174 | + $coord = explode(',', $_GET['coord']); |
|
175 | + if (!(filter_var($coord[0], FILTER_VALIDATE_FLOAT) && filter_var($coord[1], FILTER_VALIDATE_FLOAT) && filter_var($coord[2], FILTER_VALIDATE_FLOAT) && filter_var($coord[3], FILTER_VALIDATE_FLOAT) |
|
176 | 176 | && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) { |
177 | 177 | $coord = array(); |
178 | 178 | } |
179 | 179 | } |
180 | - $spotter_array = $MarineLive->getMinLastLiveMarineData($coord,$filter,true); |
|
180 | + $spotter_array = $MarineLive->getMinLastLiveMarineData($coord, $filter, true); |
|
181 | 181 | } else { |
182 | 182 | $coord = array(); |
183 | 183 | if (isset($_GET['coord']) && $_GET['coord'] != '') { |
184 | - $coord = explode(',',$_GET['coord']); |
|
185 | - if (!(filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT) |
|
184 | + $coord = explode(',', $_GET['coord']); |
|
185 | + if (!(filter_var($coord[0], FILTER_VALIDATE_FLOAT) && filter_var($coord[1], FILTER_VALIDATE_FLOAT) && filter_var($coord[2], FILTER_VALIDATE_FLOAT) && filter_var($coord[3], FILTER_VALIDATE_FLOAT) |
|
186 | 186 | && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) { |
187 | 187 | $coord = array(); |
188 | 188 | } |
189 | 189 | } |
190 | - $spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord,$filter,true); |
|
190 | + $spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord, $filter, true); |
|
191 | 191 | } |
192 | 192 | //print_r($spotter_array); |
193 | 193 | if (!empty($spotter_array) && isset($coord)) { |
194 | 194 | if (isset($_GET['archive'])) { |
195 | - $flightcnt = $SpotterArchive->getLiveSpotterCount($begindate,$enddate,$filter); |
|
195 | + $flightcnt = $SpotterArchive->getLiveSpotterCount($begindate, $enddate, $filter); |
|
196 | 196 | } elseif ($tracker) { |
197 | 197 | $flightcnt = $TrackerLive->getLiveTrackerCount($filter); |
198 | 198 | } elseif ($marine) { |
@@ -203,15 +203,15 @@ discard block |
||
203 | 203 | if ($flightcnt == '') $flightcnt = 0; |
204 | 204 | } else $flightcnt = 0; |
205 | 205 | |
206 | -$sqltime = round(microtime(true)-$begintime,2); |
|
206 | +$sqltime = round(microtime(true) - $begintime, 2); |
|
207 | 207 | $minitime = time(); |
208 | 208 | $maxitime = 0; |
209 | -$lastupdate = filter_input(INPUT_GET,'update',FILTER_SANITIZE_NUMBER_INT); |
|
209 | +$lastupdate = filter_input(INPUT_GET, 'update', FILTER_SANITIZE_NUMBER_INT); |
|
210 | 210 | $modelsdb = array(); |
211 | 211 | if (file_exists(dirname(__FILE__).'/models/modelsdb')) { |
212 | - if (($handle = fopen(dirname(__FILE__).'/models/modelsdb','r')) !== FALSE) { |
|
213 | - while (($row = fgetcsv($handle,1000)) !== FALSE) { |
|
214 | - if (isset($row[1]) ){ |
|
212 | + if (($handle = fopen(dirname(__FILE__).'/models/modelsdb', 'r')) !== FALSE) { |
|
213 | + while (($row = fgetcsv($handle, 1000)) !== FALSE) { |
|
214 | + if (isset($row[1])) { |
|
215 | 215 | $model = $row[0]; |
216 | 216 | $modelsdb[$model] = $row[1]; |
217 | 217 | } |
@@ -221,9 +221,9 @@ discard block |
||
221 | 221 | } |
222 | 222 | $modelsdb2 = array(); |
223 | 223 | if (file_exists(dirname(__FILE__).'/models/gltf2/modelsdb')) { |
224 | - if (($handle = fopen(dirname(__FILE__).'/models/gltf2/modelsdb','r')) !== FALSE) { |
|
225 | - while (($row = fgetcsv($handle,1000)) !== FALSE) { |
|
226 | - if (isset($row[1]) ){ |
|
224 | + if (($handle = fopen(dirname(__FILE__).'/models/gltf2/modelsdb', 'r')) !== FALSE) { |
|
225 | + while (($row = fgetcsv($handle, 1000)) !== FALSE) { |
|
226 | + if (isset($row[1])) { |
|
227 | 227 | $model = $row[0]; |
228 | 228 | $modelsdb2[$model] = $row[1]; |
229 | 229 | } |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | if (!empty($spotter_array) && is_array($spotter_array)) |
262 | 262 | { |
263 | 263 | $nblatlong = 0; |
264 | - foreach($spotter_array as $spotter_item) |
|
264 | + foreach ($spotter_array as $spotter_item) |
|
265 | 265 | { |
266 | 266 | $j++; |
267 | 267 | //if (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'airwhere') $heightrelative = 'RELATIVE_TO_GROUND'; |
@@ -303,9 +303,9 @@ discard block |
||
303 | 303 | $output .= '"lastupdate": "'.$lastupdate.'",'; |
304 | 304 | if (isset($spotter_item['format_source'])) $output .= '"format": "'.$spotter_item['format_source'].'",'; |
305 | 305 | if ($tracker) { |
306 | - $output.= '"type": "tracker"'; |
|
306 | + $output .= '"type": "tracker"'; |
|
307 | 307 | } elseif ($marine) { |
308 | - $output.= '"type": "marine"'; |
|
308 | + $output .= '"type": "marine"'; |
|
309 | 309 | } else { |
310 | 310 | if (isset($globalMap3DLiveries) && $globalMap3DLiveries) { |
311 | 311 | $aircraft_icao = $spotter_item['aircraft_icao']; |
@@ -319,14 +319,14 @@ discard block |
||
319 | 319 | if (isset($airline_icao)) { |
320 | 320 | $imagefile = $aircraft_icao.'-'.$airline_icao.'.png'; |
321 | 321 | if (file_exists(dirname(__FILE__).'/models/gltf2/liveries/'.$imagefile)) { |
322 | - $output.= '"liveries": "'.$globalURL.'/models/gltf2/liveries/'.$imagefile.'",'; |
|
322 | + $output .= '"liveries": "'.$globalURL.'/models/gltf2/liveries/'.$imagefile.'",'; |
|
323 | 323 | } |
324 | 324 | } |
325 | 325 | } |
326 | - if ($ident != '') $output.= '"ident": "'.$ident.'",'; |
|
326 | + if ($ident != '') $output .= '"ident": "'.$ident.'",'; |
|
327 | 327 | } |
328 | - $output.= '"gltf2": %gltf2%,'; |
|
329 | - $output.= '"type": "flight"'; |
|
328 | + $output .= '"gltf2": %gltf2%,'; |
|
329 | + $output .= '"type": "flight"'; |
|
330 | 330 | } |
331 | 331 | $output .= '},'; |
332 | 332 | |
@@ -679,8 +679,8 @@ discard block |
||
679 | 679 | $output .= '},'; |
680 | 680 | } |
681 | 681 | } |
682 | - if (isset($onground) && $onground) $output = str_replace('%onground%','true',$output); |
|
683 | - else $output = str_replace('%onground%','false',$output); |
|
682 | + if (isset($onground) && $onground) $output = str_replace('%onground%', 'true', $output); |
|
683 | + else $output = str_replace('%onground%', 'false', $output); |
|
684 | 684 | |
685 | 685 | // $output .= '"heightReference": "CLAMP_TO_GROUND",'; |
686 | 686 | //$output .= '"heightReference": "'.$heightrelative.'",'; |
@@ -695,7 +695,7 @@ discard block |
||
695 | 695 | $output .= '"cartographicDegrees": ['; |
696 | 696 | if ($minitime > strtotime($spotter_item['date'])) $minitime = strtotime($spotter_item['date']); |
697 | 697 | if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']); |
698 | - $output .= '"'.date("c",strtotime($spotter_item['date'])).'", '; |
|
698 | + $output .= '"'.date("c", strtotime($spotter_item['date'])).'", '; |
|
699 | 699 | $output .= $spotter_item['longitude'].', '; |
700 | 700 | $output .= $spotter_item['latitude']; |
701 | 701 | $prevlong = $spotter_item['longitude']; |
@@ -723,8 +723,8 @@ discard block |
||
723 | 723 | //$quat = quaternionrotate(deg2rad($spotter_item['heading']),deg2rad(0),deg2rad(0)); |
724 | 724 | //$orientation .= '"'.date("c",strtotime($spotter_item['date'])).'",'.$quat['x'].','.$quat['y'].','.$quat['z'].','.$quat['w']; |
725 | 725 | } else { |
726 | - $nblatlong = $nblatlong+1; |
|
727 | - $output .= ',"'.date("c",strtotime($spotter_item['date'])).'", '; |
|
726 | + $nblatlong = $nblatlong + 1; |
|
727 | + $output .= ',"'.date("c", strtotime($spotter_item['date'])).'", '; |
|
728 | 728 | if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']); |
729 | 729 | if ($spotter_item['ground_speed'] == 0) { |
730 | 730 | $output .= $prevlong.', '; |
@@ -764,17 +764,17 @@ discard block |
||
764 | 764 | } |
765 | 765 | $output .= ']'; |
766 | 766 | if (isset($globalArchive) && $globalArchive === TRUE) { |
767 | - if ((time()-$globalLiveInterval) > $minitime) { |
|
768 | - if (time()-$globalLiveInterval > $maxitime) { |
|
769 | - $output = str_replace('%minitime%',date("c",$maxitime),$output); |
|
767 | + if ((time() - $globalLiveInterval) > $minitime) { |
|
768 | + if (time() - $globalLiveInterval > $maxitime) { |
|
769 | + $output = str_replace('%minitime%', date("c", $maxitime), $output); |
|
770 | 770 | } else { |
771 | - $output = str_replace('%minitime%',date("c",time()-$globalLiveInterval),$output); |
|
771 | + $output = str_replace('%minitime%', date("c", time() - $globalLiveInterval), $output); |
|
772 | 772 | } |
773 | 773 | } |
774 | - else $output = str_replace('%minitime%',date("c",$minitime),$output); |
|
775 | -} else $output = str_replace('%minitime%',date("c",$minitime),$output); |
|
776 | -$output = str_replace('%maxitime%',date("c",$maxitime),$output); |
|
777 | -if ($gltf2) $output = str_replace('%gltf2%','true',$output); |
|
778 | -else $output = str_replace('%gltf2%','false',$output); |
|
774 | + else $output = str_replace('%minitime%', date("c", $minitime), $output); |
|
775 | +} else $output = str_replace('%minitime%', date("c", $minitime), $output); |
|
776 | +$output = str_replace('%maxitime%', date("c", $maxitime), $output); |
|
777 | +if ($gltf2) $output = str_replace('%gltf2%', 'true', $output); |
|
778 | +else $output = str_replace('%gltf2%', 'false', $output); |
|
779 | 779 | print $output; |
780 | 780 | ?> |
@@ -16,8 +16,12 @@ discard block |
||
16 | 16 | } |
17 | 17 | $tracker = false; |
18 | 18 | $marine = false; |
19 | -if (isset($_GET['tracker'])) $tracker = true; |
|
20 | -if (isset($_GET['marine'])) $marine = true; |
|
19 | +if (isset($_GET['tracker'])) { |
|
20 | + $tracker = true; |
|
21 | +} |
|
22 | +if (isset($_GET['marine'])) { |
|
23 | + $marine = true; |
|
24 | +} |
|
21 | 25 | if ($tracker) { |
22 | 26 | require_once('require/class.Tracker.php'); |
23 | 27 | require_once('require/class.TrackerLive.php'); |
@@ -74,24 +78,49 @@ discard block |
||
74 | 78 | } |
75 | 79 | header('Content-Type: text/javascript'); |
76 | 80 | |
77 | -if (!isset($globalJsonCompress)) $compress = true; |
|
78 | -else $compress = $globalJsonCompress; |
|
81 | +if (!isset($globalJsonCompress)) { |
|
82 | + $compress = true; |
|
83 | +} else { |
|
84 | + $compress = $globalJsonCompress; |
|
85 | +} |
|
79 | 86 | |
80 | 87 | $from_archive = false; |
81 | 88 | $min = false; |
82 | 89 | $allhistory = false; |
83 | 90 | $filter['source'] = array(); |
84 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
85 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
86 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
87 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs')); |
|
88 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
89 | -if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
90 | -if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING); |
|
91 | -if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
92 | -if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
93 | -if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
94 | -if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING); |
|
91 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') { |
|
92 | + $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
93 | +} |
|
94 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') { |
|
95 | + $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
96 | +} |
|
97 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') { |
|
98 | + $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
99 | +} |
|
100 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') { |
|
101 | + $filter['source'] = array_merge($filter['source'],array('sbs','famaprs')); |
|
102 | +} |
|
103 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') { |
|
104 | + $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
105 | +} |
|
106 | +if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') { |
|
107 | + $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
108 | +} |
|
109 | +if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') { |
|
110 | + $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING); |
|
111 | +} |
|
112 | +if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') { |
|
113 | + $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
114 | +} |
|
115 | +if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') { |
|
116 | + $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
117 | +} |
|
118 | +if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') { |
|
119 | + $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
120 | +} |
|
121 | +if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') { |
|
122 | + $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING); |
|
123 | +} |
|
95 | 124 | /* |
96 | 125 | if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) { |
97 | 126 | $min = true; |
@@ -200,8 +229,12 @@ discard block |
||
200 | 229 | } else { |
201 | 230 | $flightcnt = $SpotterLive->getLiveSpotterCount($filter); |
202 | 231 | } |
203 | - if ($flightcnt == '') $flightcnt = 0; |
|
204 | -} else $flightcnt = 0; |
|
232 | + if ($flightcnt == '') { |
|
233 | + $flightcnt = 0; |
|
234 | + } |
|
235 | + } else { |
|
236 | + $flightcnt = 0; |
|
237 | +} |
|
205 | 238 | |
206 | 239 | $sqltime = round(microtime(true)-$begintime,2); |
207 | 240 | $minitime = time(); |
@@ -237,7 +270,9 @@ discard block |
||
237 | 270 | $prev_flightaware_id = ''; |
238 | 271 | $speed = 1; |
239 | 272 | $gltf2 = false; |
240 | -if (isset($archivespeed)) $speed = $archivespeed; |
|
273 | +if (isset($archivespeed)) { |
|
274 | + $speed = $archivespeed; |
|
275 | +} |
|
241 | 276 | $output = '['; |
242 | 277 | if ($tracker) { |
243 | 278 | $output .= '{"id" : "document", "name" : "tracker","version" : "1.0"'; |
@@ -273,9 +308,13 @@ discard block |
||
273 | 308 | $image = "images/placeholder_thumb.png"; |
274 | 309 | } |
275 | 310 | |
276 | - if (isset($spotter_item['flightaware_id'])) $id = $spotter_item['flightaware_id']; |
|
277 | - elseif (isset($spotter_item['famtrackid'])) $id = $spotter_item['famtrackid']; |
|
278 | - elseif (isset($spotter_item['fammarine_id'])) $id = $spotter_item['fammarine_id']; |
|
311 | + if (isset($spotter_item['flightaware_id'])) { |
|
312 | + $id = $spotter_item['flightaware_id']; |
|
313 | + } elseif (isset($spotter_item['famtrackid'])) { |
|
314 | + $id = $spotter_item['famtrackid']; |
|
315 | + } elseif (isset($spotter_item['fammarine_id'])) { |
|
316 | + $id = $spotter_item['fammarine_id']; |
|
317 | + } |
|
279 | 318 | if ($prev_flightaware_id != $id) { |
280 | 319 | if ($prev_flightaware_id != '') { |
281 | 320 | /* |
@@ -301,7 +340,9 @@ discard block |
||
301 | 340 | $output .= '"flightcnt": "'.$flightcnt.'",'; |
302 | 341 | $output .= '"onground": %onground%,'; |
303 | 342 | $output .= '"lastupdate": "'.$lastupdate.'",'; |
304 | - if (isset($spotter_item['format_source'])) $output .= '"format": "'.$spotter_item['format_source'].'",'; |
|
343 | + if (isset($spotter_item['format_source'])) { |
|
344 | + $output .= '"format": "'.$spotter_item['format_source'].'",'; |
|
345 | + } |
|
305 | 346 | if ($tracker) { |
306 | 347 | $output.= '"type": "tracker"'; |
307 | 348 | } elseif ($marine) { |
@@ -323,7 +364,9 @@ discard block |
||
323 | 364 | } |
324 | 365 | } |
325 | 366 | } |
326 | - if ($ident != '') $output.= '"ident": "'.$ident.'",'; |
|
367 | + if ($ident != '') { |
|
368 | + $output.= '"ident": "'.$ident.'",'; |
|
369 | + } |
|
327 | 370 | } |
328 | 371 | $output.= '"gltf2": %gltf2%,'; |
329 | 372 | $output.= '"type": "flight"'; |
@@ -355,7 +398,9 @@ discard block |
||
355 | 398 | $spotter_item['engine_type'] = $aircraft_info[0]['engine_type']; |
356 | 399 | $spotter_item['wake_category'] = $aircraft_info[0]['wake_category']; |
357 | 400 | $spotter_item['engine_count'] = $aircraft_info[0]['engine_count']; |
358 | - } else $aircraft_shadow = ''; |
|
401 | + } else { |
|
402 | + $aircraft_shadow = ''; |
|
403 | + } |
|
359 | 404 | $output .= ' "billboard" : {"image" : "'.$globalURL.'/images/aircrafts/new/'.$aircraft_shadow.'","scale" : 0.5'; |
360 | 405 | if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true' && isset($_COOKIE['IconColor'])) { |
361 | 406 | $rgb = $Common->hex2rgb($_COOKIE['IconColor']); |
@@ -363,7 +408,9 @@ discard block |
||
363 | 408 | } |
364 | 409 | $output .= '},'; |
365 | 410 | } |
366 | - } else $output .= ' "billboard" : {"image" : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUg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OCoAl/gIPA5MA64FVgGnNhP292W3r0SeB1YVlJXAjcBP8XwyQUj9AKwAzg2+/fQSsBhoJxBAaALaIzenZGnD911wA7gEDAD2FFSpwOzgDHZ5T7+ZSlGd2d6AXgi5+qAn+O5U0PbBVwKtAD3AHuB8f3YGBUdncCGoQ4LE9XtGRqK9LnduVPRIu2BPqwD65IYbS7Qpql7Ql9YoJcy9bwzkgPrfOCj5G33+h54E/g0PAr5thq4ApgyEgNrc27aWwVaPTA1QJ4BjgTGFvhteV40EgPrgvTP7qlmZqFnl9WD+b2posN83E/NrEkOjlI/U1fkfUYa/pe5IE3qZPW8jFOqiyN7p3pAPX04c7AxYSoDDcAjKT2LgLXA6IR2M3Bviv59wDTgQGTPH84Qd8+HXfHcoUws2zM0HMjuUPep+xP2PWpnwtw0GJsldbBpewQwE/gbeDyt7H1gcW53O7AC+A3Yn6+/W+Ld9SnWA15DAVhc8xK2TuA9YHrCuhV4EngFuBx4YagG6qv8cF+T52kB2Zy+e1I8taUacNV+uBdXO7ABmJwJpwx8XQvF9TUCWM64tiQhbq/oMv+7BwFWpQzNT8vbVQul/wwAGzzdmXU1xuUAAAAASUVORK5CYII=","scale" : 0.5},'; |
|
411 | + } else { |
|
412 | + $output .= ' "billboard" : {"image" : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAfCAYAAACVgY94AAAACXBIWXMAAC4jAAAuIwF4pT92AAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+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DcAjKT2LgLXA6IR2M3Bviv59wDTgQGTPH84Qd8+HXfHcoUws2zM0HMjuUPep+xP2PWpnwtw0GJsldbBpewQwE/gbeDyt7H1gcW53O7AC+A3Yn6+/W+Ld9SnWA15DAVhc8xK2TuA9YHrCuhV4EngFuBx4YagG6qv8cF+T52kB2Zy+e1I8taUacNV+uBdXO7ABmJwJpwx8XQvF9TUCWM64tiQhbq/oMv+7BwFWpQzNT8vbVQul/wwAGzzdmXU1xuUAAAAASUVORK5CYII=","scale" : 0.5},'; |
|
413 | + } |
|
367 | 414 | } elseif ($one3dmodel) { |
368 | 415 | if (isset($globalMap3DForceModel) && $globalMap3DForceModel != '') { |
369 | 416 | $output .= '"model": {"gltf" : "'.$globalURL.'/models/'.$globalMap3DForceModel.'","scale" : 1.0,"minimumPixelSize": 20'; |
@@ -403,7 +450,9 @@ discard block |
||
403 | 450 | $spotter_item['engine_type'] = $aircraft_info[0]['engine_type']; |
404 | 451 | $spotter_item['wake_category'] = $aircraft_info[0]['wake_category']; |
405 | 452 | $spotter_item['engine_count'] = $aircraft_info[0]['engine_count']; |
406 | - } else $aircraft_shadow = ''; |
|
453 | + } else { |
|
454 | + $aircraft_shadow = ''; |
|
455 | + } |
|
407 | 456 | if ($aircraft_shadow != '') { |
408 | 457 | if (isset($modelsdb[$aircraft_shadow])) { |
409 | 458 | $output .= '"model": {"gltf" : "'.$globalURL.'/models/'.$modelsdb[$aircraft_shadow].'","scale" : 1.0,"minimumPixelSize": 20'; |
@@ -540,7 +589,9 @@ discard block |
||
540 | 589 | } |
541 | 590 | $output .= '},'; |
542 | 591 | //if ($spotter_item['aircraft_shadow'] != '') $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",'; |
543 | - if ($spotter_item['aircraft_icao'] != '') $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
592 | + if ($spotter_item['aircraft_icao'] != '') { |
|
593 | + $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
594 | + } |
|
544 | 595 | $modelsdb[$aircraft_icao] = 'Cesium_Air.glb'; |
545 | 596 | } |
546 | 597 | } elseif (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'aprs') { |
@@ -562,7 +613,9 @@ discard block |
||
562 | 613 | } |
563 | 614 | $output .= '},'; |
564 | 615 | //if ($spotter_item['aircraft_shadow'] != '') $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",'; |
565 | - if ($spotter_item['aircraft_icao'] != '') $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
616 | + if ($spotter_item['aircraft_icao'] != '') { |
|
617 | + $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
618 | + } |
|
566 | 619 | $modelsdb[$aircraft_icao] = 'Cesium_Air.glb'; |
567 | 620 | } |
568 | 621 | } else { |
@@ -575,7 +628,9 @@ discard block |
||
575 | 628 | } |
576 | 629 | $output .= '},'; |
577 | 630 | //if ($spotter_item['aircraft_shadow'] != '') $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",'; |
578 | - if ($spotter_item['aircraft_icao'] != '') $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
631 | + if ($spotter_item['aircraft_icao'] != '') { |
|
632 | + $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",'; |
|
633 | + } |
|
579 | 634 | $modelsdb[$aircraft_icao] = 'Cesium_Air.glb'; |
580 | 635 | } |
581 | 636 | } elseif ($tracker && isset($spotter_item['type'])) { |
@@ -679,8 +734,11 @@ discard block |
||
679 | 734 | $output .= '},'; |
680 | 735 | } |
681 | 736 | } |
682 | - if (isset($onground) && $onground) $output = str_replace('%onground%','true',$output); |
|
683 | - else $output = str_replace('%onground%','false',$output); |
|
737 | + if (isset($onground) && $onground) { |
|
738 | + $output = str_replace('%onground%','true',$output); |
|
739 | + } else { |
|
740 | + $output = str_replace('%onground%','false',$output); |
|
741 | + } |
|
684 | 742 | |
685 | 743 | // $output .= '"heightReference": "CLAMP_TO_GROUND",'; |
686 | 744 | //$output .= '"heightReference": "'.$heightrelative.'",'; |
@@ -693,8 +751,12 @@ discard block |
||
693 | 751 | // $output .= '"interpolationDegree" : 5,'; |
694 | 752 | // $output .= '"epoch" : "'.date("c",strtotime($spotter_item['date'])).'", '; |
695 | 753 | $output .= '"cartographicDegrees": ['; |
696 | - if ($minitime > strtotime($spotter_item['date'])) $minitime = strtotime($spotter_item['date']); |
|
697 | - if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']); |
|
754 | + if ($minitime > strtotime($spotter_item['date'])) { |
|
755 | + $minitime = strtotime($spotter_item['date']); |
|
756 | + } |
|
757 | + if ($maxitime < strtotime($spotter_item['date'])) { |
|
758 | + $maxitime = strtotime($spotter_item['date']); |
|
759 | + } |
|
698 | 760 | $output .= '"'.date("c",strtotime($spotter_item['date'])).'", '; |
699 | 761 | $output .= $spotter_item['longitude'].', '; |
700 | 762 | $output .= $spotter_item['latitude']; |
@@ -717,7 +779,9 @@ discard block |
||
717 | 779 | $output .= ', '.round($spotter_item['altitude']*30.48); |
718 | 780 | $prevalt = round($spotter_item['altitude']*30.48); |
719 | 781 | } |
720 | - } else $output .= ', 0'; |
|
782 | + } else { |
|
783 | + $output .= ', 0'; |
|
784 | + } |
|
721 | 785 | //$orientation = '"orientation" : { '; |
722 | 786 | //$orientation .= '"unitQuaternion": ['; |
723 | 787 | //$quat = quaternionrotate(deg2rad($spotter_item['heading']),deg2rad(0),deg2rad(0)); |
@@ -725,13 +789,18 @@ discard block |
||
725 | 789 | } else { |
726 | 790 | $nblatlong = $nblatlong+1; |
727 | 791 | $output .= ',"'.date("c",strtotime($spotter_item['date'])).'", '; |
728 | - if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']); |
|
792 | + if ($maxitime < strtotime($spotter_item['date'])) { |
|
793 | + $maxitime = strtotime($spotter_item['date']); |
|
794 | + } |
|
729 | 795 | if ($spotter_item['ground_speed'] == 0) { |
730 | 796 | $output .= $prevlong.', '; |
731 | 797 | $output .= $prevlat; |
732 | 798 | //if (!$marine && (!isset($onground) || !$onground)) $output .= ', '.$prevalt; |
733 | - if (!$marine) $output .= ', '.$prevalt; |
|
734 | - else $output .= ', 0'; |
|
799 | + if (!$marine) { |
|
800 | + $output .= ', '.$prevalt; |
|
801 | + } else { |
|
802 | + $output .= ', 0'; |
|
803 | + } |
|
735 | 804 | } else { |
736 | 805 | $output .= $spotter_item['longitude'].', '; |
737 | 806 | $output .= $spotter_item['latitude']; |
@@ -744,14 +813,17 @@ discard block |
||
744 | 813 | $output .= ', 0'; |
745 | 814 | } |
746 | 815 | } else { |
747 | - if (isset($spotter_item['real_altitude']) && $spotter_item['real_altitude'] != '') $output .= ', '.round($spotter_item['real_altitude']*0.3048); |
|
748 | - elseif ($tracker) { |
|
816 | + if (isset($spotter_item['real_altitude']) && $spotter_item['real_altitude'] != '') { |
|
817 | + $output .= ', '.round($spotter_item['real_altitude']*0.3048); |
|
818 | + } elseif ($tracker) { |
|
749 | 819 | $output .= ', '.round($spotter_item['altitude']*0.3048); |
750 | 820 | } else { |
751 | 821 | $output .= ', '.round($spotter_item['altitude']*30.48); |
752 | 822 | } |
753 | 823 | } |
754 | - } else $output .= ', 0'; |
|
824 | + } else { |
|
825 | + $output .= ', 0'; |
|
826 | + } |
|
755 | 827 | } |
756 | 828 | //$quat = quaternionrotate(deg2rad($spotter_item['heading']),deg2rad(0),deg2rad(0)); |
757 | 829 | //$orientation .= ',"'.date("c",strtotime($spotter_item['date'])).'",'.$quat['x'].','.$quat['y'].','.$quat['z'].','.$quat['w']; |
@@ -770,11 +842,17 @@ discard block |
||
770 | 842 | } else { |
771 | 843 | $output = str_replace('%minitime%',date("c",time()-$globalLiveInterval),$output); |
772 | 844 | } |
845 | + } else { |
|
846 | + $output = str_replace('%minitime%',date("c",$minitime),$output); |
|
773 | 847 | } |
774 | - else $output = str_replace('%minitime%',date("c",$minitime),$output); |
|
775 | -} else $output = str_replace('%minitime%',date("c",$minitime),$output); |
|
848 | + } else { |
|
849 | + $output = str_replace('%minitime%',date("c",$minitime),$output); |
|
850 | +} |
|
776 | 851 | $output = str_replace('%maxitime%',date("c",$maxitime),$output); |
777 | -if ($gltf2) $output = str_replace('%gltf2%','true',$output); |
|
778 | -else $output = str_replace('%gltf2%','false',$output); |
|
852 | +if ($gltf2) { |
|
853 | + $output = str_replace('%gltf2%','true',$output); |
|
854 | +} else { |
|
855 | + $output = str_replace('%gltf2%','false',$output); |
|
856 | +} |
|
779 | 857 | print $output; |
780 | 858 | ?> |