Completed
Push — master ( 561404...142633 )
by Yannick
08:13
created
atc-data.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,9 @@
 block discarded – undo
8 8
 	$atcid = filter_input(INPUT_GET,'atcid',FILTER_SANITIZE_NUMBER_INT);
9 9
 	$atcident = filter_input(INPUT_GET,'atcident',FILTER_SANITIZE_STRING);
10 10
 	$atc_data = $ATC->getById($atcid);
11
-	if (!isset($atc_data[0])) $atc_data = $ATC->getByIdent($atcident);
11
+	if (!isset($atc_data[0])) {
12
+		$atc_data = $ATC->getByIdent($atcident);
13
+	}
12 14
  ?>
13 15
 <div class="alldetails">
14 16
 <button type="button" class="close">&times;</button>
Please login to merge, or discard this patch.
location-data.php 1 patch
Braces   +11 added lines, -4 removed lines patch added patch discarded remove patch
@@ -17,8 +17,11 @@  discard block
 block discarded – undo
17 17
 date_default_timezone_set('UTC');
18 18
 
19 19
 print '<div class="top">';
20
-if ($spotter_item['name'] != '') print '<div class="right"><div class="callsign-details"><div class="callsign">'.$spotter_item['name'].'</div>';
21
-else print '<div class="right"><div class="callsign-details"><div class="callsign">'.$spotter_item['location_id'].'</div>';
20
+if ($spotter_item['name'] != '') {
21
+	print '<div class="right"><div class="callsign-details"><div class="callsign">'.$spotter_item['name'].'</div>';
22
+} else {
23
+	print '<div class="right"><div class="callsign-details"><div class="callsign">'.$spotter_item['location_id'].'</div>';
24
+}
22 25
 print '</div>';
23 26
 
24 27
 print '</div></div>';
@@ -33,8 +36,12 @@  discard block
 block discarded – undo
33 36
 print $spotter_item['last_seen'];
34 37
 print '</div>';
35 38
 
36
-if ($spotter_item['city'] != '') print '<div><span>'._("City").'</span>'.$spotter_item['city'].'</div>';
37
-if ($spotter_item['country'] !='') print '<div><span>'._("Country").'</span>'.$spotter_item['country'].'</div>';
39
+if ($spotter_item['city'] != '') {
40
+	print '<div><span>'._("City").'</span>'.$spotter_item['city'].'</div>';
41
+}
42
+if ($spotter_item['country'] !='') {
43
+	print '<div><span>'._("Country").'</span>'.$spotter_item['country'].'</div>';
44
+}
38 45
 print '<div><span>'._("Coordinates").'</span>'.round($spotter_item['latitude'],3).', '.round($spotter_item['longitude'],3).'</div>';
39 46
 /*
40 47
 if ($spotter_item['atc_range'] > 0) {
Please login to merge, or discard this patch.
location-geojson.php 1 patch
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -35,10 +35,11 @@
 block discarded – undo
35 35
 			$output .= '"city": "'.$spotter_item['city'].'",';
36 36
 			$output .= '"country": "'.$spotter_item['country'].'",';
37 37
 			$output .= '"altitude": "'.$spotter_item['altitude'].'",';
38
-			if ($spotter_item['name'] != '' && $spotter_item['city'] != '' && $spotter_item['country'] != '')
39
-				$output .= '"popupContent": "'.$spotter_item['name'].' : '.$spotter_item['city'].', '.$spotter_item['country'].'",';
40
-			elseif ($spotter_item['location_id'] != '')
41
-				$output .= '"popupContent": "'.$spotter_item['location_id'].'",';
38
+			if ($spotter_item['name'] != '' && $spotter_item['city'] != '' && $spotter_item['country'] != '') {
39
+							$output .= '"popupContent": "'.$spotter_item['name'].' : '.$spotter_item['city'].', '.$spotter_item['country'].'",';
40
+			} elseif ($spotter_item['location_id'] != '') {
41
+							$output .= '"popupContent": "'.$spotter_item['location_id'].'",';
42
+			}
42 43
 			$output .= '"icon": "'.$globalURL.'/images/'.$spotter_item['logo'].'",';
43 44
 			$output .= '"type": "'.$spotter_item['type'].'",';
44 45
 			$output .= '"image_thumb": "'.$spotter_item['image_thumb'].'"';
Please login to merge, or discard this patch.
require/class.APRS.php 1 patch
Braces   +158 added lines, -60 removed lines patch added patch discarded remove patch
@@ -107,17 +107,23 @@  discard block
 block discarded – undo
107 107
 	
108 108
 	/* Check that end was found and body has at least one byte. */
109 109
 	if ($splitpos == 0 || $splitpos + 1 == $input_len || $splitpos === FALSE) {
110
-	    if ($globalDebug) echo '!!! APRS invalid : '.$input."\n";
110
+	    if ($globalDebug) {
111
+	    	echo '!!! APRS invalid : '.$input."\n";
112
+	    }
111 113
 	    return false;
112 114
 	}
113 115
 	
114
-	if ($debug) echo 'input : '.$input."\n";
116
+	if ($debug) {
117
+		echo 'input : '.$input."\n";
118
+	}
115 119
 	/* Save header and body. */
116 120
 	$body = substr($input,$splitpos+1,$input_len);
117 121
 	$body_len = strlen($body);
118 122
 	$header = substr($input,0,$splitpos);
119 123
 	//$header_len = strlen($header);
120
-	if ($debug) echo 'header : '.$header."\n";
124
+	if ($debug) {
125
+		echo 'header : '.$header."\n";
126
+	}
121 127
 	
122 128
 	/* Parse source, target and path. */
123 129
 	//FLRDF0A52>APRS,qAS,LSTB
@@ -131,11 +137,15 @@  discard block
 block discarded – undo
131 137
 		$result['format_source'] = 'famaprs';
132 138
 		$result['source_type'] = 'ais';
133 139
 	    } else {
134
-		if ($debug) echo 'ident : '.$ident."\n";
140
+		if ($debug) {
141
+			echo 'ident : '.$ident."\n";
142
+		}
135 143
 		$result['ident'] = $ident;
136 144
 	    }
137 145
 	} else {
138
-	    if ($debug) 'No ident'."\n";
146
+	    if ($debug) {
147
+	    	'No ident'."\n";
148
+	    }
139 149
 	    return false;
140 150
 	}
141 151
 	$elements = explode(',',$all_elements);
@@ -146,7 +156,9 @@  discard block
 block discarded – undo
146 156
 	        //echo "ok";
147 157
 	        //if ($element == 'TCPIP*') return false;
148 158
 	    } elseif (!preg_match('/^([0-9A-F]{32})$/',$element)) {
149
-		if ($debug) echo 'element : '.$element."\n";
159
+		if ($debug) {
160
+			echo 'element : '.$element."\n";
161
+		}
150 162
 		return false;
151 163
 	    }
152 164
 	    /*
@@ -159,13 +171,17 @@  discard block
 block discarded – undo
159 171
 	}
160 172
 	
161 173
 	$type = substr($body,0,1);
162
-	if ($debug) echo 'type : '.$type."\n";
174
+	if ($debug) {
175
+		echo 'type : '.$type."\n";
176
+	}
163 177
 	if ($type == ';') {
164 178
 		if (isset($result['source_type']) && $result['source_type'] == 'modes') {
165 179
 			$result['address'] = trim(substr($body,1,9));
166 180
 		} elseif (isset($result['source_type']) && $result['source_type'] == 'ais') {
167 181
 			$result['mmsi'] = trim(substr($body,1,9));
168
-		} else $result['ident'] = trim(substr($body,1,9));
182
+		} else {
183
+			$result['ident'] = trim(substr($body,1,9));
184
+		}
169 185
 	} elseif ($type == ',') {
170 186
 		// Invalid data or test data
171 187
 		return false;
@@ -233,7 +249,9 @@  discard block
 block discarded – undo
233 249
 		//$symbol_table = $matches[4];
234 250
 		$lat = intval($lat_deg);
235 251
 		$lon = intval($lon_deg);
236
-		if ($lat > 89 || $lon > 179) return false;
252
+		if ($lat > 89 || $lon > 179) {
253
+			return false;
254
+		}
237 255
 	    
238 256
 	    /*
239 257
 	    $tmp_5b = str_replace('.','',$lat_min);
@@ -243,8 +261,12 @@  discard block
 block discarded – undo
243 261
 	    */
244 262
 		$latitude = $lat + floatval($lat_min)/60;
245 263
 		$longitude = $lon + floatval($lon_min)/60;
246
-		if ($sind == 'S') $latitude = 0-$latitude;
247
-		if ($wind == 'W') $longitude = 0-$longitude;
264
+		if ($sind == 'S') {
265
+			$latitude = 0-$latitude;
266
+		}
267
+		if ($wind == 'W') {
268
+			$longitude = 0-$longitude;
269
+		}
248 270
 		$result['latitude'] = $latitude;
249 271
 		$result['longitude'] = $longitude;
250 272
 		$body_parse = substr($body_parse,18);
@@ -278,7 +300,9 @@  discard block
 block discarded – undo
278 300
 			$body_parse = substr($body_parse,1);
279 301
 			$body_parse_len = strlen($body_parse);
280 302
 			$result['symbol_code'] = $symbol_code;
281
-			if (isset($this->symbols[$symbol_code])) $result['symbol'] = $this->symbols[$symbol_code];
303
+			if (isset($this->symbols[$symbol_code])) {
304
+				$result['symbol'] = $this->symbols[$symbol_code];
305
+			}
282 306
 			if ($symbol_code != '_') {
283 307
 			}
284 308
 		    //$body_parse = substr($body_parse,1);
@@ -289,7 +313,9 @@  discard block
 block discarded – undo
289 313
 		        if (preg_match('/^([0-9\\. ]{3})\\/([0-9\\. ]{3})/',$body_parse)) {
290 314
 		    	    $course = substr($body_parse,0,3);
291 315
 		    	    $tmp_s = intval($course);
292
-		    	    if ($tmp_s >= 1 && $tmp_s <= 360) $result['heading'] = intval($course);
316
+		    	    if ($tmp_s >= 1 && $tmp_s <= 360) {
317
+		    	    	$result['heading'] = intval($course);
318
+		    	    }
293 319
 		    	    $speed = substr($body_parse,4,3);
294 320
 		    	    if ($speed != '...') {
295 321
 		    		//$result['speed'] = round($speed*1.852);
@@ -330,10 +356,16 @@  discard block
 block discarded – undo
330 356
 			        $lat_off = (($dao_split[1])-48.0)*0.001/60.0;
331 357
 			        $lon_off = (($dao_split[2])-48.0)*0.001/60.0;
332 358
 			    
333
-				if ($result['latitude'] < 0) $result['latitude'] -= $lat_off;
334
-				else $result['latitude'] += $lat_off;
335
-				if ($result['longitude'] < 0) $result['longitude'] -= $lon_off;
336
-				else $result['longitude'] += $lon_off;
359
+				if ($result['latitude'] < 0) {
360
+					$result['latitude'] -= $lat_off;
361
+				} else {
362
+					$result['latitude'] += $lat_off;
363
+				}
364
+				if ($result['longitude'] < 0) {
365
+					$result['longitude'] -= $lon_off;
366
+				} else {
367
+					$result['longitude'] += $lon_off;
368
+				}
337 369
 			    }
338 370
 			    
339 371
 		            $body_parse = substr($body_parse,6);
@@ -375,27 +407,48 @@  discard block
 block discarded – undo
375 407
 			$address = substr($id,2);
376 408
 			//print_r($matches);
377 409
 			$addressType = (intval(substr($id,0,2),16))&3;
378
-			if ($addressType == 0) $result['addresstype'] = "RANDOM";
379
-			elseif ($addressType == 1) $result['addresstype'] = "ICAO";
380
-			elseif ($addressType == 2) $result['addresstype'] = "FLARM";
381
-			elseif ($addressType == 3) $result['addresstype'] = "OGN";
410
+			if ($addressType == 0) {
411
+				$result['addresstype'] = "RANDOM";
412
+			} elseif ($addressType == 1) {
413
+				$result['addresstype'] = "ICAO";
414
+			} elseif ($addressType == 2) {
415
+				$result['addresstype'] = "FLARM";
416
+			} elseif ($addressType == 3) {
417
+				$result['addresstype'] = "OGN";
418
+			}
382 419
 			$aircraftType = $this->urshift(((intval(substr($id,0,2),16)) & 0b1111100),2);
383 420
 			$result['aircrafttype_code'] = $aircraftType;
384
-			if ($aircraftType == 0) $result['aircrafttype'] = "UNKNOWN";
385
-			elseif ($aircraftType == 1) $result['aircrafttype'] = "GLIDER";
386
-			elseif ($aircraftType == 2) $result['aircrafttype'] = "TOW_PLANE";
387
-			elseif ($aircraftType == 3) $result['aircrafttype'] = "HELICOPTER_ROTORCRAFT";
388
-			elseif ($aircraftType == 4) $result['aircrafttype'] = "PARACHUTE";
389
-			elseif ($aircraftType == 5) $result['aircrafttype'] = "DROP_PLANE";
390
-			elseif ($aircraftType == 6) $result['aircrafttype'] = "HANG_GLIDER";
391
-			elseif ($aircraftType == 7) $result['aircrafttype'] = "PARA_GLIDER";
392
-			elseif ($aircraftType == 8) $result['aircrafttype'] = "POWERED_AIRCRAFT";
393
-			elseif ($aircraftType == 9) $result['aircrafttype'] = "JET_AIRCRAFT";
394
-			elseif ($aircraftType == 10) $result['aircrafttype'] = "UFO";
395
-			elseif ($aircraftType == 11) $result['aircrafttype'] = "BALLOON";
396
-			elseif ($aircraftType == 12) $result['aircrafttype'] = "AIRSHIP";
397
-			elseif ($aircraftType == 13) $result['aircrafttype'] = "UAV";
398
-			elseif ($aircraftType == 15) $result['aircrafttype'] = "STATIC_OBJECT";
421
+			if ($aircraftType == 0) {
422
+				$result['aircrafttype'] = "UNKNOWN";
423
+			} elseif ($aircraftType == 1) {
424
+				$result['aircrafttype'] = "GLIDER";
425
+			} elseif ($aircraftType == 2) {
426
+				$result['aircrafttype'] = "TOW_PLANE";
427
+			} elseif ($aircraftType == 3) {
428
+				$result['aircrafttype'] = "HELICOPTER_ROTORCRAFT";
429
+			} elseif ($aircraftType == 4) {
430
+				$result['aircrafttype'] = "PARACHUTE";
431
+			} elseif ($aircraftType == 5) {
432
+				$result['aircrafttype'] = "DROP_PLANE";
433
+			} elseif ($aircraftType == 6) {
434
+				$result['aircrafttype'] = "HANG_GLIDER";
435
+			} elseif ($aircraftType == 7) {
436
+				$result['aircrafttype'] = "PARA_GLIDER";
437
+			} elseif ($aircraftType == 8) {
438
+				$result['aircrafttype'] = "POWERED_AIRCRAFT";
439
+			} elseif ($aircraftType == 9) {
440
+				$result['aircrafttype'] = "JET_AIRCRAFT";
441
+			} elseif ($aircraftType == 10) {
442
+				$result['aircrafttype'] = "UFO";
443
+			} elseif ($aircraftType == 11) {
444
+				$result['aircrafttype'] = "BALLOON";
445
+			} elseif ($aircraftType == 12) {
446
+				$result['aircrafttype'] = "AIRSHIP";
447
+			} elseif ($aircraftType == 13) {
448
+				$result['aircrafttype'] = "UAV";
449
+			} elseif ($aircraftType == 15) {
450
+				$result['aircrafttype'] = "STATIC_OBJECT";
451
+			}
399 452
 			$stealth = (intval(substr($id,0,2), 16) & 0b10000000) != 0;
400 453
 			$result['stealth'] = $stealth;
401 454
 			$result['address'] = $address;
@@ -435,13 +488,21 @@  discard block
 block discarded – undo
435 488
 			$result['temp'] = round(5/9*(($matches[1])-32),1);
436 489
 		    }
437 490
 		}
438
-		} else $result['comment'] = trim($body_parse);
491
+		} else {
492
+			$result['comment'] = trim($body_parse);
493
+		}
439 494
 
440 495
 	    }
441 496
 	//}
442
-	if (isset($result['latitude'])) $result['latitude'] = round($result['latitude'],4);
443
-	if (isset($result['longitude'])) $result['longitude'] = round($result['longitude'],4);
444
-	if ($debug) print_r($result);
497
+	if (isset($result['latitude'])) {
498
+		$result['latitude'] = round($result['latitude'],4);
499
+	}
500
+	if (isset($result['longitude'])) {
501
+		$result['longitude'] = round($result['longitude'],4);
502
+	}
503
+	if ($debug) {
504
+		print_r($result);
505
+	}
445 506
 	return $result;
446 507
     }
447 508
     
@@ -450,12 +511,21 @@  discard block
 block discarded – undo
450 511
 	$aprs_connect = 0;
451 512
 	$aprs_keep = 120;
452 513
 	$aprs_last_tx = time();
453
-	if (isset($globalAPRSversion)) $aprs_version = $globalAPRSversion;
454
-	else $aprs_version = 'FlightAirMap '.str_replace(' ','_',$globalName);
455
-	if (isset($globalServerAPRSssid)) $aprs_ssid = $globalServerAPRSssid;
456
-	else $aprs_ssid = substr('FAM'.strtoupper(str_replace(' ','_',$globalName)),0,8);
457
-	if (isset($globalServerAPRSpass)) $aprs_pass = $globalServerAPRSpass;
458
-	else $aprs_pass = '-1';
514
+	if (isset($globalAPRSversion)) {
515
+		$aprs_version = $globalAPRSversion;
516
+	} else {
517
+		$aprs_version = 'FlightAirMap '.str_replace(' ','_',$globalName);
518
+	}
519
+	if (isset($globalServerAPRSssid)) {
520
+		$aprs_ssid = $globalServerAPRSssid;
521
+	} else {
522
+		$aprs_ssid = substr('FAM'.strtoupper(str_replace(' ','_',$globalName)),0,8);
523
+	}
524
+	if (isset($globalServerAPRSpass)) {
525
+		$aprs_pass = $globalServerAPRSpass;
526
+	} else {
527
+		$aprs_pass = '-1';
528
+	}
459 529
 	
460 530
 	$aprs_filter  = '';
461 531
 	$aprs_login = "user {$aprs_ssid} pass {$aprs_pass} vers {$aprs_version}\n";
@@ -488,10 +558,14 @@  discard block
 block discarded – undo
488 558
     
489 559
     public function send($data) {
490 560
 	global $globalDebug;
491
-	if ($this->connected === false) $this->connect();
561
+	if ($this->connected === false) {
562
+		$this->connect();
563
+	}
492 564
 	$send = socket_send( $this->socket  , $data , strlen($data),0);
493 565
 	if ($send === FALSE) {
494
-		if ($globalDebug) echo 'Reconnect...';
566
+		if ($globalDebug) {
567
+			echo 'Reconnect...';
568
+		}
495 569
 		socket_close($this->socket);
496 570
 		$this->connect();
497 571
 	}
@@ -511,22 +585,32 @@  discard block
 block discarded – undo
511 585
 			//$w = '00';
512 586
 			$custom = '';
513 587
 			if ($ident != '') {
514
-				if ($custom != '') $custom .= '/';
588
+				if ($custom != '') {
589
+					$custom .= '/';
590
+				}
515 591
 				$custom .= 'CS='.$ident;
516 592
 			}
517 593
 			if ($squawk != '') {
518
-				if ($custom != '') $custom .= '/';
594
+				if ($custom != '') {
595
+					$custom .= '/';
596
+				}
519 597
 				$custom .= 'SQ='.$squawk;
520 598
 			}
521 599
 			if ($verticalrate != '') {
522
-				if ($custom != '') $custom .= '/';
600
+				if ($custom != '') {
601
+					$custom .= '/';
602
+				}
523 603
 				$custom .= 'VR='.$verticalrate;
524 604
 			}
525 605
 			if ($aircraft_icao != '' && $aircraft_icao != 'NA') {
526
-				if ($custom != '') $custom .= '/';
606
+				if ($custom != '') {
607
+					$custom .= '/';
608
+				}
527 609
 				$custom .= 'AI='.$aircraft_icao;
528 610
 			}
529
-			if ($custom != '') $custom = ' '.$custom;
611
+			if ($custom != '') {
612
+				$custom = ' '.$custom;
613
+			}
530 614
 			$this->send('AIRCRAFT>APRS,TCPIP*:;'.$hex.'   *'.date('His',strtotime($datetime)).'h'.$coordinate.'^'.str_pad($heading,3,'0',STR_PAD_LEFT).'/'.str_pad($speed,3,'0',STR_PAD_LEFT).'/A='.str_pad($altitude_real,6,'0',STR_PAD_LEFT).' !W'.$w.'!'.$custom."\n");
531 615
 		}
532 616
 	}
@@ -544,30 +628,44 @@  discard block
 block discarded – undo
544 628
 			//$w = '00';
545 629
 			$custom = '';
546 630
 			if ($ident != '') {
547
-				if ($custom != '') $custom .= '/';
631
+				if ($custom != '') {
632
+					$custom .= '/';
633
+				}
548 634
 				$custom .= 'CS='.str_replace(' ','_',$ident);
549 635
 			}
550 636
 			if ($typeid != '') {
551
-				if ($custom != '') $custom .= '/';
637
+				if ($custom != '') {
638
+					$custom .= '/';
639
+				}
552 640
 				$custom .= 'TI='.$typeid;
553 641
 			}
554 642
 			if ($statusid != '') {
555
-				if ($custom != '') $custom .= '/';
643
+				if ($custom != '') {
644
+					$custom .= '/';
645
+				}
556 646
 				$custom .= 'SI='.$statusid;
557 647
 			}
558 648
 			if ($imo != '') {
559
-				if ($custom != '') $custom .= '/';
649
+				if ($custom != '') {
650
+					$custom .= '/';
651
+				}
560 652
 				$custom .= 'IMO='.$imo;
561 653
 			}
562 654
 			if ($arrival_date != '') {
563
-				if ($custom != '') $custom .= '/';
655
+				if ($custom != '') {
656
+					$custom .= '/';
657
+				}
564 658
 				$custom .= 'AD='.strtotime($arrival_date);
565 659
 			}
566 660
 			if ($arrival_code != '') {
567
-				if ($custom != '') $custom .= '/';
661
+				if ($custom != '') {
662
+					$custom .= '/';
663
+				}
568 664
 				$custom .= 'AC='.str_replace(' ','_',$arrival_code);
569 665
 			}
570
-			if ($custom != '') $custom = ' '.$custom;
666
+			if ($custom != '') {
667
+				$custom = ' '.$custom;
668
+			}
571 669
 			$altitude = 0;
572 670
 			$this->send('MARINE>APRS,TCPIP*:;'.$mmsi.'*'.date('His',strtotime($datetime)).'h'.$coordinate.'s'.str_pad($heading,3,'0',STR_PAD_LEFT).'/'.str_pad($speed,3,'0',STR_PAD_LEFT).'/A='.str_pad($altitude,6,'0',STR_PAD_LEFT).' !W'.$w.'!'.$custom."\n");
573 671
 		}
Please login to merge, or discard this patch.
require/class.Source.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -88,7 +88,9 @@  discard block
 block discarded – undo
88 88
 	}
89 89
 
90 90
 	public function addLocation($name,$latitude,$longitude,$altitude,$city,$country,$source,$logo = 'antenna.png',$type = '',$source_id = 0,$location_id = 0,$last_seen = '', $description = '') {
91
-		if ($last_seen == '') $last_seen = date('Y-m-d H:i:s');
91
+		if ($last_seen == '') {
92
+			$last_seen = date('Y-m-d H:i:s');
93
+		}
92 94
 		$query = "INSERT INTO source_location (name,latitude,longitude,altitude,country,city,logo,source,type,source_id,last_seen,location_id,description) VALUES (:name,:latitude,:longitude,:altitude,:country,:city,:logo,:source,:type,:source_id,:last_seen,:location_id,:description)";
93 95
 		$query_values = array(':name' => $name,':latitude' => $latitude, ':longitude' => $longitude,':altitude' => $altitude,':city' => $city,':country' => $country,':logo' => $logo,':source' => $source,':type' => $type,':source_id' => $source_id,':last_seen' => $last_seen,':location_id' => $location_id,':description' => $description);
94 96
 		try {
@@ -100,7 +102,9 @@  discard block
 block discarded – undo
100 102
 	}
101 103
 
102 104
 	public function updateLocation($name,$latitude,$longitude,$altitude,$city,$country,$source,$logo = 'antenna.png',$type = '',$source_id = 0,$location_id = 0,$last_seen = '',$description = '') {
103
-		if ($last_seen == '') $last_seen = date('Y-m-d H:i:s');
105
+		if ($last_seen == '') {
106
+			$last_seen = date('Y-m-d H:i:s');
107
+		}
104 108
 		$query = "UPDATE source_location SET latitude = :latitude,longitude = :longitude,altitude = :altitude,country = :country,city = :city,logo = :logo,type = :type, source_id = :source_id, last_seen = :last_seen,location_id = :location_id, description = :description WHERE name = :name AND source = :source";
105 109
 		$query_values = array(':name' => $name,':latitude' => $latitude, ':longitude' => $longitude,':altitude' => $altitude,':city' => $city,':country' => $country,':logo' => $logo,':source' => $source,':type' => $type,':source_id' => $source_id,':last_seen' => $last_seen,':location_id' => $location_id,':description' => $description);
106 110
 		try {
@@ -123,7 +127,9 @@  discard block
 block discarded – undo
123 127
 	}
124 128
 
125 129
 	public function updateLocationByLocationID($name,$latitude,$longitude,$altitude,$city,$country,$source,$logo = 'antenna.png',$type = '',$source_id = 0, $location_id,$last_seen = '',$description = '') {
126
-		if ($last_seen == '') $last_seen = date('Y-m-d H:i:s');
130
+		if ($last_seen == '') {
131
+			$last_seen = date('Y-m-d H:i:s');
132
+		}
127 133
 		$query = "UPDATE source_location SET latitude = :latitude,longitude = :longitude,altitude = :altitude,country = :country,city = :city,logo = :logo,type = :type, last_seen = :last_seen, description = :description WHERE location_id = :location_id AND source = :source AND source_id = :source_id";
128 134
 		$query_values = array(':source_id' => $source_id,':latitude' => $latitude, ':longitude' => $longitude,':altitude' => $altitude,':city' => $city,':country' => $country,':logo' => $logo,':source' => $source,':type' => $type,':last_seen' => $last_seen,':location_id' => $location_id,':description' => $description);
129 135
 		try {
Please login to merge, or discard this patch.
index.php 1 patch
Braces   +401 added lines, -103 removed lines patch added patch discarded remove patch
@@ -154,11 +154,26 @@  discard block
 block discarded – undo
154 154
 				<li><div class="checkbox"><label><input type="checkbox" name="notamcb" value="1" onclick="showNotam();" /><?php echo _("Display NOTAM"); ?></label></div></li>
155 155
 				<li><?php echo _("NOTAM scope:"); ?>
156 156
 					<select class="selectpicker" onchange="notamscope(this);">
157
-						<option<?php if (!isset($_COOKIE['notamscope']) || $_COOKIE['notamscope'] == 'All') print ' selected'; ?>>All</option>
158
-						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport/Enroute warning') print ' selected'; ?>>Airport/Enroute warning</option>
159
-						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport warning') print ' selected'; ?>>Airport warning</option>
160
-						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Navigation warning') print ' selected'; ?>>Navigation warning</option>
161
-						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Enroute warning') print ' selected'; ?>>Enroute warning</option>
157
+						<option<?php if (!isset($_COOKIE['notamscope']) || $_COOKIE['notamscope'] == 'All') {
158
+	print ' selected';
159
+}
160
+?>>All</option>
161
+						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport/Enroute warning') {
162
+	print ' selected';
163
+}
164
+?>>Airport/Enroute warning</option>
165
+						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Airport warning') {
166
+	print ' selected';
167
+}
168
+?>>Airport warning</option>
169
+						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Navigation warning') {
170
+	print ' selected';
171
+}
172
+?>>Navigation warning</option>
173
+						<option<?php if (isset($_COOKIE['notamscope']) && $_COOKIE['notamscope'] == 'Enroute warning') {
174
+	print ' selected';
175
+}
176
+?>>Enroute warning</option>
162 177
 					</select
163 178
 				</li>
164 179
 			</ul>
@@ -186,7 +201,12 @@  discard block
 block discarded – undo
186 201
 		        <div class="form-group">
187 202
 			    <label>From (UTC):</label>
188 203
 		            <div class='input-group date' id='datetimepicker1'>
189
-            			<input type='text' name="start_date" class="form-control" value="<?php if (isset($_POST['start_date'])) print $_POST['start_date']; elseif (isset($_COOKIE['archive_begin'])) print date("m/d/Y h:i a",$_COOKIE['archive_begin']); ?>" required />
204
+            			<input type='text' name="start_date" class="form-control" value="<?php if (isset($_POST['start_date'])) {
205
+	print $_POST['start_date'];
206
+} elseif (isset($_COOKIE['archive_begin'])) {
207
+	print date("m/d/Y h:i a",$_COOKIE['archive_begin']);
208
+}
209
+?>" required />
190 210
 		                <span class="input-group-addon">
191 211
             			    <span class="glyphicon glyphicon-calendar"></span>
192 212
 		                </span>
@@ -195,7 +215,12 @@  discard block
 block discarded – undo
195 215
 		        <div class="form-group">
196 216
 			    <label>To (UTC):</label>
197 217
 		            <div class='input-group date' id='datetimepicker2'>
198
-		                <input type='text' name="end_date" class="form-control" value="<?php if (isset($_POST['end_date'])) print $_POST['end_date']; elseif (isset($_COOKIE['archive_end'])) print date("m/d/Y h:i a",$_COOKIE['archive_end']); ?>" />
218
+		                <input type='text' name="end_date" class="form-control" value="<?php if (isset($_POST['end_date'])) {
219
+	print $_POST['end_date'];
220
+} elseif (isset($_COOKIE['archive_end'])) {
221
+	print date("m/d/Y h:i a",$_COOKIE['archive_end']);
222
+}
223
+?>" />
199 224
             			<span class="input-group-addon">
200 225
 		                    <span class="glyphicon glyphicon-calendar"></span>
201 226
             			</span>
@@ -221,8 +246,20 @@  discard block
 block discarded – undo
221 246
 
222 247
 		    <li><?php echo _("Playback speed:"); ?>
223 248
 			<div class="range">
224
-			    <input type="range" min="0" max="50" step="1" 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'; ?>">
225
-			    <output id="archivespeedrange"><?php  if (isset($_COOKIE['archive_speed'])) print $_COOKIE['archive_speed']; else print '1'; ?></output>
249
+			    <input type="range" min="0" max="50" step="1" name="archivespeed" onChange="archivespeedrange.value=value;" value="<?php  if (isset($_POST['archivespeed'])) {
250
+	print $_POST['archivespeed'];
251
+} elseif (isset($_COOKIE['archive_speed'])) {
252
+	print $_COOKIE['archive_speed'];
253
+} else {
254
+	print '1';
255
+}
256
+?>">
257
+			    <output id="archivespeedrange"><?php  if (isset($_COOKIE['archive_speed'])) {
258
+	print $_COOKIE['archive_speed'];
259
+} else {
260
+	print '1';
261
+}
262
+?></output>
226 263
 			</div>
227 264
 		    </li>
228 265
 		    <li><input type="submit" name="archive" value="Show archive" class="btn btn-primary" /></li>
@@ -244,15 +281,27 @@  discard block
 block discarded – undo
244 281
 		    <li><?php echo _("Type of Map:"); ?>
245 282
 			<select  class="selectpicker" onchange="mapType(this);">
246 283
 			    <?php
247
-				if (!isset($_COOKIE['MapType']) || $_COOKIE['MapType'] == '') $MapType = $globalMapProvider;
248
-				else $MapType = $_COOKIE['MapType'];
284
+				if (!isset($_COOKIE['MapType']) || $_COOKIE['MapType'] == '') {
285
+					$MapType = $globalMapProvider;
286
+				} else {
287
+					$MapType = $_COOKIE['MapType'];
288
+				}
249 289
 			    ?>
250 290
 			    <?php
251 291
 				if (isset($globalBingMapKey) && $globalBingMapKey != '') {
252 292
 			    ?>
253
-			    <option value="Bing-Aerial"<?php if ($MapType == 'Bing-Aerial') print ' selected'; ?>>Bing-Aerial</option>
254
-			    <option value="Bing-Hybrid"<?php if ($MapType == 'Bing-Hybrid') print ' selected'; ?>>Bing-Hybrid</option>
255
-			    <option value="Bing-Road"<?php if ($MapType == 'Bing-Road') print ' selected'; ?>>Bing-Road</option>
293
+			    <option value="Bing-Aerial"<?php if ($MapType == 'Bing-Aerial') {
294
+	print ' selected';
295
+}
296
+?>>Bing-Aerial</option>
297
+			    <option value="Bing-Hybrid"<?php if ($MapType == 'Bing-Hybrid') {
298
+	print ' selected';
299
+}
300
+?>>Bing-Hybrid</option>
301
+			    <option value="Bing-Road"<?php if ($MapType == 'Bing-Road') {
302
+	print ' selected';
303
+}
304
+?>>Bing-Road</option>
256 305
 			    <?php
257 306
 				}
258 307
 			    ?>
@@ -262,56 +311,131 @@  discard block
 block discarded – undo
262 311
 			    <?php
263 312
 				    if (isset($globalHereappId) && $globalHereappId != '' && isset($globalHereappCode) && $globalHereappCode != '') {
264 313
 			    ?>
265
-			    <option value="Here-Aerial"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Aerial</option>
266
-			    <option value="Here-Hybrid"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Hybrid</option>
267
-			    <option value="Here-Road"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Road</option>
314
+			    <option value="Here-Aerial"<?php if ($MapType == 'Here') {
315
+	print ' selected';
316
+}
317
+?>>Here-Aerial</option>
318
+			    <option value="Here-Hybrid"<?php if ($MapType == 'Here') {
319
+	print ' selected';
320
+}
321
+?>>Here-Hybrid</option>
322
+			    <option value="Here-Road"<?php if ($MapType == 'Here') {
323
+	print ' selected';
324
+}
325
+?>>Here-Road</option>
268 326
 			    <?php
269 327
 				    }
270 328
 			    ?>
271 329
 			    <?php
272 330
 				    if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '') {
273 331
 			    ?>
274
-			    <option value="Google-Roadmap"<?php if ($MapType == 'Google-Roadmap') print ' selected'; ?>>Google Roadmap</option>
275
-			    <option value="Google-Satellite"<?php if ($MapType == 'Google-Satellite') print ' selected'; ?>>Google Satellite</option>
276
-			    <option value="Google-Hybrid"<?php if ($MapType == 'Google-Hybrid') print ' selected'; ?>>Google Hybrid</option>
277
-			    <option value="Google-Terrain"<?php if ($MapType == 'Google-Terrain') print ' selected'; ?>>Google Terrain</option>
332
+			    <option value="Google-Roadmap"<?php if ($MapType == 'Google-Roadmap') {
333
+	print ' selected';
334
+}
335
+?>>Google Roadmap</option>
336
+			    <option value="Google-Satellite"<?php if ($MapType == 'Google-Satellite') {
337
+	print ' selected';
338
+}
339
+?>>Google Satellite</option>
340
+			    <option value="Google-Hybrid"<?php if ($MapType == 'Google-Hybrid') {
341
+	print ' selected';
342
+}
343
+?>>Google Hybrid</option>
344
+			    <option value="Google-Terrain"<?php if ($MapType == 'Google-Terrain') {
345
+	print ' selected';
346
+}
347
+?>>Google Terrain</option>
278 348
 			    <?php
279 349
 				    }
280 350
 			    ?>
281 351
 			    <?php
282 352
 				    if (isset($globalMapQuestKey) && $globalMapQuestKey != '') {
283 353
 			    ?>
284
-			    <option value="MapQuest-OSM"<?php if ($MapType == 'MapQuest-OSM') print ' selected'; ?>>MapQuest-OSM</option>
285
-			    <option value="MapQuest-Aerial"<?php if ($MapType == 'MapQuest-Aerial') print ' selected'; ?>>MapQuest-Aerial</option>
286
-			    <option value="MapQuest-Hybrid"<?php if ($MapType == 'MapQuest-Hybrid') print ' selected'; ?>>MapQuest-Hybrid</option>
354
+			    <option value="MapQuest-OSM"<?php if ($MapType == 'MapQuest-OSM') {
355
+	print ' selected';
356
+}
357
+?>>MapQuest-OSM</option>
358
+			    <option value="MapQuest-Aerial"<?php if ($MapType == 'MapQuest-Aerial') {
359
+	print ' selected';
360
+}
361
+?>>MapQuest-Aerial</option>
362
+			    <option value="MapQuest-Hybrid"<?php if ($MapType == 'MapQuest-Hybrid') {
363
+	print ' selected';
364
+}
365
+?>>MapQuest-Hybrid</option>
287 366
 			    <?php
288 367
 				    }
289 368
 			    ?>
290
-			    <option value="Yandex"<?php if ($MapType == 'Yandex') print ' selected'; ?>>Yandex</option>
369
+			    <option value="Yandex"<?php if ($MapType == 'Yandex') {
370
+	print ' selected';
371
+}
372
+?>>Yandex</option>
291 373
 			    <?php
292 374
 				}
293 375
 			    ?>
294 376
 			    <?php
295 377
 				    if (isset($globalMapboxToken) && $globalMapboxToken != '') {
296
-					if (!isset($_COOKIE['MapTypeId'])) $MapBoxId = 'default';
297
-					else $MapBoxId = $_COOKIE['MapTypeId'];
378
+					if (!isset($_COOKIE['MapTypeId'])) {
379
+						$MapBoxId = 'default';
380
+					} else {
381
+						$MapBoxId = $_COOKIE['MapTypeId'];
382
+					}
298 383
 			    ?>
299
-			    <option value="Mapbox-default"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'default') print ' selected'; ?>>Mapbox default</option>
300
-			    <option value="Mapbox-mapbox.streets"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets') print ' selected'; ?>>Mapbox streets</option>
301
-			    <option value="Mapbox-mapbox.light"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.light') print ' selected'; ?>>Mapbox light</option>
302
-			    <option value="Mapbox-mapbox.dark"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.dark') print ' selected'; ?>>Mapbox dark</option>
303
-			    <option value="Mapbox-mapbox.satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.satellite') print ' selected'; ?>>Mapbox satellite</option>
304
-			    <option value="Mapbox-mapbox.streets-satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-satellite') print ' selected'; ?>>Mapbox streets-satellite</option>
305
-			    <option value="Mapbox-mapbox.streets-basic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-basic') print ' selected'; ?>>Mapbox streets-basic</option>
306
-			    <option value="Mapbox-mapbox.comic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.comic') print ' selected'; ?>>Mapbox comic</option>
307
-			    <option value="Mapbox-mapbox.outdoors"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.outdoors') print ' selected'; ?>>Mapbox outdoors</option>
308
-			    <option value="Mapbox-mapbox.pencil"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pencil') print ' selected'; ?>>Mapbox pencil</option>
309
-			    <option value="Mapbox-mapbox.pirates"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pirates') print ' selected'; ?>>Mapbox pirates</option>
310
-			    <option value="Mapbox-mapbox.emerald"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.emerald') print ' selected'; ?>>Mapbox emerald</option>
384
+			    <option value="Mapbox-default"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'default') {
385
+	print ' selected';
386
+}
387
+?>>Mapbox default</option>
388
+			    <option value="Mapbox-mapbox.streets"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets') {
389
+	print ' selected';
390
+}
391
+?>>Mapbox streets</option>
392
+			    <option value="Mapbox-mapbox.light"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.light') {
393
+	print ' selected';
394
+}
395
+?>>Mapbox light</option>
396
+			    <option value="Mapbox-mapbox.dark"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.dark') {
397
+	print ' selected';
398
+}
399
+?>>Mapbox dark</option>
400
+			    <option value="Mapbox-mapbox.satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.satellite') {
401
+	print ' selected';
402
+}
403
+?>>Mapbox satellite</option>
404
+			    <option value="Mapbox-mapbox.streets-satellite"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-satellite') {
405
+	print ' selected';
406
+}
407
+?>>Mapbox streets-satellite</option>
408
+			    <option value="Mapbox-mapbox.streets-basic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets-basic') {
409
+	print ' selected';
410
+}
411
+?>>Mapbox streets-basic</option>
412
+			    <option value="Mapbox-mapbox.comic"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.comic') {
413
+	print ' selected';
414
+}
415
+?>>Mapbox comic</option>
416
+			    <option value="Mapbox-mapbox.outdoors"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.outdoors') {
417
+	print ' selected';
418
+}
419
+?>>Mapbox outdoors</option>
420
+			    <option value="Mapbox-mapbox.pencil"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pencil') {
421
+	print ' selected';
422
+}
423
+?>>Mapbox pencil</option>
424
+			    <option value="Mapbox-mapbox.pirates"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pirates') {
425
+	print ' selected';
426
+}
427
+?>>Mapbox pirates</option>
428
+			    <option value="Mapbox-mapbox.emerald"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.emerald') {
429
+	print ' selected';
430
+}
431
+?>>Mapbox emerald</option>
311 432
 			    <?php
312 433
 				    }
313 434
 			    ?>
314
-			    <option value="OpenStreetMap"<?php if ($MapType == 'OpenStreetMap') print ' selected'; ?>>OpenStreetMap</option>
435
+			    <option value="OpenStreetMap"<?php if ($MapType == 'OpenStreetMap') {
436
+	print ' selected';
437
+}
438
+?>>OpenStreetMap</option>
315 439
 			</select>
316 440
 		    </li>
317 441
 <?php
@@ -319,9 +443,18 @@  discard block
 block discarded – undo
319 443
 ?>
320 444
 		    <li><?php echo _("Type of Terrain:"); ?>
321 445
 			<select  class="selectpicker" onchange="terrainType(this);">
322
-			    <option value="stk"<?php if (!isset($_COOKIE['MapTerrain']) || $_COOKIE['MapTerrain'] == 'stk') print ' selected'; ?>>stk terrain</option>
323
-			    <option value="ellipsoid"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'ellipsoid') print ' selected';?>>ellipsoid</option>
324
-			    <option value="vrterrain"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'vrterrain') print ' selected';?>>vr terrain</option>
446
+			    <option value="stk"<?php if (!isset($_COOKIE['MapTerrain']) || $_COOKIE['MapTerrain'] == 'stk') {
447
+	print ' selected';
448
+}
449
+?>>stk terrain</option>
450
+			    <option value="ellipsoid"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'ellipsoid') {
451
+	print ' selected';
452
+}
453
+?>>ellipsoid</option>
454
+			    <option value="vrterrain"<?php if (isset($_COOKIE['MapTerrain']) && $_COOKIE['MapTerrain'] == 'vrterrain') {
455
+	print ' selected';
456
+}
457
+?>>vr terrain</option>
325 458
 			</select>
326 459
 		    </li>
327 460
 <?php
@@ -331,20 +464,44 @@  discard block
 block discarded – undo
331 464
     if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') {
332 465
 ?>
333 466
 		    
334
-		    <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>
335
-		    <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>
336
-		    <li><div class="checkbox"><label><input type="checkbox" name="flightroute" value="1" onclick="clickFlightRoute(this)" <?php if ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == 'true') || (isset($globalMapRoute) && $globalMapRoute)) print 'checked'; ?> ><?php echo _("Display flight route on click"); ?></label></div></li>
337
-		    <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>
338
-		    <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>
467
+		    <li><div class="checkbox"><label><input type="checkbox" name="flightpopup" value="1" onclick="clickFlightPopup(this)" <?php if (isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true') {
468
+	print 'checked';
469
+}
470
+?> ><?php echo _("Display flight info as popup"); ?></label></div></li>
471
+		    <li><div class="checkbox"><label><input type="checkbox" name="flightpath" value="1" onclick="clickFlightPath(this)" <?php if ((isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true')) {
472
+	print 'checked';
473
+}
474
+?> ><?php echo _("Display flight path"); ?></label></div></li>
475
+		    <li><div class="checkbox"><label><input type="checkbox" name="flightroute" value="1" onclick="clickFlightRoute(this)" <?php if ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == 'true') || (isset($globalMapRoute) && $globalMapRoute)) {
476
+	print 'checked';
477
+}
478
+?> ><?php echo _("Display flight route on click"); ?></label></div></li>
479
+		    <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)) {
480
+	print 'checked';
481
+}
482
+?> ><?php echo _("Display flight remaining route on click"); ?></label></div></li>
483
+		    <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)) {
484
+	print 'checked';
485
+}
486
+?> ><?php echo _("Planes animate between updates"); ?></label></div></li>
339 487
 <?php
340 488
     }
341 489
 ?>
342
-		    <li><div class="checkbox"><label><input type="checkbox" name="displayairports" value="1" onclick="clickDisplayAirports(this)" <?php if (isset($_COOKIE['displayairports']) && $_COOKIE['displayairports'] == 'true') print 'checked'; ?> ><?php echo _("Display airports on map"); ?></label></div></li>
343
-		    <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>
490
+		    <li><div class="checkbox"><label><input type="checkbox" name="displayairports" value="1" onclick="clickDisplayAirports(this)" <?php if (isset($_COOKIE['displayairports']) && $_COOKIE['displayairports'] == 'true') {
491
+	print 'checked';
492
+}
493
+?> ><?php echo _("Display airports on map"); ?></label></div></li>
494
+		    <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))) {
495
+	print 'checked';
496
+}
497
+?> ><?php echo _("Display ground station on map"); ?></label></div></li>
344 498
 <?php
345 499
     if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') {
346 500
 ?>
347
-		    <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>
501
+		    <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')) {
502
+	print 'checked';
503
+}
504
+?> ><?php echo _("Show mini-map"); ?></label></div></li>
348 505
 <?php
349 506
     }
350 507
     if (time() > mktime(0,0,0,12,1,date("Y")) && time() < mktime(0,0,0,12,31,date("Y"))) {
@@ -358,17 +515,25 @@  discard block
 block discarded – undo
358 515
 			if (function_exists('array_column')) {
359 516
 			    if (array_search(TRUE, array_column($globalSources, 'sourcestats')) !== FALSE) {
360 517
 		    ?>
361
-		    <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>
518
+		    <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) {
519
+	print 'checked';
520
+}
521
+?> ><?php echo _("Display polar on map"); ?></label></div></li>
362 522
 		    <?php
363 523
 			    }
364 524
 			} elseif (isset($globalSources)) {
365 525
 			    $dispolar = false;
366 526
 			    foreach ($globalSources as $testsource) {
367
-			        if (isset($globalSources['sourcestats']) && $globalSources['sourcestats'] !== FALSE) $dispolar = true;
527
+			        if (isset($globalSources['sourcestats']) && $globalSources['sourcestats'] !== FALSE) {
528
+			        	$dispolar = true;
529
+			        }
368 530
 			    }
369 531
 			    if ($dispolar) {
370 532
 		    ?>
371
-		    <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>
533
+		    <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) {
534
+	print 'checked';
535
+}
536
+?> ><?php echo _("Display polar on map"); ?></label></div></li>
372 537
 		    <?php
373 538
 			    }
374 539
 		        }
@@ -381,12 +546,22 @@  discard block
 block discarded – undo
381 546
 			if (!isset($globalAircraft) || $globalAircraft === TRUE) {
382 547
 		    	    if (extension_loaded('gd') && function_exists('gd_info')) {
383 548
 		    ?>
384
-		    <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>
549
+		    <li><input type="checkbox" name="aircraftcoloraltitude" value="1" onclick="iconColorAltitude(this)" <?php if (isset($_COOKIE['IconColorAltitude']) && $_COOKIE['IconColorAltitude'] == 'true') {
550
+	print 'checked';
551
+}
552
+?> ><?php echo _("Aircraft icon color based on altitude"); ?></li>
385 553
 		    <?php 
386 554
 				if (!isset($_COOKIE['IconColorAltitude']) || $_COOKIE['IconColorAltitude'] == 'false') {
387 555
 		    ?>
388 556
 		    <li><?php echo _("Aircraft icon color:"); ?>
389
-			<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'; ?>">
557
+			<input type="color" name="aircraftcolor" id="html5colorpicker" onchange="iconColor(aircraftcolor.value);" value="#<?php if (isset($_COOKIE['IconColor'])) {
558
+	print $_COOKIE['IconColor'];
559
+} elseif (isset($globalAircraftIconColor)) {
560
+	print $globalAircraftIconColor;
561
+} else {
562
+	print '1a3151';
563
+}
564
+?>">
390 565
 		    </li>
391 566
 		    <?php
392 567
 				}
@@ -398,7 +573,14 @@  discard block
 block discarded – undo
398 573
 			    if (extension_loaded('gd') && function_exists('gd_info')) {
399 574
 		    ?>
400 575
 		    <li><?php echo _("Marine icon color:"); ?>
401
-			<input type="color" name="marinecolor" id="html5colorpicker" onchange="iconColor(marinecolor.value);" value="#<?php if (isset($_COOKIE['MarineIconColor'])) print $_COOKIE['MarineIconColor']; elseif (isset($globalMarineIconColor)) print $globalMarineIconColor; else print '1a3151'; ?>">
576
+			<input type="color" name="marinecolor" id="html5colorpicker" onchange="iconColor(marinecolor.value);" value="#<?php if (isset($_COOKIE['MarineIconColor'])) {
577
+	print $_COOKIE['MarineIconColor'];
578
+} elseif (isset($globalMarineIconColor)) {
579
+	print $globalMarineIconColor;
580
+} else {
581
+	print '1a3151';
582
+}
583
+?>">
402 584
 		    </li>
403 585
 		    <?php
404 586
 			    }
@@ -409,8 +591,22 @@  discard block
 block discarded – undo
409 591
 		    ?>
410 592
 		    <li><?php echo _("Show airport icon at zoom level:"); ?>
411 593
 			<div class="range">
412
-			    <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'; ?>">
413
-			    <output id="range"><?php if (isset($_COOKIE['AirportZoom'])) print $_COOKIE['AirportZoom']; elseif (isset($globalAirportZoom)) print $globalAirportZoom; else print '7'; ?></output>
594
+			    <input type="range" min="0" max="19" step="1" name="airportzoom" onchange="range.value=value;airportDisplayZoom(airportzoom.value);" value="<?php if (isset($_COOKIE['AirportZoom'])) {
595
+	print $_COOKIE['AirportZoom'];
596
+} elseif (isset($globalAirportZoom)) {
597
+	print $globalAirportZoom;
598
+} else {
599
+	print '7';
600
+}
601
+?>">
602
+			    <output id="range"><?php if (isset($_COOKIE['AirportZoom'])) {
603
+	print $_COOKIE['AirportZoom'];
604
+} elseif (isset($globalAirportZoom)) {
605
+	print $globalAirportZoom;
606
+} else {
607
+	print '7';
608
+}
609
+?></output>
414 610
 			</div>
415 611
 		    </li>
416 612
 		    <?php
@@ -422,9 +618,19 @@  discard block
 block discarded – undo
422 618
 <?php
423 619
 	if (!isset($globalAircraft) || $globalAircraft === TRUE) {
424 620
 ?>
425
-		    <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"); ?></li>
621
+		    <li><input type="checkbox" name="aircraftcolorforce" value="1" onclick="iconColorForce(this)" <?php if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true') {
622
+	print 'checked';
623
+}
624
+?> ><?php echo _("Force Aircraft color"); ?></li>
426 625
 		    <li><?php echo _("Aircraft icon color:"); ?>
427
-			<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'; ?>">
626
+			<input type="color" name="aircraftcolor" id="html5colorpicker" onchange="iconColor(aircraftcolor.value);" value="#<?php if (isset($_COOKIE['IconColor'])) {
627
+	print $_COOKIE['IconColor'];
628
+} elseif (isset($globalAircraftIconColor)) {
629
+	print $globalAircraftIconColor;
630
+} else {
631
+	print 'ff0000';
632
+}
633
+?>">
428 634
 		    </li>
429 635
 <?php
430 636
 	}
@@ -432,9 +638,19 @@  discard block
 block discarded – undo
432 638
 <?php
433 639
 	if (isset($globalMarine) && $globalMarine === TRUE) {
434 640
 ?>
435
-		    <li><input type="checkbox" name="marinecolorforce" value="1" onclick="iconColorForce(this)" <?php if (isset($_COOKIE['MarineIconColorForce']) && $_COOKIE['MarineIconColorForce'] == 'true') print 'checked'; ?> ><?php echo _("Force Marine color"); ?></li>
641
+		    <li><input type="checkbox" name="marinecolorforce" value="1" onclick="iconColorForce(this)" <?php if (isset($_COOKIE['MarineIconColorForce']) && $_COOKIE['MarineIconColorForce'] == 'true') {
642
+	print 'checked';
643
+}
644
+?> ><?php echo _("Force Marine color"); ?></li>
436 645
 		    <li><?php echo _("Marine icon color:"); ?>
437
-			<input type="color" name="marinecolor" id="html5colorpicker" onchange="iconColor(marinecolor.value);" value="#<?php if (isset($_COOKIE['MarineIconColor'])) print $_COOKIE['MarineIconColor']; elseif (isset($globalMarineIconColor)) print $globalMarineIconColor; else print 'ff0000'; ?>">
646
+			<input type="color" name="marinecolor" id="html5colorpicker" onchange="iconColor(marinecolor.value);" value="#<?php if (isset($_COOKIE['MarineIconColor'])) {
647
+	print $_COOKIE['MarineIconColor'];
648
+} elseif (isset($globalMarineIconColor)) {
649
+	print $globalMarineIconColor;
650
+} else {
651
+	print 'ff0000';
652
+}
653
+?>">
438 654
 		    </li>
439 655
 <?php
440 656
 	}
@@ -442,22 +658,46 @@  discard block
 block discarded – undo
442 658
 ?>
443 659
 		    <li><?php echo _("Distance unit:"); ?>
444 660
 			<select class="selectpicker" onchange="unitdistance(this);">
445
-			    <option value="km"<?php if ((!isset($_COOKIE['unitdistance']) && (!isset($globalUnitDistance) || (isset($globalUnitDistance) && $globalUnitDistance == 'km'))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) echo ' selected'; ?>>km</option>
446
-			    <option value="nm"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) echo ' selected'; ?>>nm</option>
447
-			    <option value="mi"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) echo ' selected'; ?>>mi</option>
661
+			    <option value="km"<?php if ((!isset($_COOKIE['unitdistance']) && (!isset($globalUnitDistance) || (isset($globalUnitDistance) && $globalUnitDistance == 'km'))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) {
662
+	echo ' selected';
663
+}
664
+?>>km</option>
665
+			    <option value="nm"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) {
666
+	echo ' selected';
667
+}
668
+?>>nm</option>
669
+			    <option value="mi"<?php if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) {
670
+	echo ' selected';
671
+}
672
+?>>mi</option>
448 673
 		        </select>
449 674
 		    </li>
450 675
 		    <li><?php echo _("Altitude unit:"); ?>
451 676
 			<select class="selectpicker" onchange="unitaltitude(this);">
452
-			    <option value="m"<?php if ((!isset($_COOKIE['unitaltitude']) && (!isset($globalUnitAltitude) || (isset($globalUnitAltitude) && $globalUnitAltitude == 'm'))) || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'm')) echo ' selected'; ?>>m</option>
453
-			    <option value="feet"<?php if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) echo ' selected'; ?>>feet</option>
677
+			    <option value="m"<?php if ((!isset($_COOKIE['unitaltitude']) && (!isset($globalUnitAltitude) || (isset($globalUnitAltitude) && $globalUnitAltitude == 'm'))) || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'm')) {
678
+	echo ' selected';
679
+}
680
+?>>m</option>
681
+			    <option value="feet"<?php if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) {
682
+	echo ' selected';
683
+}
684
+?>>feet</option>
454 685
 		        </select>
455 686
 		    </li>
456 687
 		    <li><?php echo _("Speed unit:"); ?>
457 688
 			<select class="selectpicker" onchange="unitspeed(this);">
458
-			    <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>
459
-			    <option value="mph"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'mph') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'mph')) echo ' selected'; ?>>mph</option>
460
-			    <option value="knots"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'knots') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'knots')) echo ' selected'; ?>>knots</option>
689
+			    <option value="kmh"<?php if ((!isset($_COOKIE['unitspeed']) && (!isset($globalUnitSpeed) || (isset($globalUnitSpeed) && $globalUnitSpeed == 'kmh'))) || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'kmh')) {
690
+	echo ' selected';
691
+}
692
+?>>km/h</option>
693
+			    <option value="mph"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'mph') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'mph')) {
694
+	echo ' selected';
695
+}
696
+?>>mph</option>
697
+			    <option value="knots"<?php if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'knots') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'knots')) {
698
+	echo ' selected';
699
+}
700
+?>>knots</option>
461 701
 		        </select>
462 702
 		    </li>
463 703
 
@@ -475,9 +715,18 @@  discard block
 block discarded – undo
475 715
 		    <?php
476 716
 			if (((isset($globalVATSIM) && $globalVATSIM) || isset($globalIVAO) && $globalIVAO || isset($globalphpVMS) && $globalphpVMS) && (!isset($globalMapVAchoose) || $globalMapVAchoose)) {
477 717
 		    ?>
478
-			<?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 } ?>
479
-			<?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 } ?>
480
-			<?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 } ?>
718
+			<?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'])) {
719
+	print 'checked';
720
+}
721
+?> ><?php echo _("Display VATSIM data"); ?></li><?php } ?>
722
+			<?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'])) {
723
+	print 'checked';
724
+}
725
+?> ><?php echo _("Display IVAO data"); ?></li><?php } ?>
726
+			<?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'])) {
727
+	print 'checked';
728
+}
729
+?> ><?php echo _("Display phpVMS data"); ?></li><?php } ?>
481 730
 		    <?php
482 731
 			}
483 732
 		    ?>
@@ -485,10 +734,16 @@  discard block
 block discarded – undo
485 734
 			if (!(isset($globalVA) && $globalVA) && !(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalIVAO) && $globalIVAO) && !(isset($globalphpVMS) && $globalphpVMS) && isset($globalSBS1) && $globalSBS1 && isset($globalAPRS) && $globalAPRS && (!isset($globalMapchoose) || $globalMapchoose)) {
486 735
 		    ?>
487 736
 			<?php if (isset($globalSBS1) && $globalSBS1) { ?>
488
-			    <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>
737
+			    <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'])) {
738
+	print 'checked';
739
+}
740
+?> ><?php echo _("Display ADS-B data"); ?></label></div></li>
489 741
 			<?php } ?>
490 742
 			<?php if (isset($globalAPRS) && $globalAPRS) { ?>
491
-			    <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>
743
+			    <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'])) {
744
+	print 'checked';
745
+}
746
+?> ><?php echo _("Display APRS data"); ?></label></div></li>
492 747
 			<?php } ?>
493 748
 		    <?php
494 749
 			}
@@ -505,7 +760,9 @@  discard block
 block discarded – undo
505 760
 				}
506 761
 				foreach($allairlinenames as $airline) {
507 762
 					$airline_name = $airline['airline_name'];
508
-					if (strlen($airline_name) > 30) $airline_name = substr($airline_name,0,30).'...';
763
+					if (strlen($airline_name) > 30) {
764
+						$airline_name = substr($airline_name,0,30).'...';
765
+					}
509 766
 					if (isset($_COOKIE['filter_Airlines']) && in_array($airline['airline_icao'],explode(',',$_COOKIE['filter_Airlines']))) {
510 767
 						echo '<option value="'.$airline['airline_icao'].'" selected>'.$airline_name.'</option>';
511 768
 					} else {
@@ -523,7 +780,10 @@  discard block
 block discarded – undo
523 780
 		    <li><?php echo _("Display alliance:"); ?>
524 781
 		    <br/>
525 782
 			<select class="selectpicker" onchange="alliance(this);" id="display_alliance">
526
-			    <option value="all"<?php if (!isset($_COOKIE['filter_alliance']) || $_COOKIE['filter_alliance'] == 'all' || $_COOKIE['filter_alliance'] == '') echo ' selected'; ?>><?php echo _("All"); ?></option>
783
+			    <option value="all"<?php if (!isset($_COOKIE['filter_alliance']) || $_COOKIE['filter_alliance'] == 'all' || $_COOKIE['filter_alliance'] == '') {
784
+	echo ' selected';
785
+}
786
+?>><?php echo _("All"); ?></option>
527 787
 			    <?php
528 788
 				foreach($allalliancenames as $alliance) {
529 789
 					$alliance_name = $alliance['alliance'];
@@ -570,10 +830,22 @@  discard block
 block discarded – undo
570 830
 		    ?>
571 831
 		    <li><?php echo _("Display airlines of type:"); ?><br/>
572 832
 			<select class="selectpicker" onchange="airlinestype(this);">
573
-			    <option value="all"<?php if (!isset($_COOKIE['filter_airlinestype']) || $_COOKIE['filter_airlinestype'] == 'all' || $_COOKIE['filter_airlinestype'] == '') echo ' selected'; ?>><?php echo _("All"); ?></option>
574
-			    <option value="passenger"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'passenger') echo ' selected'; ?>><?php echo _("Passenger"); ?></option>
575
-			    <option value="cargo"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'cargo') echo ' selected'; ?>><?php echo _("Cargo"); ?></option>
576
-			    <option value="military"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'military') echo ' selected'; ?>><?php echo _("Military"); ?></option>
833
+			    <option value="all"<?php if (!isset($_COOKIE['filter_airlinestype']) || $_COOKIE['filter_airlinestype'] == 'all' || $_COOKIE['filter_airlinestype'] == '') {
834
+	echo ' selected';
835
+}
836
+?>><?php echo _("All"); ?></option>
837
+			    <option value="passenger"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'passenger') {
838
+	echo ' selected';
839
+}
840
+?>><?php echo _("Passenger"); ?></option>
841
+			    <option value="cargo"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'cargo') {
842
+	echo ' selected';
843
+}
844
+?>><?php echo _("Cargo"); ?></option>
845
+			    <option value="military"<?php if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] == 'military') {
846
+	echo ' selected';
847
+}
848
+?>><?php echo _("Military"); ?></option>
577 849
 			</select>
578 850
 		    </li>
579 851
 		    <?php
@@ -581,7 +853,10 @@  discard block
 block discarded – undo
581 853
 		    ?>
582 854
 		    <li>
583 855
 			<?php echo _("Display flight with ident:"); ?>
584
-			<input type="text" name="identfilter" onchange="identfilter();" id="identfilter" value="<?php if (isset($_COOKIE['filter_ident'])) print $_COOKIE['filter_ident']; ?>" />
856
+			<input type="text" name="identfilter" onchange="identfilter();" id="identfilter" value="<?php if (isset($_COOKIE['filter_ident'])) {
857
+	print $_COOKIE['filter_ident'];
858
+}
859
+?>" />
585 860
 		    </li>
586 861
 		    <?php
587 862
 			}
@@ -600,7 +875,10 @@  discard block
 block discarded – undo
600 875
 	    <h1 class="sidebar-header"><?php echo _("Satellites"); ?><span class="sidebar-close"><i class="fa fa-caret-left"></i></span></h1>
601 876
 	    <form>
602 877
 		<ul>
603
-		    <li><div class="checkbox"><label><input type="checkbox" name="displayiss" value="1" onclick="clickDisplayISS(this)" <?php if (isset($_COOKIE['displayiss']) && $_COOKIE['displayiss'] == 'true') print 'checked'; ?> ><?php echo _("Show ISS, Tiangong-1 and Tiangong-2 on map"); ?></label></div></li>
878
+		    <li><div class="checkbox"><label><input type="checkbox" name="displayiss" value="1" onclick="clickDisplayISS(this)" <?php if (isset($_COOKIE['displayiss']) && $_COOKIE['displayiss'] == 'true') {
879
+	print 'checked';
880
+}
881
+?> ><?php echo _("Show ISS, Tiangong-1 and Tiangong-2 on map"); ?></label></div></li>
604 882
 		    <li><?php echo _("Type:"); ?>
605 883
 			<select class="selectpicker" multiple onchange="sattypes(this);">
606 884
 			    <?php
@@ -608,25 +886,45 @@  discard block
 block discarded – undo
608 886
 				$types = $Satellite->get_tle_types();
609 887
 				foreach ($types as $type) {
610 888
 					$type_name = $type['tle_type'];
611
-					if ($type_name == 'musson') $type_name = 'Russian LEO Navigation';
612
-					else if ($type_name == 'nnss') $type_name = 'Navi Navigation Satellite System';
613
-					else if ($type_name == 'sbas') $type_name = 'Satellite-Based Augmentation System';
614
-					else if ($type_name == 'glo-ops') $type_name = 'Glonass Operational';
615
-					else if ($type_name == 'gps-ops') $type_name = 'GPS Operational';
616
-					else if ($type_name == 'argos') $type_name = 'ARGOS Data Collection System';
617
-					else if ($type_name == 'tdrss') $type_name = 'Tracking and Data Relay Satellite System';
618
-					else if ($type_name == 'sarsat') $type_name = 'Search & Rescue';
619
-					else if ($type_name == 'dmc') $type_name = 'Disaster Monitoring';
620
-					else if ($type_name == 'resource') $type_name = 'Earth Resources';
621
-					else if ($type_name == 'stations') $type_name = 'Space Stations';
622
-					else if ($type_name == 'geo') $type_name = 'Geostationary';
623
-					else if ($type_name == 'amateur') $type_name = 'Amateur Radio';
624
-					else if ($type_name == 'x-comm') $type_name = 'Experimental';
625
-					else if ($type_name == 'other-comm') $type_name = 'Other Comm';
626
-					else if ($type_name == 'science') $type_name = 'Space & Earth Science';
627
-					else if ($type_name == 'military') $type_name = 'Miscellaneous Military';
628
-					else if ($type_name == 'radar') $type_name = 'Radar Calibration';
629
-					else if ($type_name == 'tle-new') $type_name = 'Last 30 days launches';
889
+					if ($type_name == 'musson') {
890
+						$type_name = 'Russian LEO Navigation';
891
+					} else if ($type_name == 'nnss') {
892
+						$type_name = 'Navi Navigation Satellite System';
893
+					} else if ($type_name == 'sbas') {
894
+						$type_name = 'Satellite-Based Augmentation System';
895
+					} else if ($type_name == 'glo-ops') {
896
+						$type_name = 'Glonass Operational';
897
+					} else if ($type_name == 'gps-ops') {
898
+						$type_name = 'GPS Operational';
899
+					} else if ($type_name == 'argos') {
900
+						$type_name = 'ARGOS Data Collection System';
901
+					} else if ($type_name == 'tdrss') {
902
+						$type_name = 'Tracking and Data Relay Satellite System';
903
+					} else if ($type_name == 'sarsat') {
904
+						$type_name = 'Search & Rescue';
905
+					} else if ($type_name == 'dmc') {
906
+						$type_name = 'Disaster Monitoring';
907
+					} else if ($type_name == 'resource') {
908
+						$type_name = 'Earth Resources';
909
+					} else if ($type_name == 'stations') {
910
+						$type_name = 'Space Stations';
911
+					} else if ($type_name == 'geo') {
912
+						$type_name = 'Geostationary';
913
+					} else if ($type_name == 'amateur') {
914
+						$type_name = 'Amateur Radio';
915
+					} else if ($type_name == 'x-comm') {
916
+						$type_name = 'Experimental';
917
+					} else if ($type_name == 'other-comm') {
918
+						$type_name = 'Other Comm';
919
+					} else if ($type_name == 'science') {
920
+						$type_name = 'Space & Earth Science';
921
+					} else if ($type_name == 'military') {
922
+						$type_name = 'Miscellaneous Military';
923
+					} else if ($type_name == 'radar') {
924
+						$type_name = 'Radar Calibration';
925
+					} else if ($type_name == 'tle-new') {
926
+						$type_name = 'Last 30 days launches';
927
+					}
630 928
 					
631 929
 					if (isset($_COOKIE['sattypes']) && in_array($type['tle_type'],explode(',',$_COOKIE['sattypes']))) {
632 930
 						print '<option value="'.$type['tle_type'].'" selected>'.$type_name.'</option>';
Please login to merge, or discard this patch.
require/class.SpotterLive.php 1 patch
Braces   +86 added lines, -29 removed lines patch added patch discarded remove patch
@@ -29,7 +29,9 @@  discard block
 block discarded – undo
29 29
 		if (isset($filter[0]['source'])) {
30 30
 			$filters = array_merge($filters,$filter);
31 31
 		}
32
-		if (is_array($globalFilter)) $filter = array_merge($filter,$globalFilter);
32
+		if (is_array($globalFilter)) {
33
+			$filter = array_merge($filter,$globalFilter);
34
+		}
33 35
 		$filter_query_join = '';
34 36
 		$filter_query_where = '';
35 37
 		foreach($filters as $flt) {
@@ -118,8 +120,11 @@  discard block
 block discarded – undo
118 120
 		if (isset($filter['source_aprs']) && !empty($filter['source_aprs'])) {
119 121
 			$filter_query_where .= " AND format_source = 'aprs' AND source_name IN ('".implode("','",$filter['source_aprs'])."')";
120 122
 		}
121
-		if ($filter_query_where == '' && $where) $filter_query_where = ' WHERE';
122
-		elseif ($filter_query_where != '' && $and) $filter_query_where .= ' AND';
123
+		if ($filter_query_where == '' && $where) {
124
+			$filter_query_where = ' WHERE';
125
+		} elseif ($filter_query_where != '' && $and) {
126
+			$filter_query_where .= ' AND';
127
+		}
123 128
 		if ($filter_query_where != '') {
124 129
 			$filter_query_where = preg_replace('/^ AND/',' WHERE',$filter_query_where);
125 130
 		}
@@ -160,9 +165,13 @@  discard block
 block discarded – undo
160 165
 				$orderby_query = ' '.$search_orderby_array[$sort]['sql'];
161 166
 			}
162 167
 		}
163
-		if ($orderby_query == '') $orderby_query = ' ORDER BY date DESC';
168
+		if ($orderby_query == '') {
169
+			$orderby_query = ' ORDER BY date DESC';
170
+		}
164 171
 
165
-		if (!isset($globalLiveInterval)) $globalLiveInterval = '200';
172
+		if (!isset($globalLiveInterval)) {
173
+			$globalLiveInterval = '200';
174
+		}
166 175
 		if ($globalDBdriver == 'mysql') {
167 176
 			//$query  = "SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL 30 SECOND) <= l.date GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate";
168 177
 			$query  = 'SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= l.date GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate'.$filter_query.$orderby_query;
@@ -185,7 +194,9 @@  discard block
 block discarded – undo
185 194
 		global $globalDBdriver, $globalLiveInterval, $globalArchive;
186 195
 		date_default_timezone_set('UTC');
187 196
 		$filter_query = $this->getFilter($filter,true,true);
188
-		if (!isset($globalLiveInterval)) $globalLiveInterval = '200';
197
+		if (!isset($globalLiveInterval)) {
198
+			$globalLiveInterval = '200';
199
+		}
189 200
 		if ($globalDBdriver == 'mysql') {
190 201
 			if (isset($globalArchive) && $globalArchive === TRUE) {
191 202
 				$query  = 'SELECT spotter_live.ident, spotter_live.flightaware_id, spotter_live.aircraft_icao, spotter_live.departure_airport_icao as departure_airport, spotter_live.arrival_airport_icao as arrival_airport, spotter_live.latitude, spotter_live.longitude, spotter_live.altitude, spotter_live.heading, spotter_live.ground_speed, spotter_live.squawk, spotter_live.date, spotter_live.format_source 
@@ -228,7 +239,9 @@  discard block
 block discarded – undo
228 239
 
229 240
 		$filter_query = $this->getFilter($filter,true,true);
230 241
 
231
-		if (!isset($globalLiveInterval)) $globalLiveInterval = '200';
242
+		if (!isset($globalLiveInterval)) {
243
+			$globalLiveInterval = '200';
244
+		}
232 245
 		if ($globalDBdriver == 'mysql') {
233 246
 			if (isset($globalArchive) && $globalArchive === TRUE) {
234 247
 				/*
@@ -296,7 +309,9 @@  discard block
 block discarded – undo
296 309
 		global $globalDBdriver, $globalLiveInterval;
297 310
 		$filter_query = $this->getFilter($filter,true,true);
298 311
 
299
-		if (!isset($globalLiveInterval)) $globalLiveInterval = '200';
312
+		if (!isset($globalLiveInterval)) {
313
+			$globalLiveInterval = '200';
314
+		}
300 315
 		if ($globalDBdriver == 'mysql') {
301 316
 			//$query  = 'SELECT COUNT(*) as nb FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= l.date GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate'.$filter_query;
302 317
 			$query = 'SELECT COUNT(DISTINCT spotter_live.flightaware_id) as nb FROM spotter_live'.$filter_query.' DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= date';
@@ -326,7 +341,9 @@  discard block
 block discarded – undo
326 341
 	{
327 342
 		global $globalDBdriver, $globalLiveInterval;
328 343
 		$Spotter = new Spotter($this->db);
329
-		if (!isset($globalLiveInterval)) $globalLiveInterval = '200';
344
+		if (!isset($globalLiveInterval)) {
345
+			$globalLiveInterval = '200';
346
+		}
330 347
 		$filter_query = $this->getFilter($filter);
331 348
 
332 349
 		if (is_array($coord)) {
@@ -334,7 +351,9 @@  discard block
 block discarded – undo
334 351
 			$minlat = filter_var($coord[1],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
335 352
 			$maxlong = filter_var($coord[2],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
336 353
 			$maxlat = filter_var($coord[3],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
337
-		} else return array();
354
+		} else {
355
+			return array();
356
+		}
338 357
 		if ($globalDBdriver == 'mysql') {
339 358
 			$query  = 'SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= l.date GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate AND spotter_live.latitude BETWEEN '.$minlat.' AND '.$maxlat.' AND spotter_live.longitude BETWEEN '.$minlong.' AND '.$maxlong.' GROUP BY spotter_live.flightaware_id'.$filter_query;
340 359
 		} else {
@@ -355,7 +374,9 @@  discard block
 block discarded – undo
355 374
 	{
356 375
 		global $globalDBdriver, $globalLiveInterval, $globalArchive;
357 376
 		$Spotter = new Spotter($this->db);
358
-		if (!isset($globalLiveInterval)) $globalLiveInterval = '200';
377
+		if (!isset($globalLiveInterval)) {
378
+			$globalLiveInterval = '200';
379
+		}
359 380
 		$filter_query = $this->getFilter($filter,true,true);
360 381
 
361 382
 		if (is_array($coord)) {
@@ -363,7 +384,9 @@  discard block
 block discarded – undo
363 384
 			$minlat = filter_var($coord[1],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
364 385
 			$maxlong = filter_var($coord[2],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
365 386
 			$maxlat = filter_var($coord[3],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
366
-		} else return array();
387
+		} else {
388
+			return array();
389
+		}
367 390
 		if ($globalDBdriver == 'mysql') {
368 391
 			if (isset($globalArchive) && $globalArchive === TRUE) {
369 392
 				$query  = 'SELECT spotter_live.ident, spotter_live.flightaware_id, spotter_live.aircraft_icao, spotter_live.departure_airport_icao as departure_airport, spotter_live.arrival_airport_icao as arrival_airport, spotter_live.latitude, spotter_live.longitude, spotter_live.altitude, spotter_live.heading, spotter_live.ground_speed, spotter_live.squawk, spotter_live.date, spotter_live.format_source 
@@ -593,11 +616,15 @@  discard block
 block discarded – undo
593 616
 		//$query  = self::$global_query.' WHERE spotter_live.flightaware_id = :id ORDER BY date';
594 617
 		if ($globalDBdriver == 'mysql') {
595 618
 			$query = 'SELECT spotter_live.* FROM spotter_live WHERE spotter_live.flightaware_id = :id';
596
-			if ($liveinterval) $query .= ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= date';
619
+			if ($liveinterval) {
620
+				$query .= ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= date';
621
+			}
597 622
 			$query .= ' ORDER BY date';
598 623
 		} else {
599 624
 			$query = 'SELECT spotter_live.* FROM spotter_live WHERE spotter_live.flightaware_id = :id';
600
-			if ($liveinterval) $query .= " AND CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$globalLiveInterval." SECONDS' <= date";
625
+			if ($liveinterval) {
626
+				$query .= " AND CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$globalLiveInterval." SECONDS' <= date";
627
+			}
601 628
 			$query .= ' ORDER BY date';
602 629
 		}
603 630
 
@@ -692,7 +719,9 @@  discard block
 block discarded – undo
692 719
 				$i++;
693 720
 				$j++;
694 721
 				if ($j == 30) {
695
-					if ($globalDebug) echo ".";
722
+					if ($globalDebug) {
723
+						echo ".";
724
+					}
696 725
 				    	try {
697 726
 						
698 727
 						$sth = $this->db->prepare(substr($query_delete,0,-1).")");
@@ -999,7 +1028,9 @@  discard block
 block discarded – undo
999 1028
 			{
1000 1029
 				return false;
1001 1030
 			}
1002
-		} else return '';
1031
+		} else {
1032
+			return '';
1033
+		}
1003 1034
 
1004 1035
 		if ($longitude != '')
1005 1036
 		{
@@ -1007,7 +1038,9 @@  discard block
 block discarded – undo
1007 1038
 			{
1008 1039
 				return false;
1009 1040
 			}
1010
-		} else return '';
1041
+		} else {
1042
+			return '';
1043
+		}
1011 1044
 
1012 1045
 		if ($waypoints != '')
1013 1046
 		{
@@ -1023,14 +1056,18 @@  discard block
 block discarded – undo
1023 1056
 			{
1024 1057
 				return false;
1025 1058
 			}
1026
-		} else $altitude = 0;
1059
+		} else {
1060
+			$altitude = 0;
1061
+		}
1027 1062
 		if ($altitude_real != '')
1028 1063
 		{
1029 1064
 			if (!is_numeric($altitude_real))
1030 1065
 			{
1031 1066
 				return false;
1032 1067
 			}
1033
-		} else $altitude_real = 0;
1068
+		} else {
1069
+			$altitude_real = 0;
1070
+		}
1034 1071
 
1035 1072
 		if ($heading != '')
1036 1073
 		{
@@ -1038,7 +1075,9 @@  discard block
 block discarded – undo
1038 1075
 			{
1039 1076
 				return false;
1040 1077
 			}
1041
-		} else $heading = 0;
1078
+		} else {
1079
+			$heading = 0;
1080
+		}
1042 1081
 
1043 1082
 		if ($groundspeed != '')
1044 1083
 		{
@@ -1046,9 +1085,13 @@  discard block
 block discarded – undo
1046 1085
 			{
1047 1086
 				return false;
1048 1087
 			}
1049
-		} else $groundspeed = 0;
1088
+		} else {
1089
+			$groundspeed = 0;
1090
+		}
1050 1091
 		date_default_timezone_set('UTC');
1051
-		if ($date == '') $date = date("Y-m-d H:i:s", time());
1092
+		if ($date == '') {
1093
+			$date = date("Y-m-d H:i:s", time());
1094
+		}
1052 1095
 
1053 1096
         
1054 1097
 		$flightaware_id = filter_var($flightaware_id,FILTER_SANITIZE_STRING);
@@ -1093,14 +1136,24 @@  discard block
 block discarded – undo
1093 1136
 		$arrival_airport_country = '';
1094 1137
 		
1095 1138
             	
1096
-            	if ($squawk == '' || $Common->isInteger($squawk) === false ) $squawk = NULL;
1097
-            	if ($verticalrate == '' || $Common->isInteger($verticalrate) === false ) $verticalrate = NULL;
1098
-            	if ($groundspeed == '' || $Common->isInteger($groundspeed) === false ) $groundspeed = 0;
1099
-            	if ($heading == '' || $Common->isInteger($heading) === false ) $heading = 0;
1139
+            	if ($squawk == '' || $Common->isInteger($squawk) === false ) {
1140
+            		$squawk = NULL;
1141
+            	}
1142
+            	if ($verticalrate == '' || $Common->isInteger($verticalrate) === false ) {
1143
+            		$verticalrate = NULL;
1144
+            	}
1145
+            	if ($groundspeed == '' || $Common->isInteger($groundspeed) === false ) {
1146
+            		$groundspeed = 0;
1147
+            	}
1148
+            	if ($heading == '' || $Common->isInteger($heading) === false ) {
1149
+            		$heading = 0;
1150
+            	}
1100 1151
 		
1101 1152
 		$query = '';
1102 1153
 		if ($globalArchive) {
1103
-			if ($globalDebug) echo '-- Delete previous data -- ';
1154
+			if ($globalDebug) {
1155
+				echo '-- Delete previous data -- ';
1156
+			}
1104 1157
 			$query .= 'DELETE FROM spotter_live WHERE flightaware_id = :flightaware_id;';
1105 1158
 		}
1106 1159
 
@@ -1117,10 +1170,14 @@  discard block
 block discarded – undo
1117 1170
 			return "error : ".$e->getMessage();
1118 1171
 		}
1119 1172
 		if (isset($globalArchive) && $globalArchive && $putinarchive && $noarchive !== true) {
1120
-		    if ($globalDebug) echo '(Add to SBS archive : ';
1173
+		    if ($globalDebug) {
1174
+		    	echo '(Add to SBS archive : ';
1175
+		    }
1121 1176
 		    $SpotterArchive = new SpotterArchive($this->db);
1122 1177
 		    $result =  $SpotterArchive->addSpotterArchiveData($flightaware_id, $ident, $registration, $airline_name, $airline_icao, $airline_country, $airline_type, $aircraft_icao, $aircraft_shadow, $aircraft_name, $aircraft_manufacturer, $departure_airport_icao, $departure_airport_name, $departure_airport_city, $departure_airport_country, $departure_airport_time,$arrival_airport_icao, $arrival_airport_name, $arrival_airport_city, $arrival_airport_country, $arrival_airport_time, $route_stop, $date,$latitude, $longitude, $waypoints, $altitude, $altitude_real,$heading, $groundspeed, $squawk, $ModeS, $pilot_id, $pilot_name,$verticalrate,$format_source,$source_name, $over_country);
1123
-		    if ($globalDebug) echo $result.')';
1178
+		    if ($globalDebug) {
1179
+		    	echo $result.')';
1180
+		    }
1124 1181
 		} elseif ($globalDebug && $putinarchive !== true) {
1125 1182
 			echo '(Not adding to archive)';
1126 1183
 		} elseif ($globalDebug && $noarchive === true) {
Please login to merge, or discard this patch.
js/map.2d.js.php 1 patch
Braces   +95 added lines, -25 removed lines patch added patch discarded remove patch
@@ -4,10 +4,15 @@  discard block
 block discarded – undo
4 4
 
5 5
 setcookie("MapFormat",'2d');
6 6
 
7
-if (!isset($globalOpenWeatherMapKey)) $globalOpenWeatherMapKey = '';
7
+if (!isset($globalOpenWeatherMapKey)) {
8
+	$globalOpenWeatherMapKey = '';
9
+}
8 10
 // Compressed GeoJson is used if true
9
-if (!isset($globalJsonCompress)) $compress = true;
10
-else $compress = $globalJsonCompress;
11
+if (!isset($globalJsonCompress)) {
12
+	$compress = true;
13
+} else {
14
+	$compress = $globalJsonCompress;
15
+}
11 16
 if (isset($_GET['archive'])) {
12 17
 	$archive = true;
13 18
 	//$archiveupdatetime = 50;
@@ -18,8 +23,11 @@  discard block
 block discarded – undo
18 23
 	//$lastupd = round(($_GET['enddate']-$_GET['begindate'])/(($_GET['during']*60)/10));
19 24
 	//$lastupd = 20;
20 25
 	$lastupd = $_GET['archivespeed']*$archiveupdatetime;
21
-	if (isset($_GET['enddate']) && $_GET['enddate'] != '') $enddate = $_GET['enddate'];
22
-	else $enddate = time();
26
+	if (isset($_GET['enddate']) && $_GET['enddate'] != '') {
27
+		$enddate = $_GET['enddate'];
28
+	} else {
29
+		$enddate = time();
30
+	}
23 31
 	setcookie("archive_begin",$begindate);
24 32
 	setcookie("archive_end",$enddate);
25 33
 	setcookie("archive_update",$lastupd);
@@ -106,7 +114,17 @@  discard block
 block discarded – undo
106 114
 	}
107 115
 
108 116
 	//create the map
109
-	map = L.map('archive-map', { zoomControl:false }).setView([<?php if (isset($latitude)) print $latitude; else print $globalCenterLatitude; ?>,<?php if (isset($longitude)) print $longitude; else print $globalCenterLongitude; ?>], zoom);
117
+	map = L.map('archive-map', { zoomControl:false }).setView([<?php if (isset($latitude)) {
118
+	print $latitude;
119
+} else {
120
+	print $globalCenterLatitude;
121
+}
122
+?>,<?php if (isset($longitude)) {
123
+	print $longitude;
124
+} else {
125
+	print $globalCenterLongitude;
126
+}
127
+?>], zoom);
110 128
 <?php
111 129
 	} else {
112 130
 ?>
@@ -119,9 +137,19 @@  discard block
 block discarded – undo
119 137
 	     || navigator.userAgent.match(/BlackBerry/i)
120 138
 	     || navigator.userAgent.match(/Windows Phone/i))
121 139
 	{
122
-		var zoom = <?php if (isset($globalLiveZoom)) print $globalLiveZoom-1; else print '8'; ?>;
140
+		var zoom = <?php if (isset($globalLiveZoom)) {
141
+	print $globalLiveZoom-1;
142
+} else {
143
+	print '8';
144
+}
145
+?>;
123 146
 	} else {
124
-		var zoom = <?php if (isset($globalLiveZoom)) print $globalLiveZoom; else print '9'; ?>;
147
+		var zoom = <?php if (isset($globalLiveZoom)) {
148
+	print $globalLiveZoom;
149
+} else {
150
+	print '9';
151
+}
152
+?>;
125 153
 	}
126 154
 
127 155
 	//create the map
@@ -146,16 +174,27 @@  discard block
 block discarded – undo
146 174
 	bounds = L.latLngBounds(southWest,northEast);
147 175
 	//a few title layers
148 176
 <?php
149
-	if (isset($_COOKIE['MapType'])) $MapType = $_COOKIE['MapType'];
150
-	else $MapType = $globalMapProvider;
177
+	if (isset($_COOKIE['MapType'])) {
178
+		$MapType = $_COOKIE['MapType'];
179
+	} else {
180
+		$MapType = $globalMapProvider;
181
+	}
151 182
 
152 183
 	if ($MapType == 'Mapbox') {
153
-		if ($_COOKIE['MapTypeId'] == 'default') $MapBoxId = $globalMapboxId;
154
-		else $MapBoxId = $_COOKIE['MapTypeId'];
155
-?>
184
+		if ($_COOKIE['MapTypeId'] == 'default') {
185
+			$MapBoxId = $globalMapboxId;
186
+		} else {
187
+			$MapBoxId = $_COOKIE['MapTypeId'];
188
+		}
189
+		?>
156 190
 	L.tileLayer('https://{s}.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={token}', {
157 191
 	    maxZoom: 18,
158
-	    noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) print 'false'; else print 'true'; ?>,
192
+	    noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) {
193
+	print 'false';
194
+} else {
195
+	print 'true';
196
+}
197
+?>,
159 198
 	    attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' +
160 199
 	      '<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
161 200
 	      'Imagery © <a href="http://mapbox.com">Mapbox</a>',
@@ -167,7 +206,12 @@  discard block
 block discarded – undo
167 206
 ?>
168 207
 	L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
169 208
 	    maxZoom: 18,
170
-	    noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) print 'false'; else print 'true'; ?>,
209
+	    noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) {
210
+	print 'false';
211
+} else {
212
+	print 'true';
213
+}
214
+?>,
171 215
 	    attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' +
172 216
 	      '<a href="www.openstreetmap.org/copyright">Open Database Licence</a>'
173 217
 	}).addTo(map);
@@ -213,20 +257,26 @@  discard block
 block discarded – undo
213 257
 	map.addLayer(yandexLayer);
214 258
 <?php
215 259
 	} elseif ($MapType == 'Bing-Aerial') {
216
-		if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap');
217
-?>
260
+		if (!isset($globalBingMapKey) || $globalBingMapKey == '') {
261
+			setcookie('MapType','OpenStreetMap');
262
+		}
263
+		?>
218 264
 	var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'Aerial'});
219 265
 	map.addLayer(bingLayer);
220 266
 <?php
221 267
 	} elseif ($MapType == 'Bing-Hybrid') {
222
-		if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap');
223
-?>
268
+		if (!isset($globalBingMapKey) || $globalBingMapKey == '') {
269
+			setcookie('MapType','OpenStreetMap');
270
+		}
271
+		?>
224 272
 	var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'AerialWithLabels'});
225 273
 	map.addLayer(bingLayer);
226 274
 <?php
227 275
 	} elseif ($MapType == 'Bing-Road') {
228
-		if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap');
229
-?>
276
+		if (!isset($globalBingMapKey) || $globalBingMapKey == '') {
277
+			setcookie('MapType','OpenStreetMap');
278
+		}
279
+		?>
230 280
 	var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'Road'});
231 281
 	map.addLayer(bingLayer);
232 282
 <?php
@@ -249,9 +299,24 @@  discard block
 block discarded – undo
249 299
 		$customid = $MapType;
250 300
 ?>
251 301
 	L.tileLayer('<?php print $globalMapCustomLayer[$customid]['url']; ?>/{z}/{x}/{y}.png', {
252
-	    maxZoom: <?php if (isset($globalMapCustomLayer[$customid]['maxZoom'])) print $globalMapCustomLayer[$customid]['maxZoom']; else print '18'; ?>,
253
-	    minZoom: <?php if (isset($globalMapCustomLayer[$customid]['minZoom'])) print $globalMapCustomLayer[$customid]['minZoom']; else print '0'; ?>,
254
-	    noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) print 'false'; else print 'true'; ?>,
302
+	    maxZoom: <?php if (isset($globalMapCustomLayer[$customid]['maxZoom'])) {
303
+	print $globalMapCustomLayer[$customid]['maxZoom'];
304
+} else {
305
+	print '18';
306
+}
307
+?>,
308
+	    minZoom: <?php if (isset($globalMapCustomLayer[$customid]['minZoom'])) {
309
+	print $globalMapCustomLayer[$customid]['minZoom'];
310
+} else {
311
+	print '0';
312
+}
313
+?>,
314
+	    noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) {
315
+	print 'false';
316
+} else {
317
+	print 'true';
318
+}
319
+?>,
255 320
 	    attribution: '<?php print $globalMapCustomLayer[$customid]['attribution']; ?>'
256 321
 	}).addTo(map);
257 322
 
@@ -285,7 +350,12 @@  discard block
 block discarded – undo
285 350
 		}
286 351
 	} elseif ($globalBounding == 'circle') {
287 352
 ?>
288
-	var circle = L.circle([<?php print $globalCenterLatitude; ?>, <?php print $globalCenterLongitude; ?>],<?php if (isset($globalBoundingCircleSize)) print $globalBoundingCircleSize; else print '70000'; ?>,{
353
+	var circle = L.circle([<?php print $globalCenterLatitude; ?>, <?php print $globalCenterLongitude; ?>],<?php if (isset($globalBoundingCircleSize)) {
354
+	print $globalBoundingCircleSize;
355
+} else {
356
+	print '70000';
357
+}
358
+?>,{
289 359
 	    color: '#92C7D1',
290 360
 	    fillColor: '#92C7D1',
291 361
 	    fillOpacity: 0.3,
Please login to merge, or discard this patch.
search.php 1 patch
Braces   +128 added lines, -35 removed lines patch added patch discarded remove patch
@@ -30,8 +30,12 @@  discard block
 block discarded – undo
30 30
 		//$end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date']." 00:00:00";
31 31
 		$end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".date("Y-m-d",strtotime($_GET['end_date']))." 00:00:00";
32 32
 		$sql_date = $end_date;
33
-	} else $sql_date = '';
34
-} else $sql_date = '';
33
+	} else {
34
+		$sql_date = '';
35
+	}
36
+	} else {
37
+	$sql_date = '';
38
+}
35 39
 
36 40
 if (isset($_GET['highest_altitude'])) {
37 41
 	//for altitude manipulation
@@ -45,8 +49,12 @@  discard block
 block discarded – undo
45 49
 	} else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){
46 50
 		$start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT).",60000";
47 51
 		$sql_altitude = $start_altitude;
48
-	} else $sql_altitude = '';
49
-} else $sql_altitude = '';
52
+	} else {
53
+		$sql_altitude = '';
54
+	}
55
+	} else {
56
+	$sql_altitude = '';
57
+}
50 58
 
51 59
 //calculuation for the pagination
52 60
 if(!isset($_GET['limit']))
@@ -64,7 +72,7 @@  discard block
 block discarded – undo
64 72
 		$limit_end = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
65 73
 		$absolute_difference = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
66 74
 	}
67
-}  else {
75
+} else {
68 76
 	$limit_explode = explode(",", $_GET['limit']);
69 77
 	$limit_start = filter_var($limit_explode[0],FILTER_SANITIZE_NUMBER_INT);
70 78
 	$limit_end = filter_var($limit_explode[1],FILTER_SANITIZE_NUMBER_INT);
@@ -97,10 +105,15 @@  discard block
 block discarded – undo
97 105
 	$origlon = filter_input(INPUT_GET,'origlon',FILTER_SANITIZE_STRING);
98 106
 	$dist = filter_input(INPUT_GET,'dist',FILTER_SANITIZE_NUMBER_INT);
99 107
 	if ($dist != '') {
100
-		if (isset($globalDistanceUnit) && $globalDistanceUnit == 'mi') $dist = $dist*1.60934;
101
-		elseif (isset($globalDistanceUnit) && $globalDistanceUnit == 'nm') $dist = $dist*1.852;
108
+		if (isset($globalDistanceUnit) && $globalDistanceUnit == 'mi') {
109
+			$dist = $dist*1.60934;
110
+		} elseif (isset($globalDistanceUnit) && $globalDistanceUnit == 'nm') {
111
+			$dist = $dist*1.852;
112
+		}
113
+	}
114
+	if (!isset($sql_date)) {
115
+		$sql_date = '';
102 116
 	}
103
-	if (!isset($sql_date)) $sql_date = '';
104 117
 	if ($archive == 1) {
105 118
 		$SpotterArchive = new SpotterArchive();
106 119
 		$spotter_array = $SpotterArchive->searchSpotterData($q,$registration,$aircraft,strtolower(str_replace("-", " ", $manufacturer)),$highlights,$airline,$airline_country,$airline_type,$airport,$airport_country,$callsign,$departure_airport_route,$arrival_airport_route,$owner,$pilot_id,$pilot_name,$sql_altitude,$sql_date,$limit_start.",".$absolute_difference,$sort,'',$origlat,$origlon,$dist);
@@ -168,7 +181,10 @@  discard block
 block discarded – undo
168 181
 		if (isset($_GET['aircraft']) && $_GET['aircraft'] != ""){ print _("Aircraft:").' <span>'.$aircraft.'</span> '; }
169 182
 		if (isset($_GET['manufacturer']) && $_GET['manufacturer'] != ""){ print _("Manufacturer:").' <span>'.$manufacturer.'</span> '; }
170 183
 		if (isset($_GET['registration']) && $_GET['registration'] != ""){ print _("Registration:").' <span>'.$registration.'</span> '; }
171
-		if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true"){ print _("Highlights:").' <span>'.$highlights.'</span> '; }
184
+		if (isset($_GET['highlights'])) {
185
+			if ($_GET['highlights'] == "true"){ print _("Highlights:").' <span>'.$highlights.'</span> ';
186
+		}
187
+		}
172 188
 		if (isset($_GET['airline']) && $_GET['airline'] != ""){ print _("Airline:").' <span>'.$airline.'</span> '; }
173 189
 		if (isset($_GET['airline_country']) && $_GET['airline_country'] != ""){ print _("Airline country:").' <span>'.$airline_country.'</span> '; }
174 190
 		if (isset($_GET['airline_type']) && $_GET['airline_type'] != ""){ print _("Airline type:").' <span>'.$airline_type.'</span> '; }
@@ -279,7 +295,10 @@  discard block
 block discarded – undo
279 295
 			<div class="form-group">
280 296
 				<label class="control-label col-sm-2"><?php echo _("Keywords"); ?></label>
281 297
 				<div class="col-sm-10">
282
-					<input type="text" class="form-control" id="q" name="q" value="<?php if (isset($_GET['q'])) print $q; ?>" size="10" placeholder="<?php echo _("Keywords"); ?>" />
298
+					<input type="text" class="form-control" id="q" name="q" value="<?php if (isset($_GET['q'])) {
299
+	print $q;
300
+}
301
+?>" size="10" placeholder="<?php echo _("Keywords"); ?>" />
283 302
 				</div>
284 303
 			</div>
285 304
 		</fieldset>
@@ -294,7 +313,10 @@  discard block
 block discarded – undo
294 313
 					    </select>
295 314
 					</div>
296 315
 				</div>
297
-				<script type="text/javascript">getSelect('manufacturer','<?php if(isset($_GET['manufacturer'])) print $manufacturer; ?>')</script>
316
+				<script type="text/javascript">getSelect('manufacturer','<?php if(isset($_GET['manufacturer'])) {
317
+	print $manufacturer;
318
+}
319
+?>')</script>
298 320
 				<div class="form-group">
299 321
 					<label class="control-label col-sm-2"><?php echo _("Type"); ?></label>
300 322
 						<div class="col-sm-10">
@@ -303,11 +325,17 @@  discard block
 block discarded – undo
303 325
 							</select>
304 326
 						</div>
305 327
 				</div>
306
-				<script type="text/javascript">getSelect('aircrafttypes','<?php if(isset($_GET['aircraft_icao'])) print $aircraft_icao; ?>');</script>
328
+				<script type="text/javascript">getSelect('aircrafttypes','<?php if(isset($_GET['aircraft_icao'])) {
329
+	print $aircraft_icao;
330
+}
331
+?>');</script>
307 332
 				<div class="form-group">
308 333
 					<label class="control-label col-sm-2"><?php echo _("Registration"); ?></label> 
309 334
 					<div class="col-sm-10">
310
-						<input type="text" class="form-control" name="registration" value="<?php if (isset($_GET['registration'])) print $registration; ?>" size="8" placeholder="<?php echo _("Registration"); ?>" />
335
+						<input type="text" class="form-control" name="registration" value="<?php if (isset($_GET['registration'])) {
336
+	print $registration;
337
+}
338
+?>" size="8" placeholder="<?php echo _("Registration"); ?>" />
311 339
 					</div>
312 340
 				</div>
313 341
 <?php
@@ -316,22 +344,31 @@  discard block
 block discarded – undo
316 344
 				<div class="form-group">
317 345
 					<label class="control-label col-sm-2"><?php echo _("Pilot id"); ?></label> 
318 346
 					<div class="col-sm-10">
319
-						<input type="text" class="form-control" name="pilot_id" value="<?php if (isset($_GET['pilot_id'])) print $pilot_id; ?>" size="15" placeholder="<?php echo _("Pilot id"); ?>" />
347
+						<input type="text" class="form-control" name="pilot_id" value="<?php if (isset($_GET['pilot_id'])) {
348
+	print $pilot_id;
349
+}
350
+?>" size="15" placeholder="<?php echo _("Pilot id"); ?>" />
320 351
 					</div>
321 352
 				</div>
322 353
 				<div class="form-group">
323 354
 					<label class="control-label col-sm-2"><?php echo _("Pilot name"); ?></label> 
324 355
 					<div class="col-sm-10">
325
-						<input type="text" class="form-control" name="pilot_name" value="<?php if (isset($_GET['pilot_name'])) print $pilot_name; ?>" size="15" placeholder="<?php echo _("Pilot name"); ?>" />
356
+						<input type="text" class="form-control" name="pilot_name" value="<?php if (isset($_GET['pilot_name'])) {
357
+	print $pilot_name;
358
+}
359
+?>" size="15" placeholder="<?php echo _("Pilot name"); ?>" />
326 360
 					</div>
327 361
 				</div>
328 362
 <?php
329
-}else {
363
+} else {
330 364
 ?>
331 365
 				<div class="form-group">
332 366
 					<label class="control-label col-sm-2"><?php echo _("Owner name"); ?></label> 
333 367
 					<div class="col-sm-10">
334
-						<input type="text" class="form-control" name="owner" value="<?php if (isset($_GET['owner'])) print $owner; ?>" size="15" placeholder="<?php echo _("Owner name"); ?>" />
368
+						<input type="text" class="form-control" name="owner" value="<?php if (isset($_GET['owner'])) {
369
+	print $owner;
370
+}
371
+?>" size="15" placeholder="<?php echo _("Owner name"); ?>" />
335 372
 					</div>
336 373
 				</div>
337 374
 <?php
@@ -339,8 +376,14 @@  discard block
 block discarded – undo
339 376
 ?>
340 377
 				<div class="form-group">
341 378
 					<div class="col-sm-offset-2 col-sm-10">
342
-					<!--<div><input type="checkbox" class="form-control" name="highlights" value="true" id="highlights" <?php if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true"){ print 'checked="checked"'; } ?>> <label for="highlights"><?php echo _("Include only aircrafts with special highlights (unique liveries, destinations etc.)"); ?></label></div>-->
343
-					<label class="checkbox-inline"><input type="checkbox" name="highlights" value="true" id="highlights" <?php if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true"){ print 'checked="checked"'; } ?>> <?php echo _("Include only aircrafts with special highlights (unique liveries, destinations etc.)"); ?></label>
379
+					<!--<div><input type="checkbox" class="form-control" name="highlights" value="true" id="highlights" <?php if (isset($_GET['highlights'])) {
380
+	if ($_GET['highlights'] == "true"){ print 'checked="checked"';
381
+}
382
+} ?>> <label for="highlights"><?php echo _("Include only aircrafts with special highlights (unique liveries, destinations etc.)"); ?></label></div>-->
383
+					<label class="checkbox-inline"><input type="checkbox" name="highlights" value="true" id="highlights" <?php if (isset($_GET['highlights'])) {
384
+	if ($_GET['highlights'] == "true"){ print 'checked="checked"';
385
+}
386
+} ?>> <?php echo _("Include only aircrafts with special highlights (unique liveries, destinations etc.)"); ?></label>
344 387
 					</div>
345 388
 				</div>
346 389
 			</fieldset>
@@ -354,7 +397,10 @@  discard block
 block discarded – undo
354 397
 						</select>
355 398
 					</div>
356 399
 				</div>
357
-				<script type="text/javascript">getSelect('airlinenames','<?php if(isset($_GET['airline'])) print $airline; ?>');</script>
400
+				<script type="text/javascript">getSelect('airlinenames','<?php if(isset($_GET['airline'])) {
401
+	print $airline;
402
+}
403
+?>');</script>
358 404
 				<div class="form-group">
359 405
 					<label class="control-label col-sm-2"><?php echo _("Country"); ?></label> 
360 406
 					<div class="col-sm-10">
@@ -363,19 +409,34 @@  discard block
 block discarded – undo
363 409
 						</select>
364 410
 					</div>
365 411
 				</div>
366
-				<script type="text/javascript">getSelect('airlinecountries','<?php if(isset($_GET['airline_country'])) print $airline_country; ?>');</script>
412
+				<script type="text/javascript">getSelect('airlinecountries','<?php if(isset($_GET['airline_country'])) {
413
+	print $airline_country;
414
+}
415
+?>');</script>
367 416
 				<div class="form-group">
368 417
 					<label class="control-label col-sm-2"><?php echo _("Callsign"); ?></label> 
369 418
 					<div class="col-sm-10">
370
-						<input type="text" name="callsign" class="form-control" value="<?php if (isset($_GET['callsign'])) print $callsign; ?>" size="8" placeholder="<?php echo _("Callsign"); ?>" />
419
+						<input type="text" name="callsign" class="form-control" value="<?php if (isset($_GET['callsign'])) {
420
+	print $callsign;
421
+}
422
+?>" size="8" placeholder="<?php echo _("Callsign"); ?>" />
371 423
 					</div>
372 424
 				</div>
373 425
 				<div class="form-group">
374 426
 					<div class="col-sm-offset-2 col-sm-10">
375 427
 						<label class="radio-inline"><input type="radio" name="airline_type" value="all" id="airline_type_all" <?php if (!isset($_GET['airline_type']) || $_GET['airline_type'] == "all"){ print 'checked="checked"'; } ?>> <?php echo _("All airlines types"); ?></label>
376
-						<label class="radio-inline"><input type="radio" name="airline_type" value="passenger" id="airline_type_passenger" <?php if (isset($_GET['airline_type'])) if ($_GET['airline_type'] == "passenger"){ print 'checked="checked"'; } ?>> <?php echo _("Only Passenger airlines"); ?></label>
377
-						<label class="radio-inline"><input type="radio" name="airline_type" value="cargo" id="airline_type_cargo" <?php if (isset($_GET['airline_type'])) if ( $_GET['airline_type'] == "cargo"){ print 'checked="checked"'; } ?>> <?php echo _("Only Cargo airlines"); ?></label>
378
-						<label class="radio-inline"><input type="radio" name="airline_type" value="military" id="airline_type_military" <?php if (isset($_GET['airline_type'])) if ( $_GET['airline_type'] == "military"){ print 'checked="checked"'; } ?>> <?php echo _("Only Military airlines"); ?></label>
428
+						<label class="radio-inline"><input type="radio" name="airline_type" value="passenger" id="airline_type_passenger" <?php if (isset($_GET['airline_type'])) {
429
+	if ($_GET['airline_type'] == "passenger"){ print 'checked="checked"';
430
+}
431
+} ?>> <?php echo _("Only Passenger airlines"); ?></label>
432
+						<label class="radio-inline"><input type="radio" name="airline_type" value="cargo" id="airline_type_cargo" <?php if (isset($_GET['airline_type'])) {
433
+	if ( $_GET['airline_type'] == "cargo"){ print 'checked="checked"';
434
+}
435
+} ?>> <?php echo _("Only Cargo airlines"); ?></label>
436
+						<label class="radio-inline"><input type="radio" name="airline_type" value="military" id="airline_type_military" <?php if (isset($_GET['airline_type'])) {
437
+	if ( $_GET['airline_type'] == "military"){ print 'checked="checked"';
438
+}
439
+} ?>> <?php echo _("Only Military airlines"); ?></label>
379 440
 					</div>
380 441
 				</div>
381 442
 			</fieldset>
@@ -389,7 +450,10 @@  discard block
 block discarded – undo
389 450
 						</select>
390 451
 					</div>
391 452
 				</div>
392
-				<script type="text/javascript">getSelect('airportnames','<?php if(isset($_GET['airport_icao'])) print $airport_icao; ?>');</script>
453
+				<script type="text/javascript">getSelect('airportnames','<?php if(isset($_GET['airport_icao'])) {
454
+	print $airport_icao;
455
+}
456
+?>');</script>
393 457
 				<div class="form-group">
394 458
 					<label class="control-label col-sm-2"><?php echo _("Country"); ?></label> 
395 459
 					<div class="col-sm-10">
@@ -398,7 +462,10 @@  discard block
 block discarded – undo
398 462
 						</select>
399 463
 					</div>
400 464
 				</div>
401
-				<script type="text/javascript">getSelect('airportcountries','<?php if(isset($_GET['airport_country'])) print $airport_country; ?>');</script>
465
+				<script type="text/javascript">getSelect('airportcountries','<?php if(isset($_GET['airport_country'])) {
466
+	print $airport_country;
467
+}
468
+?>');</script>
402 469
 			</fieldset>
403 470
 			<fieldset>
404 471
 				<legend><?php echo _("Route"); ?></legend>
@@ -410,7 +477,10 @@  discard block
 block discarded – undo
410 477
 						</select>
411 478
 					</div>
412 479
 				</div>
413
-				<script type="text/javascript">getSelect('departureairportnames','<?php if(isset($_GET['departure_airport_route'])) print $departure_airport_route; ?>');</script>
480
+				<script type="text/javascript">getSelect('departureairportnames','<?php if(isset($_GET['departure_airport_route'])) {
481
+	print $departure_airport_route;
482
+}
483
+?>');</script>
414 484
 				<div class="form-group">
415 485
 					<label class="control-label col-sm-2"><?php echo _("Arrival Airport"); ?></label> 
416 486
 					<div class="col-sm-10">
@@ -419,7 +489,10 @@  discard block
 block discarded – undo
419 489
 						</select>
420 490
 					</div>
421 491
 				</div>
422
-				<script type="text/javascript">getSelect('arrivalairportnames','<?php if(isset($_GET['arrival_airport_route'])) print $arrival_airport_route; ?>');</script>
492
+				<script type="text/javascript">getSelect('arrivalairportnames','<?php if(isset($_GET['arrival_airport_route'])) {
493
+	print $arrival_airport_route;
494
+}
495
+?>');</script>
423 496
 			</fieldset>
424 497
 			<fieldset>
425 498
 				<legend><?php echo _("Date"); ?></legend>
@@ -427,7 +500,10 @@  discard block
 block discarded – undo
427 500
 					<label class="control-label col-sm-2"><?php echo _("Start Date"); ?></label>
428 501
 					<div class="col-sm-10">
429 502
 						<div class='input-group date' id='datetimepicker1'>
430
-							<input type='text' name="start_date" class="form-control" value="<?php if (isset($_GET['start_date'])) print $start_date; ?>" placeholder="<?php echo _("Start Date/Time"); ?>" />
503
+							<input type='text' name="start_date" class="form-control" value="<?php if (isset($_GET['start_date'])) {
504
+	print $start_date;
505
+}
506
+?>" placeholder="<?php echo _("Start Date/Time"); ?>" />
431 507
 							<span class="input-group-addon">
432 508
 								<span class="glyphicon glyphicon-calendar"></span>
433 509
 							</span>
@@ -438,7 +514,10 @@  discard block
 block discarded – undo
438 514
 					<label class="control-label col-sm-2"><?php echo _("End Date"); ?></label>
439 515
 					<div class="col-sm-10">
440 516
 						<div class='input-group date' id='datetimepicker2'>
441
-						<input type='text' name="end_date" class="form-control" value="<?php if (isset($_GET['end_date'])) print $end_date; ?>" placeholder="<?php echo _("End Date/Time"); ?>" />
517
+						<input type='text' name="end_date" class="form-control" value="<?php if (isset($_GET['end_date'])) {
518
+	print $end_date;
519
+}
520
+?>" placeholder="<?php echo _("End Date/Time"); ?>" />
442 521
 						<span class="input-group-addon">
443 522
 							<span class="glyphicon glyphicon-calendar"></span>
444 523
 						</span>
@@ -511,19 +590,33 @@  discard block
 block discarded – undo
511 590
 			<div class="form-group">
512 591
 				<label class="control-label col-sm-2"><?php echo _("Latitude"); ?></label>
513 592
 				<div class="col-sm-10">
514
-					<input type="text" name="origlat" class="form-control" placeholder="<?php echo _("Center point latitude"); ?>" value="<?php if (isset($_GET['origlat'])) print $origlat; ?>" />
593
+					<input type="text" name="origlat" class="form-control" placeholder="<?php echo _("Center point latitude"); ?>" value="<?php if (isset($_GET['origlat'])) {
594
+	print $origlat;
595
+}
596
+?>" />
515 597
 				</div>
516 598
 			</div>
517 599
 			<div class="form-group">
518 600
 				<label class="control-label col-sm-2"><?php echo _("Longitude"); ?></label>
519 601
 				<div class="col-sm-10">
520
-					<input type="text" name="origlon" class="form-control" placeholder="<?php echo _("Center point longitude"); ?>" value="<?php if (isset($_GET['origlon'])) print $origlon; ?>" />
602
+					<input type="text" name="origlon" class="form-control" placeholder="<?php echo _("Center point longitude"); ?>" value="<?php if (isset($_GET['origlon'])) {
603
+	print $origlon;
604
+}
605
+?>" />
521 606
 				</div>
522 607
 			</div>
523 608
 			<div class="form-group">
524
-				<label class="control-label col-sm-2"><?php echo _("Distance").' ('; if (isset($globalDistanceUnit)) print $globalDistanceUnit; else print 'km'; print ')'; ?></label>
609
+				<label class="control-label col-sm-2"><?php echo _("Distance").' ('; if (isset($globalDistanceUnit)) {
610
+	print $globalDistanceUnit;
611
+} else {
612
+	print 'km';
613
+}
614
+print ')'; ?></label>
525 615
 				<div class="col-sm-10">
526
-					<input type="text" name="dist" class="form-control" placeholder="<?php echo _("Distance from center point"); ?>" value="<?php if (isset($_GET['distance'])) print $distance; ?>" />
616
+					<input type="text" name="dist" class="form-control" placeholder="<?php echo _("Distance from center point"); ?>" value="<?php if (isset($_GET['distance'])) {
617
+	print $distance;
618
+}
619
+?>" />
527 620
 				</div>
528 621
 			</div>
529 622
 		</fieldset>
Please login to merge, or discard this patch.