Completed
Push — master ( 2c5525...528bd8 )
by Yannick
32:59
created
live-geojson.php 1 patch
Braces   +336 added lines, -136 removed lines patch added patch discarded remove patch
@@ -12,7 +12,9 @@  discard block
 block discarded – undo
12 12
 $tracker = false;
13 13
 $marine = false;
14 14
 $usecoord = false;
15
-if (isset($_GET['test'])) exit();
15
+if (isset($_GET['test'])) {
16
+	exit();
17
+}
16 18
 if (isset($_GET['tracker'])) {
17 19
     $tracker = true;
18 20
 }
@@ -57,29 +59,58 @@  discard block
 block discarded – undo
57 59
 }
58 60
 header('Content-Type: text/javascript');
59 61
 
60
-if (!isset($globalJsonCompress)) $compress = true;
61
-else $compress = $globalJsonCompress;
62
+if (!isset($globalJsonCompress)) {
63
+	$compress = true;
64
+} else {
65
+	$compress = $globalJsonCompress;
66
+}
62 67
 
63 68
 $from_archive = false;
64 69
 $min = true;
65 70
 $allhistory = false;
66 71
 $filter['source'] = array();
67
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt'));
68
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup'));
69
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars'));
70
-if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs'));
71
-if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs'));
72
-if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING);
73
-if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING);
74
-if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING);
75
-if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING);
76
-if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING);
77
-if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING);
78
-if (isset($_COOKIE['filter_race']) && $_COOKIE['filter_race'] != 'all') $filter['race'] = filter_var($_COOKIE['filter_race'],FILTER_SANITIZE_STRING);
72
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') {
73
+	$filter['source'] = array_merge($filter['source'],array('vatsimtxt'));
74
+}
75
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') {
76
+	$filter['source'] = array_merge($filter['source'],array('whazzup'));
77
+}
78
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') {
79
+	$filter['source'] = array_merge($filter['source'],array('phpvmacars'));
80
+}
81
+if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') {
82
+	$filter['source'] = array_merge($filter['source'],array('sbs','famaprs'));
83
+}
84
+if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') {
85
+	$filter['source'] = array_merge($filter['source'],array('aprs'));
86
+}
87
+if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') {
88
+	$filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING);
89
+}
90
+if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') {
91
+	$filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING);
92
+}
93
+if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') {
94
+	$filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING);
95
+}
96
+if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') {
97
+	$filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING);
98
+}
99
+if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') {
100
+	$filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING);
101
+}
102
+if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') {
103
+	$filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING);
104
+}
105
+if (isset($_COOKIE['filter_race']) && $_COOKIE['filter_race'] != 'all') {
106
+	$filter['race'] = filter_var($_COOKIE['filter_race'],FILTER_SANITIZE_STRING);
107
+}
79 108
 
80 109
 if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) {
81 110
 	$min = true;
82
-} else $min = false;
111
+} else {
112
+	$min = false;
113
+}
83 114
 
84 115
 $spotter_array = array();
85 116
 
@@ -190,24 +221,38 @@  discard block
 block discarded – undo
190 221
 			$flightcnt = $SpotterLive->getLiveSpotterCount($filter);
191 222
 		}
192 223
 	}
193
-	if ($flightcnt == '') $flightcnt = 0;
194
-} else $flightcnt = 0;
224
+	if ($flightcnt == '') {
225
+		$flightcnt = 0;
226
+	}
227
+	} else {
228
+	$flightcnt = 0;
229
+}
195 230
 
196 231
 $sqltime = round(microtime(true)-$begintime,2);
197 232
 
198 233
 $currenttime = filter_input(INPUT_GET,'currenttime',FILTER_SANITIZE_NUMBER_INT);
199
-if ($currenttime != '') $currenttime = round($currenttime/1000);
234
+if ($currenttime != '') {
235
+	$currenttime = round($currenttime/1000);
236
+}
200 237
 
201
-if ((!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation == FALSE) || (isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'false')) $usenextlatlon = false;
202
-else $usenextlatlon = true;
203
-if ($usenextlatlon === false) $currenttime = '';
238
+if ((!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation == FALSE) || (isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'false')) {
239
+	$usenextlatlon = false;
240
+} else {
241
+	$usenextlatlon = true;
242
+}
243
+if ($usenextlatlon === false) {
244
+	$currenttime = '';
245
+}
204 246
 $j = 0;
205 247
 $prev_flightaware_id = '';
206 248
 $aircrafts_shadow = array();
207 249
 $output = '{';
208 250
 	$output .= '"type": "FeatureCollection",';
209
-		if ($min) $output .= '"minimal": "true",';
210
-		else $output .= '"minimal": "false",';
251
+		if ($min) {
252
+			$output .= '"minimal": "true",';
253
+		} else {
254
+			$output .= '"minimal": "false",';
255
+		}
211 256
 		//$output .= '"fc": "'.$flightcnt.'",';
212 257
 		$output .= '"sqt": "'.$sqltime.'",';
213 258
 
@@ -252,18 +297,29 @@  discard block
 block discarded – undo
252 297
 						}
253 298
 						$output .= '"properties": {';
254 299
 						if (isset($spotter_item['flightaware_id'])) {
255
-							if ($compress) $output .= '"fi": "'.$spotter_item['flightaware_id'].'",';
256
-							else $output .= '"flightaware_id": "'.$spotter_item['flightaware_id'].'",';
300
+							if ($compress) {
301
+								$output .= '"fi": "'.$spotter_item['flightaware_id'].'",';
302
+							} else {
303
+								$output .= '"flightaware_id": "'.$spotter_item['flightaware_id'].'",';
304
+							}
257 305
 						} elseif (isset($spotter_item['famtrackid'])) {
258
-							if ($compress) $output .= '"fti": "'.$spotter_item['famtrackid'].'",';
259
-							else $output .= '"famtrackid": "'.$spotter_item['famtrackid'].'",';
306
+							if ($compress) {
307
+								$output .= '"fti": "'.$spotter_item['famtrackid'].'",';
308
+							} else {
309
+								$output .= '"famtrackid": "'.$spotter_item['famtrackid'].'",';
310
+							}
260 311
 						} elseif (isset($spotter_item['fammarine_id'])) {
261
-							if ($compress) $output .= '"fmi": "'.$spotter_item['fammarine_id'].'",';
262
-							else $output .= '"fammarineid": "'.$spotter_item['fammarine_id'].'",';
312
+							if ($compress) {
313
+								$output .= '"fmi": "'.$spotter_item['fammarine_id'].'",';
314
+							} else {
315
+								$output .= '"fammarineid": "'.$spotter_item['fammarine_id'].'",';
316
+							}
263 317
 						}
264 318
 						$output .= '"fc": "'.$flightcnt.'",';
265 319
 						$output .= '"sqt": "'.$sqltime.'",';
266
-						if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",';
320
+						if (isset($begindate)) {
321
+							$output .= '"archive_date": "'.$begindate.'",';
322
+						}
267 323
 
268 324
 /*
269 325
 							if ($min) $output .= '"minimal": "true",';
@@ -271,16 +327,25 @@  discard block
 block discarded – undo
271 327
 */
272 328
 							//$output .= '"fc": "'.$spotter_item['nb'].'",';
273 329
 						if (isset($spotter_item['ident']) && $spotter_item['ident'] != '') {
274
-							if ($compress) $output .= '"c": '.json_encode(str_replace('\\','',$spotter_item['ident'])).',';
275
-							else $output .= '"callsign": '.json_encode(str_replace('\\','',$spotter_item['ident'])).',';
330
+							if ($compress) {
331
+								$output .= '"c": '.json_encode(str_replace('\\','',$spotter_item['ident'])).',';
332
+							} else {
333
+								$output .= '"callsign": '.json_encode(str_replace('\\','',$spotter_item['ident'])).',';
334
+							}
276 335
 							//'
277 336
 						} else {
278
-							if ($compress) $output .= '"c": "NA",';
279
-							else $output .= '"callsign": "NA",';
337
+							if ($compress) {
338
+								$output .= '"c": "NA",';
339
+							} else {
340
+								$output .= '"callsign": "NA",';
341
+							}
280 342
 						}
281 343
 						if (isset($spotter_item['registration'])) {
282
-							if ($compress) $output .= '"reg": '.json_encode($spotter_item['registration']).',';
283
-							else $output .= '"registration": '.json_encode($spotter_item['registration']).',';
344
+							if ($compress) {
345
+								$output .= '"reg": '.json_encode($spotter_item['registration']).',';
346
+							} else {
347
+								$output .= '"registration": '.json_encode($spotter_item['registration']).',';
348
+							}
284 349
 						}
285 350
 						if (isset($spotter_item['aircraft_name']) && isset($spotter_item['aircraft_type'])) {
286 351
 							$output .= '"aircraft_name": "'.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')",';
@@ -291,20 +356,30 @@  discard block
 block discarded – undo
291 356
 							$output .= '"aircraft_name": "NA",';
292 357
 						}
293 358
 						if (isset($spotter_item['aircraft_icao'])) {
294
-							if ($compress) $output .= '"ai": "'.$spotter_item['aircraft_icao'].'",';
295
-							else $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",';
359
+							if ($compress) {
360
+								$output .= '"ai": "'.$spotter_item['aircraft_icao'].'",';
361
+							} else {
362
+								$output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",';
363
+							}
296 364
 						}
297 365
 						if (!isset($spotter_item['aircraft_shadow']) && !$tracker && !$marine) {
298
-							if (!isset($spotter_item['aircraft_icao']) || $spotter_item['aircraft_icao'] == '') $spotter_item['aircraft_shadow'] = '';
299
-							else {
366
+							if (!isset($spotter_item['aircraft_icao']) || $spotter_item['aircraft_icao'] == '') {
367
+								$spotter_item['aircraft_shadow'] = '';
368
+							} else {
300 369
 								$aircraft_icao = $spotter_item['aircraft_icao'];
301
-								if (isset($aircrafts_shadow[$aircraft_icao])) $spotter_item['aircraft_shadow'] = $aircrafts_shadow[$aircraft_icao];
302
-								else {
370
+								if (isset($aircrafts_shadow[$aircraft_icao])) {
371
+									$spotter_item['aircraft_shadow'] = $aircrafts_shadow[$aircraft_icao];
372
+								} else {
303 373
 									$aircraft_info = $Spotter->getAllAircraftInfo($spotter_item['aircraft_icao']);
304
-									if (count($aircraft_info) > 0) $spotter_item['aircraft_shadow'] = $aircraft_info[0]['aircraft_shadow'];
305
-									elseif (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'aprs') $spotter_item['aircraft_shadow'] = 'PA18.png';
306
-									elseif ($aircraft_icao == 'PARAGLIDER') $spotter_item['aircraft_shadow'] = 'PARAGLIDER.png';
307
-									else $spotter_item['aircraft_shadow'] = '';
374
+									if (count($aircraft_info) > 0) {
375
+										$spotter_item['aircraft_shadow'] = $aircraft_info[0]['aircraft_shadow'];
376
+									} elseif (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'aprs') {
377
+										$spotter_item['aircraft_shadow'] = 'PA18.png';
378
+									} elseif ($aircraft_icao == 'PARAGLIDER') {
379
+										$spotter_item['aircraft_shadow'] = 'PARAGLIDER.png';
380
+									} else {
381
+										$spotter_item['aircraft_shadow'] = '';
382
+									}
308 383
 									$aircrafts_shadow[$aircraft_icao] = $spotter_item['aircraft_shadow'];
309 384
 								}
310 385
 							}
@@ -312,73 +387,139 @@  discard block
 block discarded – undo
312 387
 						if (!isset($spotter_item['aircraft_shadow']) || $spotter_item['aircraft_shadow'] == '') {
313 388
 							if ($tracker) {
314 389
 								if (isset($spotter_item['type']) && $spotter_item['type'] == 'Ambulance') {
315
-									if ($compress) $output .= '"as": "ambulance.png",';
316
-									else $output .= '"aircraft_shadow": "ambulance.png",';
390
+									if ($compress) {
391
+										$output .= '"as": "ambulance.png",';
392
+									} else {
393
+										$output .= '"aircraft_shadow": "ambulance.png",';
394
+									}
317 395
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Police') {
318
-									if ($compress) $output .= '"as": "police.png",';
319
-									else $output .= '"aircraft_shadow": "police.png",';
396
+									if ($compress) {
397
+										$output .= '"as": "police.png",';
398
+									} else {
399
+										$output .= '"aircraft_shadow": "police.png",';
400
+									}
320 401
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Yacht (Sail)') {
321
-									if ($compress) $output .= '"as": "ship.png",';
322
-									else $output .= '"aircraft_shadow": "ship.png",';
402
+									if ($compress) {
403
+										$output .= '"as": "ship.png",';
404
+									} else {
405
+										$output .= '"aircraft_shadow": "ship.png",';
406
+									}
323 407
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Ship (Power Boat)') {
324
-									if ($compress) $output .= '"as": "ship.png",';
325
-									else $output .= '"aircraft_shadow": "ship.png",';
408
+									if ($compress) {
409
+										$output .= '"as": "ship.png",';
410
+									} else {
411
+										$output .= '"aircraft_shadow": "ship.png",';
412
+									}
326 413
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Shuttle') {
327
-									if ($compress) $output .= '"as": "ship.png",';
328
-									else $output .= '"aircraft_shadow": "ship.png",';
414
+									if ($compress) {
415
+										$output .= '"as": "ship.png",';
416
+									} else {
417
+										$output .= '"aircraft_shadow": "ship.png",';
418
+									}
329 419
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Truck') {
330
-									if ($compress) $output .= '"as": "truck.png",';
331
-									else $output .= '"aircraft_shadow": "truck.png",';
420
+									if ($compress) {
421
+										$output .= '"as": "truck.png",';
422
+									} else {
423
+										$output .= '"aircraft_shadow": "truck.png",';
424
+									}
332 425
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Truck (18 Wheeler)') {
333
-									if ($compress) $output .= '"as": "truck.png",';
334
-									else $output .= '"aircraft_shadow": "truck.png",';
426
+									if ($compress) {
427
+										$output .= '"as": "truck.png",';
428
+									} else {
429
+										$output .= '"aircraft_shadow": "truck.png",';
430
+									}
335 431
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Aircraft (small)') {
336
-									if ($compress) $output .= '"as": "aircraft.png",';
337
-									else $output .= '"aircraft_shadow": "aircraft.png",';
432
+									if ($compress) {
433
+										$output .= '"as": "aircraft.png",';
434
+									} else {
435
+										$output .= '"aircraft_shadow": "aircraft.png",';
436
+									}
338 437
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Large Aircraft') {
339
-									if ($compress) $output .= '"as": "aircraft.png",';
340
-									else $output .= '"aircraft_shadow": "aircraft.png",';
438
+									if ($compress) {
439
+										$output .= '"as": "aircraft.png",';
440
+									} else {
441
+										$output .= '"aircraft_shadow": "aircraft.png",';
442
+									}
341 443
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Helicopter') {
342
-									if ($compress) $output .= '"as": "helico.png",';
343
-									else $output .= '"aircraft_shadow": "helico.png",';
444
+									if ($compress) {
445
+										$output .= '"as": "helico.png",';
446
+									} else {
447
+										$output .= '"aircraft_shadow": "helico.png",';
448
+									}
344 449
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Railroad Engine') {
345
-									if ($compress) $output .= '"as": "rail.png",';
346
-									else $output .= '"aircraft_shadow": "rail.png",';
450
+									if ($compress) {
451
+										$output .= '"as": "rail.png",';
452
+									} else {
453
+										$output .= '"aircraft_shadow": "rail.png",';
454
+									}
347 455
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Firetruck') {
348
-									if ($compress) $output .= '"as": "firetruck.png",';
349
-									else $output .= '"aircraft_shadow": "firetruck.png",';
456
+									if ($compress) {
457
+										$output .= '"as": "firetruck.png",';
458
+									} else {
459
+										$output .= '"aircraft_shadow": "firetruck.png",';
460
+									}
350 461
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Bus') {
351
-									if ($compress) $output .= '"as": "bus.png",';
352
-									else $output .= '"aircraft_shadow": "bus.png",';
462
+									if ($compress) {
463
+										$output .= '"as": "bus.png",';
464
+									} else {
465
+										$output .= '"aircraft_shadow": "bus.png",';
466
+									}
353 467
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Phone') {
354
-									if ($compress) $output .= '"as": "phone.png",';
355
-									else $output .= '"aircraft_shadow": "phone.png",';
468
+									if ($compress) {
469
+										$output .= '"as": "phone.png",';
470
+									} else {
471
+										$output .= '"aircraft_shadow": "phone.png",';
472
+									}
356 473
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Jogger') {
357
-									if ($compress) $output .= '"as": "jogger.png",';
358
-									else $output .= '"aircraft_shadow": "jogger.png",';
474
+									if ($compress) {
475
+										$output .= '"as": "jogger.png",';
476
+									} else {
477
+										$output .= '"aircraft_shadow": "jogger.png",';
478
+									}
359 479
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Bike') {
360
-									if ($compress) $output .= '"as": "bike.png",';
361
-									else $output .= '"aircraft_shadow": "bike.png",';
480
+									if ($compress) {
481
+										$output .= '"as": "bike.png",';
482
+									} else {
483
+										$output .= '"aircraft_shadow": "bike.png",';
484
+									}
362 485
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Motorcycle') {
363
-									if ($compress) $output .= '"as": "motorcycle.png",';
364
-									else $output .= '"aircraft_shadow": "motorcycle.png",';
486
+									if ($compress) {
487
+										$output .= '"as": "motorcycle.png",';
488
+									} else {
489
+										$output .= '"aircraft_shadow": "motorcycle.png",';
490
+									}
365 491
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Balloon') {
366
-									if ($compress) $output .= '"as": "balloon.png",';
367
-									else $output .= '"aircraft_shadow": "balloon.png",';
492
+									if ($compress) {
493
+										$output .= '"as": "balloon.png",';
494
+									} else {
495
+										$output .= '"aircraft_shadow": "balloon.png",';
496
+									}
368 497
 								} else {
369
-									if ($compress) $output .= '"as": "car.png",';
370
-									else $output .= '"aircraft_shadow": "car.png",';
498
+									if ($compress) {
499
+										$output .= '"as": "car.png",';
500
+									} else {
501
+										$output .= '"aircraft_shadow": "car.png",';
502
+									}
371 503
 								}
372 504
 							} elseif ($marine) {
373
-								if ($compress) $output .= '"as": "ship.png",';
374
-								else $output .= '"aircraft_shadow": "ship.png",';
505
+								if ($compress) {
506
+									$output .= '"as": "ship.png",';
507
+								} else {
508
+									$output .= '"aircraft_shadow": "ship.png",';
509
+								}
375 510
 							} else {
376
-								if ($compress) $output .= '"as": "default.png",';
377
-								else $output .= '"aircraft_shadow": "default.png",';
511
+								if ($compress) {
512
+									$output .= '"as": "default.png",';
513
+								} else {
514
+									$output .= '"aircraft_shadow": "default.png",';
515
+								}
378 516
 							}
379 517
 						} else {
380
-							if ($compress) $output .= '"as": "'.$spotter_item['aircraft_shadow'].'",';
381
-							else $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",';
518
+							if ($compress) {
519
+								$output .= '"as": "'.$spotter_item['aircraft_shadow'].'",';
520
+							} else {
521
+								$output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",';
522
+							}
382 523
 						}
383 524
 						if (isset($spotter_item['airline_name'])) {
384 525
 							$output .= '"airline_name": "'.$spotter_item['airline_name'].'",';
@@ -386,8 +527,11 @@  discard block
 block discarded – undo
386 527
 							$output .= '"airline_name": "NA",';
387 528
 						}
388 529
 						if (isset($spotter_item['departure_airport'])) {
389
-							if ($compress) $output .= '"dac": "'.$spotter_item['departure_airport'].'",';
390
-							else $output .= '"departure_airport_code": "'.$spotter_item['departure_airport'].'",';
530
+							if ($compress) {
531
+								$output .= '"dac": "'.$spotter_item['departure_airport'].'",';
532
+							} else {
533
+								$output .= '"departure_airport_code": "'.$spotter_item['departure_airport'].'",';
534
+							}
391 535
 						}
392 536
 						if (isset($spotter_item['departure_airport_city'])) {
393 537
 							$output .= '"departure_airport": "'.$spotter_item['departure_airport_city'].', '.$spotter_item['departure_airport_country'].'",';
@@ -399,8 +543,11 @@  discard block
 block discarded – undo
399 543
 							$output .= '"arrival_airport_time": "'.$spotter_item['arrival_airport_time'].'",';
400 544
 						}
401 545
 						if (isset($spotter_item['arrival_airport'])) {
402
-							if ($compress) $output .= '"aac": "'.$spotter_item['arrival_airport'].'",';
403
-							else $output .= '"arrival_airport_code": "'.$spotter_item['arrival_airport'].'",';
546
+							if ($compress) {
547
+								$output .= '"aac": "'.$spotter_item['arrival_airport'].'",';
548
+							} else {
549
+								$output .= '"arrival_airport_code": "'.$spotter_item['arrival_airport'].'",';
550
+							}
404 551
 						}
405 552
 						if (isset($spotter_item['arrival_airport_city'])) {
406 553
 							$output .= '"arrival_airport": "'.$spotter_item['arrival_airport_city'].', '.$spotter_item['arrival_airport_country'].'",';
@@ -419,11 +566,17 @@  discard block
 block discarded – undo
419 566
 						}
420 567
 						
421 568
 						if (isset($spotter_item['real_altitude'])) {
422
-							if ($compress) $output .= '"a": "'.($spotter_item['real_altitude']/100).'",';
423
-							else $output .= '"altitude": "'.($spotter_item['real_altitude']/100).'",';
569
+							if ($compress) {
570
+								$output .= '"a": "'.($spotter_item['real_altitude']/100).'",';
571
+							} else {
572
+								$output .= '"altitude": "'.($spotter_item['real_altitude']/100).'",';
573
+							}
424 574
 						} elseif (isset($spotter_item['altitude'])) {
425
-							if ($compress) $output .= '"a": "'.$spotter_item['altitude'].'",';
426
-							else $output .= '"altitude": "'.$spotter_item['altitude'].'",';
575
+							if ($compress) {
576
+								$output .= '"a": "'.$spotter_item['altitude'].'",';
577
+							} else {
578
+								$output .= '"altitude": "'.$spotter_item['altitude'].'",';
579
+							}
427 580
 						}
428 581
 						
429 582
 						$heading = $spotter_item['heading'];
@@ -447,19 +600,24 @@  discard block
 block discarded – undo
447 600
 							}
448 601
 						}
449 602
 						
450
-						if ($compress)$output .= '"h": "'.$heading.'",';
451
-						else $output .= '"heading": "'.$heading.'",';
603
+						if ($compress) {
604
+							$output .= '"h": "'.$heading.'",';
605
+						} else {
606
+							$output .= '"heading": "'.$heading.'",';
607
+						}
452 608
 						if ($currenttime != '') {
453 609
 							if (strtotime($spotter_item['date']) < $currenttime) {
454 610
 								if (isset($archivespeed)) {
455 611
 									$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh));
456 612
 									$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
457
-									if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
458
-									else {
613
+									if (!isset($idistance) || $fdistance < $idistance) {
614
+										$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
615
+									} else {
459 616
 										$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,$archivespeed,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh));
460 617
 										$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
461
-										if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
462
-										else {
618
+										if (!isset($idistance) || $fdistance < $idistance) {
619
+											$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
620
+										} else {
463 621
 											$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed);
464 622
 											$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
465 623
 										}
@@ -467,12 +625,14 @@  discard block
 block discarded – undo
467 625
 								} elseif ($usenextlatlon) {
468 626
 									$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,1,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh));
469 627
 									$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
470
-									if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
471
-									else {
628
+									if (!isset($idistance) || $fdistance < $idistance) {
629
+										$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
630
+									} else {
472 631
 										$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,1,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh));
473 632
 										$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
474
-										if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
475
-										else {
633
+										if (!isset($idistance) || $fdistance < $idistance) {
634
+											$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
635
+										} else {
476 636
 											$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading);
477 637
 											$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
478 638
 										}
@@ -511,7 +671,9 @@  discard block
 block discarded – undo
511 671
 							}
512 672
 						}
513 673
 
514
-						if (!$min) $output .= '"image": "'.$image.'",';
674
+						if (!$min) {
675
+							$output .= '"image": "'.$image.'",';
676
+						}
515 677
 						if (isset($spotter_item['image_copyright']) && $spotter_item['image_copyright'] != '') {
516 678
 							$output .= '"image_copyright": "'.str_replace('"',"'",trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'',$spotter_item['image_copyright']))).'",';
517 679
 						}
@@ -519,8 +681,11 @@  discard block
 block discarded – undo
519 681
 							$output .= '"image_source_website": "'.urlencode($spotter_item['image_source_website']).'",';
520 682
 						}
521 683
 						if (isset($spotter_item['squawk'])) {
522
-							if ($compress) $output .= '"sq": "'.$spotter_item['squawk'].'",';
523
-							else $output .= '"squawk": "'.$spotter_item['squawk'].'",';
684
+							if ($compress) {
685
+								$output .= '"sq": "'.$spotter_item['squawk'].'",';
686
+							} else {
687
+								$output .= '"squawk": "'.$spotter_item['squawk'].'",';
688
+							}
524 689
 						}
525 690
 						if (isset($spotter_item['squawk_usage'])) {
526 691
 							$output .= '"squawk_usage": "'.$spotter_item['squawk_usage'].'",';
@@ -542,14 +707,23 @@  discard block
 block discarded – undo
542 707
 						}
543 708
 						// type when not aircraft ?
544 709
 						if (isset($spotter_item['type'])) {
545
-							if ($compress) $output .= '"t": "'.$spotter_item['type'].'"';
546
-							else $output .= '"type": "'.$spotter_item['type'].'"';
710
+							if ($compress) {
711
+								$output .= '"t": "'.$spotter_item['type'].'"';
712
+							} else {
713
+								$output .= '"type": "'.$spotter_item['type'].'"';
714
+							}
547 715
 						} elseif ($marine) {
548
-							if ($compress) $output .= '"t": "ship"';
549
-							else $output .= '"type": "ship"';
716
+							if ($compress) {
717
+								$output .= '"t": "ship"';
718
+							} else {
719
+								$output .= '"type": "ship"';
720
+							}
550 721
 						} else {
551
-							if ($compress) $output .= '"t": "aircraft"';
552
-							else $output .= '"type": "aircraft"';
722
+							if ($compress) {
723
+								$output .= '"t": "aircraft"';
724
+							} else {
725
+								$output .= '"type": "aircraft"';
726
+							}
553 727
 						}
554 728
 						$output .= '},';
555 729
 						$output .= '"geometry": {';
@@ -557,15 +731,19 @@  discard block
 block discarded – undo
557 731
 								$output .= '"coordinates": [';
558 732
 								if ($currenttime != '') {
559 733
 									if (strtotime($spotter_item['date']) < $currenttime) {
560
-										if (!isset($archivespeed)) $archivespeed = 1;
734
+										if (!isset($archivespeed)) {
735
+											$archivespeed = 1;
736
+										}
561 737
 										$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed,($currenttime-strtotime($spotter_item['date'])));
562 738
 										$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
563
-										if (!isset($idistance) || $fdistance < $idistance) $output .= $nextcoord['longitude'].','.$nextcoord['latitude'];
564
-										else {
739
+										if (!isset($idistance) || $fdistance < $idistance) {
740
+											$output .= $nextcoord['longitude'].','.$nextcoord['latitude'];
741
+										} else {
565 742
 											$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,$archivespeed,($currenttime-strtotime($spotter_item['date'])));
566 743
 											$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
567
-											if (!isset($idistance) || $fdistance < $idistance) $output .= $nextcoord['longitude'].','.$nextcoord['latitude'];
568
-											else {
744
+											if (!isset($idistance) || $fdistance < $idistance) {
745
+												$output .= $nextcoord['longitude'].','.$nextcoord['latitude'];
746
+											} else {
569 747
 												$output .= $spotter_item['longitude'].', ';
570 748
 												$output .= $spotter_item['latitude'];
571 749
 											}
@@ -643,7 +821,9 @@  discard block
 block discarded – undo
643 821
 			}
644 822
 */
645 823
 				$history = filter_input(INPUT_GET,'history',FILTER_SANITIZE_STRING);
646
-				if ($history == '' && isset($_COOKIE['history'])) $history = $_COOKIE['history'];
824
+				if ($history == '' && isset($_COOKIE['history'])) {
825
+					$history = $_COOKIE['history'];
826
+				}
647 827
 				
648 828
 				if (
649 829
 				    (isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') 
@@ -713,8 +893,11 @@  discard block
 block discarded – undo
713 893
 									$output_history .= ']}},';
714 894
 									$output .= $output_history;
715 895
 								}
716
-								if ($compress) $output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "history","a": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": [';
717
-								else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": [';
896
+								if ($compress) {
897
+									$output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "history","a": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": [';
898
+								} else {
899
+									$output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": [';
900
+								}
718 901
 							}
719 902
 							$output_history .= '[';
720 903
 							$output_history .=  $spotter_history['longitude'].', ';
@@ -735,10 +918,15 @@  discard block
 block discarded – undo
735 918
 							if ($d == false) {
736 919
 								if ($compress) {
737 920
 									$output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'",';
738
-									if (isset($spotter_history_array[0]['mapmatching_engine']) && $spotter_history_array[0]['mapmatching_engine'] == 'graphhopper') $output_history .= '"atr": "Powered by <a href=\"https://www.graphhopper.com/\">GraphHopper API</a>", Map matching engine use data from © <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a>",';
739
-									elseif (isset($spotter_history_array[0]['mapmatching_engine'])) $output_history .= '"atr": "Map matching engine use data from © <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a>",';
921
+									if (isset($spotter_history_array[0]['mapmatching_engine']) && $spotter_history_array[0]['mapmatching_engine'] == 'graphhopper') {
922
+										$output_history .= '"atr": "Powered by <a href=\"https://www.graphhopper.com/\">GraphHopper API</a>", Map matching engine use data from © <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a>",';
923
+									} elseif (isset($spotter_history_array[0]['mapmatching_engine'])) {
924
+										$output_history .= '"atr": "Map matching engine use data from © <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a>",';
925
+									}
740 926
 									$output_history .= '"t": "history"},"geometry": {"type": "LineString","coordinates": [';
741
-								} else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history"},"geometry": {"type": "LineString","coordinates": [';
927
+								} else {
928
+									$output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history"},"geometry": {"type": "LineString","coordinates": [';
929
+								}
742 930
 								$d = true;
743 931
 							}
744 932
 							$output_history .= '[';
@@ -761,7 +949,9 @@  discard block
 block discarded – undo
761 949
 							$output_historyd = '[';
762 950
 							$output_historyd .=  $spotter_item['longitude'].', ';
763 951
 							$output_historyd .=  $spotter_item['latitude'];
764
-							if (isset($spotter_history['altitude'])) $output_historyd .=  ','.$spotter_item['altitude']*30.48;
952
+							if (isset($spotter_history['altitude'])) {
953
+								$output_historyd .=  ','.$spotter_item['altitude']*30.48;
954
+							}
765 955
 							$output_historyd .= '],';
766 956
 							//$output_history = $output_historyd.$output_history;
767 957
 							$output_history = $output_history.$output_historyd;
@@ -788,8 +978,11 @@  discard block
 block discarded – undo
788 978
 				        && $spotter_item['arrival_airport'] != 'NA' 
789 979
 				        && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") 
790 980
 				    	    || (!isset($_COOKIE['MapRoute']) && isset($globalMapRoute) && $globalMapRoute)))) {
791
-				    if ($compress) $output_air = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "route"},"geometry": {"type": "LineString","coordinates": [';
792
-				    else $output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": [';
981
+				    if ($compress) {
982
+				    	$output_air = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "route"},"geometry": {"type": "LineString","coordinates": [';
983
+				    } else {
984
+				    	$output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": [';
985
+				    }
793 986
 				    if (isset($spotter_item['departure_airport_latitude'])) {
794 987
 					$output_air .= '['.$spotter_item['departure_airport_longitude'].','.$spotter_item['departure_airport_latitude'].'],';
795 988
 				    } elseif (isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA') {
@@ -822,8 +1015,11 @@  discard block
 block discarded – undo
822 1015
 				    	    || (!isset($_COOKIE['MapRemainingRoute']) && (!isset($globalMapRemainingRoute) 
823 1016
 				    	    || (isset($globalMapRemainingRoute) && $globalMapRemainingRoute)))))) {
824 1017
 				    $havedata = false;
825
-				    if ($compress) $output_dest = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "routedest"},"geometry": {"type": "LineString","coordinates": [';
826
-				    else $output_dest = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "routedest"},"geometry": {"type": "LineString","coordinates": [';
1018
+				    if ($compress) {
1019
+				    	$output_dest = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "routedest"},"geometry": {"type": "LineString","coordinates": [';
1020
+				    } else {
1021
+				    	$output_dest = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "routedest"},"geometry": {"type": "LineString","coordinates": [';
1022
+				    }
827 1023
 				    
828 1024
 				    //$output_dest .= '['.$spotter_item['longitude'].','.$spotter_item['latitude'].'],';
829 1025
 				    if (isset($spotter_item['arrival_airport_latitude'])) {
@@ -848,7 +1044,9 @@  discard block
 block discarded – undo
848 1044
 					$output_dest  = substr($output_dest, 0, -1);
849 1045
 				    }
850 1046
 				    $output_dest .= ']}},';
851
-				    if ($havedata) $output .= $output_dest;
1047
+				    if ($havedata) {
1048
+				    	$output .= $output_dest;
1049
+				    }
852 1050
 				    unset($output_dest);
853 1051
 				}
854 1052
 			}
@@ -856,7 +1054,9 @@  discard block
 block discarded – undo
856 1054
 			$output .= ']';
857 1055
 			$output .= ',"initial_sqltime": "'.$sqltime.'",';
858 1056
 			$output .= '"totaltime": "'.round(microtime(true)-$begintime,2).'",';
859
-			if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",';
1057
+			if (isset($begindate)) {
1058
+				$output .= '"archive_date": "'.$begindate.'",';
1059
+			}
860 1060
 			$output .= '"fc": "'.$j.'"';
861 1061
 		} else {
862 1062
 			$output .= '"features": ';
Please login to merge, or discard this patch.
install/index.php 1 patch
Braces   +603 added lines, -162 removed lines patch added patch discarded remove patch
@@ -4,11 +4,19 @@  discard block
 block discarded – undo
4 4
 if (isset($_SESSION['error'])) {
5 5
 	header('Content-Encoding: none;');
6 6
 	echo 'Error : '.$_SESSION['error'].' - Resetting install... You need to fix the problem and run install again.';
7
-	if (isset($_SESSION['error'])) unset($_SESSION['error']);
8
-	if (isset($_SESSION['errorlst'])) unset($_SESSION['errorlst']);
9
-	if (isset($_SESSION['next'])) unset($_SESSION['next']);
10
-	if (isset($_SESSION['install'])) unset($_SESSION['install']);
11
-}
7
+	if (isset($_SESSION['error'])) {
8
+		unset($_SESSION['error']);
9
+	}
10
+	if (isset($_SESSION['errorlst'])) {
11
+		unset($_SESSION['errorlst']);
12
+	}
13
+	if (isset($_SESSION['next'])) {
14
+		unset($_SESSION['next']);
15
+	}
16
+	if (isset($_SESSION['install'])) {
17
+		unset($_SESSION['install']);
18
+	}
19
+	}
12 20
 /*
13 21
 if (isset($_SESSION['errorlst'])) {
14 22
 	header('Content-Encoding: none;');
@@ -114,7 +122,9 @@  discard block
 block discarded – undo
114 122
 		if (count($alllng) != count($availablelng)) {
115 123
 			$notavailable = array();
116 124
 			foreach($alllng as $lng) {
117
-				if (!isset($availablelng[$lng])) $notavailable[] = $lng;
125
+				if (!isset($availablelng[$lng])) {
126
+					$notavailable[] = $lng;
127
+				}
118 128
 			}
119 129
 			print '<div class="alert alert-warning">The following translation can\'t be used on your system: '.implode(', ',$notavailable).'. You need to add the system locales: <a href="https://github.com/Ysurac/FlightAirMap/wiki/Translation">documentation</a>.</div>';
120 130
 		}
@@ -175,31 +185,49 @@  discard block
 block discarded – undo
175 185
 			</div>
176 186
 			<p>
177 187
 				<label for="dbhost">Database hostname</label>
178
-				<input type="text" name="dbhost" id="dbhost" value="<?php if (isset($globalDBhost)) print $globalDBhost; ?>" />
188
+				<input type="text" name="dbhost" id="dbhost" value="<?php if (isset($globalDBhost)) {
189
+	print $globalDBhost;
190
+}
191
+?>" />
179 192
 			</p>
180 193
 			<p>
181 194
 				<label for="dbport">Database port</label>
182
-				<input type="text" name="dbport" id="dbport" value="<?php if (isset($globalDBport)) print $globalDBport; ?>" />
195
+				<input type="text" name="dbport" id="dbport" value="<?php if (isset($globalDBport)) {
196
+	print $globalDBport;
197
+}
198
+?>" />
183 199
 				<p class="help-block">Default is 3306 for MariaDB/MySQL, 5432 for PostgreSQL</p>
184 200
 			</p>
185 201
 			<p>
186 202
 				<label for="dbname">Database name</label>
187
-				<input type="text" name="dbname" id="dbname" value="<?php if (isset($globalDBname)) print $globalDBname; ?>" />
203
+				<input type="text" name="dbname" id="dbname" value="<?php if (isset($globalDBname)) {
204
+	print $globalDBname;
205
+}
206
+?>" />
188 207
 			</p>
189 208
 			<p>
190 209
 				<label for="dbuser">Database user</label>
191
-				<input type="text" name="dbuser" id="dbuser" value="<?php if (isset($globalDBuser)) print $globalDBuser; ?>" />
210
+				<input type="text" name="dbuser" id="dbuser" value="<?php if (isset($globalDBuser)) {
211
+	print $globalDBuser;
212
+}
213
+?>" />
192 214
 			</p>
193 215
 			<p>
194 216
 				<label for="dbuserpass">Database user password</label>
195
-				<input type="password" name="dbuserpass" id="dbuserpass" value="<?php if (isset($globalDBpass)) print $globalDBpass; ?>" />
217
+				<input type="password" name="dbuserpass" id="dbuserpass" value="<?php if (isset($globalDBpass)) {
218
+	print $globalDBpass;
219
+}
220
+?>" />
196 221
 			</p>
197 222
 		</fieldset>
198 223
 		<fieldset id="site">
199 224
 			<legend>Site configuration</legend>
200 225
 			<p>
201 226
 				<label for="sitename">Site name</label>
202
-				<input type="text" name="sitename" id="sitename" value="<?php if (isset($globalName)) print $globalName; ?>" />
227
+				<input type="text" name="sitename" id="sitename" value="<?php if (isset($globalName)) {
228
+	print $globalName;
229
+}
230
+?>" />
203 231
 			</p>
204 232
 			<p>
205 233
 				<label for="siteurl">Site directory</label>
@@ -212,18 +240,27 @@  discard block
 block discarded – undo
212 240
 					}
213 241
 				    }
214 242
 				?>
215
-				<input type="text" name="siteurl" id="siteurl" value="<?php if (isset($globalURL)) print $globalURL; ?>" />
243
+				<input type="text" name="siteurl" id="siteurl" value="<?php if (isset($globalURL)) {
244
+	print $globalURL;
245
+}
246
+?>" />
216 247
 				<p class="help-block">ex : <i>/flightairmap</i> if complete URL is <i>http://toto.com/flightairmap</i></p>
217 248
 				<p class="help-block">Can be empty</p>
218 249
 			</p>
219 250
 			<p>
220 251
 				<label for="timezone">Timezone</label>
221
-				<input type="text" name="timezone" id="timezone" value="<?php if (isset($globalTimezone)) print $globalTimezone; ?>" />
252
+				<input type="text" name="timezone" id="timezone" value="<?php if (isset($globalTimezone)) {
253
+	print $globalTimezone;
254
+}
255
+?>" />
222 256
 				<p class="help-block">ex : UTC, Europe/Paris,...</p>
223 257
 			</p>
224 258
 			<p>
225 259
 				<label for="language">Language</label>
226
-				<input type="text" name="language" id="language" value="<?php if (isset($globalLanguage)) print $globalLanguage; ?>" />
260
+				<input type="text" name="language" id="language" value="<?php if (isset($globalLanguage)) {
261
+	print $globalLanguage;
262
+}
263
+?>" />
227 264
 				<p class="help-block">Used only when link to wikipedia for now. Can be EN,DE,FR,...</p>
228 265
 			</p>
229 266
 		</fieldset>
@@ -243,11 +280,17 @@  discard block
 block discarded – undo
243 280
 			<div id="mapbox_data">
244 281
 				<p>
245 282
 					<label for="mapboxid">Mapbox id</label>
246
-					<input type="text" name="mapboxid" id="mapboxid" value="<?php if (isset($globalMapboxId)) print $globalMapboxId; ?>" />
283
+					<input type="text" name="mapboxid" id="mapboxid" value="<?php if (isset($globalMapboxId)) {
284
+	print $globalMapboxId;
285
+}
286
+?>" />
247 287
 				</p>
248 288
 				<p>
249 289
 					<label for="mapboxtoken">Mapbox token</label>
250
-					<input type="text" name="mapboxtoken" id="mapboxtoken" value="<?php if (isset($globalMapboxToken)) print $globalMapboxToken; ?>" />
290
+					<input type="text" name="mapboxtoken" id="mapboxtoken" value="<?php if (isset($globalMapboxToken)) {
291
+	print $globalMapboxToken;
292
+}
293
+?>" />
251 294
 				</p>
252 295
 				<p class="help-block">Get a key <a href="https://www.mapbox.com/developers/">here</a></p>
253 296
 			</div>
@@ -255,7 +298,10 @@  discard block
 block discarded – undo
255 298
 			<div id="google_data">
256 299
 				<p>
257 300
 					<label for="googlekey">Google API key</label>
258
-					<input type="text" name="googlekey" id="googlekey" value="<?php if (isset($globalGoogleAPIKey)) print $globalGoogleAPIKey; ?>" />
301
+					<input type="text" name="googlekey" id="googlekey" value="<?php if (isset($globalGoogleAPIKey)) {
302
+	print $globalGoogleAPIKey;
303
+}
304
+?>" />
259 305
 					<p class="help-block">Get a key <a href="https://developers.google.com/maps/documentation/javascript/get-api-key#get-an-api-key">here</a></p>
260 306
 				</p>
261 307
 			</div>
@@ -263,7 +309,10 @@  discard block
 block discarded – undo
263 309
 			<div id="bing_data">
264 310
 				<p>
265 311
 					<label for="bingkey">Bing Map key</label>
266
-					<input type="text" name="bingkey" id="bingkey" value="<?php if (isset($globalBingMapKey)) print $globalBingMapKey; ?>" />
312
+					<input type="text" name="bingkey" id="bingkey" value="<?php if (isset($globalBingMapKey)) {
313
+	print $globalBingMapKey;
314
+}
315
+?>" />
267 316
 					<p class="help-block">Get a key <a href="https://www.bingmapsportal.com/">here</a></p>
268 317
 				</p>
269 318
 			</div>
@@ -271,7 +320,10 @@  discard block
 block discarded – undo
271 320
 			<div id="mapquest_data">
272 321
 				<p>
273 322
 					<label for="mapquestkey">MapQuest key</label>
274
-					<input type="text" name="mapquestkey" id="mapquestkey" value="<?php if (isset($globalMapQuestKey)) print $globalMapQuestKey; ?>" />
323
+					<input type="text" name="mapquestkey" id="mapquestkey" value="<?php if (isset($globalMapQuestKey)) {
324
+	print $globalMapQuestKey;
325
+}
326
+?>" />
275 327
 					<p class="help-block">Get a key <a href="https://developer.mapquest.com/user/me/apps">here</a></p>
276 328
 				</p>
277 329
 			</div>
@@ -279,11 +331,17 @@  discard block
 block discarded – undo
279 331
 			<div id="here_data">
280 332
 				<p>
281 333
 					<label for="hereappid">Here App_Id</label>
282
-					<input type="text" name="hereappid" id="hereappid" value="<?php if (isset($globalHereappId)) print $globalHereappId; ?>" />
334
+					<input type="text" name="hereappid" id="hereappid" value="<?php if (isset($globalHereappId)) {
335
+	print $globalHereappId;
336
+}
337
+?>" />
283 338
 				</p>
284 339
 				<p>
285 340
 					<label for="hereappcode">Here App_Code</label>
286
-					<input type="text" name="hereappcode" id="hereappcode" value="<?php if (isset($globalHereappCode)) print $globalHereappCode; ?>" />
341
+					<input type="text" name="hereappcode" id="hereappcode" value="<?php if (isset($globalHereappCode)) {
342
+	print $globalHereappCode;
343
+}
344
+?>" />
287 345
 				</p>
288 346
 				<p class="help-block">Get a key <a href="https://developer.here.com/rest-apis/documentation/enterprise-map-tile/topics/quick-start.html">here</a></p>
289 347
 			</div>
@@ -291,7 +349,10 @@  discard block
 block discarded – undo
291 349
 			<div id="openweathermap_data">
292 350
 				<p>
293 351
 					<label for="openweathermapkey">OpenWeatherMap key (weather layer)</label>
294
-					<input type="text" name="openweathermapkey" id="openweathermapkey" value="<?php if (isset($globalOpenWeatherMapKey)) print $globalOpenWeatherMapKey; ?>" />
352
+					<input type="text" name="openweathermapkey" id="openweathermapkey" value="<?php if (isset($globalOpenWeatherMapKey)) {
353
+	print $globalOpenWeatherMapKey;
354
+}
355
+?>" />
295 356
 					<p class="help-block">Get a key <a href="https://openweathermap.org/">here</a></p>
296 357
 				</p>
297 358
 			</div>
@@ -320,42 +381,86 @@  discard block
 block discarded – undo
320 381
 			<legend>Coverage area</legend>
321 382
 			<p>
322 383
 				<label for="latitudemax">The maximum latitude (north)</label>
323
-				<input type="text" name="latitudemax" id="latitudemax" value="<?php if (isset($globalLatitudeMax)) print $globalLatitudeMax; ?>" />
384
+				<input type="text" name="latitudemax" id="latitudemax" value="<?php if (isset($globalLatitudeMax)) {
385
+	print $globalLatitudeMax;
386
+}
387
+?>" />
324 388
 			</p>
325 389
 			<p>
326 390
 				<label for="latitudemin">The minimum latitude (south)</label>
327
-				<input type="text" name="latitudemin" id="latitudemin" value="<?php if (isset($globalLatitudeMin)) print $globalLatitudeMin; ?>" />
391
+				<input type="text" name="latitudemin" id="latitudemin" value="<?php if (isset($globalLatitudeMin)) {
392
+	print $globalLatitudeMin;
393
+}
394
+?>" />
328 395
 			</p>
329 396
 			<p>
330 397
 				<label for="longitudemax">The maximum longitude (west)</label>
331
-				<input type="text" name="longitudemax" id="longitudemax" value="<?php if (isset($globalLongitudeMax)) print $globalLongitudeMax; ?>" />
398
+				<input type="text" name="longitudemax" id="longitudemax" value="<?php if (isset($globalLongitudeMax)) {
399
+	print $globalLongitudeMax;
400
+}
401
+?>" />
332 402
 			</p>
333 403
 			<p>
334 404
 				<label for="longitudemin">The minimum longitude (east)</label>
335
-				<input type="text" name="longitudemin" id="longitudemin" value="<?php if (isset($globalLongitudeMin)) print $globalLongitudeMin; ?>" />
405
+				<input type="text" name="longitudemin" id="longitudemin" value="<?php if (isset($globalLongitudeMin)) {
406
+	print $globalLongitudeMin;
407
+}
408
+?>" />
336 409
 			</p>
337 410
 			<p>
338 411
 				<label for="latitudecenter">The latitude center</label>
339
-				<input type="text" name="latitudecenter" id="latitudecenter" value="<?php if (isset($globalCenterLatitude)) print $globalCenterLatitude; ?>" />
412
+				<input type="text" name="latitudecenter" id="latitudecenter" value="<?php if (isset($globalCenterLatitude)) {
413
+	print $globalCenterLatitude;
414
+}
415
+?>" />
340 416
 			</p>
341 417
 			<p>
342 418
 				<label for="longitudecenter">The longitude center</label>
343
-				<input type="text" name="longitudecenter" id="longitudecenter" value="<?php if (isset($globalCenterLongitude)) print $globalCenterLongitude; ?>" />
419
+				<input type="text" name="longitudecenter" id="longitudecenter" value="<?php if (isset($globalCenterLongitude)) {
420
+	print $globalCenterLongitude;
421
+}
422
+?>" />
344 423
 			</p>
345 424
 			<p>
346 425
 				<label for="livezoom">Default Zoom on live map</label>
347
-				<input type="number" name="livezoom" id="livezoom" value="<?php if (isset($globalLiveZoom)) print $globalLiveZoom; else print '9'; ?>" />
426
+				<input type="number" name="livezoom" id="livezoom" value="<?php if (isset($globalLiveZoom)) {
427
+	print $globalLiveZoom;
428
+} else {
429
+	print '9';
430
+}
431
+?>" />
348 432
 			</p>
349 433
 			<p>
350 434
 				<label for="squawk_country">Country for squawk usage</label>
351 435
 				<select name="squawk_country" id="squawk_country">
352
-					<option value="UK"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'UK') print ' selected '; ?>>UK</option>
353
-					<option value="NZ"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NZ') print ' selected '; ?>>NZ</option>
354
-					<option value="US"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'US') print ' selected '; ?>>US</option>
355
-					<option value="AU"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'AU') print ' selected '; ?>>AU</option>
356
-					<option value="NL"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NL') print ' selected '; ?>>NL</option>
357
-					<option value="FR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'FR') print ' selected '; ?>>FR</option>
358
-					<option value="TR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'TR') print ' selected '; ?>>TR</option>
436
+					<option value="UK"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'UK') {
437
+	print ' selected ';
438
+}
439
+?>>UK</option>
440
+					<option value="NZ"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NZ') {
441
+	print ' selected ';
442
+}
443
+?>>NZ</option>
444
+					<option value="US"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'US') {
445
+	print ' selected ';
446
+}
447
+?>>US</option>
448
+					<option value="AU"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'AU') {
449
+	print ' selected ';
450
+}
451
+?>>AU</option>
452
+					<option value="NL"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NL') {
453
+	print ' selected ';
454
+}
455
+?>>NL</option>
456
+					<option value="FR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'FR') {
457
+	print ' selected ';
458
+}
459
+?>>FR</option>
460
+					<option value="TR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'TR') {
461
+	print ' selected ';
462
+}
463
+?>>TR</option>
359 464
 				</select>
360 465
 			</p>
361 466
 		</fieldset>
@@ -364,15 +469,24 @@  discard block
 block discarded – undo
364 469
 			<p><i>Only put in DB flights that are inside a circle</i></p>
365 470
 			<p>
366 471
 				<label for="latitude">Center latitude</label>
367
-				<input type="text" name="zoilatitude" id="latitude" value="<?php if (isset($globalDistanceIgnore['latitude'])) echo $globalDistanceIgnore['latitude']; ?>" />
472
+				<input type="text" name="zoilatitude" id="latitude" value="<?php if (isset($globalDistanceIgnore['latitude'])) {
473
+	echo $globalDistanceIgnore['latitude'];
474
+}
475
+?>" />
368 476
 			</p>
369 477
 			<p>
370 478
 				<label for="longitude">Center longitude</label>
371
-				<input type="text" name="zoilongitude" id="longitude" value="<?php if (isset($globalDistanceIgnore['longitude'])) echo $globalDistanceIgnore['longitude']; ?>" />
479
+				<input type="text" name="zoilongitude" id="longitude" value="<?php if (isset($globalDistanceIgnore['longitude'])) {
480
+	echo $globalDistanceIgnore['longitude'];
481
+}
482
+?>" />
372 483
 			</p>
373 484
 			<p>
374 485
 				<label for="Distance">Distance (in km)</label>
375
-				<input type="text" name="zoidistance" id="distance" value="<?php if (isset($globalDistanceIgnore['distance'])) echo $globalDistanceIgnore['distance']; ?>" />
486
+				<input type="text" name="zoidistance" id="distance" value="<?php if (isset($globalDistanceIgnore['distance'])) {
487
+	echo $globalDistanceIgnore['distance'];
488
+}
489
+?>" />
376 490
 			</p>
377 491
 		</fieldset>
378 492
 		<fieldset id="sourceloc">
@@ -495,11 +609,17 @@  discard block
 block discarded – undo
495 609
 			<div id="flightaware_data">
496 610
 				<p>
497 611
 					<label for="flightawareusername">FlightAware username</label>
498
-					<input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) print $globalFlightAwareUsername; ?>" />
612
+					<input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) {
613
+	print $globalFlightAwareUsername;
614
+}
615
+?>" />
499 616
 				</p>
500 617
 				<p>
501 618
 					<label for="flightawarepassword">FlightAware password/API key</label>
502
-					<input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) print $globalFlightAwarePassword; ?>" />
619
+					<input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) {
620
+	print $globalFlightAwarePassword;
621
+}
622
+?>" />
503 623
 				</p>
504 624
 			</div>
505 625
 -->
@@ -541,7 +661,10 @@  discard block
 block discarded – undo
541 661
 								    if (filter_var($source['host'],FILTER_VALIDATE_URL)) {
542 662
 								?>
543 663
 								<td><input type="text" name="host[]" id="host" value="<?php print $source['host']; ?>" /></td>
544
-								<td><input type="text" name="port[]" class="col-xs-2" id="port" value="<?php if (isset($source['port'])) print $source['port']; ?>" /></td>
664
+								<td><input type="text" name="port[]" class="col-xs-2" id="port" value="<?php if (isset($source['port'])) {
665
+	print $source['port'];
666
+}
667
+?>" /></td>
545 668
 								<?php
546 669
 								    } else {
547 670
 									$hostport = explode(':',$source['host']);
@@ -560,37 +683,118 @@  discard block
 block discarded – undo
560 683
 								?>
561 684
 								<td>
562 685
 									<select name="format[]" id="format">
563
-										<option value="auto" <?php if (!isset($source['format'])) print 'selected'; ?>>Auto</option>
564
-										<option value="sbs" <?php if (isset($source['format']) && $source['format'] == 'sbs') print 'selected'; ?>>SBS</option>
565
-										<option value="tsv" <?php if (isset($source['format']) && $source['format'] == 'tsv') print 'selected'; ?>>TSV</option>
566
-										<option value="raw" <?php if (isset($source['format']) && $source['format'] == 'raw') print 'selected'; ?>>Raw</option>
567
-										<option value="aircraftjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftjson') print 'selected'; ?>>Dump1090 aircraft.json</option>
568
-										<option value="planefinderclient" <?php if (isset($source['format']) && $source['format'] == 'planefinderclient') print 'selected'; ?>>Planefinder client</option>
569
-										<option value="aprs" <?php if (isset($source['format']) && $source['format'] == 'aprs') print 'selected'; ?>>APRS</option>
570
-										<option value="deltadbtxt" <?php if (isset($source['format']) && $source['format'] == 'deltadbtxt') print 'selected'; ?>>Radarcape deltadb.txt</option>
571
-										<option value="vatsimtxt" <?php if (isset($source['format']) && $source['format'] == 'vatsimtxt') print 'selected'; ?>>Vatsim</option>
572
-										<option value="aircraftlistjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftlistjson') print 'selected'; ?>>Virtual Radar Server AircraftList.json</option>
573
-										<option value="vrstcp" <?php if (isset($source['format']) && $source['format'] == 'vrstcp') print 'selected'; ?>>Virtual Radar Server TCP</option>
574
-										<option value="phpvmacars" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') print 'selected'; ?>>phpVMS</option>
575
-										<option value="vaos" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') print 'selected'; ?>>Virtual Airline Operations System (VAOS)</option>
576
-										<option value="vam" <?php if (isset($source['format']) && $source['format'] == 'vam') print 'selected'; ?>>Virtual Airlines Manager</option>
577
-										<option value="whazzup" <?php if (isset($source['format']) && $source['format'] == 'whazzup') print 'selected'; ?>>IVAO</option>
578
-										<option value="flightgearmp" <?php if (isset($source['format']) && $source['format'] == 'flightgearmp') print 'selected'; ?>>FlightGear Multiplayer</option>
579
-										<option value="flightgearsp" <?php if (isset($source['format']) && $source['format'] == 'flightgearsp') print 'selected'; ?>>FlightGear Singleplayer</option>
580
-										<option value="acars" <?php if (isset($source['format']) && $source['format'] == 'acars') print 'selected'; ?>>ACARS from acarsdec/acarsdeco2 over UDP</option>
581
-										<option value="acarssbs3" <?php if (isset($source['format']) && $source['format'] == 'acarssbs3') print 'selected'; ?>>ACARS SBS-3 over TCP</option>
582
-										<option value="ais" <?php if (isset($source['format']) && $source['format'] == 'ais') print 'selected'; ?>>NMEA AIS over TCP</option>
583
-										<option value="airwhere" <?php if (isset($source['format']) && $source['format'] == 'airwhere') print 'selected'; ?>>AirWhere website</option>
584
-										<option value="hidnseek_callback" <?php if (isset($source['format']) && $source['format'] == 'hidnseek_callback') print 'selected'; ?>>HidnSeek Callback</option>
585
-										<option value="blitzortung" <?php if (isset($source['format']) && $source['format'] == 'blitzortung') print 'selected'; ?>>Blitzortung</option>
586
-										<option value="sailaway" <?php if (isset($source['format']) && $source['format'] == 'sailaway') print 'selected'; ?>>Sailaway</option>
686
+										<option value="auto" <?php if (!isset($source['format'])) {
687
+	print 'selected';
688
+}
689
+?>>Auto</option>
690
+										<option value="sbs" <?php if (isset($source['format']) && $source['format'] == 'sbs') {
691
+	print 'selected';
692
+}
693
+?>>SBS</option>
694
+										<option value="tsv" <?php if (isset($source['format']) && $source['format'] == 'tsv') {
695
+	print 'selected';
696
+}
697
+?>>TSV</option>
698
+										<option value="raw" <?php if (isset($source['format']) && $source['format'] == 'raw') {
699
+	print 'selected';
700
+}
701
+?>>Raw</option>
702
+										<option value="aircraftjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftjson') {
703
+	print 'selected';
704
+}
705
+?>>Dump1090 aircraft.json</option>
706
+										<option value="planefinderclient" <?php if (isset($source['format']) && $source['format'] == 'planefinderclient') {
707
+	print 'selected';
708
+}
709
+?>>Planefinder client</option>
710
+										<option value="aprs" <?php if (isset($source['format']) && $source['format'] == 'aprs') {
711
+	print 'selected';
712
+}
713
+?>>APRS</option>
714
+										<option value="deltadbtxt" <?php if (isset($source['format']) && $source['format'] == 'deltadbtxt') {
715
+	print 'selected';
716
+}
717
+?>>Radarcape deltadb.txt</option>
718
+										<option value="vatsimtxt" <?php if (isset($source['format']) && $source['format'] == 'vatsimtxt') {
719
+	print 'selected';
720
+}
721
+?>>Vatsim</option>
722
+										<option value="aircraftlistjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftlistjson') {
723
+	print 'selected';
724
+}
725
+?>>Virtual Radar Server AircraftList.json</option>
726
+										<option value="vrstcp" <?php if (isset($source['format']) && $source['format'] == 'vrstcp') {
727
+	print 'selected';
728
+}
729
+?>>Virtual Radar Server TCP</option>
730
+										<option value="phpvmacars" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') {
731
+	print 'selected';
732
+}
733
+?>>phpVMS</option>
734
+										<option value="vaos" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') {
735
+	print 'selected';
736
+}
737
+?>>Virtual Airline Operations System (VAOS)</option>
738
+										<option value="vam" <?php if (isset($source['format']) && $source['format'] == 'vam') {
739
+	print 'selected';
740
+}
741
+?>>Virtual Airlines Manager</option>
742
+										<option value="whazzup" <?php if (isset($source['format']) && $source['format'] == 'whazzup') {
743
+	print 'selected';
744
+}
745
+?>>IVAO</option>
746
+										<option value="flightgearmp" <?php if (isset($source['format']) && $source['format'] == 'flightgearmp') {
747
+	print 'selected';
748
+}
749
+?>>FlightGear Multiplayer</option>
750
+										<option value="flightgearsp" <?php if (isset($source['format']) && $source['format'] == 'flightgearsp') {
751
+	print 'selected';
752
+}
753
+?>>FlightGear Singleplayer</option>
754
+										<option value="acars" <?php if (isset($source['format']) && $source['format'] == 'acars') {
755
+	print 'selected';
756
+}
757
+?>>ACARS from acarsdec/acarsdeco2 over UDP</option>
758
+										<option value="acarssbs3" <?php if (isset($source['format']) && $source['format'] == 'acarssbs3') {
759
+	print 'selected';
760
+}
761
+?>>ACARS SBS-3 over TCP</option>
762
+										<option value="ais" <?php if (isset($source['format']) && $source['format'] == 'ais') {
763
+	print 'selected';
764
+}
765
+?>>NMEA AIS over TCP</option>
766
+										<option value="airwhere" <?php if (isset($source['format']) && $source['format'] == 'airwhere') {
767
+	print 'selected';
768
+}
769
+?>>AirWhere website</option>
770
+										<option value="hidnseek_callback" <?php if (isset($source['format']) && $source['format'] == 'hidnseek_callback') {
771
+	print 'selected';
772
+}
773
+?>>HidnSeek Callback</option>
774
+										<option value="blitzortung" <?php if (isset($source['format']) && $source['format'] == 'blitzortung') {
775
+	print 'selected';
776
+}
777
+?>>Blitzortung</option>
778
+										<option value="sailaway" <?php if (isset($source['format']) && $source['format'] == 'sailaway') {
779
+	print 'selected';
780
+}
781
+?>>Sailaway</option>
587 782
 									</select>
588 783
 								</td>
589 784
 								<td>
590
-									<input type="text" name="name[]" id="name" value="<?php if (isset($source['name'])) print $source['name']; ?>" />
785
+									<input type="text" name="name[]" id="name" value="<?php if (isset($source['name'])) {
786
+	print $source['name'];
787
+}
788
+?>" />
591 789
 								</td>
592
-								<td><input type="checkbox" name="sourcestats[]" id="sourcestats" title="Create statistics for the source like number of messages, distance,..." value="1" <?php if (isset($source['sourcestats']) && $source['sourcestats']) print 'checked'; ?> /></td>
593
-								<td><input type="checkbox" name="noarchive[]" id="noarchive" title="Don't archive this source" value="1" <?php if (isset($source['noarchive']) && $source['noarchive']) print 'checked'; ?> /></td>
790
+								<td><input type="checkbox" name="sourcestats[]" id="sourcestats" title="Create statistics for the source like number of messages, distance,..." value="1" <?php if (isset($source['sourcestats']) && $source['sourcestats']) {
791
+	print 'checked';
792
+}
793
+?> /></td>
794
+								<td><input type="checkbox" name="noarchive[]" id="noarchive" title="Don't archive this source" value="1" <?php if (isset($source['noarchive']) && $source['noarchive']) {
795
+	print 'checked';
796
+}
797
+?> /></td>
594 798
 								<td>
595 799
 									<select name="timezones[]" id="timezones">
596 800
 								<?php
@@ -600,7 +804,9 @@  discard block
 block discarded – undo
600 804
 											print '<option selected>'.$timezones.'</option>';
601 805
 										} elseif (!isset($source['timezone']) && $timezones == 'UTC') {
602 806
 											print '<option selected>'.$timezones.'</option>';
603
-										} else print '<option>'.$timezones.'</option>';
807
+										} else {
808
+											print '<option>'.$timezones.'</option>';
809
+										}
604 810
 									}
605 811
 								?>
606 812
 									</select>
@@ -654,7 +860,9 @@  discard block
 block discarded – undo
654 860
 									foreach($timezonelist as $timezones){
655 861
 										if ($timezones == 'UTC') {
656 862
 											print '<option selected>'.$timezones.'</option>';
657
-										} else print '<option>'.$timezones.'</option>';
863
+										} else {
864
+											print '<option>'.$timezones.'</option>';
865
+										}
658 866
 									}
659 867
 								?>
660 868
 									</select>
@@ -679,11 +887,17 @@  discard block
 block discarded – undo
679 887
 					<p>Listen UDP server for acarsdec/acarsdeco2/... with <i>daemon-acars.php</i> script</p>
680 888
 					<p>
681 889
 						<label for="acarshost">ACARS UDP host</label>
682
-						<input type="text" name="acarshost" id="acarshost" value="<?php if (isset($globalACARSHost)) print $globalACARSHost; ?>" />
890
+						<input type="text" name="acarshost" id="acarshost" value="<?php if (isset($globalACARSHost)) {
891
+	print $globalACARSHost;
892
+}
893
+?>" />
683 894
 					</p>
684 895
 					<p>
685 896
 						<label for="acarsport">ACARS UDP port</label>
686
-						<input type="number" name="acarsport" id="acarsport" value="<?php if (isset($globalACARSPort)) print $globalACARSPort; ?>" />
897
+						<input type="number" name="acarsport" id="acarsport" value="<?php if (isset($globalACARSPort)) {
898
+	print $globalACARSPort;
899
+}
900
+?>" />
687 901
 					</p>
688 902
 				</fieldset>
689 903
 			</div>
@@ -709,17 +923,38 @@  discard block
 block discarded – undo
709 923
 				    <td><input type="url" name="newsurl[]" value="<?php print $feed; ?>"/></td>
710 924
 				    <td>
711 925
 					<select name="newslang[]">
712
-					    <option value="en"<?php if ($lng == 'en') print ' selected'; ?>>English</option>
713
-					    <option value="fr"<?php if ($lng == 'fr') print ' selected'; ?>>French</option>
926
+					    <option value="en"<?php if ($lng == 'en') {
927
+	print ' selected';
928
+}
929
+?>>English</option>
930
+					    <option value="fr"<?php if ($lng == 'fr') {
931
+	print ' selected';
932
+}
933
+?>>French</option>
714 934
 					</select>
715 935
 				    </td>
716 936
 				    <td>
717 937
 					<select name="newstype[]">
718
-					    <option value="global"<?php if ($type == 'global') print ' selected'; ?>>Global</option>
719
-					    <option value="aircraft"<?php if ($type == 'aircraft') print ' selected'; ?>>Aircraft</option>
720
-					    <option value="marine"<?php if ($type == 'marine') print ' selected'; ?>>Marine</option>
721
-					    <option value="tracker"<?php if ($type == 'tracker') print ' selected'; ?>>Tracker</option>
722
-					    <option value="satellite"<?php if ($type == 'Satellite') print ' selected'; ?>>Satellite</option>
938
+					    <option value="global"<?php if ($type == 'global') {
939
+	print ' selected';
940
+}
941
+?>>Global</option>
942
+					    <option value="aircraft"<?php if ($type == 'aircraft') {
943
+	print ' selected';
944
+}
945
+?>>Aircraft</option>
946
+					    <option value="marine"<?php if ($type == 'marine') {
947
+	print ' selected';
948
+}
949
+?>>Marine</option>
950
+					    <option value="tracker"<?php if ($type == 'tracker') {
951
+	print ' selected';
952
+}
953
+?>>Tracker</option>
954
+					    <option value="satellite"<?php if ($type == 'Satellite') {
955
+	print ' selected';
956
+}
957
+?>>Satellite</option>
723 958
 					</select>
724 959
 				    </td>
725 960
 				    <td><input type="button" value="Delete" onclick="deleteRowNews(this)" /> <input type="button" value="Add" onclick="insRowNews()" /></td>
@@ -861,13 +1096,19 @@  discard block
 block discarded – undo
861 1096
 			<div id="schedules_options">
862 1097
 				<p>
863 1098
 					<label for="britishairways">British Airways API Key</label>
864
-					<input type="text" name="britishairways" id="britishairways" value="<?php if (isset($globalBritishAirwaysKey)) print $globalBritishAirwaysKey; ?>" />
1099
+					<input type="text" name="britishairways" id="britishairways" value="<?php if (isset($globalBritishAirwaysKey)) {
1100
+	print $globalBritishAirwaysKey;
1101
+}
1102
+?>" />
865 1103
 					<p class="help-block">Register an account on <a href="https://developer.ba.com/">https://developer.ba.com/</a></p>
866 1104
 				</p>
867 1105
 				<!--
868 1106
 				<p>
869 1107
 					<label for="transavia">Transavia Test API Consumer Key</label>
870
-					<input type="text" name="transavia" id="transavia" value="<?php if (isset($globalTransaviaKey)) print $globalTransaviaKey; ?>" />
1108
+					<input type="text" name="transavia" id="transavia" value="<?php if (isset($globalTransaviaKey)) {
1109
+	print $globalTransaviaKey;
1110
+}
1111
+?>" />
871 1112
 					<p class="help-block">Register an account on <a href="https://developer.transavia.com">https://developer.transavia.com</a></p>
872 1113
 				</p>
873 1114
 				-->
@@ -876,10 +1117,16 @@  discard block
 block discarded – undo
876 1117
 						<b>Lufthansa API Key</b>
877 1118
 						<p>
878 1119
 							<label for="lufthansakey">Key</label>
879
-							<input type="text" name="lufthansakey" id="lufthansakey" value="<?php if (isset($globalLufthansaKey['key'])) print $globalLufthansaKey['key']; ?>" />
1120
+							<input type="text" name="lufthansakey" id="lufthansakey" value="<?php if (isset($globalLufthansaKey['key'])) {
1121
+	print $globalLufthansaKey['key'];
1122
+}
1123
+?>" />
880 1124
 						</p><p>
881 1125
 							<label for="lufthansasecret">Secret</label>
882
-							<input type="text" name="lufthansasecret" id="lufthansasecret" value="<?php if (isset($globalLufthansaKey['secret'])) print $globalLufthansaKey['secret']; ?>" />
1126
+							<input type="text" name="lufthansasecret" id="lufthansasecret" value="<?php if (isset($globalLufthansaKey['secret'])) {
1127
+	print $globalLufthansaKey['secret'];
1128
+}
1129
+?>" />
883 1130
 						</p>
884 1131
 					</div>
885 1132
 					<p class="help-block">Register an account on <a href="https://developer.lufthansa.com/page">https://developer.lufthansa.com/page</a></p>
@@ -889,11 +1136,17 @@  discard block
 block discarded – undo
889 1136
 						<b>FlightAware API Key</b>
890 1137
 						<p>
891 1138
 							<label for="flightawareusername">Username</label>
892
-							<input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) print $globalFlightAwareUsername; ?>" />
1139
+							<input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) {
1140
+	print $globalFlightAwareUsername;
1141
+}
1142
+?>" />
893 1143
 						</p>
894 1144
 						<p>
895 1145
 							<label for="flightawarepassword">API key</label>
896
-							<input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) print $globalFlightAwarePassword; ?>" />
1146
+							<input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) {
1147
+	print $globalFlightAwarePassword;
1148
+}
1149
+?>" />
897 1150
 						</p>
898 1151
 					</div>
899 1152
 					<p class="help-block">Register an account on <a href="https://www.flightaware.com/">https://www.flightaware.com/</a></p>
@@ -910,10 +1163,22 @@  discard block
 block discarded – undo
910 1163
 				<p>
911 1164
 					<label for="mapmatchingsource">Map Matching source</label>
912 1165
 					<select name="mapmatchingsource" id="mapmatchingsource">
913
-						<option value="fam" <?php if ((isset($globalMapMatchingSource) && $globalMapMatchingSource == 'fam') || !isset($globalMatchingSource)) print 'selected="selected" '; ?>>FlightAirMap Map Matching</option>
914
-						<option value="graphhopper" <?php if (isset($globalMapMatchingSource) && $globalMapMatchingSource == 'graphhopper') print 'selected="selected" '; ?>>GraphHopper</option>
915
-						<option value="osmr" <?php if (isset($globalMapMatchingSource) && $globalMapMatchingSource == 'osmr') print 'selected="selected" '; ?>>OSMR</option>
916
-						<option value="mapbox" <?php if (isset($globalMapMatchingSource) && $globalMapMatchingSource == 'mapbox') print 'selected="selected" '; ?>>Mapbox</option>
1166
+						<option value="fam" <?php if ((isset($globalMapMatchingSource) && $globalMapMatchingSource == 'fam') || !isset($globalMatchingSource)) {
1167
+	print 'selected="selected" ';
1168
+}
1169
+?>>FlightAirMap Map Matching</option>
1170
+						<option value="graphhopper" <?php if (isset($globalMapMatchingSource) && $globalMapMatchingSource == 'graphhopper') {
1171
+	print 'selected="selected" ';
1172
+}
1173
+?>>GraphHopper</option>
1174
+						<option value="osmr" <?php if (isset($globalMapMatchingSource) && $globalMapMatchingSource == 'osmr') {
1175
+	print 'selected="selected" ';
1176
+}
1177
+?>>OSMR</option>
1178
+						<option value="mapbox" <?php if (isset($globalMapMatchingSource) && $globalMapMatchingSource == 'mapbox') {
1179
+	print 'selected="selected" ';
1180
+}
1181
+?>>Mapbox</option>
917 1182
 					</select>
918 1183
 					<p class="help-block">Mapbox need the API Key defined in map section.</p>
919 1184
 					<p class="help-block">FlightAirMap Map Matching is free, without API key but limited to about 100 input points to keep fast results.</p>
@@ -921,7 +1186,10 @@  discard block
 block discarded – undo
921 1186
 				<br />
922 1187
 				<p>
923 1188
 					<label for="graphhopper">GraphHopper API Key</label>
924
-					<input type="text" name="graphhopper" id="graphhopper" value="<?php if (isset($globalGraphHopperKey)) print $globalGraphHopperKey; ?>" />
1189
+					<input type="text" name="graphhopper" id="graphhopper" value="<?php if (isset($globalGraphHopperKey)) {
1190
+	print $globalGraphHopperKey;
1191
+}
1192
+?>" />
925 1193
 					<p class="help-block">Register an account on <a href="https://www.graphhopper.com/">https://www.graphhopper.com/</a></p>
926 1194
 				</p>
927 1195
 			</div>
@@ -939,7 +1207,10 @@  discard block
 block discarded – undo
939 1207
 			</p>
940 1208
 			<p>
941 1209
 				<label for="notamsource">URL of your feed from notaminfo.com</label>
942
-				<input type="text" name="notamsource" id="notamsource" value="<?php if (isset($globalNOTAMSource)) print $globalNOTAMSource; ?>" />
1210
+				<input type="text" name="notamsource" id="notamsource" value="<?php if (isset($globalNOTAMSource)) {
1211
+	print $globalNOTAMSource;
1212
+}
1213
+?>" />
943 1214
 				<p class="help-block">If you want to use world NOTAM from FlightAirMap website, leave it blank</p>
944 1215
 			</p>
945 1216
 			<br />
@@ -955,14 +1226,20 @@  discard block
 block discarded – undo
955 1226
 			<div id="metarsrc">
956 1227
 				<p>
957 1228
 					<label for="metarsource">URL of your METAR source</label>
958
-					<input type="text" name="metarsource" id="metarsource" value="<?php if (isset($globalMETARurl)) print $globalMETARurl; ?>" />
1229
+					<input type="text" name="metarsource" id="metarsource" value="<?php if (isset($globalMETARurl)) {
1230
+	print $globalMETARurl;
1231
+}
1232
+?>" />
959 1233
 					<p class="help-block">Use {icao} to specify where we replace by airport icao. ex : http://metar.vatsim.net/metar.php?id={icao}</p>
960 1234
 				</p>
961 1235
 			</div>
962 1236
 			<br />
963 1237
 			<p>
964 1238
 				<label for="bitly">Bit.ly access token api (used in search page)</label>
965
-				<input type="text" name="bitly" id="bitly" value="<?php if (isset($globalBitlyAccessToken)) print $globalBitlyAccessToken; ?>" />
1239
+				<input type="text" name="bitly" id="bitly" value="<?php if (isset($globalBitlyAccessToken)) {
1240
+	print $globalBitlyAccessToken;
1241
+}
1242
+?>" />
966 1243
 			</p>
967 1244
 			<br />
968 1245
 			<p>
@@ -978,11 +1255,26 @@  discard block
 block discarded – undo
978 1255
 			<p>
979 1256
 				<label for="geoid_source">Geoid Source</label>
980 1257
 				<select name="geoid_source" id="geoid_source">
981
-					<option value="egm96-15"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-15') print ' selected="selected"'; ?>>EGM96 15' (2.1MB)</option>
982
-					<option value="egm96-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-5') print ' selected="selected"'; ?>>EGM96 5' (19MB)</option>
983
-					<option value="egm2008-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-5') print ' selected="selected"'; ?>>EGM2008 5' (19MB)</option>
984
-					<option value="egm2008-2_5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-2_5') print ' selected="selected"'; ?>>EGM2008 2.5' (75MB)</option>
985
-					<option value="egm2008-1"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-1') print ' selected="selected"'; ?>>EGM2008 1' (470MB)</option>
1258
+					<option value="egm96-15"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-15') {
1259
+	print ' selected="selected"';
1260
+}
1261
+?>>EGM96 15' (2.1MB)</option>
1262
+					<option value="egm96-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-5') {
1263
+	print ' selected="selected"';
1264
+}
1265
+?>>EGM96 5' (19MB)</option>
1266
+					<option value="egm2008-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-5') {
1267
+	print ' selected="selected"';
1268
+}
1269
+?>>EGM2008 5' (19MB)</option>
1270
+					<option value="egm2008-2_5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-2_5') {
1271
+	print ' selected="selected"';
1272
+}
1273
+?>>EGM2008 2.5' (75MB)</option>
1274
+					<option value="egm2008-1"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-1') {
1275
+	print ' selected="selected"';
1276
+}
1277
+?>>EGM2008 1' (470MB)</option>
986 1278
 				</select>
987 1279
 				<p class="help-block">The geoid is approximated by an "earth gravity model" (EGM).</p>
988 1280
 			</p>
@@ -1004,7 +1296,12 @@  discard block
 block discarded – undo
1004 1296
 			</p>
1005 1297
 			<p>
1006 1298
 				<label for="archivemonths">Generate statistics, delete or put in archive flights older than xx months</label>
1007
-				<input type="number" name="archivemonths" id="archivemonths" value="<?php if (isset($globalArchiveMonths)) print $globalArchiveMonths; else echo '1'; ?>" />
1299
+				<input type="number" name="archivemonths" id="archivemonths" value="<?php if (isset($globalArchiveMonths)) {
1300
+	print $globalArchiveMonths;
1301
+} else {
1302
+	echo '1';
1303
+}
1304
+?>" />
1008 1305
 				<p class="help-block">0 to disable, delete old flight if <i>Archive all flights data</i> is disabled</p>
1009 1306
 			</p>
1010 1307
 			<p>
@@ -1014,12 +1311,22 @@  discard block
 block discarded – undo
1014 1311
 			</p>
1015 1312
 			<p>
1016 1313
 				<label for="archivekeepmonths">Keep flights data for xx months in archive</label>
1017
-				<input type="number" name="archivekeepmonths" id="archivekeepmonths" value="<?php if (isset($globalArchiveKeepMonths)) print $globalArchiveKeepMonths; else echo '1'; ?>" />
1314
+				<input type="number" name="archivekeepmonths" id="archivekeepmonths" value="<?php if (isset($globalArchiveKeepMonths)) {
1315
+	print $globalArchiveKeepMonths;
1316
+} else {
1317
+	echo '1';
1318
+}
1319
+?>" />
1018 1320
 				<p class="help-block">0 to disable</p>
1019 1321
 			</p>
1020 1322
 			<p>
1021 1323
 				<label for="archivekeeptrackmonths">Keep flights track data for xx months in archive</label>
1022
-				<input type="number" name="archivekeeptrackmonths" id="archivekeeptrackmonths" value="<?php if (isset($globalArchiveKeepTrackMonths)) print $globalArchiveKeepTrackMonths; else echo '1'; ?>" />
1324
+				<input type="number" name="archivekeeptrackmonths" id="archivekeeptrackmonths" value="<?php if (isset($globalArchiveKeepTrackMonths)) {
1325
+	print $globalArchiveKeepTrackMonths;
1326
+} else {
1327
+	echo '1';
1328
+}
1329
+?>" />
1023 1330
 				<p class="help-block">0 to disable, should be less or egal to <i>Keep flights data</i> value</p>
1024 1331
 			</p>
1025 1332
 			<br />
@@ -1029,7 +1336,12 @@  discard block
 block discarded – undo
1029 1336
 				<p class="help-block">Uncheck if the script is running as cron job. You should always run it as daemon when it's possible.</p>
1030 1337
 				<div id="cronends"> 
1031 1338
 					<label for="cronend">Run script for xx seconds</label>
1032
-					<input type="number" name="cronend" id="cronend" value="<?php if (isset($globalCronEnd)) print $globalCronEnd; else print '0'; ?>" />
1339
+					<input type="number" name="cronend" id="cronend" value="<?php if (isset($globalCronEnd)) {
1340
+	print $globalCronEnd;
1341
+} else {
1342
+	print '0';
1343
+}
1344
+?>" />
1033 1345
 					<p class="help-block">Set to 0 to disable. Should be disabled if source is URL.</p>
1034 1346
 				</div>
1035 1347
 			</p>
@@ -1082,20 +1394,40 @@  discard block
 block discarded – undo
1082 1394
 			<br />
1083 1395
 			<p>
1084 1396
 				<label for="refresh">Show flights detected since xxx seconds</label>
1085
-				<input type="number" name="refresh" id="refresh" value="<?php if (isset($globalLiveInterval)) echo $globalLiveInterval; else echo '200'; ?>" />
1397
+				<input type="number" name="refresh" id="refresh" value="<?php if (isset($globalLiveInterval)) {
1398
+	echo $globalLiveInterval;
1399
+} else {
1400
+	echo '200';
1401
+}
1402
+?>" />
1086 1403
 			</p>
1087 1404
 			<p>
1088 1405
 				<label for="maprefresh">Live map refresh (in seconds)</label>
1089
-				<input type="number" name="maprefresh" id="maprefresh" value="<?php if (isset($globalMapRefresh)) echo $globalMapRefresh; else echo '30'; ?>" />
1406
+				<input type="number" name="maprefresh" id="maprefresh" value="<?php if (isset($globalMapRefresh)) {
1407
+	echo $globalMapRefresh;
1408
+} else {
1409
+	echo '30';
1410
+}
1411
+?>" />
1090 1412
 			</p>
1091 1413
 			<p>
1092 1414
 				<label for="mapidle">Map idle timeout (in minutes)</label>
1093
-				<input type="number" name="mapidle" id="mapidle" value="<?php if (isset($globalMapIdleTimeout)) echo $globalMapIdleTimeout; else echo '30'; ?>" />
1415
+				<input type="number" name="mapidle" id="mapidle" value="<?php if (isset($globalMapIdleTimeout)) {
1416
+	echo $globalMapIdleTimeout;
1417
+} else {
1418
+	echo '30';
1419
+}
1420
+?>" />
1094 1421
 				<p class="help-block">0 to disable</p>
1095 1422
 			</p>
1096 1423
 			<p>
1097 1424
 				<label for="minfetch">HTTP/file source fetch every xxx seconds</label>
1098
-				<input type="number" name="minfetch" id="minfetch" value="<?php if (isset($globalMinFetch)) echo $globalMinFetch; else echo '20'; ?>" />
1425
+				<input type="number" name="minfetch" id="minfetch" value="<?php if (isset($globalMinFetch)) {
1426
+	echo $globalMinFetch;
1427
+} else {
1428
+	echo '20';
1429
+}
1430
+?>" />
1099 1431
 			</p>
1100 1432
 			<p>
1101 1433
 				<label for="bbox">Only display flights that we can see on screen (bounding box)</label>
@@ -1109,12 +1441,20 @@  discard block
 block discarded – undo
1109 1441
 			<br />
1110 1442
 			<p>
1111 1443
 				<label for="closestmindist">Distance to airport set as arrival (in km)</label>
1112
-				<input type="number" name="closestmindist" id="closestmindist" value="<?php if (isset($globalClosestMinDist)) echo $globalClosestMinDist; else echo '50'; ?>" />
1444
+				<input type="number" name="closestmindist" id="closestmindist" value="<?php if (isset($globalClosestMinDist)) {
1445
+	echo $globalClosestMinDist;
1446
+} else {
1447
+	echo '50';
1448
+}
1449
+?>" />
1113 1450
 			</p>
1114 1451
 			<br />
1115 1452
 			<p>
1116 1453
 				<label for="aircraftsize">Size of aircraft icon on map (default to 30px if zoom > 7 else 15px), empty to default</label>
1117
-				<input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize;?>" />
1454
+				<input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) {
1455
+	echo $globalAircraftSize;
1456
+}
1457
+?>" />
1118 1458
 			</p>
1119 1459
 			<br />
1120 1460
 			<p>
@@ -1133,7 +1473,12 @@  discard block
 block discarded – undo
1133 1473
 			    if (extension_loaded('gd') && function_exists('gd_info')) {
1134 1474
 			?>
1135 1475
 				<label for="aircrafticoncolor">Color of aircraft icon on map</label>
1136
-				<input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) echo $globalAircraftIconColor; else echo '1a3151'; ?>" />
1476
+				<input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) {
1477
+	echo $globalAircraftIconColor;
1478
+} else {
1479
+	echo '1a3151';
1480
+}
1481
+?>" />
1137 1482
 			<?php
1138 1483
 				if (!is_writable('../cache')) {
1139 1484
 			?>
@@ -1151,14 +1496,27 @@  discard block
 block discarded – undo
1151 1496
 			<p>
1152 1497
 				<label for="airportzoom">Zoom level minimum to see airports icons</label>
1153 1498
 				<div class="range">
1154
-					<input type="range" name="airportzoom" id="airportzoom" value="<?php if (isset($globalAirportZoom)) echo $globalAirportZoom; else echo '7'; ?>" />
1155
-					<output id="range"><?php if (isset($globalAirportZoom)) echo $globalAirportZoom; else echo '7'; ?></output>
1499
+					<input type="range" name="airportzoom" id="airportzoom" value="<?php if (isset($globalAirportZoom)) {
1500
+	echo $globalAirportZoom;
1501
+} else {
1502
+	echo '7';
1503
+}
1504
+?>" />
1505
+					<output id="range"><?php if (isset($globalAirportZoom)) {
1506
+	echo $globalAirportZoom;
1507
+} else {
1508
+	echo '7';
1509
+}
1510
+?></output>
1156 1511
 				</div>
1157 1512
 			</p>
1158 1513
 			<br />
1159 1514
 			<p>
1160 1515
 				<label for="customcss">Custom CSS web path</label>
1161
-				<input type="text" name="customcss" id="customcss" value="<?php if (isset($globalCustomCSS)) echo $globalCustomCSS; ?>" />
1516
+				<input type="text" name="customcss" id="customcss" value="<?php if (isset($globalCustomCSS)) {
1517
+	echo $globalCustomCSS;
1518
+}
1519
+?>" />
1162 1520
 			</p>
1163 1521
 		</fieldset>
1164 1522
 		<input type="submit" name="submit" value="Create/Update database & write setup" />
@@ -1185,8 +1543,12 @@  discard block
 block discarded – undo
1185 1543
 	$dbhost = filter_input(INPUT_POST,'dbhost',FILTER_SANITIZE_STRING);
1186 1544
 	$dbport = filter_input(INPUT_POST,'dbport',FILTER_SANITIZE_STRING);
1187 1545
 
1188
-	if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) $error .= 'Mysql driver for PDO must be loaded';
1189
-	if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) $error .= 'PosgreSQL driver for PDO must be loaded';
1546
+	if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) {
1547
+		$error .= 'Mysql driver for PDO must be loaded';
1548
+	}
1549
+	if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) {
1550
+		$error .= 'PosgreSQL driver for PDO must be loaded';
1551
+	}
1190 1552
 	
1191 1553
 	$_SESSION['database_root'] = $dbroot;
1192 1554
 	$_SESSION['database_rootpass'] = $dbrootpass;
@@ -1254,15 +1616,23 @@  discard block
 block discarded – undo
1254 1616
 	$source_city = $_POST['source_city'];
1255 1617
 	$source_country = $_POST['source_country'];
1256 1618
 	$source_ref = $_POST['source_ref'];
1257
-	if (isset($source_id)) $source_id = $_POST['source_id'];
1258
-	else $source_id = array();
1619
+	if (isset($source_id)) {
1620
+		$source_id = $_POST['source_id'];
1621
+	} else {
1622
+		$source_id = array();
1623
+	}
1259 1624
 	
1260 1625
 	$sources = array();
1261 1626
 	foreach ($source_name as $keys => $name) {
1262
-	    if (isset($source_id[$keys])) $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'id' => $source_id[$keys],'source' => $source_ref[$keys]);
1263
-	    else $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'source' => $source_ref[$keys]);
1627
+	    if (isset($source_id[$keys])) {
1628
+	    	$sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'id' => $source_id[$keys],'source' => $source_ref[$keys]);
1629
+	    } else {
1630
+	    	$sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'source' => $source_ref[$keys]);
1631
+	    }
1632
+	}
1633
+	if (count($sources) > 0) {
1634
+		$_SESSION['sources'] = $sources;
1264 1635
 	}
1265
-	if (count($sources) > 0) $_SESSION['sources'] = $sources;
1266 1636
 
1267 1637
 	$newsurl = $_POST['newsurl'];
1268 1638
 	$newslng = $_POST['newslang'];
@@ -1275,7 +1645,9 @@  discard block
 block discarded – undo
1275 1645
 		$lng = $newslng[$newskey];
1276 1646
 		if (isset($newsfeeds[$type][$lng])) {
1277 1647
 		    $newsfeeds[$type][$lng] = array_merge($newsfeeds[$type][$lng],array($url));
1278
-		} else $newsfeeds[$type][$lng] = array($url);
1648
+		} else {
1649
+			$newsfeeds[$type][$lng] = array($url);
1650
+		}
1279 1651
 	    }
1280 1652
 	}
1281 1653
 	$settings = array_merge($settings,array('globalNewsFeeds' => $newsfeeds));
@@ -1300,17 +1672,29 @@  discard block
 block discarded – undo
1300 1672
 	$datasource = filter_input(INPUT_POST,'datasource',FILTER_SANITIZE_STRING);
1301 1673
 
1302 1674
 	$globalaircraft = filter_input(INPUT_POST,'globalaircraft',FILTER_SANITIZE_STRING);
1303
-	if ($globalaircraft == 'aircraft') $settings = array_merge($settings,array('globalAircraft' => 'TRUE'));
1304
-	else $settings = array_merge($settings,array('globalAircraft' => 'FALSE'));
1675
+	if ($globalaircraft == 'aircraft') {
1676
+		$settings = array_merge($settings,array('globalAircraft' => 'TRUE'));
1677
+	} else {
1678
+		$settings = array_merge($settings,array('globalAircraft' => 'FALSE'));
1679
+	}
1305 1680
 	$globaltracker = filter_input(INPUT_POST,'globaltracker',FILTER_SANITIZE_STRING);
1306
-	if ($globaltracker == 'tracker') $settings = array_merge($settings,array('globalTracker' => 'TRUE'));
1307
-	else $settings = array_merge($settings,array('globalTracker' => 'FALSE'));
1681
+	if ($globaltracker == 'tracker') {
1682
+		$settings = array_merge($settings,array('globalTracker' => 'TRUE'));
1683
+	} else {
1684
+		$settings = array_merge($settings,array('globalTracker' => 'FALSE'));
1685
+	}
1308 1686
 	$globalmarine = filter_input(INPUT_POST,'globalmarine',FILTER_SANITIZE_STRING);
1309
-	if ($globalmarine == 'marine') $settings = array_merge($settings,array('globalMarine' => 'TRUE'));
1310
-	else $settings = array_merge($settings,array('globalMarine' => 'FALSE'));
1687
+	if ($globalmarine == 'marine') {
1688
+		$settings = array_merge($settings,array('globalMarine' => 'TRUE'));
1689
+	} else {
1690
+		$settings = array_merge($settings,array('globalMarine' => 'FALSE'));
1691
+	}
1311 1692
 	$globalsatellite = filter_input(INPUT_POST,'globalsatellite',FILTER_SANITIZE_STRING);
1312
-	if ($globalsatellite == 'satellite') $settings = array_merge($settings,array('globalSatellite' => 'TRUE'));
1313
-	else $settings = array_merge($settings,array('globalSatellite' => 'FALSE'));
1693
+	if ($globalsatellite == 'satellite') {
1694
+		$settings = array_merge($settings,array('globalSatellite' => 'TRUE'));
1695
+	} else {
1696
+		$settings = array_merge($settings,array('globalSatellite' => 'FALSE'));
1697
+	}
1314 1698
 
1315 1699
 /*	
1316 1700
 	$globalSBS1Hosts = array();
@@ -1332,23 +1716,37 @@  discard block
 block discarded – undo
1332 1716
 	$name = $_POST['name'];
1333 1717
 	$format = $_POST['format'];
1334 1718
 	$timezones = $_POST['timezones'];
1335
-	if (isset($_POST['sourcestats'])) $sourcestats = $_POST['sourcestats'];
1336
-	else $sourcestats = array();
1337
-	if (isset($_POST['noarchive'])) $noarchive = $_POST['noarchive'];
1338
-	else $noarchive = array();
1719
+	if (isset($_POST['sourcestats'])) {
1720
+		$sourcestats = $_POST['sourcestats'];
1721
+	} else {
1722
+		$sourcestats = array();
1723
+	}
1724
+	if (isset($_POST['noarchive'])) {
1725
+		$noarchive = $_POST['noarchive'];
1726
+	} else {
1727
+		$noarchive = array();
1728
+	}
1339 1729
 	$gSources = array();
1340 1730
 	$forcepilots = false;
1341 1731
 	foreach ($host as $key => $h) {
1342
-		if (isset($sourcestats[$key]) && $sourcestats[$key] == 1) $cov = 'TRUE';
1343
-		else $cov = 'FALSE';
1344
-		if (isset($noarchive[$key]) && $noarchive[$key] == 1) $arch = 'TRUE';
1345
-		else $arch = 'FALSE';
1732
+		if (isset($sourcestats[$key]) && $sourcestats[$key] == 1) {
1733
+			$cov = 'TRUE';
1734
+		} else {
1735
+			$cov = 'FALSE';
1736
+		}
1737
+		if (isset($noarchive[$key]) && $noarchive[$key] == 1) {
1738
+			$arch = 'TRUE';
1739
+		} else {
1740
+			$arch = 'FALSE';
1741
+		}
1346 1742
 		if (strpos($format[$key],'_callback')) {
1347 1743
 			$gSources[] = array('host' => $h, 'pass' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezones[$key],'callback' => 'TRUE');
1348 1744
 		} elseif ($format[$key] != 'auto' || ($h != '' || $name[$key] != '')) {
1349 1745
 			$gSources[] = array('host' => $h, 'port' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezones[$key],'callback' => 'FALSE');
1350 1746
 		}
1351
-		if ($format[$key] == 'airwhere') $forcepilots = true;
1747
+		if ($format[$key] == 'airwhere') {
1748
+			$forcepilots = true;
1749
+		}
1352 1750
 	}
1353 1751
 	$settings = array_merge($settings,array('globalSources' => $gSources));
1354 1752
 
@@ -1379,7 +1777,9 @@  discard block
 block discarded – undo
1379 1777
 	$zoidistance = filter_input(INPUT_POST,'zoidistance',FILTER_SANITIZE_NUMBER_INT);
1380 1778
 	if ($zoilatitude != '' && $zoilongitude != '' && $zoidistance != '') {
1381 1779
 		$settings = array_merge($settings,array('globalDistanceIgnore' => array('latitude' => $zoilatitude,'longitude' => $zoilongitude,'distance' => $zoidistance)));
1382
-	} else $settings = array_merge($settings,array('globalDistanceIgnore' => array()));
1780
+	} else {
1781
+		$settings = array_merge($settings,array('globalDistanceIgnore' => array()));
1782
+	}
1383 1783
 
1384 1784
 	$refresh = filter_input(INPUT_POST,'refresh',FILTER_SANITIZE_NUMBER_INT);
1385 1785
 	$settings = array_merge($settings,array('globalLiveInterval' => $refresh));
@@ -1420,7 +1820,9 @@  discard block
 block discarded – undo
1420 1820
 
1421 1821
 	// Create in settings.php keys not yet configurable if not already here
1422 1822
 	//if (!isset($globalImageBingKey)) $settings = array_merge($settings,array('globalImageBingKey' => ''));
1423
-	if (!isset($globalDebug)) $settings = array_merge($settings,array('globalDebug' => 'TRUE'));
1823
+	if (!isset($globalDebug)) {
1824
+		$settings = array_merge($settings,array('globalDebug' => 'TRUE'));
1825
+	}
1424 1826
 
1425 1827
 	$resetyearstats = filter_input(INPUT_POST,'resetyearstats',FILTER_SANITIZE_STRING);
1426 1828
 	if ($resetyearstats == 'resetyearstats') {
@@ -1463,37 +1865,56 @@  discard block
 block discarded – undo
1463 1865
 	}
1464 1866
 */
1465 1867
 	$settings = array_merge($settings,array('globalFlightAware' => 'FALSE'));
1466
-	if ($globalsbs == 'sbs') $settings = array_merge($settings,array('globalSBS1' => 'TRUE'));
1467
-	else $settings = array_merge($settings,array('globalSBS1' => 'FALSE'));
1468
-	if ($globalaprs == 'aprs') $settings = array_merge($settings,array('globalAPRS' => 'TRUE'));
1469
-	else $settings = array_merge($settings,array('globalAPRS' => 'FALSE'));
1868
+	if ($globalsbs == 'sbs') {
1869
+		$settings = array_merge($settings,array('globalSBS1' => 'TRUE'));
1870
+	} else {
1871
+		$settings = array_merge($settings,array('globalSBS1' => 'FALSE'));
1872
+	}
1873
+	if ($globalaprs == 'aprs') {
1874
+		$settings = array_merge($settings,array('globalAPRS' => 'TRUE'));
1875
+	} else {
1876
+		$settings = array_merge($settings,array('globalAPRS' => 'FALSE'));
1877
+	}
1470 1878
 	$va = false;
1471 1879
 	if ($globalivao == 'ivao') {
1472 1880
 		$settings = array_merge($settings,array('globalIVAO' => 'TRUE'));
1473 1881
 		$va = true;
1474
-	} else $settings = array_merge($settings,array('globalIVAO' => 'FALSE'));
1882
+	} else {
1883
+		$settings = array_merge($settings,array('globalIVAO' => 'FALSE'));
1884
+	}
1475 1885
 	if ($globalvatsim == 'vatsim') {
1476 1886
 		$settings = array_merge($settings,array('globalVATSIM' => 'TRUE'));
1477 1887
 		$va = true;
1478
-	} else $settings = array_merge($settings,array('globalVATSIM' => 'FALSE'));
1888
+	} else {
1889
+		$settings = array_merge($settings,array('globalVATSIM' => 'FALSE'));
1890
+	}
1479 1891
 	if ($globalphpvms == 'phpvms') {
1480 1892
 		$settings = array_merge($settings,array('globalphpVMS' => 'TRUE'));
1481 1893
 		$va = true;
1482
-	} else $settings = array_merge($settings,array('globalphpVMS' => 'FALSE'));
1894
+	} else {
1895
+		$settings = array_merge($settings,array('globalphpVMS' => 'FALSE'));
1896
+	}
1483 1897
 	if ($globalvam == 'vam') {
1484 1898
 		$settings = array_merge($settings,array('globalVAM' => 'TRUE'));
1485 1899
 		$va = true;
1486
-	} else $settings = array_merge($settings,array('globalVAM' => 'FALSE'));
1900
+	} else {
1901
+		$settings = array_merge($settings,array('globalVAM' => 'FALSE'));
1902
+	}
1487 1903
 	if ($va) {
1488 1904
 		$settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE','globalTranslationFetch' => 'FALSE'));
1489
-	} else $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE'));
1905
+	} else {
1906
+		$settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE'));
1907
+	}
1490 1908
 	if ($globalva == 'va' || $va) {
1491 1909
 		$settings = array_merge($settings,array('globalVA' => 'TRUE'));
1492 1910
 		$settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE'));
1493 1911
 	} else {
1494 1912
 		$settings = array_merge($settings,array('globalVA' => 'FALSE'));
1495
-		if ($forcepilots) $settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE'));
1496
-		else $settings = array_merge($settings,array('globalUsePilot' => 'FALSE','globalUseOwner' => 'TRUE'));
1913
+		if ($forcepilots) {
1914
+			$settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE'));
1915
+		} else {
1916
+			$settings = array_merge($settings,array('globalUsePilot' => 'FALSE','globalUseOwner' => 'TRUE'));
1917
+		}
1497 1918
 	}
1498 1919
 	if ($globalvm == 'vm') {
1499 1920
 		$settings = array_merge($settings,array('globalVM' => 'TRUE'));
@@ -1732,7 +2153,9 @@  discard block
 block discarded – undo
1732 2153
 	$graphhopper = filter_input(INPUT_POST,'graphhopper',FILTER_SANITIZE_STRING);
1733 2154
 	$settings = array_merge($settings,array('globalGraphHopperKey' => $graphhopper));
1734 2155
 
1735
-	if (!isset($globalTransaction)) $settings = array_merge($settings,array('globalTransaction' => 'TRUE'));
2156
+	if (!isset($globalTransaction)) {
2157
+		$settings = array_merge($settings,array('globalTransaction' => 'TRUE'));
2158
+	}
1736 2159
 
1737 2160
 	// Set some defaults values...
1738 2161
 	if (!isset($globalAircraftImageSources)) {
@@ -1747,15 +2170,23 @@  discard block
 block discarded – undo
1747 2170
 
1748 2171
 	$settings = array_merge($settings,array('globalInstalled' => 'TRUE'));
1749 2172
 
1750
-	if ($error == '') settings::modify_settings($settings);
1751
-	if ($error == '') settings::comment_settings($settings_comment);
2173
+	if ($error == '') {
2174
+		settings::modify_settings($settings);
2175
+	}
2176
+	if ($error == '') {
2177
+		settings::comment_settings($settings_comment);
2178
+	}
1752 2179
 	if ($error != '') {
1753 2180
 		print '<div class="info column">'.$error.'</div>';
1754 2181
 		require('../footer.php');
1755 2182
 		exit;
1756 2183
 	} else {
1757
-		if (isset($_POST['waypoints']) && $_POST['waypoints'] == 'waypoints') $_SESSION['waypoints'] = 1;
1758
-		if (isset($_POST['owner']) && $_POST['owner'] == 'owner') $_SESSION['owner'] = 1;
2184
+		if (isset($_POST['waypoints']) && $_POST['waypoints'] == 'waypoints') {
2185
+			$_SESSION['waypoints'] = 1;
2186
+		}
2187
+		if (isset($_POST['owner']) && $_POST['owner'] == 'owner') {
2188
+			$_SESSION['owner'] = 1;
2189
+		}
1759 2190
 		if (isset($_POST['createdb'])) {
1760 2191
 			$_SESSION['install'] = 'database_create';
1761 2192
 		} else {
@@ -1792,10 +2223,18 @@  discard block
 block discarded – undo
1792 2223
 	$popw = false;
1793 2224
 	foreach ($_SESSION['done'] as $done) {
1794 2225
 	    print '<li>'.$done.'....<strong>SUCCESS</strong></li>';
1795
-	    if ($done == 'Create database') $pop = true;
1796
-	    if ($_SESSION['install'] == 'database_create') $pop = true;
1797
-	    if ($_SESSION['install'] == 'database_import') $popi = true;
1798
-	    if ($_SESSION['install'] == 'waypoints') $popw = true;
2226
+	    if ($done == 'Create database') {
2227
+	    	$pop = true;
2228
+	    }
2229
+	    if ($_SESSION['install'] == 'database_create') {
2230
+	    	$pop = true;
2231
+	    }
2232
+	    if ($_SESSION['install'] == 'database_import') {
2233
+	    	$popi = true;
2234
+	    }
2235
+	    if ($_SESSION['install'] == 'waypoints') {
2236
+	    	$popw = true;
2237
+	    }
1799 2238
 	}
1800 2239
 	if ($pop) {
1801 2240
 	    sleep(5);
@@ -1806,7 +2245,9 @@  discard block
 block discarded – undo
1806 2245
 	} else if ($popw) {
1807 2246
 	    sleep(5);
1808 2247
 	    print '<li>Populate waypoints database....<img src="../images/loading.gif" /></li>';
1809
-	} else print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>';
2248
+	} else {
2249
+		print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>';
2250
+	}
1810 2251
 	print '</div></ul>';
1811 2252
 	print '<div id="error"></div>';
1812 2253
 /*	foreach ($_SESSION['done'] as $done) {
Please login to merge, or discard this patch.
index.php 1 patch
Braces   +562 added lines, -142 removed lines patch added patch discarded remove patch
@@ -52,7 +52,10 @@  discard block
 block discarded – undo
52 52
 <?php
53 53
     if ((!isset($_COOKIE['MapFormat']) && isset($globalMap3Ddefault) && $globalMap3Ddefault) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d')) {
54 54
 ?>
55
-<script src="<?php echo $globalURL; ?>/js/map.3d.js.php<?php if (isset($tsk)) print '?tsk='.$tsk; ?>"></script>
55
+<script src="<?php echo $globalURL; ?>/js/map.3d.js.php<?php if (isset($tsk)) {
56
+	print '?tsk='.$tsk;
57
+}
58
+?>"></script>
56 59
 <?php
57 60
 	if (!isset($globalAircraft) || $globalAircraft) {
58 61
 ?>
@@ -130,7 +133,10 @@  discard block
 block discarded – undo
130 133
 			<h1>Weather</h1>
131 134
 			<ul>
132 135
 			
133
-				<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>
136
+				<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') {
137
+	print 'checked';
138
+}
139
+?> /><?php echo _("Weather Winds"); ?></label></div></li>
134 140
 			
135 141
 <?php
136 142
 		if (isset($globalOpenWeatherMapKey) && $globalOpenWeatherMapKey != '') {
@@ -149,7 +155,10 @@  discard block
 block discarded – undo
149 155
 ?>
150 156
 			<h1>Weather</h1>
151 157
 			<ul>
152
-				<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>
158
+				<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))) {
159
+	print 'checked';
160
+}
161
+?> ><?php echo _("Display weather on 3D map"); ?></label></div></li>
153 162
 			</ul>
154 163
 <?php
155 164
 	}
@@ -166,13 +175,22 @@  discard block
 block discarded – undo
166 175
 <?php
167 176
 		if (!isset($globalAircraft) || $globalAircraft) {
168 177
 ?>
169
-				<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>
170
-				<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>
178
+				<li><div class="checkbox"><label><input type="checkbox" name="waypoints" value="1" onclick="showWaypoints(this);" <?php if (isset($_COOKIE['waypoints']) && $_COOKIE['waypoints'] == 'true') {
179
+	print 'checked';
180
+}
181
+?> /><?php echo _("Display waypoints"); ?></label></div></li>
182
+				<li><div class="checkbox"><label><input type="checkbox" name="airspace" value="1" onclick="showAirspace(this);" <?php if (isset($_COOKIE['airspace']) && $_COOKIE['airspace'] == 'true') {
183
+	print 'checked';
184
+}
185
+?> /><?php echo _("Display airspace"); ?></label></div></li>
171 186
 <?php
172 187
 		}
173 188
 		if (isset($globalMarine) && $globalMarine) {
174 189
 ?>
175
-				<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>
190
+				<li><div class="checkbox"><label><input type="checkbox" name="openseamap" value="1" onclick="clickOpenSeaMap(this);" <?php if (isset($_COOKIE['openseamap']) && $_COOKIE['openseamap'] == 'true') {
191
+	print 'checked';
192
+}
193
+?> /><?php echo _("Display OpenSeaMap"); ?></label></div></li>
176 194
 <?php
177 195
 		}
178 196
 ?>
@@ -187,13 +205,22 @@  discard block
 block discarded – undo
187 205
 <?php
188 206
 		if (!isset($globalAircraft) || $globalAircraft) {
189 207
 ?>
190
-				<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>
191
-				<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>
208
+				<li><div class="checkbox"><label><input type="checkbox" name="waypoints" value="1" onclick="showWaypoints(this);" <?php if (isset($_COOKIE['waypoints']) && $_COOKIE['waypoints'] == 'true') {
209
+	print 'checked';
210
+}
211
+?> /><?php echo _("Display waypoints"); ?> Beta</label></div></li>
212
+				<li><div class="checkbox"><label><input type="checkbox" name="airspace" value="1" onclick="showAirspace(this);" <?php if (isset($_COOKIE['airspace']) && $_COOKIE['airspace'] == 'true') {
213
+	print 'checked';
214
+}
215
+?> /><?php echo _("Display airspace"); ?> Beta</label></div></li>
192 216
 <?php
193 217
 		}
194 218
 		if (isset($globalMarine) && $globalMarine) {
195 219
 ?>
196
-				<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>
220
+				<li><div class="checkbox"><label><input type="checkbox" name="openseamap" value="1" onclick="clickOpenSeaMap(this);" <?php if (isset($_COOKIE['openseamap']) && $_COOKIE['openseamap'] == 'true') {
221
+	print 'checked';
222
+}
223
+?> /><?php echo _("Display OpenSeaMap"); ?></label></div></li>
197 224
 <?php
198 225
 		}
199 226
 ?>
@@ -208,14 +235,32 @@  discard block
 block discarded – undo
208 235
 		<h1>NOTAM</h1>
209 236
 		<form>
210 237
 			<ul>
211
-				<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>
238
+				<li><div class="checkbox"><label><input type="checkbox" name="notamcb" value="1" onclick="showNotam(this);" <?php if (isset($_COOKIE['notam']) && $_COOKIE['notam'] == 'true') {
239
+	print 'checked';
240
+}
241
+?> /><?php echo _("Display NOTAM"); ?></label></div></li>
212 242
 				<li><?php echo _("NOTAM scope:"); ?>
213 243
 					<select class="selectpicker" onchange="notamscope(this);">
214
-						<option<?php if (!isset($_COOKIE['notamscope']) || $_COOKIE['notamscope'] == 'All') print ' selected'; ?>>All</option>
215
-						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport/Enroute warning') print ' selected'; ?>>Airport/Enroute warning</option>
216
-						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport warning') print ' selected'; ?>>Airport warning</option>
217
-						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Navigation warning') print ' selected'; ?>>Navigation warning</option>
218
-						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Enroute warning') print ' selected'; ?>>Enroute warning</option>
244
+						<option<?php if (!isset($_COOKIE['notamscope']) || $_COOKIE['notamscope'] == 'All') {
245
+	print ' selected';
246
+}
247
+?>>All</option>
248
+						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport/Enroute warning') {
249
+	print ' selected';
250
+}
251
+?>>Airport/Enroute warning</option>
252
+						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport warning') {
253
+	print ' selected';
254
+}
255
+?>>Airport warning</option>
256
+						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Navigation warning') {
257
+	print ' selected';
258
+}
259
+?>>Navigation warning</option>
260
+						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Enroute warning') {
261
+	print ' selected';
262
+}
263
+?>>Enroute warning</option>
219 264
 					</select
220 265
 				</li>
221 266
 			</ul>
@@ -243,7 +288,10 @@  discard block
 block discarded – undo
243 288
 		    <div class="form-group">
244 289
 			<label><?php echo _("From:"); ?></label>
245 290
 			<div class='input-group date' id='datetimepicker1'>
246
-			    <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 />
291
+			    <input type='text' id="start_date" name="start_date" class="form-control" autocomplete="off" value="<?php if (isset($_COOKIE['archive_begin']) && $_COOKIE['archive_begin'] != '') {
292
+	print date("Y-m-d H:i",$_COOKIE['archive_begin']).' UTC';
293
+}
294
+?>" required />
247 295
 			    <span class="input-group-addon">
248 296
 				<span class="glyphicon glyphicon-calendar"></span>
249 297
 			    </span>
@@ -252,7 +300,10 @@  discard block
 block discarded – undo
252 300
 		    <div class="form-group">
253 301
 			<label><?php echo _("To:"); ?></label>
254 302
 			<div class='input-group date' id='datetimepicker2'>
255
-			    <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'; ?>" />
303
+			    <input type='text' id="end_date" name="end_date" class="form-control" autocomplete="off" value="<?php if (isset($_COOKIE['archive_end']) && $_COOKIE['archive_end'] != '') {
304
+	print date("Y-m-d H:i",$_COOKIE['archive_end']).' UTC';
305
+}
306
+?>" />
256 307
 			    <span class="input-group-addon">
257 308
 				<span class="glyphicon glyphicon-calendar"></span>
258 309
 			    </span>
@@ -284,8 +335,20 @@  discard block
 block discarded – undo
284 335
 		    </script>
285 336
 		<li><?php echo _("Playback speed:"); ?>
286 337
 		    <div class="range">
287
-			<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'; ?>">
288
-			<output id="archivespeedrange"><?php  if (isset($_COOKIE['archive_speed'])) print $_COOKIE['archive_speed']; else print '1'; ?></output>
338
+			<input type="range" min="0" max="50" step="1" id="archivespeed" name="archivespeed" onChange="archivespeedrange.value=value;" value="<?php  if (isset($_POST['archivespeed'])) {
339
+	print $_POST['archivespeed'];
340
+} elseif (isset($_COOKIE['archive_speed'])) {
341
+	print $_COOKIE['archive_speed'];
342
+} else {
343
+	print '1';
344
+}
345
+?>">
346
+			<output id="archivespeedrange"><?php  if (isset($_COOKIE['archive_speed'])) {
347
+	print $_COOKIE['archive_speed'];
348
+} else {
349
+	print '1';
350
+}
351
+?></output>
289 352
 		    </div>
290 353
 		</li>
291 354
 		<?php
@@ -314,14 +377,20 @@  discard block
 block discarded – undo
314 377
 		    <li><?php echo _("Type of Map:"); ?>
315 378
 			    <?php
316 379
 				if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) {
317
-					if (!isset($_COOKIE['MapType']) || $_COOKIE['MapType'] == '') $MapType = $globalMapProvider;
318
-					else $MapType = $_COOKIE['MapType'];
380
+					if (!isset($_COOKIE['MapType']) || $_COOKIE['MapType'] == '') {
381
+						$MapType = $globalMapProvider;
382
+					} else {
383
+						$MapType = $_COOKIE['MapType'];
384
+					}
319 385
 			    ?>
320 386
 			<select  class="selectpicker" onchange="mapType(this);">
321 387
 			    <?php
322 388
 				} else {
323
-					if (!isset($_COOKIE['MapType3D']) || $_COOKIE['MapType3D'] == '') $MapType = $globalMapProvider;
324
-					else $MapType = $_COOKIE['MapType3D'];
389
+					if (!isset($_COOKIE['MapType3D']) || $_COOKIE['MapType3D'] == '') {
390
+						$MapType = $globalMapProvider;
391
+					} else {
392
+						$MapType = $_COOKIE['MapType3D'];
393
+					}
325 394
 			    ?>
326 395
 			<select  class="selectpicker" onchange="mapType3D(this);">
327 396
 			    <?php
@@ -330,24 +399,48 @@  discard block
 block discarded – undo
330 399
 			    <?php
331 400
 				if (isset($globalMapOffline) && $globalMapOffline === TRUE) {
332 401
 			    ?>
333
-			    <option value="offline"<?php if ($MapType == 'offline') print ' selected'; ?>>Natural Earth (local)</option>
402
+			    <option value="offline"<?php if ($MapType == 'offline') {
403
+	print ' selected';
404
+}
405
+?>>Natural Earth (local)</option>
334 406
 			    <?php
335 407
 				} else {
336 408
 				    if (file_exists(dirname(__FILE__).'/js/Cesium/Assets/Textures/NaturalEarthII/tilemapresource.xml')) {
337 409
 			    ?>
338
-			    <option value="offline"<?php if ($MapType == 'offline') print ' selected'; ?>>Natural Earth (local)</option>
410
+			    <option value="offline"<?php if ($MapType == 'offline') {
411
+	print ' selected';
412
+}
413
+?>>Natural Earth (local)</option>
339 414
 			    <?php
340 415
 				    }
341 416
 			    ?>
342
-			    <option value="ArcGIS-Streetmap"<?php if ($MapType == 'ArcGIS-Streetmap') print ' selected'; ?>>ArcGIS Streetmap</option>
343
-			    <option value="ArcGIS-Satellite"<?php if ($MapType == 'ArcGIS-Satellite') print ' selected'; ?>>ArcGIS Satellite</option>
344
-			    <option value="ArcGIS-Satellite"<?php if ($MapType == 'ArcGIS-Ocean') print ' selected'; ?>>ArcGIS Ocean</option>
417
+			    <option value="ArcGIS-Streetmap"<?php if ($MapType == 'ArcGIS-Streetmap') {
418
+	print ' selected';
419
+}
420
+?>>ArcGIS Streetmap</option>
421
+			    <option value="ArcGIS-Satellite"<?php if ($MapType == 'ArcGIS-Satellite') {
422
+	print ' selected';
423
+}
424
+?>>ArcGIS Satellite</option>
425
+			    <option value="ArcGIS-Satellite"<?php if ($MapType == 'ArcGIS-Ocean') {
426
+	print ' selected';
427
+}
428
+?>>ArcGIS Ocean</option>
345 429
 			    <?php
346 430
 				    if (isset($globalBingMapKey) && $globalBingMapKey != '') {
347 431
 			    ?>
348
-			    <option value="Bing-Aerial"<?php if ($MapType == 'Bing-Aerial') print ' selected'; ?>>Bing-Aerial</option>
349
-			    <option value="Bing-Hybrid"<?php if ($MapType == 'Bing-Hybrid') print ' selected'; ?>>Bing-Hybrid</option>
350
-			    <option value="Bing-Road"<?php if ($MapType == 'Bing-Road') print ' selected'; ?>>Bing-Road</option>
432
+			    <option value="Bing-Aerial"<?php if ($MapType == 'Bing-Aerial') {
433
+	print ' selected';
434
+}
435
+?>>Bing-Aerial</option>
436
+			    <option value="Bing-Hybrid"<?php if ($MapType == 'Bing-Hybrid') {
437
+	print ' selected';
438
+}
439
+?>>Bing-Hybrid</option>
440
+			    <option value="Bing-Road"<?php if ($MapType == 'Bing-Road') {
441
+	print ' selected';
442
+}
443
+?>>Bing-Road</option>
351 444
 			    <?php
352 445
 				    }
353 446
 			    ?>
@@ -357,59 +450,143 @@  discard block
 block discarded – undo
357 450
 			    <?php
358 451
 					if (isset($globalHereappId) && $globalHereappId != '' && isset($globalHereappCode) && $globalHereappCode != '') {
359 452
 			    ?>
360
-			    <option value="Here-Aerial"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Aerial</option>
361
-			    <option value="Here-Hybrid"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Hybrid</option>
362
-			    <option value="Here-Road"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Road</option>
453
+			    <option value="Here-Aerial"<?php if ($MapType == 'Here') {
454
+	print ' selected';
455
+}
456
+?>>Here-Aerial</option>
457
+			    <option value="Here-Hybrid"<?php if ($MapType == 'Here') {
458
+	print ' selected';
459
+}
460
+?>>Here-Hybrid</option>
461
+			    <option value="Here-Road"<?php if ($MapType == 'Here') {
462
+	print ' selected';
463
+}
464
+?>>Here-Road</option>
363 465
 			    <?php
364 466
 					}
365 467
 			    ?>
366 468
 			    <?php
367 469
 					if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '') {
368 470
 			    ?>
369
-			    <option value="Google-Roadmap"<?php if ($MapType == 'Google-Roadmap') print ' selected'; ?>>Google Roadmap</option>
370
-			    <option value="Google-Satellite"<?php if ($MapType == 'Google-Satellite') print ' selected'; ?>>Google Satellite</option>
371
-			    <option value="Google-Hybrid"<?php if ($MapType == 'Google-Hybrid') print ' selected'; ?>>Google Hybrid</option>
372
-			    <option value="Google-Terrain"<?php if ($MapType == 'Google-Terrain') print ' selected'; ?>>Google Terrain</option>
471
+			    <option value="Google-Roadmap"<?php if ($MapType == 'Google-Roadmap') {
472
+	print ' selected';
473
+}
474
+?>>Google Roadmap</option>
475
+			    <option value="Google-Satellite"<?php if ($MapType == 'Google-Satellite') {
476
+	print ' selected';
477
+}
478
+?>>Google Satellite</option>
479
+			    <option value="Google-Hybrid"<?php if ($MapType == 'Google-Hybrid') {
480
+	print ' selected';
481
+}
482
+?>>Google Hybrid</option>
483
+			    <option value="Google-Terrain"<?php if ($MapType == 'Google-Terrain') {
484
+	print ' selected';
485
+}
486
+?>>Google Terrain</option>
373 487
 			    <?php
374 488
 					}
375 489
 			    ?>
376 490
 			    <?php
377 491
 					if (isset($globalMapQuestKey) && $globalMapQuestKey != '') {
378 492
 			    ?>
379
-			    <option value="MapQuest-OSM"<?php if ($MapType == 'MapQuest-OSM') print ' selected'; ?>>MapQuest-OSM</option>
380
-			    <option value="MapQuest-Aerial"<?php if ($MapType == 'MapQuest-Aerial') print ' selected'; ?>>MapQuest-Aerial</option>
381
-			    <option value="MapQuest-Hybrid"<?php if ($MapType == 'MapQuest-Hybrid') print ' selected'; ?>>MapQuest-Hybrid</option>
493
+			    <option value="MapQuest-OSM"<?php if ($MapType == 'MapQuest-OSM') {
494
+	print ' selected';
495
+}
496
+?>>MapQuest-OSM</option>
497
+			    <option value="MapQuest-Aerial"<?php if ($MapType == 'MapQuest-Aerial') {
498
+	print ' selected';
499
+}
500
+?>>MapQuest-Aerial</option>
501
+			    <option value="MapQuest-Hybrid"<?php if ($MapType == 'MapQuest-Hybrid') {
502
+	print ' selected';
503
+}
504
+?>>MapQuest-Hybrid</option>
382 505
 			    <?php
383 506
 					}
384 507
 			    ?>
385
-			    <option value="Yandex"<?php if ($MapType == 'Yandex') print ' selected'; ?>>Yandex</option>
386
-			    <option value="offline"<?php if ($MapType == 'offline') print ' selected'; ?>>Natural Earth</option>
508
+			    <option value="Yandex"<?php if ($MapType == 'Yandex') {
509
+	print ' selected';
510
+}
511
+?>>Yandex</option>
512
+			    <option value="offline"<?php if ($MapType == 'offline') {
513
+	print ' selected';
514
+}
515
+?>>Natural Earth</option>
387 516
 			    <?php
388 517
 				    }
389 518
 			    ?>
390
-			    <option value="NatGeo-Street"<?php if ($MapType == 'NatGeo-Street') print ' selected'; ?>>National Geographic Street</option>
519
+			    <option value="NatGeo-Street"<?php if ($MapType == 'NatGeo-Street') {
520
+	print ' selected';
521
+}
522
+?>>National Geographic Street</option>
391 523
 			    <?php
392 524
 				    if (isset($globalMapboxToken) && $globalMapboxToken != '') {
393
-					if (!isset($_COOKIE['MapTypeId'])) $MapBoxId = 'default';
394
-					else $MapBoxId = $_COOKIE['MapTypeId'];
525
+					if (!isset($_COOKIE['MapTypeId'])) {
526
+						$MapBoxId = 'default';
527
+					} else {
528
+						$MapBoxId = $_COOKIE['MapTypeId'];
529
+					}
395 530
 			    ?>
396
-			    <option value="MapboxGL"<?php if ($MapType == 'MapboxGL') print ' selected'; ?>>Mapbox GL</option>
397
-			    <option value="Mapbox-default"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'default') print ' selected'; ?>>Mapbox default</option>
398
-			    <option value="Mapbox-mapbox.streets"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets') print ' selected'; ?>>Mapbox streets</option>
399
-			    <option value="Mapbox-mapbox.light"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.light') print ' selected'; ?>>Mapbox light</option>
400
-			    <option value="Mapbox-mapbox.dark"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.dark') print ' selected'; ?>>Mapbox dark</option>
401
-			    <option value="Mapbox-mapbox.satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.satellite') print ' selected'; ?>>Mapbox satellite</option>
402
-			    <option value="Mapbox-mapbox.streets-satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-satellite') print ' selected'; ?>>Mapbox streets-satellite</option>
403
-			    <option value="Mapbox-mapbox.streets-basic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-basic') print ' selected'; ?>>Mapbox streets-basic</option>
404
-			    <option value="Mapbox-mapbox.comic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.comic') print ' selected'; ?>>Mapbox comic</option>
405
-			    <option value="Mapbox-mapbox.outdoors"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.outdoors') print ' selected'; ?>>Mapbox outdoors</option>
406
-			    <option value="Mapbox-mapbox.pencil"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pencil') print ' selected'; ?>>Mapbox pencil</option>
407
-			    <option value="Mapbox-mapbox.pirates"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pirates') print ' selected'; ?>>Mapbox pirates</option>
408
-			    <option value="Mapbox-mapbox.emerald"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.emerald') print ' selected'; ?>>Mapbox emerald</option>
531
+			    <option value="MapboxGL"<?php if ($MapType == 'MapboxGL') {
532
+	print ' selected';
533
+}
534
+?>>Mapbox GL</option>
535
+			    <option value="Mapbox-default"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'default') {
536
+	print ' selected';
537
+}
538
+?>>Mapbox default</option>
539
+			    <option value="Mapbox-mapbox.streets"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets') {
540
+	print ' selected';
541
+}
542
+?>>Mapbox streets</option>
543
+			    <option value="Mapbox-mapbox.light"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.light') {
544
+	print ' selected';
545
+}
546
+?>>Mapbox light</option>
547
+			    <option value="Mapbox-mapbox.dark"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.dark') {
548
+	print ' selected';
549
+}
550
+?>>Mapbox dark</option>
551
+			    <option value="Mapbox-mapbox.satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.satellite') {
552
+	print ' selected';
553
+}
554
+?>>Mapbox satellite</option>
555
+			    <option value="Mapbox-mapbox.streets-satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-satellite') {
556
+	print ' selected';
557
+}
558
+?>>Mapbox streets-satellite</option>
559
+			    <option value="Mapbox-mapbox.streets-basic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-basic') {
560
+	print ' selected';
561
+}
562
+?>>Mapbox streets-basic</option>
563
+			    <option value="Mapbox-mapbox.comic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.comic') {
564
+	print ' selected';
565
+}
566
+?>>Mapbox comic</option>
567
+			    <option value="Mapbox-mapbox.outdoors"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.outdoors') {
568
+	print ' selected';
569
+}
570
+?>>Mapbox outdoors</option>
571
+			    <option value="Mapbox-mapbox.pencil"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pencil') {
572
+	print ' selected';
573
+}
574
+?>>Mapbox pencil</option>
575
+			    <option value="Mapbox-mapbox.pirates"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pirates') {
576
+	print ' selected';
577
+}
578
+?>>Mapbox pirates</option>
579
+			    <option value="Mapbox-mapbox.emerald"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.emerald') {
580
+	print ' selected';
581
+}
582
+?>>Mapbox emerald</option>
409 583
 			    <?php
410 584
 				    }
411 585
 			    ?>
412
-			    <option value="OpenStreetMap"<?php if ($MapType == 'OpenStreetMap') print ' selected'; ?>>OpenStreetMap</option>
586
+			    <option value="OpenStreetMap"<?php if ($MapType == 'OpenStreetMap') {
587
+	print ' selected';
588
+}
589
+?>>OpenStreetMap</option>
413 590
 			    <?php
414 591
 				}
415 592
 			    ?>
@@ -420,10 +597,22 @@  discard block
 block discarded – undo
420 597
 ?>
421 598
 		    <li><?php echo _("Type of Terrain:"); ?>
422 599
 			<select  class="selectpicker" onchange="terrainType(this);">
423
-			    <option value="stk"<?php if (!isset($_COOKIE['MapTerrain']) || $_COOKIE['MapTerrain'] == 'stk') print ' selected'; ?>>stk terrain</option>
424
-			    <option value="ellipsoid"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'ellipsoid') print ' selected';?>>ellipsoid</option>
425
-			    <option value="vrterrain"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'vrterrain') print ' selected';?>>vr terrain</option>
426
-			    <option value="articdem"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'articdem') print ' selected';?>>ArticDEM</option>
600
+			    <option value="stk"<?php if (!isset($_COOKIE['MapTerrain']) || $_COOKIE['MapTerrain'] == 'stk') {
601
+	print ' selected';
602
+}
603
+?>>stk terrain</option>
604
+			    <option value="ellipsoid"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'ellipsoid') {
605
+	print ' selected';
606
+}
607
+?>>ellipsoid</option>
608
+			    <option value="vrterrain"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'vrterrain') {
609
+	print ' selected';
610
+}
611
+?>>vr terrain</option>
612
+			    <option value="articdem"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'articdem') {
613
+	print ' selected';
614
+}
615
+?>>ArticDEM</option>
427 616
 			</select>
428 617
 		    </li>
429 618
 <?php
@@ -433,59 +622,116 @@  discard block
 block discarded – undo
433 622
 <?php
434 623
     if (isset($globalMap3D) && $globalMap3D) {
435 624
 ?>
436
-		    <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>
625
+		    <li><div class="checkbox"><label><input type="checkbox" name="synchro2d3d" value="1" onclick="clickSyncMap2D3D(this)" <?php if (isset($_COOKIE['Map2D3DSync']) && $_COOKIE['Map2D3DSync'] == 'true') {
626
+	print 'checked';
627
+}
628
+?> ><?php echo _("Use same type of map for 2D & 3D"); ?></label></div></li>
437 629
 <?php
438 630
     }
439 631
 ?>
440 632
 <?php
441 633
     if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') {
442 634
 ?>
443
-		    <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>
635
+		    <li><div class="checkbox"><label><input type="checkbox" name="display2dbuildings" value="1" onclick="clickDisplay2DBuildings(this)" <?php if (isset($_COOKIE['Map2DBuildings']) && $_COOKIE['Map2DBuildings'] == 'true') {
636
+	print 'checked';
637
+}
638
+?> ><?php echo _("Display 2.5D buidings on map"); ?></label></div></li>
444 639
 
445 640
 <?php
446 641
 	if (!isset($globalAircraft) || $globalAircraft === TRUE) {
447 642
 ?>
448
-		    <!--<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>-->
449
-		    <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>
450
-		    <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>
451
-		    <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>
452
-		    <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>
643
+		    <!--<li><div class="checkbox"><label><input type="checkbox" name="flightpopup" value="1" onclick="clickFlightPopup(this)" <?php if (isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true') {
644
+	print 'checked';
645
+}
646
+?> ><?php echo _("Display flight info as popup"); ?></label></div></li>-->
647
+		    <li><div class="checkbox"><label><input type="checkbox" name="flightpath" value="1" onclick="clickFlightPath(this)" <?php if ((isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true')) {
648
+	print 'checked';
649
+}
650
+?> ><?php echo _("Display flight path"); ?></label></div></li>
651
+		    <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)) {
652
+	print 'checked';
653
+}
654
+?> ><?php echo _("Display flight route on click"); ?></label></div></li>
655
+		    <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)) {
656
+	print 'checked';
657
+}
658
+?> ><?php echo _("Display flight remaining route on click"); ?></label></div></li>
659
+		    <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)) {
660
+	print 'checked';
661
+}
662
+?> ><?php echo _("Planes animate between updates"); ?></label></div></li>
453 663
 <?php
454 664
 	} elseif (!isset($globalTracker) || $globalTracker === TRUE) {
455 665
 ?>
456
-		    <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>
666
+		    <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)) {
667
+	print 'checked';
668
+}
669
+?> ><?php echo _("Enable map matching"); ?></label></div></li>
457 670
 <?php
458 671
 	}
459 672
 	if (isset($globalSatellite) && $globalSatellite === TRUE) {
460 673
 ?>
461
-		    <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>
674
+		    <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)) {
675
+	print 'checked';
676
+}
677
+?> ><?php echo _("Satellites animate between updates"); ?></label></div></li>
462 678
 <?php
463 679
 	}
464 680
     }
465 681
 ?>
466
-		    <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>
467
-		    <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>
468
-		    <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>
469
-		    <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>
682
+		    <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'])) {
683
+	print 'checked';
684
+}
685
+?> ><?php echo _("Display airports on map"); ?></label></div></li>
686
+		    <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))) {
687
+	print 'checked';
688
+}
689
+?> ><?php echo _("Display ground station on map"); ?></label></div></li>
690
+		    <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))) {
691
+	print 'checked';
692
+}
693
+?> ><?php echo _("Display weather station on map"); ?></label></div></li>
694
+		    <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))) {
695
+	print 'checked';
696
+}
697
+?> ><?php echo _("Display lightning on map"); ?></label></div></li>
470 698
 <?php
471 699
 	if (isset($globalFires)) {
472 700
 ?>
473
-		    <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>
701
+		    <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))) {
702
+	print 'checked';
703
+}
704
+?> ><?php echo _("Display fires on map"); ?></label></div></li>
474 705
 <?php
475 706
 	}
476 707
 	if (isset($globalMap3D) && $globalMap3D) {
477 708
 ?>
478
-		    <li><div class="checkbox"><label><input type="checkbox" name="singlemodel" value="1" onclick="clickSingleModel(this)" <?php if (isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') print 'checked'; ?> ><?php echo _("Only display selected flight on 3D mode"); ?></label></div></li>
709
+		    <li><div class="checkbox"><label><input type="checkbox" name="singlemodel" value="1" onclick="clickSingleModel(this)" <?php if (isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') {
710
+	print 'checked';
711
+}
712
+?> ><?php echo _("Only display selected flight on 3D mode"); ?></label></div></li>
479 713
 <?php
480 714
 	}
481 715
 ?>
482 716
 <?php
483 717
     if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') {
484 718
 ?>
485
-		    <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>
486
-		    <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>
487
-		    <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>
488
-		    <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>
719
+		    <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')) {
720
+	print 'checked';
721
+}
722
+?> ><?php echo _("Show mini-map"); ?></label></div></li>
723
+		    <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')) {
724
+	print 'checked';
725
+}
726
+?> ><?php echo _("Use shadows"); ?></label></div></li>
727
+		    <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)) {
728
+	print 'checked';
729
+}
730
+?> ><?php echo _("Use same 3D model for all aircraft (use fewer resources)"); ?></label></div></li>
731
+		    <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'])) {
732
+	print 'checked';
733
+}
734
+?> ><?php echo _("Display realtime data in infobox"); ?></label></div></li>
489 735
 <?php
490 736
     }
491 737
     if (time() > mktime(0,0,0,12,1,date("Y")) && time() < mktime(0,0,0,12,31,date("Y"))) {
@@ -498,17 +744,25 @@  discard block
 block discarded – undo
498 744
 			if (function_exists('array_column')) {
499 745
 			    if (array_search(TRUE, array_column($globalSources, 'sourcestats')) !== FALSE) {
500 746
 		    ?>
501
-		    <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>
747
+		    <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) {
748
+	print 'checked';
749
+}
750
+?> ><?php echo _("Display polar on map"); ?></label></div></li>
502 751
 		    <?php
503 752
 			    }
504 753
 			} elseif (isset($globalSources)) {
505 754
 			    $dispolar = false;
506 755
 			    foreach ($globalSources as $testsource) {
507
-			        if (isset($globalSources['sourcestats']) && $globalSources['sourcestats'] !== FALSE) $dispolar = true;
756
+			        if (isset($globalSources['sourcestats']) && $globalSources['sourcestats'] !== FALSE) {
757
+			        	$dispolar = true;
758
+			        }
508 759
 			    }
509 760
 			    if ($dispolar) {
510 761
 		    ?>
511
-		    <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>
762
+		    <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) {
763
+	print 'checked';
764
+}
765
+?> ><?php echo _("Display polar on map"); ?></label></div></li>
512 766
 		    <?php
513 767
 			    }
514 768
 		        }
@@ -521,11 +775,21 @@  discard block
 block discarded – undo
521 775
 			if (!isset($globalAircraft) || $globalAircraft === TRUE) {
522 776
 		    	    if (extension_loaded('gd') && function_exists('gd_info')) {
523 777
 		    ?>
524
-		    <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>
778
+		    <li><input type="checkbox" name="aircraftcoloraltitude" value="1" onclick="iconColorAltitude(this)" <?php if (isset($_COOKIE['IconColorAltitude']) && $_COOKIE['IconColorAltitude'] == 'true') {
779
+	print 'checked';
780
+}
781
+?> ><?php echo _("Aircraft icon color based on altitude"); ?></li>
525 782
 		    <?php 
526 783
 				if (!isset($_COOKIE['IconColorAltitude']) || $_COOKIE['IconColorAltitude'] == 'false') {
527 784
 		    ?>
528
-			<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>
785
+			<li><?php echo _("Aircraft icon color:"); ?><input type="color" name="aircraftcolor" id="html5colorpicker" onchange="iconColor(aircraftcolor.value);" value="#<?php if (isset($_COOKIE['IconColor'])) {
786
+	print $_COOKIE['IconColor'];
787
+} elseif (isset($globalAircraftIconColor)) {
788
+	print $globalAircraftIconColor;
789
+} else {
790
+	print '1a3151';
791
+}
792
+?>"></li>
529 793
 		    <?php
530 794
 				}
531 795
 			    }
@@ -536,7 +800,14 @@  discard block
 block discarded – undo
536 800
 			    if (extension_loaded('gd') && function_exists('gd_info')) {
537 801
 		    ?>
538 802
 		    <li><?php echo _("Marine icon color:"); ?>
539
-			<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'; ?>">
803
+			<input type="color" name="marinecolor" id="html5colorpicker" onchange="MarineiconColor(marinecolor.value);" value="#<?php if (isset($_COOKIE['MarineIconColor'])) {
804
+	print $_COOKIE['MarineIconColor'];
805
+} elseif (isset($globalMarineIconColor)) {
806
+	print $globalMarineIconColor;
807
+} else {
808
+	print '1a3151';
809
+}
810
+?>">
540 811
 		    </li>
541 812
 		    <?php
542 813
 			    }
@@ -547,7 +818,14 @@  discard block
 block discarded – undo
547 818
 			    if (extension_loaded('gd') && function_exists('gd_info')) {
548 819
 		    ?>
549 820
 		    <li><?php echo _("Tracker icon color:"); ?>
550
-			<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'; ?>">
821
+			<input type="color" name="trackercolor" id="html5colorpicker" onchange="TrackericonColor(trackercolor.value);" value="#<?php if (isset($_COOKIE['TrackerIconColor'])) {
822
+	print $_COOKIE['TrackerIconColor'];
823
+} elseif (isset($globalTrackerIconColor)) {
824
+	print $globalTrackerIconColor;
825
+} else {
826
+	print '1a3151';
827
+}
828
+?>">
551 829
 		    </li>
552 830
 		    <?php
553 831
 			    }
@@ -558,8 +836,22 @@  discard block
 block discarded – undo
558 836
 		    ?>
559 837
 		    <li><?php echo _("Show airport icon at zoom level:"); ?>
560 838
 			<div class="range">
561
-			    <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'; ?>">
562
-			    <output id="range"><?php if (isset($_COOKIE['AirportZoom'])) print $_COOKIE['AirportZoom']; elseif (isset($globalAirportZoom)) print $globalAirportZoom; else print '7'; ?></output>
839
+			    <input type="range" min="0" max="19" step="1" name="airportzoom" onchange="range.value=value;airportDisplayZoom(airportzoom.value);" value="<?php if (isset($_COOKIE['AirportZoom'])) {
840
+	print $_COOKIE['AirportZoom'];
841
+} elseif (isset($globalAirportZoom)) {
842
+	print $globalAirportZoom;
843
+} else {
844
+	print '7';
845
+}
846
+?>">
847
+			    <output id="range"><?php if (isset($_COOKIE['AirportZoom'])) {
848
+	print $_COOKIE['AirportZoom'];
849
+} elseif (isset($globalAirportZoom)) {
850
+	print $globalAirportZoom;
851
+} else {
852
+	print '7';
853
+}
854
+?></output>
563 855
 			</div>
564 856
 		    </li>
565 857
 		    <?php
@@ -570,17 +862,40 @@  discard block
 block discarded – undo
570 862
 ?>
571 863
 		    <li><?php echo _("Set scaling factor for rendering resolution:"); ?>
572 864
 			<div class="range">
573
-			    <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'; ?>">
574
-			    <output id="scale"><?php if (isset($_COOKIE['resolutionScale'])) print $_COOKIE['resolutionScale']; else print '1'; ?></output>
865
+			    <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'])) {
866
+	print $_COOKIE['resolutionScale'];
867
+} else {
868
+	print '1';
869
+}
870
+?>">
871
+			    <output id="scale"><?php if (isset($_COOKIE['resolutionScale'])) {
872
+	print $_COOKIE['resolutionScale'];
873
+} else {
874
+	print '1';
875
+}
876
+?></output>
575 877
 			</div>
576 878
 		    </li>
577 879
 <?php
578 880
 	if (!isset($globalAircraft) || $globalAircraft === TRUE) {
579 881
 ?>
580
-		    <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>
581
-		    <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"); ?>&nbsp;
882
+		    <li><input type="checkbox" name="useliveries" value="1" onclick="useLiveries(this)" <?php if (isset($_COOKIE['UseLiveries']) && $_COOKIE['UseLiveries'] == 'true') {
883
+	print 'checked';
884
+}
885
+?> > <?php echo _("Use airlines liveries"); ?></li>
886
+		    <li><input type="checkbox" name="aircraftcolorforce" value="1" onclick="iconColorForce(this)" <?php if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true') {
887
+	print 'checked';
888
+}
889
+?> > <?php echo _("Force Aircraft color"); ?>&nbsp;
582 890
 		    <!--<li><?php echo _("Aircraft icon color:"); ?>-->
583
-			<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'; ?>">
891
+			<input type="color" name="aircraftcolor" id="html5colorpicker" onchange="iconColor(aircraftcolor.value);" value="#<?php if (isset($_COOKIE['IconColor'])) {
892
+	print $_COOKIE['IconColor'];
893
+} elseif (isset($globalAircraftIconColor)) {
894
+	print $globalAircraftIconColor;
895
+} else {
896
+	print 'ff0000';
897
+}
898
+?>">
584 899
 		    </li>
585 900
 <?php
586 901
 	}
@@ -588,9 +903,19 @@  discard block
 block discarded – undo
588 903
 <?php
589 904
 	if (isset($globalMarine) && $globalMarine === TRUE) {
590 905
 ?>
591
-		    <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"); ?>&nbsp;
906
+		    <li><input type="checkbox" name="marinecolorforce" value="1" onclick="MarineiconColorForce(this)" <?php if (isset($_COOKIE['MarineIconColorForce']) && $_COOKIE['MarineIconColorForce'] == 'true') {
907
+	print 'checked';
908
+}
909
+?> ><?php echo _("Force Marine color"); ?>&nbsp;
592 910
 		    <!--<li><?php echo _("Marine icon color:"); ?>-->
593
-			<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'; ?>">
911
+			<input type="color" name="marinecolor" id="html5colorpicker" onchange="MarineiconColor(marinecolor.value);" value="#<?php if (isset($_COOKIE['MarineIconColor'])) {
912
+	print $_COOKIE['MarineIconColor'];
913
+} elseif (isset($globalMarineIconColor)) {
914
+	print $globalMarineIconColor;
915
+} else {
916
+	print 'ff0000';
917
+}
918
+?>">
594 919
 		    </li>
595 920
 <?php
596 921
 	}
@@ -598,9 +923,19 @@  discard block
 block discarded – undo
598 923
 <?php
599 924
 	if (isset($globalTracker) && $globalTracker === TRUE) {
600 925
 ?>
601
-		    <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"); ?>&nbsp;
926
+		    <li><input type="checkbox" name="trackercolorforce" value="1" onclick="TrackericonColorForce(this)" <?php if (isset($_COOKIE['TrackerIconColorForce']) && $_COOKIE['TrackerIconColorForce'] == 'true') {
927
+	print 'checked';
928
+}
929
+?> ><?php echo _("Force Tracker color"); ?>&nbsp;
602 930
 		    <!--<li><?php echo _("Tracker icon color:"); ?>-->
603
-			<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'; ?>">
931
+			<input type="color" name="trackercolor" id="html5colorpicker" onchange="TrackericonColor(trackercolor.value);" value="#<?php if (isset($_COOKIE['TrackerIconColor'])) {
932
+	print $_COOKIE['TrackerIconColor'];
933
+} elseif (isset($globalTrackerIconColor)) {
934
+	print $globalTrackerIconColor;
935
+} else {
936
+	print 'ff0000';
937
+}
938
+?>">
604 939
 		    </li>
605 940
 <?php
606 941
 	}
@@ -608,22 +943,46 @@  discard block
 block discarded – undo
608 943
 ?>
609 944
 		    <li><?php echo _("Distance unit:"); ?>
610 945
 			<select class="selectpicker" onchange="unitdistance(this);">
611
-			    <option value="km"<?php if ((!isset($_COOKIE['unitdistance']) && (!isset($globalUnitDistance) || (isset($globalUnitDistance) && $globalUnitDistance == 'km'))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) echo ' selected'; ?>>km</option>
612
-			    <option value="nm"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) echo ' selected'; ?>>nm</option>
613
-			    <option value="mi"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) echo ' selected'; ?>>mi</option>
946
+			    <option value="km"<?php if ((!isset($_COOKIE['unitdistance']) && (!isset($globalUnitDistance) || (isset($globalUnitDistance) && $globalUnitDistance == 'km'))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) {
947
+	echo ' selected';
948
+}
949
+?>>km</option>
950
+			    <option value="nm"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) {
951
+	echo ' selected';
952
+}
953
+?>>nm</option>
954
+			    <option value="mi"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) {
955
+	echo ' selected';
956
+}
957
+?>>mi</option>
614 958
 		        </select>
615 959
 		    </li>
616 960
 		    <li><?php echo _("Altitude unit:"); ?>
617 961
 			<select class="selectpicker" onchange="unitaltitude(this);">
618
-			    <option value="m"<?php if ((!isset($_COOKIE['unitaltitude']) && (!isset($globalUnitAltitude) || (isset($globalUnitAltitude) && $globalUnitAltitude == 'm'))) || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'm')) echo ' selected'; ?>>m</option>
619
-			    <option value="feet"<?php if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) echo ' selected'; ?>>feet</option>
962
+			    <option value="m"<?php if ((!isset($_COOKIE['unitaltitude']) && (!isset($globalUnitAltitude) || (isset($globalUnitAltitude) && $globalUnitAltitude == 'm'))) || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'm')) {
963
+	echo ' selected';
964
+}
965
+?>>m</option>
966
+			    <option value="feet"<?php if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) {
967
+	echo ' selected';
968
+}
969
+?>>feet</option>
620 970
 		        </select>
621 971
 		    </li>
622 972
 		    <li><?php echo _("Speed unit:"); ?>
623 973
 			<select class="selectpicker" onchange="unitspeed(this);">
624
-			    <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>
625
-			    <option value="mph"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'mph') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'mph')) echo ' selected'; ?>>mph</option>
626
-			    <option value="knots"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'knots') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'knots')) echo ' selected'; ?>>knots</option>
974
+			    <option value="kmh"<?php if ((!isset($_COOKIE['unitspeed']) && (!isset($globalUnitSpeed) || (isset($globalUnitSpeed) && $globalUnitSpeed == 'kmh'))) || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'kmh')) {
975
+	echo ' selected';
976
+}
977
+?>>km/h</option>
978
+			    <option value="mph"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'mph') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'mph')) {
979
+	echo ' selected';
980
+}
981
+?>>mph</option>
982
+			    <option value="knots"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'knots') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'knots')) {
983
+	echo ' selected';
984
+}
985
+?>>knots</option>
627 986
 		        </select>
628 987
 		    </li>
629 988
 
@@ -641,9 +1000,18 @@  discard block
 block discarded – undo
641 1000
 		    <?php
642 1001
 			if (((isset($globalVATSIM) && $globalVATSIM) || isset($globalIVAO) && $globalIVAO || isset($globalphpVMS) && $globalphpVMS) && (!isset($globalMapVAchoose) || $globalMapVAchoose)) {
643 1002
 		    ?>
644
-			<?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 } ?>
645
-			<?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 } ?>
646
-			<?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 } ?>
1003
+			<?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'])) {
1004
+	print 'checked';
1005
+}
1006
+?> ><?php echo _("Display VATSIM data"); ?></li><?php } ?>
1007
+			<?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'])) {
1008
+	print 'checked';
1009
+}
1010
+?> ><?php echo _("Display IVAO data"); ?></li><?php } ?>
1011
+			<?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'])) {
1012
+	print 'checked';
1013
+}
1014
+?> ><?php echo _("Display phpVMS data"); ?></li><?php } ?>
647 1015
 		    <?php
648 1016
 			}
649 1017
 		    ?>
@@ -651,10 +1019,16 @@  discard block
 block discarded – undo
651 1019
 			if (!(isset($globalVA) && $globalVA) && !(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalIVAO) && $globalIVAO) && !(isset($globalphpVMS) && $globalphpVMS) && isset($globalSBS1) && $globalSBS1 && isset($globalAPRS) && $globalAPRS && (!isset($globalMapchoose) || $globalMapchoose)) {
652 1020
 		    ?>
653 1021
 			<?php if (isset($globalSBS1) && $globalSBS1) { ?>
654
-			    <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>
1022
+			    <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'])) {
1023
+	print 'checked';
1024
+}
1025
+?> ><?php echo _("Display ADS-B data"); ?></label></div></li>
655 1026
 			<?php } ?>
656 1027
 			<?php if (isset($globalAPRS) && $globalAPRS) { ?>
657
-			    <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>
1028
+			    <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'])) {
1029
+	print 'checked';
1030
+}
1031
+?> ><?php echo _("Display APRS data"); ?></label></div></li>
658 1032
 			<?php } ?>
659 1033
 		    <?php
660 1034
 			}
@@ -671,7 +1045,9 @@  discard block
 block discarded – undo
671 1045
 				}
672 1046
 				foreach($allairlinenames as $airline) {
673 1047
 					$airline_name = $airline['airline_name'];
674
-					if (strlen($airline_name) > 30) $airline_name = substr($airline_name,0,30).'...';
1048
+					if (strlen($airline_name) > 30) {
1049
+						$airline_name = substr($airline_name,0,30).'...';
1050
+					}
675 1051
 					if (isset($_COOKIE['filter_Airlines']) && in_array($airline['airline_icao'],explode(',',$_COOKIE['filter_Airlines']))) {
676 1052
 						echo '<option value="'.$airline['airline_icao'].'" selected>'.$airline_name.'</option>';
677 1053
 					} else {
@@ -689,7 +1065,10 @@  discard block
 block discarded – undo
689 1065
 		    <li><?php echo _("Display alliance:"); ?>
690 1066
 		    <br/>
691 1067
 			<select class="selectpicker" onchange="alliance(this);" id="display_alliance">
692
-			    <option value="all"<?php if (!isset($_COOKIE['filter_alliance']) || $_COOKIE['filter_alliance'] == 'all' || $_COOKIE['filter_alliance'] == '') echo ' selected'; ?>><?php echo _("All"); ?></option>
1068
+			    <option value="all"<?php if (!isset($_COOKIE['filter_alliance']) || $_COOKIE['filter_alliance'] == 'all' || $_COOKIE['filter_alliance'] == '') {
1069
+	echo ' selected';
1070
+}
1071
+?>><?php echo _("All"); ?></option>
693 1072
 			    <?php
694 1073
 				foreach($allalliancenames as $alliance) {
695 1074
 					$alliance_name = $alliance['alliance'];
@@ -748,10 +1127,22 @@  discard block
 block discarded – undo
748 1127
 		    ?>
749 1128
 		    <li><?php echo _("Display airlines of type:"); ?><br/>
750 1129
 			<select class="selectpicker" onchange="airlinestype(this);">
751
-			    <option value="all"<?php if (!isset($_COOKIE['filter_airlinestype']) || $_COOKIE['filter_airlinestype'] == 'all' || $_COOKIE['filter_airlinestype'] == '') echo ' selected'; ?>><?php echo _("All"); ?></option>
752
-			    <option value="passenger"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'passenger') echo ' selected'; ?>><?php echo _("Passenger"); ?></option>
753
-			    <option value="cargo"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'cargo') echo ' selected'; ?>><?php echo _("Cargo"); ?></option>
754
-			    <option value="military"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'military') echo ' selected'; ?>><?php echo _("Military"); ?></option>
1130
+			    <option value="all"<?php if (!isset($_COOKIE['filter_airlinestype']) || $_COOKIE['filter_airlinestype'] == 'all' || $_COOKIE['filter_airlinestype'] == '') {
1131
+	echo ' selected';
1132
+}
1133
+?>><?php echo _("All"); ?></option>
1134
+			    <option value="passenger"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'passenger') {
1135
+	echo ' selected';
1136
+}
1137
+?>><?php echo _("Passenger"); ?></option>
1138
+			    <option value="cargo"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'cargo') {
1139
+	echo ' selected';
1140
+}
1141
+?>><?php echo _("Cargo"); ?></option>
1142
+			    <option value="military"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'military') {
1143
+	echo ' selected';
1144
+}
1145
+?>><?php echo _("Military"); ?></option>
755 1146
 			</select>
756 1147
 		    </li>
757 1148
 		    <?php
@@ -765,7 +1156,10 @@  discard block
 block discarded – undo
765 1156
 		    ?>
766 1157
 		    <li>
767 1158
 			<?php echo _("Display vessels with MMSI:"); ?>
768
-			<input type="text" name="mmsifilter" onchange="mmsifilter();" id="mmsifilter" value="<?php if (isset($_COOKIE['filter_mmsi'])) print $_COOKIE['filter_mmsi']; ?>" />
1159
+			<input type="text" name="mmsifilter" onchange="mmsifilter();" id="mmsifilter" value="<?php if (isset($_COOKIE['filter_mmsi'])) {
1160
+	print $_COOKIE['filter_mmsi'];
1161
+}
1162
+?>" />
769 1163
 		    </li>
770 1164
 			<?php
771 1165
 				if (isset($globalVM) && $globalVM) {
@@ -792,7 +1186,10 @@  discard block
 block discarded – undo
792 1186
 		    ?>
793 1187
 		    <li>
794 1188
 			<?php echo _("Display with ident:"); ?>
795
-			<input type="text" name="identfilter" onchange="identfilter();" id="identfilter" value="<?php if (isset($_COOKIE['filter_ident'])) print $_COOKIE['filter_ident']; ?>" />
1189
+			<input type="text" name="identfilter" onchange="identfilter();" id="identfilter" value="<?php if (isset($_COOKIE['filter_ident'])) {
1190
+	print $_COOKIE['filter_ident'];
1191
+}
1192
+?>" />
796 1193
 		    </li>
797 1194
 		</ul>
798 1195
 	    </form>
@@ -808,7 +1205,10 @@  discard block
 block discarded – undo
808 1205
 	    <h1 class="sidebar-header"><?php echo _("Satellites"); ?><span class="sidebar-close"><i class="fa fa-caret-left"></i></span></h1>
809 1206
 	    <form>
810 1207
 		<ul>
811
-		    <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>
1208
+		    <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'])) {
1209
+	print 'checked';
1210
+}
1211
+?> ><?php echo _("Show ISS, Tiangong-1 and Tiangong-2 on map"); ?></label></div></li>
812 1212
 		    <li><?php echo _("Type:"); ?>
813 1213
 			<select class="selectpicker" multiple onchange="sattypes(this);">
814 1214
 			    <?php
@@ -816,25 +1216,45 @@  discard block
 block discarded – undo
816 1216
 				$types = $Satellite->get_tle_types();
817 1217
 				foreach ($types as $type) {
818 1218
 					$type_name = $type['tle_type'];
819
-					if ($type_name == 'musson') $type_name = 'Russian LEO Navigation';
820
-					else if ($type_name == 'nnss') $type_name = 'Navi Navigation Satellite System';
821
-					else if ($type_name == 'sbas') $type_name = 'Satellite-Based Augmentation System';
822
-					else if ($type_name == 'glo-ops') $type_name = 'Glonass Operational';
823
-					else if ($type_name == 'gps-ops') $type_name = 'GPS Operational';
824
-					else if ($type_name == 'argos') $type_name = 'ARGOS Data Collection System';
825
-					else if ($type_name == 'tdrss') $type_name = 'Tracking and Data Relay Satellite System';
826
-					else if ($type_name == 'sarsat') $type_name = 'Search & Rescue';
827
-					else if ($type_name == 'dmc') $type_name = 'Disaster Monitoring';
828
-					else if ($type_name == 'resource') $type_name = 'Earth Resources';
829
-					else if ($type_name == 'stations') $type_name = 'Space Stations';
830
-					else if ($type_name == 'geo') $type_name = 'Geostationary';
831
-					else if ($type_name == 'amateur') $type_name = 'Amateur Radio';
832
-					else if ($type_name == 'x-comm') $type_name = 'Experimental';
833
-					else if ($type_name == 'other-comm') $type_name = 'Other Comm';
834
-					else if ($type_name == 'science') $type_name = 'Space & Earth Science';
835
-					else if ($type_name == 'military') $type_name = 'Miscellaneous Military';
836
-					else if ($type_name == 'radar') $type_name = 'Radar Calibration';
837
-					else if ($type_name == 'tle-new') $type_name = 'Last 30 days launches';
1219
+					if ($type_name == 'musson') {
1220
+						$type_name = 'Russian LEO Navigation';
1221
+					} else if ($type_name == 'nnss') {
1222
+						$type_name = 'Navi Navigation Satellite System';
1223
+					} else if ($type_name == 'sbas') {
1224
+						$type_name = 'Satellite-Based Augmentation System';
1225
+					} else if ($type_name == 'glo-ops') {
1226
+						$type_name = 'Glonass Operational';
1227
+					} else if ($type_name == 'gps-ops') {
1228
+						$type_name = 'GPS Operational';
1229
+					} else if ($type_name == 'argos') {
1230
+						$type_name = 'ARGOS Data Collection System';
1231
+					} else if ($type_name == 'tdrss') {
1232
+						$type_name = 'Tracking and Data Relay Satellite System';
1233
+					} else if ($type_name == 'sarsat') {
1234
+						$type_name = 'Search & Rescue';
1235
+					} else if ($type_name == 'dmc') {
1236
+						$type_name = 'Disaster Monitoring';
1237
+					} else if ($type_name == 'resource') {
1238
+						$type_name = 'Earth Resources';
1239
+					} else if ($type_name == 'stations') {
1240
+						$type_name = 'Space Stations';
1241
+					} else if ($type_name == 'geo') {
1242
+						$type_name = 'Geostationary';
1243
+					} else if ($type_name == 'amateur') {
1244
+						$type_name = 'Amateur Radio';
1245
+					} else if ($type_name == 'x-comm') {
1246
+						$type_name = 'Experimental';
1247
+					} else if ($type_name == 'other-comm') {
1248
+						$type_name = 'Other Comm';
1249
+					} else if ($type_name == 'science') {
1250
+						$type_name = 'Space & Earth Science';
1251
+					} else if ($type_name == 'military') {
1252
+						$type_name = 'Miscellaneous Military';
1253
+					} else if ($type_name == 'radar') {
1254
+						$type_name = 'Radar Calibration';
1255
+					} else if ($type_name == 'tle-new') {
1256
+						$type_name = 'Last 30 days launches';
1257
+					}
838 1258
 					
839 1259
 					if (isset($_COOKIE['sattypes']) && in_array($type['tle_type'],explode(',',$_COOKIE['sattypes']))) {
840 1260
 						print '<option value="'.$type['tle_type'].'" selected>'.$type_name.'</option>';
Please login to merge, or discard this patch.
require/class.Tracker.php 1 patch
Braces   +172 added lines, -61 removed lines patch added patch discarded remove patch
@@ -10,7 +10,9 @@  discard block
 block discarded – undo
10 10
 	public function __construct($dbc = null) {
11 11
 		$Connection = new Connection($dbc);
12 12
 		$this->db = $Connection->db();
13
-		if ($this->db === null) die('Error: No DB connection. (Tracker)');
13
+		if ($this->db === null) {
14
+			die('Error: No DB connection. (Tracker)');
15
+		}
14 16
 	}
15 17
 
16 18
 	/**
@@ -32,7 +34,9 @@  discard block
 block discarded – undo
32 34
 		if (isset($filter[0]['source'])) {
33 35
 			$filters = array_merge($filters,$filter);
34 36
 		}
35
-		if (is_array($globalFilter)) $filter = array_merge($filter,$globalFilter);
37
+		if (is_array($globalFilter)) {
38
+			$filter = array_merge($filter,$globalFilter);
39
+		}
36 40
 		$filter_query_join = '';
37 41
 		$filter_query_where = '';
38 42
 		foreach($filters as $flt) {
@@ -74,8 +78,11 @@  discard block
 block discarded – undo
74 78
 				$filter_query_where .= " AND EXTRACT(DAY FROM tracker_output.date) = '".$filter['day']."'";
75 79
 			}
76 80
 		}
77
-		if ($filter_query_where == '' && $where) $filter_query_where = ' WHERE';
78
-		elseif ($filter_query_where != '' && $and) $filter_query_where .= ' AND';
81
+		if ($filter_query_where == '' && $where) {
82
+			$filter_query_where = ' WHERE';
83
+		} elseif ($filter_query_where != '' && $and) {
84
+			$filter_query_where .= ' AND';
85
+		}
79 86
 		if ($filter_query_where != '') {
80 87
 			$filter_query_where = preg_replace('/^ AND/',' WHERE',$filter_query_where);
81 88
 		}
@@ -129,26 +136,43 @@  discard block
 block discarded – undo
129 136
 				$temp_array['tracker_id'] = $row['tracker_archive_id'];
130 137
 			} elseif (isset($row['tracker_archive_output_id'])) {
131 138
 				$temp_array['tracker_id'] = $row['tracker_archive_output_id'];
132
-			*/} 
133
-			elseif (isset($row['trackerid'])) {
139
+			*/} elseif (isset($row['trackerid'])) {
134 140
 				$temp_array['trackerid'] = $row['trackerid'];
135 141
 			} else {
136 142
 				$temp_array['trackerid'] = '';
137 143
 			}
138
-			if (isset($row['famtrackid'])) $temp_array['famtrackid'] = $row['famtrackid'];
139
-			if (isset($row['type'])) $temp_array['type'] = $row['type'];
140
-			if (isset($row['comment'])) $temp_array['comment'] = $row['comment'];
144
+			if (isset($row['famtrackid'])) {
145
+				$temp_array['famtrackid'] = $row['famtrackid'];
146
+			}
147
+			if (isset($row['type'])) {
148
+				$temp_array['type'] = $row['type'];
149
+			}
150
+			if (isset($row['comment'])) {
151
+				$temp_array['comment'] = $row['comment'];
152
+			}
141 153
 			$temp_array['ident'] = $row['ident'];
142
-			if (isset($row['latitude'])) $temp_array['latitude'] = $row['latitude'];
143
-			if (isset($row['longitude'])) $temp_array['longitude'] = $row['longitude'];
144
-			if (isset($row['format_source'])) $temp_array['format_source'] = $row['format_source'];
145
-			if (isset($row['altitude'])) $temp_array['altitude'] = $row['altitude'];
154
+			if (isset($row['latitude'])) {
155
+				$temp_array['latitude'] = $row['latitude'];
156
+			}
157
+			if (isset($row['longitude'])) {
158
+				$temp_array['longitude'] = $row['longitude'];
159
+			}
160
+			if (isset($row['format_source'])) {
161
+				$temp_array['format_source'] = $row['format_source'];
162
+			}
163
+			if (isset($row['altitude'])) {
164
+				$temp_array['altitude'] = $row['altitude'];
165
+			}
146 166
 			if (isset($row['heading'])) {
147 167
 				$temp_array['heading'] = $row['heading'];
148 168
 				$heading_direction = $this->parseDirection($row['heading']);
149
-				if (isset($heading_direction[0]['direction_fullname'])) $temp_array['heading_name'] = $heading_direction[0]['direction_fullname'];
169
+				if (isset($heading_direction[0]['direction_fullname'])) {
170
+					$temp_array['heading_name'] = $heading_direction[0]['direction_fullname'];
171
+				}
172
+			}
173
+			if (isset($row['ground_speed'])) {
174
+				$temp_array['ground_speed'] = $row['ground_speed'];
150 175
 			}
151
-			if (isset($row['ground_speed'])) $temp_array['ground_speed'] = $row['ground_speed'];
152 176
 			
153 177
 			if (isset($row['date'])) {
154 178
 				$dateArray = $this->parseDateString($row['date']);
@@ -191,13 +215,21 @@  discard block
 block discarded – undo
191 215
 			}
192 216
 			
193 217
 			$fromsource = NULL;
194
-			if (isset($row['source_name']) && $row['source_name'] != '') $temp_array['source_name'] = $row['source_name'];
195
-			if (isset($row['over_country']) && $row['over_country'] != '') $temp_array['over_country'] = $row['over_country'];
196
-			if (isset($row['distance']) && $row['distance'] != '') $temp_array['distance'] = $row['distance'];
218
+			if (isset($row['source_name']) && $row['source_name'] != '') {
219
+				$temp_array['source_name'] = $row['source_name'];
220
+			}
221
+			if (isset($row['over_country']) && $row['over_country'] != '') {
222
+				$temp_array['over_country'] = $row['over_country'];
223
+			}
224
+			if (isset($row['distance']) && $row['distance'] != '') {
225
+				$temp_array['distance'] = $row['distance'];
226
+			}
197 227
 			$temp_array['query_number_rows'] = $num_rows;
198 228
 			$tracker_array[] = $temp_array;
199 229
 		}
200
-		if ($num_rows == 0) return array();
230
+		if ($num_rows == 0) {
231
+			return array();
232
+		}
201 233
 		$tracker_array[0]['query_number_rows'] = $num_rows;
202 234
 		return $tracker_array;
203 235
 	}	
@@ -228,8 +260,12 @@  discard block
 block discarded – undo
228 260
 			{
229 261
 				//$limit_query = " LIMIT ".$limit_array[0].",".$limit_array[1];
230 262
 				$limit_query = " LIMIT ".$limit_array[1]." OFFSET ".$limit_array[0];
231
-			} else $limit_query = "";
232
-		} else $limit_query = "";
263
+			} else {
264
+				$limit_query = "";
265
+			}
266
+		} else {
267
+			$limit_query = "";
268
+		}
233 269
 		
234 270
 		if ($sort != "")
235 271
 		{
@@ -257,7 +293,9 @@  discard block
 block discarded – undo
257 293
 		global $global_tracker_query;
258 294
 		
259 295
 		date_default_timezone_set('UTC');
260
-		if ($id == '') return array();
296
+		if ($id == '') {
297
+			return array();
298
+		}
261 299
 		$additional_query = "tracker_output.famtrackid = :id";
262 300
 		$query_values = array(':id' => $id);
263 301
 		$query  = $global_tracker_query." WHERE ".$additional_query." ";
@@ -400,8 +438,11 @@  discard block
 block discarded – undo
400 438
 		$query .= " ORDER BY tracker_output.source_name ASC";
401 439
 
402 440
 		$sth = $this->db->prepare($query);
403
-		if (!empty($query_values)) $sth->execute($query_values);
404
-		else $sth->execute();
441
+		if (!empty($query_values)) {
442
+			$sth->execute($query_values);
443
+		} else {
444
+			$sth->execute();
445
+		}
405 446
 
406 447
 		$source_array = array();
407 448
 		$temp_array = array();
@@ -456,7 +497,9 @@  discard block
 block discarded – undo
456 497
 			date_default_timezone_set($globalTimezone);
457 498
 			$datetime = new DateTime();
458 499
 			$offset = $datetime->format('P');
459
-		} else $offset = '+00:00';
500
+		} else {
501
+			$offset = '+00:00';
502
+		}
460 503
 
461 504
 		if ($globalDBdriver == 'mysql') {
462 505
 			$query  = "SELECT DISTINCT DATE(CONVERT_TZ(tracker_output.date,'+00:00', :offset)) as date
@@ -612,7 +655,9 @@  discard block
 block discarded – undo
612 655
 			{
613 656
 				return false;
614 657
 			}
615
-		} else $altitude = 0;
658
+		} else {
659
+			$altitude = 0;
660
+		}
616 661
 		
617 662
 		if ($heading != "")
618 663
 		{
@@ -651,8 +696,12 @@  discard block
 block discarded – undo
651 696
             		$latitude = 0;
652 697
             		$longitude = 0;
653 698
             	}
654
-                if ($heading == '' || $Common->isInteger($heading) === false) $heading = 0;
655
-                if ($groundspeed == '' || $Common->isInteger($groundspeed) === false) $groundspeed = 0;
699
+                if ($heading == '' || $Common->isInteger($heading) === false) {
700
+                	$heading = 0;
701
+                }
702
+                if ($groundspeed == '' || $Common->isInteger($groundspeed) === false) {
703
+                	$groundspeed = 0;
704
+                }
656 705
                 $query  = "INSERT INTO tracker_output (famtrackid, ident, latitude, longitude, altitude, heading, ground_speed, date, format_source, source_name, comment, type) 
657 706
                 VALUES (:famtrackid,:ident,:latitude,:longitude,:altitude,:heading,:speed,:date,:format_source, :source_name,:comment,:type)";
658 707
 
@@ -756,7 +805,9 @@  discard block
 block discarded – undo
756 805
 		global $globalDBdriver, $globalArchive;
757 806
 		//$filter_query = $this->getFilter($filters,true,true);
758 807
 		$Connection= new Connection($this->db);
759
-		if (!$Connection->tableExists('countries')) return array();
808
+		if (!$Connection->tableExists('countries')) {
809
+			return array();
810
+		}
760 811
 		if (!isset($globalArchive) || $globalArchive !== TRUE) {
761 812
 			require_once('class.TrackerLive.php');
762 813
 			$TrackerLive = new TrackerLive($this->db);
@@ -799,7 +850,9 @@  discard block
 block discarded – undo
799 850
 			$query = "SELECT c.name, c.iso3, c.iso2, count(c.name) as nb FROM countries c INNER JOIN (SELECT DISTINCT famtrackid,over_country FROM tracker_archive".$filter_query.") l ON c.iso2 = l.over_country ";
800 851
 		}
801 852
 		$query .= "GROUP BY c.name,c.iso3,c.iso2 ORDER BY nb DESC";
802
-		if ($limit) $query .= " LIMIT 10 OFFSET 0";
853
+		if ($limit) {
854
+			$query .= " LIMIT 10 OFFSET 0";
855
+		}
803 856
       
804 857
 		
805 858
 		$sth = $this->db->prepare($query);
@@ -832,12 +885,18 @@  discard block
 block discarded – undo
832 885
 		$query  = "SELECT DISTINCT tracker_output.ident, COUNT(tracker_output.ident) AS callsign_icao_count 
833 886
                     FROM tracker_output".$filter_query." tracker_output.ident <> ''";
834 887
 		 if ($olderthanmonths > 0) {
835
-			if ($globalDBdriver == 'mysql') $query .= ' AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH)';
836
-			else $query .= " AND tracker_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'";
888
+			if ($globalDBdriver == 'mysql') {
889
+				$query .= ' AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH)';
890
+			} else {
891
+				$query .= " AND tracker_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'";
892
+			}
837 893
 		}
838 894
 		if ($sincedate != '') {
839
-			if ($globalDBdriver == 'mysql') $query .= " AND tracker_output.date > '".$sincedate."'";
840
-			else $query .= " AND tracker_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
895
+			if ($globalDBdriver == 'mysql') {
896
+				$query .= " AND tracker_output.date > '".$sincedate."'";
897
+			} else {
898
+				$query .= " AND tracker_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
899
+			}
841 900
 		}
842 901
 		$query_values = array();
843 902
 		if ($year != '') {
@@ -868,7 +927,9 @@  discard block
 block discarded – undo
868 927
 			}
869 928
 		}
870 929
 		$query .= " GROUP BY tracker_output.ident ORDER BY callsign_icao_count DESC";
871
-		if ($limit) $query .= " LIMIT 10 OFFSET 0";
930
+		if ($limit) {
931
+			$query .= " LIMIT 10 OFFSET 0";
932
+		}
872 933
       		
873 934
 		$sth = $this->db->prepare($query);
874 935
 		$sth->execute($query_values);
@@ -903,7 +964,9 @@  discard block
 block discarded – undo
903 964
 			date_default_timezone_set($globalTimezone);
904 965
 			$datetime = new DateTime();
905 966
 			$offset = $datetime->format('P');
906
-		} else $offset = '+00:00';
967
+		} else {
968
+			$offset = '+00:00';
969
+		}
907 970
 
908 971
 		if ($globalDBdriver == 'mysql') {
909 972
 			$query  = "SELECT DATE(CONVERT_TZ(tracker_output.date,'+00:00', :offset)) AS date_name, count(*) as date_count
@@ -953,7 +1016,9 @@  discard block
 block discarded – undo
953 1016
 			date_default_timezone_set($globalTimezone);
954 1017
 			$datetime = new DateTime();
955 1018
 			$offset = $datetime->format('P');
956
-		} else $offset = '+00:00';
1019
+		} else {
1020
+			$offset = '+00:00';
1021
+		}
957 1022
 		$filter_query = $this->getFilter($filters,true,true);
958 1023
 		if ($globalDBdriver == 'mysql') {
959 1024
 			$query  = "SELECT DATE(CONVERT_TZ(tracker_output.date,'+00:00', :offset)) AS date_name, count(*) as date_count
@@ -999,7 +1064,9 @@  discard block
 block discarded – undo
999 1064
 			date_default_timezone_set($globalTimezone);
1000 1065
 			$datetime = new DateTime();
1001 1066
 			$offset = $datetime->format('P');
1002
-		} else $offset = '+00:00';
1067
+		} else {
1068
+			$offset = '+00:00';
1069
+		}
1003 1070
 		$filter_query = $this->getFilter($filters,true,true);
1004 1071
 		if ($globalDBdriver == 'mysql') {
1005 1072
 			$query  = "SELECT DATE(CONVERT_TZ(tracker_output.date,'+00:00', :offset)) AS date_name, count(*) as date_count
@@ -1047,7 +1114,9 @@  discard block
 block discarded – undo
1047 1114
 			date_default_timezone_set($globalTimezone);
1048 1115
 			$datetime = new DateTime();
1049 1116
 			$offset = $datetime->format('P');
1050
-		} else $offset = '+00:00';
1117
+		} else {
1118
+			$offset = '+00:00';
1119
+		}
1051 1120
 
1052 1121
 		if ($globalDBdriver == 'mysql') {
1053 1122
 			$query  = "SELECT YEAR(CONVERT_TZ(tracker_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(tracker_output.date,'+00:00', :offset)) AS month_name, count(*) as date_count
@@ -1096,7 +1165,9 @@  discard block
 block discarded – undo
1096 1165
 			date_default_timezone_set($globalTimezone);
1097 1166
 			$datetime = new DateTime();
1098 1167
 			$offset = $datetime->format('P');
1099
-		} else $offset = '+00:00';
1168
+		} else {
1169
+			$offset = '+00:00';
1170
+		}
1100 1171
 		$filter_query = $this->getFilter($filters,true,true);
1101 1172
 		if ($globalDBdriver == 'mysql') {
1102 1173
 			$query  = "SELECT MONTH(CONVERT_TZ(tracker_output.date,'+00:00', :offset)) AS month_name, YEAR(CONVERT_TZ(tracker_output.date,'+00:00', :offset)) AS year_name, count(*) as date_count
@@ -1145,7 +1216,9 @@  discard block
 block discarded – undo
1145 1216
 			date_default_timezone_set($globalTimezone);
1146 1217
 			$datetime = new DateTime();
1147 1218
 			$offset = $datetime->format('P');
1148
-		} else $offset = '+00:00';
1219
+		} else {
1220
+			$offset = '+00:00';
1221
+		}
1149 1222
 
1150 1223
 		$orderby_sql = '';
1151 1224
 		if ($orderby == "hour")
@@ -1214,7 +1287,9 @@  discard block
 block discarded – undo
1214 1287
 			date_default_timezone_set($globalTimezone);
1215 1288
 			$datetime = new DateTime($date);
1216 1289
 			$offset = $datetime->format('P');
1217
-		} else $offset = '+00:00';
1290
+		} else {
1291
+			$offset = '+00:00';
1292
+		}
1218 1293
 
1219 1294
 		if ($globalDBdriver == 'mysql') {
1220 1295
 			$query  = "SELECT HOUR(CONVERT_TZ(tracker_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count
@@ -1262,7 +1337,9 @@  discard block
 block discarded – undo
1262 1337
 			date_default_timezone_set($globalTimezone);
1263 1338
 			$datetime = new DateTime();
1264 1339
 			$offset = $datetime->format('P');
1265
-		} else $offset = '+00:00';
1340
+		} else {
1341
+			$offset = '+00:00';
1342
+		}
1266 1343
 
1267 1344
 		if ($globalDBdriver == 'mysql') {
1268 1345
 			$query  = "SELECT HOUR(CONVERT_TZ(tracker_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count
@@ -1327,8 +1404,11 @@  discard block
 block discarded – undo
1327 1404
 				$query_values = array_merge($query_values,array(':month' => $month));
1328 1405
 			}
1329 1406
 		}
1330
-		if (empty($query_values)) $queryi .= $this->getFilter($filters);
1331
-		else $queryi .= $this->getFilter($filters,true,true).substr($query,4);
1407
+		if (empty($query_values)) {
1408
+			$queryi .= $this->getFilter($filters);
1409
+		} else {
1410
+			$queryi .= $this->getFilter($filters,true,true).substr($query,4);
1411
+		}
1332 1412
 		
1333 1413
 		$sth = $this->db->prepare($queryi);
1334 1414
 		$sth->execute($query_values);
@@ -1365,8 +1445,11 @@  discard block
 block discarded – undo
1365 1445
 				$query_values = array_merge($query_values,array(':month' => $month));
1366 1446
 			}
1367 1447
 		}
1368
-		if (empty($query_values)) $queryi .= $this->getFilter($filters);
1369
-		else $queryi .= $this->getFilter($filters,true,true).substr($query,4);
1448
+		if (empty($query_values)) {
1449
+			$queryi .= $this->getFilter($filters);
1450
+		} else {
1451
+			$queryi .= $this->getFilter($filters,true,true).substr($query,4);
1452
+		}
1370 1453
 		
1371 1454
 		$sth = $this->db->prepare($queryi);
1372 1455
 		$sth->execute($query_values);
@@ -1388,7 +1471,9 @@  discard block
 block discarded – undo
1388 1471
 			date_default_timezone_set($globalTimezone);
1389 1472
 			$datetime = new DateTime();
1390 1473
 			$offset = $datetime->format('P');
1391
-		} else $offset = '+00:00';
1474
+		} else {
1475
+			$offset = '+00:00';
1476
+		}
1392 1477
 
1393 1478
 		if ($globalDBdriver == 'mysql') {
1394 1479
 			$query  = "SELECT HOUR(CONVERT_TZ(tracker_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count
@@ -1492,7 +1577,9 @@  discard block
 block discarded – undo
1492 1577
 	*/
1493 1578
 	public function parseDirection($direction = 0)
1494 1579
 	{
1495
-		if ($direction == '') $direction = 0;
1580
+		if ($direction == '') {
1581
+			$direction = 0;
1582
+		}
1496 1583
 		$direction_array = array();
1497 1584
 		$temp_array = array();
1498 1585
 
@@ -1581,7 +1668,9 @@  discard block
 block discarded – undo
1581 1668
 		$longitude = filter_var($longitude,FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
1582 1669
 	
1583 1670
 		$Connection = new Connection($this->db);
1584
-		if (!$Connection->tableExists('countries')) return '';
1671
+		if (!$Connection->tableExists('countries')) {
1672
+			return '';
1673
+		}
1585 1674
 	
1586 1675
 		try {
1587 1676
 			/*
@@ -1601,9 +1690,13 @@  discard block
 block discarded – undo
1601 1690
 			$sth->closeCursor();
1602 1691
 			if (count($row) > 0) {
1603 1692
 				return $row;
1604
-			} else return '';
1693
+			} else {
1694
+				return '';
1695
+			}
1605 1696
 		} catch (PDOException $e) {
1606
-			if (isset($globalDebug) && $globalDebug) echo 'Error : '.$e->getMessage()."\n";
1697
+			if (isset($globalDebug) && $globalDebug) {
1698
+				echo 'Error : '.$e->getMessage()."\n";
1699
+			}
1607 1700
 			return '';
1608 1701
 		}
1609 1702
 	
@@ -1621,7 +1714,9 @@  discard block
 block discarded – undo
1621 1714
 		$iso2 = filter_var($iso2,FILTER_SANITIZE_STRING);
1622 1715
 	
1623 1716
 		$Connection = new Connection($this->db);
1624
-		if (!$Connection->tableExists('countries')) return '';
1717
+		if (!$Connection->tableExists('countries')) {
1718
+			return '';
1719
+		}
1625 1720
 	
1626 1721
 		try {
1627 1722
 			$query = "SELECT name,iso2,iso3 FROM countries WHERE iso2 = :iso2 LIMIT 1";
@@ -1633,9 +1728,13 @@  discard block
 block discarded – undo
1633 1728
 			$sth->closeCursor();
1634 1729
 			if (count($row) > 0) {
1635 1730
 				return $row;
1636
-			} else return '';
1731
+			} else {
1732
+				return '';
1733
+			}
1637 1734
 		} catch (PDOException $e) {
1638
-			if (isset($globalDebug) && $globalDebug) echo 'Error : '.$e->getMessage()."\n";
1735
+			if (isset($globalDebug) && $globalDebug) {
1736
+				echo 'Error : '.$e->getMessage()."\n";
1737
+			}
1639 1738
 			return '';
1640 1739
 		}
1641 1740
 	
@@ -1696,7 +1795,9 @@  discard block
 block discarded – undo
1696 1795
 			}
1697 1796
 		}
1698 1797
 		$query .= " GROUP BY tracker_output.type ORDER BY tracker_type_count DESC";
1699
-		if ($limit) $query .= " LIMIT 10 OFFSET 0";
1798
+		if ($limit) {
1799
+			$query .= " LIMIT 10 OFFSET 0";
1800
+		}
1700 1801
 		$sth = $this->db->prepare($query);
1701 1802
 		$sth->execute($query_values);
1702 1803
 		$tracker_array = array();
@@ -1733,7 +1834,9 @@  discard block
 block discarded – undo
1733 1834
 				foreach ($q_array as $q_item){
1734 1835
 					$q_item = filter_var($q_item,FILTER_SANITIZE_STRING);
1735 1836
 					$additional_query .= " AND (";
1736
-					if (is_int($q_item)) $additional_query .= "(tracker_output.tracker_id = '".$q_item."') OR ";
1837
+					if (is_int($q_item)) {
1838
+						$additional_query .= "(tracker_output.tracker_id = '".$q_item."') OR ";
1839
+					}
1737 1840
 					$additional_query .= "(tracker_output.ident like '%".$q_item."%') OR ";
1738 1841
 					$additional_query .= ")";
1739 1842
 				}
@@ -1759,7 +1862,9 @@  discard block
 block discarded – undo
1759 1862
 				date_default_timezone_set($globalTimezone);
1760 1863
 				$datetime = new DateTime();
1761 1864
 				$offset = $datetime->format('P');
1762
-			} else $offset = '+00:00';
1865
+			} else {
1866
+				$offset = '+00:00';
1867
+			}
1763 1868
 			if ($date_array[1] != "")
1764 1869
 			{
1765 1870
 				$date_array[0] = date("Y-m-d H:i:s", strtotime($date_array[0]));
@@ -1786,8 +1891,12 @@  discard block
 block discarded – undo
1786 1891
 			if ($limit_array[0] >= 0 && $limit_array[1] >= 0)
1787 1892
 			{
1788 1893
 				$limit_query = " LIMIT ".$limit_array[1]." OFFSET ".$limit_array[0];
1789
-			} else $limit_query = "";
1790
-		} else $limit_query = "";
1894
+			} else {
1895
+				$limit_query = "";
1896
+			}
1897
+		} else {
1898
+			$limit_query = "";
1899
+		}
1791 1900
 		if ($sort != "")
1792 1901
 		{
1793 1902
 			$search_orderby_array = $this->getOrderBy();
@@ -1830,7 +1939,9 @@  discard block
 block discarded – undo
1830 1939
 	{
1831 1940
 		global $globalBitlyAccessToken;
1832 1941
 		
1833
-		if ($globalBitlyAccessToken == '') return $url;
1942
+		if ($globalBitlyAccessToken == '') {
1943
+			return $url;
1944
+		}
1834 1945
 		$google_url = 'https://api-ssl.bitly.com/v3/shorten?access_token='.$globalBitlyAccessToken.'&longUrl='.$url;
1835 1946
 		$ch = curl_init();
1836 1947
 		curl_setopt($ch, CURLOPT_HEADER, 0);
Please login to merge, or discard this patch.
table-output.php 1 patch
Braces   +68 added lines, -25 removed lines patch added patch discarded remove patch
@@ -7,7 +7,9 @@  discard block
 block discarded – undo
7 7
 $showRouteStop = $Common->multiKeyExists($spotter_array,'route_stop');
8 8
 $showDuration = $Common->multiKeyExists($spotter_array,'duration');
9 9
 
10
-if (!isset($type)) $type = 'aircraft';
10
+if (!isset($type)) {
11
+	$type = 'aircraft';
12
+}
11 13
 
12 14
 if (!isset($_GET['sort'])) 
13 15
 {
@@ -565,7 +567,9 @@  discard block
 block discarded – undo
565 567
 	if (isset($globalTimezone))
566 568
 	{
567 569
 		date_default_timezone_set($globalTimezone);
568
-	} else date_default_timezone_set('UTC');
570
+	} else {
571
+		date_default_timezone_set('UTC');
572
+	}
569 573
 	if ($showSpecial === true)
570 574
 	{
571 575
 		print '<tr class="special">'."\n";
@@ -580,7 +584,9 @@  discard block
 block discarded – undo
580 584
 			print '<tr class="active">';
581 585
 		} elseif (isset($spotter_item['spotted_registration'])) {
582 586
 			print '<tr class="info">';
583
-		} else print '<tr>';
587
+		} else {
588
+			print '<tr>';
589
+		}
584 590
 	}
585 591
 	if (strtolower($current_page) == "acars-latest" || strtolower($current_page) == "acars-archive" || strtolower($current_page) == "currently" || strtolower($current_page) == "accident-latest" || strtolower($current_page) == "incident-latest" || strtolower($current_page) == "accident-detailed" || strtolower($current_page) == "incident-detailed") {
586 592
 		if ($type == 'aircraft') {
@@ -588,8 +594,9 @@  discard block
 block discarded – undo
588 594
 			{
589 595
 				print '<td class="aircraft_thumbnail">'."\n";
590 596
 				if ($spotter_item['image_source'] == 'planespotters') {
591
-					if ($spotter_item['image_source_website'] != '') $image_src = $spotter_item['image_source_website'];
592
-					else {
597
+					if ($spotter_item['image_source_website'] != '') {
598
+						$image_src = $spotter_item['image_source_website'];
599
+					} else {
593 600
 						$planespotter_url_array = explode("_", $spotter_item['image']);
594 601
 						$planespotter_id = str_replace(".jpg", "", $planespotter_url_array[1]);
595 602
 						$image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id;
@@ -602,7 +609,9 @@  discard block
 block discarded – undo
602 609
 				} else {
603 610
 					if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') {
604 611
 						$image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']);
605
-					} else 	$image_thumbnail = $spotter_item['image_thumbnail'];
612
+					} else {
613
+						$image_thumbnail = $spotter_item['image_thumbnail'];
614
+					}
606 615
 					if (isset($spotter_item['airline_name'])) {
607 616
 						print '<img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" alt="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Airline:").' '.$spotter_item['airline_name'].'" data-html="true" width="100px" />'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
608 617
 					} else {
@@ -621,7 +630,9 @@  discard block
 block discarded – undo
621 630
 				print '<td class="aircraft_thumbnail">'."\n";
622 631
 				if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') {
623 632
 					$image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']);
624
-				} else 	$image_thumbnail = $spotter_item['image_thumbnail'];
633
+				} else {
634
+					$image_thumbnail = $spotter_item['image_thumbnail'];
635
+				}
625 636
 				if (isset($spotter_item['mmsi']) && $spotter_item['mmsi'] != '') {
626 637
 					print '<img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['mmsi'].'" alt="'.$spotter_item['mmsi'].'" data-content="'._("MMSI:").' '.$spotter_item['mmsi'].'" data-html="true" width="100px" />'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
627 638
 				} else {
@@ -643,7 +654,9 @@  discard block
 block discarded – undo
643 654
 				print '<td class="aircraft_thumbnail">'."\n";
644 655
 				if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') {
645 656
 					$image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']);
646
-				} else 	$image_thumbnail = $spotter_item['image_thumbnail'];
657
+				} else {
658
+					$image_thumbnail = $spotter_item['image_thumbnail'];
659
+				}
647 660
 				print '<img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['ident'].'" alt="'.$spotter_item['type'].'" data-content="'._("Type:").' '.$spotter_item['type'].'" data-html="true" width="100px" />'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
648 661
 				print '</td>'."\n";
649 662
 			} else {
@@ -696,8 +709,9 @@  discard block
 block discarded – undo
696 709
 				print '<td class="aircraft_thumbnail">'."\n";
697 710
 				//print '<a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'"><img src="'.$spotter_item['image_thumbnail'].'" alt="Click to see more information about this flight" title="Click to see more information about this flight" width="100px" /></a>';
698 711
 				if ($spotter_item['image_source'] == 'planespotters') {
699
-					if ($spotter_item['image_source_website'] != '') $image_src = $spotter_item['image_source_website'];
700
-					else {
712
+					if ($spotter_item['image_source_website'] != '') {
713
+						$image_src = $spotter_item['image_source_website'];
714
+					} else {
701 715
 						$planespotter_url_array = explode("_", $spotter_array[0]['image']);
702 716
 						$planespotter_id = str_replace(".jpg", "", $planespotter_url_array[1]);
703 717
 						$image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id;
@@ -714,7 +728,9 @@  discard block
 block discarded – undo
714 728
 				} else {
715 729
 					if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') {
716 730
 						$image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']);
717
-					} else 	$image_thumbnail = $spotter_item['image_thumbnail'];
731
+					} else {
732
+						$image_thumbnail = $spotter_item['image_thumbnail'];
733
+					}
718 734
 					if (!isset($spotter_item['airline_name']) && isset($spotter_item['aircraft_name'])) {
719 735
 						print '<a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'"><img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '._("Not available").'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
720 736
 					} elseif (!isset($spotter_item['aircraft_name']) && isset($spotter_item['airline_name'])) {
@@ -747,7 +763,9 @@  discard block
 block discarded – undo
747 763
 				print '<td class="aircraft_thumbnail">'."\n";
748 764
 				if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') {
749 765
 					$image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']);
750
-				} else 	$image_thumbnail = $spotter_item['image_thumbnail'];
766
+				} else {
767
+					$image_thumbnail = $spotter_item['image_thumbnail'];
768
+				}
751 769
 				if (isset($spotter_item['mmsi']) && $spotter_item['mmsi'] != '') {
752 770
 					print '<img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['mmsi'].'" alt="'.$spotter_item['mmsi'].'" data-content="'._("MMSI:").' '.$spotter_item['mmsi'].'" data-html="true" width="100px" />'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
753 771
 				} else {
@@ -769,7 +787,9 @@  discard block
 block discarded – undo
769 787
 				print '<td class="aircraft_thumbnail">'."\n";
770 788
 				if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') {
771 789
 					$image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']);
772
-				} else 	$image_thumbnail = $spotter_item['image_thumbnail'];
790
+				} else {
791
+					$image_thumbnail = $spotter_item['image_thumbnail'];
792
+				}
773 793
 				print '<img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['ident'].'" alt="'.$spotter_item['type'].'" data-content="'._("Type:").' '.$spotter_item['type'].'" data-html="true" width="100px" />'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
774 794
 				print '</td>'."\n";
775 795
 			} else {
@@ -887,8 +907,11 @@  discard block
 block discarded – undo
887 907
 				print '<span class="nomobile"><a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_type'].'</a></span>'."\n";
888 908
 			} else {
889 909
 				$aircraft_names = explode('/',$spotter_item['aircraft_name']);
890
-				if (count($aircraft_names) == 1) print '<span class="nomobile"><a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name'].'</a></span>'."\n";
891
-				else print '<span class="nomobile"><a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'" title="'.$spotter_item['aircraft_name'].'">'.$spotter_item['aircraft_manufacturer'].' '.$aircraft_names[0].'</a></span>'."\n";
910
+				if (count($aircraft_names) == 1) {
911
+					print '<span class="nomobile"><a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name'].'</a></span>'."\n";
912
+				} else {
913
+					print '<span class="nomobile"><a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'" title="'.$spotter_item['aircraft_name'].'">'.$spotter_item['aircraft_manufacturer'].' '.$aircraft_names[0].'</a></span>'."\n";
914
+				}
892 915
 			}
893 916
 			print '<span class="mobile"><a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_type'].'</a></span>'."\n";
894 917
 		} elseif ($type == 'marine') {
@@ -931,15 +954,21 @@  discard block
 block discarded – undo
931 954
 			if (isset($spotter_item['departure_airport_time']) && isset($spotter_item['real_departure_airport_time'])) {
932 955
 				if ($spotter_item['departure_airport_time'] > 2460) {
933 956
 					$departure_airport_time = date('H:m',$spotter_item['departure_airport_time']);
934
-				} else $departure_airport_time = substr($spotter_item['departure_airport_time'],0,-2).':'.substr($spotter_item['departure_airport_time'],-2);
957
+				} else {
958
+					$departure_airport_time = substr($spotter_item['departure_airport_time'],0,-2).':'.substr($spotter_item['departure_airport_time'],-2);
959
+				}
935 960
 				if ($spotter_item['real_departure_airport_time'] > 2460) {
936 961
 					$real_departure_airport_time = date('H:m',$spotter_item['real_departure_airport_time']);
937
-				} else $real_departure_airport_time = $spotter_item['real_departure_airport_time'];
962
+				} else {
963
+					$real_departure_airport_time = $spotter_item['real_departure_airport_time'];
964
+				}
938 965
 				print '<br /><span class="airport_time">'.$departure_airport_time.' ('.$real_departure_airport_time.')</span>'."\n";
939 966
 			} elseif (isset($spotter_item['real_departure_airport_time']) && $spotter_item['real_departure_airport_time'] != 'NULL') {
940 967
 				if ($spotter_item['real_departure_airport_time'] > 2460) {
941 968
 					$real_departure_airport_time = date('H:m',$spotter_item['real_departure_airport_time']);
942
-				} else $real_departure_airport_time = $spotter_item['real_departure_airport_time'];
969
+				} else {
970
+					$real_departure_airport_time = $spotter_item['real_departure_airport_time'];
971
+				}
943 972
 				print '<br /><span class="airport_time">'.$real_departure_airport_time.'</span>'."\n";
944 973
 			} elseif (isset($spotter_item['departure_airport_time']) && $spotter_item['departure_airport_time'] != 'NULL') {
945 974
 				if ($spotter_item['departure_airport_time'] > 2460) {
@@ -961,7 +990,9 @@  discard block
 block discarded – undo
961 990
 						$longitude = $spotter_item['longitude'];
962 991
 					}
963 992
 					$distance = $Spotter->getAirportDistance($spotter_item['departure_airport'],$latitude,$longitude);
964
-				} else $distance = '';
993
+				} else {
994
+					$distance = '';
995
+				}
965 996
 				if ($distance != '') {
966 997
 					if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) {
967 998
 						echo '<br/><i>'.round($distance*0.539957).' nm</i>';
@@ -988,7 +1019,9 @@  discard block
 block discarded – undo
988 1019
 			} else {
989 1020
 				if (isset($spotter_item['real_arrival_airport']) && $spotter_item['real_arrival_airport'] != $spotter_item['arrival_airport']) {
990 1021
 					print '<span class="nomobile">Scheduled : <a href="'.$globalURL.'/airport/'.$spotter_item['arrival_airport'].'">'.$spotter_item['arrival_airport_city'].', '.$spotter_item['arrival_airport_country'].' ('.$spotter_item['arrival_airport'].')</a></span>'."\n";
991
-					if (!isset($Spotter)) $Spotter = new Spotter();
1022
+					if (!isset($Spotter)) {
1023
+						$Spotter = new Spotter();
1024
+					}
992 1025
 					$arrival_airport_info = $Spotter->getAllAirportInfo($spotter_item['real_arrival_airport']);
993 1026
 					print '<br /><span class="nomobile">'._("Real:").' <a href="'.$globalURL.'/airport/'.$spotter_item['real_arrival_airport'].'">'.$arrival_airport_info[0]['city'].','.$arrival_airport_info[0]['country'].' ('.$spotter_item['real_arrival_airport'].')</a></span>'."\n";
994 1027
 					print '<span class="mobile">'._("Scheduled:").' <a href="'.$globalURL.'/airport/'.$spotter_item['real_arrival_airport'].'">'.$spotter_item['real_arrival_airport'].'</a></span>'."\n";
@@ -1004,20 +1037,28 @@  discard block
 block discarded – undo
1004 1037
 			if (isset($spotter_item['arrival_airport_time']) && isset($spotter_item['real_arrival_airport_time'])) {
1005 1038
 				if ($spotter_item['arrival_airport_time'] > 2460) {
1006 1039
 					$arrival_airport_time = date('H:m',$spotter_item['arrival_airport_time']);
1007
-				} else $arrival_airport_time = $spotter_item['arrival_airport_time'];
1040
+				} else {
1041
+					$arrival_airport_time = $spotter_item['arrival_airport_time'];
1042
+				}
1008 1043
 				if ($spotter_item['real_arrival_airport_time'] > 2460) {
1009 1044
 					$real_arrival_airport_time = date('H:m',$spotter_item['real_arrival_airport_time']);
1010
-				} else $real_arrival_airport_time = $spotter_item['real_arrival_airport_time'];
1045
+				} else {
1046
+					$real_arrival_airport_time = $spotter_item['real_arrival_airport_time'];
1047
+				}
1011 1048
 				print '<br /><span class="airport_time">'.$spotter_item['arrival_airport_time'].' ('.$spotter_item['real_arrival_airport_time'].')</span>'."\n";
1012 1049
 			} elseif (isset($spotter_item['real_arrival_airport_time'])) {
1013 1050
 				if ($spotter_item['real_arrival_airport_time'] > 2460) {
1014 1051
 					$real_arrival_airport_time = date('H:m',$spotter_item['real_arrival_airport_time']);
1015
-				} else $real_arrival_airport_time = $spotter_item['real_arrival_airport_time'];
1052
+				} else {
1053
+					$real_arrival_airport_time = $spotter_item['real_arrival_airport_time'];
1054
+				}
1016 1055
 				print '<br /><span class="airport_time">'.$real_arrival_airport_time.'</span>'."\n";
1017 1056
 			} elseif (isset($spotter_item['arrival_airport_time']) && $spotter_item['arrival_airport_time'] != 'NULL') {
1018 1057
 				if ($spotter_item['arrival_airport_time'] > 2460) {
1019 1058
 					$arrival_airport_time = date('H:m',$spotter_item['arrival_airport_time']);
1020
-				} else $arrival_airport_time = $spotter_item['arrival_airport_time'];
1059
+				} else {
1060
+					$arrival_airport_time = $spotter_item['arrival_airport_time'];
1061
+				}
1021 1062
 				print '<br /><span class="airport_time">'.$arrival_airport_time.'</span>'."\n";
1022 1063
 			}
1023 1064
 			if (!isset($spotter_item['real_arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') {
@@ -1030,7 +1071,9 @@  discard block
 block discarded – undo
1030 1071
 						$longitude = $spotter_item['longitude'];
1031 1072
 					}
1032 1073
 					$distance = $Spotter->getAirportDistance($spotter_item['arrival_airport'],$latitude,$longitude);
1033
-				} else $distance = '';
1074
+				} else {
1075
+					$distance = '';
1076
+				}
1034 1077
 				if ($distance != '') {
1035 1078
 					if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) {
1036 1079
 						echo '<br/><i>'.round($distance*0.539957).' nm</i>';
Please login to merge, or discard this patch.
race-detailed.php 1 patch
Braces   +15 added lines, -5 removed lines patch added patch discarded remove patch
@@ -38,8 +38,12 @@  discard block
 block discarded – undo
38 38
 	$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);
39 39
 	$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT);
40 40
 	$filter = array();
41
-	if ($year != '') $filter = array_merge($filter,array('year' => $year));
42
-	if ($month != '') $filter = array_merge($filter,array('month' => $month));
41
+	if ($year != '') {
42
+		$filter = array_merge($filter,array('year' => $year));
43
+	}
44
+	if ($month != '') {
45
+		$filter = array_merge($filter,array('month' => $month));
46
+	}
43 47
 	if ($sort != '') 
44 48
 	{
45 49
 		$spotter_array = $Marine->getMarineDataByRace($race,$limit_start.",".$absolute_difference, $sort,$filter);
@@ -57,8 +61,12 @@  discard block
 block discarded – undo
57 61
 	{
58 62
 		$title = sprintf(_("Detailed View for %s"),$spotter_array[0]['race_name']);
59 63
 		$ident = $spotter_array[0]['ident'];
60
-		if (isset($spotter_array[0]['latitude'])) $latitude = $spotter_array[0]['latitude'];
61
-		if (isset($spotter_array[0]['longitude'])) $longitude = $spotter_array[0]['longitude'];
64
+		if (isset($spotter_array[0]['latitude'])) {
65
+			$latitude = $spotter_array[0]['latitude'];
66
+		}
67
+		if (isset($spotter_array[0]['longitude'])) {
68
+			$longitude = $spotter_array[0]['longitude'];
69
+		}
62 70
 		require_once('header.php');
63 71
 		/*
64 72
 		if (isset($globalArchive) && $globalArchive) {
@@ -111,7 +119,9 @@  discard block
 block discarded – undo
111 119
 		*/
112 120
 		print '<div class="info column">';
113 121
 		print '<h1>'.$spotter_array[0]['race_name'].'</h1>';
114
-		if (isset($spotter_array[0]['race_id']) && $spotter_array[0]['race_id'] != '') print '<div><span class="label">'._("race ID").'</span>'.$spotter_array[0]['race_id'].'</div>';
122
+		if (isset($spotter_array[0]['race_id']) && $spotter_array[0]['race_id'] != '') {
123
+			print '<div><span class="label">'._("race ID").'</span>'.$spotter_array[0]['race_id'].'</div>';
124
+		}
115 125
 		/*
116 126
 		if ($year == '' && $month == '') {
117 127
 			$Stats = new Stats();
Please login to merge, or discard this patch.
race.php 1 patch
Braces   +11 added lines, -4 removed lines patch added patch discarded remove patch
@@ -33,7 +33,9 @@  discard block
 block discarded – undo
33 33
 			}
34 34
 			print '<a href="#'.$firstLetter.'">'.$firstLetter.'</a>';
35 35
 		}
36
-		if ($firstLetter != "'") $previous = $firstLetter;
36
+		if ($firstLetter != "'") {
37
+			$previous = $firstLetter;
38
+		}
37 39
 	}
38 40
 	print '</div>';
39 41
 	$previous = null;
@@ -48,10 +50,15 @@  discard block
 block discarded – undo
48 50
 				}
49 51
 				print '<a name="'.$firstLetter.'"></a><h4 class="alphabet-header">'.$firstLetter.'</h4><div class="alphabet">';
50 52
 			}
51
-			if ($firstLetter != "'") $previous = $firstLetter;
53
+			if ($firstLetter != "'") {
54
+				$previous = $firstLetter;
55
+			}
52 56
 			print '<div class="alphabet-item">';
53
-			if (isset($value['race_id']) && $value['race_id'] != '') print '<a href="'.$globalURL.'/marine/race/'.$value['race_id'].'">'.$value['race_name'].' ('.$value['race_id'].')';
54
-			else print '<a href="'.$globalURL.'/race/'.$value['race_name'].'">'.$value['race_name'];
57
+			if (isset($value['race_id']) && $value['race_id'] != '') {
58
+				print '<a href="'.$globalURL.'/marine/race/'.$value['race_id'].'">'.$value['race_name'].' ('.$value['race_id'].')';
59
+			} else {
60
+				print '<a href="'.$globalURL.'/race/'.$value['race_name'].'">'.$value['race_name'];
61
+			}
55 62
 			print '</a>';
56 63
 			print '</div>';
57 64
 		}
Please login to merge, or discard this patch.
require/class.Marine.php 1 patch
Braces   +232 added lines, -82 removed lines patch added patch discarded remove patch
@@ -8,7 +8,9 @@  discard block
 block discarded – undo
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. (Marine)');
11
+		if ($this->db === null) {
12
+			die('Error: No DB connection. (Marine)');
13
+		}
12 14
 	}
13 15
 
14 16
 	/**
@@ -30,7 +32,9 @@  discard block
 block discarded – undo
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) {
@@ -78,8 +82,11 @@  discard block
 block discarded – undo
78 82
 				$filter_query_where .= " AND EXTRACT(DAY FROM marine_output.date) = '".$filter['day']."'";
79 83
 			}
80 84
 		}
81
-		if ($filter_query_where == '' && $where) $filter_query_where = ' WHERE';
82
-		elseif ($filter_query_where != '' && $and) $filter_query_where .= ' AND';
85
+		if ($filter_query_where == '' && $where) {
86
+			$filter_query_where = ' WHERE';
87
+		} elseif ($filter_query_where != '' && $and) {
88
+			$filter_query_where .= ' AND';
89
+		}
83 90
 		if ($filter_query_where != '') {
84 91
 			$filter_query_where = preg_replace('/^ AND/',' WHERE',$filter_query_where);
85 92
 		}
@@ -133,40 +140,78 @@  discard block
 block discarded – undo
133 140
 				$temp_array['spotter_id'] = $row['spotter_archive_id'];
134 141
 			} elseif (isset($row['spotter_archive_output_id'])) {
135 142
 				$temp_array['spotter_id'] = $row['spotter_archive_output_id'];
136
-			*/} 
137
-			elseif (isset($row['marineid'])) {
143
+			*/} elseif (isset($row['marineid'])) {
138 144
 				$temp_array['marine_id'] = $row['marineid'];
139 145
 			} else {
140 146
 				$temp_array['marine_id'] = '';
141 147
 			}
142
-			if (isset($row['fammarine_id'])) $temp_array['fammarine_id'] = $row['fammarine_id'];
143
-			if (isset($row['mmsi'])) $temp_array['mmsi'] = $row['mmsi'];
144
-			if (isset($row['type'])) $temp_array['type'] = $row['type'];
145
-			if (isset($row['type_id'])) $temp_array['type_id'] = $row['type_id'];
146
-			if (isset($row['status'])) $temp_array['status'] = $row['status'];
147
-			if (isset($row['status_id'])) $temp_array['status_id'] = $row['status_id'];
148
-			if (isset($row['captain_id'])) $temp_array['captain_id'] = $row['captain_id'];
149
-			if (isset($row['captain_name'])) $temp_array['captain_name'] = $row['captain_name'];
150
-			if (isset($row['race_id'])) $temp_array['race_id'] = $row['race_id'];
151
-			if (isset($row['race_name'])) $temp_array['race_name'] = $row['race_name'];
152
-			if (isset($row['ident'])) $temp_array['ident'] = $row['ident'];
153
-			if (isset($row['arrival_port_name'])) $temp_array['arrival_port_name'] = $row['arrival_port_name'];
154
-			if (isset($row['latitude'])) $temp_array['latitude'] = $row['latitude'];
155
-			if (isset($row['longitude'])) $temp_array['longitude'] = $row['longitude'];
156
-			if (isset($row['distance']) && $row['distance'] != '') $temp_array['distance'] = $row['distance'];
157
-			if (isset($row['format_source'])) $temp_array['format_source'] = $row['format_source'];
148
+			if (isset($row['fammarine_id'])) {
149
+				$temp_array['fammarine_id'] = $row['fammarine_id'];
150
+			}
151
+			if (isset($row['mmsi'])) {
152
+				$temp_array['mmsi'] = $row['mmsi'];
153
+			}
154
+			if (isset($row['type'])) {
155
+				$temp_array['type'] = $row['type'];
156
+			}
157
+			if (isset($row['type_id'])) {
158
+				$temp_array['type_id'] = $row['type_id'];
159
+			}
160
+			if (isset($row['status'])) {
161
+				$temp_array['status'] = $row['status'];
162
+			}
163
+			if (isset($row['status_id'])) {
164
+				$temp_array['status_id'] = $row['status_id'];
165
+			}
166
+			if (isset($row['captain_id'])) {
167
+				$temp_array['captain_id'] = $row['captain_id'];
168
+			}
169
+			if (isset($row['captain_name'])) {
170
+				$temp_array['captain_name'] = $row['captain_name'];
171
+			}
172
+			if (isset($row['race_id'])) {
173
+				$temp_array['race_id'] = $row['race_id'];
174
+			}
175
+			if (isset($row['race_name'])) {
176
+				$temp_array['race_name'] = $row['race_name'];
177
+			}
178
+			if (isset($row['ident'])) {
179
+				$temp_array['ident'] = $row['ident'];
180
+			}
181
+			if (isset($row['arrival_port_name'])) {
182
+				$temp_array['arrival_port_name'] = $row['arrival_port_name'];
183
+			}
184
+			if (isset($row['latitude'])) {
185
+				$temp_array['latitude'] = $row['latitude'];
186
+			}
187
+			if (isset($row['longitude'])) {
188
+				$temp_array['longitude'] = $row['longitude'];
189
+			}
190
+			if (isset($row['distance']) && $row['distance'] != '') {
191
+				$temp_array['distance'] = $row['distance'];
192
+			}
193
+			if (isset($row['format_source'])) {
194
+				$temp_array['format_source'] = $row['format_source'];
195
+			}
158 196
 			if (isset($row['heading'])) {
159 197
 				$temp_array['heading'] = $row['heading'];
160 198
 				$heading_direction = $this->parseDirection($row['heading']);
161
-				if (isset($heading_direction[0]['direction_fullname'])) $temp_array['heading_name'] = $heading_direction[0]['direction_fullname'];
199
+				if (isset($heading_direction[0]['direction_fullname'])) {
200
+					$temp_array['heading_name'] = $heading_direction[0]['direction_fullname'];
201
+				}
202
+			}
203
+			if (isset($row['ground_speed'])) {
204
+				$temp_array['ground_speed'] = $row['ground_speed'];
162 205
 			}
163
-			if (isset($row['ground_speed'])) $temp_array['ground_speed'] = $row['ground_speed'];
164 206
 
165 207
 			if(isset($temp_array['mmsi']) && $temp_array['mmsi'] != "")
166 208
 			{
167 209
 				$Image = new Image($this->db);
168
-				if (isset($temp_array['ident']) && $temp_array['ident'] != '') $image_array = $Image->getMarineImage($temp_array['mmsi'],'',$temp_array['ident']);
169
-				else $image_array = $Image->getMarineImage($temp_array['mmsi']);
210
+				if (isset($temp_array['ident']) && $temp_array['ident'] != '') {
211
+					$image_array = $Image->getMarineImage($temp_array['mmsi'],'',$temp_array['ident']);
212
+				} else {
213
+					$image_array = $Image->getMarineImage($temp_array['mmsi']);
214
+				}
170 215
 				unset($Image);
171 216
 				if (count($image_array) > 0) {
172 217
 					$temp_array['image'] = $image_array[0]['image'];
@@ -218,13 +263,21 @@  discard block
 block discarded – undo
218 263
 			}
219 264
 			
220 265
 			$fromsource = NULL;
221
-			if (isset($row['source_name']) && $row['source_name'] != '') $temp_array['source_name'] = $row['source_name'];
222
-			if (isset($row['over_country']) && $row['over_country'] != '') $temp_array['over_country'] = $row['over_country'];
223
-			if (isset($row['distance']) && $row['distance'] != '') $temp_array['distance'] = $row['distance'];
266
+			if (isset($row['source_name']) && $row['source_name'] != '') {
267
+				$temp_array['source_name'] = $row['source_name'];
268
+			}
269
+			if (isset($row['over_country']) && $row['over_country'] != '') {
270
+				$temp_array['over_country'] = $row['over_country'];
271
+			}
272
+			if (isset($row['distance']) && $row['distance'] != '') {
273
+				$temp_array['distance'] = $row['distance'];
274
+			}
224 275
 			$temp_array['query_number_rows'] = $num_rows;
225 276
 			$spotter_array[] = $temp_array;
226 277
 		}
227
-		if ($num_rows == 0) return array();
278
+		if ($num_rows == 0) {
279
+			return array();
280
+		}
228 281
 		$spotter_array[0]['query_number_rows'] = $num_rows;
229 282
 		return $spotter_array;
230 283
 	}	
@@ -250,8 +303,12 @@  discard block
 block discarded – undo
250 303
 			{
251 304
 				//$limit_query = " LIMIT ".$limit_array[0].",".$limit_array[1];
252 305
 				$limit_query = " LIMIT ".$limit_array[1]." OFFSET ".$limit_array[0];
253
-			} else $limit_query = "";
254
-		} else $limit_query = "";
306
+			} else {
307
+				$limit_query = "";
308
+			}
309
+		} else {
310
+			$limit_query = "";
311
+		}
255 312
 		if ($sort != "")
256 313
 		{
257 314
 			$search_orderby_array = $this->getOrderBy();
@@ -275,7 +332,9 @@  discard block
 block discarded – undo
275 332
 		global $global_marine_query;
276 333
 		
277 334
 		date_default_timezone_set('UTC');
278
-		if ($id == '') return array();
335
+		if ($id == '') {
336
+			return array();
337
+		}
279 338
 		$additional_query = "marine_output.fammarine_id = :id";
280 339
 		$query_values = array(':id' => $id);
281 340
 		$query  = $global_marine_query." WHERE ".$additional_query." ";
@@ -719,8 +778,11 @@  discard block
 block discarded – undo
719 778
 		$sth = $this->db->prepare($query);
720 779
 		$sth->execute($query_values);
721 780
 		$result = $sth->fetchAll(PDO::FETCH_ASSOC);
722
-		if (is_int($result[0]['duration'])) return gmdate('H:i:s',$result[0]['duration']);
723
-		else return $result[0]['duration'];
781
+		if (is_int($result[0]['duration'])) {
782
+			return gmdate('H:i:s',$result[0]['duration']);
783
+		} else {
784
+			return $result[0]['duration'];
785
+		}
724 786
 	}
725 787
 
726 788
 	/**
@@ -779,8 +841,11 @@  discard block
 block discarded – undo
779 841
 		$query .= " ORDER BY marine_output.source_name ASC";
780 842
 
781 843
 		$sth = $this->db->prepare($query);
782
-		if (!empty($query_values)) $sth->execute($query_values);
783
-		else $sth->execute();
844
+		if (!empty($query_values)) {
845
+			$sth->execute($query_values);
846
+		} else {
847
+			$sth->execute();
848
+		}
784 849
 
785 850
 		$source_array = array();
786 851
 		$temp_array = array();
@@ -835,8 +900,11 @@  discard block
 block discarded – undo
835 900
 		$sth = $this->db->prepare($query);
836 901
 		$sth->execute(array(':mmsi' => $mmsi));
837 902
 		$result = $sth->fetchAll(PDO::FETCH_ASSOC);
838
-		if (isset($result[0])) return $result[0];
839
-		else return array();
903
+		if (isset($result[0])) {
904
+			return $result[0];
905
+		} else {
906
+			return array();
907
+		}
840 908
 	}
841 909
 
842 910
 	/**
@@ -877,7 +945,9 @@  discard block
 block discarded – undo
877 945
 			date_default_timezone_set($globalTimezone);
878 946
 			$datetime = new DateTime();
879 947
 			$offset = $datetime->format('P');
880
-		} else $offset = '+00:00';
948
+		} else {
949
+			$offset = '+00:00';
950
+		}
881 951
 
882 952
 		if ($globalDBdriver == 'mysql') {
883 953
 			$query  = "SELECT DISTINCT DATE(CONVERT_TZ(marine_output.date,'+00:00', :offset)) as date
@@ -1129,14 +1199,28 @@  discard block
 block discarded – undo
1129 1199
 			$latitude = 0;
1130 1200
 			$longitude = 0;
1131 1201
 		}
1132
-		if ($type_id == '') $type_id = NULL;
1133
-		if ($status_id == '') $status_id = NULL;
1134
-		if ($distance == '') $distance = NULL;
1135
-		if ($race_rank == '') $race_rank = NULL;
1136
-		if ($race_time == '') $race_time = NULL;
1137
-		if ($heading == '' || $Common->isInteger($heading) === false) $heading = 0;
1202
+		if ($type_id == '') {
1203
+			$type_id = NULL;
1204
+		}
1205
+		if ($status_id == '') {
1206
+			$status_id = NULL;
1207
+		}
1208
+		if ($distance == '') {
1209
+			$distance = NULL;
1210
+		}
1211
+		if ($race_rank == '') {
1212
+			$race_rank = NULL;
1213
+		}
1214
+		if ($race_time == '') {
1215
+			$race_time = NULL;
1216
+		}
1217
+		if ($heading == '' || $Common->isInteger($heading) === false) {
1218
+			$heading = 0;
1219
+		}
1138 1220
 		//if ($groundspeed == '' || $Common->isInteger($groundspeed) === false) $groundspeed = 0;
1139
-		if ($arrival_date == '') $arrival_date = NULL;
1221
+		if ($arrival_date == '') {
1222
+			$arrival_date = NULL;
1223
+		}
1140 1224
 		$query  = "INSERT INTO marine_output (fammarine_id, ident, latitude, longitude, heading, ground_speed, date, format_source, source_name, mmsi, type, type_id, status,status_id,imo,arrival_port_name,arrival_port_date,captain_id,captain_name,race_id,race_name, distance, race_rank,race_time) 
1141 1225
 		    VALUES (:fammarine_id,:ident,:latitude,:longitude,:heading,:speed,:date,:format_source, :source_name,:mmsi,:type,:type_id,:status,:status_id,:imo,:arrival_port_name,:arrival_port_date,:captain_id,:captain_name,:race_id,:race_name, :distance, :race_rank,:race_time)";
1142 1226
 
@@ -1243,7 +1327,9 @@  discard block
 block discarded – undo
1243 1327
 		global $globalDBdriver, $globalArchive;
1244 1328
 		//$filter_query = $this->getFilter($filters,true,true);
1245 1329
 		$Connection= new Connection($this->db);
1246
-		if (!$Connection->tableExists('countries')) return array();
1330
+		if (!$Connection->tableExists('countries')) {
1331
+			return array();
1332
+		}
1247 1333
 		require_once('class.SpotterLive.php');
1248 1334
 		if (!isset($globalArchive) || $globalArchive !== TRUE) {
1249 1335
 			$MarineLive = new MarineLive($this->db);
@@ -1287,7 +1373,9 @@  discard block
 block discarded – undo
1287 1373
 			$query = "SELECT c.name, c.iso3, c.iso2, count(c.name) as nb FROM countries c INNER JOIN (SELECT DISTINCT fammarine_id,over_country FROM marine_archive".$filter_query.") l ON c.iso2 = l.over_country ";
1288 1374
 		}
1289 1375
 		$query .= "GROUP BY c.name,c.iso3,c.iso2 ORDER BY nb DESC";
1290
-		if ($limit) $query .= " LIMIT 10 OFFSET 0";
1376
+		if ($limit) {
1377
+			$query .= " LIMIT 10 OFFSET 0";
1378
+		}
1291 1379
 
1292 1380
 		$sth = $this->db->prepare($query);
1293 1381
 		$sth->execute();
@@ -1321,12 +1409,18 @@  discard block
 block discarded – undo
1321 1409
 		$query  = "SELECT DISTINCT marine_output.ident, COUNT(marine_output.ident) AS callsign_icao_count 
1322 1410
                     FROM marine_output".$filter_query." marine_output.ident <> ''";
1323 1411
 		 if ($olderthanmonths > 0) {
1324
-			if ($globalDBdriver == 'mysql') $query .= ' AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH)';
1325
-			else $query .= " AND marine_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'";
1412
+			if ($globalDBdriver == 'mysql') {
1413
+				$query .= ' AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH)';
1414
+			} else {
1415
+				$query .= " AND marine_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'";
1416
+			}
1326 1417
 		}
1327 1418
 		if ($sincedate != '') {
1328
-			if ($globalDBdriver == 'mysql') $query .= " AND marine_output.date > '".$sincedate."'";
1329
-			else $query .= " AND marine_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
1419
+			if ($globalDBdriver == 'mysql') {
1420
+				$query .= " AND marine_output.date > '".$sincedate."'";
1421
+			} else {
1422
+				$query .= " AND marine_output.date > CAST('".$sincedate."' AS TIMESTAMP)";
1423
+			}
1330 1424
 		}
1331 1425
 		$query_values = array();
1332 1426
 		if ($year != '') {
@@ -1357,7 +1451,9 @@  discard block
 block discarded – undo
1357 1451
 			}
1358 1452
 		}
1359 1453
 		$query .= " GROUP BY marine_output.ident ORDER BY callsign_icao_count DESC";
1360
-		if ($limit) $query .= " LIMIT 10 OFFSET 0";
1454
+		if ($limit) {
1455
+			$query .= " LIMIT 10 OFFSET 0";
1456
+		}
1361 1457
       		
1362 1458
 		$sth = $this->db->prepare($query);
1363 1459
 		$sth->execute($query_values);
@@ -1392,7 +1488,9 @@  discard block
 block discarded – undo
1392 1488
 			date_default_timezone_set($globalTimezone);
1393 1489
 			$datetime = new DateTime();
1394 1490
 			$offset = $datetime->format('P');
1395
-		} else $offset = '+00:00';
1491
+		} else {
1492
+			$offset = '+00:00';
1493
+		}
1396 1494
 
1397 1495
 		if ($globalDBdriver == 'mysql') {
1398 1496
 			$query  = "SELECT DATE(CONVERT_TZ(marine_output.date,'+00:00', :offset)) AS date_name, count(*) as date_count
@@ -1442,7 +1540,9 @@  discard block
 block discarded – undo
1442 1540
 			date_default_timezone_set($globalTimezone);
1443 1541
 			$datetime = new DateTime();
1444 1542
 			$offset = $datetime->format('P');
1445
-		} else $offset = '+00:00';
1543
+		} else {
1544
+			$offset = '+00:00';
1545
+		}
1446 1546
 		$filter_query = $this->getFilter($filters,true,true);
1447 1547
 		if ($globalDBdriver == 'mysql') {
1448 1548
 			$query  = "SELECT DATE(CONVERT_TZ(marine_output.date,'+00:00', :offset)) AS date_name, count(*) as date_count
@@ -1488,7 +1588,9 @@  discard block
 block discarded – undo
1488 1588
 			date_default_timezone_set($globalTimezone);
1489 1589
 			$datetime = new DateTime();
1490 1590
 			$offset = $datetime->format('P');
1491
-		} else $offset = '+00:00';
1591
+		} else {
1592
+			$offset = '+00:00';
1593
+		}
1492 1594
 		$filter_query = $this->getFilter($filters,true,true);
1493 1595
 		if ($globalDBdriver == 'mysql') {
1494 1596
 			$query  = "SELECT DATE(CONVERT_TZ(marine_output.date,'+00:00', :offset)) AS date_name, count(*) as date_count
@@ -1536,7 +1638,9 @@  discard block
 block discarded – undo
1536 1638
 			date_default_timezone_set($globalTimezone);
1537 1639
 			$datetime = new DateTime();
1538 1640
 			$offset = $datetime->format('P');
1539
-		} else $offset = '+00:00';
1641
+		} else {
1642
+			$offset = '+00:00';
1643
+		}
1540 1644
 
1541 1645
 		if ($globalDBdriver == 'mysql') {
1542 1646
 			$query  = "SELECT YEAR(CONVERT_TZ(marine_output.date,'+00:00', :offset)) AS year_name,MONTH(CONVERT_TZ(marine_output.date,'+00:00', :offset)) AS month_name, count(*) as date_count
@@ -1585,7 +1689,9 @@  discard block
 block discarded – undo
1585 1689
 			date_default_timezone_set($globalTimezone);
1586 1690
 			$datetime = new DateTime();
1587 1691
 			$offset = $datetime->format('P');
1588
-		} else $offset = '+00:00';
1692
+		} else {
1693
+			$offset = '+00:00';
1694
+		}
1589 1695
 		$filter_query = $this->getFilter($filters,true,true);
1590 1696
 		if ($globalDBdriver == 'mysql') {
1591 1697
 			$query  = "SELECT MONTH(CONVERT_TZ(marine_output.date,'+00:00', :offset)) AS month_name, YEAR(CONVERT_TZ(marine_output.date,'+00:00', :offset)) AS year_name, count(*) as date_count
@@ -1634,7 +1740,9 @@  discard block
 block discarded – undo
1634 1740
 			date_default_timezone_set($globalTimezone);
1635 1741
 			$datetime = new DateTime();
1636 1742
 			$offset = $datetime->format('P');
1637
-		} else $offset = '+00:00';
1743
+		} else {
1744
+			$offset = '+00:00';
1745
+		}
1638 1746
 
1639 1747
 		$orderby_sql = '';
1640 1748
 		if ($orderby == "hour")
@@ -1703,7 +1811,9 @@  discard block
 block discarded – undo
1703 1811
 			date_default_timezone_set($globalTimezone);
1704 1812
 			$datetime = new DateTime($date);
1705 1813
 			$offset = $datetime->format('P');
1706
-		} else $offset = '+00:00';
1814
+		} else {
1815
+			$offset = '+00:00';
1816
+		}
1707 1817
 
1708 1818
 		if ($globalDBdriver == 'mysql') {
1709 1819
 			$query  = "SELECT HOUR(CONVERT_TZ(marine_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count
@@ -1751,7 +1861,9 @@  discard block
 block discarded – undo
1751 1861
 			date_default_timezone_set($globalTimezone);
1752 1862
 			$datetime = new DateTime();
1753 1863
 			$offset = $datetime->format('P');
1754
-		} else $offset = '+00:00';
1864
+		} else {
1865
+			$offset = '+00:00';
1866
+		}
1755 1867
 
1756 1868
 		if ($globalDBdriver == 'mysql') {
1757 1869
 			$query  = "SELECT HOUR(CONVERT_TZ(marine_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count
@@ -1816,8 +1928,11 @@  discard block
 block discarded – undo
1816 1928
 				$query_values = array_merge($query_values,array(':month' => $month));
1817 1929
 			}
1818 1930
 		}
1819
-		if (empty($query_values)) $queryi .= $this->getFilter($filters);
1820
-		else $queryi .= $this->getFilter($filters,true,true).substr($query,4);
1931
+		if (empty($query_values)) {
1932
+			$queryi .= $this->getFilter($filters);
1933
+		} else {
1934
+			$queryi .= $this->getFilter($filters,true,true).substr($query,4);
1935
+		}
1821 1936
 		
1822 1937
 		$sth = $this->db->prepare($queryi);
1823 1938
 		$sth->execute($query_values);
@@ -1854,8 +1969,11 @@  discard block
 block discarded – undo
1854 1969
 				$query_values = array_merge($query_values,array(':month' => $month));
1855 1970
 			}
1856 1971
 		}
1857
-		if (empty($query_values)) $queryi .= $this->getFilter($filters);
1858
-		else $queryi .= $this->getFilter($filters,true,true).substr($query,4);
1972
+		if (empty($query_values)) {
1973
+			$queryi .= $this->getFilter($filters);
1974
+		} else {
1975
+			$queryi .= $this->getFilter($filters,true,true).substr($query,4);
1976
+		}
1859 1977
 		
1860 1978
 		$sth = $this->db->prepare($queryi);
1861 1979
 		$sth->execute($query_values);
@@ -1877,7 +1995,9 @@  discard block
 block discarded – undo
1877 1995
 			date_default_timezone_set($globalTimezone);
1878 1996
 			$datetime = new DateTime();
1879 1997
 			$offset = $datetime->format('P');
1880
-		} else $offset = '+00:00';
1998
+		} else {
1999
+			$offset = '+00:00';
2000
+		}
1881 2001
 
1882 2002
 		if ($globalDBdriver == 'mysql') {
1883 2003
 			$query  = "SELECT HOUR(CONVERT_TZ(marine_output.date,'+00:00', :offset)) AS hour_name, count(*) as hour_count
@@ -1981,7 +2101,9 @@  discard block
 block discarded – undo
1981 2101
 	*/
1982 2102
 	public function parseDirection($direction = 0)
1983 2103
 	{
1984
-		if ($direction == '') $direction = 0;
2104
+		if ($direction == '') {
2105
+			$direction = 0;
2106
+		}
1985 2107
 		$direction_array = array();
1986 2108
 		$temp_array = array();
1987 2109
 
@@ -2070,7 +2192,9 @@  discard block
 block discarded – undo
2070 2192
 		$longitude = filter_var($longitude,FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
2071 2193
 	
2072 2194
 		$Connection = new Connection($this->db);
2073
-		if (!$Connection->tableExists('countries')) return '';
2195
+		if (!$Connection->tableExists('countries')) {
2196
+			return '';
2197
+		}
2074 2198
 	
2075 2199
 		try {
2076 2200
 			/*
@@ -2090,9 +2214,13 @@  discard block
 block discarded – undo
2090 2214
 			$sth->closeCursor();
2091 2215
 			if (count($row) > 0) {
2092 2216
 				return $row;
2093
-			} else return '';
2217
+			} else {
2218
+				return '';
2219
+			}
2094 2220
 		} catch (PDOException $e) {
2095
-			if (isset($globalDebug) && $globalDebug) echo 'Error : '.$e->getMessage()."\n";
2221
+			if (isset($globalDebug) && $globalDebug) {
2222
+				echo 'Error : '.$e->getMessage()."\n";
2223
+			}
2096 2224
 			return '';
2097 2225
 		}
2098 2226
 	
@@ -2110,7 +2238,9 @@  discard block
 block discarded – undo
2110 2238
 		$iso2 = filter_var($iso2,FILTER_SANITIZE_STRING);
2111 2239
 	
2112 2240
 		$Connection = new Connection($this->db);
2113
-		if (!$Connection->tableExists('countries')) return '';
2241
+		if (!$Connection->tableExists('countries')) {
2242
+			return '';
2243
+		}
2114 2244
 	
2115 2245
 		try {
2116 2246
 			$query = "SELECT name,iso2,iso3 FROM countries WHERE iso2 = :iso2 LIMIT 1";
@@ -2122,9 +2252,13 @@  discard block
 block discarded – undo
2122 2252
 			$sth->closeCursor();
2123 2253
 			if (count($row) > 0) {
2124 2254
 				return $row;
2125
-			} else return '';
2255
+			} else {
2256
+				return '';
2257
+			}
2126 2258
 		} catch (PDOException $e) {
2127
-			if (isset($globalDebug) && $globalDebug) echo 'Error : '.$e->getMessage()."\n";
2259
+			if (isset($globalDebug) && $globalDebug) {
2260
+				echo 'Error : '.$e->getMessage()."\n";
2261
+			}
2128 2262
 			return '';
2129 2263
 		}
2130 2264
 	
@@ -2142,7 +2276,9 @@  discard block
 block discarded – undo
2142 2276
 	{
2143 2277
 		global $globalBitlyAccessToken;
2144 2278
 		
2145
-		if ($globalBitlyAccessToken == '') return $url;
2279
+		if ($globalBitlyAccessToken == '') {
2280
+			return $url;
2281
+		}
2146 2282
         
2147 2283
 		$google_url = 'https://api-ssl.bitly.com/v3/shorten?access_token='.$globalBitlyAccessToken.'&longUrl='.$url;
2148 2284
 		
@@ -2218,7 +2354,9 @@  discard block
 block discarded – undo
2218 2354
 			}
2219 2355
 		}
2220 2356
 		$query .= " GROUP BY marine_output.type, marine_output.type_id ORDER BY marine_type_count DESC";
2221
-		if ($limit) $query .= " LIMIT 10 OFFSET 0";
2357
+		if ($limit) {
2358
+			$query .= " LIMIT 10 OFFSET 0";
2359
+		}
2222 2360
 		$sth = $this->db->prepare($query);
2223 2361
 		$sth->execute($query_values);
2224 2362
 		$marine_array = array();
@@ -2256,9 +2394,15 @@  discard block
 block discarded – undo
2256 2394
 				foreach ($q_array as $q_item){
2257 2395
 					$q_item = filter_var($q_item,FILTER_SANITIZE_STRING);
2258 2396
 					$additional_query .= " AND (";
2259
-					if (is_int($q_item)) $additional_query .= "(marine_output.marine_id = '".$q_item."') OR ";
2260
-					if (is_int($q_item)) $additional_query .= "(marine_output.mmsi = '".$q_item."') OR ";
2261
-					if (is_int($q_item)) $additional_query .= "(marine_output.imo = '".$q_item."') OR ";
2397
+					if (is_int($q_item)) {
2398
+						$additional_query .= "(marine_output.marine_id = '".$q_item."') OR ";
2399
+					}
2400
+					if (is_int($q_item)) {
2401
+						$additional_query .= "(marine_output.mmsi = '".$q_item."') OR ";
2402
+					}
2403
+					if (is_int($q_item)) {
2404
+						$additional_query .= "(marine_output.imo = '".$q_item."') OR ";
2405
+					}
2262 2406
 					$additional_query .= "(marine_output.ident like '%".$q_item."%') OR ";
2263 2407
 					$additional_query .= ")";
2264 2408
 				}
@@ -2306,7 +2450,9 @@  discard block
 block discarded – undo
2306 2450
 				date_default_timezone_set($globalTimezone);
2307 2451
 				$datetime = new DateTime();
2308 2452
 				$offset = $datetime->format('P');
2309
-			} else $offset = '+00:00';
2453
+			} else {
2454
+				$offset = '+00:00';
2455
+			}
2310 2456
 			if ($date_array[1] != "")
2311 2457
 			{
2312 2458
 				$date_array[0] = date("Y-m-d H:i:s", strtotime($date_array[0]));
@@ -2333,8 +2479,12 @@  discard block
 block discarded – undo
2333 2479
 			if ($limit_array[0] >= 0 && $limit_array[1] >= 0)
2334 2480
 			{
2335 2481
 				$limit_query = " LIMIT ".$limit_array[1]." OFFSET ".$limit_array[0];
2336
-			} else $limit_query = "";
2337
-		} else $limit_query = "";
2482
+			} else {
2483
+				$limit_query = "";
2484
+			}
2485
+		} else {
2486
+			$limit_query = "";
2487
+		}
2338 2488
 		if ($sort != "")
2339 2489
 		{
2340 2490
 			$search_orderby_array = $this->getOrderBy();
Please login to merge, or discard this patch.
require/class.MarineLive.php 1 patch
Braces   +140 added lines, -47 removed lines patch added patch discarded remove patch
@@ -8,7 +8,9 @@  discard block
 block discarded – undo
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. (MarineLive)');
11
+		if ($this->db === null) {
12
+			die('Error: No DB connection. (MarineLive)');
13
+		}
12 14
 	}
13 15
 
14 16
 
@@ -30,7 +32,9 @@  discard block
 block discarded – undo
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) {
@@ -86,8 +90,11 @@  discard block
 block discarded – undo
86 90
 		if (isset($filter['source_aprs']) && !empty($filter['source_aprs'])) {
87 91
 			$filter_query_where .= " AND format_source = 'aprs' AND source_name IN ('".implode("','",$filter['source_aprs'])."')";
88 92
 		}
89
-		if ($filter_query_where == '' && $where) $filter_query_where = ' WHERE';
90
-		elseif ($filter_query_where != '' && $and) $filter_query_where .= ' AND';
93
+		if ($filter_query_where == '' && $where) {
94
+			$filter_query_where = ' WHERE';
95
+		} elseif ($filter_query_where != '' && $and) {
96
+			$filter_query_where .= ' AND';
97
+		}
91 98
 		if ($filter_query_where != '') {
92 99
 			$filter_query_where = preg_replace('/^ AND/',' WHERE',$filter_query_where);
93 100
 		}
@@ -128,9 +135,13 @@  discard block
 block discarded – undo
128 135
 				$orderby_query = ' '.$search_orderby_array[$sort]['sql'];
129 136
 			}
130 137
 		}
131
-		if ($orderby_query == '') $orderby_query= ' ORDER BY date DESC';
138
+		if ($orderby_query == '') {
139
+			$orderby_query= ' ORDER BY date DESC';
140
+		}
132 141
 
133
-		if (!isset($globalLiveInterval)) $globalLiveInterval = '200';
142
+		if (!isset($globalLiveInterval)) {
143
+			$globalLiveInterval = '200';
144
+		}
134 145
 		if ($globalDBdriver == 'mysql') {
135 146
 			//$query  = "SELECT marine_live.* FROM marine_live INNER JOIN (SELECT l.fammarine_id, max(l.date) as maxdate FROM marine_live l WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL 30 SECOND) <= l.date GROUP BY l.fammarine_id) s on marine_live.fammarine_id = s.fammarine_id AND marine_live.date = s.maxdate";
136 147
 			$query  = 'SELECT marine_live.* FROM marine_live INNER JOIN (SELECT l.fammarine_id, max(l.date) as maxdate FROM marine_live l WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= l.date GROUP BY l.fammarine_id) s on marine_live.fammarine_id = s.fammarine_id AND marine_live.date = s.maxdate'.$filter_query.$orderby_query;
@@ -155,7 +166,9 @@  discard block
 block discarded – undo
155 166
 
156 167
 		$filter_query = $this->getFilter($filter,true,true);
157 168
 
158
-		if (!isset($globalLiveInterval)) $globalLiveInterval = '200';
169
+		if (!isset($globalLiveInterval)) {
170
+			$globalLiveInterval = '200';
171
+		}
159 172
 		if ($globalDBdriver == 'mysql') {
160 173
 			$query  = 'SELECT marine_live.mmsi, marine_live.ident, marine_live.type,marine_live.fammarine_id, marine_live.latitude, marine_live.longitude, marine_live.heading, marine_live.ground_speed, marine_live.date, marine_live.format_source, marine_live.captain_name 
161 174
 			FROM marine_live INNER JOIN (SELECT l.fammarine_id, max(l.date) as maxdate FROM marine_live l WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= l.date GROUP BY l.fammarine_id) s on marine_live.fammarine_id = s.fammarine_id AND marine_live.date = s.maxdate'.$filter_query." marine_live.latitude <> 0 AND marine_live.longitude <> 0";
@@ -197,58 +210,96 @@  discard block
 block discarded – undo
197 210
 		$id = filter_var($id,FILTER_SANITIZE_STRING);
198 211
 		$filter_query = $this->getFilter($filter,true,true);
199 212
 
200
-		if (!isset($globalLiveInterval)) $globalLiveInterval = '200';
201
-		if (!isset($globalMap3DMarinesLimit) || $globalMap3DMarinesLimit == '') $globalMap3DMarinesLimit = '300';
213
+		if (!isset($globalLiveInterval)) {
214
+			$globalLiveInterval = '200';
215
+		}
216
+		if (!isset($globalMap3DMarinesLimit) || $globalMap3DMarinesLimit == '') {
217
+			$globalMap3DMarinesLimit = '300';
218
+		}
202 219
 		if ($globalDBdriver == 'mysql') {
203 220
 			if (isset($globalArchive) && $globalArchive === TRUE) {
204 221
 				$query  = 'SELECT * FROM (SELECT marine_archive.ident, marine_archive.fammarine_id,marine_archive.type_id,marine_archive.type, marine_archive.latitude, marine_archive.longitude, marine_archive.heading, marine_archive.ground_speed, marine_archive.date, marine_archive.format_source, marine_archive.captain_name 
205 222
 				    FROM marine_archive INNER JOIN (SELECT fammarine_id FROM marine_live'.$filter_query.' DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval." SECOND) <= marine_live.date) l ON l.fammarine_id = marine_archive.fammarine_id ";
206
-				if ($usecoord) $query .= "AND marine_archive.latitude BETWEEN ".$minlat." AND ".$maxlat." AND marine_archive.longitude BETWEEN ".$minlong." AND ".$maxlong." ";
207
-				if ($id != '') $query .= "OR marine_archive.fammarine_id = :id ";
223
+				if ($usecoord) {
224
+					$query .= "AND marine_archive.latitude BETWEEN ".$minlat." AND ".$maxlat." AND marine_archive.longitude BETWEEN ".$minlong." AND ".$maxlong." ";
225
+				}
226
+				if ($id != '') {
227
+					$query .= "OR marine_archive.fammarine_id = :id ";
228
+				}
208 229
 				$query .= "UNION
209 230
 				    SELECT marine_live.ident, marine_live.fammarine_id,marine_live.type_id,marine_live.type, marine_live.latitude, marine_live.longitude, marine_live.heading, marine_live.ground_speed, marine_live.date, marine_live.format_source, marine_live.captain_name 
210 231
 				    FROM marine_live".$filter_query.' DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval." SECOND) <= marine_live.date";
211
-				if ($usecoord) $query .= " AND marine_live.latitude BETWEEN ".$minlat." AND ".$maxlat." AND marine_live.longitude BETWEEN ".$minlong." AND ".$maxlong;
212
-				if ($id != '') $query .= "OR marine_live.fammarine_id = :id ";
232
+				if ($usecoord) {
233
+					$query .= " AND marine_live.latitude BETWEEN ".$minlat." AND ".$maxlat." AND marine_live.longitude BETWEEN ".$minlong." AND ".$maxlong;
234
+				}
235
+				if ($id != '') {
236
+					$query .= "OR marine_live.fammarine_id = :id ";
237
+				}
213 238
 				$query .= ") AS marine 
214 239
 				    WHERE latitude <> '0' AND longitude <> '0' 
215 240
 				    ORDER BY fammarine_id, date";
216
-				if ($limit) $query .= " LIMIT ".$globalMap3DMarinesLimit;
241
+				if ($limit) {
242
+					$query .= " LIMIT ".$globalMap3DMarinesLimit;
243
+				}
217 244
 			} else {
218 245
 				$query  = 'SELECT marine_live.ident, marine_live.fammarine_id,marine_live.type_id,marine_live.type, marine_live.latitude, marine_live.longitude, marine_live.heading, marine_live.ground_speed, marine_live.date, marine_live.format_source, marine_live.captain_name 
219 246
 				    FROM marine_live'.$filter_query.' DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval." SECOND) <= marine_live.date ";
220
-				if ($usecoord) $query .= "AND marine_live.latitude BETWEEN ".$minlat." AND ".$maxlat." AND marine_live.longitude BETWEEN ".$minlong." AND ".$maxlong." ";
221
-				if ($id != '') $query .= "OR marine_live.fammarine_id = :id ";
247
+				if ($usecoord) {
248
+					$query .= "AND marine_live.latitude BETWEEN ".$minlat." AND ".$maxlat." AND marine_live.longitude BETWEEN ".$minlong." AND ".$maxlong." ";
249
+				}
250
+				if ($id != '') {
251
+					$query .= "OR marine_live.fammarine_id = :id ";
252
+				}
222 253
 				$query .= "AND marine_live.latitude <> '0' AND marine_live.longitude <> '0' 
223 254
 				ORDER BY marine_live.fammarine_id, marine_live.date";
224
-				if ($limit) $query .= " LIMIT ".$globalMap3DMarinesLimit;
255
+				if ($limit) {
256
+					$query .= " LIMIT ".$globalMap3DMarinesLimit;
257
+				}
225 258
 			}
226 259
 		} else {
227 260
 			if (isset($globalArchive) && $globalArchive === TRUE) {
228 261
 				$query  = "SELECT * FROM (SELECT marine_archive.ident, marine_archive.fammarine_id, marine_archive.type_id, marine_archive.type,marine_archive.latitude, marine_archive.longitude, marine_archive.heading, marine_archive.ground_speed, marine_archive.date, marine_archive.format_source, marine_archive.captain_name 
229 262
 				    FROM marine_archive INNER JOIN (SELECT fammarine_id FROM marine_live".$filter_query." CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$globalLiveInterval." SECONDS' <= marine_live.date) l ON l.fammarine_id = marine_archive.fammarine_id ";
230
-				if ($usecoord) $query .= "AND (marine_archive.latitude BETWEEN ".$minlat." AND ".$maxlat." AND marine_archive.longitude BETWEEN ".$minlong." AND ".$maxlong.") ";
231
-				if ($id != '') $query .= "OR marine_archive.fammarine_id = :id ";
263
+				if ($usecoord) {
264
+					$query .= "AND (marine_archive.latitude BETWEEN ".$minlat." AND ".$maxlat." AND marine_archive.longitude BETWEEN ".$minlong." AND ".$maxlong.") ";
265
+				}
266
+				if ($id != '') {
267
+					$query .= "OR marine_archive.fammarine_id = :id ";
268
+				}
232 269
 				$query .= "UNION
233 270
 				    SELECT marine_live.ident, marine_live.fammarine_id, marine_live.type_id, marine_live.type,marine_live.latitude, marine_live.longitude, marine_live.heading, marine_live.ground_speed, marine_live.date, marine_live.format_source, marine_live.captain_name 
234 271
 				    FROM marine_live".$filter_query." CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$globalLiveInterval." SECONDS' <= marine_live.date";
235
-				if ($usecoord) $query .= " AND (marine_live.latitude BETWEEN ".$minlat." AND ".$maxlat." AND marine_live.longitude BETWEEN ".$minlong." AND ".$maxlong.")";
236
-				if ($id != '') $query .= " OR marine_live.fammarine_id = :id";
272
+				if ($usecoord) {
273
+					$query .= " AND (marine_live.latitude BETWEEN ".$minlat." AND ".$maxlat." AND marine_live.longitude BETWEEN ".$minlong." AND ".$maxlong.")";
274
+				}
275
+				if ($id != '') {
276
+					$query .= " OR marine_live.fammarine_id = :id";
277
+				}
237 278
 				$query .= ") AS marine WHERE latitude <> '0' AND longitude <> '0' ";
238 279
 				$query .= "ORDER BY fammarine_id, date";
239
-				if ($limit) $query .= " LIMIT ".$globalMap3DMarinesLimit;
280
+				if ($limit) {
281
+					$query .= " LIMIT ".$globalMap3DMarinesLimit;
282
+				}
240 283
 			} else {
241 284
 				$query  = "SELECT marine_live.ident, marine_live.fammarine_id, marine_live.type_id, marine_live.type,marine_live.latitude, marine_live.longitude, marine_live.heading, marine_live.ground_speed, marine_live.date, marine_live.format_source, marine_live.captain_name 
242 285
 				    FROM marine_live".$filter_query." CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$globalLiveInterval." SECONDS' <= marine_live.date ";
243
-				if ($usecoord) $query .= "AND (marine_live.latitude BETWEEN ".$minlat." AND ".$maxlat." AND marine_live.longitude BETWEEN ".$minlong." AND ".$maxlong.") ";
244
-				if ($id != '') $query .= "OR marine_live.fammarine_id = :id ";
286
+				if ($usecoord) {
287
+					$query .= "AND (marine_live.latitude BETWEEN ".$minlat." AND ".$maxlat." AND marine_live.longitude BETWEEN ".$minlong." AND ".$maxlong.") ";
288
+				}
289
+				if ($id != '') {
290
+					$query .= "OR marine_live.fammarine_id = :id ";
291
+				}
245 292
 				$query .= "AND marine_live.latitude <> '0' AND marine_live.longitude <> '0' 
246 293
 				ORDER BY marine_live.fammarine_id, marine_live.date";
247
-				if ($limit) $query .= " LIMIT ".$globalMap3DMarinesLimit;
294
+				if ($limit) {
295
+					$query .= " LIMIT ".$globalMap3DMarinesLimit;
296
+				}
248 297
 			}
249 298
 		}
250 299
 		$query_values = array();
251
-		if ($id != '') $query_values = array(':id' => $id);
300
+		if ($id != '') {
301
+			$query_values = array(':id' => $id);
302
+		}
252 303
 		try {
253 304
 			$sth = $this->db->prepare($query);
254 305
 			$sth->execute($query_values);
@@ -271,7 +322,9 @@  discard block
 block discarded – undo
271 322
 		global $globalDBdriver, $globalLiveInterval;
272 323
 		$filter_query = $this->getFilter($filter,true,true);
273 324
 
274
-		if (!isset($globalLiveInterval)) $globalLiveInterval = '200';
325
+		if (!isset($globalLiveInterval)) {
326
+			$globalLiveInterval = '200';
327
+		}
275 328
 		if ($globalDBdriver == 'mysql') {
276 329
 			$query = 'SELECT COUNT(DISTINCT marine_live.fammarine_id) as nb FROM marine_live'.$filter_query.' DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= date';
277 330
 		} else {
@@ -299,7 +352,9 @@  discard block
 block discarded – undo
299 352
 	{
300 353
 		global $globalDBdriver, $globalLiveInterval;
301 354
 		$Marine = new Marine($this->db);
302
-		if (!isset($globalLiveInterval)) $globalLiveInterval = '200';
355
+		if (!isset($globalLiveInterval)) {
356
+			$globalLiveInterval = '200';
357
+		}
303 358
 		$filter_query = $this->getFilter($filter);
304 359
 
305 360
 		if (is_array($coord)) {
@@ -307,7 +362,9 @@  discard block
 block discarded – undo
307 362
 			$minlat = filter_var($coord[1],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
308 363
 			$maxlong = filter_var($coord[2],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
309 364
 			$maxlat = filter_var($coord[3],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
310
-		} else return array();
365
+		} else {
366
+			return array();
367
+		}
311 368
 		if ($globalDBdriver == 'mysql') {
312 369
 			$query  = 'SELECT marine_live.* FROM marine_live INNER JOIN (SELECT l.fammarine_id, max(l.date) as maxdate FROM marine_live l WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= l.date GROUP BY l.fammarine_id) s on marine_live.fammarine_id = s.fammarine_id AND marine_live.date = s.maxdate AND marine_live.latitude BETWEEN '.$minlat.' AND '.$maxlat.' AND marine_live.longitude BETWEEN '.$minlong.' AND '.$maxlong.' GROUP BY marine_live.fammarine_id ORDER BY date DESC'.$filter_query;
313 370
 		} else {
@@ -327,7 +384,9 @@  discard block
 block discarded – undo
327 384
 	{
328 385
 		global $globalDBdriver, $globalLiveInterval, $globalArchive;
329 386
 		$Marine = new Marine($this->db);
330
-		if (!isset($globalLiveInterval)) $globalLiveInterval = '200';
387
+		if (!isset($globalLiveInterval)) {
388
+			$globalLiveInterval = '200';
389
+		}
331 390
 		$filter_query = $this->getFilter($filter,true,true);
332 391
 
333 392
 		if (is_array($coord)) {
@@ -335,7 +394,9 @@  discard block
 block discarded – undo
335 394
 			$minlat = filter_var($coord[1],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
336 395
 			$maxlong = filter_var($coord[2],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
337 396
 			$maxlat = filter_var($coord[3],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
338
-		} else return array();
397
+		} else {
398
+			return array();
399
+		}
339 400
 		/*
340 401
 		if ($globalDBdriver == 'mysql') {
341 402
 			$query  = 'SELECT marine_live.ident, marine_live.fammarine_id,marine_live.type, marine_live.latitude, marine_live.longitude, marine_live.heading, marine_live.ground_speed, marine_live.date, marine_live.format_source 
@@ -558,11 +619,15 @@  discard block
 block discarded – undo
558 619
 		//$query  = self::$global_query.' WHERE marine_live.fammarine_id = :id ORDER BY date';
559 620
 		if ($globalDBdriver == 'mysql') {
560 621
 			$query = 'SELECT marine_live.* FROM marine_live WHERE marine_live.fammarine_id = :id';
561
-			if ($liveinterval) $query .= ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= date';
622
+			if ($liveinterval) {
623
+				$query .= ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= date';
624
+			}
562 625
 			$query .= ' ORDER BY date';
563 626
 		} else {
564 627
 			$query = 'SELECT marine_live.* FROM marine_live WHERE marine_live.fammarine_id = :id';
565
-			if ($liveinterval) $query .= " AND CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$globalLiveInterval." SECONDS' <= date";
628
+			if ($liveinterval) {
629
+				$query .= " AND CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$globalLiveInterval." SECONDS' <= date";
630
+			}
566 631
 			$query .= ' ORDER BY date';
567 632
 		}
568 633
 
@@ -657,7 +722,9 @@  discard block
 block discarded – undo
657 722
 				$i++;
658 723
 				$j++;
659 724
 				if ($j == 30) {
660
-					if ($globalDebug) echo ".";
725
+					if ($globalDebug) {
726
+						echo ".";
727
+					}
661 728
 				    	try {
662 729
 						
663 730
 						$sth = $this->db->prepare(substr($query_delete,0,-1).")");
@@ -951,7 +1018,9 @@  discard block
 block discarded – undo
951 1018
 			{
952 1019
 				return false;
953 1020
 			}
954
-		} else return '';
1021
+		} else {
1022
+			return '';
1023
+		}
955 1024
 
956 1025
 		if ($longitude != '')
957 1026
 		{
@@ -959,7 +1028,9 @@  discard block
 block discarded – undo
959 1028
 			{
960 1029
 				return false;
961 1030
 			}
962
-		} else return '';
1031
+		} else {
1032
+			return '';
1033
+		}
963 1034
 
964 1035
 
965 1036
 		if ($heading != '')
@@ -968,7 +1039,9 @@  discard block
 block discarded – undo
968 1039
 			{
969 1040
 				return false;
970 1041
 			}
971
-		} else $heading = 0;
1042
+		} else {
1043
+			$heading = 0;
1044
+		}
972 1045
 
973 1046
 		if ($groundspeed != '')
974 1047
 		{
@@ -976,9 +1049,13 @@  discard block
 block discarded – undo
976 1049
 			{
977 1050
 				return false;
978 1051
 			}
979
-		} else $groundspeed = 0;
1052
+		} else {
1053
+			$groundspeed = 0;
1054
+		}
980 1055
 		date_default_timezone_set('UTC');
981
-		if ($date == '') $date = date("Y-m-d H:i:s", time());
1056
+		if ($date == '') {
1057
+			$date = date("Y-m-d H:i:s", time());
1058
+		}
982 1059
 
983 1060
         
984 1061
 		$fammarine_id = filter_var($fammarine_id,FILTER_SANITIZE_STRING);
@@ -1006,16 +1083,28 @@  discard block
 block discarded – undo
1006 1083
 		$race_name = filter_var($race_name,FILTER_SANITIZE_STRING);
1007 1084
 		$race_rank = filter_var($race_rank,FILTER_SANITIZE_NUMBER_INT);
1008 1085
 		$race_time = filter_var($race_time,FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
1009
-		if ($typeid == '') $typeid = NULL;
1010
-		if ($statusid == '') $statusid = NULL;
1011
-		if ($distance == '') $distance = NULL;
1086
+		if ($typeid == '') {
1087
+			$typeid = NULL;
1088
+		}
1089
+		if ($statusid == '') {
1090
+			$statusid = NULL;
1091
+		}
1092
+		if ($distance == '') {
1093
+			$distance = NULL;
1094
+		}
1012 1095
 
1013 1096
             	//if ($groundspeed == '' || $Common->isInteger($groundspeed) === false ) $groundspeed = 0;
1014
-            	if ($heading == '' || $Common->isInteger($heading) === false ) $heading = 0;
1015
-            	if ($arrival_date == '') $arrival_date = NULL;
1097
+            	if ($heading == '' || $Common->isInteger($heading) === false ) {
1098
+            		$heading = 0;
1099
+            	}
1100
+            	if ($arrival_date == '') {
1101
+            		$arrival_date = NULL;
1102
+            	}
1016 1103
             	$query = '';
1017 1104
 		if ($globalArchive) {
1018
-			if ($globalDebug) echo '-- Delete previous data -- ';
1105
+			if ($globalDebug) {
1106
+				echo '-- Delete previous data -- ';
1107
+			}
1019 1108
 			$query .= 'DELETE FROM marine_live WHERE fammarine_id = :fammarine_id;';
1020 1109
 		}
1021 1110
 		$query .= 'INSERT INTO marine_live (fammarine_id, ident, latitude, longitude, heading, ground_speed, date, format_source, source_name, over_country, mmsi, type,type_id,status,status_id,imo,arrival_port_name,arrival_port_date,captain_id,captain_name,race_id,race_name,distance,race_rank,race_time) 
@@ -1030,10 +1119,14 @@  discard block
 block discarded – undo
1030 1119
 		}
1031 1120
 		
1032 1121
 		if (isset($globalArchive) && $globalArchive && $putinarchive && $noarchive !== true) {
1033
-			if ($globalDebug) echo '(Add to Marine archive : ';
1122
+			if ($globalDebug) {
1123
+				echo '(Add to Marine archive : ';
1124
+			}
1034 1125
 			$MarineArchive = new MarineArchive($this->db);
1035 1126
 			$result =  $MarineArchive->addMarineArchiveData($fammarine_id, $ident, $latitude, $longitude, $heading, $groundspeed, $date, $putinarchive, $mmsi,$type,$typeid,$imo, $callsign,$arrival_code,$arrival_date,$status,$statusid,$noarchive,$format_source, $source_name, $over_country,$captain_id,$captain_name,$race_id,$race_name,$distance,$race_rank,$race_time);
1036
-			if ($globalDebug) echo $result.')';
1127
+			if ($globalDebug) {
1128
+				echo $result.')';
1129
+			}
1037 1130
 		}
1038 1131
 		return "success";
1039 1132
 	}
Please login to merge, or discard this patch.