Completed
Push — master ( db2756...3d0574 )
by Yannick
29:36
created
install/index.php 1 patch
Braces   +578 added lines, -156 removed lines patch added patch discarded remove patch
@@ -4,11 +4,19 @@  discard block
 block discarded – undo
4 4
 if (isset($_SESSION['error'])) {
5 5
 	header('Content-Encoding: none;');
6 6
 	echo 'Error : '.$_SESSION['error'].' - Resetting install... You need to fix the problem and run install again.';
7
-	if (isset($_SESSION['error'])) unset($_SESSION['error']);
8
-	if (isset($_SESSION['errorlst'])) unset($_SESSION['errorlst']);
9
-	if (isset($_SESSION['next'])) unset($_SESSION['next']);
10
-	if (isset($_SESSION['install'])) unset($_SESSION['install']);
11
-}
7
+	if (isset($_SESSION['error'])) {
8
+		unset($_SESSION['error']);
9
+	}
10
+	if (isset($_SESSION['errorlst'])) {
11
+		unset($_SESSION['errorlst']);
12
+	}
13
+	if (isset($_SESSION['next'])) {
14
+		unset($_SESSION['next']);
15
+	}
16
+	if (isset($_SESSION['install'])) {
17
+		unset($_SESSION['install']);
18
+	}
19
+	}
12 20
 /*
13 21
 if (isset($_SESSION['errorlst'])) {
14 22
 	header('Content-Encoding: none;');
@@ -159,45 +167,72 @@  discard block
 block discarded – undo
159 167
 			</div>
160 168
 			<p>
161 169
 				<label for="dbhost">Database hostname</label>
162
-				<input type="text" name="dbhost" id="dbhost" value="<?php if (isset($globalDBhost)) print $globalDBhost; ?>" />
170
+				<input type="text" name="dbhost" id="dbhost" value="<?php if (isset($globalDBhost)) {
171
+	print $globalDBhost;
172
+}
173
+?>" />
163 174
 			</p>
164 175
 			<p>
165 176
 				<label for="dbport">Database port</label>
166
-				<input type="text" name="dbport" id="dbport" value="<?php if (isset($globalDBport)) print $globalDBport; ?>" />
177
+				<input type="text" name="dbport" id="dbport" value="<?php if (isset($globalDBport)) {
178
+	print $globalDBport;
179
+}
180
+?>" />
167 181
 				<p class="help-block">Default is 3306 for MariaDB/MySQL, 5432 for PostgreSQL</p>
168 182
 			</p>
169 183
 			<p>
170 184
 				<label for="dbname">Database name</label>
171
-				<input type="text" name="dbname" id="dbname" value="<?php if (isset($globalDBname)) print $globalDBname; ?>" />
185
+				<input type="text" name="dbname" id="dbname" value="<?php if (isset($globalDBname)) {
186
+	print $globalDBname;
187
+}
188
+?>" />
172 189
 			</p>
173 190
 			<p>
174 191
 				<label for="dbuser">Database user</label>
175
-				<input type="text" name="dbuser" id="dbuser" value="<?php if (isset($globalDBuser)) print $globalDBuser; ?>" />
192
+				<input type="text" name="dbuser" id="dbuser" value="<?php if (isset($globalDBuser)) {
193
+	print $globalDBuser;
194
+}
195
+?>" />
176 196
 			</p>
177 197
 			<p>
178 198
 				<label for="dbuserpass">Database user password</label>
179
-				<input type="password" name="dbuserpass" id="dbuserpass" value="<?php if (isset($globalDBpass)) print $globalDBpass; ?>" />
199
+				<input type="password" name="dbuserpass" id="dbuserpass" value="<?php if (isset($globalDBpass)) {
200
+	print $globalDBpass;
201
+}
202
+?>" />
180 203
 			</p>
181 204
 		</fieldset>
182 205
 		<fieldset id="site">
183 206
 			<legend>Site configuration</legend>
184 207
 			<p>
185 208
 				<label for="sitename">Site name</label>
186
-				<input type="text" name="sitename" id="sitename" value="<?php if (isset($globalName)) print $globalName; ?>" />
209
+				<input type="text" name="sitename" id="sitename" value="<?php if (isset($globalName)) {
210
+	print $globalName;
211
+}
212
+?>" />
187 213
 			</p>
188 214
 			<p>
189 215
 				<label for="siteurl">Site directory</label>
190
-				<input type="text" name="siteurl" id="siteurl" value="<?php if (isset($globalURL)) print $globalURL; ?>" />
216
+				<input type="text" name="siteurl" id="siteurl" value="<?php if (isset($globalURL)) {
217
+	print $globalURL;
218
+}
219
+?>" />
191 220
 				<p class="help-block">Can be null. ex : <i>flightairmap</i> if complete URL is <i>http://toto.com/flightairmap</i></p>
192 221
 			</p>
193 222
 			<p>
194 223
 				<label for="timezone">Timezone</label>
195
-				<input type="text" name="timezone" id="timezone" value="<?php if (isset($globalTimezone)) print $globalTimezone; ?>" />
224
+				<input type="text" name="timezone" id="timezone" value="<?php if (isset($globalTimezone)) {
225
+	print $globalTimezone;
226
+}
227
+?>" />
196 228
 				<p class="help-block">ex : UTC, Europe/Paris,...</p>
197 229
 			</p>
198 230
 			<p>
199 231
 				<label for="language">Language</label>
200
-				<input type="text" name="language" id="language" value="<?php if (isset($globalLanguage)) print $globalLanguage; ?>" />
232
+				<input type="text" name="language" id="language" value="<?php if (isset($globalLanguage)) {
233
+	print $globalLanguage;
234
+}
235
+?>" />
201 236
 				<p class="help-block">Used only when link to wikipedia for now. Can be EN,DE,FR,...</p>
202 237
 			</p>
203 238
 		</fieldset>
@@ -218,11 +253,17 @@  discard block
 block discarded – undo
218 253
 			<div id="mapbox_data">
219 254
 				<p>
220 255
 					<label for="mapboxid">Mapbox id</label>
221
-					<input type="text" name="mapboxid" id="mapboxid" value="<?php if (isset($globalMapboxId)) print $globalMapboxId; ?>" />
256
+					<input type="text" name="mapboxid" id="mapboxid" value="<?php if (isset($globalMapboxId)) {
257
+	print $globalMapboxId;
258
+}
259
+?>" />
222 260
 				</p>
223 261
 				<p>
224 262
 					<label for="mapboxtoken">Mapbox token</label>
225
-					<input type="text" name="mapboxtoken" id="mapboxtoken" value="<?php if (isset($globalMapboxToken)) print $globalMapboxToken; ?>" />
263
+					<input type="text" name="mapboxtoken" id="mapboxtoken" value="<?php if (isset($globalMapboxToken)) {
264
+	print $globalMapboxToken;
265
+}
266
+?>" />
226 267
 				</p>
227 268
 				<p class="help-block">Get a key <a href="https://www.mapbox.com/developers/">here</a></p>
228 269
 			</div>
@@ -230,7 +271,10 @@  discard block
 block discarded – undo
230 271
 			<div id="google_data">
231 272
 				<p>
232 273
 					<label for="googlekey">Google API key</label>
233
-					<input type="text" name="googlekey" id="googlekey" value="<?php if (isset($globalGoogleAPIKey)) print $globalGoogleAPIKey; ?>" />
274
+					<input type="text" name="googlekey" id="googlekey" value="<?php if (isset($globalGoogleAPIKey)) {
275
+	print $globalGoogleAPIKey;
276
+}
277
+?>" />
234 278
 					<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>
235 279
 				</p>
236 280
 			</div>
@@ -238,7 +282,10 @@  discard block
 block discarded – undo
238 282
 			<div id="bing_data">
239 283
 				<p>
240 284
 					<label for="bingkey">Bing Map key</label>
241
-					<input type="text" name="bingkey" id="bingkey" value="<?php if (isset($globalBingMapKey)) print $globalBingMapKey; ?>" />
285
+					<input type="text" name="bingkey" id="bingkey" value="<?php if (isset($globalBingMapKey)) {
286
+	print $globalBingMapKey;
287
+}
288
+?>" />
242 289
 					<p class="help-block">Get a key <a href="https://www.bingmapsportal.com/">here</a></p>
243 290
 				</p>
244 291
 			</div>
@@ -246,7 +293,10 @@  discard block
 block discarded – undo
246 293
 			<div id="mapquest_data">
247 294
 				<p>
248 295
 					<label for="mapquestkey">MapQuest key</label>
249
-					<input type="text" name="mapquestkey" id="mapquestkey" value="<?php if (isset($globalMapQuestKey)) print $globalMapQuestKey; ?>" />
296
+					<input type="text" name="mapquestkey" id="mapquestkey" value="<?php if (isset($globalMapQuestKey)) {
297
+	print $globalMapQuestKey;
298
+}
299
+?>" />
250 300
 					<p class="help-block">Get a key <a href="https://developer.mapquest.com/user/me/apps">here</a></p>
251 301
 				</p>
252 302
 			</div>
@@ -254,11 +304,17 @@  discard block
 block discarded – undo
254 304
 			<div id="here_data">
255 305
 				<p>
256 306
 					<label for="hereappid">Here App_Id</label>
257
-					<input type="text" name="hereappid" id="hereappid" value="<?php if (isset($globalHereappId)) print $globalHereappId; ?>" />
307
+					<input type="text" name="hereappid" id="hereappid" value="<?php if (isset($globalHereappId)) {
308
+	print $globalHereappId;
309
+}
310
+?>" />
258 311
 				</p>
259 312
 				<p>
260 313
 					<label for="hereappcode">Here App_Code</label>
261
-					<input type="text" name="hereappcode" id="hereappcode" value="<?php if (isset($globalHereappCode)) print $globalHereappCode; ?>" />
314
+					<input type="text" name="hereappcode" id="hereappcode" value="<?php if (isset($globalHereappCode)) {
315
+	print $globalHereappCode;
316
+}
317
+?>" />
262 318
 				</p>
263 319
 				<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>
264 320
 			</div>
@@ -266,7 +322,10 @@  discard block
 block discarded – undo
266 322
 			<div id="openweathermap_data">
267 323
 				<p>
268 324
 					<label for="openweathermapkey">OpenWeatherMap key (weather layer)</label>
269
-					<input type="text" name="openweathermapkey" id="openweathermapkey" value="<?php if (isset($globalOpenWeatherMapKey)) print $globalOpenWeatherMapKey; ?>" />
325
+					<input type="text" name="openweathermapkey" id="openweathermapkey" value="<?php if (isset($globalOpenWeatherMapKey)) {
326
+	print $globalOpenWeatherMapKey;
327
+}
328
+?>" />
270 329
 					<p class="help-block">Get a key <a href="https://openweathermap.org/">here</a></p>
271 330
 				</p>
272 331
 			</div>
@@ -295,42 +354,86 @@  discard block
 block discarded – undo
295 354
 			<legend>Coverage area</legend>
296 355
 			<p>
297 356
 				<label for="latitudemax">The maximum latitude (north)</label>
298
-				<input type="text" name="latitudemax" id="latitudemax" value="<?php if (isset($globalLatitudeMax)) print $globalLatitudeMax; ?>" />
357
+				<input type="text" name="latitudemax" id="latitudemax" value="<?php if (isset($globalLatitudeMax)) {
358
+	print $globalLatitudeMax;
359
+}
360
+?>" />
299 361
 			</p>
300 362
 			<p>
301 363
 				<label for="latitudemin">The minimum latitude (south)</label>
302
-				<input type="text" name="latitudemin" id="latitudemin" value="<?php if (isset($globalLatitudeMin)) print $globalLatitudeMin; ?>" />
364
+				<input type="text" name="latitudemin" id="latitudemin" value="<?php if (isset($globalLatitudeMin)) {
365
+	print $globalLatitudeMin;
366
+}
367
+?>" />
303 368
 			</p>
304 369
 			<p>
305 370
 				<label for="longitudemax">The maximum longitude (west)</label>
306
-				<input type="text" name="longitudemax" id="longitudemax" value="<?php if (isset($globalLongitudeMax)) print $globalLongitudeMax; ?>" />
371
+				<input type="text" name="longitudemax" id="longitudemax" value="<?php if (isset($globalLongitudeMax)) {
372
+	print $globalLongitudeMax;
373
+}
374
+?>" />
307 375
 			</p>
308 376
 			<p>
309 377
 				<label for="longitudemin">The minimum longitude (east)</label>
310
-				<input type="text" name="longitudemin" id="longitudemin" value="<?php if (isset($globalLongitudeMin)) print $globalLongitudeMin; ?>" />
378
+				<input type="text" name="longitudemin" id="longitudemin" value="<?php if (isset($globalLongitudeMin)) {
379
+	print $globalLongitudeMin;
380
+}
381
+?>" />
311 382
 			</p>
312 383
 			<p>
313 384
 				<label for="latitudecenter">The latitude center</label>
314
-				<input type="text" name="latitudecenter" id="latitudecenter" value="<?php if (isset($globalCenterLatitude)) print $globalCenterLatitude; ?>" />
385
+				<input type="text" name="latitudecenter" id="latitudecenter" value="<?php if (isset($globalCenterLatitude)) {
386
+	print $globalCenterLatitude;
387
+}
388
+?>" />
315 389
 			</p>
316 390
 			<p>
317 391
 				<label for="longitudecenter">The longitude center</label>
318
-				<input type="text" name="longitudecenter" id="longitudecenter" value="<?php if (isset($globalCenterLongitude)) print $globalCenterLongitude; ?>" />
392
+				<input type="text" name="longitudecenter" id="longitudecenter" value="<?php if (isset($globalCenterLongitude)) {
393
+	print $globalCenterLongitude;
394
+}
395
+?>" />
319 396
 			</p>
320 397
 			<p>
321 398
 				<label for="livezoom">Default Zoom on live map</label>
322
-				<input type="number" name="livezoom" id="livezoom" value="<?php if (isset($globalLiveZoom)) print $globalLiveZoom; else print '9'; ?>" />
399
+				<input type="number" name="livezoom" id="livezoom" value="<?php if (isset($globalLiveZoom)) {
400
+	print $globalLiveZoom;
401
+} else {
402
+	print '9';
403
+}
404
+?>" />
323 405
 			</p>
324 406
 			<p>
325 407
 				<label for="squawk_country">Country for squawk usage</label>
326 408
 				<select name="squawk_country" id="squawk_country">
327
-					<option value="UK"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'UK') print ' selected '; ?>>UK</option>
328
-					<option value="NZ"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NZ') print ' selected '; ?>>NZ</option>
329
-					<option value="US"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'US') print ' selected '; ?>>US</option>
330
-					<option value="AU"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'AU') print ' selected '; ?>>AU</option>
331
-					<option value="NL"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NL') print ' selected '; ?>>NL</option>
332
-					<option value="FR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'FR') print ' selected '; ?>>FR</option>
333
-					<option value="TR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'TR') print ' selected '; ?>>TR</option>
409
+					<option value="UK"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'UK') {
410
+	print ' selected ';
411
+}
412
+?>>UK</option>
413
+					<option value="NZ"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NZ') {
414
+	print ' selected ';
415
+}
416
+?>>NZ</option>
417
+					<option value="US"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'US') {
418
+	print ' selected ';
419
+}
420
+?>>US</option>
421
+					<option value="AU"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'AU') {
422
+	print ' selected ';
423
+}
424
+?>>AU</option>
425
+					<option value="NL"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NL') {
426
+	print ' selected ';
427
+}
428
+?>>NL</option>
429
+					<option value="FR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'FR') {
430
+	print ' selected ';
431
+}
432
+?>>FR</option>
433
+					<option value="TR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'TR') {
434
+	print ' selected ';
435
+}
436
+?>>TR</option>
334 437
 				</select>
335 438
 			</p>
336 439
 		</fieldset>
@@ -339,15 +442,24 @@  discard block
 block discarded – undo
339 442
 			<p><i>Only put in DB flights that are inside a circle</i></p>
340 443
 			<p>
341 444
 				<label for="latitude">Center latitude</label>
342
-				<input type="text" name="zoilatitude" id="latitude" value="<?php if (isset($globalDistanceIgnore['latitude'])) echo $globalDistanceIgnore['latitude']; ?>" />
445
+				<input type="text" name="zoilatitude" id="latitude" value="<?php if (isset($globalDistanceIgnore['latitude'])) {
446
+	echo $globalDistanceIgnore['latitude'];
447
+}
448
+?>" />
343 449
 			</p>
344 450
 			<p>
345 451
 				<label for="longitude">Center longitude</label>
346
-				<input type="text" name="zoilongitude" id="longitude" value="<?php if (isset($globalDistanceIgnore['longitude'])) echo $globalDistanceIgnore['longitude']; ?>" />
452
+				<input type="text" name="zoilongitude" id="longitude" value="<?php if (isset($globalDistanceIgnore['longitude'])) {
453
+	echo $globalDistanceIgnore['longitude'];
454
+}
455
+?>" />
347 456
 			</p>
348 457
 			<p>
349 458
 				<label for="Distance">Distance (in km)</label>
350
-				<input type="text" name="zoidistance" id="distance" value="<?php if (isset($globalDistanceIgnore['distance'])) echo $globalDistanceIgnore['distance']; ?>" />
459
+				<input type="text" name="zoidistance" id="distance" value="<?php if (isset($globalDistanceIgnore['distance'])) {
460
+	echo $globalDistanceIgnore['distance'];
461
+}
462
+?>" />
351 463
 			</p>
352 464
 		</fieldset>
353 465
 		<fieldset id="sourceloc">
@@ -463,11 +575,17 @@  discard block
 block discarded – undo
463 575
 			<div id="flightaware_data">
464 576
 				<p>
465 577
 					<label for="flightawareusername">FlightAware username</label>
466
-					<input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) print $globalFlightAwareUsername; ?>" />
578
+					<input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) {
579
+	print $globalFlightAwareUsername;
580
+}
581
+?>" />
467 582
 				</p>
468 583
 				<p>
469 584
 					<label for="flightawarepassword">FlightAware password/API key</label>
470
-					<input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) print $globalFlightAwarePassword; ?>" />
585
+					<input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) {
586
+	print $globalFlightAwarePassword;
587
+}
588
+?>" />
471 589
 				</p>
472 590
 			</div>
473 591
 -->
@@ -509,7 +627,10 @@  discard block
 block discarded – undo
509 627
 								    if (filter_var($source['host'],FILTER_VALIDATE_URL)) {
510 628
 								?>
511 629
 								<td><input type="text" name="host[]" id="host" value="<?php print $source['host']; ?>" /></td>
512
-								<td><input type="text" name="port[]" class="col-xs-2" id="port" value="<?php if (isset($source['port'])) print $source['port']; ?>" /></td>
630
+								<td><input type="text" name="port[]" class="col-xs-2" id="port" value="<?php if (isset($source['port'])) {
631
+	print $source['port'];
632
+}
633
+?>" /></td>
513 634
 								<?php
514 635
 								    } else {
515 636
 									$hostport = explode(':',$source['host']);
@@ -528,34 +649,106 @@  discard block
 block discarded – undo
528 649
 								?>
529 650
 								<td>
530 651
 									<select name="format[]" id="format">
531
-										<option value="auto" <?php if (!isset($source['format'])) print 'selected'; ?>>Auto</option>
532
-										<option value="sbs" <?php if (isset($source['format']) && $source['format'] == 'sbs') print 'selected'; ?>>SBS</option>
533
-										<option value="tsv" <?php if (isset($source['format']) && $source['format'] == 'tsv') print 'selected'; ?>>TSV</option>
534
-										<option value="raw" <?php if (isset($source['format']) && $source['format'] == 'raw') print 'selected'; ?>>Raw</option>
535
-										<option value="aprs" <?php if (isset($source['format']) && $source['format'] == 'aprs') print 'selected'; ?>>APRS</option>
536
-										<option value="deltadbtxt" <?php if (isset($source['format']) && $source['format'] == 'deltadbtxt') print 'selected'; ?>>Radarcape deltadb.txt</option>
537
-										<option value="vatsimtxt" <?php if (isset($source['format']) && $source['format'] == 'vatsimtxt') print 'selected'; ?>>Vatsim</option>
538
-										<option value="aircraftlistjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftlistjson') print 'selected'; ?>>Virtual Radar Server AircraftList.json</option>
539
-										<option value="vrstcp" <?php if (isset($source['format']) && $source['format'] == 'vrstcp') print 'selected'; ?>>Virtual Radar Server TCP</option>
540
-										<option value="phpvmacars" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') print 'selected'; ?>>phpVMS</option>
541
-										<option value="vaos" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') print 'selected'; ?>>Virtual Airline Operations System (VAOS)</option>
542
-										<option value="vam" <?php if (isset($source['format']) && $source['format'] == 'vam') print 'selected'; ?>>Virtual Airlines Manager</option>
543
-										<option value="whazzup" <?php if (isset($source['format']) && $source['format'] == 'whazzup') print 'selected'; ?>>IVAO</option>
544
-										<option value="flightgearmp" <?php if (isset($source['format']) && $source['format'] == 'flightgearmp') print 'selected'; ?>>FlightGear Multiplayer</option>
545
-										<option value="flightgearsp" <?php if (isset($source['format']) && $source['format'] == 'flightgearsp') print 'selected'; ?>>FlightGear Singleplayer</option>
546
-										<option value="acars" <?php if (isset($source['format']) && $source['format'] == 'acars') print 'selected'; ?>>ACARS from acarsdec/acarsdeco2 over UDP</option>
547
-										<option value="acarssbs3" <?php if (isset($source['format']) && $source['format'] == 'acarssbs3') print 'selected'; ?>>ACARS SBS-3 over TCP</option>
548
-										<option value="ais" <?php if (isset($source['format']) && $source['format'] == 'ais') print 'selected'; ?>>NMEA AIS over TCP</option>
549
-										<option value="airwhere" <?php if (isset($source['format']) && $source['format'] == 'airwhere') print 'selected'; ?>>AirWhere website</option>
550
-										<option value="hidnseek_callback" <?php if (isset($source['format']) && $source['format'] == 'hidnseek_callback') print 'selected'; ?>>HidnSeek Callback</option>
551
-										<option value="blitzortung" <?php if (isset($source['format']) && $source['format'] == 'blitzortung') print 'selected'; ?>>Blitzortung</option>
652
+										<option value="auto" <?php if (!isset($source['format'])) {
653
+	print 'selected';
654
+}
655
+?>>Auto</option>
656
+										<option value="sbs" <?php if (isset($source['format']) && $source['format'] == 'sbs') {
657
+	print 'selected';
658
+}
659
+?>>SBS</option>
660
+										<option value="tsv" <?php if (isset($source['format']) && $source['format'] == 'tsv') {
661
+	print 'selected';
662
+}
663
+?>>TSV</option>
664
+										<option value="raw" <?php if (isset($source['format']) && $source['format'] == 'raw') {
665
+	print 'selected';
666
+}
667
+?>>Raw</option>
668
+										<option value="aprs" <?php if (isset($source['format']) && $source['format'] == 'aprs') {
669
+	print 'selected';
670
+}
671
+?>>APRS</option>
672
+										<option value="deltadbtxt" <?php if (isset($source['format']) && $source['format'] == 'deltadbtxt') {
673
+	print 'selected';
674
+}
675
+?>>Radarcape deltadb.txt</option>
676
+										<option value="vatsimtxt" <?php if (isset($source['format']) && $source['format'] == 'vatsimtxt') {
677
+	print 'selected';
678
+}
679
+?>>Vatsim</option>
680
+										<option value="aircraftlistjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftlistjson') {
681
+	print 'selected';
682
+}
683
+?>>Virtual Radar Server AircraftList.json</option>
684
+										<option value="vrstcp" <?php if (isset($source['format']) && $source['format'] == 'vrstcp') {
685
+	print 'selected';
686
+}
687
+?>>Virtual Radar Server TCP</option>
688
+										<option value="phpvmacars" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') {
689
+	print 'selected';
690
+}
691
+?>>phpVMS</option>
692
+										<option value="vaos" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') {
693
+	print 'selected';
694
+}
695
+?>>Virtual Airline Operations System (VAOS)</option>
696
+										<option value="vam" <?php if (isset($source['format']) && $source['format'] == 'vam') {
697
+	print 'selected';
698
+}
699
+?>>Virtual Airlines Manager</option>
700
+										<option value="whazzup" <?php if (isset($source['format']) && $source['format'] == 'whazzup') {
701
+	print 'selected';
702
+}
703
+?>>IVAO</option>
704
+										<option value="flightgearmp" <?php if (isset($source['format']) && $source['format'] == 'flightgearmp') {
705
+	print 'selected';
706
+}
707
+?>>FlightGear Multiplayer</option>
708
+										<option value="flightgearsp" <?php if (isset($source['format']) && $source['format'] == 'flightgearsp') {
709
+	print 'selected';
710
+}
711
+?>>FlightGear Singleplayer</option>
712
+										<option value="acars" <?php if (isset($source['format']) && $source['format'] == 'acars') {
713
+	print 'selected';
714
+}
715
+?>>ACARS from acarsdec/acarsdeco2 over UDP</option>
716
+										<option value="acarssbs3" <?php if (isset($source['format']) && $source['format'] == 'acarssbs3') {
717
+	print 'selected';
718
+}
719
+?>>ACARS SBS-3 over TCP</option>
720
+										<option value="ais" <?php if (isset($source['format']) && $source['format'] == 'ais') {
721
+	print 'selected';
722
+}
723
+?>>NMEA AIS over TCP</option>
724
+										<option value="airwhere" <?php if (isset($source['format']) && $source['format'] == 'airwhere') {
725
+	print 'selected';
726
+}
727
+?>>AirWhere website</option>
728
+										<option value="hidnseek_callback" <?php if (isset($source['format']) && $source['format'] == 'hidnseek_callback') {
729
+	print 'selected';
730
+}
731
+?>>HidnSeek Callback</option>
732
+										<option value="blitzortung" <?php if (isset($source['format']) && $source['format'] == 'blitzortung') {
733
+	print 'selected';
734
+}
735
+?>>Blitzortung</option>
552 736
 									</select>
553 737
 								</td>
554 738
 								<td>
555
-									<input type="text" name="name[]" id="name" value="<?php if (isset($source['name'])) print $source['name']; ?>" />
739
+									<input type="text" name="name[]" id="name" value="<?php if (isset($source['name'])) {
740
+	print $source['name'];
741
+}
742
+?>" />
556 743
 								</td>
557
-								<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>
558
-								<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>
744
+								<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']) {
745
+	print 'checked';
746
+}
747
+?> /></td>
748
+								<td><input type="checkbox" name="noarchive[]" id="noarchive" title="Don't archive this source" value="1" <?php if (isset($source['noarchive']) && $source['noarchive']) {
749
+	print 'checked';
750
+}
751
+?> /></td>
559 752
 								<td>
560 753
 									<select name="timezones[]" id="timezones">
561 754
 								<?php
@@ -565,7 +758,9 @@  discard block
 block discarded – undo
565 758
 											print '<option selected>'.$timezones.'</option>';
566 759
 										} elseif (!isset($source['timezone']) && $timezones == 'UTC') {
567 760
 											print '<option selected>'.$timezones.'</option>';
568
-										} else print '<option>'.$timezones.'</option>';
761
+										} else {
762
+											print '<option>'.$timezones.'</option>';
763
+										}
569 764
 									}
570 765
 								?>
571 766
 									</select>
@@ -616,7 +811,9 @@  discard block
 block discarded – undo
616 811
 									foreach($timezonelist as $timezones){
617 812
 										if ($timezones == 'UTC') {
618 813
 											print '<option selected>'.$timezones.'</option>';
619
-										} else print '<option>'.$timezones.'</option>';
814
+										} else {
815
+											print '<option>'.$timezones.'</option>';
816
+										}
620 817
 									}
621 818
 								?>
622 819
 									</select>
@@ -640,11 +837,17 @@  discard block
 block discarded – undo
640 837
 					<p>Listen UDP server for acarsdec/acarsdeco2/... with <i>daemon-acars.php</i> script</p>
641 838
 					<p>
642 839
 						<label for="acarshost">ACARS UDP host</label>
643
-						<input type="text" name="acarshost" id="acarshost" value="<?php if (isset($globalACARSHost)) print $globalACARSHost; ?>" />
840
+						<input type="text" name="acarshost" id="acarshost" value="<?php if (isset($globalACARSHost)) {
841
+	print $globalACARSHost;
842
+}
843
+?>" />
644 844
 					</p>
645 845
 					<p>
646 846
 						<label for="acarsport">ACARS UDP port</label>
647
-						<input type="number" name="acarsport" id="acarsport" value="<?php if (isset($globalACARSPort)) print $globalACARSPort; ?>" />
847
+						<input type="number" name="acarsport" id="acarsport" value="<?php if (isset($globalACARSPort)) {
848
+	print $globalACARSPort;
849
+}
850
+?>" />
648 851
 					</p>
649 852
 				</fieldset>
650 853
 			</div>
@@ -670,17 +873,38 @@  discard block
 block discarded – undo
670 873
 				    <td><input type="url" name="newsurl[]" value="<?php print $feed; ?>"/></td>
671 874
 				    <td>
672 875
 					<select name="newslang[]">
673
-					    <option value="en"<?php if ($lng == 'en') print ' selected'; ?>>English</option>
674
-					    <option value="fr"<?php if ($lng == 'fr') print ' selected'; ?>>French</option>
876
+					    <option value="en"<?php if ($lng == 'en') {
877
+	print ' selected';
878
+}
879
+?>>English</option>
880
+					    <option value="fr"<?php if ($lng == 'fr') {
881
+	print ' selected';
882
+}
883
+?>>French</option>
675 884
 					</select>
676 885
 				    </td>
677 886
 				    <td>
678 887
 					<select name="newstype[]">
679
-					    <option value="global"<?php if ($type == 'global') print ' selected'; ?>>Global</option>
680
-					    <option value="aircraft"<?php if ($type == 'aircraft') print ' selected'; ?>>Aircraft</option>
681
-					    <option value="marine"<?php if ($type == 'marine') print ' selected'; ?>>Marine</option>
682
-					    <option value="tracker"<?php if ($type == 'tracker') print ' selected'; ?>>Tracker</option>
683
-					    <option value="satellite"<?php if ($type == 'Satellite') print ' selected'; ?>>Satellite</option>
888
+					    <option value="global"<?php if ($type == 'global') {
889
+	print ' selected';
890
+}
891
+?>>Global</option>
892
+					    <option value="aircraft"<?php if ($type == 'aircraft') {
893
+	print ' selected';
894
+}
895
+?>>Aircraft</option>
896
+					    <option value="marine"<?php if ($type == 'marine') {
897
+	print ' selected';
898
+}
899
+?>>Marine</option>
900
+					    <option value="tracker"<?php if ($type == 'tracker') {
901
+	print ' selected';
902
+}
903
+?>>Tracker</option>
904
+					    <option value="satellite"<?php if ($type == 'Satellite') {
905
+	print ' selected';
906
+}
907
+?>>Satellite</option>
684 908
 					</select>
685 909
 				    </td>
686 910
 				    <td><input type="button" value="Delete" onclick="deleteRowNews(this)" /> <input type="button" value="Add" onclick="insRowNews()" /></td>
@@ -813,13 +1037,19 @@  discard block
 block discarded – undo
813 1037
 			<div id="schedules_options">
814 1038
 				<p>
815 1039
 					<label for="britishairways">British Airways API Key</label>
816
-					<input type="text" name="britishairways" id="britishairways" value="<?php if (isset($globalBritishAirwaysKey)) print $globalBritishAirwaysKey; ?>" />
1040
+					<input type="text" name="britishairways" id="britishairways" value="<?php if (isset($globalBritishAirwaysKey)) {
1041
+	print $globalBritishAirwaysKey;
1042
+}
1043
+?>" />
817 1044
 					<p class="help-block">Register an account on <a href="https://developer.ba.com/">https://developer.ba.com/</a></p>
818 1045
 				</p>
819 1046
 				<!--
820 1047
 				<p>
821 1048
 					<label for="transavia">Transavia Test API Consumer Key</label>
822
-					<input type="text" name="transavia" id="transavia" value="<?php if (isset($globalTransaviaKey)) print $globalTransaviaKey; ?>" />
1049
+					<input type="text" name="transavia" id="transavia" value="<?php if (isset($globalTransaviaKey)) {
1050
+	print $globalTransaviaKey;
1051
+}
1052
+?>" />
823 1053
 					<p class="help-block">Register an account on <a href="https://developer.transavia.com">https://developer.transavia.com</a></p>
824 1054
 				</p>
825 1055
 				-->
@@ -828,10 +1058,16 @@  discard block
 block discarded – undo
828 1058
 						<b>Lufthansa API Key</b>
829 1059
 						<p>
830 1060
 							<label for="lufthansakey">Key</label>
831
-							<input type="text" name="lufthansakey" id="lufthansakey" value="<?php if (isset($globalLufthansaKey['key'])) print $globalLufthansaKey['key']; ?>" />
1061
+							<input type="text" name="lufthansakey" id="lufthansakey" value="<?php if (isset($globalLufthansaKey['key'])) {
1062
+	print $globalLufthansaKey['key'];
1063
+}
1064
+?>" />
832 1065
 						</p><p>
833 1066
 							<label for="lufthansasecret">Secret</label>
834
-							<input type="text" name="lufthansasecret" id="lufthansasecret" value="<?php if (isset($globalLufthansaKey['secret'])) print $globalLufthansaKey['secret']; ?>" />
1067
+							<input type="text" name="lufthansasecret" id="lufthansasecret" value="<?php if (isset($globalLufthansaKey['secret'])) {
1068
+	print $globalLufthansaKey['secret'];
1069
+}
1070
+?>" />
835 1071
 						</p>
836 1072
 					</div>
837 1073
 					<p class="help-block">Register an account on <a href="https://developer.lufthansa.com/page">https://developer.lufthansa.com/page</a></p>
@@ -841,11 +1077,17 @@  discard block
 block discarded – undo
841 1077
 						<b>FlightAware API Key</b>
842 1078
 						<p>
843 1079
 							<label for="flightawareusername">Username</label>
844
-							<input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) print $globalFlightAwareUsername; ?>" />
1080
+							<input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) {
1081
+	print $globalFlightAwareUsername;
1082
+}
1083
+?>" />
845 1084
 						</p>
846 1085
 						<p>
847 1086
 							<label for="flightawarepassword">API key</label>
848
-							<input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) print $globalFlightAwarePassword; ?>" />
1087
+							<input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) {
1088
+	print $globalFlightAwarePassword;
1089
+}
1090
+?>" />
849 1091
 						</p>
850 1092
 					</div>
851 1093
 					<p class="help-block">Register an account on <a href="https://www.flightaware.com/">https://www.flightaware.com/</a></p>
@@ -862,16 +1104,28 @@  discard block
 block discarded – undo
862 1104
 				<p>
863 1105
 					<label for="mapmatchingsource">Map Matching source</label>
864 1106
 					<select name="mapmatchingsource" id="mapmatchingsource">
865
-						<option value="graphhopper" <?php if (isset($globalMapMatchingSource) && $globalMapMatchingSource == 'graphhopper') print 'selected="selected" '; ?>>GraphHopper</option>
866
-						<option value="osmr" <?php if ((isset($globalMapMatchingSource) && $globalMapMatchingSource == 'osmr') || !isset($globalMatchingSource)) print 'selected="selected" '; ?>>OSMR</option>
867
-						<option value="mapbox" <?php if (isset($globalMapMatchingSource) && $globalMapMatchingSource == 'mapbox') print 'selected="selected" '; ?>>Mapbox</option>
1107
+						<option value="graphhopper" <?php if (isset($globalMapMatchingSource) && $globalMapMatchingSource == 'graphhopper') {
1108
+	print 'selected="selected" ';
1109
+}
1110
+?>>GraphHopper</option>
1111
+						<option value="osmr" <?php if ((isset($globalMapMatchingSource) && $globalMapMatchingSource == 'osmr') || !isset($globalMatchingSource)) {
1112
+	print 'selected="selected" ';
1113
+}
1114
+?>>OSMR</option>
1115
+						<option value="mapbox" <?php if (isset($globalMapMatchingSource) && $globalMapMatchingSource == 'mapbox') {
1116
+	print 'selected="selected" ';
1117
+}
1118
+?>>Mapbox</option>
868 1119
 					</select>
869 1120
 					<p class="help-block">Mapbox need the API Key defined in map section</p>
870 1121
 				</p>
871 1122
 				<br />
872 1123
 				<p>
873 1124
 					<label for="graphhopper">GraphHopper API Key</label>
874
-					<input type="text" name="graphhopper" id="graphhopper" value="<?php if (isset($globalGraphHopperKey)) print $globalGraphHopperKey; ?>" />
1125
+					<input type="text" name="graphhopper" id="graphhopper" value="<?php if (isset($globalGraphHopperKey)) {
1126
+	print $globalGraphHopperKey;
1127
+}
1128
+?>" />
875 1129
 					<p class="help-block">Register an account on <a href="https://www.graphhopper.com/">https://www.graphhopper.com/</a></p>
876 1130
 				</p>
877 1131
 			</div>
@@ -889,7 +1143,10 @@  discard block
 block discarded – undo
889 1143
 			</p>
890 1144
 			<p>
891 1145
 				<label for="notamsource">URL of your feed from notaminfo.com</label>
892
-				<input type="text" name="notamsource" id="notamsource" value="<?php if (isset($globalNOTAMSource)) print $globalNOTAMSource; ?>" />
1146
+				<input type="text" name="notamsource" id="notamsource" value="<?php if (isset($globalNOTAMSource)) {
1147
+	print $globalNOTAMSource;
1148
+}
1149
+?>" />
893 1150
 				<p class="help-block">If you want to use world NOTAM from FlightAirMap website, leave it blank</p>
894 1151
 			</p>
895 1152
 			<br />
@@ -905,14 +1162,20 @@  discard block
 block discarded – undo
905 1162
 			<div id="metarsrc">
906 1163
 				<p>
907 1164
 					<label for="metarsource">URL of your METAR source</label>
908
-					<input type="text" name="metarsource" id="metarsource" value="<?php if (isset($globalMETARurl)) print $globalMETARurl; ?>" />
1165
+					<input type="text" name="metarsource" id="metarsource" value="<?php if (isset($globalMETARurl)) {
1166
+	print $globalMETARurl;
1167
+}
1168
+?>" />
909 1169
 					<p class="help-block">Use {icao} to specify where we replace by airport icao. ex : http://metar.vatsim.net/metar.php?id={icao}</p>
910 1170
 				</p>
911 1171
 			</div>
912 1172
 			<br />
913 1173
 			<p>
914 1174
 				<label for="bitly">Bit.ly access token api (used in search page)</label>
915
-				<input type="text" name="bitly" id="bitly" value="<?php if (isset($globalBitlyAccessToken)) print $globalBitlyAccessToken; ?>" />
1175
+				<input type="text" name="bitly" id="bitly" value="<?php if (isset($globalBitlyAccessToken)) {
1176
+	print $globalBitlyAccessToken;
1177
+}
1178
+?>" />
916 1179
 			</p>
917 1180
 			<br />
918 1181
 			<p>
@@ -928,11 +1191,26 @@  discard block
 block discarded – undo
928 1191
 			<p>
929 1192
 				<label for="geoid_source">Geoid Source</label>
930 1193
 				<select name="geoid_source" id="geoid_source">
931
-					<option value="egm96-15"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-15') print ' selected="selected"'; ?>>EGM96 15' (2.1MB)</option>
932
-					<option value="egm96-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-5') print ' selected="selected"'; ?>>EGM96 5' (19MB)</option>
933
-					<option value="egm2008-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-5') print ' selected="selected"'; ?>>EGM2008 5' (19MB)</option>
934
-					<option value="egm2008-2_5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-2_5') print ' selected="selected"'; ?>>EGM2008 2.5' (75MB)</option>
935
-					<option value="egm2008-1"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-1') print ' selected="selected"'; ?>>EGM2008 1' (470MB)</option>
1194
+					<option value="egm96-15"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-15') {
1195
+	print ' selected="selected"';
1196
+}
1197
+?>>EGM96 15' (2.1MB)</option>
1198
+					<option value="egm96-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-5') {
1199
+	print ' selected="selected"';
1200
+}
1201
+?>>EGM96 5' (19MB)</option>
1202
+					<option value="egm2008-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-5') {
1203
+	print ' selected="selected"';
1204
+}
1205
+?>>EGM2008 5' (19MB)</option>
1206
+					<option value="egm2008-2_5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-2_5') {
1207
+	print ' selected="selected"';
1208
+}
1209
+?>>EGM2008 2.5' (75MB)</option>
1210
+					<option value="egm2008-1"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-1') {
1211
+	print ' selected="selected"';
1212
+}
1213
+?>>EGM2008 1' (470MB)</option>
936 1214
 				</select>
937 1215
 				<p class="help-block">The geoid is approximated by an "earth gravity model" (EGM).</p>
938 1216
 			</p>
@@ -954,7 +1232,12 @@  discard block
 block discarded – undo
954 1232
 			</p>
955 1233
 			<p>
956 1234
 				<label for="archivemonths">Generate statistics, delete or put in archive flights older than xx months</label>
957
-				<input type="number" name="archivemonths" id="archivemonths" value="<?php if (isset($globalArchiveMonths)) print $globalArchiveMonths; else echo '1'; ?>" />
1235
+				<input type="number" name="archivemonths" id="archivemonths" value="<?php if (isset($globalArchiveMonths)) {
1236
+	print $globalArchiveMonths;
1237
+} else {
1238
+	echo '1';
1239
+}
1240
+?>" />
958 1241
 				<p class="help-block">0 to disable, delete old flight if <i>Archive all flights data</i> is disabled</p>
959 1242
 			</p>
960 1243
 			<p>
@@ -964,12 +1247,22 @@  discard block
 block discarded – undo
964 1247
 			</p>
965 1248
 			<p>
966 1249
 				<label for="archivekeepmonths">Keep flights data for xx months in archive</label>
967
-				<input type="number" name="archivekeepmonths" id="archivekeepmonths" value="<?php if (isset($globalArchiveKeepMonths)) print $globalArchiveKeepMonths; else echo '1'; ?>" />
1250
+				<input type="number" name="archivekeepmonths" id="archivekeepmonths" value="<?php if (isset($globalArchiveKeepMonths)) {
1251
+	print $globalArchiveKeepMonths;
1252
+} else {
1253
+	echo '1';
1254
+}
1255
+?>" />
968 1256
 				<p class="help-block">0 to disable</p>
969 1257
 			</p>
970 1258
 			<p>
971 1259
 				<label for="archivekeeptrackmonths">Keep flights track data for xx months in archive</label>
972
-				<input type="number" name="archivekeeptrackmonths" id="archivekeeptrackmonths" value="<?php if (isset($globalArchiveKeepTrackMonths)) print $globalArchiveKeepTrackMonths; else echo '1'; ?>" />
1260
+				<input type="number" name="archivekeeptrackmonths" id="archivekeeptrackmonths" value="<?php if (isset($globalArchiveKeepTrackMonths)) {
1261
+	print $globalArchiveKeepTrackMonths;
1262
+} else {
1263
+	echo '1';
1264
+}
1265
+?>" />
973 1266
 				<p class="help-block">0 to disable, should be less or egal to <i>Keep flights data</i> value</p>
974 1267
 			</p>
975 1268
 			<br />
@@ -979,7 +1272,12 @@  discard block
 block discarded – undo
979 1272
 				<p class="help-block">Uncheck if the script is running as cron job</p>
980 1273
 				<div id="cronends"> 
981 1274
 					<label for="cronend">Run script for xx seconds</label>
982
-					<input type="number" name="cronend" id="cronend" value="<?php if (isset($globalCronEnd)) print $globalCronEnd; else print '0'; ?>" />
1275
+					<input type="number" name="cronend" id="cronend" value="<?php if (isset($globalCronEnd)) {
1276
+	print $globalCronEnd;
1277
+} else {
1278
+	print '0';
1279
+}
1280
+?>" />
983 1281
 					<p class="help-block">Set to 0 to disable. Should be disabled if source is URL.</p>
984 1282
 				</div>
985 1283
 			</p>
@@ -1032,15 +1330,30 @@  discard block
 block discarded – undo
1032 1330
 			<br />
1033 1331
 			<p>
1034 1332
 				<label for="refresh">Show flights detected since xxx seconds</label>
1035
-				<input type="number" name="refresh" id="refresh" value="<?php if (isset($globalLiveInterval)) echo $globalLiveInterval; else echo '200'; ?>" />
1333
+				<input type="number" name="refresh" id="refresh" value="<?php if (isset($globalLiveInterval)) {
1334
+	echo $globalLiveInterval;
1335
+} else {
1336
+	echo '200';
1337
+}
1338
+?>" />
1036 1339
 			</p>
1037 1340
 			<p>
1038 1341
 				<label for="maprefresh">Live map refresh (in seconds)</label>
1039
-				<input type="number" name="maprefresh" id="maprefresh" value="<?php if (isset($globalMapRefresh)) echo $globalMapRefresh; else echo '30'; ?>" />
1342
+				<input type="number" name="maprefresh" id="maprefresh" value="<?php if (isset($globalMapRefresh)) {
1343
+	echo $globalMapRefresh;
1344
+} else {
1345
+	echo '30';
1346
+}
1347
+?>" />
1040 1348
 			</p>
1041 1349
 			<p>
1042 1350
 				<label for="mapidle">Map idle timeout (in minutes)</label>
1043
-				<input type="number" name="mapidle" id="mapidle" value="<?php if (isset($globalMapIdleTimeout)) echo $globalMapIdleTimeout; else echo '30'; ?>" />
1351
+				<input type="number" name="mapidle" id="mapidle" value="<?php if (isset($globalMapIdleTimeout)) {
1352
+	echo $globalMapIdleTimeout;
1353
+} else {
1354
+	echo '30';
1355
+}
1356
+?>" />
1044 1357
 				<p class="help-block">0 to disable</p>
1045 1358
 			</p>
1046 1359
 			<p>
@@ -1055,12 +1368,20 @@  discard block
 block discarded – undo
1055 1368
 			<br />
1056 1369
 			<p>
1057 1370
 				<label for="closestmindist">Distance to airport set as arrival (in km)</label>
1058
-				<input type="number" name="closestmindist" id="closestmindist" value="<?php if (isset($globalClosestMinDist)) echo $globalClosestMinDist; else echo '50'; ?>" />
1371
+				<input type="number" name="closestmindist" id="closestmindist" value="<?php if (isset($globalClosestMinDist)) {
1372
+	echo $globalClosestMinDist;
1373
+} else {
1374
+	echo '50';
1375
+}
1376
+?>" />
1059 1377
 			</p>
1060 1378
 			<br />
1061 1379
 			<p>
1062 1380
 				<label for="aircraftsize">Size of aircraft icon on map (default to 30px if zoom > 7 else 15px), empty to default</label>
1063
-				<input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize;?>" />
1381
+				<input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) {
1382
+	echo $globalAircraftSize;
1383
+}
1384
+?>" />
1064 1385
 			</p>
1065 1386
 			<br />
1066 1387
 			<p>
@@ -1079,7 +1400,12 @@  discard block
 block discarded – undo
1079 1400
 			    if (extension_loaded('gd') && function_exists('gd_info')) {
1080 1401
 			?>
1081 1402
 				<label for="aircrafticoncolor">Color of aircraft icon on map</label>
1082
-				<input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) echo $globalAircraftIconColor; else echo '1a3151'; ?>" />
1403
+				<input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) {
1404
+	echo $globalAircraftIconColor;
1405
+} else {
1406
+	echo '1a3151';
1407
+}
1408
+?>" />
1083 1409
 			<?php
1084 1410
 				if (!is_writable('../cache')) {
1085 1411
 			?>
@@ -1097,14 +1423,27 @@  discard block
 block discarded – undo
1097 1423
 			<p>
1098 1424
 				<label for="airportzoom">Zoom level minimum to see airports icons</label>
1099 1425
 				<div class="range">
1100
-					<input type="range" name="airportzoom" id="airportzoom" value="<?php if (isset($globalAirportZoom)) echo $globalAirportZoom; else echo '7'; ?>" />
1101
-					<output id="range"><?php if (isset($globalAirportZoom)) echo $globalAirportZoom; else echo '7'; ?></output>
1426
+					<input type="range" name="airportzoom" id="airportzoom" value="<?php if (isset($globalAirportZoom)) {
1427
+	echo $globalAirportZoom;
1428
+} else {
1429
+	echo '7';
1430
+}
1431
+?>" />
1432
+					<output id="range"><?php if (isset($globalAirportZoom)) {
1433
+	echo $globalAirportZoom;
1434
+} else {
1435
+	echo '7';
1436
+}
1437
+?></output>
1102 1438
 				</div>
1103 1439
 			</p>
1104 1440
 			<br />
1105 1441
 			<p>
1106 1442
 				<label for="customcss">Custom CSS web path</label>
1107
-				<input type="text" name="customcss" id="customcss" value="<?php if (isset($globalCustomCSS)) echo $globalCustomCSS; ?>" />
1443
+				<input type="text" name="customcss" id="customcss" value="<?php if (isset($globalCustomCSS)) {
1444
+	echo $globalCustomCSS;
1445
+}
1446
+?>" />
1108 1447
 			</p>
1109 1448
 		</fieldset>
1110 1449
 		<input type="submit" name="submit" value="Create/Update database & write setup" />
@@ -1131,8 +1470,12 @@  discard block
 block discarded – undo
1131 1470
 	$dbhost = filter_input(INPUT_POST,'dbhost',FILTER_SANITIZE_STRING);
1132 1471
 	$dbport = filter_input(INPUT_POST,'dbport',FILTER_SANITIZE_STRING);
1133 1472
 
1134
-	if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) $error .= 'Mysql driver for PDO must be loaded';
1135
-	if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) $error .= 'PosgreSQL driver for PDO must be loaded';
1473
+	if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) {
1474
+		$error .= 'Mysql driver for PDO must be loaded';
1475
+	}
1476
+	if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) {
1477
+		$error .= 'PosgreSQL driver for PDO must be loaded';
1478
+	}
1136 1479
 	
1137 1480
 	$_SESSION['database_root'] = $dbroot;
1138 1481
 	$_SESSION['database_rootpass'] = $dbrootpass;
@@ -1200,15 +1543,23 @@  discard block
 block discarded – undo
1200 1543
 	$source_city = $_POST['source_city'];
1201 1544
 	$source_country = $_POST['source_country'];
1202 1545
 	$source_ref = $_POST['source_ref'];
1203
-	if (isset($source_id)) $source_id = $_POST['source_id'];
1204
-	else $source_id = array();
1546
+	if (isset($source_id)) {
1547
+		$source_id = $_POST['source_id'];
1548
+	} else {
1549
+		$source_id = array();
1550
+	}
1205 1551
 	
1206 1552
 	$sources = array();
1207 1553
 	foreach ($source_name as $keys => $name) {
1208
-	    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]);
1209
-	    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]);
1554
+	    if (isset($source_id[$keys])) {
1555
+	    	$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]);
1556
+	    } else {
1557
+	    	$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]);
1558
+	    }
1559
+	}
1560
+	if (count($sources) > 0) {
1561
+		$_SESSION['sources'] = $sources;
1210 1562
 	}
1211
-	if (count($sources) > 0) $_SESSION['sources'] = $sources;
1212 1563
 
1213 1564
 	$newsurl = $_POST['newsurl'];
1214 1565
 	$newslng = $_POST['newslang'];
@@ -1221,7 +1572,9 @@  discard block
 block discarded – undo
1221 1572
 		$lng = $newslng[$newskey];
1222 1573
 		if (isset($newsfeeds[$type][$lng])) {
1223 1574
 		    $newsfeeds[$type][$lng] = array_merge($newsfeeds[$type][$lng],array($url));
1224
-		} else $newsfeeds[$type][$lng] = array($url);
1575
+		} else {
1576
+			$newsfeeds[$type][$lng] = array($url);
1577
+		}
1225 1578
 	    }
1226 1579
 	}
1227 1580
 	$settings = array_merge($settings,array('globalNewsFeeds' => $newsfeeds));
@@ -1245,17 +1598,29 @@  discard block
 block discarded – undo
1245 1598
 	$datasource = filter_input(INPUT_POST,'datasource',FILTER_SANITIZE_STRING);
1246 1599
 
1247 1600
 	$globalaircraft = filter_input(INPUT_POST,'globalaircraft',FILTER_SANITIZE_STRING);
1248
-	if ($globalaircraft == 'aircraft') $settings = array_merge($settings,array('globalAircraft' => 'TRUE'));
1249
-	else $settings = array_merge($settings,array('globalAircraft' => 'FALSE'));
1601
+	if ($globalaircraft == 'aircraft') {
1602
+		$settings = array_merge($settings,array('globalAircraft' => 'TRUE'));
1603
+	} else {
1604
+		$settings = array_merge($settings,array('globalAircraft' => 'FALSE'));
1605
+	}
1250 1606
 	$globaltracker = filter_input(INPUT_POST,'globaltracker',FILTER_SANITIZE_STRING);
1251
-	if ($globaltracker == 'tracker') $settings = array_merge($settings,array('globalTracker' => 'TRUE'));
1252
-	else $settings = array_merge($settings,array('globalTracker' => 'FALSE'));
1607
+	if ($globaltracker == 'tracker') {
1608
+		$settings = array_merge($settings,array('globalTracker' => 'TRUE'));
1609
+	} else {
1610
+		$settings = array_merge($settings,array('globalTracker' => 'FALSE'));
1611
+	}
1253 1612
 	$globalmarine = filter_input(INPUT_POST,'globalmarine',FILTER_SANITIZE_STRING);
1254
-	if ($globalmarine == 'marine') $settings = array_merge($settings,array('globalMarine' => 'TRUE'));
1255
-	else $settings = array_merge($settings,array('globalMarine' => 'FALSE'));
1613
+	if ($globalmarine == 'marine') {
1614
+		$settings = array_merge($settings,array('globalMarine' => 'TRUE'));
1615
+	} else {
1616
+		$settings = array_merge($settings,array('globalMarine' => 'FALSE'));
1617
+	}
1256 1618
 	$globalsatellite = filter_input(INPUT_POST,'globalsatellite',FILTER_SANITIZE_STRING);
1257
-	if ($globalsatellite == 'satellite') $settings = array_merge($settings,array('globalSatellite' => 'TRUE'));
1258
-	else $settings = array_merge($settings,array('globalSatellite' => 'FALSE'));
1619
+	if ($globalsatellite == 'satellite') {
1620
+		$settings = array_merge($settings,array('globalSatellite' => 'TRUE'));
1621
+	} else {
1622
+		$settings = array_merge($settings,array('globalSatellite' => 'FALSE'));
1623
+	}
1259 1624
 
1260 1625
 /*	
1261 1626
 	$globalSBS1Hosts = array();
@@ -1277,23 +1642,37 @@  discard block
 block discarded – undo
1277 1642
 	$name = $_POST['name'];
1278 1643
 	$format = $_POST['format'];
1279 1644
 	$timezones = $_POST['timezones'];
1280
-	if (isset($_POST['sourcestats'])) $sourcestats = $_POST['sourcestats'];
1281
-	else $sourcestats = array();
1282
-	if (isset($_POST['noarchive'])) $noarchive = $_POST['noarchive'];
1283
-	else $noarchive = array();
1645
+	if (isset($_POST['sourcestats'])) {
1646
+		$sourcestats = $_POST['sourcestats'];
1647
+	} else {
1648
+		$sourcestats = array();
1649
+	}
1650
+	if (isset($_POST['noarchive'])) {
1651
+		$noarchive = $_POST['noarchive'];
1652
+	} else {
1653
+		$noarchive = array();
1654
+	}
1284 1655
 	$gSources = array();
1285 1656
 	$forcepilots = false;
1286 1657
 	foreach ($host as $key => $h) {
1287
-		if (isset($sourcestats[$key]) && $sourcestats[$key] == 1) $cov = 'TRUE';
1288
-		else $cov = 'FALSE';
1289
-		if (isset($noarchive[$key]) && $noarchive[$key] == 1) $arch = 'TRUE';
1290
-		else $arch = 'FALSE';
1658
+		if (isset($sourcestats[$key]) && $sourcestats[$key] == 1) {
1659
+			$cov = 'TRUE';
1660
+		} else {
1661
+			$cov = 'FALSE';
1662
+		}
1663
+		if (isset($noarchive[$key]) && $noarchive[$key] == 1) {
1664
+			$arch = 'TRUE';
1665
+		} else {
1666
+			$arch = 'FALSE';
1667
+		}
1291 1668
 		if (strpos($format[$key],'_callback')) {
1292 1669
 			$gSources[] = array('host' => $h, 'pass' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezones[$key],'callback' => 'TRUE');
1293 1670
 		} elseif ($h != '' || $name[$key] != '') {
1294 1671
 			$gSources[] = array('host' => $h, 'port' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezones[$key],'callback' => 'FALSE');
1295 1672
 		}
1296
-		if ($format[$key] == 'airwhere') $forcepilots = true;
1673
+		if ($format[$key] == 'airwhere') {
1674
+			$forcepilots = true;
1675
+		}
1297 1676
 	}
1298 1677
 	$settings = array_merge($settings,array('globalSources' => $gSources));
1299 1678
 
@@ -1324,7 +1703,9 @@  discard block
 block discarded – undo
1324 1703
 	$zoidistance = filter_input(INPUT_POST,'zoidistance',FILTER_SANITIZE_NUMBER_INT);
1325 1704
 	if ($zoilatitude != '' && $zoilongitude != '' && $zoidistance != '') {
1326 1705
 		$settings = array_merge($settings,array('globalDistanceIgnore' => array('latitude' => $zoilatitude,'longitude' => $zoilongitude,'distance' => $zoidistance)));
1327
-	} else $settings = array_merge($settings,array('globalDistanceIgnore' => array()));
1706
+	} else {
1707
+		$settings = array_merge($settings,array('globalDistanceIgnore' => array()));
1708
+	}
1328 1709
 
1329 1710
 	$refresh = filter_input(INPUT_POST,'refresh',FILTER_SANITIZE_NUMBER_INT);
1330 1711
 	$settings = array_merge($settings,array('globalLiveInterval' => $refresh));
@@ -1363,7 +1744,9 @@  discard block
 block discarded – undo
1363 1744
 
1364 1745
 	// Create in settings.php keys not yet configurable if not already here
1365 1746
 	//if (!isset($globalImageBingKey)) $settings = array_merge($settings,array('globalImageBingKey' => ''));
1366
-	if (!isset($globalDebug)) $settings = array_merge($settings,array('globalDebug' => 'TRUE'));
1747
+	if (!isset($globalDebug)) {
1748
+		$settings = array_merge($settings,array('globalDebug' => 'TRUE'));
1749
+	}
1367 1750
 
1368 1751
 	$resetyearstats = filter_input(INPUT_POST,'resetyearstats',FILTER_SANITIZE_STRING);
1369 1752
 	if ($resetyearstats == 'resetyearstats') {
@@ -1406,37 +1789,56 @@  discard block
 block discarded – undo
1406 1789
 	}
1407 1790
 */
1408 1791
 	$settings = array_merge($settings,array('globalFlightAware' => 'FALSE'));
1409
-	if ($globalsbs == 'sbs') $settings = array_merge($settings,array('globalSBS1' => 'TRUE'));
1410
-	else $settings = array_merge($settings,array('globalSBS1' => 'FALSE'));
1411
-	if ($globalaprs == 'aprs') $settings = array_merge($settings,array('globalAPRS' => 'TRUE'));
1412
-	else $settings = array_merge($settings,array('globalAPRS' => 'FALSE'));
1792
+	if ($globalsbs == 'sbs') {
1793
+		$settings = array_merge($settings,array('globalSBS1' => 'TRUE'));
1794
+	} else {
1795
+		$settings = array_merge($settings,array('globalSBS1' => 'FALSE'));
1796
+	}
1797
+	if ($globalaprs == 'aprs') {
1798
+		$settings = array_merge($settings,array('globalAPRS' => 'TRUE'));
1799
+	} else {
1800
+		$settings = array_merge($settings,array('globalAPRS' => 'FALSE'));
1801
+	}
1413 1802
 	$va = false;
1414 1803
 	if ($globalivao == 'ivao') {
1415 1804
 		$settings = array_merge($settings,array('globalIVAO' => 'TRUE'));
1416 1805
 		$va = true;
1417
-	} else $settings = array_merge($settings,array('globalIVAO' => 'FALSE'));
1806
+	} else {
1807
+		$settings = array_merge($settings,array('globalIVAO' => 'FALSE'));
1808
+	}
1418 1809
 	if ($globalvatsim == 'vatsim') {
1419 1810
 		$settings = array_merge($settings,array('globalVATSIM' => 'TRUE'));
1420 1811
 		$va = true;
1421
-	} else $settings = array_merge($settings,array('globalVATSIM' => 'FALSE'));
1812
+	} else {
1813
+		$settings = array_merge($settings,array('globalVATSIM' => 'FALSE'));
1814
+	}
1422 1815
 	if ($globalphpvms == 'phpvms') {
1423 1816
 		$settings = array_merge($settings,array('globalphpVMS' => 'TRUE'));
1424 1817
 		$va = true;
1425
-	} else $settings = array_merge($settings,array('globalphpVMS' => 'FALSE'));
1818
+	} else {
1819
+		$settings = array_merge($settings,array('globalphpVMS' => 'FALSE'));
1820
+	}
1426 1821
 	if ($globalvam == 'vam') {
1427 1822
 		$settings = array_merge($settings,array('globalVAM' => 'TRUE'));
1428 1823
 		$va = true;
1429
-	} else $settings = array_merge($settings,array('globalVAM' => 'FALSE'));
1824
+	} else {
1825
+		$settings = array_merge($settings,array('globalVAM' => 'FALSE'));
1826
+	}
1430 1827
 	if ($va) {
1431 1828
 		$settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE','globalTranslationFetch' => 'FALSE'));
1432
-	} else $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE'));
1829
+	} else {
1830
+		$settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE'));
1831
+	}
1433 1832
 	if ($globalva == 'va' || $va) {
1434 1833
 		$settings = array_merge($settings,array('globalVA' => 'TRUE'));
1435 1834
 		$settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE'));
1436 1835
 	} else {
1437 1836
 		$settings = array_merge($settings,array('globalVA' => 'FALSE'));
1438
-		if ($forcepilots) $settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE'));
1439
-		else $settings = array_merge($settings,array('globalUsePilot' => 'FALSE','globalUseOwner' => 'TRUE'));
1837
+		if ($forcepilots) {
1838
+			$settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE'));
1839
+		} else {
1840
+			$settings = array_merge($settings,array('globalUsePilot' => 'FALSE','globalUseOwner' => 'TRUE'));
1841
+		}
1440 1842
 	}
1441 1843
 	
1442 1844
 	
@@ -1659,7 +2061,9 @@  discard block
 block discarded – undo
1659 2061
 	$graphhopper = filter_input(INPUT_POST,'graphhopper',FILTER_SANITIZE_STRING);
1660 2062
 	$settings = array_merge($settings,array('globalGraphHopperKey' => $graphhopper));
1661 2063
 
1662
-	if (!isset($globalTransaction)) $settings = array_merge($settings,array('globalTransaction' => 'TRUE'));
2064
+	if (!isset($globalTransaction)) {
2065
+		$settings = array_merge($settings,array('globalTransaction' => 'TRUE'));
2066
+	}
1663 2067
 
1664 2068
 	// Set some defaults values...
1665 2069
 	if (!isset($globalAircraftImageSources)) {
@@ -1674,15 +2078,23 @@  discard block
 block discarded – undo
1674 2078
 
1675 2079
 	$settings = array_merge($settings,array('globalInstalled' => 'TRUE'));
1676 2080
 
1677
-	if ($error == '') settings::modify_settings($settings);
1678
-	if ($error == '') settings::comment_settings($settings_comment);
2081
+	if ($error == '') {
2082
+		settings::modify_settings($settings);
2083
+	}
2084
+	if ($error == '') {
2085
+		settings::comment_settings($settings_comment);
2086
+	}
1679 2087
 	if ($error != '') {
1680 2088
 		print '<div class="info column">'.$error.'</div>';
1681 2089
 		require('../footer.php');
1682 2090
 		exit;
1683 2091
 	} else {
1684
-		if (isset($_POST['waypoints']) && $_POST['waypoints'] == 'waypoints') $_SESSION['waypoints'] = 1;
1685
-		if (isset($_POST['owner']) && $_POST['owner'] == 'owner') $_SESSION['owner'] = 1;
2092
+		if (isset($_POST['waypoints']) && $_POST['waypoints'] == 'waypoints') {
2093
+			$_SESSION['waypoints'] = 1;
2094
+		}
2095
+		if (isset($_POST['owner']) && $_POST['owner'] == 'owner') {
2096
+			$_SESSION['owner'] = 1;
2097
+		}
1686 2098
 		if (isset($_POST['createdb'])) {
1687 2099
 			$_SESSION['install'] = 'database_create';
1688 2100
 		} else {
@@ -1719,10 +2131,18 @@  discard block
 block discarded – undo
1719 2131
 	$popw = false;
1720 2132
 	foreach ($_SESSION['done'] as $done) {
1721 2133
 	    print '<li>'.$done.'....<strong>SUCCESS</strong></li>';
1722
-	    if ($done == 'Create database') $pop = true;
1723
-	    if ($_SESSION['install'] == 'database_create') $pop = true;
1724
-	    if ($_SESSION['install'] == 'database_import') $popi = true;
1725
-	    if ($_SESSION['install'] == 'waypoints') $popw = true;
2134
+	    if ($done == 'Create database') {
2135
+	    	$pop = true;
2136
+	    }
2137
+	    if ($_SESSION['install'] == 'database_create') {
2138
+	    	$pop = true;
2139
+	    }
2140
+	    if ($_SESSION['install'] == 'database_import') {
2141
+	    	$popi = true;
2142
+	    }
2143
+	    if ($_SESSION['install'] == 'waypoints') {
2144
+	    	$popw = true;
2145
+	    }
1726 2146
 	}
1727 2147
 	if ($pop) {
1728 2148
 	    sleep(5);
@@ -1733,7 +2153,9 @@  discard block
 block discarded – undo
1733 2153
 	} else if ($popw) {
1734 2154
 	    sleep(5);
1735 2155
 	    print '<li>Populate waypoints database....<img src="../images/loading.gif" /></li>';
1736
-	} else print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>';
2156
+	} else {
2157
+		print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>';
2158
+	}
1737 2159
 	print '</div></ul>';
1738 2160
 	print '<div id="error"></div>';
1739 2161
 /*	foreach ($_SESSION['done'] as $done) {
Please login to merge, or discard this patch.