Completed
Push — master ( 75e641...0485dc )
by Yannick
33:10
created
airspace-geojson.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -11,13 +11,13 @@  discard block
 block discarded – undo
11 11
 $Connection = new Connection();
12 12
 
13 13
 if (!$Connection->tableExists('airspace')) {
14
-    die;
14
+	die;
15 15
 }
16 16
 
17 17
 if (isset($_GET['coord'])) 
18 18
 {
19 19
 	$coords = explode(',',$_GET['coord']);
20
-        if ($globalDBdriver == 'mysql') {
20
+		if ($globalDBdriver == 'mysql') {
21 21
 		$query = "SELECT *, ST_AsWKB(SHAPE) AS wkb FROM airspace WHERE ST_Intersects(SHAPE, ST_Envelope(linestring(point(:minlon,:minlat), point(:maxlon,:maxlat))))";
22 22
 		try {
23 23
 			$sth = $Connection->db->prepare($query);
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 		}
38 38
 	}
39 39
 } else {
40
-        if ($globalDBdriver == 'mysql') {
40
+		if ($globalDBdriver == 'mysql') {
41 41
 		$query = "SELECT *, ST_AsWKB(SHAPE) AS wkb FROM airspace";
42 42
 	} else {
43 43
 		$query = "SELECT *, ST_AsBinary(wkb_geometry,'NDR') AS wkb FROM airspace";
@@ -51,8 +51,8 @@  discard block
 block discarded – undo
51 51
 }
52 52
 
53 53
 $geojson = array(
54
-    'type' => 'FeatureCollection',
55
-    'features' => array()
54
+	'type' => 'FeatureCollection',
55
+	'features' => array()
56 56
 );
57 57
 
58 58
 while ($row = $sth->fetch(PDO::FETCH_ASSOC))
@@ -115,9 +115,9 @@  discard block
 block discarded – undo
115 115
 		}
116 116
 		if (isset($properties['type']) && $properties['type'] != '') {
117 117
 			$feature = array(
118
-			    'type' => 'Feature',
119
-			    'geometry' => json_decode($geom->out('json')),
120
-			    'properties' => $properties
118
+				'type' => 'Feature',
119
+				'geometry' => json_decode($geom->out('json')),
120
+				'properties' => $properties
121 121
 			);
122 122
 			array_push($geojson['features'], $feature);
123 123
 		}
Please login to merge, or discard this patch.
require/class.SpotterArchive.php 1 patch
Indentation   +528 added lines, -528 removed lines patch added patch discarded remove patch
@@ -10,10 +10,10 @@  discard block
 block discarded – undo
10 10
 	}
11 11
 
12 12
 	/**
13
-	* Get SQL query part for filter used
14
-	* @param Array $filter the filter
15
-	* @return Array the SQL part
16
-	*/
13
+	 * Get SQL query part for filter used
14
+	 * @param Array $filter the filter
15
+	 * @return Array the SQL part
16
+	 */
17 17
 	public function getFilter($filter = array(),$where = false,$and = false) {
18 18
 		global $globalFilter, $globalStatsFilters, $globalFilterName, $globalDBdriver;
19 19
 		$filters = array();
@@ -158,44 +158,44 @@  discard block
 block discarded – undo
158 158
 	}
159 159
 
160 160
 
161
-        /**
162
-        * Gets all the spotter information based on a particular callsign
163
-        *
164
-        * @return Array the spotter information
165
-        *
166
-        */
167
-        public function getLastArchiveSpotterDataByIdent($ident)
168
-        {
161
+		/**
162
+		 * Gets all the spotter information based on a particular callsign
163
+		 *
164
+		 * @return Array the spotter information
165
+		 *
166
+		 */
167
+		public function getLastArchiveSpotterDataByIdent($ident)
168
+		{
169 169
 		$Spotter = new Spotter($this->db);
170
-                date_default_timezone_set('UTC');
170
+				date_default_timezone_set('UTC');
171 171
 
172
-                $ident = filter_var($ident, FILTER_SANITIZE_STRING);
173
-                //$query  = "SELECT spotter_archive.* FROM spotter_archive INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_archive l WHERE l.ident = :ident GROUP BY l.flightaware_id) s on spotter_archive.flightaware_id = s.flightaware_id AND spotter_archive.date = s.maxdate LIMIT 1";
174
-                $query  = "SELECT spotter_archive.* FROM spotter_archive WHERE ident = :ident ORDER BY date DESC LIMIT 1";
172
+				$ident = filter_var($ident, FILTER_SANITIZE_STRING);
173
+				//$query  = "SELECT spotter_archive.* FROM spotter_archive INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_archive l WHERE l.ident = :ident GROUP BY l.flightaware_id) s on spotter_archive.flightaware_id = s.flightaware_id AND spotter_archive.date = s.maxdate LIMIT 1";
174
+				$query  = "SELECT spotter_archive.* FROM spotter_archive WHERE ident = :ident ORDER BY date DESC LIMIT 1";
175 175
 
176
-                $spotter_array = $Spotter->getDataFromDB($query,array(':ident' => $ident));
176
+				$spotter_array = $Spotter->getDataFromDB($query,array(':ident' => $ident));
177 177
 
178
-                return $spotter_array;
179
-        }
178
+				return $spotter_array;
179
+		}
180 180
 
181 181
 
182
-        /**
183
-        * Gets last the spotter information based on a particular id
184
-        *
185
-        * @return Array the spotter information
186
-        *
187
-        */
188
-        public function getLastArchiveSpotterDataById($id)
189
-        {
190
-    		$Spotter = new Spotter($this->db);
191
-                date_default_timezone_set('UTC');
192
-                $id = filter_var($id, FILTER_SANITIZE_STRING);
193
-                //$query  = SpotterArchive->$global_query." WHERE spotter_archive.flightaware_id = :id";
194
-                //$query  = "SELECT spotter_archive.* FROM spotter_archive INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_archive l WHERE l.flightaware_id = :id GROUP BY l.flightaware_id) s on spotter_archive.flightaware_id = s.flightaware_id AND spotter_archive.date = s.maxdate LIMIT 1";
195
-                $query  = "SELECT * FROM spotter_archive WHERE flightaware_id = :id ORDER BY date DESC LIMIT 1";
182
+		/**
183
+		 * Gets last the spotter information based on a particular id
184
+		 *
185
+		 * @return Array the spotter information
186
+		 *
187
+		 */
188
+		public function getLastArchiveSpotterDataById($id)
189
+		{
190
+			$Spotter = new Spotter($this->db);
191
+				date_default_timezone_set('UTC');
192
+				$id = filter_var($id, FILTER_SANITIZE_STRING);
193
+				//$query  = SpotterArchive->$global_query." WHERE spotter_archive.flightaware_id = :id";
194
+				//$query  = "SELECT spotter_archive.* FROM spotter_archive INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_archive l WHERE l.flightaware_id = :id GROUP BY l.flightaware_id) s on spotter_archive.flightaware_id = s.flightaware_id AND spotter_archive.date = s.maxdate LIMIT 1";
195
+				$query  = "SELECT * FROM spotter_archive WHERE flightaware_id = :id ORDER BY date DESC LIMIT 1";
196 196
 
197 197
 //              $spotter_array = Spotter->getDataFromDB($query,array(':id' => $id));
198
-                  /*
198
+				  /*
199 199
                 try {
200 200
                         $Connection = new Connection();
201 201
                         $sth = Connection->$db->prepare($query);
@@ -205,118 +205,118 @@  discard block
 block discarded – undo
205 205
                 }
206 206
                 $spotter_array = $sth->fetchAll(PDO->FETCH_ASSOC);
207 207
                 */
208
-                $spotter_array = $Spotter->getDataFromDB($query,array(':id' => $id));
209
-
210
-                return $spotter_array;
211
-        }
212
-
213
-        /**
214
-        * Gets all the spotter information based on a particular id
215
-        *
216
-        * @return Array the spotter information
217
-        *
218
-        */
219
-        public function getAllArchiveSpotterDataById($id)
208
+				$spotter_array = $Spotter->getDataFromDB($query,array(':id' => $id));
209
+
210
+				return $spotter_array;
211
+		}
212
+
213
+		/**
214
+		 * Gets all the spotter information based on a particular id
215
+		 *
216
+		 * @return Array the spotter information
217
+		 *
218
+		 */
219
+		public function getAllArchiveSpotterDataById($id)
220 220
 	{
221
-                date_default_timezone_set('UTC');
222
-                $id = filter_var($id, FILTER_SANITIZE_STRING);
223
-                $query  = $this->global_query." WHERE spotter_archive.flightaware_id = :id ORDER BY date";
221
+				date_default_timezone_set('UTC');
222
+				$id = filter_var($id, FILTER_SANITIZE_STRING);
223
+				$query  = $this->global_query." WHERE spotter_archive.flightaware_id = :id ORDER BY date";
224 224
 
225 225
 //              $spotter_array = Spotter->getDataFromDB($query,array(':id' => $id));
226 226
 
227
-                try {
228
-                        $sth = $this->db->prepare($query);
229
-                        $sth->execute(array(':id' => $id));
230
-                } catch(PDOException $e) {
231
-                        echo $e->getMessage();
232
-                        die;
233
-                }
234
-                $spotter_array = $sth->fetchAll(PDO::FETCH_ASSOC);
235
-
236
-                return $spotter_array;
237
-        }
238
-
239
-        /**
240
-        * Gets coordinate & time spotter information based on a particular id
241
-        *
242
-        * @return Array the spotter information
243
-        *
244
-        */
245
-        public function getCoordArchiveSpotterDataById($id)
246
-        {
247
-                date_default_timezone_set('UTC');
248
-                $id = filter_var($id, FILTER_SANITIZE_STRING);
249
-                $query  = "SELECT spotter_archive.latitude, spotter_archive.longitude, spotter_archive.date FROM spotter_archive WHERE spotter_archive.flightaware_id = :id ORDER by spotter_archive.date ASC";
250
-                try {
251
-                        $sth = $this->db->prepare($query);
252
-                        $sth->execute(array(':id' => $id));
253
-                } catch(PDOException $e) {
254
-                        echo $e->getMessage();
255
-                        die;
256
-                }
257
-                $spotter_array = $sth->fetchAll(PDO::FETCH_ASSOC);
258
-                return $spotter_array;
259
-        }
227
+				try {
228
+						$sth = $this->db->prepare($query);
229
+						$sth->execute(array(':id' => $id));
230
+				} catch(PDOException $e) {
231
+						echo $e->getMessage();
232
+						die;
233
+				}
234
+				$spotter_array = $sth->fetchAll(PDO::FETCH_ASSOC);
260 235
 
236
+				return $spotter_array;
237
+		}
261 238
 
262
-        /**
263
-        * Gets altitude information based on a particular callsign
264
-        *
265
-        * @return Array the spotter information
266
-        *
267
-        */
268
-        public function getAltitudeArchiveSpotterDataByIdent($ident)
269
-        {
239
+		/**
240
+		 * Gets coordinate & time spotter information based on a particular id
241
+		 *
242
+		 * @return Array the spotter information
243
+		 *
244
+		 */
245
+		public function getCoordArchiveSpotterDataById($id)
246
+		{
247
+				date_default_timezone_set('UTC');
248
+				$id = filter_var($id, FILTER_SANITIZE_STRING);
249
+				$query  = "SELECT spotter_archive.latitude, spotter_archive.longitude, spotter_archive.date FROM spotter_archive WHERE spotter_archive.flightaware_id = :id ORDER by spotter_archive.date ASC";
250
+				try {
251
+						$sth = $this->db->prepare($query);
252
+						$sth->execute(array(':id' => $id));
253
+				} catch(PDOException $e) {
254
+						echo $e->getMessage();
255
+						die;
256
+				}
257
+				$spotter_array = $sth->fetchAll(PDO::FETCH_ASSOC);
258
+				return $spotter_array;
259
+		}
270 260
 
271
-                date_default_timezone_set('UTC');
272 261
 
273
-                $ident = filter_var($ident, FILTER_SANITIZE_STRING);
274
-                $query  = "SELECT spotter_archive.altitude, spotter_archive.date FROM spotter_archive WHERE spotter_archive.ident = :ident AND spotter_archive.latitude <> 0 AND spotter_archive.longitude <> 0 ORDER BY date";
262
+		/**
263
+		 * Gets altitude information based on a particular callsign
264
+		 *
265
+		 * @return Array the spotter information
266
+		 *
267
+		 */
268
+		public function getAltitudeArchiveSpotterDataByIdent($ident)
269
+		{
275 270
 
276
-                try {
277
-                        $sth = $this->db->prepare($query);
278
-                        $sth->execute(array(':ident' => $ident));
279
-                } catch(PDOException $e) {
280
-                        echo $e->getMessage();
281
-                        die;
282
-                }
283
-                $spotter_array = $sth->fetchAll(PDO::FETCH_ASSOC);
271
+				date_default_timezone_set('UTC');
284 272
 
285
-                return $spotter_array;
286
-        }
273
+				$ident = filter_var($ident, FILTER_SANITIZE_STRING);
274
+				$query  = "SELECT spotter_archive.altitude, spotter_archive.date FROM spotter_archive WHERE spotter_archive.ident = :ident AND spotter_archive.latitude <> 0 AND spotter_archive.longitude <> 0 ORDER BY date";
287 275
 
288
-        /**
289
-        * Gets altitude information based on a particular id
290
-        *
291
-        * @return Array the spotter information
292
-        *
293
-        */
294
-        public function getAltitudeArchiveSpotterDataById($id)
295
-        {
276
+				try {
277
+						$sth = $this->db->prepare($query);
278
+						$sth->execute(array(':ident' => $ident));
279
+				} catch(PDOException $e) {
280
+						echo $e->getMessage();
281
+						die;
282
+				}
283
+				$spotter_array = $sth->fetchAll(PDO::FETCH_ASSOC);
296 284
 
297
-                date_default_timezone_set('UTC');
285
+				return $spotter_array;
286
+		}
298 287
 
299
-                $id = filter_var($id, FILTER_SANITIZE_STRING);
300
-                $query  = "SELECT spotter_archive.altitude, spotter_archive.date FROM spotter_archive WHERE spotter_archive.flightaware_id = :id AND spotter_archive.latitude <> 0 AND spotter_archive.longitude <> 0 ORDER BY date";
288
+		/**
289
+		 * Gets altitude information based on a particular id
290
+		 *
291
+		 * @return Array the spotter information
292
+		 *
293
+		 */
294
+		public function getAltitudeArchiveSpotterDataById($id)
295
+		{
301 296
 
302
-                try {
303
-                        $sth = $this->db->prepare($query);
304
-                        $sth->execute(array(':id' => $id));
305
-                } catch(PDOException $e) {
306
-                        echo $e->getMessage();
307
-                        die;
308
-                }
309
-                $spotter_array = $sth->fetchAll(PDO::FETCH_ASSOC);
297
+				date_default_timezone_set('UTC');
298
+
299
+				$id = filter_var($id, FILTER_SANITIZE_STRING);
300
+				$query  = "SELECT spotter_archive.altitude, spotter_archive.date FROM spotter_archive WHERE spotter_archive.flightaware_id = :id AND spotter_archive.latitude <> 0 AND spotter_archive.longitude <> 0 ORDER BY date";
301
+
302
+				try {
303
+						$sth = $this->db->prepare($query);
304
+						$sth->execute(array(':id' => $id));
305
+				} catch(PDOException $e) {
306
+						echo $e->getMessage();
307
+						die;
308
+				}
309
+				$spotter_array = $sth->fetchAll(PDO::FETCH_ASSOC);
310 310
 
311
-                return $spotter_array;
312
-        }
311
+				return $spotter_array;
312
+		}
313 313
 
314
-        /**
315
-        * Gets altitude & speed information based on a particular id
316
-        *
317
-        * @return Array the spotter information
318
-        *
319
-        */
314
+		/**
315
+		 * Gets altitude & speed information based on a particular id
316
+		 *
317
+		 * @return Array the spotter information
318
+		 *
319
+		 */
320 320
 	public function getAltitudeSpeedArchiveSpotterDataById($id)
321 321
 	{
322 322
 		date_default_timezone_set('UTC');
@@ -333,12 +333,12 @@  discard block
 block discarded – undo
333 333
 		return $spotter_array;
334 334
 	}
335 335
 
336
-        /**
337
-        * Gets altitude information based on a particular callsign
338
-        *
339
-        * @return Array the spotter information
340
-        *
341
-        */
336
+		/**
337
+		 * Gets altitude information based on a particular callsign
338
+		 *
339
+		 * @return Array the spotter information
340
+		 *
341
+		 */
342 342
 	public function getLastAltitudeArchiveSpotterDataByIdent($ident)
343 343
 	{
344 344
 		date_default_timezone_set('UTC');
@@ -358,12 +358,12 @@  discard block
 block discarded – undo
358 358
 
359 359
 
360 360
 
361
-       /**
362
-        * Gets all the archive spotter information
363
-        *
364
-        * @return Array the spotter information
365
-        *
366
-        */
361
+	   /**
362
+	    * Gets all the archive spotter information
363
+	    *
364
+	    * @return Array the spotter information
365
+	    *
366
+	    */
367 367
 	public function getSpotterArchiveData($ident,$flightaware_id,$date)
368 368
 	{
369 369
 		$Spotter = new Spotter($this->db);
@@ -391,34 +391,34 @@  discard block
 block discarded – undo
391 391
 	}
392 392
 
393 393
 	/**
394
-        * Gets Minimal Live Spotter data
395
-        *
396
-        * @return Array the spotter information
397
-        *
398
-        */
399
-        public function getMinLiveSpotterData($begindate,$enddate,$filter = array())
400
-        {
401
-                global $globalDBdriver, $globalLiveInterval;
402
-                date_default_timezone_set('UTC');
403
-
404
-                $filter_query = '';
405
-                if (isset($filter['source']) && !empty($filter['source'])) {
406
-                        $filter_query .= " AND format_source IN ('".implode("','",$filter['source'])."') ";
407
-                }
408
-                // Use spotter_output also ?
409
-                if (isset($filter['airlines']) && !empty($filter['airlines'])) {
410
-                        $filter_query .= " INNER JOIN (SELECT flightaware_id FROM spotter_archive_output WHERE spotter_archive_output.airline_icao IN ('".implode("','",$filter['airlines'])."')) so ON so.flightaware_id = spotter_archive.flightaware_id ";
411
-                }
412
-                if (isset($filter['airlinestype']) && !empty($filter['airlinestype'])) {
413
-                        $filter_query .= " INNER JOIN (SELECT flightaware_id FROM spotter_archive_output WHERE spotter_archive_output.airline_type = '".$filter['airlinestype']."') sa ON sa.flightaware_id = spotter_archive.flightaware_id ";
414
-                }
415
-                if (isset($filter['source_aprs']) && !empty($filter['source_aprs'])) {
416
-                        $filter_query = " AND format_source = 'aprs' AND source_name IN ('".implode("','",$filter['source_aprs'])."')";
417
-                }
394
+	 * Gets Minimal Live Spotter data
395
+	 *
396
+	 * @return Array the spotter information
397
+	 *
398
+	 */
399
+		public function getMinLiveSpotterData($begindate,$enddate,$filter = array())
400
+		{
401
+				global $globalDBdriver, $globalLiveInterval;
402
+				date_default_timezone_set('UTC');
403
+
404
+				$filter_query = '';
405
+				if (isset($filter['source']) && !empty($filter['source'])) {
406
+						$filter_query .= " AND format_source IN ('".implode("','",$filter['source'])."') ";
407
+				}
408
+				// Use spotter_output also ?
409
+				if (isset($filter['airlines']) && !empty($filter['airlines'])) {
410
+						$filter_query .= " INNER JOIN (SELECT flightaware_id FROM spotter_archive_output WHERE spotter_archive_output.airline_icao IN ('".implode("','",$filter['airlines'])."')) so ON so.flightaware_id = spotter_archive.flightaware_id ";
411
+				}
412
+				if (isset($filter['airlinestype']) && !empty($filter['airlinestype'])) {
413
+						$filter_query .= " INNER JOIN (SELECT flightaware_id FROM spotter_archive_output WHERE spotter_archive_output.airline_type = '".$filter['airlinestype']."') sa ON sa.flightaware_id = spotter_archive.flightaware_id ";
414
+				}
415
+				if (isset($filter['source_aprs']) && !empty($filter['source_aprs'])) {
416
+						$filter_query = " AND format_source = 'aprs' AND source_name IN ('".implode("','",$filter['source_aprs'])."')";
417
+				}
418 418
 
419
-                //if (!isset($globalLiveInterval)) $globalLiveInterval = '200';
420
-                if ($globalDBdriver == 'mysql') {
421
-                        /*
419
+				//if (!isset($globalLiveInterval)) $globalLiveInterval = '200';
420
+				if ($globalDBdriver == 'mysql') {
421
+						/*
422 422
                         $query  = 'SELECT a.aircraft_shadow, spotter_archive.ident, spotter_archive.flightaware_id, spotter_archive.aircraft_icao, spotter_archive.departure_airport_icao as departure_airport, spotter_archive.arrival_airport_icao as arrival_airport, spotter_archive.latitude, spotter_archive.longitude, spotter_archive.altitude, spotter_archive.heading, spotter_archive.ground_speed, spotter_archive.squawk 
423 423
                     		    FROM spotter_archive 
424 424
                     		    INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_archive l WHERE (l.date BETWEEN '."'".$begindate."'".' AND '."'".$enddate."'".') GROUP BY l.flightaware_id) s on spotter_archive.flightaware_id = s.flightaware_id AND spotter_archive.date = s.maxdate '.$filter_query.'LEFT JOIN (SELECT aircraft_shadow,icao FROM aircraft) a ON spotter_archive.aircraft_icao = a.icao';
@@ -437,56 +437,56 @@  discard block
 block discarded – undo
437 437
 				    INNER JOIN (SELECT * FROM aircraft) a on spotter_archive.aircraft_icao = a.icao
438 438
 				    WHERE spotter_archive.date BETWEEN '."'".$begindate."'".' AND '."'".$begindate."'".' 
439 439
                         	    '.$filter_query.' ORDER BY flightaware_id';
440
-                } else {
441
-                        //$query  = 'SELECT spotter_archive.ident, spotter_archive.flightaware_id, spotter_archive.aircraft_icao, spotter_archive.departure_airport_icao as departure_airport, spotter_archive.arrival_airport_icao as arrival_airport, spotter_archive.latitude, spotter_archive.longitude, spotter_archive.altitude, spotter_archive.heading, spotter_archive.ground_speed, spotter_archive.squawk, a.aircraft_shadow FROM spotter_archive INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_archive l WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= l.date GROUP BY l.flightaware_id) s on spotter_archive.flightaware_id = s.flightaware_id AND spotter_archive.date = s.maxdate '.$filter_query.'INNER JOIN (SELECT * FROM aircraft) a on spotter_archive.aircraft_icao = a.icao';
442
-                        $query  = 'SELECT spotter_archive.date,spotter_archive.flightaware_id, spotter_archive.ident, spotter_archive.aircraft_icao, spotter_archive.departure_airport_icao as departure_airport, spotter_archive.arrival_airport_icao as arrival_airport, spotter_archive.latitude, spotter_archive.longitude, spotter_archive.altitude, spotter_archive.heading, spotter_archive.ground_speed, spotter_archive.squawk, a.aircraft_shadow,a.engine_type, a.engine_count, a.wake_category 
440
+				} else {
441
+						//$query  = 'SELECT spotter_archive.ident, spotter_archive.flightaware_id, spotter_archive.aircraft_icao, spotter_archive.departure_airport_icao as departure_airport, spotter_archive.arrival_airport_icao as arrival_airport, spotter_archive.latitude, spotter_archive.longitude, spotter_archive.altitude, spotter_archive.heading, spotter_archive.ground_speed, spotter_archive.squawk, a.aircraft_shadow FROM spotter_archive INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_archive l WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= l.date GROUP BY l.flightaware_id) s on spotter_archive.flightaware_id = s.flightaware_id AND spotter_archive.date = s.maxdate '.$filter_query.'INNER JOIN (SELECT * FROM aircraft) a on spotter_archive.aircraft_icao = a.icao';
442
+						$query  = 'SELECT spotter_archive.date,spotter_archive.flightaware_id, spotter_archive.ident, spotter_archive.aircraft_icao, spotter_archive.departure_airport_icao as departure_airport, spotter_archive.arrival_airport_icao as arrival_airport, spotter_archive.latitude, spotter_archive.longitude, spotter_archive.altitude, spotter_archive.heading, spotter_archive.ground_speed, spotter_archive.squawk, a.aircraft_shadow,a.engine_type, a.engine_count, a.wake_category 
443 443
                         	    FROM spotter_archive 
444 444
                         	    INNER JOIN (SELECT * FROM aircraft) a on spotter_archive.aircraft_icao = a.icao
445 445
                         	    WHERE spotter_archive.date >= '."'".$begindate."'".' AND spotter_archive.date <= '."'".$enddate."'".'
446 446
                         	    '.$filter_query.' ORDER BY flightaware_id';
447
-                }
448
-                //echo $query;
449
-                try {
450
-                        $sth = $this->db->prepare($query);
451
-                        $sth->execute();
452
-                } catch(PDOException $e) {
453
-                        echo $e->getMessage();
454
-                        die;
455
-                }
456
-                $spotter_array = $sth->fetchAll(PDO::FETCH_ASSOC);
447
+				}
448
+				//echo $query;
449
+				try {
450
+						$sth = $this->db->prepare($query);
451
+						$sth->execute();
452
+				} catch(PDOException $e) {
453
+						echo $e->getMessage();
454
+						die;
455
+				}
456
+				$spotter_array = $sth->fetchAll(PDO::FETCH_ASSOC);
457 457
 
458
-                return $spotter_array;
459
-        }
458
+				return $spotter_array;
459
+		}
460 460
 
461 461
 	/**
462
-        * Gets Minimal Live Spotter data
463
-        *
464
-        * @return Array the spotter information
465
-        *
466
-        */
467
-        public function getMinLiveSpotterDataPlayback($begindate,$enddate,$filter = array())
468
-        {
469
-                global $globalDBdriver, $globalLiveInterval;
470
-                date_default_timezone_set('UTC');
471
-
472
-                $filter_query = '';
473
-                if (isset($filter['source']) && !empty($filter['source'])) {
474
-                        $filter_query .= " AND format_source IN ('".implode("','",$filter['source'])."') ";
475
-                }
476
-                // Should use spotter_output also ?
477
-                if (isset($filter['airlines']) && !empty($filter['airlines'])) {
478
-                        $filter_query .= " INNER JOIN (SELECT flightaware_id FROM spotter_archive_output WHERE spotter_archive_output.airline_icao IN ('".implode("','",$filter['airlines'])."')) so ON so.flightaware_id = spotter_archive.flightaware_id ";
479
-                }
480
-                if (isset($filter['airlinestype']) && !empty($filter['airlinestype'])) {
481
-                        $filter_query .= " INNER JOIN (SELECT flightaware_id FROM spotter_archive_output WHERE spotter_archive_output.airline_type = '".$filter['airlinestype']."') sa ON sa.flightaware_id = spotter_archive.flightaware_id ";
482
-                }
483
-                if (isset($filter['source_aprs']) && !empty($filter['source_aprs'])) {
484
-                        $filter_query = " AND format_source = 'aprs' AND source_name IN ('".implode("','",$filter['source_aprs'])."')";
485
-                }
462
+	 * Gets Minimal Live Spotter data
463
+	 *
464
+	 * @return Array the spotter information
465
+	 *
466
+	 */
467
+		public function getMinLiveSpotterDataPlayback($begindate,$enddate,$filter = array())
468
+		{
469
+				global $globalDBdriver, $globalLiveInterval;
470
+				date_default_timezone_set('UTC');
471
+
472
+				$filter_query = '';
473
+				if (isset($filter['source']) && !empty($filter['source'])) {
474
+						$filter_query .= " AND format_source IN ('".implode("','",$filter['source'])."') ";
475
+				}
476
+				// Should use spotter_output also ?
477
+				if (isset($filter['airlines']) && !empty($filter['airlines'])) {
478
+						$filter_query .= " INNER JOIN (SELECT flightaware_id FROM spotter_archive_output WHERE spotter_archive_output.airline_icao IN ('".implode("','",$filter['airlines'])."')) so ON so.flightaware_id = spotter_archive.flightaware_id ";
479
+				}
480
+				if (isset($filter['airlinestype']) && !empty($filter['airlinestype'])) {
481
+						$filter_query .= " INNER JOIN (SELECT flightaware_id FROM spotter_archive_output WHERE spotter_archive_output.airline_type = '".$filter['airlinestype']."') sa ON sa.flightaware_id = spotter_archive.flightaware_id ";
482
+				}
483
+				if (isset($filter['source_aprs']) && !empty($filter['source_aprs'])) {
484
+						$filter_query = " AND format_source = 'aprs' AND source_name IN ('".implode("','",$filter['source_aprs'])."')";
485
+				}
486 486
 
487
-                //if (!isset($globalLiveInterval)) $globalLiveInterval = '200';
488
-                if ($globalDBdriver == 'mysql') {
489
-                        /*
487
+				//if (!isset($globalLiveInterval)) $globalLiveInterval = '200';
488
+				if ($globalDBdriver == 'mysql') {
489
+						/*
490 490
                         $query  = 'SELECT a.aircraft_shadow, spotter_archive.ident, spotter_archive.flightaware_id, spotter_archive.aircraft_icao, spotter_archive.departure_airport_icao as departure_airport, spotter_archive.arrival_airport_icao as arrival_airport, spotter_archive.latitude, spotter_archive.longitude, spotter_archive.altitude, spotter_archive.heading, spotter_archive.ground_speed, spotter_archive.squawk 
491 491
                     		    FROM spotter_archive 
492 492
                     		    INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_archive l WHERE (l.date BETWEEN '."'".$begindate."'".' AND '."'".$enddate."'".') GROUP BY l.flightaware_id) s on spotter_archive.flightaware_id = s.flightaware_id AND spotter_archive.date = s.maxdate '.$filter_query.'LEFT JOIN (SELECT aircraft_shadow,icao FROM aircraft) a ON spotter_archive.aircraft_icao = a.icao';
@@ -497,95 +497,95 @@  discard block
 block discarded – undo
497 497
 				    WHERE (spotter_archive_output.date BETWEEN '."'".$begindate."'".' AND '."'".$enddate."'".') 
498 498
                         	    '.$filter_query.' GROUP BY spotter_archive_output.flightaware_id, spotter_archive_output.ident, spotter_archive_output.aircraft_icao, spotter_archive_output.departure_airport_icao, spotter_archive_output.arrival_airport_icao, spotter_archive_output.latitude, spotter_archive_output.longitude, spotter_archive_output.altitude, spotter_archive_output.heading, spotter_archive_output.ground_speed, spotter_archive_output.squawk, a.aircraft_shadow';
499 499
 
500
-                } else {
501
-                        //$query  = 'SELECT spotter_archive_output.ident, spotter_archive_output.flightaware_id, spotter_archive_output.aircraft_icao, spotter_archive_output.departure_airport_icao as departure_airport, spotter_archive_output.arrival_airport_icao as arrival_airport, spotter_archive_output.latitude, spotter_archive_output.longitude, spotter_archive_output.altitude, spotter_archive_output.heading, spotter_archive_output.ground_speed, spotter_archive_output.squawk, a.aircraft_shadow FROM spotter_archive_output INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_archive_output l WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= l.date GROUP BY l.flightaware_id) s on spotter_archive_output.flightaware_id = s.flightaware_id AND spotter_archive_output.date = s.maxdate '.$filter_query.'INNER JOIN (SELECT * FROM aircraft) a on spotter_archive_output.aircraft_icao = a.icao';
502
-                       /*
500
+				} else {
501
+						//$query  = 'SELECT spotter_archive_output.ident, spotter_archive_output.flightaware_id, spotter_archive_output.aircraft_icao, spotter_archive_output.departure_airport_icao as departure_airport, spotter_archive_output.arrival_airport_icao as arrival_airport, spotter_archive_output.latitude, spotter_archive_output.longitude, spotter_archive_output.altitude, spotter_archive_output.heading, spotter_archive_output.ground_speed, spotter_archive_output.squawk, a.aircraft_shadow FROM spotter_archive_output INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_archive_output l WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= l.date GROUP BY l.flightaware_id) s on spotter_archive_output.flightaware_id = s.flightaware_id AND spotter_archive_output.date = s.maxdate '.$filter_query.'INNER JOIN (SELECT * FROM aircraft) a on spotter_archive_output.aircraft_icao = a.icao';
502
+					   /*
503 503
                         $query  = 'SELECT spotter_archive_output.ident, spotter_archive_output.flightaware_id, spotter_archive_output.aircraft_icao, spotter_archive_output.departure_airport_icao as departure_airport, spotter_archive_output.arrival_airport_icao as arrival_airport, spotter_archive_output.latitude, spotter_archive_output.longitude, spotter_archive_output.altitude, spotter_archive_output.heading, spotter_archive_output.ground_speed, spotter_archive_output.squawk, a.aircraft_shadow
504 504
                         	    FROM spotter_archive_output 
505 505
                         	    INNER JOIN (SELECT * FROM aircraft) a on spotter_archive_output.aircraft_icao = a.icao
506 506
                         	    WHERE spotter_archive_output.date >= '."'".$begindate."'".' AND spotter_archive_output.date <= '."'".$enddate."'".'
507 507
                         	    '.$filter_query.' GROUP BY spotter_archive_output.flightaware_id, spotter_archive_output.ident, spotter_archive_output.aircraft_icao, spotter_archive_output.departure_airport_icao, spotter_archive_output.arrival_airport_icao, spotter_archive_output.latitude, spotter_archive_output.longitude, spotter_archive_output.altitude, spotter_archive_output.heading, spotter_archive_output.ground_speed, spotter_archive_output.squawk, a.aircraft_shadow';
508 508
                         */
509
-                        $query  = 'SELECT DISTINCT spotter_archive_output.flightaware_id, spotter_archive_output.ident, spotter_archive_output.aircraft_icao, spotter_archive_output.departure_airport_icao as departure_airport, spotter_archive_output.arrival_airport_icao as arrival_airport, spotter_archive_output.latitude, spotter_archive_output.longitude, spotter_archive_output.altitude, spotter_archive_output.heading, spotter_archive_output.ground_speed, spotter_archive_output.squawk, a.aircraft_shadow
509
+						$query  = 'SELECT DISTINCT spotter_archive_output.flightaware_id, spotter_archive_output.ident, spotter_archive_output.aircraft_icao, spotter_archive_output.departure_airport_icao as departure_airport, spotter_archive_output.arrival_airport_icao as arrival_airport, spotter_archive_output.latitude, spotter_archive_output.longitude, spotter_archive_output.altitude, spotter_archive_output.heading, spotter_archive_output.ground_speed, spotter_archive_output.squawk, a.aircraft_shadow
510 510
                         	    FROM spotter_archive_output 
511 511
                         	    INNER JOIN (SELECT * FROM aircraft) a on spotter_archive_output.aircraft_icao = a.icao
512 512
                         	    WHERE spotter_archive_output.date >= '."'".$begindate."'".' AND spotter_archive_output.date <= '."'".$enddate."'".'
513 513
                         	    '.$filter_query.' LIMIT 200 OFFSET 0';
514 514
 //                        	    .' GROUP BY spotter_output.flightaware_id, spotter_output.ident, spotter_output.aircraft_icao, spotter_output.departure_airport_icao, spotter_output.arrival_airport_icao, spotter_output.latitude, spotter_output.longitude, spotter_output.altitude, spotter_output.heading, spotter_output.ground_speed, spotter_output.squawk, a.aircraft_shadow';
515 515
                         	    
516
-                }
517
-                //echo $query;
518
-                try {
519
-                        $sth = $this->db->prepare($query);
520
-                        $sth->execute();
521
-                } catch(PDOException $e) {
522
-                        echo $e->getMessage();
523
-                        die;
524
-                }
525
-                $spotter_array = $sth->fetchAll(PDO::FETCH_ASSOC);
516
+				}
517
+				//echo $query;
518
+				try {
519
+						$sth = $this->db->prepare($query);
520
+						$sth->execute();
521
+				} catch(PDOException $e) {
522
+						echo $e->getMessage();
523
+						die;
524
+				}
525
+				$spotter_array = $sth->fetchAll(PDO::FETCH_ASSOC);
526 526
 
527
-                return $spotter_array;
528
-        }
527
+				return $spotter_array;
528
+		}
529 529
 
530 530
 	 /**
531
-        * Gets count Live Spotter data
532
-        *
533
-        * @return Array the spotter information
534
-        *
535
-        */
536
-        public function getLiveSpotterCount($begindate,$enddate,$filter = array())
537
-        {
538
-                global $globalDBdriver, $globalLiveInterval;
539
-                date_default_timezone_set('UTC');
540
-
541
-                $filter_query = '';
542
-                if (isset($filter['source']) && !empty($filter['source'])) {
543
-                        $filter_query .= " AND format_source IN ('".implode("','",$filter['source'])."') ";
544
-                }
545
-                if (isset($filter['airlines']) && !empty($filter['airlines'])) {
546
-                        $filter_query .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.airline_icao IN ('".implode("','",$filter['airlines'])."')) so ON so.flightaware_id = spotter_archive.flightaware_id ";
547
-                }
548
-                if (isset($filter['airlinestype']) && !empty($filter['airlinestype'])) {
549
-                        $filter_query .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.airline_type = '".$filter['airlinestype']."') sa ON sa.flightaware_id = spotter_archive.flightaware_id ";
550
-                }
551
-                if (isset($filter['source_aprs']) && !empty($filter['source_aprs'])) {
552
-                        $filter_query = " AND format_source = 'aprs' AND source_name IN ('".implode("','",$filter['source_aprs'])."')";
553
-                }
531
+	  * Gets count Live Spotter data
532
+	  *
533
+	  * @return Array the spotter information
534
+	  *
535
+	  */
536
+		public function getLiveSpotterCount($begindate,$enddate,$filter = array())
537
+		{
538
+				global $globalDBdriver, $globalLiveInterval;
539
+				date_default_timezone_set('UTC');
554 540
 
555
-                //if (!isset($globalLiveInterval)) $globalLiveInterval = '200';
556
-                if ($globalDBdriver == 'mysql') {
541
+				$filter_query = '';
542
+				if (isset($filter['source']) && !empty($filter['source'])) {
543
+						$filter_query .= " AND format_source IN ('".implode("','",$filter['source'])."') ";
544
+				}
545
+				if (isset($filter['airlines']) && !empty($filter['airlines'])) {
546
+						$filter_query .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.airline_icao IN ('".implode("','",$filter['airlines'])."')) so ON so.flightaware_id = spotter_archive.flightaware_id ";
547
+				}
548
+				if (isset($filter['airlinestype']) && !empty($filter['airlinestype'])) {
549
+						$filter_query .= " INNER JOIN (SELECT flightaware_id FROM spotter_output WHERE spotter_output.airline_type = '".$filter['airlinestype']."') sa ON sa.flightaware_id = spotter_archive.flightaware_id ";
550
+				}
551
+				if (isset($filter['source_aprs']) && !empty($filter['source_aprs'])) {
552
+						$filter_query = " AND format_source = 'aprs' AND source_name IN ('".implode("','",$filter['source_aprs'])."')";
553
+				}
554
+
555
+				//if (!isset($globalLiveInterval)) $globalLiveInterval = '200';
556
+				if ($globalDBdriver == 'mysql') {
557 557
 			$query = 'SELECT COUNT(DISTINCT flightaware_id) as nb 
558 558
 			FROM spotter_archive l 
559 559
 			WHERE (l.date BETWEEN DATE_SUB('."'".$begindate."'".',INTERVAL '.$globalLiveInterval.' SECOND) AND '."'".$begindate."'".')'.$filter_query;
560
-                } else {
560
+				} else {
561 561
 			$query = 'SELECT COUNT(DISTINCT flightaware_id) as nb FROM spotter_archive l WHERE (l.date BETWEEN '."'".$begindate."' - INTERVAL '".$globalLiveInterval." SECONDS' AND "."'".$enddate."'".')'.$filter_query;
562
-                }
563
-                //echo $query;
564
-                try {
565
-                        $sth = $this->db->prepare($query);
566
-                        $sth->execute();
567
-                } catch(PDOException $e) {
568
-                        echo $e->getMessage();
569
-                        die;
570
-                }
562
+				}
563
+				//echo $query;
564
+				try {
565
+						$sth = $this->db->prepare($query);
566
+						$sth->execute();
567
+				} catch(PDOException $e) {
568
+						echo $e->getMessage();
569
+						die;
570
+				}
571 571
 		$result = $sth->fetch(PDO::FETCH_ASSOC);
572 572
 		$sth->closeCursor();
573
-                return $result['nb'];
573
+				return $result['nb'];
574 574
 
575
-        }
575
+		}
576 576
 
577 577
 
578 578
 
579 579
 	// Spotter_Archive_output
580 580
 	
581
-    /**
582
-    * Gets all the spotter information
583
-    *
584
-    * @return Array the spotter information
585
-    *
586
-    */
587
-    public function searchSpotterData($q = '', $registration = '', $aircraft_icao = '', $aircraft_manufacturer = '', $highlights = '', $airline_icao = '', $airline_country = '', $airline_type = '', $airport = '', $airport_country = '', $callsign = '', $departure_airport_route = '', $arrival_airport_route = '', $owner = '',$pilot_id = '',$pilot_name = '',$altitude = '', $date_posted = '', $limit = '', $sort = '', $includegeodata = '',$origLat = '',$origLon = '',$dist = '', $filters=array())
588
-    {
581
+	/**
582
+	 * Gets all the spotter information
583
+	 *
584
+	 * @return Array the spotter information
585
+	 *
586
+	 */
587
+	public function searchSpotterData($q = '', $registration = '', $aircraft_icao = '', $aircraft_manufacturer = '', $highlights = '', $airline_icao = '', $airline_country = '', $airline_type = '', $airport = '', $airport_country = '', $callsign = '', $departure_airport_route = '', $arrival_airport_route = '', $owner = '',$pilot_id = '',$pilot_name = '',$altitude = '', $date_posted = '', $limit = '', $sort = '', $includegeodata = '',$origLat = '',$origLon = '',$dist = '', $filters=array())
588
+	{
589 589
 	global $globalTimezone, $globalDBdriver;
590 590
 	require_once(dirname(__FILE__).'/class.Translation.php');
591 591
 	$Translation = new Translation($this->db);
@@ -599,159 +599,159 @@  discard block
 block discarded – undo
599 599
 	$filter_query = $this->getFilter($filters);
600 600
 	if ($q != "")
601 601
 	{
602
-	    if (!is_string($q))
603
-	    {
602
+		if (!is_string($q))
603
+		{
604 604
 		return false;
605
-	    } else {
605
+		} else {
606 606
 	        
607 607
 		$q_array = explode(" ", $q);
608 608
 		
609 609
 		foreach ($q_array as $q_item){
610
-		    $additional_query .= " AND (";
611
-		    $additional_query .= "(spotter_archive_output.spotter_id like '%".$q_item."%') OR ";
612
-		    $additional_query .= "(spotter_archive_output.aircraft_icao like '%".$q_item."%') OR ";
613
-		    $additional_query .= "(spotter_archive_output.aircraft_name like '%".$q_item."%') OR ";
614
-		    $additional_query .= "(spotter_archive_output.aircraft_manufacturer like '%".$q_item."%') OR ";
615
-		    $additional_query .= "(spotter_archive_output.airline_icao like '%".$q_item."%') OR ";
616
-		    $additional_query .= "(spotter_archive_output.airline_name like '%".$q_item."%') OR ";
617
-		    $additional_query .= "(spotter_archive_output.airline_country like '%".$q_item."%') OR ";
618
-		    $additional_query .= "(spotter_archive_output.departure_airport_icao like '%".$q_item."%') OR ";
619
-		    $additional_query .= "(spotter_archive_output.departure_airport_name like '%".$q_item."%') OR ";
620
-		    $additional_query .= "(spotter_archive_output.departure_airport_city like '%".$q_item."%') OR ";
621
-		    $additional_query .= "(spotter_archive_output.departure_airport_country like '%".$q_item."%') OR ";
622
-		    $additional_query .= "(spotter_archive_output.arrival_airport_icao like '%".$q_item."%') OR ";
623
-		    $additional_query .= "(spotter_archive_output.arrival_airport_name like '%".$q_item."%') OR ";
624
-		    $additional_query .= "(spotter_archive_output.arrival_airport_city like '%".$q_item."%') OR ";
625
-		    $additional_query .= "(spotter_archive_output.arrival_airport_country like '%".$q_item."%') OR ";
626
-		    $additional_query .= "(spotter_archive_output.registration like '%".$q_item."%') OR ";
627
-		    $additional_query .= "(spotter_archive_output.owner_name like '%".$q_item."%') OR ";
628
-		    $additional_query .= "(spotter_archive_output.pilot_id like '%".$q_item."%') OR ";
629
-		    $additional_query .= "(spotter_archive_output.pilot_name like '%".$q_item."%') OR ";
630
-		    $additional_query .= "(spotter_archive_output.ident like '%".$q_item."%') OR ";
631
-		    $translate = $Translation->ident2icao($q_item);
632
-		    if ($translate != $q_item) $additional_query .= "(spotter_archive_output.ident like '%".$translate."%') OR ";
633
-		    $additional_query .= "(spotter_archive_output.highlight like '%".$q_item."%')";
634
-		    $additional_query .= ")";
610
+			$additional_query .= " AND (";
611
+			$additional_query .= "(spotter_archive_output.spotter_id like '%".$q_item."%') OR ";
612
+			$additional_query .= "(spotter_archive_output.aircraft_icao like '%".$q_item."%') OR ";
613
+			$additional_query .= "(spotter_archive_output.aircraft_name like '%".$q_item."%') OR ";
614
+			$additional_query .= "(spotter_archive_output.aircraft_manufacturer like '%".$q_item."%') OR ";
615
+			$additional_query .= "(spotter_archive_output.airline_icao like '%".$q_item."%') OR ";
616
+			$additional_query .= "(spotter_archive_output.airline_name like '%".$q_item."%') OR ";
617
+			$additional_query .= "(spotter_archive_output.airline_country like '%".$q_item."%') OR ";
618
+			$additional_query .= "(spotter_archive_output.departure_airport_icao like '%".$q_item."%') OR ";
619
+			$additional_query .= "(spotter_archive_output.departure_airport_name like '%".$q_item."%') OR ";
620
+			$additional_query .= "(spotter_archive_output.departure_airport_city like '%".$q_item."%') OR ";
621
+			$additional_query .= "(spotter_archive_output.departure_airport_country like '%".$q_item."%') OR ";
622
+			$additional_query .= "(spotter_archive_output.arrival_airport_icao like '%".$q_item."%') OR ";
623
+			$additional_query .= "(spotter_archive_output.arrival_airport_name like '%".$q_item."%') OR ";
624
+			$additional_query .= "(spotter_archive_output.arrival_airport_city like '%".$q_item."%') OR ";
625
+			$additional_query .= "(spotter_archive_output.arrival_airport_country like '%".$q_item."%') OR ";
626
+			$additional_query .= "(spotter_archive_output.registration like '%".$q_item."%') OR ";
627
+			$additional_query .= "(spotter_archive_output.owner_name like '%".$q_item."%') OR ";
628
+			$additional_query .= "(spotter_archive_output.pilot_id like '%".$q_item."%') OR ";
629
+			$additional_query .= "(spotter_archive_output.pilot_name like '%".$q_item."%') OR ";
630
+			$additional_query .= "(spotter_archive_output.ident like '%".$q_item."%') OR ";
631
+			$translate = $Translation->ident2icao($q_item);
632
+			if ($translate != $q_item) $additional_query .= "(spotter_archive_output.ident like '%".$translate."%') OR ";
633
+			$additional_query .= "(spotter_archive_output.highlight like '%".$q_item."%')";
634
+			$additional_query .= ")";
635
+		}
635 636
 		}
636
-	    }
637 637
 	}
638 638
 	
639 639
 	if ($registration != "")
640 640
 	{
641
-	    $registration = filter_var($registration,FILTER_SANITIZE_STRING);
642
-	    if (!is_string($registration))
643
-	    {
641
+		$registration = filter_var($registration,FILTER_SANITIZE_STRING);
642
+		if (!is_string($registration))
643
+		{
644 644
 		return false;
645
-	    } else {
645
+		} else {
646 646
 		$additional_query .= " AND (spotter_archive_output.registration = '".$registration."')";
647
-	    }
647
+		}
648 648
 	}
649 649
 	
650 650
 	if ($aircraft_icao != "")
651 651
 	{
652
-	    $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING);
653
-	    if (!is_string($aircraft_icao))
654
-	    {
652
+		$aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING);
653
+		if (!is_string($aircraft_icao))
654
+		{
655 655
 		return false;
656
-	    } else {
656
+		} else {
657 657
 		$additional_query .= " AND (spotter_archive_output.aircraft_icao = '".$aircraft_icao."')";
658
-	    }
658
+		}
659 659
 	}
660 660
 	
661 661
 	if ($aircraft_manufacturer != "")
662 662
 	{
663
-	    $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING);
664
-	    if (!is_string($aircraft_manufacturer))
665
-	    {
663
+		$aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING);
664
+		if (!is_string($aircraft_manufacturer))
665
+		{
666 666
 		return false;
667
-	    } else {
667
+		} else {
668 668
 		$additional_query .= " AND (spotter_archive_output.aircraft_manufacturer = '".$aircraft_manufacturer."')";
669
-	    }
669
+		}
670 670
 	}
671 671
 	
672 672
 	if ($highlights == "true")
673 673
 	{
674
-	    if (!is_string($highlights))
675
-	    {
674
+		if (!is_string($highlights))
675
+		{
676 676
 		return false;
677
-	    } else {
677
+		} else {
678 678
 		$additional_query .= " AND (spotter_archive_output.highlight <> '')";
679
-	    }
679
+		}
680 680
 	}
681 681
 	
682 682
 	if ($airline_icao != "")
683 683
 	{
684
-	    $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING);
685
-	    if (!is_string($airline_icao))
686
-	    {
684
+		$airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING);
685
+		if (!is_string($airline_icao))
686
+		{
687 687
 		return false;
688
-	    } else {
688
+		} else {
689 689
 		$additional_query .= " AND (spotter_archive_output.airline_icao = '".$airline_icao."')";
690
-	    }
690
+		}
691 691
 	}
692 692
 	
693 693
 	if ($airline_country != "")
694 694
 	{
695
-	    $airline_country = filter_var($airline_country,FILTER_SANITIZE_STRING);
696
-	    if (!is_string($airline_country))
697
-	    {
695
+		$airline_country = filter_var($airline_country,FILTER_SANITIZE_STRING);
696
+		if (!is_string($airline_country))
697
+		{
698 698
 		return false;
699
-	    } else {
699
+		} else {
700 700
 		$additional_query .= " AND (spotter_archive_output.airline_country = '".$airline_country."')";
701
-	    }
701
+		}
702 702
 	}
703 703
 	
704 704
 	if ($airline_type != "")
705 705
 	{
706
-	    $airline_type = filter_var($airline_type,FILTER_SANITIZE_STRING);
707
-	    if (!is_string($airline_type))
708
-	    {
706
+		$airline_type = filter_var($airline_type,FILTER_SANITIZE_STRING);
707
+		if (!is_string($airline_type))
708
+		{
709 709
 		return false;
710
-	    } else {
710
+		} else {
711 711
 		if ($airline_type == "passenger")
712 712
 		{
713
-		    $additional_query .= " AND (spotter_archive_output.airline_type = 'passenger')";
713
+			$additional_query .= " AND (spotter_archive_output.airline_type = 'passenger')";
714 714
 		}
715 715
 		if ($airline_type == "cargo")
716 716
 		{
717
-		    $additional_query .= " AND (spotter_archive_output.airline_type = 'cargo')";
717
+			$additional_query .= " AND (spotter_archive_output.airline_type = 'cargo')";
718 718
 		}
719 719
 		if ($airline_type == "military")
720 720
 		{
721
-		    $additional_query .= " AND (spotter_archive_output.airline_type = 'military')";
721
+			$additional_query .= " AND (spotter_archive_output.airline_type = 'military')";
722
+		}
722 723
 		}
723
-	    }
724 724
 	}
725 725
 	
726 726
 	if ($airport != "")
727 727
 	{
728
-	    $airport = filter_var($airport,FILTER_SANITIZE_STRING);
729
-	    if (!is_string($airport))
730
-	    {
728
+		$airport = filter_var($airport,FILTER_SANITIZE_STRING);
729
+		if (!is_string($airport))
730
+		{
731 731
 		return false;
732
-	    } else {
732
+		} else {
733 733
 		$additional_query .= " AND ((spotter_archive_output.departure_airport_icao = '".$airport."') OR (spotter_archive_output.arrival_airport_icao = '".$airport."'))";
734
-	    }
734
+		}
735 735
 	}
736 736
 	
737 737
 	if ($airport_country != "")
738 738
 	{
739
-	    $airport_country = filter_var($airport_country,FILTER_SANITIZE_STRING);
740
-	    if (!is_string($airport_country))
741
-	    {
739
+		$airport_country = filter_var($airport_country,FILTER_SANITIZE_STRING);
740
+		if (!is_string($airport_country))
741
+		{
742 742
 		return false;
743
-	    } else {
743
+		} else {
744 744
 		$additional_query .= " AND ((spotter_archive_output.departure_airport_country = '".$airport_country."') OR (spotter_archive_output.arrival_airport_country = '".$airport_country."'))";
745
-	    }
745
+		}
746 746
 	}
747 747
     
748 748
 	if ($callsign != "")
749 749
 	{
750
-	    $callsign = filter_var($callsign,FILTER_SANITIZE_STRING);
751
-	    if (!is_string($callsign))
752
-	    {
750
+		$callsign = filter_var($callsign,FILTER_SANITIZE_STRING);
751
+		if (!is_string($callsign))
752
+		{
753 753
 		return false;
754
-	    } else {
754
+		} else {
755 755
 		$translate = $Translation->ident2icao($callsign);
756 756
 		if ($translate != $callsign) {
757 757
 			$additional_query .= " AND (spotter_archive_output.ident = :callsign OR spotter_archive_output.ident = :translate)";
@@ -759,81 +759,81 @@  discard block
 block discarded – undo
759 759
 		} else {
760 760
 			$additional_query .= " AND (spotter_archive_output.ident = '".$callsign."')";
761 761
 		}
762
-	    }
762
+		}
763 763
 	}
764 764
 
765 765
 	if ($owner != "")
766 766
 	{
767
-	    $owner = filter_var($owner,FILTER_SANITIZE_STRING);
768
-	    if (!is_string($owner))
769
-	    {
767
+		$owner = filter_var($owner,FILTER_SANITIZE_STRING);
768
+		if (!is_string($owner))
769
+		{
770 770
 		return false;
771
-	    } else {
771
+		} else {
772 772
 		$additional_query .= " AND (spotter_archive_output.owner_name = '".$owner."')";
773
-	    }
773
+		}
774 774
 	}
775 775
 
776 776
 	if ($pilot_name != "")
777 777
 	{
778
-	    $pilot_name = filter_var($pilot_name,FILTER_SANITIZE_STRING);
779
-	    if (!is_string($pilot_name))
780
-	    {
778
+		$pilot_name = filter_var($pilot_name,FILTER_SANITIZE_STRING);
779
+		if (!is_string($pilot_name))
780
+		{
781 781
 		return false;
782
-	    } else {
782
+		} else {
783 783
 		$additional_query .= " AND (spotter_archive_output.pilot_name = '".$pilot_name."')";
784
-	    }
784
+		}
785 785
 	}
786 786
 	
787 787
 	if ($pilot_id != "")
788 788
 	{
789
-	    $pilot_id = filter_var($pilot_id,FILTER_SANITIZE_NUMBER_INT);
790
-	    if (!is_string($pilot_id))
791
-	    {
789
+		$pilot_id = filter_var($pilot_id,FILTER_SANITIZE_NUMBER_INT);
790
+		if (!is_string($pilot_id))
791
+		{
792 792
 		return false;
793
-	    } else {
793
+		} else {
794 794
 		$additional_query .= " AND (spotter_archive_output.pilot_id = '".$pilot_id."')";
795
-	    }
795
+		}
796 796
 	}
797 797
 	
798 798
 	if ($departure_airport_route != "")
799 799
 	{
800
-	    $departure_airport_route = filter_var($departure_airport_route,FILTER_SANITIZE_STRING);
801
-	    if (!is_string($departure_airport_route))
802
-	    {
800
+		$departure_airport_route = filter_var($departure_airport_route,FILTER_SANITIZE_STRING);
801
+		if (!is_string($departure_airport_route))
802
+		{
803 803
 		return false;
804
-	    } else {
804
+		} else {
805 805
 		$additional_query .= " AND (spotter_archive_output.departure_airport_icao = '".$departure_airport_route."')";
806
-	    }
806
+		}
807 807
 	}
808 808
 	
809 809
 	if ($arrival_airport_route != "")
810 810
 	{
811
-	    $arrival_airport_route = filter_var($arrival_airport_route,FILTER_SANITIZE_STRING);
812
-	    if (!is_string($arrival_airport_route))
813
-	    {
811
+		$arrival_airport_route = filter_var($arrival_airport_route,FILTER_SANITIZE_STRING);
812
+		if (!is_string($arrival_airport_route))
813
+		{
814 814
 		return false;
815
-	    } else {
815
+		} else {
816 816
 		$additional_query .= " AND (spotter_archive_output.arrival_airport_icao = '".$arrival_airport_route."')";
817
-	    }
817
+		}
818 818
 	}
819 819
 	
820 820
 	if ($altitude != "")
821 821
 	{
822
-	    $altitude_array = explode(",", $altitude);
822
+		$altitude_array = explode(",", $altitude);
823 823
 	    
824
-	    $altitude_array[0] = filter_var($altitude_array[0],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
825
-	    $altitude_array[1] = filter_var($altitude_array[1],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
824
+		$altitude_array[0] = filter_var($altitude_array[0],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
825
+		$altitude_array[1] = filter_var($altitude_array[1],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
826 826
 	    
827 827
 
828
-	    if ($altitude_array[1] != "")
829
-	    {                
828
+		if ($altitude_array[1] != "")
829
+		{                
830 830
 		$altitude_array[0] = substr($altitude_array[0], 0, -2);
831 831
 		$altitude_array[1] = substr($altitude_array[1], 0, -2);
832 832
 		$additional_query .= " AND altitude BETWEEN '".$altitude_array[0]."' AND '".$altitude_array[1]."' ";
833
-	    } else {
833
+		} else {
834 834
 		$altitude_array[0] = substr($altitude_array[0], 0, -2);
835 835
 		$additional_query .= " AND altitude <= '".$altitude_array[0]."' ";
836
-	    }
836
+		}
837 837
 	}
838 838
 	
839 839
 	if ($date_posted != "")
@@ -918,14 +918,14 @@  discard block
 block discarded – undo
918 918
 		}
919 919
 	}
920 920
 
921
-    /**
922
-    * Gets all the spotter information based on the callsign
923
-    *
924
-    * @return Array the spotter information
925
-    *
926
-    */
927
-    public function getSpotterDataByIdent($ident = '', $limit = '', $sort = '')
928
-    {
921
+	/**
922
+	 * Gets all the spotter information based on the callsign
923
+	 *
924
+	 * @return Array the spotter information
925
+	 *
926
+	 */
927
+	public function getSpotterDataByIdent($ident = '', $limit = '', $sort = '')
928
+	{
929 929
 	$global_query = "SELECT spotter_archive_output.* FROM spotter_archive_output";
930 930
 	
931 931
 	date_default_timezone_set('UTC');
@@ -937,35 +937,35 @@  discard block
 block discarded – undo
937 937
 	
938 938
 	if ($ident != "")
939 939
 	{
940
-	    if (!is_string($ident))
941
-	    {
940
+		if (!is_string($ident))
941
+		{
942 942
 		return false;
943
-	    } else {
943
+		} else {
944 944
 		$additional_query = " AND spotter_archive_output.ident = :ident";
945 945
 		$query_values = array(':ident' => $ident);
946
-	    }
946
+		}
947 947
 	}
948 948
 	
949 949
 	if ($limit != "")
950 950
 	{
951
-	    $limit_array = explode(",", $limit);
951
+		$limit_array = explode(",", $limit);
952 952
 	    
953
-	    $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT);
954
-	    $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT);
953
+		$limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT);
954
+		$limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT);
955 955
 	    
956
-	    if ($limit_array[0] >= 0 && $limit_array[1] >= 0)
957
-	    {
956
+		if ($limit_array[0] >= 0 && $limit_array[1] >= 0)
957
+		{
958 958
 		//$limit_query = " LIMIT ".$limit_array[0].",".$limit_array[1];
959 959
 		$limit_query = " LIMIT ".$limit_array[1]." OFFSET ".$limit_array[0];
960
-	    }
960
+		}
961 961
 	}
962 962
 
963 963
 	if ($sort != "")
964 964
 	{
965
-	    $search_orderby_array = $Spotter->getOrderBy();
966
-	    $orderby_query = $search_orderby_array[$sort]['sql'];
965
+		$search_orderby_array = $Spotter->getOrderBy();
966
+		$orderby_query = $search_orderby_array[$sort]['sql'];
967 967
 	} else {
968
-	    $orderby_query = " ORDER BY spotter_archive_output.date DESC";
968
+		$orderby_query = " ORDER BY spotter_archive_output.date DESC";
969 969
 	}
970 970
 
971 971
 	$query = $global_query." WHERE spotter_archive_output.ident <> '' ".$additional_query." ".$orderby_query;
@@ -973,17 +973,17 @@  discard block
 block discarded – undo
973 973
 	$spotter_array = $Spotter->getDataFromDB($query, $query_values, $limit_query);
974 974
 
975 975
 	return $spotter_array;
976
-    }
976
+	}
977 977
 
978 978
 
979
-    /**
980
-    * Gets all the spotter information based on the owner
981
-    *
982
-    * @return Array the spotter information
983
-    *
984
-    */
985
-    public function getSpotterDataByOwner($owner = '', $limit = '', $sort = '', $filter = array())
986
-    {
979
+	/**
980
+	 * Gets all the spotter information based on the owner
981
+	 *
982
+	 * @return Array the spotter information
983
+	 *
984
+	 */
985
+	public function getSpotterDataByOwner($owner = '', $limit = '', $sort = '', $filter = array())
986
+	{
987 987
 	$global_query = "SELECT spotter_archive_output.* FROM spotter_archive_output";
988 988
 	
989 989
 	date_default_timezone_set('UTC');
@@ -996,35 +996,35 @@  discard block
 block discarded – undo
996 996
 	
997 997
 	if ($owner != "")
998 998
 	{
999
-	    if (!is_string($owner))
1000
-	    {
999
+		if (!is_string($owner))
1000
+		{
1001 1001
 		return false;
1002
-	    } else {
1002
+		} else {
1003 1003
 		$additional_query = " AND (spotter_archive_output.owner_name = :owner)";
1004 1004
 		$query_values = array(':owner' => $owner);
1005
-	    }
1005
+		}
1006 1006
 	}
1007 1007
 	
1008 1008
 	if ($limit != "")
1009 1009
 	{
1010
-	    $limit_array = explode(",", $limit);
1010
+		$limit_array = explode(",", $limit);
1011 1011
 	    
1012
-	    $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT);
1013
-	    $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT);
1012
+		$limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT);
1013
+		$limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT);
1014 1014
 	    
1015
-	    if ($limit_array[0] >= 0 && $limit_array[1] >= 0)
1016
-	    {
1015
+		if ($limit_array[0] >= 0 && $limit_array[1] >= 0)
1016
+		{
1017 1017
 		//$limit_query = " LIMIT ".$limit_array[0].",".$limit_array[1];
1018 1018
 		$limit_query = " LIMIT ".$limit_array[1]." OFFSET ".$limit_array[0];
1019
-	    }
1019
+		}
1020 1020
 	}
1021 1021
 
1022 1022
 	if ($sort != "")
1023 1023
 	{
1024
-	    $search_orderby_array = $Spotter->getOrderBy();
1025
-	    $orderby_query = $search_orderby_array[$sort]['sql'];
1024
+		$search_orderby_array = $Spotter->getOrderBy();
1025
+		$orderby_query = $search_orderby_array[$sort]['sql'];
1026 1026
 	} else {
1027
-	    $orderby_query = " ORDER BY spotter_archive_output.date DESC";
1027
+		$orderby_query = " ORDER BY spotter_archive_output.date DESC";
1028 1028
 	}
1029 1029
 
1030 1030
 	$query = $global_query.$filter_query." spotter_archive_output.owner_name <> '' ".$additional_query." ".$orderby_query;
@@ -1032,16 +1032,16 @@  discard block
 block discarded – undo
1032 1032
 	$spotter_array = $Spotter->getDataFromDB($query, $query_values, $limit_query);
1033 1033
 
1034 1034
 	return $spotter_array;
1035
-    }
1036
-
1037
-    /**
1038
-    * Gets all the spotter information based on the pilot
1039
-    *
1040
-    * @return Array the spotter information
1041
-    *
1042
-    */
1043
-    public function getSpotterDataByPilot($pilot = '', $limit = '', $sort = '', $filter = array())
1044
-    {
1035
+	}
1036
+
1037
+	/**
1038
+	 * Gets all the spotter information based on the pilot
1039
+	 *
1040
+	 * @return Array the spotter information
1041
+	 *
1042
+	 */
1043
+	public function getSpotterDataByPilot($pilot = '', $limit = '', $sort = '', $filter = array())
1044
+	{
1045 1045
 	$global_query = "SELECT spotter_archive_output.* FROM spotter_archive_output";
1046 1046
 	
1047 1047
 	date_default_timezone_set('UTC');
@@ -1060,24 +1060,24 @@  discard block
 block discarded – undo
1060 1060
 	
1061 1061
 	if ($limit != "")
1062 1062
 	{
1063
-	    $limit_array = explode(",", $limit);
1063
+		$limit_array = explode(",", $limit);
1064 1064
 	    
1065
-	    $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT);
1066
-	    $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT);
1065
+		$limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT);
1066
+		$limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT);
1067 1067
 	    
1068
-	    if ($limit_array[0] >= 0 && $limit_array[1] >= 0)
1069
-	    {
1068
+		if ($limit_array[0] >= 0 && $limit_array[1] >= 0)
1069
+		{
1070 1070
 		//$limit_query = " LIMIT ".$limit_array[0].",".$limit_array[1];
1071 1071
 		$limit_query = " LIMIT ".$limit_array[1]." OFFSET ".$limit_array[0];
1072
-	    }
1072
+		}
1073 1073
 	}
1074 1074
 
1075 1075
 	if ($sort != "")
1076 1076
 	{
1077
-	    $search_orderby_array = $Spotter->getOrderBy();
1078
-	    $orderby_query = $search_orderby_array[$sort]['sql'];
1077
+		$search_orderby_array = $Spotter->getOrderBy();
1078
+		$orderby_query = $search_orderby_array[$sort]['sql'];
1079 1079
 	} else {
1080
-	    $orderby_query = " ORDER BY spotter_archive_output.date DESC";
1080
+		$orderby_query = " ORDER BY spotter_archive_output.date DESC";
1081 1081
 	}
1082 1082
 
1083 1083
 	$query = $global_query.$filter_query." spotter_archive_output.pilot_name <> '' ".$additional_query." ".$orderby_query;
@@ -1085,16 +1085,16 @@  discard block
 block discarded – undo
1085 1085
 	$spotter_array = $Spotter->getDataFromDB($query, $query_values, $limit_query);
1086 1086
 
1087 1087
 	return $spotter_array;
1088
-    }
1089
-
1090
-    /**
1091
-    * Gets all number of flight over countries
1092
-    *
1093
-    * @return Array the airline country list
1094
-    *
1095
-    */
1096
-    public function countAllFlightOverCountries($limit = true,$olderthanmonths = 0,$sincedate = '')
1097
-    {
1088
+	}
1089
+
1090
+	/**
1091
+	 * Gets all number of flight over countries
1092
+	 *
1093
+	 * @return Array the airline country list
1094
+	 *
1095
+	 */
1096
+	public function countAllFlightOverCountries($limit = true,$olderthanmonths = 0,$sincedate = '')
1097
+	{
1098 1098
 	global $globalDBdriver;
1099 1099
 	/*
1100 1100
 	$query = "SELECT c.name, c.iso3, c.iso2, count(c.name) as nb 
@@ -1104,14 +1104,14 @@  discard block
 block discarded – undo
1104 1104
 	$query = "SELECT c.name, c.iso3, c.iso2, count(c.name) as nb
1105 1105
 		    FROM countries c, spotter_archive s
1106 1106
 		    WHERE c.iso2 = s.over_country ";
1107
-                if ($olderthanmonths > 0) {
1108
-            		if ($globalDBdriver == 'mysql') {
1107
+				if ($olderthanmonths > 0) {
1108
+					if ($globalDBdriver == 'mysql') {
1109 1109
 				$query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
1110 1110
 			} else {
1111 1111
 				$query .= "AND date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'";
1112 1112
 			}
1113 1113
 		}
1114
-                if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
1114
+				if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
1115 1115
 	$query .= "GROUP BY c.name, c.iso3, c.iso2 ORDER BY nb DESC";
1116 1116
 	if ($limit) $query .= " LIMIT 0,10";
1117 1117
       
@@ -1124,23 +1124,23 @@  discard block
 block discarded – undo
1124 1124
         
1125 1125
 	while($row = $sth->fetch(PDO::FETCH_ASSOC))
1126 1126
 	{
1127
-	    $temp_array['flight_count'] = $row['nb'];
1128
-	    $temp_array['flight_country'] = $row['name'];
1129
-	    $temp_array['flight_country_iso3'] = $row['iso3'];
1130
-	    $temp_array['flight_country_iso2'] = $row['iso2'];
1131
-	    $flight_array[] = $temp_array;
1127
+		$temp_array['flight_count'] = $row['nb'];
1128
+		$temp_array['flight_country'] = $row['name'];
1129
+		$temp_array['flight_country_iso3'] = $row['iso3'];
1130
+		$temp_array['flight_country_iso2'] = $row['iso2'];
1131
+		$flight_array[] = $temp_array;
1132 1132
 	}
1133 1133
 	return $flight_array;
1134
-    }
1135
-
1136
-    /**
1137
-    * Gets all number of flight over countries
1138
-    *
1139
-    * @return Array the airline country list
1140
-    *
1141
-    */
1142
-    public function countAllFlightOverCountriesByAirlines($limit = true,$olderthanmonths = 0,$sincedate = '')
1143
-    {
1134
+	}
1135
+
1136
+	/**
1137
+	 * Gets all number of flight over countries
1138
+	 *
1139
+	 * @return Array the airline country list
1140
+	 *
1141
+	 */
1142
+	public function countAllFlightOverCountriesByAirlines($limit = true,$olderthanmonths = 0,$sincedate = '')
1143
+	{
1144 1144
 	global $globalDBdriver;
1145 1145
 	/*
1146 1146
 	$query = "SELECT c.name, c.iso3, c.iso2, count(c.name) as nb 
@@ -1150,14 +1150,14 @@  discard block
 block discarded – undo
1150 1150
 	$query = "SELECT o.airline_icao,c.name, c.iso3, c.iso2, count(c.name) as nb
1151 1151
 		    FROM countries c, spotter_archive s, spotter_output o
1152 1152
 		    WHERE c.iso2 = s.over_country AND o.airline_icao <> '' AND o.flightaware_id = s.flightaware_id ";
1153
-                if ($olderthanmonths > 0) {
1154
-            		if ($globalDBdriver == 'mysql') {
1153
+				if ($olderthanmonths > 0) {
1154
+					if ($globalDBdriver == 'mysql') {
1155 1155
 				$query .= 'AND s.date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) ';
1156 1156
 			} else {
1157 1157
 				$query .= "AND s.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'";
1158 1158
 			}
1159 1159
 		}
1160
-                if ($sincedate != '') $query .= "AND s.date > '".$sincedate."' ";
1160
+				if ($sincedate != '') $query .= "AND s.date > '".$sincedate."' ";
1161 1161
 	$query .= "GROUP BY o.airline_icao,c.name, c.iso3, c.iso2 ORDER BY nb DESC";
1162 1162
 	if ($limit) $query .= " LIMIT 0,10";
1163 1163
       
@@ -1170,24 +1170,24 @@  discard block
 block discarded – undo
1170 1170
         
1171 1171
 	while($row = $sth->fetch(PDO::FETCH_ASSOC))
1172 1172
 	{
1173
-	    $temp_array['airline_icao'] = $row['airline_icao'];
1174
-	    $temp_array['flight_count'] = $row['nb'];
1175
-	    $temp_array['flight_country'] = $row['name'];
1176
-	    $temp_array['flight_country_iso3'] = $row['iso3'];
1177
-	    $temp_array['flight_country_iso2'] = $row['iso2'];
1178
-	    $flight_array[] = $temp_array;
1173
+		$temp_array['airline_icao'] = $row['airline_icao'];
1174
+		$temp_array['flight_count'] = $row['nb'];
1175
+		$temp_array['flight_country'] = $row['name'];
1176
+		$temp_array['flight_country_iso3'] = $row['iso3'];
1177
+		$temp_array['flight_country_iso2'] = $row['iso2'];
1178
+		$flight_array[] = $temp_array;
1179 1179
 	}
1180 1180
 	return $flight_array;
1181
-    }
1182
-
1183
-    /**
1184
-    * Gets last spotter information based on a particular callsign
1185
-    *
1186
-    * @return Array the spotter information
1187
-    *
1188
-    */
1189
-    public function getDateArchiveSpotterDataById($id,$date)
1190
-    {
1181
+	}
1182
+
1183
+	/**
1184
+	 * Gets last spotter information based on a particular callsign
1185
+	 *
1186
+	 * @return Array the spotter information
1187
+	 *
1188
+	 */
1189
+	public function getDateArchiveSpotterDataById($id,$date)
1190
+	{
1191 1191
 	$Spotter = new Spotter($this->db);
1192 1192
 	date_default_timezone_set('UTC');
1193 1193
 	$id = filter_var($id, FILTER_SANITIZE_STRING);
@@ -1195,16 +1195,16 @@  discard block
 block discarded – undo
1195 1195
 	$date = date('c',$date);
1196 1196
 	$spotter_array = $Spotter->getDataFromDB($query,array(':id' => $id,':date' => $date));
1197 1197
 	return $spotter_array;
1198
-    }
1199
-
1200
-    /**
1201
-    * Gets all the spotter information based on a particular callsign
1202
-    *
1203
-    * @return Array the spotter information
1204
-    *
1205
-    */
1206
-    public function getDateArchiveSpotterDataByIdent($ident,$date)
1207
-    {
1198
+	}
1199
+
1200
+	/**
1201
+	 * Gets all the spotter information based on a particular callsign
1202
+	 *
1203
+	 * @return Array the spotter information
1204
+	 *
1205
+	 */
1206
+	public function getDateArchiveSpotterDataByIdent($ident,$date)
1207
+	{
1208 1208
 	$Spotter = new Spotter($this->db);
1209 1209
 	date_default_timezone_set('UTC');
1210 1210
 	$ident = filter_var($ident, FILTER_SANITIZE_STRING);
@@ -1212,16 +1212,16 @@  discard block
 block discarded – undo
1212 1212
 	$date = date('c',$date);
1213 1213
 	$spotter_array = $Spotter->getDataFromDB($query,array(':ident' => $ident,':date' => $date));
1214 1214
 	return $spotter_array;
1215
-    }
1216
-
1217
-    /**
1218
-    * Gets all the spotter information based on the airport
1219
-    *
1220
-    * @return Array the spotter information
1221
-    *
1222
-    */
1223
-    public function getSpotterDataByAirport($airport = '', $limit = '', $sort = '',$filters = array())
1224
-    {
1215
+	}
1216
+
1217
+	/**
1218
+	 * Gets all the spotter information based on the airport
1219
+	 *
1220
+	 * @return Array the spotter information
1221
+	 *
1222
+	 */
1223
+	public function getSpotterDataByAirport($airport = '', $limit = '', $sort = '',$filters = array())
1224
+	{
1225 1225
 	global $global_query;
1226 1226
 	$Spotter = new Spotter($this->db);
1227 1227
 	date_default_timezone_set('UTC');
@@ -1232,35 +1232,35 @@  discard block
 block discarded – undo
1232 1232
 	
1233 1233
 	if ($airport != "")
1234 1234
 	{
1235
-	    if (!is_string($airport))
1236
-	    {
1235
+		if (!is_string($airport))
1236
+		{
1237 1237
 		return false;
1238
-	    } else {
1238
+		} else {
1239 1239
 		$additional_query .= " AND ((spotter_archive_output.departure_airport_icao = :airport) OR (spotter_archive_output.arrival_airport_icao = :airport))";
1240 1240
 		$query_values = array(':airport' => $airport);
1241
-	    }
1241
+		}
1242 1242
 	}
1243 1243
 	
1244 1244
 	if ($limit != "")
1245 1245
 	{
1246
-	    $limit_array = explode(",", $limit);
1246
+		$limit_array = explode(",", $limit);
1247 1247
 	    
1248
-	    $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT);
1249
-	    $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT);
1248
+		$limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT);
1249
+		$limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT);
1250 1250
 	    
1251
-	    if ($limit_array[0] >= 0 && $limit_array[1] >= 0)
1252
-	    {
1251
+		if ($limit_array[0] >= 0 && $limit_array[1] >= 0)
1252
+		{
1253 1253
 		//$limit_query = " LIMIT ".$limit_array[0].",".$limit_array[1];
1254 1254
 		$limit_query = " LIMIT ".$limit_array[1]." OFFSET ".$limit_array[0];
1255
-	    }
1255
+		}
1256 1256
 	}
1257 1257
 	
1258 1258
 	if ($sort != "")
1259 1259
 	{
1260
-	    $search_orderby_array = $Spotter->getOrderBy();
1261
-	    $orderby_query = $search_orderby_array[$sort]['sql'];
1260
+		$search_orderby_array = $Spotter->getOrderBy();
1261
+		$orderby_query = $search_orderby_array[$sort]['sql'];
1262 1262
 	} else {
1263
-	    $orderby_query = " ORDER BY spotter_archive_output.date DESC";
1263
+		$orderby_query = " ORDER BY spotter_archive_output.date DESC";
1264 1264
 	}
1265 1265
 
1266 1266
 	$query = $global_query.$filter_query." spotter_archive_output.ident <> '' ".$additional_query." AND ((spotter_archive_output.departure_airport_icao <> 'NA') AND (spotter_archive_output.arrival_airport_icao <> 'NA')) ".$orderby_query;
@@ -1268,6 +1268,6 @@  discard block
 block discarded – undo
1268 1268
 	$spotter_array = $Spotter->getDataFromDB($query, $query_values, $limit_query);
1269 1269
 
1270 1270
 	return $spotter_array;
1271
-    }
1271
+	}
1272 1272
 }
1273 1273
 ?>
1274 1274
\ No newline at end of file
Please login to merge, or discard this patch.
index.php 1 patch
Indentation   +100 added lines, -100 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
     <?php }; if (isset($globalSatellite) && $globalSatellite) { ?><td><div id="ibxsatellite"><h4><?php echo _("Satellites Displayed"); ?></h4><br /><i class="fa fa-spinner fa-pulse fa-fw"></i></div></td><?php } ?>
50 50
 </tr></table></div>
51 51
 <?php
52
-    if ((!isset($_COOKIE['MapFormat']) && isset($globalMap3Ddefault) && $globalMap3Ddefault) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d')) {
52
+	if ((!isset($_COOKIE['MapFormat']) && isset($globalMap3Ddefault) && $globalMap3Ddefault) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d')) {
53 53
 ?>
54 54
 <script src="<?php echo $globalURL; ?>/js/map.3d.js.php<?php if (isset($tsk)) print '?tsk='.$tsk; ?>"></script>
55 55
 <?php
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 <script src="<?php echo $globalURL; ?>/js/map-marine.3d.js.php"></script>
74 74
 <?php
75 75
 	}
76
-    }
76
+	}
77 77
 ?>
78 78
 
79 79
 <div id="sidebar" class="sidebar collapsed">
@@ -84,34 +84,34 @@  discard block
 block discarded – undo
84 84
 	<li><a href="" onclick="getUserLocation(); return false;" title="<?php echo _("Plot your Location"); ?>"><i class="fa fa-map-marker"></i></a></li>
85 85
 	<li><a href="" onclick="getCompassDirection(); return false;" title="<?php echo _("Compass Mode"); ?>"><i class="fa fa-compass"></i></a></li>
86 86
 <?php
87
-    if ((isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') || (isset($globalBeta) && $globalBeta === TRUE)) {
87
+	if ((isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') || (isset($globalBeta) && $globalBeta === TRUE)) {
88 88
 	if (isset($globalArchive) && $globalArchive == TRUE) {
89 89
 ?>
90 90
 	<li><a href="#archive" role="tab" title="<?php echo _("Archive"); ?>"><i class="fa fa-archive"></i></a></li>
91 91
 <?php
92 92
 	}
93
-    }
93
+	}
94 94
 ?>
95 95
 	<li><a href="#home" role="tab" title="<?php echo _("Layers"); ?>"><i class="fa fa-map"></i></a></li>
96 96
 	<li><a href="#filters" role="tab" title="<?php echo _("Filters"); ?>"><i class="fa fa-filter"></i></a></li>
97 97
 	<li><a href="#settings" role="tab" title="<?php echo _("Settings"); ?>"><i class="fa fa-gears"></i></a></li>
98 98
 <?php
99
-    if (isset($globalMap3D) && $globalMap3D) {
99
+	if (isset($globalMap3D) && $globalMap3D) {
100 100
 	if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) {
101 101
 ?>
102 102
 	<li><a href="" onclick="show3D(); return false;" role="tab" title="3D"><b>3D</b></a></li>
103 103
 <?php
104 104
 	} else {
105
-	    if (isset($globalSatellite) && $globalSatellite) {
105
+		if (isset($globalSatellite) && $globalSatellite) {
106 106
 ?>
107 107
 	<li><a href="#satellites" role="tab" title="<?php echo _("Satellites"); ?>"><i class="satellite"></i></a></li>
108 108
 <?php
109
-	    }
109
+		}
110 110
 ?>
111 111
 	<li><a href="" onclick="show2D(); return false;" role="tab" title="2D"><b>2D</b></a></li>
112 112
 <?php
113 113
 	}
114
-    }
114
+	}
115 115
 ?>
116 116
     </ul>
117 117
 
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 ?>
187 187
         </div>
188 188
 <?php
189
-    if (isset($globalArchive) && $globalArchive == TRUE) {
189
+	if (isset($globalArchive) && $globalArchive == TRUE) {
190 190
 ?>
191 191
         <div class="sidebar-pane" id="archive">
192 192
 	    <h1 class="sidebar-header"><?php echo _("Playback"); ?> <i>Bêta</i><span class="sidebar-close"><i class="fa fa-caret-left"></i></span></h1>
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
 	    </form>
246 246
 	</div>
247 247
 <?php
248
-    }
248
+	}
249 249
 ?>
250 250
         <div class="sidebar-pane" id="settings">
251 251
 	    <h1 class="sidebar-header"><?php echo _("Settings"); ?><span class="sidebar-close"><i class="fa fa-caret-left"></i></span></h1>
@@ -256,72 +256,72 @@  discard block
 block discarded – undo
256 256
 			    <?php
257 257
 				if (!isset($_COOKIE['MapType']) || $_COOKIE['MapType'] == '') $MapType = $globalMapProvider;
258 258
 				else $MapType = $_COOKIE['MapType'];
259
-			    ?>
259
+				?>
260 260
 			    <?php
261 261
 				if (isset($globalMapOffline) && $globalMapOffline === TRUE) {
262
-			    ?>
262
+				?>
263 263
 			    <option value="offline"<?php if ($MapType == 'offline') print ' selected'; ?>>Natural Earth (local)</option>
264 264
 			    <?php
265 265
 				} else {
266
-				    if (file_exists(dirname(__FILE__).'/js/Cesium/Assets/Textures/NaturalEarthII/tilemapresource.xml')) {
267
-			    ?>
266
+					if (file_exists(dirname(__FILE__).'/js/Cesium/Assets/Textures/NaturalEarthII/tilemapresource.xml')) {
267
+				?>
268 268
 			    <option value="offline"<?php if ($MapType == 'offline') print ' selected'; ?>>Natural Earth (local)</option>
269 269
 			    <?php
270
-				    }
271
-			    ?>
270
+					}
271
+				?>
272 272
 			    <option value="ArcGIS-Streetmap"<?php if ($MapType == 'ArcGIS-Streetmap') print ' selected'; ?>>ArcGIS Streetmap</option>
273 273
 			    <option value="ArcGIS-Satellite"<?php if ($MapType == 'ArcGIS-Satellite') print ' selected'; ?>>ArcGIS Satellite</option>
274 274
 			    <?php
275
-				    if (isset($globalBingMapKey) && $globalBingMapKey != '') {
276
-			    ?>
275
+					if (isset($globalBingMapKey) && $globalBingMapKey != '') {
276
+				?>
277 277
 			    <option value="Bing-Aerial"<?php if ($MapType == 'Bing-Aerial') print ' selected'; ?>>Bing-Aerial</option>
278 278
 			    <option value="Bing-Hybrid"<?php if ($MapType == 'Bing-Hybrid') print ' selected'; ?>>Bing-Hybrid</option>
279 279
 			    <option value="Bing-Road"<?php if ($MapType == 'Bing-Road') print ' selected'; ?>>Bing-Road</option>
280 280
 			    <?php
281
-				    }
282
-			    ?>
281
+					}
282
+				?>
283 283
 			    <?php
284
-				    if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) {
285
-			    ?>
284
+					if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) {
285
+				?>
286 286
 			    <?php
287 287
 					if (isset($globalHereappId) && $globalHereappId != '' && isset($globalHereappCode) && $globalHereappCode != '') {
288
-			    ?>
288
+				?>
289 289
 			    <option value="Here-Aerial"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Aerial</option>
290 290
 			    <option value="Here-Hybrid"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Hybrid</option>
291 291
 			    <option value="Here-Road"<?php if ($MapType == 'Here') print ' selected'; ?>>Here-Road</option>
292 292
 			    <?php
293 293
 					}
294
-			    ?>
294
+				?>
295 295
 			    <?php
296 296
 					if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '') {
297
-			    ?>
297
+				?>
298 298
 			    <option value="Google-Roadmap"<?php if ($MapType == 'Google-Roadmap') print ' selected'; ?>>Google Roadmap</option>
299 299
 			    <option value="Google-Satellite"<?php if ($MapType == 'Google-Satellite') print ' selected'; ?>>Google Satellite</option>
300 300
 			    <option value="Google-Hybrid"<?php if ($MapType == 'Google-Hybrid') print ' selected'; ?>>Google Hybrid</option>
301 301
 			    <option value="Google-Terrain"<?php if ($MapType == 'Google-Terrain') print ' selected'; ?>>Google Terrain</option>
302 302
 			    <?php
303 303
 					}
304
-			    ?>
304
+				?>
305 305
 			    <?php
306 306
 					if (isset($globalMapQuestKey) && $globalMapQuestKey != '') {
307
-			    ?>
307
+				?>
308 308
 			    <option value="MapQuest-OSM"<?php if ($MapType == 'MapQuest-OSM') print ' selected'; ?>>MapQuest-OSM</option>
309 309
 			    <option value="MapQuest-Aerial"<?php if ($MapType == 'MapQuest-Aerial') print ' selected'; ?>>MapQuest-Aerial</option>
310 310
 			    <option value="MapQuest-Hybrid"<?php if ($MapType == 'MapQuest-Hybrid') print ' selected'; ?>>MapQuest-Hybrid</option>
311 311
 			    <?php
312 312
 					}
313
-			    ?>
313
+				?>
314 314
 			    <option value="Yandex"<?php if ($MapType == 'Yandex') print ' selected'; ?>>Yandex</option>
315 315
 			    <option value="offline"<?php if ($MapType == 'offline') print ' selected'; ?>>Natural Earth</option>
316 316
 			    <?php
317
-				    }
318
-			    ?>
317
+					}
318
+				?>
319 319
 			    <option value="NatGeo-Street"<?php if ($MapType == 'NatGeo-Street') print ' selected'; ?>>National Geographic Street</option>
320 320
 			    <?php
321
-				    if (isset($globalMapboxToken) && $globalMapboxToken != '') {
321
+					if (isset($globalMapboxToken) && $globalMapboxToken != '') {
322 322
 					if (!isset($_COOKIE['MapTypeId'])) $MapBoxId = 'default';
323 323
 					else $MapBoxId = $_COOKIE['MapTypeId'];
324
-			    ?>
324
+				?>
325 325
 			    <option value="MapboxGL"<?php if ($MapType == 'MapboxGL') print ' selected'; ?>>Mapbox GL</option>
326 326
 			    <option value="Mapbox-default"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'default') print ' selected'; ?>>Mapbox default</option>
327 327
 			    <option value="Mapbox-mapbox.streets"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.streets') print ' selected'; ?>>Mapbox streets</option>
@@ -336,16 +336,16 @@  discard block
 block discarded – undo
336 336
 			    <option value="Mapbox-mapbox.pirates"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.pirates') print ' selected'; ?>>Mapbox pirates</option>
337 337
 			    <option value="Mapbox-mapbox.emerald"<?php if ($MapType == 'Mapbox' && $MapBoxId == 'mapbox.emerald') print ' selected'; ?>>Mapbox emerald</option>
338 338
 			    <?php
339
-				    }
340
-			    ?>
339
+					}
340
+				?>
341 341
 			    <option value="OpenStreetMap"<?php if ($MapType == 'OpenStreetMap') print ' selected'; ?>>OpenStreetMap</option>
342 342
 			    <?php
343 343
 				}
344
-			    ?>
344
+				?>
345 345
 			</select>
346 346
 		    </li>
347 347
 <?php
348
-    if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d' && (!isset($globalMapOffline) || $globalMapOffline === FALSE)) {
348
+	if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d' && (!isset($globalMapOffline) || $globalMapOffline === FALSE)) {
349 349
 ?>
350 350
 		    <li><?php echo _("Type of Terrain:"); ?>
351 351
 			<select  class="selectpicker" onchange="terrainType(this);">
@@ -356,10 +356,10 @@  discard block
 block discarded – undo
356 356
 			</select>
357 357
 		    </li>
358 358
 <?php
359
-    }
359
+	}
360 360
 ?>
361 361
 <?php
362
-    if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') {
362
+	if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') {
363 363
 ?>
364 364
 		    <li><div class="checkbox"><label><input type="checkbox" name="display2dbuildings" value="1" onclick="clickDisplay2DBuildings(this)" <?php if (isset($_COOKIE['Map2DBuildings']) && $_COOKIE['Map2DBuildings'] == 'true') print 'checked'; ?> ><?php echo _("Display 2.5D buidings on map"); ?></label></div></li>
365 365
 
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
 		    <li><div class="checkbox"><label><input type="checkbox" name="satelliteestimation" value="1" onclick="clickSatelliteEstimation(this)" <?php if ((isset($_COOKIE['satelliteestimation']) && $_COOKIE['satelliteestimation'] == 'true') || (!isset($_COOKIE['satelliteestimation']) && !isset($globalMapEstimation)) || (!isset($_COOKIE['satelliteestimation']) && isset($globalMapEstimation) && $globalMapEstimation)) print 'checked'; ?> ><?php echo _("Satellites animate between updates"); ?></label></div></li>
383 383
 <?php
384 384
 	}
385
-    }
385
+	}
386 386
 ?>
387 387
 		    <li><div class="checkbox"><label><input type="checkbox" name="displayairports" value="1" onclick="clickDisplayAirports(this)" <?php if (isset($_COOKIE['displayairports']) && $_COOKIE['displayairports'] == 'true' || !isset($_COOKIE['displayairports'])) print 'checked'; ?> ><?php echo _("Display airports on map"); ?></label></div></li>
388 388
 		    <li><div class="checkbox"><label><input type="checkbox" name="displaygroundstation" value="1" onclick="clickDisplayGroundStation(this)" <?php if ((isset($_COOKIE['show_GroundStation']) && $_COOKIE['show_GroundStation'] == 'true') || (!isset($_COOKIE['show_GroundStation']) && (isset($globalMapGroundStation) && $globalMapGroundStation === TRUE))) print 'checked'; ?> ><?php echo _("Display ground station on map"); ?></label></div></li>
@@ -401,80 +401,80 @@  discard block
 block discarded – undo
401 401
 	}
402 402
 ?>
403 403
 <?php
404
-    if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') {
404
+	if (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] == '3d') {
405 405
 ?>
406 406
 		    <li><div class="checkbox"><label><input type="checkbox" name="displayminimap" value="1" onclick="clickDisplayMinimap(this)" <?php if (!isset($_COOKIE['displayminimap']) || (isset($_COOKIE['displayminimap']) && $_COOKIE['displayminimap'] == 'true')) print 'checked'; ?> ><?php echo _("Show mini-map"); ?></label></div></li>
407 407
 		    <li><div class="checkbox"><label><input type="checkbox" name="one3dmodel" value="1" onclick="useOne3Dmodel(this)" <?php if ((isset($_COOKIE['one3dmodel']) && $_COOKIE['one3dmodel'] == 'true') || (!isset($_COOKIE['one3dmodel']) && isset($globalMap3DOneModel) && $globalMap3DOneModel)) print 'checked'; ?> ><?php echo _("Use same 3D model for all aircraft (use fewer resources)"); ?></label></div></li>
408 408
 <?php
409
-    }
410
-    if (time() > mktime(0,0,0,12,1,date("Y")) && time() < mktime(0,0,0,12,31,date("Y"))) {
409
+	}
410
+	if (time() > mktime(0,0,0,12,1,date("Y")) && time() < mktime(0,0,0,12,31,date("Y"))) {
411 411
 ?>
412 412
 		    <li><div class="checkbox"><label><input type="checkbox" name="displaysanta" value="1" onclick="clickSanta(this)"><i class="fa fa-snowflake-o" aria-hidden="true"></i> <?php echo _("Show Santa Claus now"); ?> <i class="fa fa-snowflake-o" aria-hidden="true"></i></label></div></li>
413 413
 <?php
414
-    }
414
+	}
415 415
 ?>
416 416
 		    <?php
417 417
 			if (function_exists('array_column')) {
418
-			    if (array_search(TRUE, array_column($globalSources, 'sourcestats')) !== FALSE) {
419
-		    ?>
418
+				if (array_search(TRUE, array_column($globalSources, 'sourcestats')) !== FALSE) {
419
+			?>
420 420
 		    <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) print 'checked'; ?> ><?php echo _("Display polar on map"); ?></label></div></li>
421 421
 		    <?php
422
-			    }
422
+				}
423 423
 			} elseif (isset($globalSources)) {
424
-			    $dispolar = false;
425
-			    foreach ($globalSources as $testsource) {
426
-			        if (isset($globalSources['sourcestats']) && $globalSources['sourcestats'] !== FALSE) $dispolar = true;
427
-			    }
428
-			    if ($dispolar) {
429
-		    ?>
424
+				$dispolar = false;
425
+				foreach ($globalSources as $testsource) {
426
+					if (isset($globalSources['sourcestats']) && $globalSources['sourcestats'] !== FALSE) $dispolar = true;
427
+				}
428
+				if ($dispolar) {
429
+			?>
430 430
 		    <li><div class="checkbox"><label><input type="checkbox" name="flightpolar" value="1" onclick="clickPolar(this)" <?php if ((isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) print 'checked'; ?> ><?php echo _("Display polar on map"); ?></label></div></li>
431 431
 		    <?php
432
-			    }
433
-		        }
434
-		    ?>
432
+				}
433
+				}
434
+			?>
435 435
 <?php
436
-    if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') {
436
+	if (!isset($_COOKIE['MapFormat']) || $_COOKIE['MapFormat'] != '3d') {
437 437
 ?>
438 438
 
439 439
 		    <?php
440 440
 			if (!isset($globalAircraft) || $globalAircraft === TRUE) {
441
-		    	    if (extension_loaded('gd') && function_exists('gd_info')) {
442
-		    ?>
441
+					if (extension_loaded('gd') && function_exists('gd_info')) {
442
+			?>
443 443
 		    <li><input type="checkbox" name="aircraftcoloraltitude" value="1" onclick="iconColorAltitude(this)" <?php if (isset($_COOKIE['IconColorAltitude']) && $_COOKIE['IconColorAltitude'] == 'true') print 'checked'; ?> ><?php echo _("Aircraft icon color based on altitude"); ?></li>
444 444
 		    <?php 
445 445
 				if (!isset($_COOKIE['IconColorAltitude']) || $_COOKIE['IconColorAltitude'] == 'false') {
446
-		    ?>
446
+			?>
447 447
 			<li><?php echo _("Aircraft icon color:"); ?><input type="color" name="aircraftcolor" id="html5colorpicker" onchange="iconColor(aircraftcolor.value);" value="#<?php if (isset($_COOKIE['IconColor'])) print $_COOKIE['IconColor']; elseif (isset($globalAircraftIconColor)) print $globalAircraftIconColor; else print '1a3151'; ?>"></li>
448 448
 		    <?php
449 449
 				}
450
-			    }
451
-		        }
452
-		    ?>
450
+				}
451
+				}
452
+			?>
453 453
 		    <?php
454 454
 			if (isset($globalMarine) && $globalMarine === TRUE) {
455
-			    if (extension_loaded('gd') && function_exists('gd_info')) {
456
-		    ?>
455
+				if (extension_loaded('gd') && function_exists('gd_info')) {
456
+			?>
457 457
 		    <li><?php echo _("Marine icon color:"); ?>
458 458
 			<input type="color" name="marinecolor" id="html5colorpicker" onchange="MarineiconColor(marinecolor.value);" value="#<?php if (isset($_COOKIE['MarineIconColor'])) print $_COOKIE['MarineIconColor']; elseif (isset($globalMarineIconColor)) print $globalMarineIconColor; else print '1a3151'; ?>">
459 459
 		    </li>
460 460
 		    <?php
461
-			    }
462
-		        }
463
-		    ?>
461
+				}
462
+				}
463
+			?>
464 464
 		    <?php
465 465
 			if (isset($globalTracker) && $globalTracker === TRUE) {
466
-			    if (extension_loaded('gd') && function_exists('gd_info')) {
467
-		    ?>
466
+				if (extension_loaded('gd') && function_exists('gd_info')) {
467
+			?>
468 468
 		    <li><?php echo _("Tracker icon color:"); ?>
469 469
 			<input type="color" name="trackercolor" id="html5colorpicker" onchange="TrackericonColor(trackercolor.value);" value="#<?php if (isset($_COOKIE['TrackerIconColor'])) print $_COOKIE['TrackerIconColor']; elseif (isset($globalTrackerIconColor)) print $globalTrackerIconColor; else print '1a3151'; ?>">
470 470
 		    </li>
471 471
 		    <?php
472
-			    }
473
-		        }
474
-		    ?>
472
+				}
473
+				}
474
+			?>
475 475
 		    <?php
476 476
 			if (!isset($globalAircraft) || $globalAircraft === TRUE) {
477
-		    ?>
477
+			?>
478 478
 		    <li><?php echo _("Show airport icon at zoom level:"); ?>
479 479
 			<div class="range">
480 480
 			    <input type="range" min="0" max="19" step="1" name="airportzoom" onchange="range.value=value;airportDisplayZoom(airportzoom.value);" value="<?php if (isset($_COOKIE['AirportZoom'])) print $_COOKIE['AirportZoom']; elseif (isset($globalAirportZoom)) print $globalAirportZoom; else print '7'; ?>">
@@ -483,9 +483,9 @@  discard block
 block discarded – undo
483 483
 		    </li>
484 484
 		    <?php
485 485
 			}
486
-		    ?>
486
+			?>
487 487
 <?php
488
-    } elseif (isset($_COOKIE['MapFormat']) || $_COOKIE['MapFOrmat'] == '3d') {
488
+	} elseif (isset($_COOKIE['MapFormat']) || $_COOKIE['MapFOrmat'] == '3d') {
489 489
 ?>
490 490
 <?php
491 491
 	if (!isset($globalAircraft) || $globalAircraft === TRUE) {
@@ -517,7 +517,7 @@  discard block
 block discarded – undo
517 517
 		    </li>
518 518
 <?php
519 519
 	}
520
-    }
520
+	}
521 521
 ?>
522 522
 		    <li><?php echo _("Distance unit:"); ?>
523 523
 			<select class="selectpicker" onchange="unitdistance(this);">
@@ -550,19 +550,19 @@  discard block
 block discarded – undo
550 550
 		    <ul>
551 551
 		    <?php
552 552
 			if (!isset($globalAircraft) || $globalAircraft) {
553
-		    ?>
553
+			?>
554 554
 		    <?php
555 555
 			if (((isset($globalVATSIM) && $globalVATSIM) || isset($globalIVAO) && $globalIVAO || isset($globalphpVMS) && $globalphpVMS) && (!isset($globalMapVAchoose) || $globalMapVAchoose)) {
556
-		    ?>
556
+			?>
557 557
 			<?php if (isset($globalVATSIM) && $globalVATSIM) { ?><li><input type="checkbox" name="vatsim" value="1" onclick="clickVATSIM(this)" <?php if ((isset($_COOKIE['ShowVATSIM']) && $_COOKIE['ShowVATSIM'] == 'true') || !isset($_COOKIE['ShowVATSIM'])) print 'checked'; ?> ><?php echo _("Display VATSIM data"); ?></li><?php } ?>
558 558
 			<?php if (isset($globalIVAO) && $globalIVAO) { ?><li><input type="checkbox" name="ivao" value="1" onclick="clickIVAO(this)" <?php if ((isset($_COOKIE['ShowIVAO']) && $_COOKIE['ShowIVAO'] == 'true') || !isset($_COOKIE['ShowIVAO'])) print 'checked'; ?> ><?php echo _("Display IVAO data"); ?></li><?php } ?>
559 559
 			<?php if (isset($globalphpVMS) && $globalphpVMS) { ?><li><input type="checkbox" name="phpvms" value="1" onclick="clickphpVMS(this)" <?php if ((isset($_COOKIE['ShowVMS']) && $_COOKIE['ShowVMS'] == 'true') || !isset($_COOKIE['ShowVMS'])) print 'checked'; ?> ><?php echo _("Display phpVMS data"); ?></li><?php } ?>
560 560
 		    <?php
561 561
 			}
562
-		    ?>
562
+			?>
563 563
 		    <?php
564 564
 			if (!(isset($globalVA) && $globalVA) && !(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalIVAO) && $globalIVAO) && !(isset($globalphpVMS) && $globalphpVMS) && isset($globalSBS1) && $globalSBS1 && isset($globalAPRS) && $globalAPRS && (!isset($globalMapchoose) || $globalMapchoose)) {
565
-		    ?>
565
+			?>
566 566
 			<?php if (isset($globalSBS1) && $globalSBS1) { ?>
567 567
 			    <li><div class="checkbox"><label><input type="checkbox" name="sbs" value="1" onclick="clickSBS1(this)" <?php if ((isset($_COOKIE['ShowSBS1']) && $_COOKIE['ShowSBS1'] == 'true') || !isset($_COOKIE['ShowSBS1'])) print 'checked'; ?> ><?php echo _("Display ADS-B data"); ?></label></div></li>
568 568
 			<?php } ?>
@@ -571,7 +571,7 @@  discard block
 block discarded – undo
571 571
 			<?php } ?>
572 572
 		    <?php
573 573
 			}
574
-		    ?>
574
+			?>
575 575
 		    <li><?php echo _("Display airlines:"); ?>
576 576
 		    <br/>
577 577
 			<select class="selectpicker" multiple onchange="airlines(this);" id="display_airlines">
@@ -591,14 +591,14 @@  discard block
 block discarded – undo
591 591
 						echo '<option value="'.$airline['airline_icao'].'">'.$airline_name.'</option>';
592 592
 					}
593 593
 				}
594
-			    ?>
594
+				?>
595 595
 			</select>
596 596
 		    </li>
597 597
 		    <?php
598 598
 			$Spotter = new Spotter();
599 599
 			$allalliancenames = $Spotter->getAllAllianceNames();
600 600
 			if (!empty($allalliancenames)) {
601
-		    ?>
601
+			?>
602 602
 		    <li><?php echo _("Display alliance:"); ?>
603 603
 		    <br/>
604 604
 			<select class="selectpicker" onchange="alliance(this);" id="display_alliance">
@@ -612,18 +612,18 @@  discard block
 block discarded – undo
612 612
 						echo '<option value="'.$alliance_name.'">'.$alliance_name.'</option>';
613 613
 					}
614 614
 				}
615
-			    ?>
615
+				?>
616 616
 			</select>
617 617
 		    </li>
618 618
 		    <?php
619 619
 			}
620
-		    ?>
620
+			?>
621 621
 		    <?php
622 622
 			}
623
-		    ?>
623
+			?>
624 624
 		    <?php
625 625
 			if (isset($globalAPRS) && $globalAPRS) {
626
-		    ?>
626
+			?>
627 627
 		    <li><?php echo _("Display APRS sources name:"); ?>
628 628
 			<select class="selectpicker" multiple onchange="sources(this);">
629 629
 			    <?php
@@ -647,18 +647,18 @@  discard block
 block discarded – undo
647 647
 						echo '<option value="'.$src['name'].'">'.$src['name'].'</option>';
648 648
 					}
649 649
 				}
650
-			    ?>
650
+				?>
651 651
 			</select>
652 652
 		    </li>
653 653
 		    <?php
654 654
 			}
655
-		    ?>
655
+			?>
656 656
 		    <?php
657 657
 			if (!isset($globalAircraft) || $globalAircraft) {
658
-		    ?>
658
+			?>
659 659
 		    <?php
660
-			    if (!(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalIVAO) && $globalIVAO) && !(isset($globalphpVMS) && $globalphpVMS)) {
661
-		    ?>
660
+				if (!(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalIVAO) && $globalIVAO) && !(isset($globalphpVMS) && $globalphpVMS)) {
661
+			?>
662 662
 		    <li><?php echo _("Display airlines of type:"); ?><br/>
663 663
 			<select class="selectpicker" onchange="airlinestype(this);">
664 664
 			    <option value="all"<?php if (!isset($_COOKIE['filter_airlinestype']) || $_COOKIE['filter_airlinestype'] == 'all' || $_COOKIE['filter_airlinestype'] == '') echo ' selected'; ?>><?php echo _("All"); ?></option>
@@ -668,21 +668,21 @@  discard block
 block discarded – undo
668 668
 			</select>
669 669
 		    </li>
670 670
 		    <?php
671
-			    }
672
-		    ?>
671
+				}
672
+			?>
673 673
 		    <?php
674 674
 			}
675
-		    ?>
675
+			?>
676 676
 		    <?php
677 677
 			if (isset($globalMarine) && $globalMarine) {
678
-		    ?>
678
+			?>
679 679
 		    <li>
680 680
 			<?php echo _("Display vessels with MMSI:"); ?>
681 681
 			<input type="text" name="mmsifilter" onchange="mmsifilter();" id="mmsifilter" value="<?php if (isset($_COOKIE['filter_mmsi'])) print $_COOKIE['filter_mmsi']; ?>" />
682 682
 		    </li>
683 683
 		    <?php
684 684
 			}
685
-		    ?>
685
+			?>
686 686
 		    <li>
687 687
 			<?php echo _("Display with ident:"); ?>
688 688
 			<input type="text" name="identfilter" onchange="identfilter();" id="identfilter" value="<?php if (isset($_COOKIE['filter_ident'])) print $_COOKIE['filter_ident']; ?>" />
@@ -695,7 +695,7 @@  discard block
 block discarded – undo
695 695
 	    </form>
696 696
     	</div>
697 697
 <?php
698
-    if (isset($globalSatellite) && $globalSatellite) {
698
+	if (isset($globalSatellite) && $globalSatellite) {
699 699
 ?>
700 700
         <div class="sidebar-pane" id="satellites">
701 701
 	    <h1 class="sidebar-header"><?php echo _("Satellites"); ?><span class="sidebar-close"><i class="fa fa-caret-left"></i></span></h1>
@@ -735,14 +735,14 @@  discard block
 block discarded – undo
735 735
 						print '<option value="'.$type['tle_type'].'">'.$type_name.'</option>';
736 736
 					}
737 737
 				}
738
-			    ?>
738
+				?>
739 739
 			</select>
740 740
 		    </li>
741 741
 		</ul>
742 742
 	    </form>
743 743
 	</div>
744 744
 <?php
745
-    }
745
+	}
746 746
 ?>
747 747
     </div>
748 748
 </div>
Please login to merge, or discard this patch.
header.php 1 patch
Indentation   +74 added lines, -74 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 // When button "Remove all filters" is clicked
39 39
 if (isset($_POST['removefilters'])) {
40 40
 	$allfilters = array_filter(array_keys($_COOKIE),function($key) {
41
-	    return strpos($key,'filter_') === 0;
41
+		return strpos($key,'filter_') === 0;
42 42
 	});
43 43
 	foreach ($allfilters as $filt) {
44 44
 		unset($_COOKIE[$filt]);
@@ -404,34 +404,34 @@  discard block
 block discarded – undo
404 404
 
405 405
       <ul class="nav navbar-nav">
406 406
 <?php
407
-    if (isset($globalNewsFeeds['global']) && !empty($globalNewsFeeds['global'])) {
407
+	if (isset($globalNewsFeeds['global']) && !empty($globalNewsFeeds['global'])) {
408 408
 ?>
409 409
     <li><a href="<?php print $globalURL; ?>/news"><?php echo _("News"); ?></a></li>
410 410
 <?php
411
-    }
411
+	}
412 412
 ?>
413 413
 
414 414
 <?php 
415
-    $sub = false;
416
-    if (
415
+	$sub = false;
416
+	if (
417 417
 	(
418
-	    (!isset($globalAircraft) || (isset($globalAircraft) && $globalAircraft === TRUE)) && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalTracker) && $globalTracker === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE))
418
+		(!isset($globalAircraft) || (isset($globalAircraft) && $globalAircraft === TRUE)) && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalTracker) && $globalTracker === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE))
419 419
 	) || 
420 420
 	(
421
-	    isset($globalMarine) && $globalMarine === TRUE && ((isset($globalTracker) && $globalTracker === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE))
421
+		isset($globalMarine) && $globalMarine === TRUE && ((isset($globalTracker) && $globalTracker === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE))
422 422
 	) || 
423 423
 	(
424
-	    isset($globalTracker) && $globalTracker === TRUE && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE))
424
+		isset($globalTracker) && $globalTracker === TRUE && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE))
425 425
 	) || 
426 426
 	(
427
-	    isset($globalSatellite) && $globalSatellite === TRUE && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalTracker) && $globalTracker === TRUE))
427
+		isset($globalSatellite) && $globalSatellite === TRUE && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalTracker) && $globalTracker === TRUE))
428 428
 	)
429
-    ) {
429
+	) {
430 430
 	$sub = true;
431
-    }
431
+	}
432 432
 ?>
433 433
 <?php
434
-    if (!isset($globalAircraft) || $globalAircraft === TRUE) {
434
+	if (!isset($globalAircraft) || $globalAircraft === TRUE) {
435 435
 ?>
436 436
     <li class="dropdown">
437 437
 <?php
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
 	<ul class="dropdown-menu multi-level">
443 443
       	<li class="dropdown-submenu">
444 444
 <?php
445
-        }
445
+		}
446 446
 ?>
447 447
 <?php
448 448
 	if (isset($globalNewsFeeds['aircraft']) && !empty($globalNewsFeeds['aircraft'])) {
@@ -457,25 +457,25 @@  discard block
 block discarded – undo
457 457
           <ul class="dropdown-menu">
458 458
           	<li><a href="<?php print $globalURL; ?>/aircraft"><?php echo _("Aircraft Types"); ?></a></li>
459 459
 <?php
460
-    if (!isset($globalNoAirlines) || $globalNoAirlines === FALSE) {
460
+	if (!isset($globalNoAirlines) || $globalNoAirlines === FALSE) {
461 461
 ?>
462 462
 			<li><a href="<?php print $globalURL; ?>/airline"><?php echo _("Airlines"); ?></a></li>
463 463
 <?php
464
-    }
464
+	}
465 465
 ?>
466 466
 			<li><a href="<?php print $globalURL; ?>/airport"><?php echo _("Airports"); ?></a></li>
467 467
 <?php
468
-    if ((isset($globalUseOwner) && $globalUseOwner) || (!isset($globalUseOwner) && (!isset($globalVA) || !$globalVA) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS) && (!isset($globalVAM) || !$globalVAM))) {
468
+	if ((isset($globalUseOwner) && $globalUseOwner) || (!isset($globalUseOwner) && (!isset($globalVA) || !$globalVA) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS) && (!isset($globalVAM) || !$globalVAM))) {
469 469
 ?>
470 470
 			<li><a href="<?php print $globalURL; ?>/owner"><?php echo _("Owners"); ?></a></li>
471 471
 <?php
472
-    } 
473
-    if ((isset($globalUsePilot) && $globalUsePilot) || !isset($globalUsePilot) && ((isset($globalVA) && $globalVA) || (isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS) || (isset($globalVAM) && $globalVAM))) {
472
+	} 
473
+	if ((isset($globalUsePilot) && $globalUsePilot) || !isset($globalUsePilot) && ((isset($globalVA) && $globalVA) || (isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS) || (isset($globalVAM) && $globalVAM))) {
474 474
 
475 475
 ?>
476 476
 			<li><a href="<?php print $globalURL; ?>/pilot"><?php echo _("Pilots"); ?></a></li>
477 477
 <?php
478
-    }
478
+	}
479 479
 ?>
480 480
 			<li><hr /></li>
481 481
             <li><a href="<?php print $globalURL; ?>/currently"><?php echo _("Current Activity"); ?></a></li>
@@ -483,43 +483,43 @@  discard block
 block discarded – undo
483 483
             <li><a href="<?php print $globalURL; ?>/date/<?php print date("Y-m-d"); ?>"><?php echo _("Today's Activity"); ?></a></li>
484 484
             <li><a href="<?php print $globalURL; ?>/newest"><?php echo _("Newest by Category"); ?></a></li>
485 485
             <?php
486
-        	if ($globalACARS) {
487
-        	    if (isset($globalDemo) && $globalDemo) {
488
-    	    ?>
486
+			if ($globalACARS) {
487
+				if (isset($globalDemo) && $globalDemo) {
488
+			?>
489 489
             <li><hr /></li>
490 490
             <li><i><?php echo _('ACARS data not available publicly'); ?></i></li>
491 491
             <li><a href=""><?php echo _('Latest ACARS messages'); ?></a></li>
492 492
             <li><a href=""><?php echo _('Archive ACARS messages'); ?></a></li>
493 493
             <?php
494
-        	    } else {
495
-    	    ?>
494
+				} else {
495
+			?>
496 496
             <li><hr /></li>
497 497
             <li><a href="<?php print $globalURL; ?>/acars-latest"><?php echo _("Latest ACARS messages"); ?></a></li>
498 498
             <li><a href="<?php print $globalURL; ?>/acars-archive"><?php echo _("Archive ACARS messages"); ?></a></li>
499 499
             <?php
500
-        	    }
501
-        	}
502
-    	    ?>
500
+				}
501
+			}
502
+			?>
503 503
     	    <?php
504
-    	        if (isset($globalAccidents) && $globalAccidents) {
505
-    	    ?>
504
+				if (isset($globalAccidents) && $globalAccidents) {
505
+			?>
506 506
             <li><hr /></li>
507 507
             <li><a href="<?php print $globalURL; ?>/accident-latest"><?php echo _("Latest accident"); ?></a></li>
508 508
             <li><a href="<?php print $globalURL; ?>/accident/<?php print date("Y-m-d"); ?>"><?php echo _("Today's Accident"); ?></a></li>
509 509
             <li><a href="<?php print $globalURL; ?>/incident-latest"><?php echo _("Latest incident"); ?></a></li>
510 510
             <li><a href="<?php print $globalURL; ?>/incident/<?php print date("Y-m-d"); ?>"><?php echo _("Today's Incident"); ?></a></li>
511 511
             <?php
512
-        	}
513
-    	    ?>
512
+			}
513
+			?>
514 514
             <li><hr /></li>
515 515
             <li><a href="<?php print $globalURL; ?>/highlights/table"><?php echo _("Special Highlights"); ?></a></li>
516 516
             <?php
517 517
 		if (!isset($globalNoUpcoming) || $globalNoUpcoming === FALSE) {
518
-	    ?>
518
+		?>
519 519
             <li><a href="<?php print $globalURL; ?>/upcoming"><?php echo _("Upcoming Flights"); ?></a></li>
520 520
 	    <?php
521 521
 		}
522
-	    ?>
522
+		?>
523 523
           </ul>
524 524
         </li>
525 525
       	<li><a href="<?php print $globalURL; ?>/search"><?php echo _("Search"); ?></a></li>
@@ -546,14 +546,14 @@  discard block
 block discarded – undo
546 546
     </ul>
547 547
 <?php
548 548
 	}
549
-    }
549
+	}
550 550
 ?>
551 551
 <?php
552
-    if (isset($globalMarine) && $globalMarine) {
552
+	if (isset($globalMarine) && $globalMarine) {
553 553
 ?>
554 554
     <li class="dropdown">
555 555
 <?php
556
-        if ($sub) {
556
+		if ($sub) {
557 557
 ?>
558 558
     <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Marines"); ?> <b class="caret"></b></a>
559 559
 	<ul class="dropdown-menu multi-level">
@@ -587,14 +587,14 @@  discard block
 block discarded – undo
587 587
 	}
588 588
 ?>
589 589
 <?php
590
-    }
590
+	}
591 591
 ?>
592 592
 <?php
593
-    if (isset($globalTracker) && $globalTracker) {
593
+	if (isset($globalTracker) && $globalTracker) {
594 594
 ?>
595 595
     <li class="dropdown">
596 596
 <?php
597
-        if ($sub) {
597
+		if ($sub) {
598 598
 ?>
599 599
     <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Trackers"); ?> <b class="caret"></b></a>
600 600
 	<ul class="dropdown-menu multi-level">
@@ -628,14 +628,14 @@  discard block
 block discarded – undo
628 628
 	}
629 629
 ?>
630 630
 <?php
631
-    }
631
+	}
632 632
 ?>
633 633
 <?php
634
-    if (isset($globalSatellite) && $globalSatellite) {
634
+	if (isset($globalSatellite) && $globalSatellite) {
635 635
 ?>
636 636
     <li class="dropdown">
637 637
 <?php
638
-        if ($sub) {
638
+		if ($sub) {
639 639
 ?>
640 640
     <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Satellites"); ?> <b class="caret"></b></a>
641 641
 	<ul class="dropdown-menu multi-level">
@@ -671,7 +671,7 @@  discard block
 block discarded – undo
671 671
 	}
672 672
 ?>
673 673
 <?php
674
-    }
674
+	}
675 675
 ?>
676 676
 
677 677
         <li class="dropdown">
@@ -680,12 +680,12 @@  discard block
 block discarded – undo
680 680
           	<li><a href="<?php print $globalURL; ?>/about"><?php echo _("About The Project"); ?></a></li>
681 681
           	<li><a href="<?php print $globalURL; ?>/about/export"><?php echo _("Exporting Data"); ?></a></li>
682 682
 <?php
683
-    if (!isset($globalAircraft) || $globalAircraft === TRUE) {
683
+	if (!isset($globalAircraft) || $globalAircraft === TRUE) {
684 684
 ?>
685 685
 		<li><hr /></li>
686 686
 		<li><a href="<?php print $globalURL; ?>/about/tv"><?php echo _("Spotter TV"); ?></a></li>
687 687
 <?php
688
-    }
688
+	}
689 689
 ?>
690 690
 	    <?php if (isset($globalContribute) && $globalContribute) { ?>
691 691
                 <li><hr /></li>
@@ -709,13 +709,13 @@  discard block
 block discarded – undo
709 709
   	    <form>
710 710
   		<select class="selectpicker" data-width="120px" onchange="language(this);">
711 711
   		    <?php
712
-  		        foreach ($alllang as $key => $lang) {
713
-  		            print '<option value="'.$key.'"';
714
-  		            if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) print ' selected ';
715
-  		            if ($lang[0] == 'Deutsch') print '>'.$lang[0].' (&beta;eta)</option>';
716
-  		            else print '>'.$lang[0].'</option>';
717
-  		        }
718
-  		    ?>
712
+  				foreach ($alllang as $key => $lang) {
713
+  					print '<option value="'.$key.'"';
714
+  					if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) print ' selected ';
715
+  					if ($lang[0] == 'Deutsch') print '>'.$lang[0].' (&beta;eta)</option>';
716
+  					else print '>'.$lang[0].'</option>';
717
+  				}
718
+  			?>
719 719
   		</select>
720 720
   	    </form>
721 721
   	</div>
@@ -748,18 +748,18 @@  discard block
 block discarded – undo
748 748
 ?>
749 749
     <div class="top-header clear" role="main">
750 750
 <?php
751
-    if (isset($longitude) && isset($latitude) && $longitude != 0 && $latitude != 0) {
751
+	if (isset($longitude) && isset($latitude) && $longitude != 0 && $latitude != 0) {
752 752
 ?>
753 753
     <div id="archive-map"></div>
754 754
 <?php
755
-    }
755
+	}
756 756
 ?>
757 757
     </div>
758 758
 <?php
759 759
 }
760 760
 if ((strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false) || (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false))
761 761
 {
762
-    ?>
762
+	?>
763 763
     <div class="top-header clear" role="main">
764 764
         <div id="map"></div>
765 765
 	<link rel="stylesheet" href="<?php print $globalURL; ?>/css/leaflet.css" />
@@ -770,15 +770,15 @@  discard block
 block discarded – undo
770 770
         var zoom = 13;
771 771
 //create the map
772 772
 <?php
773
-    if (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($airport_array[0]['latitude'])) {
773
+	if (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($airport_array[0]['latitude'])) {
774 774
 ?>
775 775
   map = L.map('map', { zoomControl:true }).setView([<?php print $airport_array[0]['latitude']; ?>,<?php print $airport_array[0]['longitude']; ?>], zoom);
776 776
 <?php
777
-    } elseif (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false) {
777
+	} elseif (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false) {
778 778
 ?>
779 779
   map = L.map('map', { zoomControl:true });
780 780
 <?php
781
-    } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($spotter_array[0]['departure_airport_latitude'])) {
781
+	} elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($spotter_array[0]['departure_airport_latitude'])) {
782 782
 ?>
783 783
   map = L.map('map', { zoomControl:true }).setView([<?php print $spotter_array[0]['departure_airport_latitude']; ?>,<?php print $spotter_array[0]['arrival_airport_longitude']; ?>]);
784 784
     var line = L.polyline([[<?php print $spotter_array[0]['departure_airport_latitude']; ?>, <?php print $spotter_array[0]['departure_airport_longitude']; ?>],[<?php print $spotter_array[0]['arrival_airport_latitude']; ?>, <?php print $spotter_array[0]['arrival_airport_longitude']; ?>]]).addTo(map);
@@ -786,22 +786,22 @@  discard block
 block discarded – undo
786 786
     var departure_airport = L.marker([<?php print $spotter_array[0]['departure_airport_latitude']; ?>, <?php print $spotter_array[0]['departure_airport_longitude']; ?>], {icon: L.icon({iconUrl: '<?php print $globalURL; ?>/images/departure_airport.png',iconSize: [16,18],iconAnchor: [8,16]})}).addTo(map);
787 787
     var arrival_airport = L.marker([<?php print $spotter_array[0]['arrival_airport_latitude']; ?>, <?php print $spotter_array[0]['arrival_airport_longitude']; ?>], {icon: L.icon({iconUrl: '<?php print $globalURL; ?>/images/arrival_airport.png',iconSize: [16,18],iconAnchor: [8,16]})}).addTo(map);
788 788
 <?php
789
-    } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && !isset($spotter_array[0]['departure_airport_latitude']) && isset($spotter_array[0]['latitude'])) {
789
+	} elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && !isset($spotter_array[0]['departure_airport_latitude']) && isset($spotter_array[0]['latitude'])) {
790 790
 ?>
791 791
   map = L.map('map', { zoomControl:true }).setView([<?php print $spotter_array[0]['latitude']; ?>,<?php print $spotter_array[0]['longitude']; ?>]);
792 792
 <?php
793
-    } elseif (!isset($spotter_array[0]['latitude']) && !isset($spotter_array[0]['longitude'])) {
793
+	} elseif (!isset($spotter_array[0]['latitude']) && !isset($spotter_array[0]['longitude'])) {
794 794
 ?>
795 795
   map = L.map('map', { zoomControl:true });
796 796
 <?php
797
-    }
797
+	}
798 798
 ?>
799 799
   //initialize the layer group for the aircrft markers
800 800
   var layer_data = L.layerGroup();
801 801
 
802 802
   //a few title layers
803 803
 <?php
804
-    if ($globalMapProvider == 'Mapbox') {
804
+	if ($globalMapProvider == 'Mapbox') {
805 805
 ?>
806 806
   L.tileLayer('https://{s}.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={token}', {
807 807
     maxZoom: 18,
@@ -812,14 +812,14 @@  discard block
 block discarded – undo
812 812
     token : '<?php print $globalMapboxToken; ?>'
813 813
   }).addTo(map);
814 814
 <?php
815
-    } elseif ($globalMapProvider == 'Mapbox-GL') {
815
+	} elseif ($globalMapProvider == 'Mapbox-GL') {
816 816
 ?>
817 817
     L.mapboxGL({
818 818
 	accessToken: '<?php print $globalMapboxToken; ?>',
819 819
 	style: 'mapbox://styles/mapbox/bright-v8'
820 820
   }).addTo(map);
821 821
 <?php
822
-    } elseif ($globalMapProvider == 'MapQuest-OSM') {
822
+	} elseif ($globalMapProvider == 'MapQuest-OSM') {
823 823
 ?>
824 824
   L.tileLayer('http://otile1.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.png', {
825 825
     maxZoom: 18,
@@ -828,7 +828,7 @@  discard block
 block discarded – undo
828 828
       'Tiles Courtesy of <a href="http://www.mapquest.com">MapQuest</a>'
829 829
   }).addTo(map);
830 830
 <?php
831
-    } elseif ($globalMapProvider == 'MapQuest-Aerial') {
831
+	} elseif ($globalMapProvider == 'MapQuest-Aerial') {
832 832
 ?>
833 833
   L.tileLayer('http://otile1.mqcdn.com/tiles/1.0.0/sat/{z}/{x}/{y}.png', {
834 834
     maxZoom: 18,
@@ -837,27 +837,27 @@  discard block
 block discarded – undo
837 837
       'Tiles Courtesy of <a href="http://www.mapquest.com">MapQuest</a>, Portions Courtesy NASA/JPL-Caltech and U.S. Depart. of Agriculture, Farm Service Agency"'
838 838
   }).addTo(map);
839 839
 <?php
840
-    } elseif ($globalMapProvider == 'Google-Roadmap') {
840
+	} elseif ($globalMapProvider == 'Google-Roadmap') {
841 841
 ?>
842 842
     var googleLayer = new L.Google('ROADMAP');
843 843
     map.addLayer(googleLayer);
844 844
 <?php
845
-    } elseif ($globalMapProvider == 'Google-Satellite') {
845
+	} elseif ($globalMapProvider == 'Google-Satellite') {
846 846
 ?>
847 847
     var googleLayer = new L.Google('SATELLITE');
848 848
     map.addLayer(googleLayer);
849 849
 <?php
850
-    } elseif ($globalMapProvider == 'Google-Hybrid') {
850
+	} elseif ($globalMapProvider == 'Google-Hybrid') {
851 851
 ?>
852 852
     var googleLayer = new L.Google('HYBRID');
853 853
     map.addLayer(googleLayer);
854 854
 <?php
855
-    } elseif ($globalMapProvider == 'Google-Terrain') {
855
+	} elseif ($globalMapProvider == 'Google-Terrain') {
856 856
 ?>
857 857
     var googleLayer = new L.Google('Terrain');
858 858
     map.addLayer(googleLayer);
859 859
 <?php
860
-    } elseif (isset($globalMapCustomLayer[$globalMapProvider])) {
860
+	} elseif (isset($globalMapCustomLayer[$globalMapProvider])) {
861 861
 	$customid = $globalMapProvider;
862 862
 ?>
863 863
     L.tileLayer('<?php print $globalMapCustomLayer[$customid]['url']; ?>/{z}/{x}/{y}.png', {
@@ -867,7 +867,7 @@  discard block
 block discarded – undo
867 867
         attribution: '<?php print $globalMapCustomLayer[$customid]['attribution']; ?>'
868 868
     }).addTo(map);
869 869
 <?php
870
-    } elseif ($globalMapProvider == 'offline' || (isset($globalMapOffline) && $globalMapOffline === TRUE)) {
870
+	} elseif ($globalMapProvider == 'offline' || (isset($globalMapOffline) && $globalMapOffline === TRUE)) {
871 871
 ?>
872 872
     var center = map.getCenter();
873 873
     map.options.crs = L.CRS.EPSG4326;
@@ -882,8 +882,8 @@  discard block
 block discarded – undo
882 882
         attribution: 'Natural Earth'
883 883
     }).addTo(map);
884 884
 <?php
885
-    //} elseif ($globalMapProvider == 'OpenStreetMap') {
886
-    } else {
885
+	//} elseif ($globalMapProvider == 'OpenStreetMap') {
886
+	} else {
887 887
 ?>
888 888
   L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
889 889
     maxZoom: 18,
@@ -892,7 +892,7 @@  discard block
 block discarded – undo
892 892
   }).addTo(map);
893 893
 
894 894
 <?php
895
-    }
895
+	}
896 896
 ?>
897 897
         </script>
898 898
     </div>
Please login to merge, or discard this patch.
archive-geojson.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -232,12 +232,12 @@  discard block
 block discarded – undo
232 232
 					$previousts = strtotime($spotter_history['date']);
233 233
 				}
234 234
 				if (isset($output_time)) {
235
-				    $output_time  = substr($output_time, 0, -1);
236
-				    $output .= '"time": ['.$output_time.'],';
235
+					$output_time  = substr($output_time, 0, -1);
236
+					$output .= '"time": ['.$output_time.'],';
237 237
 				}
238 238
 				if (isset($output_timediff)) {
239
-				    $output_timediff  = substr($output_timediff, 0, -1);
240
-				    $output .= '"timediff": ['.$output_timediff.'],';
239
+					$output_timediff  = substr($output_timediff, 0, -1);
240
+					$output .= '"timediff": ['.$output_timediff.'],';
241 241
 				}
242 242
 							// FIXME : type when not aircraft ?
243 243
 						if ($compress) $output .= '"t": "aircraft"';
@@ -249,8 +249,8 @@  discard block
 block discarded – undo
249 249
 						$output .= '"coordinates": [';
250 250
 						
251 251
 				if (isset($output_history)) {
252
-				    $output_history  = substr($output_history, 0, -1);
253
-				    $output .= $output_history;
252
+					$output_history  = substr($output_history, 0, -1);
253
+					$output .= $output_history;
254 254
 				}
255 255
 				$output .= ']';
256 256
 				$output .= '}';
Please login to merge, or discard this patch.