Completed
Push — master ( b49092...cf2135 )
by Yannick
30:03
created
search.php 3 patches
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -91,28 +91,28 @@
 block discarded – undo
91 91
 $limit_previous_2 = $limit_end - $absolute_difference;
92 92
 
93 93
 if (
94
-    (isset($_GET['q']) && $_GET['q'] != '') || 
95
-    (isset($_GET['registration']) && $_GET['registration'] != '') || 
96
-    (isset($_GET['aircraft']) && $_GET['aircraft'] != '') ||
97
-    (isset($_GET['manufacturer']) && $_GET['manufacturer'] != '') ||
98
-    (isset($_GET['highlights']) && $_GET['highlights'] != '') ||
99
-    (isset($_GET['airline']) && $_GET['airline'] != '') ||
100
-    (isset($_GET['airline_country']) && $_GET['airline_country'] != '') ||
101
-    (isset($_GET['airline_type']) && $_GET['airline_type'] != '') ||
102
-    (isset($_GET['airport']) && $_GET['airport'] != '') ||
103
-    (isset($_GET['airport_country']) && $_GET['airport_country'] != '') ||
104
-    (isset($_GET['callsign']) && $_GET['callsign'] != '') ||
105
-    (isset($_GET['owner']) && $_GET['owner'] != '') ||
106
-    (isset($_GET['pilot_name']) && $_GET['pilot_name'] != '') ||
107
-    (isset($_GET['pilot_id']) && $_GET['pilot_id'] != '') ||
108
-    (isset($_GET['departure_airport_route']) && $_GET['departure_airport_route'] != '') ||
109
-    (isset($_GET['arrival_airport_route']) && $_GET['arrival_airport_route'] != '') ||
110
-    (isset($_GET['mmsi']) && $_GET['mmsi'] != '') ||
111
-    (isset($_GET['imo']) && $_GET['imo'] != '') ||
112
-    ((isset($_GET['origlat']) && $_GET['origlat'] != '') &&
113
-    (isset($_GET['origlon']) && $_GET['origlon'] != '') &&
114
-    (isset($_GET['dist']) && $_GET['dist'] != ''))
115
-    ){  
94
+	(isset($_GET['q']) && $_GET['q'] != '') || 
95
+	(isset($_GET['registration']) && $_GET['registration'] != '') || 
96
+	(isset($_GET['aircraft']) && $_GET['aircraft'] != '') ||
97
+	(isset($_GET['manufacturer']) && $_GET['manufacturer'] != '') ||
98
+	(isset($_GET['highlights']) && $_GET['highlights'] != '') ||
99
+	(isset($_GET['airline']) && $_GET['airline'] != '') ||
100
+	(isset($_GET['airline_country']) && $_GET['airline_country'] != '') ||
101
+	(isset($_GET['airline_type']) && $_GET['airline_type'] != '') ||
102
+	(isset($_GET['airport']) && $_GET['airport'] != '') ||
103
+	(isset($_GET['airport_country']) && $_GET['airport_country'] != '') ||
104
+	(isset($_GET['callsign']) && $_GET['callsign'] != '') ||
105
+	(isset($_GET['owner']) && $_GET['owner'] != '') ||
106
+	(isset($_GET['pilot_name']) && $_GET['pilot_name'] != '') ||
107
+	(isset($_GET['pilot_id']) && $_GET['pilot_id'] != '') ||
108
+	(isset($_GET['departure_airport_route']) && $_GET['departure_airport_route'] != '') ||
109
+	(isset($_GET['arrival_airport_route']) && $_GET['arrival_airport_route'] != '') ||
110
+	(isset($_GET['mmsi']) && $_GET['mmsi'] != '') ||
111
+	(isset($_GET['imo']) && $_GET['imo'] != '') ||
112
+	((isset($_GET['origlat']) && $_GET['origlat'] != '') &&
113
+	(isset($_GET['origlon']) && $_GET['origlon'] != '') &&
114
+	(isset($_GET['dist']) && $_GET['dist'] != ''))
115
+	){  
116 116
 	$q = filter_input(INPUT_GET, 'q',FILTER_SANITIZE_STRING);
117 117
 	$registration = filter_input(INPUT_GET, 'registration',FILTER_SANITIZE_STRING);
118 118
 	$aircraft = filter_input(INPUT_GET, 'aircraft',FILTER_SANITIZE_STRING);
Please login to merge, or discard this patch.
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 aircrafts 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 aircrafts 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 aircrafts 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 aircrafts 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 aircrafts 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 aircrafts 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 aircrafts 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 aircrafts 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.