@@ -16,24 +16,24 @@ discard block |
||
16 | 16 | $sql_date = ''; |
17 | 17 | if (isset($_GET['start_date'])) { |
18 | 18 | //for the date manipulation into the query |
19 | - if($_GET['start_date'] != "" && $_GET['end_date'] != ""){ |
|
19 | + if ($_GET['start_date'] != "" && $_GET['end_date'] != "") { |
|
20 | 20 | if (strtotime($_GET['start_date']) !== false && strtotime($_GET['end_date']) !== false) { |
21 | 21 | //$start_date = $_GET['start_date']." 00:00:00"; |
22 | - $start_date = date("Y-m-d",strtotime($_GET['start_date']))." 00:00:00"; |
|
22 | + $start_date = date("Y-m-d", strtotime($_GET['start_date']))." 00:00:00"; |
|
23 | 23 | //$end_date = $_GET['end_date']." 00:00:00"; |
24 | - $end_date = date("Y-m-d",strtotime($_GET['end_date']))." 00:00:00"; |
|
24 | + $end_date = date("Y-m-d", strtotime($_GET['end_date']))." 00:00:00"; |
|
25 | 25 | $sql_date = $start_date.",".$end_date; |
26 | 26 | } |
27 | - } else if($_GET['start_date'] != ""){ |
|
27 | + } else if ($_GET['start_date'] != "") { |
|
28 | 28 | if (strtotime($_GET['start_date']) !== false) { |
29 | 29 | //$start_date = $_GET['start_date']." 00:00:00"; |
30 | - $start_date = date("Y-m-d",strtotime($_GET['start_date']))." 00:00:00"; |
|
30 | + $start_date = date("Y-m-d", strtotime($_GET['start_date']))." 00:00:00"; |
|
31 | 31 | $sql_date = $start_date; |
32 | 32 | } |
33 | - } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){ |
|
33 | + } else if ($_GET['start_date'] == "" && $_GET['end_date'] != "") { |
|
34 | 34 | if (strtotime($_GET['end_date']) !== false) { |
35 | 35 | //$end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date']." 00:00:00"; |
36 | - $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".date("Y-m-d",strtotime($_GET['end_date']))." 00:00:00"; |
|
36 | + $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".date("Y-m-d", strtotime($_GET['end_date']))." 00:00:00"; |
|
37 | 37 | $sql_date = $end_date; |
38 | 38 | } |
39 | 39 | } else $sql_date = ''; |
@@ -41,21 +41,21 @@ discard block |
||
41 | 41 | |
42 | 42 | if (isset($_GET['highest_altitude'])) { |
43 | 43 | //for altitude manipulation |
44 | - if($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != ""){ |
|
45 | - $end_altitude = filter_input(INPUT_GET,'highest_altitude',FILTER_SANITIZE_NUMBER_INT); |
|
46 | - $start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT); |
|
44 | + if ($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != "") { |
|
45 | + $end_altitude = filter_input(INPUT_GET, 'highest_altitude', FILTER_SANITIZE_NUMBER_INT); |
|
46 | + $start_altitude = filter_input(INPUT_GET, 'lowest_altitude', FILTER_SANITIZE_NUMBER_INT); |
|
47 | 47 | $sql_altitude = $start_altitude.",".$end_altitude; |
48 | - } else if($_GET['highest_altitude'] != ""){ |
|
49 | - $end_altitude = filter_input(INPUT_GET,'highest_altitude',FILTER_SANITIZE_NUMBER_INT); |
|
48 | + } else if ($_GET['highest_altitude'] != "") { |
|
49 | + $end_altitude = filter_input(INPUT_GET, 'highest_altitude', FILTER_SANITIZE_NUMBER_INT); |
|
50 | 50 | $sql_altitude = $end_altitude; |
51 | - } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){ |
|
52 | - $start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT).",60000"; |
|
51 | + } else if ($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != "") { |
|
52 | + $start_altitude = filter_input(INPUT_GET, 'lowest_altitude', FILTER_SANITIZE_NUMBER_INT).",60000"; |
|
53 | 53 | $sql_altitude = $start_altitude; |
54 | 54 | } else $sql_altitude = ''; |
55 | 55 | } else $sql_altitude = ''; |
56 | 56 | |
57 | 57 | //calculuation for the pagination |
58 | -if(!isset($_GET['limit'])) |
|
58 | +if (!isset($_GET['limit'])) |
|
59 | 59 | { |
60 | 60 | if (!isset($_GET['number_results'])) |
61 | 61 | { |
@@ -63,45 +63,45 @@ discard block |
||
63 | 63 | $limit_end = 25; |
64 | 64 | $absolute_difference = 25; |
65 | 65 | } else { |
66 | - if ($_GET['number_results'] > 1000){ |
|
66 | + if ($_GET['number_results'] > 1000) { |
|
67 | 67 | $_GET['number_results'] = 1000; |
68 | 68 | } |
69 | 69 | $limit_start = 0; |
70 | - $limit_end = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT); |
|
71 | - $absolute_difference = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT); |
|
70 | + $limit_end = filter_input(INPUT_GET, 'number_results', FILTER_SANITIZE_NUMBER_INT); |
|
71 | + $absolute_difference = filter_input(INPUT_GET, 'number_results', FILTER_SANITIZE_NUMBER_INT); |
|
72 | 72 | } |
73 | -} else { |
|
73 | +} else { |
|
74 | 74 | $limit_explode = explode(",", $_GET['limit']); |
75 | - $limit_start = filter_var($limit_explode[0],FILTER_SANITIZE_NUMBER_INT); |
|
76 | - $limit_end = filter_var($limit_explode[1],FILTER_SANITIZE_NUMBER_INT); |
|
75 | + $limit_start = filter_var($limit_explode[0], FILTER_SANITIZE_NUMBER_INT); |
|
76 | + $limit_end = filter_var($limit_explode[1], FILTER_SANITIZE_NUMBER_INT); |
|
77 | 77 | } |
78 | 78 | $absolute_difference = abs($limit_start - $limit_end); |
79 | 79 | $limit_next = $limit_end + $absolute_difference; |
80 | 80 | $limit_previous_1 = $limit_start - $absolute_difference; |
81 | 81 | $limit_previous_2 = $limit_end - $absolute_difference; |
82 | 82 | |
83 | -if (!empty($_GET)){ |
|
84 | - $q = filter_input(INPUT_GET, 'q',FILTER_SANITIZE_STRING); |
|
85 | - $registration = filter_input(INPUT_GET, 'registration',FILTER_SANITIZE_STRING); |
|
86 | - $aircraft = filter_input(INPUT_GET, 'aircraft',FILTER_SANITIZE_STRING); |
|
87 | - $manufacturer = filter_input(INPUT_GET, 'manufacturer',FILTER_SANITIZE_STRING); |
|
88 | - $highlights = filter_input(INPUT_GET, 'highlights',FILTER_SANITIZE_STRING); |
|
89 | - $airline = filter_input(INPUT_GET, 'airline',FILTER_SANITIZE_STRING); |
|
90 | - $airline_country = filter_input(INPUT_GET, 'airline_country',FILTER_SANITIZE_STRING); |
|
91 | - $airline_type = filter_input(INPUT_GET, 'airline_type',FILTER_SANITIZE_STRING); |
|
92 | - $airport = filter_input(INPUT_GET, 'airport',FILTER_SANITIZE_STRING); |
|
93 | - $airport_country = filter_input(INPUT_GET, 'airport_country',FILTER_SANITIZE_STRING); |
|
94 | - $callsign = filter_input(INPUT_GET, 'callsign',FILTER_SANITIZE_STRING); |
|
95 | - $owner = filter_input(INPUT_GET, 'owner',FILTER_SANITIZE_STRING); |
|
96 | - $pilot_name = filter_input(INPUT_GET, 'pilot_name',FILTER_SANITIZE_STRING); |
|
97 | - $pilot_id = filter_input(INPUT_GET, 'pilot_id',FILTER_SANITIZE_STRING); |
|
98 | - $departure_airport_route = filter_input(INPUT_GET, 'departure_airport_route',FILTER_SANITIZE_STRING); |
|
99 | - $arrival_airport_route = filter_input(INPUT_GET, 'arrival_airport_route',FILTER_SANITIZE_STRING); |
|
100 | - $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
101 | - $archive = filter_input(INPUT_GET,'archive',FILTER_SANITIZE_NUMBER_INT); |
|
102 | - $origlat = filter_input(INPUT_GET,'origlat',FILTER_SANITIZE_NUMBER_FLOAT); |
|
103 | - $origlon = filter_input(INPUT_GET,'origlon',FILTER_SANITIZE_NUMBER_FLOAT); |
|
104 | - $dist = filter_input(INPUT_GET,'dist',FILTER_SANITIZE_NUMBER_INT); |
|
83 | +if (!empty($_GET)) { |
|
84 | + $q = filter_input(INPUT_GET, 'q', FILTER_SANITIZE_STRING); |
|
85 | + $registration = filter_input(INPUT_GET, 'registration', FILTER_SANITIZE_STRING); |
|
86 | + $aircraft = filter_input(INPUT_GET, 'aircraft', FILTER_SANITIZE_STRING); |
|
87 | + $manufacturer = filter_input(INPUT_GET, 'manufacturer', FILTER_SANITIZE_STRING); |
|
88 | + $highlights = filter_input(INPUT_GET, 'highlights', FILTER_SANITIZE_STRING); |
|
89 | + $airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING); |
|
90 | + $airline_country = filter_input(INPUT_GET, 'airline_country', FILTER_SANITIZE_STRING); |
|
91 | + $airline_type = filter_input(INPUT_GET, 'airline_type', FILTER_SANITIZE_STRING); |
|
92 | + $airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING); |
|
93 | + $airport_country = filter_input(INPUT_GET, 'airport_country', FILTER_SANITIZE_STRING); |
|
94 | + $callsign = filter_input(INPUT_GET, 'callsign', FILTER_SANITIZE_STRING); |
|
95 | + $owner = filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING); |
|
96 | + $pilot_name = filter_input(INPUT_GET, 'pilot_name', FILTER_SANITIZE_STRING); |
|
97 | + $pilot_id = filter_input(INPUT_GET, 'pilot_id', FILTER_SANITIZE_STRING); |
|
98 | + $departure_airport_route = filter_input(INPUT_GET, 'departure_airport_route', FILTER_SANITIZE_STRING); |
|
99 | + $arrival_airport_route = filter_input(INPUT_GET, 'arrival_airport_route', FILTER_SANITIZE_STRING); |
|
100 | + $sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
101 | + $archive = filter_input(INPUT_GET, 'archive', FILTER_SANITIZE_NUMBER_INT); |
|
102 | + $origlat = filter_input(INPUT_GET, 'origlat', FILTER_SANITIZE_NUMBER_FLOAT); |
|
103 | + $origlon = filter_input(INPUT_GET, 'origlon', FILTER_SANITIZE_NUMBER_FLOAT); |
|
104 | + $dist = filter_input(INPUT_GET, 'dist', FILTER_SANITIZE_NUMBER_INT); |
|
105 | 105 | if ($dist != '') { |
106 | 106 | if (isset($globalDistanceUnit) && $globalDistanceUnit == 'mi') $dist = $dist*1.60934; |
107 | 107 | elseif (isset($globalDistanceUnit) && $globalDistanceUnit == 'nm') $dist = $dist*1.852; |
@@ -109,9 +109,9 @@ discard block |
||
109 | 109 | if (!isset($sql_date)) $sql_date = ''; |
110 | 110 | if ($archive == 1) { |
111 | 111 | $SpotterArchive = new SpotterArchive(); |
112 | - $spotter_array = $SpotterArchive->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,'',$origlat,$origlon,$dist); |
|
112 | + $spotter_array = $SpotterArchive->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, '', $origlat, $origlon, $dist); |
|
113 | 113 | } else { |
114 | - $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,'',$origlat,$origlon,$dist); |
|
114 | + $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, '', $origlat, $origlon, $dist); |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | print '<span class="sub-menu-statistic column mobile">'; |
@@ -144,12 +144,12 @@ discard block |
||
144 | 144 | //remove 3D=true parameter |
145 | 145 | $no3D = str_replace("&3D=true", "", $_SERVER['QUERY_STRING']); |
146 | 146 | $kmlURL = str_replace("http://", "kml://", $globalURL); |
147 | - if (!isset($_GET['3D'])){ |
|
147 | + if (!isset($_GET['3D'])) { |
|
148 | 148 | print '<li><a href="'.$globalURL.'/search?'.$no3D.'" class="active"><i class="fa fa-table"></i> '._("Table").'</a></li>'; |
149 | 149 | } else { |
150 | 150 | print '<li><span class="notablet"><a href="'.$globalURL.'/search?'.$no3D.'"><i class="fa fa-table"></i> '._("Table").'</a></span></li>'; |
151 | 151 | } |
152 | - if (isset($_GET['3D'])){ |
|
152 | + if (isset($_GET['3D'])) { |
|
153 | 153 | print '<li><a href="'.$globalURL.'/search?'.$no3D.'&3D=true" class="active"><i class="fa fa-globe"></i> '._("3D Map").'</a></li>'; |
154 | 154 | } else { |
155 | 155 | print '<li ><a href="'.$globalURL.'/search?'.$no3D.'&3D=true" class="notablet nomobile"><i class="fa fa-globe"></i> '._("3D Map").'</a><a href="'.$kmlURL.'/search/kml?'.htmlentities($_SERVER['QUERY_STRING']).'" class="tablet mobile"><i class="fa fa-globe"></i> 3D Map</a></li>'; |
@@ -170,30 +170,30 @@ discard block |
||
170 | 170 | print '<div class="column">'; |
171 | 171 | print '<div class="info">'; |
172 | 172 | print '<h1>'._("Search Results for").' '; |
173 | - if (isset($_GET['q']) && $_GET['q'] != ""){ print _("Keyword:").' <span>'.$q.'</span> '; } |
|
174 | - if (isset($_GET['aircraft']) && $_GET['aircraft'] != ""){ print _("Aircraft:").' <span>'.$aircraft.'</span> '; } |
|
175 | - if (isset($_GET['manufacturer']) && $_GET['manufacturer'] != ""){ print _("Manufacturer:").' <span>'.$manufacturer.'</span> '; } |
|
176 | - if (isset($_GET['registration']) && $_GET['registration'] != ""){ print _("Registration:").' <span>'.$registration.'</span> '; } |
|
177 | - if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true"){ print _("Highlights:").' <span>'.$highlights.'</span> '; } |
|
178 | - if (isset($_GET['airline']) && $_GET['airline'] != ""){ print _("Airline:").' <span>'.$airline.'</span> '; } |
|
179 | - if (isset($_GET['airline_country']) && $_GET['airline_country'] != ""){ print _("Airline country:").' <span>'.$airline_country.'</span> '; } |
|
180 | - if (isset($_GET['airline_type']) && $_GET['airline_type'] != ""){ print _("Airline type:").' <span>'.$airline_type.'</span> '; } |
|
181 | - if (isset($_GET['airport']) && $_GET['airport'] != ""){ print _("Airport:").' <span>'.$airport.'</span> '; } |
|
182 | - if (isset($_GET['airport_country']) && $_GET['airport_country'] != ""){ print _("Airport country:").' <span>'.$airport_country.'</span> '; } |
|
183 | - if (isset($_GET['callsign']) && $_GET['callsign'] != ""){ print _("Callsign:").' <span>'.$callsign.'</span> '; } |
|
184 | - if (isset($_GET['owner']) && $_GET['owner'] != ""){ print _("Owner:").' <span>'.$owner.'</span> '; } |
|
185 | - if (isset($_GET['pilot_id']) && $_GET['pilot_id'] != ""){ print _("Pilot id:").' <span>'.$pilot_id.'</span> '; } |
|
186 | - if (isset($_GET['pilot_name']) && $_GET['pilot_name'] != ""){ print _("Pilot name:").' <span>'.$pilot_name.'</span> '; } |
|
187 | - if (isset($_GET['departure_airport_route']) && $_GET['departure_airport_route'] != "" && (!isset($_GET['arrival_airport_route']) || $_GET['arrival_airport_route'] == "")){ print _("Route out of:").' <span>'.$departure_airport_route.'</span> '; } |
|
188 | - if (isset($_GET['departure_airport_route']) && $_GET['departure_airport_route'] == "" && isset($_GET['arrival_airport_route']) && $_GET['arrival_airport_route'] != ""){ print _("Route into:").' <span>'.$arrival_airport_route.'</span> '; } |
|
189 | - if (isset($_GET['departure_airport_route']) && $_GET['departure_airport_route'] != "" && isset($_GET['arrival_airport_route']) && $_GET['arrival_airport_route'] != ""){ print _("Route between:").' <span>'.$departure_airport_route.'</span> and <span>'.$_GET['arrival_airport_route'].'</span> '; } |
|
190 | - if (isset($_GET['start_date']) && $_GET['start_date'] != "" && isset($_GET['end_date']) && $_GET['end_date'] == ""){ print _("Date starting at:").' <span>'.$start_date.'</span> '; } |
|
191 | - if (isset($_GET['start_date']) && $_GET['start_date'] == "" && isset($_GET['end_date']) && $_GET['end_date'] != ""){ print _("Date ending at:").' <span>'.$end_date.'</span> '; } |
|
192 | - if (isset($_GET['start_date']) && $_GET['start_date'] != "" && isset($_GET['end_date']) && $_GET['end_date'] != ""){ print _("Date between:").' <span>'.$start_date.'</span> and <span>'.$end_date.'</span> '; } |
|
193 | - if (isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] != "" && isset($_GET['highest_altitude']) && $_GET['highest_altitude'] == ""){ print _("Altitude starting at:").' <span>'.number_format($lowest_altitude).' feet</span> '; } |
|
194 | - if (isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] == "" && isset($_GET['highest_altitude']) && $_GET['highest_altitude'] != ""){ print _("Altitude ending at:").' <span>'.number_format($highest_altitude).' feet</span> '; } |
|
195 | - if (isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] != "" && isset($_GET['highest_altitude']) && $_GET['highest_altitude'] != ""){ print _("Altitude between:").' <span>'.number_format($lowest_altitude).' feet</span> '._("and").' <span>'.number_format($highest_altitude).' feet</span> '; } |
|
196 | - if (isset($_GET['number_results']) && $_GET['number_results'] != ""){ print _("limit per page:").' <span>'.$number_results.'</span> '; } |
|
173 | + if (isset($_GET['q']) && $_GET['q'] != "") { print _("Keyword:").' <span>'.$q.'</span> '; } |
|
174 | + if (isset($_GET['aircraft']) && $_GET['aircraft'] != "") { print _("Aircraft:").' <span>'.$aircraft.'</span> '; } |
|
175 | + if (isset($_GET['manufacturer']) && $_GET['manufacturer'] != "") { print _("Manufacturer:").' <span>'.$manufacturer.'</span> '; } |
|
176 | + if (isset($_GET['registration']) && $_GET['registration'] != "") { print _("Registration:").' <span>'.$registration.'</span> '; } |
|
177 | + if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true") { print _("Highlights:").' <span>'.$highlights.'</span> '; } |
|
178 | + if (isset($_GET['airline']) && $_GET['airline'] != "") { print _("Airline:").' <span>'.$airline.'</span> '; } |
|
179 | + if (isset($_GET['airline_country']) && $_GET['airline_country'] != "") { print _("Airline country:").' <span>'.$airline_country.'</span> '; } |
|
180 | + if (isset($_GET['airline_type']) && $_GET['airline_type'] != "") { print _("Airline type:").' <span>'.$airline_type.'</span> '; } |
|
181 | + if (isset($_GET['airport']) && $_GET['airport'] != "") { print _("Airport:").' <span>'.$airport.'</span> '; } |
|
182 | + if (isset($_GET['airport_country']) && $_GET['airport_country'] != "") { print _("Airport country:").' <span>'.$airport_country.'</span> '; } |
|
183 | + if (isset($_GET['callsign']) && $_GET['callsign'] != "") { print _("Callsign:").' <span>'.$callsign.'</span> '; } |
|
184 | + if (isset($_GET['owner']) && $_GET['owner'] != "") { print _("Owner:").' <span>'.$owner.'</span> '; } |
|
185 | + if (isset($_GET['pilot_id']) && $_GET['pilot_id'] != "") { print _("Pilot id:").' <span>'.$pilot_id.'</span> '; } |
|
186 | + if (isset($_GET['pilot_name']) && $_GET['pilot_name'] != "") { print _("Pilot name:").' <span>'.$pilot_name.'</span> '; } |
|
187 | + if (isset($_GET['departure_airport_route']) && $_GET['departure_airport_route'] != "" && (!isset($_GET['arrival_airport_route']) || $_GET['arrival_airport_route'] == "")) { print _("Route out of:").' <span>'.$departure_airport_route.'</span> '; } |
|
188 | + if (isset($_GET['departure_airport_route']) && $_GET['departure_airport_route'] == "" && isset($_GET['arrival_airport_route']) && $_GET['arrival_airport_route'] != "") { print _("Route into:").' <span>'.$arrival_airport_route.'</span> '; } |
|
189 | + if (isset($_GET['departure_airport_route']) && $_GET['departure_airport_route'] != "" && isset($_GET['arrival_airport_route']) && $_GET['arrival_airport_route'] != "") { print _("Route between:").' <span>'.$departure_airport_route.'</span> and <span>'.$_GET['arrival_airport_route'].'</span> '; } |
|
190 | + if (isset($_GET['start_date']) && $_GET['start_date'] != "" && isset($_GET['end_date']) && $_GET['end_date'] == "") { print _("Date starting at:").' <span>'.$start_date.'</span> '; } |
|
191 | + if (isset($_GET['start_date']) && $_GET['start_date'] == "" && isset($_GET['end_date']) && $_GET['end_date'] != "") { print _("Date ending at:").' <span>'.$end_date.'</span> '; } |
|
192 | + if (isset($_GET['start_date']) && $_GET['start_date'] != "" && isset($_GET['end_date']) && $_GET['end_date'] != "") { print _("Date between:").' <span>'.$start_date.'</span> and <span>'.$end_date.'</span> '; } |
|
193 | + if (isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] != "" && isset($_GET['highest_altitude']) && $_GET['highest_altitude'] == "") { print _("Altitude starting at:").' <span>'.number_format($lowest_altitude).' feet</span> '; } |
|
194 | + if (isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] == "" && isset($_GET['highest_altitude']) && $_GET['highest_altitude'] != "") { print _("Altitude ending at:").' <span>'.number_format($highest_altitude).' feet</span> '; } |
|
195 | + if (isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] != "" && isset($_GET['highest_altitude']) && $_GET['highest_altitude'] != "") { print _("Altitude between:").' <span>'.number_format($lowest_altitude).' feet</span> '._("and").' <span>'.number_format($highest_altitude).' feet</span> '; } |
|
196 | + if (isset($_GET['number_results']) && $_GET['number_results'] != "") { print _("limit per page:").' <span>'.$number_results.'</span> '; } |
|
197 | 197 | print '</h1>'; |
198 | 198 | print '</div>'; |
199 | 199 | |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | </select> |
301 | 301 | </div> |
302 | 302 | </div> |
303 | - <script type="text/javascript">getSelect('manufacturer','<?php if(isset($_GET['manufacturer'])) print $manufacturer; ?>')</script> |
|
303 | + <script type="text/javascript">getSelect('manufacturer','<?php if (isset($_GET['manufacturer'])) print $manufacturer; ?>')</script> |
|
304 | 304 | <div class="form-group"> |
305 | 305 | <label class="control-label col-sm-2"><?php echo _("Type"); ?></label> |
306 | 306 | <div class="col-sm-10"> |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | </select> |
310 | 310 | </div> |
311 | 311 | </div> |
312 | - <script type="text/javascript">getSelect('aircrafttypes','<?php if(isset($_GET['aircraft_icao'])) print $aircraft_icao; ?>');</script> |
|
312 | + <script type="text/javascript">getSelect('aircrafttypes','<?php if (isset($_GET['aircraft_icao'])) print $aircraft_icao; ?>');</script> |
|
313 | 313 | <div class="form-group"> |
314 | 314 | <label class="control-label col-sm-2"><?php echo _("Registration"); ?></label> |
315 | 315 | <div class="col-sm-10"> |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | </div> |
333 | 333 | </div> |
334 | 334 | <?php |
335 | -}else { |
|
335 | +} else { |
|
336 | 336 | ?> |
337 | 337 | <div class="form-group"> |
338 | 338 | <label class="control-label col-sm-2"><?php echo _("Owner name"); ?></label> |
@@ -345,8 +345,8 @@ discard block |
||
345 | 345 | ?> |
346 | 346 | <div class="form-group"> |
347 | 347 | <div class="col-sm-offset-2 col-sm-10"> |
348 | - <!--<div><input type="checkbox" class="form-control" name="highlights" value="true" id="highlights" <?php if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true"){ print 'checked="checked"'; } ?>> <label for="highlights"><?php echo _("Include only aircrafts with special highlights (unique liveries, destinations etc.)"); ?></label></div>--> |
|
349 | - <label class="checkbox-inline"><input type="checkbox" name="highlights" value="true" id="highlights" <?php if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true"){ print 'checked="checked"'; } ?>> <?php echo _("Include only aircrafts with special highlights (unique liveries, destinations etc.)"); ?></label> |
|
348 | + <!--<div><input type="checkbox" class="form-control" name="highlights" value="true" id="highlights" <?php if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true") { print 'checked="checked"'; } ?>> <label for="highlights"><?php echo _("Include only aircrafts with special highlights (unique liveries, destinations etc.)"); ?></label></div>--> |
|
349 | + <label class="checkbox-inline"><input type="checkbox" name="highlights" value="true" id="highlights" <?php if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true") { print 'checked="checked"'; } ?>> <?php echo _("Include only aircrafts with special highlights (unique liveries, destinations etc.)"); ?></label> |
|
350 | 350 | </div> |
351 | 351 | </div> |
352 | 352 | </fieldset> |
@@ -360,7 +360,7 @@ discard block |
||
360 | 360 | </select> |
361 | 361 | </div> |
362 | 362 | </div> |
363 | - <script type="text/javascript">getSelect('airlinenames','<?php if(isset($_GET['airline'])) print $airline; ?>');</script> |
|
363 | + <script type="text/javascript">getSelect('airlinenames','<?php if (isset($_GET['airline'])) print $airline; ?>');</script> |
|
364 | 364 | <div class="form-group"> |
365 | 365 | <label class="control-label col-sm-2"><?php echo _("Country"); ?></label> |
366 | 366 | <div class="col-sm-10"> |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | </select> |
370 | 370 | </div> |
371 | 371 | </div> |
372 | - <script type="text/javascript">getSelect('airlinecountries','<?php if(isset($_GET['airline_country'])) print $airline_country; ?>');</script> |
|
372 | + <script type="text/javascript">getSelect('airlinecountries','<?php if (isset($_GET['airline_country'])) print $airline_country; ?>');</script> |
|
373 | 373 | <div class="form-group"> |
374 | 374 | <label class="control-label col-sm-2"><?php echo _("Callsign"); ?></label> |
375 | 375 | <div class="col-sm-10"> |
@@ -378,10 +378,10 @@ discard block |
||
378 | 378 | </div> |
379 | 379 | <div class="form-group"> |
380 | 380 | <div class="col-sm-offset-2 col-sm-10"> |
381 | - <label class="radio-inline"><input type="radio" name="airline_type" value="all" id="airline_type_all" <?php if (!isset($_GET['airline_type']) || $_GET['airline_type'] == "all"){ print 'checked="checked"'; } ?>> <?php echo _("All airlines types"); ?></label> |
|
382 | - <label class="radio-inline"><input type="radio" name="airline_type" value="passenger" id="airline_type_passenger" <?php if (isset($_GET['airline_type'])) if ($_GET['airline_type'] == "passenger"){ print 'checked="checked"'; } ?>> <?php echo _("Only Passenger airlines"); ?></label> |
|
383 | - <label class="radio-inline"><input type="radio" name="airline_type" value="cargo" id="airline_type_cargo" <?php if (isset($_GET['airline_type'])) if ( $_GET['airline_type'] == "cargo"){ print 'checked="checked"'; } ?>> <?php echo _("Only Cargo airlines"); ?></label> |
|
384 | - <label class="radio-inline"><input type="radio" name="airline_type" value="military" id="airline_type_military" <?php if (isset($_GET['airline_type'])) if ( $_GET['airline_type'] == "military"){ print 'checked="checked"'; } ?>> <?php echo _("Only Military airlines"); ?></label> |
|
381 | + <label class="radio-inline"><input type="radio" name="airline_type" value="all" id="airline_type_all" <?php if (!isset($_GET['airline_type']) || $_GET['airline_type'] == "all") { print 'checked="checked"'; } ?>> <?php echo _("All airlines types"); ?></label> |
|
382 | + <label class="radio-inline"><input type="radio" name="airline_type" value="passenger" id="airline_type_passenger" <?php if (isset($_GET['airline_type'])) if ($_GET['airline_type'] == "passenger") { print 'checked="checked"'; } ?>> <?php echo _("Only Passenger airlines"); ?></label> |
|
383 | + <label class="radio-inline"><input type="radio" name="airline_type" value="cargo" id="airline_type_cargo" <?php if (isset($_GET['airline_type'])) if ($_GET['airline_type'] == "cargo") { print 'checked="checked"'; } ?>> <?php echo _("Only Cargo airlines"); ?></label> |
|
384 | + <label class="radio-inline"><input type="radio" name="airline_type" value="military" id="airline_type_military" <?php if (isset($_GET['airline_type'])) if ($_GET['airline_type'] == "military") { print 'checked="checked"'; } ?>> <?php echo _("Only Military airlines"); ?></label> |
|
385 | 385 | </div> |
386 | 386 | </div> |
387 | 387 | </fieldset> |
@@ -395,7 +395,7 @@ discard block |
||
395 | 395 | </select> |
396 | 396 | </div> |
397 | 397 | </div> |
398 | - <script type="text/javascript">getSelect('airportnames','<?php if(isset($_GET['airport_icao'])) print $airport_icao; ?>');</script> |
|
398 | + <script type="text/javascript">getSelect('airportnames','<?php if (isset($_GET['airport_icao'])) print $airport_icao; ?>');</script> |
|
399 | 399 | <div class="form-group"> |
400 | 400 | <label class="control-label col-sm-2"><?php echo _("Country"); ?></label> |
401 | 401 | <div class="col-sm-10"> |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | </select> |
405 | 405 | </div> |
406 | 406 | </div> |
407 | - <script type="text/javascript">getSelect('airportcountries','<?php if(isset($_GET['airport_country'])) print $airport_country; ?>');</script> |
|
407 | + <script type="text/javascript">getSelect('airportcountries','<?php if (isset($_GET['airport_country'])) print $airport_country; ?>');</script> |
|
408 | 408 | </fieldset> |
409 | 409 | <fieldset> |
410 | 410 | <legend><?php echo _("Route"); ?></legend> |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | </select> |
417 | 417 | </div> |
418 | 418 | </div> |
419 | - <script type="text/javascript">getSelect('departureairportnames','<?php if(isset($_GET['departure_airport_route'])) print $departure_airport_route; ?>');</script> |
|
419 | + <script type="text/javascript">getSelect('departureairportnames','<?php if (isset($_GET['departure_airport_route'])) print $departure_airport_route; ?>');</script> |
|
420 | 420 | <div class="form-group"> |
421 | 421 | <label class="control-label col-sm-2"><?php echo _("Arrival Airport"); ?></label> |
422 | 422 | <div class="col-sm-10"> |
@@ -425,7 +425,7 @@ discard block |
||
425 | 425 | </select> |
426 | 426 | </div> |
427 | 427 | </div> |
428 | - <script type="text/javascript">getSelect('arrivalairportnames','<?php if(isset($_GET['arrival_airport_route'])) print $arrival_airport_route; ?>');</script> |
|
428 | + <script type="text/javascript">getSelect('arrivalairportnames','<?php if (isset($_GET['arrival_airport_route'])) print $arrival_airport_route; ?>');</script> |
|
429 | 429 | </fieldset> |
430 | 430 | <fieldset> |
431 | 431 | <legend><?php echo _("Date"); ?></legend> |
@@ -479,9 +479,9 @@ discard block |
||
479 | 479 | <option></option> |
480 | 480 | <?php |
481 | 481 | $altitude_array = Array(1000, 5000, 10000, 15000, 20000, 25000, 30000, 35000, 40000, 45000, 50000); |
482 | -foreach($altitude_array as $altitude) |
|
482 | +foreach ($altitude_array as $altitude) |
|
483 | 483 | { |
484 | - if(isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] == $altitude) |
|
484 | + if (isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] == $altitude) |
|
485 | 485 | { |
486 | 486 | print '<option value="'.$altitude.'" selected="selected">'.number_format($altitude).' feet</option>'; |
487 | 487 | } else { |
@@ -499,9 +499,9 @@ discard block |
||
499 | 499 | <option></option> |
500 | 500 | <?php |
501 | 501 | $altitude_array = Array(1000, 5000, 10000, 15000, 20000, 25000, 30000, 35000, 40000, 45000, 50000); |
502 | -foreach($altitude_array as $altitude) |
|
502 | +foreach ($altitude_array as $altitude) |
|
503 | 503 | { |
504 | - if(isset($_GET['highest_altitude']) && $_GET['highest_altitude'] == $altitude) |
|
504 | + if (isset($_GET['highest_altitude']) && $_GET['highest_altitude'] == $altitude) |
|
505 | 505 | { |
506 | 506 | print '<option value="'.$altitude.'" selected="selected">'.number_format($altitude).' feet</option>'; |
507 | 507 | } else { |
@@ -540,10 +540,10 @@ discard block |
||
540 | 540 | <div class="col-sm-10"> |
541 | 541 | <select class="form-control" name="number_results"> |
542 | 542 | <?php |
543 | -$number_results_array = Array(25, 50, 100, 150, 200, 250, 300, 400, 500, 600, 700, 800, 900, 1000); |
|
544 | -foreach($number_results_array as $number) |
|
543 | +$number_results_array = Array(25, 50, 100, 150, 200, 250, 300, 400, 500, 600, 700, 800, 900, 1000); |
|
544 | +foreach ($number_results_array as $number) |
|
545 | 545 | { |
546 | - if(isset($_GET['number_results']) && $_GET['number_results'] == $number) |
|
546 | + if (isset($_GET['number_results']) && $_GET['number_results'] == $number) |
|
547 | 547 | { |
548 | 548 | print '<option value="'.$number.'" selected="selected">'.$number.'</option>'; |
549 | 549 | } else { |
@@ -562,7 +562,7 @@ discard block |
||
562 | 562 | <fieldset> |
563 | 563 | <div class="form-group"> |
564 | 564 | <div class="col-sm-offset-2 col-sm-10"> |
565 | - <label class="checkbox-inline"><input type="checkbox" name="archive" value="1" disabled /><?php echo sprintf(_("Search in archive (older than %s months)"),$globalArchiveKeepMonths); ?></label> |
|
565 | + <label class="checkbox-inline"><input type="checkbox" name="archive" value="1" disabled /><?php echo sprintf(_("Search in archive (older than %s months)"), $globalArchiveKeepMonths); ?></label> |
|
566 | 566 | <p class="help-block">Disabled in demo</p> |
567 | 567 | </div> |
568 | 568 | </div> |
@@ -573,7 +573,7 @@ discard block |
||
573 | 573 | <fieldset> |
574 | 574 | <div class="form-group"> |
575 | 575 | <div class="col-sm-offset-2 col-sm-10"> |
576 | - <label class="checkbox-inline"><input type="checkbox" name="archive" value="1" /><?php echo sprintf(_("Search in archive (older than %s months)"),$globalArchiveKeepMonths); ?></label> |
|
576 | + <label class="checkbox-inline"><input type="checkbox" name="archive" value="1" /><?php echo sprintf(_("Search in archive (older than %s months)"), $globalArchiveKeepMonths); ?></label> |
|
577 | 577 | </div> |
578 | 578 | </div> |
579 | 579 | </fieldset> |
@@ -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']); |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | <div class="form-group"> |
195 | 195 | <label>From (UTC):</label> |
196 | 196 | <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 /> |
|
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 /> |
|
198 | 198 | <span class="input-group-addon"> |
199 | 199 | <span class="glyphicon glyphicon-calendar"></span> |
200 | 200 | </span> |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | <div class="form-group"> |
204 | 204 | <label>To (UTC):</label> |
205 | 205 | <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']); ?>" /> |
|
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']); ?>" /> |
|
207 | 207 | <span class="input-group-addon"> |
208 | 208 | <span class="glyphicon glyphicon-calendar"></span> |
209 | 209 | </span> |
@@ -327,9 +327,9 @@ discard block |
||
327 | 327 | <li><?php echo _("Type of Terrain:"); ?> |
328 | 328 | <select class="selectpicker" onchange="terrainType(this);"> |
329 | 329 | <option value="stk"<?php if (!isset($_COOKIE['MapTerrain']) || $_COOKIE['MapTerrain'] == 'stk') print ' selected'; ?>>stk terrain</option> |
330 | - <option value="ellipsoid"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'ellipsoid') print ' selected';?>>ellipsoid</option> |
|
331 | - <option value="vrterrain"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'vrterrain') print ' selected';?>>vr terrain</option> |
|
332 | - <option value="articdem"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'articdem') print ' selected';?>>ArticDEM</option> |
|
330 | + <option value="ellipsoid"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'ellipsoid') print ' selected'; ?>>ellipsoid</option> |
|
331 | + <option value="vrterrain"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'vrterrain') print ' selected'; ?>>vr terrain</option> |
|
332 | + <option value="articdem"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'articdem') print ' selected'; ?>>ArticDEM</option> |
|
333 | 333 | </select> |
334 | 334 | </li> |
335 | 335 | <?php |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | <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> |
366 | 366 | <?php |
367 | 367 | } |
368 | - if (time() > mktime(0,0,0,12,1,date("Y")) && time() < mktime(0,0,0,12,31,date("Y"))) { |
|
368 | + if (time() > mktime(0, 0, 0, 12, 1, date("Y")) && time() < mktime(0, 0, 0, 12, 31, date("Y"))) { |
|
369 | 369 | ?> |
370 | 370 | <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> |
371 | 371 | <?php |
@@ -541,10 +541,10 @@ discard block |
||
541 | 541 | $Spotter = new Spotter(); |
542 | 542 | $allairlinenames = $Spotter->getAllAirlineNames(); |
543 | 543 | } |
544 | - foreach($allairlinenames as $airline) { |
|
544 | + foreach ($allairlinenames as $airline) { |
|
545 | 545 | $airline_name = $airline['airline_name']; |
546 | - if (strlen($airline_name) > 30) $airline_name = substr($airline_name,0,30).'...'; |
|
547 | - if (isset($_COOKIE['filter_Airlines']) && in_array($airline['airline_icao'],explode(',',$_COOKIE['filter_Airlines']))) { |
|
546 | + if (strlen($airline_name) > 30) $airline_name = substr($airline_name, 0, 30).'...'; |
|
547 | + if (isset($_COOKIE['filter_Airlines']) && in_array($airline['airline_icao'], explode(',', $_COOKIE['filter_Airlines']))) { |
|
548 | 548 | echo '<option value="'.$airline['airline_icao'].'" selected>'.$airline_name.'</option>'; |
549 | 549 | } else { |
550 | 550 | echo '<option value="'.$airline['airline_icao'].'">'.$airline_name.'</option>'; |
@@ -563,7 +563,7 @@ discard block |
||
563 | 563 | <select class="selectpicker" onchange="alliance(this);" id="display_alliance"> |
564 | 564 | <option value="all"<?php if (!isset($_COOKIE['filter_alliance']) || $_COOKIE['filter_alliance'] == 'all' || $_COOKIE['filter_alliance'] == '') echo ' selected'; ?>><?php echo _("All"); ?></option> |
565 | 565 | <?php |
566 | - foreach($allalliancenames as $alliance) { |
|
566 | + foreach ($allalliancenames as $alliance) { |
|
567 | 567 | $alliance_name = $alliance['alliance']; |
568 | 568 | if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] == $alliance_name) { |
569 | 569 | echo '<option value="'.$alliance_name.'" selected>'.$alliance_name.'</option>'; |
@@ -599,8 +599,8 @@ discard block |
||
599 | 599 | */ |
600 | 600 | $Source = new Source(); |
601 | 601 | $datasource = $Source->getLocationInfoByType('gs'); |
602 | - foreach($datasource as $src) { |
|
603 | - if (isset($_COOKIE['filter_Sources']) && in_array($src['name'],explode(',',$_COOKIE['filter_Sources']))) { |
|
602 | + foreach ($datasource as $src) { |
|
603 | + if (isset($_COOKIE['filter_Sources']) && in_array($src['name'], explode(',', $_COOKIE['filter_Sources']))) { |
|
604 | 604 | echo '<option value="'.$src['name'].'" selected>'.$src['name'].'</option>'; |
605 | 605 | } else { |
606 | 606 | echo '<option value="'.$src['name'].'">'.$src['name'].'</option>'; |
@@ -679,7 +679,7 @@ discard block |
||
679 | 679 | else if ($type_name == 'radar') $type_name = 'Radar Calibration'; |
680 | 680 | else if ($type_name == 'tle-new') $type_name = 'Last 30 days launches'; |
681 | 681 | |
682 | - if (isset($_COOKIE['sattypes']) && in_array($type['tle_type'],explode(',',$_COOKIE['sattypes']))) { |
|
682 | + if (isset($_COOKIE['sattypes']) && in_array($type['tle_type'], explode(',', $_COOKIE['sattypes']))) { |
|
683 | 683 | print '<option value="'.$type['tle_type'].'" selected>'.$type_name.'</option>'; |
684 | 684 | } else { |
685 | 685 | print '<option value="'.$type['tle_type'].'">'.$type_name.'</option>'; |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | $Source = new Source(); |
6 | 6 | |
7 | 7 | if (isset($_GET['sourceid'])) { |
8 | - $sourceid = filter_input(INPUT_GET,'sourceid',FILTER_SANITIZE_NUMBER_INT); |
|
8 | + $sourceid = filter_input(INPUT_GET, 'sourceid', FILTER_SANITIZE_NUMBER_INT); |
|
9 | 9 | $source_data = $Source->getLocationInfoById($sourceid); |
10 | 10 | if (isset($source_data[0])) { |
11 | 11 | ?> |
@@ -37,8 +37,8 @@ discard block |
||
37 | 37 | print '</div>'; |
38 | 38 | |
39 | 39 | if ($spotter_item['city'] != '') print '<div><span>'._("City").'</span>'.$spotter_item['city'].'</div>'; |
40 | -if ($spotter_item['country'] !='') print '<div><span>'._("Country").'</span>'.$spotter_item['country'].'</div>'; |
|
41 | -print '<div><span>'._("Coordinates").'</span>'.round($spotter_item['latitude'],4).', '.round($spotter_item['longitude'],4).'</div>'; |
|
40 | +if ($spotter_item['country'] != '') print '<div><span>'._("Country").'</span>'.$spotter_item['country'].'</div>'; |
|
41 | +print '<div><span>'._("Coordinates").'</span>'.round($spotter_item['latitude'], 4).', '.round($spotter_item['longitude'], 4).'</div>'; |
|
42 | 42 | /* |
43 | 43 | if ($spotter_item['atc_range'] > 0) { |
44 | 44 | print '<div><span>'._("Range").'</span>'; |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | } |
48 | 48 | */ |
49 | 49 | if ($spotter_item['type'] == 'wx') { |
50 | - $weather = json_decode($spotter_item['description'],true); |
|
50 | + $weather = json_decode($spotter_item['description'], true); |
|
51 | 51 | //print_r($weather); |
52 | 52 | if (isset($weather['temp'])) print '<div><span>'._("Temperature").'</span>'.$weather['temp'].'°C</div>'; |
53 | 53 | if (isset($weather['pressure'])) print '<div><span>'._("Pressure").'</span>'.$weather['pressure'].'hPa</div>'; |
@@ -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 | $limit_start = $limit_explode[0]; |
19 | 19 | $limit_end = $limit_explode[1]; |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | $country = ucwords(str_replace("-", " ", $_GET['country'])); |
31 | 31 | |
32 | 32 | $page_url = $globalURL.'/country/'.$_GET['country']; |
33 | - $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
33 | + $sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
34 | 34 | if ($country == 'Na') { |
35 | 35 | $spotter_array = array(); |
36 | 36 | } else { |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | |
44 | 44 | if (!empty($spotter_array)) |
45 | 45 | { |
46 | - $title = sprintf(_("Detailed View for Airports & Airlines from %s"),$country); |
|
46 | + $title = sprintf(_("Detailed View for Airports & Airlines from %s"), $country); |
|
47 | 47 | |
48 | 48 | require_once('header.php'); |
49 | 49 | print '<div class="select-item">'; |
@@ -51,9 +51,9 @@ discard block |
||
51 | 51 | print '<select name="country" class="selectpicker" data-live-search="true">'; |
52 | 52 | print '<option></option>'; |
53 | 53 | $all_countries = $Spotter->getAllCountries(); |
54 | - foreach($all_countries as $all_country) |
|
54 | + foreach ($all_countries as $all_country) |
|
55 | 55 | { |
56 | - if($country == $all_country['country']) |
|
56 | + if ($country == $all_country['country']) |
|
57 | 57 | { |
58 | 58 | print '<option value="'.strtolower(str_replace(" ", "-", $all_country['country'])).'" selected="selected">'.$all_country['country'].'</option>'; |
59 | 59 | } else { |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | if ($_GET['country'] != "NA") |
69 | 69 | { |
70 | 70 | print '<div class="info column">'; |
71 | - print '<h1>'.sprintf(_("Airports & Airlines from %s"),$country).'</h1>'; |
|
71 | + print '<h1>'.sprintf(_("Airports & Airlines from %s"), $country).'</h1>'; |
|
72 | 72 | print '</div>'; |
73 | 73 | } else { |
74 | 74 | 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>'; |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | |
77 | 77 | include('country-sub-menu.php'); |
78 | 78 | print '<div class="table column">'; |
79 | - 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>'; |
|
79 | + 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>'; |
|
80 | 80 | |
81 | 81 | include('table-output.php'); |
82 | 82 | print '<div class="pagination">'; |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | $output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">'; |
15 | 15 | |
16 | 16 | $spotter_array = $Spotter->getAllFlightsforSitemap(); |
17 | - foreach($spotter_array as $spotter_item) |
|
17 | + foreach ($spotter_array as $spotter_item) |
|
18 | 18 | { |
19 | 19 | $output .= '<url>'; |
20 | 20 | $output .= '<loc>'.'http://'.$_SERVER['HTTP_HOST'].$globalURL.'/flightid/'.$spotter_item['spotter_id'].'</loc>'; |
@@ -25,13 +25,13 @@ discard block |
||
25 | 25 | $output .= '</urlset>'; |
26 | 26 | |
27 | 27 | |
28 | -} else if (isset($_GET['type']) && $_GET['type'] == "aircraft"){ |
|
28 | +} else if (isset($_GET['type']) && $_GET['type'] == "aircraft") { |
|
29 | 29 | |
30 | 30 | $output .= '<?xml version="1.0" encoding="UTF-8"?>'; |
31 | 31 | $output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">'; |
32 | 32 | $aircraft_types = $Stats->getAllAircraftTypes(); |
33 | 33 | if (empty($aircraft_types)) $aircraft_types = $Spotter->getAllAircraftTypes(); |
34 | - foreach($aircraft_types as $aircraft_item) |
|
34 | + foreach ($aircraft_types as $aircraft_item) |
|
35 | 35 | { |
36 | 36 | $output .= '<url>'; |
37 | 37 | $output .= '<loc>'.'http://'.$_SERVER['HTTP_HOST'].$globalURL.'/aircraft/'.urlencode($aircraft_item['aircraft_icao']).'</loc>'; |
@@ -42,13 +42,13 @@ discard block |
||
42 | 42 | $output .= '</urlset>'; |
43 | 43 | |
44 | 44 | |
45 | -} else if (isset($_GET['type']) && $_GET['type'] == "registration"){ |
|
45 | +} else if (isset($_GET['type']) && $_GET['type'] == "registration") { |
|
46 | 46 | |
47 | 47 | $output .= '<?xml version="1.0" encoding="UTF-8"?>'; |
48 | 48 | $output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">'; |
49 | 49 | |
50 | 50 | $aircraft_registrations = $Spotter->getAllAircraftRegistrations(); |
51 | - foreach($aircraft_registrations as $aircraft_item) |
|
51 | + foreach ($aircraft_registrations as $aircraft_item) |
|
52 | 52 | { |
53 | 53 | $output .= '<url>'; |
54 | 54 | $output .= '<loc>'.'http://'.$_SERVER['HTTP_HOST'].$globalURL.'/registration/'.urlencode($aircraft_item['registration']).'</loc>'; |
@@ -58,13 +58,13 @@ discard block |
||
58 | 58 | } |
59 | 59 | $output .= '</urlset>'; |
60 | 60 | |
61 | -} else if (isset($_GET['type']) && $_GET['type'] == "airline"){ |
|
61 | +} else if (isset($_GET['type']) && $_GET['type'] == "airline") { |
|
62 | 62 | |
63 | 63 | $output .= '<?xml version="1.0" encoding="UTF-8"?>'; |
64 | 64 | $output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">'; |
65 | 65 | |
66 | 66 | $airline_names = $Stats->getAllAirlineNames(); |
67 | - foreach($airline_names as $airline_item) |
|
67 | + foreach ($airline_names as $airline_item) |
|
68 | 68 | { |
69 | 69 | $output .= '<url>'; |
70 | 70 | $output .= '<loc>'.'http://'.$_SERVER['HTTP_HOST'].$globalURL.'/airline/'.urlencode($airline_item['airline_icao']).'</loc>'; |
@@ -74,14 +74,14 @@ discard block |
||
74 | 74 | } |
75 | 75 | $output .= '</urlset>'; |
76 | 76 | |
77 | -} else if (isset($_GET['type']) && $_GET['type'] == "airport"){ |
|
77 | +} else if (isset($_GET['type']) && $_GET['type'] == "airport") { |
|
78 | 78 | |
79 | 79 | $output .= '<?xml version="1.0" encoding="UTF-8"?>'; |
80 | 80 | $output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">'; |
81 | 81 | |
82 | 82 | $airport_names = $Stats->getAllAirportNames(); |
83 | 83 | if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames(); |
84 | - foreach($airport_names as $airport_item) |
|
84 | + foreach ($airport_names as $airport_item) |
|
85 | 85 | { |
86 | 86 | $output .= '<url>'; |
87 | 87 | $output .= '<loc>'.'http://'.$_SERVER['HTTP_HOST'].$globalURL.'/airport/'.$airport_item['airport_icao'].'</loc>'; |
@@ -91,14 +91,14 @@ discard block |
||
91 | 91 | } |
92 | 92 | $output .= '</urlset>'; |
93 | 93 | |
94 | -} else if (isset($_GET['type']) && $_GET['type'] == "manufacturer"){ |
|
94 | +} else if (isset($_GET['type']) && $_GET['type'] == "manufacturer") { |
|
95 | 95 | |
96 | 96 | $output .= '<?xml version="1.0" encoding="UTF-8"?>'; |
97 | 97 | $output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">'; |
98 | 98 | |
99 | 99 | $manufacturer_names = $Stats->getAllManufacturers(); |
100 | 100 | if (empty($manufacturer_names)) $manufacturer_names = $Spotter->getAllManufacturers(); |
101 | - foreach($manufacturer_names as $manufacturer_item) |
|
101 | + foreach ($manufacturer_names as $manufacturer_item) |
|
102 | 102 | { |
103 | 103 | $output .= '<url>'; |
104 | 104 | $output .= '<loc>'.'http://'.$_SERVER['HTTP_HOST'].$globalURL.'/manufacturer/'.urlencode(strtolower(str_replace(" ", "-", $manufacturer_item['aircraft_manufacturer']))).'</loc>'; |
@@ -108,13 +108,13 @@ discard block |
||
108 | 108 | } |
109 | 109 | $output .= '</urlset>'; |
110 | 110 | |
111 | -} else if (isset($_GET['type']) && $_GET['type'] == "country"){ |
|
111 | +} else if (isset($_GET['type']) && $_GET['type'] == "country") { |
|
112 | 112 | |
113 | 113 | $output .= '<?xml version="1.0" encoding="UTF-8"?>'; |
114 | 114 | $output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">'; |
115 | 115 | |
116 | 116 | $country_names = $Spotter->getAllCountries(); |
117 | - foreach($country_names as $country_item) |
|
117 | + foreach ($country_names as $country_item) |
|
118 | 118 | { |
119 | 119 | $output .= '<url>'; |
120 | 120 | $output .= '<loc>'.'http://'.$_SERVER['HTTP_HOST'].$globalURL.'/country/'.urlencode(strtolower(str_replace(" ", "-", $country_item['country']))).'</loc>'; |
@@ -124,13 +124,13 @@ discard block |
||
124 | 124 | } |
125 | 125 | $output .= '</urlset>'; |
126 | 126 | |
127 | -} else if (isset($_GET['type']) && $_GET['type'] == "ident"){ |
|
127 | +} else if (isset($_GET['type']) && $_GET['type'] == "ident") { |
|
128 | 128 | |
129 | 129 | $output .= '<?xml version="1.0" encoding="UTF-8"?>'; |
130 | 130 | $output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">'; |
131 | 131 | |
132 | 132 | $ident_names = $Spotter->getAllIdents(); |
133 | - foreach($ident_names as $ident_item) |
|
133 | + foreach ($ident_names as $ident_item) |
|
134 | 134 | { |
135 | 135 | if (ctype_alnum($ident_item['ident'])) { |
136 | 136 | $output .= '<url>'; |
@@ -142,13 +142,13 @@ discard block |
||
142 | 142 | } |
143 | 143 | $output .= '</urlset>'; |
144 | 144 | |
145 | -} else if (isset($_GET['type']) && $_GET['type'] == "date"){ |
|
145 | +} else if (isset($_GET['type']) && $_GET['type'] == "date") { |
|
146 | 146 | |
147 | 147 | $output .= '<?xml version="1.0" encoding="UTF-8"?>'; |
148 | 148 | $output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">'; |
149 | 149 | |
150 | 150 | $date_names = $Spotter->getAllDates(); |
151 | - foreach($date_names as $date_item) |
|
151 | + foreach ($date_names as $date_item) |
|
152 | 152 | { |
153 | 153 | $output .= '<url>'; |
154 | 154 | $output .= '<loc>'.'http://'.$_SERVER['HTTP_HOST'].$globalURL.'/date/'.date("Y-m-d", strtotime($date_item['date'])).'</loc>'; |
@@ -158,13 +158,13 @@ discard block |
||
158 | 158 | } |
159 | 159 | $output .= '</urlset>'; |
160 | 160 | |
161 | -} else if (isset($_GET['type']) && $_GET['type'] == "route"){ |
|
161 | +} else if (isset($_GET['type']) && $_GET['type'] == "route") { |
|
162 | 162 | |
163 | 163 | $output .= '<?xml version="1.0" encoding="UTF-8"?>'; |
164 | 164 | $output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">'; |
165 | 165 | |
166 | 166 | $route_names = $Spotter->getAllRoutes(); |
167 | - foreach($route_names as $route_item) |
|
167 | + foreach ($route_names as $route_item) |
|
168 | 168 | { |
169 | 169 | $output .= '<url>'; |
170 | 170 | $output .= '<loc>'.'http://'.$_SERVER['HTTP_HOST'].$globalURL.'/route/'.$route_item['airport_departure_icao'].'/'.$route_item['airport_arrival_icao'].'</loc>'; |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | } |
175 | 175 | $output .= '</urlset>'; |
176 | 176 | |
177 | -} else if (isset($_GET['type']) && $_GET['type'] == "static"){ |
|
177 | +} else if (isset($_GET['type']) && $_GET['type'] == "static") { |
|
178 | 178 | |
179 | 179 | $output .= '<?xml version="1.0" encoding="UTF-8"?>'; |
180 | 180 | $output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">'; |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | try { |
17 | 17 | $sth = $this->db->prepare($query); |
18 | 18 | $sth->execute($query_values); |
19 | - } catch(PDOException $e) { |
|
19 | + } catch (PDOException $e) { |
|
20 | 20 | return "error : ".$e->getMessage(); |
21 | 21 | } |
22 | 22 | $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
@@ -29,20 +29,20 @@ discard block |
||
29 | 29 | try { |
30 | 30 | $sth = $this->db->prepare($query); |
31 | 31 | $sth->execute($query_values); |
32 | - } catch(PDOException $e) { |
|
32 | + } catch (PDOException $e) { |
|
33 | 33 | return "error : ".$e->getMessage(); |
34 | 34 | } |
35 | 35 | $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
36 | 36 | return $all; |
37 | 37 | } |
38 | 38 | |
39 | - public function getLocationInfobyNameType($name,$type) { |
|
39 | + public function getLocationInfobyNameType($name, $type) { |
|
40 | 40 | $query = "SELECT * FROM source_location WHERE name = :name AND type = :type"; |
41 | - $query_values = array(':name' => $name,':type' => $type); |
|
41 | + $query_values = array(':name' => $name, ':type' => $type); |
|
42 | 42 | try { |
43 | 43 | $sth = $this->db->prepare($query); |
44 | 44 | $sth->execute($query_values); |
45 | - } catch(PDOException $e) { |
|
45 | + } catch (PDOException $e) { |
|
46 | 46 | return "error : ".$e->getMessage(); |
47 | 47 | } |
48 | 48 | $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | try { |
56 | 56 | $sth = $this->db->prepare($query); |
57 | 57 | $sth->execute($query_values); |
58 | - } catch(PDOException $e) { |
|
58 | + } catch (PDOException $e) { |
|
59 | 59 | return "error : ".$e->getMessage(); |
60 | 60 | } |
61 | 61 | $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
@@ -65,10 +65,10 @@ discard block |
||
65 | 65 | public function getLocationInfoByType($type, $coord = array(), $limit = false) { |
66 | 66 | $query = "SELECT * FROM source_location WHERE type = :type"; |
67 | 67 | if (is_array($coord) && !empty($coord)) { |
68 | - $minlong = filter_var($coord[0],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
69 | - $minlat = filter_var($coord[1],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
70 | - $maxlong = filter_var($coord[2],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
71 | - $maxlat = filter_var($coord[3],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
68 | + $minlong = filter_var($coord[0], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
69 | + $minlat = filter_var($coord[1], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
70 | + $maxlong = filter_var($coord[2], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
71 | + $maxlat = filter_var($coord[3], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
72 | 72 | $query .= " AND source_location.latitude BETWEEN ".$minlat." AND ".$maxlat." AND source_location.longitude BETWEEN ".$minlong." AND ".$maxlong." AND source_location.latitude <> 0 AND source_location.longitude <> 0"; |
73 | 73 | } |
74 | 74 | $query .= " ORDER BY last_seen DESC"; |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | try { |
78 | 78 | $sth = $this->db->prepare($query); |
79 | 79 | $sth->execute($query_values); |
80 | - } catch(PDOException $e) { |
|
80 | + } catch (PDOException $e) { |
|
81 | 81 | return "error : ".$e->getMessage(); |
82 | 82 | } |
83 | 83 | $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | try { |
91 | 91 | $sth = $this->db->prepare($query); |
92 | 92 | $sth->execute($query_values); |
93 | - } catch(PDOException $e) { |
|
93 | + } catch (PDOException $e) { |
|
94 | 94 | return "error : ".$e->getMessage(); |
95 | 95 | } |
96 | 96 | $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
@@ -103,56 +103,56 @@ discard block |
||
103 | 103 | try { |
104 | 104 | $sth = $this->db->prepare($query); |
105 | 105 | $sth->execute($query_values); |
106 | - } catch(PDOException $e) { |
|
106 | + } catch (PDOException $e) { |
|
107 | 107 | return "error : ".$e->getMessage(); |
108 | 108 | } |
109 | 109 | $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
110 | 110 | return $all; |
111 | 111 | } |
112 | 112 | |
113 | - public function addLocation($name,$latitude,$longitude,$altitude,$city,$country,$source,$logo = 'antenna.png',$type = '',$source_id = 0,$location_id = 0,$last_seen = '', $description = '') { |
|
113 | + public function addLocation($name, $latitude, $longitude, $altitude, $city, $country, $source, $logo = 'antenna.png', $type = '', $source_id = 0, $location_id = 0, $last_seen = '', $description = '') { |
|
114 | 114 | if ($last_seen == '') $last_seen = date('Y-m-d H:i:s'); |
115 | 115 | $query = "INSERT INTO source_location (name,latitude,longitude,altitude,country,city,logo,source,type,source_id,last_seen,location_id,description) VALUES (:name,:latitude,:longitude,:altitude,:country,:city,:logo,:source,:type,:source_id,:last_seen,:location_id,:description)"; |
116 | - $query_values = array(':name' => $name,':latitude' => $latitude, ':longitude' => $longitude,':altitude' => $altitude,':city' => $city,':country' => $country,':logo' => $logo,':source' => $source,':type' => $type,':source_id' => $source_id,':last_seen' => $last_seen,':location_id' => $location_id,':description' => $description); |
|
116 | + $query_values = array(':name' => $name, ':latitude' => $latitude, ':longitude' => $longitude, ':altitude' => $altitude, ':city' => $city, ':country' => $country, ':logo' => $logo, ':source' => $source, ':type' => $type, ':source_id' => $source_id, ':last_seen' => $last_seen, ':location_id' => $location_id, ':description' => $description); |
|
117 | 117 | try { |
118 | 118 | $sth = $this->db->prepare($query); |
119 | 119 | $sth->execute($query_values); |
120 | - } catch(PDOException $e) { |
|
120 | + } catch (PDOException $e) { |
|
121 | 121 | echo "error : ".$e->getMessage(); |
122 | 122 | } |
123 | 123 | } |
124 | 124 | |
125 | - public function updateLocation($name,$latitude,$longitude,$altitude,$city,$country,$source,$logo = 'antenna.png',$type = '',$source_id = 0,$location_id = 0,$last_seen = '',$description = '') { |
|
125 | + public function updateLocation($name, $latitude, $longitude, $altitude, $city, $country, $source, $logo = 'antenna.png', $type = '', $source_id = 0, $location_id = 0, $last_seen = '', $description = '') { |
|
126 | 126 | if ($last_seen == '') $last_seen = date('Y-m-d H:i:s'); |
127 | 127 | $query = "UPDATE source_location SET latitude = :latitude,longitude = :longitude,altitude = :altitude,country = :country,city = :city,logo = :logo,type = :type, source_id = :source_id, last_seen = :last_seen,location_id = :location_id, description = :description WHERE name = :name AND source = :source"; |
128 | - $query_values = array(':name' => $name,':latitude' => $latitude, ':longitude' => $longitude,':altitude' => $altitude,':city' => $city,':country' => $country,':logo' => $logo,':source' => $source,':type' => $type,':source_id' => $source_id,':last_seen' => $last_seen,':location_id' => $location_id,':description' => $description); |
|
128 | + $query_values = array(':name' => $name, ':latitude' => $latitude, ':longitude' => $longitude, ':altitude' => $altitude, ':city' => $city, ':country' => $country, ':logo' => $logo, ':source' => $source, ':type' => $type, ':source_id' => $source_id, ':last_seen' => $last_seen, ':location_id' => $location_id, ':description' => $description); |
|
129 | 129 | try { |
130 | 130 | $sth = $this->db->prepare($query); |
131 | 131 | $sth->execute($query_values); |
132 | - } catch(PDOException $e) { |
|
132 | + } catch (PDOException $e) { |
|
133 | 133 | return "error : ".$e->getMessage(); |
134 | 134 | } |
135 | 135 | } |
136 | 136 | |
137 | - public function updateLocationDescByName($name,$source,$source_id = 0,$description = '') { |
|
137 | + public function updateLocationDescByName($name, $source, $source_id = 0, $description = '') { |
|
138 | 138 | $query = "UPDATE source_location SET description = :description WHERE source_id = :source_id AND name = :name AND source = :source"; |
139 | - $query_values = array(':name' => $name,':source' => $source,':source_id' => $source_id,':description' => $description); |
|
139 | + $query_values = array(':name' => $name, ':source' => $source, ':source_id' => $source_id, ':description' => $description); |
|
140 | 140 | try { |
141 | 141 | $sth = $this->db->prepare($query); |
142 | 142 | $sth->execute($query_values); |
143 | - } catch(PDOException $e) { |
|
143 | + } catch (PDOException $e) { |
|
144 | 144 | return "error : ".$e->getMessage(); |
145 | 145 | } |
146 | 146 | } |
147 | 147 | |
148 | - public function updateLocationByLocationID($name,$latitude,$longitude,$altitude,$city,$country,$source,$logo = 'antenna.png',$type = '',$source_id = 0, $location_id,$last_seen = '',$description = '') { |
|
148 | + public function updateLocationByLocationID($name, $latitude, $longitude, $altitude, $city, $country, $source, $logo = 'antenna.png', $type = '', $source_id = 0, $location_id, $last_seen = '', $description = '') { |
|
149 | 149 | if ($last_seen == '') $last_seen = date('Y-m-d H:i:s'); |
150 | 150 | $query = "UPDATE source_location SET latitude = :latitude,longitude = :longitude,altitude = :altitude,country = :country,city = :city,logo = :logo,type = :type, last_seen = :last_seen, description = :description WHERE location_id = :location_id AND source = :source AND source_id = :source_id"; |
151 | - $query_values = array(':source_id' => $source_id,':latitude' => $latitude, ':longitude' => $longitude,':altitude' => $altitude,':city' => $city,':country' => $country,':logo' => $logo,':source' => $source,':type' => $type,':last_seen' => $last_seen,':location_id' => $location_id,':description' => $description); |
|
151 | + $query_values = array(':source_id' => $source_id, ':latitude' => $latitude, ':longitude' => $longitude, ':altitude' => $altitude, ':city' => $city, ':country' => $country, ':logo' => $logo, ':source' => $source, ':type' => $type, ':last_seen' => $last_seen, ':location_id' => $location_id, ':description' => $description); |
|
152 | 152 | try { |
153 | 153 | $sth = $this->db->prepare($query); |
154 | 154 | $sth->execute($query_values); |
155 | - } catch(PDOException $e) { |
|
155 | + } catch (PDOException $e) { |
|
156 | 156 | echo "error : ".$e->getMessage(); |
157 | 157 | } |
158 | 158 | } |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | try { |
164 | 164 | $sth = $this->db->prepare($query); |
165 | 165 | $sth->execute($query_values); |
166 | - } catch(PDOException $e) { |
|
166 | + } catch (PDOException $e) { |
|
167 | 167 | return "error : ".$e->getMessage(); |
168 | 168 | } |
169 | 169 | } |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | try { |
175 | 175 | $sth = $this->db->prepare($query); |
176 | 176 | $sth->execute($query_values); |
177 | - } catch(PDOException $e) { |
|
177 | + } catch (PDOException $e) { |
|
178 | 178 | return "error : ".$e->getMessage(); |
179 | 179 | } |
180 | 180 | } |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | try { |
186 | 186 | $sth = $this->db->prepare($query); |
187 | 187 | $sth->execute($query_values); |
188 | - } catch(PDOException $e) { |
|
188 | + } catch (PDOException $e) { |
|
189 | 189 | return "error : ".$e->getMessage(); |
190 | 190 | } |
191 | 191 | } |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | try { |
196 | 196 | $sth = $this->db->prepare($query); |
197 | 197 | $sth->execute(); |
198 | - } catch(PDOException $e) { |
|
198 | + } catch (PDOException $e) { |
|
199 | 199 | return "error : ".$e->getMessage(); |
200 | 200 | } |
201 | 201 | } |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | try { |
225 | 225 | $sth = $this->db->prepare($query); |
226 | 226 | $sth->execute(array(':type' => $type)); |
227 | - } catch(PDOException $e) { |
|
227 | + } catch (PDOException $e) { |
|
228 | 228 | return "error"; |
229 | 229 | } |
230 | 230 | return "success"; |
@@ -48,11 +48,11 @@ discard block |
||
48 | 48 | $s3 = sin($bank/2); |
49 | 49 | $c1c2 = $c1*$c2; |
50 | 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); |
|
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 | } |
@@ -73,16 +73,16 @@ discard block |
||
73 | 73 | $min = false; |
74 | 74 | $allhistory = false; |
75 | 75 | $filter['source'] = array(); |
76 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
77 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
78 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
79 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs')); |
|
80 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
81 | -if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
82 | -if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
83 | -if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
84 | -if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
85 | -if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING); |
|
76 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'], array('vatsimtxt')); |
|
77 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'], array('whazzup')); |
|
78 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'], array('phpvmacars')); |
|
79 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'], array('sbs', 'famaprs')); |
|
80 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'], array('aprs')); |
|
81 | +if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'], FILTER_SANITIZE_STRING); |
|
82 | +if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',', $_COOKIE['filter_Airlines']), FILTER_SANITIZE_STRING); |
|
83 | +if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',', $_COOKIE['filter_Sources']), FILTER_SANITIZE_STRING); |
|
84 | +if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'], FILTER_SANITIZE_STRING); |
|
85 | +if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'], FILTER_SANITIZE_STRING); |
|
86 | 86 | /* |
87 | 87 | if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) { |
88 | 88 | $min = true; |
@@ -129,12 +129,12 @@ discard block |
||
129 | 129 | $from_archive = true; |
130 | 130 | // $begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
131 | 131 | // $enddate = filter_input(INPUT_GET,'enddate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
132 | - $begindate = filter_input(INPUT_GET,'begindate',FILTER_SANITIZE_NUMBER_INT); |
|
133 | - $enddate = filter_input(INPUT_GET,'enddate',FILTER_SANITIZE_NUMBER_INT); |
|
134 | - $archivespeed = filter_input(INPUT_GET,'speed',FILTER_SANITIZE_NUMBER_INT); |
|
135 | - $begindate = date('Y-m-d H:i:s',$begindate); |
|
136 | - $enddate = date('Y-m-d H:i:s',$enddate); |
|
137 | - $spotter_array = $SpotterArchive->getMinLiveSpotterDataPlayback($begindate,$enddate,$filter); |
|
132 | + $begindate = filter_input(INPUT_GET, 'begindate', FILTER_SANITIZE_NUMBER_INT); |
|
133 | + $enddate = filter_input(INPUT_GET, 'enddate', FILTER_SANITIZE_NUMBER_INT); |
|
134 | + $archivespeed = filter_input(INPUT_GET, 'speed', FILTER_SANITIZE_NUMBER_INT); |
|
135 | + $begindate = date('Y-m-d H:i:s', $begindate); |
|
136 | + $enddate = date('Y-m-d H:i:s', $enddate); |
|
137 | + $spotter_array = $SpotterArchive->getMinLiveSpotterDataPlayback($begindate, $enddate, $filter); |
|
138 | 138 | } elseif (isset($_COOKIE['archive']) && isset($_COOKIE['archive_begin']) && isset($_COOKIE['archive_end']) && isset($_COOKIE['archive_speed'])) { |
139 | 139 | $from_archive = true; |
140 | 140 | // $begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
@@ -144,34 +144,34 @@ discard block |
||
144 | 144 | $begindate = $_COOKIE['archive_begin']; |
145 | 145 | $enddate = $_COOKIE['archive_end']; |
146 | 146 | |
147 | - $archivespeed = filter_var($_COOKIE['archive_speed'],FILTER_SANITIZE_NUMBER_INT); |
|
148 | - $begindate = date('Y-m-d H:i:s',$begindate); |
|
149 | - $enddate = date('Y-m-d H:i:s',$enddate); |
|
147 | + $archivespeed = filter_var($_COOKIE['archive_speed'], FILTER_SANITIZE_NUMBER_INT); |
|
148 | + $begindate = date('Y-m-d H:i:s', $begindate); |
|
149 | + $enddate = date('Y-m-d H:i:s', $enddate); |
|
150 | 150 | // echo 'Begin : '.$begindate.' - End : '.$enddate."\n"; |
151 | - $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate,$enddate,$filter); |
|
151 | + $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate, $enddate, $filter); |
|
152 | 152 | } elseif ($tracker) { |
153 | 153 | $coord = array(); |
154 | 154 | if (isset($_GET['coord']) && $_GET['coord'] != '') { |
155 | - $coord = explode(',',$_GET['coord']); |
|
155 | + $coord = explode(',', $_GET['coord']); |
|
156 | 156 | } |
157 | - $spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord,$filter,true); |
|
157 | + $spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord, $filter, true); |
|
158 | 158 | } elseif ($marine) { |
159 | 159 | $coord = array(); |
160 | 160 | if (isset($_GET['coord']) && $_GET['coord'] != '') { |
161 | - $coord = explode(',',$_GET['coord']); |
|
161 | + $coord = explode(',', $_GET['coord']); |
|
162 | 162 | } |
163 | - $spotter_array = $MarineLive->getMinLastLiveMarineData($coord,$filter,true); |
|
163 | + $spotter_array = $MarineLive->getMinLastLiveMarineData($coord, $filter, true); |
|
164 | 164 | } else { |
165 | 165 | $coord = array(); |
166 | 166 | if (isset($_GET['coord']) && $_GET['coord'] != '') { |
167 | - $coord = explode(',',$_GET['coord']); |
|
167 | + $coord = explode(',', $_GET['coord']); |
|
168 | 168 | } |
169 | - $spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord,$filter,true); |
|
169 | + $spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord, $filter, true); |
|
170 | 170 | } |
171 | 171 | //print_r($spotter_array); |
172 | 172 | if (!empty($spotter_array) && isset($coord)) { |
173 | 173 | if (isset($_GET['archive'])) { |
174 | - $flightcnt = $SpotterArchive->getLiveSpotterCount($begindate,$enddate,$filter); |
|
174 | + $flightcnt = $SpotterArchive->getLiveSpotterCount($begindate, $enddate, $filter); |
|
175 | 175 | } elseif ($tracker) { |
176 | 176 | $flightcnt = $TrackerLive->getLiveTrackerCount($filter); |
177 | 177 | } elseif ($marine) { |
@@ -182,15 +182,15 @@ discard block |
||
182 | 182 | if ($flightcnt == '') $flightcnt = 0; |
183 | 183 | } else $flightcnt = 0; |
184 | 184 | |
185 | -$sqltime = round(microtime(true)-$begintime,2); |
|
185 | +$sqltime = round(microtime(true) - $begintime, 2); |
|
186 | 186 | $minitime = time(); |
187 | 187 | $maxitime = 0; |
188 | -$lastupdate = filter_input(INPUT_GET,'update',FILTER_SANITIZE_NUMBER_INT); |
|
188 | +$lastupdate = filter_input(INPUT_GET, 'update', FILTER_SANITIZE_NUMBER_INT); |
|
189 | 189 | $modelsdb = array(); |
190 | 190 | if (file_exists(dirname(__FILE__).'/models/modelsdb')) { |
191 | - if (($handle = fopen(dirname(__FILE__).'/models/modelsdb','r')) !== FALSE) { |
|
192 | - while (($row = fgetcsv($handle,1000)) !== FALSE) { |
|
193 | - if (isset($row[1]) ){ |
|
191 | + if (($handle = fopen(dirname(__FILE__).'/models/modelsdb', 'r')) !== FALSE) { |
|
192 | + while (($row = fgetcsv($handle, 1000)) !== FALSE) { |
|
193 | + if (isset($row[1])) { |
|
194 | 194 | $model = $row[0]; |
195 | 195 | $modelsdb[$model] = $row[1]; |
196 | 196 | } |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | if (!empty($spotter_array) && is_array($spotter_array)) |
228 | 228 | { |
229 | 229 | $nblatlong = 0; |
230 | - foreach($spotter_array as $spotter_item) |
|
230 | + foreach ($spotter_array as $spotter_item) |
|
231 | 231 | { |
232 | 232 | $j++; |
233 | 233 | //if (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'airwhere') $heightrelative = 'RELATIVE_TO_GROUND'; |
@@ -267,11 +267,11 @@ discard block |
||
267 | 267 | $output .= '"lastupdate": "'.$lastupdate.'",'; |
268 | 268 | $output .= '"format": "'.$spotter_item['format_source'].'",'; |
269 | 269 | if ($tracker) { |
270 | - $output.= '"type": "tracker"'; |
|
270 | + $output .= '"type": "tracker"'; |
|
271 | 271 | } elseif ($marine) { |
272 | - $output.= '"type": "marine"'; |
|
272 | + $output .= '"type": "marine"'; |
|
273 | 273 | } else { |
274 | - $output.= '"type": "flight"'; |
|
274 | + $output .= '"type": "flight"'; |
|
275 | 275 | } |
276 | 276 | $output .= '},'; |
277 | 277 | |
@@ -615,8 +615,8 @@ discard block |
||
615 | 615 | $output .= '},'; |
616 | 616 | } |
617 | 617 | } |
618 | - if (isset($onground) && $onground) $output = str_replace('%onground%','true',$output); |
|
619 | - else $output = str_replace('%onground%','false',$output); |
|
618 | + if (isset($onground) && $onground) $output = str_replace('%onground%', 'true', $output); |
|
619 | + else $output = str_replace('%onground%', 'false', $output); |
|
620 | 620 | |
621 | 621 | // $output .= '"heightReference": "CLAMP_TO_GROUND",'; |
622 | 622 | //$output .= '"heightReference": "'.$heightrelative.'",'; |
@@ -631,7 +631,7 @@ discard block |
||
631 | 631 | $output .= '"cartographicDegrees": ['; |
632 | 632 | if ($minitime > strtotime($spotter_item['date'])) $minitime = strtotime($spotter_item['date']); |
633 | 633 | if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']); |
634 | - $output .= '"'.date("c",strtotime($spotter_item['date'])).'", '; |
|
634 | + $output .= '"'.date("c", strtotime($spotter_item['date'])).'", '; |
|
635 | 635 | $output .= $spotter_item['longitude'].', '; |
636 | 636 | $output .= $spotter_item['latitude']; |
637 | 637 | $prevlong = $spotter_item['longitude']; |
@@ -659,8 +659,8 @@ discard block |
||
659 | 659 | //$quat = quaternionrotate(deg2rad($spotter_item['heading']),deg2rad(0),deg2rad(0)); |
660 | 660 | //$orientation .= '"'.date("c",strtotime($spotter_item['date'])).'",'.$quat['x'].','.$quat['y'].','.$quat['z'].','.$quat['w']; |
661 | 661 | } else { |
662 | - $nblatlong = $nblatlong+1; |
|
663 | - $output .= ',"'.date("c",strtotime($spotter_item['date'])).'", '; |
|
662 | + $nblatlong = $nblatlong + 1; |
|
663 | + $output .= ',"'.date("c", strtotime($spotter_item['date'])).'", '; |
|
664 | 664 | if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']); |
665 | 665 | if ($spotter_item['ground_speed'] == 0) { |
666 | 666 | $output .= $prevlong.', '; |
@@ -700,15 +700,15 @@ discard block |
||
700 | 700 | } |
701 | 701 | $output .= ']'; |
702 | 702 | if (isset($globalArchive) && $globalArchive === TRUE) { |
703 | - if ((time()-$globalLiveInterval) > $minitime) { |
|
704 | - if (time()-$globalLiveInterval > $maxitime) { |
|
705 | - $output = str_replace('%minitime%',date("c",$maxitime),$output); |
|
703 | + if ((time() - $globalLiveInterval) > $minitime) { |
|
704 | + if (time() - $globalLiveInterval > $maxitime) { |
|
705 | + $output = str_replace('%minitime%', date("c", $maxitime), $output); |
|
706 | 706 | } else { |
707 | - $output = str_replace('%minitime%',date("c",time()-$globalLiveInterval),$output); |
|
707 | + $output = str_replace('%minitime%', date("c", time() - $globalLiveInterval), $output); |
|
708 | 708 | } |
709 | 709 | } |
710 | - else $output = str_replace('%minitime%',date("c",$minitime),$output); |
|
711 | -} else $output = str_replace('%minitime%',date("c",$minitime),$output); |
|
712 | -$output = str_replace('%maxitime%',date("c",$maxitime),$output); |
|
710 | + else $output = str_replace('%minitime%', date("c", $minitime), $output); |
|
711 | +} else $output = str_replace('%minitime%', date("c", $minitime), $output); |
|
712 | +$output = str_replace('%maxitime%', date("c", $maxitime), $output); |
|
713 | 713 | print $output; |
714 | 714 | ?> |
@@ -14,12 +14,12 @@ discard block |
||
14 | 14 | * @param Array $headers header to submit with the form |
15 | 15 | * @return String the result |
16 | 16 | */ |
17 | - public function getData($url, $type = 'get', $data = '', $headers = '',$cookie = '',$referer = '',$timeout = '',$useragent = '') { |
|
17 | + public function getData($url, $type = 'get', $data = '', $headers = '', $cookie = '', $referer = '', $timeout = '', $useragent = '') { |
|
18 | 18 | global $globalProxy, $globalForceIPv4; |
19 | 19 | $ch = curl_init(); |
20 | 20 | curl_setopt($ch, CURLOPT_URL, $url); |
21 | 21 | if (isset($globalForceIPv4) && $globalForceIPv4) { |
22 | - if (defined('CURLOPT_IPRESOLVE') && defined('CURL_IPRESOLVE_V4')){ |
|
22 | + if (defined('CURLOPT_IPRESOLVE') && defined('CURL_IPRESOLVE_V4')) { |
|
23 | 23 | curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); |
24 | 24 | } |
25 | 25 | } |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
30 | 30 | curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); |
31 | 31 | curl_setopt($ch, CURLINFO_HEADER_OUT, true); |
32 | - curl_setopt($ch,CURLOPT_ENCODING , "gzip"); |
|
32 | + curl_setopt($ch, CURLOPT_ENCODING, "gzip"); |
|
33 | 33 | //curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 GTB5'); |
34 | 34 | // curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (X11; Linux x86_64; rv:42.0) Gecko/20100101 Firefox/42.0'); |
35 | 35 | if ($useragent == '') { |
@@ -39,13 +39,13 @@ discard block |
||
39 | 39 | } |
40 | 40 | if ($timeout == '') curl_setopt($ch, CURLOPT_TIMEOUT, 10); |
41 | 41 | else curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); |
42 | - curl_setopt($ch, CURLOPT_HEADERFUNCTION, array('Common',"curlResponseHeaderCallback")); |
|
42 | + curl_setopt($ch, CURLOPT_HEADERFUNCTION, array('Common', "curlResponseHeaderCallback")); |
|
43 | 43 | if ($type == 'post') { |
44 | 44 | curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); |
45 | 45 | if (is_array($data)) { |
46 | 46 | curl_setopt($ch, CURLOPT_POST, count($data)); |
47 | 47 | $data_string = ''; |
48 | - foreach($data as $key=>$value) { $data_string .= $key.'='.$value.'&'; } |
|
48 | + foreach ($data as $key=>$value) { $data_string .= $key.'='.$value.'&'; } |
|
49 | 49 | rtrim($data_string, '&'); |
50 | 50 | curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); |
51 | 51 | } else { |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | } |
58 | 58 | if ($cookie != '') { |
59 | 59 | if (is_array($cookie)) { |
60 | - curl_setopt($ch, CURLOPT_COOKIE, implode($cookie,';')); |
|
60 | + curl_setopt($ch, CURLOPT_COOKIE, implode($cookie, ';')); |
|
61 | 61 | } else { |
62 | 62 | curl_setopt($ch, CURLOPT_COOKIE, $cookie); |
63 | 63 | } |
@@ -69,13 +69,13 @@ discard block |
||
69 | 69 | $info = curl_getinfo($ch); |
70 | 70 | //var_dump($info); |
71 | 71 | curl_close($ch); |
72 | - if ($info['http_code'] == '503' && strstr($result,'DDoS protection by CloudFlare')) { |
|
72 | + if ($info['http_code'] == '503' && strstr($result, 'DDoS protection by CloudFlare')) { |
|
73 | 73 | echo "Cloudflare Detected\n"; |
74 | 74 | require_once(dirname(__FILE__).'/libs/cloudflare-bypass/libraries/cloudflareClass.php'); |
75 | 75 | $useragent = UAgent::random(); |
76 | 76 | cloudflare::useUserAgent($useragent); |
77 | 77 | if ($clearanceCookie = cloudflare::bypass($url)) { |
78 | - return $this->getData($url,'get',$data,$headers,$clearanceCookie,$referer,$timeout,$useragent); |
|
78 | + return $this->getData($url, 'get', $data, $headers, $clearanceCookie, $referer, $timeout, $useragent); |
|
79 | 79 | } |
80 | 80 | } else { |
81 | 81 | return $result; |
@@ -106,20 +106,20 @@ discard block |
||
106 | 106 | fclose($fp); |
107 | 107 | } |
108 | 108 | |
109 | - public static function gunzip($in_file,$out_file_name = '') { |
|
109 | + public static function gunzip($in_file, $out_file_name = '') { |
|
110 | 110 | //echo $in_file.' -> '.$out_file_name."\n"; |
111 | 111 | $buffer_size = 4096; // read 4kb at a time |
112 | 112 | if ($out_file_name == '') $out_file_name = str_replace('.gz', '', $in_file); |
113 | 113 | if ($in_file != '' && file_exists($in_file)) { |
114 | 114 | // PHP version of Ubuntu use gzopen64 instead of gzopen |
115 | - if (function_exists('gzopen')) $file = gzopen($in_file,'rb'); |
|
116 | - elseif (function_exists('gzopen64')) $file = gzopen64($in_file,'rb'); |
|
115 | + if (function_exists('gzopen')) $file = gzopen($in_file, 'rb'); |
|
116 | + elseif (function_exists('gzopen64')) $file = gzopen64($in_file, 'rb'); |
|
117 | 117 | else { |
118 | 118 | echo 'gzopen not available'; |
119 | 119 | die; |
120 | 120 | } |
121 | 121 | $out_file = fopen($out_file_name, 'wb'); |
122 | - while(!gzeof($file)) { |
|
122 | + while (!gzeof($file)) { |
|
123 | 123 | fwrite($out_file, gzread($file, $buffer_size)); |
124 | 124 | } |
125 | 125 | fclose($out_file); |
@@ -127,19 +127,19 @@ discard block |
||
127 | 127 | } |
128 | 128 | } |
129 | 129 | |
130 | - public static function bunzip2($in_file,$out_file_name = '') { |
|
130 | + public static function bunzip2($in_file, $out_file_name = '') { |
|
131 | 131 | //echo $in_file.' -> '.$out_file_name."\n"; |
132 | 132 | $buffer_size = 4096; // read 4kb at a time |
133 | 133 | if ($out_file_name == '') $out_file_name = str_replace('.bz2', '', $in_file); |
134 | 134 | if ($in_file != '' && file_exists($in_file)) { |
135 | 135 | // PHP version of Ubuntu use gzopen64 instead of gzopen |
136 | - if (function_exists('bzopen')) $file = bzopen($in_file,'rb'); |
|
136 | + if (function_exists('bzopen')) $file = bzopen($in_file, 'rb'); |
|
137 | 137 | else { |
138 | 138 | echo 'bzopen not available'; |
139 | 139 | die; |
140 | 140 | } |
141 | 141 | $out_file = fopen($out_file_name, 'wb'); |
142 | - while(!feof($file)) { |
|
142 | + while (!feof($file)) { |
|
143 | 143 | fwrite($out_file, bzread($file, $buffer_size)); |
144 | 144 | } |
145 | 145 | fclose($out_file); |
@@ -157,27 +157,27 @@ discard block |
||
157 | 157 | if ($data == '') return array(); |
158 | 158 | $html = str_get_html($data); |
159 | 159 | if ($html === false) return array(); |
160 | - $tabledata=array(); |
|
161 | - foreach($html->find('tr') as $element) |
|
160 | + $tabledata = array(); |
|
161 | + foreach ($html->find('tr') as $element) |
|
162 | 162 | { |
163 | 163 | $td = array(); |
164 | - foreach( $element->find('th') as $row) |
|
164 | + foreach ($element->find('th') as $row) |
|
165 | 165 | { |
166 | 166 | $td [] = trim($row->plaintext); |
167 | 167 | } |
168 | - $td=array_filter($td); |
|
168 | + $td = array_filter($td); |
|
169 | 169 | $tabledata[] = $td; |
170 | 170 | |
171 | 171 | $td = array(); |
172 | 172 | $tdi = array(); |
173 | - foreach( $element->find('td') as $row) |
|
173 | + foreach ($element->find('td') as $row) |
|
174 | 174 | { |
175 | 175 | $td [] = trim($row->plaintext); |
176 | 176 | $tdi [] = trim($row->innertext); |
177 | 177 | } |
178 | - $td=array_filter($td); |
|
179 | - $tdi=array_filter($tdi); |
|
180 | - $tabledata[]=array_merge($td,$tdi); |
|
178 | + $td = array_filter($td); |
|
179 | + $tdi = array_filter($tdi); |
|
180 | + $tabledata[] = array_merge($td, $tdi); |
|
181 | 181 | } |
182 | 182 | $html->clear(); |
183 | 183 | unset($html); |
@@ -192,8 +192,8 @@ discard block |
||
192 | 192 | public function text2array($data) { |
193 | 193 | $html = str_get_html($data); |
194 | 194 | if ($html === false) return array(); |
195 | - $tabledata=array(); |
|
196 | - foreach($html->find('p') as $element) |
|
195 | + $tabledata = array(); |
|
196 | + foreach ($html->find('p') as $element) |
|
197 | 197 | { |
198 | 198 | $tabledata [] = trim($element->plaintext); |
199 | 199 | } |
@@ -213,11 +213,11 @@ discard block |
||
213 | 213 | */ |
214 | 214 | public function distance($lat, $lon, $latc, $lonc, $unit = 'km') { |
215 | 215 | if ($lat == $latc && $lon == $lonc) return 0; |
216 | - $dist = rad2deg(acos(sin(deg2rad(floatval($lat)))*sin(deg2rad(floatval($latc)))+ cos(deg2rad(floatval($lat)))*cos(deg2rad(floatval($latc)))*cos(deg2rad(floatval($lon)-floatval($lonc)))))*60*1.1515; |
|
216 | + $dist = rad2deg(acos(sin(deg2rad(floatval($lat)))*sin(deg2rad(floatval($latc))) + cos(deg2rad(floatval($lat)))*cos(deg2rad(floatval($latc)))*cos(deg2rad(floatval($lon) - floatval($lonc)))))*60*1.1515; |
|
217 | 217 | if ($unit == "km") { |
218 | - return round($dist * 1.609344); |
|
218 | + return round($dist*1.609344); |
|
219 | 219 | } elseif ($unit == "m") { |
220 | - return round($dist * 1.609344 * 1000); |
|
220 | + return round($dist*1.609344*1000); |
|
221 | 221 | } elseif ($unit == "mile" || $unit == "mi") { |
222 | 222 | return round($dist); |
223 | 223 | } elseif ($unit == "nm") { |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | * @param float $distance distance covered |
234 | 234 | * @return whether distance is realistic |
235 | 235 | */ |
236 | - public function withinThreshold ($timeDifference, $distance) { |
|
236 | + public function withinThreshold($timeDifference, $distance) { |
|
237 | 237 | $x = abs($timeDifference); |
238 | 238 | $d = abs($distance); |
239 | 239 | if ($x == 0 || $d == 0) return true; |
@@ -249,12 +249,12 @@ discard block |
||
249 | 249 | return ($array !== array_values($array)); |
250 | 250 | } |
251 | 251 | |
252 | - public function isInteger($input){ |
|
252 | + public function isInteger($input) { |
|
253 | 253 | return(ctype_digit(strval($input))); |
254 | 254 | } |
255 | 255 | |
256 | 256 | |
257 | - public function convertDec($dms,$latlong) { |
|
257 | + public function convertDec($dms, $latlong) { |
|
258 | 258 | if ($latlong == 'latitude') { |
259 | 259 | $deg = substr($dms, 0, 2); |
260 | 260 | $min = substr($dms, 2, 4); |
@@ -262,10 +262,10 @@ discard block |
||
262 | 262 | $deg = substr($dms, 0, 3); |
263 | 263 | $min = substr($dms, 3, 5); |
264 | 264 | } |
265 | - return $deg+(($min*60)/3600); |
|
265 | + return $deg + (($min*60)/3600); |
|
266 | 266 | } |
267 | 267 | |
268 | - public function convertDM($coord,$latlong) { |
|
268 | + public function convertDM($coord, $latlong) { |
|
269 | 269 | if ($latlong == 'latitude') { |
270 | 270 | if ($coord < 0) $NSEW = 'S'; |
271 | 271 | else $NSEW = 'N'; |
@@ -275,9 +275,9 @@ discard block |
||
275 | 275 | } |
276 | 276 | $coord = abs($coord); |
277 | 277 | $deg = floor($coord); |
278 | - $coord = ($coord-$deg)*60; |
|
278 | + $coord = ($coord - $deg)*60; |
|
279 | 279 | $min = $coord; |
280 | - return array('deg' => $deg,'min' => $min,'NSEW' => $NSEW); |
|
280 | + return array('deg' => $deg, 'min' => $min, 'NSEW' => $NSEW); |
|
281 | 281 | } |
282 | 282 | |
283 | 283 | /** |
@@ -289,8 +289,8 @@ discard block |
||
289 | 289 | public function xcopy($source, $dest) |
290 | 290 | { |
291 | 291 | $files = glob($source.'*.*'); |
292 | - foreach($files as $file){ |
|
293 | - $file_to_go = str_replace($source,$dest,$file); |
|
292 | + foreach ($files as $file) { |
|
293 | + $file_to_go = str_replace($source, $dest, $file); |
|
294 | 294 | copy($file, $file_to_go); |
295 | 295 | } |
296 | 296 | return true; |
@@ -301,9 +301,9 @@ discard block |
||
301 | 301 | * @param String $url url to check |
302 | 302 | * @return bool Return true on succes false on failure |
303 | 303 | */ |
304 | - public function urlexist($url){ |
|
305 | - $headers=get_headers($url); |
|
306 | - return stripos($headers[0],"200 OK")?true:false; |
|
304 | + public function urlexist($url) { |
|
305 | + $headers = get_headers($url); |
|
306 | + return stripos($headers[0], "200 OK") ? true : false; |
|
307 | 307 | } |
308 | 308 | |
309 | 309 | /** |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | public function hex2str($hex) { |
315 | 315 | $str = ''; |
316 | 316 | $hexln = strlen($hex); |
317 | - for($i=0;$i<$hexln;$i+=2) $str .= chr(hexdec(substr($hex,$i,2))); |
|
317 | + for ($i = 0; $i < $hexln; $i += 2) $str .= chr(hexdec(substr($hex, $i, 2))); |
|
318 | 318 | return $str; |
319 | 319 | } |
320 | 320 | |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | * @return String Return result |
325 | 325 | */ |
326 | 326 | public function hex2rgb($hex) { |
327 | - $hex = str_replace('#','',$hex); |
|
327 | + $hex = str_replace('#', '', $hex); |
|
328 | 328 | return sscanf($hex, "%02x%02x%02x"); |
329 | 329 | } |
330 | 330 | |
@@ -332,33 +332,33 @@ discard block |
||
332 | 332 | //difference in longitudinal coordinates |
333 | 333 | $dLon = deg2rad($lon2) - deg2rad($lon1); |
334 | 334 | //difference in the phi of latitudinal coordinates |
335 | - $dPhi = log(tan(deg2rad($lat2) / 2 + pi() / 4) / tan(deg2rad($lat1) / 2 + pi() / 4)); |
|
335 | + $dPhi = log(tan(deg2rad($lat2)/2 + pi()/4)/tan(deg2rad($lat1)/2 + pi()/4)); |
|
336 | 336 | //we need to recalculate $dLon if it is greater than pi |
337 | - if(abs($dLon) > pi()) { |
|
338 | - if($dLon > 0) { |
|
339 | - $dLon = (2 * pi() - $dLon) * -1; |
|
337 | + if (abs($dLon) > pi()) { |
|
338 | + if ($dLon > 0) { |
|
339 | + $dLon = (2*pi() - $dLon)*-1; |
|
340 | 340 | } else { |
341 | - $dLon = 2 * pi() + $dLon; |
|
341 | + $dLon = 2*pi() + $dLon; |
|
342 | 342 | } |
343 | 343 | } |
344 | 344 | //return the angle, normalized |
345 | - return (rad2deg(atan2($dLon, $dPhi)) + 360) % 360; |
|
345 | + return (rad2deg(atan2($dLon, $dPhi)) + 360)%360; |
|
346 | 346 | } |
347 | 347 | |
348 | - public function checkLine($lat1,$lon1,$lat2,$lon2,$lat3,$lon3,$approx = 0.15) { |
|
348 | + public function checkLine($lat1, $lon1, $lat2, $lon2, $lat3, $lon3, $approx = 0.15) { |
|
349 | 349 | //$a = ($lon2-$lon1)*$lat3+($lat2-$lat1)*$lon3+($lat1*$lon2+$lat2*$lon1); |
350 | - $a = -($lon2-$lon1); |
|
350 | + $a = -($lon2 - $lon1); |
|
351 | 351 | $b = $lat2 - $lat1; |
352 | - $c = -($a*$lat1+$b*$lon1); |
|
353 | - $d = $a*$lat3+$b*$lon3+$c; |
|
352 | + $c = -($a*$lat1 + $b*$lon1); |
|
353 | + $d = $a*$lat3 + $b*$lon3 + $c; |
|
354 | 354 | if ($d > -$approx && $d < $approx) return true; |
355 | 355 | else return false; |
356 | 356 | } |
357 | 357 | |
358 | 358 | public function array_merge_noappend() { |
359 | 359 | $output = array(); |
360 | - foreach(func_get_args() as $array) { |
|
361 | - foreach($array as $key => $value) { |
|
360 | + foreach (func_get_args() as $array) { |
|
361 | + foreach ($array as $key => $value) { |
|
362 | 362 | $output[$key] = isset($output[$key]) ? |
363 | 363 | array_merge($output[$key], $value) : $value; |
364 | 364 | } |
@@ -422,34 +422,34 @@ discard block |
||
422 | 422 | return $result; |
423 | 423 | } |
424 | 424 | |
425 | - public function nextcoord($latitude, $longitude, $speed, $heading, $archivespeed = 1){ |
|
425 | + public function nextcoord($latitude, $longitude, $speed, $heading, $archivespeed = 1) { |
|
426 | 426 | global $globalMapRefresh; |
427 | 427 | $distance = ($speed*0.514444*$globalMapRefresh*$archivespeed)/1000; |
428 | 428 | $r = 6378; |
429 | 429 | $latitude = deg2rad($latitude); |
430 | 430 | $longitude = deg2rad($longitude); |
431 | 431 | $bearing = deg2rad($heading); |
432 | - $latitude2 = asin( (sin($latitude) * cos($distance/$r)) + (cos($latitude) * sin($distance/$r) * cos($bearing)) ); |
|
433 | - $longitude2 = $longitude + atan2( sin($bearing)*sin($distance/$r)*cos($latitude), cos($distance/$r)-(sin($latitude)*sin($latitude2)) ); |
|
434 | - return array('latitude' => number_format(rad2deg($latitude2),5,'.',''),'longitude' => number_format(rad2deg($longitude2),5,'.','')); |
|
432 | + $latitude2 = asin((sin($latitude)*cos($distance/$r)) + (cos($latitude)*sin($distance/$r)*cos($bearing))); |
|
433 | + $longitude2 = $longitude + atan2(sin($bearing)*sin($distance/$r)*cos($latitude), cos($distance/$r) - (sin($latitude)*sin($latitude2))); |
|
434 | + return array('latitude' => number_format(rad2deg($latitude2), 5, '.', ''), 'longitude' => number_format(rad2deg($longitude2), 5, '.', '')); |
|
435 | 435 | } |
436 | 436 | |
437 | - public function getCoordfromDistanceBearing($latitude,$longitude,$bearing,$distance) { |
|
437 | + public function getCoordfromDistanceBearing($latitude, $longitude, $bearing, $distance) { |
|
438 | 438 | // distance in meter |
439 | 439 | $R = 6378.14; |
440 | - $latitude1 = $latitude * (M_PI/180); |
|
441 | - $longitude1 = $longitude * (M_PI/180); |
|
442 | - $brng = $bearing * (M_PI/180); |
|
440 | + $latitude1 = $latitude*(M_PI/180); |
|
441 | + $longitude1 = $longitude*(M_PI/180); |
|
442 | + $brng = $bearing*(M_PI/180); |
|
443 | 443 | $d = $distance; |
444 | 444 | |
445 | 445 | $latitude2 = asin(sin($latitude1)*cos($d/$R) + cos($latitude1)*sin($d/$R)*cos($brng)); |
446 | - $longitude2 = $longitude1 + atan2(sin($brng)*sin($d/$R)*cos($latitude1),cos($d/$R)-sin($latitude1)*sin($latitude2)); |
|
446 | + $longitude2 = $longitude1 + atan2(sin($brng)*sin($d/$R)*cos($latitude1), cos($d/$R) - sin($latitude1)*sin($latitude2)); |
|
447 | 447 | |
448 | - $latitude2 = $latitude2 * (180/M_PI); |
|
449 | - $longitude2 = $longitude2 * (180/M_PI); |
|
448 | + $latitude2 = $latitude2*(180/M_PI); |
|
449 | + $longitude2 = $longitude2*(180/M_PI); |
|
450 | 450 | |
451 | - $flat = round ($latitude2,6); |
|
452 | - $flong = round ($longitude2,6); |
|
451 | + $flat = round($latitude2, 6); |
|
452 | + $flong = round($longitude2, 6); |
|
453 | 453 | /* |
454 | 454 | $dx = $distance*cos($bearing); |
455 | 455 | $dy = $distance*sin($bearing); |
@@ -458,7 +458,7 @@ discard block |
||
458 | 458 | $flong = $longitude + $dlong; |
459 | 459 | $flat = $latitude + $dlat; |
460 | 460 | */ |
461 | - return array('latitude' => $flat,'longitude' => $flong); |
|
461 | + return array('latitude' => $flat, 'longitude' => $flong); |
|
462 | 462 | } |
463 | 463 | |
464 | 464 | /** |
@@ -472,14 +472,14 @@ discard block |
||
472 | 472 | * @param integer $level GZIP compression level (default: 9) |
473 | 473 | * @return string New filename (with .gz appended) if success, or false if operation fails |
474 | 474 | */ |
475 | - public function gzCompressFile($source, $level = 9){ |
|
476 | - $dest = $source . '.gz'; |
|
477 | - $mode = 'wb' . $level; |
|
475 | + public function gzCompressFile($source, $level = 9) { |
|
476 | + $dest = $source.'.gz'; |
|
477 | + $mode = 'wb'.$level; |
|
478 | 478 | $error = false; |
479 | 479 | if ($fp_out = gzopen($dest, $mode)) { |
480 | - if ($fp_in = fopen($source,'rb')) { |
|
480 | + if ($fp_in = fopen($source, 'rb')) { |
|
481 | 481 | while (!feof($fp_in)) |
482 | - gzwrite($fp_out, fread($fp_in, 1024 * 512)); |
|
482 | + gzwrite($fp_out, fread($fp_in, 1024*512)); |
|
483 | 483 | fclose($fp_in); |
484 | 484 | } else { |
485 | 485 | $error = true; |
@@ -495,7 +495,7 @@ discard block |
||
495 | 495 | } |
496 | 496 | |
497 | 497 | public function remove_accents($string) { |
498 | - if ( !preg_match('/[\x80-\xff]/', $string) ) return $string; |
|
498 | + if (!preg_match('/[\x80-\xff]/', $string)) return $string; |
|
499 | 499 | $chars = array( |
500 | 500 | // Decompositions for Latin-1 Supplement |
501 | 501 | chr(195).chr(128) => 'A', chr(195).chr(129) => 'A', |
@@ -552,7 +552,7 @@ discard block |
||
552 | 552 | chr(196).chr(172) => 'I', chr(196).chr(173) => 'i', |
553 | 553 | chr(196).chr(174) => 'I', chr(196).chr(175) => 'i', |
554 | 554 | chr(196).chr(176) => 'I', chr(196).chr(177) => 'i', |
555 | - chr(196).chr(178) => 'IJ',chr(196).chr(179) => 'ij', |
|
555 | + chr(196).chr(178) => 'IJ', chr(196).chr(179) => 'ij', |
|
556 | 556 | chr(196).chr(180) => 'J', chr(196).chr(181) => 'j', |
557 | 557 | chr(196).chr(182) => 'K', chr(196).chr(183) => 'k', |
558 | 558 | chr(196).chr(184) => 'k', chr(196).chr(185) => 'L', |
@@ -568,13 +568,13 @@ discard block |
||
568 | 568 | chr(197).chr(140) => 'O', chr(197).chr(141) => 'o', |
569 | 569 | chr(197).chr(142) => 'O', chr(197).chr(143) => 'o', |
570 | 570 | chr(197).chr(144) => 'O', chr(197).chr(145) => 'o', |
571 | - chr(197).chr(146) => 'OE',chr(197).chr(147) => 'oe', |
|
572 | - chr(197).chr(148) => 'R',chr(197).chr(149) => 'r', |
|
573 | - chr(197).chr(150) => 'R',chr(197).chr(151) => 'r', |
|
574 | - chr(197).chr(152) => 'R',chr(197).chr(153) => 'r', |
|
575 | - chr(197).chr(154) => 'S',chr(197).chr(155) => 's', |
|
576 | - chr(197).chr(156) => 'S',chr(197).chr(157) => 's', |
|
577 | - chr(197).chr(158) => 'S',chr(197).chr(159) => 's', |
|
571 | + chr(197).chr(146) => 'OE', chr(197).chr(147) => 'oe', |
|
572 | + chr(197).chr(148) => 'R', chr(197).chr(149) => 'r', |
|
573 | + chr(197).chr(150) => 'R', chr(197).chr(151) => 'r', |
|
574 | + chr(197).chr(152) => 'R', chr(197).chr(153) => 'r', |
|
575 | + chr(197).chr(154) => 'S', chr(197).chr(155) => 's', |
|
576 | + chr(197).chr(156) => 'S', chr(197).chr(157) => 's', |
|
577 | + chr(197).chr(158) => 'S', chr(197).chr(159) => 's', |
|
578 | 578 | chr(197).chr(160) => 'S', chr(197).chr(161) => 's', |
579 | 579 | chr(197).chr(162) => 'T', chr(197).chr(163) => 't', |
580 | 580 | chr(197).chr(164) => 'T', chr(197).chr(165) => 't', |
@@ -608,7 +608,7 @@ discard block |
||
608 | 608 | for ($i = 0, $int = '', $concat_flag = true; $i < $length; $i++) { |
609 | 609 | if (is_numeric($string[$i]) && $concat_flag) { |
610 | 610 | $int .= $string[$i]; |
611 | - } elseif(!$concat && $concat_flag && strlen($int) > 0) { |
|
611 | + } elseif (!$concat && $concat_flag && strlen($int) > 0) { |
|
612 | 612 | $concat_flag = false; |
613 | 613 | } |
614 | 614 | } |
@@ -654,7 +654,7 @@ discard block |
||
654 | 654 | $slice = array_slice($arr, $offset + 1, $length); |
655 | 655 | return implode("", $slice); |
656 | 656 | } else { |
657 | - return mb_substr($string,$offset,$length,'UTF-8'); |
|
657 | + return mb_substr($string, $offset, $length, 'UTF-8'); |
|
658 | 658 | } |
659 | 659 | } |
660 | 660 | |
@@ -664,14 +664,14 @@ discard block |
||
664 | 664 | //NOTE: use a trailing slash for folders!!! |
665 | 665 | //see http://bugs.php.net/bug.php?id=27609 |
666 | 666 | //see http://bugs.php.net/bug.php?id=30931 |
667 | - if ($path{strlen($path)-1}=='/') // recursively return a temporary file path |
|
667 | + if ($path{strlen($path) - 1} == '/') // recursively return a temporary file path |
|
668 | 668 | return $this->is__writable($path.uniqid(mt_rand()).'.tmp'); |
669 | 669 | else if (is_dir($path)) |
670 | 670 | return $this->is__writable($path.'/'.uniqid(mt_rand()).'.tmp'); |
671 | 671 | // check tmp file for read/write capabilities |
672 | 672 | $rm = file_exists($path); |
673 | 673 | $f = @fopen($path, 'a'); |
674 | - if ($f===false) |
|
674 | + if ($f === false) |
|
675 | 675 | return false; |
676 | 676 | fclose($f); |
677 | 677 | if (!$rm) |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | require_once('require/class.Language.php'); |
4 | 4 | require_once('require/class.Translation.php'); |
5 | 5 | $type = ''; |
6 | -$ident = urldecode(filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING)); |
|
6 | +$ident = urldecode(filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING)); |
|
7 | 7 | if (isset($_GET['marine'])) { |
8 | 8 | require_once('require/class.Marine.php'); |
9 | 9 | require_once('require/class.MarineLive.php'); |
@@ -30,12 +30,12 @@ discard block |
||
30 | 30 | $page_url = $globalURL.'/ident/'.$_GET['ident']; |
31 | 31 | } |
32 | 32 | |
33 | -if (!isset($_GET['ident'])){ |
|
33 | +if (!isset($_GET['ident'])) { |
|
34 | 34 | header('Location: '.$globalURL.''); |
35 | 35 | } else { |
36 | 36 | $Translation = new Translation(); |
37 | 37 | //calculuation for the pagination |
38 | - if(!isset($_GET['limit'])) |
|
38 | + if (!isset($_GET['limit'])) |
|
39 | 39 | { |
40 | 40 | $limit_start = 0; |
41 | 41 | $limit_end = 25; |
@@ -54,18 +54,18 @@ discard block |
||
54 | 54 | $limit_previous_1 = $limit_start - $absolute_difference; |
55 | 55 | $limit_previous_2 = $limit_end - $absolute_difference; |
56 | 56 | |
57 | - $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
57 | + $sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
58 | 58 | if ($type == 'aircraft') { |
59 | 59 | if ($sort != '') |
60 | 60 | { |
61 | - $spotter_array = $Spotter->getSpotterDataByIdent($ident,$limit_start.",".$absolute_difference, $sort); |
|
61 | + $spotter_array = $Spotter->getSpotterDataByIdent($ident, $limit_start.",".$absolute_difference, $sort); |
|
62 | 62 | if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) { |
63 | - $spotter_array = $SpotterArchive->getSpotterDataByIdent($ident,$limit_start.",".$absolute_difference, $sort); |
|
63 | + $spotter_array = $SpotterArchive->getSpotterDataByIdent($ident, $limit_start.",".$absolute_difference, $sort); |
|
64 | 64 | } |
65 | 65 | } else { |
66 | - $spotter_array = $Spotter->getSpotterDataByIdent($ident,$limit_start.",".$absolute_difference); |
|
66 | + $spotter_array = $Spotter->getSpotterDataByIdent($ident, $limit_start.",".$absolute_difference); |
|
67 | 67 | if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) { |
68 | - $spotter_array = $SpotterArchive->getSpotterDataByIdent($ident,$limit_start.",".$absolute_difference); |
|
68 | + $spotter_array = $SpotterArchive->getSpotterDataByIdent($ident, $limit_start.",".$absolute_difference); |
|
69 | 69 | } |
70 | 70 | } |
71 | 71 | if (empty($spotter_array)) { |
@@ -74,14 +74,14 @@ discard block |
||
74 | 74 | $ident = $new_ident; |
75 | 75 | if ($sort != '') |
76 | 76 | { |
77 | - $spotter_array = $Spotter->getSpotterDataByIdent($ident,$limit_start.",".$absolute_difference, $sort); |
|
77 | + $spotter_array = $Spotter->getSpotterDataByIdent($ident, $limit_start.",".$absolute_difference, $sort); |
|
78 | 78 | if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) { |
79 | - $spotter_array = $SpotterArchive->getSpotterDataByIdent($ident,$limit_start.",".$absolute_difference, $sort); |
|
79 | + $spotter_array = $SpotterArchive->getSpotterDataByIdent($ident, $limit_start.",".$absolute_difference, $sort); |
|
80 | 80 | } |
81 | 81 | } else { |
82 | - $spotter_array = $Spotter->getSpotterDataByIdent($ident,$limit_start.",".$absolute_difference); |
|
82 | + $spotter_array = $Spotter->getSpotterDataByIdent($ident, $limit_start.",".$absolute_difference); |
|
83 | 83 | if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) { |
84 | - $spotter_array = $SpotterArchive->getSpotterDataByIdent($ident,$limit_start.",".$absolute_difference); |
|
84 | + $spotter_array = $SpotterArchive->getSpotterDataByIdent($ident, $limit_start.",".$absolute_difference); |
|
85 | 85 | } |
86 | 86 | } |
87 | 87 | } |
@@ -89,34 +89,34 @@ discard block |
||
89 | 89 | } elseif ($type == 'marine') { |
90 | 90 | if ($sort != '') |
91 | 91 | { |
92 | - $spotter_array = $Marine->getMarineDataByIdent($ident,$limit_start.",".$absolute_difference, $sort); |
|
92 | + $spotter_array = $Marine->getMarineDataByIdent($ident, $limit_start.",".$absolute_difference, $sort); |
|
93 | 93 | if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) { |
94 | - $spotter_array = $MarineArchive->getMarineDataByIdent($ident,$limit_start.",".$absolute_difference, $sort); |
|
94 | + $spotter_array = $MarineArchive->getMarineDataByIdent($ident, $limit_start.",".$absolute_difference, $sort); |
|
95 | 95 | } |
96 | 96 | } else { |
97 | - $spotter_array = $Marine->getMarineDataByIdent($ident,$limit_start.",".$absolute_difference); |
|
97 | + $spotter_array = $Marine->getMarineDataByIdent($ident, $limit_start.",".$absolute_difference); |
|
98 | 98 | if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) { |
99 | - $spotter_array = $MarineArchive->getMarineDataByIdent($ident,$limit_start.",".$absolute_difference); |
|
99 | + $spotter_array = $MarineArchive->getMarineDataByIdent($ident, $limit_start.",".$absolute_difference); |
|
100 | 100 | } |
101 | 101 | } |
102 | 102 | } elseif ($type == 'tracker') { |
103 | 103 | if ($sort != '') |
104 | 104 | { |
105 | - $spotter_array = $Tracker->getTrackerDataByIdent($ident,$limit_start.",".$absolute_difference, $sort); |
|
105 | + $spotter_array = $Tracker->getTrackerDataByIdent($ident, $limit_start.",".$absolute_difference, $sort); |
|
106 | 106 | if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) { |
107 | - $spotter_array = $TrackerArchive->getTrackerDataByIdent($ident,$limit_start.",".$absolute_difference, $sort); |
|
107 | + $spotter_array = $TrackerArchive->getTrackerDataByIdent($ident, $limit_start.",".$absolute_difference, $sort); |
|
108 | 108 | } |
109 | 109 | } else { |
110 | - $spotter_array = $Tracker->getTrackerDataByIdent($ident,$limit_start.",".$absolute_difference); |
|
110 | + $spotter_array = $Tracker->getTrackerDataByIdent($ident, $limit_start.",".$absolute_difference); |
|
111 | 111 | if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) { |
112 | - $spotter_array = $TrackerArchive->getTrackerDataByIdent($ident,$limit_start.",".$absolute_difference); |
|
112 | + $spotter_array = $TrackerArchive->getTrackerDataByIdent($ident, $limit_start.",".$absolute_difference); |
|
113 | 113 | } |
114 | 114 | } |
115 | 115 | } |
116 | 116 | |
117 | 117 | if (!empty($spotter_array)) |
118 | 118 | { |
119 | - $title = sprintf(_("Detailed View for %s"),$spotter_array[0]['ident']); |
|
119 | + $title = sprintf(_("Detailed View for %s"), $spotter_array[0]['ident']); |
|
120 | 120 | $ident = $spotter_array[0]['ident']; |
121 | 121 | if (isset($spotter_array[0]['latitude'])) $latitude = $spotter_array[0]['latitude']; |
122 | 122 | if (isset($spotter_array[0]['longitude'])) $longitude = $spotter_array[0]['longitude']; |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | $altitude_data = ''; |
136 | 136 | $hour_data = ''; |
137 | 137 | $speed_data = ''; |
138 | - foreach($all_data as $data) |
|
138 | + foreach ($all_data as $data) |
|
139 | 139 | { |
140 | 140 | $hour_data .= '"'.$data['date'].'",'; |
141 | 141 | if (isset($data['real_altitude']) && $data['real_altitude'] != '') { |
@@ -163,8 +163,8 @@ discard block |
||
163 | 163 | $speed_data .= $speed.','; |
164 | 164 | } |
165 | 165 | $hour_data = "['x',".substr($hour_data, 0, -1)."]"; |
166 | - $altitude_data = "['altitude',".substr($altitude_data,0,-1)."]"; |
|
167 | - $speed_data = "['speed',".substr($speed_data,0,-1)."]"; |
|
166 | + $altitude_data = "['altitude',".substr($altitude_data, 0, -1)."]"; |
|
167 | + $speed_data = "['speed',".substr($speed_data, 0, -1)."]"; |
|
168 | 168 | print 'c3.generate({ |
169 | 169 | bindto: "#chart", |
170 | 170 | data: { |
@@ -208,9 +208,9 @@ discard block |
||
208 | 208 | |
209 | 209 | if ($type == 'aircraft') include('ident-sub-menu.php'); |
210 | 210 | print '<div class="table column">'; |
211 | - if ($type == 'aircraft') print '<p>'.sprintf(_("The table below shows the detailed information of all flights with the ident/callsign of <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>'; |
|
212 | - elseif ($type == 'marine') print '<p>'.sprintf(_("The table below shows the detailed information of all vessels with the ident/callsign of <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>'; |
|
213 | - elseif ($type == 'tracker') print '<p>'.sprintf(_("The table below shows the detailed information of all trackers with the ident/callsign of <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>'; |
|
211 | + if ($type == 'aircraft') print '<p>'.sprintf(_("The table below shows the detailed information of all flights with the ident/callsign of <strong>%s</strong>."), $spotter_array[0]['ident']).'</p>'; |
|
212 | + elseif ($type == 'marine') print '<p>'.sprintf(_("The table below shows the detailed information of all vessels with the ident/callsign of <strong>%s</strong>."), $spotter_array[0]['ident']).'</p>'; |
|
213 | + elseif ($type == 'tracker') print '<p>'.sprintf(_("The table below shows the detailed information of all trackers with the ident/callsign of <strong>%s</strong>."), $spotter_array[0]['ident']).'</p>'; |
|
214 | 214 | |
215 | 215 | include('table-output.php'); |
216 | 216 | print '<div class="pagination">'; |