Completed
Push — master ( 012813...8fb9b9 )
by Yannick
08:10
created
aircraft-data.php 2 patches
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -9,14 +9,14 @@  discard block
 block discarded – undo
9 9
 
10 10
 $from_archive = false;
11 11
 if (isset($_GET['ident'])) {
12
-	$ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING);
12
+	$ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING);
13 13
 	if (isset($_GET['currenttime'])) {
14
-		$currenttime = filter_input(INPUT_GET,'currenttime',FILTER_SANITIZE_NUMBER_INT);
14
+		$currenttime = filter_input(INPUT_GET, 'currenttime', FILTER_SANITIZE_NUMBER_INT);
15 15
 		$currenttime = round($currenttime/1000);
16
-		$spotter_array = $SpotterLive->getDateLiveSpotterDataByIdent($ident,$currenttime);
16
+		$spotter_array = $SpotterLive->getDateLiveSpotterDataByIdent($ident, $currenttime);
17 17
 		if (empty($spotter_array)) {
18 18
 			$from_archive = true;
19
-			$spotter_array = $SpotterArchive->getDateArchiveSpotterDataByIdent($ident,$currenttime);
19
+			$spotter_array = $SpotterArchive->getDateArchiveSpotterDataByIdent($ident, $currenttime);
20 20
 		}
21 21
 	} else {
22 22
 		$spotter_array = $SpotterLive->getLastLiveSpotterDataByIdent($ident);
@@ -27,15 +27,15 @@  discard block
 block discarded – undo
27 27
 	}
28 28
 }
29 29
 if (isset($_GET['flightaware_id'])) {
30
-	$flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING);
30
+	$flightaware_id = filter_input(INPUT_GET, 'flightaware_id', FILTER_SANITIZE_STRING);
31 31
 	if (isset($_GET['currenttime'])) {
32
-		$currenttime = filter_input(INPUT_GET,'currenttime',FILTER_SANITIZE_NUMBER_INT);
32
+		$currenttime = filter_input(INPUT_GET, 'currenttime', FILTER_SANITIZE_NUMBER_INT);
33 33
 		$currenttime = round($currenttime/1000);
34
-		$spotter_array = $SpotterLive->getDateLiveSpotterDataById($flightaware_id,$currenttime);
34
+		$spotter_array = $SpotterLive->getDateLiveSpotterDataById($flightaware_id, $currenttime);
35 35
 		if (empty($spotter_array)) {
36 36
 			$from_archive = true;
37 37
 //			$spotter_array = $SpotterArchive->getLastArchiveSpotterDataById($flightaware_id);
38
-			$spotter_array = $SpotterArchive->getDateArchiveSpotterDataById($flightaware_id,$currenttime);
38
+			$spotter_array = $SpotterArchive->getDateArchiveSpotterDataById($flightaware_id, $currenttime);
39 39
 		}
40 40
 	} else {
41 41
 		$spotter_array = $SpotterLive->getLastLiveSpotterDataById($flightaware_id);
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 if (isset($spotter_item['image_thumbnail']) && $spotter_item['image_thumbnail'] != "")
55 55
 {
56 56
 	if ($spotter_item['image_source'] == 'flickr' || $spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart') {
57
-		$image = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']);
57
+		$image = preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']);
58 58
 	} else $image = $spotter_item['image_thumbnail'];
59 59
 
60 60
 }
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 print '<div class="nomobile airports"><div class="airport"><span class="code"><a href="'.$globalURL.'/airport/'.$spotter_item['departure_airport'].'" target="_blank">'.$spotter_item['departure_airport'].'</a></span>'.$spotter_item['departure_airport_city'].' '.$spotter_item['departure_airport_country'];
73 73
 if (isset($spotter_item['departure_airport_time'])) {
74 74
 	if ($spotter_item['departure_airport_time'] > 2460) {
75
-		print '<br /><span class="time">'.date('H:m',$spotter_item['departure_airport_time']).'</span>';
75
+		print '<br /><span class="time">'.date('H:m', $spotter_item['departure_airport_time']).'</span>';
76 76
 	} else {
77 77
 		print '<br /><span class="time">'.$spotter_item['departure_airport_time'].'</span>';
78 78
 	}
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 print '<span class="code"><a href="'.$globalURL.'/airport/'.$spotter_item['arrival_airport'].'" target="_blank">'.$spotter_item['arrival_airport'].'</a></span>'.$spotter_item['arrival_airport_city'].' '.$spotter_item['arrival_airport_country'];
82 82
 if (isset($spotter_item['arrival_airport_time'])) {
83 83
 	if ($spotter_item['arrival_airport_time'] > 2460) {
84
-		print '<br /><span class="time">'.date('H:m',$spotter_item['arrival_airport_time']).'</span>';
84
+		print '<br /><span class="time">'.date('H:m', $spotter_item['arrival_airport_time']).'</span>';
85 85
 	} else {
86 86
 		print '<br /><span class="time">'.$spotter_item['arrival_airport_time'].'</span>';
87 87
 	}
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 
150 150
 if (isset($globalphpVMS) && $globalphpVMS && isset($globalVATSIM) && $globalVATSIM && isset($globalIVAO) && $globalIVAO && isset($spotter_item['format_source']) && $spotter_item['format_source'] != '' && $spotter_item['format_source'] != 'pireps') print '<div class="waypoints"><span>'._("Source").'</span>'.$spotter_item['format_source'].'</div>';
151 151
 if (isset($spotter_item['waypoints']) && $spotter_item['waypoints'] != '') print '<div class="waypoints"><span>'._("Route").'</span>'.$spotter_item['waypoints'].'</div>';
152
-if (isset($spotter_item['acars']['message'])) print '<div class="acars"><span>'._("Latest ACARS message").'</span>'.trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'<br/>',$spotter_item['acars']['message'])).'</div>';
152
+if (isset($spotter_item['acars']['message'])) print '<div class="acars"><span>'._("Latest ACARS message").'</span>'.trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '<br/>', $spotter_item['acars']['message'])).'</div>';
153 153
 if (isset($spotter_item['squawk']) && $spotter_item['squawk'] != '' && $spotter_item['squawk'] != 0) print '<div class="bottom">'._("Squawk:").' '.$spotter_item['squawk'].' - '.$spotter_item['squawk_usage'].'</div>';
154 154
 print '</div>';
155 155
 ?>
Please login to merge, or discard this patch.
Braces   +34 added lines, -12 removed lines patch added patch discarded remove patch
@@ -55,7 +55,9 @@  discard block
 block discarded – undo
55 55
 {
56 56
 	if ($spotter_item['image_source'] == 'flickr' || $spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart') {
57 57
 		$image = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']);
58
-	} else $image = $spotter_item['image_thumbnail'];
58
+	} else {
59
+		$image = $spotter_item['image_thumbnail'];
60
+	}
59 61
 
60 62
 }
61 63
 /* else {
@@ -67,7 +69,9 @@  discard block
 block discarded – undo
67 69
 	print '<div class="left"><img src="'.$image.'" alt="'.$spotter_item['registration'].' '.$spotter_item['aircraft_name'].'" title="'.$spotter_item['registration'].' '.$spotter_item['aircraft_name'].' Image &copy; '.$spotter_item['image_copyright'].'"/><br />Image &copy; '.$spotter_item['image_copyright'].'</div>';
68 70
 }
69 71
 print '<div class="right"><div class="callsign-details"><div class="callsign"><a href="'.$globalURL.'/redirect/'.$spotter_item['flightaware_id'].'" target="_blank">'.$spotter_item['ident'].'</a></div>';
70
-if (isset($spotter_item['airline_name'])) print '<div class="airline">'.$spotter_item['airline_name'].'</div>';
72
+if (isset($spotter_item['airline_name'])) {
73
+	print '<div class="airline">'.$spotter_item['airline_name'].'</div>';
74
+}
71 75
 print '</div>';
72 76
 print '<div class="nomobile airports"><div class="airport"><span class="code"><a href="'.$globalURL.'/airport/'.$spotter_item['departure_airport'].'" target="_blank">'.$spotter_item['departure_airport'].'</a></span>'.$spotter_item['departure_airport_city'].' '.$spotter_item['departure_airport_country'];
73 77
 if (isset($spotter_item['departure_airport_time'])) {
@@ -95,9 +99,14 @@  discard block
 block discarded – undo
95 99
 print '<span class="code"><a href="'.$globalURL.'/airport/'.$spotter_item['arrival_airport'].'" target="_blank">'.$spotter_item['arrival_airport'].'</a></span>'.$spotter_item['arrival_airport_city'].' '.$spotter_item['arrival_airport_country'];
96 100
 print '</div></div><div id="aircraft">';
97 101
 print '<span>'._("Aircraft").'</span>';
98
-if (isset($spotter_item['aircraft_wiki'])) print '<a href="'.$spotter_item['aircraft_wiki'].'">'.$spotter_item['aircraft_name'].'</a>';
99
-if (isset($spotter_item['aircraft_type'])) print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')</a>';
100
-else print $spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name'];
102
+if (isset($spotter_item['aircraft_wiki'])) {
103
+	print '<a href="'.$spotter_item['aircraft_wiki'].'">'.$spotter_item['aircraft_name'].'</a>';
104
+}
105
+if (isset($spotter_item['aircraft_type'])) {
106
+	print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')</a>';
107
+} else {
108
+	print $spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name'];
109
+}
101 110
 print '</div>';
102 111
 print '<div id ="altitude"><span>'._("Altitude").'</span>';
103 112
 if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) {
@@ -106,7 +115,9 @@  discard block
 block discarded – undo
106 115
 	print round($spotter_item['altitude']*30.48).' m (FL'.$spotter_item['altitude'].')';
107 116
 }
108 117
 print '</div>';
109
-if (isset($spotter_item['registration']) && $spotter_item['registration'] != '') print '<div><span>'._("Registration").'</span><a href="'.$globalURL.'/registration/'.$spotter_item['registration'].'" target="_blank">'.$spotter_item['registration'].'</a></div>';
118
+if (isset($spotter_item['registration']) && $spotter_item['registration'] != '') {
119
+	print '<div><span>'._("Registration").'</span><a href="'.$globalURL.'/registration/'.$spotter_item['registration'].'" target="_blank">'.$spotter_item['registration'].'</a></div>';
120
+}
110 121
 print '<div id="speed"><span>'._("Speed").'</span>';
111 122
 if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'mph') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'mph')) {
112 123
 	print round($spotter_item['ground_speed']*1.15078).' mph';
@@ -120,8 +131,11 @@  discard block
 block discarded – undo
120 131
 print '<div id="heading"><span>'._("Heading").'</span>'.$spotter_item['heading'].'°</div>';
121 132
 if (isset($spotter_item['pilot_name']) && $spotter_item['pilot_name'] != '') {
122 133
 	print '<div id="pilot"><span>'._("Pilot").'</span>';
123
-	if (isset($spotter_item['pilot_id'])) print $spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')';
124
-	else print $spotter_item['pilot_name'];
134
+	if (isset($spotter_item['pilot_id'])) {
135
+		print $spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')';
136
+	} else {
137
+		print $spotter_item['pilot_name'];
138
+	}
125 139
 	print '</div>';
126 140
 }
127 141
 
@@ -149,10 +163,18 @@  discard block
 block discarded – undo
149 163
 print '</div>';
150 164
 print '</div>';
151 165
 
152
-if (isset($globalphpVMS) && $globalphpVMS && isset($globalVATSIM) && $globalVATSIM && isset($globalIVAO) && $globalIVAO && isset($spotter_item['format_source']) && $spotter_item['format_source'] != '' && $spotter_item['format_source'] != 'pireps') print '<div class="waypoints"><span>'._("Source").'</span>'.$spotter_item['format_source'].'</div>';
153
-if (isset($spotter_item['waypoints']) && $spotter_item['waypoints'] != '') print '<div class="waypoints"><span>'._("Route").'</span>'.$spotter_item['waypoints'].'</div>';
154
-if (isset($spotter_item['acars']['message'])) print '<div class="acars"><span>'._("Latest ACARS message").'</span>'.trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'<br/>',$spotter_item['acars']['message'])).'</div>';
155
-if (isset($spotter_item['squawk']) && $spotter_item['squawk'] != '' && $spotter_item['squawk'] != 0) print '<div class="bottom">'._("Squawk:").' '.$spotter_item['squawk'].' - '.$spotter_item['squawk_usage'].'</div>';
166
+if (isset($globalphpVMS) && $globalphpVMS && isset($globalVATSIM) && $globalVATSIM && isset($globalIVAO) && $globalIVAO && isset($spotter_item['format_source']) && $spotter_item['format_source'] != '' && $spotter_item['format_source'] != 'pireps') {
167
+	print '<div class="waypoints"><span>'._("Source").'</span>'.$spotter_item['format_source'].'</div>';
168
+}
169
+if (isset($spotter_item['waypoints']) && $spotter_item['waypoints'] != '') {
170
+	print '<div class="waypoints"><span>'._("Route").'</span>'.$spotter_item['waypoints'].'</div>';
171
+}
172
+if (isset($spotter_item['acars']['message'])) {
173
+	print '<div class="acars"><span>'._("Latest ACARS message").'</span>'.trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'<br/>',$spotter_item['acars']['message'])).'</div>';
174
+}
175
+if (isset($spotter_item['squawk']) && $spotter_item['squawk'] != '' && $spotter_item['squawk'] != 0) {
176
+	print '<div class="bottom">'._("Squawk:").' '.$spotter_item['squawk'].' - '.$spotter_item['squawk_usage'].'</div>';
177
+}
156 178
 print '</div>';
157 179
 ?>
158 180
 </div>
159 181
\ No newline at end of file
Please login to merge, or discard this patch.
airport-statistics-route.php 3 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -7,14 +7,14 @@  discard block
 block discarded – undo
7 7
         header('Location: '.$globalURL.'/airport');
8 8
         die();
9 9
 }
10
-$airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING);
10
+$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING);
11 11
 $Spotter = new Spotter();
12
-$spotter_array = $Spotter->getSpotterDataByAirport($airport,"0,1","");
12
+$spotter_array = $Spotter->getSpotterDataByAirport($airport, "0,1", "");
13 13
 $airport_array = $Spotter->getAllAirportInfo($airport);
14 14
 
15 15
 if (!empty($airport_array))
16 16
 {
17
-	$title = sprintf(_("Most Common Routes to/from %s, %s (%s)"),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']);
17
+	$title = sprintf(_("Most Common Routes to/from %s, %s (%s)"), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']);
18 18
 
19 19
 	require_once('header.php');
20 20
 	print '<div class="select-item">';
@@ -25,9 +25,9 @@  discard block
 block discarded – undo
25 25
 	$airport_names = $Stats->getAllAirportNames();
26 26
 	if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames();
27 27
 	ksort($airport_names);
28
-	foreach($airport_names as $airport_name)
28
+	foreach ($airport_names as $airport_name)
29 29
 	{
30
-		if($airport == $airport_name['airport_icao'])
30
+		if ($airport == $airport_name['airport_icao'])
31 31
 		{
32 32
 			print '<option value="'.$airport_name['airport_icao'].'" selected="selected">'.$airport_name['airport_city'].', '.$airport_name['airport_name'].', '.$airport_name['airport_country'].' ('.$airport_name['airport_icao'].')</option>';
33 33
 		} else {
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 	include('airport-sub-menu.php');
59 59
 	print '<div class="column">';
60 60
 	print '<h2>'._("Most Common Routes").'</h2>';
61
-	print '<p>'.sprintf(_("The statistic below shows the most common routes to/from <strong>%s, %s (%s)</strong>."),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']).'</p>';
61
+	print '<p>'.sprintf(_("The statistic below shows the most common routes to/from <strong>%s, %s (%s)</strong>."), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']).'</p>';
62 62
 
63 63
 	$route_array = $Spotter->countAllRoutesByAirport($airport);
64 64
 	if (!empty($route_array))
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 		print '</thead>';
75 75
 		print '<tbody>';
76 76
 		$i = 1;
77
-		foreach($route_array as $route_item)
77
+		foreach ($route_array as $route_item)
78 78
 		{
79 79
 			print '<tr>';
80 80
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@
 block discarded – undo
4 4
 require_once('require/class.Stats.php');
5 5
 require_once('require/class.Language.php');
6 6
 if (!isset($_GET['airport'])) {
7
-        header('Location: '.$globalURL.'/airport');
8
-        die();
7
+		header('Location: '.$globalURL.'/airport');
8
+		die();
9 9
 }
10 10
 $airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING);
11 11
 $Spotter = new Spotter();
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,9 @@
 block discarded – undo
23 23
 	print '<option></option>';
24 24
 	$Stats = new Stats();
25 25
 	$airport_names = $Stats->getAllAirportNames();
26
-	if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames();
26
+	if (empty($airport_names)) {
27
+		$airport_names = $Spotter->getAllAirportNames();
28
+	}
27 29
 	ksort($airport_names);
28 30
 	foreach($airport_names as $airport_name)
29 31
 	{
Please login to merge, or discard this patch.
airport-statistics-time.php 3 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -7,14 +7,14 @@  discard block
 block discarded – undo
7 7
         header('Location: '.$globalURL.'/airport');
8 8
         die();
9 9
 }
10
-$airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING);
10
+$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING);
11 11
 $Spotter = new Spotter();
12
-$spotter_array = $Spotter->getSpotterDataByAirport($airport,"0,1","");
12
+$spotter_array = $Spotter->getSpotterDataByAirport($airport, "0,1", "");
13 13
 $airport_array = $Spotter->getAllAirportInfo($airport);
14 14
 
15 15
 if (!empty($airport_array))
16 16
 {
17
-	$title = sprintf(_("Most Common Time of Day to/from %s, %s (%s)"),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']);
17
+	$title = sprintf(_("Most Common Time of Day to/from %s, %s (%s)"), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']);
18 18
 
19 19
 	require_once('header.php');
20 20
 	print '<div class="select-item">';
@@ -25,9 +25,9 @@  discard block
 block discarded – undo
25 25
 	$airport_names = $Stats->getAllAirportNames();
26 26
 	if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames();
27 27
 	ksort($airport_names);
28
-	foreach($airport_names as $airport_name)
28
+	foreach ($airport_names as $airport_name)
29 29
 	{
30
-		if($airport == $airport_name['airport_icao'])
30
+		if ($airport == $airport_name['airport_icao'])
31 31
 		{
32 32
 			print '<option value="'.$airport_name['airport_icao'].'" selected="selected">'.$airport_name['airport_city'].', '.$airport_name['airport_name'].', '.$airport_name['airport_country'].' ('.$airport_name['airport_icao'].')</option>';
33 33
 		} else {
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 	include('airport-sub-menu.php');
59 59
 	print '<div class="column">';
60 60
 	print '<h2>'._("Most Common Time of Day").'</h2>';
61
-	print '<p>'.sprintf(_("The statistic below shows the most common time of day to/from <strong>%s, %s (%s)</strong>."),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']).'</p>';
61
+	print '<p>'.sprintf(_("The statistic below shows the most common time of day to/from <strong>%s, %s (%s)</strong>."), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']).'</p>';
62 62
 
63 63
 	$hour_array = $Spotter->countAllHoursByAirport($airport);
64 64
 	print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>';
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
             var data = google.visualization.arrayToDataTable([
71 71
             	["'._("Hour").'", "'._("# of Flights").'"], ';
72 72
             $hour_data = '';
73
-	foreach($hour_array as $hour_item)
73
+	foreach ($hour_array as $hour_item)
74 74
 	{
75 75
 		$hour_data .= '[ "'.date("ga", strtotime($hour_item['hour_name'].":00")).'",'.$hour_item['hour_count'].'],';
76 76
 	}
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@  discard block
 block discarded – undo
4 4
 require_once('require/class.Stats.php');
5 5
 require_once('require/class.Language.php');
6 6
 if (!isset($_GET['airport'])) {
7
-        header('Location: '.$globalURL.'/airport');
8
-        die();
7
+		header('Location: '.$globalURL.'/airport');
8
+		die();
9 9
 }
10 10
 $airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING);
11 11
 $Spotter = new Spotter();
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
           function drawChart() {
70 70
             var data = google.visualization.arrayToDataTable([
71 71
             	["'._("Hour").'", "'._("# of Flights").'"], ';
72
-            $hour_data = '';
72
+			$hour_data = '';
73 73
 	foreach($hour_array as $hour_item)
74 74
 	{
75 75
 		$hour_data .= '[ "'.date("ga", strtotime($hour_item['hour_name'].":00")).'",'.$hour_item['hour_count'].'],';
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,9 @@
 block discarded – undo
23 23
 	print '<option></option>';
24 24
 	$Stats = new Stats();
25 25
 	$airport_names = $Stats->getAllAirportNames();
26
-	if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames();
26
+	if (empty($airport_names)) {
27
+		$airport_names = $Spotter->getAllAirportNames();
28
+	}
27 29
 	ksort($airport_names);
28 30
 	foreach($airport_names as $airport_name)
29 31
 	{
Please login to merge, or discard this patch.
install/index.php 3 patches
Indentation   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -305,17 +305,17 @@  discard block
 block discarded – undo
305 305
 				</tr>
306 306
 				<!--
307 307
 		<?php
308
-		    require_once(dirname(__FILE__).'/../require/class.Connection.php');
309
-		    $Connection = new Connection();
308
+			require_once(dirname(__FILE__).'/../require/class.Connection.php');
309
+			$Connection = new Connection();
310 310
 		?>
311 311
 				-->
312 312
 		<?php
313
-		    if ($Connection->db != NULL) {
313
+			if ($Connection->db != NULL) {
314 314
 			if ($Connection->tableExists('source_location')) {
315
-			    require_once(dirname(__FILE__).'/../require/class.Source.php');
316
-			    $Source = new Source();
317
-			    $alllocations = $Source->getAllLocationInfo();
318
-			    foreach ($alllocations as $location) {
315
+				require_once(dirname(__FILE__).'/../require/class.Source.php');
316
+				$Source = new Source();
317
+				$alllocations = $Source->getAllLocationInfo();
318
+				foreach ($alllocations as $location) {
319 319
 		?>
320 320
 				<tr>
321 321
 	    				<input type="hidden" name="source_id[]" value="<?php print $location['id']; ?>" />
@@ -329,9 +329,9 @@  discard block
 block discarded – undo
329 329
 				</tr>
330 330
 		
331 331
 		<?php
332
-			    }
332
+				}
333
+			}
333 334
 			}
334
-		    }
335 335
 		?>
336 336
 
337 337
 				<tr>
@@ -424,12 +424,12 @@  discard block
 block discarded – undo
424 424
 ?>
425 425
 							<tr>
426 426
 								<?php
427
-								    if (filter_var($source['host'],FILTER_VALIDATE_URL)) {
427
+									if (filter_var($source['host'],FILTER_VALIDATE_URL)) {
428 428
 								?>
429 429
 								<td><input type="text" name="host[]" id="host" value="<?php print $source['host']; ?>" /></td>
430 430
 								<td><input type="number" name="port[]" id="port" value="<?php print $source['port']; ?>" /></td>
431 431
 								<?php
432
-								    } else {
432
+									} else {
433 433
 									$hostport = explode(':',$source['host']);
434 434
 									if (isset($hostport[1])) {
435 435
 										$host = $hostport[0];
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
 								<td><input type="text" name="host[]" id="host" value="<?php print $host; ?>" /></td>
443 443
 								<td><input type="number" name="port[]" id="port" value="<?php print $port; ?>" /></td>
444 444
 								<?php
445
-								    }
445
+									}
446 446
 								?>
447 447
 								<td>
448 448
 									<select name="format[]" id="format">
@@ -758,7 +758,7 @@  discard block
 block discarded – undo
758 758
 			<br />
759 759
 			<p>
760 760
 			<?php 
761
-			    if (extension_loaded('gd') && function_exists('gd_info')) {
761
+				if (extension_loaded('gd') && function_exists('gd_info')) {
762 762
 			?>
763 763
 				<label for="aircrafticoncolor">Color of aircraft icon on map</label>
764 764
 				<input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) echo $globalAircraftIconColor; else echo '1a3151'; ?>" />
@@ -768,11 +768,11 @@  discard block
 block discarded – undo
768 768
 				<b>The directory cache is not writable, aircraft icon will not be cached</b>
769 769
 			<?php
770 770
 				}
771
-			    } else {
771
+				} else {
772 772
 			?>
773 773
 				<b>PHP GD is not installed, you can t change color of aircraft icon on map</b>
774 774
 			<?php
775
-			    }
775
+				}
776 776
 			?>
777 777
 			</p>
778 778
 			<br />
@@ -791,7 +791,7 @@  discard block
 block discarded – undo
791 791
 	</p>
792 792
 <?php
793 793
 	require('../footer.php');
794
-        exit;
794
+		exit;
795 795
 }
796 796
 	
797 797
 $settings = array();
@@ -881,8 +881,8 @@  discard block
 block discarded – undo
881 881
 	
882 882
 	$sources = array();
883 883
 	foreach ($source_name as $keys => $name) {
884
-	    if (isset($source_id[$keys])) $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'id' => $source_id[$keys],'source' => $source_ref[$keys]);
885
-	    else $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'source' => $source_ref[$keys]);
884
+		if (isset($source_id[$keys])) $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'id' => $source_id[$keys],'source' => $source_ref[$keys]);
885
+		else $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'source' => $source_ref[$keys]);
886 886
 	}
887 887
 	if (count($sources) > 0) $_SESSION['sources'] = $sources;
888 888
 
@@ -1176,14 +1176,14 @@  discard block
 block discarded – undo
1176 1176
 
1177 1177
 	// Set some defaults values...
1178 1178
 	if (!isset($globalAircraftImageSources)) {
1179
-	    $globalAircraftImageSources = array('ivaomtl','wikimedia','airportdata','deviantart','flickr','bing','jetphotos','planepictures','planespotters');
1180
-	    $settings = array_merge($settings,array('globalAircraftImageSources' => $globalAircraftImageSources));
1179
+		$globalAircraftImageSources = array('ivaomtl','wikimedia','airportdata','deviantart','flickr','bing','jetphotos','planepictures','planespotters');
1180
+		$settings = array_merge($settings,array('globalAircraftImageSources' => $globalAircraftImageSources));
1181 1181
 	}
1182 1182
 
1183 1183
 	if (!isset($globalSchedulesSources)) {
1184
-	    $globalSchedulesSources = array('flightmapper','costtotravel','flightradar24','flightaware');
1185
-    	    $settings = array_merge($settings,array('globalSchedulesSources' => $globalSchedulesSources));
1186
-    	}
1184
+		$globalSchedulesSources = array('flightmapper','costtotravel','flightradar24','flightaware');
1185
+			$settings = array_merge($settings,array('globalSchedulesSources' => $globalSchedulesSources));
1186
+		}
1187 1187
 
1188 1188
 	$settings = array_merge($settings,array('globalInstalled' => 'TRUE'));
1189 1189
 
@@ -1235,21 +1235,21 @@  discard block
 block discarded – undo
1235 1235
 	$popi = false;
1236 1236
 	$popw = false;
1237 1237
 	foreach ($_SESSION['done'] as $done) {
1238
-	    print '<li>'.$done.'....<strong>SUCCESS</strong></li>';
1239
-	    if ($done == 'Create database') $pop = true;
1240
-	    if ($_SESSION['install'] == 'database_create') $pop = true;
1241
-	    if ($_SESSION['install'] == 'database_import') $popi = true;
1242
-	    if ($_SESSION['install'] == 'waypoints') $popw = true;
1238
+		print '<li>'.$done.'....<strong>SUCCESS</strong></li>';
1239
+		if ($done == 'Create database') $pop = true;
1240
+		if ($_SESSION['install'] == 'database_create') $pop = true;
1241
+		if ($_SESSION['install'] == 'database_import') $popi = true;
1242
+		if ($_SESSION['install'] == 'waypoints') $popw = true;
1243 1243
 	}
1244 1244
 	if ($pop) {
1245
-	    sleep(5);
1246
-	    print '<li>Create database....<img src="../images/loading.gif" /></li>';
1245
+		sleep(5);
1246
+		print '<li>Create database....<img src="../images/loading.gif" /></li>';
1247 1247
 	} else if ($popi) {
1248
-	    sleep(5);
1249
-	    print '<li>Create and import tables....<img src="../images/loading.gif" /></li>';
1248
+		sleep(5);
1249
+		print '<li>Create and import tables....<img src="../images/loading.gif" /></li>';
1250 1250
 	} else if ($popw) {
1251
-	    sleep(5);
1252
-	    print '<li>Populate waypoints database....<img src="../images/loading.gif" /></li>';
1251
+		sleep(5);
1252
+		print '<li>Populate waypoints database....<img src="../images/loading.gif" /></li>';
1253 1253
 	} else print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>';
1254 1254
 	print '</div></ul>';
1255 1255
 	print '<div id="error"></div>';
@@ -1312,7 +1312,7 @@  discard block
 block discarded – undo
1312 1312
 	unset($_COOKIE['install']);
1313 1313
 	print '<div class="info column"><ul>';
1314 1314
 	foreach ($_SESSION['done'] as $done) {
1315
-	    print '<li>'.$done.'....<strong>SUCCESS</strong></li>';
1315
+		print '<li>'.$done.'....<strong>SUCCESS</strong></li>';
1316 1316
 	}
1317 1317
 	print '<li>Reloading page to check all is now ok....<strong>SUCCESS</strong></li>';
1318 1318
 	print '</ul></div>';
Please login to merge, or discard this patch.
Spacing   +213 added lines, -213 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 require_once(dirname(__FILE__).'/class.create_db.php');
11 11
 require_once(dirname(__FILE__).'/class.update_schema.php');
12 12
 require_once(dirname(__FILE__).'/class.settings.php');
13
-$title="Install";
13
+$title = "Install";
14 14
 require(dirname(__FILE__).'/../require/settings.php');
15 15
 require(dirname(__FILE__).'/header.php');
16 16
 
@@ -69,8 +69,8 @@  discard block
 block discarded – undo
69 69
 if (!extension_loaded('curl')) {
70 70
 	$error[] = "Curl is not loaded.";
71 71
 }
72
-if(function_exists('apache_get_modules') ){
73
-	if(!in_array('mod_rewrite',apache_get_modules())) {
72
+if (function_exists('apache_get_modules')) {
73
+	if (!in_array('mod_rewrite', apache_get_modules())) {
74 74
 		$error[] = "mod_rewrite is not available.";
75 75
 	}
76 76
 /*
@@ -86,8 +86,8 @@  discard block
 block discarded – undo
86 86
 print '<div class="info column"><p><strong>If you use MySQL or MariaDB, check that <i>max_allowed_packet</i> >= 8M, else import of some table can fail.</strong></p></div>';
87 87
 if (isset($_SERVER['REQUEST_SCHEME']) && isset($_SERVER['SERVER_NAME']) && isset($_SERVER['SERVER_PORT']) && isset($_SERVER['REQUEST_URI'])) {
88 88
 	if (function_exists('get_headers')) {
89
-		$check_header = @get_headers($_SERVER['REQUEST_SCHEME'].'://'.$_SERVER["SERVER_NAME"].':'.$_SERVER["SERVER_PORT"].str_replace('install/','search',str_replace('index.php',$_SERVER["REQUEST_URI"])));
90
-		if (isset($check_header[0]) && !stripos($check_header[0],"200 OK")) {
89
+		$check_header = @get_headers($_SERVER['REQUEST_SCHEME'].'://'.$_SERVER["SERVER_NAME"].':'.$_SERVER["SERVER_PORT"].str_replace('install/', 'search', str_replace('index.php', $_SERVER["REQUEST_URI"])));
90
+		if (isset($check_header[0]) && !stripos($check_header[0], "200 OK")) {
91 91
 			print '<div class="info column"><p><strong>Check your configuration, rewrite don\'t seems to work.</strong></p></div>';
92 92
 		}
93 93
 	}
@@ -439,13 +439,13 @@  discard block
 block discarded – undo
439 439
 ?>
440 440
 							<tr>
441 441
 								<?php
442
-								    if (filter_var($source['host'],FILTER_VALIDATE_URL)) {
442
+								    if (filter_var($source['host'], FILTER_VALIDATE_URL)) {
443 443
 								?>
444 444
 								<td><input type="text" name="host[]" id="host" value="<?php print $source['host']; ?>" /></td>
445 445
 								<td><input type="number" name="port[]" id="port" value="<?php print $source['port']; ?>" /></td>
446 446
 								<?php
447 447
 								    } else {
448
-									$hostport = explode(':',$source['host']);
448
+									$hostport = explode(':', $source['host']);
449 449
 									if (isset($hostport[1])) {
450 450
 										$host = $hostport[0];
451 451
 										$port = $hostport[1];
@@ -789,7 +789,7 @@  discard block
 block discarded – undo
789 789
 			<br />
790 790
 			<p>
791 791
 				<label for="aircraftsize">Size of aircraft icon on map (default to 30px if zoom > 7 else 15px), empty to default</label>
792
-				<input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize;?>" />
792
+				<input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize; ?>" />
793 793
 			</p>
794 794
 			<br />
795 795
 			<p>
@@ -835,14 +835,14 @@  discard block
 block discarded – undo
835 835
 $error = '';
836 836
 
837 837
 if (isset($_POST['dbtype'])) {
838
-	$dbtype = filter_input(INPUT_POST,'dbtype',FILTER_SANITIZE_STRING);
839
-	$dbroot = filter_input(INPUT_POST,'dbroot',FILTER_SANITIZE_STRING);
840
-	$dbrootpass = filter_input(INPUT_POST,'dbrootpass',FILTER_SANITIZE_STRING);
841
-	$dbname = filter_input(INPUT_POST,'dbname',FILTER_SANITIZE_STRING);
842
-	$dbuser = filter_input(INPUT_POST,'dbuser',FILTER_SANITIZE_STRING);
843
-	$dbuserpass = filter_input(INPUT_POST,'dbuserpass',FILTER_SANITIZE_STRING);
844
-	$dbhost = filter_input(INPUT_POST,'dbhost',FILTER_SANITIZE_STRING);
845
-	$dbport = filter_input(INPUT_POST,'dbport',FILTER_SANITIZE_STRING);
838
+	$dbtype = filter_input(INPUT_POST, 'dbtype', FILTER_SANITIZE_STRING);
839
+	$dbroot = filter_input(INPUT_POST, 'dbroot', FILTER_SANITIZE_STRING);
840
+	$dbrootpass = filter_input(INPUT_POST, 'dbrootpass', FILTER_SANITIZE_STRING);
841
+	$dbname = filter_input(INPUT_POST, 'dbname', FILTER_SANITIZE_STRING);
842
+	$dbuser = filter_input(INPUT_POST, 'dbuser', FILTER_SANITIZE_STRING);
843
+	$dbuserpass = filter_input(INPUT_POST, 'dbuserpass', FILTER_SANITIZE_STRING);
844
+	$dbhost = filter_input(INPUT_POST, 'dbhost', FILTER_SANITIZE_STRING);
845
+	$dbport = filter_input(INPUT_POST, 'dbport', FILTER_SANITIZE_STRING);
846 846
 
847 847
 	if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) $error .= 'Mysql driver for PDO must be loaded';
848 848
 	if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) $error .= 'PosgreSQL driver for PDO must be loaded';
@@ -862,48 +862,48 @@  discard block
 block discarded – undo
862 862
 	} else $settings = array_merge($settings,array('globalDBdriver' => $dbtype,'globalDBhost' => $dbhost,'globalDBuser' => $dbuser,'globalDBport' => $dbport,'globalDBpass' => $dbuserpass,'globalDBname' => $dbname));
863 863
 	*/
864 864
 	
865
-	$settings = array_merge($settings,array('globalDBdriver' => $dbtype,'globalDBhost' => $dbhost,'globalDBuser' => $dbuser,'globalDBport' => $dbport,'globalDBpass' => $dbuserpass,'globalDBname' => $dbname));
865
+	$settings = array_merge($settings, array('globalDBdriver' => $dbtype, 'globalDBhost' => $dbhost, 'globalDBuser' => $dbuser, 'globalDBport' => $dbport, 'globalDBpass' => $dbuserpass, 'globalDBname' => $dbname));
866 866
 
867
-	$sitename = filter_input(INPUT_POST,'sitename',FILTER_SANITIZE_STRING);
868
-	$siteurl = filter_input(INPUT_POST,'siteurl',FILTER_SANITIZE_STRING);
869
-	$timezone = filter_input(INPUT_POST,'timezone',FILTER_SANITIZE_STRING);
870
-	$language = filter_input(INPUT_POST,'language',FILTER_SANITIZE_STRING);
871
-	$settings = array_merge($settings,array('globalName' => $sitename,'globalURL' => $siteurl, 'globalTimezone' => $timezone,'globalLanguage' => $language));
867
+	$sitename = filter_input(INPUT_POST, 'sitename', FILTER_SANITIZE_STRING);
868
+	$siteurl = filter_input(INPUT_POST, 'siteurl', FILTER_SANITIZE_STRING);
869
+	$timezone = filter_input(INPUT_POST, 'timezone', FILTER_SANITIZE_STRING);
870
+	$language = filter_input(INPUT_POST, 'language', FILTER_SANITIZE_STRING);
871
+	$settings = array_merge($settings, array('globalName' => $sitename, 'globalURL' => $siteurl, 'globalTimezone' => $timezone, 'globalLanguage' => $language));
872 872
 
873
-	$mapprovider = filter_input(INPUT_POST,'mapprovider',FILTER_SANITIZE_STRING);
874
-	$mapboxid = filter_input(INPUT_POST,'mapboxid',FILTER_SANITIZE_STRING);
875
-	$mapboxtoken = filter_input(INPUT_POST,'mapboxtoken',FILTER_SANITIZE_STRING);
876
-	$googlekey = filter_input(INPUT_POST,'googlekey',FILTER_SANITIZE_STRING);
877
-	$bingkey = filter_input(INPUT_POST,'bingkey',FILTER_SANITIZE_STRING);
878
-	$mapquestkey = filter_input(INPUT_POST,'mapquestkey',FILTER_SANITIZE_STRING);
879
-	$hereappid = filter_input(INPUT_POST,'hereappid',FILTER_SANITIZE_STRING);
880
-	$hereappcode = filter_input(INPUT_POST,'hereappcode',FILTER_SANITIZE_STRING);
881
-	$settings = array_merge($settings,array('globalMapProvider' => $mapprovider,'globalMapboxId' => $mapboxid,'globalMapboxToken' => $mapboxtoken,'globalGoogleAPIKey' => $googlekey,'globalBingMapKey' => $bingkey,'globalHereappID' => $hereappid,'globalHereappCode' => $hereappcode,'globalMapQuestKey' => $mapquestkey));
873
+	$mapprovider = filter_input(INPUT_POST, 'mapprovider', FILTER_SANITIZE_STRING);
874
+	$mapboxid = filter_input(INPUT_POST, 'mapboxid', FILTER_SANITIZE_STRING);
875
+	$mapboxtoken = filter_input(INPUT_POST, 'mapboxtoken', FILTER_SANITIZE_STRING);
876
+	$googlekey = filter_input(INPUT_POST, 'googlekey', FILTER_SANITIZE_STRING);
877
+	$bingkey = filter_input(INPUT_POST, 'bingkey', FILTER_SANITIZE_STRING);
878
+	$mapquestkey = filter_input(INPUT_POST, 'mapquestkey', FILTER_SANITIZE_STRING);
879
+	$hereappid = filter_input(INPUT_POST, 'hereappid', FILTER_SANITIZE_STRING);
880
+	$hereappcode = filter_input(INPUT_POST, 'hereappcode', FILTER_SANITIZE_STRING);
881
+	$settings = array_merge($settings, array('globalMapProvider' => $mapprovider, 'globalMapboxId' => $mapboxid, 'globalMapboxToken' => $mapboxtoken, 'globalGoogleAPIKey' => $googlekey, 'globalBingMapKey' => $bingkey, 'globalHereappID' => $hereappid, 'globalHereappCode' => $hereappcode, 'globalMapQuestKey' => $mapquestkey));
882 882
 	
883
-	$latitudemax = filter_input(INPUT_POST,'latitudemax',FILTER_SANITIZE_STRING);
884
-	$latitudemin = filter_input(INPUT_POST,'latitudemin',FILTER_SANITIZE_STRING);
885
-	$longitudemax = filter_input(INPUT_POST,'longitudemax',FILTER_SANITIZE_STRING);
886
-	$longitudemin = filter_input(INPUT_POST,'longitudemin',FILTER_SANITIZE_STRING);
887
-	$livezoom = filter_input(INPUT_POST,'livezoom',FILTER_SANITIZE_NUMBER_INT);
888
-	$settings = array_merge($settings,array('globalLatitudeMax' => $latitudemax,'globalLatitudeMin' => $latitudemin,'globalLongitudeMax' => $longitudemax,'globalLongitudeMin' => $longitudemin,'globalLiveZoom' => $livezoom));
883
+	$latitudemax = filter_input(INPUT_POST, 'latitudemax', FILTER_SANITIZE_STRING);
884
+	$latitudemin = filter_input(INPUT_POST, 'latitudemin', FILTER_SANITIZE_STRING);
885
+	$longitudemax = filter_input(INPUT_POST, 'longitudemax', FILTER_SANITIZE_STRING);
886
+	$longitudemin = filter_input(INPUT_POST, 'longitudemin', FILTER_SANITIZE_STRING);
887
+	$livezoom = filter_input(INPUT_POST, 'livezoom', FILTER_SANITIZE_NUMBER_INT);
888
+	$settings = array_merge($settings, array('globalLatitudeMax' => $latitudemax, 'globalLatitudeMin' => $latitudemin, 'globalLongitudeMax' => $longitudemax, 'globalLongitudeMin' => $longitudemin, 'globalLiveZoom' => $livezoom));
889 889
 
890
-	$squawk_country = filter_input(INPUT_POST,'squawk_country',FILTER_SANITIZE_STRING);
891
-	$settings = array_merge($settings,array('globalSquawkCountry' => $squawk_country));
890
+	$squawk_country = filter_input(INPUT_POST, 'squawk_country', FILTER_SANITIZE_STRING);
891
+	$settings = array_merge($settings, array('globalSquawkCountry' => $squawk_country));
892 892
 
893
-	$latitudecenter = filter_input(INPUT_POST,'latitudecenter',FILTER_SANITIZE_STRING);
894
-	$longitudecenter = filter_input(INPUT_POST,'longitudecenter',FILTER_SANITIZE_STRING);
895
-	$settings = array_merge($settings,array('globalCenterLatitude' => $latitudecenter,'globalCenterLongitude' => $longitudecenter));
893
+	$latitudecenter = filter_input(INPUT_POST, 'latitudecenter', FILTER_SANITIZE_STRING);
894
+	$longitudecenter = filter_input(INPUT_POST, 'longitudecenter', FILTER_SANITIZE_STRING);
895
+	$settings = array_merge($settings, array('globalCenterLatitude' => $latitudecenter, 'globalCenterLongitude' => $longitudecenter));
896 896
 
897
-	$acars = filter_input(INPUT_POST,'acars',FILTER_SANITIZE_STRING);
897
+	$acars = filter_input(INPUT_POST, 'acars', FILTER_SANITIZE_STRING);
898 898
 	if ($acars == 'acars') {
899
-		$settings = array_merge($settings,array('globalACARS' => 'TRUE'));
899
+		$settings = array_merge($settings, array('globalACARS' => 'TRUE'));
900 900
 	} else {
901
-		$settings = array_merge($settings,array('globalACARS' => 'FALSE'));
901
+		$settings = array_merge($settings, array('globalACARS' => 'FALSE'));
902 902
 	}
903 903
 
904
-	$flightawareusername = filter_input(INPUT_POST,'flightawareusername',FILTER_SANITIZE_STRING);
905
-	$flightawarepassword = filter_input(INPUT_POST,'flightawarepassword',FILTER_SANITIZE_STRING);
906
-	$settings = array_merge($settings,array('globalFlightAwareUsername' => $flightawareusername,'globalFlightAwarePassword' => $flightawarepassword));
904
+	$flightawareusername = filter_input(INPUT_POST, 'flightawareusername', FILTER_SANITIZE_STRING);
905
+	$flightawarepassword = filter_input(INPUT_POST, 'flightawarepassword', FILTER_SANITIZE_STRING);
906
+	$settings = array_merge($settings, array('globalFlightAwareUsername' => $flightawareusername, 'globalFlightAwarePassword' => $flightawarepassword));
907 907
 	
908 908
 	$source_name = $_POST['source_name'];
909 909
 	$source_latitude = $_POST['source_latitude'];
@@ -917,8 +917,8 @@  discard block
 block discarded – undo
917 917
 	
918 918
 	$sources = array();
919 919
 	foreach ($source_name as $keys => $name) {
920
-	    if (isset($source_id[$keys])) $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'id' => $source_id[$keys],'source' => $source_ref[$keys]);
921
-	    else $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'source' => $source_ref[$keys]);
920
+	    if (isset($source_id[$keys])) $sources[] = array('name' => $name, 'latitude' => $source_latitude[$keys], 'longitude' => $source_longitude[$keys], 'altitude' => $source_altitude[$keys], 'city' => $source_city[$keys], 'country' => $source_country[$keys], 'id' => $source_id[$keys], 'source' => $source_ref[$keys]);
921
+	    else $sources[] = array('name' => $name, 'latitude' => $source_latitude[$keys], 'longitude' => $source_longitude[$keys], 'altitude' => $source_altitude[$keys], 'city' => $source_city[$keys], 'country' => $source_country[$keys], 'source' => $source_ref[$keys]);
922 922
 	}
923 923
 	if (count($sources) > 0) $_SESSION['sources'] = $sources;
924 924
 
@@ -931,23 +931,23 @@  discard block
 block discarded – undo
931 931
 	$sbsurl = $_POST['sbsurl'];
932 932
 	*/
933 933
 
934
-	$globalvatsim = filter_input(INPUT_POST,'globalvatsim',FILTER_SANITIZE_STRING);
935
-	$globalivao = filter_input(INPUT_POST,'globalivao',FILTER_SANITIZE_STRING);
936
-	$globalphpvms = filter_input(INPUT_POST,'globalphpvms',FILTER_SANITIZE_STRING);
937
-	$globalvam = filter_input(INPUT_POST,'globalvam',FILTER_SANITIZE_STRING);
938
-	$globalsbs = filter_input(INPUT_POST,'globalsbs',FILTER_SANITIZE_STRING);
939
-	$globalaprs = filter_input(INPUT_POST,'globalaprs',FILTER_SANITIZE_STRING);
940
-	$datasource = filter_input(INPUT_POST,'datasource',FILTER_SANITIZE_STRING);
934
+	$globalvatsim = filter_input(INPUT_POST, 'globalvatsim', FILTER_SANITIZE_STRING);
935
+	$globalivao = filter_input(INPUT_POST, 'globalivao', FILTER_SANITIZE_STRING);
936
+	$globalphpvms = filter_input(INPUT_POST, 'globalphpvms', FILTER_SANITIZE_STRING);
937
+	$globalvam = filter_input(INPUT_POST, 'globalvam', FILTER_SANITIZE_STRING);
938
+	$globalsbs = filter_input(INPUT_POST, 'globalsbs', FILTER_SANITIZE_STRING);
939
+	$globalaprs = filter_input(INPUT_POST, 'globalaprs', FILTER_SANITIZE_STRING);
940
+	$datasource = filter_input(INPUT_POST, 'datasource', FILTER_SANITIZE_STRING);
941 941
 
942
-	$globalaircraft = filter_input(INPUT_POST,'globalaircraft',FILTER_SANITIZE_STRING);
943
-	if ($globalaircraft == 'aircraft') $settings = array_merge($settings,array('globalAircraft' => 'TRUE'));
944
-	else $settings = array_merge($settings,array('globalAircraft' => 'FALSE'));
945
-	$globaltracker = filter_input(INPUT_POST,'globaltracker',FILTER_SANITIZE_STRING);
946
-	if ($globaltracker == 'tracker') $settings = array_merge($settings,array('globalTracker' => 'TRUE'));
947
-	else $settings = array_merge($settings,array('globalTracker' => 'FALSE'));
948
-	$globalmarine = filter_input(INPUT_POST,'globalmarine',FILTER_SANITIZE_STRING);
949
-	if ($globalmarine == 'marine') $settings = array_merge($settings,array('globalMarine' => 'TRUE'));
950
-	else $settings = array_merge($settings,array('globalMarine' => 'FALSE'));
942
+	$globalaircraft = filter_input(INPUT_POST, 'globalaircraft', FILTER_SANITIZE_STRING);
943
+	if ($globalaircraft == 'aircraft') $settings = array_merge($settings, array('globalAircraft' => 'TRUE'));
944
+	else $settings = array_merge($settings, array('globalAircraft' => 'FALSE'));
945
+	$globaltracker = filter_input(INPUT_POST, 'globaltracker', FILTER_SANITIZE_STRING);
946
+	if ($globaltracker == 'tracker') $settings = array_merge($settings, array('globalTracker' => 'TRUE'));
947
+	else $settings = array_merge($settings, array('globalTracker' => 'FALSE'));
948
+	$globalmarine = filter_input(INPUT_POST, 'globalmarine', FILTER_SANITIZE_STRING);
949
+	if ($globalmarine == 'marine') $settings = array_merge($settings, array('globalMarine' => 'TRUE'));
950
+	else $settings = array_merge($settings, array('globalMarine' => 'FALSE'));
951 951
 
952 952
 /*	
953 953
 	$globalSBS1Hosts = array();
@@ -963,7 +963,7 @@  discard block
 block discarded – undo
963 963
 	}
964 964
 	$settings = array_merge($settings,array('globalSBS1Hosts' => $globalSBS1Hosts));
965 965
 */
966
-	$settings_comment = array_merge($settings_comment,array('globalSBS1Hosts'));
966
+	$settings_comment = array_merge($settings_comment, array('globalSBS1Hosts'));
967 967
 	$host = $_POST['host'];
968 968
 	$port = $_POST['port'];
969 969
 	$name = $_POST['name'];
@@ -978,96 +978,96 @@  discard block
 block discarded – undo
978 978
 		else $cov = 'FALSE';
979 979
 		if (isset($noarchive[$key]) && $noarchive[$key] == 1) $arch = 'TRUE';
980 980
 		else $arch = 'FALSE';
981
-		if ($h != '') $gSources[] = array('host' => $h, 'port' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch);
981
+		if ($h != '') $gSources[] = array('host' => $h, 'port' => $port[$key], 'name' => $name[$key], 'format' => $format[$key], 'sourcestats' => $cov, 'noarchive' => $arch);
982 982
 	}
983
-	$settings = array_merge($settings,array('globalSources' => $gSources));
983
+	$settings = array_merge($settings, array('globalSources' => $gSources));
984 984
 
985 985
 /*
986 986
 	$sbstimeout = filter_input(INPUT_POST,'sbstimeout',FILTER_SANITIZE_NUMBER_INT);
987 987
 	$settings = array_merge($settings,array('globalSourcesTimeOut' => $sbstimeout));
988 988
 */
989
-	$acarshost = filter_input(INPUT_POST,'acarshost',FILTER_SANITIZE_STRING);
990
-	$acarsport = filter_input(INPUT_POST,'acarsport',FILTER_SANITIZE_NUMBER_INT);
991
-	$settings = array_merge($settings,array('globalACARSHost' => $acarshost,'globalACARSPort' => $acarsport));
989
+	$acarshost = filter_input(INPUT_POST, 'acarshost', FILTER_SANITIZE_STRING);
990
+	$acarsport = filter_input(INPUT_POST, 'acarsport', FILTER_SANITIZE_NUMBER_INT);
991
+	$settings = array_merge($settings, array('globalACARSHost' => $acarshost, 'globalACARSPort' => $acarsport));
992 992
 
993
-	$bitly = filter_input(INPUT_POST,'bitly',FILTER_SANITIZE_STRING);
994
-	$settings = array_merge($settings,array('globalBitlyAccessToken' => $bitly));
993
+	$bitly = filter_input(INPUT_POST, 'bitly', FILTER_SANITIZE_STRING);
994
+	$settings = array_merge($settings, array('globalBitlyAccessToken' => $bitly));
995 995
 
996
-	$notamsource = filter_input(INPUT_POST,'notamsource',FILTER_SANITIZE_STRING);
997
-	$settings = array_merge($settings,array('globalNOTAMSource' => $notamsource));
998
-	$metarsource = filter_input(INPUT_POST,'metarsource',FILTER_SANITIZE_STRING);
999
-	$settings = array_merge($settings,array('globalMETARurl' => $metarsource));
996
+	$notamsource = filter_input(INPUT_POST, 'notamsource', FILTER_SANITIZE_STRING);
997
+	$settings = array_merge($settings, array('globalNOTAMSource' => $notamsource));
998
+	$metarsource = filter_input(INPUT_POST, 'metarsource', FILTER_SANITIZE_STRING);
999
+	$settings = array_merge($settings, array('globalMETARurl' => $metarsource));
1000 1000
 
1001
-	$zoilatitude = filter_input(INPUT_POST,'zoilatitude',FILTER_SANITIZE_STRING);
1002
-	$zoilongitude = filter_input(INPUT_POST,'zoilongitude',FILTER_SANITIZE_STRING);
1003
-	$zoidistance = filter_input(INPUT_POST,'zoidistance',FILTER_SANITIZE_NUMBER_INT);
1001
+	$zoilatitude = filter_input(INPUT_POST, 'zoilatitude', FILTER_SANITIZE_STRING);
1002
+	$zoilongitude = filter_input(INPUT_POST, 'zoilongitude', FILTER_SANITIZE_STRING);
1003
+	$zoidistance = filter_input(INPUT_POST, 'zoidistance', FILTER_SANITIZE_NUMBER_INT);
1004 1004
 	if ($zoilatitude != '' && $zoilongitude != '' && $zoidistance != '') {
1005
-		$settings = array_merge($settings,array('globalDistanceIgnore' => array('latitude' => $zoilatitude,'longitude' => $zoilongitude,'distance' => $zoidistance)));
1006
-	} else $settings = array_merge($settings,array('globalDistanceIgnore' => array()));
1005
+		$settings = array_merge($settings, array('globalDistanceIgnore' => array('latitude' => $zoilatitude, 'longitude' => $zoilongitude, 'distance' => $zoidistance)));
1006
+	} else $settings = array_merge($settings, array('globalDistanceIgnore' => array()));
1007 1007
 
1008
-	$refresh = filter_input(INPUT_POST,'refresh',FILTER_SANITIZE_NUMBER_INT);
1009
-	$settings = array_merge($settings,array('globalLiveInterval' => $refresh));
1010
-	$maprefresh = filter_input(INPUT_POST,'maprefresh',FILTER_SANITIZE_NUMBER_INT);
1011
-	$settings = array_merge($settings,array('globalMapRefresh' => $maprefresh));
1012
-	$mapidle = filter_input(INPUT_POST,'mapidle',FILTER_SANITIZE_NUMBER_INT);
1013
-	$settings = array_merge($settings,array('globalMapIdleTimeout' => $mapidle));
1014
-	$closestmindist = filter_input(INPUT_POST,'closestmindist',FILTER_SANITIZE_NUMBER_INT);
1015
-	$settings = array_merge($settings,array('globalClosestMinDist' => $closestmindist));
1008
+	$refresh = filter_input(INPUT_POST, 'refresh', FILTER_SANITIZE_NUMBER_INT);
1009
+	$settings = array_merge($settings, array('globalLiveInterval' => $refresh));
1010
+	$maprefresh = filter_input(INPUT_POST, 'maprefresh', FILTER_SANITIZE_NUMBER_INT);
1011
+	$settings = array_merge($settings, array('globalMapRefresh' => $maprefresh));
1012
+	$mapidle = filter_input(INPUT_POST, 'mapidle', FILTER_SANITIZE_NUMBER_INT);
1013
+	$settings = array_merge($settings, array('globalMapIdleTimeout' => $mapidle));
1014
+	$closestmindist = filter_input(INPUT_POST, 'closestmindist', FILTER_SANITIZE_NUMBER_INT);
1015
+	$settings = array_merge($settings, array('globalClosestMinDist' => $closestmindist));
1016 1016
 
1017
-	$aircraftsize = filter_input(INPUT_POST,'aircraftsize',FILTER_SANITIZE_NUMBER_INT);
1018
-	$settings = array_merge($settings,array('globalAircraftSize' => $aircraftsize));
1017
+	$aircraftsize = filter_input(INPUT_POST, 'aircraftsize', FILTER_SANITIZE_NUMBER_INT);
1018
+	$settings = array_merge($settings, array('globalAircraftSize' => $aircraftsize));
1019 1019
 
1020
-	$archivemonths = filter_input(INPUT_POST,'archivemonths',FILTER_SANITIZE_NUMBER_INT);
1021
-	$settings = array_merge($settings,array('globalArchiveMonths' => $archivemonths));
1020
+	$archivemonths = filter_input(INPUT_POST, 'archivemonths', FILTER_SANITIZE_NUMBER_INT);
1021
+	$settings = array_merge($settings, array('globalArchiveMonths' => $archivemonths));
1022 1022
 	
1023
-	$archiveyear = filter_input(INPUT_POST,'archiveyear',FILTER_SANITIZE_STRING);
1023
+	$archiveyear = filter_input(INPUT_POST, 'archiveyear', FILTER_SANITIZE_STRING);
1024 1024
 	if ($archiveyear == "archiveyear") {
1025
-		$settings = array_merge($settings,array('globalArchiveYear' => 'TRUE'));
1025
+		$settings = array_merge($settings, array('globalArchiveYear' => 'TRUE'));
1026 1026
 	} else {
1027
-		$settings = array_merge($settings,array('globalArchiveYear' => 'FALSE'));
1027
+		$settings = array_merge($settings, array('globalArchiveYear' => 'FALSE'));
1028 1028
 	}
1029
-	$archivekeepmonths = filter_input(INPUT_POST,'archivekeepmonths',FILTER_SANITIZE_NUMBER_INT);
1030
-	$settings = array_merge($settings,array('globalArchiveKeepMonths' => $archivekeepmonths));
1031
-	$archivekeeptrackmonths = filter_input(INPUT_POST,'archivekeeptrackmonths',FILTER_SANITIZE_NUMBER_INT);
1032
-	$settings = array_merge($settings,array('globalArchiveKeepTrackMonths' => $archivekeeptrackmonths));
1029
+	$archivekeepmonths = filter_input(INPUT_POST, 'archivekeepmonths', FILTER_SANITIZE_NUMBER_INT);
1030
+	$settings = array_merge($settings, array('globalArchiveKeepMonths' => $archivekeepmonths));
1031
+	$archivekeeptrackmonths = filter_input(INPUT_POST, 'archivekeeptrackmonths', FILTER_SANITIZE_NUMBER_INT);
1032
+	$settings = array_merge($settings, array('globalArchiveKeepTrackMonths' => $archivekeeptrackmonths));
1033 1033
 
1034
-	$britishairways = filter_input(INPUT_POST,'britishairways',FILTER_SANITIZE_STRING);
1035
-	$settings = array_merge($settings,array('globalBritishAirwaysKey' => $britishairways));
1036
-	$transavia = filter_input(INPUT_POST,'transavia',FILTER_SANITIZE_STRING);
1037
-	$settings = array_merge($settings,array('globalTransaviaKey' => $transavia));
1034
+	$britishairways = filter_input(INPUT_POST, 'britishairways', FILTER_SANITIZE_STRING);
1035
+	$settings = array_merge($settings, array('globalBritishAirwaysKey' => $britishairways));
1036
+	$transavia = filter_input(INPUT_POST, 'transavia', FILTER_SANITIZE_STRING);
1037
+	$settings = array_merge($settings, array('globalTransaviaKey' => $transavia));
1038 1038
 
1039
-	$lufthansakey = filter_input(INPUT_POST,'lufthansakey',FILTER_SANITIZE_STRING);
1040
-	$lufthansasecret = filter_input(INPUT_POST,'lufthansasecret',FILTER_SANITIZE_STRING);
1041
-	$settings = array_merge($settings,array('globalLufthansaKey' => array('key' => $lufthansakey,'secret' => $lufthansasecret)));
1039
+	$lufthansakey = filter_input(INPUT_POST, 'lufthansakey', FILTER_SANITIZE_STRING);
1040
+	$lufthansasecret = filter_input(INPUT_POST, 'lufthansasecret', FILTER_SANITIZE_STRING);
1041
+	$settings = array_merge($settings, array('globalLufthansaKey' => array('key' => $lufthansakey, 'secret' => $lufthansasecret)));
1042 1042
 
1043 1043
 	// Create in settings.php keys not yet configurable if not already here
1044 1044
 	//if (!isset($globalImageBingKey)) $settings = array_merge($settings,array('globalImageBingKey' => ''));
1045
-	if (!isset($globalDebug)) $settings = array_merge($settings,array('globalDebug' => 'TRUE'));
1045
+	if (!isset($globalDebug)) $settings = array_merge($settings, array('globalDebug' => 'TRUE'));
1046 1046
 
1047
-	$resetyearstats = filter_input(INPUT_POST,'resetyearstats',FILTER_SANITIZE_STRING);
1047
+	$resetyearstats = filter_input(INPUT_POST, 'resetyearstats', FILTER_SANITIZE_STRING);
1048 1048
 	if ($resetyearstats == 'resetyearstats') {
1049
-		$settings = array_merge($settings,array('globalDeleteLastYearStats' => 'TRUE'));
1049
+		$settings = array_merge($settings, array('globalDeleteLastYearStats' => 'TRUE'));
1050 1050
 	} else {
1051
-		$settings = array_merge($settings,array('globalDeleteLastYearStats' => 'FALSE'));
1051
+		$settings = array_merge($settings, array('globalDeleteLastYearStats' => 'FALSE'));
1052 1052
 	}
1053 1053
 
1054
-	$archive = filter_input(INPUT_POST,'archive',FILTER_SANITIZE_STRING);
1054
+	$archive = filter_input(INPUT_POST, 'archive', FILTER_SANITIZE_STRING);
1055 1055
 	if ($archive == 'archive') {
1056
-		$settings = array_merge($settings,array('globalArchive' => 'TRUE'));
1056
+		$settings = array_merge($settings, array('globalArchive' => 'TRUE'));
1057 1057
 	} else {
1058
-		$settings = array_merge($settings,array('globalArchive' => 'FALSE'));
1058
+		$settings = array_merge($settings, array('globalArchive' => 'FALSE'));
1059 1059
 	}
1060
-	$daemon = filter_input(INPUT_POST,'daemon',FILTER_SANITIZE_STRING);
1060
+	$daemon = filter_input(INPUT_POST, 'daemon', FILTER_SANITIZE_STRING);
1061 1061
 	if ($daemon == 'daemon') {
1062
-		$settings = array_merge($settings,array('globalDaemon' => 'TRUE'));
1062
+		$settings = array_merge($settings, array('globalDaemon' => 'TRUE'));
1063 1063
 	} else {
1064
-		$settings = array_merge($settings,array('globalDaemon' => 'FALSE'));
1064
+		$settings = array_merge($settings, array('globalDaemon' => 'FALSE'));
1065 1065
 	}
1066
-	$schedules = filter_input(INPUT_POST,'schedules',FILTER_SANITIZE_STRING);
1066
+	$schedules = filter_input(INPUT_POST, 'schedules', FILTER_SANITIZE_STRING);
1067 1067
 	if ($schedules == 'schedules') {
1068
-		$settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE'));
1068
+		$settings = array_merge($settings, array('globalSchedulesFetch' => 'TRUE'));
1069 1069
 	} else {
1070
-		$settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE'));
1070
+		$settings = array_merge($settings, array('globalSchedulesFetch' => 'FALSE'));
1071 1071
 	}
1072 1072
 
1073 1073
 /*
@@ -1078,183 +1078,183 @@  discard block
 block discarded – undo
1078 1078
 		$settings = array_merge($settings,array('globalFlightAware' => 'FALSE','globalSBS1' => 'TRUE'));
1079 1079
 	}
1080 1080
 */
1081
-	$settings = array_merge($settings,array('globalFlightAware' => 'FALSE'));
1082
-	if ($globalsbs == 'sbs') $settings = array_merge($settings,array('globalSBS1' => 'TRUE'));
1083
-	else $settings = array_merge($settings,array('globalSBS1' => 'FALSE'));
1084
-	if ($globalaprs == 'aprs') $settings = array_merge($settings,array('globalAPRS' => 'TRUE'));
1085
-	else $settings = array_merge($settings,array('globalAPRS' => 'FALSE'));
1081
+	$settings = array_merge($settings, array('globalFlightAware' => 'FALSE'));
1082
+	if ($globalsbs == 'sbs') $settings = array_merge($settings, array('globalSBS1' => 'TRUE'));
1083
+	else $settings = array_merge($settings, array('globalSBS1' => 'FALSE'));
1084
+	if ($globalaprs == 'aprs') $settings = array_merge($settings, array('globalAPRS' => 'TRUE'));
1085
+	else $settings = array_merge($settings, array('globalAPRS' => 'FALSE'));
1086 1086
 	if ($globalivao == 'ivao') {
1087 1087
 		//$settings = array_merge($settings,array('globalIVAO' => 'TRUE','globalVATSIM' => 'FALSE'));
1088
-		$settings = array_merge($settings,array('globalIVAO' => 'TRUE'));
1089
-	} else $settings = array_merge($settings,array('globalIVAO' => 'FALSE'));
1088
+		$settings = array_merge($settings, array('globalIVAO' => 'TRUE'));
1089
+	} else $settings = array_merge($settings, array('globalIVAO' => 'FALSE'));
1090 1090
 	if ($globalvatsim == 'vatsim') {
1091 1091
 		//$settings = array_merge($settings,array('globalVATSIM' => 'TRUE','globalIVAO' => 'FALSE'));
1092
-		$settings = array_merge($settings,array('globalVATSIM' => 'TRUE'));
1093
-	} else $settings = array_merge($settings,array('globalVATSIM' => 'FALSE'));
1092
+		$settings = array_merge($settings, array('globalVATSIM' => 'TRUE'));
1093
+	} else $settings = array_merge($settings, array('globalVATSIM' => 'FALSE'));
1094 1094
 	if ($globalphpvms == 'phpvms') {
1095
-		$settings = array_merge($settings,array('globalphpVMS' => 'TRUE'));
1096
-	} else $settings = array_merge($settings,array('globalphpVMS' => 'FALSE'));
1095
+		$settings = array_merge($settings, array('globalphpVMS' => 'TRUE'));
1096
+	} else $settings = array_merge($settings, array('globalphpVMS' => 'FALSE'));
1097 1097
 	if ($globalvam == 'vam') {
1098
-		$settings = array_merge($settings,array('globalVAM' => 'TRUE'));
1099
-	} else $settings = array_merge($settings,array('globalVAM' => 'FALSE'));
1098
+		$settings = array_merge($settings, array('globalVAM' => 'TRUE'));
1099
+	} else $settings = array_merge($settings, array('globalVAM' => 'FALSE'));
1100 1100
 	if ($globalvatsim == 'vatsim' || $globalivao == 'ivao' || $globalphpvms == 'phpvms') {
1101
-		$settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE','globalTranslationFetch' => 'FALSE'));
1102
-	} else $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE'));
1101
+		$settings = array_merge($settings, array('globalSchedulesFetch' => 'FALSE', 'globalTranslationFetch' => 'FALSE'));
1102
+	} else $settings = array_merge($settings, array('globalSchedulesFetch' => 'TRUE', 'globalTranslationFetch' => 'TRUE'));
1103 1103
 	
1104 1104
 
1105 1105
 
1106
-	$notam = filter_input(INPUT_POST,'notam',FILTER_SANITIZE_STRING);
1106
+	$notam = filter_input(INPUT_POST, 'notam', FILTER_SANITIZE_STRING);
1107 1107
 	if ($notam == 'notam') {
1108
-		$settings = array_merge($settings,array('globalNOTAM' => 'TRUE'));
1108
+		$settings = array_merge($settings, array('globalNOTAM' => 'TRUE'));
1109 1109
 	} else {
1110
-		$settings = array_merge($settings,array('globalNOTAM' => 'FALSE'));
1110
+		$settings = array_merge($settings, array('globalNOTAM' => 'FALSE'));
1111 1111
 	}
1112
-	$owner = filter_input(INPUT_POST,'owner',FILTER_SANITIZE_STRING);
1112
+	$owner = filter_input(INPUT_POST, 'owner', FILTER_SANITIZE_STRING);
1113 1113
 	if ($owner == 'owner') {
1114
-		$settings = array_merge($settings,array('globalOwner' => 'TRUE'));
1114
+		$settings = array_merge($settings, array('globalOwner' => 'TRUE'));
1115 1115
 	} else {
1116
-		$settings = array_merge($settings,array('globalOwner' => 'FALSE'));
1116
+		$settings = array_merge($settings, array('globalOwner' => 'FALSE'));
1117 1117
 	}
1118
-	$map3d = filter_input(INPUT_POST,'map3d',FILTER_SANITIZE_STRING);
1118
+	$map3d = filter_input(INPUT_POST, 'map3d', FILTER_SANITIZE_STRING);
1119 1119
 	if ($map3d == 'map3d') {
1120
-		$settings = array_merge($settings,array('globalMap3D' => 'TRUE'));
1120
+		$settings = array_merge($settings, array('globalMap3D' => 'TRUE'));
1121 1121
 	} else {
1122
-		$settings = array_merge($settings,array('globalMap3D' => 'FALSE'));
1122
+		$settings = array_merge($settings, array('globalMap3D' => 'FALSE'));
1123 1123
 	}
1124
-	$crash = filter_input(INPUT_POST,'crash',FILTER_SANITIZE_STRING);
1124
+	$crash = filter_input(INPUT_POST, 'crash', FILTER_SANITIZE_STRING);
1125 1125
 	if ($crash == 'crash') {
1126
-		$settings = array_merge($settings,array('globalAccidents' => 'TRUE'));
1126
+		$settings = array_merge($settings, array('globalAccidents' => 'TRUE'));
1127 1127
 	} else {
1128
-		$settings = array_merge($settings,array('globalAccidents' => 'FALSE'));
1128
+		$settings = array_merge($settings, array('globalAccidents' => 'FALSE'));
1129 1129
 	}
1130
-	$mapsatellites = filter_input(INPUT_POST,'mapsatellites',FILTER_SANITIZE_STRING);
1130
+	$mapsatellites = filter_input(INPUT_POST, 'mapsatellites', FILTER_SANITIZE_STRING);
1131 1131
 	if ($mapsatellites == 'mapsatellites') {
1132
-		$settings = array_merge($settings,array('globalMapSatellites' => 'TRUE'));
1132
+		$settings = array_merge($settings, array('globalMapSatellites' => 'TRUE'));
1133 1133
 	} else {
1134
-		$settings = array_merge($settings,array('globalMapSatellites' => 'FALSE'));
1134
+		$settings = array_merge($settings, array('globalMapSatellites' => 'FALSE'));
1135 1135
 	}
1136
-	$map3ddefault = filter_input(INPUT_POST,'map3ddefault',FILTER_SANITIZE_STRING);
1136
+	$map3ddefault = filter_input(INPUT_POST, 'map3ddefault', FILTER_SANITIZE_STRING);
1137 1137
 	if ($map3ddefault == 'map3ddefault') {
1138
-		$settings = array_merge($settings,array('globalMap3Ddefault' => 'TRUE'));
1138
+		$settings = array_merge($settings, array('globalMap3Ddefault' => 'TRUE'));
1139 1139
 	} else {
1140
-		$settings = array_merge($settings,array('globalMap3Ddefault' => 'FALSE'));
1140
+		$settings = array_merge($settings, array('globalMap3Ddefault' => 'FALSE'));
1141 1141
 	}
1142
-	$translate = filter_input(INPUT_POST,'translate',FILTER_SANITIZE_STRING);
1142
+	$translate = filter_input(INPUT_POST, 'translate', FILTER_SANITIZE_STRING);
1143 1143
 	if ($translate == 'translate') {
1144
-		$settings = array_merge($settings,array('globalTranslate' => 'TRUE'));
1144
+		$settings = array_merge($settings, array('globalTranslate' => 'TRUE'));
1145 1145
 	} else {
1146
-		$settings = array_merge($settings,array('globalTranslate' => 'FALSE'));
1146
+		$settings = array_merge($settings, array('globalTranslate' => 'FALSE'));
1147 1147
 	}
1148
-	$realairlines = filter_input(INPUT_POST,'realairlines',FILTER_SANITIZE_STRING);
1148
+	$realairlines = filter_input(INPUT_POST, 'realairlines', FILTER_SANITIZE_STRING);
1149 1149
 	if ($realairlines == 'realairlines') {
1150
-		$settings = array_merge($settings,array('globalUseRealAirlines' => 'TRUE'));
1150
+		$settings = array_merge($settings, array('globalUseRealAirlines' => 'TRUE'));
1151 1151
 	} else {
1152
-		$settings = array_merge($settings,array('globalUseRealAirlines' => 'FALSE'));
1152
+		$settings = array_merge($settings, array('globalUseRealAirlines' => 'FALSE'));
1153 1153
 	}
1154
-	$estimation = filter_input(INPUT_POST,'estimation',FILTER_SANITIZE_STRING);
1154
+	$estimation = filter_input(INPUT_POST, 'estimation', FILTER_SANITIZE_STRING);
1155 1155
 	if ($estimation == 'estimation') {
1156
-		$settings = array_merge($settings,array('globalMapEstimation' => 'TRUE'));
1156
+		$settings = array_merge($settings, array('globalMapEstimation' => 'TRUE'));
1157 1157
 	} else {
1158
-		$settings = array_merge($settings,array('globalMapEstimation' => 'FALSE'));
1158
+		$settings = array_merge($settings, array('globalMapEstimation' => 'FALSE'));
1159 1159
 	}
1160
-	$metar = filter_input(INPUT_POST,'metar',FILTER_SANITIZE_STRING);
1160
+	$metar = filter_input(INPUT_POST, 'metar', FILTER_SANITIZE_STRING);
1161 1161
 	if ($metar == 'metar') {
1162
-		$settings = array_merge($settings,array('globalMETAR' => 'TRUE'));
1162
+		$settings = array_merge($settings, array('globalMETAR' => 'TRUE'));
1163 1163
 	} else {
1164
-		$settings = array_merge($settings,array('globalMETAR' => 'FALSE'));
1164
+		$settings = array_merge($settings, array('globalMETAR' => 'FALSE'));
1165 1165
 	}
1166
-	$metarcycle = filter_input(INPUT_POST,'metarcycle',FILTER_SANITIZE_STRING);
1166
+	$metarcycle = filter_input(INPUT_POST, 'metarcycle', FILTER_SANITIZE_STRING);
1167 1167
 	if ($metarcycle == 'metarcycle') {
1168
-		$settings = array_merge($settings,array('globalMETARcycle' => 'TRUE'));
1168
+		$settings = array_merge($settings, array('globalMETARcycle' => 'TRUE'));
1169 1169
 	} else {
1170
-		$settings = array_merge($settings,array('globalMETARcycle' => 'FALSE'));
1170
+		$settings = array_merge($settings, array('globalMETARcycle' => 'FALSE'));
1171 1171
 	}
1172
-	$fork = filter_input(INPUT_POST,'fork',FILTER_SANITIZE_STRING);
1172
+	$fork = filter_input(INPUT_POST, 'fork', FILTER_SANITIZE_STRING);
1173 1173
 	if ($fork == 'fork') {
1174
-		$settings = array_merge($settings,array('globalFork' => 'TRUE'));
1174
+		$settings = array_merge($settings, array('globalFork' => 'TRUE'));
1175 1175
 	} else {
1176
-		$settings = array_merge($settings,array('globalFork' => 'FALSE'));
1176
+		$settings = array_merge($settings, array('globalFork' => 'FALSE'));
1177 1177
 	}
1178 1178
 
1179
-	$colormap = filter_input(INPUT_POST,'colormap',FILTER_SANITIZE_STRING);
1179
+	$colormap = filter_input(INPUT_POST, 'colormap', FILTER_SANITIZE_STRING);
1180 1180
 	if ($colormap == 'colormap') {
1181
-		$settings = array_merge($settings,array('globalMapAltitudeColor' => 'TRUE'));
1181
+		$settings = array_merge($settings, array('globalMapAltitudeColor' => 'TRUE'));
1182 1182
 	} else {
1183
-		$settings = array_merge($settings,array('globalMapAltitudeColor' => 'FALSE'));
1183
+		$settings = array_merge($settings, array('globalMapAltitudeColor' => 'FALSE'));
1184 1184
 	}
1185 1185
 	
1186 1186
 	if (isset($_POST['aircrafticoncolor'])) {
1187
-		$aircrafticoncolor = filter_input(INPUT_POST,'aircrafticoncolor',FILTER_SANITIZE_STRING);
1188
-		$settings = array_merge($settings,array('globalAircraftIconColor' => substr($aircrafticoncolor,1)));
1187
+		$aircrafticoncolor = filter_input(INPUT_POST, 'aircrafticoncolor', FILTER_SANITIZE_STRING);
1188
+		$settings = array_merge($settings, array('globalAircraftIconColor' => substr($aircrafticoncolor, 1)));
1189 1189
 	}
1190 1190
 
1191
-	$airportzoom = filter_input(INPUT_POST,'airportzoom',FILTER_SANITIZE_NUMBER_INT);
1192
-	$settings = array_merge($settings,array('globalAirportZoom' => $airportzoom));
1191
+	$airportzoom = filter_input(INPUT_POST, 'airportzoom', FILTER_SANITIZE_NUMBER_INT);
1192
+	$settings = array_merge($settings, array('globalAirportZoom' => $airportzoom));
1193 1193
 
1194
-	$unitdistance = filter_input(INPUT_POST,'unitdistance',FILTER_SANITIZE_STRING);
1195
-	$settings = array_merge($settings,array('globalUnitDistance' => $unitdistance));
1196
-	$unitaltitude = filter_input(INPUT_POST,'unitaltitude',FILTER_SANITIZE_STRING);
1197
-	$settings = array_merge($settings,array('globalUnitAltitude' => $unitaltitude));
1198
-	$unitspeed = filter_input(INPUT_POST,'unitspeed',FILTER_SANITIZE_STRING);
1199
-	$settings = array_merge($settings,array('globalUnitSpeed' => $unitspeed));
1194
+	$unitdistance = filter_input(INPUT_POST, 'unitdistance', FILTER_SANITIZE_STRING);
1195
+	$settings = array_merge($settings, array('globalUnitDistance' => $unitdistance));
1196
+	$unitaltitude = filter_input(INPUT_POST, 'unitaltitude', FILTER_SANITIZE_STRING);
1197
+	$settings = array_merge($settings, array('globalUnitAltitude' => $unitaltitude));
1198
+	$unitspeed = filter_input(INPUT_POST, 'unitspeed', FILTER_SANITIZE_STRING);
1199
+	$settings = array_merge($settings, array('globalUnitSpeed' => $unitspeed));
1200 1200
 
1201
-	$mappopup = filter_input(INPUT_POST,'mappopup',FILTER_SANITIZE_STRING);
1201
+	$mappopup = filter_input(INPUT_POST, 'mappopup', FILTER_SANITIZE_STRING);
1202 1202
 	if ($mappopup == 'mappopup') {
1203
-		$settings = array_merge($settings,array('globalMapPopup' => 'TRUE'));
1203
+		$settings = array_merge($settings, array('globalMapPopup' => 'TRUE'));
1204 1204
 	} else {
1205
-		$settings = array_merge($settings,array('globalMapPopup' => 'FALSE'));
1205
+		$settings = array_merge($settings, array('globalMapPopup' => 'FALSE'));
1206 1206
 	}
1207
-	$airportpopup = filter_input(INPUT_POST,'airportpopup',FILTER_SANITIZE_STRING);
1207
+	$airportpopup = filter_input(INPUT_POST, 'airportpopup', FILTER_SANITIZE_STRING);
1208 1208
 	if ($airportpopup == 'airportpopup') {
1209
-		$settings = array_merge($settings,array('globalAirportPopup' => 'TRUE'));
1209
+		$settings = array_merge($settings, array('globalAirportPopup' => 'TRUE'));
1210 1210
 	} else {
1211
-		$settings = array_merge($settings,array('globalAirportPopup' => 'FALSE'));
1211
+		$settings = array_merge($settings, array('globalAirportPopup' => 'FALSE'));
1212 1212
 	}
1213
-	$maphistory = filter_input(INPUT_POST,'maphistory',FILTER_SANITIZE_STRING);
1213
+	$maphistory = filter_input(INPUT_POST, 'maphistory', FILTER_SANITIZE_STRING);
1214 1214
 	if ($maphistory == 'maphistory') {
1215
-		$settings = array_merge($settings,array('globalMapHistory' => 'TRUE'));
1215
+		$settings = array_merge($settings, array('globalMapHistory' => 'TRUE'));
1216 1216
 	} else {
1217
-		$settings = array_merge($settings,array('globalMapHistory' => 'FALSE'));
1217
+		$settings = array_merge($settings, array('globalMapHistory' => 'FALSE'));
1218 1218
 	}
1219
-	$flightroute = filter_input(INPUT_POST,'flightroute',FILTER_SANITIZE_STRING);
1219
+	$flightroute = filter_input(INPUT_POST, 'flightroute', FILTER_SANITIZE_STRING);
1220 1220
 	if ($flightroute == 'flightroute') {
1221
-		$settings = array_merge($settings,array('globalMapRoute' => 'TRUE'));
1221
+		$settings = array_merge($settings, array('globalMapRoute' => 'TRUE'));
1222 1222
 	} else {
1223
-		$settings = array_merge($settings,array('globalMapRoute' => 'FALSE'));
1223
+		$settings = array_merge($settings, array('globalMapRoute' => 'FALSE'));
1224 1224
 	}
1225
-	$allflights = filter_input(INPUT_POST,'allflights',FILTER_SANITIZE_STRING);
1225
+	$allflights = filter_input(INPUT_POST, 'allflights', FILTER_SANITIZE_STRING);
1226 1226
 	if ($allflights == 'allflights') {
1227
-		$settings = array_merge($settings,array('globalAllFlights' => 'TRUE'));
1227
+		$settings = array_merge($settings, array('globalAllFlights' => 'TRUE'));
1228 1228
 	} else {
1229
-		$settings = array_merge($settings,array('globalAllFlights' => 'FALSE'));
1229
+		$settings = array_merge($settings, array('globalAllFlights' => 'FALSE'));
1230 1230
 	}
1231
-	$bbox = filter_input(INPUT_POST,'bbox',FILTER_SANITIZE_STRING);
1231
+	$bbox = filter_input(INPUT_POST, 'bbox', FILTER_SANITIZE_STRING);
1232 1232
 	if ($bbox == 'bbox') {
1233
-		$settings = array_merge($settings,array('globalMapUseBbox' => 'TRUE'));
1233
+		$settings = array_merge($settings, array('globalMapUseBbox' => 'TRUE'));
1234 1234
 	} else {
1235
-		$settings = array_merge($settings,array('globalMapUseBbox' => 'FALSE'));
1235
+		$settings = array_merge($settings, array('globalMapUseBbox' => 'FALSE'));
1236 1236
 	}
1237
-	$waypoints = filter_input(INPUT_POST,'waypoints',FILTER_SANITIZE_STRING);
1237
+	$waypoints = filter_input(INPUT_POST, 'waypoints', FILTER_SANITIZE_STRING);
1238 1238
 	if ($waypoints == 'waypoints') {
1239
-		$settings = array_merge($settings,array('globalWaypoints' => 'TRUE'));
1239
+		$settings = array_merge($settings, array('globalWaypoints' => 'TRUE'));
1240 1240
 	} else {
1241
-		$settings = array_merge($settings,array('globalWaypoints' => 'FALSE'));
1241
+		$settings = array_merge($settings, array('globalWaypoints' => 'FALSE'));
1242 1242
 	}
1243 1243
 
1244
-	if (!isset($globalTransaction)) $settings = array_merge($settings,array('globalTransaction' => 'TRUE'));
1244
+	if (!isset($globalTransaction)) $settings = array_merge($settings, array('globalTransaction' => 'TRUE'));
1245 1245
 
1246 1246
 	// Set some defaults values...
1247 1247
 	if (!isset($globalAircraftImageSources)) {
1248
-	    $globalAircraftImageSources = array('ivaomtl','wikimedia','airportdata','deviantart','flickr','bing','jetphotos','planepictures','planespotters');
1249
-	    $settings = array_merge($settings,array('globalAircraftImageSources' => $globalAircraftImageSources));
1248
+	    $globalAircraftImageSources = array('ivaomtl', 'wikimedia', 'airportdata', 'deviantart', 'flickr', 'bing', 'jetphotos', 'planepictures', 'planespotters');
1249
+	    $settings = array_merge($settings, array('globalAircraftImageSources' => $globalAircraftImageSources));
1250 1250
 	}
1251 1251
 
1252 1252
 	if (!isset($globalSchedulesSources)) {
1253
-	    $globalSchedulesSources = array('flightmapper','costtotravel','flightradar24','flightaware');
1254
-    	    $settings = array_merge($settings,array('globalSchedulesSources' => $globalSchedulesSources));
1253
+	    $globalSchedulesSources = array('flightmapper', 'costtotravel', 'flightradar24', 'flightaware');
1254
+    	    $settings = array_merge($settings, array('globalSchedulesSources' => $globalSchedulesSources));
1255 1255
     	}
1256 1256
 
1257
-	$settings = array_merge($settings,array('globalInstalled' => 'TRUE'));
1257
+	$settings = array_merge($settings, array('globalInstalled' => 'TRUE'));
1258 1258
 
1259 1259
 	if ($error == '') settings::modify_settings($settings);
1260 1260
 	if ($error == '') settings::comment_settings($settings_comment);
Please login to merge, or discard this patch.
Braces   +446 added lines, -119 removed lines patch added patch discarded remove patch
@@ -131,45 +131,72 @@  discard block
 block discarded – undo
131 131
 			</div>
132 132
 			<p>
133 133
 				<label for="dbhost">Database hostname</label>
134
-				<input type="text" name="dbhost" id="dbhost" value="<?php if (isset($globalDBhost)) print $globalDBhost; ?>" />
134
+				<input type="text" name="dbhost" id="dbhost" value="<?php if (isset($globalDBhost)) {
135
+	print $globalDBhost;
136
+}
137
+?>" />
135 138
 			</p>
136 139
 			<p>
137 140
 				<label for="dbport">Database port</label>
138
-				<input type="text" name="dbport" id="dbport" value="<?php if (isset($globalDBport)) print $globalDBport; ?>" />
141
+				<input type="text" name="dbport" id="dbport" value="<?php if (isset($globalDBport)) {
142
+	print $globalDBport;
143
+}
144
+?>" />
139 145
 				<p class="help-block">Default is 3306 for MariaDB/MySQL, 5432 for PostgreSQL</p>
140 146
 			</p>
141 147
 			<p>
142 148
 				<label for="dbname">Database name</label>
143
-				<input type="text" name="dbname" id="dbname" value="<?php if (isset($globalDBname)) print $globalDBname; ?>" />
149
+				<input type="text" name="dbname" id="dbname" value="<?php if (isset($globalDBname)) {
150
+	print $globalDBname;
151
+}
152
+?>" />
144 153
 			</p>
145 154
 			<p>
146 155
 				<label for="dbuser">Database user</label>
147
-				<input type="text" name="dbuser" id="dbuser" value="<?php if (isset($globalDBuser)) print $globalDBuser; ?>" />
156
+				<input type="text" name="dbuser" id="dbuser" value="<?php if (isset($globalDBuser)) {
157
+	print $globalDBuser;
158
+}
159
+?>" />
148 160
 			</p>
149 161
 			<p>
150 162
 				<label for="dbuserpass">Database user password</label>
151
-				<input type="password" name="dbuserpass" id="dbuserpass" value="<?php if (isset($globalDBpass)) print $globalDBpass; ?>" />
163
+				<input type="password" name="dbuserpass" id="dbuserpass" value="<?php if (isset($globalDBpass)) {
164
+	print $globalDBpass;
165
+}
166
+?>" />
152 167
 			</p>
153 168
 		</fieldset>
154 169
 		<fieldset id="site">
155 170
 			<legend>Site configuration</legend>
156 171
 			<p>
157 172
 				<label for="sitename">Site name</label>
158
-				<input type="text" name="sitename" id="sitename" value="<?php if (isset($globalName)) print $globalName; ?>" />
173
+				<input type="text" name="sitename" id="sitename" value="<?php if (isset($globalName)) {
174
+	print $globalName;
175
+}
176
+?>" />
159 177
 			</p>
160 178
 			<p>
161 179
 				<label for="siteurl">Site directory</label>
162
-				<input type="text" name="siteurl" id="siteurl" value="<?php if (isset($globalURL)) print $globalURL; ?>" />
180
+				<input type="text" name="siteurl" id="siteurl" value="<?php if (isset($globalURL)) {
181
+	print $globalURL;
182
+}
183
+?>" />
163 184
 				<p class="help-block">Can be null. ex : <i>flightairmap</i> if complete URL is <i>http://toto.com/flightairmap</i></p>
164 185
 			</p>
165 186
 			<p>
166 187
 				<label for="timezone">Timezone</label>
167
-				<input type="text" name="timezone" id="timezone" value="<?php if (isset($globalTimezone)) print $globalTimezone; ?>" />
188
+				<input type="text" name="timezone" id="timezone" value="<?php if (isset($globalTimezone)) {
189
+	print $globalTimezone;
190
+}
191
+?>" />
168 192
 				<p class="help-block">ex : UTC, Europe/Paris,...</p>
169 193
 			</p>
170 194
 			<p>
171 195
 				<label for="language">Language</label>
172
-				<input type="text" name="language" id="language" value="<?php if (isset($globalLanguage)) print $globalLanguage; ?>" />
196
+				<input type="text" name="language" id="language" value="<?php if (isset($globalLanguage)) {
197
+	print $globalLanguage;
198
+}
199
+?>" />
173 200
 				<p class="help-block">Used only when link to wikipedia for now. Can be EN,DE,FR,...</p>
174 201
 			</p>
175 202
 		</fieldset>
@@ -190,11 +217,17 @@  discard block
 block discarded – undo
190 217
 			<div id="mapbox_data">
191 218
 				<p>
192 219
 					<label for="mapboxid">Mapbox id</label>
193
-					<input type="text" name="mapboxid" id="mapboxid" value="<?php if (isset($globalMapboxId)) print $globalMapboxId; ?>" />
220
+					<input type="text" name="mapboxid" id="mapboxid" value="<?php if (isset($globalMapboxId)) {
221
+	print $globalMapboxId;
222
+}
223
+?>" />
194 224
 				</p>
195 225
 				<p>
196 226
 					<label for="mapboxtoken">Mapbox token</label>
197
-					<input type="text" name="mapboxtoken" id="mapboxtoken" value="<?php if (isset($globalMapboxToken)) print $globalMapboxToken; ?>" />
227
+					<input type="text" name="mapboxtoken" id="mapboxtoken" value="<?php if (isset($globalMapboxToken)) {
228
+	print $globalMapboxToken;
229
+}
230
+?>" />
198 231
 				</p>
199 232
 				<p class="help-block">Get a key <a href="https://www.mapbox.com/developers/">here</a></p>
200 233
 			</div>
@@ -202,7 +235,10 @@  discard block
 block discarded – undo
202 235
 			<div id="google_data">
203 236
 				<p>
204 237
 					<label for="googlekey">Google API key</label>
205
-					<input type="text" name="googlekey" id="googlekey" value="<?php if (isset($globalGoogleAPIKey)) print $globalGoogleAPIKey; ?>" />
238
+					<input type="text" name="googlekey" id="googlekey" value="<?php if (isset($globalGoogleAPIKey)) {
239
+	print $globalGoogleAPIKey;
240
+}
241
+?>" />
206 242
 					<p class="help-block">Get a key <a href="https://developers.google.com/maps/documentation/javascript/get-api-key#get-an-api-key">here</a></p>
207 243
 				</p>
208 244
 			</div>
@@ -210,7 +246,10 @@  discard block
 block discarded – undo
210 246
 			<div id="bing_data">
211 247
 				<p>
212 248
 					<label for="bingkey">Bing Map key</label>
213
-					<input type="text" name="bingkey" id="bingkey" value="<?php if (isset($globalBingMapKey)) print $globalBingMapKey; ?>" />
249
+					<input type="text" name="bingkey" id="bingkey" value="<?php if (isset($globalBingMapKey)) {
250
+	print $globalBingMapKey;
251
+}
252
+?>" />
214 253
 					<p class="help-block">Get a key <a href="https://www.bingmapsportal.com/">here</a></p>
215 254
 				</p>
216 255
 			</div>
@@ -218,7 +257,10 @@  discard block
 block discarded – undo
218 257
 			<div id="mapquest_data">
219 258
 				<p>
220 259
 					<label for="mapquestkey">MapQuest key</label>
221
-					<input type="text" name="mapquestkey" id="mapquestkey" value="<?php if (isset($globalMapQuestKey)) print $globalMapQuestKey; ?>" />
260
+					<input type="text" name="mapquestkey" id="mapquestkey" value="<?php if (isset($globalMapQuestKey)) {
261
+	print $globalMapQuestKey;
262
+}
263
+?>" />
222 264
 					<p class="help-block">Get a key <a href="https://developer.mapquest.com/user/me/apps">here</a></p>
223 265
 				</p>
224 266
 			</div>
@@ -226,11 +268,17 @@  discard block
 block discarded – undo
226 268
 			<div id="here_data">
227 269
 				<p>
228 270
 					<label for="hereappid">Here App_Id</label>
229
-					<input type="text" name="hereappid" id="hereappid" value="<?php if (isset($globalHereappId)) print $globalHereappId; ?>" />
271
+					<input type="text" name="hereappid" id="hereappid" value="<?php if (isset($globalHereappId)) {
272
+	print $globalHereappId;
273
+}
274
+?>" />
230 275
 				</p>
231 276
 				<p>
232 277
 					<label for="hereappcode">Here App_Code</label>
233
-					<input type="text" name="hereappcode" id="hereappcode" value="<?php if (isset($globalHereappCode)) print $globalHereappCode; ?>" />
278
+					<input type="text" name="hereappcode" id="hereappcode" value="<?php if (isset($globalHereappCode)) {
279
+	print $globalHereappCode;
280
+}
281
+?>" />
234 282
 				</p>
235 283
 				<p class="help-block">Get a key <a href="https://developer.here.com/rest-apis/documentation/enterprise-map-tile/topics/quick-start.html">here</a></p>
236 284
 			</div>
@@ -239,42 +287,86 @@  discard block
 block discarded – undo
239 287
 			<legend>Coverage area</legend>
240 288
 			<p>
241 289
 				<label for="latitudemax">The maximum latitude (north)</label>
242
-				<input type="text" name="latitudemax" id="latitudemax" value="<?php if (isset($globalLatitudeMax)) print $globalLatitudeMax; ?>" />
290
+				<input type="text" name="latitudemax" id="latitudemax" value="<?php if (isset($globalLatitudeMax)) {
291
+	print $globalLatitudeMax;
292
+}
293
+?>" />
243 294
 			</p>
244 295
 			<p>
245 296
 				<label for="latitudemin">The minimum latitude (south)</label>
246
-				<input type="text" name="latitudemin" id="latitudemin" value="<?php if (isset($globalLatitudeMin)) print $globalLatitudeMin; ?>" />
297
+				<input type="text" name="latitudemin" id="latitudemin" value="<?php if (isset($globalLatitudeMin)) {
298
+	print $globalLatitudeMin;
299
+}
300
+?>" />
247 301
 			</p>
248 302
 			<p>
249 303
 				<label for="longitudemax">The maximum longitude (west)</label>
250
-				<input type="text" name="longitudemax" id="longitudemax" value="<?php if (isset($globalLongitudeMax)) print $globalLongitudeMax; ?>" />
304
+				<input type="text" name="longitudemax" id="longitudemax" value="<?php if (isset($globalLongitudeMax)) {
305
+	print $globalLongitudeMax;
306
+}
307
+?>" />
251 308
 			</p>
252 309
 			<p>
253 310
 				<label for="longitudemin">The minimum longitude (east)</label>
254
-				<input type="text" name="longitudemin" id="longitudemin" value="<?php if (isset($globalLongitudeMin)) print $globalLongitudeMin; ?>" />
311
+				<input type="text" name="longitudemin" id="longitudemin" value="<?php if (isset($globalLongitudeMin)) {
312
+	print $globalLongitudeMin;
313
+}
314
+?>" />
255 315
 			</p>
256 316
 			<p>
257 317
 				<label for="latitudecenter">The latitude center</label>
258
-				<input type="text" name="latitudecenter" id="latitudecenter" value="<?php if (isset($globalCenterLatitude)) print $globalCenterLatitude; ?>" />
318
+				<input type="text" name="latitudecenter" id="latitudecenter" value="<?php if (isset($globalCenterLatitude)) {
319
+	print $globalCenterLatitude;
320
+}
321
+?>" />
259 322
 			</p>
260 323
 			<p>
261 324
 				<label for="longitudecenter">The longitude center</label>
262
-				<input type="text" name="longitudecenter" id="longitudecenter" value="<?php if (isset($globalCenterLongitude)) print $globalCenterLongitude; ?>" />
325
+				<input type="text" name="longitudecenter" id="longitudecenter" value="<?php if (isset($globalCenterLongitude)) {
326
+	print $globalCenterLongitude;
327
+}
328
+?>" />
263 329
 			</p>
264 330
 			<p>
265 331
 				<label for="livezoom">Default Zoom on live map</label>
266
-				<input type="number" name="livezoom" id="livezoom" value="<?php if (isset($globalLiveZoom)) print $globalLiveZoom; else print '9'; ?>" />
332
+				<input type="number" name="livezoom" id="livezoom" value="<?php if (isset($globalLiveZoom)) {
333
+	print $globalLiveZoom;
334
+} else {
335
+	print '9';
336
+}
337
+?>" />
267 338
 			</p>
268 339
 			<p>
269 340
 				<label for="squawk_country">Country for squawk usage</label>
270 341
 				<select name="squawk_country" id="squawk_country">
271
-					<option value="UK"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'UK') print ' selected '; ?>>UK</option>
272
-					<option value="NZ"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NZ') print ' selected '; ?>>NZ</option>
273
-					<option value="US"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'US') print ' selected '; ?>>US</option>
274
-					<option value="AU"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'AU') print ' selected '; ?>>AU</option>
275
-					<option value="NL"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NL') print ' selected '; ?>>NL</option>
276
-					<option value="FR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'FR') print ' selected '; ?>>FR</option>
277
-					<option value="TR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'TR') print ' selected '; ?>>TR</option>
342
+					<option value="UK"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'UK') {
343
+	print ' selected ';
344
+}
345
+?>>UK</option>
346
+					<option value="NZ"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NZ') {
347
+	print ' selected ';
348
+}
349
+?>>NZ</option>
350
+					<option value="US"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'US') {
351
+	print ' selected ';
352
+}
353
+?>>US</option>
354
+					<option value="AU"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'AU') {
355
+	print ' selected ';
356
+}
357
+?>>AU</option>
358
+					<option value="NL"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NL') {
359
+	print ' selected ';
360
+}
361
+?>>NL</option>
362
+					<option value="FR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'FR') {
363
+	print ' selected ';
364
+}
365
+?>>FR</option>
366
+					<option value="TR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'TR') {
367
+	print ' selected ';
368
+}
369
+?>>TR</option>
278 370
 				</select>
279 371
 			</p>
280 372
 		</fieldset>
@@ -283,15 +375,24 @@  discard block
 block discarded – undo
283 375
 			<p><i>Only put in DB flights that are inside a circle</i></p>
284 376
 			<p>
285 377
 				<label for="latitude">Center latitude</label>
286
-				<input type="text" name="zoilatitude" id="latitude" value="<?php if (isset($globalDistanceIgnore['latitude'])) echo $globalDistanceIgnore['latitude']; ?>" />
378
+				<input type="text" name="zoilatitude" id="latitude" value="<?php if (isset($globalDistanceIgnore['latitude'])) {
379
+	echo $globalDistanceIgnore['latitude'];
380
+}
381
+?>" />
287 382
 			</p>
288 383
 			<p>
289 384
 				<label for="longitude">Center longitude</label>
290
-				<input type="text" name="zoilongitude" id="longitude" value="<?php if (isset($globalDistanceIgnore['longitude'])) echo $globalDistanceIgnore['longitude']; ?>" />
385
+				<input type="text" name="zoilongitude" id="longitude" value="<?php if (isset($globalDistanceIgnore['longitude'])) {
386
+	echo $globalDistanceIgnore['longitude'];
387
+}
388
+?>" />
291 389
 			</p>
292 390
 			<p>
293 391
 				<label for="Distance">Distance (in km)</label>
294
-				<input type="text" name="zoidistance" id="distance" value="<?php if (isset($globalDistanceIgnore['distance'])) echo $globalDistanceIgnore['distance']; ?>" />
392
+				<input type="text" name="zoidistance" id="distance" value="<?php if (isset($globalDistanceIgnore['distance'])) {
393
+	echo $globalDistanceIgnore['distance'];
394
+}
395
+?>" />
295 396
 			</p>
296 397
 		</fieldset>
297 398
 		<fieldset id="sourceloc">
@@ -397,11 +498,17 @@  discard block
 block discarded – undo
397 498
 			<div id="flightaware_data">
398 499
 				<p>
399 500
 					<label for="flightawareusername">FlightAware username</label>
400
-					<input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) print $globalFlightAwareUsername; ?>" />
501
+					<input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) {
502
+	print $globalFlightAwareUsername;
503
+}
504
+?>" />
401 505
 				</p>
402 506
 				<p>
403 507
 					<label for="flightawarepassword">FlightAware password/API key</label>
404
-					<input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) print $globalFlightAwarePassword; ?>" />
508
+					<input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) {
509
+	print $globalFlightAwarePassword;
510
+}
511
+?>" />
405 512
 				</p>
406 513
 			</div>
407 514
 -->
@@ -461,28 +568,88 @@  discard block
 block discarded – undo
461 568
 								?>
462 569
 								<td>
463 570
 									<select name="format[]" id="format">
464
-										<option value="auto" <?php if (!isset($source['format'])) print 'selected'; ?>>Auto</option>
465
-										<option value="sbs" <?php if (isset($source['format']) && $source['format'] == 'sbs') print 'selected'; ?>>SBS</option>
466
-										<option value="tsv" <?php if (isset($source['format']) && $source['format'] == 'tsv') print 'selected'; ?>>TSV</option>
467
-										<option value="raw" <?php if (isset($source['format']) && $source['format'] == 'raw') print 'selected'; ?>>Raw</option>
468
-										<option value="aprs" <?php if (isset($source['format']) && $source['format'] == 'aprs') print 'selected'; ?>>APRS</option>
469
-										<option value="deltadbtxt" <?php if (isset($source['format']) && $source['format'] == 'deltadbtxt') print 'selected'; ?>>Radarcape deltadb.txt</option>
470
-										<option value="vatsimtxt" <?php if (isset($source['format']) && $source['format'] == 'vatsimtxt') print 'selected'; ?>>Vatsim</option>
471
-										<option value="aircraftlistjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftlistjson') print 'selected'; ?>>Virtual Radar Server AircraftList.json</option>
472
-										<option value="vrstcp" <?php if (isset($source['format']) && $source['format'] == 'vrstcp') print 'selected'; ?>>Virtual Radar Server TCP</option>
473
-										<option value="phpvmacars" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') print 'selected'; ?>>phpVMS</option>
474
-										<option value="vam" <?php if (isset($source['format']) && $source['format'] == 'vam') print 'selected'; ?>>Virtual Airlines Manager</option>
475
-										<option value="whazzup" <?php if (isset($source['format']) && $source['format'] == 'whazzup') print 'selected'; ?>>IVAO</option>
476
-										<option value="flightgearmp" <?php if (isset($source['format']) && $source['format'] == 'flightgearmp') print 'selected'; ?>>FlightGear Multiplayer</option>
477
-										<option value="flightgearsp" <?php if (isset($source['format']) && $source['format'] == 'flightgearsp') print 'selected'; ?>>FlightGear Singleplayer</option>
478
-										<option value="acars" <?php if (isset($source['format']) && $source['format'] == 'acars') print 'selected'; ?>>ACARS from acarsdec/acarsdeco2 over UDP</option>
479
-										<option value="acarssbs3" <?php if (isset($source['format']) && $source['format'] == 'acarssbs3') print 'selected'; ?>>ACARS SBS-3 over TCP</option>
480
-										<option value="ais" <?php if (isset($source['format']) && $source['format'] == 'ais') print 'selected'; ?>>NMEA AIS over TCP</option>
571
+										<option value="auto" <?php if (!isset($source['format'])) {
572
+	print 'selected';
573
+}
574
+?>>Auto</option>
575
+										<option value="sbs" <?php if (isset($source['format']) && $source['format'] == 'sbs') {
576
+	print 'selected';
577
+}
578
+?>>SBS</option>
579
+										<option value="tsv" <?php if (isset($source['format']) && $source['format'] == 'tsv') {
580
+	print 'selected';
581
+}
582
+?>>TSV</option>
583
+										<option value="raw" <?php if (isset($source['format']) && $source['format'] == 'raw') {
584
+	print 'selected';
585
+}
586
+?>>Raw</option>
587
+										<option value="aprs" <?php if (isset($source['format']) && $source['format'] == 'aprs') {
588
+	print 'selected';
589
+}
590
+?>>APRS</option>
591
+										<option value="deltadbtxt" <?php if (isset($source['format']) && $source['format'] == 'deltadbtxt') {
592
+	print 'selected';
593
+}
594
+?>>Radarcape deltadb.txt</option>
595
+										<option value="vatsimtxt" <?php if (isset($source['format']) && $source['format'] == 'vatsimtxt') {
596
+	print 'selected';
597
+}
598
+?>>Vatsim</option>
599
+										<option value="aircraftlistjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftlistjson') {
600
+	print 'selected';
601
+}
602
+?>>Virtual Radar Server AircraftList.json</option>
603
+										<option value="vrstcp" <?php if (isset($source['format']) && $source['format'] == 'vrstcp') {
604
+	print 'selected';
605
+}
606
+?>>Virtual Radar Server TCP</option>
607
+										<option value="phpvmacars" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') {
608
+	print 'selected';
609
+}
610
+?>>phpVMS</option>
611
+										<option value="vam" <?php if (isset($source['format']) && $source['format'] == 'vam') {
612
+	print 'selected';
613
+}
614
+?>>Virtual Airlines Manager</option>
615
+										<option value="whazzup" <?php if (isset($source['format']) && $source['format'] == 'whazzup') {
616
+	print 'selected';
617
+}
618
+?>>IVAO</option>
619
+										<option value="flightgearmp" <?php if (isset($source['format']) && $source['format'] == 'flightgearmp') {
620
+	print 'selected';
621
+}
622
+?>>FlightGear Multiplayer</option>
623
+										<option value="flightgearsp" <?php if (isset($source['format']) && $source['format'] == 'flightgearsp') {
624
+	print 'selected';
625
+}
626
+?>>FlightGear Singleplayer</option>
627
+										<option value="acars" <?php if (isset($source['format']) && $source['format'] == 'acars') {
628
+	print 'selected';
629
+}
630
+?>>ACARS from acarsdec/acarsdeco2 over UDP</option>
631
+										<option value="acarssbs3" <?php if (isset($source['format']) && $source['format'] == 'acarssbs3') {
632
+	print 'selected';
633
+}
634
+?>>ACARS SBS-3 over TCP</option>
635
+										<option value="ais" <?php if (isset($source['format']) && $source['format'] == 'ais') {
636
+	print 'selected';
637
+}
638
+?>>NMEA AIS over TCP</option>
481 639
 									</select>
482 640
 								</td>
483
-								<td><input type="text" name="name[]" id="name" value="<?php if (isset($source['name'])) print $source['name']; ?>" /></td>
484
-								<td><input type="checkbox" name="sourcestats[]" id="sourcestats" title="Create statistics for the source like number of messages, distance,..." value="1" <?php if (isset($source['sourcestats']) && $source['sourcestats']) print 'checked'; ?> /></td>
485
-								<td><input type="checkbox" name="noarchive[]" id="noarchive" title="Don't archive this source" value="1" <?php if (isset($source['noarchive']) && $source['noarchive']) print 'checked'; ?> /></td>
641
+								<td><input type="text" name="name[]" id="name" value="<?php if (isset($source['name'])) {
642
+	print $source['name'];
643
+}
644
+?>" /></td>
645
+								<td><input type="checkbox" name="sourcestats[]" id="sourcestats" title="Create statistics for the source like number of messages, distance,..." value="1" <?php if (isset($source['sourcestats']) && $source['sourcestats']) {
646
+	print 'checked';
647
+}
648
+?> /></td>
649
+								<td><input type="checkbox" name="noarchive[]" id="noarchive" title="Don't archive this source" value="1" <?php if (isset($source['noarchive']) && $source['noarchive']) {
650
+	print 'checked';
651
+}
652
+?> /></td>
486 653
 								<td><input type="button" id="delhost" value="Delete" onclick="deleteRow(this)" /> <input type="button" id="addhost" value="Add" onclick="insRow()" /></td>
487 654
 							</tr>
488 655
 <?php
@@ -531,11 +698,17 @@  discard block
 block discarded – undo
531 698
 					<p>Listen UDP server for acarsdec/acarsdeco2/... with <i>daemon-acars.php</i> script</p>
532 699
 					<p>
533 700
 						<label for="acarshost">ACARS UDP host</label>
534
-						<input type="text" name="acarshost" id="acarshost" value="<?php if (isset($globalACARSHost)) print $globalACARSHost; ?>" />
701
+						<input type="text" name="acarshost" id="acarshost" value="<?php if (isset($globalACARSHost)) {
702
+	print $globalACARSHost;
703
+}
704
+?>" />
535 705
 					</p>
536 706
 					<p>
537 707
 						<label for="acarsport">ACARS UDP port</label>
538
-						<input type="number" name="acarsport" id="acarsport" value="<?php if (isset($globalACARSPort)) print $globalACARSPort; ?>" />
708
+						<input type="number" name="acarsport" id="acarsport" value="<?php if (isset($globalACARSPort)) {
709
+	print $globalACARSPort;
710
+}
711
+?>" />
539 712
 					</p>
540 713
 				</fieldset>
541 714
 			</div>
@@ -615,13 +788,19 @@  discard block
 block discarded – undo
615 788
 			<div id="schedules_options">
616 789
 				<p>
617 790
 					<label for="britishairways">British Airways API Key</label>
618
-					<input type="text" name="britishairways" id="britishairways" value="<?php if (isset($globalBritishAirwaysKey)) print $globalBritishAirwaysKey; ?>" />
791
+					<input type="text" name="britishairways" id="britishairways" value="<?php if (isset($globalBritishAirwaysKey)) {
792
+	print $globalBritishAirwaysKey;
793
+}
794
+?>" />
619 795
 					<p class="help-block">Register an account on <a href="https://developer.ba.com/">https://developer.ba.com/</a></p>
620 796
 				</p>
621 797
 				<!--
622 798
 				<p>
623 799
 					<label for="transavia">Transavia Test API Consumer Key</label>
624
-					<input type="text" name="transavia" id="transavia" value="<?php if (isset($globalTransaviaKey)) print $globalTransaviaKey; ?>" />
800
+					<input type="text" name="transavia" id="transavia" value="<?php if (isset($globalTransaviaKey)) {
801
+	print $globalTransaviaKey;
802
+}
803
+?>" />
625 804
 					<p class="help-block">Register an account on <a href="https://developer.transavia.com">https://developer.transavia.com</a></p>
626 805
 				</p>
627 806
 				-->
@@ -630,10 +809,16 @@  discard block
 block discarded – undo
630 809
 						<b>Lufthansa API Key</b>
631 810
 						<p>
632 811
 							<label for="lufthansakey">Key</label>
633
-							<input type="text" name="lufthansakey" id="lufthansakey" value="<?php if (isset($globalLufthansaKey['key'])) print $globalLufthansaKey['key']; ?>" />
812
+							<input type="text" name="lufthansakey" id="lufthansakey" value="<?php if (isset($globalLufthansaKey['key'])) {
813
+	print $globalLufthansaKey['key'];
814
+}
815
+?>" />
634 816
 						</p><p>
635 817
 							<label for="lufthansasecret">Secret</label>
636
-							<input type="text" name="lufthansasecret" id="lufthansasecret" value="<?php if (isset($globalLufthansaKey['secret'])) print $globalLufthansaKey['secret']; ?>" />
818
+							<input type="text" name="lufthansasecret" id="lufthansasecret" value="<?php if (isset($globalLufthansaKey['secret'])) {
819
+	print $globalLufthansaKey['secret'];
820
+}
821
+?>" />
637 822
 						</p>
638 823
 					</div>
639 824
 					<p class="help-block">Register an account on <a href="https://developer.lufthansa.com/page">https://developer.lufthansa.com/page</a></p>
@@ -653,7 +838,10 @@  discard block
 block discarded – undo
653 838
 			</p>
654 839
 			<p>
655 840
 				<label for="notamsource">URL of your feed from notaminfo.com</label>
656
-				<input type="text" name="notamsource" id="notamsource" value="<?php if (isset($globalNOTAMSource)) print $globalNOTAMSource; ?>" />
841
+				<input type="text" name="notamsource" id="notamsource" value="<?php if (isset($globalNOTAMSource)) {
842
+	print $globalNOTAMSource;
843
+}
844
+?>" />
657 845
 				<p class="help-block">If you want to use world NOTAM from FlightAirMap website, leave it blank</p>
658 846
 			</p>
659 847
 			<br />
@@ -669,14 +857,20 @@  discard block
 block discarded – undo
669 857
 			<div id="metarsrc">
670 858
 				<p>
671 859
 					<label for="metarsource">URL of your METAR source</label>
672
-					<input type="text" name="metarsource" id="metarsource" value="<?php if (isset($globalMETARurl)) print $globalMETARurl; ?>" />
860
+					<input type="text" name="metarsource" id="metarsource" value="<?php if (isset($globalMETARurl)) {
861
+	print $globalMETARurl;
862
+}
863
+?>" />
673 864
 					<p class="help-block">Use {icao} to specify where we replace by airport icao. ex : http://metar.vatsim.net/metar.php?id={icao}</p>
674 865
 				</p>
675 866
 			</div>
676 867
 			<br />
677 868
 			<p>
678 869
 				<label for="bitly">Bit.ly access token api (used in search page)</label>
679
-				<input type="text" name="bitly" id="bitly" value="<?php if (isset($globalBitlyAccessToken)) print $globalBitlyAccessToken; ?>" />
870
+				<input type="text" name="bitly" id="bitly" value="<?php if (isset($globalBitlyAccessToken)) {
871
+	print $globalBitlyAccessToken;
872
+}
873
+?>" />
680 874
 			</p>
681 875
 			<br />
682 876
 			<p>
@@ -696,7 +890,12 @@  discard block
 block discarded – undo
696 890
 			</p>
697 891
 			<p>
698 892
 				<label for="archivemonths">Generate statistics, delete or put in archive flights older than xx months</label>
699
-				<input type="number" name="archivemonths" id="archivemonths" value="<?php if (isset($globalArchiveMonths)) print $globalArchiveMonths; else echo '0'; ?>" />
893
+				<input type="number" name="archivemonths" id="archivemonths" value="<?php if (isset($globalArchiveMonths)) {
894
+	print $globalArchiveMonths;
895
+} else {
896
+	echo '0';
897
+}
898
+?>" />
700 899
 				<p class="help-block">0 to disable, delete old flight if <i>Archive all flights data</i> is disabled</p>
701 900
 			</p>
702 901
 			<p>
@@ -706,12 +905,22 @@  discard block
 block discarded – undo
706 905
 			</p>
707 906
 			<p>
708 907
 				<label for="archivekeepmonths">Keep flights data for xx months in archive</label>
709
-				<input type="number" name="archivekeepmonths" id="archivekeepmonths" value="<?php if (isset($globalArchiveKeepMonths)) print $globalArchiveKeepMonths; else echo '0'; ?>" />
908
+				<input type="number" name="archivekeepmonths" id="archivekeepmonths" value="<?php if (isset($globalArchiveKeepMonths)) {
909
+	print $globalArchiveKeepMonths;
910
+} else {
911
+	echo '0';
912
+}
913
+?>" />
710 914
 				<p class="help-block">0 to disable</p>
711 915
 			</p>
712 916
 			<p>
713 917
 				<label for="archivekeeptrackmonths">Keep flights track data for xx months in archive</label>
714
-				<input type="number" name="archivekeeptrackmonths" id="archivekeeptrackmonths" value="<?php if (isset($globalArchiveKeepTrackMonths)) print $globalArchiveKeepTrackMonths; else echo '0'; ?>" />
918
+				<input type="number" name="archivekeeptrackmonths" id="archivekeeptrackmonths" value="<?php if (isset($globalArchiveKeepTrackMonths)) {
919
+	print $globalArchiveKeepTrackMonths;
920
+} else {
921
+	echo '0';
922
+}
923
+?>" />
715 924
 				<p class="help-block">0 to disable, should be less or egal to <i>Keep flights data</i> value</p>
716 925
 			</p>
717 926
 			<br />
@@ -721,7 +930,12 @@  discard block
 block discarded – undo
721 930
 				<p class="help-block">Uncheck if the script is running as cron job</p>
722 931
 				<div id="cronends"> 
723 932
 					<label for="cronend">Run script for xx seconds</label>
724
-					<input type="number" name="cronend" id="cronend" value="<?php if (isset($globalCronEnd)) print $globalCronEnd; else print '0'; ?>" />
933
+					<input type="number" name="cronend" id="cronend" value="<?php if (isset($globalCronEnd)) {
934
+	print $globalCronEnd;
935
+} else {
936
+	print '0';
937
+}
938
+?>" />
725 939
 					<p class="help-block">Set to 0 to disable. Should be disabled if source is URL.</p>
726 940
 				</div>
727 941
 			</p>
@@ -766,15 +980,30 @@  discard block
 block discarded – undo
766 980
 			<br />
767 981
 			<p>
768 982
 				<label for="refresh">Show flights detected since xxx seconds</label>
769
-				<input type="number" name="refresh" id="refresh" value="<?php if (isset($globalLiveInterval)) echo $globalLiveInterval; else echo '200'; ?>" />
983
+				<input type="number" name="refresh" id="refresh" value="<?php if (isset($globalLiveInterval)) {
984
+	echo $globalLiveInterval;
985
+} else {
986
+	echo '200';
987
+}
988
+?>" />
770 989
 			</p>
771 990
 			<p>
772 991
 				<label for="maprefresh">Live map refresh (in seconds)</label>
773
-				<input type="number" name="maprefresh" id="maprefresh" value="<?php if (isset($globalMapRefresh)) echo $globalMapRefresh; else echo '30'; ?>" />
992
+				<input type="number" name="maprefresh" id="maprefresh" value="<?php if (isset($globalMapRefresh)) {
993
+	echo $globalMapRefresh;
994
+} else {
995
+	echo '30';
996
+}
997
+?>" />
774 998
 			</p>
775 999
 			<p>
776 1000
 				<label for="mapidle">Map idle timeout (in minutes)</label>
777
-				<input type="number" name="mapidle" id="mapidle" value="<?php if (isset($globalMapIdleTimeout)) echo $globalMapIdleTimeout; else echo '30'; ?>" />
1001
+				<input type="number" name="mapidle" id="mapidle" value="<?php if (isset($globalMapIdleTimeout)) {
1002
+	echo $globalMapIdleTimeout;
1003
+} else {
1004
+	echo '30';
1005
+}
1006
+?>" />
778 1007
 				<p class="help-block">0 to disable</p>
779 1008
 			</p>
780 1009
 			<p>
@@ -784,12 +1013,20 @@  discard block
 block discarded – undo
784 1013
 			<br />
785 1014
 			<p>
786 1015
 				<label for="closestmindist">Distance to airport set as arrival (in km)</label>
787
-				<input type="number" name="closestmindist" id="closestmindist" value="<?php if (isset($globalClosestMinDist)) echo $globalClosestMinDist; else echo '50'; ?>" />
1016
+				<input type="number" name="closestmindist" id="closestmindist" value="<?php if (isset($globalClosestMinDist)) {
1017
+	echo $globalClosestMinDist;
1018
+} else {
1019
+	echo '50';
1020
+}
1021
+?>" />
788 1022
 			</p>
789 1023
 			<br />
790 1024
 			<p>
791 1025
 				<label for="aircraftsize">Size of aircraft icon on map (default to 30px if zoom > 7 else 15px), empty to default</label>
792
-				<input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize;?>" />
1026
+				<input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) {
1027
+	echo $globalAircraftSize;
1028
+}
1029
+?>" />
793 1030
 			</p>
794 1031
 			<br />
795 1032
 			<p>
@@ -797,7 +1034,12 @@  discard block
 block discarded – undo
797 1034
 			    if (extension_loaded('gd') && function_exists('gd_info')) {
798 1035
 			?>
799 1036
 				<label for="aircrafticoncolor">Color of aircraft icon on map</label>
800
-				<input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) echo $globalAircraftIconColor; else echo '1a3151'; ?>" />
1037
+				<input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) {
1038
+	echo $globalAircraftIconColor;
1039
+} else {
1040
+	echo '1a3151';
1041
+}
1042
+?>" />
801 1043
 			<?php
802 1044
 				if (!is_writable('../cache')) {
803 1045
 			?>
@@ -815,8 +1057,18 @@  discard block
 block discarded – undo
815 1057
 			<p>
816 1058
 				<label for="airportzoom">Zoom level minimum to see airports icons</label>
817 1059
 				<div class="range">
818
-					<input type="range" name="airportzoom" id="airportzoom" value="<?php if (isset($globalAirportZoom)) echo $globalAirportZoom; else echo '7'; ?>" />
819
-					<output id="range"><?php if (isset($globalAirportZoom)) echo $globalAirportZoom; else echo '7'; ?></output>
1060
+					<input type="range" name="airportzoom" id="airportzoom" value="<?php if (isset($globalAirportZoom)) {
1061
+	echo $globalAirportZoom;
1062
+} else {
1063
+	echo '7';
1064
+}
1065
+?>" />
1066
+					<output id="range"><?php if (isset($globalAirportZoom)) {
1067
+	echo $globalAirportZoom;
1068
+} else {
1069
+	echo '7';
1070
+}
1071
+?></output>
820 1072
 				</div>
821 1073
 			</p>
822 1074
 		</fieldset>
@@ -844,8 +1096,12 @@  discard block
 block discarded – undo
844 1096
 	$dbhost = filter_input(INPUT_POST,'dbhost',FILTER_SANITIZE_STRING);
845 1097
 	$dbport = filter_input(INPUT_POST,'dbport',FILTER_SANITIZE_STRING);
846 1098
 
847
-	if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) $error .= 'Mysql driver for PDO must be loaded';
848
-	if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) $error .= 'PosgreSQL driver for PDO must be loaded';
1099
+	if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) {
1100
+		$error .= 'Mysql driver for PDO must be loaded';
1101
+	}
1102
+	if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) {
1103
+		$error .= 'PosgreSQL driver for PDO must be loaded';
1104
+	}
849 1105
 	
850 1106
 	$_SESSION['database_root'] = $dbroot;
851 1107
 	$_SESSION['database_rootpass'] = $dbrootpass;
@@ -912,15 +1168,23 @@  discard block
 block discarded – undo
912 1168
 	$source_city = $_POST['source_city'];
913 1169
 	$source_country = $_POST['source_country'];
914 1170
 	$source_ref = $_POST['source_ref'];
915
-	if (isset($source_id)) $source_id = $_POST['source_id'];
916
-	else $source_id = array();
1171
+	if (isset($source_id)) {
1172
+		$source_id = $_POST['source_id'];
1173
+	} else {
1174
+		$source_id = array();
1175
+	}
917 1176
 	
918 1177
 	$sources = array();
919 1178
 	foreach ($source_name as $keys => $name) {
920
-	    if (isset($source_id[$keys])) $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'id' => $source_id[$keys],'source' => $source_ref[$keys]);
921
-	    else $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'source' => $source_ref[$keys]);
1179
+	    if (isset($source_id[$keys])) {
1180
+	    	$sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'id' => $source_id[$keys],'source' => $source_ref[$keys]);
1181
+	    } else {
1182
+	    	$sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'source' => $source_ref[$keys]);
1183
+	    }
1184
+	}
1185
+	if (count($sources) > 0) {
1186
+		$_SESSION['sources'] = $sources;
922 1187
 	}
923
-	if (count($sources) > 0) $_SESSION['sources'] = $sources;
924 1188
 
925 1189
 	//$sbshost = filter_input(INPUT_POST,'sbshost',FILTER_SANITIZE_STRING);
926 1190
 	//$sbsport = filter_input(INPUT_POST,'sbsport',FILTER_SANITIZE_NUMBER_INT);
@@ -940,14 +1204,23 @@  discard block
 block discarded – undo
940 1204
 	$datasource = filter_input(INPUT_POST,'datasource',FILTER_SANITIZE_STRING);
941 1205
 
942 1206
 	$globalaircraft = filter_input(INPUT_POST,'globalaircraft',FILTER_SANITIZE_STRING);
943
-	if ($globalaircraft == 'aircraft') $settings = array_merge($settings,array('globalAircraft' => 'TRUE'));
944
-	else $settings = array_merge($settings,array('globalAircraft' => 'FALSE'));
1207
+	if ($globalaircraft == 'aircraft') {
1208
+		$settings = array_merge($settings,array('globalAircraft' => 'TRUE'));
1209
+	} else {
1210
+		$settings = array_merge($settings,array('globalAircraft' => 'FALSE'));
1211
+	}
945 1212
 	$globaltracker = filter_input(INPUT_POST,'globaltracker',FILTER_SANITIZE_STRING);
946
-	if ($globaltracker == 'tracker') $settings = array_merge($settings,array('globalTracker' => 'TRUE'));
947
-	else $settings = array_merge($settings,array('globalTracker' => 'FALSE'));
1213
+	if ($globaltracker == 'tracker') {
1214
+		$settings = array_merge($settings,array('globalTracker' => 'TRUE'));
1215
+	} else {
1216
+		$settings = array_merge($settings,array('globalTracker' => 'FALSE'));
1217
+	}
948 1218
 	$globalmarine = filter_input(INPUT_POST,'globalmarine',FILTER_SANITIZE_STRING);
949
-	if ($globalmarine == 'marine') $settings = array_merge($settings,array('globalMarine' => 'TRUE'));
950
-	else $settings = array_merge($settings,array('globalMarine' => 'FALSE'));
1219
+	if ($globalmarine == 'marine') {
1220
+		$settings = array_merge($settings,array('globalMarine' => 'TRUE'));
1221
+	} else {
1222
+		$settings = array_merge($settings,array('globalMarine' => 'FALSE'));
1223
+	}
951 1224
 
952 1225
 /*	
953 1226
 	$globalSBS1Hosts = array();
@@ -968,17 +1241,31 @@  discard block
 block discarded – undo
968 1241
 	$port = $_POST['port'];
969 1242
 	$name = $_POST['name'];
970 1243
 	$format = $_POST['format'];
971
-	if (isset($_POST['sourcestats'])) $sourcestats = $_POST['sourcestats'];
972
-	else $sourcestats = array();
973
-	if (isset($_POST['noarchive'])) $noarchive = $_POST['noarchive'];
974
-	else $noarchive = array();
1244
+	if (isset($_POST['sourcestats'])) {
1245
+		$sourcestats = $_POST['sourcestats'];
1246
+	} else {
1247
+		$sourcestats = array();
1248
+	}
1249
+	if (isset($_POST['noarchive'])) {
1250
+		$noarchive = $_POST['noarchive'];
1251
+	} else {
1252
+		$noarchive = array();
1253
+	}
975 1254
 	$gSources = array();
976 1255
 	foreach ($host as $key => $h) {
977
-		if (isset($sourcestats[$key]) && $sourcestats[$key] == 1) $cov = 'TRUE';
978
-		else $cov = 'FALSE';
979
-		if (isset($noarchive[$key]) && $noarchive[$key] == 1) $arch = 'TRUE';
980
-		else $arch = 'FALSE';
981
-		if ($h != '') $gSources[] = array('host' => $h, 'port' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch);
1256
+		if (isset($sourcestats[$key]) && $sourcestats[$key] == 1) {
1257
+			$cov = 'TRUE';
1258
+		} else {
1259
+			$cov = 'FALSE';
1260
+		}
1261
+		if (isset($noarchive[$key]) && $noarchive[$key] == 1) {
1262
+			$arch = 'TRUE';
1263
+		} else {
1264
+			$arch = 'FALSE';
1265
+		}
1266
+		if ($h != '') {
1267
+			$gSources[] = array('host' => $h, 'port' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch);
1268
+		}
982 1269
 	}
983 1270
 	$settings = array_merge($settings,array('globalSources' => $gSources));
984 1271
 
@@ -1003,7 +1290,9 @@  discard block
 block discarded – undo
1003 1290
 	$zoidistance = filter_input(INPUT_POST,'zoidistance',FILTER_SANITIZE_NUMBER_INT);
1004 1291
 	if ($zoilatitude != '' && $zoilongitude != '' && $zoidistance != '') {
1005 1292
 		$settings = array_merge($settings,array('globalDistanceIgnore' => array('latitude' => $zoilatitude,'longitude' => $zoilongitude,'distance' => $zoidistance)));
1006
-	} else $settings = array_merge($settings,array('globalDistanceIgnore' => array()));
1293
+	} else {
1294
+		$settings = array_merge($settings,array('globalDistanceIgnore' => array()));
1295
+	}
1007 1296
 
1008 1297
 	$refresh = filter_input(INPUT_POST,'refresh',FILTER_SANITIZE_NUMBER_INT);
1009 1298
 	$settings = array_merge($settings,array('globalLiveInterval' => $refresh));
@@ -1042,7 +1331,9 @@  discard block
 block discarded – undo
1042 1331
 
1043 1332
 	// Create in settings.php keys not yet configurable if not already here
1044 1333
 	//if (!isset($globalImageBingKey)) $settings = array_merge($settings,array('globalImageBingKey' => ''));
1045
-	if (!isset($globalDebug)) $settings = array_merge($settings,array('globalDebug' => 'TRUE'));
1334
+	if (!isset($globalDebug)) {
1335
+		$settings = array_merge($settings,array('globalDebug' => 'TRUE'));
1336
+	}
1046 1337
 
1047 1338
 	$resetyearstats = filter_input(INPUT_POST,'resetyearstats',FILTER_SANITIZE_STRING);
1048 1339
 	if ($resetyearstats == 'resetyearstats') {
@@ -1079,27 +1370,43 @@  discard block
 block discarded – undo
1079 1370
 	}
1080 1371
 */
1081 1372
 	$settings = array_merge($settings,array('globalFlightAware' => 'FALSE'));
1082
-	if ($globalsbs == 'sbs') $settings = array_merge($settings,array('globalSBS1' => 'TRUE'));
1083
-	else $settings = array_merge($settings,array('globalSBS1' => 'FALSE'));
1084
-	if ($globalaprs == 'aprs') $settings = array_merge($settings,array('globalAPRS' => 'TRUE'));
1085
-	else $settings = array_merge($settings,array('globalAPRS' => 'FALSE'));
1373
+	if ($globalsbs == 'sbs') {
1374
+		$settings = array_merge($settings,array('globalSBS1' => 'TRUE'));
1375
+	} else {
1376
+		$settings = array_merge($settings,array('globalSBS1' => 'FALSE'));
1377
+	}
1378
+	if ($globalaprs == 'aprs') {
1379
+		$settings = array_merge($settings,array('globalAPRS' => 'TRUE'));
1380
+	} else {
1381
+		$settings = array_merge($settings,array('globalAPRS' => 'FALSE'));
1382
+	}
1086 1383
 	if ($globalivao == 'ivao') {
1087 1384
 		//$settings = array_merge($settings,array('globalIVAO' => 'TRUE','globalVATSIM' => 'FALSE'));
1088 1385
 		$settings = array_merge($settings,array('globalIVAO' => 'TRUE'));
1089
-	} else $settings = array_merge($settings,array('globalIVAO' => 'FALSE'));
1386
+	} else {
1387
+		$settings = array_merge($settings,array('globalIVAO' => 'FALSE'));
1388
+	}
1090 1389
 	if ($globalvatsim == 'vatsim') {
1091 1390
 		//$settings = array_merge($settings,array('globalVATSIM' => 'TRUE','globalIVAO' => 'FALSE'));
1092 1391
 		$settings = array_merge($settings,array('globalVATSIM' => 'TRUE'));
1093
-	} else $settings = array_merge($settings,array('globalVATSIM' => 'FALSE'));
1392
+	} else {
1393
+		$settings = array_merge($settings,array('globalVATSIM' => 'FALSE'));
1394
+	}
1094 1395
 	if ($globalphpvms == 'phpvms') {
1095 1396
 		$settings = array_merge($settings,array('globalphpVMS' => 'TRUE'));
1096
-	} else $settings = array_merge($settings,array('globalphpVMS' => 'FALSE'));
1397
+	} else {
1398
+		$settings = array_merge($settings,array('globalphpVMS' => 'FALSE'));
1399
+	}
1097 1400
 	if ($globalvam == 'vam') {
1098 1401
 		$settings = array_merge($settings,array('globalVAM' => 'TRUE'));
1099
-	} else $settings = array_merge($settings,array('globalVAM' => 'FALSE'));
1402
+	} else {
1403
+		$settings = array_merge($settings,array('globalVAM' => 'FALSE'));
1404
+	}
1100 1405
 	if ($globalvatsim == 'vatsim' || $globalivao == 'ivao' || $globalphpvms == 'phpvms') {
1101 1406
 		$settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE','globalTranslationFetch' => 'FALSE'));
1102
-	} else $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE'));
1407
+	} else {
1408
+		$settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE'));
1409
+	}
1103 1410
 	
1104 1411
 
1105 1412
 
@@ -1241,7 +1548,9 @@  discard block
 block discarded – undo
1241 1548
 		$settings = array_merge($settings,array('globalWaypoints' => 'FALSE'));
1242 1549
 	}
1243 1550
 
1244
-	if (!isset($globalTransaction)) $settings = array_merge($settings,array('globalTransaction' => 'TRUE'));
1551
+	if (!isset($globalTransaction)) {
1552
+		$settings = array_merge($settings,array('globalTransaction' => 'TRUE'));
1553
+	}
1245 1554
 
1246 1555
 	// Set some defaults values...
1247 1556
 	if (!isset($globalAircraftImageSources)) {
@@ -1256,15 +1565,23 @@  discard block
 block discarded – undo
1256 1565
 
1257 1566
 	$settings = array_merge($settings,array('globalInstalled' => 'TRUE'));
1258 1567
 
1259
-	if ($error == '') settings::modify_settings($settings);
1260
-	if ($error == '') settings::comment_settings($settings_comment);
1568
+	if ($error == '') {
1569
+		settings::modify_settings($settings);
1570
+	}
1571
+	if ($error == '') {
1572
+		settings::comment_settings($settings_comment);
1573
+	}
1261 1574
 	if ($error != '') {
1262 1575
 		print '<div class="info column">'.$error.'</div>';
1263 1576
 		require('../footer.php');
1264 1577
 		exit;
1265 1578
 	} else {
1266
-		if (isset($_POST['waypoints']) && $_POST['waypoints'] == 'waypoints') $_SESSION['waypoints'] = 1;
1267
-		if (isset($_POST['owner']) && $_POST['owner'] == 'owner') $_SESSION['owner'] = 1;
1579
+		if (isset($_POST['waypoints']) && $_POST['waypoints'] == 'waypoints') {
1580
+			$_SESSION['waypoints'] = 1;
1581
+		}
1582
+		if (isset($_POST['owner']) && $_POST['owner'] == 'owner') {
1583
+			$_SESSION['owner'] = 1;
1584
+		}
1268 1585
 		if (isset($_POST['createdb'])) {
1269 1586
 			$_SESSION['install'] = 'database_create';
1270 1587
 		} else {
@@ -1305,10 +1622,18 @@  discard block
 block discarded – undo
1305 1622
 	$popw = false;
1306 1623
 	foreach ($_SESSION['done'] as $done) {
1307 1624
 	    print '<li>'.$done.'....<strong>SUCCESS</strong></li>';
1308
-	    if ($done == 'Create database') $pop = true;
1309
-	    if ($_SESSION['install'] == 'database_create') $pop = true;
1310
-	    if ($_SESSION['install'] == 'database_import') $popi = true;
1311
-	    if ($_SESSION['install'] == 'waypoints') $popw = true;
1625
+	    if ($done == 'Create database') {
1626
+	    	$pop = true;
1627
+	    }
1628
+	    if ($_SESSION['install'] == 'database_create') {
1629
+	    	$pop = true;
1630
+	    }
1631
+	    if ($_SESSION['install'] == 'database_import') {
1632
+	    	$popi = true;
1633
+	    }
1634
+	    if ($_SESSION['install'] == 'waypoints') {
1635
+	    	$popw = true;
1636
+	    }
1312 1637
 	}
1313 1638
 	if ($pop) {
1314 1639
 	    sleep(5);
@@ -1319,7 +1644,9 @@  discard block
 block discarded – undo
1319 1644
 	} else if ($popw) {
1320 1645
 	    sleep(5);
1321 1646
 	    print '<li>Populate waypoints database....<img src="../images/loading.gif" /></li>';
1322
-	} else print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>';
1647
+	} else {
1648
+		print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>';
1649
+	}
1323 1650
 	print '</div></ul>';
1324 1651
 	print '<div id="error"></div>';
1325 1652
 /*	foreach ($_SESSION['done'] as $done) {
Please login to merge, or discard this patch.
manufacturer-statistics-aircraft.php 3 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,9 @@
 block discarded – undo
22 22
 	print '<select name="aircraft_manufacturer" class="selectpicker" data-live-search="true">';
23 23
 	$Stats = new Stats();
24 24
 	$all_manufacturers = $Stats->getAllManufacturers();
25
-	if (empty($all_manufacturers)) $all_manufacturers = $Spotter->getAllManufacturers();
25
+	if (empty($all_manufacturers)) {
26
+		$all_manufacturers = $Spotter->getAllManufacturers();
27
+	}
26 28
 	foreach($all_manufacturers as $all_manufacturer)
27 29
 	{
28 30
 		if($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer'])))
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -8,13 +8,13 @@  discard block
 block discarded – undo
8 8
         die();
9 9
 }
10 10
 $Spotter = new Spotter();
11
-$manufacturer = ucwords(str_replace("-", " ", filter_input(INPUT_GET,'aircraft_manufacturer',FILTER_SANITIZE_STRING)));
12
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
13
-$spotter_array = $Spotter->getSpotterDataByManufacturer($manufacturer,"0,1", $sort);
11
+$manufacturer = ucwords(str_replace("-", " ", filter_input(INPUT_GET, 'aircraft_manufacturer', FILTER_SANITIZE_STRING)));
12
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
13
+$spotter_array = $Spotter->getSpotterDataByManufacturer($manufacturer, "0,1", $sort);
14 14
 
15 15
 if (!empty($spotter_array))
16 16
 {
17
-	$title = sprintf(_("Most Common Aircraft from %s"),$manufacturer);
17
+	$title = sprintf(_("Most Common Aircraft from %s"), $manufacturer);
18 18
 
19 19
 	require_once('header.php');
20 20
 	print '<div class="select-item">';
@@ -23,9 +23,9 @@  discard block
 block discarded – undo
23 23
 	$Stats = new Stats();
24 24
 	$all_manufacturers = $Stats->getAllManufacturers();
25 25
 	if (empty($all_manufacturers)) $all_manufacturers = $Spotter->getAllManufacturers();
26
-	foreach($all_manufacturers as $all_manufacturer)
26
+	foreach ($all_manufacturers as $all_manufacturer)
27 27
 	{
28
-		if($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer'])))
28
+		if ($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer'])))
29 29
 		{
30 30
 			print '<option value="'.strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer'])).'" selected="selected">'.$all_manufacturer['aircraft_manufacturer'].'</option>';
31 31
 		} else {
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 	include('manufacturer-sub-menu.php');
45 45
 	print '<div class="column">';
46 46
 	print '<h2>'._("Most Common Aircraft").'</h2>';
47
-	print '<p>'.sprintf(_("The statistic below shows the most common aircrafts of flights from <strong>%s</strong>."),$manufacturer).'</p>';
47
+	print '<p>'.sprintf(_("The statistic below shows the most common aircrafts of flights from <strong>%s</strong>."), $manufacturer).'</p>';
48 48
 
49 49
 	$aircraft_array = $Spotter->countAllAircraftTypesByManufacturer($manufacturer);
50 50
 	if (!empty($aircraft_array))
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 		print '</thead>';
60 60
 		print '<tbody>';
61 61
 		$i = 1;
62
-		foreach($aircraft_array as $aircraft_item)
62
+		foreach ($aircraft_array as $aircraft_item)
63 63
 		{
64 64
 			print '<tr>';
65 65
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@
 block discarded – undo
4 4
 require_once('require/class.Stats.php');
5 5
 require_once('require/class.Language.php');
6 6
 if (!isset($_GET['aircraft_manufacturer'])) {
7
-        header('Location: '.$globalURL.'/manufacturer');
8
-        die();
7
+		header('Location: '.$globalURL.'/manufacturer');
8
+		die();
9 9
 }
10 10
 $Spotter = new Spotter();
11 11
 $manufacturer = ucwords(str_replace("-", " ", filter_input(INPUT_GET,'aircraft_manufacturer',FILTER_SANITIZE_STRING)));
Please login to merge, or discard this patch.
manufacturer-statistics-airline-country.php 3 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,9 @@
 block discarded – undo
22 22
 	print '<select name="aircraft_manufacturer" class="selectpicker" data-live-search="true">';
23 23
 	$Stats = new Stats();
24 24
 	$all_manufacturers = $Stats->getAllManufacturers();
25
-	if (empty($all_manufacturers)) $all_manufacturers = $Spotter->getAllManufacturers();
25
+	if (empty($all_manufacturers)) {
26
+		$all_manufacturers = $Spotter->getAllManufacturers();
27
+	}
26 28
 	foreach($all_manufacturers as $all_manufacturer)
27 29
 	{
28 30
 		if($GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer'])))
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -8,13 +8,13 @@  discard block
 block discarded – undo
8 8
         die();
9 9
 }
10 10
 $Spotter = new Spotter();
11
-$manufacturer = ucwords(str_replace("-", " ", filter_input(INPUT_GET,'aircraft_manufacturer',FILTER_SANITIZE_STRING)));
12
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
13
-$spotter_array = $Spotter->getSpotterDataByManufacturer($manufacturer,"0,1", $sort);
11
+$manufacturer = ucwords(str_replace("-", " ", filter_input(INPUT_GET, 'aircraft_manufacturer', FILTER_SANITIZE_STRING)));
12
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
13
+$spotter_array = $Spotter->getSpotterDataByManufacturer($manufacturer, "0,1", $sort);
14 14
 
15 15
 if (!empty($spotter_array))
16 16
 {
17
-	$title = sprintf(_("Most Common Airlines by Country from %s"),$manufacturer);
17
+	$title = sprintf(_("Most Common Airlines by Country from %s"), $manufacturer);
18 18
 
19 19
 	require_once('header.php');
20 20
 	print '<div class="select-item">';
@@ -23,9 +23,9 @@  discard block
 block discarded – undo
23 23
 	$Stats = new Stats();
24 24
 	$all_manufacturers = $Stats->getAllManufacturers();
25 25
 	if (empty($all_manufacturers)) $all_manufacturers = $Spotter->getAllManufacturers();
26
-	foreach($all_manufacturers as $all_manufacturer)
26
+	foreach ($all_manufacturers as $all_manufacturer)
27 27
 	{
28
-		if($GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer'])))
28
+		if ($GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer'])))
29 29
 		{
30 30
 			print '<option value="'.strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer'])).'" selected="selected">'.$all_manufacturer['aircraft_manufacturer'].'</option>';
31 31
 		} else {
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 	include('manufacturer-sub-menu.php');
45 45
 	print '<div class="column">';
46 46
 	print '<h2>'._("Most Common Airlines by Country").'</h2>';
47
-	print '<p>'.sprintf(_("The statistic below shows the most common airlines by Country of origin of flights from <strong>%s</strong>."),$manufacturer).'</p>';
47
+	print '<p>'.sprintf(_("The statistic below shows the most common airlines by Country of origin of flights from <strong>%s</strong>."), $manufacturer).'</p>';
48 48
 	$airline_array = $Spotter->countAllAirlineCountriesByManufacturer($manufacturer);
49 49
 	print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>';
50 50
 	print '<div id="chartCountry" class="chart" width="100%"></div>
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
             	["'._("Country").'", "'._("# of times").'"], ';
57 57
 
58 58
 	$country_data = '';
59
-	foreach($airline_array as $airline_item)
59
+	foreach ($airline_array as $airline_item)
60 60
 	{
61 61
 		$country_data .= '[ "'.$airline_item['airline_country'].'",'.$airline_item['airline_country_count'].'],';
62 62
 	}
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 		print '</thead>';
91 91
 		print '<tbody>';
92 92
 		$i = 1;
93
-		foreach($airline_array as $airline_item)
93
+		foreach ($airline_array as $airline_item)
94 94
 		{
95 95
 			print '<tr>';
96 96
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@
 block discarded – undo
4 4
 require_once('require/class.Stats.php');
5 5
 require_once('require/class.Language.php');
6 6
 if (!isset($_GET['aircraft_manufacturer'])) {
7
-        header('Location: '.$globalURL.'/manufacturer');
8
-        die();
7
+		header('Location: '.$globalURL.'/manufacturer');
8
+		die();
9 9
 }
10 10
 $Spotter = new Spotter();
11 11
 $manufacturer = ucwords(str_replace("-", " ", filter_input(INPUT_GET,'aircraft_manufacturer',FILTER_SANITIZE_STRING)));
Please login to merge, or discard this patch.
manufacturer-detailed.php 2 patches
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 		$limit_start = 0;
14 14
 		$limit_end = 25;
15 15
 		$absolute_difference = 25;
16
-	}  else {
16
+	} else {
17 17
 		$limit_explode = explode(",", $_GET['limit']);
18 18
 		$limit_start = $limit_explode[0];
19 19
 		$limit_end = $limit_explode[1];
@@ -47,7 +47,9 @@  discard block
 block discarded – undo
47 47
 		print '<select name="aircraft_manufacturer" class="selectpicker" data-live-search="true">';
48 48
 		$Stats = new Stats();
49 49
 		$all_manufacturers = $Stats->getAllManufacturers();
50
-		if (empty($all_manufacturers)) $all_manufacturers = $Spotter->getAllManufacturers();
50
+		if (empty($all_manufacturers)) {
51
+			$all_manufacturers = $Spotter->getAllManufacturers();
52
+		}
51 53
 		foreach($all_manufacturers as $all_manufacturer)
52 54
 		{
53 55
 			if($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer'])))
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -4,16 +4,16 @@  discard block
 block discarded – undo
4 4
 require_once('require/class.Stats.php');
5 5
 require_once('require/class.Language.php');
6 6
 $Spotter = new Spotter();
7
-if (!isset($_GET['aircraft_manufacturer'])){
7
+if (!isset($_GET['aircraft_manufacturer'])) {
8 8
 	header('Location: '.$globalURL.'');
9 9
 } else {
10 10
 	//calculuation for the pagination
11
-	if(!isset($_GET['limit']))
11
+	if (!isset($_GET['limit']))
12 12
 	{
13 13
 		$limit_start = 0;
14 14
 		$limit_end = 25;
15 15
 		$absolute_difference = 25;
16
-	}  else {
16
+	} else {
17 17
 		$limit_explode = explode(",", $_GET['limit']);
18 18
 		$limit_start = $limit_explode[0];
19 19
 		$limit_end = $limit_explode[1];
@@ -27,19 +27,19 @@  discard block
 block discarded – undo
27 27
 	$limit_previous_1 = $limit_start - $absolute_difference;
28 28
 	$limit_previous_2 = $limit_end - $absolute_difference;
29 29
 	
30
-	$manufacturer = ucwords(str_replace("-", " ", filter_input(INPUT_GET,'aircraft_manufacturer',FILTER_SANITIZE_STRING)));
31
-	$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
30
+	$manufacturer = ucwords(str_replace("-", " ", filter_input(INPUT_GET, 'aircraft_manufacturer', FILTER_SANITIZE_STRING)));
31
+	$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
32 32
 	$page_url = $globalURL.'/manufacturer/'.$manufacturer;
33 33
 	
34 34
 	if ($sort != '') {
35
-		$spotter_array = $Spotter->getSpotterDataByManufacturer($manufacturer,$limit_start.",".$absolute_difference, $sort);
35
+		$spotter_array = $Spotter->getSpotterDataByManufacturer($manufacturer, $limit_start.",".$absolute_difference, $sort);
36 36
 	} else {
37
-		$spotter_array = $Spotter->getSpotterDataByManufacturer($manufacturer,$limit_start.",".$absolute_difference, '');
37
+		$spotter_array = $Spotter->getSpotterDataByManufacturer($manufacturer, $limit_start.",".$absolute_difference, '');
38 38
 	}
39 39
 	
40 40
 	if (!empty($spotter_array))
41 41
 	{
42
-		$title = sprintf(_("Detailed View for %s"),$manufacturer);
42
+		$title = sprintf(_("Detailed View for %s"), $manufacturer);
43 43
 
44 44
 		require_once('header.php');
45 45
 		print '<div class="select-item">';
@@ -48,9 +48,9 @@  discard block
 block discarded – undo
48 48
 		$Stats = new Stats();
49 49
 		$all_manufacturers = $Stats->getAllManufacturers();
50 50
 		if (empty($all_manufacturers)) $all_manufacturers = $Spotter->getAllManufacturers();
51
-		foreach($all_manufacturers as $all_manufacturer)
51
+		foreach ($all_manufacturers as $all_manufacturer)
52 52
 		{
53
-			if($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer'])))
53
+			if ($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer'])))
54 54
 			{
55 55
 				print '<option value="'.strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer'])).'" selected="selected">'.$all_manufacturer['aircraft_manufacturer'].'</option>';
56 56
 			} else {
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 		print '</div>';
68 68
 
69 69
 		print '<div class="table column">';
70
-		print '<p>'.sprintf(_("The table below shows the detailed information of all flights from <strong>%s</strong."),$manufacturer).'</p>';
70
+		print '<p>'.sprintf(_("The table below shows the detailed information of all flights from <strong>%s</strong."), $manufacturer).'</p>';
71 71
 
72 72
 		include('manufacturer-sub-menu.php');
73 73
 		include('table-output.php'); 
Please login to merge, or discard this patch.
require/class.ATC.php 4 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
     /**
12 12
     * Get SQL query part for filter used
13 13
     * @param Array $filter the filter
14
-    * @return Array the SQL part
14
+    * @return string the SQL part
15 15
     */
16 16
     public function getFilter($filter = array(),$where = false,$and = false) {
17 17
 	global $globalFilter, $globalStatsFilters, $globalFilterName;
Please login to merge, or discard this patch.
Braces   +14 added lines, -5 removed lines patch added patch discarded remove patch
@@ -20,20 +20,27 @@  discard block
 block discarded – undo
20 20
 	if (is_array($globalStatsFilters) && isset($globalStatsFilters[$globalFilterName])) {
21 21
 	    if (isset($globalStatsFilters[$globalFilterName][0]['source'])) {
22 22
 		foreach($globalStatsFilters[$globalFilterName] as $source) {
23
-			if (isset($source['source'])) $filter['source'][] = $source['source'];
23
+			if (isset($source['source'])) {
24
+				$filter['source'][] = $source['source'];
25
+			}
24 26
 		}
25 27
 	    } else {
26 28
 		$filter = $globalStatsFilters[$globalFilterName];
27 29
 	    }
28 30
 	}
29
-	if (is_array($globalFilter)) $filter = array_merge($filter,$globalFilter);
31
+	if (is_array($globalFilter)) {
32
+		$filter = array_merge($filter,$globalFilter);
33
+	}
30 34
 	$filter_query_join = '';
31 35
 	$filter_query_where = '';
32 36
 	if (isset($filter['source']) && !empty($filter['source'])) {
33 37
 	    $filter_query_where = " WHERE format_source IN ('".implode("','",$filter['source'])."')";
34 38
 	}
35
-	if ($filter_query_where == '' && $where) $filter_query_where = ' WHERE';
36
-	elseif ($filter_query_where != '' && $and) $filter_query_where .= ' AND';
39
+	if ($filter_query_where == '' && $where) {
40
+		$filter_query_where = ' WHERE';
41
+	} elseif ($filter_query_where != '' && $and) {
42
+		$filter_query_where .= ' AND';
43
+	}
37 44
 	$filter_query = $filter_query_join.$filter_query_where;
38 45
 	return $filter_query;
39 46
     }
@@ -57,7 +64,9 @@  discard block
 block discarded – undo
57 64
     		$info = str_replace('^','<br />',$info);
58 65
     		$info = str_replace('&amp;sect;','',$info);
59 66
     		$info = str_replace('"','',$info);
60
-    		if ($type == '') $type = NULL;
67
+    		if ($type == '') {
68
+    			$type = NULL;
69
+    		}
61 70
                 $query = "INSERT INTO atc (ident,frequency,latitude,longitude,atc_range,info,atc_lastseen,type,ivao_id,ivao_name,format_source,source_name) VALUES (:ident,:frequency,:latitude,:longitude,:range,:info,:date,:type,:ivao_id,:ivao_name,:format_source,:source_name)";
62 71
                 $query_values = array(':ident' => $ident,':frequency' => $frequency,':latitude' => $latitude,':longitude' => $longitude,':range' => $range,':info' => $info,':date' => $date,':ivao_id' => $ivao_id,':ivao_name' => $ivao_name, ':type' => $type,':format_source' => $format_source,':source_name' => $source_name);
63 72
                  try {
Please login to merge, or discard this patch.
Indentation   +73 added lines, -73 removed lines patch added patch discarded remove patch
@@ -10,100 +10,100 @@
 block discarded – undo
10 10
 	}
11 11
 	
12 12
 	
13
-    /**
14
-    * Get SQL query part for filter used
15
-    * @param Array $filter the filter
16
-    * @return Array the SQL part
17
-    */
18
-    public function getFilter($filter = array(),$where = false,$and = false) {
13
+	/**
14
+	 * Get SQL query part for filter used
15
+	 * @param Array $filter the filter
16
+	 * @return Array the SQL part
17
+	 */
18
+	public function getFilter($filter = array(),$where = false,$and = false) {
19 19
 	global $globalFilter, $globalStatsFilters, $globalFilterName;
20 20
 	if (is_array($globalStatsFilters) && isset($globalStatsFilters[$globalFilterName])) {
21
-	    if (isset($globalStatsFilters[$globalFilterName][0]['source'])) {
21
+		if (isset($globalStatsFilters[$globalFilterName][0]['source'])) {
22 22
 		foreach($globalStatsFilters[$globalFilterName] as $source) {
23 23
 			if (isset($source['source'])) $filter['source'][] = $source['source'];
24 24
 		}
25
-	    } else {
25
+		} else {
26 26
 		$filter = $globalStatsFilters[$globalFilterName];
27
-	    }
27
+		}
28 28
 	}
29 29
 	if (is_array($globalFilter)) $filter = array_merge($filter,$globalFilter);
30 30
 	$filter_query_join = '';
31 31
 	$filter_query_where = '';
32 32
 	if (isset($filter['source']) && !empty($filter['source'])) {
33
-	    $filter_query_where = " WHERE format_source IN ('".implode("','",$filter['source'])."')";
33
+		$filter_query_where = " WHERE format_source IN ('".implode("','",$filter['source'])."')";
34 34
 	}
35 35
 	if ($filter_query_where == '' && $where) $filter_query_where = ' WHERE';
36 36
 	elseif ($filter_query_where != '' && $and) $filter_query_where .= ' AND';
37 37
 	$filter_query = $filter_query_join.$filter_query_where;
38 38
 	return $filter_query;
39
-    }
39
+	}
40 40
 
41
-       public function getAll() {
42
-    		$filter_query = $this->getFilter(array());
43
-                $query = "SELECT * FROM atc".$filter_query;
44
-                $query_values = array();
45
-                 try {
46
-                        $sth = $this->db->prepare($query);
47
-                        $sth->execute($query_values);
48
-                } catch(PDOException $e) {
49
-                        return "error : ".$e->getMessage();
50
-                }
51
-                $all = $sth->fetchAll(PDO::FETCH_ASSOC);
52
-                return $all;
53
-        }
41
+	   public function getAll() {
42
+			$filter_query = $this->getFilter(array());
43
+				$query = "SELECT * FROM atc".$filter_query;
44
+				$query_values = array();
45
+				 try {
46
+						$sth = $this->db->prepare($query);
47
+						$sth->execute($query_values);
48
+				} catch(PDOException $e) {
49
+						return "error : ".$e->getMessage();
50
+				}
51
+				$all = $sth->fetchAll(PDO::FETCH_ASSOC);
52
+				return $all;
53
+		}
54 54
 
55
-       public function add($ident,$frequency,$latitude,$longitude,$range,$info,$date,$type = '',$ivao_id = '',$ivao_name = '',$format_source = '',$source_name = '') {
56
-    		$info = preg_replace('/[^(\x20-\x7F)]*/','',$info);
57
-    		$info = str_replace('^','<br />',$info);
58
-    		$info = str_replace('&amp;sect;','',$info);
59
-    		$info = str_replace('"','',$info);
60
-    		if ($type == '') $type = NULL;
61
-                $query = "INSERT INTO atc (ident,frequency,latitude,longitude,atc_range,info,atc_lastseen,type,ivao_id,ivao_name,format_source,source_name) VALUES (:ident,:frequency,:latitude,:longitude,:range,:info,:date,:type,:ivao_id,:ivao_name,:format_source,:source_name)";
62
-                $query_values = array(':ident' => $ident,':frequency' => $frequency,':latitude' => $latitude,':longitude' => $longitude,':range' => $range,':info' => $info,':date' => $date,':ivao_id' => $ivao_id,':ivao_name' => $ivao_name, ':type' => $type,':format_source' => $format_source,':source_name' => $source_name);
63
-                 try {
64
-                        $sth = $this->db->prepare($query);
65
-                        $sth->execute($query_values);
66
-                } catch(PDOException $e) {
67
-                        return "error : ".$e->getMessage();
68
-                }
69
-        }
55
+	   public function add($ident,$frequency,$latitude,$longitude,$range,$info,$date,$type = '',$ivao_id = '',$ivao_name = '',$format_source = '',$source_name = '') {
56
+			$info = preg_replace('/[^(\x20-\x7F)]*/','',$info);
57
+			$info = str_replace('^','<br />',$info);
58
+			$info = str_replace('&amp;sect;','',$info);
59
+			$info = str_replace('"','',$info);
60
+			if ($type == '') $type = NULL;
61
+				$query = "INSERT INTO atc (ident,frequency,latitude,longitude,atc_range,info,atc_lastseen,type,ivao_id,ivao_name,format_source,source_name) VALUES (:ident,:frequency,:latitude,:longitude,:range,:info,:date,:type,:ivao_id,:ivao_name,:format_source,:source_name)";
62
+				$query_values = array(':ident' => $ident,':frequency' => $frequency,':latitude' => $latitude,':longitude' => $longitude,':range' => $range,':info' => $info,':date' => $date,':ivao_id' => $ivao_id,':ivao_name' => $ivao_name, ':type' => $type,':format_source' => $format_source,':source_name' => $source_name);
63
+				 try {
64
+						$sth = $this->db->prepare($query);
65
+						$sth->execute($query_values);
66
+				} catch(PDOException $e) {
67
+						return "error : ".$e->getMessage();
68
+				}
69
+		}
70 70
 
71
-       public function deleteById($id) {
72
-                $query = "DELETE FROM atc WHERE atc_id = :id";
73
-                $query_values = array(':id' => $id);
74
-                 try {
75
-                        $sth = $this->db->prepare($query);
76
-                        $sth->execute($query_values);
77
-                } catch(PDOException $e) {
78
-                        return "error : ".$e->getMessage();
79
-                }
80
-        }
71
+	   public function deleteById($id) {
72
+				$query = "DELETE FROM atc WHERE atc_id = :id";
73
+				$query_values = array(':id' => $id);
74
+				 try {
75
+						$sth = $this->db->prepare($query);
76
+						$sth->execute($query_values);
77
+				} catch(PDOException $e) {
78
+						return "error : ".$e->getMessage();
79
+				}
80
+		}
81 81
 
82
-       public function deleteAll() {
83
-                $query = "DELETE FROM atc";
84
-                $query_values = array();
85
-                 try {
86
-                        $sth = $this->db->prepare($query);
87
-                        $sth->execute($query_values);
88
-                } catch(PDOException $e) {
89
-                        return "error : ".$e->getMessage();
90
-                }
91
-        }
82
+	   public function deleteAll() {
83
+				$query = "DELETE FROM atc";
84
+				$query_values = array();
85
+				 try {
86
+						$sth = $this->db->prepare($query);
87
+						$sth->execute($query_values);
88
+				} catch(PDOException $e) {
89
+						return "error : ".$e->getMessage();
90
+				}
91
+		}
92 92
 
93 93
 	public function deleteOldATC() {
94
-                global $globalDBdriver;
95
-                if ($globalDBdriver == 'mysql') {
96
-                        $query  = "DELETE FROM atc WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 HOUR) >= atc.atc_lastseen";
97
-                } else {
98
-                        $query  = "DELETE FROM atc WHERE NOW() AT TIME ZONE 'UTC' - '1 HOUR'->INTERVAL >= atc.atc_lastseen";
99
-                }
100
-                try {
101
-                        $sth = $this->db->prepare($query);
102
-                        $sth->execute();
103
-                } catch(PDOException $e) {
104
-                        return "error";
105
-                }
106
-                return "success";
107
-        }
94
+				global $globalDBdriver;
95
+				if ($globalDBdriver == 'mysql') {
96
+						$query  = "DELETE FROM atc WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 HOUR) >= atc.atc_lastseen";
97
+				} else {
98
+						$query  = "DELETE FROM atc WHERE NOW() AT TIME ZONE 'UTC' - '1 HOUR'->INTERVAL >= atc.atc_lastseen";
99
+				}
100
+				try {
101
+						$sth = $this->db->prepare($query);
102
+						$sth->execute();
103
+				} catch(PDOException $e) {
104
+						return "error";
105
+				}
106
+				return "success";
107
+		}
108 108
 }
109 109
 ?>
110 110
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -15,22 +15,22 @@  discard block
 block discarded – undo
15 15
     * @param Array $filter the filter
16 16
     * @return Array the SQL part
17 17
     */
18
-    public function getFilter($filter = array(),$where = false,$and = false) {
18
+    public function getFilter($filter = array(), $where = false, $and = false) {
19 19
 	global $globalFilter, $globalStatsFilters, $globalFilterName;
20 20
 	if (is_array($globalStatsFilters) && isset($globalStatsFilters[$globalFilterName])) {
21 21
 	    if (isset($globalStatsFilters[$globalFilterName][0]['source'])) {
22
-		foreach($globalStatsFilters[$globalFilterName] as $source) {
22
+		foreach ($globalStatsFilters[$globalFilterName] as $source) {
23 23
 			if (isset($source['source'])) $filter['source'][] = $source['source'];
24 24
 		}
25 25
 	    } else {
26 26
 		$filter = $globalStatsFilters[$globalFilterName];
27 27
 	    }
28 28
 	}
29
-	if (is_array($globalFilter)) $filter = array_merge($filter,$globalFilter);
29
+	if (is_array($globalFilter)) $filter = array_merge($filter, $globalFilter);
30 30
 	$filter_query_join = '';
31 31
 	$filter_query_where = '';
32 32
 	if (isset($filter['source']) && !empty($filter['source'])) {
33
-	    $filter_query_where = " WHERE format_source IN ('".implode("','",$filter['source'])."')";
33
+	    $filter_query_where = " WHERE format_source IN ('".implode("','", $filter['source'])."')";
34 34
 	}
35 35
 	if ($filter_query_where == '' && $where) $filter_query_where = ' WHERE';
36 36
 	elseif ($filter_query_where != '' && $and) $filter_query_where .= ' AND';
@@ -45,25 +45,25 @@  discard block
 block discarded – undo
45 45
                  try {
46 46
                         $sth = $this->db->prepare($query);
47 47
                         $sth->execute($query_values);
48
-                } catch(PDOException $e) {
48
+                } catch (PDOException $e) {
49 49
                         return "error : ".$e->getMessage();
50 50
                 }
51 51
                 $all = $sth->fetchAll(PDO::FETCH_ASSOC);
52 52
                 return $all;
53 53
         }
54 54
 
55
-       public function add($ident,$frequency,$latitude,$longitude,$range,$info,$date,$type = '',$ivao_id = '',$ivao_name = '',$format_source = '',$source_name = '') {
56
-    		$info = preg_replace('/[^(\x20-\x7F)]*/','',$info);
57
-    		$info = str_replace('^','<br />',$info);
58
-    		$info = str_replace('&amp;sect;','',$info);
59
-    		$info = str_replace('"','',$info);
55
+       public function add($ident, $frequency, $latitude, $longitude, $range, $info, $date, $type = '', $ivao_id = '', $ivao_name = '', $format_source = '', $source_name = '') {
56
+    		$info = preg_replace('/[^(\x20-\x7F)]*/', '', $info);
57
+    		$info = str_replace('^', '<br />', $info);
58
+    		$info = str_replace('&amp;sect;', '', $info);
59
+    		$info = str_replace('"', '', $info);
60 60
     		if ($type == '') $type = NULL;
61 61
                 $query = "INSERT INTO atc (ident,frequency,latitude,longitude,atc_range,info,atc_lastseen,type,ivao_id,ivao_name,format_source,source_name) VALUES (:ident,:frequency,:latitude,:longitude,:range,:info,:date,:type,:ivao_id,:ivao_name,:format_source,:source_name)";
62
-                $query_values = array(':ident' => $ident,':frequency' => $frequency,':latitude' => $latitude,':longitude' => $longitude,':range' => $range,':info' => $info,':date' => $date,':ivao_id' => $ivao_id,':ivao_name' => $ivao_name, ':type' => $type,':format_source' => $format_source,':source_name' => $source_name);
62
+                $query_values = array(':ident' => $ident, ':frequency' => $frequency, ':latitude' => $latitude, ':longitude' => $longitude, ':range' => $range, ':info' => $info, ':date' => $date, ':ivao_id' => $ivao_id, ':ivao_name' => $ivao_name, ':type' => $type, ':format_source' => $format_source, ':source_name' => $source_name);
63 63
                  try {
64 64
                         $sth = $this->db->prepare($query);
65 65
                         $sth->execute($query_values);
66
-                } catch(PDOException $e) {
66
+                } catch (PDOException $e) {
67 67
                         return "error : ".$e->getMessage();
68 68
                 }
69 69
         }
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
                  try {
75 75
                         $sth = $this->db->prepare($query);
76 76
                         $sth->execute($query_values);
77
-                } catch(PDOException $e) {
77
+                } catch (PDOException $e) {
78 78
                         return "error : ".$e->getMessage();
79 79
                 }
80 80
         }
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
                  try {
86 86
                         $sth = $this->db->prepare($query);
87 87
                         $sth->execute($query_values);
88
-                } catch(PDOException $e) {
88
+                } catch (PDOException $e) {
89 89
                         return "error : ".$e->getMessage();
90 90
                 }
91 91
         }
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
                 try {
101 101
                         $sth = $this->db->prepare($query);
102 102
                         $sth->execute();
103
-                } catch(PDOException $e) {
103
+                } catch (PDOException $e) {
104 104
                         return "error";
105 105
                 }
106 106
                 return "success";
Please login to merge, or discard this patch.
space-data.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 <button type="button" class="close">&times;</button>
8 8
 <?php
9 9
 
10
-$sat = filter_input(INPUT_GET,'sat',FILTER_SANITIZE_STRING);
10
+$sat = filter_input(INPUT_GET, 'sat', FILTER_SANITIZE_STRING);
11 11
 $sat = urldecode($sat);
12 12
 
13 13
 if ($sat == 'ISS (ZARYA)') {
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 	$aircraft_name = 'INTEGRAL';
43 43
 //	$ground_speed = 14970;
44 44
 	$launch_date = '17 October 2002';
45
-} elseif (strpos($sat,'IRIDIUM') !== false) {
45
+} elseif (strpos($sat, 'IRIDIUM') !== false) {
46 46
 	$image = 'https://upload.wikimedia.org/wikipedia/commons/b/b6/Iridium_Satellite.jpg';
47 47
 	$image_copyright = 'Cliff';
48 48
 	$ident = 'Iridium satellite constellation';
@@ -50,22 +50,22 @@  discard block
 block discarded – undo
50 50
 	$aircraft_name = $sat;
51 51
 //	$ground_speed = 14970;
52 52
 //	$launch_date = '29 september 2011';
53
-} elseif (strpos($sat,'ORBCOMM') !== false) {
53
+} elseif (strpos($sat, 'ORBCOMM') !== false) {
54 54
 	$ident = 'Orbcomm';
55 55
 	$aircraft_wiki = 'https://en.wikipedia.org/wiki/Orbcomm_(satellite)';
56 56
 	$aircraft_name = $sat;
57
-} elseif (strpos($sat,'GLOBALSTAR') !== false) {
57
+} elseif (strpos($sat, 'GLOBALSTAR') !== false) {
58 58
 	$ident = 'Globalstar';
59 59
 	$aircraft_wiki = 'https://en.wikipedia.org/wiki/Globalstar';
60 60
 	$aircraft_name = $sat;
61
-} elseif (strpos($sat,'OSCAR 7') !== false) {
61
+} elseif (strpos($sat, 'OSCAR 7') !== false) {
62 62
 	$image = 'https://upload.wikimedia.org/wikipedia/en/a/ad/AMSAT-OSCAR_7.jpg';
63 63
 	$image_copyright = 'Amsat.org';
64 64
 	$ident = 'AMSAT-OSCAR 7';
65 65
 	$aircraft_wiki = 'https://en.wikipedia.org/wiki/AMSAT-OSCAR_7';
66 66
 	$aircraft_name = $sat;
67 67
 	$launch_date = '15 November 1974';
68
-} elseif (strpos($sat,'santaclaus') !== false) {
68
+} elseif (strpos($sat, 'santaclaus') !== false) {
69 69
 	$image = 'https://upload.wikimedia.org/wikipedia/commons/4/49/Jonathan_G_Meath_portrays_Santa_Claus.jpg';
70 70
 	$image_copyright = 'Jonathan G Meath';
71 71
 	$ident = 'Santa Claus';
Please login to merge, or discard this patch.