Completed
Push — master ( caebd9...55f541 )
by Yannick
09:39
created
search.php 1 patch
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
 
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
 					    </select>
387 387
 					</div>
388 388
 				</div>
389
-				<script type="text/javascript">getSelect('manufacturer','<?php if(isset($_GET['manufacturer'])) print $manufacturer; ?>')</script>
389
+				<script type="text/javascript">getSelect('manufacturer','<?php if (isset($_GET['manufacturer'])) print $manufacturer; ?>')</script>
390 390
 				<div class="form-group">
391 391
 					<label class="control-label col-sm-2"><?php echo _("Type"); ?></label>
392 392
 						<div class="col-sm-10">
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
 							</select>
396 396
 						</div>
397 397
 				</div>
398
-				<script type="text/javascript">getSelect('aircrafttypes','<?php if(isset($_GET['aircraft_icao'])) print $aircraft_icao; ?>');</script>
398
+				<script type="text/javascript">getSelect('aircrafttypes','<?php if (isset($_GET['aircraft_icao'])) print $aircraft_icao; ?>');</script>
399 399
 				<div class="form-group">
400 400
 					<label class="control-label col-sm-2"><?php echo _("Registration"); ?></label> 
401 401
 					<div class="col-sm-10">
@@ -418,7 +418,7 @@  discard block
 block discarded – undo
418 418
 					</div>
419 419
 				</div>
420 420
 <?php
421
-	}else {
421
+	} else {
422 422
 ?>
423 423
 				<div class="form-group">
424 424
 					<label class="control-label col-sm-2"><?php echo _("Owner name"); ?></label> 
@@ -431,8 +431,8 @@  discard block
 block discarded – undo
431 431
 ?>
432 432
 				<div class="form-group">
433 433
 					<div class="col-sm-offset-2 col-sm-10">
434
-					<!--<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>-->
435
-					<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>
434
+					<!--<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>-->
435
+					<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>
436 436
 					</div>
437 437
 				</div>
438 438
 			</fieldset>
@@ -446,7 +446,7 @@  discard block
 block discarded – undo
446 446
 						</select>
447 447
 					</div>
448 448
 				</div>
449
-				<script type="text/javascript">getSelect('airlinenames','<?php if(isset($_GET['airline'])) print $airline; ?>');</script>
449
+				<script type="text/javascript">getSelect('airlinenames','<?php if (isset($_GET['airline'])) print $airline; ?>');</script>
450 450
 				<div class="form-group">
451 451
 					<label class="control-label col-sm-2"><?php echo _("Country"); ?></label> 
452 452
 					<div class="col-sm-10">
@@ -455,7 +455,7 @@  discard block
 block discarded – undo
455 455
 						</select>
456 456
 					</div>
457 457
 				</div>
458
-				<script type="text/javascript">getSelect('airlinecountries','<?php if(isset($_GET['airline_country'])) print $airline_country; ?>');</script>
458
+				<script type="text/javascript">getSelect('airlinecountries','<?php if (isset($_GET['airline_country'])) print $airline_country; ?>');</script>
459 459
 				<div class="form-group">
460 460
 					<label class="control-label col-sm-2"><?php echo _("Callsign"); ?></label> 
461 461
 					<div class="col-sm-10">
@@ -464,10 +464,10 @@  discard block
 block discarded – undo
464 464
 				</div>
465 465
 				<div class="form-group">
466 466
 					<div class="col-sm-offset-2 col-sm-10">
467
-						<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>
468
-						<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>
469
-						<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>
470
-						<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>
467
+						<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>
468
+						<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>
469
+						<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>
470
+						<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 471
 					</div>
472 472
 				</div>
473 473
 			</fieldset>
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
 						</select>
482 482
 					</div>
483 483
 				</div>
484
-				<script type="text/javascript">getSelect('airportnames','<?php if(isset($_GET['airport_icao'])) print $airport_icao; ?>');</script>
484
+				<script type="text/javascript">getSelect('airportnames','<?php if (isset($_GET['airport_icao'])) print $airport_icao; ?>');</script>
485 485
 				<div class="form-group">
486 486
 					<label class="control-label col-sm-2"><?php echo _("Country"); ?></label> 
487 487
 					<div class="col-sm-10">
@@ -490,7 +490,7 @@  discard block
 block discarded – undo
490 490
 						</select>
491 491
 					</div>
492 492
 				</div>
493
-				<script type="text/javascript">getSelect('airportcountries','<?php if(isset($_GET['airport_country'])) print $airport_country; ?>');</script>
493
+				<script type="text/javascript">getSelect('airportcountries','<?php if (isset($_GET['airport_country'])) print $airport_country; ?>');</script>
494 494
 			</fieldset>
495 495
 			<fieldset>
496 496
 				<legend><?php echo _("Route"); ?></legend>
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
 						</select>
503 503
 					</div>
504 504
 				</div>
505
-				<script type="text/javascript">getSelect('departureairportnames','<?php if(isset($_GET['departure_airport_route'])) print $departure_airport_route; ?>');</script>
505
+				<script type="text/javascript">getSelect('departureairportnames','<?php if (isset($_GET['departure_airport_route'])) print $departure_airport_route; ?>');</script>
506 506
 				<div class="form-group">
507 507
 					<label class="control-label col-sm-2"><?php echo _("Arrival Airport"); ?></label> 
508 508
 					<div class="col-sm-10">
@@ -511,7 +511,7 @@  discard block
 block discarded – undo
511 511
 						</select>
512 512
 					</div>
513 513
 				</div>
514
-				<script type="text/javascript">getSelect('arrivalairportnames','<?php if(isset($_GET['arrival_airport_route'])) print $arrival_airport_route; ?>');</script>
514
+				<script type="text/javascript">getSelect('arrivalairportnames','<?php if (isset($_GET['arrival_airport_route'])) print $arrival_airport_route; ?>');</script>
515 515
 			</fieldset>
516 516
 			<fieldset>
517 517
 				<legend>Altitude</legend>
@@ -522,9 +522,9 @@  discard block
 block discarded – undo
522 522
 							<option></option>
523 523
 <?php
524 524
 $altitude_array = Array(1000, 5000, 10000, 15000, 20000, 25000, 30000, 35000, 40000, 45000, 50000);
525
-foreach($altitude_array as $altitude)
525
+foreach ($altitude_array as $altitude)
526 526
 {
527
-	if(isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] == $altitude)
527
+	if (isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] == $altitude)
528 528
 	{
529 529
 		print '<option value="'.$altitude.'" selected="selected">'.number_format($altitude).' feet</option>';
530 530
 	} else {
@@ -542,9 +542,9 @@  discard block
 block discarded – undo
542 542
 							<option></option>
543 543
 <?php
544 544
 	$altitude_array = Array(1000, 5000, 10000, 15000, 20000, 25000, 30000, 35000, 40000, 45000, 50000);
545
-	foreach($altitude_array as $altitude)
545
+	foreach ($altitude_array as $altitude)
546 546
 	{
547
-		if(isset($_GET['highest_altitude']) && $_GET['highest_altitude'] == $altitude)
547
+		if (isset($_GET['highest_altitude']) && $_GET['highest_altitude'] == $altitude)
548 548
 		{
549 549
 			print '<option value="'.$altitude.'" selected="selected">'.number_format($altitude).' feet</option>';
550 550
 		} else {
@@ -706,10 +706,10 @@  discard block
 block discarded – undo
706 706
 				<div class="col-sm-10">
707 707
 					<select class="form-control" name="number_results">
708 708
 <?php
709
-$number_results_array = Array(25, 50, 100, 150, 200, 250, 300, 400, 500,  600, 700, 800, 900, 1000);
710
-foreach($number_results_array as $number)
709
+$number_results_array = Array(25, 50, 100, 150, 200, 250, 300, 400, 500, 600, 700, 800, 900, 1000);
710
+foreach ($number_results_array as $number)
711 711
 {
712
-	if(isset($_GET['number_results']) && $_GET['number_results'] == $number)
712
+	if (isset($_GET['number_results']) && $_GET['number_results'] == $number)
713 713
 	{
714 714
 		print '<option value="'.$number.'" selected="selected">'.$number.'</option>';
715 715
 	} else {
@@ -728,7 +728,7 @@  discard block
 block discarded – undo
728 728
 		<fieldset>
729 729
 			<div class="form-group">
730 730
 				<div class="col-sm-offset-2 col-sm-10">
731
-					<label class="checkbox-inline"><input type="checkbox" name="archive" value="1" disabled /><?php echo sprintf(_("Search in archive (older than %s months)"),$globalArchiveKeepMonths); ?></label>
731
+					<label class="checkbox-inline"><input type="checkbox" name="archive" value="1" disabled /><?php echo sprintf(_("Search in archive (older than %s months)"), $globalArchiveKeepMonths); ?></label>
732 732
 					<p class="help-block">Disabled in demo</p>
733 733
 				</div>
734 734
 			</div>
@@ -739,7 +739,7 @@  discard block
 block discarded – undo
739 739
 		<fieldset>
740 740
 			<div class="form-group">
741 741
 				<div class="col-sm-offset-2 col-sm-10">
742
-					<label class="checkbox-inline"><input type="checkbox" name="archive" value="1" /><?php echo sprintf(_("Search in archive (older than %s months)"),$globalArchiveKeepMonths); ?></label>
742
+					<label class="checkbox-inline"><input type="checkbox" name="archive" value="1" /><?php echo sprintf(_("Search in archive (older than %s months)"), $globalArchiveKeepMonths); ?></label>
743 743
 				</div>
744 744
 			</div>
745 745
 		</fieldset>
Please login to merge, or discard this patch.
statistics-race.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -6,8 +6,8 @@  discard block
 block discarded – undo
6 6
 $title = _("Statistics").' - '._("Top 10 Races Number of Participants");
7 7
 
8 8
 if (!isset($filter_name)) $filter_name = '';
9
-$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);
10
-$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT);
9
+$year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT);
10
+$month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT);
11 11
 $type = 'marine';
12 12
 require_once('header.php');
13 13
 include('statistics-sub-menu.php');
@@ -18,10 +18,10 @@  discard block
 block discarded – undo
18 18
 	</div>
19 19
 	<p>'._("Below are the <strong>Top 10</strong> races with the most number of participants.").'</p>';
20 20
 	  
21
-$race_array = $Marine->countAllCaptainsByRaces(true,$filter_name,$year,$month);
21
+$race_array = $Marine->countAllCaptainsByRaces(true, $filter_name, $year, $month);
22 22
 print '<div id="chart" class="chart" width="100%"></div><script>';
23 23
 $pilot_data = '';
24
-foreach($race_array as $race_item)
24
+foreach ($race_array as $race_item)
25 25
 {
26 26
 	$race_data .= '["'.$race_item['marine_race_name'].' ('.$race_item['marine_race_id'].')",'.$race_item['marine_captain_count'].'],';
27 27
 }
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 	print '</thead>';
47 47
 	print '<tbody>';
48 48
 	$i = 1;
49
-	foreach($race_array as $race_item)
49
+	foreach ($race_array as $race_item)
50 50
 	{
51 51
 		print '<tr>';
52 52
 		print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
aircraft-data.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -13,14 +13,14 @@  discard block
 block discarded – undo
13 13
 
14 14
 $from_archive = false;
15 15
 if (isset($_GET['ident'])) {
16
-	$ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING);
16
+	$ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING);
17 17
 	if (isset($_GET['currenttime'])) {
18
-		$currenttime = filter_input(INPUT_GET,'currenttime',FILTER_SANITIZE_NUMBER_INT);
18
+		$currenttime = filter_input(INPUT_GET, 'currenttime', FILTER_SANITIZE_NUMBER_INT);
19 19
 		$currenttime = round($currenttime/1000);
20
-		$spotter_array = $SpotterLive->getDateLiveSpotterDataByIdent($ident,$currenttime);
20
+		$spotter_array = $SpotterLive->getDateLiveSpotterDataByIdent($ident, $currenttime);
21 21
 		if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) {
22 22
 			$from_archive = true;
23
-			$spotter_array = $SpotterArchive->getDateArchiveSpotterDataByIdent($ident,$currenttime);
23
+			$spotter_array = $SpotterArchive->getDateArchiveSpotterDataByIdent($ident, $currenttime);
24 24
 		}
25 25
 	} else {
26 26
 		$spotter_array = $SpotterLive->getLastLiveSpotterDataByIdent($ident);
@@ -31,15 +31,15 @@  discard block
 block discarded – undo
31 31
 	}
32 32
 }
33 33
 if (isset($_GET['flightaware_id'])) {
34
-	$flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING);
34
+	$flightaware_id = filter_input(INPUT_GET, 'flightaware_id', FILTER_SANITIZE_STRING);
35 35
 	if (isset($_GET['currenttime'])) {
36
-		$currenttime = filter_input(INPUT_GET,'currenttime',FILTER_SANITIZE_NUMBER_INT);
36
+		$currenttime = filter_input(INPUT_GET, 'currenttime', FILTER_SANITIZE_NUMBER_INT);
37 37
 		$currenttime = round($currenttime/1000);
38
-		$spotter_array = $SpotterLive->getDateLiveSpotterDataById($flightaware_id,$currenttime);
38
+		$spotter_array = $SpotterLive->getDateLiveSpotterDataById($flightaware_id, $currenttime);
39 39
 		if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) {
40 40
 			$from_archive = true;
41 41
 //			$spotter_array = $SpotterArchive->getLastArchiveSpotterDataById($flightaware_id);
42
-			$spotter_array = $SpotterArchive->getDateArchiveSpotterDataById($flightaware_id,$currenttime);
42
+			$spotter_array = $SpotterArchive->getDateArchiveSpotterDataById($flightaware_id, $currenttime);
43 43
 		}
44 44
 	} else {
45 45
 		$spotter_array = $SpotterLive->getLastLiveSpotterDataById($flightaware_id);
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 	if (isset($spotter_item['image_thumbnail']) && $spotter_item['image_thumbnail'] != "")
60 60
 	{
61 61
 		if ($spotter_item['image_source'] == 'flickr' || $spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart') {
62
-			$image = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']);
62
+			$image = preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']);
63 63
 		} else $image = $spotter_item['image_thumbnail'];
64 64
 	}
65 65
 	/* else {
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 		print '<div class="nomobile airports"><div class="airport"><span class="code"><a href="'.$globalURL.'/airport/'.$spotter_item['departure_airport'].'" target="_blank">'.$spotter_item['departure_airport'].'</a></span>'.$spotter_item['departure_airport_city'].' '.$spotter_item['departure_airport_country'];
87 87
 		if (isset($spotter_item['departure_airport_time']) && $spotter_item['departure_airport_time'] != 'NULL') {
88 88
 			if ($spotter_item['departure_airport_time'] > 2460) {
89
-				print '<br /><span class="time">'.date('H:m',$spotter_item['departure_airport_time']).'</span>';
89
+				print '<br /><span class="time">'.date('H:m', $spotter_item['departure_airport_time']).'</span>';
90 90
 			} else {
91 91
 				print '<br /><span class="time">'.$spotter_item['departure_airport_time'].'</span>';
92 92
 			}
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 		print '<span class="code"><a href="'.$globalURL.'/airport/'.$spotter_item['arrival_airport'].'" target="_blank">'.$spotter_item['arrival_airport'].'</a></span>'.$spotter_item['arrival_airport_city'].' '.$spotter_item['arrival_airport_country'];
96 96
 		if (isset($spotter_item['arrival_airport_time']) && $spotter_item['arrival_airport_time'] != 'NULL') {
97 97
 			if ($spotter_item['arrival_airport_time'] > 2460) {
98
-				print '<br /><span class="time">'.date('H:m',$spotter_item['arrival_airport_time']).'</span>';
98
+				print '<br /><span class="time">'.date('H:m', $spotter_item['arrival_airport_time']).'</span>';
99 99
 			} else {
100 100
 				print '<br /><span class="time">'.$spotter_item['arrival_airport_time'].'</span>';
101 101
 			}
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 	print '<span>'._("Aircraft").'</span>';
115 115
 	if (isset($spotter_item['aircraft_wiki'])) print '<a href="'.$spotter_item['aircraft_wiki'].'">'.$spotter_item['aircraft_name'].'</a>';
116 116
 	if (isset($spotter_item['aircraft_type']) && isset($spotter_item['aircraft_manufacturer']) && $spotter_item['aircraft_manufacturer'] != 'N/A' && isset($spotter_item['aircraft_name']) && $spotter_item['aircraft_name'] != 'N/A') {
117
-		$aircraft_names = explode('/',$spotter_item['aircraft_name']);
117
+		$aircraft_names = explode('/', $spotter_item['aircraft_name']);
118 118
 		if (count($aircraft_names) == 1) print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')</a>';
119 119
 		else print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'" title="'.$spotter_item['aircraft_name'].'">'.$spotter_item['aircraft_manufacturer'].' '.$aircraft_names[0].' ('.$spotter_item['aircraft_type'].')</a>';
120 120
 	} elseif (isset($spotter_item['aircraft_type'])) print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_type'].'</a>';
@@ -125,8 +125,8 @@  discard block
 block discarded – undo
125 125
 	print '<div id="altitude"><span>'._("Altitude").'</span>';
126 126
 	if (isset($globalGroundAltitude) && $globalGroundAltitude) {
127 127
 		try {
128
-			$groundAltitude = $Elevation->getElevation($spotter_item['latitude'],$spotter_item['longitude']);
129
-		} catch(Exception $e) {
128
+			$groundAltitude = $Elevation->getElevation($spotter_item['latitude'], $spotter_item['longitude']);
129
+		} catch (Exception $e) {
130 130
 			// If catched not exist
131 131
 		}
132 132
 	}
@@ -157,15 +157,15 @@  discard block
 block discarded – undo
157 157
 	print '</div>';
158 158
 	print '<div id="coordinates"><span>'._("Coordinates").'</span>';
159 159
 	if ((!isset($_COOKIE['unitcoordinate']) && isset($globalUnitCoordinate) && $globalUnitCoordinate == 'dms') || (isset($_COOKIE['unitcoordinate']) && $_COOKIE['unitcoordinate'] == 'dms')) {
160
-		$latitude = $Common->convertDMS($spotter_item['latitude'],'latitude');
160
+		$latitude = $Common->convertDMS($spotter_item['latitude'], 'latitude');
161 161
 		print '<span class="latitude">'.$latitude['deg'].'° '.$latitude['min']."′ ".$latitude['sec'].'" '.$latitude['NSEW'].'</span>, ';
162
-		$longitude = $Common->convertDMS($spotter_item['longitude'],'longitude');
162
+		$longitude = $Common->convertDMS($spotter_item['longitude'], 'longitude');
163 163
 		print '<span class="longitude">'.$longitude['deg'].'° '.$longitude['min']."′ ".$longitude['sec'].'" '.$longitude['NSEW'].'</span>';
164 164
 	} elseif ((!isset($_COOKIE['unitcoordinate']) && isset($globalUnitCoordinate) && $globalUnitCoordinate == 'dm') || (isset($_COOKIE['unitcoordinate']) && $_COOKIE['unitcoordinate'] == 'dm')) {
165
-		$latitude = $Common->convertDM($spotter_item['latitude'],'latitude');
166
-		print '<span class="latitude">'.$latitude['deg'].'° '.round($latitude['min'],3)."′".$latitude['NSEW'].'</span>, ';
167
-		$longitude = $Common->convertDM($spotter_item['longitude'],'longitude');
168
-		print '<span class="longitude">'.$longitude['deg'].'° '.round($longitude['min'],3)."′".$longitude['NSEW'].'</span>';
165
+		$latitude = $Common->convertDM($spotter_item['latitude'], 'latitude');
166
+		print '<span class="latitude">'.$latitude['deg'].'° '.round($latitude['min'], 3)."′".$latitude['NSEW'].'</span>, ';
167
+		$longitude = $Common->convertDM($spotter_item['longitude'], 'longitude');
168
+		print '<span class="longitude">'.$longitude['deg'].'° '.round($longitude['min'], 3)."′".$longitude['NSEW'].'</span>';
169 169
 	} else {
170 170
 		print '<span class="latitude">'.$spotter_item['latitude'].'</span>, ';
171 171
 		print '<span class="longitude">'.$spotter_item['longitude'].'</span>';
@@ -190,9 +190,9 @@  discard block
 block discarded – undo
190 190
 	if (isset($globalCam) && $globalCam) {
191 191
 		require_once(dirname(__FILE__).'/require/class.Common.php');
192 192
 		$Common = new Common();
193
-		$azimuth = round($Common->azimuth($globalCenterLatitude,$globalCenterLongitude,$spotter_item['latitude'],$spotter_item['longitude']));
194
-		$distance = $Common->distance($globalCenterLatitude,$globalCenterLongitude,$spotter_item['latitude'],$spotter_item['longitude'],'m');
195
-		$plunge = round($Common->plunge($globalCenterAltitude,$spotter_item['real_altitude'],$distance));
193
+		$azimuth = round($Common->azimuth($globalCenterLatitude, $globalCenterLongitude, $spotter_item['latitude'], $spotter_item['longitude']));
194
+		$distance = $Common->distance($globalCenterLatitude, $globalCenterLongitude, $spotter_item['latitude'], $spotter_item['longitude'], 'm');
195
+		$plunge = round($Common->plunge($globalCenterAltitude, $spotter_item['real_altitude'], $distance));
196 196
 		print '<div id="camcoordinates"><span>'._("Cam Coordinates").'</span>';
197 197
 		print 'azimuth: '.$azimuth;
198 198
 		print ' / ';
@@ -202,16 +202,16 @@  discard block
 block discarded – undo
202 202
 		print '</div>';
203 203
 		//echo $Common->getData('http://127.0.0.1/camera.php?azimuth='.$azimuth.'&plunge='.$plunge,'get','','','','','','',false,true);
204 204
 		//echo $Common->getData('file://'.dirname(__FILE__).'/camera.php?azimuth='.$azimuth.'&plunge='.$plunge,'get','','','','','','',false,true);
205
-		echo $Common->getData('http://'.$_SERVER['SERVER_NAME'].'/camera.php?azimuth='.$azimuth.'&plunge='.$plunge,'get','','','','','','',false,true);
205
+		echo $Common->getData('http://'.$_SERVER['SERVER_NAME'].'/camera.php?azimuth='.$azimuth.'&plunge='.$plunge, 'get', '', '', '', '', '', '', false, true);
206 206
 	}
207 207
   
208 208
 	print '<div id="heading"><span>'._("Heading").'</span><span class="heading">'.$spotter_item['heading'].'</span>°</div>';
209 209
 	if (isset($spotter_item['verticalrate']) && $spotter_item['verticalrate'] != '') {
210 210
 		print '<div id="verticalrate"><span>'._("Vertical rate").'</span>';
211 211
 		if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) {
212
-			print $spotter_item['verticalrate']. ' ft/min';
212
+			print $spotter_item['verticalrate'].' ft/min';
213 213
 		} else {
214
-			print round($spotter_item['verticalrate']*0.3048). ' m/min';
214
+			print round($spotter_item['verticalrate']*0.3048).' m/min';
215 215
 		}
216 216
 		print '</div>';
217 217
 	}
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 	print '</div>';
247 247
 	if (isset($globalVA) && $globalVA && isset($globalphpVMS) && $globalphpVMS && isset($globalVATSIM) && $globalVATSIM && isset($globalIVAO) && $globalIVAO && isset($spotter_item['format_source']) && $spotter_item['format_source'] != '' && $spotter_item['format_source'] != 'pireps') print '<div class="waypoints"><span>'._("Source").'</span>'.$spotter_item['format_source'].'</div>';
248 248
 	if (isset($spotter_item['waypoints']) && $spotter_item['waypoints'] != '') print '<div class="waypoints"><span>'._("Route").'</span>'.$spotter_item['waypoints'].'</div>';
249
-	if (isset($spotter_item['acars']['message'])) print '<div class="acars"><span>'._("Latest ACARS message").'</span>'.trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'<br/>',$spotter_item['acars']['message'])).'</div>';
249
+	if (isset($spotter_item['acars']['message'])) print '<div class="acars"><span>'._("Latest ACARS message").'</span>'.trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '<br/>', $spotter_item['acars']['message'])).'</div>';
250 250
 	if (isset($spotter_item['squawk']) && $spotter_item['squawk'] != '' && $spotter_item['squawk'] != 0) print '<div class="bottom">'._("Squawk:").' '.$spotter_item['squawk'].' - '.$spotter_item['squawk_usage'].'</div>';
251 251
 	print '</div>';
252 252
 }
Please login to merge, or discard this patch.
marine-data.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -11,15 +11,15 @@  discard block
 block discarded – undo
11 11
 
12 12
 $from_archive = false;
13 13
 if (isset($_GET['ident'])) {
14
-	$ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING);
14
+	$ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING);
15 15
 	if (isset($_GET['currenttime'])) {
16
-		$currenttime = filter_input(INPUT_GET,'currenttime',FILTER_SANITIZE_NUMBER_INT);
16
+		$currenttime = filter_input(INPUT_GET, 'currenttime', FILTER_SANITIZE_NUMBER_INT);
17 17
 		$currenttime = round($currenttime/1000);
18
-		$spotter_array = $MarineLive->getDateLiveMarineDataByIdent($ident,$currenttime);
18
+		$spotter_array = $MarineLive->getDateLiveMarineDataByIdent($ident, $currenttime);
19 19
 		
20 20
 		if (empty($spotter_array)) {
21 21
 			$from_archive = true;
22
-			$spotter_array = $MarineArchive->getDateArchiveMarineDataByIdent($ident,$currenttime);
22
+			$spotter_array = $MarineArchive->getDateArchiveMarineDataByIdent($ident, $currenttime);
23 23
 		}
24 24
 		
25 25
 	} else {
@@ -33,16 +33,16 @@  discard block
 block discarded – undo
33 33
 	}
34 34
 }
35 35
 if (isset($_GET['fammarine_id'])) {
36
-	$fammarine_id = filter_input(INPUT_GET,'fammarine_id',FILTER_SANITIZE_STRING);
36
+	$fammarine_id = filter_input(INPUT_GET, 'fammarine_id', FILTER_SANITIZE_STRING);
37 37
 	if (isset($_GET['currenttime'])) {
38
-		$currenttime = filter_input(INPUT_GET,'currenttime',FILTER_SANITIZE_NUMBER_INT);
38
+		$currenttime = filter_input(INPUT_GET, 'currenttime', FILTER_SANITIZE_NUMBER_INT);
39 39
 		$currenttime = round($currenttime/1000);
40
-		$spotter_array = $MarineLive->getDateLiveMarineDataById($fammarine_id,$currenttime);
40
+		$spotter_array = $MarineLive->getDateLiveMarineDataById($fammarine_id, $currenttime);
41 41
 		
42 42
 		if (empty($spotter_array)) {
43 43
 			$from_archive = true;
44 44
 //			$spotter_array = $SpotterArchive->getLastArchiveSpotterDataById($flightaware_id);
45
-			$spotter_array = $MarineArchive->getDateArchiveMarineDataById($fammarine_id,$currenttime);
45
+			$spotter_array = $MarineArchive->getDateArchiveMarineDataById($fammarine_id, $currenttime);
46 46
 		}
47 47
 		
48 48
 	} else {
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 if (isset($spotter_item['image_thumbnail']) && $spotter_item['image_thumbnail'] != "")
65 65
 {
66 66
 	if ($spotter_item['image_source'] == 'flickr' || $spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart') {
67
-		$image = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']);
67
+		$image = preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']);
68 68
 	} else $image = $spotter_item['image_thumbnail'];
69 69
 
70 70
 }
@@ -94,24 +94,24 @@  discard block
 block discarded – undo
94 94
 */
95 95
 print '<div><span>'._("Speed").'</span>';
96 96
 if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'mph') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'mph')) {
97
-	print round($spotter_item['ground_speed']*0.621371,2).' mph';
97
+	print round($spotter_item['ground_speed']*0.621371, 2).' mph';
98 98
 } elseif ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'knots') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'knots')) {
99
-	print round($spotter_item['ground_speed']*0.539957,2).' knots';
99
+	print round($spotter_item['ground_speed']*0.539957, 2).' knots';
100 100
 } else {
101 101
 	print $spotter_item['ground_speed'].' km/h';
102 102
 }
103 103
 print '</div>';
104 104
 print '<div><span>'._("Coordinates").'</span>';
105 105
 if ((!isset($_COOKIE['unitcoordinate']) && isset($globalUnitCoordinate) && $globalUnitCoordinate == 'dms') || (isset($_COOKIE['unitcoordinate']) && $_COOKIE['unitcoordinate'] == 'dms')) {
106
-	$latitude = $Common->convertDMS($spotter_item['latitude'],'latitude');
106
+	$latitude = $Common->convertDMS($spotter_item['latitude'], 'latitude');
107 107
 	print '<span class="latitude">'.$latitude['deg'].'° '.$latitude['min']."′ ".$latitude['sec'].'" '.$latitude['NSEW'].'</span>, ';
108
-	$longitude = $Common->convertDMS($spotter_item['longitude'],'longitude');
108
+	$longitude = $Common->convertDMS($spotter_item['longitude'], 'longitude');
109 109
 	print '<span class="longitude">'.$longitude['deg'].'° '.$longitude['min']."′ ".$longitude['sec'].'" '.$longitude['NSEW'].'</span>';
110 110
 } elseif ((!isset($_COOKIE['unitcoordinate']) && isset($globalUnitCoordinate) && $globalUnitCoordinate == 'dm') || (isset($_COOKIE['unitcoordinate']) && $_COOKIE['unitcoordinate'] == 'dm')) {
111
-	$latitude = $Common->convertDM($spotter_item['latitude'],'latitude');
112
-	print '<span class="latitude">'.$latitude['deg'].'° '.round($latitude['min'],3)."′ ".$latitude['NSEW'].'</span>, ';
113
-	$longitude = $Common->convertDM($spotter_item['longitude'],'longitude');
114
-	print '<span class="longitude">'.$longitude['deg'].'° '.round($longitude['min'],3)."′ ".$longitude['NSEW'].'</span>';
111
+	$latitude = $Common->convertDM($spotter_item['latitude'], 'latitude');
112
+	print '<span class="latitude">'.$latitude['deg'].'° '.round($latitude['min'], 3)."′ ".$latitude['NSEW'].'</span>, ';
113
+	$longitude = $Common->convertDM($spotter_item['longitude'], 'longitude');
114
+	print '<span class="longitude">'.$longitude['deg'].'° '.round($longitude['min'], 3)."′ ".$longitude['NSEW'].'</span>';
115 115
 } else {
116 116
 	print '<span class="latitude">'.$spotter_item['latitude'].'</span>, ';
117 117
 	print '<span class="longitude">'.$spotter_item['longitude'].'</span>';
Please login to merge, or discard this patch.
tracker-data.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -13,14 +13,14 @@  discard block
 block discarded – undo
13 13
 
14 14
 $from_archive = false;
15 15
 if (isset($_GET['ident'])) {
16
-	$ident = urldecode(filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING));
16
+	$ident = urldecode(filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING));
17 17
 	if (isset($_GET['currenttime'])) {
18
-		$currenttime = filter_input(INPUT_GET,'currenttime',FILTER_SANITIZE_NUMBER_INT);
18
+		$currenttime = filter_input(INPUT_GET, 'currenttime', FILTER_SANITIZE_NUMBER_INT);
19 19
 		$currenttime = round($currenttime/1000);
20
-		$spotter_array = $TrackerLive->getDateLiveTrackerDataByIdent($ident,$currenttime);
20
+		$spotter_array = $TrackerLive->getDateLiveTrackerDataByIdent($ident, $currenttime);
21 21
 		if (empty($spotter_array)) {
22 22
 			$from_archive = true;
23
-			$spotter_array = $TrackerArchive->getDateArchiveTrackerDataByIdent($ident,$currenttime);
23
+			$spotter_array = $TrackerArchive->getDateArchiveTrackerDataByIdent($ident, $currenttime);
24 24
 		}
25 25
 		
26 26
 	} else {
@@ -32,16 +32,16 @@  discard block
 block discarded – undo
32 32
 	}
33 33
 }
34 34
 if (isset($_GET['famtrackid'])) {
35
-	$famtrackid = urldecode(filter_input(INPUT_GET,'famtrackid',FILTER_SANITIZE_STRING));
35
+	$famtrackid = urldecode(filter_input(INPUT_GET, 'famtrackid', FILTER_SANITIZE_STRING));
36 36
 	if (isset($_GET['currenttime'])) {
37
-		$currenttime = filter_input(INPUT_GET,'currenttime',FILTER_SANITIZE_NUMBER_INT);
37
+		$currenttime = filter_input(INPUT_GET, 'currenttime', FILTER_SANITIZE_NUMBER_INT);
38 38
 		$currenttime = round($currenttime/1000);
39
-		$spotter_array = $TrackerLive->getDateLiveTrackerDataById($famtrackid,$currenttime);
39
+		$spotter_array = $TrackerLive->getDateLiveTrackerDataById($famtrackid, $currenttime);
40 40
 		
41 41
 		if (empty($spotter_array)) {
42 42
 			$from_archive = true;
43 43
 //			$spotter_array = $SpotterArchive->getLastArchiveSpotterDataById($flightaware_id);
44
-			$spotter_array = $TrackerArchive->getDateArchiveTrackerDataById($famtrackid,$currenttime);
44
+			$spotter_array = $TrackerArchive->getDateArchiveTrackerDataById($famtrackid, $currenttime);
45 45
 		}
46 46
 		
47 47
 	} else {
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 if (isset($spotter_item['image_thumbnail']) && $spotter_item['image_thumbnail'] != "")
62 62
 {
63 63
 	if ($spotter_item['image_source'] == 'flickr' || $spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart') {
64
-		$image = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']);
64
+		$image = preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']);
65 65
 	} else $image = $spotter_item['image_thumbnail'];
66 66
 
67 67
 }
@@ -81,8 +81,8 @@  discard block
 block discarded – undo
81 81
 print '<div><span>'._("Altitude").'</span>';
82 82
 if (isset($globalGroundAltitude) && $globalGroundAltitude) {
83 83
     try {
84
-	$groundAltitude = $Elevation->getElevation($spotter_item['latitude'],$spotter_item['longitude']);
85
-    } catch(Exception $e) {
84
+	$groundAltitude = $Elevation->getElevation($spotter_item['latitude'], $spotter_item['longitude']);
85
+    } catch (Exception $e) {
86 86
     }
87 87
 }
88 88
 print '<span class="altitude">';
@@ -117,15 +117,15 @@  discard block
 block discarded – undo
117 117
 print '</div>';
118 118
 print '<div><span>'._("Coordinates").'</span>';
119 119
 if ((!isset($_COOKIE['unitcoordinate']) && isset($globalUnitCoordinate) && $globalUnitCoordinate == 'dms') || (isset($_COOKIE['unitcoordinate']) && $_COOKIE['unitcoordinate'] == 'dms')) {
120
-	$latitude = $Common->convertDMS($spotter_item['latitude'],'latitude');
120
+	$latitude = $Common->convertDMS($spotter_item['latitude'], 'latitude');
121 121
 	print '<span class="latitude">'.$latitude['deg'].'° '.$latitude['min']."′ ".$latitude['sec'].'" '.$latitude['NSEW'].'</span>, ';
122
-	$longitude = $Common->convertDMS($spotter_item['longitude'],'longitude');
122
+	$longitude = $Common->convertDMS($spotter_item['longitude'], 'longitude');
123 123
 	print '<span class="longitude">'.$longitude['deg'].'° '.$longitude['min']."′ ".$longitude['sec'].'" '.$longitude['NSEW'].'</span>';
124 124
 } elseif ((!isset($_COOKIE['unitcoordinate']) && isset($globalUnitCoordinate) && $globalUnitCoordinate == 'dm') || (isset($_COOKIE['unitcoordinate']) && $_COOKIE['unitcoordinate'] == 'dm')) {
125
-	$latitude = $Common->convertDM($spotter_item['latitude'],'latitude');
126
-	print '<span class="latitude">'.$latitude['deg'].'° '.round($latitude['min'],3)."′ ".$latitude['NSEW'].'</span>, ';
127
-	$longitude = $Common->convertDM($spotter_item['longitude'],'longitude');
128
-	print '<span class="longitude">'.$longitude['deg'].'° '.round($longitude['min'],3)."′ ".$longitude['NSEW'].'</span>';
125
+	$latitude = $Common->convertDM($spotter_item['latitude'], 'latitude');
126
+	print '<span class="latitude">'.$latitude['deg'].'° '.round($latitude['min'], 3)."′ ".$latitude['NSEW'].'</span>, ';
127
+	$longitude = $Common->convertDM($spotter_item['longitude'], 'longitude');
128
+	print '<span class="longitude">'.$longitude['deg'].'° '.round($longitude['min'], 3)."′ ".$longitude['NSEW'].'</span>';
129 129
 } else {
130 130
 	print '<span class="latitude">'.$spotter_item['latitude'].'</span>, ';
131 131
 	print '<span class="longitude">'.$spotter_item['longitude'].'</span>';
Please login to merge, or discard this patch.
location-geojson.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -11,47 +11,47 @@  discard block
 block discarded – undo
11 11
 $spotter_array = array();
12 12
 if (isset($_GET['coord'])) 
13 13
 {
14
-	$coords = explode(',',$_GET['coord']);
14
+	$coords = explode(',', $_GET['coord']);
15 15
 	if ((isset($_COOKIE['show_GroundStation']) && $_COOKIE['show_GroundStation'] == 'true') 
16 16
 	    || (!isset($_COOKIE['show_GroundStation']) && (isset($globalMapGroundStation) && $globalMapGroundStation === TRUE))) {
17 17
 		//$spotter_array = $Source->getAllLocationInfo();
18
-		$spotter_array = array_merge($spotter_array,$Source->getLocationInfoByType('gs',$coords));
18
+		$spotter_array = array_merge($spotter_array, $Source->getLocationInfoByType('gs', $coords));
19 19
 	}
20 20
 	if ((isset($_COOKIE['show_WeatherStation']) && $_COOKIE['show_WeatherStation'] == 'true') 
21 21
 	    || (!isset($_COOKIE['show_WeatherStation']) && (isset($globalMapWeatherStation) && $globalMapWeatherStation === TRUE))) {
22
-		$spotter_array = array_merge($spotter_array,$Source->getLocationInfoByType('wx',$coords));
22
+		$spotter_array = array_merge($spotter_array, $Source->getLocationInfoByType('wx', $coords));
23 23
 	}
24 24
 	if ((isset($_COOKIE['show_Lightning']) && $_COOKIE['show_Lightning'] == 'true') 
25 25
 	    || (!isset($_COOKIE['show_Lightning']) && (isset($globalMapLightning) && $globalMapLightning === TRUE))) {
26
-		$spotter_array = array_merge($spotter_array,$Source->getLocationInfoByType('lightning',$coords));
26
+		$spotter_array = array_merge($spotter_array, $Source->getLocationInfoByType('lightning', $coords));
27 27
 	}
28 28
 	if ((isset($_COOKIE['show_Fires']) && $_COOKIE['show_Fires'] == 'true') 
29 29
 	    || (!isset($_COOKIE['show_Fires']) && (isset($globalMapFires) && $globalMapFires === TRUE))) {
30
-		$spotter_array = array_merge($spotter_array,$Source->getLocationInfoByType('fires',$coords,true));
30
+		$spotter_array = array_merge($spotter_array, $Source->getLocationInfoByType('fires', $coords, true));
31 31
 	}
32 32
 	if (!isset($globalDemo)) {
33
-		$spotter_array = array_merge($spotter_array,$Source->getLocationInfoByType(''));
33
+		$spotter_array = array_merge($spotter_array, $Source->getLocationInfoByType(''));
34 34
 	}
35 35
 } else {
36 36
 	if ((isset($_COOKIE['show_GroundStation']) && $_COOKIE['show_GroundStation'] == 'true') 
37 37
 	    || (!isset($_COOKIE['show_GroundStation']) && (isset($globalMapGroundStation) && $globalMapGroundStation === TRUE))) {
38 38
 		//$spotter_array = $Source->getAllLocationInfo();
39
-		$spotter_array = array_merge($spotter_array,$Source->getLocationInfoByType('gs'));
39
+		$spotter_array = array_merge($spotter_array, $Source->getLocationInfoByType('gs'));
40 40
 	}
41 41
 	if ((isset($_COOKIE['show_WeatherStation']) && $_COOKIE['show_WeatherStation'] == 'true') 
42 42
 	    || (!isset($_COOKIE['show_WeatherStation']) && (isset($globalMapWeatherStation) && $globalMapWeatherStation === TRUE))) {
43
-		$spotter_array = array_merge($spotter_array,$Source->getLocationInfoByType('wx'));
43
+		$spotter_array = array_merge($spotter_array, $Source->getLocationInfoByType('wx'));
44 44
 	}
45 45
 	if ((isset($_COOKIE['show_Lightning']) && $_COOKIE['show_Lightning'] == 'true') 
46 46
 	    || (!isset($_COOKIE['show_Lightning']) && (isset($globalMapLightning) && $globalMapLightning === TRUE))) {
47
-		$spotter_array = array_merge($spotter_array,$Source->getLocationInfoByType('lightning'));
47
+		$spotter_array = array_merge($spotter_array, $Source->getLocationInfoByType('lightning'));
48 48
 	}
49 49
 	if ((isset($_COOKIE['show_Fire']) && $_COOKIE['show_Fire'] == 'true') 
50 50
 	    || (!isset($_COOKIE['show_Fire']) && (isset($globalMapFires) && $globalMapFires === TRUE))) {
51
-		$spotter_array = array_merge($spotter_array,$Source->getLocationInfoByType('fires',array(),true));
51
+		$spotter_array = array_merge($spotter_array, $Source->getLocationInfoByType('fires', array(), true));
52 52
 	}
53 53
 	if (!isset($globalDemo)) {
54
-		$spotter_array = array_merge($spotter_array,$Source->getLocationInfoByType(''));
54
+		$spotter_array = array_merge($spotter_array, $Source->getLocationInfoByType(''));
55 55
 	}
56 56
 }
57 57
 
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 $output = '{"type": "FeatureCollection","features": [';
60 60
 if (!empty($spotter_array) && count($spotter_array) > 0)
61 61
 {
62
-	foreach($spotter_array as $spotter_item)
62
+	foreach ($spotter_array as $spotter_item)
63 63
 	{
64 64
 		date_default_timezone_set('UTC');
65 65
 		$output .= '{"type": "Feature",';
@@ -78,8 +78,8 @@  discard block
 block discarded – undo
78 78
 		$output .= '"icon": "'.$globalURL.'/images/'.$spotter_item['logo'].'",';
79 79
 		$output .= '"type": "'.$spotter_item['type'].'",';
80 80
 		if ($spotter_item['type'] == 'wx') {
81
-			$weather = json_decode($spotter_item['description'],true);
82
-			if (isset($weather['temp'])) $output.= '"temp": "'.$weather['temp'].'",';
81
+			$weather = json_decode($spotter_item['description'], true);
82
+			if (isset($weather['temp'])) $output .= '"temp": "'.$weather['temp'].'",';
83 83
 		}
84 84
 		$output .= '"image_thumb": "'.$spotter_item['image_thumb'].'"';
85 85
 		$output .= '},';
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 		$output .= '}';
90 90
 		$output .= '},';
91 91
 	}
92
-	$output  = substr($output, 0, -1);
92
+	$output = substr($output, 0, -1);
93 93
 }
94 94
 $output .= ']}';
95 95
 print $output;
Please login to merge, or discard this patch.
space-data.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 <button type="button" class="close">&times;</button>
10 10
 <?php
11 11
 
12
-$sat = filter_input(INPUT_GET,'sat',FILTER_SANITIZE_STRING);
12
+$sat = filter_input(INPUT_GET, 'sat', FILTER_SANITIZE_STRING);
13 13
 $sat = urldecode($sat);
14 14
 //$info = $Satellite->get_info(str_replace(' ','-',$sat));
15 15
 //print_r($info);
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 	$aircraft_name = 'INTEGRAL';
49 49
 //	$ground_speed = 14970;
50 50
 	$launch_date = '17 October 2002';
51
-} elseif (strpos($sat,'IRIDIUM') !== false) {
51
+} elseif (strpos($sat, 'IRIDIUM') !== false) {
52 52
 	$image = 'https://upload.wikimedia.org/wikipedia/commons/b/b6/Iridium_Satellite.jpg';
53 53
 	$image_copyright = 'Cliff';
54 54
 	$ident = 'Iridium satellite constellation';
@@ -56,23 +56,23 @@  discard block
 block discarded – undo
56 56
 	$aircraft_name = $sat;
57 57
 //	$ground_speed = 14970;
58 58
 //	$launch_date = '29 september 2011';
59
-} elseif (strpos($sat,'ORBCOMM') !== false) {
59
+} elseif (strpos($sat, 'ORBCOMM') !== false) {
60 60
 	$ident = 'Orbcomm';
61 61
 	$aircraft_wiki = 'https://en.wikipedia.org/wiki/Orbcomm_(satellite)';
62 62
 	$aircraft_name = $sat;
63
-} elseif (strpos($sat,'GLOBALSTAR') !== false) {
63
+} elseif (strpos($sat, 'GLOBALSTAR') !== false) {
64 64
 	$ident = 'Globalstar';
65 65
 	$aircraft_wiki = 'https://en.wikipedia.org/wiki/Globalstar';
66 66
 	$aircraft_name = $sat;
67
-	$satname = str_replace(array('[+]','[-]'),'',$sat);
68
-} elseif (strpos($sat,'OSCAR 7') !== false) {
67
+	$satname = str_replace(array('[+]', '[-]'), '', $sat);
68
+} elseif (strpos($sat, 'OSCAR 7') !== false) {
69 69
 	$image = 'https://upload.wikimedia.org/wikipedia/en/a/ad/AMSAT-OSCAR_7.jpg';
70 70
 	$image_copyright = 'Amsat.org';
71 71
 	$ident = 'AMSAT-OSCAR 7';
72 72
 	$aircraft_wiki = 'https://en.wikipedia.org/wiki/AMSAT-OSCAR_7';
73 73
 	$aircraft_name = $sat;
74 74
 	$launch_date = '15 November 1974';
75
-} elseif (strpos($sat,'santaclaus') !== false) {
75
+} elseif (strpos($sat, 'santaclaus') !== false) {
76 76
 	$image = 'https://upload.wikimedia.org/wikipedia/commons/4/49/Jonathan_G_Meath_portrays_Santa_Claus.jpg';
77 77
 	$image_copyright = 'Jonathan G Meath';
78 78
 	$ident = 'Santa Claus';
@@ -81,8 +81,8 @@  discard block
 block discarded – undo
81 81
 //	$launch_date = '15 November 1974';
82 82
 } else {
83 83
 	$ident = $sat;
84
-	if (strpos($sat,'(')) $satname = $sat;
85
-	else $satname = str_replace(array(' '),'-',$sat);
84
+	if (strpos($sat, '(')) $satname = $sat;
85
+	else $satname = str_replace(array(' '), '-', $sat);
86 86
 }
87 87
 if (!isset($satname)) $satname = $sat;
88 88
 if ($satname != 'santaclaus') {
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 		print '<div><span>'._("Orbit").'</span>'.$info['orbit'].'</div>';
157 157
 	}
158 158
 	if ($info['launch_date'] != '') {
159
-		print '<div><span>'._("Launch Date").'</span>'.date('Y-m-d',strtotime($info['launch_date'])).'</div>';
159
+		print '<div><span>'._("Launch Date").'</span>'.date('Y-m-d', strtotime($info['launch_date'])).'</div>';
160 160
 	}
161 161
 	if ($info['launch_site'] != '') {
162 162
 		print '<div><span>'._("Launch Site").'</span>'.$info['launch_site'].'</div>';
Please login to merge, or discard this patch.
races-geojson.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 }
9 9
 header('Content-Type: text/javascript');
10 10
 
11
-$race_id = filter_input(INPUT_GET,'race_id',FILTER_SANITIZE_NUMBER_INT);
11
+$race_id = filter_input(INPUT_GET, 'race_id', FILTER_SANITIZE_NUMBER_INT);
12 12
 if ($race_id != '') {
13 13
 	$race_array = $Marine->getRace($race_id);
14 14
 } else {
@@ -18,10 +18,10 @@  discard block
 block discarded – undo
18 18
 $output = '{"type": "FeatureCollection","features": [';
19 19
 if (!empty($race_array))
20 20
 {	
21
-	$course = json_decode($race_array['race_markers'],true);
21
+	$course = json_decode($race_array['race_markers'], true);
22 22
 	$i = 0;
23 23
 	$f = count($course);
24
-	foreach($course as $marker)
24
+	foreach ($course as $marker)
25 25
 	{
26 26
 		date_default_timezone_set('UTC');
27 27
 		$output .= '{"type": "Feature",';
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 		$output .= '"type": "'.$marker['type'].'",';
34 34
 		if ($i == 0 || $i == 1) {
35 35
 			$output .= '"icon": "images/tsk/tsk-start.png",';
36
-		} elseif ($i == $f-1 || $i == $f-2) {
36
+		} elseif ($i == $f - 1 || $i == $f - 2) {
37 37
 			$output .= '"icon": "images/tsk/tsk-finish.png",';
38 38
 		} elseif ($marker['type'] == 4) {
39 39
 			$output .= '"icon": "images/kardinalstonne.png",';
Please login to merge, or discard this patch.
scripts/daemon-acars.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -23,10 +23,10 @@  discard block
 block discarded – undo
23 23
     die();
24 24
 }
25 25
 
26
-$ACARS=new ACARS(null,true);
26
+$ACARS = new ACARS(null, true);
27 27
 date_default_timezone_set('UTC');
28 28
 // signal handler - playing nice with sockets and dump1090
29
-pcntl_signal(SIGINT,  function($signo) {
29
+pcntl_signal(SIGINT, function($signo) {
30 30
     global $sock;
31 31
     echo "\n\nctrl-c or kill signal received. Tidying up ... ";
32 32
     socket_shutdown($sock, 0);
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 $sock = socket_create(AF_INET, SOCK_DGRAM, 0) or die("Unable to create socket\n");
43 43
 
44 44
 // Bind the source address
45
-if( !socket_bind($sock, $globalACARSHost , $globalACARSPort) )
45
+if (!socket_bind($sock, $globalACARSHost, $globalACARSPort))
46 46
 {
47 47
     $errorcode = socket_last_error();
48 48
     $errormsg = socket_strerror($errorcode);
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 }
52 52
 
53 53
 if ($globalDebug) echo "LISTEN UDP MODE \n\n";
54
-while(1) {
54
+while (1) {
55 55
     $r = socket_recvfrom($sock, $buffer, 512, 0, $remote_ip, $remote_port);
56 56
 
57 57
     // lets play nice and handle signals such as ctrl-c/kill properly
@@ -60,8 +60,8 @@  discard block
 block discarded – undo
60 60
     //  (null) 2 23/02/2015 14:46:06 0 -16 X .D-AIPW ! 1L 7 M82A LH077P 010952342854:VP-MIBI+W+0)-V+(),GB1
61 61
     if ($globalDebug) echo $buffer."\n";
62 62
     $ACARS->add(trim($buffer));
63
-    socket_sendto($sock, "OK " . $buffer , 100 , 0 , $remote_ip , $remote_port);
63
+    socket_sendto($sock, "OK ".$buffer, 100, 0, $remote_ip, $remote_port);
64 64
     $ACARS->deleteLiveAcarsData();
65 65
 }
66
-pcntl_exec($_,$argv);
66
+pcntl_exec($_, $argv);
67 67
 ?>
Please login to merge, or discard this patch.