@@ -66,11 +66,11 @@ discard block |
||
66 | 66 | $s3 = sin($bank/2); |
67 | 67 | $c1c2 = $c1*$c2; |
68 | 68 | $s1s2 = $s1*$s2; |
69 | - $w =$c1c2*$c3 - $s1s2*$s3; |
|
70 | - $x =$c1c2*$s3 + $s1s2*$c3; |
|
71 | - $y =$s1*$c2*$c3 + $c1*$s2*$s3; |
|
72 | - $z =$c1*$s2*$c3 - $s1*$c2*$s3; |
|
73 | - return array('x' => $x,'y' => $y,'z' => $z,'w' => $w); |
|
69 | + $w = $c1c2*$c3 - $s1s2*$s3; |
|
70 | + $x = $c1c2*$s3 + $s1s2*$c3; |
|
71 | + $y = $s1*$c2*$c3 + $c1*$s2*$s3; |
|
72 | + $z = $c1*$s2*$c3 - $s1*$c2*$s3; |
|
73 | + return array('x' => $x, 'y' => $y, 'z' => $z, 'w' => $w); |
|
74 | 74 | // return array('x' => '0.0','y' => '-0.931','z' => '0.0','w' => '0.365'); |
75 | 75 | |
76 | 76 | } |
@@ -91,18 +91,18 @@ discard block |
||
91 | 91 | $min = false; |
92 | 92 | $allhistory = false; |
93 | 93 | $filter['source'] = array(); |
94 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt')); |
|
95 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup')); |
|
96 | -if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars')); |
|
97 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs')); |
|
98 | -if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs')); |
|
99 | -if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING); |
|
100 | -if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING); |
|
101 | -if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING); |
|
102 | -if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING); |
|
103 | -if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING); |
|
104 | -if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING); |
|
105 | -if (isset($_COOKIE['filter_race']) && $_COOKIE['filter_race'] != 'all') $filter['race'] = filter_var($_COOKIE['filter_race'],FILTER_SANITIZE_NUMBER_INT); |
|
94 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'], array('vatsimtxt')); |
|
95 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'], array('whazzup')); |
|
96 | +if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'], array('phpvmacars')); |
|
97 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'], array('sbs', 'famaprs')); |
|
98 | +if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'], array('aprs')); |
|
99 | +if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'], FILTER_SANITIZE_STRING); |
|
100 | +if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'], FILTER_SANITIZE_STRING); |
|
101 | +if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',', $_COOKIE['filter_Airlines']), FILTER_SANITIZE_STRING); |
|
102 | +if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',', $_COOKIE['filter_Sources']), FILTER_SANITIZE_STRING); |
|
103 | +if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'], FILTER_SANITIZE_STRING); |
|
104 | +if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'], FILTER_SANITIZE_STRING); |
|
105 | +if (isset($_COOKIE['filter_race']) && $_COOKIE['filter_race'] != 'all') $filter['race'] = filter_var($_COOKIE['filter_race'], FILTER_SANITIZE_NUMBER_INT); |
|
106 | 106 | /* |
107 | 107 | if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) { |
108 | 108 | $min = true; |
@@ -149,17 +149,17 @@ discard block |
||
149 | 149 | $from_archive = true; |
150 | 150 | // $begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
151 | 151 | // $enddate = filter_input(INPUT_GET,'enddate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~'))); |
152 | - $begindate = filter_input(INPUT_GET,'begindate',FILTER_SANITIZE_NUMBER_INT); |
|
153 | - $enddate = filter_input(INPUT_GET,'enddate',FILTER_SANITIZE_NUMBER_INT); |
|
154 | - $archivespeed = filter_input(INPUT_GET,'speed',FILTER_SANITIZE_NUMBER_INT); |
|
155 | - $begindate = date('Y-m-d H:i:s',$begindate); |
|
156 | - $enddate = date('Y-m-d H:i:s',$enddate); |
|
152 | + $begindate = filter_input(INPUT_GET, 'begindate', FILTER_SANITIZE_NUMBER_INT); |
|
153 | + $enddate = filter_input(INPUT_GET, 'enddate', FILTER_SANITIZE_NUMBER_INT); |
|
154 | + $archivespeed = filter_input(INPUT_GET, 'speed', FILTER_SANITIZE_NUMBER_INT); |
|
155 | + $begindate = date('Y-m-d H:i:s', $begindate); |
|
156 | + $enddate = date('Y-m-d H:i:s', $enddate); |
|
157 | 157 | if ($tracker) { |
158 | - $spotter_array = $TrackerArchive->getMinLiveTrackerDataPlayback($begindate,$enddate,$filter); |
|
158 | + $spotter_array = $TrackerArchive->getMinLiveTrackerDataPlayback($begindate, $enddate, $filter); |
|
159 | 159 | } elseif ($marine) { |
160 | - $spotter_array = $MarineArchive->getMinLiveMarineDataPlayback($begindate,$enddate,$filter); |
|
160 | + $spotter_array = $MarineArchive->getMinLiveMarineDataPlayback($begindate, $enddate, $filter); |
|
161 | 161 | } else { |
162 | - $spotter_array = $SpotterArchive->getMinLiveSpotterDataPlayback($begindate,$enddate,$filter); |
|
162 | + $spotter_array = $SpotterArchive->getMinLiveSpotterDataPlayback($begindate, $enddate, $filter); |
|
163 | 163 | } |
164 | 164 | } elseif (isset($_COOKIE['archive']) && isset($_COOKIE['archive_begin']) && isset($_COOKIE['archive_end']) && isset($_COOKIE['archive_speed'])) { |
165 | 165 | $from_archive = true; |
@@ -176,36 +176,36 @@ discard block |
||
176 | 176 | } |
177 | 177 | $enddate = $_COOKIE['archive_end']; |
178 | 178 | $enddateinitial = $_COOKIE['archive_end']; |
179 | - $archivespeed = filter_var($_COOKIE['archive_speed'],FILTER_SANITIZE_NUMBER_INT); |
|
180 | - $begindate = date('Y-m-d H:i:s',$begindate); |
|
181 | - $enddate = date('Y-m-d H:i:s',$enddate); |
|
179 | + $archivespeed = filter_var($_COOKIE['archive_speed'], FILTER_SANITIZE_NUMBER_INT); |
|
180 | + $begindate = date('Y-m-d H:i:s', $begindate); |
|
181 | + $enddate = date('Y-m-d H:i:s', $enddate); |
|
182 | 182 | //echo 'Begin : '.$begindate.' - End : '.$enddate."\n"; |
183 | 183 | if ($tracker) { |
184 | - $spotter_array = $TrackerArchive->getMinLiveTrackerData($begindate,$enddate,$filter); |
|
184 | + $spotter_array = $TrackerArchive->getMinLiveTrackerData($begindate, $enddate, $filter); |
|
185 | 185 | } elseif ($marine) { |
186 | - $spotter_array = $MarineArchive->getMinLiveMarineData($begindate,$enddate,$filter); |
|
186 | + $spotter_array = $MarineArchive->getMinLiveMarineData($begindate, $enddate, $filter); |
|
187 | 187 | } else { |
188 | - $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate,$enddate,$filter); |
|
188 | + $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate, $enddate, $filter); |
|
189 | 189 | } |
190 | 190 | } elseif ($tracker) { |
191 | 191 | $coord = array(); |
192 | 192 | if (isset($_GET['coord']) && $_GET['coord'] != '') { |
193 | - $coord = explode(',',$_GET['coord']); |
|
194 | - if (!(filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT) |
|
193 | + $coord = explode(',', $_GET['coord']); |
|
194 | + if (!(filter_var($coord[0], FILTER_VALIDATE_FLOAT) && filter_var($coord[1], FILTER_VALIDATE_FLOAT) && filter_var($coord[2], FILTER_VALIDATE_FLOAT) && filter_var($coord[3], FILTER_VALIDATE_FLOAT) |
|
195 | 195 | && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) { |
196 | 196 | $coord = array(); |
197 | 197 | } |
198 | 198 | } |
199 | 199 | $previous_filter = $filter; |
200 | 200 | if ((isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') && (isset($_COOKIE['MapTrackTracker']) && $_COOKIE['MapTrackTracker'] != '')) { |
201 | - $filter = array_merge($filter,array('id' => $_COOKIE['MapTrackTracker'])); |
|
202 | - $spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord,$filter,false); |
|
201 | + $filter = array_merge($filter, array('id' => $_COOKIE['MapTrackTracker'])); |
|
202 | + $spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord, $filter, false); |
|
203 | 203 | /* |
204 | 204 | } elseif (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '' && !empty($coord)) { |
205 | 205 | $spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord,$filter,true,$_COOKIE['MapTrack']); |
206 | 206 | */ |
207 | 207 | } elseif (!isset($_COOKIE['singlemodel']) || $_COOKIE['singlemodel'] == 'false') { |
208 | - $spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord,$filter,false); |
|
208 | + $spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord, $filter, false); |
|
209 | 209 | } else { |
210 | 210 | $spotter_array = array(); |
211 | 211 | } |
@@ -214,20 +214,20 @@ discard block |
||
214 | 214 | $coord = array(); |
215 | 215 | //if (isset($_GET['coord']) && $_GET['coord'] != '') { |
216 | 216 | if (!((isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') && (isset($_COOKIE['MapTrackMarine']) && $_COOKIE['MapTrackMarine'] != '')) && isset($_GET['coord']) && $_GET['coord'] != '') { |
217 | - $coord = explode(',',$_GET['coord']); |
|
218 | - if (!(filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT) |
|
217 | + $coord = explode(',', $_GET['coord']); |
|
218 | + if (!(filter_var($coord[0], FILTER_VALIDATE_FLOAT) && filter_var($coord[1], FILTER_VALIDATE_FLOAT) && filter_var($coord[2], FILTER_VALIDATE_FLOAT) && filter_var($coord[3], FILTER_VALIDATE_FLOAT) |
|
219 | 219 | && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) { |
220 | 220 | $coord = array(); |
221 | 221 | } |
222 | 222 | } |
223 | 223 | $previous_filter = $filter; |
224 | 224 | if ((isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') && (isset($_COOKIE['MapTrackMarine']) && $_COOKIE['MapTrackMarine'] != '')) { |
225 | - $filter = array_merge($filter,array('id' => $_COOKIE['MapTrackMarine'])); |
|
226 | - $spotter_array = $MarineLive->getMinLastLiveMarineData($coord,$filter,false); |
|
225 | + $filter = array_merge($filter, array('id' => $_COOKIE['MapTrackMarine'])); |
|
226 | + $spotter_array = $MarineLive->getMinLastLiveMarineData($coord, $filter, false); |
|
227 | 227 | } elseif (isset($_COOKIE['MapTrackMarine']) && $_COOKIE['MapTrackMarine'] != '' && !empty($coord)) { |
228 | - $spotter_array = $MarineLive->getMinLastLiveMarineData($coord,$filter,false,$_COOKIE['MapTrack']); |
|
228 | + $spotter_array = $MarineLive->getMinLastLiveMarineData($coord, $filter, false, $_COOKIE['MapTrack']); |
|
229 | 229 | } elseif (!isset($_COOKIE['singlemodel']) || $_COOKIE['singlemodel'] == 'false') { |
230 | - $spotter_array = $MarineLive->getMinLastLiveMarineData($coord,$filter,false); |
|
230 | + $spotter_array = $MarineLive->getMinLastLiveMarineData($coord, $filter, false); |
|
231 | 231 | } else { |
232 | 232 | $spotter_array = array(); |
233 | 233 | } |
@@ -235,8 +235,8 @@ discard block |
||
235 | 235 | } else { |
236 | 236 | $coord = array(); |
237 | 237 | if (!((isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') && (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '')) && isset($_GET['coord']) && $_GET['coord'] != '') { |
238 | - $coord = explode(',',$_GET['coord']); |
|
239 | - if (!(filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT) |
|
238 | + $coord = explode(',', $_GET['coord']); |
|
239 | + if (!(filter_var($coord[0], FILTER_VALIDATE_FLOAT) && filter_var($coord[1], FILTER_VALIDATE_FLOAT) && filter_var($coord[2], FILTER_VALIDATE_FLOAT) && filter_var($coord[3], FILTER_VALIDATE_FLOAT) |
|
240 | 240 | && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) { |
241 | 241 | $coord = array(); |
242 | 242 | } |
@@ -244,14 +244,14 @@ discard block |
||
244 | 244 | $previous_filter = $filter; |
245 | 245 | if (((isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') || ((!isset($_COOKIE['singlemodel']) && isset($globalMap3DSelected) && $globalMap3DSelected)) && (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '')) { |
246 | 246 | //$filter = array_merge($filter,array('id' => $_COOKIE['MapTrack'])); |
247 | - $spotter_array = $SpotterLive->getMinLastLiveSpotterDataByID($_COOKIE['MapTrack'],$filter,false); |
|
247 | + $spotter_array = $SpotterLive->getMinLastLiveSpotterDataByID($_COOKIE['MapTrack'], $filter, false); |
|
248 | 248 | //$spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord,$filter,false); |
249 | 249 | } elseif (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '') { |
250 | 250 | //$spotter_array = $SpotterLive->getMinLastLiveSpotterDataByID($_COOKIE['MapTrack'],$filter,false); |
251 | 251 | //if (empty($spotter_array)) $spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord,$filter,false,$_COOKIE['MapTrack']); |
252 | - $spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord,$filter,false,$_COOKIE['MapTrack']); |
|
252 | + $spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord, $filter, false, $_COOKIE['MapTrack']); |
|
253 | 253 | } elseif (!isset($_COOKIE['singlemodel']) || $_COOKIE['singlemodel'] == 'false') { |
254 | - $spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord,$filter,false); |
|
254 | + $spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord, $filter, false); |
|
255 | 255 | } else { |
256 | 256 | $spotter_array = array(); |
257 | 257 | } |
@@ -261,19 +261,19 @@ discard block |
||
261 | 261 | if (!empty($spotter_array) && isset($coord)) { |
262 | 262 | if ($tracker) { |
263 | 263 | if (isset($_GET['archive'])) { |
264 | - $flightcnt = $TrackerArchive->getLiveTrackerCount($begindate,$enddate,$filter); |
|
264 | + $flightcnt = $TrackerArchive->getLiveTrackerCount($begindate, $enddate, $filter); |
|
265 | 265 | } else { |
266 | 266 | $flightcnt = $TrackerLive->getLiveTrackerCount($filter); |
267 | 267 | } |
268 | 268 | } elseif ($marine) { |
269 | 269 | if (isset($_GET['archive'])) { |
270 | - $flightcnt = $MarineArchive->getLiveMarineCount($begindate,$enddate,$filter); |
|
270 | + $flightcnt = $MarineArchive->getLiveMarineCount($begindate, $enddate, $filter); |
|
271 | 271 | } else { |
272 | 272 | $flightcnt = $MarineLive->getLiveMarineCount($filter); |
273 | 273 | } |
274 | 274 | } else { |
275 | 275 | if (isset($_GET['archive'])) { |
276 | - $flightcnt = $SpotterArchive->getLiveSpotterCount($begindate,$enddate,$filter); |
|
276 | + $flightcnt = $SpotterArchive->getLiveSpotterCount($begindate, $enddate, $filter); |
|
277 | 277 | } else { |
278 | 278 | $flightcnt = $SpotterLive->getLiveSpotterCount($filter); |
279 | 279 | } |
@@ -281,17 +281,17 @@ discard block |
||
281 | 281 | if ($flightcnt == '') $flightcnt = 0; |
282 | 282 | } else $flightcnt = 0; |
283 | 283 | |
284 | -$sqltime = round(microtime(true)-$begintime,2); |
|
284 | +$sqltime = round(microtime(true) - $begintime, 2); |
|
285 | 285 | $minitime = time(); |
286 | 286 | $minitracktime_begin = time(); |
287 | 287 | $minitracktime = $minitracktime_begin; |
288 | 288 | $maxitime = 0; |
289 | -$lastupdate = filter_input(INPUT_GET,'update',FILTER_SANITIZE_NUMBER_INT); |
|
289 | +$lastupdate = filter_input(INPUT_GET, 'update', FILTER_SANITIZE_NUMBER_INT); |
|
290 | 290 | $modelsdb = array(); |
291 | 291 | if (file_exists(dirname(__FILE__).'/models/modelsdb')) { |
292 | - if (($handle = fopen(dirname(__FILE__).'/models/modelsdb','r')) !== FALSE) { |
|
293 | - while (($row = fgetcsv($handle,1000)) !== FALSE) { |
|
294 | - if (isset($row[1]) ){ |
|
292 | + if (($handle = fopen(dirname(__FILE__).'/models/modelsdb', 'r')) !== FALSE) { |
|
293 | + while (($row = fgetcsv($handle, 1000)) !== FALSE) { |
|
294 | + if (isset($row[1])) { |
|
295 | 295 | $model = $row[0]; |
296 | 296 | $modelsdb[$model] = $row[1]; |
297 | 297 | } |
@@ -301,9 +301,9 @@ discard block |
||
301 | 301 | } |
302 | 302 | $modelsdb2 = array(); |
303 | 303 | if (file_exists(dirname(__FILE__).'/models/gltf2/modelsdb')) { |
304 | - if (($handle = fopen(dirname(__FILE__).'/models/gltf2/modelsdb','r')) !== FALSE) { |
|
305 | - while (($row = fgetcsv($handle,1000)) !== FALSE) { |
|
306 | - if (isset($row[1]) ){ |
|
304 | + if (($handle = fopen(dirname(__FILE__).'/models/gltf2/modelsdb', 'r')) !== FALSE) { |
|
305 | + while (($row = fgetcsv($handle, 1000)) !== FALSE) { |
|
306 | + if (isset($row[1])) { |
|
307 | 307 | $model = $row[0]; |
308 | 308 | $glb = $row[1]; |
309 | 309 | if (isset($row[2])) { |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | if (!empty($spotter_array) && is_array($spotter_array)) |
350 | 350 | { |
351 | 351 | $nblatlong = 0; |
352 | - foreach($spotter_array as $spotter_item) |
|
352 | + foreach ($spotter_array as $spotter_item) |
|
353 | 353 | { |
354 | 354 | $j++; |
355 | 355 | //if (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'airwhere') $heightrelative = 'RELATIVE_TO_GROUND'; |
@@ -403,16 +403,16 @@ discard block |
||
403 | 403 | } |
404 | 404 | if (isset($spotter_item['registration'])) $output .= '"registration": "'.$spotter_item['registration'].'",'; |
405 | 405 | if (isset($spotter_item['format_source'])) $output .= '"format": "'.$spotter_item['format_source'].'",'; |
406 | - if (isset($spotter_item['ident'])) $output.= '"ident": '.json_encode($spotter_item['ident']).','; |
|
406 | + if (isset($spotter_item['ident'])) $output .= '"ident": '.json_encode($spotter_item['ident']).','; |
|
407 | 407 | if ($tracker) { |
408 | 408 | if (isset($spotter_item['type'])) $output .= '"tracker_type": '.json_encode($spotter_item['type']).','; |
409 | - $output.= '"type": "tracker"'; |
|
409 | + $output .= '"type": "tracker"'; |
|
410 | 410 | } elseif ($marine) { |
411 | 411 | if (isset($spotter_item['type'])) $output .= '"marine_type": '.json_encode($spotter_item['type']).','; |
412 | 412 | if (isset($spotter_item['captain_name'])) $output .= '"captain": '.json_encode($spotter_item['captain_name']).','; |
413 | 413 | if (isset($spotter_item['race_name'])) $output .= '"race": '.json_encode($spotter_item['race_name']).','; |
414 | 414 | if (isset($spotter_item['race_rank'])) $output .= '"rank": "'.$spotter_item['race_rank'].'",'; |
415 | - $output.= '"type": "marine"'; |
|
415 | + $output .= '"type": "marine"'; |
|
416 | 416 | } else { |
417 | 417 | if ($one3dmodel === false && isset($globalMap3DLiveries) && $globalMap3DLiveries) { |
418 | 418 | $aircraft_icao = $spotter_item['aircraft_icao']; |
@@ -426,14 +426,14 @@ discard block |
||
426 | 426 | if (isset($airline_icao)) { |
427 | 427 | $imagefile = $aircraft_icao.'-'.$airline_icao.'.png'; |
428 | 428 | if (file_exists(dirname(__FILE__).'/models/gltf2/liveries/'.$imagefile)) { |
429 | - $output.= '"liveries": "'.$globalURL.'/models/gltf2/liveries/'.$imagefile.'",'; |
|
429 | + $output .= '"liveries": "'.$globalURL.'/models/gltf2/liveries/'.$imagefile.'",'; |
|
430 | 430 | } |
431 | 431 | } |
432 | 432 | } |
433 | 433 | //if ($ident != '') $output.= '"ident": "'.$ident.'",'; |
434 | 434 | } |
435 | - $output.= '"gltf2": %gltf2%,'; |
|
436 | - $output.= '"type": "flight"'; |
|
435 | + $output .= '"gltf2": %gltf2%,'; |
|
436 | + $output .= '"type": "flight"'; |
|
437 | 437 | } |
438 | 438 | $output .= '},'; |
439 | 439 | |
@@ -808,8 +808,8 @@ discard block |
||
808 | 808 | $output .= '},'; |
809 | 809 | } |
810 | 810 | } |
811 | - if (isset($onground) && $onground) $output = str_replace('%onground%','true',$output); |
|
812 | - else $output = str_replace('%onground%','false',$output); |
|
811 | + if (isset($onground) && $onground) $output = str_replace('%onground%', 'true', $output); |
|
812 | + else $output = str_replace('%onground%', 'false', $output); |
|
813 | 813 | |
814 | 814 | // $output .= '"heightReference": "CLAMP_TO_GROUND",'; |
815 | 815 | //$output .= '"heightReference": "'.$heightrelative.'",'; |
@@ -825,7 +825,7 @@ discard block |
||
825 | 825 | if ($minitime > strtotime($spotter_item['date'])) $minitime = strtotime($spotter_item['date']); |
826 | 826 | if (isset($_COOKIE['MapTrack']) && $id == $_COOKIE['MapTrack'] && $minitracktime > strtotime($spotter_item['date'])) $minitracktime = strtotime($spotter_item['date']); |
827 | 827 | if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']); |
828 | - $output .= '"'.date("c",strtotime($spotter_item['date'])).'", '; |
|
828 | + $output .= '"'.date("c", strtotime($spotter_item['date'])).'", '; |
|
829 | 829 | $output .= $spotter_item['longitude'].', '; |
830 | 830 | $output .= $spotter_item['latitude']; |
831 | 831 | $prevlong = $spotter_item['longitude']; |
@@ -853,8 +853,8 @@ discard block |
||
853 | 853 | //$quat = quaternionrotate(deg2rad($spotter_item['heading']),deg2rad(0),deg2rad(0)); |
854 | 854 | //$orientation .= '"'.date("c",strtotime($spotter_item['date'])).'",'.$quat['x'].','.$quat['y'].','.$quat['z'].','.$quat['w']; |
855 | 855 | } else { |
856 | - $nblatlong = $nblatlong+1; |
|
857 | - $output .= ',"'.date("c",strtotime($spotter_item['date'])).'", '; |
|
856 | + $nblatlong = $nblatlong + 1; |
|
857 | + $output .= ',"'.date("c", strtotime($spotter_item['date'])).'", '; |
|
858 | 858 | if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']); |
859 | 859 | if ($spotter_item['ground_speed'] == 0) { |
860 | 860 | $output .= $prevlong.', '; |
@@ -895,26 +895,26 @@ discard block |
||
895 | 895 | $output .= ']'; |
896 | 896 | if (isset($globalArchive) && $globalArchive === TRUE) { |
897 | 897 | if (isset($begindateinitial)) { |
898 | - $output = str_replace('%minitime%',date("c",$begindateinitial),$output); |
|
899 | - } elseif ((time()-$globalLiveInterval) > $minitime) { |
|
900 | - if (time()-$globalLiveInterval > $maxitime) { |
|
901 | - $output = str_replace('%minitime%',date("c",$maxitime),$output); |
|
898 | + $output = str_replace('%minitime%', date("c", $begindateinitial), $output); |
|
899 | + } elseif ((time() - $globalLiveInterval) > $minitime) { |
|
900 | + if (time() - $globalLiveInterval > $maxitime) { |
|
901 | + $output = str_replace('%minitime%', date("c", $maxitime), $output); |
|
902 | 902 | } else { |
903 | - $output = str_replace('%minitime%',date("c",time()-$globalLiveInterval),$output); |
|
903 | + $output = str_replace('%minitime%', date("c", time() - $globalLiveInterval), $output); |
|
904 | 904 | } |
905 | 905 | } |
906 | - else $output = str_replace('%minitime%',date("c",$minitime),$output); |
|
906 | + else $output = str_replace('%minitime%', date("c", $minitime), $output); |
|
907 | 907 | } elseif (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '' && $minitracktime != $minitracktime_begin) { |
908 | - $output = str_replace('%minitime%',date("c",$minitracktime),$output); |
|
908 | + $output = str_replace('%minitime%', date("c", $minitracktime), $output); |
|
909 | 909 | } else { |
910 | - $output = str_replace('%minitime%',date("c",$minitime),$output); |
|
910 | + $output = str_replace('%minitime%', date("c", $minitime), $output); |
|
911 | 911 | } |
912 | 912 | if (isset($enddateinitial)) { |
913 | - $output = str_replace('%maxitime%',date("c",$enddateinitial),$output); |
|
913 | + $output = str_replace('%maxitime%', date("c", $enddateinitial), $output); |
|
914 | 914 | } else { |
915 | - $output = str_replace('%maxitime%',date("c",$maxitime),$output); |
|
915 | + $output = str_replace('%maxitime%', date("c", $maxitime), $output); |
|
916 | 916 | } |
917 | -if ($gltf2) $output = str_replace('%gltf2%','true',$output); |
|
918 | -else $output = str_replace('%gltf2%','false',$output); |
|
917 | +if ($gltf2) $output = str_replace('%gltf2%', 'true', $output); |
|
918 | +else $output = str_replace('%gltf2%', 'false', $output); |
|
919 | 919 | print $output; |
920 | 920 | ?> |
@@ -13,10 +13,10 @@ discard block |
||
13 | 13 | |
14 | 14 | |
15 | 15 | /** |
16 | - * Get SQL query part for filter used |
|
17 | - * @param Array $filter the filter |
|
18 | - * @return Array the SQL part |
|
19 | - */ |
|
16 | + * Get SQL query part for filter used |
|
17 | + * @param Array $filter the filter |
|
18 | + * @return Array the SQL part |
|
19 | + */ |
|
20 | 20 | public function getFilter($filter = array(),$where = false,$and = false) { |
21 | 21 | global $globalFilter, $globalStatsFilters, $globalFilterName, $globalDBdriver; |
22 | 22 | $filters = array(); |
@@ -136,11 +136,11 @@ discard block |
||
136 | 136 | } |
137 | 137 | |
138 | 138 | /** |
139 | - * Gets all the spotter information based on the latest data entry |
|
140 | - * |
|
141 | - * @return Array the spotter information |
|
142 | - * |
|
143 | - */ |
|
139 | + * Gets all the spotter information based on the latest data entry |
|
140 | + * |
|
141 | + * @return Array the spotter information |
|
142 | + * |
|
143 | + */ |
|
144 | 144 | public function getLiveSpotterData($limit = '', $sort = '', $filter = array()) |
145 | 145 | { |
146 | 146 | global $globalDBdriver, $globalLiveInterval; |
@@ -183,11 +183,11 @@ discard block |
||
183 | 183 | } |
184 | 184 | |
185 | 185 | /** |
186 | - * Gets Minimal Live Spotter data |
|
187 | - * |
|
188 | - * @return Array the spotter information |
|
189 | - * |
|
190 | - */ |
|
186 | + * Gets Minimal Live Spotter data |
|
187 | + * |
|
188 | + * @return Array the spotter information |
|
189 | + * |
|
190 | + */ |
|
191 | 191 | public function getMinLiveSpotterData($filter = array()) |
192 | 192 | { |
193 | 193 | global $globalDBdriver, $globalLiveInterval, $globalArchive; |
@@ -224,11 +224,11 @@ discard block |
||
224 | 224 | } |
225 | 225 | |
226 | 226 | /** |
227 | - * Gets Minimal Live Spotter data since xx seconds |
|
228 | - * |
|
229 | - * @return Array the spotter information |
|
230 | - * |
|
231 | - */ |
|
227 | + * Gets Minimal Live Spotter data since xx seconds |
|
228 | + * |
|
229 | + * @return Array the spotter information |
|
230 | + * |
|
231 | + */ |
|
232 | 232 | public function getMinLastLiveSpotterData($coord = array(),$filter = array(), $limit = false, $id = '') |
233 | 233 | { |
234 | 234 | global $globalDBdriver, $globalLiveInterval, $globalArchive, $globalMap3DAircraftsLimit; |
@@ -325,11 +325,11 @@ discard block |
||
325 | 325 | } |
326 | 326 | |
327 | 327 | /** |
328 | - * Gets Minimal Live Spotter data since xx seconds |
|
329 | - * |
|
330 | - * @return Array the spotter information |
|
331 | - * |
|
332 | - */ |
|
328 | + * Gets Minimal Live Spotter data since xx seconds |
|
329 | + * |
|
330 | + * @return Array the spotter information |
|
331 | + * |
|
332 | + */ |
|
333 | 333 | public function getMinLastLiveSpotterDataByID($id = '',$filter = array(), $limit = false) |
334 | 334 | { |
335 | 335 | global $globalDBdriver, $globalLiveInterval, $globalArchive, $globalMap3DAircraftsLimit; |
@@ -394,11 +394,11 @@ discard block |
||
394 | 394 | } |
395 | 395 | |
396 | 396 | /** |
397 | - * Gets number of latest data entry |
|
398 | - * |
|
399 | - * @return String number of entry |
|
400 | - * |
|
401 | - */ |
|
397 | + * Gets number of latest data entry |
|
398 | + * |
|
399 | + * @return String number of entry |
|
400 | + * |
|
401 | + */ |
|
402 | 402 | public function getLiveSpotterCount($filter = array()) |
403 | 403 | { |
404 | 404 | global $globalDBdriver, $globalLiveInterval; |
@@ -425,11 +425,11 @@ discard block |
||
425 | 425 | } |
426 | 426 | |
427 | 427 | /** |
428 | - * Gets all the spotter information based on the latest data entry and coord |
|
429 | - * |
|
430 | - * @return Array the spotter information |
|
431 | - * |
|
432 | - */ |
|
428 | + * Gets all the spotter information based on the latest data entry and coord |
|
429 | + * |
|
430 | + * @return Array the spotter information |
|
431 | + * |
|
432 | + */ |
|
433 | 433 | public function getLiveSpotterDatabyCoord($coord, $filter = array()) |
434 | 434 | { |
435 | 435 | global $globalDBdriver, $globalLiveInterval; |
@@ -454,11 +454,11 @@ discard block |
||
454 | 454 | } |
455 | 455 | |
456 | 456 | /** |
457 | - * Gets all the spotter information based on the latest data entry and coord |
|
458 | - * |
|
459 | - * @return Array the spotter information |
|
460 | - * |
|
461 | - */ |
|
457 | + * Gets all the spotter information based on the latest data entry and coord |
|
458 | + * |
|
459 | + * @return Array the spotter information |
|
460 | + * |
|
461 | + */ |
|
462 | 462 | public function getMinLiveSpotterDatabyCoord($coord, $filter = array()) |
463 | 463 | { |
464 | 464 | global $globalDBdriver, $globalLiveInterval, $globalArchive; |
@@ -523,11 +523,11 @@ discard block |
||
523 | 523 | } |
524 | 524 | |
525 | 525 | /** |
526 | - * Gets all the spotter information based on a user's latitude and longitude |
|
527 | - * |
|
528 | - * @return Array the spotter information |
|
529 | - * |
|
530 | - */ |
|
526 | + * Gets all the spotter information based on a user's latitude and longitude |
|
527 | + * |
|
528 | + * @return Array the spotter information |
|
529 | + * |
|
530 | + */ |
|
531 | 531 | public function getLatestSpotterForLayar($lat, $lng, $radius, $interval) |
532 | 532 | { |
533 | 533 | $Spotter = new Spotter($this->db); |
@@ -537,98 +537,98 @@ discard block |
||
537 | 537 | return false; |
538 | 538 | } |
539 | 539 | } |
540 | - if ($lng != '') |
|
541 | - { |
|
542 | - if (!is_numeric($lng)) |
|
543 | - { |
|
544 | - return false; |
|
545 | - } |
|
546 | - } |
|
547 | - |
|
548 | - if ($radius != '') |
|
549 | - { |
|
550 | - if (!is_numeric($radius)) |
|
551 | - { |
|
552 | - return false; |
|
553 | - } |
|
554 | - } |
|
540 | + if ($lng != '') |
|
541 | + { |
|
542 | + if (!is_numeric($lng)) |
|
543 | + { |
|
544 | + return false; |
|
545 | + } |
|
546 | + } |
|
547 | + |
|
548 | + if ($radius != '') |
|
549 | + { |
|
550 | + if (!is_numeric($radius)) |
|
551 | + { |
|
552 | + return false; |
|
553 | + } |
|
554 | + } |
|
555 | 555 | $additional_query = ''; |
556 | - if ($interval != '') |
|
557 | - { |
|
558 | - if (!is_string($interval)) |
|
559 | - { |
|
560 | - //$additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 MINUTE) <= spotter_live.date '; |
|
561 | - return false; |
|
562 | - } else { |
|
563 | - if ($interval == '1m') |
|
564 | - { |
|
565 | - $additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 MINUTE) <= spotter_live.date '; |
|
566 | - } else if ($interval == '15m'){ |
|
567 | - $additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 15 MINUTE) <= spotter_live.date '; |
|
568 | - } |
|
569 | - } |
|
570 | - } else { |
|
571 | - $additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 MINUTE) <= spotter_live.date '; |
|
572 | - } |
|
573 | - |
|
574 | - $query = "SELECT spotter_live.*, ( 6371 * acos( cos( radians(:lat) ) * cos( radians( latitude ) ) * cos( radians( longitude ) - radians(:lng) ) + sin( radians(:lat) ) * sin( radians( latitude ) ) ) ) AS distance FROM spotter_live |
|
556 | + if ($interval != '') |
|
557 | + { |
|
558 | + if (!is_string($interval)) |
|
559 | + { |
|
560 | + //$additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 MINUTE) <= spotter_live.date '; |
|
561 | + return false; |
|
562 | + } else { |
|
563 | + if ($interval == '1m') |
|
564 | + { |
|
565 | + $additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 MINUTE) <= spotter_live.date '; |
|
566 | + } else if ($interval == '15m'){ |
|
567 | + $additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 15 MINUTE) <= spotter_live.date '; |
|
568 | + } |
|
569 | + } |
|
570 | + } else { |
|
571 | + $additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 MINUTE) <= spotter_live.date '; |
|
572 | + } |
|
573 | + |
|
574 | + $query = "SELECT spotter_live.*, ( 6371 * acos( cos( radians(:lat) ) * cos( radians( latitude ) ) * cos( radians( longitude ) - radians(:lng) ) + sin( radians(:lat) ) * sin( radians( latitude ) ) ) ) AS distance FROM spotter_live |
|
575 | 575 | WHERE spotter_live.latitude <> '' |
576 | 576 | AND spotter_live.longitude <> '' |
577 | 577 | ".$additional_query." |
578 | 578 | HAVING distance < :radius |
579 | 579 | ORDER BY distance"; |
580 | 580 | |
581 | - $spotter_array = $Spotter->getDataFromDB($query, array(':lat' => $lat, ':lng' => $lng,':radius' => $radius)); |
|
581 | + $spotter_array = $Spotter->getDataFromDB($query, array(':lat' => $lat, ':lng' => $lng,':radius' => $radius)); |
|
582 | 582 | |
583 | - return $spotter_array; |
|
584 | - } |
|
583 | + return $spotter_array; |
|
584 | + } |
|
585 | 585 | |
586 | 586 | |
587 | - /** |
|
588 | - * Gets all the spotter information based on a particular callsign |
|
589 | - * |
|
590 | - * @return Array the spotter information |
|
591 | - * |
|
592 | - */ |
|
587 | + /** |
|
588 | + * Gets all the spotter information based on a particular callsign |
|
589 | + * |
|
590 | + * @return Array the spotter information |
|
591 | + * |
|
592 | + */ |
|
593 | 593 | public function getLastLiveSpotterDataByIdent($ident) |
594 | 594 | { |
595 | 595 | $Spotter = new Spotter($this->db); |
596 | 596 | date_default_timezone_set('UTC'); |
597 | 597 | |
598 | 598 | $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
599 | - $query = 'SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE l.ident = :ident GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate ORDER BY spotter_live.date DESC'; |
|
599 | + $query = 'SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE l.ident = :ident GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate ORDER BY spotter_live.date DESC'; |
|
600 | 600 | |
601 | 601 | $spotter_array = $Spotter->getDataFromDB($query,array(':ident' => $ident),'',true); |
602 | 602 | |
603 | 603 | return $spotter_array; |
604 | 604 | } |
605 | 605 | |
606 | - /** |
|
607 | - * Gets all the spotter information based on a particular callsign |
|
608 | - * |
|
609 | - * @return Array the spotter information |
|
610 | - * |
|
611 | - */ |
|
606 | + /** |
|
607 | + * Gets all the spotter information based on a particular callsign |
|
608 | + * |
|
609 | + * @return Array the spotter information |
|
610 | + * |
|
611 | + */ |
|
612 | 612 | public function getDateLiveSpotterDataByIdent($ident,$date) |
613 | 613 | { |
614 | 614 | $Spotter = new Spotter($this->db); |
615 | 615 | date_default_timezone_set('UTC'); |
616 | 616 | |
617 | 617 | $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
618 | - $query = 'SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE l.ident = :ident AND l.date <= :date GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate ORDER BY spotter_live.date DESC'; |
|
618 | + $query = 'SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE l.ident = :ident AND l.date <= :date GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate ORDER BY spotter_live.date DESC'; |
|
619 | 619 | |
620 | - $date = date('c',$date); |
|
620 | + $date = date('c',$date); |
|
621 | 621 | $spotter_array = $Spotter->getDataFromDB($query,array(':ident' => $ident,':date' => $date)); |
622 | 622 | |
623 | 623 | return $spotter_array; |
624 | 624 | } |
625 | 625 | |
626 | - /** |
|
627 | - * Gets last spotter information based on a particular callsign |
|
628 | - * |
|
629 | - * @return Array the spotter information |
|
630 | - * |
|
631 | - */ |
|
626 | + /** |
|
627 | + * Gets last spotter information based on a particular callsign |
|
628 | + * |
|
629 | + * @return Array the spotter information |
|
630 | + * |
|
631 | + */ |
|
632 | 632 | public function getLastLiveSpotterDataById($id) |
633 | 633 | { |
634 | 634 | $Spotter = new Spotter($this->db); |
@@ -639,12 +639,12 @@ discard block |
||
639 | 639 | return $spotter_array; |
640 | 640 | } |
641 | 641 | |
642 | - /** |
|
643 | - * Gets last spotter information based on a particular callsign |
|
644 | - * |
|
645 | - * @return Array the spotter information |
|
646 | - * |
|
647 | - */ |
|
642 | + /** |
|
643 | + * Gets last spotter information based on a particular callsign |
|
644 | + * |
|
645 | + * @return Array the spotter information |
|
646 | + * |
|
647 | + */ |
|
648 | 648 | public function getDateLiveSpotterDataById($id,$date) |
649 | 649 | { |
650 | 650 | $Spotter = new Spotter($this->db); |
@@ -657,21 +657,21 @@ discard block |
||
657 | 657 | return $spotter_array; |
658 | 658 | } |
659 | 659 | |
660 | - /** |
|
661 | - * Gets altitude information based on a particular callsign |
|
662 | - * |
|
663 | - * @return Array the spotter information |
|
664 | - * |
|
665 | - */ |
|
660 | + /** |
|
661 | + * Gets altitude information based on a particular callsign |
|
662 | + * |
|
663 | + * @return Array the spotter information |
|
664 | + * |
|
665 | + */ |
|
666 | 666 | public function getAltitudeLiveSpotterDataByIdent($ident) |
667 | 667 | { |
668 | 668 | |
669 | 669 | date_default_timezone_set('UTC'); |
670 | 670 | |
671 | 671 | $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
672 | - $query = 'SELECT spotter_live.altitude, spotter_live.date FROM spotter_live WHERE spotter_live.ident = :ident'; |
|
672 | + $query = 'SELECT spotter_live.altitude, spotter_live.date FROM spotter_live WHERE spotter_live.ident = :ident'; |
|
673 | 673 | |
674 | - try { |
|
674 | + try { |
|
675 | 675 | |
676 | 676 | $sth = $this->db->prepare($query); |
677 | 677 | $sth->execute(array(':ident' => $ident)); |
@@ -684,12 +684,12 @@ discard block |
||
684 | 684 | return $spotter_array; |
685 | 685 | } |
686 | 686 | |
687 | - /** |
|
688 | - * Gets all the spotter information based on a particular id |
|
689 | - * |
|
690 | - * @return Array the spotter information |
|
691 | - * |
|
692 | - */ |
|
687 | + /** |
|
688 | + * Gets all the spotter information based on a particular id |
|
689 | + * |
|
690 | + * @return Array the spotter information |
|
691 | + * |
|
692 | + */ |
|
693 | 693 | public function getAllLiveSpotterDataById($id,$liveinterval = false) |
694 | 694 | { |
695 | 695 | global $globalDBdriver, $globalLiveInterval; |
@@ -717,18 +717,18 @@ discard block |
||
717 | 717 | return $spotter_array; |
718 | 718 | } |
719 | 719 | |
720 | - /** |
|
721 | - * Gets all the spotter information based on a particular ident |
|
722 | - * |
|
723 | - * @return Array the spotter information |
|
724 | - * |
|
725 | - */ |
|
720 | + /** |
|
721 | + * Gets all the spotter information based on a particular ident |
|
722 | + * |
|
723 | + * @return Array the spotter information |
|
724 | + * |
|
725 | + */ |
|
726 | 726 | public function getAllLiveSpotterDataByIdent($ident) |
727 | 727 | { |
728 | 728 | date_default_timezone_set('UTC'); |
729 | 729 | $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
730 | 730 | $query = self::$global_query.' WHERE spotter_live.ident = :ident'; |
731 | - try { |
|
731 | + try { |
|
732 | 732 | |
733 | 733 | $sth = $this->db->prepare($query); |
734 | 734 | $sth->execute(array(':ident' => $ident)); |
@@ -742,23 +742,23 @@ discard block |
||
742 | 742 | |
743 | 743 | |
744 | 744 | /** |
745 | - * Deletes all info in the table |
|
746 | - * |
|
747 | - * @return String success or false |
|
748 | - * |
|
749 | - */ |
|
745 | + * Deletes all info in the table |
|
746 | + * |
|
747 | + * @return String success or false |
|
748 | + * |
|
749 | + */ |
|
750 | 750 | public function deleteLiveSpotterData() |
751 | 751 | { |
752 | 752 | global $globalDBdriver; |
753 | 753 | if ($globalDBdriver == 'mysql') { |
754 | 754 | //$query = "DELETE FROM spotter_live WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL 30 MINUTE) >= spotter_live.date"; |
755 | 755 | $query = 'DELETE FROM spotter_live WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL 9 HOUR) >= spotter_live.date'; |
756 | - //$query = "DELETE FROM spotter_live WHERE spotter_live.id IN (SELECT spotter_live.id FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 HOUR) >= spotter_live.date)"; |
|
756 | + //$query = "DELETE FROM spotter_live WHERE spotter_live.id IN (SELECT spotter_live.id FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 HOUR) >= spotter_live.date)"; |
|
757 | 757 | } else { |
758 | 758 | $query = "DELETE FROM spotter_live WHERE NOW() AT TIME ZONE 'UTC' - INTERVAL '9 HOURS' >= spotter_live.date"; |
759 | 759 | } |
760 | 760 | |
761 | - try { |
|
761 | + try { |
|
762 | 762 | |
763 | 763 | $sth = $this->db->prepare($query); |
764 | 764 | $sth->execute(); |
@@ -770,18 +770,18 @@ discard block |
||
770 | 770 | } |
771 | 771 | |
772 | 772 | /** |
773 | - * Deletes all info in the table for aircraft not seen since 2 HOUR |
|
774 | - * |
|
775 | - * @return String success or false |
|
776 | - * |
|
777 | - */ |
|
773 | + * Deletes all info in the table for aircraft not seen since 2 HOUR |
|
774 | + * |
|
775 | + * @return String success or false |
|
776 | + * |
|
777 | + */ |
|
778 | 778 | public function deleteLiveSpotterDataNotUpdated() |
779 | 779 | { |
780 | 780 | global $globalDBdriver, $globalDebug; |
781 | 781 | if ($globalDBdriver == 'mysql') { |
782 | 782 | //$query = 'SELECT flightaware_id FROM spotter_live WHERE DATE_SUB(UTC_TIMESTAMP(), INTERVAL 1 HOUR) >= spotter_live.date AND spotter_live.flightaware_id NOT IN (SELECT flightaware_id FROM spotter_live WHERE DATE_SUB(UTC_TIMESTAMP(), INTERVAL 1 HOUR) < spotter_live.date) LIMIT 800 OFFSET 0'; |
783 | - $query = "SELECT spotter_live.flightaware_id FROM spotter_live INNER JOIN (SELECT flightaware_id,MAX(date) as max_date FROM spotter_live GROUP BY flightaware_id) s ON s.flightaware_id = spotter_live.flightaware_id AND DATE_SUB(UTC_TIMESTAMP(), INTERVAL 2 HOUR) >= s.max_date LIMIT 2000 OFFSET 0"; |
|
784 | - try { |
|
783 | + $query = "SELECT spotter_live.flightaware_id FROM spotter_live INNER JOIN (SELECT flightaware_id,MAX(date) as max_date FROM spotter_live GROUP BY flightaware_id) s ON s.flightaware_id = spotter_live.flightaware_id AND DATE_SUB(UTC_TIMESTAMP(), INTERVAL 2 HOUR) >= s.max_date LIMIT 2000 OFFSET 0"; |
|
784 | + try { |
|
785 | 785 | |
786 | 786 | $sth = $this->db->prepare($query); |
787 | 787 | $sth->execute(); |
@@ -789,8 +789,8 @@ discard block |
||
789 | 789 | return "error"; |
790 | 790 | } |
791 | 791 | $query_delete = 'DELETE FROM spotter_live WHERE flightaware_id IN ('; |
792 | - $i = 0; |
|
793 | - $j =0; |
|
792 | + $i = 0; |
|
793 | + $j =0; |
|
794 | 794 | $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
795 | 795 | foreach($all as $row) |
796 | 796 | { |
@@ -798,20 +798,20 @@ discard block |
||
798 | 798 | $j++; |
799 | 799 | if ($j == 30) { |
800 | 800 | if ($globalDebug) echo "."; |
801 | - try { |
|
801 | + try { |
|
802 | 802 | |
803 | 803 | $sth = $this->db->prepare(substr($query_delete,0,-1).")"); |
804 | 804 | $sth->execute(); |
805 | 805 | } catch(PDOException $e) { |
806 | 806 | return "error"; |
807 | 807 | } |
808 | - $query_delete = 'DELETE FROM spotter_live WHERE flightaware_id IN ('; |
|
809 | - $j = 0; |
|
808 | + $query_delete = 'DELETE FROM spotter_live WHERE flightaware_id IN ('; |
|
809 | + $j = 0; |
|
810 | 810 | } |
811 | 811 | $query_delete .= "'".$row['flightaware_id']."',"; |
812 | 812 | } |
813 | 813 | if ($i > 0) { |
814 | - try { |
|
814 | + try { |
|
815 | 815 | |
816 | 816 | $sth = $this->db->prepare(substr($query_delete,0,-1).")"); |
817 | 817 | $sth->execute(); |
@@ -822,9 +822,9 @@ discard block |
||
822 | 822 | return "success"; |
823 | 823 | } elseif ($globalDBdriver == 'pgsql') { |
824 | 824 | //$query = "SELECT flightaware_id FROM spotter_live WHERE NOW() AT TIME ZONE 'UTC' - INTERVAL '9 HOURS' >= spotter_live.date AND spotter_live.flightaware_id NOT IN (SELECT flightaware_id FROM spotter_live WHERE NOW() AT TIME ZONE 'UTC' - INTERVAL '9 HOURS' < spotter_live.date) LIMIT 800 OFFSET 0"; |
825 | - //$query = "SELECT spotter_live.flightaware_id FROM spotter_live INNER JOIN (SELECT flightaware_id,MAX(date) as max_date FROM spotter_live GROUP BY flightaware_id) s ON s.flightaware_id = spotter_live.flightaware_id AND NOW() AT TIME ZONE 'UTC' - INTERVAL '2 HOURS' >= s.max_date LIMIT 800 OFFSET 0"; |
|
826 | - $query = "DELETE FROM spotter_live WHERE flightaware_id IN (SELECT spotter_live.flightaware_id FROM spotter_live INNER JOIN (SELECT flightaware_id,MAX(date) as max_date FROM spotter_live GROUP BY flightaware_id) s ON s.flightaware_id = spotter_live.flightaware_id AND NOW() AT TIME ZONE 'UTC' - INTERVAL '2 HOURS' >= s.max_date LIMIT 2000 OFFSET 0)"; |
|
827 | - try { |
|
825 | + //$query = "SELECT spotter_live.flightaware_id FROM spotter_live INNER JOIN (SELECT flightaware_id,MAX(date) as max_date FROM spotter_live GROUP BY flightaware_id) s ON s.flightaware_id = spotter_live.flightaware_id AND NOW() AT TIME ZONE 'UTC' - INTERVAL '2 HOURS' >= s.max_date LIMIT 800 OFFSET 0"; |
|
826 | + $query = "DELETE FROM spotter_live WHERE flightaware_id IN (SELECT spotter_live.flightaware_id FROM spotter_live INNER JOIN (SELECT flightaware_id,MAX(date) as max_date FROM spotter_live GROUP BY flightaware_id) s ON s.flightaware_id = spotter_live.flightaware_id AND NOW() AT TIME ZONE 'UTC' - INTERVAL '2 HOURS' >= s.max_date LIMIT 2000 OFFSET 0)"; |
|
827 | + try { |
|
828 | 828 | |
829 | 829 | $sth = $this->db->prepare($query); |
830 | 830 | $sth->execute(); |
@@ -868,17 +868,17 @@ discard block |
||
868 | 868 | } |
869 | 869 | |
870 | 870 | /** |
871 | - * Deletes all info in the table for an ident |
|
872 | - * |
|
873 | - * @return String success or false |
|
874 | - * |
|
875 | - */ |
|
871 | + * Deletes all info in the table for an ident |
|
872 | + * |
|
873 | + * @return String success or false |
|
874 | + * |
|
875 | + */ |
|
876 | 876 | public function deleteLiveSpotterDataByIdent($ident) |
877 | 877 | { |
878 | 878 | $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
879 | 879 | $query = 'DELETE FROM spotter_live WHERE ident = :ident'; |
880 | 880 | |
881 | - try { |
|
881 | + try { |
|
882 | 882 | |
883 | 883 | $sth = $this->db->prepare($query); |
884 | 884 | $sth->execute(array(':ident' => $ident)); |
@@ -890,17 +890,17 @@ discard block |
||
890 | 890 | } |
891 | 891 | |
892 | 892 | /** |
893 | - * Deletes all info in the table for an id |
|
894 | - * |
|
895 | - * @return String success or false |
|
896 | - * |
|
897 | - */ |
|
893 | + * Deletes all info in the table for an id |
|
894 | + * |
|
895 | + * @return String success or false |
|
896 | + * |
|
897 | + */ |
|
898 | 898 | public function deleteLiveSpotterDataById($id) |
899 | 899 | { |
900 | 900 | $id = filter_var($id, FILTER_SANITIZE_STRING); |
901 | 901 | $query = 'DELETE FROM spotter_live WHERE flightaware_id = :id'; |
902 | 902 | |
903 | - try { |
|
903 | + try { |
|
904 | 904 | |
905 | 905 | $sth = $this->db->prepare($query); |
906 | 906 | $sth->execute(array(':id' => $id)); |
@@ -913,11 +913,11 @@ discard block |
||
913 | 913 | |
914 | 914 | |
915 | 915 | /** |
916 | - * Gets the aircraft ident within the last hour |
|
917 | - * |
|
918 | - * @return String the ident |
|
919 | - * |
|
920 | - */ |
|
916 | + * Gets the aircraft ident within the last hour |
|
917 | + * |
|
918 | + * @return String the ident |
|
919 | + * |
|
920 | + */ |
|
921 | 921 | public function getIdentFromLastHour($ident) |
922 | 922 | { |
923 | 923 | global $globalDBdriver, $globalTimezone; |
@@ -943,14 +943,14 @@ discard block |
||
943 | 943 | $ident_result = $row['ident']; |
944 | 944 | } |
945 | 945 | return $ident_result; |
946 | - } |
|
946 | + } |
|
947 | 947 | |
948 | 948 | /** |
949 | - * Check recent aircraft |
|
950 | - * |
|
951 | - * @return String the ident |
|
952 | - * |
|
953 | - */ |
|
949 | + * Check recent aircraft |
|
950 | + * |
|
951 | + * @return String the ident |
|
952 | + * |
|
953 | + */ |
|
954 | 954 | public function checkIdentRecent($ident) |
955 | 955 | { |
956 | 956 | global $globalDBdriver, $globalTimezone; |
@@ -976,14 +976,14 @@ discard block |
||
976 | 976 | $ident_result = $row['flightaware_id']; |
977 | 977 | } |
978 | 978 | return $ident_result; |
979 | - } |
|
979 | + } |
|
980 | 980 | |
981 | 981 | /** |
982 | - * Check recent aircraft by id |
|
983 | - * |
|
984 | - * @return String the ident |
|
985 | - * |
|
986 | - */ |
|
982 | + * Check recent aircraft by id |
|
983 | + * |
|
984 | + * @return String the ident |
|
985 | + * |
|
986 | + */ |
|
987 | 987 | public function checkIdRecent($id) |
988 | 988 | { |
989 | 989 | global $globalDBdriver, $globalTimezone; |
@@ -1009,14 +1009,14 @@ discard block |
||
1009 | 1009 | $ident_result = $row['flightaware_id']; |
1010 | 1010 | } |
1011 | 1011 | return $ident_result; |
1012 | - } |
|
1012 | + } |
|
1013 | 1013 | |
1014 | 1014 | /** |
1015 | - * Check recent aircraft by ModeS |
|
1016 | - * |
|
1017 | - * @return String the ModeS |
|
1018 | - * |
|
1019 | - */ |
|
1015 | + * Check recent aircraft by ModeS |
|
1016 | + * |
|
1017 | + * @return String the ModeS |
|
1018 | + * |
|
1019 | + */ |
|
1020 | 1020 | public function checkModeSRecent($modes) |
1021 | 1021 | { |
1022 | 1022 | global $globalDBdriver, $globalTimezone; |
@@ -1046,11 +1046,11 @@ discard block |
||
1046 | 1046 | } |
1047 | 1047 | |
1048 | 1048 | /** |
1049 | - * Gets the aircraft data from the last 20 seconds |
|
1050 | - * |
|
1051 | - * @return Array the spotter data |
|
1052 | - * |
|
1053 | - */ |
|
1049 | + * Gets the aircraft data from the last 20 seconds |
|
1050 | + * |
|
1051 | + * @return Array the spotter data |
|
1052 | + * |
|
1053 | + */ |
|
1054 | 1054 | public function getRealTimeData($q = '') |
1055 | 1055 | { |
1056 | 1056 | global $globalDBdriver; |
@@ -1092,16 +1092,16 @@ discard block |
||
1092 | 1092 | } |
1093 | 1093 | |
1094 | 1094 | /** |
1095 | - * Adds a new spotter data |
|
1096 | - * |
|
1097 | - * @param String $flightaware_id the ID from flightaware |
|
1098 | - * @param String $ident the flight ident |
|
1099 | - * @param String $aircraft_icao the aircraft type |
|
1100 | - * @param String $departure_airport_icao the departure airport |
|
1101 | - * @param String $arrival_airport_icao the arrival airport |
|
1102 | - * @return String success or false |
|
1103 | - * |
|
1104 | - */ |
|
1095 | + * Adds a new spotter data |
|
1096 | + * |
|
1097 | + * @param String $flightaware_id the ID from flightaware |
|
1098 | + * @param String $ident the flight ident |
|
1099 | + * @param String $aircraft_icao the aircraft type |
|
1100 | + * @param String $departure_airport_icao the departure airport |
|
1101 | + * @param String $arrival_airport_icao the arrival airport |
|
1102 | + * @return String success or false |
|
1103 | + * |
|
1104 | + */ |
|
1105 | 1105 | public function addLiveSpotterData($flightaware_id = '', $ident = '', $aircraft_icao = '', $departure_airport_icao = '', $arrival_airport_icao = '', $latitude = '', $longitude = '', $waypoints = '', $altitude = '', $altitude_real = '',$heading = '', $groundspeed = '', $date = '',$departure_airport_time = '', $arrival_airport_time = '', $squawk = '', $route_stop = '', $ModeS = '', $putinarchive = false,$registration = '',$pilot_id = '', $pilot_name = '', $verticalrate = '', $noarchive = false, $ground = false,$format_source = '', $source_name = '', $over_country = '') |
1106 | 1106 | { |
1107 | 1107 | global $globalURL, $globalArchive, $globalDebug; |
@@ -1244,10 +1244,10 @@ discard block |
||
1244 | 1244 | $arrival_airport_country = ''; |
1245 | 1245 | |
1246 | 1246 | |
1247 | - if ($squawk == '' || $Common->isInteger($squawk) === false ) $squawk = NULL; |
|
1248 | - if ($verticalrate == '' || $Common->isInteger($verticalrate) === false ) $verticalrate = NULL; |
|
1249 | - if ($groundspeed == '' || $Common->isInteger($groundspeed) === false ) $groundspeed = 0; |
|
1250 | - if ($heading == '' || $Common->isInteger($heading) === false ) $heading = 0; |
|
1247 | + if ($squawk == '' || $Common->isInteger($squawk) === false ) $squawk = NULL; |
|
1248 | + if ($verticalrate == '' || $Common->isInteger($verticalrate) === false ) $verticalrate = NULL; |
|
1249 | + if ($groundspeed == '' || $Common->isInteger($groundspeed) === false ) $groundspeed = 0; |
|
1250 | + if ($heading == '' || $Common->isInteger($heading) === false ) $heading = 0; |
|
1251 | 1251 | |
1252 | 1252 | $query = ''; |
1253 | 1253 | if ($globalArchive) { |
@@ -1268,10 +1268,10 @@ discard block |
||
1268 | 1268 | return "error : ".$e->getMessage(); |
1269 | 1269 | } |
1270 | 1270 | if (isset($globalArchive) && $globalArchive && $putinarchive && $noarchive !== true) { |
1271 | - if ($globalDebug) echo '(Add to SBS archive : '; |
|
1272 | - $SpotterArchive = new SpotterArchive($this->db); |
|
1273 | - $result = $SpotterArchive->addSpotterArchiveData($flightaware_id, $ident, $registration, $airline_name, $airline_icao, $airline_country, $airline_type, $aircraft_icao, $aircraft_shadow, $aircraft_name, $aircraft_manufacturer, $departure_airport_icao, $departure_airport_name, $departure_airport_city, $departure_airport_country, $departure_airport_time,$arrival_airport_icao, $arrival_airport_name, $arrival_airport_city, $arrival_airport_country, $arrival_airport_time, $route_stop, $date,$latitude, $longitude, $waypoints, $altitude, $altitude_real,$heading, $groundspeed, $squawk, $ModeS, $pilot_id, $pilot_name,$verticalrate,$format_source,$source_name, $over_country); |
|
1274 | - if ($globalDebug) echo $result.')'; |
|
1271 | + if ($globalDebug) echo '(Add to SBS archive : '; |
|
1272 | + $SpotterArchive = new SpotterArchive($this->db); |
|
1273 | + $result = $SpotterArchive->addSpotterArchiveData($flightaware_id, $ident, $registration, $airline_name, $airline_icao, $airline_country, $airline_type, $aircraft_icao, $aircraft_shadow, $aircraft_name, $aircraft_manufacturer, $departure_airport_icao, $departure_airport_name, $departure_airport_city, $departure_airport_country, $departure_airport_time,$arrival_airport_icao, $arrival_airport_name, $arrival_airport_city, $arrival_airport_country, $arrival_airport_time, $route_stop, $date,$latitude, $longitude, $waypoints, $altitude, $altitude_real,$heading, $groundspeed, $squawk, $ModeS, $pilot_id, $pilot_name,$verticalrate,$format_source,$source_name, $over_country); |
|
1274 | + if ($globalDebug) echo $result.')'; |
|
1275 | 1275 | } elseif ($globalDebug && $putinarchive !== true) { |
1276 | 1276 | echo '(Not adding to archive)'; |
1277 | 1277 | } elseif ($globalDebug && $noarchive === true) { |
@@ -17,62 +17,62 @@ discard block |
||
17 | 17 | * @param Array $filter the filter |
18 | 18 | * @return Array the SQL part |
19 | 19 | */ |
20 | - public function getFilter($filter = array(),$where = false,$and = false) { |
|
20 | + public function getFilter($filter = array(), $where = false, $and = false) { |
|
21 | 21 | global $globalFilter, $globalStatsFilters, $globalFilterName, $globalDBdriver; |
22 | 22 | $filters = array(); |
23 | 23 | if (is_array($globalStatsFilters) && isset($globalStatsFilters[$globalFilterName])) { |
24 | 24 | if (isset($globalStatsFilters[$globalFilterName][0]['source'])) { |
25 | 25 | $filters = $globalStatsFilters[$globalFilterName]; |
26 | 26 | } else { |
27 | - $filter = array_merge($filter,$globalStatsFilters[$globalFilterName]); |
|
27 | + $filter = array_merge($filter, $globalStatsFilters[$globalFilterName]); |
|
28 | 28 | } |
29 | 29 | } |
30 | 30 | if (isset($filter[0]['source'])) { |
31 | - $filters = array_merge($filters,$filter); |
|
31 | + $filters = array_merge($filters, $filter); |
|
32 | 32 | } |
33 | - if (is_array($globalFilter)) $filter = array_merge($filter,$globalFilter); |
|
33 | + if (is_array($globalFilter)) $filter = array_merge($filter, $globalFilter); |
|
34 | 34 | $filter_query_join = ''; |
35 | 35 | $filter_query_where = ''; |
36 | - foreach($filters as $flt) { |
|
36 | + foreach ($filters as $flt) { |
|
37 | 37 | if (isset($flt['airlines']) && !empty($flt['airlines'])) { |
38 | 38 | if ($flt['airlines'][0] != '' && $flt['airlines'][0] != 'all') { |
39 | 39 | if (isset($flt['source'])) { |
40 | - $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.airline_icao IN ('".implode("','",$flt['airlines'])."') AND spotter_output.format_source IN ('".implode("','",$flt['source'])."')) saf ON saf.flightaware_id = spotter_live.flightaware_id"; |
|
40 | + $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.airline_icao IN ('".implode("','", $flt['airlines'])."') AND spotter_output.format_source IN ('".implode("','", $flt['source'])."')) saf ON saf.flightaware_id = spotter_live.flightaware_id"; |
|
41 | 41 | } else { |
42 | - $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.airline_icao IN ('".implode("','",$flt['airlines'])."')) saf ON saf.flightaware_id = spotter_live.flightaware_id"; |
|
42 | + $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.airline_icao IN ('".implode("','", $flt['airlines'])."')) saf ON saf.flightaware_id = spotter_live.flightaware_id"; |
|
43 | 43 | } |
44 | 44 | } |
45 | 45 | } |
46 | 46 | if (isset($flt['pilots_id']) && !empty($flt['pilots_id'])) { |
47 | 47 | if (isset($flt['source'])) { |
48 | - $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.pilot_id IN ('".implode("','",$flt['pilots_id'])."') AND spotter_output.format_source IN ('".implode("','",$flt['source'])."')) spi ON spi.flightaware_id = spotter_live.flightaware_id"; |
|
48 | + $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.pilot_id IN ('".implode("','", $flt['pilots_id'])."') AND spotter_output.format_source IN ('".implode("','", $flt['source'])."')) spi ON spi.flightaware_id = spotter_live.flightaware_id"; |
|
49 | 49 | } else { |
50 | - $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.pilot_id IN ('".implode("','",$flt['pilots_id'])."')) spi ON spi.flightaware_id = spotter_live.flightaware_id"; |
|
50 | + $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.pilot_id IN ('".implode("','", $flt['pilots_id'])."')) spi ON spi.flightaware_id = spotter_live.flightaware_id"; |
|
51 | 51 | } |
52 | 52 | } |
53 | 53 | if (isset($flt['idents']) && !empty($flt['idents'])) { |
54 | 54 | if (isset($flt['source'])) { |
55 | - $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.ident IN ('".implode("','",$flt['idents'])."') AND spotter_output.format_source IN ('".implode("','",$flt['source'])."')) spid ON spid.flightaware_id = spotter_live.flightaware_id"; |
|
55 | + $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.ident IN ('".implode("','", $flt['idents'])."') AND spotter_output.format_source IN ('".implode("','", $flt['source'])."')) spid ON spid.flightaware_id = spotter_live.flightaware_id"; |
|
56 | 56 | } else { |
57 | - $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.ident IN ('".implode("','",$flt['idents'])."')) spid ON spid.flightaware_id = spotter_live.flightaware_id"; |
|
57 | + $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.ident IN ('".implode("','", $flt['idents'])."')) spid ON spid.flightaware_id = spotter_live.flightaware_id"; |
|
58 | 58 | } |
59 | 59 | } |
60 | 60 | if (isset($flt['registrations']) && !empty($flt['registrations'])) { |
61 | 61 | if (isset($flt['source'])) { |
62 | - $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.registration IN ('".implode("','",$flt['registrations'])."') AND spotter_output.format_source IN ('".implode("','",$flt['source'])."')) sre ON sre.flightaware_id = spotter_live.flightaware_id"; |
|
62 | + $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.registration IN ('".implode("','", $flt['registrations'])."') AND spotter_output.format_source IN ('".implode("','", $flt['source'])."')) sre ON sre.flightaware_id = spotter_live.flightaware_id"; |
|
63 | 63 | } else { |
64 | - $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.registration IN ('".implode("','",$flt['registrations'])."')) sre ON sre.flightaware_id = spotter_live.flightaware_id"; |
|
64 | + $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.registration IN ('".implode("','", $flt['registrations'])."')) sre ON sre.flightaware_id = spotter_live.flightaware_id"; |
|
65 | 65 | } |
66 | 66 | } |
67 | 67 | if ((isset($flt['airlines']) && empty($flt['airlines']) && isset($flt['pilots_id']) && empty($flt['pilots_id']) && isset($flt['idents']) && empty($flt['idents'])) || (!isset($flt['airlines']) && !isset($flt['pilots_id']) && !isset($flt['idents']) && !isset($flt['registrations']))) { |
68 | 68 | if (isset($flt['source'])) { |
69 | - $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.format_source IN ('".implode("','",$flt['source'])."')) ssf ON ssf.flightaware_id = spotter_live.flightaware_id"; |
|
69 | + $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.format_source IN ('".implode("','", $flt['source'])."')) ssf ON ssf.flightaware_id = spotter_live.flightaware_id"; |
|
70 | 70 | } |
71 | 71 | } |
72 | 72 | } |
73 | 73 | if (isset($filter['airlines']) && !empty($filter['airlines'])) { |
74 | 74 | if ($filter['airlines'][0] != '' && $filter['airlines'][0] != 'all') { |
75 | - $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.airline_icao IN ('".implode("','",$filter['airlines'])."')) sai ON sai.flightaware_id = spotter_live.flightaware_id"; |
|
75 | + $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.airline_icao IN ('".implode("','", $filter['airlines'])."')) sai ON sai.flightaware_id = spotter_live.flightaware_id"; |
|
76 | 76 | } |
77 | 77 | } |
78 | 78 | if (isset($filter['alliance']) && !empty($filter['alliance'])) { |
@@ -82,13 +82,13 @@ discard block |
||
82 | 82 | $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.airline_type = '".$filter['airlinestype']."') sa ON sa.flightaware_id = spotter_live.flightaware_id "; |
83 | 83 | } |
84 | 84 | if (isset($filter['pilots_id']) && !empty($filter['pilots_id'])) { |
85 | - $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.pilot_id IN ('".implode("','",$filter['pilots_id'])."')) sp ON sp.flightaware_id = spotter_live.flightaware_id"; |
|
85 | + $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.pilot_id IN ('".implode("','", $filter['pilots_id'])."')) sp ON sp.flightaware_id = spotter_live.flightaware_id"; |
|
86 | 86 | } |
87 | 87 | if (isset($filter['source']) && !empty($filter['source'])) { |
88 | 88 | if (count($filter['source']) == 1) { |
89 | 89 | $filter_query_where .= " AND format_source = '".$filter['source'][0]."'"; |
90 | 90 | } else { |
91 | - $filter_query_where .= " AND format_source IN ('".implode("','",$filter['source'])."')"; |
|
91 | + $filter_query_where .= " AND format_source IN ('".implode("','", $filter['source'])."')"; |
|
92 | 92 | } |
93 | 93 | } |
94 | 94 | if (isset($filter['ident']) && !empty($filter['ident'])) { |
@@ -121,15 +121,15 @@ discard block |
||
121 | 121 | $filter_query_date .= " AND EXTRACT(DAY FROM spotter_output.date) = '".$filter['day']."'"; |
122 | 122 | } |
123 | 123 | } |
124 | - $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output".preg_replace('/^ AND/',' WHERE',$filter_query_date).") sd ON sd.flightaware_id = spotter_live.flightaware_id"; |
|
124 | + $filter_query_join .= " INNER JOIN (SELECT flightaware_id FROM spotter_output".preg_replace('/^ AND/', ' WHERE', $filter_query_date).") sd ON sd.flightaware_id = spotter_live.flightaware_id"; |
|
125 | 125 | } |
126 | 126 | if (isset($filter['source_aprs']) && !empty($filter['source_aprs'])) { |
127 | - $filter_query_where .= " AND format_source = 'aprs' AND source_name IN ('".implode("','",$filter['source_aprs'])."')"; |
|
127 | + $filter_query_where .= " AND format_source = 'aprs' AND source_name IN ('".implode("','", $filter['source_aprs'])."')"; |
|
128 | 128 | } |
129 | 129 | if ($filter_query_where == '' && $where) $filter_query_where = ' WHERE'; |
130 | 130 | elseif ($filter_query_where != '' && $and) $filter_query_where .= ' AND'; |
131 | 131 | if ($filter_query_where != '') { |
132 | - $filter_query_where = preg_replace('/^ AND/',' WHERE',$filter_query_where); |
|
132 | + $filter_query_where = preg_replace('/^ AND/', ' WHERE', $filter_query_where); |
|
133 | 133 | } |
134 | 134 | $filter_query = $filter_query_join.$filter_query_where; |
135 | 135 | return $filter_query; |
@@ -152,8 +152,8 @@ discard block |
||
152 | 152 | if ($limit != '') |
153 | 153 | { |
154 | 154 | $limit_array = explode(',', $limit); |
155 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
156 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
155 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
156 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
157 | 157 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
158 | 158 | { |
159 | 159 | $limit_query = ' LIMIT '.$limit_array[1].' OFFSET '.$limit_array[0]; |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | } else { |
178 | 178 | $query = "SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$globalLiveInterval." SECONDS' <= l.date GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate".$filter_query.$orderby_query; |
179 | 179 | } |
180 | - $spotter_array = $Spotter->getDataFromDB($query.$limit_query,array(),'',true); |
|
180 | + $spotter_array = $Spotter->getDataFromDB($query.$limit_query, array(), '', true); |
|
181 | 181 | |
182 | 182 | return $spotter_array; |
183 | 183 | } |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | { |
193 | 193 | global $globalDBdriver, $globalLiveInterval, $globalArchive; |
194 | 194 | date_default_timezone_set('UTC'); |
195 | - $filter_query = $this->getFilter($filter,true,true); |
|
195 | + $filter_query = $this->getFilter($filter, true, true); |
|
196 | 196 | if (!isset($globalLiveInterval)) $globalLiveInterval = '200'; |
197 | 197 | if ($globalDBdriver == 'mysql') { |
198 | 198 | if (isset($globalArchive) && $globalArchive === TRUE) { |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | try { |
216 | 216 | $sth = $this->db->prepare($query); |
217 | 217 | $sth->execute(); |
218 | - } catch(PDOException $e) { |
|
218 | + } catch (PDOException $e) { |
|
219 | 219 | echo $e->getMessage(); |
220 | 220 | die; |
221 | 221 | } |
@@ -229,20 +229,20 @@ discard block |
||
229 | 229 | * @return Array the spotter information |
230 | 230 | * |
231 | 231 | */ |
232 | - public function getMinLastLiveSpotterData($coord = array(),$filter = array(), $limit = false, $id = '') |
|
232 | + public function getMinLastLiveSpotterData($coord = array(), $filter = array(), $limit = false, $id = '') |
|
233 | 233 | { |
234 | 234 | global $globalDBdriver, $globalLiveInterval, $globalArchive, $globalMap3DAircraftsLimit; |
235 | 235 | date_default_timezone_set('UTC'); |
236 | 236 | $usecoord = false; |
237 | 237 | if (is_array($coord) && !empty($coord)) { |
238 | - $minlong = filter_var($coord[0],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
239 | - $minlat = filter_var($coord[1],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
240 | - $maxlong = filter_var($coord[2],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
241 | - $maxlat = filter_var($coord[3],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
238 | + $minlong = filter_var($coord[0], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
239 | + $minlat = filter_var($coord[1], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
240 | + $maxlong = filter_var($coord[2], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
241 | + $maxlat = filter_var($coord[3], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
242 | 242 | $usecoord = true; |
243 | 243 | } |
244 | - $id = filter_var($id,FILTER_SANITIZE_STRING); |
|
245 | - $filter_query = $this->getFilter($filter,true,true); |
|
244 | + $id = filter_var($id, FILTER_SANITIZE_STRING); |
|
245 | + $filter_query = $this->getFilter($filter, true, true); |
|
246 | 246 | |
247 | 247 | if (!isset($globalLiveInterval) || $globalLiveInterval == '') $globalLiveInterval = '200'; |
248 | 248 | if (!isset($globalMap3DAircraftsLimit) || $globalMap3DAircraftsLimit == '') $globalMap3DAircraftsLimit = '300'; |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | WHERE spotter_archive.latitude <> '0' AND spotter_archive.longitude <> '0' |
255 | 255 | ORDER BY spotter_archive.flightaware_id, spotter_archive.date"; |
256 | 256 | */ |
257 | - $query = 'SELECT * FROM (SELECT spotter_archive.ident, spotter_archive.flightaware_id, spotter_archive.aircraft_icao, spotter_archive.departure_airport_icao as departure_airport, spotter_archive.arrival_airport_icao as arrival_airport, spotter_archive.latitude, spotter_archive.longitude, spotter_archive.altitude, spotter_archive.heading, spotter_archive.ground_speed, spotter_archive.squawk, spotter_archive.date, spotter_archive.format_source, spotter_archive.registration |
|
257 | + $query = 'SELECT * FROM (SELECT spotter_archive.ident, spotter_archive.flightaware_id, spotter_archive.aircraft_icao, spotter_archive.departure_airport_icao as departure_airport, spotter_archive.arrival_airport_icao as arrival_airport, spotter_archive.latitude, spotter_archive.longitude, spotter_archive.altitude, spotter_archive.heading, spotter_archive.ground_speed, spotter_archive.squawk, spotter_archive.date, spotter_archive.format_source, spotter_archive.registration |
|
258 | 258 | FROM spotter_archive INNER JOIN (SELECT flightaware_id FROM spotter_live'.$filter_query.' DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval." SECOND) <= spotter_live.date) l ON l.flightaware_id = spotter_archive.flightaware_id "; |
259 | 259 | if ($usecoord) $query .= "AND (spotter_archive.latitude BETWEEN ".$minlat." AND ".$maxlat." AND spotter_archive.longitude BETWEEN ".$minlong." AND ".$maxlong.") "; |
260 | 260 | if ($id != '') $query .= "OR spotter_archive.flightaware_id = :id "; |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | ORDER BY flightaware_id, date"; |
269 | 269 | if ($limit) $query .= " LIMIT ".$globalMap3DAircraftsLimit; |
270 | 270 | } else { |
271 | - $query = 'SELECT spotter_live.ident, spotter_live.flightaware_id, spotter_live.aircraft_icao, spotter_live.departure_airport_icao as departure_airport, spotter_live.arrival_airport_icao as arrival_airport, spotter_live.latitude, spotter_live.longitude, spotter_live.altitude, spotter_live.heading, spotter_live.ground_speed, spotter_live.squawk, spotter_live.date, spotter_live.format_source, spotter_live.registration |
|
271 | + $query = 'SELECT spotter_live.ident, spotter_live.flightaware_id, spotter_live.aircraft_icao, spotter_live.departure_airport_icao as departure_airport, spotter_live.arrival_airport_icao as arrival_airport, spotter_live.latitude, spotter_live.longitude, spotter_live.altitude, spotter_live.heading, spotter_live.ground_speed, spotter_live.squawk, spotter_live.date, spotter_live.format_source, spotter_live.registration |
|
272 | 272 | FROM spotter_live'.$filter_query.' DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval." SECOND) <= spotter_live.date "; |
273 | 273 | if ($usecoord) $query .= "AND (spotter_live.latitude BETWEEN ".$minlat." AND ".$maxlat." AND spotter_live.longitude BETWEEN ".$minlong." AND ".$maxlong.") "; |
274 | 274 | if ($id != '') $query .= "OR spotter_live.flightaware_id = :id "; |
@@ -284,13 +284,13 @@ discard block |
||
284 | 284 | WHERE spotter_archive.latitude <> '0' AND spotter_archive.longitude <> '0' |
285 | 285 | ORDER BY spotter_archive.flightaware_id, spotter_archive.date"; |
286 | 286 | */ |
287 | - $query = "SELECT * FROM ( |
|
287 | + $query = "SELECT * FROM ( |
|
288 | 288 | SELECT spotter_archive.ident, spotter_archive.flightaware_id, spotter_archive.aircraft_icao, spotter_archive.departure_airport_icao as departure_airport, spotter_archive.arrival_airport_icao as arrival_airport, spotter_archive.latitude, spotter_archive.longitude, spotter_archive.altitude, spotter_archive.heading, spotter_archive.ground_speed, spotter_archive.squawk, spotter_archive.date, spotter_archive.format_source, spotter_archive.registration |
289 | 289 | FROM spotter_archive |
290 | 290 | INNER JOIN ( |
291 | 291 | SELECT flightaware_id |
292 | 292 | FROM spotter_live".$filter_query." CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$globalLiveInterval." SECONDS' <= spotter_live.date"; |
293 | - $query.= ") l ON l.flightaware_id = spotter_archive.flightaware_id "; |
|
293 | + $query .= ") l ON l.flightaware_id = spotter_archive.flightaware_id "; |
|
294 | 294 | if ($usecoord) $query .= "AND (spotter_archive.latitude BETWEEN ".$minlat." AND ".$maxlat." AND spotter_archive.longitude BETWEEN ".$minlong." AND ".$maxlong.") "; |
295 | 295 | if ($id != '') $query .= "OR spotter_archive.flightaware_id = :id "; |
296 | 296 | $query .= "UNION |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | try { |
317 | 317 | $sth = $this->db->prepare($query); |
318 | 318 | $sth->execute($query_values); |
319 | - } catch(PDOException $e) { |
|
319 | + } catch (PDOException $e) { |
|
320 | 320 | echo $e->getMessage(); |
321 | 321 | die; |
322 | 322 | } |
@@ -330,12 +330,12 @@ discard block |
||
330 | 330 | * @return Array the spotter information |
331 | 331 | * |
332 | 332 | */ |
333 | - public function getMinLastLiveSpotterDataByID($id = '',$filter = array(), $limit = false) |
|
333 | + public function getMinLastLiveSpotterDataByID($id = '', $filter = array(), $limit = false) |
|
334 | 334 | { |
335 | 335 | global $globalDBdriver, $globalLiveInterval, $globalArchive, $globalMap3DAircraftsLimit; |
336 | 336 | date_default_timezone_set('UTC'); |
337 | - $id = filter_var($id,FILTER_SANITIZE_STRING); |
|
338 | - $filter_query = $this->getFilter($filter,true,true); |
|
337 | + $id = filter_var($id, FILTER_SANITIZE_STRING); |
|
338 | + $filter_query = $this->getFilter($filter, true, true); |
|
339 | 339 | |
340 | 340 | if (!isset($globalLiveInterval) || $globalLiveInterval == '') $globalLiveInterval = '200'; |
341 | 341 | if (!isset($globalMap3DAircraftsLimit) || $globalMap3DAircraftsLimit == '') $globalMap3DAircraftsLimit = '300'; |
@@ -359,13 +359,13 @@ discard block |
||
359 | 359 | } |
360 | 360 | } else { |
361 | 361 | if (isset($globalArchive) && $globalArchive === TRUE) { |
362 | - $query = "SELECT * FROM ( |
|
362 | + $query = "SELECT * FROM ( |
|
363 | 363 | SELECT spotter_archive.ident, spotter_archive.flightaware_id, spotter_archive.aircraft_icao, spotter_archive.departure_airport_icao as departure_airport, spotter_archive.arrival_airport_icao as arrival_airport, spotter_archive.latitude, spotter_archive.longitude, spotter_archive.altitude, spotter_archive.heading, spotter_archive.ground_speed, spotter_archive.squawk, spotter_archive.date, spotter_archive.format_source, spotter_archive.registration |
364 | 364 | FROM spotter_archive |
365 | 365 | INNER JOIN ( |
366 | 366 | SELECT flightaware_id |
367 | 367 | FROM spotter_live".$filter_query." spotter_live.flightaware_id = :id"; |
368 | - $query.= ") l ON l.flightaware_id = spotter_archive.flightaware_id "; |
|
368 | + $query .= ") l ON l.flightaware_id = spotter_archive.flightaware_id "; |
|
369 | 369 | $query .= "UNION |
370 | 370 | SELECT spotter_live.ident, spotter_live.flightaware_id, spotter_live.aircraft_icao, spotter_live.departure_airport_icao as departure_airport, spotter_live.arrival_airport_icao as arrival_airport, spotter_live.latitude, spotter_live.longitude, spotter_live.altitude, spotter_live.heading, spotter_live.ground_speed, spotter_live.squawk, spotter_live.date, spotter_live.format_source, spotter_live.registration |
371 | 371 | FROM spotter_live".$filter_query." spotter_live.flightaware_id = :id"; |
@@ -385,7 +385,7 @@ discard block |
||
385 | 385 | try { |
386 | 386 | $sth = $this->db->prepare($query); |
387 | 387 | $sth->execute($query_values); |
388 | - } catch(PDOException $e) { |
|
388 | + } catch (PDOException $e) { |
|
389 | 389 | echo $e->getMessage(); |
390 | 390 | die; |
391 | 391 | } |
@@ -402,7 +402,7 @@ discard block |
||
402 | 402 | public function getLiveSpotterCount($filter = array()) |
403 | 403 | { |
404 | 404 | global $globalDBdriver, $globalLiveInterval; |
405 | - $filter_query = $this->getFilter($filter,true,true); |
|
405 | + $filter_query = $this->getFilter($filter, true, true); |
|
406 | 406 | |
407 | 407 | if (!isset($globalLiveInterval)) $globalLiveInterval = '200'; |
408 | 408 | if ($globalDBdriver == 'mysql') { |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | try { |
416 | 416 | $sth = $this->db->prepare($query); |
417 | 417 | $sth->execute(); |
418 | - } catch(PDOException $e) { |
|
418 | + } catch (PDOException $e) { |
|
419 | 419 | echo $e->getMessage(); |
420 | 420 | die; |
421 | 421 | } |
@@ -438,10 +438,10 @@ discard block |
||
438 | 438 | $filter_query = $this->getFilter($filter); |
439 | 439 | |
440 | 440 | if (is_array($coord)) { |
441 | - $minlong = filter_var($coord[0],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
442 | - $minlat = filter_var($coord[1],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
443 | - $maxlong = filter_var($coord[2],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
444 | - $maxlat = filter_var($coord[3],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
441 | + $minlong = filter_var($coord[0], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
442 | + $minlat = filter_var($coord[1], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
443 | + $maxlong = filter_var($coord[2], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
444 | + $maxlat = filter_var($coord[3], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
445 | 445 | } else return array(); |
446 | 446 | if ($globalDBdriver == 'mysql') { |
447 | 447 | $query = 'SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= l.date GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate AND spotter_live.latitude BETWEEN '.$minlat.' AND '.$maxlat.' AND spotter_live.longitude BETWEEN '.$minlong.' AND '.$maxlong.' GROUP BY spotter_live.flightaware_id'.$filter_query; |
@@ -464,23 +464,23 @@ discard block |
||
464 | 464 | global $globalDBdriver, $globalLiveInterval, $globalArchive; |
465 | 465 | $Spotter = new Spotter($this->db); |
466 | 466 | if (!isset($globalLiveInterval)) $globalLiveInterval = '200'; |
467 | - $filter_query = $this->getFilter($filter,true,true); |
|
467 | + $filter_query = $this->getFilter($filter, true, true); |
|
468 | 468 | |
469 | 469 | if (is_array($coord)) { |
470 | - $minlong = filter_var($coord[0],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
471 | - $minlat = filter_var($coord[1],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
472 | - $maxlong = filter_var($coord[2],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
473 | - $maxlat = filter_var($coord[3],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
470 | + $minlong = filter_var($coord[0], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
471 | + $minlat = filter_var($coord[1], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
472 | + $maxlong = filter_var($coord[2], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
473 | + $maxlat = filter_var($coord[3], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
474 | 474 | } else return array(); |
475 | 475 | if ($globalDBdriver == 'mysql') { |
476 | 476 | if (isset($globalArchive) && $globalArchive === TRUE) { |
477 | - $query = 'SELECT spotter_live.ident, spotter_live.flightaware_id, spotter_live.aircraft_icao, spotter_live.departure_airport_icao as departure_airport, spotter_live.arrival_airport_icao as arrival_airport, spotter_live.latitude, spotter_live.longitude, spotter_live.altitude, spotter_live.real_altitude, spotter_live.heading, spotter_live.ground_speed, spotter_live.squawk, spotter_live.date, spotter_live.format_source, spotter_live.registration |
|
477 | + $query = 'SELECT spotter_live.ident, spotter_live.flightaware_id, spotter_live.aircraft_icao, spotter_live.departure_airport_icao as departure_airport, spotter_live.arrival_airport_icao as arrival_airport, spotter_live.latitude, spotter_live.longitude, spotter_live.altitude, spotter_live.real_altitude, spotter_live.heading, spotter_live.ground_speed, spotter_live.squawk, spotter_live.date, spotter_live.format_source, spotter_live.registration |
|
478 | 478 | FROM spotter_live |
479 | 479 | '.$filter_query.' DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= spotter_live.date |
480 | 480 | AND spotter_live.latitude BETWEEN '.$minlat.' AND '.$maxlat.' AND spotter_live.longitude BETWEEN '.$minlong.' AND '.$maxlong.' |
481 | 481 | AND spotter_live.latitude <> 0 AND spotter_live.longitude <> 0 ORDER BY date DESC'; |
482 | 482 | } else { |
483 | - $query = 'SELECT spotter_live.ident, spotter_live.flightaware_id, spotter_live.aircraft_icao, spotter_live.departure_airport_icao as departure_airport, spotter_live.arrival_airport_icao as arrival_airport, spotter_live.latitude, spotter_live.longitude, spotter_live.altitude, spotter_live.real_altitude, spotter_live.heading, spotter_live.ground_speed, spotter_live.squawk, spotter_live.date, spotter_live.format_source, spotter_live.registration |
|
483 | + $query = 'SELECT spotter_live.ident, spotter_live.flightaware_id, spotter_live.aircraft_icao, spotter_live.departure_airport_icao as departure_airport, spotter_live.arrival_airport_icao as arrival_airport, spotter_live.latitude, spotter_live.longitude, spotter_live.altitude, spotter_live.real_altitude, spotter_live.heading, spotter_live.ground_speed, spotter_live.squawk, spotter_live.date, spotter_live.format_source, spotter_live.registration |
|
484 | 484 | FROM spotter_live |
485 | 485 | INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate |
486 | 486 | FROM spotter_live l |
@@ -492,14 +492,14 @@ discard block |
||
492 | 492 | } |
493 | 493 | } else { |
494 | 494 | if (isset($globalArchive) && $globalArchive === TRUE) { |
495 | - $query = "SELECT spotter_live.ident, spotter_live.flightaware_id, spotter_live.aircraft_icao, spotter_live.departure_airport_icao as departure_airport, spotter_live.arrival_airport_icao as arrival_airport, spotter_live.latitude, spotter_live.longitude, spotter_live.altitude, spotter_live.real_altitude, spotter_live.heading, spotter_live.ground_speed, spotter_live.squawk, spotter_live.date, spotter_live.format_source, spotter_live.registration |
|
495 | + $query = "SELECT spotter_live.ident, spotter_live.flightaware_id, spotter_live.aircraft_icao, spotter_live.departure_airport_icao as departure_airport, spotter_live.arrival_airport_icao as arrival_airport, spotter_live.latitude, spotter_live.longitude, spotter_live.altitude, spotter_live.real_altitude, spotter_live.heading, spotter_live.ground_speed, spotter_live.squawk, spotter_live.date, spotter_live.format_source, spotter_live.registration |
|
496 | 496 | FROM spotter_live |
497 | 497 | ".$filter_query." CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$globalLiveInterval." SECONDS' <= spotter_live.date |
498 | 498 | AND spotter_live.latitude BETWEEN ".$minlat." AND ".$maxlat." |
499 | 499 | AND spotter_live.longitude BETWEEN ".$minlong." AND ".$maxlong." |
500 | 500 | AND spotter_live.latitude <> '0' AND spotter_live.longitude <> '0' ORDER BY date DESC"; |
501 | 501 | } else { |
502 | - $query = "SELECT spotter_live.ident, spotter_live.flightaware_id, spotter_live.aircraft_icao, spotter_live.departure_airport_icao as departure_airport, spotter_live.arrival_airport_icao as arrival_airport, spotter_live.latitude, spotter_live.longitude, spotter_live.altitude, spotter_live.real_altitude, spotter_live.heading, spotter_live.ground_speed, spotter_live.squawk, spotter_live.date, spotter_live.format_source, spotter_live.registration |
|
502 | + $query = "SELECT spotter_live.ident, spotter_live.flightaware_id, spotter_live.aircraft_icao, spotter_live.departure_airport_icao as departure_airport, spotter_live.arrival_airport_icao as arrival_airport, spotter_live.latitude, spotter_live.longitude, spotter_live.altitude, spotter_live.real_altitude, spotter_live.heading, spotter_live.ground_speed, spotter_live.squawk, spotter_live.date, spotter_live.format_source, spotter_live.registration |
|
503 | 503 | FROM spotter_live |
504 | 504 | INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate |
505 | 505 | FROM spotter_live l |
@@ -514,7 +514,7 @@ discard block |
||
514 | 514 | try { |
515 | 515 | $sth = $this->db->prepare($query); |
516 | 516 | $sth->execute(); |
517 | - } catch(PDOException $e) { |
|
517 | + } catch (PDOException $e) { |
|
518 | 518 | echo $e->getMessage(); |
519 | 519 | die; |
520 | 520 | } |
@@ -563,7 +563,7 @@ discard block |
||
563 | 563 | if ($interval == '1m') |
564 | 564 | { |
565 | 565 | $additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 MINUTE) <= spotter_live.date '; |
566 | - } else if ($interval == '15m'){ |
|
566 | + } else if ($interval == '15m') { |
|
567 | 567 | $additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 15 MINUTE) <= spotter_live.date '; |
568 | 568 | } |
569 | 569 | } |
@@ -571,14 +571,14 @@ discard block |
||
571 | 571 | $additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 MINUTE) <= spotter_live.date '; |
572 | 572 | } |
573 | 573 | |
574 | - $query = "SELECT spotter_live.*, ( 6371 * acos( cos( radians(:lat) ) * cos( radians( latitude ) ) * cos( radians( longitude ) - radians(:lng) ) + sin( radians(:lat) ) * sin( radians( latitude ) ) ) ) AS distance FROM spotter_live |
|
574 | + $query = "SELECT spotter_live.*, ( 6371 * acos( cos( radians(:lat) ) * cos( radians( latitude ) ) * cos( radians( longitude ) - radians(:lng) ) + sin( radians(:lat) ) * sin( radians( latitude ) ) ) ) AS distance FROM spotter_live |
|
575 | 575 | WHERE spotter_live.latitude <> '' |
576 | 576 | AND spotter_live.longitude <> '' |
577 | 577 | ".$additional_query." |
578 | 578 | HAVING distance < :radius |
579 | 579 | ORDER BY distance"; |
580 | 580 | |
581 | - $spotter_array = $Spotter->getDataFromDB($query, array(':lat' => $lat, ':lng' => $lng,':radius' => $radius)); |
|
581 | + $spotter_array = $Spotter->getDataFromDB($query, array(':lat' => $lat, ':lng' => $lng, ':radius' => $radius)); |
|
582 | 582 | |
583 | 583 | return $spotter_array; |
584 | 584 | } |
@@ -596,9 +596,9 @@ discard block |
||
596 | 596 | date_default_timezone_set('UTC'); |
597 | 597 | |
598 | 598 | $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
599 | - $query = 'SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE l.ident = :ident GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate ORDER BY spotter_live.date DESC'; |
|
599 | + $query = 'SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE l.ident = :ident GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate ORDER BY spotter_live.date DESC'; |
|
600 | 600 | |
601 | - $spotter_array = $Spotter->getDataFromDB($query,array(':ident' => $ident),'',true); |
|
601 | + $spotter_array = $Spotter->getDataFromDB($query, array(':ident' => $ident), '', true); |
|
602 | 602 | |
603 | 603 | return $spotter_array; |
604 | 604 | } |
@@ -609,16 +609,16 @@ discard block |
||
609 | 609 | * @return Array the spotter information |
610 | 610 | * |
611 | 611 | */ |
612 | - public function getDateLiveSpotterDataByIdent($ident,$date) |
|
612 | + public function getDateLiveSpotterDataByIdent($ident, $date) |
|
613 | 613 | { |
614 | 614 | $Spotter = new Spotter($this->db); |
615 | 615 | date_default_timezone_set('UTC'); |
616 | 616 | |
617 | 617 | $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
618 | - $query = 'SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE l.ident = :ident AND l.date <= :date GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate ORDER BY spotter_live.date DESC'; |
|
618 | + $query = 'SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE l.ident = :ident AND l.date <= :date GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate ORDER BY spotter_live.date DESC'; |
|
619 | 619 | |
620 | - $date = date('c',$date); |
|
621 | - $spotter_array = $Spotter->getDataFromDB($query,array(':ident' => $ident,':date' => $date)); |
|
620 | + $date = date('c', $date); |
|
621 | + $spotter_array = $Spotter->getDataFromDB($query, array(':ident' => $ident, ':date' => $date)); |
|
622 | 622 | |
623 | 623 | return $spotter_array; |
624 | 624 | } |
@@ -634,8 +634,8 @@ discard block |
||
634 | 634 | $Spotter = new Spotter($this->db); |
635 | 635 | date_default_timezone_set('UTC'); |
636 | 636 | $id = filter_var($id, FILTER_SANITIZE_STRING); |
637 | - $query = 'SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE l.flightaware_id = :id GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate ORDER BY spotter_live.date DESC'; |
|
638 | - $spotter_array = $Spotter->getDataFromDB($query,array(':id' => $id),'',true); |
|
637 | + $query = 'SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE l.flightaware_id = :id GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate ORDER BY spotter_live.date DESC'; |
|
638 | + $spotter_array = $Spotter->getDataFromDB($query, array(':id' => $id), '', true); |
|
639 | 639 | return $spotter_array; |
640 | 640 | } |
641 | 641 | |
@@ -645,15 +645,15 @@ discard block |
||
645 | 645 | * @return Array the spotter information |
646 | 646 | * |
647 | 647 | */ |
648 | - public function getDateLiveSpotterDataById($id,$date) |
|
648 | + public function getDateLiveSpotterDataById($id, $date) |
|
649 | 649 | { |
650 | 650 | $Spotter = new Spotter($this->db); |
651 | 651 | date_default_timezone_set('UTC'); |
652 | 652 | |
653 | 653 | $id = filter_var($id, FILTER_SANITIZE_STRING); |
654 | - $query = 'SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE l.flightaware_id = :id AND l.date <= :date GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate ORDER BY spotter_live.date DESC'; |
|
655 | - $date = date('c',$date); |
|
656 | - $spotter_array = $Spotter->getDataFromDB($query,array(':id' => $id,':date' => $date),'',true); |
|
654 | + $query = 'SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE l.flightaware_id = :id AND l.date <= :date GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate ORDER BY spotter_live.date DESC'; |
|
655 | + $date = date('c', $date); |
|
656 | + $spotter_array = $Spotter->getDataFromDB($query, array(':id' => $id, ':date' => $date), '', true); |
|
657 | 657 | return $spotter_array; |
658 | 658 | } |
659 | 659 | |
@@ -669,13 +669,13 @@ discard block |
||
669 | 669 | date_default_timezone_set('UTC'); |
670 | 670 | |
671 | 671 | $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
672 | - $query = 'SELECT spotter_live.altitude, spotter_live.date FROM spotter_live WHERE spotter_live.ident = :ident'; |
|
672 | + $query = 'SELECT spotter_live.altitude, spotter_live.date FROM spotter_live WHERE spotter_live.ident = :ident'; |
|
673 | 673 | |
674 | 674 | try { |
675 | 675 | |
676 | 676 | $sth = $this->db->prepare($query); |
677 | 677 | $sth->execute(array(':ident' => $ident)); |
678 | - } catch(PDOException $e) { |
|
678 | + } catch (PDOException $e) { |
|
679 | 679 | echo $e->getMessage(); |
680 | 680 | die; |
681 | 681 | } |
@@ -690,7 +690,7 @@ discard block |
||
690 | 690 | * @return Array the spotter information |
691 | 691 | * |
692 | 692 | */ |
693 | - public function getAllLiveSpotterDataById($id,$liveinterval = false) |
|
693 | + public function getAllLiveSpotterDataById($id, $liveinterval = false) |
|
694 | 694 | { |
695 | 695 | global $globalDBdriver, $globalLiveInterval; |
696 | 696 | date_default_timezone_set('UTC'); |
@@ -709,7 +709,7 @@ discard block |
||
709 | 709 | try { |
710 | 710 | $sth = $this->db->prepare($query); |
711 | 711 | $sth->execute(array(':id' => $id)); |
712 | - } catch(PDOException $e) { |
|
712 | + } catch (PDOException $e) { |
|
713 | 713 | echo $e->getMessage(); |
714 | 714 | die; |
715 | 715 | } |
@@ -727,12 +727,12 @@ discard block |
||
727 | 727 | { |
728 | 728 | date_default_timezone_set('UTC'); |
729 | 729 | $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
730 | - $query = self::$global_query.' WHERE spotter_live.ident = :ident'; |
|
730 | + $query = self::$global_query.' WHERE spotter_live.ident = :ident'; |
|
731 | 731 | try { |
732 | 732 | |
733 | 733 | $sth = $this->db->prepare($query); |
734 | 734 | $sth->execute(array(':ident' => $ident)); |
735 | - } catch(PDOException $e) { |
|
735 | + } catch (PDOException $e) { |
|
736 | 736 | echo $e->getMessage(); |
737 | 737 | die; |
738 | 738 | } |
@@ -762,7 +762,7 @@ discard block |
||
762 | 762 | |
763 | 763 | $sth = $this->db->prepare($query); |
764 | 764 | $sth->execute(); |
765 | - } catch(PDOException $e) { |
|
765 | + } catch (PDOException $e) { |
|
766 | 766 | return "error"; |
767 | 767 | } |
768 | 768 | |
@@ -785,14 +785,14 @@ discard block |
||
785 | 785 | |
786 | 786 | $sth = $this->db->prepare($query); |
787 | 787 | $sth->execute(); |
788 | - } catch(PDOException $e) { |
|
788 | + } catch (PDOException $e) { |
|
789 | 789 | return "error"; |
790 | 790 | } |
791 | 791 | $query_delete = 'DELETE FROM spotter_live WHERE flightaware_id IN ('; |
792 | 792 | $i = 0; |
793 | - $j =0; |
|
793 | + $j = 0; |
|
794 | 794 | $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
795 | - foreach($all as $row) |
|
795 | + foreach ($all as $row) |
|
796 | 796 | { |
797 | 797 | $i++; |
798 | 798 | $j++; |
@@ -800,9 +800,9 @@ discard block |
||
800 | 800 | if ($globalDebug) echo "."; |
801 | 801 | try { |
802 | 802 | |
803 | - $sth = $this->db->prepare(substr($query_delete,0,-1).")"); |
|
803 | + $sth = $this->db->prepare(substr($query_delete, 0, -1).")"); |
|
804 | 804 | $sth->execute(); |
805 | - } catch(PDOException $e) { |
|
805 | + } catch (PDOException $e) { |
|
806 | 806 | return "error"; |
807 | 807 | } |
808 | 808 | $query_delete = 'DELETE FROM spotter_live WHERE flightaware_id IN ('; |
@@ -813,9 +813,9 @@ discard block |
||
813 | 813 | if ($i > 0) { |
814 | 814 | try { |
815 | 815 | |
816 | - $sth = $this->db->prepare(substr($query_delete,0,-1).")"); |
|
816 | + $sth = $this->db->prepare(substr($query_delete, 0, -1).")"); |
|
817 | 817 | $sth->execute(); |
818 | - } catch(PDOException $e) { |
|
818 | + } catch (PDOException $e) { |
|
819 | 819 | return "error"; |
820 | 820 | } |
821 | 821 | } |
@@ -828,7 +828,7 @@ discard block |
||
828 | 828 | |
829 | 829 | $sth = $this->db->prepare($query); |
830 | 830 | $sth->execute(); |
831 | - } catch(PDOException $e) { |
|
831 | + } catch (PDOException $e) { |
|
832 | 832 | return "error"; |
833 | 833 | } |
834 | 834 | /* $query_delete = "DELETE FROM spotter_live WHERE flightaware_id IN ("; |
@@ -876,13 +876,13 @@ discard block |
||
876 | 876 | public function deleteLiveSpotterDataByIdent($ident) |
877 | 877 | { |
878 | 878 | $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
879 | - $query = 'DELETE FROM spotter_live WHERE ident = :ident'; |
|
879 | + $query = 'DELETE FROM spotter_live WHERE ident = :ident'; |
|
880 | 880 | |
881 | 881 | try { |
882 | 882 | |
883 | 883 | $sth = $this->db->prepare($query); |
884 | 884 | $sth->execute(array(':ident' => $ident)); |
885 | - } catch(PDOException $e) { |
|
885 | + } catch (PDOException $e) { |
|
886 | 886 | return "error"; |
887 | 887 | } |
888 | 888 | |
@@ -898,13 +898,13 @@ discard block |
||
898 | 898 | public function deleteLiveSpotterDataById($id) |
899 | 899 | { |
900 | 900 | $id = filter_var($id, FILTER_SANITIZE_STRING); |
901 | - $query = 'DELETE FROM spotter_live WHERE flightaware_id = :id'; |
|
901 | + $query = 'DELETE FROM spotter_live WHERE flightaware_id = :id'; |
|
902 | 902 | |
903 | 903 | try { |
904 | 904 | |
905 | 905 | $sth = $this->db->prepare($query); |
906 | 906 | $sth->execute(array(':id' => $id)); |
907 | - } catch(PDOException $e) { |
|
907 | + } catch (PDOException $e) { |
|
908 | 908 | return "error"; |
909 | 909 | } |
910 | 910 | |
@@ -922,13 +922,13 @@ discard block |
||
922 | 922 | { |
923 | 923 | global $globalDBdriver, $globalTimezone; |
924 | 924 | if ($globalDBdriver == 'mysql') { |
925 | - $query = 'SELECT spotter_live.ident FROM spotter_live |
|
925 | + $query = 'SELECT spotter_live.ident FROM spotter_live |
|
926 | 926 | WHERE spotter_live.ident = :ident |
927 | 927 | AND spotter_live.date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 HOUR) |
928 | 928 | AND spotter_live.date < UTC_TIMESTAMP()'; |
929 | 929 | $query_data = array(':ident' => $ident); |
930 | 930 | } else { |
931 | - $query = "SELECT spotter_live.ident FROM spotter_live |
|
931 | + $query = "SELECT spotter_live.ident FROM spotter_live |
|
932 | 932 | WHERE spotter_live.ident = :ident |
933 | 933 | AND spotter_live.date >= now() AT TIME ZONE 'UTC' - INTERVAL '1 HOURS' |
934 | 934 | AND spotter_live.date < now() AT TIME ZONE 'UTC'"; |
@@ -937,8 +937,8 @@ discard block |
||
937 | 937 | |
938 | 938 | $sth = $this->db->prepare($query); |
939 | 939 | $sth->execute($query_data); |
940 | - $ident_result=''; |
|
941 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
940 | + $ident_result = ''; |
|
941 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
942 | 942 | { |
943 | 943 | $ident_result = $row['ident']; |
944 | 944 | } |
@@ -955,13 +955,13 @@ discard block |
||
955 | 955 | { |
956 | 956 | global $globalDBdriver, $globalTimezone; |
957 | 957 | if ($globalDBdriver == 'mysql') { |
958 | - $query = 'SELECT spotter_live.ident, spotter_live.flightaware_id FROM spotter_live |
|
958 | + $query = 'SELECT spotter_live.ident, spotter_live.flightaware_id FROM spotter_live |
|
959 | 959 | WHERE spotter_live.ident = :ident |
960 | 960 | AND spotter_live.date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 20 MINUTE)'; |
961 | 961 | // AND spotter_live.date < UTC_TIMESTAMP()"; |
962 | 962 | $query_data = array(':ident' => $ident); |
963 | 963 | } else { |
964 | - $query = "SELECT spotter_live.ident, spotter_live.flightaware_id FROM spotter_live |
|
964 | + $query = "SELECT spotter_live.ident, spotter_live.flightaware_id FROM spotter_live |
|
965 | 965 | WHERE spotter_live.ident = :ident |
966 | 966 | AND spotter_live.date >= now() AT TIME ZONE 'UTC' - INTERVAL '20 MINUTES'"; |
967 | 967 | // AND spotter_live.date < now() AT TIME ZONE 'UTC'"; |
@@ -970,8 +970,8 @@ discard block |
||
970 | 970 | |
971 | 971 | $sth = $this->db->prepare($query); |
972 | 972 | $sth->execute($query_data); |
973 | - $ident_result=''; |
|
974 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
973 | + $ident_result = ''; |
|
974 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
975 | 975 | { |
976 | 976 | $ident_result = $row['flightaware_id']; |
977 | 977 | } |
@@ -988,13 +988,13 @@ discard block |
||
988 | 988 | { |
989 | 989 | global $globalDBdriver, $globalTimezone; |
990 | 990 | if ($globalDBdriver == 'mysql') { |
991 | - $query = 'SELECT spotter_live.ident, spotter_live.flightaware_id FROM spotter_live |
|
991 | + $query = 'SELECT spotter_live.ident, spotter_live.flightaware_id FROM spotter_live |
|
992 | 992 | WHERE spotter_live.flightaware_id = :id |
993 | 993 | AND spotter_live.date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 10 HOUR)'; |
994 | 994 | // AND spotter_live.date < UTC_TIMESTAMP()"; |
995 | 995 | $query_data = array(':id' => $id); |
996 | 996 | } else { |
997 | - $query = "SELECT spotter_live.ident, spotter_live.flightaware_id FROM spotter_live |
|
997 | + $query = "SELECT spotter_live.ident, spotter_live.flightaware_id FROM spotter_live |
|
998 | 998 | WHERE spotter_live.flightaware_id = :id |
999 | 999 | AND spotter_live.date >= now() AT TIME ZONE 'UTC' - INTERVAL '10 HOUR'"; |
1000 | 1000 | // AND spotter_live.date < now() AT TIME ZONE 'UTC'"; |
@@ -1003,8 +1003,8 @@ discard block |
||
1003 | 1003 | |
1004 | 1004 | $sth = $this->db->prepare($query); |
1005 | 1005 | $sth->execute($query_data); |
1006 | - $ident_result=''; |
|
1007 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
1006 | + $ident_result = ''; |
|
1007 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
1008 | 1008 | { |
1009 | 1009 | $ident_result = $row['flightaware_id']; |
1010 | 1010 | } |
@@ -1021,13 +1021,13 @@ discard block |
||
1021 | 1021 | { |
1022 | 1022 | global $globalDBdriver, $globalTimezone; |
1023 | 1023 | if ($globalDBdriver == 'mysql') { |
1024 | - $query = 'SELECT spotter_live.ModeS, spotter_live.flightaware_id FROM spotter_live |
|
1024 | + $query = 'SELECT spotter_live.ModeS, spotter_live.flightaware_id FROM spotter_live |
|
1025 | 1025 | WHERE spotter_live.ModeS = :modes |
1026 | 1026 | AND spotter_live.date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 20 MINUTE)'; |
1027 | 1027 | // AND spotter_live.date < UTC_TIMESTAMP()"; |
1028 | 1028 | $query_data = array(':modes' => $modes); |
1029 | 1029 | } else { |
1030 | - $query = "SELECT spotter_live.ModeS, spotter_live.flightaware_id FROM spotter_live |
|
1030 | + $query = "SELECT spotter_live.ModeS, spotter_live.flightaware_id FROM spotter_live |
|
1031 | 1031 | WHERE spotter_live.ModeS = :modes |
1032 | 1032 | AND spotter_live.date >= CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '20 MINUTE'"; |
1033 | 1033 | // // AND spotter_live.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC'"; |
@@ -1036,8 +1036,8 @@ discard block |
||
1036 | 1036 | |
1037 | 1037 | $sth = $this->db->prepare($query); |
1038 | 1038 | $sth->execute($query_data); |
1039 | - $ident_result=''; |
|
1040 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
1039 | + $ident_result = ''; |
|
1040 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
1041 | 1041 | { |
1042 | 1042 | //$ident_result = $row['spotter_live_id']; |
1043 | 1043 | $ident_result = $row['flightaware_id']; |
@@ -1062,8 +1062,8 @@ discard block |
||
1062 | 1062 | return array(); |
1063 | 1063 | } else { |
1064 | 1064 | $q_array = explode(" ", $q); |
1065 | - foreach ($q_array as $q_item){ |
|
1066 | - $q_item = filter_var($q_item,FILTER_SANITIZE_STRING); |
|
1065 | + foreach ($q_array as $q_item) { |
|
1066 | + $q_item = filter_var($q_item, FILTER_SANITIZE_STRING); |
|
1067 | 1067 | $additional_query .= " AND ("; |
1068 | 1068 | $additional_query .= "(spotter_live.aircraft_icao like '%".$q_item."%') OR "; |
1069 | 1069 | $additional_query .= "(spotter_live.aircraft_name like '%".$q_item."%') OR "; |
@@ -1078,11 +1078,11 @@ discard block |
||
1078 | 1078 | } |
1079 | 1079 | } |
1080 | 1080 | if ($globalDBdriver == 'mysql') { |
1081 | - $query = "SELECT spotter_live.* FROM spotter_live |
|
1081 | + $query = "SELECT spotter_live.* FROM spotter_live |
|
1082 | 1082 | WHERE spotter_live.date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 20 SECOND) ".$additional_query." |
1083 | 1083 | AND spotter_live.date < UTC_TIMESTAMP()"; |
1084 | 1084 | } else { |
1085 | - $query = "SELECT spotter_live.* FROM spotter_live |
|
1085 | + $query = "SELECT spotter_live.* FROM spotter_live |
|
1086 | 1086 | WHERE spotter_live.date::timestamp >= CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '20 SECONDS' ".$additional_query." |
1087 | 1087 | AND spotter_live.date::timestamp < CURRENT_TIMESTAMP AT TIME ZONE 'UTC'"; |
1088 | 1088 | } |
@@ -1102,7 +1102,7 @@ discard block |
||
1102 | 1102 | * @return String success or false |
1103 | 1103 | * |
1104 | 1104 | */ |
1105 | - public function addLiveSpotterData($flightaware_id = '', $ident = '', $aircraft_icao = '', $departure_airport_icao = '', $arrival_airport_icao = '', $latitude = '', $longitude = '', $waypoints = '', $altitude = '', $altitude_real = '',$heading = '', $groundspeed = '', $date = '',$departure_airport_time = '', $arrival_airport_time = '', $squawk = '', $route_stop = '', $ModeS = '', $putinarchive = false,$registration = '',$pilot_id = '', $pilot_name = '', $verticalrate = '', $noarchive = false, $ground = false,$format_source = '', $source_name = '', $over_country = '') |
|
1105 | + public function addLiveSpotterData($flightaware_id = '', $ident = '', $aircraft_icao = '', $departure_airport_icao = '', $arrival_airport_icao = '', $latitude = '', $longitude = '', $waypoints = '', $altitude = '', $altitude_real = '', $heading = '', $groundspeed = '', $date = '', $departure_airport_time = '', $arrival_airport_time = '', $squawk = '', $route_stop = '', $ModeS = '', $putinarchive = false, $registration = '', $pilot_id = '', $pilot_name = '', $verticalrate = '', $noarchive = false, $ground = false, $format_source = '', $source_name = '', $over_country = '') |
|
1106 | 1106 | { |
1107 | 1107 | global $globalURL, $globalArchive, $globalDebug; |
1108 | 1108 | $Common = new Common(); |
@@ -1202,27 +1202,27 @@ discard block |
||
1202 | 1202 | if ($date == '') $date = date("Y-m-d H:i:s", time()); |
1203 | 1203 | |
1204 | 1204 | |
1205 | - $flightaware_id = filter_var($flightaware_id,FILTER_SANITIZE_STRING); |
|
1206 | - $ident = filter_var($ident,FILTER_SANITIZE_STRING); |
|
1207 | - $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
|
1208 | - $departure_airport_icao = filter_var($departure_airport_icao,FILTER_SANITIZE_STRING); |
|
1209 | - $arrival_airport_icao = filter_var($arrival_airport_icao,FILTER_SANITIZE_STRING); |
|
1210 | - $latitude = filter_var($latitude,FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
1211 | - $longitude = filter_var($longitude,FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
1212 | - $waypoints = filter_var($waypoints,FILTER_SANITIZE_STRING); |
|
1213 | - $altitude = filter_var($altitude,FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
1214 | - $altitude_real = filter_var($altitude_real,FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
1215 | - $heading = filter_var($heading,FILTER_SANITIZE_NUMBER_INT); |
|
1216 | - $groundspeed = filter_var($groundspeed,FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
1217 | - $squawk = filter_var($squawk,FILTER_SANITIZE_NUMBER_INT); |
|
1218 | - $route_stop = filter_var($route_stop,FILTER_SANITIZE_STRING); |
|
1219 | - $ModeS = filter_var($ModeS,FILTER_SANITIZE_STRING); |
|
1220 | - $pilot_id = filter_var($pilot_id,FILTER_SANITIZE_STRING); |
|
1221 | - $pilot_name = filter_var($pilot_name,FILTER_SANITIZE_STRING); |
|
1222 | - $format_source = filter_var($format_source,FILTER_SANITIZE_STRING); |
|
1223 | - $source_name = filter_var($source_name,FILTER_SANITIZE_STRING); |
|
1224 | - $over_country = filter_var($over_country,FILTER_SANITIZE_STRING); |
|
1225 | - $verticalrate = filter_var($verticalrate,FILTER_SANITIZE_NUMBER_INT); |
|
1205 | + $flightaware_id = filter_var($flightaware_id, FILTER_SANITIZE_STRING); |
|
1206 | + $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
|
1207 | + $aircraft_icao = filter_var($aircraft_icao, FILTER_SANITIZE_STRING); |
|
1208 | + $departure_airport_icao = filter_var($departure_airport_icao, FILTER_SANITIZE_STRING); |
|
1209 | + $arrival_airport_icao = filter_var($arrival_airport_icao, FILTER_SANITIZE_STRING); |
|
1210 | + $latitude = filter_var($latitude, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
1211 | + $longitude = filter_var($longitude, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
1212 | + $waypoints = filter_var($waypoints, FILTER_SANITIZE_STRING); |
|
1213 | + $altitude = filter_var($altitude, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
1214 | + $altitude_real = filter_var($altitude_real, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
1215 | + $heading = filter_var($heading, FILTER_SANITIZE_NUMBER_INT); |
|
1216 | + $groundspeed = filter_var($groundspeed, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
1217 | + $squawk = filter_var($squawk, FILTER_SANITIZE_NUMBER_INT); |
|
1218 | + $route_stop = filter_var($route_stop, FILTER_SANITIZE_STRING); |
|
1219 | + $ModeS = filter_var($ModeS, FILTER_SANITIZE_STRING); |
|
1220 | + $pilot_id = filter_var($pilot_id, FILTER_SANITIZE_STRING); |
|
1221 | + $pilot_name = filter_var($pilot_name, FILTER_SANITIZE_STRING); |
|
1222 | + $format_source = filter_var($format_source, FILTER_SANITIZE_STRING); |
|
1223 | + $source_name = filter_var($source_name, FILTER_SANITIZE_STRING); |
|
1224 | + $over_country = filter_var($over_country, FILTER_SANITIZE_STRING); |
|
1225 | + $verticalrate = filter_var($verticalrate, FILTER_SANITIZE_NUMBER_INT); |
|
1226 | 1226 | |
1227 | 1227 | $airline_name = ''; |
1228 | 1228 | $airline_icao = ''; |
@@ -1244,10 +1244,10 @@ discard block |
||
1244 | 1244 | $arrival_airport_country = ''; |
1245 | 1245 | |
1246 | 1246 | |
1247 | - if ($squawk == '' || $Common->isInteger($squawk) === false ) $squawk = NULL; |
|
1248 | - if ($verticalrate == '' || $Common->isInteger($verticalrate) === false ) $verticalrate = NULL; |
|
1249 | - if ($groundspeed == '' || $Common->isInteger($groundspeed) === false ) $groundspeed = 0; |
|
1250 | - if ($heading == '' || $Common->isInteger($heading) === false ) $heading = 0; |
|
1247 | + if ($squawk == '' || $Common->isInteger($squawk) === false) $squawk = NULL; |
|
1248 | + if ($verticalrate == '' || $Common->isInteger($verticalrate) === false) $verticalrate = NULL; |
|
1249 | + if ($groundspeed == '' || $Common->isInteger($groundspeed) === false) $groundspeed = 0; |
|
1250 | + if ($heading == '' || $Common->isInteger($heading) === false) $heading = 0; |
|
1251 | 1251 | |
1252 | 1252 | $query = ''; |
1253 | 1253 | if ($globalArchive) { |
@@ -1258,19 +1258,19 @@ discard block |
||
1258 | 1258 | $query .= 'INSERT INTO spotter_live (flightaware_id, ident, registration, airline_name, airline_icao, airline_country, airline_type, aircraft_icao, aircraft_shadow, aircraft_name, aircraft_manufacturer, departure_airport_icao, departure_airport_name, departure_airport_city, departure_airport_country, arrival_airport_icao, arrival_airport_name, arrival_airport_city, arrival_airport_country, latitude, longitude, waypoints, altitude, heading, ground_speed, date, departure_airport_time, arrival_airport_time, squawk, route_stop, ModeS, pilot_id, pilot_name, verticalrate, ground, format_source, source_name, over_country, real_altitude) |
1259 | 1259 | VALUES (:flightaware_id,:ident,:registration,:airline_name,:airline_icao,:airline_country,:airline_type,:aircraft_icao,:aircraft_shadow,:aircraft_type,:aircraft_manufacturer,:departure_airport_icao,:departure_airport_name, :departure_airport_city, :departure_airport_country, :arrival_airport_icao, :arrival_airport_name, :arrival_airport_city, :arrival_airport_country, :latitude,:longitude,:waypoints,:altitude,:heading,:groundspeed,:date,:departure_airport_time,:arrival_airport_time,:squawk,:route_stop,:ModeS, :pilot_id, :pilot_name, :verticalrate, :ground, :format_source, :source_name, :over_country, :real_altitude)'; |
1260 | 1260 | |
1261 | - $query_values = array(':flightaware_id' => $flightaware_id,':ident' => $ident, ':registration' => $registration,':airline_name' => $airline_name,':airline_icao' => $airline_icao,':airline_country' => $airline_country,':airline_type' => $airline_type,':aircraft_icao' => $aircraft_icao,':aircraft_shadow' => $aircraft_shadow,':aircraft_type' => $aircraft_type,':aircraft_manufacturer' => $aircraft_manufacturer,':departure_airport_icao' => $departure_airport_icao,':departure_airport_name' => $departure_airport_name,':departure_airport_city' => $departure_airport_city,':departure_airport_country' => $departure_airport_country,':arrival_airport_icao' => $arrival_airport_icao,':arrival_airport_name' => $arrival_airport_name,':arrival_airport_city' => $arrival_airport_city,':arrival_airport_country' => $arrival_airport_country,':latitude' => $latitude,':longitude' => $longitude, ':waypoints' => $waypoints,':altitude' => $altitude,':heading' => $heading,':groundspeed' => $groundspeed,':date' => $date, ':departure_airport_time' => $departure_airport_time,':arrival_airport_time' => $arrival_airport_time, ':squawk' => $squawk,':route_stop' => $route_stop,':ModeS' => $ModeS, ':pilot_id' => $pilot_id, ':pilot_name' => $pilot_name, ':verticalrate' => $verticalrate, ':format_source' => $format_source,':ground' => $ground, ':source_name' => $source_name, ':over_country' => $over_country,':real_altitude' => $altitude_real); |
|
1261 | + $query_values = array(':flightaware_id' => $flightaware_id, ':ident' => $ident, ':registration' => $registration, ':airline_name' => $airline_name, ':airline_icao' => $airline_icao, ':airline_country' => $airline_country, ':airline_type' => $airline_type, ':aircraft_icao' => $aircraft_icao, ':aircraft_shadow' => $aircraft_shadow, ':aircraft_type' => $aircraft_type, ':aircraft_manufacturer' => $aircraft_manufacturer, ':departure_airport_icao' => $departure_airport_icao, ':departure_airport_name' => $departure_airport_name, ':departure_airport_city' => $departure_airport_city, ':departure_airport_country' => $departure_airport_country, ':arrival_airport_icao' => $arrival_airport_icao, ':arrival_airport_name' => $arrival_airport_name, ':arrival_airport_city' => $arrival_airport_city, ':arrival_airport_country' => $arrival_airport_country, ':latitude' => $latitude, ':longitude' => $longitude, ':waypoints' => $waypoints, ':altitude' => $altitude, ':heading' => $heading, ':groundspeed' => $groundspeed, ':date' => $date, ':departure_airport_time' => $departure_airport_time, ':arrival_airport_time' => $arrival_airport_time, ':squawk' => $squawk, ':route_stop' => $route_stop, ':ModeS' => $ModeS, ':pilot_id' => $pilot_id, ':pilot_name' => $pilot_name, ':verticalrate' => $verticalrate, ':format_source' => $format_source, ':ground' => $ground, ':source_name' => $source_name, ':over_country' => $over_country, ':real_altitude' => $altitude_real); |
|
1262 | 1262 | try { |
1263 | 1263 | |
1264 | 1264 | $sth = $this->db->prepare($query); |
1265 | 1265 | $sth->execute($query_values); |
1266 | 1266 | $sth->closeCursor(); |
1267 | - } catch(PDOException $e) { |
|
1267 | + } catch (PDOException $e) { |
|
1268 | 1268 | return "error : ".$e->getMessage(); |
1269 | 1269 | } |
1270 | 1270 | if (isset($globalArchive) && $globalArchive && $putinarchive && $noarchive !== true) { |
1271 | 1271 | if ($globalDebug) echo '(Add to SBS archive : '; |
1272 | 1272 | $SpotterArchive = new SpotterArchive($this->db); |
1273 | - $result = $SpotterArchive->addSpotterArchiveData($flightaware_id, $ident, $registration, $airline_name, $airline_icao, $airline_country, $airline_type, $aircraft_icao, $aircraft_shadow, $aircraft_name, $aircraft_manufacturer, $departure_airport_icao, $departure_airport_name, $departure_airport_city, $departure_airport_country, $departure_airport_time,$arrival_airport_icao, $arrival_airport_name, $arrival_airport_city, $arrival_airport_country, $arrival_airport_time, $route_stop, $date,$latitude, $longitude, $waypoints, $altitude, $altitude_real,$heading, $groundspeed, $squawk, $ModeS, $pilot_id, $pilot_name,$verticalrate,$format_source,$source_name, $over_country); |
|
1273 | + $result = $SpotterArchive->addSpotterArchiveData($flightaware_id, $ident, $registration, $airline_name, $airline_icao, $airline_country, $airline_type, $aircraft_icao, $aircraft_shadow, $aircraft_name, $aircraft_manufacturer, $departure_airport_icao, $departure_airport_name, $departure_airport_city, $departure_airport_country, $departure_airport_time, $arrival_airport_icao, $arrival_airport_name, $arrival_airport_city, $arrival_airport_country, $arrival_airport_time, $route_stop, $date, $latitude, $longitude, $waypoints, $altitude, $altitude_real, $heading, $groundspeed, $squawk, $ModeS, $pilot_id, $pilot_name, $verticalrate, $format_source, $source_name, $over_country); |
|
1274 | 1274 | if ($globalDebug) echo $result.')'; |
1275 | 1275 | } elseif ($globalDebug && $putinarchive !== true) { |
1276 | 1276 | echo '(Not adding to archive)'; |
@@ -1283,7 +1283,7 @@ discard block |
||
1283 | 1283 | |
1284 | 1284 | public function getOrderBy() |
1285 | 1285 | { |
1286 | - $orderby = array("aircraft_asc" => array("key" => "aircraft_asc", "value" => "Aircraft Type - ASC", "sql" => "ORDER BY spotter_live.aircraft_icao ASC"), "aircraft_desc" => array("key" => "aircraft_desc", "value" => "Aircraft Type - DESC", "sql" => "ORDER BY spotter_live.aircraft_icao DESC"),"manufacturer_asc" => array("key" => "manufacturer_asc", "value" => "Aircraft Manufacturer - ASC", "sql" => "ORDER BY spotter_live.aircraft_manufacturer ASC"), "manufacturer_desc" => array("key" => "manufacturer_desc", "value" => "Aircraft Manufacturer - DESC", "sql" => "ORDER BY spotter_live.aircraft_manufacturer DESC"),"airline_name_asc" => array("key" => "airline_name_asc", "value" => "Airline Name - ASC", "sql" => "ORDER BY spotter_live.airline_name ASC"), "airline_name_desc" => array("key" => "airline_name_desc", "value" => "Airline Name - DESC", "sql" => "ORDER BY spotter_live.airline_name DESC"), "ident_asc" => array("key" => "ident_asc", "value" => "Ident - ASC", "sql" => "ORDER BY spotter_live.ident ASC"), "ident_desc" => array("key" => "ident_desc", "value" => "Ident - DESC", "sql" => "ORDER BY spotter_live.ident DESC"), "airport_departure_asc" => array("key" => "airport_departure_asc", "value" => "Departure Airport - ASC", "sql" => "ORDER BY spotter_live.departure_airport_city ASC"), "airport_departure_desc" => array("key" => "airport_departure_desc", "value" => "Departure Airport - DESC", "sql" => "ORDER BY spotter_live.departure_airport_city DESC"), "airport_arrival_asc" => array("key" => "airport_arrival_asc", "value" => "Arrival Airport - ASC", "sql" => "ORDER BY spotter_live.arrival_airport_city ASC"), "airport_arrival_desc" => array("key" => "airport_arrival_desc", "value" => "Arrival Airport - DESC", "sql" => "ORDER BY spotter_live.arrival_airport_city DESC"), "date_asc" => array("key" => "date_asc", "value" => "Date - ASC", "sql" => "ORDER BY spotter_live.date ASC"), "date_desc" => array("key" => "date_desc", "value" => "Date - DESC", "sql" => "ORDER BY spotter_live.date DESC")); |
|
1286 | + $orderby = array("aircraft_asc" => array("key" => "aircraft_asc", "value" => "Aircraft Type - ASC", "sql" => "ORDER BY spotter_live.aircraft_icao ASC"), "aircraft_desc" => array("key" => "aircraft_desc", "value" => "Aircraft Type - DESC", "sql" => "ORDER BY spotter_live.aircraft_icao DESC"), "manufacturer_asc" => array("key" => "manufacturer_asc", "value" => "Aircraft Manufacturer - ASC", "sql" => "ORDER BY spotter_live.aircraft_manufacturer ASC"), "manufacturer_desc" => array("key" => "manufacturer_desc", "value" => "Aircraft Manufacturer - DESC", "sql" => "ORDER BY spotter_live.aircraft_manufacturer DESC"), "airline_name_asc" => array("key" => "airline_name_asc", "value" => "Airline Name - ASC", "sql" => "ORDER BY spotter_live.airline_name ASC"), "airline_name_desc" => array("key" => "airline_name_desc", "value" => "Airline Name - DESC", "sql" => "ORDER BY spotter_live.airline_name DESC"), "ident_asc" => array("key" => "ident_asc", "value" => "Ident - ASC", "sql" => "ORDER BY spotter_live.ident ASC"), "ident_desc" => array("key" => "ident_desc", "value" => "Ident - DESC", "sql" => "ORDER BY spotter_live.ident DESC"), "airport_departure_asc" => array("key" => "airport_departure_asc", "value" => "Departure Airport - ASC", "sql" => "ORDER BY spotter_live.departure_airport_city ASC"), "airport_departure_desc" => array("key" => "airport_departure_desc", "value" => "Departure Airport - DESC", "sql" => "ORDER BY spotter_live.departure_airport_city DESC"), "airport_arrival_asc" => array("key" => "airport_arrival_asc", "value" => "Arrival Airport - ASC", "sql" => "ORDER BY spotter_live.arrival_airport_city ASC"), "airport_arrival_desc" => array("key" => "airport_arrival_desc", "value" => "Arrival Airport - DESC", "sql" => "ORDER BY spotter_live.arrival_airport_city DESC"), "date_asc" => array("key" => "date_asc", "value" => "Date - ASC", "sql" => "ORDER BY spotter_live.date ASC"), "date_desc" => array("key" => "date_desc", "value" => "Date - DESC", "sql" => "ORDER BY spotter_live.date DESC")); |
|
1287 | 1287 | return $orderby; |
1288 | 1288 | } |
1289 | 1289 |
@@ -8,7 +8,9 @@ discard block |
||
8 | 8 | public function __construct($dbc = null) { |
9 | 9 | $Connection = new Connection($dbc); |
10 | 10 | $this->db = $Connection->db(); |
11 | - if ($this->db === null) die('Error: No DB connection. (SpotterLive)'); |
|
11 | + if ($this->db === null) { |
|
12 | + die('Error: No DB connection. (SpotterLive)'); |
|
13 | + } |
|
12 | 14 | } |
13 | 15 | |
14 | 16 | |
@@ -30,7 +32,9 @@ discard block |
||
30 | 32 | if (isset($filter[0]['source'])) { |
31 | 33 | $filters = array_merge($filters,$filter); |
32 | 34 | } |
33 | - if (is_array($globalFilter)) $filter = array_merge($filter,$globalFilter); |
|
35 | + if (is_array($globalFilter)) { |
|
36 | + $filter = array_merge($filter,$globalFilter); |
|
37 | + } |
|
34 | 38 | $filter_query_join = ''; |
35 | 39 | $filter_query_where = ''; |
36 | 40 | foreach($filters as $flt) { |
@@ -126,8 +130,11 @@ discard block |
||
126 | 130 | if (isset($filter['source_aprs']) && !empty($filter['source_aprs'])) { |
127 | 131 | $filter_query_where .= " AND format_source = 'aprs' AND source_name IN ('".implode("','",$filter['source_aprs'])."')"; |
128 | 132 | } |
129 | - if ($filter_query_where == '' && $where) $filter_query_where = ' WHERE'; |
|
130 | - elseif ($filter_query_where != '' && $and) $filter_query_where .= ' AND'; |
|
133 | + if ($filter_query_where == '' && $where) { |
|
134 | + $filter_query_where = ' WHERE'; |
|
135 | + } elseif ($filter_query_where != '' && $and) { |
|
136 | + $filter_query_where .= ' AND'; |
|
137 | + } |
|
131 | 138 | if ($filter_query_where != '') { |
132 | 139 | $filter_query_where = preg_replace('/^ AND/',' WHERE',$filter_query_where); |
133 | 140 | } |
@@ -168,9 +175,13 @@ discard block |
||
168 | 175 | $orderby_query = ' '.$search_orderby_array[$sort]['sql']; |
169 | 176 | } |
170 | 177 | } |
171 | - if ($orderby_query == '') $orderby_query = ' ORDER BY date DESC'; |
|
178 | + if ($orderby_query == '') { |
|
179 | + $orderby_query = ' ORDER BY date DESC'; |
|
180 | + } |
|
172 | 181 | |
173 | - if (!isset($globalLiveInterval)) $globalLiveInterval = '200'; |
|
182 | + if (!isset($globalLiveInterval)) { |
|
183 | + $globalLiveInterval = '200'; |
|
184 | + } |
|
174 | 185 | if ($globalDBdriver == 'mysql') { |
175 | 186 | //$query = "SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL 30 SECOND) <= l.date GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate"; |
176 | 187 | $query = 'SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= l.date GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate'.$filter_query.$orderby_query; |
@@ -193,7 +204,9 @@ discard block |
||
193 | 204 | global $globalDBdriver, $globalLiveInterval, $globalArchive; |
194 | 205 | date_default_timezone_set('UTC'); |
195 | 206 | $filter_query = $this->getFilter($filter,true,true); |
196 | - if (!isset($globalLiveInterval)) $globalLiveInterval = '200'; |
|
207 | + if (!isset($globalLiveInterval)) { |
|
208 | + $globalLiveInterval = '200'; |
|
209 | + } |
|
197 | 210 | if ($globalDBdriver == 'mysql') { |
198 | 211 | if (isset($globalArchive) && $globalArchive === TRUE) { |
199 | 212 | $query = 'SELECT spotter_live.ident, spotter_live.flightaware_id, spotter_live.aircraft_icao, spotter_live.departure_airport_icao as departure_airport, spotter_live.arrival_airport_icao as arrival_airport, spotter_live.latitude, spotter_live.longitude, spotter_live.altitude, spotter_live.real_altitude, spotter_live.heading, spotter_live.ground_speed, spotter_live.squawk, spotter_live.date, spotter_live.format_source, spotter_live.registration |
@@ -244,8 +257,12 @@ discard block |
||
244 | 257 | $id = filter_var($id,FILTER_SANITIZE_STRING); |
245 | 258 | $filter_query = $this->getFilter($filter,true,true); |
246 | 259 | |
247 | - if (!isset($globalLiveInterval) || $globalLiveInterval == '') $globalLiveInterval = '200'; |
|
248 | - if (!isset($globalMap3DAircraftsLimit) || $globalMap3DAircraftsLimit == '') $globalMap3DAircraftsLimit = '300'; |
|
260 | + if (!isset($globalLiveInterval) || $globalLiveInterval == '') { |
|
261 | + $globalLiveInterval = '200'; |
|
262 | + } |
|
263 | + if (!isset($globalMap3DAircraftsLimit) || $globalMap3DAircraftsLimit == '') { |
|
264 | + $globalMap3DAircraftsLimit = '300'; |
|
265 | + } |
|
249 | 266 | if ($globalDBdriver == 'mysql') { |
250 | 267 | if (isset($globalArchive) && $globalArchive === TRUE) { |
251 | 268 | /* |
@@ -256,25 +273,41 @@ discard block |
||
256 | 273 | */ |
257 | 274 | $query = 'SELECT * FROM (SELECT spotter_archive.ident, spotter_archive.flightaware_id, spotter_archive.aircraft_icao, spotter_archive.departure_airport_icao as departure_airport, spotter_archive.arrival_airport_icao as arrival_airport, spotter_archive.latitude, spotter_archive.longitude, spotter_archive.altitude, spotter_archive.heading, spotter_archive.ground_speed, spotter_archive.squawk, spotter_archive.date, spotter_archive.format_source, spotter_archive.registration |
258 | 275 | FROM spotter_archive INNER JOIN (SELECT flightaware_id FROM spotter_live'.$filter_query.' DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval." SECOND) <= spotter_live.date) l ON l.flightaware_id = spotter_archive.flightaware_id "; |
259 | - if ($usecoord) $query .= "AND (spotter_archive.latitude BETWEEN ".$minlat." AND ".$maxlat." AND spotter_archive.longitude BETWEEN ".$minlong." AND ".$maxlong.") "; |
|
260 | - if ($id != '') $query .= "OR spotter_archive.flightaware_id = :id "; |
|
276 | + if ($usecoord) { |
|
277 | + $query .= "AND (spotter_archive.latitude BETWEEN ".$minlat." AND ".$maxlat." AND spotter_archive.longitude BETWEEN ".$minlong." AND ".$maxlong.") "; |
|
278 | + } |
|
279 | + if ($id != '') { |
|
280 | + $query .= "OR spotter_archive.flightaware_id = :id "; |
|
281 | + } |
|
261 | 282 | $query .= "UNION |
262 | 283 | SELECT spotter_live.ident, spotter_live.flightaware_id, spotter_live.aircraft_icao, spotter_live.departure_airport_icao as departure_airport, spotter_live.arrival_airport_icao as arrival_airport, spotter_live.latitude, spotter_live.longitude, spotter_live.altitude, spotter_live.heading, spotter_live.ground_speed, spotter_live.squawk, spotter_live.date, spotter_live.format_source, spotter_live.registration |
263 | 284 | FROM spotter_live".$filter_query.' DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval." SECOND) <= spotter_live.date"; |
264 | - if ($usecoord) $query .= " AND (spotter_live.latitude BETWEEN ".$minlat." AND ".$maxlat." AND spotter_live.longitude BETWEEN ".$minlong." AND ".$maxlong.")"; |
|
265 | - if ($id != '') $query .= " OR spotter_live.flightaware_id = :id"; |
|
285 | + if ($usecoord) { |
|
286 | + $query .= " AND (spotter_live.latitude BETWEEN ".$minlat." AND ".$maxlat." AND spotter_live.longitude BETWEEN ".$minlong." AND ".$maxlong.")"; |
|
287 | + } |
|
288 | + if ($id != '') { |
|
289 | + $query .= " OR spotter_live.flightaware_id = :id"; |
|
290 | + } |
|
266 | 291 | $query .= ") AS spotter |
267 | 292 | WHERE latitude <> '0' AND longitude <> '0' |
268 | 293 | ORDER BY flightaware_id, date"; |
269 | - if ($limit) $query .= " LIMIT ".$globalMap3DAircraftsLimit; |
|
294 | + if ($limit) { |
|
295 | + $query .= " LIMIT ".$globalMap3DAircraftsLimit; |
|
296 | + } |
|
270 | 297 | } else { |
271 | 298 | $query = 'SELECT spotter_live.ident, spotter_live.flightaware_id, spotter_live.aircraft_icao, spotter_live.departure_airport_icao as departure_airport, spotter_live.arrival_airport_icao as arrival_airport, spotter_live.latitude, spotter_live.longitude, spotter_live.altitude, spotter_live.heading, spotter_live.ground_speed, spotter_live.squawk, spotter_live.date, spotter_live.format_source, spotter_live.registration |
272 | 299 | FROM spotter_live'.$filter_query.' DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval." SECOND) <= spotter_live.date "; |
273 | - if ($usecoord) $query .= "AND (spotter_live.latitude BETWEEN ".$minlat." AND ".$maxlat." AND spotter_live.longitude BETWEEN ".$minlong." AND ".$maxlong.") "; |
|
274 | - if ($id != '') $query .= "OR spotter_live.flightaware_id = :id "; |
|
300 | + if ($usecoord) { |
|
301 | + $query .= "AND (spotter_live.latitude BETWEEN ".$minlat." AND ".$maxlat." AND spotter_live.longitude BETWEEN ".$minlong." AND ".$maxlong.") "; |
|
302 | + } |
|
303 | + if ($id != '') { |
|
304 | + $query .= "OR spotter_live.flightaware_id = :id "; |
|
305 | + } |
|
275 | 306 | $query .= "AND spotter_live.latitude <> '0' AND spotter_live.longitude <> '0' |
276 | 307 | ORDER BY spotter_live.flightaware_id, spotter_live.date"; |
277 | - if ($limit) $query .= " LIMIT ".$globalMap3DAircraftsLimit; |
|
308 | + if ($limit) { |
|
309 | + $query .= " LIMIT ".$globalMap3DAircraftsLimit; |
|
310 | + } |
|
278 | 311 | } |
279 | 312 | } else { |
280 | 313 | if (isset($globalArchive) && $globalArchive === TRUE) { |
@@ -291,28 +324,46 @@ discard block |
||
291 | 324 | SELECT flightaware_id |
292 | 325 | FROM spotter_live".$filter_query." CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$globalLiveInterval." SECONDS' <= spotter_live.date"; |
293 | 326 | $query.= ") l ON l.flightaware_id = spotter_archive.flightaware_id "; |
294 | - if ($usecoord) $query .= "AND (spotter_archive.latitude BETWEEN ".$minlat." AND ".$maxlat." AND spotter_archive.longitude BETWEEN ".$minlong." AND ".$maxlong.") "; |
|
295 | - if ($id != '') $query .= "OR spotter_archive.flightaware_id = :id "; |
|
327 | + if ($usecoord) { |
|
328 | + $query .= "AND (spotter_archive.latitude BETWEEN ".$minlat." AND ".$maxlat." AND spotter_archive.longitude BETWEEN ".$minlong." AND ".$maxlong.") "; |
|
329 | + } |
|
330 | + if ($id != '') { |
|
331 | + $query .= "OR spotter_archive.flightaware_id = :id "; |
|
332 | + } |
|
296 | 333 | $query .= "UNION |
297 | 334 | SELECT spotter_live.ident, spotter_live.flightaware_id, spotter_live.aircraft_icao, spotter_live.departure_airport_icao as departure_airport, spotter_live.arrival_airport_icao as arrival_airport, spotter_live.latitude, spotter_live.longitude, spotter_live.altitude, spotter_live.heading, spotter_live.ground_speed, spotter_live.squawk, spotter_live.date, spotter_live.format_source, spotter_live.registration |
298 | 335 | FROM spotter_live".$filter_query." CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$globalLiveInterval." SECONDS' <= spotter_live.date"; |
299 | - if ($usecoord) $query .= " AND (spotter_live.latitude BETWEEN ".$minlat." AND ".$maxlat." AND spotter_live.longitude BETWEEN ".$minlong." AND ".$maxlong.")"; |
|
300 | - if ($id != '') $query .= " OR spotter_live.flightaware_id = :id"; |
|
336 | + if ($usecoord) { |
|
337 | + $query .= " AND (spotter_live.latitude BETWEEN ".$minlat." AND ".$maxlat." AND spotter_live.longitude BETWEEN ".$minlong." AND ".$maxlong.")"; |
|
338 | + } |
|
339 | + if ($id != '') { |
|
340 | + $query .= " OR spotter_live.flightaware_id = :id"; |
|
341 | + } |
|
301 | 342 | $query .= ") AS spotter WHERE latitude <> '0' AND longitude <> '0' "; |
302 | 343 | $query .= "ORDER BY flightaware_id, date"; |
303 | - if ($limit) $query .= " LIMIT ".$globalMap3DAircraftsLimit; |
|
344 | + if ($limit) { |
|
345 | + $query .= " LIMIT ".$globalMap3DAircraftsLimit; |
|
346 | + } |
|
304 | 347 | } else { |
305 | 348 | $query = "SELECT spotter_live.ident, spotter_live.flightaware_id, spotter_live.aircraft_icao, spotter_live.departure_airport_icao as departure_airport, spotter_live.arrival_airport_icao as arrival_airport, spotter_live.latitude, spotter_live.longitude, spotter_live.altitude, spotter_live.heading, spotter_live.ground_speed, spotter_live.squawk, spotter_live.date, spotter_live.format_source, spotter_live.registration |
306 | 349 | FROM spotter_live".$filter_query." CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$globalLiveInterval." SECONDS' <= spotter_live.date "; |
307 | - if ($usecoord) $query .= "AND (spotter_live.latitude BETWEEN ".$minlat." AND ".$maxlat." AND spotter_live.longitude BETWEEN ".$minlong." AND ".$maxlong.") "; |
|
308 | - if ($id != '') $query .= "OR spotter_live.flightaware_id = :id "; |
|
350 | + if ($usecoord) { |
|
351 | + $query .= "AND (spotter_live.latitude BETWEEN ".$minlat." AND ".$maxlat." AND spotter_live.longitude BETWEEN ".$minlong." AND ".$maxlong.") "; |
|
352 | + } |
|
353 | + if ($id != '') { |
|
354 | + $query .= "OR spotter_live.flightaware_id = :id "; |
|
355 | + } |
|
309 | 356 | $query .= "AND spotter_live.latitude <> '0' AND spotter_live.longitude <> '0' |
310 | 357 | ORDER BY spotter_live.flightaware_id, spotter_live.date"; |
311 | - if ($limit) $query .= " LIMIT ".$globalMap3DAircraftsLimit; |
|
358 | + if ($limit) { |
|
359 | + $query .= " LIMIT ".$globalMap3DAircraftsLimit; |
|
360 | + } |
|
312 | 361 | } |
313 | 362 | } |
314 | 363 | $query_values = array(); |
315 | - if ($id != '') $query_values = array(':id' => $id); |
|
364 | + if ($id != '') { |
|
365 | + $query_values = array(':id' => $id); |
|
366 | + } |
|
316 | 367 | try { |
317 | 368 | $sth = $this->db->prepare($query); |
318 | 369 | $sth->execute($query_values); |
@@ -337,8 +388,12 @@ discard block |
||
337 | 388 | $id = filter_var($id,FILTER_SANITIZE_STRING); |
338 | 389 | $filter_query = $this->getFilter($filter,true,true); |
339 | 390 | |
340 | - if (!isset($globalLiveInterval) || $globalLiveInterval == '') $globalLiveInterval = '200'; |
|
341 | - if (!isset($globalMap3DAircraftsLimit) || $globalMap3DAircraftsLimit == '') $globalMap3DAircraftsLimit = '300'; |
|
391 | + if (!isset($globalLiveInterval) || $globalLiveInterval == '') { |
|
392 | + $globalLiveInterval = '200'; |
|
393 | + } |
|
394 | + if (!isset($globalMap3DAircraftsLimit) || $globalMap3DAircraftsLimit == '') { |
|
395 | + $globalMap3DAircraftsLimit = '300'; |
|
396 | + } |
|
342 | 397 | if ($globalDBdriver == 'mysql') { |
343 | 398 | if (isset($globalArchive) && $globalArchive === TRUE) { |
344 | 399 | $query = 'SELECT * FROM (SELECT spotter_archive.ident, spotter_archive.flightaware_id, spotter_archive.aircraft_icao, spotter_archive.departure_airport_icao as departure_airport, spotter_archive.arrival_airport_icao as arrival_airport, spotter_archive.latitude, spotter_archive.longitude, spotter_archive.altitude, spotter_archive.heading, spotter_archive.ground_speed, spotter_archive.squawk, spotter_archive.date, spotter_archive.format_source, spotter_archive.registration |
@@ -349,13 +404,17 @@ discard block |
||
349 | 404 | $query .= ") AS spotter |
350 | 405 | WHERE latitude <> '0' AND longitude <> '0' |
351 | 406 | ORDER BY flightaware_id, date"; |
352 | - if ($limit) $query .= " LIMIT ".$globalMap3DAircraftsLimit; |
|
407 | + if ($limit) { |
|
408 | + $query .= " LIMIT ".$globalMap3DAircraftsLimit; |
|
409 | + } |
|
353 | 410 | } else { |
354 | 411 | $query = 'SELECT spotter_live.ident, spotter_live.flightaware_id, spotter_live.aircraft_icao, spotter_live.departure_airport_icao as departure_airport, spotter_live.arrival_airport_icao as arrival_airport, spotter_live.latitude, spotter_live.longitude, spotter_live.altitude, spotter_live.heading, spotter_live.ground_speed, spotter_live.squawk, spotter_live.date, spotter_live.format_source, spotter_live.registration |
355 | 412 | FROM spotter_live'.$filter_query.' spotter_live.flightaware_id = :id '; |
356 | 413 | $query .= "AND spotter_live.latitude <> '0' AND spotter_live.longitude <> '0' |
357 | 414 | ORDER BY spotter_live.flightaware_id, spotter_live.date"; |
358 | - if ($limit) $query .= " LIMIT ".$globalMap3DAircraftsLimit; |
|
415 | + if ($limit) { |
|
416 | + $query .= " LIMIT ".$globalMap3DAircraftsLimit; |
|
417 | + } |
|
359 | 418 | } |
360 | 419 | } else { |
361 | 420 | if (isset($globalArchive) && $globalArchive === TRUE) { |
@@ -371,13 +430,17 @@ discard block |
||
371 | 430 | FROM spotter_live".$filter_query." spotter_live.flightaware_id = :id"; |
372 | 431 | $query .= ") AS spotter WHERE latitude <> '0' AND longitude <> '0' "; |
373 | 432 | $query .= "ORDER BY flightaware_id, date"; |
374 | - if ($limit) $query .= " LIMIT ".$globalMap3DAircraftsLimit; |
|
433 | + if ($limit) { |
|
434 | + $query .= " LIMIT ".$globalMap3DAircraftsLimit; |
|
435 | + } |
|
375 | 436 | } else { |
376 | 437 | $query = "SELECT spotter_live.ident, spotter_live.flightaware_id, spotter_live.aircraft_icao, spotter_live.departure_airport_icao as departure_airport, spotter_live.arrival_airport_icao as arrival_airport, spotter_live.latitude, spotter_live.longitude, spotter_live.altitude, spotter_live.heading, spotter_live.ground_speed, spotter_live.squawk, spotter_live.date, spotter_live.format_source, spotter_live.registration |
377 | 438 | FROM spotter_live".$filter_query." spotter_live.flightaware_id = :id "; |
378 | 439 | $query .= "AND spotter_live.latitude <> '0' AND spotter_live.longitude <> '0' |
379 | 440 | ORDER BY spotter_live.flightaware_id, spotter_live.date"; |
380 | - if ($limit) $query .= " LIMIT ".$globalMap3DAircraftsLimit; |
|
441 | + if ($limit) { |
|
442 | + $query .= " LIMIT ".$globalMap3DAircraftsLimit; |
|
443 | + } |
|
381 | 444 | } |
382 | 445 | } |
383 | 446 | $query_values = array(); |
@@ -404,7 +467,9 @@ discard block |
||
404 | 467 | global $globalDBdriver, $globalLiveInterval; |
405 | 468 | $filter_query = $this->getFilter($filter,true,true); |
406 | 469 | |
407 | - if (!isset($globalLiveInterval)) $globalLiveInterval = '200'; |
|
470 | + if (!isset($globalLiveInterval)) { |
|
471 | + $globalLiveInterval = '200'; |
|
472 | + } |
|
408 | 473 | if ($globalDBdriver == 'mysql') { |
409 | 474 | //$query = 'SELECT COUNT(*) as nb FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= l.date GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate'.$filter_query; |
410 | 475 | $query = 'SELECT COUNT(DISTINCT spotter_live.flightaware_id) as nb FROM spotter_live'.$filter_query.' DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= date'; |
@@ -434,7 +499,9 @@ discard block |
||
434 | 499 | { |
435 | 500 | global $globalDBdriver, $globalLiveInterval; |
436 | 501 | $Spotter = new Spotter($this->db); |
437 | - if (!isset($globalLiveInterval)) $globalLiveInterval = '200'; |
|
502 | + if (!isset($globalLiveInterval)) { |
|
503 | + $globalLiveInterval = '200'; |
|
504 | + } |
|
438 | 505 | $filter_query = $this->getFilter($filter); |
439 | 506 | |
440 | 507 | if (is_array($coord)) { |
@@ -442,7 +509,9 @@ discard block |
||
442 | 509 | $minlat = filter_var($coord[1],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
443 | 510 | $maxlong = filter_var($coord[2],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
444 | 511 | $maxlat = filter_var($coord[3],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
445 | - } else return array(); |
|
512 | + } else { |
|
513 | + return array(); |
|
514 | + } |
|
446 | 515 | if ($globalDBdriver == 'mysql') { |
447 | 516 | $query = 'SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= l.date GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate AND spotter_live.latitude BETWEEN '.$minlat.' AND '.$maxlat.' AND spotter_live.longitude BETWEEN '.$minlong.' AND '.$maxlong.' GROUP BY spotter_live.flightaware_id'.$filter_query; |
448 | 517 | } else { |
@@ -463,7 +532,9 @@ discard block |
||
463 | 532 | { |
464 | 533 | global $globalDBdriver, $globalLiveInterval, $globalArchive; |
465 | 534 | $Spotter = new Spotter($this->db); |
466 | - if (!isset($globalLiveInterval)) $globalLiveInterval = '200'; |
|
535 | + if (!isset($globalLiveInterval)) { |
|
536 | + $globalLiveInterval = '200'; |
|
537 | + } |
|
467 | 538 | $filter_query = $this->getFilter($filter,true,true); |
468 | 539 | |
469 | 540 | if (is_array($coord)) { |
@@ -471,7 +542,9 @@ discard block |
||
471 | 542 | $minlat = filter_var($coord[1],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
472 | 543 | $maxlong = filter_var($coord[2],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
473 | 544 | $maxlat = filter_var($coord[3],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
474 | - } else return array(); |
|
545 | + } else { |
|
546 | + return array(); |
|
547 | + } |
|
475 | 548 | if ($globalDBdriver == 'mysql') { |
476 | 549 | if (isset($globalArchive) && $globalArchive === TRUE) { |
477 | 550 | $query = 'SELECT spotter_live.ident, spotter_live.flightaware_id, spotter_live.aircraft_icao, spotter_live.departure_airport_icao as departure_airport, spotter_live.arrival_airport_icao as arrival_airport, spotter_live.latitude, spotter_live.longitude, spotter_live.altitude, spotter_live.real_altitude, spotter_live.heading, spotter_live.ground_speed, spotter_live.squawk, spotter_live.date, spotter_live.format_source, spotter_live.registration |
@@ -698,11 +771,15 @@ discard block |
||
698 | 771 | //$query = self::$global_query.' WHERE spotter_live.flightaware_id = :id ORDER BY date'; |
699 | 772 | if ($globalDBdriver == 'mysql') { |
700 | 773 | $query = 'SELECT spotter_live.* FROM spotter_live WHERE spotter_live.flightaware_id = :id'; |
701 | - if ($liveinterval) $query .= ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= date'; |
|
774 | + if ($liveinterval) { |
|
775 | + $query .= ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= date'; |
|
776 | + } |
|
702 | 777 | $query .= ' ORDER BY date'; |
703 | 778 | } else { |
704 | 779 | $query = 'SELECT spotter_live.* FROM spotter_live WHERE spotter_live.flightaware_id = :id'; |
705 | - if ($liveinterval) $query .= " AND CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$globalLiveInterval." SECONDS' <= date"; |
|
780 | + if ($liveinterval) { |
|
781 | + $query .= " AND CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$globalLiveInterval." SECONDS' <= date"; |
|
782 | + } |
|
706 | 783 | $query .= ' ORDER BY date'; |
707 | 784 | } |
708 | 785 | |
@@ -797,7 +874,9 @@ discard block |
||
797 | 874 | $i++; |
798 | 875 | $j++; |
799 | 876 | if ($j == 30) { |
800 | - if ($globalDebug) echo "."; |
|
877 | + if ($globalDebug) { |
|
878 | + echo "."; |
|
879 | + } |
|
801 | 880 | try { |
802 | 881 | |
803 | 882 | $sth = $this->db->prepare(substr($query_delete,0,-1).")"); |
@@ -1150,7 +1229,9 @@ discard block |
||
1150 | 1229 | { |
1151 | 1230 | return false; |
1152 | 1231 | } |
1153 | - } else return ''; |
|
1232 | + } else { |
|
1233 | + return ''; |
|
1234 | + } |
|
1154 | 1235 | |
1155 | 1236 | if ($longitude != '') |
1156 | 1237 | { |
@@ -1158,7 +1239,9 @@ discard block |
||
1158 | 1239 | { |
1159 | 1240 | return false; |
1160 | 1241 | } |
1161 | - } else return ''; |
|
1242 | + } else { |
|
1243 | + return ''; |
|
1244 | + } |
|
1162 | 1245 | |
1163 | 1246 | if ($waypoints != '') |
1164 | 1247 | { |
@@ -1174,14 +1257,18 @@ discard block |
||
1174 | 1257 | { |
1175 | 1258 | return false; |
1176 | 1259 | } |
1177 | - } else $altitude = 0; |
|
1260 | + } else { |
|
1261 | + $altitude = 0; |
|
1262 | + } |
|
1178 | 1263 | if ($altitude_real != '') |
1179 | 1264 | { |
1180 | 1265 | if (!is_numeric($altitude_real)) |
1181 | 1266 | { |
1182 | 1267 | return false; |
1183 | 1268 | } |
1184 | - } else $altitude_real = 0; |
|
1269 | + } else { |
|
1270 | + $altitude_real = 0; |
|
1271 | + } |
|
1185 | 1272 | |
1186 | 1273 | if ($heading != '') |
1187 | 1274 | { |
@@ -1189,7 +1276,9 @@ discard block |
||
1189 | 1276 | { |
1190 | 1277 | return false; |
1191 | 1278 | } |
1192 | - } else $heading = 0; |
|
1279 | + } else { |
|
1280 | + $heading = 0; |
|
1281 | + } |
|
1193 | 1282 | |
1194 | 1283 | if ($groundspeed != '') |
1195 | 1284 | { |
@@ -1197,9 +1286,13 @@ discard block |
||
1197 | 1286 | { |
1198 | 1287 | return false; |
1199 | 1288 | } |
1200 | - } else $groundspeed = 0; |
|
1289 | + } else { |
|
1290 | + $groundspeed = 0; |
|
1291 | + } |
|
1201 | 1292 | date_default_timezone_set('UTC'); |
1202 | - if ($date == '') $date = date("Y-m-d H:i:s", time()); |
|
1293 | + if ($date == '') { |
|
1294 | + $date = date("Y-m-d H:i:s", time()); |
|
1295 | + } |
|
1203 | 1296 | |
1204 | 1297 | |
1205 | 1298 | $flightaware_id = filter_var($flightaware_id,FILTER_SANITIZE_STRING); |
@@ -1244,14 +1337,24 @@ discard block |
||
1244 | 1337 | $arrival_airport_country = ''; |
1245 | 1338 | |
1246 | 1339 | |
1247 | - if ($squawk == '' || $Common->isInteger($squawk) === false ) $squawk = NULL; |
|
1248 | - if ($verticalrate == '' || $Common->isInteger($verticalrate) === false ) $verticalrate = NULL; |
|
1249 | - if ($groundspeed == '' || $Common->isInteger($groundspeed) === false ) $groundspeed = 0; |
|
1250 | - if ($heading == '' || $Common->isInteger($heading) === false ) $heading = 0; |
|
1340 | + if ($squawk == '' || $Common->isInteger($squawk) === false ) { |
|
1341 | + $squawk = NULL; |
|
1342 | + } |
|
1343 | + if ($verticalrate == '' || $Common->isInteger($verticalrate) === false ) { |
|
1344 | + $verticalrate = NULL; |
|
1345 | + } |
|
1346 | + if ($groundspeed == '' || $Common->isInteger($groundspeed) === false ) { |
|
1347 | + $groundspeed = 0; |
|
1348 | + } |
|
1349 | + if ($heading == '' || $Common->isInteger($heading) === false ) { |
|
1350 | + $heading = 0; |
|
1351 | + } |
|
1251 | 1352 | |
1252 | 1353 | $query = ''; |
1253 | 1354 | if ($globalArchive) { |
1254 | - if ($globalDebug) echo '-- Delete previous data -- '; |
|
1355 | + if ($globalDebug) { |
|
1356 | + echo '-- Delete previous data -- '; |
|
1357 | + } |
|
1255 | 1358 | $query .= 'DELETE FROM spotter_live WHERE flightaware_id = :flightaware_id;'; |
1256 | 1359 | } |
1257 | 1360 | |
@@ -1268,10 +1371,14 @@ discard block |
||
1268 | 1371 | return "error : ".$e->getMessage(); |
1269 | 1372 | } |
1270 | 1373 | if (isset($globalArchive) && $globalArchive && $putinarchive && $noarchive !== true) { |
1271 | - if ($globalDebug) echo '(Add to SBS archive : '; |
|
1374 | + if ($globalDebug) { |
|
1375 | + echo '(Add to SBS archive : '; |
|
1376 | + } |
|
1272 | 1377 | $SpotterArchive = new SpotterArchive($this->db); |
1273 | 1378 | $result = $SpotterArchive->addSpotterArchiveData($flightaware_id, $ident, $registration, $airline_name, $airline_icao, $airline_country, $airline_type, $aircraft_icao, $aircraft_shadow, $aircraft_name, $aircraft_manufacturer, $departure_airport_icao, $departure_airport_name, $departure_airport_city, $departure_airport_country, $departure_airport_time,$arrival_airport_icao, $arrival_airport_name, $arrival_airport_city, $arrival_airport_country, $arrival_airport_time, $route_stop, $date,$latitude, $longitude, $waypoints, $altitude, $altitude_real,$heading, $groundspeed, $squawk, $ModeS, $pilot_id, $pilot_name,$verticalrate,$format_source,$source_name, $over_country); |
1274 | - if ($globalDebug) echo $result.')'; |
|
1379 | + if ($globalDebug) { |
|
1380 | + echo $result.')'; |
|
1381 | + } |
|
1275 | 1382 | } elseif ($globalDebug && $putinarchive !== true) { |
1276 | 1383 | echo '(Not adding to archive)'; |
1277 | 1384 | } elseif ($globalDebug && $noarchive === true) { |
@@ -57,7 +57,10 @@ discard block |
||
57 | 57 | <?php |
58 | 58 | if ((!isset($_COOKIE['MapFormat']) && isset($globalMap3Ddefault) && $globalMap3Ddefault) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d')) { |
59 | 59 | ?> |
60 | -<script src="<?php echo $globalURL; ?>/js/map.3d.js.php<?php if (isset($tsk)) print '?tsk='.$tsk; ?>"></script> |
|
60 | +<script src="<?php echo $globalURL; ?>/js/map.3d.js.php<?php if (isset($tsk)) { |
|
61 | + print '?tsk='.$tsk; |
|
62 | +} |
|
63 | +?>"></script> |
|
61 | 64 | <?php |
62 | 65 | if (!isset($globalAircraft) || $globalAircraft) { |
63 | 66 | ?> |
@@ -135,9 +138,18 @@ discard block |
||
135 | 138 | <h1>Weather</h1> |
136 | 139 | <ul> |
137 | 140 | |
138 | - <li><div class="checkbox"><label><input type="checkbox" name="wind" value="1" onclick="clickWind(this);" <?php if (isset($_COOKIE['weather_wind']) && $_COOKIE['weather_wind'] == 'true') print 'checked'; ?> /><?php echo _("Weather Winds"); ?></label></div></li> |
|
139 | - <li><div class="checkbox"><label><input type="checkbox" name="wave" value="1" onclick="clickWave(this);" <?php if (isset($_COOKIE['weather_wave']) && $_COOKIE['weather_wave'] == 'true') print 'checked'; ?> /><?php echo _("Ocean surface currents"); ?></label></div></li> |
|
140 | - <!-- <li><div class="checkbox"><label><input type="checkbox" name="backwave" value="1" onclick="clickBackWave(this);" <?php if (isset($_COOKIE['weather_backwave']) && $_COOKIE['weather_backwave'] == 'true') print 'checked'; ?> /><?php echo _("Weather Waves height background"); ?></label></div></li> --> |
|
141 | + <li><div class="checkbox"><label><input type="checkbox" name="wind" value="1" onclick="clickWind(this);" <?php if (isset($_COOKIE['weather_wind']) && $_COOKIE['weather_wind'] == 'true') { |
|
142 | + print 'checked'; |
|
143 | +} |
|
144 | +?> /><?php echo _("Weather Winds"); ?></label></div></li> |
|
145 | + <li><div class="checkbox"><label><input type="checkbox" name="wave" value="1" onclick="clickWave(this);" <?php if (isset($_COOKIE['weather_wave']) && $_COOKIE['weather_wave'] == 'true') { |
|
146 | + print 'checked'; |
|
147 | +} |
|
148 | +?> /><?php echo _("Ocean surface currents"); ?></label></div></li> |
|
149 | + <!-- <li><div class="checkbox"><label><input type="checkbox" name="backwave" value="1" onclick="clickBackWave(this);" <?php if (isset($_COOKIE['weather_backwave']) && $_COOKIE['weather_backwave'] == 'true') { |
|
150 | + print 'checked'; |
|
151 | +} |
|
152 | +?> /><?php echo _("Weather Waves height background"); ?></label></div></li> --> |
|
141 | 153 | |
142 | 154 | <?php |
143 | 155 | if (isset($globalOpenWeatherMapKey) && $globalOpenWeatherMapKey != '') { |
@@ -156,7 +168,10 @@ discard block |
||
156 | 168 | ?> |
157 | 169 | <h1>Weather</h1> |
158 | 170 | <ul> |
159 | - <li><div class="checkbox"><label><input type="checkbox" name="displayweather" value="1" onclick="clickDisplayWeather(this)" <?php if ((isset($_COOKIE['show_Weather']) && $_COOKIE['show_Weather'] == 'true') || (!isset($_COOKIE['show_Weather']) && (isset($globalMapWeather) && $globalMapWeather === TRUE))) print 'checked'; ?> ><?php echo _("Display weather on 3D map"); ?></label></div></li> |
|
171 | + <li><div class="checkbox"><label><input type="checkbox" name="displayweather" value="1" onclick="clickDisplayWeather(this)" <?php if ((isset($_COOKIE['show_Weather']) && $_COOKIE['show_Weather'] == 'true') || (!isset($_COOKIE['show_Weather']) && (isset($globalMapWeather) && $globalMapWeather === TRUE))) { |
|
172 | + print 'checked'; |
|
173 | +} |
|
174 | +?> ><?php echo _("Display weather on 3D map"); ?></label></div></li> |
|
160 | 175 | </ul> |
161 | 176 | <?php |
162 | 177 | } |
@@ -173,13 +188,22 @@ discard block |
||
173 | 188 | <?php |
174 | 189 | if (!isset($globalAircraft) || $globalAircraft) { |
175 | 190 | ?> |
176 | - <li><div class="checkbox"><label><input type="checkbox" name="waypoints" value="1" onclick="showWaypoints(this);" <?php if (isset($_COOKIE['waypoints']) && $_COOKIE['waypoints'] == 'true') print 'checked'; ?> /><?php echo _("Display waypoints"); ?></label></div></li> |
|
177 | - <li><div class="checkbox"><label><input type="checkbox" name="airspace" value="1" onclick="showAirspace(this);" <?php if (isset($_COOKIE['airspace']) && $_COOKIE['airspace'] == 'true') print 'checked'; ?> /><?php echo _("Display airspace"); ?></label></div></li> |
|
191 | + <li><div class="checkbox"><label><input type="checkbox" name="waypoints" value="1" onclick="showWaypoints(this);" <?php if (isset($_COOKIE['waypoints']) && $_COOKIE['waypoints'] == 'true') { |
|
192 | + print 'checked'; |
|
193 | +} |
|
194 | +?> /><?php echo _("Display waypoints"); ?></label></div></li> |
|
195 | + <li><div class="checkbox"><label><input type="checkbox" name="airspace" value="1" onclick="showAirspace(this);" <?php if (isset($_COOKIE['airspace']) && $_COOKIE['airspace'] == 'true') { |
|
196 | + print 'checked'; |
|
197 | +} |
|
198 | +?> /><?php echo _("Display airspace"); ?></label></div></li> |
|
178 | 199 | <?php |
179 | 200 | } |
180 | 201 | if (isset($globalMarine) && $globalMarine) { |
181 | 202 | ?> |
182 | - <li><div class="checkbox"><label><input type="checkbox" name="openseamap" value="1" onclick="clickOpenSeaMap(this);" <?php if (isset($_COOKIE['openseamap']) && $_COOKIE['openseamap'] == 'true') print 'checked'; ?> /><?php echo _("Display OpenSeaMap"); ?></label></div></li> |
|
203 | + <li><div class="checkbox"><label><input type="checkbox" name="openseamap" value="1" onclick="clickOpenSeaMap(this);" <?php if (isset($_COOKIE['openseamap']) && $_COOKIE['openseamap'] == 'true') { |
|
204 | + print 'checked'; |
|
205 | +} |
|
206 | +?> /><?php echo _("Display OpenSeaMap"); ?></label></div></li> |
|
183 | 207 | <?php |
184 | 208 | } |
185 | 209 | ?> |
@@ -194,13 +218,22 @@ discard block |
||
194 | 218 | <?php |
195 | 219 | if (!isset($globalAircraft) || $globalAircraft) { |
196 | 220 | ?> |
197 | - <li><div class="checkbox"><label><input type="checkbox" name="waypoints" value="1" onclick="showWaypoints(this);" <?php if (isset($_COOKIE['waypoints']) && $_COOKIE['waypoints'] == 'true') print 'checked'; ?> /><?php echo _("Display waypoints"); ?> Beta</label></div></li> |
|
198 | - <li><div class="checkbox"><label><input type="checkbox" name="airspace" value="1" onclick="showAirspace(this);" <?php if (isset($_COOKIE['airspace']) && $_COOKIE['airspace'] == 'true') print 'checked'; ?> /><?php echo _("Display airspace"); ?> Beta</label></div></li> |
|
221 | + <li><div class="checkbox"><label><input type="checkbox" name="waypoints" value="1" onclick="showWaypoints(this);" <?php if (isset($_COOKIE['waypoints']) && $_COOKIE['waypoints'] == 'true') { |
|
222 | + print 'checked'; |
|
223 | +} |
|
224 | +?> /><?php echo _("Display waypoints"); ?> Beta</label></div></li> |
|
225 | + <li><div class="checkbox"><label><input type="checkbox" name="airspace" value="1" onclick="showAirspace(this);" <?php if (isset($_COOKIE['airspace']) && $_COOKIE['airspace'] == 'true') { |
|
226 | + print 'checked'; |
|
227 | +} |
|
228 | +?> /><?php echo _("Display airspace"); ?> Beta</label></div></li> |
|
199 | 229 | <?php |
200 | 230 | } |
201 | 231 | if (isset($globalMarine) && $globalMarine) { |
202 | 232 | ?> |
203 | - <li><div class="checkbox"><label><input type="checkbox" name="openseamap" value="1" onclick="clickOpenSeaMap(this);" <?php if (isset($_COOKIE['openseamap']) && $_COOKIE['openseamap'] == 'true') print 'checked'; ?> /><?php echo _("Display OpenSeaMap"); ?></label></div></li> |
|
233 | + <li><div class="checkbox"><label><input type="checkbox" name="openseamap" value="1" onclick="clickOpenSeaMap(this);" <?php if (isset($_COOKIE['openseamap']) && $_COOKIE['openseamap'] == 'true') { |
|
234 | + print 'checked'; |
|
235 | +} |
|
236 | +?> /><?php echo _("Display OpenSeaMap"); ?></label></div></li> |
|
204 | 237 | <?php |
205 | 238 | } |
206 | 239 | ?> |
@@ -215,14 +248,32 @@ discard block |
||
215 | 248 | <h1>NOTAM</h1> |
216 | 249 | <form> |
217 | 250 | <ul> |
218 | - <li><div class="checkbox"><label><input type="checkbox" name="notamcb" value="1" onclick="showNotam(this);" <?php if (isset($_COOKIE['notam']) && $_COOKIE['notam'] == 'true') print 'checked'; ?> /><?php echo _("Display NOTAM"); ?></label></div></li> |
|
251 | + <li><div class="checkbox"><label><input type="checkbox" name="notamcb" value="1" onclick="showNotam(this);" <?php if (isset($_COOKIE['notam']) && $_COOKIE['notam'] == 'true') { |
|
252 | + print 'checked'; |
|
253 | +} |
|
254 | +?> /><?php echo _("Display NOTAM"); ?></label></div></li> |
|
219 | 255 | <li><?php echo _("NOTAM scope:"); ?> |
220 | 256 | <select class="selectpicker" onchange="notamscope(this);"> |
221 | - <option<?php if (!isset($_COOKIE['notamscope']) || $_COOKIE['notamscope'] == 'All') print ' selected'; ?>>All</option> |
|
222 | - <option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport/Enroute warning') print ' selected'; ?>>Airport/Enroute warning</option> |
|
223 | - <option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport warning') print ' selected'; ?>>Airport warning</option> |
|
224 | - <option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Navigation warning') print ' selected'; ?>>Navigation warning</option> |
|
225 | - <option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Enroute warning') print ' selected'; ?>>Enroute warning</option> |
|
257 | + <option<?php if (!isset($_COOKIE['notamscope']) || $_COOKIE['notamscope'] == 'All') { |
|
258 | + print ' selected'; |
|
259 | +} |
|
260 | +?>>All</option> |
|
261 | + <option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport/Enroute warning') { |
|
262 | + print ' selected'; |
|
263 | +} |
|
264 | +?>>Airport/Enroute warning</option> |
|
265 | + <option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport warning') { |
|
266 | + print ' selected'; |
|
267 | +} |
|
268 | +?>>Airport warning</option> |
|
269 | + <option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Navigation warning') { |
|
270 | + print ' selected'; |
|
271 | +} |
|
272 | +?>>Navigation warning</option> |
|
273 | + <option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Enroute warning') { |
|
274 | + print ' selected'; |
|
275 | +} |
|
276 | +?>>Enroute warning</option> |
|
226 | 277 | </select |
227 | 278 | </li> |
228 | 279 | </ul> |
@@ -250,7 +301,10 @@ discard block |
||
250 | 301 | <div class="form-group"> |
251 | 302 | <label><?php echo _("From:"); ?></label> |
252 | 303 | <div class='input-group date' id='datetimepicker1'> |
253 | - <input type='text' id="start_date" name="start_date" class="form-control" autocomplete="off" value="<?php if (isset($_COOKIE['archive_begin']) && $_COOKIE['archive_begin'] != '') print date("Y-m-d H:i",$_COOKIE['archive_begin']).' UTC'; ?>" required /> |
|
304 | + <input type='text' id="start_date" name="start_date" class="form-control" autocomplete="off" value="<?php if (isset($_COOKIE['archive_begin']) && $_COOKIE['archive_begin'] != '') { |
|
305 | + print date("Y-m-d H:i",$_COOKIE['archive_begin']).' UTC'; |
|
306 | +} |
|
307 | +?>" required /> |
|
254 | 308 | <span class="input-group-addon"> |
255 | 309 | <span class="glyphicon glyphicon-calendar"></span> |
256 | 310 | </span> |
@@ -259,7 +313,10 @@ discard block |
||
259 | 313 | <div class="form-group"> |
260 | 314 | <label><?php echo _("To:"); ?></label> |
261 | 315 | <div class='input-group date' id='datetimepicker2'> |
262 | - <input type='text' id="end_date" name="end_date" class="form-control" autocomplete="off" value="<?php if (isset($_COOKIE['archive_end']) && $_COOKIE['archive_end'] != '') print date("Y-m-d H:i",$_COOKIE['archive_end']).' UTC'; ?>" /> |
|
316 | + <input type='text' id="end_date" name="end_date" class="form-control" autocomplete="off" value="<?php if (isset($_COOKIE['archive_end']) && $_COOKIE['archive_end'] != '') { |
|
317 | + print date("Y-m-d H:i",$_COOKIE['archive_end']).' UTC'; |
|
318 | +} |
|
319 | +?>" /> |
|
263 | 320 | <span class="input-group-addon"> |
264 | 321 | <span class="glyphicon glyphicon-calendar"></span> |
265 | 322 | </span> |
@@ -291,8 +348,20 @@ discard block |
||
291 | 348 | </script> |
292 | 349 | <li><?php echo _("Playback speed:"); ?> |
293 | 350 | <div class="range"> |
294 | - <input type="range" min="0" max="50" step="1" id="archivespeed" name="archivespeed" onChange="archivespeedrange.value=value;" value="<?php if (isset($_POST['archivespeed'])) print $_POST['archivespeed']; elseif (isset($_COOKIE['archive_speed'])) print $_COOKIE['archive_speed']; else print '1'; ?>"> |
|
295 | - <output id="archivespeedrange"><?php if (isset($_COOKIE['archive_speed'])) print $_COOKIE['archive_speed']; else print '1'; ?></output> |
|
351 | + <input type="range" min="0" max="50" step="1" id="archivespeed" name="archivespeed" onChange="archivespeedrange.value=value;" value="<?php if (isset($_POST['archivespeed'])) { |
|
352 | + print $_POST['archivespeed']; |
|
353 | +} elseif (isset($_COOKIE['archive_speed'])) { |
|
354 | + print $_COOKIE['archive_speed']; |
|
355 | +} else { |
|
356 | + print '1'; |
|
357 | +} |
|
358 | +?>"> |
|
359 | + <output id="archivespeedrange"><?php if (isset($_COOKIE['archive_speed'])) { |
|
360 | + print $_COOKIE['archive_speed']; |
|
361 | +} else { |
|
362 | + print '1'; |
|
363 | +} |
|
364 | +?></output> |
|
296 | 365 | </div> |
297 | 366 | </li> |
298 | 367 | <?php |
@@ -321,14 +390,20 @@ discard block |
||
321 | 390 | <li><?php echo _("Type of Map:"); ?> |
322 | 391 | <?php |
323 | 392 | if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) { |
324 | - if (!isset($_COOKIE['MapType']) || $_COOKIE['MapType'] == '') $MapType = $globalMapProvider; |
|
325 | - else $MapType = $_COOKIE['MapType']; |
|
393 | + if (!isset($_COOKIE['MapType']) || $_COOKIE['MapType'] == '') { |
|
394 | + $MapType = $globalMapProvider; |
|
395 | + } else { |
|
396 | + $MapType = $_COOKIE['MapType']; |
|
397 | + } |
|
326 | 398 | ?> |
327 | 399 | <select class="selectpicker" onchange="mapType(this);"> |
328 | 400 | <?php |
329 | 401 | } else { |
330 | - if (!isset($_COOKIE['MapType3D']) || $_COOKIE['MapType3D'] == '') $MapType = $globalMapProvider; |
|
331 | - else $MapType = $_COOKIE['MapType3D']; |
|
402 | + if (!isset($_COOKIE['MapType3D']) || $_COOKIE['MapType3D'] == '') { |
|
403 | + $MapType = $globalMapProvider; |
|
404 | + } else { |
|
405 | + $MapType = $_COOKIE['MapType3D']; |
|
406 | + } |
|
332 | 407 | ?> |
333 | 408 | <select class="selectpicker" onchange="mapType3D(this);"> |
334 | 409 | <?php |
@@ -337,24 +412,48 @@ discard block |
||
337 | 412 | <?php |
338 | 413 | if (isset($globalMapOffline) && $globalMapOffline === TRUE) { |
339 | 414 | ?> |
340 | - <option value="offline"<?php if ($MapType == 'offline') print ' selected'; ?>>Natural Earth (local)</option> |
|
415 | + <option value="offline"<?php if ($MapType == 'offline') { |
|
416 | + print ' selected'; |
|
417 | +} |
|
418 | +?>>Natural Earth (local)</option> |
|
341 | 419 | <?php |
342 | 420 | } else { |
343 | 421 | if (file_exists(dirname(__FILE__).'/js/Cesium/Assets/Textures/NaturalEarthII/tilemapresource.xml')) { |
344 | 422 | ?> |
345 | - <option value="offline"<?php if ($MapType == 'offline') print ' selected'; ?>>Natural Earth (local)</option> |
|
423 | + <option value="offline"<?php if ($MapType == 'offline') { |
|
424 | + print ' selected'; |
|
425 | +} |
|
426 | +?>>Natural Earth (local)</option> |
|
346 | 427 | <?php |
347 | 428 | } |
348 | 429 | ?> |
349 | - <option value="ArcGIS-Streetmap"<?php if ($MapType == 'ArcGIS-Streetmap') print ' selected'; ?>>ArcGIS Streetmap</option> |
|
350 | - <option value="ArcGIS-Satellite"<?php if ($MapType == 'ArcGIS-Satellite') print ' selected'; ?>>ArcGIS Satellite</option> |
|
351 | - <option value="ArcGIS-Satellite"<?php if ($MapType == 'ArcGIS-Ocean') print ' selected'; ?>>ArcGIS Ocean</option> |
|
430 | + <option value="ArcGIS-Streetmap"<?php if ($MapType == 'ArcGIS-Streetmap') { |
|
431 | + print ' selected'; |
|
432 | +} |
|
433 | +?>>ArcGIS Streetmap</option> |
|
434 | + <option value="ArcGIS-Satellite"<?php if ($MapType == 'ArcGIS-Satellite') { |
|
435 | + print ' selected'; |
|
436 | +} |
|
437 | +?>>ArcGIS Satellite</option> |
|
438 | + <option value="ArcGIS-Satellite"<?php if ($MapType == 'ArcGIS-Ocean') { |
|
439 | + print ' selected'; |
|
440 | +} |
|
441 | +?>>ArcGIS Ocean</option> |
|
352 | 442 | <?php |
353 | 443 | if (isset($globalBingMapKey) && $globalBingMapKey != '') { |
354 | 444 | ?> |
355 | - <option value="Bing-Aerial"<?php if ($MapType == 'Bing-Aerial') print ' selected'; ?>>Bing-Aerial</option> |
|
356 | - <option value="Bing-Hybrid"<?php if ($MapType == 'Bing-Hybrid') print ' selected'; ?>>Bing-Hybrid</option> |
|
357 | - <option value="Bing-Road"<?php if ($MapType == 'Bing-Road') print ' selected'; ?>>Bing-Road</option> |
|
445 | + <option value="Bing-Aerial"<?php if ($MapType == 'Bing-Aerial') { |
|
446 | + print ' selected'; |
|
447 | +} |
|
448 | +?>>Bing-Aerial</option> |
|
449 | + <option value="Bing-Hybrid"<?php if ($MapType == 'Bing-Hybrid') { |
|
450 | + print ' selected'; |
|
451 | +} |
|
452 | +?>>Bing-Hybrid</option> |
|
453 | + <option value="Bing-Road"<?php if ($MapType == 'Bing-Road') { |
|
454 | + print ' selected'; |
|
455 | +} |
|
456 | +?>>Bing-Road</option> |
|
358 | 457 | <?php |
359 | 458 | } |
360 | 459 | ?> |
@@ -364,59 +463,143 @@ discard block |
||
364 | 463 | <?php |
365 | 464 | if (isset($globalHereappId) && $globalHereappId != '' && isset($globalHereappCode) && $globalHereappCode != '') { |
366 | 465 | ?> |
367 | - <option value="Here-Aerial"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Aerial</option> |
|
368 | - <option value="Here-Hybrid"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Hybrid</option> |
|
369 | - <option value="Here-Road"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Road</option> |
|
466 | + <option value="Here-Aerial"<?php if ($MapType == 'Here') { |
|
467 | + print ' selected'; |
|
468 | +} |
|
469 | +?>>Here-Aerial</option> |
|
470 | + <option value="Here-Hybrid"<?php if ($MapType == 'Here') { |
|
471 | + print ' selected'; |
|
472 | +} |
|
473 | +?>>Here-Hybrid</option> |
|
474 | + <option value="Here-Road"<?php if ($MapType == 'Here') { |
|
475 | + print ' selected'; |
|
476 | +} |
|
477 | +?>>Here-Road</option> |
|
370 | 478 | <?php |
371 | 479 | } |
372 | 480 | ?> |
373 | 481 | <?php |
374 | 482 | if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '') { |
375 | 483 | ?> |
376 | - <option value="Google-Roadmap"<?php if ($MapType == 'Google-Roadmap') print ' selected'; ?>>Google Roadmap</option> |
|
377 | - <option value="Google-Satellite"<?php if ($MapType == 'Google-Satellite') print ' selected'; ?>>Google Satellite</option> |
|
378 | - <option value="Google-Hybrid"<?php if ($MapType == 'Google-Hybrid') print ' selected'; ?>>Google Hybrid</option> |
|
379 | - <option value="Google-Terrain"<?php if ($MapType == 'Google-Terrain') print ' selected'; ?>>Google Terrain</option> |
|
484 | + <option value="Google-Roadmap"<?php if ($MapType == 'Google-Roadmap') { |
|
485 | + print ' selected'; |
|
486 | +} |
|
487 | +?>>Google Roadmap</option> |
|
488 | + <option value="Google-Satellite"<?php if ($MapType == 'Google-Satellite') { |
|
489 | + print ' selected'; |
|
490 | +} |
|
491 | +?>>Google Satellite</option> |
|
492 | + <option value="Google-Hybrid"<?php if ($MapType == 'Google-Hybrid') { |
|
493 | + print ' selected'; |
|
494 | +} |
|
495 | +?>>Google Hybrid</option> |
|
496 | + <option value="Google-Terrain"<?php if ($MapType == 'Google-Terrain') { |
|
497 | + print ' selected'; |
|
498 | +} |
|
499 | +?>>Google Terrain</option> |
|
380 | 500 | <?php |
381 | 501 | } |
382 | 502 | ?> |
383 | 503 | <?php |
384 | 504 | if (isset($globalMapQuestKey) && $globalMapQuestKey != '') { |
385 | 505 | ?> |
386 | - <option value="MapQuest-OSM"<?php if ($MapType == 'MapQuest-OSM') print ' selected'; ?>>MapQuest-OSM</option> |
|
387 | - <option value="MapQuest-Aerial"<?php if ($MapType == 'MapQuest-Aerial') print ' selected'; ?>>MapQuest-Aerial</option> |
|
388 | - <option value="MapQuest-Hybrid"<?php if ($MapType == 'MapQuest-Hybrid') print ' selected'; ?>>MapQuest-Hybrid</option> |
|
506 | + <option value="MapQuest-OSM"<?php if ($MapType == 'MapQuest-OSM') { |
|
507 | + print ' selected'; |
|
508 | +} |
|
509 | +?>>MapQuest-OSM</option> |
|
510 | + <option value="MapQuest-Aerial"<?php if ($MapType == 'MapQuest-Aerial') { |
|
511 | + print ' selected'; |
|
512 | +} |
|
513 | +?>>MapQuest-Aerial</option> |
|
514 | + <option value="MapQuest-Hybrid"<?php if ($MapType == 'MapQuest-Hybrid') { |
|
515 | + print ' selected'; |
|
516 | +} |
|
517 | +?>>MapQuest-Hybrid</option> |
|
389 | 518 | <?php |
390 | 519 | } |
391 | 520 | ?> |
392 | - <option value="Yandex"<?php if ($MapType == 'Yandex') print ' selected'; ?>>Yandex</option> |
|
393 | - <option value="offline"<?php if ($MapType == 'offline') print ' selected'; ?>>Natural Earth</option> |
|
521 | + <option value="Yandex"<?php if ($MapType == 'Yandex') { |
|
522 | + print ' selected'; |
|
523 | +} |
|
524 | +?>>Yandex</option> |
|
525 | + <option value="offline"<?php if ($MapType == 'offline') { |
|
526 | + print ' selected'; |
|
527 | +} |
|
528 | +?>>Natural Earth</option> |
|
394 | 529 | <?php |
395 | 530 | } |
396 | 531 | ?> |
397 | - <option value="NatGeo-Street"<?php if ($MapType == 'NatGeo-Street') print ' selected'; ?>>National Geographic Street</option> |
|
532 | + <option value="NatGeo-Street"<?php if ($MapType == 'NatGeo-Street') { |
|
533 | + print ' selected'; |
|
534 | +} |
|
535 | +?>>National Geographic Street</option> |
|
398 | 536 | <?php |
399 | 537 | if (isset($globalMapboxToken) && $globalMapboxToken != '') { |
400 | - if (!isset($_COOKIE['MapTypeId'])) $MapBoxId = 'default'; |
|
401 | - else $MapBoxId = $_COOKIE['MapTypeId']; |
|
538 | + if (!isset($_COOKIE['MapTypeId'])) { |
|
539 | + $MapBoxId = 'default'; |
|
540 | + } else { |
|
541 | + $MapBoxId = $_COOKIE['MapTypeId']; |
|
542 | + } |
|
402 | 543 | ?> |
403 | - <option value="MapboxGL"<?php if ($MapType == 'MapboxGL') print ' selected'; ?>>Mapbox GL</option> |
|
404 | - <option value="Mapbox-default"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'default') print ' selected'; ?>>Mapbox default</option> |
|
405 | - <option value="Mapbox-mapbox.streets"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets') print ' selected'; ?>>Mapbox streets</option> |
|
406 | - <option value="Mapbox-mapbox.light"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.light') print ' selected'; ?>>Mapbox light</option> |
|
407 | - <option value="Mapbox-mapbox.dark"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.dark') print ' selected'; ?>>Mapbox dark</option> |
|
408 | - <option value="Mapbox-mapbox.satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.satellite') print ' selected'; ?>>Mapbox satellite</option> |
|
409 | - <option value="Mapbox-mapbox.streets-satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-satellite') print ' selected'; ?>>Mapbox streets-satellite</option> |
|
410 | - <option value="Mapbox-mapbox.streets-basic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-basic') print ' selected'; ?>>Mapbox streets-basic</option> |
|
411 | - <option value="Mapbox-mapbox.comic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.comic') print ' selected'; ?>>Mapbox comic</option> |
|
412 | - <option value="Mapbox-mapbox.outdoors"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.outdoors') print ' selected'; ?>>Mapbox outdoors</option> |
|
413 | - <option value="Mapbox-mapbox.pencil"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pencil') print ' selected'; ?>>Mapbox pencil</option> |
|
414 | - <option value="Mapbox-mapbox.pirates"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pirates') print ' selected'; ?>>Mapbox pirates</option> |
|
415 | - <option value="Mapbox-mapbox.emerald"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.emerald') print ' selected'; ?>>Mapbox emerald</option> |
|
544 | + <option value="MapboxGL"<?php if ($MapType == 'MapboxGL') { |
|
545 | + print ' selected'; |
|
546 | +} |
|
547 | +?>>Mapbox GL</option> |
|
548 | + <option value="Mapbox-default"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'default') { |
|
549 | + print ' selected'; |
|
550 | +} |
|
551 | +?>>Mapbox default</option> |
|
552 | + <option value="Mapbox-mapbox.streets"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets') { |
|
553 | + print ' selected'; |
|
554 | +} |
|
555 | +?>>Mapbox streets</option> |
|
556 | + <option value="Mapbox-mapbox.light"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.light') { |
|
557 | + print ' selected'; |
|
558 | +} |
|
559 | +?>>Mapbox light</option> |
|
560 | + <option value="Mapbox-mapbox.dark"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.dark') { |
|
561 | + print ' selected'; |
|
562 | +} |
|
563 | +?>>Mapbox dark</option> |
|
564 | + <option value="Mapbox-mapbox.satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.satellite') { |
|
565 | + print ' selected'; |
|
566 | +} |
|
567 | +?>>Mapbox satellite</option> |
|
568 | + <option value="Mapbox-mapbox.streets-satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-satellite') { |
|
569 | + print ' selected'; |
|
570 | +} |
|
571 | +?>>Mapbox streets-satellite</option> |
|
572 | + <option value="Mapbox-mapbox.streets-basic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-basic') { |
|
573 | + print ' selected'; |
|
574 | +} |
|
575 | +?>>Mapbox streets-basic</option> |
|
576 | + <option value="Mapbox-mapbox.comic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.comic') { |
|
577 | + print ' selected'; |
|
578 | +} |
|
579 | +?>>Mapbox comic</option> |
|
580 | + <option value="Mapbox-mapbox.outdoors"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.outdoors') { |
|
581 | + print ' selected'; |
|
582 | +} |
|
583 | +?>>Mapbox outdoors</option> |
|
584 | + <option value="Mapbox-mapbox.pencil"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pencil') { |
|
585 | + print ' selected'; |
|
586 | +} |
|
587 | +?>>Mapbox pencil</option> |
|
588 | + <option value="Mapbox-mapbox.pirates"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pirates') { |
|
589 | + print ' selected'; |
|
590 | +} |
|
591 | +?>>Mapbox pirates</option> |
|
592 | + <option value="Mapbox-mapbox.emerald"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.emerald') { |
|
593 | + print ' selected'; |
|
594 | +} |
|
595 | +?>>Mapbox emerald</option> |
|
416 | 596 | <?php |
417 | 597 | } |
418 | 598 | ?> |
419 | - <option value="OpenStreetMap"<?php if ($MapType == 'OpenStreetMap') print ' selected'; ?>>OpenStreetMap</option> |
|
599 | + <option value="OpenStreetMap"<?php if ($MapType == 'OpenStreetMap') { |
|
600 | + print ' selected'; |
|
601 | +} |
|
602 | +?>>OpenStreetMap</option> |
|
420 | 603 | <?php |
421 | 604 | } |
422 | 605 | ?> |
@@ -427,10 +610,22 @@ discard block |
||
427 | 610 | ?> |
428 | 611 | <li><?php echo _("Type of Terrain:"); ?> |
429 | 612 | <select class="selectpicker" onchange="terrainType(this);"> |
430 | - <option value="stk"<?php if (!isset($_COOKIE['MapTerrain']) || $_COOKIE['MapTerrain'] == 'stk') print ' selected'; ?>>stk terrain</option> |
|
431 | - <option value="ellipsoid"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'ellipsoid') print ' selected';?>>ellipsoid</option> |
|
432 | - <option value="vrterrain"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'vrterrain') print ' selected';?>>vr terrain</option> |
|
433 | - <option value="articdem"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'articdem') print ' selected';?>>ArticDEM</option> |
|
613 | + <option value="stk"<?php if (!isset($_COOKIE['MapTerrain']) || $_COOKIE['MapTerrain'] == 'stk') { |
|
614 | + print ' selected'; |
|
615 | +} |
|
616 | +?>>stk terrain</option> |
|
617 | + <option value="ellipsoid"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'ellipsoid') { |
|
618 | + print ' selected'; |
|
619 | +} |
|
620 | +?>>ellipsoid</option> |
|
621 | + <option value="vrterrain"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'vrterrain') { |
|
622 | + print ' selected'; |
|
623 | +} |
|
624 | +?>>vr terrain</option> |
|
625 | + <option value="articdem"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'articdem') { |
|
626 | + print ' selected'; |
|
627 | +} |
|
628 | +?>>ArticDEM</option> |
|
434 | 629 | </select> |
435 | 630 | </li> |
436 | 631 | <?php |
@@ -440,59 +635,116 @@ discard block |
||
440 | 635 | <?php |
441 | 636 | if (isset($globalMap3D) && $globalMap3D) { |
442 | 637 | ?> |
443 | - <li><div class="checkbox"><label><input type="checkbox" name="synchro2d3d" value="1" onclick="clickSyncMap2D3D(this)" <?php if (isset($_COOKIE['Map2D3DSync']) && $_COOKIE['Map2D3DSync'] == 'true') print 'checked'; ?> ><?php echo _("Use same type of map for 2D & 3D"); ?></label></div></li> |
|
638 | + <li><div class="checkbox"><label><input type="checkbox" name="synchro2d3d" value="1" onclick="clickSyncMap2D3D(this)" <?php if (isset($_COOKIE['Map2D3DSync']) && $_COOKIE['Map2D3DSync'] == 'true') { |
|
639 | + print 'checked'; |
|
640 | +} |
|
641 | +?> ><?php echo _("Use same type of map for 2D & 3D"); ?></label></div></li> |
|
444 | 642 | <?php |
445 | 643 | } |
446 | 644 | ?> |
447 | 645 | <?php |
448 | 646 | if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') { |
449 | 647 | ?> |
450 | - <li><div class="checkbox"><label><input type="checkbox" name="display2dbuildings" value="1" onclick="clickDisplay2DBuildings(this)" <?php if (isset($_COOKIE['Map2DBuildings']) && $_COOKIE['Map2DBuildings'] == 'true') print 'checked'; ?> ><?php echo _("Display 2.5D buidings on map"); ?></label></div></li> |
|
648 | + <li><div class="checkbox"><label><input type="checkbox" name="display2dbuildings" value="1" onclick="clickDisplay2DBuildings(this)" <?php if (isset($_COOKIE['Map2DBuildings']) && $_COOKIE['Map2DBuildings'] == 'true') { |
|
649 | + print 'checked'; |
|
650 | +} |
|
651 | +?> ><?php echo _("Display 2.5D buidings on map"); ?></label></div></li> |
|
451 | 652 | |
452 | 653 | <?php |
453 | 654 | if (!isset($globalAircraft) || $globalAircraft === TRUE) { |
454 | 655 | ?> |
455 | - <!--<li><div class="checkbox"><label><input type="checkbox" name="flightpopup" value="1" onclick="clickFlightPopup(this)" <?php if (isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true') print 'checked'; ?> ><?php echo _("Display flight info as popup"); ?></label></div></li>--> |
|
456 | - <li><div class="checkbox"><label><input type="checkbox" name="flightpath" value="1" onclick="clickFlightPath(this)" <?php if ((isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true')) print 'checked'; ?> ><?php echo _("Display flight path"); ?></label></div></li> |
|
457 | - <li><div class="checkbox"><label><input type="checkbox" name="flightroute" value="1" onclick="clickFlightRoute(this)" <?php if ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == 'true') || (!isset($_COOKIE['MapRoute']) && isset($globalMapRoute) && $globalMapRoute)) print 'checked'; ?> ><?php echo _("Display flight route on click"); ?></label></div></li> |
|
458 | - <li><div class="checkbox"><label><input type="checkbox" name="flightremainingroute" value="1" onclick="clickFlightRemainingRoute(this)" <?php if ((isset($_COOKIE['MapRemainingRoute']) && $_COOKIE['MapRemainingRoute'] == 'true') || (!isset($_COOKIE['MapRemainingRoute']) && isset($globalMapRemainingRoute) && $globalMapRemainingRoute)) print 'checked'; ?> ><?php echo _("Display flight remaining route on click"); ?></label></div></li> |
|
459 | - <li><div class="checkbox"><label><input type="checkbox" name="flightestimation" value="1" onclick="clickFlightEstimation(this)" <?php if ((isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'true') || (!isset($_COOKIE['flightestimation']) && !isset($globalMapEstimation)) || (!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation)) print 'checked'; ?> ><?php echo _("Planes animate between updates"); ?></label></div></li> |
|
656 | + <!--<li><div class="checkbox"><label><input type="checkbox" name="flightpopup" value="1" onclick="clickFlightPopup(this)" <?php if (isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true') { |
|
657 | + print 'checked'; |
|
658 | +} |
|
659 | +?> ><?php echo _("Display flight info as popup"); ?></label></div></li>--> |
|
660 | + <li><div class="checkbox"><label><input type="checkbox" name="flightpath" value="1" onclick="clickFlightPath(this)" <?php if ((isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true')) { |
|
661 | + print 'checked'; |
|
662 | +} |
|
663 | +?> ><?php echo _("Display flight path"); ?></label></div></li> |
|
664 | + <li><div class="checkbox"><label><input type="checkbox" name="flightroute" value="1" onclick="clickFlightRoute(this)" <?php if ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == 'true') || (!isset($_COOKIE['MapRoute']) && isset($globalMapRoute) && $globalMapRoute)) { |
|
665 | + print 'checked'; |
|
666 | +} |
|
667 | +?> ><?php echo _("Display flight route on click"); ?></label></div></li> |
|
668 | + <li><div class="checkbox"><label><input type="checkbox" name="flightremainingroute" value="1" onclick="clickFlightRemainingRoute(this)" <?php if ((isset($_COOKIE['MapRemainingRoute']) && $_COOKIE['MapRemainingRoute'] == 'true') || (!isset($_COOKIE['MapRemainingRoute']) && isset($globalMapRemainingRoute) && $globalMapRemainingRoute)) { |
|
669 | + print 'checked'; |
|
670 | +} |
|
671 | +?> ><?php echo _("Display flight remaining route on click"); ?></label></div></li> |
|
672 | + <li><div class="checkbox"><label><input type="checkbox" name="flightestimation" value="1" onclick="clickFlightEstimation(this)" <?php if ((isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'true') || (!isset($_COOKIE['flightestimation']) && !isset($globalMapEstimation)) || (!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation)) { |
|
673 | + print 'checked'; |
|
674 | +} |
|
675 | +?> ><?php echo _("Planes animate between updates"); ?></label></div></li> |
|
460 | 676 | <?php |
461 | 677 | } elseif (!isset($globalTracker) || $globalTracker === TRUE) { |
462 | 678 | ?> |
463 | - <li><div class="checkbox"><label><input type="checkbox" name="mapmatching" value="1" onclick="clickMapMatching(this)" <?php if ((isset($_COOKIE['mapmatching']) && $_COOKIE['mapmatching'] == 'true') || (!isset($_COOKIE['mapmatching']) && isset($globalMapMatching) && $globalMapMatching)) print 'checked'; ?> ><?php echo _("Enable map matching"); ?></label></div></li> |
|
679 | + <li><div class="checkbox"><label><input type="checkbox" name="mapmatching" value="1" onclick="clickMapMatching(this)" <?php if ((isset($_COOKIE['mapmatching']) && $_COOKIE['mapmatching'] == 'true') || (!isset($_COOKIE['mapmatching']) && isset($globalMapMatching) && $globalMapMatching)) { |
|
680 | + print 'checked'; |
|
681 | +} |
|
682 | +?> ><?php echo _("Enable map matching"); ?></label></div></li> |
|
464 | 683 | <?php |
465 | 684 | } |
466 | 685 | if (isset($globalSatellite) && $globalSatellite === TRUE) { |
467 | 686 | ?> |
468 | - <li><div class="checkbox"><label><input type="checkbox" name="satelliteestimation" value="1" onclick="clickSatelliteEstimation(this)" <?php if ((isset($_COOKIE['satelliteestimation']) && $_COOKIE['satelliteestimation'] == 'true') || (!isset($_COOKIE['satelliteestimation']) && !isset($globalMapEstimation)) || (!isset($_COOKIE['satelliteestimation']) && isset($globalMapEstimation) && $globalMapEstimation)) print 'checked'; ?> ><?php echo _("Satellites animate between updates"); ?></label></div></li> |
|
687 | + <li><div class="checkbox"><label><input type="checkbox" name="satelliteestimation" value="1" onclick="clickSatelliteEstimation(this)" <?php if ((isset($_COOKIE['satelliteestimation']) && $_COOKIE['satelliteestimation'] == 'true') || (!isset($_COOKIE['satelliteestimation']) && !isset($globalMapEstimation)) || (!isset($_COOKIE['satelliteestimation']) && isset($globalMapEstimation) && $globalMapEstimation)) { |
|
688 | + print 'checked'; |
|
689 | +} |
|
690 | +?> ><?php echo _("Satellites animate between updates"); ?></label></div></li> |
|
469 | 691 | <?php |
470 | 692 | } |
471 | 693 | } |
472 | 694 | ?> |
473 | - <li><div class="checkbox"><label><input type="checkbox" name="displayairports" value="1" onclick="clickDisplayAirports(this)" <?php if (isset($_COOKIE['displayairports']) && $_COOKIE['displayairports'] == 'true' || !isset($_COOKIE['displayairports'])) print 'checked'; ?> ><?php echo _("Display airports on map"); ?></label></div></li> |
|
474 | - <li><div class="checkbox"><label><input type="checkbox" name="displaygroundstation" value="1" onclick="clickDisplayGroundStation(this)" <?php if ((isset($_COOKIE['show_GroundStation']) && $_COOKIE['show_GroundStation'] == 'true') || (!isset($_COOKIE['show_GroundStation']) && (isset($globalMapGroundStation) && $globalMapGroundStation === TRUE))) print 'checked'; ?> ><?php echo _("Display ground station on map"); ?></label></div></li> |
|
475 | - <li><div class="checkbox"><label><input type="checkbox" name="displayweatherstation" value="1" onclick="clickDisplayWeatherStation(this)" <?php if ((isset($_COOKIE['show_WeatherStation']) && $_COOKIE['show_WeatherStation'] == 'true') || (!isset($_COOKIE['show_WeatherStation']) && (isset($globalMapWeatherStation) && $globalMapWeatherStation === TRUE))) print 'checked'; ?> ><?php echo _("Display weather station on map"); ?></label></div></li> |
|
476 | - <li><div class="checkbox"><label><input type="checkbox" name="displaylightning" value="1" onclick="clickDisplayLightning(this)" <?php if ((isset($_COOKIE['show_Lightning']) && $_COOKIE['show_Lightning'] == 'true') || (!isset($_COOKIE['show_Lightning']) && (isset($globalMapLightning) && $globalMapLightning === TRUE))) print 'checked'; ?> ><?php echo _("Display lightning on map"); ?></label></div></li> |
|
695 | + <li><div class="checkbox"><label><input type="checkbox" name="displayairports" value="1" onclick="clickDisplayAirports(this)" <?php if (isset($_COOKIE['displayairports']) && $_COOKIE['displayairports'] == 'true' || !isset($_COOKIE['displayairports'])) { |
|
696 | + print 'checked'; |
|
697 | +} |
|
698 | +?> ><?php echo _("Display airports on map"); ?></label></div></li> |
|
699 | + <li><div class="checkbox"><label><input type="checkbox" name="displaygroundstation" value="1" onclick="clickDisplayGroundStation(this)" <?php if ((isset($_COOKIE['show_GroundStation']) && $_COOKIE['show_GroundStation'] == 'true') || (!isset($_COOKIE['show_GroundStation']) && (isset($globalMapGroundStation) && $globalMapGroundStation === TRUE))) { |
|
700 | + print 'checked'; |
|
701 | +} |
|
702 | +?> ><?php echo _("Display ground station on map"); ?></label></div></li> |
|
703 | + <li><div class="checkbox"><label><input type="checkbox" name="displayweatherstation" value="1" onclick="clickDisplayWeatherStation(this)" <?php if ((isset($_COOKIE['show_WeatherStation']) && $_COOKIE['show_WeatherStation'] == 'true') || (!isset($_COOKIE['show_WeatherStation']) && (isset($globalMapWeatherStation) && $globalMapWeatherStation === TRUE))) { |
|
704 | + print 'checked'; |
|
705 | +} |
|
706 | +?> ><?php echo _("Display weather station on map"); ?></label></div></li> |
|
707 | + <li><div class="checkbox"><label><input type="checkbox" name="displaylightning" value="1" onclick="clickDisplayLightning(this)" <?php if ((isset($_COOKIE['show_Lightning']) && $_COOKIE['show_Lightning'] == 'true') || (!isset($_COOKIE['show_Lightning']) && (isset($globalMapLightning) && $globalMapLightning === TRUE))) { |
|
708 | + print 'checked'; |
|
709 | +} |
|
710 | +?> ><?php echo _("Display lightning on map"); ?></label></div></li> |
|
477 | 711 | <?php |
478 | 712 | if (isset($globalFires)) { |
479 | 713 | ?> |
480 | - <li><div class="checkbox"><label><input type="checkbox" name="displayfires" value="1" onclick="clickDisplayFires(this)" <?php if ((isset($_COOKIE['show_Fires']) && $_COOKIE['show_Fires'] == 'true') || (!isset($_COOKIE['show_Fires']) && (isset($globalMapFires) && $globalMapFires === TRUE))) print 'checked'; ?> ><?php echo _("Display fires on map"); ?></label></div></li> |
|
714 | + <li><div class="checkbox"><label><input type="checkbox" name="displayfires" value="1" onclick="clickDisplayFires(this)" <?php if ((isset($_COOKIE['show_Fires']) && $_COOKIE['show_Fires'] == 'true') || (!isset($_COOKIE['show_Fires']) && (isset($globalMapFires) && $globalMapFires === TRUE))) { |
|
715 | + print 'checked'; |
|
716 | +} |
|
717 | +?> ><?php echo _("Display fires on map"); ?></label></div></li> |
|
481 | 718 | <?php |
482 | 719 | } |
483 | 720 | if (isset($globalMap3D) && $globalMap3D) { |
484 | 721 | ?> |
485 | - <li><div class="checkbox"><label><input type="checkbox" name="singlemodel" value="1" onclick="clickSingleModel(this)" <?php if ((isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') || (!isset($_COOKIE['singlemodel']) && isset($globalMap3DSelected) && $globalMap3DSelected)) print 'checked'; ?> ><?php echo _("Only display selected flight on 3D mode"); ?></label></div></li> |
|
722 | + <li><div class="checkbox"><label><input type="checkbox" name="singlemodel" value="1" onclick="clickSingleModel(this)" <?php if ((isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') || (!isset($_COOKIE['singlemodel']) && isset($globalMap3DSelected) && $globalMap3DSelected)) { |
|
723 | + print 'checked'; |
|
724 | +} |
|
725 | +?> ><?php echo _("Only display selected flight on 3D mode"); ?></label></div></li> |
|
486 | 726 | <?php |
487 | 727 | } |
488 | 728 | ?> |
489 | 729 | <?php |
490 | 730 | if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') { |
491 | 731 | ?> |
492 | - <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> |
|
493 | - <li><div class="checkbox"><label><input type="checkbox" name="shadows" value="1" onclick="clickShadows(this)" <?php if ((!isset($_COOKIE['map3dnoshadows']) && (!isset($globalMap3DShadows) || $globalMap3DShadows)) || (isset($_COOKIE['map3dnoshadows']) && $_COOKIE['map3dnoshadows'] == 'false')) print 'checked'; ?> ><?php echo _("Use shadows"); ?></label></div></li> |
|
494 | - <li><div class="checkbox"><label><input type="checkbox" name="one3dmodel" value="1" onclick="useOne3Dmodel(this)" <?php if ((isset($_COOKIE['one3dmodel']) && $_COOKIE['one3dmodel'] == 'true') || (!isset($_COOKIE['one3dmodel']) && isset($globalMap3DOneModel) && $globalMap3DOneModel)) print 'checked'; ?> ><?php echo _("Use same 3D model for all aircraft (use fewer resources)"); ?></label></div></li> |
|
495 | - <li><div class="checkbox"><label><input type="checkbox" name="updaterealtime" value="1" onclick="clickUpdateRealtime(this)" <?php if ((isset($_COOKIE['updaterealtime']) && $_COOKIE['updaterealtime'] == 'true') || !isset($_COOKIE['updaterealtime'])) print 'checked'; ?> ><?php echo _("Display realtime data in infobox"); ?></label></div></li> |
|
732 | + <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')) { |
|
733 | + print 'checked'; |
|
734 | +} |
|
735 | +?> ><?php echo _("Show mini-map"); ?></label></div></li> |
|
736 | + <li><div class="checkbox"><label><input type="checkbox" name="shadows" value="1" onclick="clickShadows(this)" <?php if ((!isset($_COOKIE['map3dnoshadows']) && (!isset($globalMap3DShadows) || $globalMap3DShadows)) || (isset($_COOKIE['map3dnoshadows']) && $_COOKIE['map3dnoshadows'] == 'false')) { |
|
737 | + print 'checked'; |
|
738 | +} |
|
739 | +?> ><?php echo _("Use shadows"); ?></label></div></li> |
|
740 | + <li><div class="checkbox"><label><input type="checkbox" name="one3dmodel" value="1" onclick="useOne3Dmodel(this)" <?php if ((isset($_COOKIE['one3dmodel']) && $_COOKIE['one3dmodel'] == 'true') || (!isset($_COOKIE['one3dmodel']) && isset($globalMap3DOneModel) && $globalMap3DOneModel)) { |
|
741 | + print 'checked'; |
|
742 | +} |
|
743 | +?> ><?php echo _("Use same 3D model for all aircraft (use fewer resources)"); ?></label></div></li> |
|
744 | + <li><div class="checkbox"><label><input type="checkbox" name="updaterealtime" value="1" onclick="clickUpdateRealtime(this)" <?php if ((isset($_COOKIE['updaterealtime']) && $_COOKIE['updaterealtime'] == 'true') || !isset($_COOKIE['updaterealtime'])) { |
|
745 | + print 'checked'; |
|
746 | +} |
|
747 | +?> ><?php echo _("Display realtime data in infobox"); ?></label></div></li> |
|
496 | 748 | <?php |
497 | 749 | } |
498 | 750 | if (time() > mktime(0,0,0,12,1,date("Y")) && time() < mktime(0,0,0,12,31,date("Y"))) { |
@@ -505,17 +757,25 @@ discard block |
||
505 | 757 | if (function_exists('array_column')) { |
506 | 758 | if (array_search(TRUE, array_column($globalSources, 'sourcestats')) !== FALSE) { |
507 | 759 | ?> |
508 | - <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) print 'checked'; ?> ><?php echo _("Display polar on map"); ?></label></div></li> |
|
760 | + <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) { |
|
761 | + print 'checked'; |
|
762 | +} |
|
763 | +?> ><?php echo _("Display polar on map"); ?></label></div></li> |
|
509 | 764 | <?php |
510 | 765 | } |
511 | 766 | } elseif (isset($globalSources)) { |
512 | 767 | $dispolar = false; |
513 | 768 | foreach ($globalSources as $testsource) { |
514 | - if (isset($globalSources['sourcestats']) && $globalSources['sourcestats'] !== FALSE) $dispolar = true; |
|
769 | + if (isset($globalSources['sourcestats']) && $globalSources['sourcestats'] !== FALSE) { |
|
770 | + $dispolar = true; |
|
771 | + } |
|
515 | 772 | } |
516 | 773 | if ($dispolar) { |
517 | 774 | ?> |
518 | - <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) print 'checked'; ?> ><?php echo _("Display polar on map"); ?></label></div></li> |
|
775 | + <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) { |
|
776 | + print 'checked'; |
|
777 | +} |
|
778 | +?> ><?php echo _("Display polar on map"); ?></label></div></li> |
|
519 | 779 | <?php |
520 | 780 | } |
521 | 781 | } |
@@ -528,11 +788,21 @@ discard block |
||
528 | 788 | if (!isset($globalAircraft) || $globalAircraft === TRUE) { |
529 | 789 | if (extension_loaded('gd') && function_exists('gd_info')) { |
530 | 790 | ?> |
531 | - <li><input type="checkbox" name="aircraftcoloraltitude" value="1" onclick="iconColorAltitude(this)" <?php if (isset($_COOKIE['IconColorAltitude']) && $_COOKIE['IconColorAltitude'] == 'true') print 'checked'; ?> ><?php echo _("Aircraft icon color based on altitude"); ?></li> |
|
791 | + <li><input type="checkbox" name="aircraftcoloraltitude" value="1" onclick="iconColorAltitude(this)" <?php if (isset($_COOKIE['IconColorAltitude']) && $_COOKIE['IconColorAltitude'] == 'true') { |
|
792 | + print 'checked'; |
|
793 | +} |
|
794 | +?> ><?php echo _("Aircraft icon color based on altitude"); ?></li> |
|
532 | 795 | <?php |
533 | 796 | if (!isset($_COOKIE['IconColorAltitude']) || $_COOKIE['IconColorAltitude'] == 'false') { |
534 | 797 | ?> |
535 | - <li><?php echo _("Aircraft icon color:"); ?><input type="color" name="aircraftcolor" id="html5colorpicker" onchange="iconColor(aircraftcolor.value);" value="#<?php if (isset($_COOKIE['IconColor'])) print $_COOKIE['IconColor']; elseif (isset($globalAircraftIconColor)) print $globalAircraftIconColor; else print '1a3151'; ?>"></li> |
|
798 | + <li><?php echo _("Aircraft icon color:"); ?><input type="color" name="aircraftcolor" id="html5colorpicker" onchange="iconColor(aircraftcolor.value);" value="#<?php if (isset($_COOKIE['IconColor'])) { |
|
799 | + print $_COOKIE['IconColor']; |
|
800 | +} elseif (isset($globalAircraftIconColor)) { |
|
801 | + print $globalAircraftIconColor; |
|
802 | +} else { |
|
803 | + print '1a3151'; |
|
804 | +} |
|
805 | +?>"></li> |
|
536 | 806 | <?php |
537 | 807 | } |
538 | 808 | } |
@@ -543,7 +813,14 @@ discard block |
||
543 | 813 | if (extension_loaded('gd') && function_exists('gd_info')) { |
544 | 814 | ?> |
545 | 815 | <li><?php echo _("Marine icon color:"); ?> |
546 | - <input type="color" name="marinecolor" id="html5colorpicker" onchange="MarineiconColor(marinecolor.value);" value="#<?php if (isset($_COOKIE['MarineIconColor'])) print $_COOKIE['MarineIconColor']; elseif (isset($globalMarineIconColor)) print $globalMarineIconColor; else print '1a3151'; ?>"> |
|
816 | + <input type="color" name="marinecolor" id="html5colorpicker" onchange="MarineiconColor(marinecolor.value);" value="#<?php if (isset($_COOKIE['MarineIconColor'])) { |
|
817 | + print $_COOKIE['MarineIconColor']; |
|
818 | +} elseif (isset($globalMarineIconColor)) { |
|
819 | + print $globalMarineIconColor; |
|
820 | +} else { |
|
821 | + print '1a3151'; |
|
822 | +} |
|
823 | +?>"> |
|
547 | 824 | </li> |
548 | 825 | <?php |
549 | 826 | } |
@@ -554,7 +831,14 @@ discard block |
||
554 | 831 | if (extension_loaded('gd') && function_exists('gd_info')) { |
555 | 832 | ?> |
556 | 833 | <li><?php echo _("Tracker icon color:"); ?> |
557 | - <input type="color" name="trackercolor" id="html5colorpicker" onchange="TrackericonColor(trackercolor.value);" value="#<?php if (isset($_COOKIE['TrackerIconColor'])) print $_COOKIE['TrackerIconColor']; elseif (isset($globalTrackerIconColor)) print $globalTrackerIconColor; else print '1a3151'; ?>"> |
|
834 | + <input type="color" name="trackercolor" id="html5colorpicker" onchange="TrackericonColor(trackercolor.value);" value="#<?php if (isset($_COOKIE['TrackerIconColor'])) { |
|
835 | + print $_COOKIE['TrackerIconColor']; |
|
836 | +} elseif (isset($globalTrackerIconColor)) { |
|
837 | + print $globalTrackerIconColor; |
|
838 | +} else { |
|
839 | + print '1a3151'; |
|
840 | +} |
|
841 | +?>"> |
|
558 | 842 | </li> |
559 | 843 | <?php |
560 | 844 | } |
@@ -565,8 +849,22 @@ discard block |
||
565 | 849 | ?> |
566 | 850 | <li><?php echo _("Show airport icon at zoom level:"); ?> |
567 | 851 | <div class="range"> |
568 | - <input type="range" min="0" max="19" step="1" name="airportzoom" onchange="range.value=value;airportDisplayZoom(airportzoom.value);" value="<?php if (isset($_COOKIE['AirportZoom'])) print $_COOKIE['AirportZoom']; elseif (isset($globalAirportZoom)) print $globalAirportZoom; else print '7'; ?>"> |
|
569 | - <output id="range"><?php if (isset($_COOKIE['AirportZoom'])) print $_COOKIE['AirportZoom']; elseif (isset($globalAirportZoom)) print $globalAirportZoom; else print '7'; ?></output> |
|
852 | + <input type="range" min="0" max="19" step="1" name="airportzoom" onchange="range.value=value;airportDisplayZoom(airportzoom.value);" value="<?php if (isset($_COOKIE['AirportZoom'])) { |
|
853 | + print $_COOKIE['AirportZoom']; |
|
854 | +} elseif (isset($globalAirportZoom)) { |
|
855 | + print $globalAirportZoom; |
|
856 | +} else { |
|
857 | + print '7'; |
|
858 | +} |
|
859 | +?>"> |
|
860 | + <output id="range"><?php if (isset($_COOKIE['AirportZoom'])) { |
|
861 | + print $_COOKIE['AirportZoom']; |
|
862 | +} elseif (isset($globalAirportZoom)) { |
|
863 | + print $globalAirportZoom; |
|
864 | +} else { |
|
865 | + print '7'; |
|
866 | +} |
|
867 | +?></output> |
|
570 | 868 | </div> |
571 | 869 | </li> |
572 | 870 | <?php |
@@ -577,17 +875,40 @@ discard block |
||
577 | 875 | ?> |
578 | 876 | <li><?php echo _("Set scaling factor for rendering resolution:"); ?> |
579 | 877 | <div class="range"> |
580 | - <input type="range" min="0.5" max="2" step="0.5" name="resolutionscale" onchange="scale.value=value;resolutionScale(resolutionscale.value);" value="<?php if (isset($_COOKIE['resolutionScale'])) print $_COOKIE['resolutionScale']; else print '1'; ?>"> |
|
581 | - <output id="scale"><?php if (isset($_COOKIE['resolutionScale'])) print $_COOKIE['resolutionScale']; else print '1'; ?></output> |
|
878 | + <input type="range" min="0.5" max="2" step="0.5" name="resolutionscale" onchange="scale.value=value;resolutionScale(resolutionscale.value);" value="<?php if (isset($_COOKIE['resolutionScale'])) { |
|
879 | + print $_COOKIE['resolutionScale']; |
|
880 | +} else { |
|
881 | + print '1'; |
|
882 | +} |
|
883 | +?>"> |
|
884 | + <output id="scale"><?php if (isset($_COOKIE['resolutionScale'])) { |
|
885 | + print $_COOKIE['resolutionScale']; |
|
886 | +} else { |
|
887 | + print '1'; |
|
888 | +} |
|
889 | +?></output> |
|
582 | 890 | </div> |
583 | 891 | </li> |
584 | 892 | <?php |
585 | 893 | if (!isset($globalAircraft) || $globalAircraft === TRUE) { |
586 | 894 | ?> |
587 | - <li><input type="checkbox" name="useliveries" value="1" onclick="useLiveries(this)" <?php if (isset($_COOKIE['UseLiveries']) && $_COOKIE['UseLiveries'] == 'true') print 'checked'; ?> > <?php echo _("Use airlines liveries"); ?></li> |
|
588 | - <li><input type="checkbox" name="aircraftcolorforce" value="1" onclick="iconColorForce(this)" <?php if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true') print 'checked'; ?> > <?php echo _("Force Aircraft color"); ?> |
|
895 | + <li><input type="checkbox" name="useliveries" value="1" onclick="useLiveries(this)" <?php if (isset($_COOKIE['UseLiveries']) && $_COOKIE['UseLiveries'] == 'true') { |
|
896 | + print 'checked'; |
|
897 | +} |
|
898 | +?> > <?php echo _("Use airlines liveries"); ?></li> |
|
899 | + <li><input type="checkbox" name="aircraftcolorforce" value="1" onclick="iconColorForce(this)" <?php if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true') { |
|
900 | + print 'checked'; |
|
901 | +} |
|
902 | +?> > <?php echo _("Force Aircraft color"); ?> |
|
589 | 903 | <!--<li><?php echo _("Aircraft icon color:"); ?>--> |
590 | - <input type="color" name="aircraftcolor" id="html5colorpicker" onchange="iconColor(aircraftcolor.value);" value="#<?php if (isset($_COOKIE['IconColor'])) print $_COOKIE['IconColor']; elseif (isset($globalAircraftIconColor)) print $globalAircraftIconColor; else print 'ff0000'; ?>"> |
|
904 | + <input type="color" name="aircraftcolor" id="html5colorpicker" onchange="iconColor(aircraftcolor.value);" value="#<?php if (isset($_COOKIE['IconColor'])) { |
|
905 | + print $_COOKIE['IconColor']; |
|
906 | +} elseif (isset($globalAircraftIconColor)) { |
|
907 | + print $globalAircraftIconColor; |
|
908 | +} else { |
|
909 | + print 'ff0000'; |
|
910 | +} |
|
911 | +?>"> |
|
591 | 912 | </li> |
592 | 913 | <?php |
593 | 914 | } |
@@ -595,9 +916,19 @@ discard block |
||
595 | 916 | <?php |
596 | 917 | if (isset($globalMarine) && $globalMarine === TRUE) { |
597 | 918 | ?> |
598 | - <li><input type="checkbox" name="marinecolorforce" value="1" onclick="MarineiconColorForce(this)" <?php if (isset($_COOKIE['MarineIconColorForce']) && $_COOKIE['MarineIconColorForce'] == 'true') print 'checked'; ?> ><?php echo _("Force Marine color"); ?> |
|
919 | + <li><input type="checkbox" name="marinecolorforce" value="1" onclick="MarineiconColorForce(this)" <?php if (isset($_COOKIE['MarineIconColorForce']) && $_COOKIE['MarineIconColorForce'] == 'true') { |
|
920 | + print 'checked'; |
|
921 | +} |
|
922 | +?> ><?php echo _("Force Marine color"); ?> |
|
599 | 923 | <!--<li><?php echo _("Marine icon color:"); ?>--> |
600 | - <input type="color" name="marinecolor" id="html5colorpicker" onchange="MarineiconColor(marinecolor.value);" value="#<?php if (isset($_COOKIE['MarineIconColor'])) print $_COOKIE['MarineIconColor']; elseif (isset($globalMarineIconColor)) print $globalMarineIconColor; else print 'ff0000'; ?>"> |
|
924 | + <input type="color" name="marinecolor" id="html5colorpicker" onchange="MarineiconColor(marinecolor.value);" value="#<?php if (isset($_COOKIE['MarineIconColor'])) { |
|
925 | + print $_COOKIE['MarineIconColor']; |
|
926 | +} elseif (isset($globalMarineIconColor)) { |
|
927 | + print $globalMarineIconColor; |
|
928 | +} else { |
|
929 | + print 'ff0000'; |
|
930 | +} |
|
931 | +?>"> |
|
601 | 932 | </li> |
602 | 933 | <?php |
603 | 934 | } |
@@ -605,9 +936,19 @@ discard block |
||
605 | 936 | <?php |
606 | 937 | if (isset($globalTracker) && $globalTracker === TRUE) { |
607 | 938 | ?> |
608 | - <li><input type="checkbox" name="trackercolorforce" value="1" onclick="TrackericonColorForce(this)" <?php if (isset($_COOKIE['TrackerIconColorForce']) && $_COOKIE['TrackerIconColorForce'] == 'true') print 'checked'; ?> ><?php echo _("Force Tracker color"); ?> |
|
939 | + <li><input type="checkbox" name="trackercolorforce" value="1" onclick="TrackericonColorForce(this)" <?php if (isset($_COOKIE['TrackerIconColorForce']) && $_COOKIE['TrackerIconColorForce'] == 'true') { |
|
940 | + print 'checked'; |
|
941 | +} |
|
942 | +?> ><?php echo _("Force Tracker color"); ?> |
|
609 | 943 | <!--<li><?php echo _("Tracker icon color:"); ?>--> |
610 | - <input type="color" name="trackercolor" id="html5colorpicker" onchange="TrackericonColor(trackercolor.value);" value="#<?php if (isset($_COOKIE['TrackerIconColor'])) print $_COOKIE['TrackerIconColor']; elseif (isset($globalTrackerIconColor)) print $globalTrackerIconColor; else print 'ff0000'; ?>"> |
|
944 | + <input type="color" name="trackercolor" id="html5colorpicker" onchange="TrackericonColor(trackercolor.value);" value="#<?php if (isset($_COOKIE['TrackerIconColor'])) { |
|
945 | + print $_COOKIE['TrackerIconColor']; |
|
946 | +} elseif (isset($globalTrackerIconColor)) { |
|
947 | + print $globalTrackerIconColor; |
|
948 | +} else { |
|
949 | + print 'ff0000'; |
|
950 | +} |
|
951 | +?>"> |
|
611 | 952 | </li> |
612 | 953 | <?php |
613 | 954 | } |
@@ -615,22 +956,46 @@ discard block |
||
615 | 956 | ?> |
616 | 957 | <li><?php echo _("Distance unit:"); ?> |
617 | 958 | <select class="selectpicker" onchange="unitdistance(this);"> |
618 | - <option value="km"<?php if ((!isset($_COOKIE['unitdistance']) && (!isset($globalUnitDistance) || (isset($globalUnitDistance) && $globalUnitDistance == 'km'))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) echo ' selected'; ?>>km</option> |
|
619 | - <option value="nm"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) echo ' selected'; ?>>nm</option> |
|
620 | - <option value="mi"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) echo ' selected'; ?>>mi</option> |
|
959 | + <option value="km"<?php if ((!isset($_COOKIE['unitdistance']) && (!isset($globalUnitDistance) || (isset($globalUnitDistance) && $globalUnitDistance == 'km'))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) { |
|
960 | + echo ' selected'; |
|
961 | +} |
|
962 | +?>>km</option> |
|
963 | + <option value="nm"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
|
964 | + echo ' selected'; |
|
965 | +} |
|
966 | +?>>nm</option> |
|
967 | + <option value="mi"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
|
968 | + echo ' selected'; |
|
969 | +} |
|
970 | +?>>mi</option> |
|
621 | 971 | </select> |
622 | 972 | </li> |
623 | 973 | <li><?php echo _("Altitude unit:"); ?> |
624 | 974 | <select class="selectpicker" onchange="unitaltitude(this);"> |
625 | - <option value="m"<?php if ((!isset($_COOKIE['unitaltitude']) && (!isset($globalUnitAltitude) || (isset($globalUnitAltitude) && $globalUnitAltitude == 'm'))) || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'm')) echo ' selected'; ?>>m</option> |
|
626 | - <option value="feet"<?php if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) echo ' selected'; ?>>feet</option> |
|
975 | + <option value="m"<?php if ((!isset($_COOKIE['unitaltitude']) && (!isset($globalUnitAltitude) || (isset($globalUnitAltitude) && $globalUnitAltitude == 'm'))) || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'm')) { |
|
976 | + echo ' selected'; |
|
977 | +} |
|
978 | +?>>m</option> |
|
979 | + <option value="feet"<?php if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) { |
|
980 | + echo ' selected'; |
|
981 | +} |
|
982 | +?>>feet</option> |
|
627 | 983 | </select> |
628 | 984 | </li> |
629 | 985 | <li><?php echo _("Speed unit:"); ?> |
630 | 986 | <select class="selectpicker" onchange="unitspeed(this);"> |
631 | - <option value="kmh"<?php if ((!isset($_COOKIE['unitspeed']) && (!isset($globalUnitSpeed) || (isset($globalUnitSpeed) && $globalUnitSpeed == 'kmh'))) || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'kmh')) echo ' selected'; ?>>km/h</option> |
|
632 | - <option value="mph"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'mph') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'mph')) echo ' selected'; ?>>mph</option> |
|
633 | - <option value="knots"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'knots') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'knots')) echo ' selected'; ?>>knots</option> |
|
987 | + <option value="kmh"<?php if ((!isset($_COOKIE['unitspeed']) && (!isset($globalUnitSpeed) || (isset($globalUnitSpeed) && $globalUnitSpeed == 'kmh'))) || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'kmh')) { |
|
988 | + echo ' selected'; |
|
989 | +} |
|
990 | +?>>km/h</option> |
|
991 | + <option value="mph"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'mph') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'mph')) { |
|
992 | + echo ' selected'; |
|
993 | +} |
|
994 | +?>>mph</option> |
|
995 | + <option value="knots"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'knots') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'knots')) { |
|
996 | + echo ' selected'; |
|
997 | +} |
|
998 | +?>>knots</option> |
|
634 | 999 | </select> |
635 | 1000 | </li> |
636 | 1001 | |
@@ -648,9 +1013,18 @@ discard block |
||
648 | 1013 | <?php |
649 | 1014 | if (((isset($globalVATSIM) && $globalVATSIM) || isset($globalIVAO) && $globalIVAO || isset($globalphpVMS) && $globalphpVMS) && (!isset($globalMapVAchoose) || $globalMapVAchoose)) { |
650 | 1015 | ?> |
651 | - <?php if (isset($globalVATSIM) && $globalVATSIM) { ?><li><input type="checkbox" name="vatsim" value="1" onclick="clickVATSIM(this)" <?php if ((isset($_COOKIE['ShowVATSIM']) && $_COOKIE['ShowVATSIM'] == 'true') || !isset($_COOKIE['ShowVATSIM'])) print 'checked'; ?> ><?php echo _("Display VATSIM data"); ?></li><?php } ?> |
|
652 | - <?php if (isset($globalIVAO) && $globalIVAO) { ?><li><input type="checkbox" name="ivao" value="1" onclick="clickIVAO(this)" <?php if ((isset($_COOKIE['ShowIVAO']) && $_COOKIE['ShowIVAO'] == 'true') || !isset($_COOKIE['ShowIVAO'])) print 'checked'; ?> ><?php echo _("Display IVAO data"); ?></li><?php } ?> |
|
653 | - <?php if (isset($globalphpVMS) && $globalphpVMS) { ?><li><input type="checkbox" name="phpvms" value="1" onclick="clickphpVMS(this)" <?php if ((isset($_COOKIE['ShowVMS']) && $_COOKIE['ShowVMS'] == 'true') || !isset($_COOKIE['ShowVMS'])) print 'checked'; ?> ><?php echo _("Display phpVMS data"); ?></li><?php } ?> |
|
1016 | + <?php if (isset($globalVATSIM) && $globalVATSIM) { ?><li><input type="checkbox" name="vatsim" value="1" onclick="clickVATSIM(this)" <?php if ((isset($_COOKIE['ShowVATSIM']) && $_COOKIE['ShowVATSIM'] == 'true') || !isset($_COOKIE['ShowVATSIM'])) { |
|
1017 | + print 'checked'; |
|
1018 | +} |
|
1019 | +?> ><?php echo _("Display VATSIM data"); ?></li><?php } ?> |
|
1020 | + <?php if (isset($globalIVAO) && $globalIVAO) { ?><li><input type="checkbox" name="ivao" value="1" onclick="clickIVAO(this)" <?php if ((isset($_COOKIE['ShowIVAO']) && $_COOKIE['ShowIVAO'] == 'true') || !isset($_COOKIE['ShowIVAO'])) { |
|
1021 | + print 'checked'; |
|
1022 | +} |
|
1023 | +?> ><?php echo _("Display IVAO data"); ?></li><?php } ?> |
|
1024 | + <?php if (isset($globalphpVMS) && $globalphpVMS) { ?><li><input type="checkbox" name="phpvms" value="1" onclick="clickphpVMS(this)" <?php if ((isset($_COOKIE['ShowVMS']) && $_COOKIE['ShowVMS'] == 'true') || !isset($_COOKIE['ShowVMS'])) { |
|
1025 | + print 'checked'; |
|
1026 | +} |
|
1027 | +?> ><?php echo _("Display phpVMS data"); ?></li><?php } ?> |
|
654 | 1028 | <?php |
655 | 1029 | } |
656 | 1030 | ?> |
@@ -658,10 +1032,16 @@ discard block |
||
658 | 1032 | if (!(isset($globalVA) && $globalVA) && !(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalIVAO) && $globalIVAO) && !(isset($globalphpVMS) && $globalphpVMS) && isset($globalSBS1) && $globalSBS1 && isset($globalAPRS) && $globalAPRS && (!isset($globalMapchoose) || $globalMapchoose)) { |
659 | 1033 | ?> |
660 | 1034 | <?php if (isset($globalSBS1) && $globalSBS1) { ?> |
661 | - <li><div class="checkbox"><label><input type="checkbox" name="sbs" value="1" onclick="clickSBS1(this)" <?php if ((isset($_COOKIE['ShowSBS1']) && $_COOKIE['ShowSBS1'] == 'true') || !isset($_COOKIE['ShowSBS1'])) print 'checked'; ?> ><?php echo _("Display ADS-B data"); ?></label></div></li> |
|
1035 | + <li><div class="checkbox"><label><input type="checkbox" name="sbs" value="1" onclick="clickSBS1(this)" <?php if ((isset($_COOKIE['ShowSBS1']) && $_COOKIE['ShowSBS1'] == 'true') || !isset($_COOKIE['ShowSBS1'])) { |
|
1036 | + print 'checked'; |
|
1037 | +} |
|
1038 | +?> ><?php echo _("Display ADS-B data"); ?></label></div></li> |
|
662 | 1039 | <?php } ?> |
663 | 1040 | <?php if (isset($globalAPRS) && $globalAPRS) { ?> |
664 | - <li><div class="checkbox"><label><input type="checkbox" name="aprs" value="1" onclick="clickAPRS(this)" <?php if ((isset($_COOKIE['ShowAPRS']) && $_COOKIE['ShowAPRS'] == 'true') || !isset($_COOKIE['ShowAPRS'])) print 'checked'; ?> ><?php echo _("Display APRS data"); ?></label></div></li> |
|
1041 | + <li><div class="checkbox"><label><input type="checkbox" name="aprs" value="1" onclick="clickAPRS(this)" <?php if ((isset($_COOKIE['ShowAPRS']) && $_COOKIE['ShowAPRS'] == 'true') || !isset($_COOKIE['ShowAPRS'])) { |
|
1042 | + print 'checked'; |
|
1043 | +} |
|
1044 | +?> ><?php echo _("Display APRS data"); ?></label></div></li> |
|
665 | 1045 | <?php } ?> |
666 | 1046 | <?php |
667 | 1047 | } |
@@ -678,7 +1058,9 @@ discard block |
||
678 | 1058 | } |
679 | 1059 | foreach($allairlinenames as $airline) { |
680 | 1060 | $airline_name = $airline['airline_name']; |
681 | - if (strlen($airline_name) > 30) $airline_name = substr($airline_name,0,30).'...'; |
|
1061 | + if (strlen($airline_name) > 30) { |
|
1062 | + $airline_name = substr($airline_name,0,30).'...'; |
|
1063 | + } |
|
682 | 1064 | if (isset($_COOKIE['filter_Airlines']) && in_array($airline['airline_icao'],explode(',',$_COOKIE['filter_Airlines']))) { |
683 | 1065 | echo '<option value="'.$airline['airline_icao'].'" selected>'.$airline_name.'</option>'; |
684 | 1066 | } else { |
@@ -696,7 +1078,10 @@ discard block |
||
696 | 1078 | <li><?php echo _("Display alliance:"); ?> |
697 | 1079 | <br/> |
698 | 1080 | <select class="selectpicker" onchange="alliance(this);" id="display_alliance"> |
699 | - <option value="all"<?php if (!isset($_COOKIE['filter_alliance']) || $_COOKIE['filter_alliance'] == 'all' || $_COOKIE['filter_alliance'] == '') echo ' selected'; ?>><?php echo _("All"); ?></option> |
|
1081 | + <option value="all"<?php if (!isset($_COOKIE['filter_alliance']) || $_COOKIE['filter_alliance'] == 'all' || $_COOKIE['filter_alliance'] == '') { |
|
1082 | + echo ' selected'; |
|
1083 | +} |
|
1084 | +?>><?php echo _("All"); ?></option> |
|
700 | 1085 | <?php |
701 | 1086 | foreach($allalliancenames as $alliance) { |
702 | 1087 | $alliance_name = $alliance['alliance']; |
@@ -755,10 +1140,22 @@ discard block |
||
755 | 1140 | ?> |
756 | 1141 | <li><?php echo _("Display airlines of type:"); ?><br/> |
757 | 1142 | <select class="selectpicker" onchange="airlinestype(this);"> |
758 | - <option value="all"<?php if (!isset($_COOKIE['filter_airlinestype']) || $_COOKIE['filter_airlinestype'] == 'all' || $_COOKIE['filter_airlinestype'] == '') echo ' selected'; ?>><?php echo _("All"); ?></option> |
|
759 | - <option value="passenger"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'passenger') echo ' selected'; ?>><?php echo _("Passenger"); ?></option> |
|
760 | - <option value="cargo"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'cargo') echo ' selected'; ?>><?php echo _("Cargo"); ?></option> |
|
761 | - <option value="military"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'military') echo ' selected'; ?>><?php echo _("Military"); ?></option> |
|
1143 | + <option value="all"<?php if (!isset($_COOKIE['filter_airlinestype']) || $_COOKIE['filter_airlinestype'] == 'all' || $_COOKIE['filter_airlinestype'] == '') { |
|
1144 | + echo ' selected'; |
|
1145 | +} |
|
1146 | +?>><?php echo _("All"); ?></option> |
|
1147 | + <option value="passenger"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'passenger') { |
|
1148 | + echo ' selected'; |
|
1149 | +} |
|
1150 | +?>><?php echo _("Passenger"); ?></option> |
|
1151 | + <option value="cargo"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'cargo') { |
|
1152 | + echo ' selected'; |
|
1153 | +} |
|
1154 | +?>><?php echo _("Cargo"); ?></option> |
|
1155 | + <option value="military"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'military') { |
|
1156 | + echo ' selected'; |
|
1157 | +} |
|
1158 | +?>><?php echo _("Military"); ?></option> |
|
762 | 1159 | </select> |
763 | 1160 | </li> |
764 | 1161 | <?php |
@@ -772,7 +1169,10 @@ discard block |
||
772 | 1169 | ?> |
773 | 1170 | <li> |
774 | 1171 | <?php echo _("Display vessels with MMSI:"); ?> |
775 | - <input type="text" name="mmsifilter" onchange="mmsifilter();" id="mmsifilter" value="<?php if (isset($_COOKIE['filter_mmsi'])) print $_COOKIE['filter_mmsi']; ?>" /> |
|
1172 | + <input type="text" name="mmsifilter" onchange="mmsifilter();" id="mmsifilter" value="<?php if (isset($_COOKIE['filter_mmsi'])) { |
|
1173 | + print $_COOKIE['filter_mmsi']; |
|
1174 | +} |
|
1175 | +?>" /> |
|
776 | 1176 | </li> |
777 | 1177 | <?php |
778 | 1178 | if (isset($globalVM) && $globalVM) { |
@@ -803,7 +1203,10 @@ discard block |
||
803 | 1203 | ?> |
804 | 1204 | <li> |
805 | 1205 | <?php echo _("Display with ident:"); ?> |
806 | - <input type="text" name="identfilter" onchange="identfilter();" id="identfilter" value="<?php if (isset($_COOKIE['filter_ident'])) print $_COOKIE['filter_ident']; ?>" /> |
|
1206 | + <input type="text" name="identfilter" onchange="identfilter();" id="identfilter" value="<?php if (isset($_COOKIE['filter_ident'])) { |
|
1207 | + print $_COOKIE['filter_ident']; |
|
1208 | +} |
|
1209 | +?>" /> |
|
807 | 1210 | </li> |
808 | 1211 | </ul> |
809 | 1212 | </form> |
@@ -819,7 +1222,10 @@ discard block |
||
819 | 1222 | <h1 class="sidebar-header"><?php echo _("Satellites"); ?><span class="sidebar-close"><i class="fa fa-caret-left"></i></span></h1> |
820 | 1223 | <form> |
821 | 1224 | <ul> |
822 | - <li><div class="checkbox"><label><input type="checkbox" name="displayiss" value="1" onclick="clickDisplayISS(this)" <?php if ((isset($_COOKIE['displayiss']) && $_COOKIE['displayiss'] == 'true') || !isset($_COOKIE['displayiss'])) print 'checked'; ?> ><?php echo _("Show ISS, Tiangong-1 and Tiangong-2 on map"); ?></label></div></li> |
|
1225 | + <li><div class="checkbox"><label><input type="checkbox" name="displayiss" value="1" onclick="clickDisplayISS(this)" <?php if ((isset($_COOKIE['displayiss']) && $_COOKIE['displayiss'] == 'true') || !isset($_COOKIE['displayiss'])) { |
|
1226 | + print 'checked'; |
|
1227 | +} |
|
1228 | +?> ><?php echo _("Show ISS, Tiangong-1 and Tiangong-2 on map"); ?></label></div></li> |
|
823 | 1229 | <li><?php echo _("Type:"); ?> |
824 | 1230 | <select class="selectpicker" multiple onchange="sattypes(this);"> |
825 | 1231 | <?php |
@@ -827,25 +1233,45 @@ discard block |
||
827 | 1233 | $types = $Satellite->get_tle_types(); |
828 | 1234 | foreach ($types as $type) { |
829 | 1235 | $type_name = $type['tle_type']; |
830 | - if ($type_name == 'musson') $type_name = 'Russian LEO Navigation'; |
|
831 | - else if ($type_name == 'nnss') $type_name = 'Navi Navigation Satellite System'; |
|
832 | - else if ($type_name == 'sbas') $type_name = 'Satellite-Based Augmentation System'; |
|
833 | - else if ($type_name == 'glo-ops') $type_name = 'Glonass Operational'; |
|
834 | - else if ($type_name == 'gps-ops') $type_name = 'GPS Operational'; |
|
835 | - else if ($type_name == 'argos') $type_name = 'ARGOS Data Collection System'; |
|
836 | - else if ($type_name == 'tdrss') $type_name = 'Tracking and Data Relay Satellite System'; |
|
837 | - else if ($type_name == 'sarsat') $type_name = 'Search & Rescue'; |
|
838 | - else if ($type_name == 'dmc') $type_name = 'Disaster Monitoring'; |
|
839 | - else if ($type_name == 'resource') $type_name = 'Earth Resources'; |
|
840 | - else if ($type_name == 'stations') $type_name = 'Space Stations'; |
|
841 | - else if ($type_name == 'geo') $type_name = 'Geostationary'; |
|
842 | - else if ($type_name == 'amateur') $type_name = 'Amateur Radio'; |
|
843 | - else if ($type_name == 'x-comm') $type_name = 'Experimental'; |
|
844 | - else if ($type_name == 'other-comm') $type_name = 'Other Comm'; |
|
845 | - else if ($type_name == 'science') $type_name = 'Space & Earth Science'; |
|
846 | - else if ($type_name == 'military') $type_name = 'Miscellaneous Military'; |
|
847 | - else if ($type_name == 'radar') $type_name = 'Radar Calibration'; |
|
848 | - else if ($type_name == 'tle-new') $type_name = 'Last 30 days launches'; |
|
1236 | + if ($type_name == 'musson') { |
|
1237 | + $type_name = 'Russian LEO Navigation'; |
|
1238 | + } else if ($type_name == 'nnss') { |
|
1239 | + $type_name = 'Navi Navigation Satellite System'; |
|
1240 | + } else if ($type_name == 'sbas') { |
|
1241 | + $type_name = 'Satellite-Based Augmentation System'; |
|
1242 | + } else if ($type_name == 'glo-ops') { |
|
1243 | + $type_name = 'Glonass Operational'; |
|
1244 | + } else if ($type_name == 'gps-ops') { |
|
1245 | + $type_name = 'GPS Operational'; |
|
1246 | + } else if ($type_name == 'argos') { |
|
1247 | + $type_name = 'ARGOS Data Collection System'; |
|
1248 | + } else if ($type_name == 'tdrss') { |
|
1249 | + $type_name = 'Tracking and Data Relay Satellite System'; |
|
1250 | + } else if ($type_name == 'sarsat') { |
|
1251 | + $type_name = 'Search & Rescue'; |
|
1252 | + } else if ($type_name == 'dmc') { |
|
1253 | + $type_name = 'Disaster Monitoring'; |
|
1254 | + } else if ($type_name == 'resource') { |
|
1255 | + $type_name = 'Earth Resources'; |
|
1256 | + } else if ($type_name == 'stations') { |
|
1257 | + $type_name = 'Space Stations'; |
|
1258 | + } else if ($type_name == 'geo') { |
|
1259 | + $type_name = 'Geostationary'; |
|
1260 | + } else if ($type_name == 'amateur') { |
|
1261 | + $type_name = 'Amateur Radio'; |
|
1262 | + } else if ($type_name == 'x-comm') { |
|
1263 | + $type_name = 'Experimental'; |
|
1264 | + } else if ($type_name == 'other-comm') { |
|
1265 | + $type_name = 'Other Comm'; |
|
1266 | + } else if ($type_name == 'science') { |
|
1267 | + $type_name = 'Space & Earth Science'; |
|
1268 | + } else if ($type_name == 'military') { |
|
1269 | + $type_name = 'Miscellaneous Military'; |
|
1270 | + } else if ($type_name == 'radar') { |
|
1271 | + $type_name = 'Radar Calibration'; |
|
1272 | + } else if ($type_name == 'tle-new') { |
|
1273 | + $type_name = 'Last 30 days launches'; |
|
1274 | + } |
|
849 | 1275 | |
850 | 1276 | if (isset($_COOKIE['sattypes']) && in_array($type['tle_type'],explode(',',$_COOKIE['sattypes']))) { |
851 | 1277 | print '<option value="'.$type['tle_type'].'" selected>'.$type_name.'</option>'; |