Completed
Push — master ( 56826b...44a8cc )
by Yannick
26:44
created
search.php 2 patches
Spacing   +102 added lines, -102 removed lines patch added patch discarded remove patch
@@ -26,24 +26,24 @@  discard block
 block discarded – undo
26 26
 $sql_date = '';
27 27
 if (isset($_GET['start_date'])) {
28 28
 	//for the date manipulation into the query
29
-	if($_GET['start_date'] != "" && $_GET['end_date'] != ""){
29
+	if ($_GET['start_date'] != "" && $_GET['end_date'] != "") {
30 30
 		if (strtotime($_GET['start_date']) !== false && strtotime($_GET['end_date']) !== false) {
31 31
 			//$start_date = $_GET['start_date']." 00:00:00";
32
-			$start_date = date("Y-m-d",strtotime($_GET['start_date']))." 00:00:00";
32
+			$start_date = date("Y-m-d", strtotime($_GET['start_date']))." 00:00:00";
33 33
 			//$end_date = $_GET['end_date']." 00:00:00";
34
-			$end_date = date("Y-m-d",strtotime($_GET['end_date']))." 00:00:00";
34
+			$end_date = date("Y-m-d", strtotime($_GET['end_date']))." 00:00:00";
35 35
 			$sql_date = $start_date.",".$end_date;
36 36
 		}
37
-	} else if($_GET['start_date'] != ""){
37
+	} else if ($_GET['start_date'] != "") {
38 38
 		if (strtotime($_GET['start_date']) !== false) {
39 39
 			//$start_date = $_GET['start_date']." 00:00:00";
40
-			$start_date = date("Y-m-d",strtotime($_GET['start_date']))." 00:00:00";
40
+			$start_date = date("Y-m-d", strtotime($_GET['start_date']))." 00:00:00";
41 41
 			$sql_date = $start_date;
42 42
 		}
43
-	} else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){
43
+	} else if ($_GET['start_date'] == "" && $_GET['end_date'] != "") {
44 44
 		if (strtotime($_GET['end_date']) !== false) {
45 45
 			//$end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date']." 00:00:00";
46
-			$end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".date("Y-m-d",strtotime($_GET['end_date']))." 00:00:00";
46
+			$end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".date("Y-m-d", strtotime($_GET['end_date']))." 00:00:00";
47 47
 			$sql_date = $end_date;
48 48
 		}
49 49
 	} else $sql_date = '';
@@ -51,21 +51,21 @@  discard block
 block discarded – undo
51 51
 
52 52
 if (isset($_GET['highest_altitude'])) {
53 53
 	//for altitude manipulation
54
-	if($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != ""){
55
-		$end_altitude = filter_input(INPUT_GET,'highest_altitude',FILTER_SANITIZE_NUMBER_INT);
56
-		$start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT);
54
+	if ($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != "") {
55
+		$end_altitude = filter_input(INPUT_GET, 'highest_altitude', FILTER_SANITIZE_NUMBER_INT);
56
+		$start_altitude = filter_input(INPUT_GET, 'lowest_altitude', FILTER_SANITIZE_NUMBER_INT);
57 57
 		$sql_altitude = $start_altitude.",".$end_altitude;
58
-	} else if($_GET['highest_altitude'] != ""){
59
-		$end_altitude = filter_input(INPUT_GET,'highest_altitude',FILTER_SANITIZE_NUMBER_INT);
58
+	} else if ($_GET['highest_altitude'] != "") {
59
+		$end_altitude = filter_input(INPUT_GET, 'highest_altitude', FILTER_SANITIZE_NUMBER_INT);
60 60
 		$sql_altitude = $end_altitude;
61
-	} else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){
62
-		$start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT).",60000";
61
+	} else if ($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != "") {
62
+		$start_altitude = filter_input(INPUT_GET, 'lowest_altitude', FILTER_SANITIZE_NUMBER_INT).",60000";
63 63
 		$sql_altitude = $start_altitude;
64 64
 	} else $sql_altitude = '';
65 65
 } else $sql_altitude = '';
66 66
 
67 67
 //calculuation for the pagination
68
-if(!isset($_GET['limit']))
68
+if (!isset($_GET['limit']))
69 69
 {
70 70
 	if (!isset($_GET['number_results']))
71 71
 	{
@@ -73,17 +73,17 @@  discard block
 block discarded – undo
73 73
 		$limit_end = 25;
74 74
 		$absolute_difference = 25;
75 75
 	} else {
76
-		if ($_GET['number_results'] > 1000){
76
+		if ($_GET['number_results'] > 1000) {
77 77
 			$_GET['number_results'] = 1000;
78 78
 		}
79 79
 		$limit_start = 0;
80
-		$limit_end = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
81
-		$absolute_difference = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
80
+		$limit_end = filter_input(INPUT_GET, 'number_results', FILTER_SANITIZE_NUMBER_INT);
81
+		$absolute_difference = filter_input(INPUT_GET, 'number_results', FILTER_SANITIZE_NUMBER_INT);
82 82
 	}
83
-}  else {
83
+} else {
84 84
 	$limit_explode = explode(",", $_GET['limit']);
85
-	$limit_start = filter_var($limit_explode[0],FILTER_SANITIZE_NUMBER_INT);
86
-	$limit_end = filter_var($limit_explode[1],FILTER_SANITIZE_NUMBER_INT);
85
+	$limit_start = filter_var($limit_explode[0], FILTER_SANITIZE_NUMBER_INT);
86
+	$limit_end = filter_var($limit_explode[1], FILTER_SANITIZE_NUMBER_INT);
87 87
 }
88 88
 $absolute_difference = abs($limit_start - $limit_end);
89 89
 $limit_next = $limit_end + $absolute_difference;
@@ -112,31 +112,31 @@  discard block
 block discarded – undo
112 112
     ((isset($_GET['origlat']) && $_GET['origlat'] != '') &&
113 113
     (isset($_GET['origlon']) && $_GET['origlon'] != '') &&
114 114
     (isset($_GET['dist']) && $_GET['dist'] != ''))
115
-    ){  
116
-	$q = filter_input(INPUT_GET, 'q',FILTER_SANITIZE_STRING);
117
-	$registration = filter_input(INPUT_GET, 'registration',FILTER_SANITIZE_STRING);
118
-	$aircraft = filter_input(INPUT_GET, 'aircraft',FILTER_SANITIZE_STRING);
119
-	$manufacturer = filter_input(INPUT_GET, 'manufacturer',FILTER_SANITIZE_STRING);
120
-	$highlights = filter_input(INPUT_GET, 'highlights',FILTER_SANITIZE_STRING);
121
-	$airline = filter_input(INPUT_GET, 'airline',FILTER_SANITIZE_STRING);
122
-	$airline_country = filter_input(INPUT_GET, 'airline_country',FILTER_SANITIZE_STRING);
123
-	$airline_type = filter_input(INPUT_GET, 'airline_type',FILTER_SANITIZE_STRING);
124
-	$airport = filter_input(INPUT_GET, 'airport',FILTER_SANITIZE_STRING);
125
-	$airport_country = filter_input(INPUT_GET, 'airport_country',FILTER_SANITIZE_STRING);
126
-	$callsign = filter_input(INPUT_GET, 'callsign',FILTER_SANITIZE_STRING);
127
-	$owner = filter_input(INPUT_GET, 'owner',FILTER_SANITIZE_STRING);
128
-	$pilot_name = filter_input(INPUT_GET, 'pilot_name',FILTER_SANITIZE_STRING);
129
-	$pilot_id = filter_input(INPUT_GET, 'pilot_id',FILTER_SANITIZE_STRING);
130
-	$mmsi = filter_input(INPUT_GET, 'mmsi',FILTER_SANITIZE_NUMBER_INT);
131
-	$imo = filter_input(INPUT_GET, 'imo',FILTER_SANITIZE_NUMBER_INT);
132
-	$departure_airport_route = filter_input(INPUT_GET, 'departure_airport_route',FILTER_SANITIZE_STRING);
133
-	$arrival_airport_route = filter_input(INPUT_GET, 'arrival_airport_route',FILTER_SANITIZE_STRING);
134
-	$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
135
-	$archive = filter_input(INPUT_GET,'archive',FILTER_SANITIZE_NUMBER_INT);
136
-	$origlat = filter_input(INPUT_GET,'origlat',FILTER_SANITIZE_NUMBER_FLOAT);
137
-	$origlon = filter_input(INPUT_GET,'origlon',FILTER_SANITIZE_NUMBER_FLOAT);
138
-	$dist = filter_input(INPUT_GET,'dist',FILTER_SANITIZE_NUMBER_INT);
139
-	$number_results = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
115
+    ) {  
116
+	$q = filter_input(INPUT_GET, 'q', FILTER_SANITIZE_STRING);
117
+	$registration = filter_input(INPUT_GET, 'registration', FILTER_SANITIZE_STRING);
118
+	$aircraft = filter_input(INPUT_GET, 'aircraft', FILTER_SANITIZE_STRING);
119
+	$manufacturer = filter_input(INPUT_GET, 'manufacturer', FILTER_SANITIZE_STRING);
120
+	$highlights = filter_input(INPUT_GET, 'highlights', FILTER_SANITIZE_STRING);
121
+	$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
122
+	$airline_country = filter_input(INPUT_GET, 'airline_country', FILTER_SANITIZE_STRING);
123
+	$airline_type = filter_input(INPUT_GET, 'airline_type', FILTER_SANITIZE_STRING);
124
+	$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING);
125
+	$airport_country = filter_input(INPUT_GET, 'airport_country', FILTER_SANITIZE_STRING);
126
+	$callsign = filter_input(INPUT_GET, 'callsign', FILTER_SANITIZE_STRING);
127
+	$owner = filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING);
128
+	$pilot_name = filter_input(INPUT_GET, 'pilot_name', FILTER_SANITIZE_STRING);
129
+	$pilot_id = filter_input(INPUT_GET, 'pilot_id', FILTER_SANITIZE_STRING);
130
+	$mmsi = filter_input(INPUT_GET, 'mmsi', FILTER_SANITIZE_NUMBER_INT);
131
+	$imo = filter_input(INPUT_GET, 'imo', FILTER_SANITIZE_NUMBER_INT);
132
+	$departure_airport_route = filter_input(INPUT_GET, 'departure_airport_route', FILTER_SANITIZE_STRING);
133
+	$arrival_airport_route = filter_input(INPUT_GET, 'arrival_airport_route', FILTER_SANITIZE_STRING);
134
+	$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
135
+	$archive = filter_input(INPUT_GET, 'archive', FILTER_SANITIZE_NUMBER_INT);
136
+	$origlat = filter_input(INPUT_GET, 'origlat', FILTER_SANITIZE_NUMBER_FLOAT);
137
+	$origlon = filter_input(INPUT_GET, 'origlon', FILTER_SANITIZE_NUMBER_FLOAT);
138
+	$dist = filter_input(INPUT_GET, 'dist', FILTER_SANITIZE_NUMBER_INT);
139
+	$number_results = filter_input(INPUT_GET, 'number_results', FILTER_SANITIZE_NUMBER_INT);
140 140
 	if ($dist != '') {
141 141
 		if (isset($globalDistanceUnit) && $globalDistanceUnit == 'mi') $dist = $dist*1.60934;
142 142
 		elseif (isset($globalDistanceUnit) && $globalDistanceUnit == 'nm') $dist = $dist*1.852;
@@ -145,15 +145,15 @@  discard block
 block discarded – undo
145 145
 	if ($archive == 1) {
146 146
 		if ($type == 'aircraft') {
147 147
 			$SpotterArchive = new SpotterArchive();
148
-			$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);
148
+			$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);
149 149
 		}
150 150
 	} else {
151 151
 		if ($type == 'aircraft') {
152
-			$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);
152
+			$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);
153 153
 		} elseif ($type == 'tracker') {
154
-			$spotter_array = $Tracker->searchTrackerData($q,$callsign,$sql_date,$limit_start.",".$absolute_difference,$sort,'',$origlat,$origlon,$dist);
154
+			$spotter_array = $Tracker->searchTrackerData($q, $callsign, $sql_date, $limit_start.",".$absolute_difference, $sort, '', $origlat, $origlon, $dist);
155 155
 		} elseif ($type == 'marine') {
156
-			$spotter_array = $Marine->searchMarineData($q,$callsign,$mmsi,$imo,$sql_date,$limit_start.",".$absolute_difference,$sort,'',$origlat,$origlon,$dist);
156
+			$spotter_array = $Marine->searchMarineData($q, $callsign, $mmsi, $imo, $sql_date, $limit_start.",".$absolute_difference, $sort, '', $origlat, $origlon, $dist);
157 157
 		}
158 158
 	}
159 159
 	 
@@ -189,12 +189,12 @@  discard block
 block discarded – undo
189 189
 	//remove 3D=true parameter
190 190
 	$no3D = str_replace("&3D=true", "", $_SERVER['QUERY_STRING']);
191 191
 	$kmlURL = str_replace("http://", "kml://", $globalURL);
192
-	if (!isset($_GET['3D'])){
192
+	if (!isset($_GET['3D'])) {
193 193
 		print '<li><a href="'.$globalURL.'/search?'.$no3D.'" class="active"><i class="fa fa-table"></i> '._("Table").'</a></li>';
194 194
 	} else {
195 195
 		print '<li><span class="notablet"><a href="'.$globalURL.'/search?'.$no3D.'"><i class="fa fa-table"></i> '._("Table").'</a></span></li>';
196 196
 	}
197
-	if (isset($_GET['3D'])){
197
+	if (isset($_GET['3D'])) {
198 198
 		print '<li><a href="'.$globalURL.'/search?'.$no3D.'&3D=true" class="active"><i class="fa fa-globe"></i> '._("3D Map").'</a></li>';
199 199
 	} else {
200 200
 		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>';
@@ -215,32 +215,32 @@  discard block
 block discarded – undo
215 215
 		print '<div class="column">';
216 216
 		print '<div class="info">';
217 217
 		print '<h1>'._("Search Results for").' ';
218
-		if (isset($_GET['q']) && $_GET['q'] != ""){ print _("Keyword:").' <span>'.$q.'</span> '; }
219
-		if (isset($_GET['aircraft']) && $_GET['aircraft'] != ""){ print _("Aircraft:").' <span>'.$aircraft.'</span> '; }
220
-		if (isset($_GET['manufacturer']) && $_GET['manufacturer'] != ""){ print _("Manufacturer:").' <span>'.$manufacturer.'</span> '; }
221
-		if (isset($_GET['registration']) && $_GET['registration'] != ""){ print _("Registration:").' <span>'.$registration.'</span> '; }
222
-		if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true"){ print _("Highlights:").' <span>'.$highlights.'</span> '; }
223
-		if (isset($_GET['airline']) && $_GET['airline'] != ""){ print _("Airline:").' <span>'.$airline.'</span> '; }
224
-		if (isset($_GET['airline_country']) && $_GET['airline_country'] != ""){ print _("Airline country:").' <span>'.$airline_country.'</span> '; }
225
-		if (isset($_GET['airline_type']) && $_GET['airline_type'] != ""){ print _("Airline type:").' <span>'.$airline_type.'</span> '; }
226
-		if (isset($_GET['airport']) && $_GET['airport'] != ""){ print _("Airport:").' <span>'.$airport.'</span> '; }
227
-		if (isset($_GET['airport_country']) && $_GET['airport_country'] != ""){ print _("Airport country:").' <span>'.$airport_country.'</span> '; }
228
-		if (isset($_GET['callsign']) && $_GET['callsign'] != ""){ print _("Callsign:").' <span>'.$callsign.'</span> '; }
229
-		if (isset($_GET['owner']) && $_GET['owner'] != ""){ print _("Owner:").' <span>'.$owner.'</span> '; }
230
-		if (isset($_GET['pilot_id']) && $_GET['pilot_id'] != ""){ print _("Pilot id:").' <span>'.$pilot_id.'</span> '; }
231
-		if (isset($_GET['pilot_name']) && $_GET['pilot_name'] != ""){ print _("Pilot name:").' <span>'.$pilot_name.'</span> '; }
232
-		if (isset($_GET['departure_airport_route']) && $_GET['departure_airport_route'] != "" && (!isset($_GET['arrival_airport_route']) || $_GET['arrival_airport_route'] == "")){ print _("Route out of:").' <span>'.$departure_airport_route.'</span> '; }
233
-		if (isset($_GET['departure_airport_route']) && $_GET['departure_airport_route'] == "" && isset($_GET['arrival_airport_route']) && $_GET['arrival_airport_route'] != ""){ print _("Route into:").' <span>'.$arrival_airport_route.'</span> '; }
234
-		if (isset($_GET['departure_airport_route']) && $_GET['departure_airport_route'] != "" && isset($_GET['arrival_airport_route']) && $_GET['arrival_airport_route'] != ""){ print _("Route between:").' <span>'.$departure_airport_route.'</span> and <span>'.$_GET['arrival_airport_route'].'</span> '; }
235
-		if (isset($_GET['mmsi']) && $_GET['mmsi'] != ""){ print _("MMSI:").' <span>'.$mmsi.'</span> '; }
236
-		if (isset($_GET['imo']) && $_GET['imo'] != ""){ print _("IMO:").' <span>'.$imo.'</span> '; }
237
-		if (isset($_GET['start_date']) && $_GET['start_date'] != "" && isset($_GET['end_date']) && $_GET['end_date'] == ""){ print _("Date starting at:").' <span>'.$start_date.'</span> '; }
238
-		if (isset($_GET['start_date']) && $_GET['start_date'] == "" && isset($_GET['end_date']) && $_GET['end_date'] != ""){ print _("Date ending at:").' <span>'.$end_date.'</span> '; }
239
-		if (isset($_GET['start_date']) && $_GET['start_date'] != "" && isset($_GET['end_date']) && $_GET['end_date'] != ""){ print _("Date between:").' <span>'.$start_date.'</span> and <span>'.$end_date.'</span> '; }
240
-		if (isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] != "" && isset($_GET['highest_altitude']) && $_GET['highest_altitude'] == ""){ print _("Altitude starting at:").' <span>'.number_format($lowest_altitude).' feet</span> '; }
241
-		if (isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] == "" && isset($_GET['highest_altitude']) && $_GET['highest_altitude'] != ""){ print _("Altitude ending at:").' <span>'.number_format($highest_altitude).' feet</span> '; }
242
-		if (isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] != "" && isset($_GET['highest_altitude']) && $_GET['highest_altitude'] != ""){ print _("Altitude between:").' <span>'.number_format($lowest_altitude).' feet</span> '._("and").' <span>'.number_format($highest_altitude).' feet</span> '; }
243
-		if (isset($_GET['number_results']) && $_GET['number_results'] != ""){ print _("limit per page:").' <span>'.$number_results.'</span> '; }
218
+		if (isset($_GET['q']) && $_GET['q'] != "") { print _("Keyword:").' <span>'.$q.'</span> '; }
219
+		if (isset($_GET['aircraft']) && $_GET['aircraft'] != "") { print _("Aircraft:").' <span>'.$aircraft.'</span> '; }
220
+		if (isset($_GET['manufacturer']) && $_GET['manufacturer'] != "") { print _("Manufacturer:").' <span>'.$manufacturer.'</span> '; }
221
+		if (isset($_GET['registration']) && $_GET['registration'] != "") { print _("Registration:").' <span>'.$registration.'</span> '; }
222
+		if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true") { print _("Highlights:").' <span>'.$highlights.'</span> '; }
223
+		if (isset($_GET['airline']) && $_GET['airline'] != "") { print _("Airline:").' <span>'.$airline.'</span> '; }
224
+		if (isset($_GET['airline_country']) && $_GET['airline_country'] != "") { print _("Airline country:").' <span>'.$airline_country.'</span> '; }
225
+		if (isset($_GET['airline_type']) && $_GET['airline_type'] != "") { print _("Airline type:").' <span>'.$airline_type.'</span> '; }
226
+		if (isset($_GET['airport']) && $_GET['airport'] != "") { print _("Airport:").' <span>'.$airport.'</span> '; }
227
+		if (isset($_GET['airport_country']) && $_GET['airport_country'] != "") { print _("Airport country:").' <span>'.$airport_country.'</span> '; }
228
+		if (isset($_GET['callsign']) && $_GET['callsign'] != "") { print _("Callsign:").' <span>'.$callsign.'</span> '; }
229
+		if (isset($_GET['owner']) && $_GET['owner'] != "") { print _("Owner:").' <span>'.$owner.'</span> '; }
230
+		if (isset($_GET['pilot_id']) && $_GET['pilot_id'] != "") { print _("Pilot id:").' <span>'.$pilot_id.'</span> '; }
231
+		if (isset($_GET['pilot_name']) && $_GET['pilot_name'] != "") { print _("Pilot name:").' <span>'.$pilot_name.'</span> '; }
232
+		if (isset($_GET['departure_airport_route']) && $_GET['departure_airport_route'] != "" && (!isset($_GET['arrival_airport_route']) || $_GET['arrival_airport_route'] == "")) { print _("Route out of:").' <span>'.$departure_airport_route.'</span> '; }
233
+		if (isset($_GET['departure_airport_route']) && $_GET['departure_airport_route'] == "" && isset($_GET['arrival_airport_route']) && $_GET['arrival_airport_route'] != "") { print _("Route into:").' <span>'.$arrival_airport_route.'</span> '; }
234
+		if (isset($_GET['departure_airport_route']) && $_GET['departure_airport_route'] != "" && isset($_GET['arrival_airport_route']) && $_GET['arrival_airport_route'] != "") { print _("Route between:").' <span>'.$departure_airport_route.'</span> and <span>'.$_GET['arrival_airport_route'].'</span> '; }
235
+		if (isset($_GET['mmsi']) && $_GET['mmsi'] != "") { print _("MMSI:").' <span>'.$mmsi.'</span> '; }
236
+		if (isset($_GET['imo']) && $_GET['imo'] != "") { print _("IMO:").' <span>'.$imo.'</span> '; }
237
+		if (isset($_GET['start_date']) && $_GET['start_date'] != "" && isset($_GET['end_date']) && $_GET['end_date'] == "") { print _("Date starting at:").' <span>'.$start_date.'</span> '; }
238
+		if (isset($_GET['start_date']) && $_GET['start_date'] == "" && isset($_GET['end_date']) && $_GET['end_date'] != "") { print _("Date ending at:").' <span>'.$end_date.'</span> '; }
239
+		if (isset($_GET['start_date']) && $_GET['start_date'] != "" && isset($_GET['end_date']) && $_GET['end_date'] != "") { print _("Date between:").' <span>'.$start_date.'</span> and <span>'.$end_date.'</span> '; }
240
+		if (isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] != "" && isset($_GET['highest_altitude']) && $_GET['highest_altitude'] == "") { print _("Altitude starting at:").' <span>'.number_format($lowest_altitude).' feet</span> '; }
241
+		if (isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] == "" && isset($_GET['highest_altitude']) && $_GET['highest_altitude'] != "") { print _("Altitude ending at:").' <span>'.number_format($highest_altitude).' feet</span> '; }
242
+		if (isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] != "" && isset($_GET['highest_altitude']) && $_GET['highest_altitude'] != "") { print _("Altitude between:").' <span>'.number_format($lowest_altitude).' feet</span> '._("and").' <span>'.number_format($highest_altitude).' feet</span> '; }
243
+		if (isset($_GET['number_results']) && $_GET['number_results'] != "") { print _("limit per page:").' <span>'.$number_results.'</span> '; }
244 244
 		print '</h1>';
245 245
 		print '</div>';
246 246
 
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
 					    </select>
375 375
 					</div>
376 376
 				</div>
377
-				<script type="text/javascript">getSelect('manufacturer','<?php if(isset($_GET['manufacturer'])) print $manufacturer; ?>')</script>
377
+				<script type="text/javascript">getSelect('manufacturer','<?php if (isset($_GET['manufacturer'])) print $manufacturer; ?>')</script>
378 378
 				<div class="form-group">
379 379
 					<label class="control-label col-sm-2"><?php echo _("Type"); ?></label>
380 380
 						<div class="col-sm-10">
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
 							</select>
384 384
 						</div>
385 385
 				</div>
386
-				<script type="text/javascript">getSelect('aircrafttypes','<?php if(isset($_GET['aircraft_icao'])) print $aircraft_icao; ?>');</script>
386
+				<script type="text/javascript">getSelect('aircrafttypes','<?php if (isset($_GET['aircraft_icao'])) print $aircraft_icao; ?>');</script>
387 387
 				<div class="form-group">
388 388
 					<label class="control-label col-sm-2"><?php echo _("Registration"); ?></label> 
389 389
 					<div class="col-sm-10">
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
 					</div>
407 407
 				</div>
408 408
 <?php
409
-	}else {
409
+	} else {
410 410
 ?>
411 411
 				<div class="form-group">
412 412
 					<label class="control-label col-sm-2"><?php echo _("Owner name"); ?></label> 
@@ -419,8 +419,8 @@  discard block
 block discarded – undo
419 419
 ?>
420 420
 				<div class="form-group">
421 421
 					<div class="col-sm-offset-2 col-sm-10">
422
-					<!--<div><input type="checkbox" class="form-control" 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 aircraft with special highlights (unique liveries, destinations etc.)"); ?></label></div>-->
423
-					<label class="checkbox-inline"><input type="checkbox" name="highlights" value="true" id="highlights" <?php if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true"){ print 'checked="checked"'; } ?>> <?php echo _("Include only aircraft with special highlights (unique liveries, destinations etc.)"); ?></label>
422
+					<!--<div><input type="checkbox" class="form-control" 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 aircraft with special highlights (unique liveries, destinations etc.)"); ?></label></div>-->
423
+					<label class="checkbox-inline"><input type="checkbox" name="highlights" value="true" id="highlights" <?php if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true") { print 'checked="checked"'; } ?>> <?php echo _("Include only aircraft with special highlights (unique liveries, destinations etc.)"); ?></label>
424 424
 					</div>
425 425
 				</div>
426 426
 			</fieldset>
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
 						</select>
435 435
 					</div>
436 436
 				</div>
437
-				<script type="text/javascript">getSelect('airlinenames','<?php if(isset($_GET['airline'])) print $airline; ?>');</script>
437
+				<script type="text/javascript">getSelect('airlinenames','<?php if (isset($_GET['airline'])) print $airline; ?>');</script>
438 438
 				<div class="form-group">
439 439
 					<label class="control-label col-sm-2"><?php echo _("Country"); ?></label> 
440 440
 					<div class="col-sm-10">
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
 						</select>
444 444
 					</div>
445 445
 				</div>
446
-				<script type="text/javascript">getSelect('airlinecountries','<?php if(isset($_GET['airline_country'])) print $airline_country; ?>');</script>
446
+				<script type="text/javascript">getSelect('airlinecountries','<?php if (isset($_GET['airline_country'])) print $airline_country; ?>');</script>
447 447
 				<div class="form-group">
448 448
 					<label class="control-label col-sm-2"><?php echo _("Callsign"); ?></label> 
449 449
 					<div class="col-sm-10">
@@ -452,10 +452,10 @@  discard block
 block discarded – undo
452 452
 				</div>
453 453
 				<div class="form-group">
454 454
 					<div class="col-sm-offset-2 col-sm-10">
455
-						<label class="radio-inline"><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"'; } ?>> <?php echo _("All airlines types"); ?></label>
456
-						<label class="radio-inline"><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"'; } ?>> <?php echo _("Only Passenger airlines"); ?></label>
457
-						<label class="radio-inline"><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"'; } ?>> <?php echo _("Only Cargo airlines"); ?></label>
458
-						<label class="radio-inline"><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"'; } ?>> <?php echo _("Only Military airlines"); ?></label>
455
+						<label class="radio-inline"><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"'; } ?>> <?php echo _("All airlines types"); ?></label>
456
+						<label class="radio-inline"><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"'; } ?>> <?php echo _("Only Passenger airlines"); ?></label>
457
+						<label class="radio-inline"><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"'; } ?>> <?php echo _("Only Cargo airlines"); ?></label>
458
+						<label class="radio-inline"><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"'; } ?>> <?php echo _("Only Military airlines"); ?></label>
459 459
 					</div>
460 460
 				</div>
461 461
 			</fieldset>
@@ -469,7 +469,7 @@  discard block
 block discarded – undo
469 469
 						</select>
470 470
 					</div>
471 471
 				</div>
472
-				<script type="text/javascript">getSelect('airportnames','<?php if(isset($_GET['airport_icao'])) print $airport_icao; ?>');</script>
472
+				<script type="text/javascript">getSelect('airportnames','<?php if (isset($_GET['airport_icao'])) print $airport_icao; ?>');</script>
473 473
 				<div class="form-group">
474 474
 					<label class="control-label col-sm-2"><?php echo _("Country"); ?></label> 
475 475
 					<div class="col-sm-10">
@@ -478,7 +478,7 @@  discard block
 block discarded – undo
478 478
 						</select>
479 479
 					</div>
480 480
 				</div>
481
-				<script type="text/javascript">getSelect('airportcountries','<?php if(isset($_GET['airport_country'])) print $airport_country; ?>');</script>
481
+				<script type="text/javascript">getSelect('airportcountries','<?php if (isset($_GET['airport_country'])) print $airport_country; ?>');</script>
482 482
 			</fieldset>
483 483
 			<fieldset>
484 484
 				<legend><?php echo _("Route"); ?></legend>
@@ -490,7 +490,7 @@  discard block
 block discarded – undo
490 490
 						</select>
491 491
 					</div>
492 492
 				</div>
493
-				<script type="text/javascript">getSelect('departureairportnames','<?php if(isset($_GET['departure_airport_route'])) print $departure_airport_route; ?>');</script>
493
+				<script type="text/javascript">getSelect('departureairportnames','<?php if (isset($_GET['departure_airport_route'])) print $departure_airport_route; ?>');</script>
494 494
 				<div class="form-group">
495 495
 					<label class="control-label col-sm-2"><?php echo _("Arrival Airport"); ?></label> 
496 496
 					<div class="col-sm-10">
@@ -499,7 +499,7 @@  discard block
 block discarded – undo
499 499
 						</select>
500 500
 					</div>
501 501
 				</div>
502
-				<script type="text/javascript">getSelect('arrivalairportnames','<?php if(isset($_GET['arrival_airport_route'])) print $arrival_airport_route; ?>');</script>
502
+				<script type="text/javascript">getSelect('arrivalairportnames','<?php if (isset($_GET['arrival_airport_route'])) print $arrival_airport_route; ?>');</script>
503 503
 			</fieldset>
504 504
 			<fieldset>
505 505
 				<legend>Altitude</legend>
@@ -510,9 +510,9 @@  discard block
 block discarded – undo
510 510
 							<option></option>
511 511
 <?php
512 512
 $altitude_array = Array(1000, 5000, 10000, 15000, 20000, 25000, 30000, 35000, 40000, 45000, 50000);
513
-foreach($altitude_array as $altitude)
513
+foreach ($altitude_array as $altitude)
514 514
 {
515
-	if(isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] == $altitude)
515
+	if (isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] == $altitude)
516 516
 	{
517 517
 		print '<option value="'.$altitude.'" selected="selected">'.number_format($altitude).' feet</option>';
518 518
 	} else {
@@ -530,9 +530,9 @@  discard block
 block discarded – undo
530 530
 							<option></option>
531 531
 <?php
532 532
 	$altitude_array = Array(1000, 5000, 10000, 15000, 20000, 25000, 30000, 35000, 40000, 45000, 50000);
533
-	foreach($altitude_array as $altitude)
533
+	foreach ($altitude_array as $altitude)
534 534
 	{
535
-		if(isset($_GET['highest_altitude']) && $_GET['highest_altitude'] == $altitude)
535
+		if (isset($_GET['highest_altitude']) && $_GET['highest_altitude'] == $altitude)
536 536
 		{
537 537
 			print '<option value="'.$altitude.'" selected="selected">'.number_format($altitude).' feet</option>';
538 538
 		} else {
@@ -655,10 +655,10 @@  discard block
 block discarded – undo
655 655
 				<div class="col-sm-10">
656 656
 					<select class="form-control" name="number_results">
657 657
 <?php
658
-$number_results_array = Array(25, 50, 100, 150, 200, 250, 300, 400, 500,  600, 700, 800, 900, 1000);
659
-foreach($number_results_array as $number)
658
+$number_results_array = Array(25, 50, 100, 150, 200, 250, 300, 400, 500, 600, 700, 800, 900, 1000);
659
+foreach ($number_results_array as $number)
660 660
 {
661
-	if(isset($_GET['number_results']) && $_GET['number_results'] == $number)
661
+	if (isset($_GET['number_results']) && $_GET['number_results'] == $number)
662 662
 	{
663 663
 		print '<option value="'.$number.'" selected="selected">'.$number.'</option>';
664 664
 	} else {
@@ -677,7 +677,7 @@  discard block
 block discarded – undo
677 677
 		<fieldset>
678 678
 			<div class="form-group">
679 679
 				<div class="col-sm-offset-2 col-sm-10">
680
-					<label class="checkbox-inline"><input type="checkbox" name="archive" value="1" disabled /><?php echo sprintf(_("Search in archive (older than %s months)"),$globalArchiveKeepMonths); ?></label>
680
+					<label class="checkbox-inline"><input type="checkbox" name="archive" value="1" disabled /><?php echo sprintf(_("Search in archive (older than %s months)"), $globalArchiveKeepMonths); ?></label>
681 681
 					<p class="help-block">Disabled in demo</p>
682 682
 				</div>
683 683
 			</div>
@@ -688,7 +688,7 @@  discard block
 block discarded – undo
688 688
 		<fieldset>
689 689
 			<div class="form-group">
690 690
 				<div class="col-sm-offset-2 col-sm-10">
691
-					<label class="checkbox-inline"><input type="checkbox" name="archive" value="1" /><?php echo sprintf(_("Search in archive (older than %s months)"),$globalArchiveKeepMonths); ?></label>
691
+					<label class="checkbox-inline"><input type="checkbox" name="archive" value="1" /><?php echo sprintf(_("Search in archive (older than %s months)"), $globalArchiveKeepMonths); ?></label>
692 692
 				</div>
693 693
 			</div>
694 694
 		</fieldset>
Please login to merge, or discard this patch.
Braces   +142 added lines, -39 removed lines patch added patch discarded remove patch
@@ -46,8 +46,10 @@  discard block
 block discarded – undo
46 46
 			$end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".date("Y-m-d",strtotime($_GET['end_date']))." 00:00:00";
47 47
 			$sql_date = $end_date;
48 48
 		}
49
-	} else $sql_date = '';
50
-}
49
+	} else {
50
+		$sql_date = '';
51
+	}
52
+	}
51 53
 
52 54
 if (isset($_GET['highest_altitude'])) {
53 55
 	//for altitude manipulation
@@ -61,8 +63,12 @@  discard block
 block discarded – undo
61 63
 	} else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){
62 64
 		$start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT).",60000";
63 65
 		$sql_altitude = $start_altitude;
64
-	} else $sql_altitude = '';
65
-} else $sql_altitude = '';
66
+	} else {
67
+		$sql_altitude = '';
68
+	}
69
+	} else {
70
+	$sql_altitude = '';
71
+}
66 72
 
67 73
 //calculuation for the pagination
68 74
 if(!isset($_GET['limit']))
@@ -80,7 +86,7 @@  discard block
 block discarded – undo
80 86
 		$limit_end = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
81 87
 		$absolute_difference = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
82 88
 	}
83
-}  else {
89
+} else {
84 90
 	$limit_explode = explode(",", $_GET['limit']);
85 91
 	$limit_start = filter_var($limit_explode[0],FILTER_SANITIZE_NUMBER_INT);
86 92
 	$limit_end = filter_var($limit_explode[1],FILTER_SANITIZE_NUMBER_INT);
@@ -138,10 +144,15 @@  discard block
 block discarded – undo
138 144
 	$dist = filter_input(INPUT_GET,'dist',FILTER_SANITIZE_NUMBER_INT);
139 145
 	$number_results = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
140 146
 	if ($dist != '') {
141
-		if (isset($globalDistanceUnit) && $globalDistanceUnit == 'mi') $dist = $dist*1.60934;
142
-		elseif (isset($globalDistanceUnit) && $globalDistanceUnit == 'nm') $dist = $dist*1.852;
147
+		if (isset($globalDistanceUnit) && $globalDistanceUnit == 'mi') {
148
+			$dist = $dist*1.60934;
149
+		} elseif (isset($globalDistanceUnit) && $globalDistanceUnit == 'nm') {
150
+			$dist = $dist*1.852;
151
+		}
152
+	}
153
+	if (!isset($sql_date)) {
154
+		$sql_date = '';
143 155
 	}
144
-	if (!isset($sql_date)) $sql_date = '';
145 156
 	if ($archive == 1) {
146 157
 		if ($type == 'aircraft') {
147 158
 			$SpotterArchive = new SpotterArchive();
@@ -219,7 +230,10 @@  discard block
 block discarded – undo
219 230
 		if (isset($_GET['aircraft']) && $_GET['aircraft'] != ""){ print _("Aircraft:").' <span>'.$aircraft.'</span> '; }
220 231
 		if (isset($_GET['manufacturer']) && $_GET['manufacturer'] != ""){ print _("Manufacturer:").' <span>'.$manufacturer.'</span> '; }
221 232
 		if (isset($_GET['registration']) && $_GET['registration'] != ""){ print _("Registration:").' <span>'.$registration.'</span> '; }
222
-		if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true"){ print _("Highlights:").' <span>'.$highlights.'</span> '; }
233
+		if (isset($_GET['highlights'])) {
234
+			if ($_GET['highlights'] == "true"){ print _("Highlights:").' <span>'.$highlights.'</span> ';
235
+		}
236
+		}
223 237
 		if (isset($_GET['airline']) && $_GET['airline'] != ""){ print _("Airline:").' <span>'.$airline.'</span> '; }
224 238
 		if (isset($_GET['airline_country']) && $_GET['airline_country'] != ""){ print _("Airline country:").' <span>'.$airline_country.'</span> '; }
225 239
 		if (isset($_GET['airline_type']) && $_GET['airline_type'] != ""){ print _("Airline type:").' <span>'.$airline_type.'</span> '; }
@@ -355,7 +369,10 @@  discard block
 block discarded – undo
355 369
 			<div class="form-group">
356 370
 				<label class="control-label col-sm-2"><?php echo _("Keywords"); ?></label>
357 371
 				<div class="col-sm-10">
358
-					<input type="text" class="form-control" id="q" name="q" value="<?php if (isset($_GET['q'])) print $q; ?>" size="10" placeholder="<?php echo _("Keywords"); ?>" />
372
+					<input type="text" class="form-control" id="q" name="q" value="<?php if (isset($_GET['q'])) {
373
+	print $q;
374
+}
375
+?>" size="10" placeholder="<?php echo _("Keywords"); ?>" />
359 376
 				</div>
360 377
 			</div>
361 378
 		</fieldset>
@@ -374,7 +391,10 @@  discard block
 block discarded – undo
374 391
 					    </select>
375 392
 					</div>
376 393
 				</div>
377
-				<script type="text/javascript">getSelect('manufacturer','<?php if(isset($_GET['manufacturer'])) print $manufacturer; ?>')</script>
394
+				<script type="text/javascript">getSelect('manufacturer','<?php if(isset($_GET['manufacturer'])) {
395
+	print $manufacturer;
396
+}
397
+?>')</script>
378 398
 				<div class="form-group">
379 399
 					<label class="control-label col-sm-2"><?php echo _("Type"); ?></label>
380 400
 						<div class="col-sm-10">
@@ -383,11 +403,17 @@  discard block
 block discarded – undo
383 403
 							</select>
384 404
 						</div>
385 405
 				</div>
386
-				<script type="text/javascript">getSelect('aircrafttypes','<?php if(isset($_GET['aircraft_icao'])) print $aircraft_icao; ?>');</script>
406
+				<script type="text/javascript">getSelect('aircrafttypes','<?php if(isset($_GET['aircraft_icao'])) {
407
+	print $aircraft_icao;
408
+}
409
+?>');</script>
387 410
 				<div class="form-group">
388 411
 					<label class="control-label col-sm-2"><?php echo _("Registration"); ?></label> 
389 412
 					<div class="col-sm-10">
390
-						<input type="text" class="form-control" name="registration" value="<?php if (isset($_GET['registration'])) print $registration; ?>" size="8" placeholder="<?php echo _("Registration"); ?>" />
413
+						<input type="text" class="form-control" name="registration" value="<?php if (isset($_GET['registration'])) {
414
+	print $registration;
415
+}
416
+?>" size="8" placeholder="<?php echo _("Registration"); ?>" />
391 417
 					</div>
392 418
 				</div>
393 419
 <?php
@@ -396,22 +422,31 @@  discard block
 block discarded – undo
396 422
 				<div class="form-group">
397 423
 					<label class="control-label col-sm-2"><?php echo _("Pilot id"); ?></label> 
398 424
 					<div class="col-sm-10">
399
-						<input type="text" class="form-control" name="pilot_id" value="<?php if (isset($_GET['pilot_id'])) print $pilot_id; ?>" size="15" placeholder="<?php echo _("Pilot id"); ?>" />
425
+						<input type="text" class="form-control" name="pilot_id" value="<?php if (isset($_GET['pilot_id'])) {
426
+	print $pilot_id;
427
+}
428
+?>" size="15" placeholder="<?php echo _("Pilot id"); ?>" />
400 429
 					</div>
401 430
 				</div>
402 431
 				<div class="form-group">
403 432
 					<label class="control-label col-sm-2"><?php echo _("Pilot name"); ?></label> 
404 433
 					<div class="col-sm-10">
405
-						<input type="text" class="form-control" name="pilot_name" value="<?php if (isset($_GET['pilot_name'])) print $pilot_name; ?>" size="15" placeholder="<?php echo _("Pilot name"); ?>" />
434
+						<input type="text" class="form-control" name="pilot_name" value="<?php if (isset($_GET['pilot_name'])) {
435
+	print $pilot_name;
436
+}
437
+?>" size="15" placeholder="<?php echo _("Pilot name"); ?>" />
406 438
 					</div>
407 439
 				</div>
408 440
 <?php
409
-	}else {
441
+	} else {
410 442
 ?>
411 443
 				<div class="form-group">
412 444
 					<label class="control-label col-sm-2"><?php echo _("Owner name"); ?></label> 
413 445
 					<div class="col-sm-10">
414
-						<input type="text" class="form-control" name="owner" value="<?php if (isset($_GET['owner'])) print $owner; ?>" size="15" placeholder="<?php echo _("Owner name"); ?>" />
446
+						<input type="text" class="form-control" name="owner" value="<?php if (isset($_GET['owner'])) {
447
+	print $owner;
448
+}
449
+?>" size="15" placeholder="<?php echo _("Owner name"); ?>" />
415 450
 					</div>
416 451
 				</div>
417 452
 <?php
@@ -419,8 +454,14 @@  discard block
 block discarded – undo
419 454
 ?>
420 455
 				<div class="form-group">
421 456
 					<div class="col-sm-offset-2 col-sm-10">
422
-					<!--<div><input type="checkbox" class="form-control" 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 aircraft with special highlights (unique liveries, destinations etc.)"); ?></label></div>-->
423
-					<label class="checkbox-inline"><input type="checkbox" name="highlights" value="true" id="highlights" <?php if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true"){ print 'checked="checked"'; } ?>> <?php echo _("Include only aircraft with special highlights (unique liveries, destinations etc.)"); ?></label>
457
+					<!--<div><input type="checkbox" class="form-control" name="highlights" value="true" id="highlights" <?php if (isset($_GET['highlights'])) {
458
+	if ($_GET['highlights'] == "true"){ print 'checked="checked"';
459
+}
460
+} ?>> <label for="highlights"><?php echo _("Include only aircraft with special highlights (unique liveries, destinations etc.)"); ?></label></div>-->
461
+					<label class="checkbox-inline"><input type="checkbox" name="highlights" value="true" id="highlights" <?php if (isset($_GET['highlights'])) {
462
+	if ($_GET['highlights'] == "true"){ print 'checked="checked"';
463
+}
464
+} ?>> <?php echo _("Include only aircraft with special highlights (unique liveries, destinations etc.)"); ?></label>
424 465
 					</div>
425 466
 				</div>
426 467
 			</fieldset>
@@ -434,7 +475,10 @@  discard block
 block discarded – undo
434 475
 						</select>
435 476
 					</div>
436 477
 				</div>
437
-				<script type="text/javascript">getSelect('airlinenames','<?php if(isset($_GET['airline'])) print $airline; ?>');</script>
478
+				<script type="text/javascript">getSelect('airlinenames','<?php if(isset($_GET['airline'])) {
479
+	print $airline;
480
+}
481
+?>');</script>
438 482
 				<div class="form-group">
439 483
 					<label class="control-label col-sm-2"><?php echo _("Country"); ?></label> 
440 484
 					<div class="col-sm-10">
@@ -443,19 +487,34 @@  discard block
 block discarded – undo
443 487
 						</select>
444 488
 					</div>
445 489
 				</div>
446
-				<script type="text/javascript">getSelect('airlinecountries','<?php if(isset($_GET['airline_country'])) print $airline_country; ?>');</script>
490
+				<script type="text/javascript">getSelect('airlinecountries','<?php if(isset($_GET['airline_country'])) {
491
+	print $airline_country;
492
+}
493
+?>');</script>
447 494
 				<div class="form-group">
448 495
 					<label class="control-label col-sm-2"><?php echo _("Callsign"); ?></label> 
449 496
 					<div class="col-sm-10">
450
-						<input type="text" name="callsign" class="form-control" value="<?php if (isset($_GET['callsign'])) print $callsign; ?>" size="8" placeholder="<?php echo _("Callsign"); ?>" />
497
+						<input type="text" name="callsign" class="form-control" value="<?php if (isset($_GET['callsign'])) {
498
+	print $callsign;
499
+}
500
+?>" size="8" placeholder="<?php echo _("Callsign"); ?>" />
451 501
 					</div>
452 502
 				</div>
453 503
 				<div class="form-group">
454 504
 					<div class="col-sm-offset-2 col-sm-10">
455 505
 						<label class="radio-inline"><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"'; } ?>> <?php echo _("All airlines types"); ?></label>
456
-						<label class="radio-inline"><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"'; } ?>> <?php echo _("Only Passenger airlines"); ?></label>
457
-						<label class="radio-inline"><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"'; } ?>> <?php echo _("Only Cargo airlines"); ?></label>
458
-						<label class="radio-inline"><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"'; } ?>> <?php echo _("Only Military airlines"); ?></label>
506
+						<label class="radio-inline"><input type="radio" name="airline_type" value="passenger" id="airline_type_passenger" <?php if (isset($_GET['airline_type'])) {
507
+	if ($_GET['airline_type'] == "passenger"){ print 'checked="checked"';
508
+}
509
+} ?>> <?php echo _("Only Passenger airlines"); ?></label>
510
+						<label class="radio-inline"><input type="radio" name="airline_type" value="cargo" id="airline_type_cargo" <?php if (isset($_GET['airline_type'])) {
511
+	if ( $_GET['airline_type'] == "cargo"){ print 'checked="checked"';
512
+}
513
+} ?>> <?php echo _("Only Cargo airlines"); ?></label>
514
+						<label class="radio-inline"><input type="radio" name="airline_type" value="military" id="airline_type_military" <?php if (isset($_GET['airline_type'])) {
515
+	if ( $_GET['airline_type'] == "military"){ print 'checked="checked"';
516
+}
517
+} ?>> <?php echo _("Only Military airlines"); ?></label>
459 518
 					</div>
460 519
 				</div>
461 520
 			</fieldset>
@@ -469,7 +528,10 @@  discard block
 block discarded – undo
469 528
 						</select>
470 529
 					</div>
471 530
 				</div>
472
-				<script type="text/javascript">getSelect('airportnames','<?php if(isset($_GET['airport_icao'])) print $airport_icao; ?>');</script>
531
+				<script type="text/javascript">getSelect('airportnames','<?php if(isset($_GET['airport_icao'])) {
532
+	print $airport_icao;
533
+}
534
+?>');</script>
473 535
 				<div class="form-group">
474 536
 					<label class="control-label col-sm-2"><?php echo _("Country"); ?></label> 
475 537
 					<div class="col-sm-10">
@@ -478,7 +540,10 @@  discard block
 block discarded – undo
478 540
 						</select>
479 541
 					</div>
480 542
 				</div>
481
-				<script type="text/javascript">getSelect('airportcountries','<?php if(isset($_GET['airport_country'])) print $airport_country; ?>');</script>
543
+				<script type="text/javascript">getSelect('airportcountries','<?php if(isset($_GET['airport_country'])) {
544
+	print $airport_country;
545
+}
546
+?>');</script>
482 547
 			</fieldset>
483 548
 			<fieldset>
484 549
 				<legend><?php echo _("Route"); ?></legend>
@@ -490,7 +555,10 @@  discard block
 block discarded – undo
490 555
 						</select>
491 556
 					</div>
492 557
 				</div>
493
-				<script type="text/javascript">getSelect('departureairportnames','<?php if(isset($_GET['departure_airport_route'])) print $departure_airport_route; ?>');</script>
558
+				<script type="text/javascript">getSelect('departureairportnames','<?php if(isset($_GET['departure_airport_route'])) {
559
+	print $departure_airport_route;
560
+}
561
+?>');</script>
494 562
 				<div class="form-group">
495 563
 					<label class="control-label col-sm-2"><?php echo _("Arrival Airport"); ?></label> 
496 564
 					<div class="col-sm-10">
@@ -499,7 +567,10 @@  discard block
 block discarded – undo
499 567
 						</select>
500 568
 					</div>
501 569
 				</div>
502
-				<script type="text/javascript">getSelect('arrivalairportnames','<?php if(isset($_GET['arrival_airport_route'])) print $arrival_airport_route; ?>');</script>
570
+				<script type="text/javascript">getSelect('arrivalairportnames','<?php if(isset($_GET['arrival_airport_route'])) {
571
+	print $arrival_airport_route;
572
+}
573
+?>');</script>
503 574
 			</fieldset>
504 575
 			<fieldset>
505 576
 				<legend>Altitude</legend>
@@ -549,19 +620,33 @@  discard block
 block discarded – undo
549 620
 				<div class="form-group">
550 621
 					<label class="control-label col-sm-2"><?php echo _("Latitude"); ?></label>
551 622
 					<div class="col-sm-10">
552
-						<input type="text" name="origlat" class="form-control" placeholder="<?php echo _("Center point latitude"); ?>" value="<?php if (isset($_GET['origlat'])) print $origlat; ?>" />
623
+						<input type="text" name="origlat" class="form-control" placeholder="<?php echo _("Center point latitude"); ?>" value="<?php if (isset($_GET['origlat'])) {
624
+	print $origlat;
625
+}
626
+?>" />
553 627
 					</div>
554 628
 				</div>
555 629
 				<div class="form-group">
556 630
 					<label class="control-label col-sm-2"><?php echo _("Longitude"); ?></label>
557 631
 					<div class="col-sm-10">
558
-						<input type="text" name="origlon" class="form-control" placeholder="<?php echo _("Center point longitude"); ?>" value="<?php if (isset($_GET['origlon'])) print $origlon; ?>" />
632
+						<input type="text" name="origlon" class="form-control" placeholder="<?php echo _("Center point longitude"); ?>" value="<?php if (isset($_GET['origlon'])) {
633
+	print $origlon;
634
+}
635
+?>" />
559 636
 					</div>
560 637
 				</div>
561 638
 				<div class="form-group">
562
-					<label class="control-label col-sm-2"><?php echo _("Distance").' ('; if (isset($globalDistanceUnit)) print $globalDistanceUnit; else print 'km'; print ')'; ?></label>
639
+					<label class="control-label col-sm-2"><?php echo _("Distance").' ('; if (isset($globalDistanceUnit)) {
640
+	print $globalDistanceUnit;
641
+} else {
642
+	print 'km';
643
+}
644
+print ')'; ?></label>
563 645
 					<div class="col-sm-10">
564
-						<input type="text" name="dist" class="form-control" placeholder="<?php echo _("Distance from center point"); ?>" value="<?php if (isset($_GET['distance'])) print $distance; ?>" />
646
+						<input type="text" name="dist" class="form-control" placeholder="<?php echo _("Distance from center point"); ?>" value="<?php if (isset($_GET['distance'])) {
647
+	print $distance;
648
+}
649
+?>" />
565 650
 					</div>
566 651
 				</div>
567 652
 			</fieldset>
@@ -572,7 +657,10 @@  discard block
 block discarded – undo
572 657
 				<div class="form-group">
573 658
 					<label class="control-label col-sm-2"><?php echo _("Callsign"); ?></label> 
574 659
 					<div class="col-sm-10">
575
-						<input type="text" name="callsign" class="form-control" value="<?php if (isset($_GET['callsign'])) print $callsign; ?>" size="8" placeholder="<?php echo _("Callsign"); ?>" />
660
+						<input type="text" name="callsign" class="form-control" value="<?php if (isset($_GET['callsign'])) {
661
+	print $callsign;
662
+}
663
+?>" size="8" placeholder="<?php echo _("Callsign"); ?>" />
576 664
 					</div>
577 665
 				</div>
578 666
 			</fieldset>
@@ -583,7 +671,10 @@  discard block
 block discarded – undo
583 671
 				<div class="form-group">
584 672
 					<label class="control-label col-sm-2"><?php echo _("Callsign"); ?></label> 
585 673
 					<div class="col-sm-10">
586
-						<input type="text" name="callsign" class="form-control" value="<?php if (isset($_GET['callsign'])) print $callsign; ?>" size="8" placeholder="<?php echo _("Callsign"); ?>" />
674
+						<input type="text" name="callsign" class="form-control" value="<?php if (isset($_GET['callsign'])) {
675
+	print $callsign;
676
+}
677
+?>" size="8" placeholder="<?php echo _("Callsign"); ?>" />
587 678
 					</div>
588 679
 				</div>
589 680
 			</fieldset>
@@ -591,7 +682,10 @@  discard block
 block discarded – undo
591 682
 				<div class="form-group">
592 683
 					<label class="control-label col-sm-2"><?php echo _("MMSI"); ?></label> 
593 684
 					<div class="col-sm-10">
594
-						<input type="text" name="mmsi" class="form-control" value="<?php if (isset($_GET['mmsi'])) print $mmsi; ?>" size="8" placeholder="<?php echo _("MMSI"); ?>" />
685
+						<input type="text" name="mmsi" class="form-control" value="<?php if (isset($_GET['mmsi'])) {
686
+	print $mmsi;
687
+}
688
+?>" size="8" placeholder="<?php echo _("MMSI"); ?>" />
595 689
 					</div>
596 690
 				</div>
597 691
 			</fieldset>
@@ -599,7 +693,10 @@  discard block
 block discarded – undo
599 693
 				<div class="form-group">
600 694
 					<label class="control-label col-sm-2"><?php echo _("IMO"); ?></label> 
601 695
 					<div class="col-sm-10">
602
-						<input type="text" name="imo" class="form-control" value="<?php if (isset($_GET['imo'])) print $imo; ?>" size="8" placeholder="<?php echo _("IMO"); ?>" />
696
+						<input type="text" name="imo" class="form-control" value="<?php if (isset($_GET['imo'])) {
697
+	print $imo;
698
+}
699
+?>" size="8" placeholder="<?php echo _("IMO"); ?>" />
603 700
 					</div>
604 701
 				</div>
605 702
 			</fieldset>
@@ -612,7 +709,10 @@  discard block
 block discarded – undo
612 709
 					<label class="control-label col-sm-2"><?php echo _("Start Date"); ?></label>
613 710
 					<div class="col-sm-10">
614 711
 						<div class='input-group date' id='datetimepicker1'>
615
-							<input type='text' name="start_date" class="form-control" value="<?php if (isset($_GET['start_date']) && $_GET['start_date'] != '') print $start_date; ?>" placeholder="<?php echo _("Start Date/Time"); ?>" />
712
+							<input type='text' name="start_date" class="form-control" value="<?php if (isset($_GET['start_date']) && $_GET['start_date'] != '') {
713
+	print $start_date;
714
+}
715
+?>" placeholder="<?php echo _("Start Date/Time"); ?>" />
616 716
 							<span class="input-group-addon">
617 717
 								<span class="glyphicon glyphicon-calendar"></span>
618 718
 							</span>
@@ -623,7 +723,10 @@  discard block
 block discarded – undo
623 723
 					<label class="control-label col-sm-2"><?php echo _("End Date"); ?></label>
624 724
 					<div class="col-sm-10">
625 725
 						<div class='input-group date' id='datetimepicker2'>
626
-						<input type='text' name="end_date" class="form-control" value="<?php if (isset($_GET['end_date']) && $_GET['end_date'] != '') print $end_date; ?>" placeholder="<?php echo _("End Date/Time"); ?>" />
726
+						<input type='text' name="end_date" class="form-control" value="<?php if (isset($_GET['end_date']) && $_GET['end_date'] != '') {
727
+	print $end_date;
728
+}
729
+?>" placeholder="<?php echo _("End Date/Time"); ?>" />
627 730
 						<span class="input-group-addon">
628 731
 							<span class="glyphicon glyphicon-calendar"></span>
629 732
 						</span>
Please login to merge, or discard this patch.
highlights-display.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -7,15 +7,15 @@  discard block
 block discarded – undo
7 7
 require_once('header.php');
8 8
 
9 9
 //calculuation for the pagination
10
-if(!isset($_GET['limit']))
10
+if (!isset($_GET['limit']))
11 11
 {
12 12
 	$limit_start = 0;
13 13
 	$limit_end = 28;
14 14
 	$absolute_difference = 28;
15 15
 } else {
16 16
 	$limit_explode = explode(",", $_GET['limit']);
17
-	$limit_start = filter_var($limit_explode[0],FILTER_SANITIZE_NUMBER_INT);
18
-	$limit_end = filter_var($limit_explode[1],FILTER_SANITIZE_NUMBER_INT);
17
+	$limit_start = filter_var($limit_explode[0], FILTER_SANITIZE_NUMBER_INT);
18
+	$limit_end = filter_var($limit_explode[1], FILTER_SANITIZE_NUMBER_INT);
19 19
 	if (!ctype_digit(strval($limit_start)) || !ctype_digit(strval($limit_end))) {
20 20
 		$limit_start = 0;
21 21
 		$limit_end = 25;
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 print '<div class="column">';	
40 40
 print '<p>'._("The view below shows all aircraft that have been selected to have some sort of special characteristic about them, such as unique liveries, destinations etc.").'</p>';
41 41
 
42
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
42
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
43 43
 if ($sort != '') {
44 44
 	$spotter_array = $Spotter->getSpotterDataByHighlight($limit_start.",".$absolute_difference, $sort);
45 45
 } else {
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 if (!empty($spotter_array))
49 49
 {
50 50
 	print '<div class="dispay-view">';
51
-	foreach($spotter_array as $spotter_item)
51
+	foreach ($spotter_array as $spotter_item)
52 52
 	{
53 53
 		if (isset($spotter_item['image']) && $spotter_item['image'] != "")
54 54
 		{
Please login to merge, or discard this patch.
manufacturer-statistics-aircraft.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -8,13 +8,13 @@  discard block
 block discarded – undo
8 8
         die();
9 9
 }
10 10
 $Spotter = new Spotter();
11
-$manufacturer = ucwords(str_replace("-", " ", urldecode(filter_input(INPUT_GET,'aircraft_manufacturer',FILTER_SANITIZE_STRING))));
12
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
13
-$spotter_array = $Spotter->getSpotterDataByManufacturer($manufacturer,"0,1", $sort);
11
+$manufacturer = ucwords(str_replace("-", " ", urldecode(filter_input(INPUT_GET, 'aircraft_manufacturer', FILTER_SANITIZE_STRING))));
12
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
13
+$spotter_array = $Spotter->getSpotterDataByManufacturer($manufacturer, "0,1", $sort);
14 14
 
15 15
 if (!empty($spotter_array))
16 16
 {
17
-	$title = sprintf(_("Most Common Aircraft from %s"),$manufacturer);
17
+	$title = sprintf(_("Most Common Aircraft from %s"), $manufacturer);
18 18
 
19 19
 	require_once('header.php');
20 20
 	print '<div class="select-item">';
@@ -23,9 +23,9 @@  discard block
 block discarded – undo
23 23
 	$Stats = new Stats();
24 24
 	$all_manufacturers = $Stats->getAllManufacturers();
25 25
 	if (empty($all_manufacturers)) $all_manufacturers = $Spotter->getAllManufacturers();
26
-	foreach($all_manufacturers as $all_manufacturer)
26
+	foreach ($all_manufacturers as $all_manufacturer)
27 27
 	{
28
-		if($manufacturer == ucwords($all_manufacturer['aircraft_manufacturer']))
28
+		if ($manufacturer == ucwords($all_manufacturer['aircraft_manufacturer']))
29 29
 		{
30 30
 			print '<option value="'.strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer'])).'" selected="selected">'.$all_manufacturer['aircraft_manufacturer'].'</option>';
31 31
 		} else {
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 	include('manufacturer-sub-menu.php');
45 45
 	print '<div class="column">';
46 46
 	print '<h2>'._("Most Common Aircraft").'</h2>';
47
-	print '<p>'.sprintf(_("The statistic below shows the most common aircraft of flights from <strong>%s</strong>."),$manufacturer).'</p>';
47
+	print '<p>'.sprintf(_("The statistic below shows the most common aircraft of flights from <strong>%s</strong>."), $manufacturer).'</p>';
48 48
 
49 49
 	$aircraft_array = $Spotter->countAllAircraftTypesByManufacturer($manufacturer);
50 50
 	if (!empty($aircraft_array))
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 		print '</thead>';
60 60
 		print '<tbody>';
61 61
 		$i = 1;
62
-		foreach($aircraft_array as $aircraft_item)
62
+		foreach ($aircraft_array as $aircraft_item)
63 63
 		{
64 64
 			print '<tr>';
65 65
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
pilot-detailed.php 2 patches
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -5,13 +5,13 @@  discard block
 block discarded – undo
5 5
 require_once('require/class.Language.php');
6 6
 require_once('require/class.SpotterArchive.php');
7 7
 
8
-if (!isset($_GET['pilot'])){
8
+if (!isset($_GET['pilot'])) {
9 9
 	header('Location: '.$globalURL.'/');
10 10
 } else {
11 11
 	$Spotter = new Spotter();
12 12
 	$SpotterArchive = new SpotterArchive();
13 13
 	//calculuation for the pagination
14
-	if(!isset($_GET['limit']))
14
+	if (!isset($_GET['limit']))
15 15
 	{
16 16
 		$limit_start = 0;
17 17
 		$limit_end = 25;
@@ -32,29 +32,29 @@  discard block
 block discarded – undo
32 32
 	
33 33
 	$page_url = $globalURL.'/pilot/'.$_GET['pilot'];
34 34
 	
35
-	$pilot = filter_input(INPUT_GET,'pilot',FILTER_SANITIZE_STRING);
36
-	$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
37
-	$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);
38
-	$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT);
35
+	$pilot = filter_input(INPUT_GET, 'pilot', FILTER_SANITIZE_STRING);
36
+	$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
37
+	$year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT);
38
+	$month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT);
39 39
 	$filter = array();
40
-	if ($year != '') $filter = array_merge($filter,array('year' => $year));
41
-	if ($month != '') $filter = array_merge($filter,array('month' => $month));
40
+	if ($year != '') $filter = array_merge($filter, array('year' => $year));
41
+	if ($month != '') $filter = array_merge($filter, array('month' => $month));
42 42
 	if ($sort != '') 
43 43
 	{
44
-		$spotter_array = $Spotter->getSpotterDataByPilot($pilot,$limit_start.",".$absolute_difference, $sort,$filter);
44
+		$spotter_array = $Spotter->getSpotterDataByPilot($pilot, $limit_start.",".$absolute_difference, $sort, $filter);
45 45
 		if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) {
46
-			$spotter_array = $SpotterArchive->getSpotterDataByPilot($pilot,$limit_start.",".$absolute_difference, $sort,$filter);
46
+			$spotter_array = $SpotterArchive->getSpotterDataByPilot($pilot, $limit_start.",".$absolute_difference, $sort, $filter);
47 47
 		}
48 48
 	} else {
49
-		$spotter_array = $Spotter->getSpotterDataByPilot($pilot,$limit_start.",".$absolute_difference,'',$filter);
49
+		$spotter_array = $Spotter->getSpotterDataByPilot($pilot, $limit_start.",".$absolute_difference, '', $filter);
50 50
 		if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) {
51
-			$spotter_array = $SpotterArchive->getSpotterDataByPilot($pilot,$limit_start.",".$absolute_difference,'',$filter);
51
+			$spotter_array = $SpotterArchive->getSpotterDataByPilot($pilot, $limit_start.",".$absolute_difference, '', $filter);
52 52
 		}
53 53
 	}
54 54
 
55 55
 	if (!empty($spotter_array))
56 56
 	{
57
-		$title = sprintf(_("Detailed View for %s"),$spotter_array[0]['pilot_name']);
57
+		$title = sprintf(_("Detailed View for %s"), $spotter_array[0]['pilot_name']);
58 58
 		$ident = $spotter_array[0]['ident'];
59 59
 		if (isset($spotter_array[0]['latitude'])) $latitude = $spotter_array[0]['latitude'];
60 60
 		if (isset($spotter_array[0]['longitude'])) $longitude = $spotter_array[0]['longitude'];
@@ -115,23 +115,23 @@  discard block
 block discarded – undo
115 115
 			$Stats = new Stats();
116 116
 			$flights = $Stats->getStatsPilot($pilot);
117 117
 		} else $flights = 0;
118
-		if ($flights == 0) $flights = $Spotter->countFlightsByPilot($pilot,$filter);
118
+		if ($flights == 0) $flights = $Spotter->countFlightsByPilot($pilot, $filter);
119 119
 		print '<div><span class="label">'._("Flights").'</span>'.$flights.'</div>';
120
-		$aircraft_type = count($Spotter->countAllAircraftTypesByPilot($pilot,$filter));
120
+		$aircraft_type = count($Spotter->countAllAircraftTypesByPilot($pilot, $filter));
121 121
 		print '<div><span class="label">'._("Aircraft type").'</span>'.$aircraft_type.'</div>';
122
-		$aircraft_registration = count($Spotter->countAllAircraftRegistrationByPilot($pilot,$filter));
122
+		$aircraft_registration = count($Spotter->countAllAircraftRegistrationByPilot($pilot, $filter));
123 123
 		print '<div><span class="label">'._("Aircraft").'</span>'.$aircraft_registration.'</div>';
124
-		$aircraft_manufacturer = count($Spotter->countAllAircraftManufacturerByPilot($pilot,$filter));
124
+		$aircraft_manufacturer = count($Spotter->countAllAircraftManufacturerByPilot($pilot, $filter));
125 125
 		print '<div><span class="label">'._("Manufacturers").'</span>'.$aircraft_manufacturer.'</div>';
126
-		$airlines = count($Spotter->countAllAirlinesByPilot($pilot,$filter));
126
+		$airlines = count($Spotter->countAllAirlinesByPilot($pilot, $filter));
127 127
 		print '<div><span class="label">'._("Airlines").'</span>'.$airlines.'</div>';
128
-		$duration = $Spotter->getFlightDurationByPilot($pilot,$filter);
128
+		$duration = $Spotter->getFlightDurationByPilot($pilot, $filter);
129 129
 		if ($duration != '0') print '<div><span class="label">'._("Total flights spotted duration").'</span>'.$duration.'</div>';
130 130
 		print '</div>';
131 131
 	
132 132
 		include('pilot-sub-menu.php');
133 133
 		print '<div class="table column">';
134
-		print '<p>'.sprintf(_("The table below shows the detailed information of all flights with the pilot <strong>%s</strong>."),$spotter_array[0]['pilot_name']).'</p>';
134
+		print '<p>'.sprintf(_("The table below shows the detailed information of all flights with the pilot <strong>%s</strong>."), $spotter_array[0]['pilot_name']).'</p>';
135 135
 
136 136
 		include('table-output.php'); 
137 137
 		print '<div class="pagination">';
Please login to merge, or discard this patch.
Braces   +24 added lines, -8 removed lines patch added patch discarded remove patch
@@ -37,8 +37,12 @@  discard block
 block discarded – undo
37 37
 	$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);
38 38
 	$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT);
39 39
 	$filter = array();
40
-	if ($year != '') $filter = array_merge($filter,array('year' => $year));
41
-	if ($month != '') $filter = array_merge($filter,array('month' => $month));
40
+	if ($year != '') {
41
+		$filter = array_merge($filter,array('year' => $year));
42
+	}
43
+	if ($month != '') {
44
+		$filter = array_merge($filter,array('month' => $month));
45
+	}
42 46
 	if ($sort != '') 
43 47
 	{
44 48
 		$spotter_array = $Spotter->getSpotterDataByPilot($pilot,$limit_start.",".$absolute_difference, $sort,$filter);
@@ -56,8 +60,12 @@  discard block
 block discarded – undo
56 60
 	{
57 61
 		$title = sprintf(_("Detailed View for %s"),$spotter_array[0]['pilot_name']);
58 62
 		$ident = $spotter_array[0]['ident'];
59
-		if (isset($spotter_array[0]['latitude'])) $latitude = $spotter_array[0]['latitude'];
60
-		if (isset($spotter_array[0]['longitude'])) $longitude = $spotter_array[0]['longitude'];
63
+		if (isset($spotter_array[0]['latitude'])) {
64
+			$latitude = $spotter_array[0]['latitude'];
65
+		}
66
+		if (isset($spotter_array[0]['longitude'])) {
67
+			$longitude = $spotter_array[0]['longitude'];
68
+		}
61 69
 		require_once('header.php');
62 70
 		/*
63 71
 		if (isset($globalArchive) && $globalArchive) {
@@ -110,12 +118,18 @@  discard block
 block discarded – undo
110 118
 		*/
111 119
 		print '<div class="info column">';
112 120
 		print '<h1>'.$spotter_array[0]['pilot_name'].'</h1>';
113
-		if (isset($spotter_array[0]['pilot_id']) && $spotter_array[0]['pilot_id'] != '') print '<div><span class="label">'._("Pilot ID").'</span>'.$spotter_array[0]['pilot_id'].'</div>';
121
+		if (isset($spotter_array[0]['pilot_id']) && $spotter_array[0]['pilot_id'] != '') {
122
+			print '<div><span class="label">'._("Pilot ID").'</span>'.$spotter_array[0]['pilot_id'].'</div>';
123
+		}
114 124
 		if ($year == '' && $month == '') {
115 125
 			$Stats = new Stats();
116 126
 			$flights = $Stats->getStatsPilot($pilot);
117
-		} else $flights = 0;
118
-		if ($flights == 0) $flights = $Spotter->countFlightsByPilot($pilot,$filter);
127
+		} else {
128
+			$flights = 0;
129
+		}
130
+		if ($flights == 0) {
131
+			$flights = $Spotter->countFlightsByPilot($pilot,$filter);
132
+		}
119 133
 		print '<div><span class="label">'._("Flights").'</span>'.$flights.'</div>';
120 134
 		$aircraft_type = count($Spotter->countAllAircraftTypesByPilot($pilot,$filter));
121 135
 		print '<div><span class="label">'._("Aircraft type").'</span>'.$aircraft_type.'</div>';
@@ -126,7 +140,9 @@  discard block
 block discarded – undo
126 140
 		$airlines = count($Spotter->countAllAirlinesByPilot($pilot,$filter));
127 141
 		print '<div><span class="label">'._("Airlines").'</span>'.$airlines.'</div>';
128 142
 		$duration = $Spotter->getFlightDurationByPilot($pilot,$filter);
129
-		if ($duration != '0') print '<div><span class="label">'._("Total flights spotted duration").'</span>'.$duration.'</div>';
143
+		if ($duration != '0') {
144
+			print '<div><span class="label">'._("Total flights spotted duration").'</span>'.$duration.'</div>';
145
+		}
130 146
 		print '</div>';
131 147
 	
132 148
 		include('pilot-sub-menu.php');
Please login to merge, or discard this patch.
airport.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -7,16 +7,16 @@  discard block
 block discarded – undo
7 7
 
8 8
 if (isset($_POST['airport']))
9 9
 {
10
-	header('Location: '.$globalURL.'/airport/'.filter_input(INPUT_POST,'airport',FILTER_SANITIZE_STRING));
11
-} else if (isset($_GET['airport'])){
10
+	header('Location: '.$globalURL.'/airport/'.filter_input(INPUT_POST, 'airport', FILTER_SANITIZE_STRING));
11
+} else if (isset($_GET['airport'])) {
12 12
 	$Spotter = new Spotter();
13 13
 	//calculuation for the pagination
14
-	if($_GET['limit'] == "")
14
+	if ($_GET['limit'] == "")
15 15
 	{
16 16
 	  $limit_start = 0;
17 17
 	  $limit_end = 25;
18 18
 	  $absolute_difference = 25;
19
-	}  else {
19
+	} else {
20 20
 		$limit_explode = explode(",", $_GET['limit']);
21 21
 		$limit_start = $limit_explode[0];
22 22
 		$limit_end = $limit_explode[1];
@@ -30,10 +30,10 @@  discard block
 block discarded – undo
30 30
 	$limit_previous_1 = $limit_start - $absolute_difference;
31 31
 	$limit_previous_2 = $limit_end - $absolute_difference;
32 32
 	
33
-	$airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING);
34
-	$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
33
+	$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING);
34
+	$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
35 35
 	$page_url = $globalURL.'/airport/'.$airport;
36
-	$spotter_array = $Spotter->getSpotterDataByAirport($airport,$limit_start.",".$absolute_difference, $sort);
36
+	$spotter_array = $Spotter->getSpotterDataByAirport($airport, $limit_start.",".$absolute_difference, $sort);
37 37
 	$airport_array = $Spotter->getAllAirportInfo($airport);
38 38
 	
39 39
 	if (!empty($airport_array))
@@ -52,9 +52,9 @@  discard block
 block discarded – undo
52 52
 			$airport_names = $Spotter->getAllAirportNames();
53 53
 		}
54 54
 		ksort($airport_names);
55
-		foreach($airport_names as $airport_name)
55
+		foreach ($airport_names as $airport_name)
56 56
 		{
57
-			if($airport == $airport_name['airport_icao'])
57
+			if ($airport == $airport_name['airport_icao'])
58 58
 			{
59 59
 				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>';
60 60
 			} else {
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 		print '<div class="table column">';
88 88
 		if ($airport_array[0]['iata'] != "NA")
89 89
 		{
90
-			print '<p>'.sprintf(_("The table below shows the route(s) aircraft have used to/from <strong>%s</strong>, sorted by the most recent one."),$airport_array[0]['name']).'</p>';
90
+			print '<p>'.sprintf(_("The table below shows the route(s) aircraft have used to/from <strong>%s</strong>, sorted by the most recent one."), $airport_array[0]['name']).'</p>';
91 91
 		}
92 92
 
93 93
 		include('table-output.php');  
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 		print '<p>'._("Sorry, the airport does not exist in this database. :(").'</p>'; 
110 110
 	}
111 111
 } else {
112
-	$Spotter= new Spotter();
112
+	$Spotter = new Spotter();
113 113
 	$Stats = new Stats();
114 114
 	$Common = new Common();
115 115
 	$title = _("Airports");
@@ -123,11 +123,11 @@  discard block
 block discarded – undo
123 123
 	ksort($airport_names);
124 124
 	$previous = null;
125 125
 	print '<div class="alphabet-legend">';
126
-	foreach($airport_names as $value) {
126
+	foreach ($airport_names as $value) {
127 127
 		$firstLetter = strtoupper($Common->replace_mb_substr($value['airport_city'], 0, 1));
128
-		if($previous !== $firstLetter)
128
+		if ($previous !== $firstLetter)
129 129
 		{
130
-			if ($previous !== null){
130
+			if ($previous !== null) {
131 131
 				print ' | ';
132 132
 			}
133 133
 			print '<a href="#'.$firstLetter.'">'.$firstLetter.'</a>';
@@ -136,13 +136,13 @@  discard block
 block discarded – undo
136 136
 	}
137 137
 	print '</div>';
138 138
 	$previous = null;
139
-	foreach($airport_names as $value) {
139
+	foreach ($airport_names as $value) {
140 140
 		$firstLetter = strtoupper($Common->replace_mb_substr($value['airport_city'], 0, 1));
141 141
 		if ($firstLetter != "")
142 142
 		{
143
-			if($previous !== $firstLetter)
143
+			if ($previous !== $firstLetter)
144 144
 			{
145
-				if ($previous !== null){
145
+				if ($previous !== null) {
146 146
 					print '</div>';
147 147
 				}
148 148
 				print '<a name="'.$firstLetter.'"></a><h4 class="alphabet-header">'.$firstLetter.'</h4><div class="alphabet">';
Please login to merge, or discard this patch.
date-statistics-aircraft.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -3,14 +3,14 @@  discard block
 block discarded – undo
3 3
 require_once('require/class.Spotter.php');
4 4
 require_once('require/class.Language.php');
5 5
 $Spotter = new Spotter();
6
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
7
-$date = filter_input(INPUT_GET,'date',FILTER_SANITIZE_STRING);
8
-if (isset($_GET['date'])) $spotter_array = $Spotter->getSpotterDataByDate($date,"0,1", $sort);
6
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
7
+$date = filter_input(INPUT_GET, 'date', FILTER_SANITIZE_STRING);
8
+if (isset($_GET['date'])) $spotter_array = $Spotter->getSpotterDataByDate($date, "0,1", $sort);
9 9
 else $spotter_array = array();
10 10
 
11 11
 if (!empty($spotter_array))
12 12
 {
13
-	$title = sprintf(_("Most Common Aircraft on %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601'])));
13
+	$title = sprintf(_("Most Common Aircraft on %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601'])));
14 14
 	require_once('header.php');
15 15
 	print '<div class="select-item">';
16 16
 	print '<form action="'.$globalURL.'/date" method="post" class="form-inline">';
@@ -28,13 +28,13 @@  discard block
 block discarded – undo
28 28
 	print '<br />';
29 29
 
30 30
 	print '<div class="info column">';
31
-	print '<h1>'.sprintf(_("Flights from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>';
31
+	print '<h1>'.sprintf(_("Flights from %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>';
32 32
 	print '</div>';
33 33
 
34 34
 	include('date-sub-menu.php');
35 35
 	print '<div class="column">';
36 36
 	print '<h2>'._("Most Common Aircraft").'</h2>';
37
-	print '<p>'.sprintf(_("The statistic below shows the most common aircraft of flights on <strong>%s</strong>."),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>';
37
+	print '<p>'.sprintf(_("The statistic below shows the most common aircraft of flights on <strong>%s</strong>."), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>';
38 38
 	
39 39
 	$aircraft_array = $Spotter->countAllAircraftTypesByDate($date);
40 40
 	if (!empty($aircraft_array))
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 		print '</thead>';
50 50
 		print '<tbody>';
51 51
 		$i = 1;
52
-		foreach($aircraft_array as $aircraft_item)
52
+		foreach ($aircraft_array as $aircraft_item)
53 53
 		{
54 54
 			print '<tr>';
55 55
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
ident-statistics-aircraft.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -7,17 +7,17 @@  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);
10
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
11
+$ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING);
12 12
 if ($sort != '') {
13
-	$spotter_array = $Spotter->getSpotterDataByIdent($ident,"0,1", $sort);
13
+	$spotter_array = $Spotter->getSpotterDataByIdent($ident, "0,1", $sort);
14 14
 } else {
15
-	$spotter_array = $Spotter->getSpotterDataByIdent($ident,"0,1", '');
15
+	$spotter_array = $Spotter->getSpotterDataByIdent($ident, "0,1", '');
16 16
 }
17 17
 
18 18
 if (!empty($spotter_array))
19 19
 {
20
-	$title = sprintf(_("Most Common Aircraft of %s"),$spotter_array[0]['ident']);
20
+	$title = sprintf(_("Most Common Aircraft of %s"), $spotter_array[0]['ident']);
21 21
 	require_once('header.php');
22 22
 	print '<div class="info column">';
23 23
 	print '<h1>'.$spotter_array[0]['ident'].'</h1>';
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 	include('ident-sub-menu.php');
29 29
 	print '<div class="column">';
30 30
 	print '<h2>'._("Most Common Aircraft").'</h2>';
31
-	print '<p>'.sprintf(_("The statistic below shows the most common aircraft of flights using the ident/callsign <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>';
31
+	print '<p>'.sprintf(_("The statistic below shows the most common aircraft of flights using the ident/callsign <strong>%s</strong>."), $spotter_array[0]['ident']).'</p>';
32 32
 
33 33
 	$aircraft_array = $Spotter->countAllAircraftTypesByIdent($ident);
34 34
 	if (!empty($aircraft_array))
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 		print '</thead>';
44 44
 		print '<tbody>';
45 45
 		$i = 1;
46
-		foreach($aircraft_array as $aircraft_item)
46
+		foreach ($aircraft_array as $aircraft_item)
47 47
 		{
48 48
 			print '<tr>';
49 49
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
pilot-statistics-aircraft.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -7,22 +7,22 @@  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
-$pilot = filter_input(INPUT_GET,'pilot',FILTER_SANITIZE_STRING);
12
-$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);
13
-$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT);
10
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
11
+$pilot = filter_input(INPUT_GET, 'pilot', FILTER_SANITIZE_STRING);
12
+$year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT);
13
+$month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT);
14 14
 $filter = array();
15
-if ($year != '') $filter = array_merge($filter,array('year' => $year));
16
-if ($month != '') $filter = array_merge($filter,array('month' => $month));
15
+if ($year != '') $filter = array_merge($filter, array('year' => $year));
16
+if ($month != '') $filter = array_merge($filter, array('month' => $month));
17 17
 if ($sort != '') {
18
-	$spotter_array = $Spotter->getSpotterDataByPilot($pilot,"0,1", $sort,$filter);
18
+	$spotter_array = $Spotter->getSpotterDataByPilot($pilot, "0,1", $sort, $filter);
19 19
 } else {
20
-	$spotter_array = $Spotter->getSpotterDataByPilot($pilot,"0,1", '',$filter);
20
+	$spotter_array = $Spotter->getSpotterDataByPilot($pilot, "0,1", '', $filter);
21 21
 }
22 22
 
23 23
 if (!empty($spotter_array))
24 24
 {
25
-	$title = sprintf(_("Most Common Aircraft of %s"),$spotter_array[0]['pilot_name']);
25
+	$title = sprintf(_("Most Common Aircraft of %s"), $spotter_array[0]['pilot_name']);
26 26
 	require_once('header.php');
27 27
 	print '<div class="info column">';
28 28
 	print '<h1>'.$spotter_array[0]['pilot_name'].'</h1>';
@@ -33,9 +33,9 @@  discard block
 block discarded – undo
33 33
 	include('pilot-sub-menu.php');
34 34
 	print '<div class="column">';
35 35
 	print '<h2>'._("Most Common Aircraft").'</h2>';
36
-	print '<p>'.sprintf(_("The statistic below shows the most common aircraft of flights piloted by <strong>%s</strong>."),$spotter_array[0]['pilot_name']).'</p>';
36
+	print '<p>'.sprintf(_("The statistic below shows the most common aircraft of flights piloted by <strong>%s</strong>."), $spotter_array[0]['pilot_name']).'</p>';
37 37
 
38
-	$aircraft_array = $Spotter->countAllAircraftTypesByPilot($pilot,$filter);
38
+	$aircraft_array = $Spotter->countAllAircraftTypesByPilot($pilot, $filter);
39 39
 	if (!empty($aircraft_array))
40 40
 	{
41 41
 		print '<div class="table-responsive">';
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 		print '</thead>';
48 48
 		print '<tbody>';
49 49
 		$i = 1;
50
-		foreach($aircraft_array as $aircraft_item)
50
+		foreach ($aircraft_array as $aircraft_item)
51 51
 		{
52 52
 			print '<tr>';
53 53
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
country-statistics-aircraft.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -8,13 +8,13 @@  discard block
 block discarded – undo
8 8
 }
9 9
 $Spotter = new Spotter();
10 10
 
11
-$country = ucwords(str_replace("-", " ", urldecode(filter_input(INPUT_GET,'country',FILTER_SANITIZE_STRING))));
12
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
11
+$country = ucwords(str_replace("-", " ", urldecode(filter_input(INPUT_GET, 'country', FILTER_SANITIZE_STRING))));
12
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
13 13
 $spotter_array = $Spotter->getSpotterDataByCountry($country, "0,1", $sort);
14 14
 
15 15
 if (!empty($spotter_array))
16 16
 {
17
-	$title = sprintf(_("Most Common Aircraft from %s"),$country);
17
+	$title = sprintf(_("Most Common Aircraft from %s"), $country);
18 18
 
19 19
 	require_once('header.php');
20 20
 	print '<div class="select-item">';
@@ -22,9 +22,9 @@  discard block
 block discarded – undo
22 22
 	print '<select name="country" class="selectpicker" data-live-search="true">';
23 23
 	print '<option></option>';
24 24
 	$all_countries = $Spotter->getAllCountries();
25
-	foreach($all_countries as $all_country)
25
+	foreach ($all_countries as $all_country)
26 26
 	{
27
-		if($country == $all_country['country'])
27
+		if ($country == $all_country['country'])
28 28
 		{
29 29
 			print '<option value="'.strtolower(str_replace(" ", "-", $all_country['country'])).'" selected="selected">'.$all_country['country'].'</option>';
30 30
 		} else {
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 	if ($_GET['country'] != "NA")
40 40
 	{
41 41
 		print '<div class="info column">';
42
-		print '<h1>'.sprintf(_("Airports &amp; Airlines from %s"),$country).'</h1>';
42
+		print '<h1>'.sprintf(_("Airports &amp; Airlines from %s"), $country).'</h1>';
43 43
 		print '</div>';
44 44
 	} else {
45 45
 		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>';
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 	include('country-sub-menu.php');
49 49
 	print '<div class="column">';
50 50
 	print '<h2>'._("Most Common Aircraft").'</h2>';
51
-	print '<p>'.sprintf(_("The statistic below shows the most common aircraft of flights from <strong>%s</strong>."),$country).'</p>';
51
+	print '<p>'.sprintf(_("The statistic below shows the most common aircraft of flights from <strong>%s</strong>."), $country).'</p>';
52 52
 
53 53
 	$aircraft_array = $Spotter->countAllAircraftTypesByCountry($country);
54 54
 	if (!empty($aircraft_array))
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 		print '</thead>';
63 63
 		print '<tbody>';
64 64
 		$i = 1;
65
-		foreach($aircraft_array as $aircraft_item)
65
+		foreach ($aircraft_array as $aircraft_item)
66 66
 		{
67 67
 			print '<tr>';
68 68
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.