Completed
Push — master ( 029a3f...057a2a )
by Yannick
07:22
created
airline-statistics-time.php 1 patch
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -21,7 +21,9 @@  discard block
 block discarded – undo
21 21
 	print '<option></option>';
22 22
 	$Stats = new Stats();
23 23
 	$airline_names = $Stats->getAllAirlineNames();
24
-	if (empty($airline_names)) $airline_names = $Spotter->getAllAirlineNames();
24
+	if (empty($airline_names)) {
25
+		$airline_names = $Spotter->getAllAirlineNames();
26
+	}
25 27
 	foreach($airline_names as $airline_name)
26 28
 	{
27 29
 		if($airline == $airline_name['airline_icao'])
@@ -43,8 +45,7 @@  discard block
 block discarded – undo
43 45
 			if ($globalIVAO && @getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.gif'))
44 46
 			{
45 47
 				print '<img src="'.$globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.gif" alt="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" title="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" class="logo" />';
46
-			}
47
-			elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png'))
48
+			} elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png'))
48 49
 			{
49 50
 				print '<img src="'.$globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png" alt="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" title="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" class="logo" />';
50 51
 			}
Please login to merge, or discard this patch.
route-statistics-time.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,9 @@
 block discarded – undo
11 11
 $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
12 12
 if (isset($_GET['departure_airport']) && isset($_GET['arrival_airport'])) {
13 13
 	$spotter_array = $Spotter->getSpotterDataByRoute($_GET['departure_airport'], $_GET['arrival_airport'], "0,1", $sort);
14
-} else $spotter_array = array();
14
+} else {
15
+	$spotter_array = array();
16
+}
15 17
   
16 18
 if (!empty($spotter_array))
17 19
 {
Please login to merge, or discard this patch.
registration-detailed.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
 		$limit_start = 0;
15 15
 		$limit_end = 25;
16 16
 		$absolute_difference = 25;
17
-	}  else {
17
+	} else {
18 18
 		$limit_explode = explode(",", $_GET['limit']);
19 19
 		$limit_start = $limit_explode[0];
20 20
 		$limit_end = $limit_explode[1];
Please login to merge, or discard this patch.
manufacturer-statistics-departure-airport-country.php 1 patch
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.
manufacturer-statistics-time.php 1 patch
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.
header.php 1 patch
Braces   +32 added lines, -7 removed lines patch added patch discarded remove patch
@@ -5,8 +5,11 @@  discard block
 block discarded – undo
5 5
 $file_path = pathinfo($_SERVER['SCRIPT_NAME']);
6 6
 $current_page = $file_path['filename'];
7 7
 date_default_timezone_set($globalTimezone);
8
-if (isset($_COOKIE['MapType']) && $_COOKIE['MapType'] != '') $MapType = $_COOKIE['MapType'];
9
-else $MapType = $globalMapProvider;
8
+if (isset($_COOKIE['MapType']) && $_COOKIE['MapType'] != '') {
9
+	$MapType = $_COOKIE['MapType'];
10
+} else {
11
+	$MapType = $globalMapProvider;
12
+}
10 13
 if (isset($_GET['3d'])) {
11 14
 	setcookie('MapFormat','3d');
12 15
 } else if (isset($_GET['2d'])) {
@@ -222,7 +225,13 @@  discard block
 block discarded – undo
222 225
 <script src="<?php print $globalURL; ?>/js/Marker.Rotate.js"></script>
223 226
 <script src="<?php print $globalURL; ?>/js/MovingMarker.js"></script>
224 227
 <script src="<?php print $globalURL; ?>/js/jquery.idle.min.js"></script>
225
-<script src="<?php print $globalURL; ?>/js/map.js.php?ident=<?php print $ident; ?><?php if(isset($latitude)) print '&latitude='.$latitude; ?><?php if(isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script>
228
+<script src="<?php print $globalURL; ?>/js/map.js.php?ident=<?php print $ident; ?><?php if(isset($latitude)) {
229
+	print '&latitude='.$latitude;
230
+}
231
+?><?php if(isset($longitude)) {
232
+	print '&longitude='.$longitude;
233
+}
234
+?>&<?php print time(); ?>"></script>
226 235
 <?php
227 236
 		if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '' && ($MapType == 'Google-Roadmap' || $MapType == 'Google-Satellite' || $MapType == 'Google-Hybrid' || $MapType == 'Google-Terrain')) {
228 237
 ?>
@@ -276,7 +285,13 @@  discard block
 block discarded – undo
276 285
 <script src="<?php print $globalURL; ?>/js/Marker.Rotate.js"></script>
277 286
 <script src="<?php print $globalURL; ?>/js/MovingMarker.js"></script>
278 287
 <script src="<?php print $globalURL; ?>/js/jquery.idle.min.js"></script>
279
-<script src="<?php print $globalURL; ?>/js/map.js.php?flightaware_id=<?php print $flightaware_id; ?><?php if(isset($latitude)) print '&latitude='.$latitude; ?><?php if(isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script>
288
+<script src="<?php print $globalURL; ?>/js/map.js.php?flightaware_id=<?php print $flightaware_id; ?><?php if(isset($latitude)) {
289
+	print '&latitude='.$latitude;
290
+}
291
+?><?php if(isset($longitude)) {
292
+	print '&longitude='.$longitude;
293
+}
294
+?>&<?php print time(); ?>"></script>
280 295
 <?php
281 296
 		if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '' && ($MapType == 'Google-Roadmap' || $MapType == 'Google-Satellite' || $MapType == 'Google-Hybrid' || $MapType == 'Google-Terrain')) {
282 297
 ?>
@@ -349,7 +364,12 @@  discard block
 block discarded – undo
349 364
         <span class="icon-bar"></span>
350 365
       </button>
351 366
       <a href="<?php print $globalURL; ?>/search" class="navbar-toggle navbar-toggle-search"><i class="fa fa-search"></i></a>
352
-      <a class="navbar-brand" href="<?php if ($globalURL == '') print '/'; else print $globalURL; ?>"><img src="<?php print $globalURL.$logoURL; ?>" height="30px" /></a>
367
+      <a class="navbar-brand" href="<?php if ($globalURL == '') {
368
+	print '/';
369
+} else {
370
+	print $globalURL;
371
+}
372
+?>"><img src="<?php print $globalURL.$logoURL; ?>" height="30px" /></a>
353 373
     </div>
354 374
     <div class="collapse navbar-collapse">
355 375
       <ul class="nav navbar-nav">
@@ -438,7 +458,9 @@  discard block
 block discarded – undo
438 458
   		        $alllang = $Language->getLanguages();
439 459
   		        foreach ($alllang as $key => $lang) {
440 460
   		            print '<option value="'.$key.'"';
441
-  		            if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) print ' selected ';
461
+  		            if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) {
462
+  		            	print ' selected ';
463
+  		            }
442 464
   		            print '>'.$lang[0].'</option>';
443 465
   		        }
444 466
   		    ?>
@@ -591,4 +613,7 @@  discard block
 block discarded – undo
591 613
 
592 614
 ?>
593 615
 
594
-<section class="container main-content <?php if (strtolower($current_page) == 'index') print 'index '; ?>clear">
616
+<section class="container main-content <?php if (strtolower($current_page) == 'index') {
617
+	print 'index ';
618
+}
619
+?>clear">
Please login to merge, or discard this patch.
install/index.php 1 patch
Braces   +409 added lines, -106 removed lines patch added patch discarded remove patch
@@ -128,45 +128,72 @@  discard block
 block discarded – undo
128 128
 			</div>
129 129
 			<p>
130 130
 				<label for="dbhost">Database hostname</label>
131
-				<input type="text" name="dbhost" id="dbhost" value="<?php if (isset($globalDBhost)) print $globalDBhost; ?>" />
131
+				<input type="text" name="dbhost" id="dbhost" value="<?php if (isset($globalDBhost)) {
132
+	print $globalDBhost;
133
+}
134
+?>" />
132 135
 			</p>
133 136
 			<p>
134 137
 				<label for="dbport">Database port</label>
135
-				<input type="text" name="dbport" id="dbport" value="<?php if (isset($globalDBport)) print $globalDBport; ?>" />
138
+				<input type="text" name="dbport" id="dbport" value="<?php if (isset($globalDBport)) {
139
+	print $globalDBport;
140
+}
141
+?>" />
136 142
 				<p class="help-block">Default is 3306 for MariaDB/MySQL, 5432 for PostgreSQL</p>
137 143
 			</p>
138 144
 			<p>
139 145
 				<label for="dbname">Database name</label>
140
-				<input type="text" name="dbname" id="dbname" value="<?php if (isset($globalDBname)) print $globalDBname; ?>" />
146
+				<input type="text" name="dbname" id="dbname" value="<?php if (isset($globalDBname)) {
147
+	print $globalDBname;
148
+}
149
+?>" />
141 150
 			</p>
142 151
 			<p>
143 152
 				<label for="dbuser">Database user</label>
144
-				<input type="text" name="dbuser" id="dbuser" value="<?php if (isset($globalDBuser)) print $globalDBuser; ?>" />
153
+				<input type="text" name="dbuser" id="dbuser" value="<?php if (isset($globalDBuser)) {
154
+	print $globalDBuser;
155
+}
156
+?>" />
145 157
 			</p>
146 158
 			<p>
147 159
 				<label for="dbuserpass">Database user password</label>
148
-				<input type="password" name="dbuserpass" id="dbuserpass" value="<?php if (isset($globalDBpass)) print $globalDBpass; ?>" />
160
+				<input type="password" name="dbuserpass" id="dbuserpass" value="<?php if (isset($globalDBpass)) {
161
+	print $globalDBpass;
162
+}
163
+?>" />
149 164
 			</p>
150 165
 		</fieldset>
151 166
 		<fieldset id="site">
152 167
 			<legend>Site configuration</legend>
153 168
 			<p>
154 169
 				<label for="sitename">Site name</label>
155
-				<input type="text" name="sitename" id="sitename" value="<?php if (isset($globalName)) print $globalName; ?>" />
170
+				<input type="text" name="sitename" id="sitename" value="<?php if (isset($globalName)) {
171
+	print $globalName;
172
+}
173
+?>" />
156 174
 			</p>
157 175
 			<p>
158 176
 				<label for="siteurl">Site directory</label>
159
-				<input type="text" name="siteurl" id="siteurl" value="<?php if (isset($globalURL)) print $globalURL; ?>" />
177
+				<input type="text" name="siteurl" id="siteurl" value="<?php if (isset($globalURL)) {
178
+	print $globalURL;
179
+}
180
+?>" />
160 181
 				<p class="help-block">Can be null. ex : <i>flightairmap</i> if complete URL is <i>http://toto.com/flightairmap</i></p>
161 182
 			</p>
162 183
 			<p>
163 184
 				<label for="timezone">Timezone</label>
164
-				<input type="text" name="timezone" id="timezone" value="<?php if (isset($globalTimezone)) print $globalTimezone; ?>" />
185
+				<input type="text" name="timezone" id="timezone" value="<?php if (isset($globalTimezone)) {
186
+	print $globalTimezone;
187
+}
188
+?>" />
165 189
 				<p class="help-block">ex : UTC, Europe/Paris,...</p>
166 190
 			</p>
167 191
 			<p>
168 192
 				<label for="language">Language</label>
169
-				<input type="text" name="language" id="language" value="<?php if (isset($globalLanguage)) print $globalLanguage; ?>" />
193
+				<input type="text" name="language" id="language" value="<?php if (isset($globalLanguage)) {
194
+	print $globalLanguage;
195
+}
196
+?>" />
170 197
 				<p class="help-block">Used only when link to wikipedia for now. Can be EN,DE,FR,...</p>
171 198
 			</p>
172 199
 		</fieldset>
@@ -187,11 +214,17 @@  discard block
 block discarded – undo
187 214
 			<div id="mapbox_data">
188 215
 				<p>
189 216
 					<label for="mapboxid">Mapbox id</label>
190
-					<input type="text" name="mapboxid" id="mapboxid" value="<?php if (isset($globalMapboxId)) print $globalMapboxId; ?>" />
217
+					<input type="text" name="mapboxid" id="mapboxid" value="<?php if (isset($globalMapboxId)) {
218
+	print $globalMapboxId;
219
+}
220
+?>" />
191 221
 				</p>
192 222
 				<p>
193 223
 					<label for="mapboxtoken">Mapbox token</label>
194
-					<input type="text" name="mapboxtoken" id="mapboxtoken" value="<?php if (isset($globalMapboxToken)) print $globalMapboxToken; ?>" />
224
+					<input type="text" name="mapboxtoken" id="mapboxtoken" value="<?php if (isset($globalMapboxToken)) {
225
+	print $globalMapboxToken;
226
+}
227
+?>" />
195 228
 				</p>
196 229
 				<p class="help-block">Get a key <a href="https://www.mapbox.com/developers/">here</a></p>
197 230
 			</div>
@@ -199,7 +232,10 @@  discard block
 block discarded – undo
199 232
 			<div id="google_data">
200 233
 				<p>
201 234
 					<label for="googlekey">Google API key</label>
202
-					<input type="text" name="googlekey" id="googlekey" value="<?php if (isset($globalGoogleAPIKey)) print $globalGoogleAPIKey; ?>" />
235
+					<input type="text" name="googlekey" id="googlekey" value="<?php if (isset($globalGoogleAPIKey)) {
236
+	print $globalGoogleAPIKey;
237
+}
238
+?>" />
203 239
 					<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>
204 240
 				</p>
205 241
 			</div>
@@ -207,7 +243,10 @@  discard block
 block discarded – undo
207 243
 			<div id="bing_data">
208 244
 				<p>
209 245
 					<label for="bingkey">Bing Map key</label>
210
-					<input type="text" name="bingkey" id="bingkey" value="<?php if (isset($globalBingMapKey)) print $globalBingMapKey; ?>" />
246
+					<input type="text" name="bingkey" id="bingkey" value="<?php if (isset($globalBingMapKey)) {
247
+	print $globalBingMapKey;
248
+}
249
+?>" />
211 250
 					<p class="help-block">Get a key <a href="https://www.bingmapsportal.com/">here</a></p>
212 251
 				</p>
213 252
 			</div>
@@ -215,7 +254,10 @@  discard block
 block discarded – undo
215 254
 			<div id="mapquest_data">
216 255
 				<p>
217 256
 					<label for="mapquestkey">MapQuest key</label>
218
-					<input type="text" name="mapquestkey" id="mapquestkey" value="<?php if (isset($globalMapQuestKey)) print $globalMapQuestKey; ?>" />
257
+					<input type="text" name="mapquestkey" id="mapquestkey" value="<?php if (isset($globalMapQuestKey)) {
258
+	print $globalMapQuestKey;
259
+}
260
+?>" />
219 261
 					<p class="help-block">Get a key <a href="https://developer.mapquest.com/user/me/apps">here</a></p>
220 262
 				</p>
221 263
 			</div>
@@ -223,11 +265,17 @@  discard block
 block discarded – undo
223 265
 			<div id="here_data">
224 266
 				<p>
225 267
 					<label for="hereappid">Here App_Id</label>
226
-					<input type="text" name="hereappid" id="hereappid" value="<?php if (isset($globalHereappId)) print $globalHereappId; ?>" />
268
+					<input type="text" name="hereappid" id="hereappid" value="<?php if (isset($globalHereappId)) {
269
+	print $globalHereappId;
270
+}
271
+?>" />
227 272
 				</p>
228 273
 				<p>
229 274
 					<label for="hereappcode">Here App_Code</label>
230
-					<input type="text" name="hereappcode" id="hereappcode" value="<?php if (isset($globalHereappCode)) print $globalHereappCode; ?>" />
275
+					<input type="text" name="hereappcode" id="hereappcode" value="<?php if (isset($globalHereappCode)) {
276
+	print $globalHereappCode;
277
+}
278
+?>" />
231 279
 				</p>
232 280
 				<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>
233 281
 			</div>
@@ -236,42 +284,86 @@  discard block
 block discarded – undo
236 284
 			<legend>Coverage area</legend>
237 285
 			<p>
238 286
 				<label for="latitudemax">The maximum latitude (north)</label>
239
-				<input type="text" name="latitudemax" id="latitudemax" value="<?php if (isset($globalLatitudeMax)) print $globalLatitudeMax; ?>" />
287
+				<input type="text" name="latitudemax" id="latitudemax" value="<?php if (isset($globalLatitudeMax)) {
288
+	print $globalLatitudeMax;
289
+}
290
+?>" />
240 291
 			</p>
241 292
 			<p>
242 293
 				<label for="latitudemin">The minimum latitude (south)</label>
243
-				<input type="text" name="latitudemin" id="latitudemin" value="<?php if (isset($globalLatitudeMin)) print $globalLatitudeMin; ?>" />
294
+				<input type="text" name="latitudemin" id="latitudemin" value="<?php if (isset($globalLatitudeMin)) {
295
+	print $globalLatitudeMin;
296
+}
297
+?>" />
244 298
 			</p>
245 299
 			<p>
246 300
 				<label for="longitudemax">The maximum longitude (west)</label>
247
-				<input type="text" name="longitudemax" id="longitudemax" value="<?php if (isset($globalLongitudeMax)) print $globalLongitudeMax; ?>" />
301
+				<input type="text" name="longitudemax" id="longitudemax" value="<?php if (isset($globalLongitudeMax)) {
302
+	print $globalLongitudeMax;
303
+}
304
+?>" />
248 305
 			</p>
249 306
 			<p>
250 307
 				<label for="longitudemin">The minimum longitude (east)</label>
251
-				<input type="text" name="longitudemin" id="longitudemin" value="<?php if (isset($globalLongitudeMin)) print $globalLongitudeMin; ?>" />
308
+				<input type="text" name="longitudemin" id="longitudemin" value="<?php if (isset($globalLongitudeMin)) {
309
+	print $globalLongitudeMin;
310
+}
311
+?>" />
252 312
 			</p>
253 313
 			<p>
254 314
 				<label for="latitudecenter">The latitude center</label>
255
-				<input type="text" name="latitudecenter" id="latitudecenter" value="<?php if (isset($globalCenterLatitude)) print $globalCenterLatitude; ?>" />
315
+				<input type="text" name="latitudecenter" id="latitudecenter" value="<?php if (isset($globalCenterLatitude)) {
316
+	print $globalCenterLatitude;
317
+}
318
+?>" />
256 319
 			</p>
257 320
 			<p>
258 321
 				<label for="longitudecenter">The longitude center</label>
259
-				<input type="text" name="longitudecenter" id="longitudecenter" value="<?php if (isset($globalCenterLongitude)) print $globalCenterLongitude; ?>" />
322
+				<input type="text" name="longitudecenter" id="longitudecenter" value="<?php if (isset($globalCenterLongitude)) {
323
+	print $globalCenterLongitude;
324
+}
325
+?>" />
260 326
 			</p>
261 327
 			<p>
262 328
 				<label for="livezoom">Default Zoom on live map</label>
263
-				<input type="number" name="livezoom" id="livezoom" value="<?php if (isset($globalLiveZoom)) print $globalLiveZoom; else print '9'; ?>" />
329
+				<input type="number" name="livezoom" id="livezoom" value="<?php if (isset($globalLiveZoom)) {
330
+	print $globalLiveZoom;
331
+} else {
332
+	print '9';
333
+}
334
+?>" />
264 335
 			</p>
265 336
 			<p>
266 337
 				<label for="squawk_country">Country for squawk usage</label>
267 338
 				<select name="squawk_country" id="squawk_country">
268
-					<option value="UK"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'UK') print ' selected '; ?>>UK</option>
269
-					<option value="NZ"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NZ') print ' selected '; ?>>NZ</option>
270
-					<option value="US"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'US') print ' selected '; ?>>US</option>
271
-					<option value="AU"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'AU') print ' selected '; ?>>AU</option>
272
-					<option value="NL"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NL') print ' selected '; ?>>NL</option>
273
-					<option value="FR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'FR') print ' selected '; ?>>FR</option>
274
-					<option value="TR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'TR') print ' selected '; ?>>TR</option>
339
+					<option value="UK"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'UK') {
340
+	print ' selected ';
341
+}
342
+?>>UK</option>
343
+					<option value="NZ"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NZ') {
344
+	print ' selected ';
345
+}
346
+?>>NZ</option>
347
+					<option value="US"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'US') {
348
+	print ' selected ';
349
+}
350
+?>>US</option>
351
+					<option value="AU"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'AU') {
352
+	print ' selected ';
353
+}
354
+?>>AU</option>
355
+					<option value="NL"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NL') {
356
+	print ' selected ';
357
+}
358
+?>>NL</option>
359
+					<option value="FR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'FR') {
360
+	print ' selected ';
361
+}
362
+?>>FR</option>
363
+					<option value="TR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'TR') {
364
+	print ' selected ';
365
+}
366
+?>>TR</option>
275 367
 				</select>
276 368
 			</p>
277 369
 		</fieldset>
@@ -280,15 +372,24 @@  discard block
 block discarded – undo
280 372
 			<p><i>Only put in DB flights that are inside a circle</i></p>
281 373
 			<p>
282 374
 				<label for="latitude">Center latitude</label>
283
-				<input type="text" name="zoilatitude" id="latitude" value="<?php if (isset($globalDistanceIgnore['latitude'])) echo $globalDistanceIgnore['latitude']; ?>" />
375
+				<input type="text" name="zoilatitude" id="latitude" value="<?php if (isset($globalDistanceIgnore['latitude'])) {
376
+	echo $globalDistanceIgnore['latitude'];
377
+}
378
+?>" />
284 379
 			</p>
285 380
 			<p>
286 381
 				<label for="longitude">Center longitude</label>
287
-				<input type="text" name="zoilongitude" id="longitude" value="<?php if (isset($globalDistanceIgnore['longitude'])) echo $globalDistanceIgnore['longitude']; ?>" />
382
+				<input type="text" name="zoilongitude" id="longitude" value="<?php if (isset($globalDistanceIgnore['longitude'])) {
383
+	echo $globalDistanceIgnore['longitude'];
384
+}
385
+?>" />
288 386
 			</p>
289 387
 			<p>
290 388
 				<label for="Distance">Distance (in km)</label>
291
-				<input type="text" name="zoidistance" id="distance" value="<?php if (isset($globalDistanceIgnore['distance'])) echo $globalDistanceIgnore['distance']; ?>" />
389
+				<input type="text" name="zoidistance" id="distance" value="<?php if (isset($globalDistanceIgnore['distance'])) {
390
+	echo $globalDistanceIgnore['distance'];
391
+}
392
+?>" />
292 393
 			</p>
293 394
 		</fieldset>
294 395
 		<fieldset id="sourceloc">
@@ -383,11 +484,17 @@  discard block
 block discarded – undo
383 484
 			<div id="flightaware_data">
384 485
 				<p>
385 486
 					<label for="flightawareusername">FlightAware username</label>
386
-					<input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) print $globalFlightAwareUsername; ?>" />
487
+					<input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) {
488
+	print $globalFlightAwareUsername;
489
+}
490
+?>" />
387 491
 				</p>
388 492
 				<p>
389 493
 					<label for="flightawarepassword">FlightAware password/API key</label>
390
-					<input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) print $globalFlightAwarePassword; ?>" />
494
+					<input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) {
495
+	print $globalFlightAwarePassword;
496
+}
497
+?>" />
391 498
 				</p>
392 499
 			</div>
393 500
 -->
@@ -446,25 +553,76 @@  discard block
 block discarded – undo
446 553
 								?>
447 554
 								<td>
448 555
 									<select name="format[]" id="format">
449
-										<option value="auto" <?php if (!isset($source['format'])) print 'selected'; ?>>Auto</option>
450
-										<option value="sbs" <?php if (isset($source['format']) && $source['format'] == 'sbs') print 'selected'; ?>>SBS</option>
451
-										<option value="tsv" <?php if (isset($source['format']) && $source['format'] == 'tsv') print 'selected'; ?>>TSV</option>
452
-										<option value="raw" <?php if (isset($source['format']) && $source['format'] == 'raw') print 'selected'; ?>>Raw</option>
453
-										<option value="aprs" <?php if (isset($source['format']) && $source['format'] == 'aprs') print 'selected'; ?>>APRS</option>
454
-										<option value="deltadbtxt" <?php if (isset($source['format']) && $source['format'] == 'deltadbtxt') print 'selected'; ?>>Radarcape deltadb.txt</option>
455
-										<option value="vatsimtxt" <?php if (isset($source['format']) && $source['format'] == 'vatsimtxt') print 'selected'; ?>>Vatsim</option>
456
-										<option value="aircraftlistjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftlistjson') print 'selected'; ?>>Virtual Radar Server</option>
457
-										<option value="phpvmacars" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') print 'selected'; ?>>phpVMS</option>
458
-										<option value="vam" <?php if (isset($source['format']) && $source['format'] == 'vam') print 'selected'; ?>>Virtual Airlines Manager</option>
459
-										<option value="whazzup" <?php if (isset($source['format']) && $source['format'] == 'whazzup') print 'selected'; ?>>IVAO</option>
460
-										<option value="flightgearmp" <?php if (isset($source['format']) && $source['format'] == 'flightgearmp') print 'selected'; ?>>FlightGear Multiplayer</option>
461
-										<option value="flightgearsp" <?php if (isset($source['format']) && $source['format'] == 'flightgearsp') print 'selected'; ?>>FlightGear Singleplayer</option>
462
-										<option value="acars" <?php if (isset($source['format']) && $source['format'] == 'acars') print 'selected'; ?>>ACARS from acarsdec/acarsdeco2 over UDP</option>
463
-										<option value="acarssbs3" <?php if (isset($source['format']) && $source['format'] == 'acarssbs3') print 'selected'; ?>>ACARS over SBS-3 TCP</option>
556
+										<option value="auto" <?php if (!isset($source['format'])) {
557
+	print 'selected';
558
+}
559
+?>>Auto</option>
560
+										<option value="sbs" <?php if (isset($source['format']) && $source['format'] == 'sbs') {
561
+	print 'selected';
562
+}
563
+?>>SBS</option>
564
+										<option value="tsv" <?php if (isset($source['format']) && $source['format'] == 'tsv') {
565
+	print 'selected';
566
+}
567
+?>>TSV</option>
568
+										<option value="raw" <?php if (isset($source['format']) && $source['format'] == 'raw') {
569
+	print 'selected';
570
+}
571
+?>>Raw</option>
572
+										<option value="aprs" <?php if (isset($source['format']) && $source['format'] == 'aprs') {
573
+	print 'selected';
574
+}
575
+?>>APRS</option>
576
+										<option value="deltadbtxt" <?php if (isset($source['format']) && $source['format'] == 'deltadbtxt') {
577
+	print 'selected';
578
+}
579
+?>>Radarcape deltadb.txt</option>
580
+										<option value="vatsimtxt" <?php if (isset($source['format']) && $source['format'] == 'vatsimtxt') {
581
+	print 'selected';
582
+}
583
+?>>Vatsim</option>
584
+										<option value="aircraftlistjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftlistjson') {
585
+	print 'selected';
586
+}
587
+?>>Virtual Radar Server</option>
588
+										<option value="phpvmacars" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') {
589
+	print 'selected';
590
+}
591
+?>>phpVMS</option>
592
+										<option value="vam" <?php if (isset($source['format']) && $source['format'] == 'vam') {
593
+	print 'selected';
594
+}
595
+?>>Virtual Airlines Manager</option>
596
+										<option value="whazzup" <?php if (isset($source['format']) && $source['format'] == 'whazzup') {
597
+	print 'selected';
598
+}
599
+?>>IVAO</option>
600
+										<option value="flightgearmp" <?php if (isset($source['format']) && $source['format'] == 'flightgearmp') {
601
+	print 'selected';
602
+}
603
+?>>FlightGear Multiplayer</option>
604
+										<option value="flightgearsp" <?php if (isset($source['format']) && $source['format'] == 'flightgearsp') {
605
+	print 'selected';
606
+}
607
+?>>FlightGear Singleplayer</option>
608
+										<option value="acars" <?php if (isset($source['format']) && $source['format'] == 'acars') {
609
+	print 'selected';
610
+}
611
+?>>ACARS from acarsdec/acarsdeco2 over UDP</option>
612
+										<option value="acarssbs3" <?php if (isset($source['format']) && $source['format'] == 'acarssbs3') {
613
+	print 'selected';
614
+}
615
+?>>ACARS over SBS-3 TCP</option>
464 616
 									</select>
465 617
 								</td>
466
-								<td><input type="text" name="name[]" id="name" value="<?php if (isset($source['name'])) print $source['name']; ?>" /></td>
467
-								<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>
618
+								<td><input type="text" name="name[]" id="name" value="<?php if (isset($source['name'])) {
619
+	print $source['name'];
620
+}
621
+?>" /></td>
622
+								<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']) {
623
+	print 'checked';
624
+}
625
+?> /></td>
468 626
 								<td><input type="button" id="delhost" value="Delete" onclick="deleteRow(this)" /> <input type="button" id="addhost" value="Add" onclick="insRow()" /></td>
469 627
 							</tr>
470 628
 <?php
@@ -510,11 +668,17 @@  discard block
 block discarded – undo
510 668
 					<p>Listen UDP server for acarsdec/acarsdeco2/... with <i>daemon-acars.php</i> script</p>
511 669
 					<p>
512 670
 						<label for="acarshost">ACARS UDP host</label>
513
-						<input type="text" name="acarshost" id="acarshost" value="<?php if (isset($globalACARSHost)) print $globalACARSHost; ?>" />
671
+						<input type="text" name="acarshost" id="acarshost" value="<?php if (isset($globalACARSHost)) {
672
+	print $globalACARSHost;
673
+}
674
+?>" />
514 675
 					</p>
515 676
 					<p>
516 677
 						<label for="acarsport">ACARS UDP port</label>
517
-						<input type="number" name="acarsport" id="acarsport" value="<?php if (isset($globalACARSPort)) print $globalACARSPort; ?>" />
678
+						<input type="number" name="acarsport" id="acarsport" value="<?php if (isset($globalACARSPort)) {
679
+	print $globalACARSPort;
680
+}
681
+?>" />
518 682
 					</p>
519 683
 				</fieldset>
520 684
 			</div>
@@ -594,13 +758,19 @@  discard block
 block discarded – undo
594 758
 			<div id="schedules_options">
595 759
 				<p>
596 760
 					<label for="britishairways">British Airways API Key</label>
597
-					<input type="text" name="britishairways" id="britishairways" value="<?php if (isset($globalBritishAirwaysKey)) print $globalBritishAirwaysKey; ?>" />
761
+					<input type="text" name="britishairways" id="britishairways" value="<?php if (isset($globalBritishAirwaysKey)) {
762
+	print $globalBritishAirwaysKey;
763
+}
764
+?>" />
598 765
 					<p class="help-block">Register an account on <a href="https://developer.ba.com/">https://developer.ba.com/</a></p>
599 766
 				</p>
600 767
 				<!--
601 768
 				<p>
602 769
 					<label for="transavia">Transavia Test API Consumer Key</label>
603
-					<input type="text" name="transavia" id="transavia" value="<?php if (isset($globalTransaviaKey)) print $globalTransaviaKey; ?>" />
770
+					<input type="text" name="transavia" id="transavia" value="<?php if (isset($globalTransaviaKey)) {
771
+	print $globalTransaviaKey;
772
+}
773
+?>" />
604 774
 					<p class="help-block">Register an account on <a href="https://developer.transavia.com">https://developer.transavia.com</a></p>
605 775
 				</p>
606 776
 				-->
@@ -609,10 +779,16 @@  discard block
 block discarded – undo
609 779
 						<b>Lufthansa API Key</b>
610 780
 						<p>
611 781
 							<label for="lufthansakey">Key</label>
612
-							<input type="text" name="lufthansakey" id="lufthansakey" value="<?php if (isset($globalLufthansaKey['key'])) print $globalLufthansaKey['key']; ?>" />
782
+							<input type="text" name="lufthansakey" id="lufthansakey" value="<?php if (isset($globalLufthansaKey['key'])) {
783
+	print $globalLufthansaKey['key'];
784
+}
785
+?>" />
613 786
 						</p><p>
614 787
 							<label for="lufthansasecret">Secret</label>
615
-							<input type="text" name="lufthansasecret" id="lufthansasecret" value="<?php if (isset($globalLufthansaKey['secret'])) print $globalLufthansaKey['secret']; ?>" />
788
+							<input type="text" name="lufthansasecret" id="lufthansasecret" value="<?php if (isset($globalLufthansaKey['secret'])) {
789
+	print $globalLufthansaKey['secret'];
790
+}
791
+?>" />
616 792
 						</p>
617 793
 					</div>
618 794
 					<p class="help-block">Register an account on <a href="https://developer.lufthansa.com/page">https://developer.lufthansa.com/page</a></p>
@@ -632,7 +808,10 @@  discard block
 block discarded – undo
632 808
 			</p>
633 809
 			<p>
634 810
 				<label for="notamsource">URL of your feed from notaminfo.com</label>
635
-				<input type="text" name="notamsource" id="notamsource" value="<?php if (isset($globalNOTAMSource)) print $globalNOTAMSource; ?>" />
811
+				<input type="text" name="notamsource" id="notamsource" value="<?php if (isset($globalNOTAMSource)) {
812
+	print $globalNOTAMSource;
813
+}
814
+?>" />
636 815
 				<p class="help-block">If you want to use world NOTAM from FlightAirMap website, leave it blank</p>
637 816
 			</p>
638 817
 			<br />
@@ -648,14 +827,20 @@  discard block
 block discarded – undo
648 827
 			<div id="metarsrc">
649 828
 				<p>
650 829
 					<label for="metarsource">URL of your METAR source</label>
651
-					<input type="text" name="metarsource" id="metarsource" value="<?php if (isset($globalMETARurl)) print $globalMETARurl; ?>" />
830
+					<input type="text" name="metarsource" id="metarsource" value="<?php if (isset($globalMETARurl)) {
831
+	print $globalMETARurl;
832
+}
833
+?>" />
652 834
 					<p class="help-block">Use {icao} to specify where we replace by airport icao. ex : http://metar.vatsim.net/metar.php?id={icao}</p>
653 835
 				</p>
654 836
 			</div>
655 837
 			<br />
656 838
 			<p>
657 839
 				<label for="bitly">Bit.ly access token api (used in search page)</label>
658
-				<input type="text" name="bitly" id="bitly" value="<?php if (isset($globalBitlyAccessToken)) print $globalBitlyAccessToken; ?>" />
840
+				<input type="text" name="bitly" id="bitly" value="<?php if (isset($globalBitlyAccessToken)) {
841
+	print $globalBitlyAccessToken;
842
+}
843
+?>" />
659 844
 			</p>
660 845
 			<br />
661 846
 			<p>
@@ -675,7 +860,12 @@  discard block
 block discarded – undo
675 860
 			</p>
676 861
 			<p>
677 862
 				<label for="archivemonths">Generate statistics, delete or put in archive flights older than xx months</label>
678
-				<input type="number" name="archivemonths" id="archivemonths" value="<?php if (isset($globalArchiveMonths)) print $globalArchiveMonths; else echo '0'; ?>" />
863
+				<input type="number" name="archivemonths" id="archivemonths" value="<?php if (isset($globalArchiveMonths)) {
864
+	print $globalArchiveMonths;
865
+} else {
866
+	echo '0';
867
+}
868
+?>" />
679 869
 				<p class="help-block">0 to disable, delete old flight if <i>Archive all flights data</i> is disabled</p>
680 870
 			</p>
681 871
 			<p>
@@ -685,12 +875,22 @@  discard block
 block discarded – undo
685 875
 			</p>
686 876
 			<p>
687 877
 				<label for="archivekeepmonths">Keep flights data for xx months in archive</label>
688
-				<input type="number" name="archivekeepmonths" id="archivekeepmonths" value="<?php if (isset($globalArchiveKeepMonths)) print $globalArchiveKeepMonths; else echo '0'; ?>" />
878
+				<input type="number" name="archivekeepmonths" id="archivekeepmonths" value="<?php if (isset($globalArchiveKeepMonths)) {
879
+	print $globalArchiveKeepMonths;
880
+} else {
881
+	echo '0';
882
+}
883
+?>" />
689 884
 				<p class="help-block">0 to disable</p>
690 885
 			</p>
691 886
 			<p>
692 887
 				<label for="archivekeeptrackmonths">Keep flights track data for xx months in archive</label>
693
-				<input type="number" name="archivekeeptrackmonths" id="archivekeeptrackmonths" value="<?php if (isset($globalArchiveKeepTrackMonths)) print $globalArchiveKeepTrackMonths; else echo '0'; ?>" />
888
+				<input type="number" name="archivekeeptrackmonths" id="archivekeeptrackmonths" value="<?php if (isset($globalArchiveKeepTrackMonths)) {
889
+	print $globalArchiveKeepTrackMonths;
890
+} else {
891
+	echo '0';
892
+}
893
+?>" />
694 894
 				<p class="help-block">0 to disable, should be less or egal to <i>Keep flights data</i> value</p>
695 895
 			</p>
696 896
 			<br />
@@ -700,7 +900,12 @@  discard block
 block discarded – undo
700 900
 				<p class="help-block">Uncheck if the script is running as cron job</p>
701 901
 				<div id="cronends"> 
702 902
 					<label for="cronend">Run script for xx seconds</label>
703
-					<input type="number" name="cronend" id="cronend" value="<?php if (isset($globalCronEnd)) print $globalCronEnd; else print '0'; ?>" />
903
+					<input type="number" name="cronend" id="cronend" value="<?php if (isset($globalCronEnd)) {
904
+	print $globalCronEnd;
905
+} else {
906
+	print '0';
907
+}
908
+?>" />
704 909
 					<p class="help-block">Set to 0 to disable. Should be disabled if source is URL.</p>
705 910
 				</div>
706 911
 			</p>
@@ -745,26 +950,49 @@  discard block
 block discarded – undo
745 950
 			<br />
746 951
 			<p>
747 952
 				<label for="refresh">Show flights detected since xxx seconds</label>
748
-				<input type="number" name="refresh" id="refresh" value="<?php if (isset($globalLiveInterval)) echo $globalLiveInterval; else echo '200'; ?>" />
953
+				<input type="number" name="refresh" id="refresh" value="<?php if (isset($globalLiveInterval)) {
954
+	echo $globalLiveInterval;
955
+} else {
956
+	echo '200';
957
+}
958
+?>" />
749 959
 			</p>
750 960
 			<p>
751 961
 				<label for="maprefresh">Live map refresh (in seconds)</label>
752
-				<input type="number" name="maprefresh" id="maprefresh" value="<?php if (isset($globalMapRefresh)) echo $globalMapRefresh; else echo '30'; ?>" />
962
+				<input type="number" name="maprefresh" id="maprefresh" value="<?php if (isset($globalMapRefresh)) {
963
+	echo $globalMapRefresh;
964
+} else {
965
+	echo '30';
966
+}
967
+?>" />
753 968
 			</p>
754 969
 			<p>
755 970
 				<label for="mapidle">Map idle timeout (in minutes)</label>
756
-				<input type="number" name="mapidle" id="mapidle" value="<?php if (isset($globalMapIdleTimeout)) echo $globalMapIdleTimeout; else echo '30'; ?>" />
971
+				<input type="number" name="mapidle" id="mapidle" value="<?php if (isset($globalMapIdleTimeout)) {
972
+	echo $globalMapIdleTimeout;
973
+} else {
974
+	echo '30';
975
+}
976
+?>" />
757 977
 				<p class="help-block">0 to disable</p>
758 978
 			</p>
759 979
 			<br />
760 980
 			<p>
761 981
 				<label for="closestmindist">Distance to airport set as arrival (in km)</label>
762
-				<input type="number" name="closestmindist" id="closestmindist" value="<?php if (isset($globalClosestMinDist)) echo $globalClosestMinDist; else echo '50'; ?>" />
982
+				<input type="number" name="closestmindist" id="closestmindist" value="<?php if (isset($globalClosestMinDist)) {
983
+	echo $globalClosestMinDist;
984
+} else {
985
+	echo '50';
986
+}
987
+?>" />
763 988
 			</p>
764 989
 			<br />
765 990
 			<p>
766 991
 				<label for="aircraftsize">Size of aircraft icon on map (default to 30px if zoom > 7 else 15px), empty to default</label>
767
-				<input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize;?>" />
992
+				<input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) {
993
+	echo $globalAircraftSize;
994
+}
995
+?>" />
768 996
 			</p>
769 997
 			<br />
770 998
 			<p>
@@ -772,7 +1000,12 @@  discard block
 block discarded – undo
772 1000
 			    if (extension_loaded('gd') && function_exists('gd_info')) {
773 1001
 			?>
774 1002
 				<label for="aircrafticoncolor">Color of aircraft icon on map</label>
775
-				<input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) echo $globalAircraftIconColor; else echo '1a3151'; ?>" />
1003
+				<input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) {
1004
+	echo $globalAircraftIconColor;
1005
+} else {
1006
+	echo '1a3151';
1007
+}
1008
+?>" />
776 1009
 			<?php
777 1010
 				if (!is_writable('../cache')) {
778 1011
 			?>
@@ -790,8 +1023,18 @@  discard block
 block discarded – undo
790 1023
 			<p>
791 1024
 				<label for="airportzoom">Zoom level minimum to see airports icons</label>
792 1025
 				<div class="range">
793
-					<input type="range" name="airportzoom" id="airportzoom" value="<?php if (isset($globalAirportZoom)) echo $globalAirportZoom; else echo '7'; ?>" />
794
-					<output id="range"><?php if (isset($globalAirportZoom)) echo $globalAirportZoom; else echo '7'; ?></output>
1026
+					<input type="range" name="airportzoom" id="airportzoom" value="<?php if (isset($globalAirportZoom)) {
1027
+	echo $globalAirportZoom;
1028
+} else {
1029
+	echo '7';
1030
+}
1031
+?>" />
1032
+					<output id="range"><?php if (isset($globalAirportZoom)) {
1033
+	echo $globalAirportZoom;
1034
+} else {
1035
+	echo '7';
1036
+}
1037
+?></output>
795 1038
 				</div>
796 1039
 			</p>
797 1040
 		</fieldset>
@@ -819,8 +1062,12 @@  discard block
 block discarded – undo
819 1062
 	$dbhost = filter_input(INPUT_POST,'dbhost',FILTER_SANITIZE_STRING);
820 1063
 	$dbport = filter_input(INPUT_POST,'dbport',FILTER_SANITIZE_STRING);
821 1064
 
822
-	if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) $error .= 'Mysql driver for PDO must be loaded';
823
-	if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) $error .= 'PosgreSQL driver for PDO must be loaded';
1065
+	if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) {
1066
+		$error .= 'Mysql driver for PDO must be loaded';
1067
+	}
1068
+	if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) {
1069
+		$error .= 'PosgreSQL driver for PDO must be loaded';
1070
+	}
824 1071
 	
825 1072
 	$_SESSION['database_root'] = $dbroot;
826 1073
 	$_SESSION['database_rootpass'] = $dbrootpass;
@@ -887,15 +1134,23 @@  discard block
 block discarded – undo
887 1134
 	$source_city = $_POST['source_city'];
888 1135
 	$source_country = $_POST['source_country'];
889 1136
 	$source_ref = $_POST['source_ref'];
890
-	if (isset($source_id)) $source_id = $_POST['source_id'];
891
-	else $source_id = array();
1137
+	if (isset($source_id)) {
1138
+		$source_id = $_POST['source_id'];
1139
+	} else {
1140
+		$source_id = array();
1141
+	}
892 1142
 	
893 1143
 	$sources = array();
894 1144
 	foreach ($source_name as $keys => $name) {
895
-	    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]);
896
-	    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]);
1145
+	    if (isset($source_id[$keys])) {
1146
+	    	$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]);
1147
+	    } else {
1148
+	    	$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]);
1149
+	    }
1150
+	}
1151
+	if (count($sources) > 0) {
1152
+		$_SESSION['sources'] = $sources;
897 1153
 	}
898
-	if (count($sources) > 0) $_SESSION['sources'] = $sources;
899 1154
 
900 1155
 	//$sbshost = filter_input(INPUT_POST,'sbshost',FILTER_SANITIZE_STRING);
901 1156
 	//$sbsport = filter_input(INPUT_POST,'sbsport',FILTER_SANITIZE_NUMBER_INT);
@@ -933,13 +1188,21 @@  discard block
 block discarded – undo
933 1188
 	$port = $_POST['port'];
934 1189
 	$name = $_POST['name'];
935 1190
 	$format = $_POST['format'];
936
-	if (isset($_POST['sourcestats'])) $sourcestats = $_POST['sourcestats'];
937
-	else $sourcestats = array();
1191
+	if (isset($_POST['sourcestats'])) {
1192
+		$sourcestats = $_POST['sourcestats'];
1193
+	} else {
1194
+		$sourcestats = array();
1195
+	}
938 1196
 	$gSources = array();
939 1197
 	foreach ($host as $key => $h) {
940
-		if (isset($sourcestats[$key]) && $sourcestats[$key] == 1) $cov = 'TRUE';
941
-		else $cov = 'FALSE';
942
-		if ($h != '') $gSources[] = array('host' => $h, 'port' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov);
1198
+		if (isset($sourcestats[$key]) && $sourcestats[$key] == 1) {
1199
+			$cov = 'TRUE';
1200
+		} else {
1201
+			$cov = 'FALSE';
1202
+		}
1203
+		if ($h != '') {
1204
+			$gSources[] = array('host' => $h, 'port' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov);
1205
+		}
943 1206
 	}
944 1207
 	$settings = array_merge($settings,array('globalSources' => $gSources));
945 1208
 
@@ -964,7 +1227,9 @@  discard block
 block discarded – undo
964 1227
 	$zoidistance = filter_input(INPUT_POST,'zoidistance',FILTER_SANITIZE_NUMBER_INT);
965 1228
 	if ($zoilatitude != '' && $zoilongitude != '' && $zoidistance != '') {
966 1229
 		$settings = array_merge($settings,array('globalDistanceIgnore' => array('latitude' => $zoilatitude,'longitude' => $zoilongitude,'distance' => $zoidistance)));
967
-	} else $settings = array_merge($settings,array('globalDistanceIgnore' => array()));
1230
+	} else {
1231
+		$settings = array_merge($settings,array('globalDistanceIgnore' => array()));
1232
+	}
968 1233
 
969 1234
 	$refresh = filter_input(INPUT_POST,'refresh',FILTER_SANITIZE_NUMBER_INT);
970 1235
 	$settings = array_merge($settings,array('globalLiveInterval' => $refresh));
@@ -1003,7 +1268,9 @@  discard block
 block discarded – undo
1003 1268
 
1004 1269
 	// Create in settings.php keys not yet configurable if not already here
1005 1270
 	//if (!isset($globalImageBingKey)) $settings = array_merge($settings,array('globalImageBingKey' => ''));
1006
-	if (!isset($globalDebug)) $settings = array_merge($settings,array('globalDebug' => 'TRUE'));
1271
+	if (!isset($globalDebug)) {
1272
+		$settings = array_merge($settings,array('globalDebug' => 'TRUE'));
1273
+	}
1007 1274
 
1008 1275
 	$resetyearstats = filter_input(INPUT_POST,'resetyearstats',FILTER_SANITIZE_STRING);
1009 1276
 	if ($resetyearstats == 'resetyearstats') {
@@ -1040,27 +1307,43 @@  discard block
 block discarded – undo
1040 1307
 	}
1041 1308
 */
1042 1309
 	$settings = array_merge($settings,array('globalFlightAware' => 'FALSE'));
1043
-	if ($globalsbs == 'sbs') $settings = array_merge($settings,array('globalSBS1' => 'TRUE'));
1044
-	else $settings = array_merge($settings,array('globalSBS1' => 'FALSE'));
1045
-	if ($globalaprs == 'aprs') $settings = array_merge($settings,array('globalAPRS' => 'TRUE'));
1046
-	else $settings = array_merge($settings,array('globalAPRS' => 'FALSE'));
1310
+	if ($globalsbs == 'sbs') {
1311
+		$settings = array_merge($settings,array('globalSBS1' => 'TRUE'));
1312
+	} else {
1313
+		$settings = array_merge($settings,array('globalSBS1' => 'FALSE'));
1314
+	}
1315
+	if ($globalaprs == 'aprs') {
1316
+		$settings = array_merge($settings,array('globalAPRS' => 'TRUE'));
1317
+	} else {
1318
+		$settings = array_merge($settings,array('globalAPRS' => 'FALSE'));
1319
+	}
1047 1320
 	if ($globalivao == 'ivao') {
1048 1321
 		//$settings = array_merge($settings,array('globalIVAO' => 'TRUE','globalVATSIM' => 'FALSE'));
1049 1322
 		$settings = array_merge($settings,array('globalIVAO' => 'TRUE'));
1050
-	} else $settings = array_merge($settings,array('globalIVAO' => 'FALSE'));
1323
+	} else {
1324
+		$settings = array_merge($settings,array('globalIVAO' => 'FALSE'));
1325
+	}
1051 1326
 	if ($globalvatsim == 'vatsim') {
1052 1327
 		//$settings = array_merge($settings,array('globalVATSIM' => 'TRUE','globalIVAO' => 'FALSE'));
1053 1328
 		$settings = array_merge($settings,array('globalVATSIM' => 'TRUE'));
1054
-	} else $settings = array_merge($settings,array('globalVATSIM' => 'FALSE'));
1329
+	} else {
1330
+		$settings = array_merge($settings,array('globalVATSIM' => 'FALSE'));
1331
+	}
1055 1332
 	if ($globalphpvms == 'phpvms') {
1056 1333
 		$settings = array_merge($settings,array('globalphpVMS' => 'TRUE'));
1057
-	} else $settings = array_merge($settings,array('globalphpVMS' => 'FALSE'));
1334
+	} else {
1335
+		$settings = array_merge($settings,array('globalphpVMS' => 'FALSE'));
1336
+	}
1058 1337
 	if ($globalvam == 'vam') {
1059 1338
 		$settings = array_merge($settings,array('globalVAM' => 'TRUE'));
1060
-	} else $settings = array_merge($settings,array('globalVAM' => 'FALSE'));
1339
+	} else {
1340
+		$settings = array_merge($settings,array('globalVAM' => 'FALSE'));
1341
+	}
1061 1342
 	if ($globalvatsim == 'vatsim' || $globalivao == 'ivao' || $globalphpvms == 'phpvms') {
1062 1343
 		$settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE','globalTranslationFetch' => 'FALSE'));
1063
-	} else $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE'));
1344
+	} else {
1345
+		$settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE'));
1346
+	}
1064 1347
 	
1065 1348
 
1066 1349
 
@@ -1196,7 +1479,9 @@  discard block
 block discarded – undo
1196 1479
 		$settings = array_merge($settings,array('globalWaypoints' => 'FALSE'));
1197 1480
 	}
1198 1481
 
1199
-	if (!isset($globalTransaction)) $settings = array_merge($settings,array('globalTransaction' => 'TRUE'));
1482
+	if (!isset($globalTransaction)) {
1483
+		$settings = array_merge($settings,array('globalTransaction' => 'TRUE'));
1484
+	}
1200 1485
 
1201 1486
 	// Set some defaults values...
1202 1487
 	if (!isset($globalAircraftImageSources)) {
@@ -1211,15 +1496,23 @@  discard block
 block discarded – undo
1211 1496
 
1212 1497
 	$settings = array_merge($settings,array('globalInstalled' => 'TRUE'));
1213 1498
 
1214
-	if ($error == '') settings::modify_settings($settings);
1215
-	if ($error == '') settings::comment_settings($settings_comment);
1499
+	if ($error == '') {
1500
+		settings::modify_settings($settings);
1501
+	}
1502
+	if ($error == '') {
1503
+		settings::comment_settings($settings_comment);
1504
+	}
1216 1505
 	if ($error != '') {
1217 1506
 		print '<div class="info column">'.$error.'</div>';
1218 1507
 		require('../footer.php');
1219 1508
 		exit;
1220 1509
 	} else {
1221
-		if (isset($_POST['waypoints']) && $_POST['waypoints'] == 'waypoints') $_SESSION['waypoints'] = 1;
1222
-		if (isset($_POST['owner']) && $_POST['owner'] == 'owner') $_SESSION['owner'] = 1;
1510
+		if (isset($_POST['waypoints']) && $_POST['waypoints'] == 'waypoints') {
1511
+			$_SESSION['waypoints'] = 1;
1512
+		}
1513
+		if (isset($_POST['owner']) && $_POST['owner'] == 'owner') {
1514
+			$_SESSION['owner'] = 1;
1515
+		}
1223 1516
 		if (isset($_POST['createdb'])) {
1224 1517
 			$_SESSION['install'] = 'database_create';
1225 1518
 		} else {
@@ -1260,10 +1553,18 @@  discard block
 block discarded – undo
1260 1553
 	$popw = false;
1261 1554
 	foreach ($_SESSION['done'] as $done) {
1262 1555
 	    print '<li>'.$done.'....<strong>SUCCESS</strong></li>';
1263
-	    if ($done == 'Create database') $pop = true;
1264
-	    if ($_SESSION['install'] == 'database_create') $pop = true;
1265
-	    if ($_SESSION['install'] == 'database_import') $popi = true;
1266
-	    if ($_SESSION['install'] == 'waypoints') $popw = true;
1556
+	    if ($done == 'Create database') {
1557
+	    	$pop = true;
1558
+	    }
1559
+	    if ($_SESSION['install'] == 'database_create') {
1560
+	    	$pop = true;
1561
+	    }
1562
+	    if ($_SESSION['install'] == 'database_import') {
1563
+	    	$popi = true;
1564
+	    }
1565
+	    if ($_SESSION['install'] == 'waypoints') {
1566
+	    	$popw = true;
1567
+	    }
1267 1568
 	}
1268 1569
 	if ($pop) {
1269 1570
 	    sleep(5);
@@ -1274,7 +1575,9 @@  discard block
 block discarded – undo
1274 1575
 	} else if ($popw) {
1275 1576
 	    sleep(5);
1276 1577
 	    print '<li>Populate waypoints database....<img src="../images/loading.gif" /></li>';
1277
-	} else print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>';
1578
+	} else {
1579
+		print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>';
1580
+	}
1278 1581
 	print '</div></ul>';
1279 1582
 	print '<div id="error"></div>';
1280 1583
 /*	foreach ($_SESSION['done'] as $done) {
Please login to merge, or discard this patch.
airline-statistics-route.php 1 patch
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -21,7 +21,9 @@  discard block
 block discarded – undo
21 21
 	print '<option></option>';
22 22
 	$Stats = new Stats();
23 23
 	$airline_names = $Stats->getAllAirlineNames();
24
-	if (empty($airline_names)) $airline_names = $Spotter->getAllAirlineNames();
24
+	if (empty($airline_names)) {
25
+		$airline_names = $Spotter->getAllAirlineNames();
26
+	}
25 27
 	foreach($airline_names as $airline_name)
26 28
 	{
27 29
 		if($airline == $airline_name['airline_icao'])
@@ -43,8 +45,7 @@  discard block
 block discarded – undo
43 45
 			if ($globalIVAO && @getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.gif'))
44 46
 			{
45 47
 				print '<img src="'.$globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.gif" alt="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" title="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" class="logo" />';
46
-			}
47
-			elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png'))
48
+			} elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png'))
48 49
 			{
49 50
 				print '<img src="'.$globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png" alt="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" title="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" class="logo" />';
50 51
 			}
Please login to merge, or discard this patch.
route-statistics-registration.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,9 @@
 block discarded – undo
11 11
 $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
12 12
 if (isset($_GET['departure_airport']) && isset($_GET['arrival_airport'])) {
13 13
 	$spotter_array = $Spotter->getSpotterDataByRoute($_GET['departure_airport'], $_GET['arrival_airport'], "0,1", $sort);
14
-} else $spotter_array = array();
14
+} else {
15
+	$spotter_array = array();
16
+}
15 17
   
16 18
 if (!empty($spotter_array))
17 19
 {
Please login to merge, or discard this patch.