Completed
Push — master ( e17801...597a61 )
by Yannick
25:55
created
airport-detailed.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
 			$metar_info = $METAR->getMETAR($airport_icao);
49 49
 			//print_r($metar_info);
50 50
 			if (isset($metar_info[0]['metar'])) $metar_parse = $METAR->parse($metar_info[0]['metar']);
51
-            		//print_r($metar_parse);
51
+					//print_r($metar_parse);
52 52
 		}
53 53
 		
54 54
 		$title = sprintf(_("Detailed View for %s, %s (%s)"),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']);
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -5,17 +5,17 @@  discard block
 block discarded – undo
5 5
 require_once('require/class.Stats.php');
6 6
 require_once('require/class.METAR.php');
7 7
 
8
-if (!isset($_GET['airport'])){
8
+if (!isset($_GET['airport'])) {
9 9
 	header('Location: '.$globalURL.'/airport');
10 10
 } else {
11 11
 	$Spotter = new Spotter();
12 12
 	//calculation for the pagination
13
-	if(!isset($_GET['limit']))
13
+	if (!isset($_GET['limit']))
14 14
 	{
15 15
 		$limit_start = 0;
16 16
 		$limit_end = 25;
17 17
 		$absolute_difference = 25;
18
-	}  else {
18
+	} else {
19 19
 		$limit_explode = explode(",", $_GET['limit']);
20 20
 		$limit_start = $limit_explode[0];
21 21
 		$limit_end = $limit_explode[1];
@@ -28,15 +28,15 @@  discard block
 block discarded – undo
28 28
 	$limit_next = $limit_end + $absolute_difference;
29 29
 	$limit_previous_1 = $limit_start - $absolute_difference;
30 30
 	$limit_previous_2 = $limit_end - $absolute_difference;
31
-	$airport_icao = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING);
31
+	$airport_icao = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING);
32 32
 	$airport = $airport_icao;
33 33
 	$page_url = $globalURL.'/airport/'.$airport_icao;
34 34
 	
35 35
 	if (isset($_GET['sort'])) {
36
-		$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
37
-		$spotter_array = $Spotter->getSpotterDataByAirport($airport_icao,$limit_start.",".$absolute_difference, $sort);
36
+		$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
37
+		$spotter_array = $Spotter->getSpotterDataByAirport($airport_icao, $limit_start.",".$absolute_difference, $sort);
38 38
 	} else {
39
-		$spotter_array = $Spotter->getSpotterDataByAirport($airport_icao,$limit_start.",".$absolute_difference, '');
39
+		$spotter_array = $Spotter->getSpotterDataByAirport($airport_icao, $limit_start.",".$absolute_difference, '');
40 40
 	}
41 41
 	$airport_array = $Spotter->getAllAirportInfo($airport_icao);
42 42
 	
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
             		//print_r($metar_parse);
52 52
 		}
53 53
 		
54
-		$title = sprintf(_("Detailed View for %s, %s (%s)"),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']);
54
+		$title = sprintf(_("Detailed View for %s, %s (%s)"), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']);
55 55
 
56 56
 		require_once('header.php');
57 57
 		
@@ -63,9 +63,9 @@  discard block
 block discarded – undo
63 63
 		$airport_names = $Stats->getAllAirportNames();
64 64
 		if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames();
65 65
 		ksort($airport_names);
66
-		foreach($airport_names as $airport_name)
66
+		foreach ($airport_names as $airport_name)
67 67
 		{
68
-			if($airport_icao == $airport_name['airport_icao'])
68
+			if ($airport_icao == $airport_name['airport_icao'])
69 69
 			{
70 70
 				print '<option value="'.$airport_name['airport_icao'].'" selected="selected">'.$airport_name['airport_city'].', '.$airport_name['airport_name'].', '.$airport_name['airport_country'].' ('.$airport_name['airport_icao'].')</option>';
71 71
 			} else {
@@ -111,15 +111,15 @@  discard block
 block discarded – undo
111 111
 				$date_data = '';
112 112
 				$departure_data = '';
113 113
 				$arrival_data = '';
114
-				foreach($all_data as $data)
114
+				foreach ($all_data as $data)
115 115
 				{
116 116
 					$date_data .= '"'.$data['date'].'",';
117 117
 					$departure_data .= $data['departure'].',';
118 118
 					$arrival_data .= $data['arrival'].',';
119 119
 				}
120
-				$date_data = "['x',".substr($date_data,0,-1)."]";
121
-				$departure_data = "['departure',".substr($departure_data,0,-1)."]";
122
-				$arrival_data = "['arrival',".substr($arrival_data,0,-1)."]";
120
+				$date_data = "['x',".substr($date_data, 0, -1)."]";
121
+				$departure_data = "['departure',".substr($departure_data, 0, -1)."]";
122
+				$arrival_data = "['arrival',".substr($arrival_data, 0, -1)."]";
123 123
 				print 'c3.generate({
124 124
 				    bindto: "#chart",
125 125
 				    data: {
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
 					print _("Dew point:").' '.$metar_parse['dew'].' °C'." - ";
177 177
 				}
178 178
 				if (isset($metar_parse['temperature']) && isset($metar_parse['dew'])) {
179
-					$humidity = round(100 * pow((112 - (0.1 * $metar_parse['temperature']) + $metar_parse['dew']) / (112 + (0.9 * $metar_parse['temperature'])), 8),1);
179
+					$humidity = round(100*pow((112 - (0.1*$metar_parse['temperature']) + $metar_parse['dew'])/(112 + (0.9*$metar_parse['temperature'])), 8), 1);
180 180
 					print _("Humidity:").' '.$humidity.'%'." - ";
181 181
 				}
182 182
 				if (isset($metar_parse['QNH'])) {
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 		print '<div class="table column">';
193 193
 		if ($airport_array[0]['iata'] != "NA")
194 194
 		{
195
-			print '<p>'.sprintf(_("The table below shows the detailed information of all flights to/from <strong>%s, %s (%s)</strong>."),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']).'</p>';
195
+			print '<p>'.sprintf(_("The table below shows the detailed information of all flights to/from <strong>%s, %s (%s)</strong>."), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']).'</p>';
196 196
 		}
197 197
 		include('table-output.php');  
198 198
 		print '<div class="pagination">';
Please login to merge, or discard this patch.
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 		$limit_start = 0;
16 16
 		$limit_end = 25;
17 17
 		$absolute_difference = 25;
18
-	}  else {
18
+	} else {
19 19
 		$limit_explode = explode(",", $_GET['limit']);
20 20
 		$limit_start = $limit_explode[0];
21 21
 		$limit_end = $limit_explode[1];
@@ -47,7 +47,9 @@  discard block
 block discarded – undo
47 47
 			$METAR = new METAR();
48 48
 			$metar_info = $METAR->getMETAR($airport_icao);
49 49
 			//print_r($metar_info);
50
-			if (isset($metar_info[0]['metar'])) $metar_parse = $METAR->parse($metar_info[0]['metar']);
50
+			if (isset($metar_info[0]['metar'])) {
51
+				$metar_parse = $METAR->parse($metar_info[0]['metar']);
52
+			}
51 53
             		//print_r($metar_parse);
52 54
 		}
53 55
 		
@@ -61,7 +63,9 @@  discard block
 block discarded – undo
61 63
 		print '<option></option>';
62 64
 		$Stats = new Stats();
63 65
 		$airport_names = $Stats->getAllAirportNames();
64
-		if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames();
66
+		if (empty($airport_names)) {
67
+			$airport_names = $Spotter->getAllAirportNames();
68
+		}
65 69
 		ksort($airport_names);
66 70
 		foreach($airport_names as $airport_name)
67 71
 		{
@@ -102,7 +106,9 @@  discard block
 block discarded – undo
102 106
 			// Use spotter also
103 107
 			if (isset($globalTimezone)) {
104 108
 				date_default_timezone_set($globalTimezone);
105
-			} else date_default_timezone_set('UTC');
109
+			} else {
110
+				date_default_timezone_set('UTC');
111
+			}
106 112
 			if (count($all_data) > 0) {
107 113
 				print '<link href="'.$globalURL.'/css/c3.min.css" rel="stylesheet" type="text/css">';
108 114
 				print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>';
Please login to merge, or discard this patch.
registration-statistics-time.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -3,14 +3,14 @@  discard block
 block discarded – undo
3 3
 require_once('require/class.Spotter.php');
4 4
 require_once('require/class.Language.php');
5 5
 $Spotter = new Spotter();
6
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
7
-$registration = filter_input(INPUT_GET,'registration',FILTER_SANITIZE_STRING);
6
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
7
+$registration = filter_input(INPUT_GET, 'registration', FILTER_SANITIZE_STRING);
8 8
 $spotter_array = $Spotter->getSpotterDataByRegistration($registration, "0,1", $sort);
9 9
 $aircraft_array = $Spotter->getAircraftInfoByRegistration($registration);
10 10
 
11 11
 if (!empty($spotter_array))
12 12
 {
13
-	$title = sprintf(_("Most Common Time of Day of aircraft with registration %s"),$registration);
13
+	$title = sprintf(_("Most Common Time of Day of aircraft with registration %s"), $registration);
14 14
 	require_once('header.php');
15 15
   
16 16
 	print '<div class="info column">';
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 	include('registration-sub-menu.php');
24 24
 	print '<div class="column">';
25 25
 	print '<h2>'._("Most Common Time of Day").'</h2>';
26
-	print '<p>'.sprintf(_("The statistic below shows the most common time of day from aircraft with registration <strong>%s</strong>."),$registration).'</p>';
26
+	print '<p>'.sprintf(_("The statistic below shows the most common time of day from aircraft with registration <strong>%s</strong>."), $registration).'</p>';
27 27
 
28 28
 	$hour_array = $Spotter->countAllHoursByRegistration($registration);
29 29
 	print '<link href="'.$globalURL.'/css/c3.min.css" rel="stylesheet" type="text/css">';
@@ -33,9 +33,9 @@  discard block
 block discarded – undo
33 33
 	$hour_data = '';
34 34
 	$hour_cnt = '';
35 35
 	$last = 0;
36
-	foreach($hour_array as $hour_item)
36
+	foreach ($hour_array as $hour_item)
37 37
 	{
38
-		while($last != $hour_item['hour_name']) {
38
+		while ($last != $hour_item['hour_name']) {
39 39
 			$hour_data .= '"'.$last.':00",';
40 40
 			$hour_cnt .= '0,';
41 41
 			$last++;
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 		$hour_cnt .= $hour_item['hour_count'].',';
46 46
 	}
47 47
 	$hour_data = "[".substr($hour_data, 0, -1)."]";
48
-	$hour_cnt = "['flights',".substr($hour_cnt,0,-1)."]";
48
+	$hour_cnt = "['flights',".substr($hour_cnt, 0, -1)."]";
49 49
 	print 'c3.generate({
50 50
 	    bindto: "#chartHour",
51 51
 	    data: {
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 		print '</thead>';
69 69
 		print '<tbody>';
70 70
 		$i = 1;
71
-		foreach($hour_array as $hour_item)
71
+		foreach ($hour_array as $hour_item)
72 72
 		{
73 73
 			print '<tr>';
74 74
 			print '<td>'.$hour_item['hour_name'].':00</td>';
Please login to merge, or discard this patch.
date-statistics-departure-airport.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -4,13 +4,13 @@  discard block
 block discarded – undo
4 4
 require_once('require/class.Language.php');
5 5
 
6 6
 $Spotter = new Spotter();
7
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
8
-$date = filter_input(INPUT_GET,'date',FILTER_SANITIZE_STRING);
9
-$spotter_array = $Spotter->getSpotterDataByDate($date,"0,1", $sort);
7
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
8
+$date = filter_input(INPUT_GET, 'date', FILTER_SANITIZE_STRING);
9
+$spotter_array = $Spotter->getSpotterDataByDate($date, "0,1", $sort);
10 10
 
11 11
 if (!empty($spotter_array))
12 12
 {
13
-	$title = sprintf(_("Most Common Departure Airports on %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601'])));
13
+	$title = sprintf(_("Most Common Departure Airports on %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601'])));
14 14
 
15 15
 	require_once('header.php');
16 16
 	print '<div class="select-item">';
@@ -28,13 +28,13 @@  discard block
 block discarded – undo
28 28
 	print '<script type="text/javascript">$(function () { $("#datepicker").datetimepicker({ format: "YYYY-MM-DD", defaultDate: "'.$date.'" }); }); </script>';
29 29
 	print '<br />';
30 30
 	print '<div class="info column">';
31
-	print '<h1>'.sprintf(_("Flights from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>';
31
+	print '<h1>'.sprintf(_("Flights from %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>';
32 32
 	print '</div>';
33 33
 
34 34
 	include('date-sub-menu.php');
35 35
 	print '<div class="column">';
36 36
 	print '<h2>'._("Most Common Departure Airports").'</h2>';
37
-	print '<p>'.sprintf(_("The statistic below shows all departure airports of flights on <strong>%s</strong>."),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>';
37
+	print '<p>'.sprintf(_("The statistic below shows all departure airports of flights on <strong>%s</strong>."), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>';
38 38
 	$airport_airport_array = $Spotter->countAllDepartureAirportsByDate($date);
39 39
 	print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>';
40 40
 	print '<script type="text/javascript" src="'.$globalURL.'/js/topojson.v2.min.js"></script>';
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 	print '<script>';
44 44
 	print 'var series = [';
45 45
 	$airport_data = '';
46
-	foreach($airport_airport_array as $airport_item)
46
+	foreach ($airport_airport_array as $airport_item)
47 47
 	{
48 48
 		$airport_data .= '[ "'.$airport_item['airport_departure_icao_count'].'", "'.$airport_item['airport_departure_icao'].'",'.$airport_item['airport_departure_latitude'].','.$airport_item['airport_departure_longitude'].'],';
49 49
 	}
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 	print '</thead>';
99 99
 	print '<tbody>';
100 100
 	$i = 1;
101
-	foreach($airport_airport_array as $airport_item)
101
+	foreach ($airport_airport_array as $airport_item)
102 102
 	{
103 103
 		print '<tr>';
104 104
 		print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
route-statistics-airline-country.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -8,14 +8,14 @@  discard block
 block discarded – undo
8 8
 require_once('require/class.Spotter.php');
9 9
 require_once('require/class.Language.php');
10 10
 $Spotter = new Spotter();
11
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
12
-$departure_airport = filter_input(INPUT_GET,'departure_airport',FILTER_SANITIZE_STRING);
13
-$arrival_airport = filter_input(INPUT_GET,'arrival_airport',FILTER_SANITIZE_STRING);
11
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
12
+$departure_airport = filter_input(INPUT_GET, 'departure_airport', FILTER_SANITIZE_STRING);
13
+$arrival_airport = filter_input(INPUT_GET, 'arrival_airport', FILTER_SANITIZE_STRING);
14 14
 $spotter_array = $Spotter->getSpotterDataByRoute($departure_airport, $arrival_airport, "0,1", $sort);
15 15
 
16 16
 if (!empty($spotter_array))
17 17
 {
18
-	$title = sprintf(_("Most Common Airlines by Country between %s (%s), %s - %s (%s), %s"),$spotter_array[0]['departure_airport_name'],$spotter_array[0]['departure_airport_icao'],$spotter_array[0]['departure_airport_country'],$spotter_array[0]['arrival_airport_name'],$spotter_array[0]['arrival_airport_icao'],$spotter_array[0]['arrival_airport_country']);
18
+	$title = sprintf(_("Most Common Airlines by Country between %s (%s), %s - %s (%s), %s"), $spotter_array[0]['departure_airport_name'], $spotter_array[0]['departure_airport_icao'], $spotter_array[0]['departure_airport_country'], $spotter_array[0]['arrival_airport_name'], $spotter_array[0]['arrival_airport_icao'], $spotter_array[0]['arrival_airport_country']);
19 19
 	require_once('header.php');
20 20
 	print '<div class="info column">';
21 21
 	print '<h1>'._("Flights between").' '.$spotter_array[0]['departure_airport_name'].' ('.$spotter_array[0]['departure_airport_icao'].'), '.$spotter_array[0]['departure_airport_country'].' - '.$spotter_array[0]['arrival_airport_name'].' ('.$spotter_array[0]['arrival_airport_icao'].'), '.$spotter_array[0]['arrival_airport_country'].'</h1>';
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 	include('route-sub-menu.php');
27 27
 	print '<div class="column">';
28 28
 	print '<h2>'._("Most Common Airlines by Country").'</h2>';
29
-	print '<p>'.sprintf(_("The statistic below shows the most common airlines by Country of origin of flights between <strong>%s (%s), %s</strong> and <strong>%s (%s), %s</strong>."),$spotter_array[0]['departure_airport_name'],$spotter_array[0]['departure_airport_icao'],$spotter_array[0]['departure_airport_country'],$spotter_array[0]['arrival_airport_name'],$spotter_array[0]['arrival_airport_icao'],$spotter_array[0]['arrival_airport_country']).'</p>';
29
+	print '<p>'.sprintf(_("The statistic below shows the most common airlines by Country of origin of flights between <strong>%s (%s), %s</strong> and <strong>%s (%s), %s</strong>."), $spotter_array[0]['departure_airport_name'], $spotter_array[0]['departure_airport_icao'], $spotter_array[0]['departure_airport_country'], $spotter_array[0]['arrival_airport_name'], $spotter_array[0]['arrival_airport_icao'], $spotter_array[0]['arrival_airport_country']).'</p>';
30 30
 
31 31
 	$airline_array = $Spotter->countAllAirlineCountriesByRoute($departure_airport, $arrival_airport);
32 32
 	print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>';
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 	print '<div id="chartCountry" class="chart" width="100%"></div><script>';
36 36
 	print 'var series = [';
37 37
 	$country_data = '';
38
-	foreach($airline_array as $airline_item)
38
+	foreach ($airline_array as $airline_item)
39 39
 	{
40 40
 		$country_data .= '[ "'.$airline_item['airline_country_iso3'].'",'.$airline_item['airline_country_count'].'],';
41 41
 	}
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 		print '</thead>';
83 83
 		print '<tbody>';
84 84
 		$i = 1;
85
-		foreach($airline_array as $airline_item)
85
+		foreach ($airline_array as $airline_item)
86 86
 		{
87 87
 			print '<tr>';
88 88
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
date-statistics-arrival-airport-country.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -3,13 +3,13 @@  discard block
 block discarded – undo
3 3
 require_once('require/class.Spotter.php');
4 4
 require_once('require/class.Language.php');
5 5
 $Spotter = new Spotter();
6
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
7
-$date = filter_input(INPUT_GET,'date',FILTER_SANITIZE_STRING);
8
-$spotter_array = $Spotter->getSpotterDataByDate($date,"0,1", $sort);
6
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
7
+$date = filter_input(INPUT_GET, 'date', FILTER_SANITIZE_STRING);
8
+$spotter_array = $Spotter->getSpotterDataByDate($date, "0,1", $sort);
9 9
 
10 10
 if (!empty($spotter_array))
11 11
 {
12
-	$title = sprintf(_("Most Common Arrival Airports by Country on %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601'])));
12
+	$title = sprintf(_("Most Common Arrival Airports by Country on %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601'])));
13 13
 	require_once('header.php');
14 14
 	print '<div class="select-item">';
15 15
 	print '<form action="'.$globalURL.'/date" method="post" class="form-inline">';
@@ -26,13 +26,13 @@  discard block
 block discarded – undo
26 26
 	print '<script type="text/javascript">$(function () { $("#datepicker").datetimepicker({ format: "YYYY-MM-DD", defaultDate: "'.$date.'" }); }); </script>';
27 27
 	print '<br />';
28 28
 	print '<div class="info column">';
29
-	print '<h1>'.sprintf(_("Flights from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>';
29
+	print '<h1>'.sprintf(_("Flights from %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>';
30 30
 	print '</div>';
31 31
 
32 32
 	include('date-sub-menu.php');
33 33
 	print '<div class="column">';
34 34
 	print '<h2>'._("Most Common Arrival Airports by Country").'</h2>';
35
-	print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights on <strong>%s</strong>."),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>';
35
+	print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights on <strong>%s</strong>."), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>';
36 36
 
37 37
 	$airport_country_array = $Spotter->countAllArrivalAirportCountriesByDate($date);
38 38
 	print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>';
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 	print '<div id="chartCountry" class="chart" width="100%"></div><script>';
42 42
 	print 'var series = [';
43 43
 	$country_data = '';
44
-	foreach($airport_country_array as $airport_item)
44
+	foreach ($airport_country_array as $airport_item)
45 45
 	{
46 46
 		$country_data .= '[ "'.$airport_item['arrival_airport_country_iso3'].'",'.$airport_item['airport_arrival_country_count'].'],';
47 47
 	}
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 		print '</thead>';
90 90
 		print '<tbody>';
91 91
 		$i = 1;
92
-		foreach($airport_country_array as $airport_item)
92
+		foreach ($airport_country_array as $airport_item)
93 93
 		{
94 94
 			print '<tr>';
95 95
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
date-statistics-time.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -3,13 +3,13 @@  discard block
 block discarded – undo
3 3
 require_once('require/class.Spotter.php');
4 4
 require_once('require/class.Language.php');
5 5
 $Spotter = new Spotter();
6
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
7
-$date = filter_input(INPUT_GET,'date',FILTER_SANITIZE_STRING);
8
-$spotter_array = $Spotter->getSpotterDataByDate($date,"0,1", $sort);
6
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
7
+$date = filter_input(INPUT_GET, 'date', FILTER_SANITIZE_STRING);
8
+$spotter_array = $Spotter->getSpotterDataByDate($date, "0,1", $sort);
9 9
 
10 10
 if (!empty($spotter_array))
11 11
 {
12
-	$title = sprintf(_("Most Common Time of Day on %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601'])));
12
+	$title = sprintf(_("Most Common Time of Day on %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601'])));
13 13
 	require_once('header.php');
14 14
 	print '<div class="select-item">';
15 15
 	print '<form action="'.$globalURL.'/date" method="post" class="form-inline">';
@@ -26,13 +26,13 @@  discard block
 block discarded – undo
26 26
 	print '<script type="text/javascript">$(function () { $("#datepicker").datetimepicker({ format: "YYYY-MM-DD", defaultDate: "'.$date.'" }); }); </script>';
27 27
 	print '<br />';
28 28
 	print '<div class="info column">';
29
-	print '<h1>'.sprintf(_("Flights from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>';
29
+	print '<h1>'.sprintf(_("Flights from %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>';
30 30
 	print '</div>';
31 31
 
32 32
 	include('date-sub-menu.php');
33 33
 	print '<div class="column">';
34 34
 	print '<h2>'._("Most Common Time of Day").'</h2>';
35
-	print '<p>'.sprintf(_("The statistic below shows the most common time of day on <strong>%s</strong>."),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>';
35
+	print '<p>'.sprintf(_("The statistic below shows the most common time of day on <strong>%s</strong>."), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>';
36 36
 
37 37
 	$hour_array = $Spotter->countAllHoursByDate($date);
38 38
 	print '<link href="'.$globalURL.'/css/c3.min.css" rel="stylesheet" type="text/css">';
@@ -42,9 +42,9 @@  discard block
 block discarded – undo
42 42
 	$hour_data = '';
43 43
 	$hour_cnt = '';
44 44
 	$last = 0;
45
-	foreach($hour_array as $hour_item)
45
+	foreach ($hour_array as $hour_item)
46 46
 	{
47
-		while($last != $hour_item['hour_name']) {
47
+		while ($last != $hour_item['hour_name']) {
48 48
 			$hour_data .= '"'.$last.':00",';
49 49
 			$hour_cnt .= '0,';
50 50
 			$last++;
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 		$hour_cnt .= $hour_item['hour_count'].',';
55 55
 	}
56 56
 	$hour_data = "['x',".substr($hour_data, 0, -1)."]";
57
-	$hour_cnt = "['flights',".substr($hour_cnt,0,-1)."]";
57
+	$hour_cnt = "['flights',".substr($hour_cnt, 0, -1)."]";
58 58
 	print 'c3.generate({
59 59
 	    bindto: "#chartHour",
60 60
 	    data: {
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 		print '</thead>';
80 80
 		print '<tbody>';
81 81
 		$i = 1;
82
-		foreach($hour_array as $hour_item)
82
+		foreach ($hour_array as $hour_item)
83 83
 		{
84 84
 			print '<tr>';
85 85
 			print '<td>'.$hour_item['hour_name'].':00</td>';
Please login to merge, or discard this patch.
country-statistics-time.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@
 block discarded – undo
3 3
 require_once('require/class.Spotter.php');
4 4
 require_once('require/class.Language.php');
5 5
 if (!isset($_GET['country'])) {
6
-        header('Location: '.$globalURL.'/country');
7
-        die();
6
+		header('Location: '.$globalURL.'/country');
7
+		die();
8 8
 }
9 9
 $Spotter = new Spotter();
10 10
 $country = ucwords(str_replace("-", " ", filter_input(INPUT_GET,'country',FILTER_SANITIZE_STRING)));
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -7,8 +7,8 @@  discard block
 block discarded – undo
7 7
         die();
8 8
 }
9 9
 $Spotter = new Spotter();
10
-$country = ucwords(str_replace("-", " ", filter_input(INPUT_GET,'country',FILTER_SANITIZE_STRING)));
11
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
10
+$country = ucwords(str_replace("-", " ", filter_input(INPUT_GET, 'country', FILTER_SANITIZE_STRING)));
11
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
12 12
 
13 13
 if (isset($_GET['sort'])) {
14 14
 	$spotter_array = $Spotter->getSpotterDataByCountry($country, "0,1", $sort);
@@ -18,16 +18,16 @@  discard block
 block discarded – undo
18 18
 
19 19
 if (!empty($spotter_array))
20 20
 {
21
-	$title = sprintf(_("Most Common Time of Day from %s"),$country);
21
+	$title = sprintf(_("Most Common Time of Day from %s"), $country);
22 22
 	require_once('header.php');
23 23
 	print '<div class="select-item">';
24 24
 	print '<form action="'.$globalURL.'/country" method="post">';
25 25
 	print '<select name="country" class="selectpicker" data-live-search="true">';
26 26
 	print '<option></option>';
27 27
 	$all_countries = $Spotter->getAllCountries();
28
-	foreach($all_countries as $all_country)
28
+	foreach ($all_countries as $all_country)
29 29
 	{
30
-		if($country == $all_country['country'])
30
+		if ($country == $all_country['country'])
31 31
 		{
32 32
 			print '<option value="'.strtolower(str_replace(" ", "-", $all_country['country'])).'" selected="selected">'.$all_country['country'].'</option>';
33 33
 		} else {
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 	if ($_GET['country'] != "NA")
43 43
 	{
44 44
 		print '<div class="info column">';
45
-		print '<h1>'.sprintf(_("Airports &amp; Airlines from %s"),$country).'</h1>';
45
+		print '<h1>'.sprintf(_("Airports &amp; Airlines from %s"), $country).'</h1>';
46 46
 		print '</div>';
47 47
 	} else {
48 48
 		print '<div class="alert alert-warning">'._("This special country profile shows all flights that do <u>not</u> have a country of a airline or departure/arrival airport associated with them.").'</div>';
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 	include('country-sub-menu.php');
52 52
 	print '<div class="column">';
53 53
 	print '<h2>'._("Most Common Time of Day").'</h2>';
54
-	print '<p>'.sprintf(_("The statistic below shows the most common time of day of airports &amp; airlines from <strong>%s</strong>."),$country).'</p>';
54
+	print '<p>'.sprintf(_("The statistic below shows the most common time of day of airports &amp; airlines from <strong>%s</strong>."), $country).'</p>';
55 55
 	$hour_array = $Spotter->countAllHoursByCountry($country);
56 56
 	print '<link href="'.$globalURL.'/css/c3.min.css" rel="stylesheet" type="text/css">';
57 57
 	print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>';
@@ -60,9 +60,9 @@  discard block
 block discarded – undo
60 60
 	$hour_data = '';
61 61
 	$hour_cnt = '';
62 62
 	$last = 0;
63
-	foreach($hour_array as $hour_item)
63
+	foreach ($hour_array as $hour_item)
64 64
 	{
65
-		while($last != $hour_item['hour_name']) {
65
+		while ($last != $hour_item['hour_name']) {
66 66
 			$hour_data .= '"'.$last.':00",';
67 67
 			$hour_cnt .= '0,';
68 68
 			$last++;
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 		$hour_cnt .= $hour_item['hour_count'].',';
73 73
 	}
74 74
 	$hour_data = "['x',".substr($hour_data, 0, -1)."]";
75
-	$hour_cnt = "['flights',".substr($hour_cnt,0,-1)."]";
75
+	$hour_cnt = "['flights',".substr($hour_cnt, 0, -1)."]";
76 76
 	print 'c3.generate({
77 77
 	    bindto: "#chartHour",
78 78
 	    data: {
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 		print '</thead>';
98 98
 		print '<tbody>';
99 99
 		$i = 1;
100
-		foreach($hour_array as $hour_item)
100
+		foreach ($hour_array as $hour_item)
101 101
 		{
102 102
 			print '<tr>';
103 103
 			print '<td>'.$hour_item['hour_name'].':00</td>';
Please login to merge, or discard this patch.
date-statistics-arrival-airport.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -3,13 +3,13 @@  discard block
 block discarded – undo
3 3
 require_once('require/class.Spotter.php');
4 4
 require_once('require/class.Language.php');
5 5
 $Spotter = new Spotter();
6
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
7
-$date = filter_input(INPUT_GET,'date',FILTER_SANITIZE_STRING);
8
-$spotter_array = $Spotter->getSpotterDataByDate($date,"0,1", $sort);
6
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
7
+$date = filter_input(INPUT_GET, 'date', FILTER_SANITIZE_STRING);
8
+$spotter_array = $Spotter->getSpotterDataByDate($date, "0,1", $sort);
9 9
 
10 10
 if (!empty($spotter_array))
11 11
 {
12
-	$title = sprintf(_("Most Common Arrival Airports on %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601'])));
12
+	$title = sprintf(_("Most Common Arrival Airports on %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601'])));
13 13
 
14 14
 	require_once('header.php');
15 15
 	print '<div class="select-item">';
@@ -27,13 +27,13 @@  discard block
 block discarded – undo
27 27
 	print '<script type="text/javascript">$(function () { $("#datepicker").datetimepicker({ format: "YYYY-MM-DD", defaultDate: "'.$date.'" }); }); </script>';
28 28
 	print '<br />';  
29 29
 	print '<div class="info column">';
30
-	print '<h1>'.sprintf(_("Flights from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>';
30
+	print '<h1>'.sprintf(_("Flights from %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>';
31 31
 	print '</div>';
32 32
 
33 33
 	include('date-sub-menu.php');
34 34
 	print '<div class="column">';
35 35
 	print '<h2>'._("Most Common Arrival Airports").'</h2>';
36
-	print '<p>'.sprintf(_("The statistic below shows all arrival airports of flights on <strong>%s</strong>."),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>';
36
+	print '<p>'.sprintf(_("The statistic below shows all arrival airports of flights on <strong>%s</strong>."), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>';
37 37
 	$airport_airport_array = $Spotter->countAllArrivalAirportsByDate($date);
38 38
 	print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>';
39 39
 	print '<script type="text/javascript" src="'.$globalURL.'/js/topojson.v2.min.js"></script>';
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 	print '<script>';
43 43
 	print 'var series = [';
44 44
 	$airport_data = '';
45
-	foreach($airport_airport_array as $airport_item)
45
+	foreach ($airport_airport_array as $airport_item)
46 46
 	{
47 47
 		$airport_data .= '[ "'.$airport_item['airport_arrival_icao_count'].'", "'.$airport_item['airport_arrival_icao'].'",'.$airport_item['airport_arrival_latitude'].','.$airport_item['airport_arrival_longitude'].'],';
48 48
 	}
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 	print '</thead>';
98 98
 	print '<tbody>';
99 99
 	$i = 1;
100
-	foreach($airport_airport_array as $airport_item)
100
+	foreach ($airport_airport_array as $airport_item)
101 101
 	{
102 102
 		print '<tr>';
103 103
 		print '<td><strong>'.$i.'</strong></td>';
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 	$title = _("Unknown Date");
123 123
 	require_once('header.php');
124 124
 	print '<h1>'._("Error").'</h1>';
125
-	print '<p>'._("Sorry, this date does not exist in this database. :(");'</p>';
125
+	print '<p>'._("Sorry, this date does not exist in this database. :("); '</p>';
126 126
 }
127 127
 
128 128
 require_once('footer.php');
Please login to merge, or discard this patch.
install/index.php 3 patches
Indentation   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -317,18 +317,18 @@  discard block
 block discarded – undo
317 317
 				</tr>
318 318
 				<!--
319 319
 		<?php
320
-		    require_once(dirname(__FILE__).'/../require/class.Connection.php');
321
-		    $Connection = new Connection();
320
+			require_once(dirname(__FILE__).'/../require/class.Connection.php');
321
+			$Connection = new Connection();
322 322
 		?>
323 323
 				-->
324 324
 		<?php
325
-		    if ($Connection->db != NULL) {
325
+			if ($Connection->db != NULL) {
326 326
 			if ($Connection->tableExists('source_location')) {
327
-			    require_once(dirname(__FILE__).'/../require/class.Source.php');
328
-			    $Source = new Source();
329
-			    //$alllocations = $Source->getAllLocationInfo();
330
-			    $alllocations = $Source->getLocationInfobyType('');
331
-			    foreach ($alllocations as $location) {
327
+				require_once(dirname(__FILE__).'/../require/class.Source.php');
328
+				$Source = new Source();
329
+				//$alllocations = $Source->getAllLocationInfo();
330
+				$alllocations = $Source->getLocationInfobyType('');
331
+				foreach ($alllocations as $location) {
332 332
 		?>
333 333
 				<tr>
334 334
 	    				<input type="hidden" name="source_id[]" value="<?php print $location['id']; ?>" />
@@ -342,9 +342,9 @@  discard block
 block discarded – undo
342 342
 				</tr>
343 343
 		
344 344
 		<?php
345
-			    }
345
+				}
346
+			}
346 347
 			}
347
-		    }
348 348
 		?>
349 349
 
350 350
 				<tr>
@@ -452,12 +452,12 @@  discard block
 block discarded – undo
452 452
 ?>
453 453
 							<tr>
454 454
 								<?php
455
-								    if (filter_var($source['host'],FILTER_VALIDATE_URL)) {
455
+									if (filter_var($source['host'],FILTER_VALIDATE_URL)) {
456 456
 								?>
457 457
 								<td><input type="text" name="host[]" id="host" value="<?php print $source['host']; ?>" /></td>
458 458
 								<td><input type="text" name="port[]" class="col-xs-2" id="port" value="<?php if (isset($source['port'])) print $source['port']; ?>" /></td>
459 459
 								<?php
460
-								    } else {
460
+									} else {
461 461
 									$hostport = explode(':',$source['host']);
462 462
 									if (isset($hostport[1])) {
463 463
 										$host = $hostport[0];
@@ -470,7 +470,7 @@  discard block
 block discarded – undo
470 470
 								<td><input type="text" name="host[]" id="host" value="<?php print $host; ?>" /></td>
471 471
 								<td><input type="text" name="port[]" class="col-xs-2" id="port" value="<?php print $port; ?>" /></td>
472 472
 								<?php
473
-								    }
473
+									}
474 474
 								?>
475 475
 								<td>
476 476
 									<select name="format[]" id="format">
@@ -880,7 +880,7 @@  discard block
 block discarded – undo
880 880
 			<br />
881 881
 			<p>
882 882
 			<?php 
883
-			    if (extension_loaded('gd') && function_exists('gd_info')) {
883
+				if (extension_loaded('gd') && function_exists('gd_info')) {
884 884
 			?>
885 885
 				<label for="aircrafticoncolor">Color of aircraft icon on map</label>
886 886
 				<input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) echo $globalAircraftIconColor; else echo '1a3151'; ?>" />
@@ -890,11 +890,11 @@  discard block
 block discarded – undo
890 890
 				<b>The directory cache is not writable, aircraft icon will not be cached</b>
891 891
 			<?php
892 892
 				}
893
-			    } else {
893
+				} else {
894 894
 			?>
895 895
 				<b>PHP GD is not installed, you can't change color of aircraft icon on map</b>
896 896
 			<?php
897
-			    }
897
+				}
898 898
 			?>
899 899
 			</p>
900 900
 			<br />
@@ -918,7 +918,7 @@  discard block
 block discarded – undo
918 918
 	</p>
919 919
 <?php
920 920
 	require('../footer.php');
921
-        exit;
921
+		exit;
922 922
 }
923 923
 // '	
924 924
 $settings = array();
@@ -1009,8 +1009,8 @@  discard block
 block discarded – undo
1009 1009
 	
1010 1010
 	$sources = array();
1011 1011
 	foreach ($source_name as $keys => $name) {
1012
-	    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]);
1013
-	    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]);
1012
+		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]);
1013
+		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]);
1014 1014
 	}
1015 1015
 	if (count($sources) > 0) $_SESSION['sources'] = $sources;
1016 1016
 
@@ -1392,14 +1392,14 @@  discard block
 block discarded – undo
1392 1392
 
1393 1393
 	// Set some defaults values...
1394 1394
 	if (!isset($globalAircraftImageSources)) {
1395
-	    $globalAircraftImageSources = array('ivaomtl','wikimedia','airportdata','deviantart','flickr','bing','jetphotos','planepictures','planespotters');
1396
-	    $settings = array_merge($settings,array('globalAircraftImageSources' => $globalAircraftImageSources));
1395
+		$globalAircraftImageSources = array('ivaomtl','wikimedia','airportdata','deviantart','flickr','bing','jetphotos','planepictures','planespotters');
1396
+		$settings = array_merge($settings,array('globalAircraftImageSources' => $globalAircraftImageSources));
1397 1397
 	}
1398 1398
 
1399 1399
 	if (!isset($globalSchedulesSources)) {
1400
-	    $globalSchedulesSources = array('flightmapper','costtotravel','flightradar24','flightaware');
1401
-    	    $settings = array_merge($settings,array('globalSchedulesSources' => $globalSchedulesSources));
1402
-    	}
1400
+		$globalSchedulesSources = array('flightmapper','costtotravel','flightradar24','flightaware');
1401
+			$settings = array_merge($settings,array('globalSchedulesSources' => $globalSchedulesSources));
1402
+		}
1403 1403
 
1404 1404
 	$settings = array_merge($settings,array('globalInstalled' => 'TRUE'));
1405 1405
 
@@ -1446,21 +1446,21 @@  discard block
 block discarded – undo
1446 1446
 	$popi = false;
1447 1447
 	$popw = false;
1448 1448
 	foreach ($_SESSION['done'] as $done) {
1449
-	    print '<li>'.$done.'....<strong>SUCCESS</strong></li>';
1450
-	    if ($done == 'Create database') $pop = true;
1451
-	    if ($_SESSION['install'] == 'database_create') $pop = true;
1452
-	    if ($_SESSION['install'] == 'database_import') $popi = true;
1453
-	    if ($_SESSION['install'] == 'waypoints') $popw = true;
1449
+		print '<li>'.$done.'....<strong>SUCCESS</strong></li>';
1450
+		if ($done == 'Create database') $pop = true;
1451
+		if ($_SESSION['install'] == 'database_create') $pop = true;
1452
+		if ($_SESSION['install'] == 'database_import') $popi = true;
1453
+		if ($_SESSION['install'] == 'waypoints') $popw = true;
1454 1454
 	}
1455 1455
 	if ($pop) {
1456
-	    sleep(5);
1457
-	    print '<li>Create database....<img src="../images/loading.gif" /></li>';
1456
+		sleep(5);
1457
+		print '<li>Create database....<img src="../images/loading.gif" /></li>';
1458 1458
 	} else if ($popi) {
1459
-	    sleep(5);
1460
-	    print '<li>Create and import tables....<img src="../images/loading.gif" /></li>';
1459
+		sleep(5);
1460
+		print '<li>Create and import tables....<img src="../images/loading.gif" /></li>';
1461 1461
 	} else if ($popw) {
1462
-	    sleep(5);
1463
-	    print '<li>Populate waypoints database....<img src="../images/loading.gif" /></li>';
1462
+		sleep(5);
1463
+		print '<li>Populate waypoints database....<img src="../images/loading.gif" /></li>';
1464 1464
 	} else print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>';
1465 1465
 	print '</div></ul>';
1466 1466
 	print '<div id="error"></div>';
@@ -1523,7 +1523,7 @@  discard block
 block discarded – undo
1523 1523
 	unset($_COOKIE['install']);
1524 1524
 	print '<div class="info column"><ul>';
1525 1525
 	foreach ($_SESSION['done'] as $done) {
1526
-	    print '<li>'.$done.'....<strong>SUCCESS</strong></li>';
1526
+		print '<li>'.$done.'....<strong>SUCCESS</strong></li>';
1527 1527
 	}
1528 1528
 	print '<li>Reloading page to check all is now ok....<strong>SUCCESS</strong></li>';
1529 1529
 	print '</ul></div>';
Please login to merge, or discard this patch.
Spacing   +243 added lines, -243 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 require_once(dirname(__FILE__).'/class.create_db.php');
11 11
 require_once(dirname(__FILE__).'/class.update_schema.php');
12 12
 require_once(dirname(__FILE__).'/class.settings.php');
13
-$title="Install";
13
+$title = "Install";
14 14
 require(dirname(__FILE__).'/../require/settings.php');
15 15
 require(dirname(__FILE__).'/header.php');
16 16
 
@@ -69,8 +69,8 @@  discard block
 block discarded – undo
69 69
 if (!extension_loaded('curl')) {
70 70
 	$error[] = "Curl is not loaded.";
71 71
 }
72
-if(function_exists('apache_get_modules') ){
73
-	if(!in_array('mod_rewrite',apache_get_modules())) {
72
+if (function_exists('apache_get_modules')) {
73
+	if (!in_array('mod_rewrite', apache_get_modules())) {
74 74
 		$error[] = "mod_rewrite is not available.";
75 75
 	}
76 76
 /*
@@ -86,8 +86,8 @@  discard block
 block discarded – undo
86 86
 print '<div class="info column"><p><strong>If you use MySQL or MariaDB, check that <i>max_allowed_packet</i> >= 8M, else import of some table can fail.</strong></p></div>';
87 87
 if (isset($_SERVER['REQUEST_SCHEME']) && isset($_SERVER['SERVER_NAME']) && isset($_SERVER['SERVER_PORT']) && isset($_SERVER['REQUEST_URI'])) {
88 88
 	if (function_exists('get_headers')) {
89
-		$check_header = @get_headers($_SERVER['REQUEST_SCHEME'].'://'.$_SERVER["SERVER_NAME"].':'.$_SERVER["SERVER_PORT"].str_replace('install/','search',str_replace('index.php',$_SERVER["REQUEST_URI"])));
90
-		if (isset($check_header[0]) && !stripos($check_header[0],"200 OK")) {
89
+		$check_header = @get_headers($_SERVER['REQUEST_SCHEME'].'://'.$_SERVER["SERVER_NAME"].':'.$_SERVER["SERVER_PORT"].str_replace('install/', 'search', str_replace('index.php', $_SERVER["REQUEST_URI"])));
90
+		if (isset($check_header[0]) && !stripos($check_header[0], "200 OK")) {
91 91
 			print '<div class="info column"><p><strong>Check your configuration, rewrite don\'t seems to work.</strong></p></div>';
92 92
 		}
93 93
 	}
@@ -452,13 +452,13 @@  discard block
 block discarded – undo
452 452
 ?>
453 453
 							<tr>
454 454
 								<?php
455
-								    if (filter_var($source['host'],FILTER_VALIDATE_URL)) {
455
+								    if (filter_var($source['host'], FILTER_VALIDATE_URL)) {
456 456
 								?>
457 457
 								<td><input type="text" name="host[]" id="host" value="<?php print $source['host']; ?>" /></td>
458 458
 								<td><input type="text" name="port[]" class="col-xs-2" id="port" value="<?php if (isset($source['port'])) print $source['port']; ?>" /></td>
459 459
 								<?php
460 460
 								    } else {
461
-									$hostport = explode(':',$source['host']);
461
+									$hostport = explode(':', $source['host']);
462 462
 									if (isset($hostport[1])) {
463 463
 										$host = $hostport[0];
464 464
 										$port = $hostport[1];
@@ -504,7 +504,7 @@  discard block
 block discarded – undo
504 504
 									<select name="timezones[]" id="timezones">
505 505
 								<?php
506 506
 									$timezonelist = DateTimeZone::listIdentifiers(DateTimeZone::ALL);
507
-									foreach($timezonelist as $timezones){
507
+									foreach ($timezonelist as $timezones) {
508 508
 										if (isset($source['timezone']) && $source['timezone'] == $timezones) {
509 509
 											print '<option selected>'.$timezones.'</option>';
510 510
 										} elseif (!isset($source['timezone']) && $timezones == 'UTC') {
@@ -555,7 +555,7 @@  discard block
 block discarded – undo
555 555
 									<select name="timezones[]" id="timezones">
556 556
 								<?php
557 557
 									$timezonelist = DateTimeZone::listIdentifiers(DateTimeZone::ALL);
558
-									foreach($timezonelist as $timezones){
558
+									foreach ($timezonelist as $timezones) {
559 559
 										if ($timezones == 'UTC') {
560 560
 											print '<option selected>'.$timezones.'</option>';
561 561
 										} else print '<option>'.$timezones.'</option>';
@@ -870,7 +870,7 @@  discard block
 block discarded – undo
870 870
 			<br />
871 871
 			<p>
872 872
 				<label for="aircraftsize">Size of aircraft icon on map (default to 30px if zoom > 7 else 15px), empty to default</label>
873
-				<input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize;?>" />
873
+				<input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize; ?>" />
874 874
 			</p>
875 875
 			<br />
876 876
 			<p>
@@ -926,14 +926,14 @@  discard block
 block discarded – undo
926 926
 $error = '';
927 927
 
928 928
 if (isset($_POST['dbtype'])) {
929
-	$dbtype = filter_input(INPUT_POST,'dbtype',FILTER_SANITIZE_STRING);
930
-	$dbroot = filter_input(INPUT_POST,'dbroot',FILTER_SANITIZE_STRING);
931
-	$dbrootpass = filter_input(INPUT_POST,'dbrootpass',FILTER_SANITIZE_STRING);
932
-	$dbname = filter_input(INPUT_POST,'dbname',FILTER_SANITIZE_STRING);
933
-	$dbuser = filter_input(INPUT_POST,'dbuser',FILTER_SANITIZE_STRING);
934
-	$dbuserpass = filter_input(INPUT_POST,'dbuserpass',FILTER_SANITIZE_STRING);
935
-	$dbhost = filter_input(INPUT_POST,'dbhost',FILTER_SANITIZE_STRING);
936
-	$dbport = filter_input(INPUT_POST,'dbport',FILTER_SANITIZE_STRING);
929
+	$dbtype = filter_input(INPUT_POST, 'dbtype', FILTER_SANITIZE_STRING);
930
+	$dbroot = filter_input(INPUT_POST, 'dbroot', FILTER_SANITIZE_STRING);
931
+	$dbrootpass = filter_input(INPUT_POST, 'dbrootpass', FILTER_SANITIZE_STRING);
932
+	$dbname = filter_input(INPUT_POST, 'dbname', FILTER_SANITIZE_STRING);
933
+	$dbuser = filter_input(INPUT_POST, 'dbuser', FILTER_SANITIZE_STRING);
934
+	$dbuserpass = filter_input(INPUT_POST, 'dbuserpass', FILTER_SANITIZE_STRING);
935
+	$dbhost = filter_input(INPUT_POST, 'dbhost', FILTER_SANITIZE_STRING);
936
+	$dbport = filter_input(INPUT_POST, 'dbport', FILTER_SANITIZE_STRING);
937 937
 
938 938
 	if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) $error .= 'Mysql driver for PDO must be loaded';
939 939
 	if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) $error .= 'PosgreSQL driver for PDO must be loaded';
@@ -953,49 +953,49 @@  discard block
 block discarded – undo
953 953
 	} else $settings = array_merge($settings,array('globalDBdriver' => $dbtype,'globalDBhost' => $dbhost,'globalDBuser' => $dbuser,'globalDBport' => $dbport,'globalDBpass' => $dbuserpass,'globalDBname' => $dbname));
954 954
 	*/
955 955
 	
956
-	$settings = array_merge($settings,array('globalDBdriver' => $dbtype,'globalDBhost' => $dbhost,'globalDBuser' => $dbuser,'globalDBport' => $dbport,'globalDBpass' => $dbuserpass,'globalDBname' => $dbname));
956
+	$settings = array_merge($settings, array('globalDBdriver' => $dbtype, 'globalDBhost' => $dbhost, 'globalDBuser' => $dbuser, 'globalDBport' => $dbport, 'globalDBpass' => $dbuserpass, 'globalDBname' => $dbname));
957 957
 
958
-	$sitename = filter_input(INPUT_POST,'sitename',FILTER_SANITIZE_STRING);
959
-	$siteurl = filter_input(INPUT_POST,'siteurl',FILTER_SANITIZE_STRING);
960
-	$timezone = filter_input(INPUT_POST,'timezone',FILTER_SANITIZE_STRING);
961
-	$language = filter_input(INPUT_POST,'language',FILTER_SANITIZE_STRING);
962
-	$settings = array_merge($settings,array('globalName' => $sitename,'globalURL' => $siteurl, 'globalTimezone' => $timezone,'globalLanguage' => $language));
958
+	$sitename = filter_input(INPUT_POST, 'sitename', FILTER_SANITIZE_STRING);
959
+	$siteurl = filter_input(INPUT_POST, 'siteurl', FILTER_SANITIZE_STRING);
960
+	$timezone = filter_input(INPUT_POST, 'timezone', FILTER_SANITIZE_STRING);
961
+	$language = filter_input(INPUT_POST, 'language', FILTER_SANITIZE_STRING);
962
+	$settings = array_merge($settings, array('globalName' => $sitename, 'globalURL' => $siteurl, 'globalTimezone' => $timezone, 'globalLanguage' => $language));
963 963
 
964
-	$mapprovider = filter_input(INPUT_POST,'mapprovider',FILTER_SANITIZE_STRING);
965
-	$mapboxid = filter_input(INPUT_POST,'mapboxid',FILTER_SANITIZE_STRING);
966
-	$mapboxtoken = filter_input(INPUT_POST,'mapboxtoken',FILTER_SANITIZE_STRING);
967
-	$googlekey = filter_input(INPUT_POST,'googlekey',FILTER_SANITIZE_STRING);
968
-	$bingkey = filter_input(INPUT_POST,'bingkey',FILTER_SANITIZE_STRING);
969
-	$openweathermapkey = filter_input(INPUT_POST,'openweathermapkey',FILTER_SANITIZE_STRING);
970
-	$mapquestkey = filter_input(INPUT_POST,'mapquestkey',FILTER_SANITIZE_STRING);
971
-	$hereappid = filter_input(INPUT_POST,'hereappid',FILTER_SANITIZE_STRING);
972
-	$hereappcode = filter_input(INPUT_POST,'hereappcode',FILTER_SANITIZE_STRING);
973
-	$settings = array_merge($settings,array('globalMapProvider' => $mapprovider,'globalMapboxId' => $mapboxid,'globalMapboxToken' => $mapboxtoken,'globalGoogleAPIKey' => $googlekey,'globalBingMapKey' => $bingkey,'globalHereappID' => $hereappid,'globalHereappCode' => $hereappcode,'globalMapQuestKey' => $mapquestkey,'globalOpenWeatherMapKey' => $openweathermapkey));
964
+	$mapprovider = filter_input(INPUT_POST, 'mapprovider', FILTER_SANITIZE_STRING);
965
+	$mapboxid = filter_input(INPUT_POST, 'mapboxid', FILTER_SANITIZE_STRING);
966
+	$mapboxtoken = filter_input(INPUT_POST, 'mapboxtoken', FILTER_SANITIZE_STRING);
967
+	$googlekey = filter_input(INPUT_POST, 'googlekey', FILTER_SANITIZE_STRING);
968
+	$bingkey = filter_input(INPUT_POST, 'bingkey', FILTER_SANITIZE_STRING);
969
+	$openweathermapkey = filter_input(INPUT_POST, 'openweathermapkey', FILTER_SANITIZE_STRING);
970
+	$mapquestkey = filter_input(INPUT_POST, 'mapquestkey', FILTER_SANITIZE_STRING);
971
+	$hereappid = filter_input(INPUT_POST, 'hereappid', FILTER_SANITIZE_STRING);
972
+	$hereappcode = filter_input(INPUT_POST, 'hereappcode', FILTER_SANITIZE_STRING);
973
+	$settings = array_merge($settings, array('globalMapProvider' => $mapprovider, 'globalMapboxId' => $mapboxid, 'globalMapboxToken' => $mapboxtoken, 'globalGoogleAPIKey' => $googlekey, 'globalBingMapKey' => $bingkey, 'globalHereappID' => $hereappid, 'globalHereappCode' => $hereappcode, 'globalMapQuestKey' => $mapquestkey, 'globalOpenWeatherMapKey' => $openweathermapkey));
974 974
 	
975
-	$latitudemax = filter_input(INPUT_POST,'latitudemax',FILTER_SANITIZE_STRING);
976
-	$latitudemin = filter_input(INPUT_POST,'latitudemin',FILTER_SANITIZE_STRING);
977
-	$longitudemax = filter_input(INPUT_POST,'longitudemax',FILTER_SANITIZE_STRING);
978
-	$longitudemin = filter_input(INPUT_POST,'longitudemin',FILTER_SANITIZE_STRING);
979
-	$livezoom = filter_input(INPUT_POST,'livezoom',FILTER_SANITIZE_NUMBER_INT);
980
-	$settings = array_merge($settings,array('globalLatitudeMax' => $latitudemax,'globalLatitudeMin' => $latitudemin,'globalLongitudeMax' => $longitudemax,'globalLongitudeMin' => $longitudemin,'globalLiveZoom' => $livezoom));
975
+	$latitudemax = filter_input(INPUT_POST, 'latitudemax', FILTER_SANITIZE_STRING);
976
+	$latitudemin = filter_input(INPUT_POST, 'latitudemin', FILTER_SANITIZE_STRING);
977
+	$longitudemax = filter_input(INPUT_POST, 'longitudemax', FILTER_SANITIZE_STRING);
978
+	$longitudemin = filter_input(INPUT_POST, 'longitudemin', FILTER_SANITIZE_STRING);
979
+	$livezoom = filter_input(INPUT_POST, 'livezoom', FILTER_SANITIZE_NUMBER_INT);
980
+	$settings = array_merge($settings, array('globalLatitudeMax' => $latitudemax, 'globalLatitudeMin' => $latitudemin, 'globalLongitudeMax' => $longitudemax, 'globalLongitudeMin' => $longitudemin, 'globalLiveZoom' => $livezoom));
981 981
 
982
-	$squawk_country = filter_input(INPUT_POST,'squawk_country',FILTER_SANITIZE_STRING);
983
-	$settings = array_merge($settings,array('globalSquawkCountry' => $squawk_country));
982
+	$squawk_country = filter_input(INPUT_POST, 'squawk_country', FILTER_SANITIZE_STRING);
983
+	$settings = array_merge($settings, array('globalSquawkCountry' => $squawk_country));
984 984
 
985
-	$latitudecenter = filter_input(INPUT_POST,'latitudecenter',FILTER_SANITIZE_STRING);
986
-	$longitudecenter = filter_input(INPUT_POST,'longitudecenter',FILTER_SANITIZE_STRING);
987
-	$settings = array_merge($settings,array('globalCenterLatitude' => $latitudecenter,'globalCenterLongitude' => $longitudecenter));
985
+	$latitudecenter = filter_input(INPUT_POST, 'latitudecenter', FILTER_SANITIZE_STRING);
986
+	$longitudecenter = filter_input(INPUT_POST, 'longitudecenter', FILTER_SANITIZE_STRING);
987
+	$settings = array_merge($settings, array('globalCenterLatitude' => $latitudecenter, 'globalCenterLongitude' => $longitudecenter));
988 988
 
989
-	$acars = filter_input(INPUT_POST,'acars',FILTER_SANITIZE_STRING);
989
+	$acars = filter_input(INPUT_POST, 'acars', FILTER_SANITIZE_STRING);
990 990
 	if ($acars == 'acars') {
991
-		$settings = array_merge($settings,array('globalACARS' => 'TRUE'));
991
+		$settings = array_merge($settings, array('globalACARS' => 'TRUE'));
992 992
 	} else {
993
-		$settings = array_merge($settings,array('globalACARS' => 'FALSE'));
993
+		$settings = array_merge($settings, array('globalACARS' => 'FALSE'));
994 994
 	}
995 995
 
996
-	$flightawareusername = filter_input(INPUT_POST,'flightawareusername',FILTER_SANITIZE_STRING);
997
-	$flightawarepassword = filter_input(INPUT_POST,'flightawarepassword',FILTER_SANITIZE_STRING);
998
-	$settings = array_merge($settings,array('globalFlightAwareUsername' => $flightawareusername,'globalFlightAwarePassword' => $flightawarepassword));
996
+	$flightawareusername = filter_input(INPUT_POST, 'flightawareusername', FILTER_SANITIZE_STRING);
997
+	$flightawarepassword = filter_input(INPUT_POST, 'flightawarepassword', FILTER_SANITIZE_STRING);
998
+	$settings = array_merge($settings, array('globalFlightAwareUsername' => $flightawareusername, 'globalFlightAwarePassword' => $flightawarepassword));
999 999
 	
1000 1000
 	$source_name = $_POST['source_name'];
1001 1001
 	$source_latitude = $_POST['source_latitude'];
@@ -1009,8 +1009,8 @@  discard block
 block discarded – undo
1009 1009
 	
1010 1010
 	$sources = array();
1011 1011
 	foreach ($source_name as $keys => $name) {
1012
-	    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]);
1013
-	    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]);
1012
+	    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]);
1013
+	    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]);
1014 1014
 	}
1015 1015
 	if (count($sources) > 0) $_SESSION['sources'] = $sources;
1016 1016
 
@@ -1023,24 +1023,24 @@  discard block
 block discarded – undo
1023 1023
 	$sbsurl = $_POST['sbsurl'];
1024 1024
 	*/
1025 1025
 
1026
-	$globalvatsim = filter_input(INPUT_POST,'globalvatsim',FILTER_SANITIZE_STRING);
1027
-	$globalva = filter_input(INPUT_POST,'globalva',FILTER_SANITIZE_STRING);
1028
-	$globalivao = filter_input(INPUT_POST,'globalivao',FILTER_SANITIZE_STRING);
1029
-	$globalphpvms = filter_input(INPUT_POST,'globalphpvms',FILTER_SANITIZE_STRING);
1030
-	$globalvam = filter_input(INPUT_POST,'globalvam',FILTER_SANITIZE_STRING);
1031
-	$globalsbs = filter_input(INPUT_POST,'globalsbs',FILTER_SANITIZE_STRING);
1032
-	$globalaprs = filter_input(INPUT_POST,'globalaprs',FILTER_SANITIZE_STRING);
1033
-	$datasource = filter_input(INPUT_POST,'datasource',FILTER_SANITIZE_STRING);
1026
+	$globalvatsim = filter_input(INPUT_POST, 'globalvatsim', FILTER_SANITIZE_STRING);
1027
+	$globalva = filter_input(INPUT_POST, 'globalva', FILTER_SANITIZE_STRING);
1028
+	$globalivao = filter_input(INPUT_POST, 'globalivao', FILTER_SANITIZE_STRING);
1029
+	$globalphpvms = filter_input(INPUT_POST, 'globalphpvms', FILTER_SANITIZE_STRING);
1030
+	$globalvam = filter_input(INPUT_POST, 'globalvam', FILTER_SANITIZE_STRING);
1031
+	$globalsbs = filter_input(INPUT_POST, 'globalsbs', FILTER_SANITIZE_STRING);
1032
+	$globalaprs = filter_input(INPUT_POST, 'globalaprs', FILTER_SANITIZE_STRING);
1033
+	$datasource = filter_input(INPUT_POST, 'datasource', FILTER_SANITIZE_STRING);
1034 1034
 
1035
-	$globalaircraft = filter_input(INPUT_POST,'globalaircraft',FILTER_SANITIZE_STRING);
1036
-	if ($globalaircraft == 'aircraft') $settings = array_merge($settings,array('globalAircraft' => 'TRUE'));
1037
-	else $settings = array_merge($settings,array('globalAircraft' => 'FALSE'));
1038
-	$globaltracker = filter_input(INPUT_POST,'globaltracker',FILTER_SANITIZE_STRING);
1039
-	if ($globaltracker == 'tracker') $settings = array_merge($settings,array('globalTracker' => 'TRUE'));
1040
-	else $settings = array_merge($settings,array('globalTracker' => 'FALSE'));
1041
-	$globalmarine = filter_input(INPUT_POST,'globalmarine',FILTER_SANITIZE_STRING);
1042
-	if ($globalmarine == 'marine') $settings = array_merge($settings,array('globalMarine' => 'TRUE'));
1043
-	else $settings = array_merge($settings,array('globalMarine' => 'FALSE'));
1035
+	$globalaircraft = filter_input(INPUT_POST, 'globalaircraft', FILTER_SANITIZE_STRING);
1036
+	if ($globalaircraft == 'aircraft') $settings = array_merge($settings, array('globalAircraft' => 'TRUE'));
1037
+	else $settings = array_merge($settings, array('globalAircraft' => 'FALSE'));
1038
+	$globaltracker = filter_input(INPUT_POST, 'globaltracker', FILTER_SANITIZE_STRING);
1039
+	if ($globaltracker == 'tracker') $settings = array_merge($settings, array('globalTracker' => 'TRUE'));
1040
+	else $settings = array_merge($settings, array('globalTracker' => 'FALSE'));
1041
+	$globalmarine = filter_input(INPUT_POST, 'globalmarine', FILTER_SANITIZE_STRING);
1042
+	if ($globalmarine == 'marine') $settings = array_merge($settings, array('globalMarine' => 'TRUE'));
1043
+	else $settings = array_merge($settings, array('globalMarine' => 'FALSE'));
1044 1044
 
1045 1045
 /*	
1046 1046
 	$globalSBS1Hosts = array();
@@ -1056,7 +1056,7 @@  discard block
 block discarded – undo
1056 1056
 	}
1057 1057
 	$settings = array_merge($settings,array('globalSBS1Hosts' => $globalSBS1Hosts));
1058 1058
 */
1059
-	$settings_comment = array_merge($settings_comment,array('globalSBS1Hosts'));
1059
+	$settings_comment = array_merge($settings_comment, array('globalSBS1Hosts'));
1060 1060
 	$host = $_POST['host'];
1061 1061
 	$port = $_POST['port'];
1062 1062
 	$name = $_POST['name'];
@@ -1073,104 +1073,104 @@  discard block
 block discarded – undo
1073 1073
 		else $cov = 'FALSE';
1074 1074
 		if (isset($noarchive[$key]) && $noarchive[$key] == 1) $arch = 'TRUE';
1075 1075
 		else $arch = 'FALSE';
1076
-		if (strpos($format[$key],'_callback')) {
1077
-			$gSources[] = array('host' => $h, 'pass' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezones[$key],'callback' => 'TRUE');
1076
+		if (strpos($format[$key], '_callback')) {
1077
+			$gSources[] = array('host' => $h, 'pass' => $port[$key], 'name' => $name[$key], 'format' => $format[$key], 'sourcestats' => $cov, 'noarchive' => $arch, 'timezone' => $timezones[$key], 'callback' => 'TRUE');
1078 1078
 		} elseif ($h != '' || $name[$key] != '') {
1079
-			$gSources[] = array('host' => $h, 'port' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezones[$key],'callback' => 'FALSE');
1079
+			$gSources[] = array('host' => $h, 'port' => $port[$key], 'name' => $name[$key], 'format' => $format[$key], 'sourcestats' => $cov, 'noarchive' => $arch, 'timezone' => $timezones[$key], 'callback' => 'FALSE');
1080 1080
 		}
1081 1081
 		if ($format[$key] == 'airwhere') $forcepilots = true;
1082 1082
 	}
1083
-	$settings = array_merge($settings,array('globalSources' => $gSources));
1083
+	$settings = array_merge($settings, array('globalSources' => $gSources));
1084 1084
 
1085 1085
 /*
1086 1086
 	$sbstimeout = filter_input(INPUT_POST,'sbstimeout',FILTER_SANITIZE_NUMBER_INT);
1087 1087
 	$settings = array_merge($settings,array('globalSourcesTimeOut' => $sbstimeout));
1088 1088
 */
1089
-	$acarshost = filter_input(INPUT_POST,'acarshost',FILTER_SANITIZE_STRING);
1090
-	$acarsport = filter_input(INPUT_POST,'acarsport',FILTER_SANITIZE_NUMBER_INT);
1091
-	$settings = array_merge($settings,array('globalACARSHost' => $acarshost,'globalACARSPort' => $acarsport));
1089
+	$acarshost = filter_input(INPUT_POST, 'acarshost', FILTER_SANITIZE_STRING);
1090
+	$acarsport = filter_input(INPUT_POST, 'acarsport', FILTER_SANITIZE_NUMBER_INT);
1091
+	$settings = array_merge($settings, array('globalACARSHost' => $acarshost, 'globalACARSPort' => $acarsport));
1092 1092
 
1093
-	$bitly = filter_input(INPUT_POST,'bitly',FILTER_SANITIZE_STRING);
1094
-	$settings = array_merge($settings,array('globalBitlyAccessToken' => $bitly));
1093
+	$bitly = filter_input(INPUT_POST, 'bitly', FILTER_SANITIZE_STRING);
1094
+	$settings = array_merge($settings, array('globalBitlyAccessToken' => $bitly));
1095 1095
 
1096
-	$customcss = filter_input(INPUT_POST,'customcss',FILTER_SANITIZE_STRING);
1097
-	$settings = array_merge($settings,array('globalCustomCSS' => $customcss));
1096
+	$customcss = filter_input(INPUT_POST, 'customcss', FILTER_SANITIZE_STRING);
1097
+	$settings = array_merge($settings, array('globalCustomCSS' => $customcss));
1098 1098
 
1099
-	$notamsource = filter_input(INPUT_POST,'notamsource',FILTER_SANITIZE_STRING);
1100
-	$settings = array_merge($settings,array('globalNOTAMSource' => $notamsource));
1101
-	$metarsource = filter_input(INPUT_POST,'metarsource',FILTER_SANITIZE_STRING);
1102
-	$settings = array_merge($settings,array('globalMETARurl' => $metarsource));
1099
+	$notamsource = filter_input(INPUT_POST, 'notamsource', FILTER_SANITIZE_STRING);
1100
+	$settings = array_merge($settings, array('globalNOTAMSource' => $notamsource));
1101
+	$metarsource = filter_input(INPUT_POST, 'metarsource', FILTER_SANITIZE_STRING);
1102
+	$settings = array_merge($settings, array('globalMETARurl' => $metarsource));
1103 1103
 
1104
-	$zoilatitude = filter_input(INPUT_POST,'zoilatitude',FILTER_SANITIZE_STRING);
1105
-	$zoilongitude = filter_input(INPUT_POST,'zoilongitude',FILTER_SANITIZE_STRING);
1106
-	$zoidistance = filter_input(INPUT_POST,'zoidistance',FILTER_SANITIZE_NUMBER_INT);
1104
+	$zoilatitude = filter_input(INPUT_POST, 'zoilatitude', FILTER_SANITIZE_STRING);
1105
+	$zoilongitude = filter_input(INPUT_POST, 'zoilongitude', FILTER_SANITIZE_STRING);
1106
+	$zoidistance = filter_input(INPUT_POST, 'zoidistance', FILTER_SANITIZE_NUMBER_INT);
1107 1107
 	if ($zoilatitude != '' && $zoilongitude != '' && $zoidistance != '') {
1108
-		$settings = array_merge($settings,array('globalDistanceIgnore' => array('latitude' => $zoilatitude,'longitude' => $zoilongitude,'distance' => $zoidistance)));
1109
-	} else $settings = array_merge($settings,array('globalDistanceIgnore' => array()));
1108
+		$settings = array_merge($settings, array('globalDistanceIgnore' => array('latitude' => $zoilatitude, 'longitude' => $zoilongitude, 'distance' => $zoidistance)));
1109
+	} else $settings = array_merge($settings, array('globalDistanceIgnore' => array()));
1110 1110
 
1111
-	$refresh = filter_input(INPUT_POST,'refresh',FILTER_SANITIZE_NUMBER_INT);
1112
-	$settings = array_merge($settings,array('globalLiveInterval' => $refresh));
1113
-	$maprefresh = filter_input(INPUT_POST,'maprefresh',FILTER_SANITIZE_NUMBER_INT);
1114
-	$settings = array_merge($settings,array('globalMapRefresh' => $maprefresh));
1115
-	$mapidle = filter_input(INPUT_POST,'mapidle',FILTER_SANITIZE_NUMBER_INT);
1116
-	$settings = array_merge($settings,array('globalMapIdleTimeout' => $mapidle));
1117
-	$closestmindist = filter_input(INPUT_POST,'closestmindist',FILTER_SANITIZE_NUMBER_INT);
1118
-	$settings = array_merge($settings,array('globalClosestMinDist' => $closestmindist));
1111
+	$refresh = filter_input(INPUT_POST, 'refresh', FILTER_SANITIZE_NUMBER_INT);
1112
+	$settings = array_merge($settings, array('globalLiveInterval' => $refresh));
1113
+	$maprefresh = filter_input(INPUT_POST, 'maprefresh', FILTER_SANITIZE_NUMBER_INT);
1114
+	$settings = array_merge($settings, array('globalMapRefresh' => $maprefresh));
1115
+	$mapidle = filter_input(INPUT_POST, 'mapidle', FILTER_SANITIZE_NUMBER_INT);
1116
+	$settings = array_merge($settings, array('globalMapIdleTimeout' => $mapidle));
1117
+	$closestmindist = filter_input(INPUT_POST, 'closestmindist', FILTER_SANITIZE_NUMBER_INT);
1118
+	$settings = array_merge($settings, array('globalClosestMinDist' => $closestmindist));
1119 1119
 
1120
-	$aircraftsize = filter_input(INPUT_POST,'aircraftsize',FILTER_SANITIZE_NUMBER_INT);
1121
-	$settings = array_merge($settings,array('globalAircraftSize' => $aircraftsize));
1120
+	$aircraftsize = filter_input(INPUT_POST, 'aircraftsize', FILTER_SANITIZE_NUMBER_INT);
1121
+	$settings = array_merge($settings, array('globalAircraftSize' => $aircraftsize));
1122 1122
 
1123
-	$archivemonths = filter_input(INPUT_POST,'archivemonths',FILTER_SANITIZE_NUMBER_INT);
1124
-	$settings = array_merge($settings,array('globalArchiveMonths' => $archivemonths));
1123
+	$archivemonths = filter_input(INPUT_POST, 'archivemonths', FILTER_SANITIZE_NUMBER_INT);
1124
+	$settings = array_merge($settings, array('globalArchiveMonths' => $archivemonths));
1125 1125
 	
1126
-	$archiveyear = filter_input(INPUT_POST,'archiveyear',FILTER_SANITIZE_STRING);
1126
+	$archiveyear = filter_input(INPUT_POST, 'archiveyear', FILTER_SANITIZE_STRING);
1127 1127
 	if ($archiveyear == "archiveyear") {
1128
-		$settings = array_merge($settings,array('globalArchiveYear' => 'TRUE'));
1128
+		$settings = array_merge($settings, array('globalArchiveYear' => 'TRUE'));
1129 1129
 	} else {
1130
-		$settings = array_merge($settings,array('globalArchiveYear' => 'FALSE'));
1130
+		$settings = array_merge($settings, array('globalArchiveYear' => 'FALSE'));
1131 1131
 	}
1132
-	$archivekeepmonths = filter_input(INPUT_POST,'archivekeepmonths',FILTER_SANITIZE_NUMBER_INT);
1133
-	$settings = array_merge($settings,array('globalArchiveKeepMonths' => $archivekeepmonths));
1134
-	$archivekeeptrackmonths = filter_input(INPUT_POST,'archivekeeptrackmonths',FILTER_SANITIZE_NUMBER_INT);
1135
-	$settings = array_merge($settings,array('globalArchiveKeepTrackMonths' => $archivekeeptrackmonths));
1132
+	$archivekeepmonths = filter_input(INPUT_POST, 'archivekeepmonths', FILTER_SANITIZE_NUMBER_INT);
1133
+	$settings = array_merge($settings, array('globalArchiveKeepMonths' => $archivekeepmonths));
1134
+	$archivekeeptrackmonths = filter_input(INPUT_POST, 'archivekeeptrackmonths', FILTER_SANITIZE_NUMBER_INT);
1135
+	$settings = array_merge($settings, array('globalArchiveKeepTrackMonths' => $archivekeeptrackmonths));
1136 1136
 
1137
-	$britishairways = filter_input(INPUT_POST,'britishairways',FILTER_SANITIZE_STRING);
1138
-	$settings = array_merge($settings,array('globalBritishAirwaysKey' => $britishairways));
1139
-	$transavia = filter_input(INPUT_POST,'transavia',FILTER_SANITIZE_STRING);
1140
-	$settings = array_merge($settings,array('globalTransaviaKey' => $transavia));
1137
+	$britishairways = filter_input(INPUT_POST, 'britishairways', FILTER_SANITIZE_STRING);
1138
+	$settings = array_merge($settings, array('globalBritishAirwaysKey' => $britishairways));
1139
+	$transavia = filter_input(INPUT_POST, 'transavia', FILTER_SANITIZE_STRING);
1140
+	$settings = array_merge($settings, array('globalTransaviaKey' => $transavia));
1141 1141
 
1142
-	$lufthansakey = filter_input(INPUT_POST,'lufthansakey',FILTER_SANITIZE_STRING);
1143
-	$lufthansasecret = filter_input(INPUT_POST,'lufthansasecret',FILTER_SANITIZE_STRING);
1144
-	$settings = array_merge($settings,array('globalLufthansaKey' => array('key' => $lufthansakey,'secret' => $lufthansasecret)));
1142
+	$lufthansakey = filter_input(INPUT_POST, 'lufthansakey', FILTER_SANITIZE_STRING);
1143
+	$lufthansasecret = filter_input(INPUT_POST, 'lufthansasecret', FILTER_SANITIZE_STRING);
1144
+	$settings = array_merge($settings, array('globalLufthansaKey' => array('key' => $lufthansakey, 'secret' => $lufthansasecret)));
1145 1145
 
1146 1146
 	// Create in settings.php keys not yet configurable if not already here
1147 1147
 	//if (!isset($globalImageBingKey)) $settings = array_merge($settings,array('globalImageBingKey' => ''));
1148
-	if (!isset($globalDebug)) $settings = array_merge($settings,array('globalDebug' => 'TRUE'));
1148
+	if (!isset($globalDebug)) $settings = array_merge($settings, array('globalDebug' => 'TRUE'));
1149 1149
 
1150
-	$resetyearstats = filter_input(INPUT_POST,'resetyearstats',FILTER_SANITIZE_STRING);
1150
+	$resetyearstats = filter_input(INPUT_POST, 'resetyearstats', FILTER_SANITIZE_STRING);
1151 1151
 	if ($resetyearstats == 'resetyearstats') {
1152
-		$settings = array_merge($settings,array('globalDeleteLastYearStats' => 'TRUE'));
1152
+		$settings = array_merge($settings, array('globalDeleteLastYearStats' => 'TRUE'));
1153 1153
 	} else {
1154
-		$settings = array_merge($settings,array('globalDeleteLastYearStats' => 'FALSE'));
1154
+		$settings = array_merge($settings, array('globalDeleteLastYearStats' => 'FALSE'));
1155 1155
 	}
1156 1156
 
1157
-	$archive = filter_input(INPUT_POST,'archive',FILTER_SANITIZE_STRING);
1157
+	$archive = filter_input(INPUT_POST, 'archive', FILTER_SANITIZE_STRING);
1158 1158
 	if ($archive == 'archive') {
1159
-		$settings = array_merge($settings,array('globalArchive' => 'TRUE'));
1159
+		$settings = array_merge($settings, array('globalArchive' => 'TRUE'));
1160 1160
 	} else {
1161
-		$settings = array_merge($settings,array('globalArchive' => 'FALSE'));
1161
+		$settings = array_merge($settings, array('globalArchive' => 'FALSE'));
1162 1162
 	}
1163
-	$daemon = filter_input(INPUT_POST,'daemon',FILTER_SANITIZE_STRING);
1163
+	$daemon = filter_input(INPUT_POST, 'daemon', FILTER_SANITIZE_STRING);
1164 1164
 	if ($daemon == 'daemon') {
1165
-		$settings = array_merge($settings,array('globalDaemon' => 'TRUE'));
1165
+		$settings = array_merge($settings, array('globalDaemon' => 'TRUE'));
1166 1166
 	} else {
1167
-		$settings = array_merge($settings,array('globalDaemon' => 'FALSE'));
1167
+		$settings = array_merge($settings, array('globalDaemon' => 'FALSE'));
1168 1168
 	}
1169
-	$schedules = filter_input(INPUT_POST,'schedules',FILTER_SANITIZE_STRING);
1169
+	$schedules = filter_input(INPUT_POST, 'schedules', FILTER_SANITIZE_STRING);
1170 1170
 	if ($schedules == 'schedules') {
1171
-		$settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE'));
1171
+		$settings = array_merge($settings, array('globalSchedulesFetch' => 'TRUE'));
1172 1172
 	} else {
1173
-		$settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE'));
1173
+		$settings = array_merge($settings, array('globalSchedulesFetch' => 'FALSE'));
1174 1174
 	}
1175 1175
 
1176 1176
 /*
@@ -1181,227 +1181,227 @@  discard block
 block discarded – undo
1181 1181
 		$settings = array_merge($settings,array('globalFlightAware' => 'FALSE','globalSBS1' => 'TRUE'));
1182 1182
 	}
1183 1183
 */
1184
-	$settings = array_merge($settings,array('globalFlightAware' => 'FALSE'));
1185
-	if ($globalsbs == 'sbs') $settings = array_merge($settings,array('globalSBS1' => 'TRUE'));
1186
-	else $settings = array_merge($settings,array('globalSBS1' => 'FALSE'));
1187
-	if ($globalaprs == 'aprs') $settings = array_merge($settings,array('globalAPRS' => 'TRUE'));
1188
-	else $settings = array_merge($settings,array('globalAPRS' => 'FALSE'));
1184
+	$settings = array_merge($settings, array('globalFlightAware' => 'FALSE'));
1185
+	if ($globalsbs == 'sbs') $settings = array_merge($settings, array('globalSBS1' => 'TRUE'));
1186
+	else $settings = array_merge($settings, array('globalSBS1' => 'FALSE'));
1187
+	if ($globalaprs == 'aprs') $settings = array_merge($settings, array('globalAPRS' => 'TRUE'));
1188
+	else $settings = array_merge($settings, array('globalAPRS' => 'FALSE'));
1189 1189
 	$va = false;
1190 1190
 	if ($globalivao == 'ivao') {
1191
-		$settings = array_merge($settings,array('globalIVAO' => 'TRUE'));
1191
+		$settings = array_merge($settings, array('globalIVAO' => 'TRUE'));
1192 1192
 		$va = true;
1193
-	} else $settings = array_merge($settings,array('globalIVAO' => 'FALSE'));
1193
+	} else $settings = array_merge($settings, array('globalIVAO' => 'FALSE'));
1194 1194
 	if ($globalvatsim == 'vatsim') {
1195
-		$settings = array_merge($settings,array('globalVATSIM' => 'TRUE'));
1195
+		$settings = array_merge($settings, array('globalVATSIM' => 'TRUE'));
1196 1196
 		$va = true;
1197
-	} else $settings = array_merge($settings,array('globalVATSIM' => 'FALSE'));
1197
+	} else $settings = array_merge($settings, array('globalVATSIM' => 'FALSE'));
1198 1198
 	if ($globalphpvms == 'phpvms') {
1199
-		$settings = array_merge($settings,array('globalphpVMS' => 'TRUE'));
1199
+		$settings = array_merge($settings, array('globalphpVMS' => 'TRUE'));
1200 1200
 		$va = true;
1201
-	} else $settings = array_merge($settings,array('globalphpVMS' => 'FALSE'));
1201
+	} else $settings = array_merge($settings, array('globalphpVMS' => 'FALSE'));
1202 1202
 	if ($globalvam == 'vam') {
1203
-		$settings = array_merge($settings,array('globalVAM' => 'TRUE'));
1203
+		$settings = array_merge($settings, array('globalVAM' => 'TRUE'));
1204 1204
 		$va = true;
1205
-	} else $settings = array_merge($settings,array('globalVAM' => 'FALSE'));
1205
+	} else $settings = array_merge($settings, array('globalVAM' => 'FALSE'));
1206 1206
 	if ($va) {
1207
-		$settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE','globalTranslationFetch' => 'FALSE'));
1208
-	} else $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE'));
1207
+		$settings = array_merge($settings, array('globalSchedulesFetch' => 'FALSE', 'globalTranslationFetch' => 'FALSE'));
1208
+	} else $settings = array_merge($settings, array('globalSchedulesFetch' => 'TRUE', 'globalTranslationFetch' => 'TRUE'));
1209 1209
 	if ($globalva == 'va' || $va) {
1210
-		$settings = array_merge($settings,array('globalVA' => 'TRUE'));
1211
-		$settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE'));
1210
+		$settings = array_merge($settings, array('globalVA' => 'TRUE'));
1211
+		$settings = array_merge($settings, array('globalUsePilot' => 'TRUE', 'globalUseOwner' => 'FALSE'));
1212 1212
 	} else {
1213
-		$settings = array_merge($settings,array('globalVA' => 'FALSE'));
1214
-		if ($forcepilots) $settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE'));
1215
-		else $settings = array_merge($settings,array('globalUsePilot' => 'FALSE','globalUseOwner' => 'TRUE'));
1213
+		$settings = array_merge($settings, array('globalVA' => 'FALSE'));
1214
+		if ($forcepilots) $settings = array_merge($settings, array('globalUsePilot' => 'TRUE', 'globalUseOwner' => 'FALSE'));
1215
+		else $settings = array_merge($settings, array('globalUsePilot' => 'FALSE', 'globalUseOwner' => 'TRUE'));
1216 1216
 	}
1217 1217
 	
1218 1218
 	
1219 1219
 
1220
-	$notam = filter_input(INPUT_POST,'notam',FILTER_SANITIZE_STRING);
1220
+	$notam = filter_input(INPUT_POST, 'notam', FILTER_SANITIZE_STRING);
1221 1221
 	if ($notam == 'notam') {
1222
-		$settings = array_merge($settings,array('globalNOTAM' => 'TRUE'));
1222
+		$settings = array_merge($settings, array('globalNOTAM' => 'TRUE'));
1223 1223
 	} else {
1224
-		$settings = array_merge($settings,array('globalNOTAM' => 'FALSE'));
1224
+		$settings = array_merge($settings, array('globalNOTAM' => 'FALSE'));
1225 1225
 	}
1226
-	$owner = filter_input(INPUT_POST,'owner',FILTER_SANITIZE_STRING);
1226
+	$owner = filter_input(INPUT_POST, 'owner', FILTER_SANITIZE_STRING);
1227 1227
 	if ($owner == 'owner') {
1228
-		$settings = array_merge($settings,array('globalOwner' => 'TRUE'));
1228
+		$settings = array_merge($settings, array('globalOwner' => 'TRUE'));
1229 1229
 	} else {
1230
-		$settings = array_merge($settings,array('globalOwner' => 'FALSE'));
1230
+		$settings = array_merge($settings, array('globalOwner' => 'FALSE'));
1231 1231
 	}
1232
-	$map3d = filter_input(INPUT_POST,'map3d',FILTER_SANITIZE_STRING);
1232
+	$map3d = filter_input(INPUT_POST, 'map3d', FILTER_SANITIZE_STRING);
1233 1233
 	if ($map3d == 'map3d') {
1234
-		$settings = array_merge($settings,array('globalMap3D' => 'TRUE'));
1234
+		$settings = array_merge($settings, array('globalMap3D' => 'TRUE'));
1235 1235
 	} else {
1236
-		$settings = array_merge($settings,array('globalMap3D' => 'FALSE'));
1236
+		$settings = array_merge($settings, array('globalMap3D' => 'FALSE'));
1237 1237
 	}
1238
-	$crash = filter_input(INPUT_POST,'crash',FILTER_SANITIZE_STRING);
1238
+	$crash = filter_input(INPUT_POST, 'crash', FILTER_SANITIZE_STRING);
1239 1239
 	if ($crash == 'crash') {
1240
-		$settings = array_merge($settings,array('globalAccidents' => 'TRUE'));
1240
+		$settings = array_merge($settings, array('globalAccidents' => 'TRUE'));
1241 1241
 	} else {
1242
-		$settings = array_merge($settings,array('globalAccidents' => 'FALSE'));
1242
+		$settings = array_merge($settings, array('globalAccidents' => 'FALSE'));
1243 1243
 	}
1244
-	$mapsatellites = filter_input(INPUT_POST,'mapsatellites',FILTER_SANITIZE_STRING);
1244
+	$mapsatellites = filter_input(INPUT_POST, 'mapsatellites', FILTER_SANITIZE_STRING);
1245 1245
 	if ($mapsatellites == 'mapsatellites') {
1246
-		$settings = array_merge($settings,array('globalMapSatellites' => 'TRUE'));
1246
+		$settings = array_merge($settings, array('globalMapSatellites' => 'TRUE'));
1247 1247
 	} else {
1248
-		$settings = array_merge($settings,array('globalMapSatellites' => 'FALSE'));
1248
+		$settings = array_merge($settings, array('globalMapSatellites' => 'FALSE'));
1249 1249
 	}
1250
-	$map3ddefault = filter_input(INPUT_POST,'map3ddefault',FILTER_SANITIZE_STRING);
1250
+	$map3ddefault = filter_input(INPUT_POST, 'map3ddefault', FILTER_SANITIZE_STRING);
1251 1251
 	if ($map3ddefault == 'map3ddefault') {
1252
-		$settings = array_merge($settings,array('globalMap3Ddefault' => 'TRUE'));
1252
+		$settings = array_merge($settings, array('globalMap3Ddefault' => 'TRUE'));
1253 1253
 	} else {
1254
-		$settings = array_merge($settings,array('globalMap3Ddefault' => 'FALSE'));
1254
+		$settings = array_merge($settings, array('globalMap3Ddefault' => 'FALSE'));
1255 1255
 	}
1256
-	$translate = filter_input(INPUT_POST,'translate',FILTER_SANITIZE_STRING);
1256
+	$translate = filter_input(INPUT_POST, 'translate', FILTER_SANITIZE_STRING);
1257 1257
 	if ($translate == 'translate') {
1258
-		$settings = array_merge($settings,array('globalTranslate' => 'TRUE'));
1258
+		$settings = array_merge($settings, array('globalTranslate' => 'TRUE'));
1259 1259
 	} else {
1260
-		$settings = array_merge($settings,array('globalTranslate' => 'FALSE'));
1260
+		$settings = array_merge($settings, array('globalTranslate' => 'FALSE'));
1261 1261
 	}
1262
-	$realairlines = filter_input(INPUT_POST,'realairlines',FILTER_SANITIZE_STRING);
1262
+	$realairlines = filter_input(INPUT_POST, 'realairlines', FILTER_SANITIZE_STRING);
1263 1263
 	if ($realairlines == 'realairlines') {
1264
-		$settings = array_merge($settings,array('globalUseRealAirlines' => 'TRUE'));
1264
+		$settings = array_merge($settings, array('globalUseRealAirlines' => 'TRUE'));
1265 1265
 	} else {
1266
-		$settings = array_merge($settings,array('globalUseRealAirlines' => 'FALSE'));
1266
+		$settings = array_merge($settings, array('globalUseRealAirlines' => 'FALSE'));
1267 1267
 	}
1268
-	$estimation = filter_input(INPUT_POST,'estimation',FILTER_SANITIZE_STRING);
1268
+	$estimation = filter_input(INPUT_POST, 'estimation', FILTER_SANITIZE_STRING);
1269 1269
 	if ($estimation == 'estimation') {
1270
-		$settings = array_merge($settings,array('globalMapEstimation' => 'TRUE'));
1270
+		$settings = array_merge($settings, array('globalMapEstimation' => 'TRUE'));
1271 1271
 	} else {
1272
-		$settings = array_merge($settings,array('globalMapEstimation' => 'FALSE'));
1272
+		$settings = array_merge($settings, array('globalMapEstimation' => 'FALSE'));
1273 1273
 	}
1274
-	$metar = filter_input(INPUT_POST,'metar',FILTER_SANITIZE_STRING);
1274
+	$metar = filter_input(INPUT_POST, 'metar', FILTER_SANITIZE_STRING);
1275 1275
 	if ($metar == 'metar') {
1276
-		$settings = array_merge($settings,array('globalMETAR' => 'TRUE'));
1276
+		$settings = array_merge($settings, array('globalMETAR' => 'TRUE'));
1277 1277
 	} else {
1278
-		$settings = array_merge($settings,array('globalMETAR' => 'FALSE'));
1278
+		$settings = array_merge($settings, array('globalMETAR' => 'FALSE'));
1279 1279
 	}
1280
-	$metarcycle = filter_input(INPUT_POST,'metarcycle',FILTER_SANITIZE_STRING);
1280
+	$metarcycle = filter_input(INPUT_POST, 'metarcycle', FILTER_SANITIZE_STRING);
1281 1281
 	if ($metarcycle == 'metarcycle') {
1282
-		$settings = array_merge($settings,array('globalMETARcycle' => 'TRUE'));
1282
+		$settings = array_merge($settings, array('globalMETARcycle' => 'TRUE'));
1283 1283
 	} else {
1284
-		$settings = array_merge($settings,array('globalMETARcycle' => 'FALSE'));
1284
+		$settings = array_merge($settings, array('globalMETARcycle' => 'FALSE'));
1285 1285
 	}
1286
-	$fork = filter_input(INPUT_POST,'fork',FILTER_SANITIZE_STRING);
1286
+	$fork = filter_input(INPUT_POST, 'fork', FILTER_SANITIZE_STRING);
1287 1287
 	if ($fork == 'fork') {
1288
-		$settings = array_merge($settings,array('globalFork' => 'TRUE'));
1288
+		$settings = array_merge($settings, array('globalFork' => 'TRUE'));
1289 1289
 	} else {
1290
-		$settings = array_merge($settings,array('globalFork' => 'FALSE'));
1290
+		$settings = array_merge($settings, array('globalFork' => 'FALSE'));
1291 1291
 	}
1292 1292
 
1293
-	$colormap = filter_input(INPUT_POST,'colormap',FILTER_SANITIZE_STRING);
1293
+	$colormap = filter_input(INPUT_POST, 'colormap', FILTER_SANITIZE_STRING);
1294 1294
 	if ($colormap == 'colormap') {
1295
-		$settings = array_merge($settings,array('globalMapAltitudeColor' => 'TRUE'));
1295
+		$settings = array_merge($settings, array('globalMapAltitudeColor' => 'TRUE'));
1296 1296
 	} else {
1297
-		$settings = array_merge($settings,array('globalMapAltitudeColor' => 'FALSE'));
1297
+		$settings = array_merge($settings, array('globalMapAltitudeColor' => 'FALSE'));
1298 1298
 	}
1299 1299
 	
1300 1300
 	if (isset($_POST['aircrafticoncolor'])) {
1301
-		$aircrafticoncolor = filter_input(INPUT_POST,'aircrafticoncolor',FILTER_SANITIZE_STRING);
1302
-		$settings = array_merge($settings,array('globalAircraftIconColor' => substr($aircrafticoncolor,1)));
1301
+		$aircrafticoncolor = filter_input(INPUT_POST, 'aircrafticoncolor', FILTER_SANITIZE_STRING);
1302
+		$settings = array_merge($settings, array('globalAircraftIconColor' => substr($aircrafticoncolor, 1)));
1303 1303
 	}
1304 1304
 
1305
-	$airportzoom = filter_input(INPUT_POST,'airportzoom',FILTER_SANITIZE_NUMBER_INT);
1306
-	$settings = array_merge($settings,array('globalAirportZoom' => $airportzoom));
1305
+	$airportzoom = filter_input(INPUT_POST, 'airportzoom', FILTER_SANITIZE_NUMBER_INT);
1306
+	$settings = array_merge($settings, array('globalAirportZoom' => $airportzoom));
1307 1307
 
1308
-	$unitdistance = filter_input(INPUT_POST,'unitdistance',FILTER_SANITIZE_STRING);
1309
-	$settings = array_merge($settings,array('globalUnitDistance' => $unitdistance));
1310
-	$unitaltitude = filter_input(INPUT_POST,'unitaltitude',FILTER_SANITIZE_STRING);
1311
-	$settings = array_merge($settings,array('globalUnitAltitude' => $unitaltitude));
1312
-	$unitspeed = filter_input(INPUT_POST,'unitspeed',FILTER_SANITIZE_STRING);
1313
-	$settings = array_merge($settings,array('globalUnitSpeed' => $unitspeed));
1308
+	$unitdistance = filter_input(INPUT_POST, 'unitdistance', FILTER_SANITIZE_STRING);
1309
+	$settings = array_merge($settings, array('globalUnitDistance' => $unitdistance));
1310
+	$unitaltitude = filter_input(INPUT_POST, 'unitaltitude', FILTER_SANITIZE_STRING);
1311
+	$settings = array_merge($settings, array('globalUnitAltitude' => $unitaltitude));
1312
+	$unitspeed = filter_input(INPUT_POST, 'unitspeed', FILTER_SANITIZE_STRING);
1313
+	$settings = array_merge($settings, array('globalUnitSpeed' => $unitspeed));
1314 1314
 
1315
-	$mappopup = filter_input(INPUT_POST,'mappopup',FILTER_SANITIZE_STRING);
1315
+	$mappopup = filter_input(INPUT_POST, 'mappopup', FILTER_SANITIZE_STRING);
1316 1316
 	if ($mappopup == 'mappopup') {
1317
-		$settings = array_merge($settings,array('globalMapPopup' => 'TRUE'));
1317
+		$settings = array_merge($settings, array('globalMapPopup' => 'TRUE'));
1318 1318
 	} else {
1319
-		$settings = array_merge($settings,array('globalMapPopup' => 'FALSE'));
1319
+		$settings = array_merge($settings, array('globalMapPopup' => 'FALSE'));
1320 1320
 	}
1321
-	$airportpopup = filter_input(INPUT_POST,'airportpopup',FILTER_SANITIZE_STRING);
1321
+	$airportpopup = filter_input(INPUT_POST, 'airportpopup', FILTER_SANITIZE_STRING);
1322 1322
 	if ($airportpopup == 'airportpopup') {
1323
-		$settings = array_merge($settings,array('globalAirportPopup' => 'TRUE'));
1323
+		$settings = array_merge($settings, array('globalAirportPopup' => 'TRUE'));
1324 1324
 	} else {
1325
-		$settings = array_merge($settings,array('globalAirportPopup' => 'FALSE'));
1325
+		$settings = array_merge($settings, array('globalAirportPopup' => 'FALSE'));
1326 1326
 	}
1327
-	$maphistory = filter_input(INPUT_POST,'maphistory',FILTER_SANITIZE_STRING);
1327
+	$maphistory = filter_input(INPUT_POST, 'maphistory', FILTER_SANITIZE_STRING);
1328 1328
 	if ($maphistory == 'maphistory') {
1329
-		$settings = array_merge($settings,array('globalMapHistory' => 'TRUE'));
1329
+		$settings = array_merge($settings, array('globalMapHistory' => 'TRUE'));
1330 1330
 	} else {
1331
-		$settings = array_merge($settings,array('globalMapHistory' => 'FALSE'));
1331
+		$settings = array_merge($settings, array('globalMapHistory' => 'FALSE'));
1332 1332
 	}
1333
-	$maptooltip = filter_input(INPUT_POST,'maptooltip',FILTER_SANITIZE_STRING);
1333
+	$maptooltip = filter_input(INPUT_POST, 'maptooltip', FILTER_SANITIZE_STRING);
1334 1334
 	if ($maptooltip == 'maptooltip') {
1335
-		$settings = array_merge($settings,array('globalMapTooltip' => 'TRUE'));
1335
+		$settings = array_merge($settings, array('globalMapTooltip' => 'TRUE'));
1336 1336
 	} else {
1337
-		$settings = array_merge($settings,array('globalMapTooltip' => 'FALSE'));
1337
+		$settings = array_merge($settings, array('globalMapTooltip' => 'FALSE'));
1338 1338
 	}
1339
-	$flightroute = filter_input(INPUT_POST,'flightroute',FILTER_SANITIZE_STRING);
1339
+	$flightroute = filter_input(INPUT_POST, 'flightroute', FILTER_SANITIZE_STRING);
1340 1340
 	if ($flightroute == 'flightroute') {
1341
-		$settings = array_merge($settings,array('globalMapRoute' => 'TRUE'));
1341
+		$settings = array_merge($settings, array('globalMapRoute' => 'TRUE'));
1342 1342
 	} else {
1343
-		$settings = array_merge($settings,array('globalMapRoute' => 'FALSE'));
1343
+		$settings = array_merge($settings, array('globalMapRoute' => 'FALSE'));
1344 1344
 	}
1345
-	$flightremainingroute = filter_input(INPUT_POST,'flightremainingroute',FILTER_SANITIZE_STRING);
1345
+	$flightremainingroute = filter_input(INPUT_POST, 'flightremainingroute', FILTER_SANITIZE_STRING);
1346 1346
 	if ($flightremainingroute == 'flightremainingroute') {
1347
-		$settings = array_merge($settings,array('globalMapRemainingRoute' => 'TRUE'));
1347
+		$settings = array_merge($settings, array('globalMapRemainingRoute' => 'TRUE'));
1348 1348
 	} else {
1349
-		$settings = array_merge($settings,array('globalMapRemainingRoute' => 'FALSE'));
1349
+		$settings = array_merge($settings, array('globalMapRemainingRoute' => 'FALSE'));
1350 1350
 	}
1351
-	$allflights = filter_input(INPUT_POST,'allflights',FILTER_SANITIZE_STRING);
1351
+	$allflights = filter_input(INPUT_POST, 'allflights', FILTER_SANITIZE_STRING);
1352 1352
 	if ($allflights == 'allflights') {
1353
-		$settings = array_merge($settings,array('globalAllFlights' => 'TRUE'));
1353
+		$settings = array_merge($settings, array('globalAllFlights' => 'TRUE'));
1354 1354
 	} else {
1355
-		$settings = array_merge($settings,array('globalAllFlights' => 'FALSE'));
1355
+		$settings = array_merge($settings, array('globalAllFlights' => 'FALSE'));
1356 1356
 	}
1357
-	$bbox = filter_input(INPUT_POST,'bbox',FILTER_SANITIZE_STRING);
1357
+	$bbox = filter_input(INPUT_POST, 'bbox', FILTER_SANITIZE_STRING);
1358 1358
 	if ($bbox == 'bbox') {
1359
-		$settings = array_merge($settings,array('globalMapUseBbox' => 'TRUE'));
1359
+		$settings = array_merge($settings, array('globalMapUseBbox' => 'TRUE'));
1360 1360
 	} else {
1361
-		$settings = array_merge($settings,array('globalMapUseBbox' => 'FALSE'));
1361
+		$settings = array_merge($settings, array('globalMapUseBbox' => 'FALSE'));
1362 1362
 	}
1363
-	$groundaltitude = filter_input(INPUT_POST,'groundaltitude',FILTER_SANITIZE_STRING);
1363
+	$groundaltitude = filter_input(INPUT_POST, 'groundaltitude', FILTER_SANITIZE_STRING);
1364 1364
 	if ($groundaltitude == 'groundaltitude') {
1365
-		$settings = array_merge($settings,array('globalGroundAltitude' => 'TRUE'));
1365
+		$settings = array_merge($settings, array('globalGroundAltitude' => 'TRUE'));
1366 1366
 	} else {
1367
-		$settings = array_merge($settings,array('globalGroundAltitude' => 'FALSE'));
1367
+		$settings = array_merge($settings, array('globalGroundAltitude' => 'FALSE'));
1368 1368
 	}
1369
-	$waypoints = filter_input(INPUT_POST,'waypoints',FILTER_SANITIZE_STRING);
1369
+	$waypoints = filter_input(INPUT_POST, 'waypoints', FILTER_SANITIZE_STRING);
1370 1370
 	if ($waypoints == 'waypoints') {
1371
-		$settings = array_merge($settings,array('globalWaypoints' => 'TRUE'));
1371
+		$settings = array_merge($settings, array('globalWaypoints' => 'TRUE'));
1372 1372
 	} else {
1373
-		$settings = array_merge($settings,array('globalWaypoints' => 'FALSE'));
1373
+		$settings = array_merge($settings, array('globalWaypoints' => 'FALSE'));
1374 1374
 	}
1375
-	$geoid = filter_input(INPUT_POST,'geoid',FILTER_SANITIZE_STRING);
1375
+	$geoid = filter_input(INPUT_POST, 'geoid', FILTER_SANITIZE_STRING);
1376 1376
 	if ($geoid == 'geoid') {
1377
-		$settings = array_merge($settings,array('globalGeoid' => 'TRUE'));
1377
+		$settings = array_merge($settings, array('globalGeoid' => 'TRUE'));
1378 1378
 	} else {
1379
-		$settings = array_merge($settings,array('globalGeoid' => 'FALSE'));
1379
+		$settings = array_merge($settings, array('globalGeoid' => 'FALSE'));
1380 1380
 	}
1381
-	$geoid_source = filter_input(INPUT_POST,'geoid_source',FILTER_SANITIZE_STRING);
1382
-	$settings = array_merge($settings,array('globalGeoidSource' => $geoid_source));
1381
+	$geoid_source = filter_input(INPUT_POST, 'geoid_source', FILTER_SANITIZE_STRING);
1382
+	$settings = array_merge($settings, array('globalGeoidSource' => $geoid_source));
1383 1383
 
1384
-	$noairlines = filter_input(INPUT_POST,'noairlines',FILTER_SANITIZE_STRING);
1384
+	$noairlines = filter_input(INPUT_POST, 'noairlines', FILTER_SANITIZE_STRING);
1385 1385
 	if ($noairlines == 'noairlines') {
1386
-		$settings = array_merge($settings,array('globalNoAirlines' => 'TRUE'));
1386
+		$settings = array_merge($settings, array('globalNoAirlines' => 'TRUE'));
1387 1387
 	} else {
1388
-		$settings = array_merge($settings,array('globalNoAirlines' => 'FALSE'));
1388
+		$settings = array_merge($settings, array('globalNoAirlines' => 'FALSE'));
1389 1389
 	}
1390 1390
 
1391
-	if (!isset($globalTransaction)) $settings = array_merge($settings,array('globalTransaction' => 'TRUE'));
1391
+	if (!isset($globalTransaction)) $settings = array_merge($settings, array('globalTransaction' => 'TRUE'));
1392 1392
 
1393 1393
 	// Set some defaults values...
1394 1394
 	if (!isset($globalAircraftImageSources)) {
1395
-	    $globalAircraftImageSources = array('ivaomtl','wikimedia','airportdata','deviantart','flickr','bing','jetphotos','planepictures','planespotters');
1396
-	    $settings = array_merge($settings,array('globalAircraftImageSources' => $globalAircraftImageSources));
1395
+	    $globalAircraftImageSources = array('ivaomtl', 'wikimedia', 'airportdata', 'deviantart', 'flickr', 'bing', 'jetphotos', 'planepictures', 'planespotters');
1396
+	    $settings = array_merge($settings, array('globalAircraftImageSources' => $globalAircraftImageSources));
1397 1397
 	}
1398 1398
 
1399 1399
 	if (!isset($globalSchedulesSources)) {
1400
-	    $globalSchedulesSources = array('flightmapper','costtotravel','flightradar24','flightaware');
1401
-    	    $settings = array_merge($settings,array('globalSchedulesSources' => $globalSchedulesSources));
1400
+	    $globalSchedulesSources = array('flightmapper', 'costtotravel', 'flightradar24', 'flightaware');
1401
+    	    $settings = array_merge($settings, array('globalSchedulesSources' => $globalSchedulesSources));
1402 1402
     	}
1403 1403
 
1404
-	$settings = array_merge($settings,array('globalInstalled' => 'TRUE'));
1404
+	$settings = array_merge($settings, array('globalInstalled' => 'TRUE'));
1405 1405
 
1406 1406
 	if ($error == '') settings::modify_settings($settings);
1407 1407
 	if ($error == '') settings::comment_settings($settings_comment);
Please login to merge, or discard this patch.
Braces   +501 added lines, -134 removed lines patch added patch discarded remove patch
@@ -131,45 +131,72 @@  discard block
 block discarded – undo
131 131
 			</div>
132 132
 			<p>
133 133
 				<label for="dbhost">Database hostname</label>
134
-				<input type="text" name="dbhost" id="dbhost" value="<?php if (isset($globalDBhost)) print $globalDBhost; ?>" />
134
+				<input type="text" name="dbhost" id="dbhost" value="<?php if (isset($globalDBhost)) {
135
+	print $globalDBhost;
136
+}
137
+?>" />
135 138
 			</p>
136 139
 			<p>
137 140
 				<label for="dbport">Database port</label>
138
-				<input type="text" name="dbport" id="dbport" value="<?php if (isset($globalDBport)) print $globalDBport; ?>" />
141
+				<input type="text" name="dbport" id="dbport" value="<?php if (isset($globalDBport)) {
142
+	print $globalDBport;
143
+}
144
+?>" />
139 145
 				<p class="help-block">Default is 3306 for MariaDB/MySQL, 5432 for PostgreSQL</p>
140 146
 			</p>
141 147
 			<p>
142 148
 				<label for="dbname">Database name</label>
143
-				<input type="text" name="dbname" id="dbname" value="<?php if (isset($globalDBname)) print $globalDBname; ?>" />
149
+				<input type="text" name="dbname" id="dbname" value="<?php if (isset($globalDBname)) {
150
+	print $globalDBname;
151
+}
152
+?>" />
144 153
 			</p>
145 154
 			<p>
146 155
 				<label for="dbuser">Database user</label>
147
-				<input type="text" name="dbuser" id="dbuser" value="<?php if (isset($globalDBuser)) print $globalDBuser; ?>" />
156
+				<input type="text" name="dbuser" id="dbuser" value="<?php if (isset($globalDBuser)) {
157
+	print $globalDBuser;
158
+}
159
+?>" />
148 160
 			</p>
149 161
 			<p>
150 162
 				<label for="dbuserpass">Database user password</label>
151
-				<input type="password" name="dbuserpass" id="dbuserpass" value="<?php if (isset($globalDBpass)) print $globalDBpass; ?>" />
163
+				<input type="password" name="dbuserpass" id="dbuserpass" value="<?php if (isset($globalDBpass)) {
164
+	print $globalDBpass;
165
+}
166
+?>" />
152 167
 			</p>
153 168
 		</fieldset>
154 169
 		<fieldset id="site">
155 170
 			<legend>Site configuration</legend>
156 171
 			<p>
157 172
 				<label for="sitename">Site name</label>
158
-				<input type="text" name="sitename" id="sitename" value="<?php if (isset($globalName)) print $globalName; ?>" />
173
+				<input type="text" name="sitename" id="sitename" value="<?php if (isset($globalName)) {
174
+	print $globalName;
175
+}
176
+?>" />
159 177
 			</p>
160 178
 			<p>
161 179
 				<label for="siteurl">Site directory</label>
162
-				<input type="text" name="siteurl" id="siteurl" value="<?php if (isset($globalURL)) print $globalURL; ?>" />
180
+				<input type="text" name="siteurl" id="siteurl" value="<?php if (isset($globalURL)) {
181
+	print $globalURL;
182
+}
183
+?>" />
163 184
 				<p class="help-block">Can be null. ex : <i>flightairmap</i> if complete URL is <i>http://toto.com/flightairmap</i></p>
164 185
 			</p>
165 186
 			<p>
166 187
 				<label for="timezone">Timezone</label>
167
-				<input type="text" name="timezone" id="timezone" value="<?php if (isset($globalTimezone)) print $globalTimezone; ?>" />
188
+				<input type="text" name="timezone" id="timezone" value="<?php if (isset($globalTimezone)) {
189
+	print $globalTimezone;
190
+}
191
+?>" />
168 192
 				<p class="help-block">ex : UTC, Europe/Paris,...</p>
169 193
 			</p>
170 194
 			<p>
171 195
 				<label for="language">Language</label>
172
-				<input type="text" name="language" id="language" value="<?php if (isset($globalLanguage)) print $globalLanguage; ?>" />
196
+				<input type="text" name="language" id="language" value="<?php if (isset($globalLanguage)) {
197
+	print $globalLanguage;
198
+}
199
+?>" />
173 200
 				<p class="help-block">Used only when link to wikipedia for now. Can be EN,DE,FR,...</p>
174 201
 			</p>
175 202
 		</fieldset>
@@ -190,11 +217,17 @@  discard block
 block discarded – undo
190 217
 			<div id="mapbox_data">
191 218
 				<p>
192 219
 					<label for="mapboxid">Mapbox id</label>
193
-					<input type="text" name="mapboxid" id="mapboxid" value="<?php if (isset($globalMapboxId)) print $globalMapboxId; ?>" />
220
+					<input type="text" name="mapboxid" id="mapboxid" value="<?php if (isset($globalMapboxId)) {
221
+	print $globalMapboxId;
222
+}
223
+?>" />
194 224
 				</p>
195 225
 				<p>
196 226
 					<label for="mapboxtoken">Mapbox token</label>
197
-					<input type="text" name="mapboxtoken" id="mapboxtoken" value="<?php if (isset($globalMapboxToken)) print $globalMapboxToken; ?>" />
227
+					<input type="text" name="mapboxtoken" id="mapboxtoken" value="<?php if (isset($globalMapboxToken)) {
228
+	print $globalMapboxToken;
229
+}
230
+?>" />
198 231
 				</p>
199 232
 				<p class="help-block">Get a key <a href="https://www.mapbox.com/developers/">here</a></p>
200 233
 			</div>
@@ -202,7 +235,10 @@  discard block
 block discarded – undo
202 235
 			<div id="google_data">
203 236
 				<p>
204 237
 					<label for="googlekey">Google API key</label>
205
-					<input type="text" name="googlekey" id="googlekey" value="<?php if (isset($globalGoogleAPIKey)) print $globalGoogleAPIKey; ?>" />
238
+					<input type="text" name="googlekey" id="googlekey" value="<?php if (isset($globalGoogleAPIKey)) {
239
+	print $globalGoogleAPIKey;
240
+}
241
+?>" />
206 242
 					<p class="help-block">Get a key <a href="https://developers.google.com/maps/documentation/javascript/get-api-key#get-an-api-key">here</a></p>
207 243
 				</p>
208 244
 			</div>
@@ -210,7 +246,10 @@  discard block
 block discarded – undo
210 246
 			<div id="bing_data">
211 247
 				<p>
212 248
 					<label for="bingkey">Bing Map key</label>
213
-					<input type="text" name="bingkey" id="bingkey" value="<?php if (isset($globalBingMapKey)) print $globalBingMapKey; ?>" />
249
+					<input type="text" name="bingkey" id="bingkey" value="<?php if (isset($globalBingMapKey)) {
250
+	print $globalBingMapKey;
251
+}
252
+?>" />
214 253
 					<p class="help-block">Get a key <a href="https://www.bingmapsportal.com/">here</a></p>
215 254
 				</p>
216 255
 			</div>
@@ -218,7 +257,10 @@  discard block
 block discarded – undo
218 257
 			<div id="mapquest_data">
219 258
 				<p>
220 259
 					<label for="mapquestkey">MapQuest key</label>
221
-					<input type="text" name="mapquestkey" id="mapquestkey" value="<?php if (isset($globalMapQuestKey)) print $globalMapQuestKey; ?>" />
260
+					<input type="text" name="mapquestkey" id="mapquestkey" value="<?php if (isset($globalMapQuestKey)) {
261
+	print $globalMapQuestKey;
262
+}
263
+?>" />
222 264
 					<p class="help-block">Get a key <a href="https://developer.mapquest.com/user/me/apps">here</a></p>
223 265
 				</p>
224 266
 			</div>
@@ -226,11 +268,17 @@  discard block
 block discarded – undo
226 268
 			<div id="here_data">
227 269
 				<p>
228 270
 					<label for="hereappid">Here App_Id</label>
229
-					<input type="text" name="hereappid" id="hereappid" value="<?php if (isset($globalHereappId)) print $globalHereappId; ?>" />
271
+					<input type="text" name="hereappid" id="hereappid" value="<?php if (isset($globalHereappId)) {
272
+	print $globalHereappId;
273
+}
274
+?>" />
230 275
 				</p>
231 276
 				<p>
232 277
 					<label for="hereappcode">Here App_Code</label>
233
-					<input type="text" name="hereappcode" id="hereappcode" value="<?php if (isset($globalHereappCode)) print $globalHereappCode; ?>" />
278
+					<input type="text" name="hereappcode" id="hereappcode" value="<?php if (isset($globalHereappCode)) {
279
+	print $globalHereappCode;
280
+}
281
+?>" />
234 282
 				</p>
235 283
 				<p class="help-block">Get a key <a href="https://developer.here.com/rest-apis/documentation/enterprise-map-tile/topics/quick-start.html">here</a></p>
236 284
 			</div>
@@ -238,7 +286,10 @@  discard block
 block discarded – undo
238 286
 			<div id="openweathermap_data">
239 287
 				<p>
240 288
 					<label for="openweathermapkey">OpenWeatherMap key (weather layer)</label>
241
-					<input type="text" name="openweathermapkey" id="openweathermapkey" value="<?php if (isset($globalOpenWeatherMapKey)) print $globalOpenWeatherMapKey; ?>" />
289
+					<input type="text" name="openweathermapkey" id="openweathermapkey" value="<?php if (isset($globalOpenWeatherMapKey)) {
290
+	print $globalOpenWeatherMapKey;
291
+}
292
+?>" />
242 293
 					<p class="help-block">Get a key <a href="https://openweathermap.org/">here</a></p>
243 294
 				</p>
244 295
 			</div>
@@ -248,42 +299,86 @@  discard block
 block discarded – undo
248 299
 			<legend>Coverage area</legend>
249 300
 			<p>
250 301
 				<label for="latitudemax">The maximum latitude (north)</label>
251
-				<input type="text" name="latitudemax" id="latitudemax" value="<?php if (isset($globalLatitudeMax)) print $globalLatitudeMax; ?>" />
302
+				<input type="text" name="latitudemax" id="latitudemax" value="<?php if (isset($globalLatitudeMax)) {
303
+	print $globalLatitudeMax;
304
+}
305
+?>" />
252 306
 			</p>
253 307
 			<p>
254 308
 				<label for="latitudemin">The minimum latitude (south)</label>
255
-				<input type="text" name="latitudemin" id="latitudemin" value="<?php if (isset($globalLatitudeMin)) print $globalLatitudeMin; ?>" />
309
+				<input type="text" name="latitudemin" id="latitudemin" value="<?php if (isset($globalLatitudeMin)) {
310
+	print $globalLatitudeMin;
311
+}
312
+?>" />
256 313
 			</p>
257 314
 			<p>
258 315
 				<label for="longitudemax">The maximum longitude (west)</label>
259
-				<input type="text" name="longitudemax" id="longitudemax" value="<?php if (isset($globalLongitudeMax)) print $globalLongitudeMax; ?>" />
316
+				<input type="text" name="longitudemax" id="longitudemax" value="<?php if (isset($globalLongitudeMax)) {
317
+	print $globalLongitudeMax;
318
+}
319
+?>" />
260 320
 			</p>
261 321
 			<p>
262 322
 				<label for="longitudemin">The minimum longitude (east)</label>
263
-				<input type="text" name="longitudemin" id="longitudemin" value="<?php if (isset($globalLongitudeMin)) print $globalLongitudeMin; ?>" />
323
+				<input type="text" name="longitudemin" id="longitudemin" value="<?php if (isset($globalLongitudeMin)) {
324
+	print $globalLongitudeMin;
325
+}
326
+?>" />
264 327
 			</p>
265 328
 			<p>
266 329
 				<label for="latitudecenter">The latitude center</label>
267
-				<input type="text" name="latitudecenter" id="latitudecenter" value="<?php if (isset($globalCenterLatitude)) print $globalCenterLatitude; ?>" />
330
+				<input type="text" name="latitudecenter" id="latitudecenter" value="<?php if (isset($globalCenterLatitude)) {
331
+	print $globalCenterLatitude;
332
+}
333
+?>" />
268 334
 			</p>
269 335
 			<p>
270 336
 				<label for="longitudecenter">The longitude center</label>
271
-				<input type="text" name="longitudecenter" id="longitudecenter" value="<?php if (isset($globalCenterLongitude)) print $globalCenterLongitude; ?>" />
337
+				<input type="text" name="longitudecenter" id="longitudecenter" value="<?php if (isset($globalCenterLongitude)) {
338
+	print $globalCenterLongitude;
339
+}
340
+?>" />
272 341
 			</p>
273 342
 			<p>
274 343
 				<label for="livezoom">Default Zoom on live map</label>
275
-				<input type="number" name="livezoom" id="livezoom" value="<?php if (isset($globalLiveZoom)) print $globalLiveZoom; else print '9'; ?>" />
344
+				<input type="number" name="livezoom" id="livezoom" value="<?php if (isset($globalLiveZoom)) {
345
+	print $globalLiveZoom;
346
+} else {
347
+	print '9';
348
+}
349
+?>" />
276 350
 			</p>
277 351
 			<p>
278 352
 				<label for="squawk_country">Country for squawk usage</label>
279 353
 				<select name="squawk_country" id="squawk_country">
280
-					<option value="UK"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'UK') print ' selected '; ?>>UK</option>
281
-					<option value="NZ"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NZ') print ' selected '; ?>>NZ</option>
282
-					<option value="US"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'US') print ' selected '; ?>>US</option>
283
-					<option value="AU"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'AU') print ' selected '; ?>>AU</option>
284
-					<option value="NL"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NL') print ' selected '; ?>>NL</option>
285
-					<option value="FR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'FR') print ' selected '; ?>>FR</option>
286
-					<option value="TR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'TR') print ' selected '; ?>>TR</option>
354
+					<option value="UK"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'UK') {
355
+	print ' selected ';
356
+}
357
+?>>UK</option>
358
+					<option value="NZ"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NZ') {
359
+	print ' selected ';
360
+}
361
+?>>NZ</option>
362
+					<option value="US"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'US') {
363
+	print ' selected ';
364
+}
365
+?>>US</option>
366
+					<option value="AU"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'AU') {
367
+	print ' selected ';
368
+}
369
+?>>AU</option>
370
+					<option value="NL"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NL') {
371
+	print ' selected ';
372
+}
373
+?>>NL</option>
374
+					<option value="FR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'FR') {
375
+	print ' selected ';
376
+}
377
+?>>FR</option>
378
+					<option value="TR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'TR') {
379
+	print ' selected ';
380
+}
381
+?>>TR</option>
287 382
 				</select>
288 383
 			</p>
289 384
 		</fieldset>
@@ -292,15 +387,24 @@  discard block
 block discarded – undo
292 387
 			<p><i>Only put in DB flights that are inside a circle</i></p>
293 388
 			<p>
294 389
 				<label for="latitude">Center latitude</label>
295
-				<input type="text" name="zoilatitude" id="latitude" value="<?php if (isset($globalDistanceIgnore['latitude'])) echo $globalDistanceIgnore['latitude']; ?>" />
390
+				<input type="text" name="zoilatitude" id="latitude" value="<?php if (isset($globalDistanceIgnore['latitude'])) {
391
+	echo $globalDistanceIgnore['latitude'];
392
+}
393
+?>" />
296 394
 			</p>
297 395
 			<p>
298 396
 				<label for="longitude">Center longitude</label>
299
-				<input type="text" name="zoilongitude" id="longitude" value="<?php if (isset($globalDistanceIgnore['longitude'])) echo $globalDistanceIgnore['longitude']; ?>" />
397
+				<input type="text" name="zoilongitude" id="longitude" value="<?php if (isset($globalDistanceIgnore['longitude'])) {
398
+	echo $globalDistanceIgnore['longitude'];
399
+}
400
+?>" />
300 401
 			</p>
301 402
 			<p>
302 403
 				<label for="Distance">Distance (in km)</label>
303
-				<input type="text" name="zoidistance" id="distance" value="<?php if (isset($globalDistanceIgnore['distance'])) echo $globalDistanceIgnore['distance']; ?>" />
404
+				<input type="text" name="zoidistance" id="distance" value="<?php if (isset($globalDistanceIgnore['distance'])) {
405
+	echo $globalDistanceIgnore['distance'];
406
+}
407
+?>" />
304 408
 			</p>
305 409
 		</fieldset>
306 410
 		<fieldset id="sourceloc">
@@ -409,11 +513,17 @@  discard block
 block discarded – undo
409 513
 			<div id="flightaware_data">
410 514
 				<p>
411 515
 					<label for="flightawareusername">FlightAware username</label>
412
-					<input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) print $globalFlightAwareUsername; ?>" />
516
+					<input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) {
517
+	print $globalFlightAwareUsername;
518
+}
519
+?>" />
413 520
 				</p>
414 521
 				<p>
415 522
 					<label for="flightawarepassword">FlightAware password/API key</label>
416
-					<input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) print $globalFlightAwarePassword; ?>" />
523
+					<input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) {
524
+	print $globalFlightAwarePassword;
525
+}
526
+?>" />
417 527
 				</p>
418 528
 			</div>
419 529
 -->
@@ -455,7 +565,10 @@  discard block
 block discarded – undo
455 565
 								    if (filter_var($source['host'],FILTER_VALIDATE_URL)) {
456 566
 								?>
457 567
 								<td><input type="text" name="host[]" id="host" value="<?php print $source['host']; ?>" /></td>
458
-								<td><input type="text" name="port[]" class="col-xs-2" id="port" value="<?php if (isset($source['port'])) print $source['port']; ?>" /></td>
568
+								<td><input type="text" name="port[]" class="col-xs-2" id="port" value="<?php if (isset($source['port'])) {
569
+	print $source['port'];
570
+}
571
+?>" /></td>
459 572
 								<?php
460 573
 								    } else {
461 574
 									$hostport = explode(':',$source['host']);
@@ -474,33 +587,102 @@  discard block
 block discarded – undo
474 587
 								?>
475 588
 								<td>
476 589
 									<select name="format[]" id="format">
477
-										<option value="auto" <?php if (!isset($source['format'])) print 'selected'; ?>>Auto</option>
478
-										<option value="sbs" <?php if (isset($source['format']) && $source['format'] == 'sbs') print 'selected'; ?>>SBS</option>
479
-										<option value="tsv" <?php if (isset($source['format']) && $source['format'] == 'tsv') print 'selected'; ?>>TSV</option>
480
-										<option value="raw" <?php if (isset($source['format']) && $source['format'] == 'raw') print 'selected'; ?>>Raw</option>
481
-										<option value="aprs" <?php if (isset($source['format']) && $source['format'] == 'aprs') print 'selected'; ?>>APRS</option>
482
-										<option value="deltadbtxt" <?php if (isset($source['format']) && $source['format'] == 'deltadbtxt') print 'selected'; ?>>Radarcape deltadb.txt</option>
483
-										<option value="vatsimtxt" <?php if (isset($source['format']) && $source['format'] == 'vatsimtxt') print 'selected'; ?>>Vatsim</option>
484
-										<option value="aircraftlistjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftlistjson') print 'selected'; ?>>Virtual Radar Server AircraftList.json</option>
485
-										<option value="vrstcp" <?php if (isset($source['format']) && $source['format'] == 'vrstcp') print 'selected'; ?>>Virtual Radar Server TCP</option>
486
-										<option value="phpvmacars" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') print 'selected'; ?>>phpVMS</option>
487
-										<option value="vam" <?php if (isset($source['format']) && $source['format'] == 'vam') print 'selected'; ?>>Virtual Airlines Manager</option>
488
-										<option value="whazzup" <?php if (isset($source['format']) && $source['format'] == 'whazzup') print 'selected'; ?>>IVAO</option>
489
-										<option value="flightgearmp" <?php if (isset($source['format']) && $source['format'] == 'flightgearmp') print 'selected'; ?>>FlightGear Multiplayer</option>
490
-										<option value="flightgearsp" <?php if (isset($source['format']) && $source['format'] == 'flightgearsp') print 'selected'; ?>>FlightGear Singleplayer</option>
491
-										<option value="acars" <?php if (isset($source['format']) && $source['format'] == 'acars') print 'selected'; ?>>ACARS from acarsdec/acarsdeco2 over UDP</option>
492
-										<option value="acarssbs3" <?php if (isset($source['format']) && $source['format'] == 'acarssbs3') print 'selected'; ?>>ACARS SBS-3 over TCP</option>
493
-										<option value="ais" <?php if (isset($source['format']) && $source['format'] == 'ais') print 'selected'; ?>>NMEA AIS over TCP</option>
494
-										<option value="airwhere" <?php if (isset($source['format']) && $source['format'] == 'airwhere') print 'selected'; ?>>AirWhere website</option>
495
-										<option value="hidnseek_callback" <?php if (isset($source['format']) && $source['format'] == 'hidnseek_callback') print 'selected'; ?>>HidnSeek Callback</option>
496
-										<option value="blitzortung" <?php if (isset($source['format']) && $source['format'] == 'blitzortung') print 'selected'; ?>>Blitzortung</option>
590
+										<option value="auto" <?php if (!isset($source['format'])) {
591
+	print 'selected';
592
+}
593
+?>>Auto</option>
594
+										<option value="sbs" <?php if (isset($source['format']) && $source['format'] == 'sbs') {
595
+	print 'selected';
596
+}
597
+?>>SBS</option>
598
+										<option value="tsv" <?php if (isset($source['format']) && $source['format'] == 'tsv') {
599
+	print 'selected';
600
+}
601
+?>>TSV</option>
602
+										<option value="raw" <?php if (isset($source['format']) && $source['format'] == 'raw') {
603
+	print 'selected';
604
+}
605
+?>>Raw</option>
606
+										<option value="aprs" <?php if (isset($source['format']) && $source['format'] == 'aprs') {
607
+	print 'selected';
608
+}
609
+?>>APRS</option>
610
+										<option value="deltadbtxt" <?php if (isset($source['format']) && $source['format'] == 'deltadbtxt') {
611
+	print 'selected';
612
+}
613
+?>>Radarcape deltadb.txt</option>
614
+										<option value="vatsimtxt" <?php if (isset($source['format']) && $source['format'] == 'vatsimtxt') {
615
+	print 'selected';
616
+}
617
+?>>Vatsim</option>
618
+										<option value="aircraftlistjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftlistjson') {
619
+	print 'selected';
620
+}
621
+?>>Virtual Radar Server AircraftList.json</option>
622
+										<option value="vrstcp" <?php if (isset($source['format']) && $source['format'] == 'vrstcp') {
623
+	print 'selected';
624
+}
625
+?>>Virtual Radar Server TCP</option>
626
+										<option value="phpvmacars" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') {
627
+	print 'selected';
628
+}
629
+?>>phpVMS</option>
630
+										<option value="vam" <?php if (isset($source['format']) && $source['format'] == 'vam') {
631
+	print 'selected';
632
+}
633
+?>>Virtual Airlines Manager</option>
634
+										<option value="whazzup" <?php if (isset($source['format']) && $source['format'] == 'whazzup') {
635
+	print 'selected';
636
+}
637
+?>>IVAO</option>
638
+										<option value="flightgearmp" <?php if (isset($source['format']) && $source['format'] == 'flightgearmp') {
639
+	print 'selected';
640
+}
641
+?>>FlightGear Multiplayer</option>
642
+										<option value="flightgearsp" <?php if (isset($source['format']) && $source['format'] == 'flightgearsp') {
643
+	print 'selected';
644
+}
645
+?>>FlightGear Singleplayer</option>
646
+										<option value="acars" <?php if (isset($source['format']) && $source['format'] == 'acars') {
647
+	print 'selected';
648
+}
649
+?>>ACARS from acarsdec/acarsdeco2 over UDP</option>
650
+										<option value="acarssbs3" <?php if (isset($source['format']) && $source['format'] == 'acarssbs3') {
651
+	print 'selected';
652
+}
653
+?>>ACARS SBS-3 over TCP</option>
654
+										<option value="ais" <?php if (isset($source['format']) && $source['format'] == 'ais') {
655
+	print 'selected';
656
+}
657
+?>>NMEA AIS over TCP</option>
658
+										<option value="airwhere" <?php if (isset($source['format']) && $source['format'] == 'airwhere') {
659
+	print 'selected';
660
+}
661
+?>>AirWhere website</option>
662
+										<option value="hidnseek_callback" <?php if (isset($source['format']) && $source['format'] == 'hidnseek_callback') {
663
+	print 'selected';
664
+}
665
+?>>HidnSeek Callback</option>
666
+										<option value="blitzortung" <?php if (isset($source['format']) && $source['format'] == 'blitzortung') {
667
+	print 'selected';
668
+}
669
+?>>Blitzortung</option>
497 670
 									</select>
498 671
 								</td>
499 672
 								<td>
500
-									<input type="text" name="name[]" id="name" value="<?php if (isset($source['name'])) print $source['name']; ?>" />
673
+									<input type="text" name="name[]" id="name" value="<?php if (isset($source['name'])) {
674
+	print $source['name'];
675
+}
676
+?>" />
501 677
 								</td>
502
-								<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>
503
-								<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>
678
+								<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']) {
679
+	print 'checked';
680
+}
681
+?> /></td>
682
+								<td><input type="checkbox" name="noarchive[]" id="noarchive" title="Don't archive this source" value="1" <?php if (isset($source['noarchive']) && $source['noarchive']) {
683
+	print 'checked';
684
+}
685
+?> /></td>
504 686
 								<td>
505 687
 									<select name="timezones[]" id="timezones">
506 688
 								<?php
@@ -510,7 +692,9 @@  discard block
 block discarded – undo
510 692
 											print '<option selected>'.$timezones.'</option>';
511 693
 										} elseif (!isset($source['timezone']) && $timezones == 'UTC') {
512 694
 											print '<option selected>'.$timezones.'</option>';
513
-										} else print '<option>'.$timezones.'</option>';
695
+										} else {
696
+											print '<option>'.$timezones.'</option>';
697
+										}
514 698
 									}
515 699
 								?>
516 700
 									</select>
@@ -560,7 +744,9 @@  discard block
 block discarded – undo
560 744
 									foreach($timezonelist as $timezones){
561 745
 										if ($timezones == 'UTC') {
562 746
 											print '<option selected>'.$timezones.'</option>';
563
-										} else print '<option>'.$timezones.'</option>';
747
+										} else {
748
+											print '<option>'.$timezones.'</option>';
749
+										}
564 750
 									}
565 751
 								?>
566 752
 									</select>
@@ -583,11 +769,17 @@  discard block
 block discarded – undo
583 769
 					<p>Listen UDP server for acarsdec/acarsdeco2/... with <i>daemon-acars.php</i> script</p>
584 770
 					<p>
585 771
 						<label for="acarshost">ACARS UDP host</label>
586
-						<input type="text" name="acarshost" id="acarshost" value="<?php if (isset($globalACARSHost)) print $globalACARSHost; ?>" />
772
+						<input type="text" name="acarshost" id="acarshost" value="<?php if (isset($globalACARSHost)) {
773
+	print $globalACARSHost;
774
+}
775
+?>" />
587 776
 					</p>
588 777
 					<p>
589 778
 						<label for="acarsport">ACARS UDP port</label>
590
-						<input type="number" name="acarsport" id="acarsport" value="<?php if (isset($globalACARSPort)) print $globalACARSPort; ?>" />
779
+						<input type="number" name="acarsport" id="acarsport" value="<?php if (isset($globalACARSPort)) {
780
+	print $globalACARSPort;
781
+}
782
+?>" />
591 783
 					</p>
592 784
 				</fieldset>
593 785
 			</div>
@@ -667,13 +859,19 @@  discard block
 block discarded – undo
667 859
 			<div id="schedules_options">
668 860
 				<p>
669 861
 					<label for="britishairways">British Airways API Key</label>
670
-					<input type="text" name="britishairways" id="britishairways" value="<?php if (isset($globalBritishAirwaysKey)) print $globalBritishAirwaysKey; ?>" />
862
+					<input type="text" name="britishairways" id="britishairways" value="<?php if (isset($globalBritishAirwaysKey)) {
863
+	print $globalBritishAirwaysKey;
864
+}
865
+?>" />
671 866
 					<p class="help-block">Register an account on <a href="https://developer.ba.com/">https://developer.ba.com/</a></p>
672 867
 				</p>
673 868
 				<!--
674 869
 				<p>
675 870
 					<label for="transavia">Transavia Test API Consumer Key</label>
676
-					<input type="text" name="transavia" id="transavia" value="<?php if (isset($globalTransaviaKey)) print $globalTransaviaKey; ?>" />
871
+					<input type="text" name="transavia" id="transavia" value="<?php if (isset($globalTransaviaKey)) {
872
+	print $globalTransaviaKey;
873
+}
874
+?>" />
677 875
 					<p class="help-block">Register an account on <a href="https://developer.transavia.com">https://developer.transavia.com</a></p>
678 876
 				</p>
679 877
 				-->
@@ -682,10 +880,16 @@  discard block
 block discarded – undo
682 880
 						<b>Lufthansa API Key</b>
683 881
 						<p>
684 882
 							<label for="lufthansakey">Key</label>
685
-							<input type="text" name="lufthansakey" id="lufthansakey" value="<?php if (isset($globalLufthansaKey['key'])) print $globalLufthansaKey['key']; ?>" />
883
+							<input type="text" name="lufthansakey" id="lufthansakey" value="<?php if (isset($globalLufthansaKey['key'])) {
884
+	print $globalLufthansaKey['key'];
885
+}
886
+?>" />
686 887
 						</p><p>
687 888
 							<label for="lufthansasecret">Secret</label>
688
-							<input type="text" name="lufthansasecret" id="lufthansasecret" value="<?php if (isset($globalLufthansaKey['secret'])) print $globalLufthansaKey['secret']; ?>" />
889
+							<input type="text" name="lufthansasecret" id="lufthansasecret" value="<?php if (isset($globalLufthansaKey['secret'])) {
890
+	print $globalLufthansaKey['secret'];
891
+}
892
+?>" />
689 893
 						</p>
690 894
 					</div>
691 895
 					<p class="help-block">Register an account on <a href="https://developer.lufthansa.com/page">https://developer.lufthansa.com/page</a></p>
@@ -705,7 +909,10 @@  discard block
 block discarded – undo
705 909
 			</p>
706 910
 			<p>
707 911
 				<label for="notamsource">URL of your feed from notaminfo.com</label>
708
-				<input type="text" name="notamsource" id="notamsource" value="<?php if (isset($globalNOTAMSource)) print $globalNOTAMSource; ?>" />
912
+				<input type="text" name="notamsource" id="notamsource" value="<?php if (isset($globalNOTAMSource)) {
913
+	print $globalNOTAMSource;
914
+}
915
+?>" />
709 916
 				<p class="help-block">If you want to use world NOTAM from FlightAirMap website, leave it blank</p>
710 917
 			</p>
711 918
 			<br />
@@ -721,14 +928,20 @@  discard block
 block discarded – undo
721 928
 			<div id="metarsrc">
722 929
 				<p>
723 930
 					<label for="metarsource">URL of your METAR source</label>
724
-					<input type="text" name="metarsource" id="metarsource" value="<?php if (isset($globalMETARurl)) print $globalMETARurl; ?>" />
931
+					<input type="text" name="metarsource" id="metarsource" value="<?php if (isset($globalMETARurl)) {
932
+	print $globalMETARurl;
933
+}
934
+?>" />
725 935
 					<p class="help-block">Use {icao} to specify where we replace by airport icao. ex : http://metar.vatsim.net/metar.php?id={icao}</p>
726 936
 				</p>
727 937
 			</div>
728 938
 			<br />
729 939
 			<p>
730 940
 				<label for="bitly">Bit.ly access token api (used in search page)</label>
731
-				<input type="text" name="bitly" id="bitly" value="<?php if (isset($globalBitlyAccessToken)) print $globalBitlyAccessToken; ?>" />
941
+				<input type="text" name="bitly" id="bitly" value="<?php if (isset($globalBitlyAccessToken)) {
942
+	print $globalBitlyAccessToken;
943
+}
944
+?>" />
732 945
 			</p>
733 946
 			<br />
734 947
 			<p>
@@ -744,11 +957,26 @@  discard block
 block discarded – undo
744 957
 			<p>
745 958
 				<label for="geoid_source">Geoid Source</label>
746 959
 				<select name="geoid_source" id="geoid_source">
747
-					<option value="egm96-15"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-15') print ' selected="selected"'; ?>>EGM96 15' (2.1MB)</option>
748
-					<option value="egm96-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-5') print ' selected="selected"'; ?>>EGM96 5' (19MB)</option>
749
-					<option value="egm2008-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-5') print ' selected="selected"'; ?>>EGM2008 5' (19MB)</option>
750
-					<option value="egm2008-2_5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-2_5') print ' selected="selected"'; ?>>EGM2008 2.5' (75MB)</option>
751
-					<option value="egm2008-1"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-1') print ' selected="selected"'; ?>>EGM2008 1' (470MB)</option>
960
+					<option value="egm96-15"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-15') {
961
+	print ' selected="selected"';
962
+}
963
+?>>EGM96 15' (2.1MB)</option>
964
+					<option value="egm96-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-5') {
965
+	print ' selected="selected"';
966
+}
967
+?>>EGM96 5' (19MB)</option>
968
+					<option value="egm2008-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-5') {
969
+	print ' selected="selected"';
970
+}
971
+?>>EGM2008 5' (19MB)</option>
972
+					<option value="egm2008-2_5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-2_5') {
973
+	print ' selected="selected"';
974
+}
975
+?>>EGM2008 2.5' (75MB)</option>
976
+					<option value="egm2008-1"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-1') {
977
+	print ' selected="selected"';
978
+}
979
+?>>EGM2008 1' (470MB)</option>
752 980
 				</select>
753 981
 				<p class="help-block">The geoid is approximated by an "earth gravity model" (EGM).</p>
754 982
 			</p>
@@ -766,7 +994,12 @@  discard block
 block discarded – undo
766 994
 			</p>
767 995
 			<p>
768 996
 				<label for="archivemonths">Generate statistics, delete or put in archive flights older than xx months</label>
769
-				<input type="number" name="archivemonths" id="archivemonths" value="<?php if (isset($globalArchiveMonths)) print $globalArchiveMonths; else echo '1'; ?>" />
997
+				<input type="number" name="archivemonths" id="archivemonths" value="<?php if (isset($globalArchiveMonths)) {
998
+	print $globalArchiveMonths;
999
+} else {
1000
+	echo '1';
1001
+}
1002
+?>" />
770 1003
 				<p class="help-block">0 to disable, delete old flight if <i>Archive all flights data</i> is disabled</p>
771 1004
 			</p>
772 1005
 			<p>
@@ -776,12 +1009,22 @@  discard block
 block discarded – undo
776 1009
 			</p>
777 1010
 			<p>
778 1011
 				<label for="archivekeepmonths">Keep flights data for xx months in archive</label>
779
-				<input type="number" name="archivekeepmonths" id="archivekeepmonths" value="<?php if (isset($globalArchiveKeepMonths)) print $globalArchiveKeepMonths; else echo '1'; ?>" />
1012
+				<input type="number" name="archivekeepmonths" id="archivekeepmonths" value="<?php if (isset($globalArchiveKeepMonths)) {
1013
+	print $globalArchiveKeepMonths;
1014
+} else {
1015
+	echo '1';
1016
+}
1017
+?>" />
780 1018
 				<p class="help-block">0 to disable</p>
781 1019
 			</p>
782 1020
 			<p>
783 1021
 				<label for="archivekeeptrackmonths">Keep flights track data for xx months in archive</label>
784
-				<input type="number" name="archivekeeptrackmonths" id="archivekeeptrackmonths" value="<?php if (isset($globalArchiveKeepTrackMonths)) print $globalArchiveKeepTrackMonths; else echo '1'; ?>" />
1022
+				<input type="number" name="archivekeeptrackmonths" id="archivekeeptrackmonths" value="<?php if (isset($globalArchiveKeepTrackMonths)) {
1023
+	print $globalArchiveKeepTrackMonths;
1024
+} else {
1025
+	echo '1';
1026
+}
1027
+?>" />
785 1028
 				<p class="help-block">0 to disable, should be less or egal to <i>Keep flights data</i> value</p>
786 1029
 			</p>
787 1030
 			<br />
@@ -791,7 +1034,12 @@  discard block
 block discarded – undo
791 1034
 				<p class="help-block">Uncheck if the script is running as cron job</p>
792 1035
 				<div id="cronends"> 
793 1036
 					<label for="cronend">Run script for xx seconds</label>
794
-					<input type="number" name="cronend" id="cronend" value="<?php if (isset($globalCronEnd)) print $globalCronEnd; else print '0'; ?>" />
1037
+					<input type="number" name="cronend" id="cronend" value="<?php if (isset($globalCronEnd)) {
1038
+	print $globalCronEnd;
1039
+} else {
1040
+	print '0';
1041
+}
1042
+?>" />
795 1043
 					<p class="help-block">Set to 0 to disable. Should be disabled if source is URL.</p>
796 1044
 				</div>
797 1045
 			</p>
@@ -844,15 +1092,30 @@  discard block
 block discarded – undo
844 1092
 			<br />
845 1093
 			<p>
846 1094
 				<label for="refresh">Show flights detected since xxx seconds</label>
847
-				<input type="number" name="refresh" id="refresh" value="<?php if (isset($globalLiveInterval)) echo $globalLiveInterval; else echo '200'; ?>" />
1095
+				<input type="number" name="refresh" id="refresh" value="<?php if (isset($globalLiveInterval)) {
1096
+	echo $globalLiveInterval;
1097
+} else {
1098
+	echo '200';
1099
+}
1100
+?>" />
848 1101
 			</p>
849 1102
 			<p>
850 1103
 				<label for="maprefresh">Live map refresh (in seconds)</label>
851
-				<input type="number" name="maprefresh" id="maprefresh" value="<?php if (isset($globalMapRefresh)) echo $globalMapRefresh; else echo '30'; ?>" />
1104
+				<input type="number" name="maprefresh" id="maprefresh" value="<?php if (isset($globalMapRefresh)) {
1105
+	echo $globalMapRefresh;
1106
+} else {
1107
+	echo '30';
1108
+}
1109
+?>" />
852 1110
 			</p>
853 1111
 			<p>
854 1112
 				<label for="mapidle">Map idle timeout (in minutes)</label>
855
-				<input type="number" name="mapidle" id="mapidle" value="<?php if (isset($globalMapIdleTimeout)) echo $globalMapIdleTimeout; else echo '30'; ?>" />
1113
+				<input type="number" name="mapidle" id="mapidle" value="<?php if (isset($globalMapIdleTimeout)) {
1114
+	echo $globalMapIdleTimeout;
1115
+} else {
1116
+	echo '30';
1117
+}
1118
+?>" />
856 1119
 				<p class="help-block">0 to disable</p>
857 1120
 			</p>
858 1121
 			<p>
@@ -867,12 +1130,20 @@  discard block
 block discarded – undo
867 1130
 			<br />
868 1131
 			<p>
869 1132
 				<label for="closestmindist">Distance to airport set as arrival (in km)</label>
870
-				<input type="number" name="closestmindist" id="closestmindist" value="<?php if (isset($globalClosestMinDist)) echo $globalClosestMinDist; else echo '50'; ?>" />
1133
+				<input type="number" name="closestmindist" id="closestmindist" value="<?php if (isset($globalClosestMinDist)) {
1134
+	echo $globalClosestMinDist;
1135
+} else {
1136
+	echo '50';
1137
+}
1138
+?>" />
871 1139
 			</p>
872 1140
 			<br />
873 1141
 			<p>
874 1142
 				<label for="aircraftsize">Size of aircraft icon on map (default to 30px if zoom > 7 else 15px), empty to default</label>
875
-				<input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize;?>" />
1143
+				<input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) {
1144
+	echo $globalAircraftSize;
1145
+}
1146
+?>" />
876 1147
 			</p>
877 1148
 			<br />
878 1149
 			<p>
@@ -885,7 +1156,12 @@  discard block
 block discarded – undo
885 1156
 			    if (extension_loaded('gd') && function_exists('gd_info')) {
886 1157
 			?>
887 1158
 				<label for="aircrafticoncolor">Color of aircraft icon on map</label>
888
-				<input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) echo $globalAircraftIconColor; else echo '1a3151'; ?>" />
1159
+				<input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) {
1160
+	echo $globalAircraftIconColor;
1161
+} else {
1162
+	echo '1a3151';
1163
+}
1164
+?>" />
889 1165
 			<?php
890 1166
 				if (!is_writable('../cache')) {
891 1167
 			?>
@@ -903,14 +1179,27 @@  discard block
 block discarded – undo
903 1179
 			<p>
904 1180
 				<label for="airportzoom">Zoom level minimum to see airports icons</label>
905 1181
 				<div class="range">
906
-					<input type="range" name="airportzoom" id="airportzoom" value="<?php if (isset($globalAirportZoom)) echo $globalAirportZoom; else echo '7'; ?>" />
907
-					<output id="range"><?php if (isset($globalAirportZoom)) echo $globalAirportZoom; else echo '7'; ?></output>
1182
+					<input type="range" name="airportzoom" id="airportzoom" value="<?php if (isset($globalAirportZoom)) {
1183
+	echo $globalAirportZoom;
1184
+} else {
1185
+	echo '7';
1186
+}
1187
+?>" />
1188
+					<output id="range"><?php if (isset($globalAirportZoom)) {
1189
+	echo $globalAirportZoom;
1190
+} else {
1191
+	echo '7';
1192
+}
1193
+?></output>
908 1194
 				</div>
909 1195
 			</p>
910 1196
 			<br />
911 1197
 			<p>
912 1198
 				<label for="customcss">Custom CSS web path</label>
913
-				<input type="text" name="customcss" id="customcss" value="<?php if (isset($globalCustomCSS)) echo $globalCustomCSS; ?>" />
1199
+				<input type="text" name="customcss" id="customcss" value="<?php if (isset($globalCustomCSS)) {
1200
+	echo $globalCustomCSS;
1201
+}
1202
+?>" />
914 1203
 			</p>
915 1204
 		</fieldset>
916 1205
 		<input type="submit" name="submit" value="Create/Update database & write setup" />
@@ -937,8 +1226,12 @@  discard block
 block discarded – undo
937 1226
 	$dbhost = filter_input(INPUT_POST,'dbhost',FILTER_SANITIZE_STRING);
938 1227
 	$dbport = filter_input(INPUT_POST,'dbport',FILTER_SANITIZE_STRING);
939 1228
 
940
-	if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) $error .= 'Mysql driver for PDO must be loaded';
941
-	if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) $error .= 'PosgreSQL driver for PDO must be loaded';
1229
+	if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) {
1230
+		$error .= 'Mysql driver for PDO must be loaded';
1231
+	}
1232
+	if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) {
1233
+		$error .= 'PosgreSQL driver for PDO must be loaded';
1234
+	}
942 1235
 	
943 1236
 	$_SESSION['database_root'] = $dbroot;
944 1237
 	$_SESSION['database_rootpass'] = $dbrootpass;
@@ -1006,15 +1299,23 @@  discard block
 block discarded – undo
1006 1299
 	$source_city = $_POST['source_city'];
1007 1300
 	$source_country = $_POST['source_country'];
1008 1301
 	$source_ref = $_POST['source_ref'];
1009
-	if (isset($source_id)) $source_id = $_POST['source_id'];
1010
-	else $source_id = array();
1302
+	if (isset($source_id)) {
1303
+		$source_id = $_POST['source_id'];
1304
+	} else {
1305
+		$source_id = array();
1306
+	}
1011 1307
 	
1012 1308
 	$sources = array();
1013 1309
 	foreach ($source_name as $keys => $name) {
1014
-	    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]);
1015
-	    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]);
1310
+	    if (isset($source_id[$keys])) {
1311
+	    	$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]);
1312
+	    } else {
1313
+	    	$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]);
1314
+	    }
1315
+	}
1316
+	if (count($sources) > 0) {
1317
+		$_SESSION['sources'] = $sources;
1016 1318
 	}
1017
-	if (count($sources) > 0) $_SESSION['sources'] = $sources;
1018 1319
 
1019 1320
 	//$sbshost = filter_input(INPUT_POST,'sbshost',FILTER_SANITIZE_STRING);
1020 1321
 	//$sbsport = filter_input(INPUT_POST,'sbsport',FILTER_SANITIZE_NUMBER_INT);
@@ -1035,14 +1336,23 @@  discard block
 block discarded – undo
1035 1336
 	$datasource = filter_input(INPUT_POST,'datasource',FILTER_SANITIZE_STRING);
1036 1337
 
1037 1338
 	$globalaircraft = filter_input(INPUT_POST,'globalaircraft',FILTER_SANITIZE_STRING);
1038
-	if ($globalaircraft == 'aircraft') $settings = array_merge($settings,array('globalAircraft' => 'TRUE'));
1039
-	else $settings = array_merge($settings,array('globalAircraft' => 'FALSE'));
1339
+	if ($globalaircraft == 'aircraft') {
1340
+		$settings = array_merge($settings,array('globalAircraft' => 'TRUE'));
1341
+	} else {
1342
+		$settings = array_merge($settings,array('globalAircraft' => 'FALSE'));
1343
+	}
1040 1344
 	$globaltracker = filter_input(INPUT_POST,'globaltracker',FILTER_SANITIZE_STRING);
1041
-	if ($globaltracker == 'tracker') $settings = array_merge($settings,array('globalTracker' => 'TRUE'));
1042
-	else $settings = array_merge($settings,array('globalTracker' => 'FALSE'));
1345
+	if ($globaltracker == 'tracker') {
1346
+		$settings = array_merge($settings,array('globalTracker' => 'TRUE'));
1347
+	} else {
1348
+		$settings = array_merge($settings,array('globalTracker' => 'FALSE'));
1349
+	}
1043 1350
 	$globalmarine = filter_input(INPUT_POST,'globalmarine',FILTER_SANITIZE_STRING);
1044
-	if ($globalmarine == 'marine') $settings = array_merge($settings,array('globalMarine' => 'TRUE'));
1045
-	else $settings = array_merge($settings,array('globalMarine' => 'FALSE'));
1351
+	if ($globalmarine == 'marine') {
1352
+		$settings = array_merge($settings,array('globalMarine' => 'TRUE'));
1353
+	} else {
1354
+		$settings = array_merge($settings,array('globalMarine' => 'FALSE'));
1355
+	}
1046 1356
 
1047 1357
 /*	
1048 1358
 	$globalSBS1Hosts = array();
@@ -1064,23 +1374,37 @@  discard block
 block discarded – undo
1064 1374
 	$name = $_POST['name'];
1065 1375
 	$format = $_POST['format'];
1066 1376
 	$timezones = $_POST['timezones'];
1067
-	if (isset($_POST['sourcestats'])) $sourcestats = $_POST['sourcestats'];
1068
-	else $sourcestats = array();
1069
-	if (isset($_POST['noarchive'])) $noarchive = $_POST['noarchive'];
1070
-	else $noarchive = array();
1377
+	if (isset($_POST['sourcestats'])) {
1378
+		$sourcestats = $_POST['sourcestats'];
1379
+	} else {
1380
+		$sourcestats = array();
1381
+	}
1382
+	if (isset($_POST['noarchive'])) {
1383
+		$noarchive = $_POST['noarchive'];
1384
+	} else {
1385
+		$noarchive = array();
1386
+	}
1071 1387
 	$gSources = array();
1072 1388
 	$forcepilots = false;
1073 1389
 	foreach ($host as $key => $h) {
1074
-		if (isset($sourcestats[$key]) && $sourcestats[$key] == 1) $cov = 'TRUE';
1075
-		else $cov = 'FALSE';
1076
-		if (isset($noarchive[$key]) && $noarchive[$key] == 1) $arch = 'TRUE';
1077
-		else $arch = 'FALSE';
1390
+		if (isset($sourcestats[$key]) && $sourcestats[$key] == 1) {
1391
+			$cov = 'TRUE';
1392
+		} else {
1393
+			$cov = 'FALSE';
1394
+		}
1395
+		if (isset($noarchive[$key]) && $noarchive[$key] == 1) {
1396
+			$arch = 'TRUE';
1397
+		} else {
1398
+			$arch = 'FALSE';
1399
+		}
1078 1400
 		if (strpos($format[$key],'_callback')) {
1079 1401
 			$gSources[] = array('host' => $h, 'pass' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezones[$key],'callback' => 'TRUE');
1080 1402
 		} elseif ($h != '' || $name[$key] != '') {
1081 1403
 			$gSources[] = array('host' => $h, 'port' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezones[$key],'callback' => 'FALSE');
1082 1404
 		}
1083
-		if ($format[$key] == 'airwhere') $forcepilots = true;
1405
+		if ($format[$key] == 'airwhere') {
1406
+			$forcepilots = true;
1407
+		}
1084 1408
 	}
1085 1409
 	$settings = array_merge($settings,array('globalSources' => $gSources));
1086 1410
 
@@ -1108,7 +1432,9 @@  discard block
 block discarded – undo
1108 1432
 	$zoidistance = filter_input(INPUT_POST,'zoidistance',FILTER_SANITIZE_NUMBER_INT);
1109 1433
 	if ($zoilatitude != '' && $zoilongitude != '' && $zoidistance != '') {
1110 1434
 		$settings = array_merge($settings,array('globalDistanceIgnore' => array('latitude' => $zoilatitude,'longitude' => $zoilongitude,'distance' => $zoidistance)));
1111
-	} else $settings = array_merge($settings,array('globalDistanceIgnore' => array()));
1435
+	} else {
1436
+		$settings = array_merge($settings,array('globalDistanceIgnore' => array()));
1437
+	}
1112 1438
 
1113 1439
 	$refresh = filter_input(INPUT_POST,'refresh',FILTER_SANITIZE_NUMBER_INT);
1114 1440
 	$settings = array_merge($settings,array('globalLiveInterval' => $refresh));
@@ -1147,7 +1473,9 @@  discard block
 block discarded – undo
1147 1473
 
1148 1474
 	// Create in settings.php keys not yet configurable if not already here
1149 1475
 	//if (!isset($globalImageBingKey)) $settings = array_merge($settings,array('globalImageBingKey' => ''));
1150
-	if (!isset($globalDebug)) $settings = array_merge($settings,array('globalDebug' => 'TRUE'));
1476
+	if (!isset($globalDebug)) {
1477
+		$settings = array_merge($settings,array('globalDebug' => 'TRUE'));
1478
+	}
1151 1479
 
1152 1480
 	$resetyearstats = filter_input(INPUT_POST,'resetyearstats',FILTER_SANITIZE_STRING);
1153 1481
 	if ($resetyearstats == 'resetyearstats') {
@@ -1184,37 +1512,56 @@  discard block
 block discarded – undo
1184 1512
 	}
1185 1513
 */
1186 1514
 	$settings = array_merge($settings,array('globalFlightAware' => 'FALSE'));
1187
-	if ($globalsbs == 'sbs') $settings = array_merge($settings,array('globalSBS1' => 'TRUE'));
1188
-	else $settings = array_merge($settings,array('globalSBS1' => 'FALSE'));
1189
-	if ($globalaprs == 'aprs') $settings = array_merge($settings,array('globalAPRS' => 'TRUE'));
1190
-	else $settings = array_merge($settings,array('globalAPRS' => 'FALSE'));
1515
+	if ($globalsbs == 'sbs') {
1516
+		$settings = array_merge($settings,array('globalSBS1' => 'TRUE'));
1517
+	} else {
1518
+		$settings = array_merge($settings,array('globalSBS1' => 'FALSE'));
1519
+	}
1520
+	if ($globalaprs == 'aprs') {
1521
+		$settings = array_merge($settings,array('globalAPRS' => 'TRUE'));
1522
+	} else {
1523
+		$settings = array_merge($settings,array('globalAPRS' => 'FALSE'));
1524
+	}
1191 1525
 	$va = false;
1192 1526
 	if ($globalivao == 'ivao') {
1193 1527
 		$settings = array_merge($settings,array('globalIVAO' => 'TRUE'));
1194 1528
 		$va = true;
1195
-	} else $settings = array_merge($settings,array('globalIVAO' => 'FALSE'));
1529
+	} else {
1530
+		$settings = array_merge($settings,array('globalIVAO' => 'FALSE'));
1531
+	}
1196 1532
 	if ($globalvatsim == 'vatsim') {
1197 1533
 		$settings = array_merge($settings,array('globalVATSIM' => 'TRUE'));
1198 1534
 		$va = true;
1199
-	} else $settings = array_merge($settings,array('globalVATSIM' => 'FALSE'));
1535
+	} else {
1536
+		$settings = array_merge($settings,array('globalVATSIM' => 'FALSE'));
1537
+	}
1200 1538
 	if ($globalphpvms == 'phpvms') {
1201 1539
 		$settings = array_merge($settings,array('globalphpVMS' => 'TRUE'));
1202 1540
 		$va = true;
1203
-	} else $settings = array_merge($settings,array('globalphpVMS' => 'FALSE'));
1541
+	} else {
1542
+		$settings = array_merge($settings,array('globalphpVMS' => 'FALSE'));
1543
+	}
1204 1544
 	if ($globalvam == 'vam') {
1205 1545
 		$settings = array_merge($settings,array('globalVAM' => 'TRUE'));
1206 1546
 		$va = true;
1207
-	} else $settings = array_merge($settings,array('globalVAM' => 'FALSE'));
1547
+	} else {
1548
+		$settings = array_merge($settings,array('globalVAM' => 'FALSE'));
1549
+	}
1208 1550
 	if ($va) {
1209 1551
 		$settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE','globalTranslationFetch' => 'FALSE'));
1210
-	} else $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE'));
1552
+	} else {
1553
+		$settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE'));
1554
+	}
1211 1555
 	if ($globalva == 'va' || $va) {
1212 1556
 		$settings = array_merge($settings,array('globalVA' => 'TRUE'));
1213 1557
 		$settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE'));
1214 1558
 	} else {
1215 1559
 		$settings = array_merge($settings,array('globalVA' => 'FALSE'));
1216
-		if ($forcepilots) $settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE'));
1217
-		else $settings = array_merge($settings,array('globalUsePilot' => 'FALSE','globalUseOwner' => 'TRUE'));
1560
+		if ($forcepilots) {
1561
+			$settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE'));
1562
+		} else {
1563
+			$settings = array_merge($settings,array('globalUsePilot' => 'FALSE','globalUseOwner' => 'TRUE'));
1564
+		}
1218 1565
 	}
1219 1566
 	
1220 1567
 	
@@ -1390,7 +1737,9 @@  discard block
 block discarded – undo
1390 1737
 		$settings = array_merge($settings,array('globalNoAirlines' => 'FALSE'));
1391 1738
 	}
1392 1739
 
1393
-	if (!isset($globalTransaction)) $settings = array_merge($settings,array('globalTransaction' => 'TRUE'));
1740
+	if (!isset($globalTransaction)) {
1741
+		$settings = array_merge($settings,array('globalTransaction' => 'TRUE'));
1742
+	}
1394 1743
 
1395 1744
 	// Set some defaults values...
1396 1745
 	if (!isset($globalAircraftImageSources)) {
@@ -1405,15 +1754,23 @@  discard block
 block discarded – undo
1405 1754
 
1406 1755
 	$settings = array_merge($settings,array('globalInstalled' => 'TRUE'));
1407 1756
 
1408
-	if ($error == '') settings::modify_settings($settings);
1409
-	if ($error == '') settings::comment_settings($settings_comment);
1757
+	if ($error == '') {
1758
+		settings::modify_settings($settings);
1759
+	}
1760
+	if ($error == '') {
1761
+		settings::comment_settings($settings_comment);
1762
+	}
1410 1763
 	if ($error != '') {
1411 1764
 		print '<div class="info column">'.$error.'</div>';
1412 1765
 		require('../footer.php');
1413 1766
 		exit;
1414 1767
 	} else {
1415
-		if (isset($_POST['waypoints']) && $_POST['waypoints'] == 'waypoints') $_SESSION['waypoints'] = 1;
1416
-		if (isset($_POST['owner']) && $_POST['owner'] == 'owner') $_SESSION['owner'] = 1;
1768
+		if (isset($_POST['waypoints']) && $_POST['waypoints'] == 'waypoints') {
1769
+			$_SESSION['waypoints'] = 1;
1770
+		}
1771
+		if (isset($_POST['owner']) && $_POST['owner'] == 'owner') {
1772
+			$_SESSION['owner'] = 1;
1773
+		}
1417 1774
 		if (isset($_POST['createdb'])) {
1418 1775
 			$_SESSION['install'] = 'database_create';
1419 1776
 		} else {
@@ -1449,10 +1806,18 @@  discard block
 block discarded – undo
1449 1806
 	$popw = false;
1450 1807
 	foreach ($_SESSION['done'] as $done) {
1451 1808
 	    print '<li>'.$done.'....<strong>SUCCESS</strong></li>';
1452
-	    if ($done == 'Create database') $pop = true;
1453
-	    if ($_SESSION['install'] == 'database_create') $pop = true;
1454
-	    if ($_SESSION['install'] == 'database_import') $popi = true;
1455
-	    if ($_SESSION['install'] == 'waypoints') $popw = true;
1809
+	    if ($done == 'Create database') {
1810
+	    	$pop = true;
1811
+	    }
1812
+	    if ($_SESSION['install'] == 'database_create') {
1813
+	    	$pop = true;
1814
+	    }
1815
+	    if ($_SESSION['install'] == 'database_import') {
1816
+	    	$popi = true;
1817
+	    }
1818
+	    if ($_SESSION['install'] == 'waypoints') {
1819
+	    	$popw = true;
1820
+	    }
1456 1821
 	}
1457 1822
 	if ($pop) {
1458 1823
 	    sleep(5);
@@ -1463,7 +1828,9 @@  discard block
 block discarded – undo
1463 1828
 	} else if ($popw) {
1464 1829
 	    sleep(5);
1465 1830
 	    print '<li>Populate waypoints database....<img src="../images/loading.gif" /></li>';
1466
-	} else print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>';
1831
+	} else {
1832
+		print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>';
1833
+	}
1467 1834
 	print '</div></ul>';
1468 1835
 	print '<div id="error"></div>';
1469 1836
 /*	foreach ($_SESSION['done'] as $done) {
Please login to merge, or discard this patch.