Completed
Push — master ( aed4ca...26c961 )
by Yannick
34:50
created
live-geojson.php 1 patch
Braces   +369 added lines, -149 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,31 +59,62 @@  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
 $limit = 0;
64 69
 $from_archive = false;
65 70
 $min = true;
66 71
 $allhistory = false;
67 72
 $filter['source'] = array();
68
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt'));
69
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup'));
70
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars'));
71
-if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs'));
72
-if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs'));
73
-if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING);
74
-if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING);
75
-if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING);
76
-if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING);
77
-if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING);
78
-if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING);
79
-if (isset($_COOKIE['filter_race']) && $_COOKIE['filter_race'] != 'all') $filter['race'] = filter_var($_COOKIE['filter_race'],FILTER_SANITIZE_NUMBER_INT);
80
-if (isset($_COOKIE['filter_blocked']) && $_COOKIE['filter_blocked'] == 'true') $filter['blocked'] = true;
73
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') {
74
+	$filter['source'] = array_merge($filter['source'],array('vatsimtxt'));
75
+}
76
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') {
77
+	$filter['source'] = array_merge($filter['source'],array('whazzup'));
78
+}
79
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') {
80
+	$filter['source'] = array_merge($filter['source'],array('phpvmacars'));
81
+}
82
+if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') {
83
+	$filter['source'] = array_merge($filter['source'],array('sbs','famaprs'));
84
+}
85
+if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') {
86
+	$filter['source'] = array_merge($filter['source'],array('aprs'));
87
+}
88
+if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') {
89
+	$filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING);
90
+}
91
+if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') {
92
+	$filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING);
93
+}
94
+if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') {
95
+	$filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING);
96
+}
97
+if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') {
98
+	$filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING);
99
+}
100
+if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') {
101
+	$filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING);
102
+}
103
+if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') {
104
+	$filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING);
105
+}
106
+if (isset($_COOKIE['filter_race']) && $_COOKIE['filter_race'] != 'all') {
107
+	$filter['race'] = filter_var($_COOKIE['filter_race'],FILTER_SANITIZE_NUMBER_INT);
108
+}
109
+if (isset($_COOKIE['filter_blocked']) && $_COOKIE['filter_blocked'] == 'true') {
110
+	$filter['blocked'] = true;
111
+}
81 112
 
82 113
 if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) {
83 114
 	$min = true;
84
-} else $min = false;
115
+} else {
116
+	$min = false;
117
+}
85 118
 
86 119
 
87 120
 if (isset($_COOKIE['map_2d_limit'])) {
@@ -197,24 +230,38 @@  discard block
 block discarded – undo
197 230
 			$flightcnt = $SpotterLive->getLiveSpotterCount($filter);
198 231
 		}
199 232
 	}
200
-	if ($flightcnt == '') $flightcnt = 0;
201
-} else $flightcnt = 0;
233
+	if ($flightcnt == '') {
234
+		$flightcnt = 0;
235
+	}
236
+	} else {
237
+	$flightcnt = 0;
238
+}
202 239
 
203 240
 $sqltime = round(microtime(true)-$begintime,2);
204 241
 
205 242
 $currenttime = filter_input(INPUT_GET,'currenttime',FILTER_SANITIZE_NUMBER_INT);
206
-if ($currenttime != '') $currenttime = round($currenttime/1000);
243
+if ($currenttime != '') {
244
+	$currenttime = round($currenttime/1000);
245
+}
207 246
 
208
-if ((!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation === FALSE) || (isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'false')) $usenextlatlon = false;
209
-else $usenextlatlon = true;
210
-if ($usenextlatlon === false) $currenttime = '';
247
+if ((!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation === FALSE) || (isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'false')) {
248
+	$usenextlatlon = false;
249
+} else {
250
+	$usenextlatlon = true;
251
+}
252
+if ($usenextlatlon === false) {
253
+	$currenttime = '';
254
+}
211 255
 $j = 0;
212 256
 $prev_flightaware_id = '';
213 257
 $aircrafts_shadow = array();
214 258
 $output = '{';
215 259
 	$output .= '"type": "FeatureCollection",';
216
-		if ($min) $output .= '"minimal": "true",';
217
-		else $output .= '"minimal": "false",';
260
+		if ($min) {
261
+			$output .= '"minimal": "true",';
262
+		} else {
263
+			$output .= '"minimal": "false",';
264
+		}
218 265
 		//$output .= '"fc": "'.$flightcnt.'",';
219 266
 		$output .= '"sqt": "'.$sqltime.'",';
220 267
 
@@ -259,18 +306,29 @@  discard block
 block discarded – undo
259 306
 						}
260 307
 						$output .= '"properties": {';
261 308
 						if (isset($spotter_item['flightaware_id'])) {
262
-							if ($compress) $output .= '"fi": "'.$spotter_item['flightaware_id'].'",';
263
-							else $output .= '"flightaware_id": "'.$spotter_item['flightaware_id'].'",';
309
+							if ($compress) {
310
+								$output .= '"fi": "'.$spotter_item['flightaware_id'].'",';
311
+							} else {
312
+								$output .= '"flightaware_id": "'.$spotter_item['flightaware_id'].'",';
313
+							}
264 314
 						} elseif (isset($spotter_item['famtrackid'])) {
265
-							if ($compress) $output .= '"fti": "'.$spotter_item['famtrackid'].'",';
266
-							else $output .= '"famtrackid": "'.$spotter_item['famtrackid'].'",';
315
+							if ($compress) {
316
+								$output .= '"fti": "'.$spotter_item['famtrackid'].'",';
317
+							} else {
318
+								$output .= '"famtrackid": "'.$spotter_item['famtrackid'].'",';
319
+							}
267 320
 						} elseif (isset($spotter_item['fammarine_id'])) {
268
-							if ($compress) $output .= '"fmi": "'.$spotter_item['fammarine_id'].'",';
269
-							else $output .= '"fammarineid": "'.$spotter_item['fammarine_id'].'",';
321
+							if ($compress) {
322
+								$output .= '"fmi": "'.$spotter_item['fammarine_id'].'",';
323
+							} else {
324
+								$output .= '"fammarineid": "'.$spotter_item['fammarine_id'].'",';
325
+							}
270 326
 						}
271 327
 						$output .= '"fc": "'.$flightcnt.'",';
272 328
 						$output .= '"sqt": "'.$sqltime.'",';
273
-						if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",';
329
+						if (isset($begindate)) {
330
+							$output .= '"archive_date": "'.$begindate.'",';
331
+						}
274 332
 
275 333
 /*
276 334
 							if ($min) $output .= '"minimal": "true",';
@@ -278,16 +336,25 @@  discard block
 block discarded – undo
278 336
 */
279 337
 							//$output .= '"fc": "'.$spotter_item['nb'].'",';
280 338
 						if (isset($spotter_item['ident']) && $spotter_item['ident'] != '') {
281
-							if ($compress) $output .= '"c": '.json_encode(str_replace('\\','',$spotter_item['ident'])).',';
282
-							else $output .= '"callsign": '.json_encode(str_replace('\\','',$spotter_item['ident'])).',';
339
+							if ($compress) {
340
+								$output .= '"c": '.json_encode(str_replace('\\','',$spotter_item['ident'])).',';
341
+							} else {
342
+								$output .= '"callsign": '.json_encode(str_replace('\\','',$spotter_item['ident'])).',';
343
+							}
283 344
 							//'
284 345
 						} else {
285
-							if ($compress) $output .= '"c": "NA",';
286
-							else $output .= '"callsign": "NA",';
346
+							if ($compress) {
347
+								$output .= '"c": "NA",';
348
+							} else {
349
+								$output .= '"callsign": "NA",';
350
+							}
287 351
 						}
288 352
 						if (isset($spotter_item['registration'])) {
289
-							if ($compress) $output .= '"reg": '.json_encode($spotter_item['registration']).',';
290
-							else $output .= '"registration": '.json_encode($spotter_item['registration']).',';
353
+							if ($compress) {
354
+								$output .= '"reg": '.json_encode($spotter_item['registration']).',';
355
+							} else {
356
+								$output .= '"registration": '.json_encode($spotter_item['registration']).',';
357
+							}
291 358
 						}
292 359
 						if (isset($spotter_item['aircraft_name']) && isset($spotter_item['aircraft_type'])) {
293 360
 							$output .= '"aircraft_name": "'.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')",';
@@ -298,20 +365,30 @@  discard block
 block discarded – undo
298 365
 							$output .= '"aircraft_name": "NA",';
299 366
 						}
300 367
 						if (isset($spotter_item['aircraft_icao'])) {
301
-							if ($compress) $output .= '"ai": "'.$spotter_item['aircraft_icao'].'",';
302
-							else $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",';
368
+							if ($compress) {
369
+								$output .= '"ai": "'.$spotter_item['aircraft_icao'].'",';
370
+							} else {
371
+								$output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",';
372
+							}
303 373
 						}
304 374
 						if (!isset($spotter_item['aircraft_shadow']) && !$tracker && !$marine) {
305
-							if (!isset($spotter_item['aircraft_icao']) || $spotter_item['aircraft_icao'] == '') $spotter_item['aircraft_shadow'] = '';
306
-							else {
375
+							if (!isset($spotter_item['aircraft_icao']) || $spotter_item['aircraft_icao'] == '') {
376
+								$spotter_item['aircraft_shadow'] = '';
377
+							} else {
307 378
 								$aircraft_icao = $spotter_item['aircraft_icao'];
308
-								if (isset($aircrafts_shadow[$aircraft_icao])) $spotter_item['aircraft_shadow'] = $aircrafts_shadow[$aircraft_icao];
309
-								else {
379
+								if (isset($aircrafts_shadow[$aircraft_icao])) {
380
+									$spotter_item['aircraft_shadow'] = $aircrafts_shadow[$aircraft_icao];
381
+								} else {
310 382
 									$aircraft_info = $Spotter->getAllAircraftInfo($spotter_item['aircraft_icao']);
311
-									if (count($aircraft_info) > 0) $spotter_item['aircraft_shadow'] = $aircraft_info[0]['aircraft_shadow'];
312
-									elseif (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'aprs') $spotter_item['aircraft_shadow'] = 'PA18.png';
313
-									elseif ($aircraft_icao == 'PARAGLIDER') $spotter_item['aircraft_shadow'] = 'PARAGLIDER.png';
314
-									else $spotter_item['aircraft_shadow'] = '';
383
+									if (count($aircraft_info) > 0) {
384
+										$spotter_item['aircraft_shadow'] = $aircraft_info[0]['aircraft_shadow'];
385
+									} elseif (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'aprs') {
386
+										$spotter_item['aircraft_shadow'] = 'PA18.png';
387
+									} elseif ($aircraft_icao == 'PARAGLIDER') {
388
+										$spotter_item['aircraft_shadow'] = 'PARAGLIDER.png';
389
+									} else {
390
+										$spotter_item['aircraft_shadow'] = '';
391
+									}
315 392
 									$aircrafts_shadow[$aircraft_icao] = $spotter_item['aircraft_shadow'];
316 393
 								}
317 394
 							}
@@ -319,93 +396,177 @@  discard block
 block discarded – undo
319 396
 						if (!isset($spotter_item['aircraft_shadow']) || $spotter_item['aircraft_shadow'] == '') {
320 397
 							if ($tracker) {
321 398
 								if (isset($spotter_item['type']) && $spotter_item['type'] == 'Ambulance') {
322
-									if ($compress) $output .= '"as": "ambulance.png",';
323
-									else $output .= '"aircraft_shadow": "ambulance.png",';
399
+									if ($compress) {
400
+										$output .= '"as": "ambulance.png",';
401
+									} else {
402
+										$output .= '"aircraft_shadow": "ambulance.png",';
403
+									}
324 404
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Police') {
325
-									if ($compress) $output .= '"as": "police.png",';
326
-									else $output .= '"aircraft_shadow": "police.png",';
405
+									if ($compress) {
406
+										$output .= '"as": "police.png",';
407
+									} else {
408
+										$output .= '"aircraft_shadow": "police.png",';
409
+									}
327 410
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Yacht (Sail)') {
328
-									if ($compress) $output .= '"as": "ship.png",';
329
-									else $output .= '"aircraft_shadow": "ship.png",';
411
+									if ($compress) {
412
+										$output .= '"as": "ship.png",';
413
+									} else {
414
+										$output .= '"aircraft_shadow": "ship.png",';
415
+									}
330 416
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Ship (Power Boat)') {
331
-									if ($compress) $output .= '"as": "ship.png",';
332
-									else $output .= '"aircraft_shadow": "ship.png",';
417
+									if ($compress) {
418
+										$output .= '"as": "ship.png",';
419
+									} else {
420
+										$output .= '"aircraft_shadow": "ship.png",';
421
+									}
333 422
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Shuttle') {
334
-									if ($compress) $output .= '"as": "ship.png",';
335
-									else $output .= '"aircraft_shadow": "ship.png",';
423
+									if ($compress) {
424
+										$output .= '"as": "ship.png",';
425
+									} else {
426
+										$output .= '"aircraft_shadow": "ship.png",';
427
+									}
336 428
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Truck') {
337
-									if ($compress) $output .= '"as": "truck.png",';
338
-									else $output .= '"aircraft_shadow": "truck.png",';
429
+									if ($compress) {
430
+										$output .= '"as": "truck.png",';
431
+									} else {
432
+										$output .= '"aircraft_shadow": "truck.png",';
433
+									}
339 434
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Truck (18 Wheeler)') {
340
-									if ($compress) $output .= '"as": "truck.png",';
341
-									else $output .= '"aircraft_shadow": "truck.png",';
435
+									if ($compress) {
436
+										$output .= '"as": "truck.png",';
437
+									} else {
438
+										$output .= '"aircraft_shadow": "truck.png",';
439
+									}
342 440
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Aircraft (small)') {
343
-									if ($compress) $output .= '"as": "aircraft.png",';
344
-									else $output .= '"aircraft_shadow": "aircraft.png",';
441
+									if ($compress) {
442
+										$output .= '"as": "aircraft.png",';
443
+									} else {
444
+										$output .= '"aircraft_shadow": "aircraft.png",';
445
+									}
345 446
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Large Aircraft') {
346
-									if ($compress) $output .= '"as": "aircraft.png",';
347
-									else $output .= '"aircraft_shadow": "aircraft.png",';
447
+									if ($compress) {
448
+										$output .= '"as": "aircraft.png",';
449
+									} else {
450
+										$output .= '"aircraft_shadow": "aircraft.png",';
451
+									}
348 452
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Helicopter') {
349
-									if ($compress) $output .= '"as": "helico.png",';
350
-									else $output .= '"aircraft_shadow": "helico.png",';
453
+									if ($compress) {
454
+										$output .= '"as": "helico.png",';
455
+									} else {
456
+										$output .= '"aircraft_shadow": "helico.png",';
457
+									}
351 458
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Railroad Engine') {
352
-									if ($compress) $output .= '"as": "rail.png",';
353
-									else $output .= '"aircraft_shadow": "rail.png",';
459
+									if ($compress) {
460
+										$output .= '"as": "rail.png",';
461
+									} else {
462
+										$output .= '"aircraft_shadow": "rail.png",';
463
+									}
354 464
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Firetruck') {
355
-									if ($compress) $output .= '"as": "firetruck.png",';
356
-									else $output .= '"aircraft_shadow": "firetruck.png",';
465
+									if ($compress) {
466
+										$output .= '"as": "firetruck.png",';
467
+									} else {
468
+										$output .= '"aircraft_shadow": "firetruck.png",';
469
+									}
357 470
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Bus') {
358
-									if ($compress) $output .= '"as": "bus.png",';
359
-									else $output .= '"aircraft_shadow": "bus.png",';
471
+									if ($compress) {
472
+										$output .= '"as": "bus.png",';
473
+									} else {
474
+										$output .= '"aircraft_shadow": "bus.png",';
475
+									}
360 476
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Phone') {
361
-									if ($compress) $output .= '"as": "phone.png",';
362
-									else $output .= '"aircraft_shadow": "phone.png",';
477
+									if ($compress) {
478
+										$output .= '"as": "phone.png",';
479
+									} else {
480
+										$output .= '"aircraft_shadow": "phone.png",';
481
+									}
363 482
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Jogger') {
364
-									if ($compress) $output .= '"as": "jogger.png",';
365
-									else $output .= '"aircraft_shadow": "jogger.png",';
483
+									if ($compress) {
484
+										$output .= '"as": "jogger.png",';
485
+									} else {
486
+										$output .= '"aircraft_shadow": "jogger.png",';
487
+									}
366 488
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Bike') {
367
-									if ($compress) $output .= '"as": "bike.png",';
368
-									else $output .= '"aircraft_shadow": "bike.png",';
489
+									if ($compress) {
490
+										$output .= '"as": "bike.png",';
491
+									} else {
492
+										$output .= '"aircraft_shadow": "bike.png",';
493
+									}
369 494
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Motorcycle') {
370
-									if ($compress) $output .= '"as": "motorcycle.png",';
371
-									else $output .= '"aircraft_shadow": "motorcycle.png",';
495
+									if ($compress) {
496
+										$output .= '"as": "motorcycle.png",';
497
+									} else {
498
+										$output .= '"aircraft_shadow": "motorcycle.png",';
499
+									}
372 500
 								} elseif (isset($spotter_item['type']) && $spotter_item['type'] == 'Balloon') {
373
-									if ($compress) $output .= '"as": "balloon.png",';
374
-									else $output .= '"aircraft_shadow": "balloon.png",';
501
+									if ($compress) {
502
+										$output .= '"as": "balloon.png",';
503
+									} else {
504
+										$output .= '"aircraft_shadow": "balloon.png",';
505
+									}
375 506
 								} else {
376
-									if ($compress) $output .= '"as": "car.png",';
377
-									else $output .= '"aircraft_shadow": "car.png",';
507
+									if ($compress) {
508
+										$output .= '"as": "car.png",';
509
+									} else {
510
+										$output .= '"aircraft_shadow": "car.png",';
511
+									}
378 512
 								}
379 513
 							} elseif ($marine) {
380 514
 								if (isset($spotter_item['type']) && ($spotter_item['type']  == '50' Performance Cruiser' || $spotter_item['type']  == '50\' Performance Cruiser' || $spotter_item['type'] == 'Sail')) {
381
-									if ($compress) $output .= '"as": "50perfcruiser.png",';
382
-									else $output .= '"aircraft_shadow": "50perfcruiser.png",';
515
+									if ($compress) {
516
+										$output .= '"as": "50perfcruiser.png",';
517
+									} else {
518
+										$output .= '"aircraft_shadow": "50perfcruiser.png",';
519
+									}
383 520
 								} elseif (isset($spotter_item['type']) && $spotter_item['type']  == 'Sailaway Cruiser 38') {
384
-									if ($compress) $output .= '"as": "cruiser38.png",';
385
-									else $output .= '"aircraft_shadow": "cruiser38.png",';
521
+									if ($compress) {
522
+										$output .= '"as": "cruiser38.png",';
523
+									} else {
524
+										$output .= '"aircraft_shadow": "cruiser38.png",';
525
+									}
386 526
 								} elseif (isset($spotter_item['type']) && $spotter_item['type']  == 'Mini Transat') {
387
-									if ($compress) $output .= '"as": "transat.png",';
388
-									else $output .= '"aircraft_shadow": "transat.png",';
527
+									if ($compress) {
528
+										$output .= '"as": "transat.png",';
529
+									} else {
530
+										$output .= '"aircraft_shadow": "transat.png",';
531
+									}
389 532
 								} elseif (isset($spotter_item['type']) && $spotter_item['type']  == '52' Cruising Cat') {
390
-									if ($compress) $output .= '"as": "catamaran.png",';
391
-									else $output .= '"aircraft_shadow": "catamaran.png",';
533
+									if ($compress) {
534
+										$output .= '"as": "catamaran.png",';
535
+									} else {
536
+										$output .= '"aircraft_shadow": "catamaran.png",';
537
+									}
392 538
 								} elseif (isset($spotter_item['type']) && $spotter_item['type']  == 'Caribbean Rose') {
393
-									if ($compress) $output .= '"as": "carib.png",';
394
-									else $output .= '"aircraft_shadow": "carib.png",';
539
+									if ($compress) {
540
+										$output .= '"as": "carib.png",';
541
+									} else {
542
+										$output .= '"aircraft_shadow": "carib.png",';
543
+									}
395 544
 								} elseif (isset($spotter_item['type']) && $spotter_item['type']  == 'Nordic Folkboat') {
396
-									if ($compress) $output .= '"as": "nordic.png",';
397
-									else $output .= '"aircraft_shadow": "nordic.png",';
545
+									if ($compress) {
546
+										$output .= '"as": "nordic.png",';
547
+									} else {
548
+										$output .= '"aircraft_shadow": "nordic.png",';
549
+									}
398 550
 								} else {
399
-									if ($compress) $output .= '"as": "ship.png",';
400
-									else $output .= '"aircraft_shadow": "ship.png",';
551
+									if ($compress) {
552
+										$output .= '"as": "ship.png",';
553
+									} else {
554
+										$output .= '"aircraft_shadow": "ship.png",';
555
+									}
401 556
 								}
402 557
 							} else {
403
-								if ($compress) $output .= '"as": "default.png",';
404
-								else $output .= '"aircraft_shadow": "default.png",';
558
+								if ($compress) {
559
+									$output .= '"as": "default.png",';
560
+								} else {
561
+									$output .= '"aircraft_shadow": "default.png",';
562
+								}
405 563
 							}
406 564
 						} else {
407
-							if ($compress) $output .= '"as": "'.$spotter_item['aircraft_shadow'].'",';
408
-							else $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",';
565
+							if ($compress) {
566
+								$output .= '"as": "'.$spotter_item['aircraft_shadow'].'",';
567
+							} else {
568
+								$output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",';
569
+							}
409 570
 						}
410 571
 						if (isset($spotter_item['airline_name'])) {
411 572
 							$output .= '"airline_name": "'.$spotter_item['airline_name'].'",';
@@ -413,8 +574,11 @@  discard block
 block discarded – undo
413 574
 							$output .= '"airline_name": "NA",';
414 575
 						}
415 576
 						if (isset($spotter_item['departure_airport'])) {
416
-							if ($compress) $output .= '"dac": "'.$spotter_item['departure_airport'].'",';
417
-							else $output .= '"departure_airport_code": "'.$spotter_item['departure_airport'].'",';
577
+							if ($compress) {
578
+								$output .= '"dac": "'.$spotter_item['departure_airport'].'",';
579
+							} else {
580
+								$output .= '"departure_airport_code": "'.$spotter_item['departure_airport'].'",';
581
+							}
418 582
 						}
419 583
 						if (isset($spotter_item['departure_airport_city'])) {
420 584
 							$output .= '"departure_airport": "'.$spotter_item['departure_airport_city'].', '.$spotter_item['departure_airport_country'].'",';
@@ -426,8 +590,11 @@  discard block
 block discarded – undo
426 590
 							$output .= '"arrival_airport_time": "'.$spotter_item['arrival_airport_time'].'",';
427 591
 						}
428 592
 						if (isset($spotter_item['arrival_airport'])) {
429
-							if ($compress) $output .= '"aac": "'.$spotter_item['arrival_airport'].'",';
430
-							else $output .= '"arrival_airport_code": "'.$spotter_item['arrival_airport'].'",';
593
+							if ($compress) {
594
+								$output .= '"aac": "'.$spotter_item['arrival_airport'].'",';
595
+							} else {
596
+								$output .= '"arrival_airport_code": "'.$spotter_item['arrival_airport'].'",';
597
+							}
431 598
 						}
432 599
 						if (isset($spotter_item['arrival_airport_city'])) {
433 600
 							$output .= '"arrival_airport": "'.$spotter_item['arrival_airport_city'].', '.$spotter_item['arrival_airport_country'].'",';
@@ -446,11 +613,17 @@  discard block
 block discarded – undo
446 613
 						}
447 614
 						
448 615
 						if (isset($spotter_item['real_altitude'])) {
449
-							if ($compress) $output .= '"a": "'.($spotter_item['real_altitude']/100).'",';
450
-							else $output .= '"altitude": "'.($spotter_item['real_altitude']/100).'",';
616
+							if ($compress) {
617
+								$output .= '"a": "'.($spotter_item['real_altitude']/100).'",';
618
+							} else {
619
+								$output .= '"altitude": "'.($spotter_item['real_altitude']/100).'",';
620
+							}
451 621
 						} elseif (isset($spotter_item['altitude'])) {
452
-							if ($compress) $output .= '"a": "'.$spotter_item['altitude'].'",';
453
-							else $output .= '"altitude": "'.$spotter_item['altitude'].'",';
622
+							if ($compress) {
623
+								$output .= '"a": "'.$spotter_item['altitude'].'",';
624
+							} else {
625
+								$output .= '"altitude": "'.$spotter_item['altitude'].'",';
626
+							}
454 627
 						}
455 628
 						
456 629
 						$heading = $spotter_item['heading'];
@@ -474,19 +647,24 @@  discard block
 block discarded – undo
474 647
 							}
475 648
 						}
476 649
 						
477
-						if ($compress)$output .= '"h": "'.$heading.'",';
478
-						else $output .= '"heading": "'.$heading.'",';
650
+						if ($compress) {
651
+							$output .= '"h": "'.$heading.'",';
652
+						} else {
653
+							$output .= '"heading": "'.$heading.'",';
654
+						}
479 655
 						if ($currenttime != '') {
480 656
 							if (strtotime($spotter_item['date']) < $currenttime) {
481 657
 								if (isset($archivespeed)) {
482 658
 									$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh));
483 659
 									$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
484
-									if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
485
-									else {
660
+									if (!isset($idistance) || $fdistance < $idistance) {
661
+										$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
662
+									} else {
486 663
 										$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,$archivespeed,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh));
487 664
 										$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
488
-										if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
489
-										else {
665
+										if (!isset($idistance) || $fdistance < $idistance) {
666
+											$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
667
+										} else {
490 668
 											$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed);
491 669
 											$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
492 670
 										}
@@ -494,12 +672,14 @@  discard block
 block discarded – undo
494 672
 								} elseif ($usenextlatlon) {
495 673
 									$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,1,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh));
496 674
 									$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
497
-									if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
498
-									else {
675
+									if (!isset($idistance) || $fdistance < $idistance) {
676
+										$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
677
+									} else {
499 678
 										$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,1,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh));
500 679
 										$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
501
-										if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
502
-										else {
680
+										if (!isset($idistance) || $fdistance < $idistance) {
681
+											$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
682
+										} else {
503 683
 											$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading);
504 684
 											$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
505 685
 										}
@@ -538,7 +718,9 @@  discard block
 block discarded – undo
538 718
 							}
539 719
 						}
540 720
 
541
-						if (!$min) $output .= '"image": "'.$image.'",';
721
+						if (!$min) {
722
+							$output .= '"image": "'.$image.'",';
723
+						}
542 724
 						if (isset($spotter_item['image_copyright']) && $spotter_item['image_copyright'] != '') {
543 725
 							$output .= '"image_copyright": "'.str_replace('"',"'",trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'',$spotter_item['image_copyright']))).'",';
544 726
 						}
@@ -546,8 +728,11 @@  discard block
 block discarded – undo
546 728
 							$output .= '"image_source_website": "'.urlencode($spotter_item['image_source_website']).'",';
547 729
 						}
548 730
 						if (isset($spotter_item['squawk'])) {
549
-							if ($compress) $output .= '"sq": "'.$spotter_item['squawk'].'",';
550
-							else $output .= '"squawk": "'.$spotter_item['squawk'].'",';
731
+							if ($compress) {
732
+								$output .= '"sq": "'.$spotter_item['squawk'].'",';
733
+							} else {
734
+								$output .= '"squawk": "'.$spotter_item['squawk'].'",';
735
+							}
551 736
 						}
552 737
 						if (isset($spotter_item['squawk_usage'])) {
553 738
 							$output .= '"squawk_usage": "'.$spotter_item['squawk_usage'].'",';
@@ -578,14 +763,23 @@  discard block
 block discarded – undo
578 763
 						}
579 764
 						// type when not aircraft ?
580 765
 						if (isset($spotter_item['type'])) {
581
-							if ($compress) $output .= '"t": "'.$spotter_item['type'].'"';
582
-							else $output .= '"type": "'.$spotter_item['type'].'"';
766
+							if ($compress) {
767
+								$output .= '"t": "'.$spotter_item['type'].'"';
768
+							} else {
769
+								$output .= '"type": "'.$spotter_item['type'].'"';
770
+							}
583 771
 						} elseif ($marine) {
584
-							if ($compress) $output .= '"t": "ship"';
585
-							else $output .= '"type": "ship"';
772
+							if ($compress) {
773
+								$output .= '"t": "ship"';
774
+							} else {
775
+								$output .= '"type": "ship"';
776
+							}
586 777
 						} else {
587
-							if ($compress) $output .= '"t": "aircraft"';
588
-							else $output .= '"type": "aircraft"';
778
+							if ($compress) {
779
+								$output .= '"t": "aircraft"';
780
+							} else {
781
+								$output .= '"type": "aircraft"';
782
+							}
589 783
 						}
590 784
 						$output .= '},';
591 785
 						$output .= '"geometry": {';
@@ -593,15 +787,19 @@  discard block
 block discarded – undo
593 787
 								$output .= '"coordinates": [';
594 788
 								if ($currenttime != '') {
595 789
 									if (strtotime($spotter_item['date']) < $currenttime) {
596
-										if (!isset($archivespeed)) $archivespeed = 1;
790
+										if (!isset($archivespeed)) {
791
+											$archivespeed = 1;
792
+										}
597 793
 										$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed,($currenttime-strtotime($spotter_item['date'])));
598 794
 										$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
599
-										if (!isset($idistance) || $fdistance < $idistance) $output .= $nextcoord['longitude'].','.$nextcoord['latitude'];
600
-										else {
795
+										if (!isset($idistance) || $fdistance < $idistance) {
796
+											$output .= $nextcoord['longitude'].','.$nextcoord['latitude'];
797
+										} else {
601 798
 											$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,$archivespeed,($currenttime-strtotime($spotter_item['date'])));
602 799
 											$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
603
-											if (!isset($idistance) || $fdistance < $idistance) $output .= $nextcoord['longitude'].','.$nextcoord['latitude'];
604
-											else {
800
+											if (!isset($idistance) || $fdistance < $idistance) {
801
+												$output .= $nextcoord['longitude'].','.$nextcoord['latitude'];
802
+											} else {
605 803
 												$output .= $spotter_item['longitude'].', ';
606 804
 												$output .= $spotter_item['latitude'];
607 805
 											}
@@ -679,7 +877,9 @@  discard block
 block discarded – undo
679 877
 			}
680 878
 */
681 879
 				$history = filter_input(INPUT_GET,'history',FILTER_SANITIZE_STRING);
682
-				if ($history == '' && isset($_COOKIE['history'])) $history = $_COOKIE['history'];
880
+				if ($history == '' && isset($_COOKIE['history'])) {
881
+					$history = $_COOKIE['history'];
882
+				}
683 883
 				
684 884
 				if (
685 885
 				    (isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') 
@@ -750,8 +950,11 @@  discard block
 block discarded – undo
750 950
 									$output_history .= ']}},';
751 951
 									$output .= $output_history;
752 952
 								}
753
-								if ($compress) $output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "history","a": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": [';
754
-								else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": [';
953
+								if ($compress) {
954
+									$output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "history","a": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": [';
955
+								} else {
956
+									$output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": [';
957
+								}
755 958
 							}
756 959
 							$output_history .= '[';
757 960
 							$output_history .=  $spotter_history['longitude'].', ';
@@ -772,10 +975,15 @@  discard block
 block discarded – undo
772 975
 							if ($d === false) {
773 976
 								if ($compress) {
774 977
 									$output_history = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'",';
775
-									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>",';
776
-									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>",';
978
+									if (isset($spotter_history_array[0]['mapmatching_engine']) && $spotter_history_array[0]['mapmatching_engine'] == 'graphhopper') {
979
+										$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>",';
980
+									} elseif (isset($spotter_history_array[0]['mapmatching_engine'])) {
981
+										$output_history .= '"atr": "Map matching engine use data from © <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a>",';
982
+									}
777 983
 									$output_history .= '"t": "history"},"geometry": {"type": "LineString","coordinates": [';
778
-								} else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history"},"geometry": {"type": "LineString","coordinates": [';
984
+								} else {
985
+									$output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history"},"geometry": {"type": "LineString","coordinates": [';
986
+								}
779 987
 								$d = true;
780 988
 							}
781 989
 							$output_history .= '[';
@@ -798,7 +1006,9 @@  discard block
 block discarded – undo
798 1006
 							$output_historyd = '[';
799 1007
 							$output_historyd .=  $spotter_item['longitude'].', ';
800 1008
 							$output_historyd .=  $spotter_item['latitude'];
801
-							if (isset($spotter_history['altitude'])) $output_historyd .=  ','.$spotter_item['altitude']*30.48;
1009
+							if (isset($spotter_history['altitude'])) {
1010
+								$output_historyd .=  ','.$spotter_item['altitude']*30.48;
1011
+							}
802 1012
 							$output_historyd .= '],';
803 1013
 							//$output_history = $output_historyd.$output_history;
804 1014
 							$output_history = $output_history.$output_historyd;
@@ -826,8 +1036,11 @@  discard block
 block discarded – undo
826 1036
 				        && $spotter_item['arrival_airport'] != 'NA' 
827 1037
 				        && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") 
828 1038
 				    	    || (!isset($_COOKIE['MapRoute']) && isset($globalMapRoute) && $globalMapRoute)))) {
829
-				    if ($compress) $output_air = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "route"},"geometry": {"type": "LineString","coordinates": [';
830
-				    else $output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": [';
1039
+				    if ($compress) {
1040
+				    	$output_air = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "route"},"geometry": {"type": "LineString","coordinates": [';
1041
+				    } else {
1042
+				    	$output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": [';
1043
+				    }
831 1044
 				    if (isset($spotter_item['departure_airport_latitude'])) {
832 1045
 					$output_air .= '['.$spotter_item['departure_airport_longitude'].','.$spotter_item['departure_airport_latitude'].'],';
833 1046
 				    } elseif (isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA') {
@@ -860,8 +1073,11 @@  discard block
 block discarded – undo
860 1073
 				    	    || (!isset($_COOKIE['MapRemainingRoute']) && (!isset($globalMapRemainingRoute) 
861 1074
 				    	    || (isset($globalMapRemainingRoute) && $globalMapRemainingRoute)))))) {
862 1075
 				    $havedata = false;
863
-				    if ($compress) $output_dest = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "routedest"},"geometry": {"type": "LineString","coordinates": [';
864
-				    else $output_dest = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "routedest"},"geometry": {"type": "LineString","coordinates": [';
1076
+				    if ($compress) {
1077
+				    	$output_dest = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "routedest"},"geometry": {"type": "LineString","coordinates": [';
1078
+				    } else {
1079
+				    	$output_dest = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "routedest"},"geometry": {"type": "LineString","coordinates": [';
1080
+				    }
865 1081
 				    
866 1082
 				    //$output_dest .= '['.$spotter_item['longitude'].','.$spotter_item['latitude'].'],';
867 1083
 				    if (isset($spotter_item['arrival_airport_latitude'])) {
@@ -886,7 +1102,9 @@  discard block
 block discarded – undo
886 1102
 					$output_dest  = substr($output_dest, 0, -1);
887 1103
 				    }
888 1104
 				    $output_dest .= ']}},';
889
-				    if ($havedata) $output .= $output_dest;
1105
+				    if ($havedata) {
1106
+				    	$output .= $output_dest;
1107
+				    }
890 1108
 				    unset($output_dest);
891 1109
 				}
892 1110
 			}
@@ -894,7 +1112,9 @@  discard block
 block discarded – undo
894 1112
 			$output .= ']';
895 1113
 			$output .= ',"initial_sqltime": "'.$sqltime.'",';
896 1114
 			$output .= '"totaltime": "'.round(microtime(true)-$begintime,2).'",';
897
-			if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",';
1115
+			if (isset($begindate)) {
1116
+				$output .= '"archive_date": "'.$begindate.'",';
1117
+			}
898 1118
 			$output .= '"fc": "'.$j.'"';
899 1119
 		} else {
900 1120
 			$output .= '"features": ';
Please login to merge, or discard this patch.