Completed
Push — master ( 0ba033...062c39 )
by Yannick
10:34
created
js/map.js.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 require_once('../require/settings.php');
3 3
 require_once('../require/class.Language.php'); 
4 4
 
5
-setcookie("MapFormat",'2d');
5
+setcookie("MapFormat", '2d');
6 6
 //$_COOKIE['MapFormat'] = '2d';
7 7
 
8 8
 // Compressed GeoJson is used if true
@@ -21,10 +21,10 @@  discard block
 block discarded – undo
21 21
 		$lastupd = $_GET['archivespeed']*$archiveupdatetime;
22 22
 		if (isset($_GET['enddate']) && $_GET['enddate'] != '') $enddate = $_GET['enddate'];
23 23
 		else $enddate = time();
24
-		setcookie("archive_begin",$begindate);
25
-		setcookie("archive_end",$enddate);
26
-		setcookie("archive_update",$lastupd);
27
-		setcookie("archive_speed",$archivespeed);
24
+		setcookie("archive_begin", $begindate);
25
+		setcookie("archive_end", $enddate);
26
+		setcookie("archive_update", $lastupd);
27
+		setcookie("archive_speed", $archivespeed);
28 28
 ?>
29 29
 
30 30
 document.cookie =  'archive_begin=<?php print $begindate; ?>; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/';
@@ -95,16 +95,16 @@  discard block
 block discarded – undo
95 95
 <?php
96 96
 	}
97 97
 	if (isset($_GET['ident'])) {
98
-		$ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING);
98
+		$ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING);
99 99
 	}
100 100
 	if (isset($_GET['flightaware_id'])) {
101
-		$flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING);
101
+		$flightaware_id = filter_input(INPUT_GET, 'flightaware_id', FILTER_SANITIZE_STRING);
102 102
 	}
103 103
 	if (isset($_GET['latitude'])) {
104
-		$latitude = filter_input(INPUT_GET,'latitude',FILTER_SANITIZE_STRING);
104
+		$latitude = filter_input(INPUT_GET, 'latitude', FILTER_SANITIZE_STRING);
105 105
 	}
106 106
 	if (isset($_GET['longitude'])) {
107
-		$longitude = filter_input(INPUT_GET,'longitude',FILTER_SANITIZE_STRING);
107
+		$longitude = filter_input(INPUT_GET, 'longitude', FILTER_SANITIZE_STRING);
108 108
 	}
109 109
 ?>
110 110
 
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 	     || navigator.userAgent.match(/BlackBerry/i)
140 140
 	     || navigator.userAgent.match(/Windows Phone/i))
141 141
 	{
142
-		var zoom = <?php if (isset($globalLiveZoom)) print $globalLiveZoom-1; else print '8'; ?>;
142
+		var zoom = <?php if (isset($globalLiveZoom)) print $globalLiveZoom - 1; else print '8'; ?>;
143 143
 	} else {
144 144
 		var zoom = <?php if (isset($globalLiveZoom)) print $globalLiveZoom; else print '9'; ?>;
145 145
 	}
@@ -233,19 +233,19 @@  discard block
 block discarded – undo
233 233
 	map.addLayer(yandexLayer);
234 234
 <?php
235 235
 	} elseif ($MapType == 'Bing-Aerial') {
236
-		if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap');
236
+		if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType', 'OpenStreetMap');
237 237
 ?>
238 238
 	var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'Aerial'});
239 239
 	map.addLayer(bingLayer);
240 240
 <?php
241 241
 	} elseif ($MapType == 'Bing-Hybrid') {
242
-		if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap');
242
+		if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType', 'OpenStreetMap');
243 243
 ?>
244 244
 	var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'AerialWithLabels'});
245 245
 	map.addLayer(bingLayer);
246 246
 <?php
247 247
 	} elseif ($MapType == 'Bing-Road') {
248
-		if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap');
248
+		if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType', 'OpenStreetMap');
249 249
 ?>
250 250
 	var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'Road'});
251 251
 	map.addLayer(bingLayer);
@@ -535,10 +535,10 @@  discard block
 block discarded – undo
535 535
 	};
536 536
 	archive.update = function (props) {
537 537
 		if (typeof props != 'undefined') {
538
-			//this._div.innerHTML = '<h4><?php echo str_replace("'","\'",_("Archive Date & Time")); ?></h4>' +  '<b>' + props.archive_date + ' UTC </b>' + '<br/><i class="fa fa-fast-backward" aria-hidden="true"></i> <i class="fa fa-backward" aria-hidden="true"></i>  <a href="#" onClick="archivePause();"><i class="fa fa-pause" aria-hidden="true"></i></a> <a href="#" onClick="archivePlay();"><i class="fa fa-play" aria-hidden="true"></i></a>  <i class="fa fa-forward" aria-hidden="true"></i> <i class="fa fa-fast-forward" aria-hidden="true"></i>';
539
-			this._div.innerHTML = '<h4><?php echo str_replace("'","\'",_("Archive Date & Time")); ?></h4>' +  '<b>' + props.archive_date + ' UTC </b>' + '<br/><a href="#" onClick="archivePause();"><i class="fa fa-pause" aria-hidden="true"></i></a> <a href="#" onClick="archivePlay();"><i class="fa fa-play" aria-hidden="true"></i></a>';
538
+			//this._div.innerHTML = '<h4><?php echo str_replace("'", "\'", _("Archive Date & Time")); ?></h4>' +  '<b>' + props.archive_date + ' UTC </b>' + '<br/><i class="fa fa-fast-backward" aria-hidden="true"></i> <i class="fa fa-backward" aria-hidden="true"></i>  <a href="#" onClick="archivePause();"><i class="fa fa-pause" aria-hidden="true"></i></a> <a href="#" onClick="archivePlay();"><i class="fa fa-play" aria-hidden="true"></i></a>  <i class="fa fa-forward" aria-hidden="true"></i> <i class="fa fa-fast-forward" aria-hidden="true"></i>';
539
+			this._div.innerHTML = '<h4><?php echo str_replace("'", "\'", _("Archive Date & Time")); ?></h4>' +  '<b>' + props.archive_date + ' UTC </b>' + '<br/><a href="#" onClick="archivePause();"><i class="fa fa-pause" aria-hidden="true"></i></a> <a href="#" onClick="archivePlay();"><i class="fa fa-play" aria-hidden="true"></i></a>';
540 540
 		} else {
541
-			this._div.innerHTML = '<h4><?php echo str_replace("'","\'",_("Archive Date & Time")); ?></h4>' +  '<b><i class="fa fa-spinner fa-pulse fa-2x fa-fw margin-bottom"></i></b>';
541
+			this._div.innerHTML = '<h4><?php echo str_replace("'", "\'", _("Archive Date & Time")); ?></h4>' +  '<b><i class="fa fa-spinner fa-pulse fa-2x fa-fw margin-bottom"></i></b>';
542 542
 		}
543 543
 
544 544
 	};
@@ -738,7 +738,7 @@  discard block
 block discarded – undo
738 738
 <?php
739 739
 		} else {
740 740
 ?>
741
-		    var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000);
741
+		    var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000 + 20000; ?>+feature.properties.sqt*1000);
742 742
 		    return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{
743 743
 <?php
744 744
 		}
@@ -753,7 +753,7 @@  discard block
 block discarded – undo
753 753
 			    iconAnchor: [<?php print $globalAircraftSize/2; ?>, <?php print $globalAircraftSize; ?>],
754 754
 			    shadowUrl: iconURLShadowpath,
755 755
 			    shadowSize: [<?php print $globalAircraftSize; ?>, <?php print $globalAircraftSize; ?>],
756
-			    shadowAnchor: [<?php print ($globalAircraftSize/2)+1; ?>, <?php print $globalAircraftSize; ?>]
756
+			    shadowAnchor: [<?php print ($globalAircraftSize/2) + 1; ?>, <?php print $globalAircraftSize; ?>]
757 757
 			})
758 758
 		    })
759 759
 <?php
@@ -783,7 +783,7 @@  discard block
 block discarded – undo
783 783
 <?php
784 784
 		} else {
785 785
 ?>
786
-			    var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000);
786
+			    var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000 + 20000; ?>+feature.properties.sqt*1000);
787 787
 			    return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{
788 788
 <?php
789 789
 		}
@@ -827,7 +827,7 @@  discard block
 block discarded – undo
827 827
 <?php
828 828
 		} else {
829 829
 ?>
830
-			    var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000);
830
+			    var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000 + 20000; ?>+feature.properties.sqt*1000);
831 831
 			    return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{
832 832
 <?php
833 833
 		}
@@ -1193,7 +1193,7 @@  discard block
 block discarded – undo
1193 1193
 $('.button').tooltip({ placement: 'right' });
1194 1194
 
1195 1195
 <?php
1196
-	if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS) ) {
1196
+	if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) {
1197 1197
 ?>
1198 1198
 update_atcLayer();
1199 1199
 setInterval(function(){map.removeLayer(atcLayer);update_atcLayer()},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>);
@@ -1406,12 +1406,12 @@  discard block
 block discarded – undo
1406 1406
 	    airs.push(air.value);
1407 1407
 	}
1408 1408
     }
1409
-    document.cookie =  'Airlines='+airs.join()+'; expires=<?php print date("D, j M Y G:i:s T",mktime(0, 0, 0, date("m")  , date("d")+1, date("Y"))); ?>; path=/'
1409
+    document.cookie =  'Airlines='+airs.join()+'; expires=<?php print date("D, j M Y G:i:s T", mktime(0, 0, 0, date("m"), date("d") + 1, date("Y"))); ?>; path=/'
1410 1410
 }
1411 1411
 function airlinestype(selectObj) {
1412 1412
     var idx = selectObj.selectedIndex;
1413 1413
     var airtype = selectObj.options[idx].value;
1414
-    document.cookie =  'airlinestype='+airtype+'; expires=<?php print date("D, j M Y G:i:s T",mktime(0, 0, 0, date("m")  , date("d")+1, date("Y"))); ?>; path=/'
1414
+    document.cookie =  'airlinestype='+airtype+'; expires=<?php print date("D, j M Y G:i:s T", mktime(0, 0, 0, date("m"), date("d") + 1, date("Y"))); ?>; path=/'
1415 1415
 }
1416 1416
 function sources(selectObj) {
1417 1417
     var sources = [], source;
@@ -1422,7 +1422,7 @@  discard block
 block discarded – undo
1422 1422
 	}
1423 1423
     }
1424 1424
     //document.cookie =  'Sources='+sources.join()+'; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/'
1425
-    document.cookie =  'Sources='+sources.join()+'; expires=<?php print date("D, j M Y G:i:s T",mktime(0, 0, 0, date("m")  , date("d")+1, date("Y"))); ?>; path=/'
1425
+    document.cookie =  'Sources='+sources.join()+'; expires=<?php print date("D, j M Y G:i:s T", mktime(0, 0, 0, date("m"), date("d") + 1, date("Y"))); ?>; path=/'
1426 1426
 }
1427 1427
 
1428 1428
 function show3D() {
@@ -1445,23 +1445,23 @@  discard block
 block discarded – undo
1445 1445
 
1446 1446
 function clickVATSIM(cb) {
1447 1447
     //document.cookie =  'ShowVATSIM='+cb.checked+'; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/'
1448
-    document.cookie =  'ShowVATSIM='+cb.checked+'; expires=<?php print date("D, j M Y G:i:s T",mktime(0, 0, 0, date("m")  , date("d")+2, date("Y"))); ?>; path=/'
1448
+    document.cookie =  'ShowVATSIM='+cb.checked+'; expires=<?php print date("D, j M Y G:i:s T", mktime(0, 0, 0, date("m"), date("d") + 2, date("Y"))); ?>; path=/'
1449 1449
 }
1450 1450
 function clickIVAO(cb) {
1451 1451
     //document.cookie =  'ShowIVAO='+cb.checked+'; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/'
1452
-    document.cookie =  'ShowIVAO='+cb.checked+'; expires=<?php print date("D, j M Y G:i:s T",mktime(0, 0, 0, date("m")  , date("d")+2, date("Y"))); ?>; path=/'
1452
+    document.cookie =  'ShowIVAO='+cb.checked+'; expires=<?php print date("D, j M Y G:i:s T", mktime(0, 0, 0, date("m"), date("d") + 2, date("Y"))); ?>; path=/'
1453 1453
 }
1454 1454
 function clickphpVMS(cb) {
1455 1455
     //document.cookie =  'ShowVMS='+cb.checked+'; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/'
1456
-    document.cookie =  'ShowVMS='+cb.checked+'; expires=<?php print date("D, j M Y G:i:s T",mktime(0, 0, 0, date("m")  , date("d")+2, date("Y"))); ?>; path=/'
1456
+    document.cookie =  'ShowVMS='+cb.checked+'; expires=<?php print date("D, j M Y G:i:s T", mktime(0, 0, 0, date("m"), date("d") + 2, date("Y"))); ?>; path=/'
1457 1457
 }
1458 1458
 function clickSBS1(cb) {
1459 1459
     //document.cookie =  'ShowSBS1='+cb.checked+'; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/'
1460
-    document.cookie =  'ShowSBS1='+cb.checked+'; expires=<?php print date("D, j M Y G:i:s T",mktime(0, 0, 0, date("m")  , date("d")+2, date("Y"))); ?>; path=/'
1460
+    document.cookie =  'ShowSBS1='+cb.checked+'; expires=<?php print date("D, j M Y G:i:s T", mktime(0, 0, 0, date("m"), date("d") + 2, date("Y"))); ?>; path=/'
1461 1461
 }
1462 1462
 function clickAPRS(cb) {
1463 1463
     //document.cookie =  'ShowAPRS='+cb.checked+'; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/'
1464
-    document.cookie =  'ShowAPRS='+cb.checked+'; expires=<?php print date("D, j M Y G:i:s T",mktime(0, 0, 0, date("m")  , date("d")+2, date("Y"))); ?>; path=/'
1464
+    document.cookie =  'ShowAPRS='+cb.checked+'; expires=<?php print date("D, j M Y G:i:s T", mktime(0, 0, 0, date("m"), date("d") + 2, date("Y"))); ?>; path=/'
1465 1465
 }
1466 1466
 function clickFlightPopup(cb) {
1467 1467
     document.cookie =  'flightpopup='+cb.checked+'; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/'
Please login to merge, or discard this patch.
notam-geojson.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 
11 11
 if (isset($_GET['coord'])) 
12 12
 {
13
-	$coords = explode(',',$_GET['coord']);
13
+	$coords = explode(',', $_GET['coord']);
14 14
 	$spotter_array = $NOTAM->getAllNOTAMbyCoord($coords);
15 15
 //	$spotter_array = $NOTAM->getAllNOTAM();
16 16
 } else {
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
             
22 22
 if (!empty($spotter_array))
23 23
 {	  
24
-	foreach($spotter_array as $spotter_item)
24
+	foreach ($spotter_array as $spotter_item)
25 25
 	{
26 26
 		date_default_timezone_set('UTC');
27 27
 		//waypoint plotting
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 			$output .= '"ref": "'.$spotter_item['ref'].'",';
31 31
 			$output .= '"title": "'.$spotter_item['title'].'",';
32 32
 			$output .= '"fir": "'.$spotter_item['fir'].'",';
33
-			$output .= '"text": "'.str_replace(array("\r\n", "\r", "\n"),'<br />',str_replace(array('"',"\t"), '',$spotter_item['notam_text'])).'",';
33
+			$output .= '"text": "'.str_replace(array("\r\n", "\r", "\n"), '<br />', str_replace(array('"', "\t"), '', $spotter_item['notam_text'])).'",';
34 34
 			$output .= '"latitude": '.$spotter_item['center_latitude'].',';
35 35
 			$output .= '"longitude": '.$spotter_item['center_longitude'].',';
36 36
 			$output .= '"lower_limit": '.$spotter_item['lower_limit'].',';
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 		    $output .= '}';
68 68
 		$output .= '},';
69 69
 	}
70
-	$output  = substr($output, 0, -1);
70
+	$output = substr($output, 0, -1);
71 71
 }
72 72
 $output .= ']}';
73 73
 
Please login to merge, or discard this patch.
require/class.NOTAM.php 2 patches
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -725,7 +725,7 @@  discard block
 block discarded – undo
725 725
 		try {
726 726
 			$sth = $this->db->prepare($query);
727 727
 			$sth->execute($query_values);
728
-		} catch(PDOException $e) {
728
+		} catch (PDOException $e) {
729 729
 			echo "error : ".$e->getMessage();
730 730
 		}
731 731
 		$all = $sth->fetchAll(PDO::FETCH_ASSOC);
@@ -734,10 +734,10 @@  discard block
 block discarded – undo
734 734
 	public function getAllNOTAMbyCoord($coord) {
735 735
 		global $globalDBdriver;
736 736
 		if (is_array($coord)) {
737
-			$minlong = filter_var($coord[0],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
738
-			$minlat = filter_var($coord[1],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
739
-			$maxlong = filter_var($coord[2],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
740
-			$maxlat = filter_var($coord[3],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
737
+			$minlong = filter_var($coord[0], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
738
+			$minlat = filter_var($coord[1], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
739
+			$maxlong = filter_var($coord[2], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
740
+			$maxlat = filter_var($coord[3], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
741 741
 		} else return array();
742 742
 		if ($globalDBdriver == 'mysql') {
743 743
 			$query  = 'SELECT * FROM notam WHERE center_latitude BETWEEN '.$minlat.' AND '.$maxlat.' AND center_longitude BETWEEN '.$minlong.' AND '.$maxlong.' AND radius > 0 AND date_end > UTC_TIMESTAMP() AND date_begin < UTC_TIMESTAMP()';
@@ -749,7 +749,7 @@  discard block
 block discarded – undo
749 749
 		try {
750 750
 			$sth = $this->db->prepare($query);
751 751
 			$sth->execute($query_values);
752
-		} catch(PDOException $e) {
752
+		} catch (PDOException $e) {
753 753
 			echo "error : ".$e->getMessage();
754 754
 		}
755 755
 		$all = $sth->fetchAll(PDO::FETCH_ASSOC);
@@ -761,7 +761,7 @@  discard block
 block discarded – undo
761 761
 		try {
762 762
 			$sth = $this->db->prepare($query);
763 763
 			$sth->execute($query_values);
764
-		} catch(PDOException $e) {
764
+		} catch (PDOException $e) {
765 765
 			return "error : ".$e->getMessage();
766 766
 		}
767 767
 		$all = $sth->fetchAll(PDO::FETCH_ASSOC);
@@ -769,13 +769,13 @@  discard block
 block discarded – undo
769 769
 		else return array();
770 770
 	}
771 771
 
772
-	public function addNOTAM($ref,$title,$type,$fir,$code,$rules,$scope,$lower_limit,$upper_limit,$center_latitude,$center_longitude,$radius,$date_begin,$date_end,$permanent,$text,$full_notam) {
772
+	public function addNOTAM($ref, $title, $type, $fir, $code, $rules, $scope, $lower_limit, $upper_limit, $center_latitude, $center_longitude, $radius, $date_begin, $date_end, $permanent, $text, $full_notam) {
773 773
 		$query = "INSERT INTO notam (ref,title,notam_type,fir,code,rules,scope,lower_limit,upper_limit,center_latitude,center_longitude,radius,date_begin,date_end,permanent,notam_text,full_notam) VALUES (:ref,:title,:type,:fir,:code,:rules,:scope,:lower_limit,:upper_limit,:center_latitude,:center_longitude,:radius,:date_begin,:date_end,:permanent,:text,:full_notam)";
774
-		$query_values = array(':ref' => $ref,':title' => $title,':type' => $type,':fir' => $fir,':code' => $code,':rules' => $rules,':scope' => $scope,':lower_limit' => $lower_limit,':upper_limit' => $upper_limit,':center_latitude' => $center_latitude,':center_longitude' => $center_longitude,':radius' => $radius,':date_begin' => $date_begin,':date_end' => $date_end,':permanent' => $permanent,':text' => $text,':full_notam' => $full_notam);
774
+		$query_values = array(':ref' => $ref, ':title' => $title, ':type' => $type, ':fir' => $fir, ':code' => $code, ':rules' => $rules, ':scope' => $scope, ':lower_limit' => $lower_limit, ':upper_limit' => $upper_limit, ':center_latitude' => $center_latitude, ':center_longitude' => $center_longitude, ':radius' => $radius, ':date_begin' => $date_begin, ':date_end' => $date_end, ':permanent' => $permanent, ':text' => $text, ':full_notam' => $full_notam);
775 775
 		try {
776 776
 			$sth = $this->db->prepare($query);
777 777
 			$sth->execute($query_values);
778
-		} catch(PDOException $e) {
778
+		} catch (PDOException $e) {
779 779
 			return "error : ".$e->getMessage();
780 780
 		}
781 781
 	}
@@ -786,7 +786,7 @@  discard block
 block discarded – undo
786 786
 		try {
787 787
 			$sth = $this->db->prepare($query);
788 788
 			$sth->execute($query_values);
789
-		} catch(PDOException $e) {
789
+		} catch (PDOException $e) {
790 790
 			return "error : ".$e->getMessage();
791 791
 		}
792 792
 	}
@@ -801,7 +801,7 @@  discard block
 block discarded – undo
801 801
 		try {
802 802
 			$sth = $this->db->prepare($query);
803 803
 			$sth->execute($query_values);
804
-		} catch(PDOException $e) {
804
+		} catch (PDOException $e) {
805 805
 			return "error : ".$e->getMessage();
806 806
 		}
807 807
 	}
@@ -811,7 +811,7 @@  discard block
 block discarded – undo
811 811
 		try {
812 812
 			$sth = $this->db->prepare($query);
813 813
 			$sth->execute($query_values);
814
-		} catch(PDOException $e) {
814
+		} catch (PDOException $e) {
815 815
 			return "error : ".$e->getMessage();
816 816
 		}
817 817
 	}
@@ -820,7 +820,7 @@  discard block
 block discarded – undo
820 820
 		try {
821 821
 			$sth = $this->db->prepare($query);
822 822
 			$sth->execute();
823
-		} catch(PDOException $e) {
823
+		} catch (PDOException $e) {
824 824
 			return "error : ".$e->getMessage();
825 825
 		}
826 826
 	}
@@ -829,7 +829,7 @@  discard block
 block discarded – undo
829 829
 		try {
830 830
 			$sth = $this->db->prepare($query);
831 831
 			$sth->execute();
832
-		} catch(PDOException $e) {
832
+		} catch (PDOException $e) {
833 833
 			return "error : ".$e->getMessage();
834 834
 		}
835 835
 	}
@@ -837,14 +837,14 @@  discard block
 block discarded – undo
837 837
 	public function updateNOTAM() {
838 838
 		global $globalNOTAMAirports;
839 839
 		if (isset($globalNOTAMAirports) && is_array($globalNOTAMAirports) && count($globalNOTAMAirports) > 0) {
840
-			foreach (array_chunk($globalNOTAMAirports,10) as $airport) {
841
-				$airport_icao = implode(',',$airport);
840
+			foreach (array_chunk($globalNOTAMAirports, 10) as $airport) {
841
+				$airport_icao = implode(',', $airport);
842 842
 				$alldata = $this->downloadNOTAM($airport_icao);
843 843
 				if (count($alldata) > 0) {
844 844
 					foreach ($alldata as $initial_data) {
845 845
 						$data = $this->parse($initial_data);
846 846
 						$notamref = $this->getNOTAMbyRef($data['ref']);
847
-						if (count($notamref) == 0) $this->addNOTAM($data['ref'],$data['title'],'',$data['fir'],$data['code'],'',$data['scope'],$data['lower_limit'],$data['upper_limit'],$data['latitude'],$data['longitude'],$data['radius'],$data['date_begin'],$data['date_end'],$data['permanent'],$data['text'],$data['full_notam']);
847
+						if (count($notamref) == 0) $this->addNOTAM($data['ref'], $data['title'], '', $data['fir'], $data['code'], '', $data['scope'], $data['lower_limit'], $data['upper_limit'], $data['latitude'], $data['longitude'], $data['radius'], $data['date_begin'], $data['date_end'], $data['permanent'], $data['text'], $data['full_notam']);
848 848
 					}
849 849
 				}
850 850
 			}
@@ -854,12 +854,12 @@  discard block
 block discarded – undo
854 854
 	public function updateNOTAMallAirports() {
855 855
 		$Spotter = new Spotter();
856 856
 		$allairports = $Spotter->getAllAirportInfo();
857
-		foreach (array_chunk($allairports,20) as $airport) {
857
+		foreach (array_chunk($allairports, 20) as $airport) {
858 858
 			$airports_icao = array();
859
-			foreach($airport as $icao) {
859
+			foreach ($airport as $icao) {
860 860
 				if (isset($icao['icao'])) $airports_icao[] = $icao['icao'];
861 861
 			}
862
-			$airport_icao = implode(',',$airports_icao);
862
+			$airport_icao = implode(',', $airports_icao);
863 863
 			$alldata = $this->downloadNOTAM($airport_icao);
864 864
 			if ($globalTransaction) $this->db->beginTransaction();
865 865
 			if (count($alldata) > 0) {
@@ -872,7 +872,7 @@  discard block
 block discarded – undo
872 872
 						if (count($notamref) == 0) {
873 873
 							if (isset($data['ref_replaced'])) $this->deleteNOTAMbyRef($data['ref_replaced']);
874 874
 							if (isset($data['ref_cancelled'])) $this->deleteNOTAMbyRef($data['ref_cancelled']);
875
-							elseif (isset($data['latitude']) && isset($data['scope']) && isset($data['text']) && isset($data['permanent'])) echo $this->addNOTAM($data['ref'],'','',$data['fir'],$data['code'],'',$data['scope'],$data['lower_limit'],$data['upper_limit'],$data['latitude'],$data['longitude'],$data['radius'],$data['date_begin'],$data['date_end'],$data['permanent'],$data['text'],$data['full_notam']);
875
+							elseif (isset($data['latitude']) && isset($data['scope']) && isset($data['text']) && isset($data['permanent'])) echo $this->addNOTAM($data['ref'], '', '', $data['fir'], $data['code'], '', $data['scope'], $data['lower_limit'], $data['upper_limit'], $data['latitude'], $data['longitude'], $data['radius'], $data['date_begin'], $data['date_end'], $data['permanent'], $data['text'], $data['full_notam']);
876 876
 						}
877 877
 					}
878 878
 				}
@@ -886,7 +886,7 @@  discard block
 block discarded – undo
886 886
 		date_default_timezone_set("UTC");
887 887
 		$Common = new Common();
888 888
 		//$url = str_replace('{icao}',$icao,'https://pilotweb.nas.faa.gov/PilotWeb/notamRetrievalByICAOAction.do?method=displayByICAOs&reportType=RAW&formatType=DOMESTIC&retrieveLocId={icao}&actionType=notamRetrievalByICAOs');
889
-		$url = str_replace('{icao}',$icao,'https://pilotweb.nas.faa.gov/PilotWeb/notamRetrievalByICAOAction.do?method=displayByICAOs&reportType=RAW&formatType=ICAO&retrieveLocId={icao}&actionType=notamRetrievalByICAOs');
889
+		$url = str_replace('{icao}', $icao, 'https://pilotweb.nas.faa.gov/PilotWeb/notamRetrievalByICAOAction.do?method=displayByICAOs&reportType=RAW&formatType=ICAO&retrieveLocId={icao}&actionType=notamRetrievalByICAOs');
890 890
 		$data = $Common->getData($url);
891 891
 		preg_match_all("/<pre>(.+?)<\/pre>/is", $data, $matches);
892 892
 		//print_r($matches);
@@ -898,14 +898,14 @@  discard block
 block discarded – undo
898 898
 		$Common = new Common();
899 899
 		$result = array();
900 900
 		$result['full_notam'] = $data;
901
-		$data = str_ireplace(array("\r","\n",'\r','\n'),' ',$data);
902
-		$data = preg_split('#(?=([A-Z]\)\s))#',$data);
901
+		$data = str_ireplace(array("\r", "\n", '\r', '\n'), ' ', $data);
902
+		$data = preg_split('#(?=([A-Z]\)\s))#', $data);
903 903
 		//print_r($data);
904 904
 		foreach ($data as $line) {
905 905
 			$line = trim($line);
906
-			if (preg_match('#Q\) (.*)#',$line,$matches)) {
907
-				$line = str_replace(' ','',$line);
908
-				if (preg_match('#Q\)([A-Z]{4})\/([A-Z]{5})\/(IV|I|V)\/([A-Z]{1,3})\/([A-Z]{1,2})\/([0-9]{3})\/([0-9]{3})\/([0-9]{4})(N|S)([0-9]{5})(E|W)([0-9]{3})#',$line,$matches)) {
906
+			if (preg_match('#Q\) (.*)#', $line, $matches)) {
907
+				$line = str_replace(' ', '', $line);
908
+				if (preg_match('#Q\)([A-Z]{4})\/([A-Z]{5})\/(IV|I|V)\/([A-Z]{1,3})\/([A-Z]{1,2})\/([0-9]{3})\/([0-9]{3})\/([0-9]{4})(N|S)([0-9]{5})(E|W)([0-9]{3})#', $line, $matches)) {
909 909
 				//if (preg_match('#Q\)([A-Z]{4})\/([A-Z]{5})\/(IV|I|V)\/([A-Z]{1,3})\/([A-Z]{1,2})\/([0-9]{3})\/([0-9]{3})\/([0-9]{4})(N|S)([0-9]{5})(E|W)([0-9]{3})#',$line,$matches)) {
910 910
 					//print_r($matches);
911 911
 					$result['fir'] = $matches[1];
@@ -950,30 +950,30 @@  discard block
 block discarded – undo
950 950
 					elseif ($matches[5] == 'AW') $result['scope'] = 'Airport/Navigation warning';
951 951
 					$result['lower_limit'] = $matches[6];
952 952
 					$result['upper_limit'] = $matches[7];
953
-					$latitude = $Common->convertDec($matches[8],'latitude');
953
+					$latitude = $Common->convertDec($matches[8], 'latitude');
954 954
 					if ($matches[9] == 'S') $latitude = -$latitude;
955
-					$longitude = $Common->convertDec($matches[10],'longitude');
955
+					$longitude = $Common->convertDec($matches[10], 'longitude');
956 956
 					if ($matches[11] == 'W') $longitude = -$longitude;
957 957
 					$result['latitude'] = $latitude;
958 958
 					$result['longitude'] = $longitude;
959 959
 					$result['radius'] = intval($matches[12]);
960 960
 				} else echo 'ERROR : '.$line."\n";
961 961
 			}
962
-			elseif (preg_match('#A\) (.*)#',$line,$matches)) {
962
+			elseif (preg_match('#A\) (.*)#', $line, $matches)) {
963 963
 				$result['icao'] = $matches[1];
964 964
 			}
965
-			elseif (preg_match('#B\) ([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})#',$line,$matches)) {
965
+			elseif (preg_match('#B\) ([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})#', $line, $matches)) {
966 966
 				if ($matches[1] > 50) $year = '19'.$matches[1];
967 967
 				else $year = '20'.$matches[1];
968 968
 				$result['date_begin'] = $year.'/'.$matches[2].'/'.$matches[3].' '.$matches[4].':'.$matches[5];
969 969
 			}
970
-			elseif (preg_match('#C\) ([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})$#',$line,$matches)) {
970
+			elseif (preg_match('#C\) ([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})$#', $line, $matches)) {
971 971
 				if ($matches[1] > 50) $year = '19'.$matches[1];
972 972
 				else $year = '20'.$matches[1];
973 973
 				$result['date_end'] = $year.'/'.$matches[2].'/'.$matches[3].' '.$matches[4].':'.$matches[5];
974 974
 				$result['permanent'] = 0;
975 975
 			}
976
-			elseif (preg_match('#C\) ([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2}) (EST|PERM)$#',$line,$matches)) {
976
+			elseif (preg_match('#C\) ([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2}) (EST|PERM)$#', $line, $matches)) {
977 977
 				if ($matches[1] > 50) $year = '19'.$matches[1];
978 978
 				else $year = '20'.$matches[1];
979 979
 				$result['date_end'] = $year.'/'.$matches[2].'/'.$matches[3].' '.$matches[4].':'.$matches[5];
@@ -982,26 +982,26 @@  discard block
 block discarded – undo
982 982
 				if ($matches[6] == 'PERM') $result['permanent'] = 1;
983 983
 				else $result['permanent'] = 0;
984 984
 			}
985
-			elseif (preg_match('#C\) (EST|PERM)$#',$line,$matches)) {
985
+			elseif (preg_match('#C\) (EST|PERM)$#', $line, $matches)) {
986 986
 				$result['date_end'] = '2030/12/20 12:00';
987 987
 				if ($matches[1] == 'EST') $result['estimated'] = 1;
988 988
 				else $result['estimated'] = 0;
989 989
 				if ($matches[1] == 'PERM') $result['permanent'] = 1;
990 990
 				else $result['permanent'] = 0;
991 991
 			}
992
-			elseif (preg_match('#E\) (.*)#',$line,$matches)) {
992
+			elseif (preg_match('#E\) (.*)#', $line, $matches)) {
993 993
 				$rtext = array();
994
-				$text = explode(' ',$matches[1]);
994
+				$text = explode(' ', $matches[1]);
995 995
 				foreach ($text as $word) {
996 996
 					if (isset($this->abbr[$word])) $rtext[] = strtoupper($this->abbr[$word]);
997
-					elseif (ctype_digit(strval(substr($word,3))) && isset($this->abbr[substr($word,0,3)])) $rtext[] = strtoupper($this->abbr[substr($word,0,3)]).' '.substr($word,3);
997
+					elseif (ctype_digit(strval(substr($word, 3))) && isset($this->abbr[substr($word, 0, 3)])) $rtext[] = strtoupper($this->abbr[substr($word, 0, 3)]).' '.substr($word, 3);
998 998
 					else $rtext[] = $word;
999 999
 				}
1000
-				$result['text'] = implode(' ',$rtext);
1000
+				$result['text'] = implode(' ', $rtext);
1001 1001
 			//} elseif (preg_match('#F\) (.*)#',$line,$matches)) {
1002 1002
 			//} elseif (preg_match('#G\) (.*)#',$line,$matches)) {
1003
-			} elseif (preg_match('#(NOTAMN|NOTAMR|NOTAMC)#',$line,$matches)) {
1004
-				$text = explode(' ',$line);
1003
+			} elseif (preg_match('#(NOTAMN|NOTAMR|NOTAMC)#', $line, $matches)) {
1004
+				$text = explode(' ', $line);
1005 1005
 				$result['ref'] = $text[0];
1006 1006
 				if ($matches[1] == 'NOTAMN') $result['type'] = 'new';
1007 1007
 				if ($matches[1] == 'NOTAMC') {
Please login to merge, or discard this patch.
Braces   +149 added lines, -68 removed lines patch added patch discarded remove patch
@@ -738,7 +738,9 @@  discard block
 block discarded – undo
738 738
 			$minlat = filter_var($coord[1],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
739 739
 			$maxlong = filter_var($coord[2],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
740 740
 			$maxlat = filter_var($coord[3],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
741
-		} else return array();
741
+		} else {
742
+			return array();
743
+		}
742 744
 		if ($globalDBdriver == 'mysql') {
743 745
 			$query  = 'SELECT * FROM notam WHERE center_latitude BETWEEN '.$minlat.' AND '.$maxlat.' AND center_longitude BETWEEN '.$minlong.' AND '.$maxlong.' AND radius > 0 AND date_end > UTC_TIMESTAMP() AND date_begin < UTC_TIMESTAMP()';
744 746
 		} else {
@@ -765,8 +767,11 @@  discard block
 block discarded – undo
765 767
 			return "error : ".$e->getMessage();
766 768
 		}
767 769
 		$all = $sth->fetchAll(PDO::FETCH_ASSOC);
768
-		if (isset($all[0])) return $all[0];
769
-		else return array();
770
+		if (isset($all[0])) {
771
+			return $all[0];
772
+		} else {
773
+			return array();
774
+		}
770 775
 	}
771 776
 
772 777
 	public function addNOTAM($ref,$title,$type,$fir,$code,$rules,$scope,$lower_limit,$upper_limit,$center_latitude,$center_longitude,$radius,$date_begin,$date_end,$permanent,$text,$full_notam) {
@@ -844,7 +849,9 @@  discard block
 block discarded – undo
844 849
 					foreach ($alldata as $initial_data) {
845 850
 						$data = $this->parse($initial_data);
846 851
 						$notamref = $this->getNOTAMbyRef($data['ref']);
847
-						if (count($notamref) == 0) $this->addNOTAM($data['ref'],$data['title'],'',$data['fir'],$data['code'],'',$data['scope'],$data['lower_limit'],$data['upper_limit'],$data['latitude'],$data['longitude'],$data['radius'],$data['date_begin'],$data['date_end'],$data['permanent'],$data['text'],$data['full_notam']);
852
+						if (count($notamref) == 0) {
853
+							$this->addNOTAM($data['ref'],$data['title'],'',$data['fir'],$data['code'],'',$data['scope'],$data['lower_limit'],$data['upper_limit'],$data['latitude'],$data['longitude'],$data['radius'],$data['date_begin'],$data['date_end'],$data['permanent'],$data['text'],$data['full_notam']);
854
+						}
848 855
 					}
849 856
 				}
850 857
 			}
@@ -857,11 +864,15 @@  discard block
 block discarded – undo
857 864
 		foreach (array_chunk($allairports,20) as $airport) {
858 865
 			$airports_icao = array();
859 866
 			foreach($airport as $icao) {
860
-				if (isset($icao['icao'])) $airports_icao[] = $icao['icao'];
867
+				if (isset($icao['icao'])) {
868
+					$airports_icao[] = $icao['icao'];
869
+				}
861 870
 			}
862 871
 			$airport_icao = implode(',',$airports_icao);
863 872
 			$alldata = $this->downloadNOTAM($airport_icao);
864
-			if ($globalTransaction) $this->db->beginTransaction();
873
+			if ($globalTransaction) {
874
+				$this->db->beginTransaction();
875
+			}
865 876
 			if (count($alldata) > 0) {
866 877
 				foreach ($alldata as $initial_data) {
867 878
 					//print_r($initial_data);
@@ -870,14 +881,23 @@  discard block
 block discarded – undo
870 881
 					if (isset($data['ref'])) {
871 882
 						$notamref = $this->getNOTAMbyRef($data['ref']);
872 883
 						if (count($notamref) == 0) {
873
-							if (isset($data['ref_replaced'])) $this->deleteNOTAMbyRef($data['ref_replaced']);
874
-							if (isset($data['ref_cancelled'])) $this->deleteNOTAMbyRef($data['ref_cancelled']);
875
-							elseif (isset($data['latitude']) && isset($data['scope']) && isset($data['text']) && isset($data['permanent'])) echo $this->addNOTAM($data['ref'],'','',$data['fir'],$data['code'],'',$data['scope'],$data['lower_limit'],$data['upper_limit'],$data['latitude'],$data['longitude'],$data['radius'],$data['date_begin'],$data['date_end'],$data['permanent'],$data['text'],$data['full_notam']);
884
+							if (isset($data['ref_replaced'])) {
885
+								$this->deleteNOTAMbyRef($data['ref_replaced']);
886
+							}
887
+							if (isset($data['ref_cancelled'])) {
888
+								$this->deleteNOTAMbyRef($data['ref_cancelled']);
889
+							} elseif (isset($data['latitude']) && isset($data['scope']) && isset($data['text']) && isset($data['permanent'])) {
890
+								echo $this->addNOTAM($data['ref'],'','',$data['fir'],$data['code'],'',$data['scope'],$data['lower_limit'],$data['upper_limit'],$data['latitude'],$data['longitude'],$data['radius'],$data['date_begin'],$data['date_end'],$data['permanent'],$data['text'],$data['full_notam']);
891
+							}
876 892
 						}
877 893
 					}
878 894
 				}
879
-			} else echo 'Error on download. Nothing matches for '.$airport_icao."\n";
880
-			if ($globalTransaction) $this->db->commit();
895
+			} else {
896
+				echo 'Error on download. Nothing matches for '.$airport_icao."\n";
897
+			}
898
+			if ($globalTransaction) {
899
+				$this->db->commit();
900
+			}
881 901
 			sleep(5);
882 902
 		}
883 903
 	}
@@ -890,8 +910,11 @@  discard block
 block discarded – undo
890 910
 		$data = $Common->getData($url);
891 911
 		preg_match_all("/<pre>(.+?)<\/pre>/is", $data, $matches);
892 912
 		//print_r($matches);
893
-		if (isset($matches[1])) return $matches[1];
894
-		else return array();
913
+		if (isset($matches[1])) {
914
+			return $matches[1];
915
+		} else {
916
+			return array();
917
+		}
895 918
 	}
896 919
 
897 920
 	public function parse($data) {
@@ -913,89 +936,145 @@  discard block
 block discarded – undo
913 936
 					$rules = str_split($matches[3]);
914 937
 					foreach ($rules as $rule) {
915 938
 						if ($rule == 'I') {
916
-							if (isset($result['rules'])) $result['rules'] = $result['rules'].'/IFR';
917
-							else $result['rules'] = 'IFR';
939
+							if (isset($result['rules'])) {
940
+								$result['rules'] = $result['rules'].'/IFR';
941
+							} else {
942
+								$result['rules'] = 'IFR';
943
+							}
918 944
 						} elseif ($rule == 'V') {
919
-							if (isset($result['rules'])) $result['rules'] = $result['rules'].'/VFR';
920
-							else $result['rules'] = 'VFR';
945
+							if (isset($result['rules'])) {
946
+								$result['rules'] = $result['rules'].'/VFR';
947
+							} else {
948
+								$result['rules'] = 'VFR';
949
+							}
921 950
 						} elseif ($rule == 'K') {
922
-							if (isset($result['rules'])) $result['rules'] = $result['rules'].'/Checklist';
923
-							else $result['rules'] = 'Checklist';
951
+							if (isset($result['rules'])) {
952
+								$result['rules'] = $result['rules'].'/Checklist';
953
+							} else {
954
+								$result['rules'] = 'Checklist';
955
+							}
924 956
 						}
925 957
 					}
926 958
 					$attentions = str_split($matches[4]);
927 959
 					foreach ($attentions as $attention) {
928 960
 						if ($attention == 'N') {
929
-							if (isset($result['attention'])) $result['attention'] = $result['attention'].' / Immediate attention';
930
-							else $result['rules'] = 'Immediate attention';
961
+							if (isset($result['attention'])) {
962
+								$result['attention'] = $result['attention'].' / Immediate attention';
963
+							} else {
964
+								$result['rules'] = 'Immediate attention';
965
+							}
931 966
 						} elseif ($attention == 'B') {
932
-							if (isset($result['attention'])) $result['attention'] = $result['attention'].' / Operational significance';
933
-							else $result['rules'] = 'Operational significance';
967
+							if (isset($result['attention'])) {
968
+								$result['attention'] = $result['attention'].' / Operational significance';
969
+							} else {
970
+								$result['rules'] = 'Operational significance';
971
+							}
934 972
 						} elseif ($attention == 'O') {
935
-							if (isset($result['attention'])) $result['attention'] = $result['attention'].' / Flight operations';
936
-							else $result['rules'] = 'Flight operations';
973
+							if (isset($result['attention'])) {
974
+								$result['attention'] = $result['attention'].' / Flight operations';
975
+							} else {
976
+								$result['rules'] = 'Flight operations';
977
+							}
937 978
 						} elseif ($attention == 'M') {
938
-							if (isset($result['attention'])) $result['attention'] = $result['attention'].' / Misc';
939
-							else $result['rules'] = 'Misc';
979
+							if (isset($result['attention'])) {
980
+								$result['attention'] = $result['attention'].' / Misc';
981
+							} else {
982
+								$result['rules'] = 'Misc';
983
+							}
940 984
 						} elseif ($attention == 'K') {
941
-							if (isset($result['attention'])) $result['attention'] = $result['attention'].' / Checklist';
942
-							else $result['rules'] = 'Checklist';
985
+							if (isset($result['attention'])) {
986
+								$result['attention'] = $result['attention'].' / Checklist';
987
+							} else {
988
+								$result['rules'] = 'Checklist';
989
+							}
943 990
 						}
944 991
 					}
945
-					if ($matches[5] == 'A') $result['scope'] = 'Airport warning';
946
-					elseif ($matches[5] == 'E') $result['scope'] = 'Enroute warning';
947
-					elseif ($matches[5] == 'W') $result['scope'] = 'Navigation warning';
948
-					elseif ($matches[5] == 'K') $result['scope'] = 'Checklist';
949
-					elseif ($matches[5] == 'AE') $result['scope'] = 'Airport/Enroute warning';
950
-					elseif ($matches[5] == 'AW') $result['scope'] = 'Airport/Navigation warning';
992
+					if ($matches[5] == 'A') {
993
+						$result['scope'] = 'Airport warning';
994
+					} elseif ($matches[5] == 'E') {
995
+						$result['scope'] = 'Enroute warning';
996
+					} elseif ($matches[5] == 'W') {
997
+						$result['scope'] = 'Navigation warning';
998
+					} elseif ($matches[5] == 'K') {
999
+						$result['scope'] = 'Checklist';
1000
+					} elseif ($matches[5] == 'AE') {
1001
+						$result['scope'] = 'Airport/Enroute warning';
1002
+					} elseif ($matches[5] == 'AW') {
1003
+						$result['scope'] = 'Airport/Navigation warning';
1004
+					}
951 1005
 					$result['lower_limit'] = $matches[6];
952 1006
 					$result['upper_limit'] = $matches[7];
953 1007
 					$latitude = $Common->convertDec($matches[8],'latitude');
954
-					if ($matches[9] == 'S') $latitude = -$latitude;
1008
+					if ($matches[9] == 'S') {
1009
+						$latitude = -$latitude;
1010
+					}
955 1011
 					$longitude = $Common->convertDec($matches[10],'longitude');
956
-					if ($matches[11] == 'W') $longitude = -$longitude;
1012
+					if ($matches[11] == 'W') {
1013
+						$longitude = -$longitude;
1014
+					}
957 1015
 					$result['latitude'] = $latitude;
958 1016
 					$result['longitude'] = $longitude;
959 1017
 					$result['radius'] = intval($matches[12]);
960
-				} else echo 'ERROR : '.$line."\n";
961
-			}
962
-			elseif (preg_match('#A\) (.*)#',$line,$matches)) {
1018
+				} else {
1019
+					echo 'ERROR : '.$line."\n";
1020
+				}
1021
+			} elseif (preg_match('#A\) (.*)#',$line,$matches)) {
963 1022
 				$result['icao'] = $matches[1];
964
-			}
965
-			elseif (preg_match('#B\) ([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})#',$line,$matches)) {
966
-				if ($matches[1] > 50) $year = '19'.$matches[1];
967
-				else $year = '20'.$matches[1];
1023
+			} elseif (preg_match('#B\) ([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})#',$line,$matches)) {
1024
+				if ($matches[1] > 50) {
1025
+					$year = '19'.$matches[1];
1026
+				} else {
1027
+					$year = '20'.$matches[1];
1028
+				}
968 1029
 				$result['date_begin'] = $year.'/'.$matches[2].'/'.$matches[3].' '.$matches[4].':'.$matches[5];
969
-			}
970
-			elseif (preg_match('#C\) ([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})$#',$line,$matches)) {
971
-				if ($matches[1] > 50) $year = '19'.$matches[1];
972
-				else $year = '20'.$matches[1];
1030
+			} elseif (preg_match('#C\) ([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})$#',$line,$matches)) {
1031
+				if ($matches[1] > 50) {
1032
+					$year = '19'.$matches[1];
1033
+				} else {
1034
+					$year = '20'.$matches[1];
1035
+				}
973 1036
 				$result['date_end'] = $year.'/'.$matches[2].'/'.$matches[3].' '.$matches[4].':'.$matches[5];
974 1037
 				$result['permanent'] = 0;
975
-			}
976
-			elseif (preg_match('#C\) ([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2}) (EST|PERM)$#',$line,$matches)) {
977
-				if ($matches[1] > 50) $year = '19'.$matches[1];
978
-				else $year = '20'.$matches[1];
1038
+			} elseif (preg_match('#C\) ([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2}) (EST|PERM)$#',$line,$matches)) {
1039
+				if ($matches[1] > 50) {
1040
+					$year = '19'.$matches[1];
1041
+				} else {
1042
+					$year = '20'.$matches[1];
1043
+				}
979 1044
 				$result['date_end'] = $year.'/'.$matches[2].'/'.$matches[3].' '.$matches[4].':'.$matches[5];
980
-				if ($matches[6] == 'EST') $result['estimated'] = 1;
981
-				else $result['estimated'] = 0;
982
-				if ($matches[6] == 'PERM') $result['permanent'] = 1;
983
-				else $result['permanent'] = 0;
984
-			}
985
-			elseif (preg_match('#C\) (EST|PERM)$#',$line,$matches)) {
1045
+				if ($matches[6] == 'EST') {
1046
+					$result['estimated'] = 1;
1047
+				} else {
1048
+					$result['estimated'] = 0;
1049
+				}
1050
+				if ($matches[6] == 'PERM') {
1051
+					$result['permanent'] = 1;
1052
+				} else {
1053
+					$result['permanent'] = 0;
1054
+				}
1055
+			} elseif (preg_match('#C\) (EST|PERM)$#',$line,$matches)) {
986 1056
 				$result['date_end'] = '2030/12/20 12:00';
987
-				if ($matches[1] == 'EST') $result['estimated'] = 1;
988
-				else $result['estimated'] = 0;
989
-				if ($matches[1] == 'PERM') $result['permanent'] = 1;
990
-				else $result['permanent'] = 0;
991
-			}
992
-			elseif (preg_match('#E\) (.*)#',$line,$matches)) {
1057
+				if ($matches[1] == 'EST') {
1058
+					$result['estimated'] = 1;
1059
+				} else {
1060
+					$result['estimated'] = 0;
1061
+				}
1062
+				if ($matches[1] == 'PERM') {
1063
+					$result['permanent'] = 1;
1064
+				} else {
1065
+					$result['permanent'] = 0;
1066
+				}
1067
+			} elseif (preg_match('#E\) (.*)#',$line,$matches)) {
993 1068
 				$rtext = array();
994 1069
 				$text = explode(' ',$matches[1]);
995 1070
 				foreach ($text as $word) {
996
-					if (isset($this->abbr[$word])) $rtext[] = strtoupper($this->abbr[$word]);
997
-					elseif (ctype_digit(strval(substr($word,3))) && isset($this->abbr[substr($word,0,3)])) $rtext[] = strtoupper($this->abbr[substr($word,0,3)]).' '.substr($word,3);
998
-					else $rtext[] = $word;
1071
+					if (isset($this->abbr[$word])) {
1072
+						$rtext[] = strtoupper($this->abbr[$word]);
1073
+					} elseif (ctype_digit(strval(substr($word,3))) && isset($this->abbr[substr($word,0,3)])) {
1074
+						$rtext[] = strtoupper($this->abbr[substr($word,0,3)]).' '.substr($word,3);
1075
+					} else {
1076
+						$rtext[] = $word;
1077
+					}
999 1078
 				}
1000 1079
 				$result['text'] = implode(' ',$rtext);
1001 1080
 			//} elseif (preg_match('#F\) (.*)#',$line,$matches)) {
@@ -1003,7 +1082,9 @@  discard block
 block discarded – undo
1003 1082
 			} elseif (preg_match('#(NOTAMN|NOTAMR|NOTAMC)#',$line,$matches)) {
1004 1083
 				$text = explode(' ',$line);
1005 1084
 				$result['ref'] = $text[0];
1006
-				if ($matches[1] == 'NOTAMN') $result['type'] = 'new';
1085
+				if ($matches[1] == 'NOTAMN') {
1086
+					$result['type'] = 'new';
1087
+				}
1007 1088
 				if ($matches[1] == 'NOTAMC') {
1008 1089
 					$result['type'] = 'cancel';
1009 1090
 					$result['ref_cancelled'] = $text[2];
Please login to merge, or discard this patch.
index.php 1 patch
Indentation   +72 added lines, -72 removed lines patch added patch discarded remove patch
@@ -34,12 +34,12 @@  discard block
 block discarded – undo
34 34
 <div id="showdetails" class="showdetails"></div>
35 35
 <div id="infobox" class="infobox"></div>
36 36
 <?php
37
-    if ((!isset($_COOKIE['MapFormat']) && isset($globalMap3Ddefault) && $globalMap3Ddefault) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d')) {
37
+	if ((!isset($_COOKIE['MapFormat']) && isset($globalMap3Ddefault) && $globalMap3Ddefault) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d')) {
38 38
 
39 39
 ?>
40 40
 <script src="<?php echo $globalURL; ?>/js/map.3d.js.php"></script>
41 41
 <?php
42
-    }
42
+	}
43 43
 ?>
44 44
 <div id="dialog" title="<?php echo _("Session has timed-out"); ?>">
45 45
   <p><?php echo _("In order to save data consumption web page times out after 30 minutes. Close this dialog to continue."); ?></p>
@@ -53,31 +53,31 @@  discard block
 block discarded – undo
53 53
 	<li><a href="#" onclick="getUserLocation(); return false;" title="<?php echo _("Plot your Location"); ?>"><i class="fa fa-map-marker"></i></a></li>
54 54
 	<li><a href="#" onclick="getCompassDirection(); return false;" title="<?php echo _("Compass Mode"); ?>"><i class="fa fa-compass"></i></a></li>
55 55
 <?php
56
-    if (isset($globalArchive) && $globalArchive == TRUE && (isset($globalBeta) && $globalBeta == TRUE)) {
56
+	if (isset($globalArchive) && $globalArchive == TRUE && (isset($globalBeta) && $globalBeta == TRUE)) {
57 57
 ?>
58 58
 	<li><a href="#archive" role="tab" title="<?php echo _("Archive"); ?>"><i class="fa fa-archive"></i></a></li>
59 59
 <?php
60
-    }
60
+	}
61 61
 ?>
62 62
 	<li><a href="#home" role="tab" title="<?php echo _("Layers"); ?>"><i class="fa fa-map"></i></a></li>
63 63
 	<li><a href="#settings" role="tab" title="<?php echo _("Settings"); ?>"><i class="fa fa-gears"></i></a></li>
64 64
 <?php
65
-    if (isset($globalMap3D) && $globalMap3D) {
65
+	if (isset($globalMap3D) && $globalMap3D) {
66 66
 	if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) {
67 67
 ?>
68 68
 	<li><a href="#" onclick="show3D(); return false;" role="tab" title="3D"><b>3D</b></a></li>
69 69
 <?php
70
-        } else {
71
-    	    if (isset($globalMapSatellites) && $globalMapSatellites) {
70
+		} else {
71
+			if (isset($globalMapSatellites) && $globalMapSatellites) {
72 72
 ?>
73 73
 	<li><a href="#satellites" role="tab" title="<?php echo _("Satellites"); ?>"><i class="satellite"></i></a></li>
74 74
 <?php
75
-	    }
75
+		}
76 76
 ?>
77 77
 	<li><a href="#" onclick="show2D(); return false;" role="tab" title="2D"><b>2D</b></a></li>
78 78
 <?php
79 79
 	}
80
-    }
80
+	}
81 81
 ?>
82 82
     </ul>
83 83
 
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 ?>
110 110
         </div>
111 111
 <?php
112
-    if (isset($globalArchive) && $globalArchive == TRUE) {
112
+	if (isset($globalArchive) && $globalArchive == TRUE) {
113 113
 ?>
114 114
         <div class="sidebar-pane" id="archive">
115 115
 	    <h1 class="sidebar-header"><?php echo _("Playback"); ?> <i>Bêta</i><span class="sidebar-close"><i class="fa fa-caret-left"></i></span></h1>
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 	    </form>
166 166
 	</div>
167 167
 <?php
168
-    }
168
+	}
169 169
 ?>
170 170
         <div class="sidebar-pane" id="settings">
171 171
 	    <h1 class="sidebar-header"><?php echo _("Settings"); ?><span class="sidebar-close"><i class="fa fa-caret-left"></i></span></h1>
@@ -176,56 +176,56 @@  discard block
 block discarded – undo
176 176
 			    <?php
177 177
 				if (!isset($_COOKIE['MapType']) || $_COOKIE['MapType'] == '') $MapType = $globalMapProvider;
178 178
 				else $MapType = $_COOKIE['MapType'];
179
-			    ?>
179
+				?>
180 180
 			    <?php
181 181
 				if (isset($globalBingMapKey) && $globalBingMapKey != '') {
182
-			    ?>
182
+				?>
183 183
 			    <option value="Bing-Aerial"<?php if ($MapType == 'Bing-Aerial') print ' selected'; ?>>Bing-Aerial</option>
184 184
 			    <option value="Bing-Hybrid"<?php if ($MapType == 'Bing-Hybrid') print ' selected'; ?>>Bing-Hybrid</option>
185 185
 			    <option value="Bing-Road"<?php if ($MapType == 'Bing-Road') print ' selected'; ?>>Bing-Road</option>
186 186
 			    <?php
187 187
 				}
188
-			    ?>
188
+				?>
189 189
 			    <?php
190
-			        if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) {
191
-			    ?>
190
+					if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) {
191
+				?>
192 192
 			    <?php
193
-				    if (isset($globalHereappId) && $globalHereappId != '' && isset($globalHereappCode) && $globalHereappCode != '') {
194
-			    ?>
193
+					if (isset($globalHereappId) && $globalHereappId != '' && isset($globalHereappCode) && $globalHereappCode != '') {
194
+				?>
195 195
 			    <option value="Here-Aerial"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Aerial</option>
196 196
 			    <option value="Here-Hybrid"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Hybrid</option>
197 197
 			    <option value="Here-Road"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Road</option>
198 198
 			    <?php
199
-				    }
200
-			    ?>
199
+					}
200
+				?>
201 201
 			    <?php
202
-				    if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '') {
203
-			    ?>
202
+					if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '') {
203
+				?>
204 204
 			    <option value="Google-Roadmap"<?php if ($MapType == 'Google-Roadmap') print ' selected'; ?>>Google Roadmap</option>
205 205
 			    <option value="Google-Satellite"<?php if ($MapType == 'Google-Satellite') print ' selected'; ?>>Google Satellite</option>
206 206
 			    <option value="Google-Hybrid"<?php if ($MapType == 'Google-Hybrid') print ' selected'; ?>>Google Hybrid</option>
207 207
 			    <option value="Google-Terrain"<?php if ($MapType == 'Google-Terrain') print ' selected'; ?>>Google Terrain</option>
208 208
 			    <?php
209
-				    }
210
-			    ?>
209
+					}
210
+				?>
211 211
 			    <?php
212
-				    if (isset($globalMapQuestKey) && $globalMapQuestKey != '') {
213
-			    ?>
212
+					if (isset($globalMapQuestKey) && $globalMapQuestKey != '') {
213
+				?>
214 214
 			    <option value="MapQuest-OSM"<?php if ($MapType == 'MapQuest-OSM') print ' selected'; ?>>MapQuest-OSM</option>
215 215
 			    <option value="MapQuest-Aerial"<?php if ($MapType == 'MapQuest-Aerial') print ' selected'; ?>>MapQuest-Aerial</option>
216 216
 			    <option value="MapQuest-Hybrid"<?php if ($MapType == 'MapQuest-Hybrid') print ' selected'; ?>>MapQuest-Hybrid</option>
217 217
 			    <?php
218
-				    }
219
-			    ?>
218
+					}
219
+				?>
220 220
 			    <option value="Yandex"<?php if ($MapType == 'Yandex') print ' selected'; ?>>Yandex</option>
221 221
 			    <?php
222 222
 				}
223
-			    ?>
223
+				?>
224 224
 			    <?php
225
-				    if (isset($globalMapboxToken) && $globalMapboxToken != '') {
225
+					if (isset($globalMapboxToken) && $globalMapboxToken != '') {
226 226
 					if (!isset($_COOKIE['MapTypeId'])) $MapBoxId = 'default';
227 227
 					else $MapBoxId = $_COOKIE['MapTypeId'];
228
-			    ?>
228
+				?>
229 229
 			    <option value="Mapbox-default"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'default') print ' selected'; ?>>Mapbox default</option>
230 230
 			    <option value="Mapbox-mapbox.streets"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets') print ' selected'; ?>>Mapbox streets</option>
231 231
 			    <option value="Mapbox-mapbox.light"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.light') print ' selected'; ?>>Mapbox light</option>
@@ -239,13 +239,13 @@  discard block
 block discarded – undo
239 239
 			    <option value="Mapbox-mapbox.pirates"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pirates') print ' selected'; ?>>Mapbox pirates</option>
240 240
 			    <option value="Mapbox-mapbox.emerald"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.emerald') print ' selected'; ?>>Mapbox emerald</option>
241 241
 			    <?php
242
-				    }
243
-			    ?>
242
+					}
243
+				?>
244 244
 			    <option value="OpenStreetMap"<?php if ($MapType == 'OpenStreetMap') print ' selected'; ?>>OpenStreetMap</option>
245 245
 			</select>
246 246
 		    </li>
247 247
 <?php
248
-    if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') {
248
+	if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') {
249 249
 ?>
250 250
 		    <li><?php echo _("Type of Terrain:"); ?>
251 251
 			<select  class="selectpicker" onchange="terrainType(this);">
@@ -255,10 +255,10 @@  discard block
 block discarded – undo
255 255
 			</select>
256 256
 		    </li>
257 257
 <?php
258
-    }
258
+	}
259 259
 ?>
260 260
 <?php
261
-    if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') {
261
+	if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') {
262 262
 ?>
263 263
 		    
264 264
 		    <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>
@@ -266,54 +266,54 @@  discard block
 block discarded – undo
266 266
 		    <li><div class="checkbox"><label><input type="checkbox" name="flightroute" value="1" onclick="clickFlightRoute(this)" <?php if ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == 'true') || !isset($_COOKIE['MapRoute'])) print 'checked'; ?> ><?php echo _("Display flight route on click"); ?></label></div></li>
267 267
 		    <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>
268 268
 <?php
269
-    }
269
+	}
270 270
 ?>
271 271
 		    <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>
272 272
 <?php
273
-    if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') {
273
+	if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') {
274 274
 ?>
275 275
 		    <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>
276 276
 <?php
277
-    }
277
+	}
278 278
 ?>
279 279
 
280 280
 		    <?php
281 281
 			if (function_exists('array_column')) {
282
-			    if (array_search(TRUE, array_column($globalSources, 'sourcestats')) !== FALSE) {
283
-		    ?>
282
+				if (array_search(TRUE, array_column($globalSources, 'sourcestats')) !== FALSE) {
283
+			?>
284 284
 		    <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>
285 285
 		    <?php
286
-			    }
286
+				}
287 287
 			} elseif (isset($globalSources)) {
288
-			    $dispolar = false;
289
-			    foreach ($globalSources as $testsource) {
290
-			        if (isset($globalSources['sourcestats']) && $globalSources['sourcestats'] !== FALSE) $dispolar = true;
291
-			    }
292
-			    if ($dispolar) {
293
-		    ?>
288
+				$dispolar = false;
289
+				foreach ($globalSources as $testsource) {
290
+					if (isset($globalSources['sourcestats']) && $globalSources['sourcestats'] !== FALSE) $dispolar = true;
291
+				}
292
+				if ($dispolar) {
293
+			?>
294 294
 		    <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>
295 295
 		    <?php
296
-			    }
297
-		        }
298
-		    ?>
296
+				}
297
+				}
298
+			?>
299 299
 <?php
300
-    if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') {
300
+	if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') {
301 301
 ?>
302 302
 
303 303
 		    <?php
304
-		        if (extension_loaded('gd') && function_exists('gd_info')) {
305
-		    ?>
304
+				if (extension_loaded('gd') && function_exists('gd_info')) {
305
+			?>
306 306
 		    <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>
307 307
 		    <?php 
308 308
 			if (!isset($_COOKIE['IconColorAltitude']) || $_COOKIE['IconColorAltitude'] == 'false') {
309
-		    ?>
309
+			?>
310 310
 		    <li><?php echo _("Aircraft icon color:"); ?>
311 311
 			<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'; ?>">
312 312
 		    </li>
313 313
 		    <?php
314
-			    }
315
-		        }
316
-		    ?>
314
+				}
315
+				}
316
+			?>
317 317
 		    <li><?php echo _("Show airport icon at zoom level:"); ?>
318 318
 			<div class="range">
319 319
 			    <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'; ?>">
@@ -321,20 +321,20 @@  discard block
 block discarded – undo
321 321
 			</div>
322 322
 		    </li>
323 323
 <?php
324
-    }
324
+	}
325 325
 ?>
326 326
 		    <?php
327 327
 			if (((isset($globalVATSIM) && $globalVATSIM) || isset($globalIVAO) && $globalIVAO || isset($globalphpVMS) && $globalphpVMS) && (!isset($globalMapVAchoose) || $globalMapVAchoose)) {
328
-		    ?>
328
+			?>
329 329
 			<?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 } ?>
330 330
 			<?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 } ?>
331 331
 			<?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 } ?>
332 332
 		    <?php
333 333
 			}
334
-		    ?>
334
+			?>
335 335
 		    <?php
336 336
 			if (!(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalIVAO) && $globalIVAO) && !(isset($globalphpVMS) && $globalphpVMS) && isset($globalSBS1) && $globalSBS1 && isset($globalAPRS) && $globalAPRS && (!isset($globalMapchoose) || $globalMapchoose)) {
337
-		    ?>
337
+			?>
338 338
 			<?php if (isset($globalSBS1) && $globalSBS1) { ?>
339 339
 			    <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>
340 340
 			<?php } ?>
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
 			<?php } ?>
344 344
 		    <?php
345 345
 			}
346
-		    ?>
346
+			?>
347 347
 		    <li><?php echo _("Display airlines:"); ?>
348 348
 			<select class="selectpicker" multiple onchange="airlines(this);">
349 349
 			    <?php
@@ -357,12 +357,12 @@  discard block
 block discarded – undo
357 357
 						echo '<option value="'.$airline['airline_icao'].'">'.$airline_name.'</option>';
358 358
 					}
359 359
 				}
360
-			    ?>
360
+				?>
361 361
 			</select>
362 362
 		    </li>
363 363
 		    <?php
364 364
 			if (isset($globalAPRS) && $globalAPRS) {
365
-		    ?>
365
+			?>
366 366
 		    <li><?php echo _("Display APRS sources name:"); ?>
367 367
 			<select class="selectpicker" multiple onchange="sources(this);">
368 368
 			    <?php
@@ -374,15 +374,15 @@  discard block
 block discarded – undo
374 374
 						echo '<option value="'.$source['source_name'].'">'.$source['source_name'].'</option>';
375 375
 					}
376 376
 				}
377
-			    ?>
377
+				?>
378 378
 			</select>
379 379
 		    </li>
380 380
 		    <?php
381 381
 			}
382
-		    ?>
382
+			?>
383 383
 		    <?php
384 384
 			if (!(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalIVAO) && $globalIVAO) && !(isset($globalphpVMS) && $globalphpVMS)) {
385
-		    ?>
385
+			?>
386 386
 		    <li><?php echo _("Display airlines of type:"); ?>
387 387
 			<select class="selectpicker" onchange="airlinestype(this);">
388 388
 			    <option value="all"<?php if (!isset($_COOKIE['airlinestype']) || $_COOKIE['airlinestype'] == 'all' || $_COOKIE['airlinestype'] == '') echo ' selected'; ?>><?php echo _("All"); ?></option>
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
 		    </li>
394 394
 		    <?php
395 395
 			}
396
-		    ?>
396
+			?>
397 397
 		    <li><?php echo _("Distance unit:"); ?>
398 398
 			<select class="selectpicker" onchange="unitdistance(this);">
399 399
 			    <option value="km"<?php if ((!isset($_COOKIE['unitdistance']) && (!isset($globalUnitDistance) || (isset($globalUnitDistance) && $globalUnitDistance == 'km'))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) echo ' selected'; ?>>km</option>
@@ -419,7 +419,7 @@  discard block
 block discarded – undo
419 419
 	    <p><?php echo _("Any change in settings reload page"); ?></p>
420 420
     	</div>
421 421
 <?php
422
-    if (isset($globalMapSatellites) && $globalMapSatellites && isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') {
422
+	if (isset($globalMapSatellites) && $globalMapSatellites && isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') {
423 423
 ?>
424 424
         <div class="sidebar-pane" id="satellites">
425 425
 	    <h1 class="sidebar-header"><?php echo _("Satellites"); ?><span class="sidebar-close"><i class="fa fa-caret-left"></i></span></h1>
@@ -459,14 +459,14 @@  discard block
 block discarded – undo
459 459
 						print '<option value="'.$type['tle_type'].'">'.$type_name.'</option>';
460 460
 					}
461 461
 				}
462
-			    ?>
462
+				?>
463 463
 			</select>
464 464
 		    </li>
465 465
 		</ul>
466 466
 	    </form>
467 467
 	</div>
468 468
 <?php
469
-    }
469
+	}
470 470
 ?>
471 471
     </div>
472 472
 </div>
Please login to merge, or discard this patch.
notam-data.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
7 7
 <button type="button" class="close">&times;</button>
8 8
 <?php
9 9
 
10
-$notamref = filter_input(INPUT_GET,'notam',FILTER_SANITIZE_STRING);
10
+$notamref = filter_input(INPUT_GET, 'notam', FILTER_SANITIZE_STRING);
11 11
 $notamref = urldecode($notamref);
12 12
 $NOTAM = new NOTAM();
13 13
 $notam = $NOTAM->getNOTAMbyRef($notamref);
Please login to merge, or discard this patch.