Completed
Push — master ( 2f98db...871605 )
by Yannick
21s queued 10s
created
search.php 2 patches
Spacing   +110 added lines, -110 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;
@@ -116,35 +116,35 @@  discard block
 block discarded – undo
116 116
     ((isset($_GET['origlat']) && $_GET['origlat'] != '') &&
117 117
     (isset($_GET['origlon']) && $_GET['origlon'] != '') &&
118 118
     (isset($_GET['dist']) && $_GET['dist'] != ''))
119
-    ){  
120
-	$q = filter_input(INPUT_GET, 'q',FILTER_SANITIZE_STRING);
121
-	$registration = filter_input(INPUT_GET, 'registration',FILTER_SANITIZE_STRING);
122
-	$aircraft = filter_input(INPUT_GET, 'aircraft',FILTER_SANITIZE_STRING);
123
-	$manufacturer = filter_input(INPUT_GET, 'manufacturer',FILTER_SANITIZE_STRING);
124
-	$highlights = filter_input(INPUT_GET, 'highlights',FILTER_SANITIZE_STRING);
125
-	$airline = filter_input(INPUT_GET, 'airline',FILTER_SANITIZE_STRING);
126
-	$airline_country = filter_input(INPUT_GET, 'airline_country',FILTER_SANITIZE_STRING);
127
-	$airline_type = filter_input(INPUT_GET, 'airline_type',FILTER_SANITIZE_STRING);
128
-	$airport = filter_input(INPUT_GET, 'airport',FILTER_SANITIZE_STRING);
129
-	$airport_country = filter_input(INPUT_GET, 'airport_country',FILTER_SANITIZE_STRING);
130
-	$callsign = filter_input(INPUT_GET, 'callsign',FILTER_SANITIZE_STRING);
131
-	$owner = filter_input(INPUT_GET, 'owner',FILTER_SANITIZE_STRING);
132
-	$pilot_name = filter_input(INPUT_GET, 'pilot_name',FILTER_SANITIZE_STRING);
133
-	$pilot_id = filter_input(INPUT_GET, 'pilot_id',FILTER_SANITIZE_STRING);
134
-	$mmsi = filter_input(INPUT_GET, 'mmsi',FILTER_SANITIZE_NUMBER_INT);
135
-	$imo = filter_input(INPUT_GET, 'imo',FILTER_SANITIZE_NUMBER_INT);
136
-	$captain_id  = filter_input(INPUT_GET, 'captain_id',FILTER_SANITIZE_NUMBER_INT);
137
-	$race_id  = filter_input(INPUT_GET, 'race_id',FILTER_SANITIZE_NUMBER_INT);
138
-	$captain_name  = filter_input(INPUT_GET, 'captain_name',FILTER_SANITIZE_STRING);
139
-	$race_name  = filter_input(INPUT_GET, 'race_name',FILTER_SANITIZE_STRING);
140
-	$departure_airport_route = filter_input(INPUT_GET, 'departure_airport_route',FILTER_SANITIZE_STRING);
141
-	$arrival_airport_route = filter_input(INPUT_GET, 'arrival_airport_route',FILTER_SANITIZE_STRING);
142
-	$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
143
-	$archive = filter_input(INPUT_GET,'archive',FILTER_SANITIZE_NUMBER_INT);
144
-	$origlat = filter_input(INPUT_GET,'origlat',FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
145
-	$origlon = filter_input(INPUT_GET,'origlon',FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
146
-	$dist = filter_input(INPUT_GET,'dist',FILTER_SANITIZE_NUMBER_INT);
147
-	$number_results = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
119
+    ) {  
120
+	$q = filter_input(INPUT_GET, 'q', FILTER_SANITIZE_STRING);
121
+	$registration = filter_input(INPUT_GET, 'registration', FILTER_SANITIZE_STRING);
122
+	$aircraft = filter_input(INPUT_GET, 'aircraft', FILTER_SANITIZE_STRING);
123
+	$manufacturer = filter_input(INPUT_GET, 'manufacturer', FILTER_SANITIZE_STRING);
124
+	$highlights = filter_input(INPUT_GET, 'highlights', FILTER_SANITIZE_STRING);
125
+	$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
126
+	$airline_country = filter_input(INPUT_GET, 'airline_country', FILTER_SANITIZE_STRING);
127
+	$airline_type = filter_input(INPUT_GET, 'airline_type', FILTER_SANITIZE_STRING);
128
+	$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING);
129
+	$airport_country = filter_input(INPUT_GET, 'airport_country', FILTER_SANITIZE_STRING);
130
+	$callsign = filter_input(INPUT_GET, 'callsign', FILTER_SANITIZE_STRING);
131
+	$owner = filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING);
132
+	$pilot_name = filter_input(INPUT_GET, 'pilot_name', FILTER_SANITIZE_STRING);
133
+	$pilot_id = filter_input(INPUT_GET, 'pilot_id', FILTER_SANITIZE_STRING);
134
+	$mmsi = filter_input(INPUT_GET, 'mmsi', FILTER_SANITIZE_NUMBER_INT);
135
+	$imo = filter_input(INPUT_GET, 'imo', FILTER_SANITIZE_NUMBER_INT);
136
+	$captain_id = filter_input(INPUT_GET, 'captain_id', FILTER_SANITIZE_NUMBER_INT);
137
+	$race_id = filter_input(INPUT_GET, 'race_id', FILTER_SANITIZE_NUMBER_INT);
138
+	$captain_name = filter_input(INPUT_GET, 'captain_name', FILTER_SANITIZE_STRING);
139
+	$race_name = filter_input(INPUT_GET, 'race_name', FILTER_SANITIZE_STRING);
140
+	$departure_airport_route = filter_input(INPUT_GET, 'departure_airport_route', FILTER_SANITIZE_STRING);
141
+	$arrival_airport_route = filter_input(INPUT_GET, 'arrival_airport_route', FILTER_SANITIZE_STRING);
142
+	$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
143
+	$archive = filter_input(INPUT_GET, 'archive', FILTER_SANITIZE_NUMBER_INT);
144
+	$origlat = filter_input(INPUT_GET, 'origlat', FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
145
+	$origlon = filter_input(INPUT_GET, 'origlon', FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
146
+	$dist = filter_input(INPUT_GET, 'dist', FILTER_SANITIZE_NUMBER_INT);
147
+	$number_results = filter_input(INPUT_GET, 'number_results', FILTER_SANITIZE_NUMBER_INT);
148 148
 	if ($dist != '') {
149 149
 		if (isset($globalDistanceUnit) && $globalDistanceUnit == 'mi') $dist = $dist*1.60934;
150 150
 		elseif (isset($globalDistanceUnit) && $globalDistanceUnit == 'nm') $dist = $dist*1.852;
@@ -153,15 +153,15 @@  discard block
 block discarded – undo
153 153
 	if ($archive == 1) {
154 154
 		if ($type == 'aircraft') {
155 155
 			$SpotterArchive = new SpotterArchive();
156
-			$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);
156
+			$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);
157 157
 		}
158 158
 	} else {
159 159
 		if ($type == 'aircraft') {
160
-			$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);
160
+			$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);
161 161
 		} elseif ($type == 'tracker') {
162
-			$spotter_array = $Tracker->searchTrackerData($q,$callsign,$sql_date,$limit_start.",".$absolute_difference,$sort,'',$origlat,$origlon,$dist);
162
+			$spotter_array = $Tracker->searchTrackerData($q, $callsign, $sql_date, $limit_start.",".$absolute_difference, $sort, '', $origlat, $origlon, $dist);
163 163
 		} elseif ($type == 'marine') {
164
-			$spotter_array = $Marine->searchMarineData($q,$callsign,$mmsi,$imo,$sql_date,$limit_start.",".$absolute_difference,$sort,'',$origlat,$origlon,$dist,$captain_id,$captain_name,$race_id,$race_name);
164
+			$spotter_array = $Marine->searchMarineData($q, $callsign, $mmsi, $imo, $sql_date, $limit_start.",".$absolute_difference, $sort, '', $origlat, $origlon, $dist, $captain_id, $captain_name, $race_id, $race_name);
165 165
 		}
166 166
 	}
167 167
 	 
@@ -197,12 +197,12 @@  discard block
 block discarded – undo
197 197
 	//remove 3D=true parameter
198 198
 	$no3D = str_replace("&3D=true", "", $_SERVER['QUERY_STRING']);
199 199
 	$kmlURL = str_replace("http://", "kml://", $globalURL);
200
-	if (!isset($_GET['3D'])){
200
+	if (!isset($_GET['3D'])) {
201 201
 		print '<li><a href="'.$globalURL.'/search?'.$no3D.'" class="active"><i class="fa fa-table"></i> '._("Table").'</a></li>';
202 202
 	} else {
203 203
 		print '<li><span class="notablet"><a href="'.$globalURL.'/search?'.$no3D.'"><i class="fa fa-table"></i> '._("Table").'</a></span></li>';
204 204
 	}
205
-	if (isset($_GET['3D'])){
205
+	if (isset($_GET['3D'])) {
206 206
 		print '<li><a href="'.$globalURL.'/search?'.$no3D.'&3D=true" class="active"><i class="fa fa-globe"></i> '._("3D Map").'</a></li>';
207 207
 	} else {
208 208
 		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>';
@@ -223,36 +223,36 @@  discard block
 block discarded – undo
223 223
 		print '<div class="column">';
224 224
 		print '<div class="info">';
225 225
 		print '<h1>'._("Search Results for").' ';
226
-		if (isset($_GET['q']) && $_GET['q'] != ""){ print _("Keyword:").' <span>'.$q.'</span> '; }
227
-		if (isset($_GET['aircraft']) && $_GET['aircraft'] != ""){ print _("Aircraft:").' <span>'.$aircraft.'</span> '; }
228
-		if (isset($_GET['manufacturer']) && $_GET['manufacturer'] != ""){ print _("Manufacturer:").' <span>'.$manufacturer.'</span> '; }
229
-		if (isset($_GET['registration']) && $_GET['registration'] != ""){ print _("Registration:").' <span>'.$registration.'</span> '; }
230
-		if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true"){ print _("Highlights:").' <span>'.$highlights.'</span> '; }
231
-		if (isset($_GET['airline']) && $_GET['airline'] != ""){ print _("Airline:").' <span>'.$airline.'</span> '; }
232
-		if (isset($_GET['airline_country']) && $_GET['airline_country'] != ""){ print _("Airline country:").' <span>'.$airline_country.'</span> '; }
233
-		if (isset($_GET['airline_type']) && $_GET['airline_type'] != ""){ print _("Airline type:").' <span>'.$airline_type.'</span> '; }
234
-		if (isset($_GET['airport']) && $_GET['airport'] != ""){ print _("Airport:").' <span>'.$airport.'</span> '; }
235
-		if (isset($_GET['airport_country']) && $_GET['airport_country'] != ""){ print _("Airport country:").' <span>'.$airport_country.'</span> '; }
236
-		if (isset($_GET['callsign']) && $_GET['callsign'] != ""){ print _("Callsign:").' <span>'.$callsign.'</span> '; }
237
-		if (isset($_GET['owner']) && $_GET['owner'] != ""){ print _("Owner:").' <span>'.$owner.'</span> '; }
238
-		if (isset($_GET['pilot_id']) && $_GET['pilot_id'] != ""){ print _("Pilot id:").' <span>'.$pilot_id.'</span> '; }
239
-		if (isset($_GET['pilot_name']) && $_GET['pilot_name'] != ""){ print _("Pilot name:").' <span>'.$pilot_name.'</span> '; }
240
-		if (isset($_GET['captain_id']) && $_GET['captain_id'] != ""){ print _("Captain id:").' <span>'.$captain_id.'</span> '; }
241
-		if (isset($_GET['captain_name']) && $_GET['captain_name'] != ""){ print _("Captain name:").' <span>'.$captain_name.'</span> '; }
242
-		if (isset($_GET['race_id']) && $_GET['race_id'] != ""){ print _("Race id:").' <span>'.$race_id.'</span> '; }
243
-		if (isset($_GET['race_name']) && $_GET['race_name'] != ""){ print _("Race name:").' <span>'.$race_name.'</span> '; }
244
-		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> '; }
245
-		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> '; }
246
-		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> '; }
247
-		if (isset($_GET['mmsi']) && $_GET['mmsi'] != ""){ print _("MMSI:").' <span>'.$mmsi.'</span> '; }
248
-		if (isset($_GET['imo']) && $_GET['imo'] != ""){ print _("IMO:").' <span>'.$imo.'</span> '; }
249
-		if (isset($_GET['start_date']) && $_GET['start_date'] != "" && isset($_GET['end_date']) && $_GET['end_date'] == ""){ print _("Date starting at:").' <span>'.$start_date.'</span> '; }
250
-		if (isset($_GET['start_date']) && $_GET['start_date'] == "" && isset($_GET['end_date']) && $_GET['end_date'] != ""){ print _("Date ending at:").' <span>'.$end_date.'</span> '; }
251
-		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> '; }
252
-		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> '; }
253
-		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> '; }
254
-		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> '; }
255
-		if (isset($_GET['number_results']) && $_GET['number_results'] != ""){ print _("limit per page:").' <span>'.$number_results.'</span> '; }
226
+		if (isset($_GET['q']) && $_GET['q'] != "") { print _("Keyword:").' <span>'.$q.'</span> '; }
227
+		if (isset($_GET['aircraft']) && $_GET['aircraft'] != "") { print _("Aircraft:").' <span>'.$aircraft.'</span> '; }
228
+		if (isset($_GET['manufacturer']) && $_GET['manufacturer'] != "") { print _("Manufacturer:").' <span>'.$manufacturer.'</span> '; }
229
+		if (isset($_GET['registration']) && $_GET['registration'] != "") { print _("Registration:").' <span>'.$registration.'</span> '; }
230
+		if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true") { print _("Highlights:").' <span>'.$highlights.'</span> '; }
231
+		if (isset($_GET['airline']) && $_GET['airline'] != "") { print _("Airline:").' <span>'.$airline.'</span> '; }
232
+		if (isset($_GET['airline_country']) && $_GET['airline_country'] != "") { print _("Airline country:").' <span>'.$airline_country.'</span> '; }
233
+		if (isset($_GET['airline_type']) && $_GET['airline_type'] != "") { print _("Airline type:").' <span>'.$airline_type.'</span> '; }
234
+		if (isset($_GET['airport']) && $_GET['airport'] != "") { print _("Airport:").' <span>'.$airport.'</span> '; }
235
+		if (isset($_GET['airport_country']) && $_GET['airport_country'] != "") { print _("Airport country:").' <span>'.$airport_country.'</span> '; }
236
+		if (isset($_GET['callsign']) && $_GET['callsign'] != "") { print _("Callsign:").' <span>'.$callsign.'</span> '; }
237
+		if (isset($_GET['owner']) && $_GET['owner'] != "") { print _("Owner:").' <span>'.$owner.'</span> '; }
238
+		if (isset($_GET['pilot_id']) && $_GET['pilot_id'] != "") { print _("Pilot id:").' <span>'.$pilot_id.'</span> '; }
239
+		if (isset($_GET['pilot_name']) && $_GET['pilot_name'] != "") { print _("Pilot name:").' <span>'.$pilot_name.'</span> '; }
240
+		if (isset($_GET['captain_id']) && $_GET['captain_id'] != "") { print _("Captain id:").' <span>'.$captain_id.'</span> '; }
241
+		if (isset($_GET['captain_name']) && $_GET['captain_name'] != "") { print _("Captain name:").' <span>'.$captain_name.'</span> '; }
242
+		if (isset($_GET['race_id']) && $_GET['race_id'] != "") { print _("Race id:").' <span>'.$race_id.'</span> '; }
243
+		if (isset($_GET['race_name']) && $_GET['race_name'] != "") { print _("Race name:").' <span>'.$race_name.'</span> '; }
244
+		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> '; }
245
+		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> '; }
246
+		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> '; }
247
+		if (isset($_GET['mmsi']) && $_GET['mmsi'] != "") { print _("MMSI:").' <span>'.$mmsi.'</span> '; }
248
+		if (isset($_GET['imo']) && $_GET['imo'] != "") { print _("IMO:").' <span>'.$imo.'</span> '; }
249
+		if (isset($_GET['start_date']) && $_GET['start_date'] != "" && isset($_GET['end_date']) && $_GET['end_date'] == "") { print _("Date starting at:").' <span>'.$start_date.'</span> '; }
250
+		if (isset($_GET['start_date']) && $_GET['start_date'] == "" && isset($_GET['end_date']) && $_GET['end_date'] != "") { print _("Date ending at:").' <span>'.$end_date.'</span> '; }
251
+		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> '; }
252
+		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> '; }
253
+		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> '; }
254
+		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> '; }
255
+		if (isset($_GET['number_results']) && $_GET['number_results'] != "") { print _("limit per page:").' <span>'.$number_results.'</span> '; }
256 256
 		print '</h1>';
257 257
 		print '</div>';
258 258
 
@@ -390,7 +390,7 @@  discard block
 block discarded – undo
390 390
 					    </select>
391 391
 					</div>
392 392
 				</div>
393
-				<script type="text/javascript">getSelect('manufacturer','<?php if(isset($_GET['manufacturer'])) print $manufacturer; ?>')</script>
393
+				<script type="text/javascript">getSelect('manufacturer','<?php if (isset($_GET['manufacturer'])) print $manufacturer; ?>')</script>
394 394
 				<div class="form-group">
395 395
 					<label class="control-label col-sm-2"><?php echo _("Type"); ?></label>
396 396
 						<div class="col-sm-10">
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
 							</select>
400 400
 						</div>
401 401
 				</div>
402
-				<script type="text/javascript">getSelect('aircrafttypes','<?php if(isset($_GET['aircraft_icao'])) print $aircraft_icao; ?>');</script>
402
+				<script type="text/javascript">getSelect('aircrafttypes','<?php if (isset($_GET['aircraft_icao'])) print $aircraft_icao; ?>');</script>
403 403
 				<div class="form-group">
404 404
 					<label class="control-label col-sm-2"><?php echo _("Registration"); ?></label> 
405 405
 					<div class="col-sm-10">
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
 					</div>
423 423
 				</div>
424 424
 <?php
425
-	}else {
425
+	} else {
426 426
 ?>
427 427
 				<div class="form-group">
428 428
 					<label class="control-label col-sm-2"><?php echo _("Owner name"); ?></label> 
@@ -435,8 +435,8 @@  discard block
 block discarded – undo
435 435
 ?>
436 436
 				<div class="form-group">
437 437
 					<div class="col-sm-offset-2 col-sm-10">
438
-					<!--<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>-->
439
-					<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>
438
+					<!--<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>-->
439
+					<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>
440 440
 					</div>
441 441
 				</div>
442 442
 			</fieldset>
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
 						</select>
451 451
 					</div>
452 452
 				</div>
453
-				<script type="text/javascript">getSelect('airlinenames','<?php if(isset($_GET['airline'])) print $airline; ?>');</script>
453
+				<script type="text/javascript">getSelect('airlinenames','<?php if (isset($_GET['airline'])) print $airline; ?>');</script>
454 454
 				<div class="form-group">
455 455
 					<label class="control-label col-sm-2"><?php echo _("Country"); ?></label> 
456 456
 					<div class="col-sm-10">
@@ -459,7 +459,7 @@  discard block
 block discarded – undo
459 459
 						</select>
460 460
 					</div>
461 461
 				</div>
462
-				<script type="text/javascript">getSelect('airlinecountries','<?php if(isset($_GET['airline_country'])) print $airline_country; ?>');</script>
462
+				<script type="text/javascript">getSelect('airlinecountries','<?php if (isset($_GET['airline_country'])) print $airline_country; ?>');</script>
463 463
 				<div class="form-group">
464 464
 					<label class="control-label col-sm-2"><?php echo _("Callsign"); ?></label> 
465 465
 					<div class="col-sm-10">
@@ -468,10 +468,10 @@  discard block
 block discarded – undo
468 468
 				</div>
469 469
 				<div class="form-group">
470 470
 					<div class="col-sm-offset-2 col-sm-10">
471
-						<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>
472
-						<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>
473
-						<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>
474
-						<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>
471
+						<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>
472
+						<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>
473
+						<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>
474
+						<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>
475 475
 					</div>
476 476
 				</div>
477 477
 			</fieldset>
@@ -485,7 +485,7 @@  discard block
 block discarded – undo
485 485
 						</select>
486 486
 					</div>
487 487
 				</div>
488
-				<script type="text/javascript">getSelect('airportnames','<?php if(isset($_GET['airport_icao'])) print $airport_icao; ?>');</script>
488
+				<script type="text/javascript">getSelect('airportnames','<?php if (isset($_GET['airport_icao'])) print $airport_icao; ?>');</script>
489 489
 				<div class="form-group">
490 490
 					<label class="control-label col-sm-2"><?php echo _("Country"); ?></label> 
491 491
 					<div class="col-sm-10">
@@ -494,7 +494,7 @@  discard block
 block discarded – undo
494 494
 						</select>
495 495
 					</div>
496 496
 				</div>
497
-				<script type="text/javascript">getSelect('airportcountries','<?php if(isset($_GET['airport_country'])) print $airport_country; ?>');</script>
497
+				<script type="text/javascript">getSelect('airportcountries','<?php if (isset($_GET['airport_country'])) print $airport_country; ?>');</script>
498 498
 			</fieldset>
499 499
 			<fieldset>
500 500
 				<legend><?php echo _("Route"); ?></legend>
@@ -506,7 +506,7 @@  discard block
 block discarded – undo
506 506
 						</select>
507 507
 					</div>
508 508
 				</div>
509
-				<script type="text/javascript">getSelect('departureairportnames','<?php if(isset($_GET['departure_airport_route'])) print $departure_airport_route; ?>');</script>
509
+				<script type="text/javascript">getSelect('departureairportnames','<?php if (isset($_GET['departure_airport_route'])) print $departure_airport_route; ?>');</script>
510 510
 				<div class="form-group">
511 511
 					<label class="control-label col-sm-2"><?php echo _("Arrival Airport"); ?></label> 
512 512
 					<div class="col-sm-10">
@@ -515,7 +515,7 @@  discard block
 block discarded – undo
515 515
 						</select>
516 516
 					</div>
517 517
 				</div>
518
-				<script type="text/javascript">getSelect('arrivalairportnames','<?php if(isset($_GET['arrival_airport_route'])) print $arrival_airport_route; ?>');</script>
518
+				<script type="text/javascript">getSelect('arrivalairportnames','<?php if (isset($_GET['arrival_airport_route'])) print $arrival_airport_route; ?>');</script>
519 519
 			</fieldset>
520 520
 			<fieldset>
521 521
 				<legend><?php echo _("Altitude"); ?></legend>
@@ -526,9 +526,9 @@  discard block
 block discarded – undo
526 526
 							<option></option>
527 527
 <?php
528 528
 $altitude_array = Array(1000, 5000, 10000, 15000, 20000, 25000, 30000, 35000, 40000, 45000, 50000);
529
-foreach($altitude_array as $altitude)
529
+foreach ($altitude_array as $altitude)
530 530
 {
531
-	if(isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] == $altitude)
531
+	if (isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] == $altitude)
532 532
 	{
533 533
 		print '<option value="'.$altitude.'" selected="selected">'.number_format($altitude).' feet</option>';
534 534
 	} else {
@@ -546,9 +546,9 @@  discard block
 block discarded – undo
546 546
 							<option></option>
547 547
 <?php
548 548
 	$altitude_array = Array(1000, 5000, 10000, 15000, 20000, 25000, 30000, 35000, 40000, 45000, 50000);
549
-	foreach($altitude_array as $altitude)
549
+	foreach ($altitude_array as $altitude)
550 550
 	{
551
-		if(isset($_GET['highest_altitude']) && $_GET['highest_altitude'] == $altitude)
551
+		if (isset($_GET['highest_altitude']) && $_GET['highest_altitude'] == $altitude)
552 552
 		{
553 553
 			print '<option value="'.$altitude.'" selected="selected">'.number_format($altitude).' feet</option>';
554 554
 		} else {
@@ -710,10 +710,10 @@  discard block
 block discarded – undo
710 710
 				<div class="col-sm-10">
711 711
 					<select class="form-control" name="number_results">
712 712
 <?php
713
-$number_results_array = Array(25, 50, 100, 150, 200, 250, 300, 400, 500,  600, 700, 800, 900, 1000);
714
-foreach($number_results_array as $number)
713
+$number_results_array = Array(25, 50, 100, 150, 200, 250, 300, 400, 500, 600, 700, 800, 900, 1000);
714
+foreach ($number_results_array as $number)
715 715
 {
716
-	if(isset($_GET['number_results']) && $_GET['number_results'] == $number)
716
+	if (isset($_GET['number_results']) && $_GET['number_results'] == $number)
717 717
 	{
718 718
 		print '<option value="'.$number.'" selected="selected">'.$number.'</option>';
719 719
 	} else {
@@ -732,7 +732,7 @@  discard block
 block discarded – undo
732 732
 		<fieldset>
733 733
 			<div class="form-group">
734 734
 				<div class="col-sm-offset-2 col-sm-10">
735
-					<label class="checkbox-inline"><input type="checkbox" name="archive" value="1" disabled /><?php echo sprintf(_("Search in archive (older than %s months)"),$globalArchiveKeepMonths); ?></label>
735
+					<label class="checkbox-inline"><input type="checkbox" name="archive" value="1" disabled /><?php echo sprintf(_("Search in archive (older than %s months)"), $globalArchiveKeepMonths); ?></label>
736 736
 					<p class="help-block">Disabled in demo</p>
737 737
 				</div>
738 738
 			</div>
@@ -743,7 +743,7 @@  discard block
 block discarded – undo
743 743
 		<fieldset>
744 744
 			<div class="form-group">
745 745
 				<div class="col-sm-offset-2 col-sm-10">
746
-					<label class="checkbox-inline"><input type="checkbox" name="archive" value="1" /><?php echo sprintf(_("Search in archive (older than %s months)"),$globalArchiveKeepMonths); ?></label>
746
+					<label class="checkbox-inline"><input type="checkbox" name="archive" value="1" /><?php echo sprintf(_("Search in archive (older than %s months)"), $globalArchiveKeepMonths); ?></label>
747 747
 				</div>
748 748
 			</div>
749 749
 		</fieldset>
Please login to merge, or discard this patch.
Braces   +158 added lines, -43 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);
@@ -146,10 +152,15 @@  discard block
 block discarded – undo
146 152
 	$dist = filter_input(INPUT_GET,'dist',FILTER_SANITIZE_NUMBER_INT);
147 153
 	$number_results = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
148 154
 	if ($dist != '') {
149
-		if (isset($globalDistanceUnit) && $globalDistanceUnit == 'mi') $dist = $dist*1.60934;
150
-		elseif (isset($globalDistanceUnit) && $globalDistanceUnit == 'nm') $dist = $dist*1.852;
155
+		if (isset($globalDistanceUnit) && $globalDistanceUnit == 'mi') {
156
+			$dist = $dist*1.60934;
157
+		} elseif (isset($globalDistanceUnit) && $globalDistanceUnit == 'nm') {
158
+			$dist = $dist*1.852;
159
+		}
160
+	}
161
+	if (!isset($sql_date)) {
162
+		$sql_date = '';
151 163
 	}
152
-	if (!isset($sql_date)) $sql_date = '';
153 164
 	if ($archive == 1) {
154 165
 		if ($type == 'aircraft') {
155 166
 			$SpotterArchive = new SpotterArchive();
@@ -227,7 +238,10 @@  discard block
 block discarded – undo
227 238
 		if (isset($_GET['aircraft']) && $_GET['aircraft'] != ""){ print _("Aircraft:").' <span>'.$aircraft.'</span> '; }
228 239
 		if (isset($_GET['manufacturer']) && $_GET['manufacturer'] != ""){ print _("Manufacturer:").' <span>'.$manufacturer.'</span> '; }
229 240
 		if (isset($_GET['registration']) && $_GET['registration'] != ""){ print _("Registration:").' <span>'.$registration.'</span> '; }
230
-		if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true"){ print _("Highlights:").' <span>'.$highlights.'</span> '; }
241
+		if (isset($_GET['highlights'])) {
242
+			if ($_GET['highlights'] == "true"){ print _("Highlights:").' <span>'.$highlights.'</span> ';
243
+		}
244
+		}
231 245
 		if (isset($_GET['airline']) && $_GET['airline'] != ""){ print _("Airline:").' <span>'.$airline.'</span> '; }
232 246
 		if (isset($_GET['airline_country']) && $_GET['airline_country'] != ""){ print _("Airline country:").' <span>'.$airline_country.'</span> '; }
233 247
 		if (isset($_GET['airline_type']) && $_GET['airline_type'] != ""){ print _("Airline type:").' <span>'.$airline_type.'</span> '; }
@@ -371,7 +385,10 @@  discard block
 block discarded – undo
371 385
 			<div class="form-group">
372 386
 				<label class="control-label col-sm-2"><?php echo _("Keywords"); ?></label>
373 387
 				<div class="col-sm-10">
374
-					<input type="text" class="form-control" id="q" name="q" value="<?php if (isset($_GET['q'])) print $q; ?>" size="10" placeholder="<?php echo _("Keywords"); ?>" />
388
+					<input type="text" class="form-control" id="q" name="q" value="<?php if (isset($_GET['q'])) {
389
+	print $q;
390
+}
391
+?>" size="10" placeholder="<?php echo _("Keywords"); ?>" />
375 392
 				</div>
376 393
 			</div>
377 394
 		</fieldset>
@@ -390,7 +407,10 @@  discard block
 block discarded – undo
390 407
 					    </select>
391 408
 					</div>
392 409
 				</div>
393
-				<script type="text/javascript">getSelect('manufacturer','<?php if(isset($_GET['manufacturer'])) print $manufacturer; ?>')</script>
410
+				<script type="text/javascript">getSelect('manufacturer','<?php if(isset($_GET['manufacturer'])) {
411
+	print $manufacturer;
412
+}
413
+?>')</script>
394 414
 				<div class="form-group">
395 415
 					<label class="control-label col-sm-2"><?php echo _("Type"); ?></label>
396 416
 						<div class="col-sm-10">
@@ -399,11 +419,17 @@  discard block
 block discarded – undo
399 419
 							</select>
400 420
 						</div>
401 421
 				</div>
402
-				<script type="text/javascript">getSelect('aircrafttypes','<?php if(isset($_GET['aircraft_icao'])) print $aircraft_icao; ?>');</script>
422
+				<script type="text/javascript">getSelect('aircrafttypes','<?php if(isset($_GET['aircraft_icao'])) {
423
+	print $aircraft_icao;
424
+}
425
+?>');</script>
403 426
 				<div class="form-group">
404 427
 					<label class="control-label col-sm-2"><?php echo _("Registration"); ?></label> 
405 428
 					<div class="col-sm-10">
406
-						<input type="text" class="form-control" name="registration" value="<?php if (isset($_GET['registration'])) print $registration; ?>" size="8" placeholder="<?php echo _("Registration"); ?>" />
429
+						<input type="text" class="form-control" name="registration" value="<?php if (isset($_GET['registration'])) {
430
+	print $registration;
431
+}
432
+?>" size="8" placeholder="<?php echo _("Registration"); ?>" />
407 433
 					</div>
408 434
 				</div>
409 435
 <?php
@@ -412,22 +438,31 @@  discard block
 block discarded – undo
412 438
 				<div class="form-group">
413 439
 					<label class="control-label col-sm-2"><?php echo _("Pilot id"); ?></label> 
414 440
 					<div class="col-sm-10">
415
-						<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"); ?>" />
441
+						<input type="text" class="form-control" name="pilot_id" value="<?php if (isset($_GET['pilot_id'])) {
442
+	print $pilot_id;
443
+}
444
+?>" size="15" placeholder="<?php echo _("Pilot id"); ?>" />
416 445
 					</div>
417 446
 				</div>
418 447
 				<div class="form-group">
419 448
 					<label class="control-label col-sm-2"><?php echo _("Pilot name"); ?></label> 
420 449
 					<div class="col-sm-10">
421
-						<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"); ?>" />
450
+						<input type="text" class="form-control" name="pilot_name" value="<?php if (isset($_GET['pilot_name'])) {
451
+	print $pilot_name;
452
+}
453
+?>" size="15" placeholder="<?php echo _("Pilot name"); ?>" />
422 454
 					</div>
423 455
 				</div>
424 456
 <?php
425
-	}else {
457
+	} else {
426 458
 ?>
427 459
 				<div class="form-group">
428 460
 					<label class="control-label col-sm-2"><?php echo _("Owner name"); ?></label> 
429 461
 					<div class="col-sm-10">
430
-						<input type="text" class="form-control" name="owner" value="<?php if (isset($_GET['owner'])) print $owner; ?>" size="15" placeholder="<?php echo _("Owner name"); ?>" />
462
+						<input type="text" class="form-control" name="owner" value="<?php if (isset($_GET['owner'])) {
463
+	print $owner;
464
+}
465
+?>" size="15" placeholder="<?php echo _("Owner name"); ?>" />
431 466
 					</div>
432 467
 				</div>
433 468
 <?php
@@ -435,8 +470,14 @@  discard block
 block discarded – undo
435 470
 ?>
436 471
 				<div class="form-group">
437 472
 					<div class="col-sm-offset-2 col-sm-10">
438
-					<!--<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>-->
439
-					<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>
473
+					<!--<div><input type="checkbox" class="form-control" name="highlights" value="true" id="highlights" <?php if (isset($_GET['highlights'])) {
474
+	if ($_GET['highlights'] == "true"){ print 'checked="checked"';
475
+}
476
+} ?>> <label for="highlights"><?php echo _("Include only aircraft with special highlights (unique liveries, destinations etc.)"); ?></label></div>-->
477
+					<label class="checkbox-inline"><input type="checkbox" name="highlights" value="true" id="highlights" <?php if (isset($_GET['highlights'])) {
478
+	if ($_GET['highlights'] == "true"){ print 'checked="checked"';
479
+}
480
+} ?>> <?php echo _("Include only aircraft with special highlights (unique liveries, destinations etc.)"); ?></label>
440 481
 					</div>
441 482
 				</div>
442 483
 			</fieldset>
@@ -450,7 +491,10 @@  discard block
 block discarded – undo
450 491
 						</select>
451 492
 					</div>
452 493
 				</div>
453
-				<script type="text/javascript">getSelect('airlinenames','<?php if(isset($_GET['airline'])) print $airline; ?>');</script>
494
+				<script type="text/javascript">getSelect('airlinenames','<?php if(isset($_GET['airline'])) {
495
+	print $airline;
496
+}
497
+?>');</script>
454 498
 				<div class="form-group">
455 499
 					<label class="control-label col-sm-2"><?php echo _("Country"); ?></label> 
456 500
 					<div class="col-sm-10">
@@ -459,19 +503,34 @@  discard block
 block discarded – undo
459 503
 						</select>
460 504
 					</div>
461 505
 				</div>
462
-				<script type="text/javascript">getSelect('airlinecountries','<?php if(isset($_GET['airline_country'])) print $airline_country; ?>');</script>
506
+				<script type="text/javascript">getSelect('airlinecountries','<?php if(isset($_GET['airline_country'])) {
507
+	print $airline_country;
508
+}
509
+?>');</script>
463 510
 				<div class="form-group">
464 511
 					<label class="control-label col-sm-2"><?php echo _("Callsign"); ?></label> 
465 512
 					<div class="col-sm-10">
466
-						<input type="text" name="callsign" class="form-control" value="<?php if (isset($_GET['callsign'])) print $callsign; ?>" size="8" placeholder="<?php echo _("Callsign"); ?>" />
513
+						<input type="text" name="callsign" class="form-control" value="<?php if (isset($_GET['callsign'])) {
514
+	print $callsign;
515
+}
516
+?>" size="8" placeholder="<?php echo _("Callsign"); ?>" />
467 517
 					</div>
468 518
 				</div>
469 519
 				<div class="form-group">
470 520
 					<div class="col-sm-offset-2 col-sm-10">
471 521
 						<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>
472
-						<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>
473
-						<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>
474
-						<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>
522
+						<label class="radio-inline"><input type="radio" name="airline_type" value="passenger" id="airline_type_passenger" <?php if (isset($_GET['airline_type'])) {
523
+	if ($_GET['airline_type'] == "passenger"){ print 'checked="checked"';
524
+}
525
+} ?>> <?php echo _("Only Passenger airlines"); ?></label>
526
+						<label class="radio-inline"><input type="radio" name="airline_type" value="cargo" id="airline_type_cargo" <?php if (isset($_GET['airline_type'])) {
527
+	if ( $_GET['airline_type'] == "cargo"){ print 'checked="checked"';
528
+}
529
+} ?>> <?php echo _("Only Cargo airlines"); ?></label>
530
+						<label class="radio-inline"><input type="radio" name="airline_type" value="military" id="airline_type_military" <?php if (isset($_GET['airline_type'])) {
531
+	if ( $_GET['airline_type'] == "military"){ print 'checked="checked"';
532
+}
533
+} ?>> <?php echo _("Only Military airlines"); ?></label>
475 534
 					</div>
476 535
 				</div>
477 536
 			</fieldset>
@@ -485,7 +544,10 @@  discard block
 block discarded – undo
485 544
 						</select>
486 545
 					</div>
487 546
 				</div>
488
-				<script type="text/javascript">getSelect('airportnames','<?php if(isset($_GET['airport_icao'])) print $airport_icao; ?>');</script>
547
+				<script type="text/javascript">getSelect('airportnames','<?php if(isset($_GET['airport_icao'])) {
548
+	print $airport_icao;
549
+}
550
+?>');</script>
489 551
 				<div class="form-group">
490 552
 					<label class="control-label col-sm-2"><?php echo _("Country"); ?></label> 
491 553
 					<div class="col-sm-10">
@@ -494,7 +556,10 @@  discard block
 block discarded – undo
494 556
 						</select>
495 557
 					</div>
496 558
 				</div>
497
-				<script type="text/javascript">getSelect('airportcountries','<?php if(isset($_GET['airport_country'])) print $airport_country; ?>');</script>
559
+				<script type="text/javascript">getSelect('airportcountries','<?php if(isset($_GET['airport_country'])) {
560
+	print $airport_country;
561
+}
562
+?>');</script>
498 563
 			</fieldset>
499 564
 			<fieldset>
500 565
 				<legend><?php echo _("Route"); ?></legend>
@@ -506,7 +571,10 @@  discard block
 block discarded – undo
506 571
 						</select>
507 572
 					</div>
508 573
 				</div>
509
-				<script type="text/javascript">getSelect('departureairportnames','<?php if(isset($_GET['departure_airport_route'])) print $departure_airport_route; ?>');</script>
574
+				<script type="text/javascript">getSelect('departureairportnames','<?php if(isset($_GET['departure_airport_route'])) {
575
+	print $departure_airport_route;
576
+}
577
+?>');</script>
510 578
 				<div class="form-group">
511 579
 					<label class="control-label col-sm-2"><?php echo _("Arrival Airport"); ?></label> 
512 580
 					<div class="col-sm-10">
@@ -515,7 +583,10 @@  discard block
 block discarded – undo
515 583
 						</select>
516 584
 					</div>
517 585
 				</div>
518
-				<script type="text/javascript">getSelect('arrivalairportnames','<?php if(isset($_GET['arrival_airport_route'])) print $arrival_airport_route; ?>');</script>
586
+				<script type="text/javascript">getSelect('arrivalairportnames','<?php if(isset($_GET['arrival_airport_route'])) {
587
+	print $arrival_airport_route;
588
+}
589
+?>');</script>
519 590
 			</fieldset>
520 591
 			<fieldset>
521 592
 				<legend><?php echo _("Altitude"); ?></legend>
@@ -565,19 +636,33 @@  discard block
 block discarded – undo
565 636
 				<div class="form-group">
566 637
 					<label class="control-label col-sm-2"><?php echo _("Latitude"); ?></label>
567 638
 					<div class="col-sm-10">
568
-						<input type="text" name="origlat" class="form-control" placeholder="<?php echo _("Center point latitude"); ?>" value="<?php if (isset($_GET['origlat'])) print $origlat; ?>" />
639
+						<input type="text" name="origlat" class="form-control" placeholder="<?php echo _("Center point latitude"); ?>" value="<?php if (isset($_GET['origlat'])) {
640
+	print $origlat;
641
+}
642
+?>" />
569 643
 					</div>
570 644
 				</div>
571 645
 				<div class="form-group">
572 646
 					<label class="control-label col-sm-2"><?php echo _("Longitude"); ?></label>
573 647
 					<div class="col-sm-10">
574
-						<input type="text" name="origlon" class="form-control" placeholder="<?php echo _("Center point longitude"); ?>" value="<?php if (isset($_GET['origlon'])) print $origlon; ?>" />
648
+						<input type="text" name="origlon" class="form-control" placeholder="<?php echo _("Center point longitude"); ?>" value="<?php if (isset($_GET['origlon'])) {
649
+	print $origlon;
650
+}
651
+?>" />
575 652
 					</div>
576 653
 				</div>
577 654
 				<div class="form-group">
578
-					<label class="control-label col-sm-2"><?php echo _("Distance").' ('; if (isset($globalDistanceUnit)) print $globalDistanceUnit; else print 'km'; print ')'; ?></label>
655
+					<label class="control-label col-sm-2"><?php echo _("Distance").' ('; if (isset($globalDistanceUnit)) {
656
+	print $globalDistanceUnit;
657
+} else {
658
+	print 'km';
659
+}
660
+print ')'; ?></label>
579 661
 					<div class="col-sm-10">
580
-						<input type="text" name="dist" class="form-control" placeholder="<?php echo _("Distance from center point"); ?>" value="<?php if (isset($_GET['distance'])) print $distance; ?>" />
662
+						<input type="text" name="dist" class="form-control" placeholder="<?php echo _("Distance from center point"); ?>" value="<?php if (isset($_GET['distance'])) {
663
+	print $distance;
664
+}
665
+?>" />
581 666
 					</div>
582 667
 				</div>
583 668
 			</fieldset>
@@ -588,7 +673,10 @@  discard block
 block discarded – undo
588 673
 				<div class="form-group">
589 674
 					<label class="control-label col-sm-2"><?php echo _("Callsign"); ?></label> 
590 675
 					<div class="col-sm-10">
591
-						<input type="text" name="callsign" class="form-control" value="<?php if (isset($_GET['callsign'])) print $callsign; ?>" size="8" placeholder="<?php echo _("Callsign"); ?>" />
676
+						<input type="text" name="callsign" class="form-control" value="<?php if (isset($_GET['callsign'])) {
677
+	print $callsign;
678
+}
679
+?>" size="8" placeholder="<?php echo _("Callsign"); ?>" />
592 680
 					</div>
593 681
 				</div>
594 682
 			</fieldset>
@@ -599,7 +687,10 @@  discard block
 block discarded – undo
599 687
 				<div class="form-group">
600 688
 					<label class="control-label col-sm-2"><?php echo _("Callsign"); ?></label> 
601 689
 					<div class="col-sm-10">
602
-						<input type="text" name="callsign" class="form-control" value="<?php if (isset($_GET['callsign'])) print $callsign; ?>" size="8" placeholder="<?php echo _("Callsign"); ?>" />
690
+						<input type="text" name="callsign" class="form-control" value="<?php if (isset($_GET['callsign'])) {
691
+	print $callsign;
692
+}
693
+?>" size="8" placeholder="<?php echo _("Callsign"); ?>" />
603 694
 					</div>
604 695
 				</div>
605 696
 			</fieldset>
@@ -610,7 +701,10 @@  discard block
 block discarded – undo
610 701
 				<div class="form-group">
611 702
 					<label class="control-label col-sm-2"><?php echo _("Captain id"); ?></label> 
612 703
 					<div class="col-sm-10">
613
-						<input type="text" name="captain_id" class="form-control" value="<?php if (isset($_GET['captain_id'])) print $captain_id; ?>" size="8" placeholder="<?php echo _("Captain id"); ?>" />
704
+						<input type="text" name="captain_id" class="form-control" value="<?php if (isset($_GET['captain_id'])) {
705
+	print $captain_id;
706
+}
707
+?>" size="8" placeholder="<?php echo _("Captain id"); ?>" />
614 708
 					</div>
615 709
 				</div>
616 710
 			</fieldset>
@@ -618,7 +712,10 @@  discard block
 block discarded – undo
618 712
 				<div class="form-group">
619 713
 					<label class="control-label col-sm-2"><?php echo _("Captain name"); ?></label> 
620 714
 					<div class="col-sm-10">
621
-						<input type="text" name="captain_name" class="form-control" value="<?php if (isset($_GET['captain_name'])) print $captain_name; ?>" size="8" placeholder="<?php echo _("Captain name"); ?>" />
715
+						<input type="text" name="captain_name" class="form-control" value="<?php if (isset($_GET['captain_name'])) {
716
+	print $captain_name;
717
+}
718
+?>" size="8" placeholder="<?php echo _("Captain name"); ?>" />
622 719
 					</div>
623 720
 				</div>
624 721
 			</fieldset>
@@ -626,7 +723,10 @@  discard block
 block discarded – undo
626 723
 				<div class="form-group">
627 724
 					<label class="control-label col-sm-2"><?php echo _("Race id"); ?></label> 
628 725
 					<div class="col-sm-10">
629
-						<input type="text" name="race_id" class="form-control" value="<?php if (isset($_GET['race_id'])) print $race_id; ?>" size="8" placeholder="<?php echo _("Race id"); ?>" />
726
+						<input type="text" name="race_id" class="form-control" value="<?php if (isset($_GET['race_id'])) {
727
+	print $race_id;
728
+}
729
+?>" size="8" placeholder="<?php echo _("Race id"); ?>" />
630 730
 					</div>
631 731
 				</div>
632 732
 			</fieldset>
@@ -634,7 +734,10 @@  discard block
 block discarded – undo
634 734
 				<div class="form-group">
635 735
 					<label class="control-label col-sm-2"><?php echo _("Race name"); ?></label> 
636 736
 					<div class="col-sm-10">
637
-						<input type="text" name="race_name" class="form-control" value="<?php if (isset($_GET['race_name'])) print $race_name; ?>" size="8" placeholder="<?php echo _("Race name"); ?>" />
737
+						<input type="text" name="race_name" class="form-control" value="<?php if (isset($_GET['race_name'])) {
738
+	print $race_name;
739
+}
740
+?>" size="8" placeholder="<?php echo _("Race name"); ?>" />
638 741
 					</div>
639 742
 				</div>
640 743
 			</fieldset>
@@ -645,7 +748,10 @@  discard block
 block discarded – undo
645 748
 				<div class="form-group">
646 749
 					<label class="control-label col-sm-2"><?php echo _("MMSI"); ?></label> 
647 750
 					<div class="col-sm-10">
648
-						<input type="text" name="mmsi" class="form-control" value="<?php if (isset($_GET['mmsi'])) print $mmsi; ?>" size="8" placeholder="<?php echo _("MMSI"); ?>" />
751
+						<input type="text" name="mmsi" class="form-control" value="<?php if (isset($_GET['mmsi'])) {
752
+	print $mmsi;
753
+}
754
+?>" size="8" placeholder="<?php echo _("MMSI"); ?>" />
649 755
 					</div>
650 756
 				</div>
651 757
 			</fieldset>
@@ -653,7 +759,10 @@  discard block
 block discarded – undo
653 759
 				<div class="form-group">
654 760
 					<label class="control-label col-sm-2"><?php echo _("IMO"); ?></label> 
655 761
 					<div class="col-sm-10">
656
-						<input type="text" name="imo" class="form-control" value="<?php if (isset($_GET['imo'])) print $imo; ?>" size="8" placeholder="<?php echo _("IMO"); ?>" />
762
+						<input type="text" name="imo" class="form-control" value="<?php if (isset($_GET['imo'])) {
763
+	print $imo;
764
+}
765
+?>" size="8" placeholder="<?php echo _("IMO"); ?>" />
657 766
 					</div>
658 767
 				</div>
659 768
 			</fieldset>
@@ -667,7 +776,10 @@  discard block
 block discarded – undo
667 776
 					<label class="control-label col-sm-2"><?php echo _("Start Date"); ?></label>
668 777
 					<div class="col-sm-10">
669 778
 						<div class='input-group date' id='datetimepicker1'>
670
-							<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"); ?>" />
779
+							<input type='text' name="start_date" class="form-control" value="<?php if (isset($_GET['start_date']) && $_GET['start_date'] != '') {
780
+	print $start_date;
781
+}
782
+?>" placeholder="<?php echo _("Start Date/Time"); ?>" />
671 783
 							<span class="input-group-addon">
672 784
 								<span class="glyphicon glyphicon-calendar"></span>
673 785
 							</span>
@@ -678,7 +790,10 @@  discard block
 block discarded – undo
678 790
 					<label class="control-label col-sm-2"><?php echo _("End Date"); ?></label>
679 791
 					<div class="col-sm-10">
680 792
 						<div class='input-group date' id='datetimepicker2'>
681
-						<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"); ?>" />
793
+						<input type='text' name="end_date" class="form-control" value="<?php if (isset($_GET['end_date']) && $_GET['end_date'] != '') {
794
+	print $end_date;
795
+}
796
+?>" placeholder="<?php echo _("End Date/Time"); ?>" />
682 797
 						<span class="input-group-addon">
683 798
 							<span class="glyphicon glyphicon-calendar"></span>
684 799
 						</span>
Please login to merge, or discard this patch.
require/class.Language.php 1 patch
Spacing   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -24,55 +24,55 @@  discard block
 block discarded – undo
24 24
 }
25 25
 
26 26
 class Language {
27
-	public $all_languages = array('ar_SA' => array('العَرَبِيَّةُ',	'ar',	'arabic'),
28
-				'bg_BG' => array('Български',		'bg',	'bulgarian'),
29
-				'id_ID' => array('Bahasa Indonesia',	'id',	'indonesian'),
30
-				'ms_MY' => array('Bahasa Melayu',	'ms',	'malay'),
31
-				'ca_ES' => array('Català',		'ca',	'catalan'), // ca_CA
32
-				'cs_CZ' => array('Čeština',		'cs',	'czech'),
33
-				'de_DE' => array('Deutsch',		'de',	'german'),
34
-				'da_DK' => array('Dansk',		'da',	'danish')     , // dk_DK
35
-				'et_EE' => array('Eesti',		'et',	'estonian'), // ee_ET
36
-				'en_GB' => array('English',		'en',	'english'),
37
-				'en_US' => array('English (US)',	'en',	'english'),
38
-				'es_AR' => array('Español (Argentina)',	'es',	'spanish'),
39
-				'es_CO' => array('Español (Colombia)',	'es',	'spanish'),
40
-				'es_ES' => array('Español',	'es',	'spanish'),
41
-				'es_419' => array('Español (América Latina)',	'es',	'spanish'),
42
-				'es_MX' => array('Español (Mexico)',	'es',	'spanish'),
43
-				'es_VE' => array('Español (Venezuela)',	'es',	'spanish'),
44
-				'eu_ES' => array('Euskara',		'en',	'basque'),
45
-				'fr_FR' => array('Français',		'fr',	'french'),
46
-				'gl_ES' => array('Galego',		'gl',	'galician'),
47
-				'el_GR' => array('Ελληνικά',		'el',	'greek'), // el_EL
48
-				'he_IL' => array('עברית',		'he',	'hebrew'), // he_HE
49
-				'hr_HR' => array('Hrvatski',		'hr',	'croatian'),
50
-				'hu_HU' => array('Magyar',		'hu',	'hungarian'),
51
-				'it_IT' => array('Italiano',		'it',	'italian'),
52
-				'lv_LV' => array('Latviešu',		'lv',	'latvian'),
53
-				'lt_LT' => array('Lietuvių',		'lt',	'lithuanian'),
54
-				'nl_NL' => array('Nederlands',		'nl',	'dutch'),
55
-				'nb_NO' => array('Norsk (Bokmål)',	'nb',	'norwegian'), // no_NB
56
-				'nn_NO' => array('Norsk (Nynorsk)',	'nn',	'norwegian'), // no_NN
57
-				'fa_IR' => array('فارسی',		'fa',	'persian'),
58
-				'pl_PL' => array('Polski',		'pl',	'polish'),
59
-				'pt_PT' => array('Português',		'pt',	'portuguese'),
60
-				'pt_BR' => array('Português do Brasil',	'pt',	'brazilian portuguese'),
61
-				'ro_RO' => array('Română',		'en',	'romanian'),
62
-				'ru_RU' => array('Pусский',		'ru',	'russian'),
63
-				'sk_SK' => array('Slovenčina',		'sk',	'slovak'),
64
-				'sl_SI' => array('Slovenščina',		'sl',	'slovenian slovene'),
65
-				'sr_RS' => array('Srpski',		'sr',	'serbian'),
66
-				'fi_FI' => array('Suomi',		'fi',	'finish'),
67
-				'sv_SE' => array('Svenska',		'sv',	'swedish'),
68
-				'vi_VN' => array('Tiếng Việt',		'vi',	'vietnamese'),
69
-				'th_TH' => array('ภาษาไทย',		'th',	'thai'),
70
-				'tr_TR' => array('Türkçe',		'tr',	'turkish'),
71
-				'uk_UA' => array('Українська',		'en',	'ukrainian'), // ua_UA
72
-				'ja_JP' => array('日本語',		'ja',	'japanese'),
73
-				'zh_CN' => array('简体中文',		'zh',	'chinese'),
74
-				'zh_TW' => array('繁體中文',		'zh',	'chinese'),
75
-				'ko_KR' => array('한글',		'ko',	'korean')
27
+	public $all_languages = array('ar_SA' => array('العَرَبِيَّةُ', 'ar', 'arabic'),
28
+				'bg_BG' => array('Български', 'bg', 'bulgarian'),
29
+				'id_ID' => array('Bahasa Indonesia', 'id', 'indonesian'),
30
+				'ms_MY' => array('Bahasa Melayu', 'ms', 'malay'),
31
+				'ca_ES' => array('Català', 'ca', 'catalan'), // ca_CA
32
+				'cs_CZ' => array('Čeština', 'cs', 'czech'),
33
+				'de_DE' => array('Deutsch', 'de', 'german'),
34
+				'da_DK' => array('Dansk', 'da', 'danish'), // dk_DK
35
+				'et_EE' => array('Eesti', 'et', 'estonian'), // ee_ET
36
+				'en_GB' => array('English', 'en', 'english'),
37
+				'en_US' => array('English (US)', 'en', 'english'),
38
+				'es_AR' => array('Español (Argentina)', 'es', 'spanish'),
39
+				'es_CO' => array('Español (Colombia)', 'es', 'spanish'),
40
+				'es_ES' => array('Español', 'es', 'spanish'),
41
+				'es_419' => array('Español (América Latina)', 'es', 'spanish'),
42
+				'es_MX' => array('Español (Mexico)', 'es', 'spanish'),
43
+				'es_VE' => array('Español (Venezuela)', 'es', 'spanish'),
44
+				'eu_ES' => array('Euskara', 'en', 'basque'),
45
+				'fr_FR' => array('Français', 'fr', 'french'),
46
+				'gl_ES' => array('Galego', 'gl', 'galician'),
47
+				'el_GR' => array('Ελληνικά', 'el', 'greek'), // el_EL
48
+				'he_IL' => array('עברית', 'he', 'hebrew'), // he_HE
49
+				'hr_HR' => array('Hrvatski', 'hr', 'croatian'),
50
+				'hu_HU' => array('Magyar', 'hu', 'hungarian'),
51
+				'it_IT' => array('Italiano', 'it', 'italian'),
52
+				'lv_LV' => array('Latviešu', 'lv', 'latvian'),
53
+				'lt_LT' => array('Lietuvių', 'lt', 'lithuanian'),
54
+				'nl_NL' => array('Nederlands', 'nl', 'dutch'),
55
+				'nb_NO' => array('Norsk (Bokmål)', 'nb', 'norwegian'), // no_NB
56
+				'nn_NO' => array('Norsk (Nynorsk)', 'nn', 'norwegian'), // no_NN
57
+				'fa_IR' => array('فارسی', 'fa', 'persian'),
58
+				'pl_PL' => array('Polski', 'pl', 'polish'),
59
+				'pt_PT' => array('Português', 'pt', 'portuguese'),
60
+				'pt_BR' => array('Português do Brasil', 'pt', 'brazilian portuguese'),
61
+				'ro_RO' => array('Română', 'en', 'romanian'),
62
+				'ru_RU' => array('Pусский', 'ru', 'russian'),
63
+				'sk_SK' => array('Slovenčina', 'sk', 'slovak'),
64
+				'sl_SI' => array('Slovenščina', 'sl', 'slovenian slovene'),
65
+				'sr_RS' => array('Srpski', 'sr', 'serbian'),
66
+				'fi_FI' => array('Suomi', 'fi', 'finish'),
67
+				'sv_SE' => array('Svenska', 'sv', 'swedish'),
68
+				'vi_VN' => array('Tiếng Việt', 'vi', 'vietnamese'),
69
+				'th_TH' => array('ภาษาไทย', 'th', 'thai'),
70
+				'tr_TR' => array('Türkçe', 'tr', 'turkish'),
71
+				'uk_UA' => array('Українська', 'en', 'ukrainian'), // ua_UA
72
+				'ja_JP' => array('日本語', 'ja', 'japanese'),
73
+				'zh_CN' => array('简体中文', 'zh', 'chinese'),
74
+				'zh_TW' => array('繁體中文', 'zh', 'chinese'),
75
+				'ko_KR' => array('한글', 'ko', 'korean')
76 76
 			);
77 77
 
78 78
 	/**
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 
101 101
 	public function getLocale($locale)
102 102
 	{
103
-		return array($locale,$this->all_languages[$locale][1],$this->all_languages[$locale][2],$locale.'.utf8',$locale.'.UTF8');
103
+		return array($locale, $this->all_languages[$locale][1], $this->all_languages[$locale][2], $locale.'.utf8', $locale.'.UTF8');
104 104
 	}
105 105
 
106 106
 	/**
@@ -114,9 +114,9 @@  discard block
 block discarded – undo
114 114
 		$allAvailableLanguages = array();
115 115
 		$currentLocal = setlocale(LC_ALL, 0);
116 116
 		foreach ($available as $lang) {
117
-			if (isset($this->all_languages[$lang]) && (setlocale(LC_ALL,$this->getLocale($lang)) || $lang = 'en_GB')) $allAvailableLanguages[$lang] = $this->all_languages[$lang];
117
+			if (isset($this->all_languages[$lang]) && (setlocale(LC_ALL, $this->getLocale($lang)) || $lang = 'en_GB')) $allAvailableLanguages[$lang] = $this->all_languages[$lang];
118 118
 		}
119
-		setlocale(LC_ALL,$currentLocal);
119
+		setlocale(LC_ALL, $currentLocal);
120 120
 		return $allAvailableLanguages;
121 121
 	}
122 122
 }
Please login to merge, or discard this patch.