Completed
Push — master ( 73f088...7f17b6 )
by Yannick
07:13
created
install/header.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 <meta property="og:site_name" content="<?php print $globalName; ?>"/>
40 40
 
41 41
 <?php
42
-    if (!isset($_SESSION['install']) && !$globalInstalled) {
42
+	if (!isset($_SESSION['install']) && !$globalInstalled) {
43 43
 ?>
44 44
 <script language="JavaScript" type="text/javascript">
45 45
     function datasource_js() {
@@ -120,22 +120,22 @@  discard block
 block discarded – undo
120 120
     }
121 121
 </script>
122 122
 <?php
123
-    }
123
+	}
124 124
 ?>
125 125
 
126 126
 </head>
127 127
 
128 128
 <?php
129
-    if (!isset($_SESSION['install']) && !$globalInstalled) {
129
+	if (!isset($_SESSION['install']) && !$globalInstalled) {
130 130
 ?>
131 131
 
132 132
 <body class="page-<?php print strtolower($current_page); ?>" onload="datasource_js(); metarcycle_js(); create_database_js(); daemon_js(); schedule_js()">
133 133
 <?php
134
-    } else {
134
+	} else {
135 135
 ?>
136 136
     <body class="page-<?php print strtolower($current_page); ?>">
137 137
 <?php
138
-    }
138
+	}
139 139
 ?>
140 140
 <div class="navbar navbar-fixed-top" role="navigation">
141 141
   <div class="container">
@@ -154,12 +154,12 @@  discard block
 block discarded – undo
154 154
 
155 155
 <?php
156 156
 if (isset($top_header)) {
157
-    if ($top_header != "")
158
-    {
157
+	if ($top_header != "")
158
+	{
159 159
 	print '<div class="top-header container clear" role="main">';
160 160
 		print '<img src="../images/'.$top_header.'" alt="'.$title.'" title="'.$title.'" />';
161 161
 	print '</div>';
162
-    }
162
+	}
163 163
 }
164 164
 ?>
165 165
 
Please login to merge, or discard this patch.
install/install-action.php 3 patches
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -68,27 +68,27 @@  discard block
 block discarded – undo
68 68
 } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'database_import') {
69 69
 	if (update_schema::check_version(false) == '0') {
70 70
 		if ($globalDBdriver == 'mysql') {
71
-		    $error .= create_db::import_all_db('../db/');
71
+			$error .= create_db::import_all_db('../db/');
72 72
 		} elseif ($globalDBdriver == 'pgsql') {
73
-		    $error .= create_db::import_all_db('../db/pgsql/');
73
+			$error .= create_db::import_all_db('../db/pgsql/');
74 74
 		}
75 75
 		if ($error != '') {
76
-                        $_SESSION['error'] = $error;
76
+						$_SESSION['error'] = $error;
77 77
 		}
78 78
 		$_SESSION['done'] = array_merge($_SESSION['done'],array('Create and import tables'));
79 79
 		if ($globalSBS1 && !$globalIVAO && !$globalVATSIM && !$globalphpVMS) {
80 80
 			$_SESSION['install'] = 'populate';
81 81
 			$_SESSION['next'] = 'Populate aircraft_modes table with externals data for ADS-B';
82 82
 		} else {
83
-		    $_SESSION['install'] = 'sources';
84
-		    $_SESSION['next'] = 'Insert data in source table';
83
+			$_SESSION['install'] = 'sources';
84
+			$_SESSION['next'] = 'Insert data in source table';
85 85
 		}
86 86
 		$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
87 87
 		print json_encode($result);
88 88
 	} else {
89 89
 		$error .= update_schema::check_version(true);
90 90
 		if ($error != '') {
91
-                        $_SESSION['error'] = $error;
91
+						$_SESSION['error'] = $error;
92 92
 		}
93 93
 		$_SESSION['done'] = array_merge($_SESSION['done'],array('Update schema if needed'));
94 94
 		$_SESSION['install'] = 'sources';
@@ -118,25 +118,25 @@  discard block
 block discarded – undo
118 118
 	$error .= update_db::update_countries();
119 119
 	$_SESSION['done'] = array_merge($_SESSION['done'],array('Populate countries database'));
120 120
 	if (isset($globalNOTAM) && $globalNOTAM && isset($globalNOTAMSource) && $globalNOTAMSource != '') {
121
-	    $_SESSION['install'] = 'notam';
122
-	    $_SESSION['next'] = 'Populate NOTAM table with externals data';
123
-	    $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
124
-	    print json_encode($result);
121
+		$_SESSION['install'] = 'notam';
122
+		$_SESSION['next'] = 'Populate NOTAM table with externals data';
123
+		$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
124
+		print json_encode($result);
125 125
 	} elseif (isset($_SESSION['owner']) && $_SESSION['owner'] == 1) {
126
-	    $_SESSION['install'] = 'owner';
127
-	    $_SESSION['next'] = 'Populate owner table with externals data';
128
-	    unset($_SESSION['owner']);
129
-	    $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
130
-	    print json_encode($result);
126
+		$_SESSION['install'] = 'owner';
127
+		$_SESSION['next'] = 'Populate owner table with externals data';
128
+		unset($_SESSION['owner']);
129
+		$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
130
+		print json_encode($result);
131 131
 	} else {
132
-	    $_SESSION['install'] = 'sources';
133
-	    $_SESSION['next'] = 'Insert data in source table';
134
-	    $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
135
-	    print json_encode($result);
132
+		$_SESSION['install'] = 'sources';
133
+		$_SESSION['next'] = 'Insert data in source table';
134
+		$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
135
+		print json_encode($result);
136 136
 	}
137 137
 } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'populate') {
138 138
 	if (!is_writable('tmp')) {
139
-                $error = 'The directory <i>install/tmp</i> must be writable.';
139
+				$error = 'The directory <i>install/tmp</i> must be writable.';
140 140
 		$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
141 141
 		print json_encode($result);
142 142
 	} else {
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 	}
153 153
 } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'populate_flarm') {
154 154
 	if (!is_writable('tmp')) {
155
-                $error = 'The directory <i>install/tmp</i> must be writable.';
155
+				$error = 'The directory <i>install/tmp</i> must be writable.';
156 156
 		$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
157 157
 		print json_encode($result);
158 158
 	} else {
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 	}
186 186
 } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'routes') {
187 187
 	if (!is_writable('tmp')) {
188
-                $error = 'The directory <i>install/tmp</i> must be writable.';
188
+				$error = 'The directory <i>install/tmp</i> must be writable.';
189 189
 		$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
190 190
 		print json_encode($result);
191 191
 	} else {
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 	}
201 201
 } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'translation') {
202 202
 	if (!is_writable('tmp')) {
203
-                $error = 'The directory <i>install/tmp</i> must be writable.';
203
+				$error = 'The directory <i>install/tmp</i> must be writable.';
204 204
 		$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
205 205
 		print json_encode($result);
206 206
 	} else {
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 	}
230 230
 } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'owner') {
231 231
 	if (!is_writable('tmp')) {
232
-                $error = 'The directory <i>install/tmp</i> must be writable.';
232
+				$error = 'The directory <i>install/tmp</i> must be writable.';
233 233
 		$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
234 234
 		print json_encode($result);
235 235
 	} else {
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
 	}
245 245
 } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'notam') {
246 246
 	if (!is_writable('tmp')) {
247
-                $error = 'The directory <i>install/tmp</i> must be writable.';
247
+				$error = 'The directory <i>install/tmp</i> must be writable.';
248 248
 		$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
249 249
 		print json_encode($result);
250 250
 	} else {
@@ -296,17 +296,17 @@  discard block
 block discarded – undo
296 296
 */
297 297
 } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'sources') {
298 298
 	if (isset($_SESSION['sources']) && count($_SESSION['sources']) > 0) {
299
-	    $sources = $_SESSION['sources'];
299
+		$sources = $_SESSION['sources'];
300 300
 
301
-	    include_once('../require/class.Source.php');
302
-	    $globalDebug = FALSE;
303
-	    $Source = new Source();
304
-	    $Source->deleteAllLocation();
305
-	    foreach ($sources as $src) {
301
+		include_once('../require/class.Source.php');
302
+		$globalDebug = FALSE;
303
+		$Source = new Source();
304
+		$Source->deleteAllLocation();
305
+		foreach ($sources as $src) {
306 306
 		if (isset($src['latitude']) && $src['latitude'] != '') $Source->addLocation($src['name'],$src['latitude'],$src['longitude'],$src['altitude'],$src['city'],$src['country'],$src['source'],'antenna.png');
307
-	    }
308
-	    $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert data in source table'));
309
-	    unset($_SESSION['sources']);
307
+		}
308
+		$_SESSION['done'] = array_merge($_SESSION['done'],array('Insert data in source table'));
309
+		unset($_SESSION['sources']);
310 310
 	}
311 311
 	/*
312 312
 	if (isset($globalIVAO) && $globalIVAO) $_SESSION['install'] = 'ivao';
Please login to merge, or discard this patch.
Braces   +23 added lines, -9 removed lines patch added patch discarded remove patch
@@ -164,15 +164,21 @@  discard block
 block discarded – undo
164 164
 
165 165
 		if ((isset($globalVATSIM) && $globalVATSIM) && (isset($globalIVAO) && $globalIVAO)) {
166 166
 			$_SESSION['install'] = 'vatsim';
167
-			if (file_exists('tmp/ivae_feb2013.zip')) $_SESSION['next'] = 'Insert IVAO data';
168
-			else $_SESSION['next'] = 'Insert VATSIM data';
167
+			if (file_exists('tmp/ivae_feb2013.zip')) {
168
+				$_SESSION['next'] = 'Insert IVAO data';
169
+			} else {
170
+				$_SESSION['next'] = 'Insert VATSIM data';
171
+			}
169 172
 		} elseif (isset($globalVATSIM) && $globalVATSIM) {
170 173
 			$_SESSION['install'] = 'vatsim';
171 174
 			$_SESSION['next'] = 'Insert VATSIM data';
172 175
 		} elseif (isset($globalIVAO) && $globalIVAO) {
173 176
 			$_SESSION['install'] = 'vatsim';
174
-			if (file_exists('tmp/ivae_feb2013.zip')) $_SESSION['next'] = 'Insert IVAO data';
175
-			else $_SESSION['next'] = 'Insert VATSIM data (IVAO not found)';
177
+			if (file_exists('tmp/ivae_feb2013.zip')) {
178
+				$_SESSION['next'] = 'Insert IVAO data';
179
+			} else {
180
+				$_SESSION['next'] = 'Insert VATSIM data (IVAO not found)';
181
+			}
176 182
 		} elseif (isset($globalphpVMS) && $globalphpVMS) {
177 183
 			$_SESSION['install'] = 'vatsim';
178 184
 			$_SESSION['next'] = 'Insert phpVMS data';
@@ -303,7 +309,9 @@  discard block
 block discarded – undo
303 309
 	    $Source = new Source();
304 310
 	    $Source->deleteAllLocation();
305 311
 	    foreach ($sources as $src) {
306
-		if (isset($src['latitude']) && $src['latitude'] != '') $Source->addLocation($src['name'],$src['latitude'],$src['longitude'],$src['altitude'],$src['city'],$src['country'],$src['source'],'antenna.png');
312
+		if (isset($src['latitude']) && $src['latitude'] != '') {
313
+			$Source->addLocation($src['name'],$src['latitude'],$src['longitude'],$src['altitude'],$src['city'],$src['country'],$src['source'],'antenna.png');
314
+		}
307 315
 	    }
308 316
 	    $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert data in source table'));
309 317
 	    unset($_SESSION['sources']);
@@ -314,15 +322,21 @@  discard block
 block discarded – undo
314 322
 	*/
315 323
 	if ((isset($globalVATSIM) && $globalVATSIM) && (isset($globalIVAO) && $globalIVAO)) {
316 324
 		$_SESSION['install'] = 'vatsim';
317
-		if (file_exists('tmp/ivae_feb2013.zip')) $_SESSION['next'] = 'Insert IVAO data';
318
-		else $_SESSION['next'] = 'Insert VATSIM data';
325
+		if (file_exists('tmp/ivae_feb2013.zip')) {
326
+			$_SESSION['next'] = 'Insert IVAO data';
327
+		} else {
328
+			$_SESSION['next'] = 'Insert VATSIM data';
329
+		}
319 330
 	} elseif (isset($globalVATSIM) && $globalVATSIM) {
320 331
 		$_SESSION['install'] = 'vatsim';
321 332
 		$_SESSION['next'] = 'Insert VATSIM data';
322 333
 	} elseif (isset($globalIVAO) && $globalIVAO) {
323 334
 		$_SESSION['install'] = 'vatsim';
324
-		if (file_exists('tmp/ivae_feb2013.zip')) $_SESSION['next'] = 'Insert IVAO data';
325
-		else $_SESSION['next'] = 'Insert VATSIM data (IVAO not found)';
335
+		if (file_exists('tmp/ivae_feb2013.zip')) {
336
+			$_SESSION['next'] = 'Insert IVAO data';
337
+		} else {
338
+			$_SESSION['next'] = 'Insert VATSIM data (IVAO not found)';
339
+		}
326 340
 	} elseif (isset($globalphpVMS) && $globalphpVMS) {
327 341
 		$_SESSION['install'] = 'vatsim';
328 342
 		$_SESSION['next'] = 'Insert phpVMS data';
Please login to merge, or discard this patch.
Spacing   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -68,14 +68,14 @@  discard block
 block discarded – undo
68 68
 } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'database_create') {
69 69
 	$dbroot = $_SESSION['database_root'];
70 70
 	$dbrootpass = $_SESSION['database_rootpass'];
71
-	$error .= create_db::create_database($dbroot,$dbrootpass,$globalDBuser,$globalDBpass,$globalDBname,$globalDBdriver,$globalDBhost);
71
+	$error .= create_db::create_database($dbroot, $dbrootpass, $globalDBuser, $globalDBpass, $globalDBname, $globalDBdriver, $globalDBhost);
72 72
 	if ($error != '') {
73 73
 		$_SESSION['error'] = $error;
74 74
 	}
75
-	$_SESSION['done'] = array_merge($_SESSION['done'],array('Create database'));
75
+	$_SESSION['done'] = array_merge($_SESSION['done'], array('Create database'));
76 76
 	$_SESSION['install'] = 'database_import';
77 77
 	$_SESSION['next'] = 'Create and import tables';
78
-	$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
78
+	$result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']);
79 79
 	print json_encode($result);
80 80
 } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'database_import') {
81 81
 	if (update_schema::check_version(false) == '0') {
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 		if ($error != '') {
88 88
                         $_SESSION['error'] = $error;
89 89
 		}
90
-		$_SESSION['done'] = array_merge($_SESSION['done'],array('Create and import tables'));
90
+		$_SESSION['done'] = array_merge($_SESSION['done'], array('Create and import tables'));
91 91
 		if ($globalSBS1 && !$globalIVAO && !$globalVATSIM && !$globalphpVMS) {
92 92
 			$_SESSION['install'] = 'populate';
93 93
 			$_SESSION['next'] = 'Populate aircraft_modes table with externals data for ADS-B';
@@ -95,84 +95,84 @@  discard block
 block discarded – undo
95 95
 		    $_SESSION['install'] = 'sources';
96 96
 		    $_SESSION['next'] = 'Insert data in source table';
97 97
 		}
98
-		$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
98
+		$result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']);
99 99
 		print json_encode($result);
100 100
 	} else {
101 101
 		$error .= update_schema::check_version(true);
102 102
 		if ($error != '') {
103 103
                         $_SESSION['error'] = $error;
104 104
 		}
105
-		$_SESSION['done'] = array_merge($_SESSION['done'],array('Update schema if needed'));
105
+		$_SESSION['done'] = array_merge($_SESSION['done'], array('Update schema if needed'));
106 106
 		$_SESSION['install'] = 'sources';
107 107
 		$_SESSION['next'] = 'Insert data in source table';
108
-		$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
108
+		$result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']);
109 109
 		print json_encode($result);
110 110
 	}
111 111
 } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'waypoints') {
112 112
 	include_once('class.update_db.php');
113 113
 	$error .= update_db::update_waypoints();
114
-	$_SESSION['done'] = array_merge($_SESSION['done'],array('Populate waypoints database'));
114
+	$_SESSION['done'] = array_merge($_SESSION['done'], array('Populate waypoints database'));
115 115
 
116 116
 	$_SESSION['install'] = 'airspace';
117 117
 	$_SESSION['next'] = 'Populate airspace table';
118
-	$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
118
+	$result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']);
119 119
 	print json_encode($result);
120 120
 } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'airspace') {
121 121
 	include_once('class.update_db.php');
122 122
 	$error .= update_db::update_airspace();
123
-	$_SESSION['done'] = array_merge($_SESSION['done'],array('Populate airspace database'));
123
+	$_SESSION['done'] = array_merge($_SESSION['done'], array('Populate airspace database'));
124 124
 	$_SESSION['install'] = 'countries';
125 125
 	$_SESSION['next'] = 'Populate countries table';
126
-	$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
126
+	$result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']);
127 127
 	print json_encode($result);
128 128
 } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'countries') {
129 129
 	include_once('class.update_db.php');
130 130
 	$error .= update_db::update_countries();
131
-	$_SESSION['done'] = array_merge($_SESSION['done'],array('Populate countries database'));
131
+	$_SESSION['done'] = array_merge($_SESSION['done'], array('Populate countries database'));
132 132
 	if (isset($globalNOTAM) && $globalNOTAM && isset($globalNOTAMSource) && $globalNOTAMSource != '') {
133 133
 	    $_SESSION['install'] = 'notam';
134 134
 	    $_SESSION['next'] = 'Populate NOTAM table with externals data';
135
-	    $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
135
+	    $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']);
136 136
 	    print json_encode($result);
137 137
 	} elseif (isset($_SESSION['owner']) && $_SESSION['owner'] == 1) {
138 138
 	    $_SESSION['install'] = 'owner';
139 139
 	    $_SESSION['next'] = 'Populate owner table with externals data';
140 140
 	    unset($_SESSION['owner']);
141
-	    $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
141
+	    $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']);
142 142
 	    print json_encode($result);
143 143
 	} else {
144 144
 	    $_SESSION['install'] = 'sources';
145 145
 	    $_SESSION['next'] = 'Insert data in source table';
146
-	    $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
146
+	    $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']);
147 147
 	    print json_encode($result);
148 148
 	}
149 149
 } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'populate') {
150 150
 	if (!is_writable('tmp')) {
151 151
                 $error = 'The directory <i>install/tmp</i> must be writable.';
152
-		$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
152
+		$result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']);
153 153
 		print json_encode($result);
154 154
 	} else {
155 155
 		include_once('class.update_db.php');
156 156
 		$globalDebug = FALSE;
157 157
 		$error .= update_db::update_ModeS();
158
-		$_SESSION['done'] = array_merge($_SESSION['done'],array('Populate aircraft_modes table with externals data for ADS-B'));
158
+		$_SESSION['done'] = array_merge($_SESSION['done'], array('Populate aircraft_modes table with externals data for ADS-B'));
159 159
 
160 160
 		$_SESSION['install'] = 'populate_flarm';
161 161
 		$_SESSION['next'] = 'Populate aircraft_modes table with externals data for FLARM';
162
-		$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
162
+		$result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']);
163 163
 		print json_encode($result);
164 164
 	}
165 165
 } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'populate_flarm') {
166 166
 	if (!is_writable('tmp')) {
167 167
                 $error = 'The directory <i>install/tmp</i> must be writable.';
168
-		$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
168
+		$result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']);
169 169
 		print json_encode($result);
170 170
 	} else {
171 171
 		include_once('class.update_db.php');
172 172
 		$globalDebug = FALSE;
173 173
 		$error .= update_db::update_ModeS_flarm();
174 174
 		$error .= update_db::update_ModeS_ogn();
175
-		$_SESSION['done'] = array_merge($_SESSION['done'],array('Populate aircraft_modes table with externals data for FLARM'));
175
+		$_SESSION['done'] = array_merge($_SESSION['done'], array('Populate aircraft_modes table with externals data for FLARM'));
176 176
 
177 177
 		if ((isset($globalVATSIM) && $globalVATSIM) && (isset($globalIVAO) && $globalIVAO)) {
178 178
 			$_SESSION['install'] = 'vatsim';
@@ -192,34 +192,34 @@  discard block
 block discarded – undo
192 192
 			$_SESSION['install'] = 'routes';
193 193
 			$_SESSION['next'] = 'Populate routes table with externals data';
194 194
 		}
195
-		$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
195
+		$result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']);
196 196
 		print json_encode($result);
197 197
 	}
198 198
 } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'routes') {
199 199
 	if (!is_writable('tmp')) {
200 200
                 $error = 'The directory <i>install/tmp</i> must be writable.';
201
-		$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
201
+		$result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']);
202 202
 		print json_encode($result);
203 203
 	} else {
204 204
 		include_once('class.update_db.php');
205 205
 		$globalDebug = FALSE;
206 206
 		$error .= update_db::update_routes();
207
-		$_SESSION['done'] = array_merge($_SESSION['done'],array('Populate routes table with externals data'));
207
+		$_SESSION['done'] = array_merge($_SESSION['done'], array('Populate routes table with externals data'));
208 208
 		$_SESSION['install'] = 'translation';
209 209
 		$_SESSION['next'] = 'Populate translation table with externals data';
210
-		$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
210
+		$result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']);
211 211
 		print json_encode($result);
212 212
 	}
213 213
 } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'translation') {
214 214
 	if (!is_writable('tmp')) {
215 215
                 $error = 'The directory <i>install/tmp</i> must be writable.';
216
-		$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
216
+		$result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']);
217 217
 		print json_encode($result);
218 218
 	} else {
219 219
 		include_once('class.update_db.php');
220 220
 		$globalDebug = FALSE;
221 221
 		$error .= update_db::update_translation();
222
-		$_SESSION['done'] = array_merge($_SESSION['done'],array('Populate translation table with externals data'));
222
+		$_SESSION['done'] = array_merge($_SESSION['done'], array('Populate translation table with externals data'));
223 223
 
224 224
 		if ($_SESSION['waypoints'] == 1) {
225 225
 			$_SESSION['install'] = 'waypoints';
@@ -236,48 +236,48 @@  discard block
 block discarded – undo
236 236
 			$_SESSION['install'] = 'sources';
237 237
 			$_SESSION['next'] = 'Insert data in source table';
238 238
 		}
239
-		$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
239
+		$result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']);
240 240
 		print json_encode($result);
241 241
 	}
242 242
 } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'owner') {
243 243
 	if (!is_writable('tmp')) {
244 244
                 $error = 'The directory <i>install/tmp</i> must be writable.';
245
-		$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
245
+		$result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']);
246 246
 		print json_encode($result);
247 247
 	} else {
248 248
 		include_once('class.update_db.php');
249 249
 		$globalDebug = FALSE;
250 250
 		$error = update_db::update_owner();
251
-		$_SESSION['done'] = array_merge($_SESSION['done'],array('Populate owner table with externals data'));
251
+		$_SESSION['done'] = array_merge($_SESSION['done'], array('Populate owner table with externals data'));
252 252
 		$_SESSION['install'] = 'sources';
253 253
 		$_SESSION['next'] = 'Insert data in source table';
254
-		$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
254
+		$result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']);
255 255
 		print json_encode($result);
256 256
 	}
257 257
 } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'notam') {
258 258
 	if (!is_writable('tmp')) {
259 259
                 $error = 'The directory <i>install/tmp</i> must be writable.';
260
-		$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
260
+		$result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']);
261 261
 		print json_encode($result);
262 262
 	} else {
263 263
 		include_once('class.update_db.php');
264 264
 		$globalDebug = FALSE;
265 265
 		if (isset($globalNOTAMSource) && $globalNOTAMSource != '') {
266 266
 			$error .= update_db::update_notam();
267
-			$_SESSION['done'] = array_merge($_SESSION['done'],array('Populate notam table with externals data'));
267
+			$_SESSION['done'] = array_merge($_SESSION['done'], array('Populate notam table with externals data'));
268 268
 		} else {
269
-			$_SESSION['done'] = array_merge($_SESSION['done'],array('Populate notam table with externals data (no source defined)'));
269
+			$_SESSION['done'] = array_merge($_SESSION['done'], array('Populate notam table with externals data (no source defined)'));
270 270
 		}
271 271
 		if (isset($_SESSION['owner']) && $_SESSION['owner'] == 1) {
272 272
 			$_SESSION['install'] = 'owner';
273 273
 			$_SESSION['next'] = 'Populate owner table';
274 274
 			unset($_SESSION['owner']);
275
-			$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
275
+			$result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']);
276 276
 			print json_encode($result);
277 277
 		} else {
278 278
 			$_SESSION['install'] = 'sources';
279 279
 			$_SESSION['next'] = 'Insert data in source table';
280
-			$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
280
+			$result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']);
281 281
 			print json_encode($result);
282 282
 		}
283 283
 	}
@@ -315,9 +315,9 @@  discard block
 block discarded – undo
315 315
 	    $Source = new Source();
316 316
 	    $Source->deleteAllLocation();
317 317
 	    foreach ($sources as $src) {
318
-		if (isset($src['latitude']) && $src['latitude'] != '') $Source->addLocation($src['name'],$src['latitude'],$src['longitude'],$src['altitude'],$src['city'],$src['country'],$src['source'],'antenna.png');
318
+		if (isset($src['latitude']) && $src['latitude'] != '') $Source->addLocation($src['name'], $src['latitude'], $src['longitude'], $src['altitude'], $src['city'], $src['country'], $src['source'], 'antenna.png');
319 319
 	    }
320
-	    $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert data in source table'));
320
+	    $_SESSION['done'] = array_merge($_SESSION['done'], array('Insert data in source table'));
321 321
 	    unset($_SESSION['sources']);
322 322
 	}
323 323
 	/*
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
 		$_SESSION['install'] = 'finish';
343 343
 		$_SESSION['next'] = 'finish';
344 344
 	}
345
-	$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
345
+	$result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']);
346 346
 	print json_encode($result);
347 347
 } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'vatsim') {
348 348
 	include_once('../install/class.create_db.php');
@@ -352,36 +352,36 @@  discard block
 block discarded – undo
352 352
 	if ((isset($globalVATSIM) && $globalVATSIM) && (isset($globalIVAO) && $globalIVAO)) {
353 353
 		if (file_exists('tmp/ivae_feb2013.zip')) {
354 354
 			$error .= update_db::update_IVAO();
355
-			$_SESSION['done'] = array_merge($_SESSION['done'],array('Insert IVAO data'));
355
+			$_SESSION['done'] = array_merge($_SESSION['done'], array('Insert IVAO data'));
356 356
 		} else {
357 357
 			$error .= update_db::update_vatsim();
358
-			$_SESSION['done'] = array_merge($_SESSION['done'],array('Insert VATSIM data'));
358
+			$_SESSION['done'] = array_merge($_SESSION['done'], array('Insert VATSIM data'));
359 359
 		}
360 360
 	} elseif (isset($globalVATSIM) && $globalVATSIM) {
361 361
 		$error .= update_db::update_vatsim();
362
-		$_SESSION['done'] = array_merge($_SESSION['done'],array('Insert VATSIM data'));
362
+		$_SESSION['done'] = array_merge($_SESSION['done'], array('Insert VATSIM data'));
363 363
 	} elseif (isset($globalIVAO) && $globalIVAO) {
364 364
 		if (file_exists('tmp/ivae_feb2013.zip')) {
365 365
 			$error .= update_db::update_IVAO();
366
-			$_SESSION['done'] = array_merge($_SESSION['done'],array('Insert IVAO data'));
366
+			$_SESSION['done'] = array_merge($_SESSION['done'], array('Insert IVAO data'));
367 367
 		} else {
368 368
 			$error .= update_db::update_vatsim();
369
-			$_SESSION['done'] = array_merge($_SESSION['done'],array('Insert VATSIM data (IVAO not found)'));
369
+			$_SESSION['done'] = array_merge($_SESSION['done'], array('Insert VATSIM data (IVAO not found)'));
370 370
 		}
371 371
 	} elseif (isset($globalphpVMS) && $globalphpVMS) {
372
-		$_SESSION['done'] = array_merge($_SESSION['done'],array('Insert phpVMS data'));
372
+		$_SESSION['done'] = array_merge($_SESSION['done'], array('Insert phpVMS data'));
373 373
 	}
374 374
 	//$_SESSION['install'] = 'routes';
375 375
 	//$_SESSION['next'] = 'Populate routes table with externals data';
376 376
 	$_SESSION['install'] = 'finish';
377 377
 	$_SESSION['next'] = 'finish';
378 378
 
379
-	$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
379
+	$result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']);
380 380
 	print json_encode($result);
381 381
 } else {
382 382
 	//unset($_SESSION['install']);
383 383
 	$_SESSION['error'] = 'Unknwon task : '.$_SESSION['install'];
384
-	$result = array('error' => 'Unknwon task : '.$_SESSION['install'],'done' => $_SESSION['done'],'next' => 'finish','install' => 'finish');
384
+	$result = array('error' => 'Unknwon task : '.$_SESSION['install'], 'done' => $_SESSION['done'], 'next' => 'finish', 'install' => 'finish');
385 385
 	print json_encode($result);
386 386
 }
387 387
 ?>
388 388
\ No newline at end of file
Please login to merge, or discard this patch.
install/update_arrival_airport.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -4,13 +4,13 @@
 block discarded – undo
4 4
  *    This Script will try to find all real arrival airports for all flights in DB
5 5
  *
6 6
 */
7
-    require_once('../require/settings.php');
8
-    if ($globalInstalled) {
9
-        echo '$globalInstalled must be set to FALSE in require/settings.php';
10
-        exit;
11
-    }
12
-    require('../require/class.Spotter.php');
13
-    $Spotter = new Spotter();
14
-    $Spotter->updateArrivalAirports();
7
+	require_once('../require/settings.php');
8
+	if ($globalInstalled) {
9
+		echo '$globalInstalled must be set to FALSE in require/settings.php';
10
+		exit;
11
+	}
12
+	require('../require/class.Spotter.php');
13
+	$Spotter = new Spotter();
14
+	$Spotter->updateArrivalAirports();
15 15
 
16 16
 ?>
17 17
\ No newline at end of file
Please login to merge, or discard this patch.
install/class.settings.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 		$Common = new Common();
13 13
 		$settings_filename = '../require/settings.php';
14 14
 		$content = file_get_contents($settings_filename);
15
-		$fh = fopen($settings_filename,'w');
15
+		$fh = fopen($settings_filename, 'w');
16 16
 		foreach ($settings as $settingname => $value) {
17 17
 			if ($value == 'TRUE' || $value == 'FALSE') {
18 18
 				$pattern = '/\R\$'.$settingname." = ".'(TRUE|FALSE)'."/";
@@ -78,21 +78,21 @@  discard block
 block discarded – undo
78 78
 				$replace = "\n".'\$'.$settingname." = '".$value."'";
79 79
 			}
80 80
 			$rep_cnt = 0;
81
-			$content = preg_replace($pattern,$replace,$content,1,$rep_cnt);
81
+			$content = preg_replace($pattern, $replace, $content, 1, $rep_cnt);
82 82
 			
83 83
 			/// If setting was a string and is now an array
84 84
 			if ($rep_cnt == 0 && is_array($value)) {
85 85
 				$pattern = '/\R\$'.$settingname." = '".'(.*)'."'/";
86
-				$content = preg_replace($pattern,$replace,$content,1,$rep_cnt);
86
+				$content = preg_replace($pattern, $replace, $content, 1, $rep_cnt);
87 87
 			}
88 88
 			
89 89
 			// If setting is not in settings.php (for update)
90 90
 			if ($rep_cnt == 0) {
91
-				$content = preg_replace('/\?>/',$replace.";\n?>",$content,1,$rep_cnt);
91
+				$content = preg_replace('/\?>/', $replace.";\n?>", $content, 1, $rep_cnt);
92 92
 			}
93 93
 
94 94
 		}
95
-		fwrite($fh,$content);
95
+		fwrite($fh, $content);
96 96
 		fclose($fh);
97 97
 	}
98 98
 
@@ -104,13 +104,13 @@  discard block
 block discarded – undo
104 104
 		$Common = new Common();
105 105
 		$settings_filename = '../require/settings.php';
106 106
 		$content = file_get_contents($settings_filename);
107
-		$fh = fopen($settings_filename,'w');
107
+		$fh = fopen($settings_filename, 'w');
108 108
 		foreach ($settings as $settingname) {
109 109
 			$pattern = '/\R\$'.$settingname." = /";
110 110
 			$replace = '//$'.$settingname." = ";
111
-			$content = preg_replace($pattern,$replace,$content);
111
+			$content = preg_replace($pattern, $replace, $content);
112 112
 		}
113
-		fwrite($fh,$content);
113
+		fwrite($fh, $content);
114 114
 		fclose($fh);
115 115
 	}
116 116
 }
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -70,7 +70,9 @@
 block discarded – undo
70 70
 						}
71 71
 					}
72 72
 				}
73
-				if (!isset($array_value)) $array_value = '';
73
+				if (!isset($array_value)) {
74
+					$array_value = '';
75
+				}
74 76
 				$replace = "\n".'\$'.$settingname." = array(".$array_value.")";
75 77
 				unset($array_value);
76 78
 			} else {
Please login to merge, or discard this patch.
airport-detailed.php 3 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 			$metar_info = $METAR->getMETAR($airport_icao);
47 47
 			//print_r($metar_info);
48 48
 			if (isset($metar_info[0]['metar'])) $metar_parse = $METAR->parse($metar_info[0]['metar']);
49
-            		//print_r($metar_parse);
49
+					//print_r($metar_parse);
50 50
 		}
51 51
 		
52 52
 		$title = sprintf(_("Detailed View for %s, %s (%s)"),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']);
@@ -99,13 +99,13 @@  discard block
 block discarded – undo
99 99
                       function drawChart6() {
100 100
                         var data = google.visualization.arrayToDataTable([
101 101
                             ["'._("Date").'","'._("Departure").'","'._("Arrival").'"], ';
102
-                            $airport_data = '';
103
-                                foreach($all_data as $data)
104
-                                {
105
-                                        $airport_data .= '[ "'.$data['date'].'",'.$data['departure'].','.$data['arrival'].'],';
106
-                                }
107
-                                $airport_data = substr($airport_data, 0, -1);
108
-                                print $airport_data.']);
102
+							$airport_data = '';
103
+								foreach($all_data as $data)
104
+								{
105
+										$airport_data .= '[ "'.$data['date'].'",'.$data['departure'].','.$data['arrival'].'],';
106
+								}
107
+								$airport_data = substr($airport_data, 0, -1);
108
+								print $airport_data.']);
109 109
 
110 110
                         var options = {
111 111
                     	    legend: {position: "none"},
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 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
 	//calculuation 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,13 +28,13 @@  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
 	$page_url = $globalURL.'/airport/'.$airport_icao;
33 33
 	
34 34
 	if (isset($_GET['sort'])) {
35
-		$spotter_array = $Spotter->getSpotterDataByAirport($airport_icao,$limit_start.",".$absolute_difference, $_GET['sort']);
35
+		$spotter_array = $Spotter->getSpotterDataByAirport($airport_icao, $limit_start.",".$absolute_difference, $_GET['sort']);
36 36
 	} else {
37
-		$spotter_array = $Spotter->getSpotterDataByAirport($airport_icao,$limit_start.",".$absolute_difference, '');
37
+		$spotter_array = $Spotter->getSpotterDataByAirport($airport_icao, $limit_start.",".$absolute_difference, '');
38 38
 	}
39 39
 	$airport_array = $Spotter->getAllAirportInfo($airport_icao);
40 40
 	
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
             		//print_r($metar_parse);
50 50
 		}
51 51
 		
52
-		$title = sprintf(_("Detailed View for %s, %s (%s)"),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']);
52
+		$title = sprintf(_("Detailed View for %s, %s (%s)"), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']);
53 53
 
54 54
 		require_once('header.php');
55 55
 		print '<div class="select-item">';
@@ -58,9 +58,9 @@  discard block
 block discarded – undo
58 58
 		print '<option></option>';
59 59
 		$airport_names = $Spotter->getAllAirportNames();
60 60
 		ksort($airport_names);
61
-		foreach($airport_names as $airport_name)
61
+		foreach ($airport_names as $airport_name)
62 62
 		{
63
-			if($airport_icao == $airport_name['airport_icao'])
63
+			if ($airport_icao == $airport_name['airport_icao'])
64 64
 			{
65 65
 				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>';
66 66
 			} else {
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
                         var data = google.visualization.arrayToDataTable([
101 101
                             ["'._("Date").'","'._("Departure").'","'._("Arrival").'"], ';
102 102
                             $airport_data = '';
103
-                                foreach($all_data as $data)
103
+                                foreach ($all_data as $data)
104 104
                                 {
105 105
                                         $airport_data .= '[ "'.$data['date'].'",'.$data['departure'].','.$data['arrival'].'],';
106 106
                                 }
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 					print _("Dew point:").' '.$metar_parse['dew'].' °C'." - ";
154 154
 				}
155 155
 				if (isset($metar_parse['temperature']) && isset($metar_parse['dew'])) {
156
-					$humidity = round(100 * pow((112 - (0.1 * $metar_parse['temperature']) + $metar_parse['dew']) / (112 + (0.9 * $metar_parse['temperature'])), 8),1);
156
+					$humidity = round(100*pow((112 - (0.1*$metar_parse['temperature']) + $metar_parse['dew'])/(112 + (0.9*$metar_parse['temperature'])), 8), 1);
157 157
 					print _("Humidity:").' '.$humidity.'%'." - ";
158 158
 				}
159 159
 				if (isset($metar_parse['QNH'])) {
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
 		print '<div class="table column">';
170 170
 		 if ($airport_array[0]['iata'] != "NA")
171 171
 		{
172
-			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>';
172
+			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>';
173 173
 		}
174 174
 		include('table-output.php');  
175 175
 		print '<div class="pagination">';
Please login to merge, or discard this patch.
Braces   +7 added lines, -3 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];
@@ -45,7 +45,9 @@  discard block
 block discarded – undo
45 45
 			$METAR = new METAR();
46 46
 			$metar_info = $METAR->getMETAR($airport_icao);
47 47
 			//print_r($metar_info);
48
-			if (isset($metar_info[0]['metar'])) $metar_parse = $METAR->parse($metar_info[0]['metar']);
48
+			if (isset($metar_info[0]['metar'])) {
49
+				$metar_parse = $METAR->parse($metar_info[0]['metar']);
50
+			}
49 51
             		//print_r($metar_parse);
50 52
 		}
51 53
 		
@@ -90,7 +92,9 @@  discard block
 block discarded – undo
90 92
 			$all_data = $Stats->getLast7DaysAirports($airport_icao);
91 93
 			if (isset($globalTimezone)) {
92 94
 				date_default_timezone_set($globalTimezone);
93
-			} else date_default_timezone_set('UTC');
95
+			} else {
96
+				date_default_timezone_set('UTC');
97
+			}
94 98
 			if (count($all_data) > 0) {
95 99
 				print '<div id="chart6" class="chart" width="100%"></div>
96 100
                     <script> 
Please login to merge, or discard this patch.
statistics-month.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
             	["'._("Month").'", "'._("# of Flights").'"], ';
24 24
 
25 25
 $date_data = '';
26
-foreach($date_array as $date_item)
26
+foreach ($date_array as $date_item)
27 27
 {
28 28
 	$date_data .= '[ "'.date("F j, Y", strtotime($date_item['date_name'])).'",'.$date_item['date_count'].'],';
29 29
 }
@@ -60,12 +60,12 @@  discard block
 block discarded – undo
60 60
 	print '</thead>';
61 61
 	print '<tbody>';
62 62
 	$i = 1;
63
-	foreach($date_array as $date_item)
63
+	foreach ($date_array as $date_item)
64 64
 	{
65 65
 		print '<tr>';
66 66
 		print '<td><strong>'.$i.'</strong></td>';
67 67
 		print '<td>';
68
-		print '<a href="'.$globalURL.'/date/'.date('Y-m-d',strtotime($date_item['date_name'])).'">'.date("l F j, Y", strtotime($date_item['date_name'])).'</a>';
68
+		print '<a href="'.$globalURL.'/date/'.date('Y-m-d', strtotime($date_item['date_name'])).'">'.date("l F j, Y", strtotime($date_item['date_name'])).'</a>';
69 69
 		print '</td>';
70 70
 		print '<td>';
71 71
 		print $date_item['date_count'];
Please login to merge, or discard this patch.
route-statistics-time.php 3 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -9,14 +9,14 @@  discard block
 block discarded – undo
9 9
 require_once('require/class.Language.php');
10 10
 
11 11
 $Spotter = new Spotter();
12
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
12
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
13 13
 if (isset($_GET['departure_airport']) && isset($_GET['arrival_airport'])) {
14 14
 	$spotter_array = $Spotter->getSpotterDataByRoute($_GET['departure_airport'], $_GET['arrival_airport'], "0,1", $sort);
15 15
 } else $spotter_array = array();
16 16
 
17 17
 if (!empty($spotter_array))
18 18
 {
19
-	$title = sprintf(_("Most Common Time of Day 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
+	$title = sprintf(_("Most Common Time of Day 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']);
20 20
 	require_once('header.php');
21 21
 	print '<div class="info column">';
22 22
 	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>';
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 	include('route-sub-menu.php');
28 28
 	print '<div class="column">';
29 29
 	print '<h2>'._("Most Common Time of Day").'</h2>';
30
-	print '<p>'.sprintf(_("The statistic below shows the most common time of day 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
+	print '<p>'.sprintf(_("The statistic below shows the most common time of day 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>';
31 31
 
32 32
 	$hour_array = $Spotter->countAllHoursByRoute($_GET['departure_airport'], $_GET['arrival_airport']);
33 33
 	print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>';
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
             var data = google.visualization.arrayToDataTable([
40 40
             	["'._("Hour").'", "'._("# of Flights").'"], ';
41 41
             	$hour_data = '';
42
-	foreach($hour_array as $hour_item)
42
+	foreach ($hour_array as $hour_item)
43 43
 	{
44 44
 		$hour_data .= '[ "'.date("ga", strtotime($hour_item['hour_name'].":00")).'",'.$hour_item['hour_count'].'],';
45 45
 	}
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
           function drawChart() {
35 35
             var data = google.visualization.arrayToDataTable([
36 36
             	["'._("Hour").'", "'._("# of Flights").'"], ';
37
-            	$hour_data = '';
37
+				$hour_data = '';
38 38
 	foreach($hour_array as $hour_item)
39 39
 	{
40 40
 		$hour_data .= '[ "'.date("ga", strtotime($hour_item['hour_name'].":00")).'",'.$hour_item['hour_count'].'],';
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,9 @@
 block discarded – undo
12 12
 $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
13 13
 if (isset($_GET['departure_airport']) && isset($_GET['arrival_airport'])) {
14 14
 	$spotter_array = $Spotter->getSpotterDataByRoute($_GET['departure_airport'], $_GET['arrival_airport'], "0,1", $sort);
15
-} else $spotter_array = array();
15
+} else {
16
+	$spotter_array = array();
17
+}
16 18
   
17 19
 if (!empty($spotter_array))
18 20
 {
Please login to merge, or discard this patch.
ident-statistics-departure-airport.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -7,13 +7,13 @@  discard block
 block discarded – undo
7 7
         die();
8 8
 }
9 9
 $Spotter = new Spotter();
10
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
11
-$ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING);
12
-$spotter_array = $Spotter->getSpotterDataByIdent($ident,"0,1", $sort);
10
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
11
+$ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING);
12
+$spotter_array = $Spotter->getSpotterDataByIdent($ident, "0,1", $sort);
13 13
 
14 14
 if (!empty($spotter_array))
15 15
 {
16
-	$title = sprintf(_("Most Common Departure Airports of %s"),$spotter_array[0]['ident']);
16
+	$title = sprintf(_("Most Common Departure Airports of %s"), $spotter_array[0]['ident']);
17 17
 	require_once('header.php');
18 18
 	print '<div class="info column">';
19 19
 	print '<h1>'.$spotter_array[0]['ident'].'</h1>';
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 	include('ident-sub-menu.php');
25 25
 	print '<div class="column">';
26 26
 	print '<h2>'._("Most Common Departure Airports").'</h2>';
27
-	print '<p>'.sprintf(_("The statistic below shows all departure airports of flights with the ident/callsign <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>';
27
+	print '<p>'.sprintf(_("The statistic below shows all departure airports of flights with the ident/callsign <strong>%s</strong>."), $spotter_array[0]['ident']).'</p>';
28 28
 	$airport_airport_array = $Spotter->countAllDepartureAirportsByIdent($ident);
29 29
 	print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>
30 30
     	<script>
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
         	["'._("Airport").'", "'._("# of times").'"],';
40 40
 
41 41
 	$airport_data = '';
42
-	foreach($airport_airport_array as $airport_item)
42
+	foreach ($airport_airport_array as $airport_item)
43 43
 	{
44 44
 		$name = $airport_item['airport_departure_city'].', '.$airport_item['airport_departure_country'].' ('.$airport_item['airport_departure_icao'].')';
45 45
 		$name = str_replace("'", "", $name);
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 	print '</thead>';
79 79
 	print '<tbody>';
80 80
 	$i = 1;
81
-	foreach($airport_airport_array as $airport_item)
81
+	foreach ($airport_airport_array as $airport_item)
82 82
 	{
83 83
 		print '<tr>';
84 84
 		print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -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['ident'])) {
6
-        header('Location: '.$globalURL.'/ident');
7
-        die();
6
+		header('Location: '.$globalURL.'/ident');
7
+		die();
8 8
 }
9 9
 $Spotter = new Spotter();
10 10
 $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING);
Please login to merge, or discard this patch.
tools-notam.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 
11 11
 $page_url = $globalURL.'/tools-notam';
12 12
 
13
-$message = filter_input(INPUT_POST,'notam_message',FILTER_SANITIZE_STRING);
13
+$message = filter_input(INPUT_POST, 'notam_message', FILTER_SANITIZE_STRING);
14 14
 
15 15
 print '<div class="info column">';
16 16
 print '<h1>'._("Parse NOTAM messages").'</h1>';
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 	if (!empty($notam_parse)) {
35 35
 		print '<p>'._("NOTAM message in human readable format:").'</p>';
36 36
 		foreach ($notam_parse as $key => $value) {
37
-			print '<b>'.strtoupper(str_replace('_',' ',$key)).'</b>: '.$value.'<br />';
37
+			print '<b>'.strtoupper(str_replace('_', ' ', $key)).'</b>: '.$value.'<br />';
38 38
 		}
39 39
 	} else {
40 40
 		print '<p>'._("This NOTAM message can't be translated in human readable format :(").'</p>';
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,9 @@
 block discarded – undo
23 23
 print '<fieldset class="form-group">';
24 24
 print '<label for="notam_message">'._("NOTAM Message").'</label>';
25 25
 print '<textarea class="form-control" name="notam_message" id="notam_message" rows="5">';
26
-if ($message != '') print $message;
26
+if ($message != '') {
27
+	print $message;
28
+}
27 29
 print '</textarea>';
28 30
 print '</fieldset>';
29 31
 print '<button type="submit" class="btn btn-primary">Submit</button>';
Please login to merge, or discard this patch.