Completed
Push — master ( 73f088...7f17b6 )
by Yannick
07:13
created
search.php 2 patches
Spacing   +81 added lines, -81 removed lines patch added patch discarded remove patch
@@ -16,14 +16,14 @@  discard block
 block discarded – undo
16 16
 
17 17
 if (isset($_GET['start_date'])) {
18 18
 	//for the date manipulation into the query
19
-	if($_GET['start_date'] != "" && $_GET['end_date'] != ""){
19
+	if ($_GET['start_date'] != "" && $_GET['end_date'] != "") {
20 20
 		$start_date = $_GET['start_date']." 00:00:00";
21 21
 		$end_date = $_GET['end_date']." 00:00:00";
22 22
 		$sql_date = $start_date.",".$end_date;
23
-	} else if($_GET['start_date'] != ""){
23
+	} else if ($_GET['start_date'] != "") {
24 24
 		$start_date = $_GET['start_date']." 00:00:00";
25 25
 		$sql_date = $start_date;
26
-	} else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){
26
+	} else if ($_GET['start_date'] == "" && $_GET['end_date'] != "") {
27 27
 		$end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date']." 00:00:00";
28 28
 		$sql_date = $end_date;
29 29
 	} else $sql_date = '';
@@ -31,21 +31,21 @@  discard block
 block discarded – undo
31 31
 
32 32
 if (isset($_GET['highest_altitude'])) {
33 33
 	//for altitude manipulation
34
-	if($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != ""){
34
+	if ($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != "") {
35 35
 		$end_altitude = $_GET['highest_altitude'];
36 36
 		$start_altitude = $_GET['lowest_altitude'];
37 37
 		$sql_altitude = $start_altitude.",".$end_altitude;
38
-	} else if($_GET['highest_altitude'] != ""){
38
+	} else if ($_GET['highest_altitude'] != "") {
39 39
 		$end_altitude = $_GET['highest_altitude'];
40 40
 		$sql_altitude = $end_altitude;
41
-	} else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){
41
+	} else if ($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != "") {
42 42
 		$start_altitude = $_GET['lowest_altitude'].",60000";
43 43
 		$sql_altitude = $start_altitude;
44 44
 	} else $sql_altitude = '';
45 45
 } else $sql_altitude = '';
46 46
 
47 47
 //calculuation for the pagination
48
-if(!isset($_GET['limit']))
48
+if (!isset($_GET['limit']))
49 49
 {
50 50
 	if (!isset($_GET['number_results']))
51 51
 	{
@@ -53,14 +53,14 @@  discard block
 block discarded – undo
53 53
 		$limit_end = 25;
54 54
 		$absolute_difference = 25;
55 55
 	} else {
56
-		if ($_GET['number_results'] > 1000){
56
+		if ($_GET['number_results'] > 1000) {
57 57
 			$_GET['number_results'] = 1000;
58 58
 		}
59 59
 		$limit_start = 0;
60 60
 		$limit_end = $_GET['number_results'];
61 61
 		$absolute_difference = $_GET['number_results'];
62 62
 	}
63
-}  else {
63
+} else {
64 64
 	$limit_explode = explode(",", $_GET['limit']);
65 65
 	$limit_start = $limit_explode[0];
66 66
 	$limit_end = $limit_explode[1];
@@ -70,28 +70,28 @@  discard block
 block discarded – undo
70 70
 $limit_previous_1 = $limit_start - $absolute_difference;
71 71
 $limit_previous_2 = $limit_end - $absolute_difference;
72 72
 
73
-if (!empty($_GET)){  
74
-	$q = filter_input(INPUT_GET, 'q',FILTER_SANITIZE_STRING);
75
-	$registration = filter_input(INPUT_GET, 'registration',FILTER_SANITIZE_STRING);
76
-	$aircraft = filter_input(INPUT_GET, 'aircraft',FILTER_SANITIZE_STRING);
77
-	$manufacturer = filter_input(INPUT_GET, 'manufacturer',FILTER_SANITIZE_STRING);
78
-	$highlights = filter_input(INPUT_GET, 'highlights',FILTER_SANITIZE_STRING);
79
-	$airline = filter_input(INPUT_GET, 'airline',FILTER_SANITIZE_STRING);
80
-	$airline_country = filter_input(INPUT_GET, 'airline_country',FILTER_SANITIZE_STRING);
81
-	$airline_type = filter_input(INPUT_GET, 'airline_type',FILTER_SANITIZE_STRING);
82
-	$airport = filter_input(INPUT_GET, 'airport',FILTER_SANITIZE_STRING);
83
-	$airport_country = filter_input(INPUT_GET, 'airport_country',FILTER_SANITIZE_STRING);
84
-	$callsign = filter_input(INPUT_GET, 'callsign',FILTER_SANITIZE_STRING);
85
-	$owner = filter_input(INPUT_GET, 'owner',FILTER_SANITIZE_STRING);
86
-	$pilot_name = filter_input(INPUT_GET, 'pilot_name',FILTER_SANITIZE_STRING);
87
-	$pilot_id = filter_input(INPUT_GET, 'pilot_id',FILTER_SANITIZE_STRING);
88
-	$departure_airport_route = filter_input(INPUT_GET, 'departure_airport_route',FILTER_SANITIZE_STRING);
89
-	$arrival_airport_route = filter_input(INPUT_GET, 'arrival_airport_route',FILTER_SANITIZE_STRING);
90
-	$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
91
-	$archive = filter_input(INPUT_GET,'archive',FILTER_SANITIZE_NUMBER_INT);
92
-	$origlat = filter_input(INPUT_GET,'origlat',FILTER_SANITIZE_STRING);
93
-	$origlon = filter_input(INPUT_GET,'origlon',FILTER_SANITIZE_STRING);
94
-	$dist = filter_input(INPUT_GET,'dist',FILTER_SANITIZE_NUMBER_INT);
73
+if (!empty($_GET)) {  
74
+	$q = filter_input(INPUT_GET, 'q', FILTER_SANITIZE_STRING);
75
+	$registration = filter_input(INPUT_GET, 'registration', FILTER_SANITIZE_STRING);
76
+	$aircraft = filter_input(INPUT_GET, 'aircraft', FILTER_SANITIZE_STRING);
77
+	$manufacturer = filter_input(INPUT_GET, 'manufacturer', FILTER_SANITIZE_STRING);
78
+	$highlights = filter_input(INPUT_GET, 'highlights', FILTER_SANITIZE_STRING);
79
+	$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
80
+	$airline_country = filter_input(INPUT_GET, 'airline_country', FILTER_SANITIZE_STRING);
81
+	$airline_type = filter_input(INPUT_GET, 'airline_type', FILTER_SANITIZE_STRING);
82
+	$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING);
83
+	$airport_country = filter_input(INPUT_GET, 'airport_country', FILTER_SANITIZE_STRING);
84
+	$callsign = filter_input(INPUT_GET, 'callsign', FILTER_SANITIZE_STRING);
85
+	$owner = filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING);
86
+	$pilot_name = filter_input(INPUT_GET, 'pilot_name', FILTER_SANITIZE_STRING);
87
+	$pilot_id = filter_input(INPUT_GET, 'pilot_id', FILTER_SANITIZE_STRING);
88
+	$departure_airport_route = filter_input(INPUT_GET, 'departure_airport_route', FILTER_SANITIZE_STRING);
89
+	$arrival_airport_route = filter_input(INPUT_GET, 'arrival_airport_route', FILTER_SANITIZE_STRING);
90
+	$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
91
+	$archive = filter_input(INPUT_GET, 'archive', FILTER_SANITIZE_NUMBER_INT);
92
+	$origlat = filter_input(INPUT_GET, 'origlat', FILTER_SANITIZE_STRING);
93
+	$origlon = filter_input(INPUT_GET, 'origlon', FILTER_SANITIZE_STRING);
94
+	$dist = filter_input(INPUT_GET, 'dist', FILTER_SANITIZE_NUMBER_INT);
95 95
 	if ($dist != '') {
96 96
 		if (isset($globalDistanceUnit) && $globalDistanceUnit == 'mi') $dist = $dist*1.60934;
97 97
 		elseif (isset($globalDistanceUnit) && $globalDistanceUnit == 'nm') $dist = $dist*1.852;
@@ -99,9 +99,9 @@  discard block
 block discarded – undo
99 99
 	if (!isset($sql_date)) $sql_date = '';
100 100
 	if ($archive == 1) {
101 101
 		$SpotterArchive = new SpotterArchive();
102
-		$spotter_array = $SpotterArchive->searchSpotterData($q,$registration,$aircraft,strtolower(str_replace("-", " ", $manufacturer)),$highlights,$airline,$airline_country,$airline_type,$airport,$airport_country,$callsign,$departure_airport_route,$arrival_airport_route,$owner,$pilot_id,$pilot_name,$sql_altitude,$sql_date,$limit_start.",".$absolute_difference,$sort,'',$origlat,$origlon,$dist);
102
+		$spotter_array = $SpotterArchive->searchSpotterData($q, $registration, $aircraft, strtolower(str_replace("-", " ", $manufacturer)), $highlights, $airline, $airline_country, $airline_type, $airport, $airport_country, $callsign, $departure_airport_route, $arrival_airport_route, $owner, $pilot_id, $pilot_name, $sql_altitude, $sql_date, $limit_start.",".$absolute_difference, $sort, '', $origlat, $origlon, $dist);
103 103
 	} else {
104
-		$spotter_array = $Spotter->searchSpotterData($q,$registration,$aircraft,strtolower(str_replace("-", " ", $manufacturer)),$highlights,$airline,$airline_country,$airline_type,$airport,$airport_country,$callsign,$departure_airport_route,$arrival_airport_route,$owner,$pilot_id,$pilot_name,$sql_altitude,$sql_date,$limit_start.",".$absolute_difference,$sort,'',$origlat,$origlon,$dist);
104
+		$spotter_array = $Spotter->searchSpotterData($q, $registration, $aircraft, strtolower(str_replace("-", " ", $manufacturer)), $highlights, $airline, $airline_country, $airline_type, $airport, $airport_country, $callsign, $departure_airport_route, $arrival_airport_route, $owner, $pilot_id, $pilot_name, $sql_altitude, $sql_date, $limit_start.",".$absolute_difference, $sort, '', $origlat, $origlon, $dist);
105 105
 	}
106 106
 	 
107 107
 	print '<span class="sub-menu-statistic column mobile">';
@@ -134,12 +134,12 @@  discard block
 block discarded – undo
134 134
 	//remove 3D=true parameter
135 135
 	$no3D = str_replace("&3D=true", "", $_SERVER['QUERY_STRING']);
136 136
 	$kmlURL = str_replace("http://", "kml://", $globalURL);
137
-	if (!isset($_GET['3D'])){
137
+	if (!isset($_GET['3D'])) {
138 138
 		print '<li><a href="'.$globalURL.'/search?'.$no3D.'" class="active"><i class="fa fa-table"></i> '._("Table").'</a></li>';
139 139
 	} else {
140 140
 		print '<li><span class="notablet"><a href="'.$globalURL.'/search?'.$no3D.'"><i class="fa fa-table"></i> '._("Table").'</a></span></li>';
141 141
 	}
142
-	if (isset($_GET['3D'])){
142
+	if (isset($_GET['3D'])) {
143 143
 		print '<li><a href="'.$globalURL.'/search?'.$no3D.'&3D=true" class="active"><i class="fa fa-globe"></i> '._("3D Map").'</a></li>';
144 144
 	} else {
145 145
 		print '<li ><a href="'.$globalURL.'/search?'.$no3D.'&3D=true" class="notablet nomobile"><i class="fa fa-globe"></i> '._("3D Map").'</a><a href="'.$kmlURL.'/search/kml?'.htmlentities($_SERVER['QUERY_STRING']).'" class="tablet mobile"><i class="fa fa-globe"></i> 3D Map</a></li>';
@@ -160,30 +160,30 @@  discard block
 block discarded – undo
160 160
 		print '<div class="column">';
161 161
 		print '<div class="info">';
162 162
 		print '<h1>'._("Search Results for").' ';
163
-		if (isset($_GET['q']) && $_GET['q'] != ""){ print _("Keyword:").' <span>'.$_GET['q'].'</span> '; }
164
-		if (isset($_GET['aircraft']) && $_GET['aircraft'] != ""){ print _("Aircraft:").' <span>'.$_GET['aircraft'].'</span> '; }
165
-		if (isset($_GET['manufacturer']) && $_GET['manufacturer'] != ""){ print _("Manufacturer:").' <span>'.$_GET['manufacturer'].'</span> '; }
166
-		if (isset($_GET['registration']) && $_GET['registration'] != ""){ print _("Registration:").' <span>'.$_GET['registration'].'</span> '; }
167
-		if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true"){ print _("Highlights:").' <span>'.$_GET['highlights'].'</span> '; }
168
-		if (isset($_GET['airline']) && $_GET['airline'] != ""){ print _("Airline:").' <span>'.$_GET['airline'].'</span> '; }
169
-		if (isset($_GET['airline_country']) && $_GET['airline_country'] != ""){ print _("Airline country:").' <span>'.$_GET['airline_country'].'</span> '; }
170
-		if (isset($_GET['airline_type']) && $_GET['airline_type'] != ""){ print _("Airline type:").' <span>'.$_GET['airline_type'].'</span> '; }
171
-		if (isset($_GET['airport']) && $_GET['airport'] != ""){ print _("Airport:").' <span>'.$_GET['airport'].'</span> '; }
172
-		if (isset($_GET['airport_country']) && $_GET['airport_country'] != ""){ print _("Airport country:").' <span>'.$_GET['airport_country'].'</span> '; }
173
-		if (isset($_GET['callsign']) && $_GET['callsign'] != ""){ print _("Callsign:").' <span>'.$_GET['callsign'].'</span> '; }
174
-		if (isset($_GET['owner']) && $_GET['owner'] != ""){ print _("Owner:").' <span>'.$_GET['owner'].'</span> '; }
175
-		if (isset($_GET['pilot_id']) && $_GET['pilot_id'] != ""){ print _("Pilot id:").' <span>'.$_GET['pilot_id'].'</span> '; }
176
-		if (isset($_GET['pilot_name']) && $_GET['pilot_name'] != ""){ print _("Pilot name:").' <span>'.$_GET['pilot_name'].'</span> '; }
177
-		if (isset($_GET['departure_airport_route']) && $_GET['departure_airport_route'] != "" && (!isset($_GET['arrival_airport_route']) || $_GET['arrival_airport_route'] == "")){ print _("Route out of:").' <span>'.$_GET['departure_airport_route'].'</span> '; }
178
-		if (isset($_GET['departure_airport_route']) && $_GET['departure_airport_route'] == "" && isset($_GET['arrival_airport_route']) && $_GET['arrival_airport_route'] != ""){ print _("Route into:").' <span>'.$_GET['arrival_airport_route'].'</span> '; }
179
-		if (isset($_GET['departure_airport_route']) && $_GET['departure_airport_route'] != "" && isset($_GET['arrival_airport_route']) && $_GET['arrival_airport_route'] != ""){ print _("Route between:").' <span>'.$_GET['departure_airport_route'].'</span> and <span>'.$_GET['arrival_airport_route'].'</span> '; }
180
-		if (isset($_GET['start_date']) && $_GET['start_date'] != "" && isset($_GET['end_date']) && $_GET['end_date'] == ""){ print _("Date starting at:").' <span>'.$_GET['start_date'].'</span> '; }
181
-		if (isset($_GET['start_date']) && $_GET['start_date'] == "" && isset($_GET['end_date']) && $_GET['end_date'] != ""){ print _("Date ending at:").' <span>'.$_GET['end_date'].'</span> '; }
182
-		if (isset($_GET['start_date']) && $_GET['start_date'] != "" && isset($_GET['end_date']) && $_GET['end_date'] != ""){ print _("Date between:").' <span>'.$_GET['start_date'].'</span> and <span>'.$_GET['end_date'].'</span> '; }
183
-		if (isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] != "" && isset($_GET['highest_altitude']) && $_GET['highest_altitude'] == ""){ print _("Altitude starting at:").' <span>'.number_format($_GET['lowest_altitude']).' feet</span> '; }
184
-		if (isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] == "" && isset($_GET['highest_altitude']) && $_GET['highest_altitude'] != ""){ print _("Altitude ending at:").' <span>'.number_format($_GET['highest_altitude']).' feet</span> '; }
185
-		if (isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] != "" && isset($_GET['highest_altitude']) && $_GET['highest_altitude'] != ""){ print _("Altitude between:").' <span>'.number_format($_GET['lowest_altitude']).' feet</span> '._("and").' <span>'.number_format($_GET['highest_altitude']).' feet</span> '; }
186
-		if (isset($_GET['number_results']) && $_GET['number_results'] != ""){ print _("limit per page:").' <span>'.$_GET['number_results'].'</span> '; }
163
+		if (isset($_GET['q']) && $_GET['q'] != "") { print _("Keyword:").' <span>'.$_GET['q'].'</span> '; }
164
+		if (isset($_GET['aircraft']) && $_GET['aircraft'] != "") { print _("Aircraft:").' <span>'.$_GET['aircraft'].'</span> '; }
165
+		if (isset($_GET['manufacturer']) && $_GET['manufacturer'] != "") { print _("Manufacturer:").' <span>'.$_GET['manufacturer'].'</span> '; }
166
+		if (isset($_GET['registration']) && $_GET['registration'] != "") { print _("Registration:").' <span>'.$_GET['registration'].'</span> '; }
167
+		if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true") { print _("Highlights:").' <span>'.$_GET['highlights'].'</span> '; }
168
+		if (isset($_GET['airline']) && $_GET['airline'] != "") { print _("Airline:").' <span>'.$_GET['airline'].'</span> '; }
169
+		if (isset($_GET['airline_country']) && $_GET['airline_country'] != "") { print _("Airline country:").' <span>'.$_GET['airline_country'].'</span> '; }
170
+		if (isset($_GET['airline_type']) && $_GET['airline_type'] != "") { print _("Airline type:").' <span>'.$_GET['airline_type'].'</span> '; }
171
+		if (isset($_GET['airport']) && $_GET['airport'] != "") { print _("Airport:").' <span>'.$_GET['airport'].'</span> '; }
172
+		if (isset($_GET['airport_country']) && $_GET['airport_country'] != "") { print _("Airport country:").' <span>'.$_GET['airport_country'].'</span> '; }
173
+		if (isset($_GET['callsign']) && $_GET['callsign'] != "") { print _("Callsign:").' <span>'.$_GET['callsign'].'</span> '; }
174
+		if (isset($_GET['owner']) && $_GET['owner'] != "") { print _("Owner:").' <span>'.$_GET['owner'].'</span> '; }
175
+		if (isset($_GET['pilot_id']) && $_GET['pilot_id'] != "") { print _("Pilot id:").' <span>'.$_GET['pilot_id'].'</span> '; }
176
+		if (isset($_GET['pilot_name']) && $_GET['pilot_name'] != "") { print _("Pilot name:").' <span>'.$_GET['pilot_name'].'</span> '; }
177
+		if (isset($_GET['departure_airport_route']) && $_GET['departure_airport_route'] != "" && (!isset($_GET['arrival_airport_route']) || $_GET['arrival_airport_route'] == "")) { print _("Route out of:").' <span>'.$_GET['departure_airport_route'].'</span> '; }
178
+		if (isset($_GET['departure_airport_route']) && $_GET['departure_airport_route'] == "" && isset($_GET['arrival_airport_route']) && $_GET['arrival_airport_route'] != "") { print _("Route into:").' <span>'.$_GET['arrival_airport_route'].'</span> '; }
179
+		if (isset($_GET['departure_airport_route']) && $_GET['departure_airport_route'] != "" && isset($_GET['arrival_airport_route']) && $_GET['arrival_airport_route'] != "") { print _("Route between:").' <span>'.$_GET['departure_airport_route'].'</span> and <span>'.$_GET['arrival_airport_route'].'</span> '; }
180
+		if (isset($_GET['start_date']) && $_GET['start_date'] != "" && isset($_GET['end_date']) && $_GET['end_date'] == "") { print _("Date starting at:").' <span>'.$_GET['start_date'].'</span> '; }
181
+		if (isset($_GET['start_date']) && $_GET['start_date'] == "" && isset($_GET['end_date']) && $_GET['end_date'] != "") { print _("Date ending at:").' <span>'.$_GET['end_date'].'</span> '; }
182
+		if (isset($_GET['start_date']) && $_GET['start_date'] != "" && isset($_GET['end_date']) && $_GET['end_date'] != "") { print _("Date between:").' <span>'.$_GET['start_date'].'</span> and <span>'.$_GET['end_date'].'</span> '; }
183
+		if (isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] != "" && isset($_GET['highest_altitude']) && $_GET['highest_altitude'] == "") { print _("Altitude starting at:").' <span>'.number_format($_GET['lowest_altitude']).' feet</span> '; }
184
+		if (isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] == "" && isset($_GET['highest_altitude']) && $_GET['highest_altitude'] != "") { print _("Altitude ending at:").' <span>'.number_format($_GET['highest_altitude']).' feet</span> '; }
185
+		if (isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] != "" && isset($_GET['highest_altitude']) && $_GET['highest_altitude'] != "") { print _("Altitude between:").' <span>'.number_format($_GET['lowest_altitude']).' feet</span> '._("and").' <span>'.number_format($_GET['highest_altitude']).' feet</span> '; }
186
+		if (isset($_GET['number_results']) && $_GET['number_results'] != "") { print _("limit per page:").' <span>'.$_GET['number_results'].'</span> '; }
187 187
 		print '</h1>';
188 188
 		print '</div>';
189 189
 
@@ -286,14 +286,14 @@  discard block
 block discarded – undo
286 286
 						<option></option>
287 287
 					</select>
288 288
 				</div>
289
-				<script type="text/javascript">getSelect('manufacturer','<?php if(isset($_GET['manufacturer'])) print $_GET['manufacturer']; ?>')</script>
289
+				<script type="text/javascript">getSelect('manufacturer','<?php if (isset($_GET['manufacturer'])) print $_GET['manufacturer']; ?>')</script>
290 290
 				<div class="form-group">
291 291
 					<label><?php echo _("Type"); ?></label> 
292 292
 					<select name="aircraft" id="aircrafttypes" class="selectpicker" data-live-search="true">
293 293
 						<option></option>
294 294
 					</select>
295 295
 				</div>
296
-				<script type="text/javascript">getSelect('aircrafttypes','<?php if(isset($_GET['aircraft_icao'])) print $_GET['aircraft_icao']; ?>');</script>
296
+				<script type="text/javascript">getSelect('aircrafttypes','<?php if (isset($_GET['aircraft_icao'])) print $_GET['aircraft_icao']; ?>');</script>
297 297
 				<div class="form-group">
298 298
 					<label><?php echo _("Registration"); ?></label> 
299 299
 					<input type="text" name="registration" value="<?php if (isset($_GET['registration'])) print $_GET['registration']; ?>" size="8" />
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
 					<input type="text" name="pilot_name" value="<?php if (isset($_GET['pilot_name'])) print $_GET['pilot_name']; ?>" size="15" />
311 311
 				</div>
312 312
 <?php
313
-}else {
313
+} else {
314 314
 ?>
315 315
 				<div class="form-group">
316 316
 					<label><?php echo _("Owner name"); ?></label> 
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
 }
321 321
 ?>
322 322
 				<div class="form-group checkbox">
323
-					<div><input type="checkbox" name="highlights" value="true" id="highlights" <?php if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true"){ print 'checked="checked"'; } ?>> <label for="highlights"><?php echo _("Include only aircrafts with special highlights (unique liveries, destinations etc.)"); ?></label></div>
323
+					<div><input type="checkbox" name="highlights" value="true" id="highlights" <?php if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true") { print 'checked="checked"'; } ?>> <label for="highlights"><?php echo _("Include only aircrafts with special highlights (unique liveries, destinations etc.)"); ?></label></div>
324 324
 				</div>
325 325
 			</fieldset>
326 326
 			<fieldset>
@@ -331,23 +331,23 @@  discard block
 block discarded – undo
331 331
 						<option></option>
332 332
 					</select>
333 333
 				</div>
334
-				<script type="text/javascript">getSelect('airlinenames','<?php if(isset($_GET['airline'])) print $_GET['airline']; ?>');</script>
334
+				<script type="text/javascript">getSelect('airlinenames','<?php if (isset($_GET['airline'])) print $_GET['airline']; ?>');</script>
335 335
 				<div class="form-group">
336 336
 					<label><?php echo _("Country"); ?></label> 
337 337
 					<select name="airline_country" id="airlinecountries" class="selectpicker" data-live-search="true">
338 338
 						<option></option>
339 339
 					</select>
340 340
 				</div>
341
-				<script type="text/javascript">getSelect('airlinecountries','<?php if(isset($_GET['airline_country'])) print $_GET['airline_country']; ?>');</script>
341
+				<script type="text/javascript">getSelect('airlinecountries','<?php if (isset($_GET['airline_country'])) print $_GET['airline_country']; ?>');</script>
342 342
 				<div class="form-group">
343 343
 					<label><?php echo _("Callsign"); ?></label> 
344 344
 					<input type="text" name="callsign" value="<?php if (isset($_GET['callsign'])) print $_GET['callsign']; ?>" size="8" />
345 345
 				</div>
346 346
 				<div class="form-group radio">
347
-					<div><input type="radio" name="airline_type" value="all" id="airline_type_all" <?php if (!isset($_GET['airline_type']) || $_GET['airline_type'] == "all"){ print 'checked="checked"'; } ?>> <label for="airline_type_all"><?php echo _("All airlines types"); ?></label></div>
348
-					<div><input type="radio" name="airline_type" value="passenger" id="airline_type_passenger" <?php if (isset($_GET['airline_type'])) if ($_GET['airline_type'] == "passenger"){ print 'checked="checked"'; } ?>> <label for="airline_type_passenger"><?php echo _("Only Passenger airlines"); ?></label></div>
349
-					<div><input type="radio" name="airline_type" value="cargo" id="airline_type_cargo" <?php if (isset($_GET['airline_type'])) if ( $_GET['airline_type'] == "cargo"){ print 'checked="checked"'; } ?>> <label for="airline_type_cargo"><?php echo _("Only Cargo airlines"); ?></label></div>
350
-					<div><input type="radio" name="airline_type" value="military" id="airline_type_military" <?php if (isset($_GET['airline_type'])) if ( $_GET['airline_type'] == "military"){ print 'checked="checked"'; } ?>> <label for="airline_type_military"><?php echo _("Only Military airlines"); ?></label></div>
347
+					<div><input type="radio" name="airline_type" value="all" id="airline_type_all" <?php if (!isset($_GET['airline_type']) || $_GET['airline_type'] == "all") { print 'checked="checked"'; } ?>> <label for="airline_type_all"><?php echo _("All airlines types"); ?></label></div>
348
+					<div><input type="radio" name="airline_type" value="passenger" id="airline_type_passenger" <?php if (isset($_GET['airline_type'])) if ($_GET['airline_type'] == "passenger") { print 'checked="checked"'; } ?>> <label for="airline_type_passenger"><?php echo _("Only Passenger airlines"); ?></label></div>
349
+					<div><input type="radio" name="airline_type" value="cargo" id="airline_type_cargo" <?php if (isset($_GET['airline_type'])) if ($_GET['airline_type'] == "cargo") { print 'checked="checked"'; } ?>> <label for="airline_type_cargo"><?php echo _("Only Cargo airlines"); ?></label></div>
350
+					<div><input type="radio" name="airline_type" value="military" id="airline_type_military" <?php if (isset($_GET['airline_type'])) if ($_GET['airline_type'] == "military") { print 'checked="checked"'; } ?>> <label for="airline_type_military"><?php echo _("Only Military airlines"); ?></label></div>
351 351
 				</div>
352 352
 			</fieldset>
353 353
 			<fieldset>
@@ -358,14 +358,14 @@  discard block
 block discarded – undo
358 358
 						<option></option>
359 359
 					</select>
360 360
 				</div>
361
-				<script type="text/javascript">getSelect('airportnames','<?php if(isset($_GET['airport_icao'])) print $_GET['airport_icao']; ?>');</script>
361
+				<script type="text/javascript">getSelect('airportnames','<?php if (isset($_GET['airport_icao'])) print $_GET['airport_icao']; ?>');</script>
362 362
 				<div class="form-group">
363 363
 					<label><?php echo _("Country"); ?></label> 
364 364
 					<select name="airport_country" id="airportcountries" class="selectpicker" data-live-search="true">
365 365
 						<option></option>
366 366
 					</select>
367 367
 				</div>
368
-				<script type="text/javascript">getSelect('airportcountries','<?php if(isset($_GET['airport_country'])) print $_GET['airport_country']; ?>');</script>
368
+				<script type="text/javascript">getSelect('airportcountries','<?php if (isset($_GET['airport_country'])) print $_GET['airport_country']; ?>');</script>
369 369
 			</fieldset>
370 370
 			<fieldset>
371 371
 				<legend><?php echo _("Route"); ?></legend>
@@ -375,14 +375,14 @@  discard block
 block discarded – undo
375 375
 						<option></option>
376 376
 					</select>
377 377
 				</div>
378
-				<script type="text/javascript">getSelect('departureairportnames','<?php if(isset($_GET['departure_airport_route'])) print $_GET['departure_airport_route']; ?>');</script>
378
+				<script type="text/javascript">getSelect('departureairportnames','<?php if (isset($_GET['departure_airport_route'])) print $_GET['departure_airport_route']; ?>');</script>
379 379
 				<div class="form-group">
380 380
 					<label><?php echo _("Arrival Airport"); ?></label> 
381 381
 					<select name="arrival_airport_route" id="arrivalairportnames" class="selectpicker" data-live-search="true">
382 382
 						<option></option>
383 383
 					</select>
384 384
 				</div>
385
-				<script type="text/javascript">getSelect('arrivalairportnames','<?php if(isset($_GET['arrival_airport_route'])) print $_GET['arrival_airport_route']; ?>');</script>
385
+				<script type="text/javascript">getSelect('arrivalairportnames','<?php if (isset($_GET['arrival_airport_route'])) print $_GET['arrival_airport_route']; ?>');</script>
386 386
 			</fieldset>
387 387
 			<fieldset>
388 388
 				<legend><?php echo _("Date"); ?></legend>
@@ -432,9 +432,9 @@  discard block
 block discarded – undo
432 432
 					<option></option>
433 433
 <?php
434 434
 $altitude_array = Array(1000, 5000, 10000, 15000, 20000, 25000, 30000, 35000, 40000, 45000, 50000);
435
-foreach($altitude_array as $altitude)
435
+foreach ($altitude_array as $altitude)
436 436
 {
437
-	if(isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] == $altitude)
437
+	if (isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] == $altitude)
438 438
 	{
439 439
 		print '<option value="'.$altitude.'" selected="selected">'.number_format($altitude).' feet</option>';
440 440
 	} else {
@@ -450,9 +450,9 @@  discard block
 block discarded – undo
450 450
 					<option></option>
451 451
 <?php
452 452
 $altitude_array = Array(1000, 5000, 10000, 15000, 20000, 25000, 30000, 35000, 40000, 45000, 50000);
453
-foreach($altitude_array as $altitude)
453
+foreach ($altitude_array as $altitude)
454 454
 {
455
-	if(isset($_GET['highest_altitude']) && $_GET['highest_altitude'] == $altitude)
455
+	if (isset($_GET['highest_altitude']) && $_GET['highest_altitude'] == $altitude)
456 456
 	{
457 457
 		print '<option value="'.$altitude.'" selected="selected">'.number_format($altitude).' feet</option>';
458 458
 	} else {
@@ -484,10 +484,10 @@  discard block
 block discarded – undo
484 484
 				<label><?php echo _("Number of Results"); ?></label> 
485 485
 				<select name="number_results">
486 486
 <?php
487
-$number_results_array = Array(25, 50, 100, 150, 200, 250, 300, 400, 500,  600, 700, 800, 900, 1000);
488
-foreach($number_results_array as $number)
487
+$number_results_array = Array(25, 50, 100, 150, 200, 250, 300, 400, 500, 600, 700, 800, 900, 1000);
488
+foreach ($number_results_array as $number)
489 489
 {
490
-	if(isset($_GET['number_results']) && $_GET['number_results'] == $number)
490
+	if (isset($_GET['number_results']) && $_GET['number_results'] == $number)
491 491
 	{
492 492
 		print '<option value="'.$number.'" selected="selected">'.$number.'</option>';
493 493
 	} else {
@@ -503,7 +503,7 @@  discard block
 block discarded – undo
503 503
 ?>
504 504
 		<fieldset>
505 505
 			<div class="form-group">
506
-				<label><?php echo sprintf(_("Search in archive (older than %s months)"),$globalArchiveKeepMonths); ?></label>
506
+				<label><?php echo sprintf(_("Search in archive (older than %s months)"), $globalArchiveKeepMonths); ?></label>
507 507
 				<input type="checkbox" name="archive" value="1" />
508 508
 			</div>
509 509
 		</fieldset>
Please login to merge, or discard this patch.
Braces   +112 added lines, -31 removed lines patch added patch discarded remove patch
@@ -26,8 +26,12 @@  discard block
 block discarded – undo
26 26
 	} else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){
27 27
 		$end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date']." 00:00:00";
28 28
 		$sql_date = $end_date;
29
-	} else $sql_date = '';
30
-} else $sql_date = '';
29
+	} else {
30
+		$sql_date = '';
31
+	}
32
+	} else {
33
+	$sql_date = '';
34
+}
31 35
 
32 36
 if (isset($_GET['highest_altitude'])) {
33 37
 	//for altitude manipulation
@@ -41,8 +45,12 @@  discard block
 block discarded – undo
41 45
 	} else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){
42 46
 		$start_altitude = $_GET['lowest_altitude'].",60000";
43 47
 		$sql_altitude = $start_altitude;
44
-	} else $sql_altitude = '';
45
-} else $sql_altitude = '';
48
+	} else {
49
+		$sql_altitude = '';
50
+	}
51
+	} else {
52
+	$sql_altitude = '';
53
+}
46 54
 
47 55
 //calculuation for the pagination
48 56
 if(!isset($_GET['limit']))
@@ -60,7 +68,7 @@  discard block
 block discarded – undo
60 68
 		$limit_end = $_GET['number_results'];
61 69
 		$absolute_difference = $_GET['number_results'];
62 70
 	}
63
-}  else {
71
+} else {
64 72
 	$limit_explode = explode(",", $_GET['limit']);
65 73
 	$limit_start = $limit_explode[0];
66 74
 	$limit_end = $limit_explode[1];
@@ -93,10 +101,15 @@  discard block
 block discarded – undo
93 101
 	$origlon = filter_input(INPUT_GET,'origlon',FILTER_SANITIZE_STRING);
94 102
 	$dist = filter_input(INPUT_GET,'dist',FILTER_SANITIZE_NUMBER_INT);
95 103
 	if ($dist != '') {
96
-		if (isset($globalDistanceUnit) && $globalDistanceUnit == 'mi') $dist = $dist*1.60934;
97
-		elseif (isset($globalDistanceUnit) && $globalDistanceUnit == 'nm') $dist = $dist*1.852;
104
+		if (isset($globalDistanceUnit) && $globalDistanceUnit == 'mi') {
105
+			$dist = $dist*1.60934;
106
+		} elseif (isset($globalDistanceUnit) && $globalDistanceUnit == 'nm') {
107
+			$dist = $dist*1.852;
108
+		}
109
+	}
110
+	if (!isset($sql_date)) {
111
+		$sql_date = '';
98 112
 	}
99
-	if (!isset($sql_date)) $sql_date = '';
100 113
 	if ($archive == 1) {
101 114
 		$SpotterArchive = new SpotterArchive();
102 115
 		$spotter_array = $SpotterArchive->searchSpotterData($q,$registration,$aircraft,strtolower(str_replace("-", " ", $manufacturer)),$highlights,$airline,$airline_country,$airline_type,$airport,$airport_country,$callsign,$departure_airport_route,$arrival_airport_route,$owner,$pilot_id,$pilot_name,$sql_altitude,$sql_date,$limit_start.",".$absolute_difference,$sort,'',$origlat,$origlon,$dist);
@@ -164,7 +177,10 @@  discard block
 block discarded – undo
164 177
 		if (isset($_GET['aircraft']) && $_GET['aircraft'] != ""){ print _("Aircraft:").' <span>'.$_GET['aircraft'].'</span> '; }
165 178
 		if (isset($_GET['manufacturer']) && $_GET['manufacturer'] != ""){ print _("Manufacturer:").' <span>'.$_GET['manufacturer'].'</span> '; }
166 179
 		if (isset($_GET['registration']) && $_GET['registration'] != ""){ print _("Registration:").' <span>'.$_GET['registration'].'</span> '; }
167
-		if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true"){ print _("Highlights:").' <span>'.$_GET['highlights'].'</span> '; }
180
+		if (isset($_GET['highlights'])) {
181
+			if ($_GET['highlights'] == "true"){ print _("Highlights:").' <span>'.$_GET['highlights'].'</span> ';
182
+		}
183
+		}
168 184
 		if (isset($_GET['airline']) && $_GET['airline'] != ""){ print _("Airline:").' <span>'.$_GET['airline'].'</span> '; }
169 185
 		if (isset($_GET['airline_country']) && $_GET['airline_country'] != ""){ print _("Airline country:").' <span>'.$_GET['airline_country'].'</span> '; }
170 186
 		if (isset($_GET['airline_type']) && $_GET['airline_type'] != ""){ print _("Airline type:").' <span>'.$_GET['airline_type'].'</span> '; }
@@ -274,7 +290,10 @@  discard block
 block discarded – undo
274 290
 		<fieldset>
275 291
 			<div class="form-group">
276 292
 				<label><?php echo _("Keywords"); ?></label> 
277
-				<input type="text" id="q" name="q" value="<?php if (isset($_GET['q'])) print $_GET['q']; ?>" size="10" placeholder="<?php echo _("Keywords"); ?>" />
293
+				<input type="text" id="q" name="q" value="<?php if (isset($_GET['q'])) {
294
+	print $_GET['q'];
295
+}
296
+?>" size="10" placeholder="<?php echo _("Keywords"); ?>" />
278 297
 			</div>
279 298
 		</fieldset>
280 299
 		<div class="advanced-form">
@@ -286,41 +305,62 @@  discard block
 block discarded – undo
286 305
 						<option></option>
287 306
 					</select>
288 307
 				</div>
289
-				<script type="text/javascript">getSelect('manufacturer','<?php if(isset($_GET['manufacturer'])) print $_GET['manufacturer']; ?>')</script>
308
+				<script type="text/javascript">getSelect('manufacturer','<?php if(isset($_GET['manufacturer'])) {
309
+	print $_GET['manufacturer'];
310
+}
311
+?>')</script>
290 312
 				<div class="form-group">
291 313
 					<label><?php echo _("Type"); ?></label> 
292 314
 					<select name="aircraft" id="aircrafttypes" class="selectpicker" data-live-search="true">
293 315
 						<option></option>
294 316
 					</select>
295 317
 				</div>
296
-				<script type="text/javascript">getSelect('aircrafttypes','<?php if(isset($_GET['aircraft_icao'])) print $_GET['aircraft_icao']; ?>');</script>
318
+				<script type="text/javascript">getSelect('aircrafttypes','<?php if(isset($_GET['aircraft_icao'])) {
319
+	print $_GET['aircraft_icao'];
320
+}
321
+?>');</script>
297 322
 				<div class="form-group">
298 323
 					<label><?php echo _("Registration"); ?></label> 
299
-					<input type="text" name="registration" value="<?php if (isset($_GET['registration'])) print $_GET['registration']; ?>" size="8" />
324
+					<input type="text" name="registration" value="<?php if (isset($_GET['registration'])) {
325
+	print $_GET['registration'];
326
+}
327
+?>" size="8" />
300 328
 				</div>
301 329
 <?php
302 330
 if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) {
303 331
 ?>
304 332
 				<div class="form-group">
305 333
 					<label><?php echo _("Pilot id"); ?></label> 
306
-					<input type="text" name="pilot_id" value="<?php if (isset($_GET['pilot_id'])) print $_GET['pilot_id']; ?>" size="15" />
334
+					<input type="text" name="pilot_id" value="<?php if (isset($_GET['pilot_id'])) {
335
+	print $_GET['pilot_id'];
336
+}
337
+?>" size="15" />
307 338
 				</div>
308 339
 				<div class="form-group">
309 340
 					<label><?php echo _("Pilot name"); ?></label> 
310
-					<input type="text" name="pilot_name" value="<?php if (isset($_GET['pilot_name'])) print $_GET['pilot_name']; ?>" size="15" />
341
+					<input type="text" name="pilot_name" value="<?php if (isset($_GET['pilot_name'])) {
342
+	print $_GET['pilot_name'];
343
+}
344
+?>" size="15" />
311 345
 				</div>
312 346
 <?php
313
-}else {
347
+} else {
314 348
 ?>
315 349
 				<div class="form-group">
316 350
 					<label><?php echo _("Owner name"); ?></label> 
317
-					<input type="text" name="owner" value="<?php if (isset($_GET['owner'])) print $_GET['owner']; ?>" size="15" />
351
+					<input type="text" name="owner" value="<?php if (isset($_GET['owner'])) {
352
+	print $_GET['owner'];
353
+}
354
+?>" size="15" />
318 355
 				</div>
319 356
 <?php
320 357
 }
321 358
 ?>
322 359
 				<div class="form-group checkbox">
323
-					<div><input type="checkbox" name="highlights" value="true" id="highlights" <?php if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true"){ print 'checked="checked"'; } ?>> <label for="highlights"><?php echo _("Include only aircrafts with special highlights (unique liveries, destinations etc.)"); ?></label></div>
360
+					<div><input type="checkbox" name="highlights" value="true" id="highlights" <?php if (isset($_GET['highlights'])) {
361
+	if ($_GET['highlights'] == "true"){ print 'checked="checked"';
362
+}
363
+} ?>> <label for="highlights"><?php echo _("Include only aircrafts with special highlights (unique liveries, destinations etc.)"); ?></label></div>
324 364
 				</div>
325 365
 			</fieldset>
326 366
 			<fieldset>
@@ -331,23 +371,41 @@  discard block
 block discarded – undo
331 371
 						<option></option>
332 372
 					</select>
333 373
 				</div>
334
-				<script type="text/javascript">getSelect('airlinenames','<?php if(isset($_GET['airline'])) print $_GET['airline']; ?>');</script>
374
+				<script type="text/javascript">getSelect('airlinenames','<?php if(isset($_GET['airline'])) {
375
+	print $_GET['airline'];
376
+}
377
+?>');</script>
335 378
 				<div class="form-group">
336 379
 					<label><?php echo _("Country"); ?></label> 
337 380
 					<select name="airline_country" id="airlinecountries" class="selectpicker" data-live-search="true">
338 381
 						<option></option>
339 382
 					</select>
340 383
 				</div>
341
-				<script type="text/javascript">getSelect('airlinecountries','<?php if(isset($_GET['airline_country'])) print $_GET['airline_country']; ?>');</script>
384
+				<script type="text/javascript">getSelect('airlinecountries','<?php if(isset($_GET['airline_country'])) {
385
+	print $_GET['airline_country'];
386
+}
387
+?>');</script>
342 388
 				<div class="form-group">
343 389
 					<label><?php echo _("Callsign"); ?></label> 
344
-					<input type="text" name="callsign" value="<?php if (isset($_GET['callsign'])) print $_GET['callsign']; ?>" size="8" />
390
+					<input type="text" name="callsign" value="<?php if (isset($_GET['callsign'])) {
391
+	print $_GET['callsign'];
392
+}
393
+?>" size="8" />
345 394
 				</div>
346 395
 				<div class="form-group radio">
347 396
 					<div><input type="radio" name="airline_type" value="all" id="airline_type_all" <?php if (!isset($_GET['airline_type']) || $_GET['airline_type'] == "all"){ print 'checked="checked"'; } ?>> <label for="airline_type_all"><?php echo _("All airlines types"); ?></label></div>
348
-					<div><input type="radio" name="airline_type" value="passenger" id="airline_type_passenger" <?php if (isset($_GET['airline_type'])) if ($_GET['airline_type'] == "passenger"){ print 'checked="checked"'; } ?>> <label for="airline_type_passenger"><?php echo _("Only Passenger airlines"); ?></label></div>
349
-					<div><input type="radio" name="airline_type" value="cargo" id="airline_type_cargo" <?php if (isset($_GET['airline_type'])) if ( $_GET['airline_type'] == "cargo"){ print 'checked="checked"'; } ?>> <label for="airline_type_cargo"><?php echo _("Only Cargo airlines"); ?></label></div>
350
-					<div><input type="radio" name="airline_type" value="military" id="airline_type_military" <?php if (isset($_GET['airline_type'])) if ( $_GET['airline_type'] == "military"){ print 'checked="checked"'; } ?>> <label for="airline_type_military"><?php echo _("Only Military airlines"); ?></label></div>
397
+					<div><input type="radio" name="airline_type" value="passenger" id="airline_type_passenger" <?php if (isset($_GET['airline_type'])) {
398
+	if ($_GET['airline_type'] == "passenger"){ print 'checked="checked"';
399
+}
400
+} ?>> <label for="airline_type_passenger"><?php echo _("Only Passenger airlines"); ?></label></div>
401
+					<div><input type="radio" name="airline_type" value="cargo" id="airline_type_cargo" <?php if (isset($_GET['airline_type'])) {
402
+	if ( $_GET['airline_type'] == "cargo"){ print 'checked="checked"';
403
+}
404
+} ?>> <label for="airline_type_cargo"><?php echo _("Only Cargo airlines"); ?></label></div>
405
+					<div><input type="radio" name="airline_type" value="military" id="airline_type_military" <?php if (isset($_GET['airline_type'])) {
406
+	if ( $_GET['airline_type'] == "military"){ print 'checked="checked"';
407
+}
408
+} ?>> <label for="airline_type_military"><?php echo _("Only Military airlines"); ?></label></div>
351 409
 				</div>
352 410
 			</fieldset>
353 411
 			<fieldset>
@@ -358,14 +416,20 @@  discard block
 block discarded – undo
358 416
 						<option></option>
359 417
 					</select>
360 418
 				</div>
361
-				<script type="text/javascript">getSelect('airportnames','<?php if(isset($_GET['airport_icao'])) print $_GET['airport_icao']; ?>');</script>
419
+				<script type="text/javascript">getSelect('airportnames','<?php if(isset($_GET['airport_icao'])) {
420
+	print $_GET['airport_icao'];
421
+}
422
+?>');</script>
362 423
 				<div class="form-group">
363 424
 					<label><?php echo _("Country"); ?></label> 
364 425
 					<select name="airport_country" id="airportcountries" class="selectpicker" data-live-search="true">
365 426
 						<option></option>
366 427
 					</select>
367 428
 				</div>
368
-				<script type="text/javascript">getSelect('airportcountries','<?php if(isset($_GET['airport_country'])) print $_GET['airport_country']; ?>');</script>
429
+				<script type="text/javascript">getSelect('airportcountries','<?php if(isset($_GET['airport_country'])) {
430
+	print $_GET['airport_country'];
431
+}
432
+?>');</script>
369 433
 			</fieldset>
370 434
 			<fieldset>
371 435
 				<legend><?php echo _("Route"); ?></legend>
@@ -375,21 +439,30 @@  discard block
 block discarded – undo
375 439
 						<option></option>
376 440
 					</select>
377 441
 				</div>
378
-				<script type="text/javascript">getSelect('departureairportnames','<?php if(isset($_GET['departure_airport_route'])) print $_GET['departure_airport_route']; ?>');</script>
442
+				<script type="text/javascript">getSelect('departureairportnames','<?php if(isset($_GET['departure_airport_route'])) {
443
+	print $_GET['departure_airport_route'];
444
+}
445
+?>');</script>
379 446
 				<div class="form-group">
380 447
 					<label><?php echo _("Arrival Airport"); ?></label> 
381 448
 					<select name="arrival_airport_route" id="arrivalairportnames" class="selectpicker" data-live-search="true">
382 449
 						<option></option>
383 450
 					</select>
384 451
 				</div>
385
-				<script type="text/javascript">getSelect('arrivalairportnames','<?php if(isset($_GET['arrival_airport_route'])) print $_GET['arrival_airport_route']; ?>');</script>
452
+				<script type="text/javascript">getSelect('arrivalairportnames','<?php if(isset($_GET['arrival_airport_route'])) {
453
+	print $_GET['arrival_airport_route'];
454
+}
455
+?>');</script>
386 456
 			</fieldset>
387 457
 			<fieldset>
388 458
 				<legend><?php echo _("Date"); ?></legend>
389 459
 				<div class="form-group">
390 460
 					<label><?php echo _("Start Date"); ?></label>
391 461
 					<div class='input-group date' id='datetimepicker1'>
392
-						<input type='text' name="start_date" class="form-control" value="<?php if (isset($_GET['start_date'])) print $_GET['start_date']; ?>" placeholder="<?php echo _("Start Date/Time"); ?>" />
462
+						<input type='text' name="start_date" class="form-control" value="<?php if (isset($_GET['start_date'])) {
463
+	print $_GET['start_date'];
464
+}
465
+?>" placeholder="<?php echo _("Start Date/Time"); ?>" />
393 466
 						<span class="input-group-addon">
394 467
 							<span class="glyphicon glyphicon-calendar"></span>
395 468
 						</span>
@@ -398,7 +471,10 @@  discard block
 block discarded – undo
398 471
 				<div class="form-group">
399 472
 					<label><?php echo _("End Date"); ?></label>
400 473
 					<div class='input-group date' id='datetimepicker2'>
401
-						<input type='text' name="end_date" class="form-control" value="<?php if (isset($_GET['end_date'])) print $_GET['end_date']; ?>" placeholder="<?php echo _("End Date/Time"); ?>" />
474
+						<input type='text' name="end_date" class="form-control" value="<?php if (isset($_GET['end_date'])) {
475
+	print $_GET['end_date'];
476
+}
477
+?>" placeholder="<?php echo _("End Date/Time"); ?>" />
402 478
 						<span class="input-group-addon">
403 479
 							<span class="glyphicon glyphicon-calendar"></span>
404 480
 						</span>
@@ -474,7 +550,12 @@  discard block
 block discarded – undo
474 550
 				<input type="text" name="origlon" class="form-control" placeholder="<?php echo _("Center point longitude"); ?>" />
475 551
 			</div>
476 552
 			<div class="form-group">
477
-				<label><?php echo _("Distance").' ('; if (isset($globalDistanceUnit)) print $globalDistanceUnit; else print 'km'; print ')'; ?></label>
553
+				<label><?php echo _("Distance").' ('; if (isset($globalDistanceUnit)) {
554
+	print $globalDistanceUnit;
555
+} else {
556
+	print 'km';
557
+}
558
+print ')'; ?></label>
478 559
 				<input type="text" name="dist" class="form-control" placeholder="<?php echo _("Distance from center point"); ?>" />
479 560
 			</div>
480 561
 		</fieldset>
Please login to merge, or discard this patch.
country-statistics-airline-country.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@  discard block
 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)));
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
           function drawChart() {
62 62
             var data = google.visualization.arrayToDataTable([
63 63
             	["'._("Country").'", "'._("# of times").'"], ';
64
-            	$country_data = '';
64
+				$country_data = '';
65 65
 	foreach($airline_array as $airline_item)
66 66
 	{
67 67
 		$country_data .= '[ "'.$airline_item['airline_country'].'",'.$airline_item['airline_country_count'].'],';
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 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 Airlines by Country of %s"),$country);
21
+	$title = sprintf(_("Most Common Airlines by Country of %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 Airlines by Country").'</h2>';
54
-	print '<p>'.sprintf(_("The statistic below shows the most common airlines by Country of origin of flights from airports &amp; airlines of <strong>%s</strong>."),$country).'</p>';
54
+	print '<p>'.sprintf(_("The statistic below shows the most common airlines by Country of origin of flights from airports &amp; airlines of <strong>%s</strong>."), $country).'</p>';
55 55
 	$airline_array = $Spotter->countAllAirlineCountriesByCountry($country);
56 56
 	print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>';
57 57
 	print '<div id="chartCountry" class="chart" width="100%"></div>
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
             var data = google.visualization.arrayToDataTable([
63 63
             	["'._("Country").'", "'._("# of times").'"], ';
64 64
             	$country_data = '';
65
-	foreach($airline_array as $airline_item)
65
+	foreach ($airline_array as $airline_item)
66 66
 	{
67 67
 		$country_data .= '[ "'.$airline_item['airline_country'].'",'.$airline_item['airline_country_count'].'],';
68 68
 	}
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 		print '</thead>';
97 97
 		print '<tbody>';
98 98
 		$i = 1;
99
-		foreach($airline_array as $airline_item)
99
+		foreach ($airline_array as $airline_item)
100 100
 		{
101 101
 			print '<tr>';
102 102
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
atc-geojson.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 	header('Content-disposition: attachment; filename="atc.geojson"');
8 8
 }
9 9
 header('Content-Type: text/javascript');
10
-$ATC=new ATC();
10
+$ATC = new ATC();
11 11
 if (isset($_GET['coord'])) 
12 12
 {
13 13
 	//$coords = explode(',',$_GET['coord']);
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
             
21 21
 if (!empty($spotter_array))
22 22
 {	  
23
-	foreach($spotter_array as $spotter_item)
23
+	foreach ($spotter_array as $spotter_item)
24 24
 	{
25 25
 		date_default_timezone_set('UTC');
26 26
 		//waypoint plotting
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 		    $output .= '}';
44 44
 		$output .= '},';
45 45
 	}
46
-	$output  = substr($output, 0, -1);
46
+	$output = substr($output, 0, -1);
47 47
 }
48 48
 $output .= ']}';
49 49
 
Please login to merge, or discard this patch.
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 		date_default_timezone_set('UTC');
27 27
 		//waypoint plotting
28 28
 		$output .= '{"type": "Feature",';
29
-		    $output .= '"properties": {';
29
+			$output .= '"properties": {';
30 30
 			$output .= '"name": "'.str_replace('"',"'",$spotter_item['name']).'",';
31 31
 			$output .= '"city": "'.$spotter_item['city'].'",';
32 32
 			$output .= '"country": "'.$spotter_item['country'].'",';
@@ -49,13 +49,13 @@  discard block
 block discarded – undo
49 49
 			$output .= '"homepage": "'.$spotter_item['home_link'].'",';
50 50
 			$output .= '"image_thumb": "'.$spotter_item['image_thumb'].'"';
51 51
 //			$output .= '"photo": "'.$spotter_item['image_thumbnail'].'",';
52
-		    $output .= '},';
53
-		    $output .= '"geometry": {';
52
+			$output .= '},';
53
+			$output .= '"geometry": {';
54 54
 			$output .= '"type": "Point",';
55 55
 			$output .= '"coordinates": [';
56
-			    $output .= $spotter_item['longitude'].', '.$spotter_item['latitude'];
56
+				$output .= $spotter_item['longitude'].', '.$spotter_item['latitude'];
57 57
 			$output .= ']';
58
-		    $output .= '}';
58
+			$output .= '}';
59 59
 		$output .= '},';
60 60
 	}
61 61
 }
Please login to merge, or discard this patch.
currently.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,19 +1,19 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 require_once('require/class.Connection.php');
3
-require_once('require/class.Spotter.php');;
3
+require_once('require/class.Spotter.php'); ;
4 4
 require_once('require/class.Language.php');
5 5
 require_once('require/class.SpotterLive.php');
6 6
 
7 7
 $title = "Current Activity";
8 8
 require_once('header.php');
9
-$SpotterLive=new SpotterLive();
9
+$SpotterLive = new SpotterLive();
10 10
 //calculuation for the pagination
11
-if(!isset($_GET['limit']))
11
+if (!isset($_GET['limit']))
12 12
 {
13 13
 	$limit_start = 0;
14 14
 	$limit_end = 25;
15 15
 	$absolute_difference = 25;
16
-}  else {
16
+} else {
17 17
 	$limit_explode = explode(",", $_GET['limit']);
18 18
 	$limit_start = $limit_explode[0];
19 19
 	$limit_end = $limit_explode[1];
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 print '<div class="table column">';
37 37
 print '<p>'._("The table below shows the detailed information of all current flights.").'</p>';
38 38
 
39
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
39
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
40 40
 if (isset($_GET['sort'])) {
41 41
 	$spotter_array = $SpotterLive->getLiveSpotterData($limit_start.",".$absolute_difference, $sort);
42 42
 } else {
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
   $limit_start = 0;
19 19
   $limit_end = 25;
20 20
   $absolute_difference = 25;
21
-}  else {
21
+} else {
22 22
 	$limit_explode = explode(",", $_GET['limit']);
23 23
 	$limit_start = $limit_explode[0];
24 24
 	$limit_end = $limit_explode[1];
Please login to merge, or discard this patch.
ident-statistics-manufacturer.php 2 patches
Spacing   +6 added lines, -6 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 Aircraft Manufacturer of %s"),$spotter_array[0]['ident']);
16
+	$title = sprintf(_("Most Common Aircraft Manufacturer 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 Aircraft Manufacturer").'</h2>';
27
-	print '<p>'.sprintf(_("The statistic below shows the most common Aircraft Manufacturer of flights using the ident/callsign <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>';
27
+	print '<p>'.sprintf(_("The statistic below shows the most common Aircraft Manufacturer of flights using the ident/callsign <strong>%s</strong>."), $spotter_array[0]['ident']).'</p>';
28 28
 
29 29
 	$manufacturers_array = $Spotter->countAllAircraftManufacturerByIdent($ident);
30 30
 	if (!empty($manufacturers_array))
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 		print '</thead>';
40 40
 		print '<tbody>';
41 41
 		$i = 1;
42
-		foreach($manufacturers_array as $manufacturer_item)
42
+		foreach ($manufacturers_array as $manufacturer_item)
43 43
 		{
44 44
 			print '<tr>';
45 45
 			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.
date-statistics-airline-country.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -3,15 +3,15 @@  discard block
 block discarded – undo
3 3
 require_once('require/class.Spotter.php');
4 4
 require_once('require/class.Language.php');
5 5
 
6
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
6
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
7 7
 
8 8
 $Spotter = new Spotter();
9
-if (isset($_GET['date'])) $spotter_array = $Spotter->getSpotterDataByDate($_GET['date'],"0,1", $sort);
9
+if (isset($_GET['date'])) $spotter_array = $Spotter->getSpotterDataByDate($_GET['date'], "0,1", $sort);
10 10
 else $spotter_array = array();
11 11
 
12 12
 if (!empty($spotter_array))
13 13
 {
14
-	$title = sprintf(_("Most Common Airlines by Country on %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601'])));
14
+	$title = sprintf(_("Most Common Airlines by Country on %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601'])));
15 15
 	require_once('header.php');
16 16
 	print '<div class="select-item">';
17 17
 	print '<form action="'.$globalURL.'/date" method="post">';
@@ -22,13 +22,13 @@  discard block
 block discarded – undo
22 22
 	print '</div>';
23 23
 
24 24
 	print '<div class="info column">';
25
-	print '<h1>'.sprintf(_("Flights from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>';
25
+	print '<h1>'.sprintf(_("Flights from %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>';
26 26
 	print '</div>';
27 27
 
28 28
 	include('date-sub-menu.php');
29 29
 	print '<div class="column">';
30 30
 	print '<h2>'._("Most Common Airlines by Country").'</h2>';
31
-	print '<p>'.sprintf(_("The statistic below shows the most common airlines by Country of origin of flights on <strong>%s</strong>."),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>';
31
+	print '<p>'.sprintf(_("The statistic below shows the most common airlines by Country of origin of flights on <strong>%s</strong>."), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>';
32 32
 
33 33
 	$airline_array = $Spotter->countAllAirlineCountriesByDate($_GET['date']);
34 34
 	print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>';
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
             var data = google.visualization.arrayToDataTable([
41 41
             	["'._("Country").'", "'._("# of times").'"], ';
42 42
 	$country_data = '';
43
-	foreach($airline_array as $airline_item)
43
+	foreach ($airline_array as $airline_item)
44 44
 	{
45 45
 		$country_data .= '[ "'.$airline_item['airline_country'].'",'.$airline_item['airline_country_count'].'],';
46 46
 	}
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 		print '</thead>';
75 75
 		print '<tbody>';
76 76
 		$i = 1;
77
-		foreach($airline_array as $airline_item)
77
+		foreach ($airline_array as $airline_item)
78 78
 		{
79 79
 			print '<tr>';
80 80
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,11 @@
 block discarded – undo
4 4
 require_once('require/class.Language.php');
5 5
 $Spotter = new Spotter();
6 6
 $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
7
-if (isset($_GET['date'])) $spotter_array = $Spotter->getSpotterDataByDate($_GET['date'],"0,1", $sort);
8
-else $spotter_array = array();
7
+if (isset($_GET['date'])) {
8
+	$spotter_array = $Spotter->getSpotterDataByDate($_GET['date'],"0,1", $sort);
9
+} else {
10
+	$spotter_array = array();
11
+}
9 12
 
10 13
 if (!empty($spotter_array))
11 14
 {
Please login to merge, or discard this patch.
country-statistics-arrival-airport-country.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@  discard block
 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)));
@@ -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 Arrival Airports by Country").'</h2>';
54
-        print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights of airports &amp; airlines from <strong>%s</strong>."),$country).'</p>';
54
+		print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights of airports &amp; airlines from <strong>%s</strong>."),$country).'</p>';
55 55
 
56 56
 	$airport_country_array = $Spotter->countAllArrivalAirportCountriesByCountry($country);
57 57
 	print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>';
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
           function drawChart() {
63 63
             var data = google.visualization.arrayToDataTable([
64 64
             	["'._("Country").'", "'._("# of times").'"], ';
65
-            	$country_data = '';
65
+				$country_data = '';
66 66
 	foreach($airport_country_array as $airport_item)
67 67
 	{
68 68
 		$country_data .= '[ "'.$airport_item['arrival_airport_country'].'",'.$airport_item['airport_arrival_country_count'].'],';
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 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 Arrival Airports by Country from %s"),$country);
21
+	$title = sprintf(_("Most Common Arrival Airports by Country 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 Arrival Airports by Country").'</h2>';
54
-        print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights of airports &amp; airlines from <strong>%s</strong>."),$country).'</p>';
54
+        print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights of airports &amp; airlines from <strong>%s</strong>."), $country).'</p>';
55 55
 
56 56
 	$airport_country_array = $Spotter->countAllArrivalAirportCountriesByCountry($country);
57 57
 	print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>';
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
             var data = google.visualization.arrayToDataTable([
64 64
             	["'._("Country").'", "'._("# of times").'"], ';
65 65
             	$country_data = '';
66
-	foreach($airport_country_array as $airport_item)
66
+	foreach ($airport_country_array as $airport_item)
67 67
 	{
68 68
 		$country_data .= '[ "'.$airport_item['arrival_airport_country'].'",'.$airport_item['airport_arrival_country_count'].'],';
69 69
 	}
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 		print '</thead>';
98 98
 		print '<tbody>';
99 99
 		$i = 1;
100
-		foreach($airport_country_array as $airport_item)
100
+		foreach ($airport_country_array as $airport_item)
101 101
 		{
102 102
 			print '<tr>';
103 103
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
footer.php 3 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,12 +2,12 @@
 block discarded – undo
2 2
 
3 3
 <footer class="container">
4 4
 	<?php
5
-	    if (isset($sql_time)) {
5
+		if (isset($sql_time)) {
6 6
 	?>
7 7
 	<i><?php echo _("Page generated in").' '.round($sql_time+$page_time,2); ?>s (<?php print round($page_time,2); ?>ms PHP - <?php print round($sql_time,2); ?>ms SQL)</i>
8 8
 	<br />
9 9
 	<?php
10
-	    }
10
+		}
11 11
 	?>
12 12
 	<span>Developed in Barrie by <a href="http://www.mariotrunz.com" target="_blank">Mario Trunz</a> & at <a href="http://www.zugaina.com" target="_blank">Zugaina</a> by Ycarus</span> - <span><a href="<?php if (isset($globalURL)) print $globalURL; ?>/about#source">Source &amp; Credits</a></span> - <span><a href="https://github.com/Ysurac/FlightAirMap/issues" target="_blank">Report any issues</a></span>
13 13
 </footer>
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@
 block discarded – undo
4 4
 	<?php
5 5
 	    if (isset($sql_time)) {
6 6
 	?>
7
-	<i><?php echo _("Page generated in").' '.round($sql_time+$page_time,2); ?>s (<?php print round($page_time,2); ?>ms PHP - <?php print round($sql_time,2); ?>ms SQL)</i>
7
+	<i><?php echo _("Page generated in").' '.round($sql_time + $page_time, 2); ?>s (<?php print round($page_time, 2); ?>ms PHP - <?php print round($sql_time, 2); ?>ms SQL)</i>
8 8
 	<br />
9 9
 	<?php
10 10
 	    }
Please login to merge, or discard this patch.
Braces   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,10 @@
 block discarded – undo
9 9
 	<?php
10 10
 	    }
11 11
 	?>
12
-	<span>Developed in Barrie by <a href="http://www.mariotrunz.com" target="_blank">Mario Trunz</a> & at <a href="http://www.zugaina.com" target="_blank">Zugaina</a> by Ycarus</span> - <span><a href="<?php if (isset($globalURL)) print $globalURL; ?>/about#source">Source &amp; Credits</a></span> - <span><a href="https://github.com/Ysurac/FlightAirMap/issues" target="_blank">Report any issues</a></span>
12
+	<span>Developed in Barrie by <a href="http://www.mariotrunz.com" target="_blank">Mario Trunz</a> & at <a href="http://www.zugaina.com" target="_blank">Zugaina</a> by Ycarus</span> - <span><a href="<?php if (isset($globalURL)) {
13
+	print $globalURL;
14
+}
15
+?>/about#source">Source &amp; Credits</a></span> - <span><a href="https://github.com/Ysurac/FlightAirMap/issues" target="_blank">Report any issues</a></span>
13 16
 </footer>
14 17
 
15 18
 <div class="notifications bottom-left"></div>
Please login to merge, or discard this patch.
tools-acars.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 
9 9
 $page_url = $globalURL.'/tools-acars';
10 10
 
11
-$message = filter_input(INPUT_POST,'acars_message',FILTER_SANITIZE_STRING);
11
+$message = filter_input(INPUT_POST, 'acars_message', FILTER_SANITIZE_STRING);
12 12
 
13 13
 print '<div class="info column">';
14 14
 print '<h1>'._("Parse ACARS messages").'</h1>';
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.