Completed
Push — master ( 50b764...f2ce3d )
by Yannick
30:38
created
require/class.AIS.php 1 patch
Spacing   +129 added lines, -129 removed lines patch added patch discarded remove patch
@@ -117,31 +117,31 @@  discard block
 block discarded – undo
117 117
 
118 118
 	private function make_latf($temp) { // unsigned long 
119 119
 		$flat = 0.0; // float
120
-		$temp = $temp & 0x07FFFFFF;
121
-		if ($temp & 0x04000000) {
122
-			$temp = $temp ^ 0x07FFFFFF;
120
+		$temp = $temp&0x07FFFFFF;
121
+		if ($temp&0x04000000) {
122
+			$temp = $temp^0x07FFFFFF;
123 123
 			$temp += 1;
124
-			$flat = (float)($temp / (60.0 * 10000.0));
124
+			$flat = (float) ($temp/(60.0*10000.0));
125 125
 			$flat *= -1.0;
126
-		} else $flat = (float)($temp / (60.0 * 10000.0));
126
+		} else $flat = (float) ($temp/(60.0*10000.0));
127 127
 		return $flat; // float
128 128
 	}
129 129
 
130 130
 	private function make_lonf($temp) { // unsigned long
131 131
 		$flon = 0.0; // float
132
-		$temp = $temp & 0x0FFFFFFF;
133
-		if ($temp & 0x08000000) {
134
-			$temp = $temp ^ 0x0FFFFFFF;
132
+		$temp = $temp&0x0FFFFFFF;
133
+		if ($temp&0x08000000) {
134
+			$temp = $temp^0x0FFFFFFF;
135 135
 			$temp += 1;
136
-			$flon = (float)($temp / (60.0 * 10000.0));
136
+			$flon = (float) ($temp/(60.0*10000.0));
137 137
 			$flon *= -1.0;
138
-		} else $flon = (float)($temp / (60.0 * 10000.0));
138
+		} else $flon = (float) ($temp/(60.0*10000.0));
139 139
 		return $flon;
140 140
 	}
141 141
 
142 142
 	private function ascii_2_dec($chr) {
143
-		$dec=ord($chr);//get decimal ascii code
144
-		$hex=dechex($dec);//convert decimal to hex
143
+		$dec = ord($chr); //get decimal ascii code
144
+		$hex = dechex($dec); //convert decimal to hex
145 145
 		return ($dec);
146 146
 	}
147 147
 	
@@ -160,15 +160,15 @@  discard block
 block discarded – undo
160 160
 		//only process in the following range: 48-87, 96-119
161 161
 		if ($ascii < 48) { }
162 162
 		else {
163
-			if($ascii>119) { }
163
+			if ($ascii > 119) { }
164 164
 			else {
165
-				if ($ascii>87 && $ascii<96) ;
165
+				if ($ascii > 87 && $ascii < 96);
166 166
 				else {
167
-					$ascii=$ascii+40;
168
-					if ($ascii>128){
169
-						$ascii=$ascii+32;
167
+					$ascii = $ascii + 40;
168
+					if ($ascii > 128) {
169
+						$ascii = $ascii + 32;
170 170
 					} else {
171
-						$ascii=$ascii+40;
171
+						$ascii = $ascii + 40;
172 172
 					}
173 173
 				}
174 174
 			}
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 	}
178 178
 
179 179
 	private function dec_2_6bit($dec) {
180
-		$bin=decbin($dec);
180
+		$bin = decbin($dec);
181 181
 		return(substr($bin, -6)); 
182 182
 	}
183 183
 
@@ -195,11 +195,11 @@  discard block
 block discarded – undo
195 195
 		);
196 196
 		// "
197 197
 		$rv = '';
198
-		if ($_size % 6 == 0) {
199
-			$len = $_size / 6;
200
-			for ($i=0; $i<$len; $i++) {
201
-				$offset = $i * 6;
202
-				$rv .= $ais_chars[ bindec(substr($_str,$_start + $offset,6)) ];
198
+		if ($_size%6 == 0) {
199
+			$len = $_size/6;
200
+			for ($i = 0; $i < $len; $i++) {
201
+				$offset = $i*6;
202
+				$rv .= $ais_chars[bindec(substr($_str, $_start + $offset, 6))];
203 203
 			}
204 204
 		}
205 205
 		return $rv;
@@ -226,93 +226,93 @@  discard block
 block discarded – undo
226 226
 		$ro->eta_hour = '';
227 227
 		$ro->eta_minute = '';
228 228
 		$ro->ts = time();
229
-		$ro->id = bindec(substr($_aisdata,0,6));
230
-		$ro->mmsi = bindec(substr($_aisdata,8,30));
229
+		$ro->id = bindec(substr($_aisdata, 0, 6));
230
+		$ro->mmsi = bindec(substr($_aisdata, 8, 30));
231 231
 		if ($ro->id >= 1 && $ro->id <= 3) {
232
-			$ro->cog = bindec(substr($_aisdata,116,12))/10;
233
-			$ro->sog = bindec(substr($_aisdata,50,10))/10;
234
-			$ro->lon = $this->make_lonf(bindec(substr($_aisdata,61,28)));
235
-			$ro->lat = $this->make_latf(bindec(substr($_aisdata,89,27)));
232
+			$ro->cog = bindec(substr($_aisdata, 116, 12))/10;
233
+			$ro->sog = bindec(substr($_aisdata, 50, 10))/10;
234
+			$ro->lon = $this->make_lonf(bindec(substr($_aisdata, 61, 28)));
235
+			$ro->lat = $this->make_latf(bindec(substr($_aisdata, 89, 27)));
236 236
 			$ro->cls = 1; // class A
237 237
 		} else if ($ro->id == 4) {
238
-			$ro->lon = $this->make_lonf(bindec(substr($_aisdata,79,28)));
239
-			$ro->lat = $this->make_latf(bindec(substr($_aisdata,107,27)));
238
+			$ro->lon = $this->make_lonf(bindec(substr($_aisdata, 79, 28)));
239
+			$ro->lat = $this->make_latf(bindec(substr($_aisdata, 107, 27)));
240 240
 			$ro->cls = 1; // class A
241 241
 		} else if ($ro->id == 5) {
242
-			$ro->imo = bindec(substr($_aisdata,40,30));
243
-			$ro->callsign = $this->binchar($_aisdata,70,42);
244
-			$ro->name = $this->binchar($_aisdata,112,120);
245
-			$ro->typeid = bindec(substr($_aisdata,232,8));
242
+			$ro->imo = bindec(substr($_aisdata, 40, 30));
243
+			$ro->callsign = $this->binchar($_aisdata, 70, 42);
244
+			$ro->name = $this->binchar($_aisdata, 112, 120);
245
+			$ro->typeid = bindec(substr($_aisdata, 232, 8));
246 246
 			$ro->type = $this->getShipType($ro->typeid);
247 247
 			//$ro->to_bow = bindec(substr($_aisdata,240,9));
248 248
 			//$ro->to_stern = bindec(substr($_aisdata,249,9));
249 249
 			//$ro->to_port = bindec(substr($_aisdata,258,6));
250 250
 			//$ro->to_starboard = bindec(substr($_aisdata,264,6));
251
-			$ro->eta_month = bindec(substr($_aisdata,274,4));
252
-			$ro->eta_day = bindec(substr($_aisdata,278,5));
253
-			$ro->eta_hour = bindec(substr($_aisdata,283,5));
254
-			$ro->eta_minute = bindec(substr($_aisdata,288,6));
251
+			$ro->eta_month = bindec(substr($_aisdata, 274, 4));
252
+			$ro->eta_day = bindec(substr($_aisdata, 278, 5));
253
+			$ro->eta_hour = bindec(substr($_aisdata, 283, 5));
254
+			$ro->eta_minute = bindec(substr($_aisdata, 288, 6));
255 255
 			//$ro->draught = bindec(substr($_aisdata,294,8));
256
-			$ro->destination = $this->binchar($_aisdata,302,120);
256
+			$ro->destination = $this->binchar($_aisdata, 302, 120);
257 257
 			$ro->cls = 1; // class A
258 258
 		} else if ($ro->id == 9) {
259 259
 			// Search and Rescue aircraft position report
260 260
 		} else if ($ro->id == 18) {
261
-			$ro->cog = bindec(substr($_aisdata,112,12))/10;
262
-			$ro->sog = bindec(substr($_aisdata,46,10))/10;
263
-			$ro->lon = $this->make_lonf(bindec(substr($_aisdata,57,28)));
264
-			$ro->lat = $this->make_latf(bindec(substr($_aisdata,85,27)));
265
-			$ro->heading = bindec(substr($_aisdata,124,9));
261
+			$ro->cog = bindec(substr($_aisdata, 112, 12))/10;
262
+			$ro->sog = bindec(substr($_aisdata, 46, 10))/10;
263
+			$ro->lon = $this->make_lonf(bindec(substr($_aisdata, 57, 28)));
264
+			$ro->lat = $this->make_latf(bindec(substr($_aisdata, 85, 27)));
265
+			$ro->heading = bindec(substr($_aisdata, 124, 9));
266 266
 			if ($ro->heading == 511) $ro->heading = '';
267 267
 			$ro->cls = 2; // class B
268 268
 		} else if ($ro->id == 19) {
269
-			$ro->cog = bindec(substr($_aisdata,112,12))/10;
270
-			$ro->sog = bindec(substr($_aisdata,46,10))/10;
271
-			$ro->lon = $this->make_lonf(bindec(substr($_aisdata,61,28)));
272
-			$ro->lat = $this->make_latf(bindec(substr($_aisdata,89,27)));
273
-			$ro->name = $this->binchar($_aisdata,143,120);
269
+			$ro->cog = bindec(substr($_aisdata, 112, 12))/10;
270
+			$ro->sog = bindec(substr($_aisdata, 46, 10))/10;
271
+			$ro->lon = $this->make_lonf(bindec(substr($_aisdata, 61, 28)));
272
+			$ro->lat = $this->make_latf(bindec(substr($_aisdata, 89, 27)));
273
+			$ro->name = $this->binchar($_aisdata, 143, 120);
274 274
 			$ro->cls = 2; // class B
275
-			$ro->heading = bindec(substr($_aisdata,124,9));
275
+			$ro->heading = bindec(substr($_aisdata, 124, 9));
276 276
 			if ($ro->heading == 511) $ro->heading = '';
277
-			$ro->typeid = bindec(substr($_aisdata,263,8));
277
+			$ro->typeid = bindec(substr($_aisdata, 263, 8));
278 278
 			$ro->type = $this->getShipType($ro->typeid);
279 279
 			//$ro->to_bow = bindec(substr($_aisdata,271,9));
280 280
 			//$ro->to_stern = bindec(substr($_aisdata,280,9));
281 281
 			//$ro->to_port = bindec(substr($_aisdata,289,6));
282 282
 			//$ro->to_starboard = bindec(substr($_aisdata,295,6));
283 283
 		} else if ($ro->id == 21) {
284
-			$ro->lon = $this->make_lonf(bindec(substr($_aisdata,164,28)));
285
-			$ro->lat = $this->make_latf(bindec(substr($_aisdata,192,27)));
286
-			$ro->name = $this->binchar($_aisdata,43,120);
284
+			$ro->lon = $this->make_lonf(bindec(substr($_aisdata, 164, 28)));
285
+			$ro->lat = $this->make_latf(bindec(substr($_aisdata, 192, 27)));
286
+			$ro->name = $this->binchar($_aisdata, 43, 120);
287 287
 			//$ro->to_bow = bindec(substr($_aisdata,219,9));
288 288
 			//$ro->to_stern = bindec(substr($_aisdata,228,9));
289 289
 			//$ro->to_port = bindec(substr($_aisdata,237,6));
290 290
 			//$ro->to_starboard = bindec(substr($_aisdata,243,6));
291 291
 			$ro->cls = 2; // class B
292 292
 		} else if ($ro->id == 24) {
293
-			$pn = bindec(substr($_aisdata,38,2));
293
+			$pn = bindec(substr($_aisdata, 38, 2));
294 294
 			if ($pn == 0) {
295
-				$ro->name = $this->binchar($_aisdata,40,120);
295
+				$ro->name = $this->binchar($_aisdata, 40, 120);
296 296
 			}
297
-			$ro->typeid = bindec(substr($_aisdata,40,8));
297
+			$ro->typeid = bindec(substr($_aisdata, 40, 8));
298 298
 			$ro->type = $this->getShipType($ro->typeid);
299
-			$ro->callsign = $this->binchar($_aisdata,90,42);
299
+			$ro->callsign = $this->binchar($_aisdata, 90, 42);
300 300
 			//$ro->to_bow = bindec(substr($_aisdata,132,9));
301 301
 			//$ro->to_stern = bindec(substr($_aisdata,141,9));
302 302
 			//$ro->to_port = bindec(substr($_aisdata,150,6));
303 303
 			//$ro->to_starboard = bindec(substr($_aisdata,156,6));
304 304
 			$ro->cls = 2; // class B
305 305
 		} else if ($ro->id == 27) {
306
-			$ro->cog = bindec(substr($_aisdata,85,9));
306
+			$ro->cog = bindec(substr($_aisdata, 85, 9));
307 307
 			if ($ro->cog == 511) $ro->cog = 0.0;
308
-			$ro->sog = bindec(substr($_aisdata,79,6));
308
+			$ro->sog = bindec(substr($_aisdata, 79, 6));
309 309
 			if ($ro->sog == 63) $ro->sog = 0.0;
310
-			$ro->lon = $this->make_lonf(bindec(substr($_aisdata,44,18))*10);
311
-			$ro->lat = $this->make_latf(bindec(substr($_aisdata,62,17))*10);
310
+			$ro->lon = $this->make_lonf(bindec(substr($_aisdata, 44, 18))*10);
311
+			$ro->lat = $this->make_latf(bindec(substr($_aisdata, 62, 17))*10);
312 312
 			$ro->cls = 1; // class A
313 313
 		
314 314
 		}
315
-		$ro->statusid = bindec(substr($_aisdata,38,4));
315
+		$ro->statusid = bindec(substr($_aisdata, 38, 4));
316 316
 		$ro->status = $this->getStatus($ro->statusid);
317 317
 		return $ro;
318 318
 	}
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
 	}
360 360
 
361 361
 	public function getShipTypeID($type) {
362
-		$typeid = array_search($type,$this->shiptype);
362
+		$typeid = array_search($type, $this->shiptype);
363 363
 		if ($typeid !== FALSE) return $typeid;
364 364
 		elseif ($type == 'Cargo' || $type == 'General Cargo' || $type == 'Bulk Carrier' || $type == 'Container Ship' || $type == 'Cargo A' || $type == 'Reefer' || $type == 'Vehicles Carrier' || $type == 'Ro-Ro Cargo') return 70;
365 365
 		elseif ($type == 'Passengers Ship' || $type == 'Passenger' || $type == 'Ro-Ro/Passenger Ship' || $type == 'Motor Passenger') return 60;
@@ -381,14 +381,14 @@  discard block
 block discarded – undo
381 381
 	public function process_ais_itu($_itu, $_len, $_filler, $aux /*, $ais_ch*/) {
382 382
 		global $port; // tcpip port...
383 383
 		static $debug_counter = 0;
384
-		$aisdata168='';//six bit array of ascii characters
384
+		$aisdata168 = ''; //six bit array of ascii characters
385 385
 		$ais_nmea_array = str_split($_itu); // convert to an array
386 386
 		foreach ($ais_nmea_array as $value) {
387 387
 			$dec = $this->ascii_2_dec($value);
388 388
 			$bit8 = $this->asciidec_2_8bit($dec);
389 389
 			$bit6 = $this->dec_2_6bit($bit8);
390 390
 			//echo $value ."-" .$bit6 ."";
391
-			$aisdata168 .=$bit6;
391
+			$aisdata168 .= $bit6;
392 392
 		}
393 393
 		//echo $aisdata168 . "<br/>";
394 394
 		//return $this->decode_ais($aisdata168, $aux);
@@ -411,24 +411,24 @@  discard block
 block discarded – undo
411 411
 		// calculate checksum after ! till *
412 412
 		// assume 1st ! is valid
413 413
 		// find * ensure that it is at correct position
414
-		$end = strrpos ( $rawdata , '*' );
414
+		$end = strrpos($rawdata, '*');
415 415
 		if ($end === FALSE) return -1; // check for NULLS!!!
416
-		$cs = substr( $rawdata, $end + 1 );
417
-		if ( strlen($cs) != 2 ) return -1; // correct cs length
418
-		$dcs = (int)hexdec( $cs );
419
-		for ( $alias=1; $alias<$end; $alias++) $chksum ^= ord( $rawdata[$alias] ); // perform XOR for NMEA checksum
420
-		if ( $chksum == $dcs ) { // NMEA checksum pass
416
+		$cs = substr($rawdata, $end + 1);
417
+		if (strlen($cs) != 2) return -1; // correct cs length
418
+		$dcs = (int) hexdec($cs);
419
+		for ($alias = 1; $alias < $end; $alias++) $chksum ^= ord($rawdata[$alias]); // perform XOR for NMEA checksum
420
+		if ($chksum == $dcs) { // NMEA checksum pass
421 421
 			$pcs = explode(',', $rawdata);
422 422
 			// !AI??? identifier
423 423
 			if (!isset($pcs[1])) {
424 424
 				echo "ERROR,INVALID_DATA ".time()." $rawdata\n";
425 425
 				return -1;
426 426
 			}
427
-			$num_seq = (int)$pcs[1]; // number of sequences
428
-			$seq = (int)$pcs[2]; // get sequence
427
+			$num_seq = (int) $pcs[1]; // number of sequences
428
+			$seq = (int) $pcs[2]; // get sequence
429 429
 			// get msg sequence id
430 430
 			if ($pcs[3] == '') $msg_sid = -1; // non-multipart message, set to -1
431
-			else $msg_sid = (int)$pcs[3]; // multipart message
431
+			else $msg_sid = (int) $pcs[3]; // multipart message
432 432
 			$ais_ch = $pcs[4]; // get AIS channel
433 433
 			// message sequence checking
434 434
 			if ($num_seq < 1 || $num_seq > 9) {
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
 					}
462 462
 				}
463 463
 				$itu = $itu.$pcs[5]; // get itu message
464
-				$filler += (int)$pcs[6][0]; // get filler
464
+				$filler += (int) $pcs[6][0]; // get filler
465 465
 				if ($num_seq == 1 // valid single message
466 466
 				    || $num_seq == $pseq // valid multi-part message
467 467
 				) {
@@ -483,13 +483,13 @@  discard block
 block discarded – undo
483 483
 		$cbuf = $cbuf.$ibuf;
484 484
 		$last_pos = 0;
485 485
 		$result = new stdClass();
486
-		while ( ($start = strpos($cbuf,"VDM",$last_pos)) !== FALSE) {
486
+		while (($start = strpos($cbuf, "VDM", $last_pos)) !== FALSE) {
487 487
 		//while ( ($start = strpos($cbuf,"!AI",$last_pos)) !== FALSE) {
488 488
 			//DEBUG echo $cbuf;
489
-			if ( ($end = strpos($cbuf,"\r\n", $start)) !== FALSE) { //TBD need to trim?
489
+			if (($end = strpos($cbuf, "\r\n", $start)) !== FALSE) { //TBD need to trim?
490 490
 				$tst = substr($cbuf, $start - 3, ($end - $start + 3));
491 491
 				//DEBUG echo "[$start $end $tst]\n";
492
-				$result = $this->process_ais_raw( $tst, "" );
492
+				$result = $this->process_ais_raw($tst, "");
493 493
 				$last_pos = $end + 1;
494 494
 			} else break;
495 495
 		}
@@ -501,41 +501,41 @@  discard block
 block discarded – undo
501 501
 	// incoming data from serial or IP comms
502 502
 	public function process_ais_line($cbuf) {
503 503
 		$result = new stdClass();
504
-		$start = strpos($cbuf,"VDM");
504
+		$start = strpos($cbuf, "VDM");
505 505
 		$tst = substr($cbuf, $start - 3);
506
-		$result = $this->process_ais_raw( $tst, "" );
506
+		$result = $this->process_ais_raw($tst, "");
507 507
 		return $result;
508 508
 	}
509 509
 
510 510
 	/* AIS Encoding
511 511
 	*/
512
-	private function mk_ais_lat( $lat ) {
512
+	private function mk_ais_lat($lat) {
513 513
 		//$lat = 1.2569;
514
-		if ($lat<0.0) {
514
+		if ($lat < 0.0) {
515 515
 			$lat = -$lat;
516
-			$neg=true;
517
-		} else $neg=false;
516
+			$neg = true;
517
+		} else $neg = false;
518 518
 		$latd = 0x00000000;
519
-		$latd = intval ($lat * 600000.0);
520
-		if ($neg==true) {
519
+		$latd = intval($lat*600000.0);
520
+		if ($neg == true) {
521 521
 			$latd = ~$latd;
522
-			$latd+=1;
522
+			$latd += 1;
523 523
 			$latd &= 0x07FFFFFF;
524 524
 		}
525 525
 		return $latd;
526 526
 	}
527 527
 
528
-	private function mk_ais_lon( $lon ) {
528
+	private function mk_ais_lon($lon) {
529 529
 		//$lon = 103.851;
530
-		if ($lon<0.0) {
530
+		if ($lon < 0.0) {
531 531
 			$lon = -$lon;
532
-			$neg=true;
533
-		} else $neg=false;
532
+			$neg = true;
533
+		} else $neg = false;
534 534
 		$lond = 0x00000000;
535
-		$lond = intval ($lon * 600000.0);
536
-		if ($neg==true) {
535
+		$lond = intval($lon*600000.0);
536
+		if ($neg == true) {
537 537
 			$lond = ~$lond;
538
-			$lond+=1;
538
+			$lond += 1;
539 539
 			$lond &= 0x0FFFFFFF;
540 540
 		}
541 541
 		return $lond;
@@ -543,8 +543,8 @@  discard block
 block discarded – undo
543 543
 
544 544
 	private function char2bin($name, $max_len) {
545 545
 		$len = strlen($name);
546
-		if ($len > $max_len) $name = substr($name,0,$max_len);
547
-		if ($len < $max_len) $pad = str_repeat('0', ($max_len - $len) * 6);
546
+		if ($len > $max_len) $name = substr($name, 0, $max_len);
547
+		if ($len < $max_len) $pad = str_repeat('0', ($max_len - $len)*6);
548 548
 		else $pad = '';
549 549
 		$rv = '';
550 550
 		$ais_chars = array(
@@ -561,26 +561,26 @@  discard block
 block discarded – undo
561 561
 		if ($_a) foreach ($_a as $_1) {
562 562
 			if (isset($ais_chars[$_1])) $dec = $ais_chars[$_1];
563 563
 			else $dec = 0;
564
-			$bin = str_pad(decbin( $dec ), 6, '0', STR_PAD_LEFT);
564
+			$bin = str_pad(decbin($dec), 6, '0', STR_PAD_LEFT);
565 565
 			$rv .= $bin;
566 566
 			//echo "$_1 $dec ($bin)<br/>";
567 567
 		}
568 568
 		return $rv.$pad;
569 569
 	}
570 570
 
571
-	private function mk_ais($_enc, $_part=1,$_total=1,$_seq='',$_ch='A') {
571
+	private function mk_ais($_enc, $_part = 1, $_total = 1, $_seq = '', $_ch = 'A') {
572 572
 		$len_bit = strlen($_enc);
573
-		$rem6 = $len_bit % 6;
573
+		$rem6 = $len_bit%6;
574 574
 		$pad6_len = 0;
575 575
 		if ($rem6) $pad6_len = 6 - $rem6;
576 576
 		//echo  $pad6_len.'<br>';
577 577
 		$_enc .= str_repeat("0", $pad6_len); // pad the text...
578
-		$len_enc = strlen($_enc) / 6;
578
+		$len_enc = strlen($_enc)/6;
579 579
 		//echo $_enc.' '.$len_enc.'<br/>';
580 580
 		$itu = '';
581
-		for ($i=0; $i<$len_enc; $i++) {
582
-			$offset = $i * 6;
583
-			$dec = bindec(substr($_enc,$offset,6));
581
+		for ($i = 0; $i < $len_enc; $i++) {
582
+			$offset = $i*6;
583
+			$dec = bindec(substr($_enc, $offset, 6));
584 584
 			if ($dec < 40) $dec += 48;
585 585
 			else $dec += 56;
586 586
 			//echo chr($dec)." $dec<br/>";
@@ -590,15 +590,15 @@  discard block
 block discarded – undo
590 590
 		$chksum = 0;
591 591
 		$itu = "AIVDM,$_part,$_total,$_seq,$_ch,".$itu.",0";
592 592
 		$len_itu = strlen($itu);
593
-		for ($i=0; $i<$len_itu; $i++) {
594
-			$chksum ^= ord( $itu[$i] );
593
+		for ($i = 0; $i < $len_itu; $i++) {
594
+			$chksum ^= ord($itu[$i]);
595 595
 		}
596
-		$hex_arr = array('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F');
597
-		$lsb = $chksum & 0x0F;
598
-		if ($lsb >=0 && $lsb <= 15 ) $lsbc = $hex_arr[$lsb];
596
+		$hex_arr = array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F');
597
+		$lsb = $chksum&0x0F;
598
+		if ($lsb >= 0 && $lsb <= 15) $lsbc = $hex_arr[$lsb];
599 599
 		else $lsbc = '0';
600
-		$msb = (($chksum & 0xF0) >> 4) & 0x0F;
601
-		if ($msb >=0 && $msb <= 15 ) $msbc = $hex_arr[$msb];
600
+		$msb = (($chksum&0xF0) >> 4)&0x0F;
601
+		if ($msb >= 0 && $msb <= 15) $msbc = $hex_arr[$msb];
602 602
 		else $msbc = '0';
603 603
 		$itu = '!'.$itu."*{$msbc}{$lsbc}\r\n";
604 604
 		return $itu;
@@ -624,14 +624,14 @@  discard block
 block discarded – undo
624 624
 
625 625
 	public function mmsitype($mmsi) {
626 626
 		if (strlen($mmsi) == 9) {
627
-			if (substr($mmsi,0,3) == '974') return 'EPIRB (Emergency Position Indicating Radio Beacon) AIS';
628
-			elseif (substr($mmsi,0,3) == '972') return 'MOB (Man Overboard) device';
629
-			elseif (substr($mmsi,0,3) == '970') return 'AIS SART (Search and Rescue Transmitter)';
630
-			elseif (substr($mmsi,0,3) == '111') return 'SAR (Search and Rescue) aircraft';
631
-			elseif (substr($mmsi,0,2) == '98') return 'Auxiliary craft associated with a parent ship';
632
-			elseif (substr($mmsi,0,2) == '99') return 'Aids to Navigation';
633
-			elseif (substr($mmsi,0,2) == '00') return 'Coastal stations';
634
-			elseif (substr($mmsi,0,1) == '0') return 'Group of ships';
627
+			if (substr($mmsi, 0, 3) == '974') return 'EPIRB (Emergency Position Indicating Radio Beacon) AIS';
628
+			elseif (substr($mmsi, 0, 3) == '972') return 'MOB (Man Overboard) device';
629
+			elseif (substr($mmsi, 0, 3) == '970') return 'AIS SART (Search and Rescue Transmitter)';
630
+			elseif (substr($mmsi, 0, 3) == '111') return 'SAR (Search and Rescue) aircraft';
631
+			elseif (substr($mmsi, 0, 2) == '98') return 'Auxiliary craft associated with a parent ship';
632
+			elseif (substr($mmsi, 0, 2) == '99') return 'Aids to Navigation';
633
+			elseif (substr($mmsi, 0, 2) == '00') return 'Coastal stations';
634
+			elseif (substr($mmsi, 0, 1) == '0') return 'Group of ships';
635 635
 			else return 'Ship';
636 636
 		}
637 637
 
@@ -641,19 +641,19 @@  discard block
 block discarded – undo
641 641
 	public function parse_line($buffer) {
642 642
 		global $globalDebug;
643 643
 		$result = array();
644
-		$start = strpos($buffer,"VDM");
644
+		$start = strpos($buffer, "VDM");
645 645
 		$tst = substr($buffer, $start - 3);
646
-		$data = $this->process_ais_raw( $tst, "" );
646
+		$data = $this->process_ais_raw($tst, "");
647 647
 		if (!is_object($data)) {
648 648
 			//if ($globalDebug) echo '==== Line format not supported : '.$buffer."\n";
649 649
 			return array();
650 650
 		}
651 651
 		if ($data->lon != 0) $result['longitude'] = $data->lon;
652 652
 		if ($data->lat != 0) $result['latitude'] = $data->lat;
653
-		$result['ident'] = trim(str_replace('@','',$data->name));
653
+		$result['ident'] = trim(str_replace('@', '', $data->name));
654 654
 		$result['timestamp'] = $data->ts;
655 655
 		$result['mmsi'] = $data->mmsi;
656
-		if (strlen($result['mmsi']) == 8 && substr($result['mmsi'],0,3) == '669') $result['mmsi'] = '3'.$result['mmsi'];
656
+		if (strlen($result['mmsi']) == 8 && substr($result['mmsi'], 0, 3) == '669') $result['mmsi'] = '3'.$result['mmsi'];
657 657
 		$result['mmsi_type'] = $this->mmsitype($result['mmsi']);
658 658
 		if ($data->sog != -1.0) $result['speed'] = $data->sog;
659 659
 		if ($data->heading !== '') $result['heading'] = $data->heading;
@@ -663,16 +663,16 @@  discard block
 block discarded – undo
663 663
 		if ($data->type !== '') $result['type'] = $data->type;
664 664
 		if ($data->typeid !== '') $result['typeid'] = $data->typeid;
665 665
 		if ($data->imo !== '') $result['imo'] = $data->imo;
666
-		if ($data->callsign !== '') $result['callsign'] = trim(str_replace('@','',$data->callsign));
666
+		if ($data->callsign !== '') $result['callsign'] = trim(str_replace('@', '', $data->callsign));
667 667
 		if (is_numeric($data->eta_month) && $data->eta_month != 0 && is_numeric($data->eta_day) && $data->eta_day != 0 && $data->eta_hour !== '' && $data->eta_minute !== '') {
668
-			$eta_ts = strtotime(date('Y').'-'.sprintf("%02d",$data->eta_month).'-'.sprintf("%02d",$data->eta_day).' '.sprintf("%02d",$data->eta_hour).':'.sprintf("%02d",$data->eta_minute).':00');
668
+			$eta_ts = strtotime(date('Y').'-'.sprintf("%02d", $data->eta_month).'-'.sprintf("%02d", $data->eta_day).' '.sprintf("%02d", $data->eta_hour).':'.sprintf("%02d", $data->eta_minute).':00');
669 669
 			if ($eta_ts != '') $result['eta_ts'] = $eta_ts;
670 670
 		} elseif (is_numeric($data->eta_hour) && is_numeric($data->eta_minute)) {
671
-			$eta_ts = strtotime(date('Y-m-d').' '.sprintf("%02d",$data->eta_hour).':'.sprintf("%02d",$data->eta_minute).':00');
671
+			$eta_ts = strtotime(date('Y-m-d').' '.sprintf("%02d", $data->eta_hour).':'.sprintf("%02d", $data->eta_minute).':00');
672 672
 			if ($eta_ts != '') $result['eta_ts'] = $eta_ts;
673 673
 		}
674 674
 		if ($data->destination != '') {
675
-			$dest = trim(str_replace('@','',$data->destination));
675
+			$dest = trim(str_replace('@', '', $data->destination));
676 676
 			if ($dest != '') $result['destination'] = $dest;
677 677
 		}
678 678
 		$result['all'] = (array) $data;
Please login to merge, or discard this patch.
install/index.php 1 patch
Spacing   +282 added lines, -282 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 require_once(dirname(__FILE__).'/class.create_db.php');
23 23
 require_once(dirname(__FILE__).'/class.update_schema.php');
24 24
 require_once(dirname(__FILE__).'/class.settings.php');
25
-$title="Install";
25
+$title = "Install";
26 26
 require(dirname(__FILE__).'/../require/settings.php');
27 27
 require_once(dirname(__FILE__).'/../require/class.Common.php');
28 28
 require(dirname(__FILE__).'/header.php');
@@ -95,8 +95,8 @@  discard block
 block discarded – undo
95 95
 	if (!extension_loaded('curl')) {
96 96
 		$error[] = "Curl is not loaded.";
97 97
 	}
98
-	if(function_exists('apache_get_modules') ){
99
-		if(!in_array('mod_rewrite',apache_get_modules())) {
98
+	if (function_exists('apache_get_modules')) {
99
+		if (!in_array('mod_rewrite', apache_get_modules())) {
100 100
 			$error[] = "mod_rewrite is not available.";
101 101
 		}
102 102
 	/*
@@ -112,8 +112,8 @@  discard block
 block discarded – undo
112 112
 	print '<div class="info column"><p><strong>If you use MySQL or MariaDB, check that <i>max_allowed_packet</i> >= 8M, else import of some table can fail.</strong></p></div>';
113 113
 	if (isset($_SERVER['REQUEST_SCHEME']) && isset($_SERVER['SERVER_NAME']) && isset($_SERVER['SERVER_PORT']) && isset($_SERVER['REQUEST_URI'])) {
114 114
 		if (function_exists('get_headers')) {
115
-			$check_header = @get_headers($_SERVER['REQUEST_SCHEME'].'://'.$_SERVER["SERVER_NAME"].':'.$_SERVER["SERVER_PORT"].str_replace('install/','search',str_replace('index.php',$_SERVER["REQUEST_URI"])));
116
-			if (isset($check_header[0]) && !stripos($check_header[0],"200 OK")) {
115
+			$check_header = @get_headers($_SERVER['REQUEST_SCHEME'].'://'.$_SERVER["SERVER_NAME"].':'.$_SERVER["SERVER_PORT"].str_replace('install/', 'search', str_replace('index.php', $_SERVER["REQUEST_URI"])));
116
+			if (isset($check_header[0]) && !stripos($check_header[0], "200 OK")) {
117 117
 				print '<div class="info column"><p><strong>Check your configuration, rewrite don\'t seems to work.</strong></p></div>';
118 118
 			}
119 119
 		}
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 				    if ((!isset($globalURL) || $globalURL == '') && (!isset($globalDBuser) || $globalDBuser == '')) {
193 193
 					if (isset($_SERVER['REQUEST_URI'])) {
194 194
 						$URL = $_SERVER['REQUEST_URI'];
195
-						$globalURL = str_replace('/install','',str_replace('/install/','',str_replace('/install/index.php','',$URL)));
195
+						$globalURL = str_replace('/install', '', str_replace('/install/', '', str_replace('/install/index.php', '', $URL)));
196 196
 					}
197 197
 				    }
198 198
 				?>
@@ -515,13 +515,13 @@  discard block
 block discarded – undo
515 515
 ?>
516 516
 							<tr>
517 517
 								<?php
518
-								    if (filter_var($source['host'],FILTER_VALIDATE_URL)) {
518
+								    if (filter_var($source['host'], FILTER_VALIDATE_URL)) {
519 519
 								?>
520 520
 								<td><input type="text" name="host[]" id="host" value="<?php print $source['host']; ?>" /></td>
521 521
 								<td><input type="text" name="port[]" class="col-xs-2" id="port" value="<?php if (isset($source['port'])) print $source['port']; ?>" /></td>
522 522
 								<?php
523 523
 								    } else {
524
-									$hostport = explode(':',$source['host']);
524
+									$hostport = explode(':', $source['host']);
525 525
 									if (isset($hostport[1])) {
526 526
 										$host = $hostport[0];
527 527
 										$port = $hostport[1];
@@ -570,7 +570,7 @@  discard block
 block discarded – undo
570 570
 									<select name="timezones[]" id="timezones">
571 571
 								<?php
572 572
 									$timezonelist = DateTimeZone::listIdentifiers(DateTimeZone::ALL);
573
-									foreach($timezonelist as $timezones){
573
+									foreach ($timezonelist as $timezones) {
574 574
 										if (isset($source['timezone']) && $source['timezone'] == $timezones) {
575 575
 											print '<option selected>'.$timezones.'</option>';
576 576
 										} elseif (!isset($source['timezone']) && $timezones == 'UTC') {
@@ -624,7 +624,7 @@  discard block
 block discarded – undo
624 624
 									<select name="timezones[]" id="timezones">
625 625
 								<?php
626 626
 									$timezonelist = DateTimeZone::listIdentifiers(DateTimeZone::ALL);
627
-									foreach($timezonelist as $timezones){
627
+									foreach ($timezonelist as $timezones) {
628 628
 										if ($timezones == 'UTC') {
629 629
 											print '<option selected>'.$timezones.'</option>';
630 630
 										} else print '<option>'.$timezones.'</option>';
@@ -1076,7 +1076,7 @@  discard block
 block discarded – undo
1076 1076
 			<br />
1077 1077
 			<p>
1078 1078
 				<label for="aircraftsize">Size of aircraft icon on map (default to 30px if zoom > 7 else 15px), empty to default</label>
1079
-				<input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize;?>" />
1079
+				<input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize; ?>" />
1080 1080
 			</p>
1081 1081
 			<br />
1082 1082
 			<p>
@@ -1138,14 +1138,14 @@  discard block
 block discarded – undo
1138 1138
 $error = '';
1139 1139
 
1140 1140
 if (isset($_POST['dbtype'])) {
1141
-	$dbtype = filter_input(INPUT_POST,'dbtype',FILTER_SANITIZE_STRING);
1142
-	$dbroot = filter_input(INPUT_POST,'dbroot',FILTER_SANITIZE_STRING);
1143
-	$dbrootpass = filter_input(INPUT_POST,'dbrootpass',FILTER_SANITIZE_STRING);
1144
-	$dbname = filter_input(INPUT_POST,'dbname',FILTER_SANITIZE_STRING);
1145
-	$dbuser = filter_input(INPUT_POST,'dbuser',FILTER_SANITIZE_STRING);
1146
-	$dbuserpass = filter_input(INPUT_POST,'dbuserpass',FILTER_SANITIZE_STRING);
1147
-	$dbhost = filter_input(INPUT_POST,'dbhost',FILTER_SANITIZE_STRING);
1148
-	$dbport = filter_input(INPUT_POST,'dbport',FILTER_SANITIZE_STRING);
1141
+	$dbtype = filter_input(INPUT_POST, 'dbtype', FILTER_SANITIZE_STRING);
1142
+	$dbroot = filter_input(INPUT_POST, 'dbroot', FILTER_SANITIZE_STRING);
1143
+	$dbrootpass = filter_input(INPUT_POST, 'dbrootpass', FILTER_SANITIZE_STRING);
1144
+	$dbname = filter_input(INPUT_POST, 'dbname', FILTER_SANITIZE_STRING);
1145
+	$dbuser = filter_input(INPUT_POST, 'dbuser', FILTER_SANITIZE_STRING);
1146
+	$dbuserpass = filter_input(INPUT_POST, 'dbuserpass', FILTER_SANITIZE_STRING);
1147
+	$dbhost = filter_input(INPUT_POST, 'dbhost', FILTER_SANITIZE_STRING);
1148
+	$dbport = filter_input(INPUT_POST, 'dbport', FILTER_SANITIZE_STRING);
1149 1149
 
1150 1150
 	if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) $error .= 'Mysql driver for PDO must be loaded';
1151 1151
 	if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) $error .= 'PosgreSQL driver for PDO must be loaded';
@@ -1165,49 +1165,49 @@  discard block
 block discarded – undo
1165 1165
 	} else $settings = array_merge($settings,array('globalDBdriver' => $dbtype,'globalDBhost' => $dbhost,'globalDBuser' => $dbuser,'globalDBport' => $dbport,'globalDBpass' => $dbuserpass,'globalDBname' => $dbname));
1166 1166
 	*/
1167 1167
 	
1168
-	$settings = array_merge($settings,array('globalDBdriver' => $dbtype,'globalDBhost' => $dbhost,'globalDBuser' => $dbuser,'globalDBport' => $dbport,'globalDBpass' => $dbuserpass,'globalDBname' => $dbname));
1168
+	$settings = array_merge($settings, array('globalDBdriver' => $dbtype, 'globalDBhost' => $dbhost, 'globalDBuser' => $dbuser, 'globalDBport' => $dbport, 'globalDBpass' => $dbuserpass, 'globalDBname' => $dbname));
1169 1169
 
1170
-	$sitename = filter_input(INPUT_POST,'sitename',FILTER_SANITIZE_STRING);
1171
-	$siteurl = filter_input(INPUT_POST,'siteurl',FILTER_SANITIZE_STRING);
1172
-	$timezone = filter_input(INPUT_POST,'timezone',FILTER_SANITIZE_STRING);
1173
-	$language = filter_input(INPUT_POST,'language',FILTER_SANITIZE_STRING);
1174
-	$settings = array_merge($settings,array('globalName' => $sitename,'globalURL' => $siteurl, 'globalTimezone' => $timezone,'globalLanguage' => $language));
1170
+	$sitename = filter_input(INPUT_POST, 'sitename', FILTER_SANITIZE_STRING);
1171
+	$siteurl = filter_input(INPUT_POST, 'siteurl', FILTER_SANITIZE_STRING);
1172
+	$timezone = filter_input(INPUT_POST, 'timezone', FILTER_SANITIZE_STRING);
1173
+	$language = filter_input(INPUT_POST, 'language', FILTER_SANITIZE_STRING);
1174
+	$settings = array_merge($settings, array('globalName' => $sitename, 'globalURL' => $siteurl, 'globalTimezone' => $timezone, 'globalLanguage' => $language));
1175 1175
 
1176
-	$mapprovider = filter_input(INPUT_POST,'mapprovider',FILTER_SANITIZE_STRING);
1177
-	$mapboxid = filter_input(INPUT_POST,'mapboxid',FILTER_SANITIZE_STRING);
1178
-	$mapboxtoken = filter_input(INPUT_POST,'mapboxtoken',FILTER_SANITIZE_STRING);
1179
-	$googlekey = filter_input(INPUT_POST,'googlekey',FILTER_SANITIZE_STRING);
1180
-	$bingkey = filter_input(INPUT_POST,'bingkey',FILTER_SANITIZE_STRING);
1181
-	$openweathermapkey = filter_input(INPUT_POST,'openweathermapkey',FILTER_SANITIZE_STRING);
1182
-	$mapquestkey = filter_input(INPUT_POST,'mapquestkey',FILTER_SANITIZE_STRING);
1183
-	$hereappid = filter_input(INPUT_POST,'hereappid',FILTER_SANITIZE_STRING);
1184
-	$hereappcode = filter_input(INPUT_POST,'hereappcode',FILTER_SANITIZE_STRING);
1185
-	$settings = array_merge($settings,array('globalMapProvider' => $mapprovider,'globalMapboxId' => $mapboxid,'globalMapboxToken' => $mapboxtoken,'globalGoogleAPIKey' => $googlekey,'globalBingMapKey' => $bingkey,'globalHereappID' => $hereappid,'globalHereappCode' => $hereappcode,'globalMapQuestKey' => $mapquestkey,'globalOpenWeatherMapKey' => $openweathermapkey));
1176
+	$mapprovider = filter_input(INPUT_POST, 'mapprovider', FILTER_SANITIZE_STRING);
1177
+	$mapboxid = filter_input(INPUT_POST, 'mapboxid', FILTER_SANITIZE_STRING);
1178
+	$mapboxtoken = filter_input(INPUT_POST, 'mapboxtoken', FILTER_SANITIZE_STRING);
1179
+	$googlekey = filter_input(INPUT_POST, 'googlekey', FILTER_SANITIZE_STRING);
1180
+	$bingkey = filter_input(INPUT_POST, 'bingkey', FILTER_SANITIZE_STRING);
1181
+	$openweathermapkey = filter_input(INPUT_POST, 'openweathermapkey', FILTER_SANITIZE_STRING);
1182
+	$mapquestkey = filter_input(INPUT_POST, 'mapquestkey', FILTER_SANITIZE_STRING);
1183
+	$hereappid = filter_input(INPUT_POST, 'hereappid', FILTER_SANITIZE_STRING);
1184
+	$hereappcode = filter_input(INPUT_POST, 'hereappcode', FILTER_SANITIZE_STRING);
1185
+	$settings = array_merge($settings, array('globalMapProvider' => $mapprovider, 'globalMapboxId' => $mapboxid, 'globalMapboxToken' => $mapboxtoken, 'globalGoogleAPIKey' => $googlekey, 'globalBingMapKey' => $bingkey, 'globalHereappID' => $hereappid, 'globalHereappCode' => $hereappcode, 'globalMapQuestKey' => $mapquestkey, 'globalOpenWeatherMapKey' => $openweathermapkey));
1186 1186
 	
1187
-	$latitudemax = filter_input(INPUT_POST,'latitudemax',FILTER_SANITIZE_STRING);
1188
-	$latitudemin = filter_input(INPUT_POST,'latitudemin',FILTER_SANITIZE_STRING);
1189
-	$longitudemax = filter_input(INPUT_POST,'longitudemax',FILTER_SANITIZE_STRING);
1190
-	$longitudemin = filter_input(INPUT_POST,'longitudemin',FILTER_SANITIZE_STRING);
1191
-	$livezoom = filter_input(INPUT_POST,'livezoom',FILTER_SANITIZE_NUMBER_INT);
1192
-	$settings = array_merge($settings,array('globalLatitudeMax' => $latitudemax,'globalLatitudeMin' => $latitudemin,'globalLongitudeMax' => $longitudemax,'globalLongitudeMin' => $longitudemin,'globalLiveZoom' => $livezoom));
1187
+	$latitudemax = filter_input(INPUT_POST, 'latitudemax', FILTER_SANITIZE_STRING);
1188
+	$latitudemin = filter_input(INPUT_POST, 'latitudemin', FILTER_SANITIZE_STRING);
1189
+	$longitudemax = filter_input(INPUT_POST, 'longitudemax', FILTER_SANITIZE_STRING);
1190
+	$longitudemin = filter_input(INPUT_POST, 'longitudemin', FILTER_SANITIZE_STRING);
1191
+	$livezoom = filter_input(INPUT_POST, 'livezoom', FILTER_SANITIZE_NUMBER_INT);
1192
+	$settings = array_merge($settings, array('globalLatitudeMax' => $latitudemax, 'globalLatitudeMin' => $latitudemin, 'globalLongitudeMax' => $longitudemax, 'globalLongitudeMin' => $longitudemin, 'globalLiveZoom' => $livezoom));
1193 1193
 
1194
-	$squawk_country = filter_input(INPUT_POST,'squawk_country',FILTER_SANITIZE_STRING);
1195
-	$settings = array_merge($settings,array('globalSquawkCountry' => $squawk_country));
1194
+	$squawk_country = filter_input(INPUT_POST, 'squawk_country', FILTER_SANITIZE_STRING);
1195
+	$settings = array_merge($settings, array('globalSquawkCountry' => $squawk_country));
1196 1196
 
1197
-	$latitudecenter = filter_input(INPUT_POST,'latitudecenter',FILTER_SANITIZE_STRING);
1198
-	$longitudecenter = filter_input(INPUT_POST,'longitudecenter',FILTER_SANITIZE_STRING);
1199
-	$settings = array_merge($settings,array('globalCenterLatitude' => $latitudecenter,'globalCenterLongitude' => $longitudecenter));
1197
+	$latitudecenter = filter_input(INPUT_POST, 'latitudecenter', FILTER_SANITIZE_STRING);
1198
+	$longitudecenter = filter_input(INPUT_POST, 'longitudecenter', FILTER_SANITIZE_STRING);
1199
+	$settings = array_merge($settings, array('globalCenterLatitude' => $latitudecenter, 'globalCenterLongitude' => $longitudecenter));
1200 1200
 
1201
-	$acars = filter_input(INPUT_POST,'acars',FILTER_SANITIZE_STRING);
1201
+	$acars = filter_input(INPUT_POST, 'acars', FILTER_SANITIZE_STRING);
1202 1202
 	if ($acars == 'acars') {
1203
-		$settings = array_merge($settings,array('globalACARS' => 'TRUE'));
1203
+		$settings = array_merge($settings, array('globalACARS' => 'TRUE'));
1204 1204
 	} else {
1205
-		$settings = array_merge($settings,array('globalACARS' => 'FALSE'));
1205
+		$settings = array_merge($settings, array('globalACARS' => 'FALSE'));
1206 1206
 	}
1207 1207
 
1208
-	$flightawareusername = filter_input(INPUT_POST,'flightawareusername',FILTER_SANITIZE_STRING);
1209
-	$flightawarepassword = filter_input(INPUT_POST,'flightawarepassword',FILTER_SANITIZE_STRING);
1210
-	$settings = array_merge($settings,array('globalFlightAwareUsername' => $flightawareusername,'globalFlightAwarePassword' => $flightawarepassword));
1208
+	$flightawareusername = filter_input(INPUT_POST, 'flightawareusername', FILTER_SANITIZE_STRING);
1209
+	$flightawarepassword = filter_input(INPUT_POST, 'flightawarepassword', FILTER_SANITIZE_STRING);
1210
+	$settings = array_merge($settings, array('globalFlightAwareUsername' => $flightawareusername, 'globalFlightAwarePassword' => $flightawarepassword));
1211 1211
 	
1212 1212
 	$source_name = $_POST['source_name'];
1213 1213
 	$source_latitude = $_POST['source_latitude'];
@@ -1221,8 +1221,8 @@  discard block
 block discarded – undo
1221 1221
 	
1222 1222
 	$sources = array();
1223 1223
 	foreach ($source_name as $keys => $name) {
1224
-	    if (isset($source_id[$keys])) $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'id' => $source_id[$keys],'source' => $source_ref[$keys]);
1225
-	    else $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'source' => $source_ref[$keys]);
1224
+	    if (isset($source_id[$keys])) $sources[] = array('name' => $name, 'latitude' => $source_latitude[$keys], 'longitude' => $source_longitude[$keys], 'altitude' => $source_altitude[$keys], 'city' => $source_city[$keys], 'country' => $source_country[$keys], 'id' => $source_id[$keys], 'source' => $source_ref[$keys]);
1225
+	    else $sources[] = array('name' => $name, 'latitude' => $source_latitude[$keys], 'longitude' => $source_longitude[$keys], 'altitude' => $source_altitude[$keys], 'city' => $source_city[$keys], 'country' => $source_country[$keys], 'source' => $source_ref[$keys]);
1226 1226
 	}
1227 1227
 	if (count($sources) > 0) $_SESSION['sources'] = $sources;
1228 1228
 
@@ -1231,16 +1231,16 @@  discard block
 block discarded – undo
1231 1231
 	$newstype = $_POST['newstype'];
1232 1232
 	
1233 1233
 	$newsfeeds = array();
1234
-	foreach($newsurl as $newskey => $url) {
1234
+	foreach ($newsurl as $newskey => $url) {
1235 1235
 	    if ($url != '') {
1236 1236
 		$type = $newstype[$newskey];
1237 1237
 		$lng = $newslng[$newskey];
1238 1238
 		if (isset($newsfeeds[$type][$lng])) {
1239
-		    $newsfeeds[$type][$lng] = array_merge($newsfeeds[$type][$lng],array($url));
1239
+		    $newsfeeds[$type][$lng] = array_merge($newsfeeds[$type][$lng], array($url));
1240 1240
 		} else $newsfeeds[$type][$lng] = array($url);
1241 1241
 	    }
1242 1242
 	}
1243
-	$settings = array_merge($settings,array('globalNewsFeeds' => $newsfeeds));
1243
+	$settings = array_merge($settings, array('globalNewsFeeds' => $newsfeeds));
1244 1244
 
1245 1245
 	//$sbshost = filter_input(INPUT_POST,'sbshost',FILTER_SANITIZE_STRING);
1246 1246
 	//$sbsport = filter_input(INPUT_POST,'sbsport',FILTER_SANITIZE_NUMBER_INT);
@@ -1251,27 +1251,27 @@  discard block
 block discarded – undo
1251 1251
 	$sbsurl = $_POST['sbsurl'];
1252 1252
 	*/
1253 1253
 
1254
-	$globalvatsim = filter_input(INPUT_POST,'globalvatsim',FILTER_SANITIZE_STRING);
1255
-	$globalva = filter_input(INPUT_POST,'globalva',FILTER_SANITIZE_STRING);
1256
-	$globalivao = filter_input(INPUT_POST,'globalivao',FILTER_SANITIZE_STRING);
1257
-	$globalphpvms = filter_input(INPUT_POST,'globalphpvms',FILTER_SANITIZE_STRING);
1258
-	$globalvam = filter_input(INPUT_POST,'globalvam',FILTER_SANITIZE_STRING);
1259
-	$globalsbs = filter_input(INPUT_POST,'globalsbs',FILTER_SANITIZE_STRING);
1260
-	$globalaprs = filter_input(INPUT_POST,'globalaprs',FILTER_SANITIZE_STRING);
1261
-	$datasource = filter_input(INPUT_POST,'datasource',FILTER_SANITIZE_STRING);
1254
+	$globalvatsim = filter_input(INPUT_POST, 'globalvatsim', FILTER_SANITIZE_STRING);
1255
+	$globalva = filter_input(INPUT_POST, 'globalva', FILTER_SANITIZE_STRING);
1256
+	$globalivao = filter_input(INPUT_POST, 'globalivao', FILTER_SANITIZE_STRING);
1257
+	$globalphpvms = filter_input(INPUT_POST, 'globalphpvms', FILTER_SANITIZE_STRING);
1258
+	$globalvam = filter_input(INPUT_POST, 'globalvam', FILTER_SANITIZE_STRING);
1259
+	$globalsbs = filter_input(INPUT_POST, 'globalsbs', FILTER_SANITIZE_STRING);
1260
+	$globalaprs = filter_input(INPUT_POST, 'globalaprs', FILTER_SANITIZE_STRING);
1261
+	$datasource = filter_input(INPUT_POST, 'datasource', FILTER_SANITIZE_STRING);
1262 1262
 
1263
-	$globalaircraft = filter_input(INPUT_POST,'globalaircraft',FILTER_SANITIZE_STRING);
1264
-	if ($globalaircraft == 'aircraft') $settings = array_merge($settings,array('globalAircraft' => 'TRUE'));
1265
-	else $settings = array_merge($settings,array('globalAircraft' => 'FALSE'));
1266
-	$globaltracker = filter_input(INPUT_POST,'globaltracker',FILTER_SANITIZE_STRING);
1267
-	if ($globaltracker == 'tracker') $settings = array_merge($settings,array('globalTracker' => 'TRUE'));
1268
-	else $settings = array_merge($settings,array('globalTracker' => 'FALSE'));
1269
-	$globalmarine = filter_input(INPUT_POST,'globalmarine',FILTER_SANITIZE_STRING);
1270
-	if ($globalmarine == 'marine') $settings = array_merge($settings,array('globalMarine' => 'TRUE'));
1271
-	else $settings = array_merge($settings,array('globalMarine' => 'FALSE'));
1272
-	$globalsatellite = filter_input(INPUT_POST,'globalsatellite',FILTER_SANITIZE_STRING);
1273
-	if ($globalsatellite == 'satellite') $settings = array_merge($settings,array('globalSatellite' => 'TRUE'));
1274
-	else $settings = array_merge($settings,array('globalSatellite' => 'FALSE'));
1263
+	$globalaircraft = filter_input(INPUT_POST, 'globalaircraft', FILTER_SANITIZE_STRING);
1264
+	if ($globalaircraft == 'aircraft') $settings = array_merge($settings, array('globalAircraft' => 'TRUE'));
1265
+	else $settings = array_merge($settings, array('globalAircraft' => 'FALSE'));
1266
+	$globaltracker = filter_input(INPUT_POST, 'globaltracker', FILTER_SANITIZE_STRING);
1267
+	if ($globaltracker == 'tracker') $settings = array_merge($settings, array('globalTracker' => 'TRUE'));
1268
+	else $settings = array_merge($settings, array('globalTracker' => 'FALSE'));
1269
+	$globalmarine = filter_input(INPUT_POST, 'globalmarine', FILTER_SANITIZE_STRING);
1270
+	if ($globalmarine == 'marine') $settings = array_merge($settings, array('globalMarine' => 'TRUE'));
1271
+	else $settings = array_merge($settings, array('globalMarine' => 'FALSE'));
1272
+	$globalsatellite = filter_input(INPUT_POST, 'globalsatellite', FILTER_SANITIZE_STRING);
1273
+	if ($globalsatellite == 'satellite') $settings = array_merge($settings, array('globalSatellite' => 'TRUE'));
1274
+	else $settings = array_merge($settings, array('globalSatellite' => 'FALSE'));
1275 1275
 
1276 1276
 /*	
1277 1277
 	$globalSBS1Hosts = array();
@@ -1287,7 +1287,7 @@  discard block
 block discarded – undo
1287 1287
 	}
1288 1288
 	$settings = array_merge($settings,array('globalSBS1Hosts' => $globalSBS1Hosts));
1289 1289
 */
1290
-	$settings_comment = array_merge($settings_comment,array('globalSBS1Hosts'));
1290
+	$settings_comment = array_merge($settings_comment, array('globalSBS1Hosts'));
1291 1291
 	$host = $_POST['host'];
1292 1292
 	$port = $_POST['port'];
1293 1293
 	$name = $_POST['name'];
@@ -1304,115 +1304,115 @@  discard block
 block discarded – undo
1304 1304
 		else $cov = 'FALSE';
1305 1305
 		if (isset($noarchive[$key]) && $noarchive[$key] == 1) $arch = 'TRUE';
1306 1306
 		else $arch = 'FALSE';
1307
-		if (strpos($format[$key],'_callback')) {
1308
-			$gSources[] = array('host' => $h, 'pass' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezones[$key],'callback' => 'TRUE');
1307
+		if (strpos($format[$key], '_callback')) {
1308
+			$gSources[] = array('host' => $h, 'pass' => $port[$key], 'name' => $name[$key], 'format' => $format[$key], 'sourcestats' => $cov, 'noarchive' => $arch, 'timezone' => $timezones[$key], 'callback' => 'TRUE');
1309 1309
 		} elseif ($h != '' || $name[$key] != '') {
1310
-			$gSources[] = array('host' => $h, 'port' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezones[$key],'callback' => 'FALSE');
1310
+			$gSources[] = array('host' => $h, 'port' => $port[$key], 'name' => $name[$key], 'format' => $format[$key], 'sourcestats' => $cov, 'noarchive' => $arch, 'timezone' => $timezones[$key], 'callback' => 'FALSE');
1311 1311
 		}
1312 1312
 		if ($format[$key] == 'airwhere') $forcepilots = true;
1313 1313
 	}
1314
-	$settings = array_merge($settings,array('globalSources' => $gSources));
1314
+	$settings = array_merge($settings, array('globalSources' => $gSources));
1315 1315
 
1316 1316
 /*
1317 1317
 	$sbstimeout = filter_input(INPUT_POST,'sbstimeout',FILTER_SANITIZE_NUMBER_INT);
1318 1318
 	$settings = array_merge($settings,array('globalSourcesTimeOut' => $sbstimeout));
1319 1319
 */
1320
-	$acarshost = filter_input(INPUT_POST,'acarshost',FILTER_SANITIZE_STRING);
1321
-	$acarsport = filter_input(INPUT_POST,'acarsport',FILTER_SANITIZE_NUMBER_INT);
1322
-	$settings = array_merge($settings,array('globalACARSHost' => $acarshost,'globalACARSPort' => $acarsport));
1320
+	$acarshost = filter_input(INPUT_POST, 'acarshost', FILTER_SANITIZE_STRING);
1321
+	$acarsport = filter_input(INPUT_POST, 'acarsport', FILTER_SANITIZE_NUMBER_INT);
1322
+	$settings = array_merge($settings, array('globalACARSHost' => $acarshost, 'globalACARSPort' => $acarsport));
1323 1323
 
1324
-	$bitly = filter_input(INPUT_POST,'bitly',FILTER_SANITIZE_STRING);
1325
-	$settings = array_merge($settings,array('globalBitlyAccessToken' => $bitly));
1324
+	$bitly = filter_input(INPUT_POST, 'bitly', FILTER_SANITIZE_STRING);
1325
+	$settings = array_merge($settings, array('globalBitlyAccessToken' => $bitly));
1326 1326
 
1327
-	$customcss = filter_input(INPUT_POST,'customcss',FILTER_SANITIZE_STRING);
1328
-	$settings = array_merge($settings,array('globalCustomCSS' => $customcss));
1327
+	$customcss = filter_input(INPUT_POST, 'customcss', FILTER_SANITIZE_STRING);
1328
+	$settings = array_merge($settings, array('globalCustomCSS' => $customcss));
1329 1329
 
1330
-	$map3dtile = filter_input(INPUT_POST,'map3dtileset',FILTER_SANITIZE_STRING);
1331
-	$settings = array_merge($settings,array('globalMap3DTiles' => $map3dtile));
1330
+	$map3dtile = filter_input(INPUT_POST, 'map3dtileset', FILTER_SANITIZE_STRING);
1331
+	$settings = array_merge($settings, array('globalMap3DTiles' => $map3dtile));
1332 1332
 
1333
-	$notamsource = filter_input(INPUT_POST,'notamsource',FILTER_SANITIZE_STRING);
1334
-	$settings = array_merge($settings,array('globalNOTAMSource' => $notamsource));
1335
-	$metarsource = filter_input(INPUT_POST,'metarsource',FILTER_SANITIZE_STRING);
1336
-	$settings = array_merge($settings,array('globalMETARurl' => $metarsource));
1333
+	$notamsource = filter_input(INPUT_POST, 'notamsource', FILTER_SANITIZE_STRING);
1334
+	$settings = array_merge($settings, array('globalNOTAMSource' => $notamsource));
1335
+	$metarsource = filter_input(INPUT_POST, 'metarsource', FILTER_SANITIZE_STRING);
1336
+	$settings = array_merge($settings, array('globalMETARurl' => $metarsource));
1337 1337
 
1338
-	$zoilatitude = filter_input(INPUT_POST,'zoilatitude',FILTER_SANITIZE_STRING);
1339
-	$zoilongitude = filter_input(INPUT_POST,'zoilongitude',FILTER_SANITIZE_STRING);
1340
-	$zoidistance = filter_input(INPUT_POST,'zoidistance',FILTER_SANITIZE_NUMBER_INT);
1338
+	$zoilatitude = filter_input(INPUT_POST, 'zoilatitude', FILTER_SANITIZE_STRING);
1339
+	$zoilongitude = filter_input(INPUT_POST, 'zoilongitude', FILTER_SANITIZE_STRING);
1340
+	$zoidistance = filter_input(INPUT_POST, 'zoidistance', FILTER_SANITIZE_NUMBER_INT);
1341 1341
 	if ($zoilatitude != '' && $zoilongitude != '' && $zoidistance != '') {
1342
-		$settings = array_merge($settings,array('globalDistanceIgnore' => array('latitude' => $zoilatitude,'longitude' => $zoilongitude,'distance' => $zoidistance)));
1343
-	} else $settings = array_merge($settings,array('globalDistanceIgnore' => array()));
1342
+		$settings = array_merge($settings, array('globalDistanceIgnore' => array('latitude' => $zoilatitude, 'longitude' => $zoilongitude, 'distance' => $zoidistance)));
1343
+	} else $settings = array_merge($settings, array('globalDistanceIgnore' => array()));
1344 1344
 
1345
-	$refresh = filter_input(INPUT_POST,'refresh',FILTER_SANITIZE_NUMBER_INT);
1346
-	$settings = array_merge($settings,array('globalLiveInterval' => $refresh));
1347
-	$maprefresh = filter_input(INPUT_POST,'maprefresh',FILTER_SANITIZE_NUMBER_INT);
1348
-	$settings = array_merge($settings,array('globalMapRefresh' => $maprefresh));
1349
-	$mapidle = filter_input(INPUT_POST,'mapidle',FILTER_SANITIZE_NUMBER_INT);
1350
-	$settings = array_merge($settings,array('globalMapIdleTimeout' => $mapidle));
1351
-	$minfetch = filter_input(INPUT_POST,'minfetch',FILTER_SANITIZE_NUMBER_INT);
1352
-	$settings = array_merge($settings,array('globalMinFetch' => $minfetch));
1353
-	$closestmindist = filter_input(INPUT_POST,'closestmindist',FILTER_SANITIZE_NUMBER_INT);
1354
-	$settings = array_merge($settings,array('globalClosestMinDist' => $closestmindist));
1345
+	$refresh = filter_input(INPUT_POST, 'refresh', FILTER_SANITIZE_NUMBER_INT);
1346
+	$settings = array_merge($settings, array('globalLiveInterval' => $refresh));
1347
+	$maprefresh = filter_input(INPUT_POST, 'maprefresh', FILTER_SANITIZE_NUMBER_INT);
1348
+	$settings = array_merge($settings, array('globalMapRefresh' => $maprefresh));
1349
+	$mapidle = filter_input(INPUT_POST, 'mapidle', FILTER_SANITIZE_NUMBER_INT);
1350
+	$settings = array_merge($settings, array('globalMapIdleTimeout' => $mapidle));
1351
+	$minfetch = filter_input(INPUT_POST, 'minfetch', FILTER_SANITIZE_NUMBER_INT);
1352
+	$settings = array_merge($settings, array('globalMinFetch' => $minfetch));
1353
+	$closestmindist = filter_input(INPUT_POST, 'closestmindist', FILTER_SANITIZE_NUMBER_INT);
1354
+	$settings = array_merge($settings, array('globalClosestMinDist' => $closestmindist));
1355 1355
 
1356
-	$aircraftsize = filter_input(INPUT_POST,'aircraftsize',FILTER_SANITIZE_NUMBER_INT);
1357
-	$settings = array_merge($settings,array('globalAircraftSize' => $aircraftsize));
1356
+	$aircraftsize = filter_input(INPUT_POST, 'aircraftsize', FILTER_SANITIZE_NUMBER_INT);
1357
+	$settings = array_merge($settings, array('globalAircraftSize' => $aircraftsize));
1358 1358
 
1359
-	$archivemonths = filter_input(INPUT_POST,'archivemonths',FILTER_SANITIZE_NUMBER_INT);
1360
-	$settings = array_merge($settings,array('globalArchiveMonths' => $archivemonths));
1359
+	$archivemonths = filter_input(INPUT_POST, 'archivemonths', FILTER_SANITIZE_NUMBER_INT);
1360
+	$settings = array_merge($settings, array('globalArchiveMonths' => $archivemonths));
1361 1361
 	
1362
-	$archiveyear = filter_input(INPUT_POST,'archiveyear',FILTER_SANITIZE_STRING);
1362
+	$archiveyear = filter_input(INPUT_POST, 'archiveyear', FILTER_SANITIZE_STRING);
1363 1363
 	if ($archiveyear == "archiveyear") {
1364
-		$settings = array_merge($settings,array('globalArchiveYear' => 'TRUE'));
1364
+		$settings = array_merge($settings, array('globalArchiveYear' => 'TRUE'));
1365 1365
 	} else {
1366
-		$settings = array_merge($settings,array('globalArchiveYear' => 'FALSE'));
1366
+		$settings = array_merge($settings, array('globalArchiveYear' => 'FALSE'));
1367 1367
 	}
1368
-	$archivekeepmonths = filter_input(INPUT_POST,'archivekeepmonths',FILTER_SANITIZE_NUMBER_INT);
1369
-	$settings = array_merge($settings,array('globalArchiveKeepMonths' => $archivekeepmonths));
1370
-	$archivekeeptrackmonths = filter_input(INPUT_POST,'archivekeeptrackmonths',FILTER_SANITIZE_NUMBER_INT);
1371
-	$settings = array_merge($settings,array('globalArchiveKeepTrackMonths' => $archivekeeptrackmonths));
1368
+	$archivekeepmonths = filter_input(INPUT_POST, 'archivekeepmonths', FILTER_SANITIZE_NUMBER_INT);
1369
+	$settings = array_merge($settings, array('globalArchiveKeepMonths' => $archivekeepmonths));
1370
+	$archivekeeptrackmonths = filter_input(INPUT_POST, 'archivekeeptrackmonths', FILTER_SANITIZE_NUMBER_INT);
1371
+	$settings = array_merge($settings, array('globalArchiveKeepTrackMonths' => $archivekeeptrackmonths));
1372 1372
 
1373
-	$britishairways = filter_input(INPUT_POST,'britishairways',FILTER_SANITIZE_STRING);
1374
-	$settings = array_merge($settings,array('globalBritishAirwaysKey' => $britishairways));
1375
-	$transavia = filter_input(INPUT_POST,'transavia',FILTER_SANITIZE_STRING);
1376
-	$settings = array_merge($settings,array('globalTransaviaKey' => $transavia));
1373
+	$britishairways = filter_input(INPUT_POST, 'britishairways', FILTER_SANITIZE_STRING);
1374
+	$settings = array_merge($settings, array('globalBritishAirwaysKey' => $britishairways));
1375
+	$transavia = filter_input(INPUT_POST, 'transavia', FILTER_SANITIZE_STRING);
1376
+	$settings = array_merge($settings, array('globalTransaviaKey' => $transavia));
1377 1377
 
1378
-	$lufthansakey = filter_input(INPUT_POST,'lufthansakey',FILTER_SANITIZE_STRING);
1379
-	$lufthansasecret = filter_input(INPUT_POST,'lufthansasecret',FILTER_SANITIZE_STRING);
1380
-	$settings = array_merge($settings,array('globalLufthansaKey' => array('key' => $lufthansakey,'secret' => $lufthansasecret)));
1378
+	$lufthansakey = filter_input(INPUT_POST, 'lufthansakey', FILTER_SANITIZE_STRING);
1379
+	$lufthansasecret = filter_input(INPUT_POST, 'lufthansasecret', FILTER_SANITIZE_STRING);
1380
+	$settings = array_merge($settings, array('globalLufthansaKey' => array('key' => $lufthansakey, 'secret' => $lufthansasecret)));
1381 1381
 
1382 1382
 	// Create in settings.php keys not yet configurable if not already here
1383 1383
 	//if (!isset($globalImageBingKey)) $settings = array_merge($settings,array('globalImageBingKey' => ''));
1384
-	if (!isset($globalDebug)) $settings = array_merge($settings,array('globalDebug' => 'TRUE'));
1384
+	if (!isset($globalDebug)) $settings = array_merge($settings, array('globalDebug' => 'TRUE'));
1385 1385
 
1386
-	$resetyearstats = filter_input(INPUT_POST,'resetyearstats',FILTER_SANITIZE_STRING);
1386
+	$resetyearstats = filter_input(INPUT_POST, 'resetyearstats', FILTER_SANITIZE_STRING);
1387 1387
 	if ($resetyearstats == 'resetyearstats') {
1388
-		$settings = array_merge($settings,array('globalDeleteLastYearStats' => 'TRUE'));
1388
+		$settings = array_merge($settings, array('globalDeleteLastYearStats' => 'TRUE'));
1389 1389
 	} else {
1390
-		$settings = array_merge($settings,array('globalDeleteLastYearStats' => 'FALSE'));
1390
+		$settings = array_merge($settings, array('globalDeleteLastYearStats' => 'FALSE'));
1391 1391
 	}
1392 1392
 
1393
-	$archive = filter_input(INPUT_POST,'archive',FILTER_SANITIZE_STRING);
1393
+	$archive = filter_input(INPUT_POST, 'archive', FILTER_SANITIZE_STRING);
1394 1394
 	if ($archive == 'archive') {
1395
-		$settings = array_merge($settings,array('globalArchive' => 'TRUE'));
1395
+		$settings = array_merge($settings, array('globalArchive' => 'TRUE'));
1396 1396
 	} else {
1397
-		$settings = array_merge($settings,array('globalArchive' => 'FALSE'));
1397
+		$settings = array_merge($settings, array('globalArchive' => 'FALSE'));
1398 1398
 	}
1399
-	$archiveresults = filter_input(INPUT_POST,'archiveresults',FILTER_SANITIZE_STRING);
1399
+	$archiveresults = filter_input(INPUT_POST, 'archiveresults', FILTER_SANITIZE_STRING);
1400 1400
 	if ($archiveresults == 'archiveresults') {
1401
-		$settings = array_merge($settings,array('globalArchiveResults' => 'TRUE'));
1401
+		$settings = array_merge($settings, array('globalArchiveResults' => 'TRUE'));
1402 1402
 	} else {
1403
-		$settings = array_merge($settings,array('globalArchiveResults' => 'FALSE'));
1403
+		$settings = array_merge($settings, array('globalArchiveResults' => 'FALSE'));
1404 1404
 	}
1405
-	$daemon = filter_input(INPUT_POST,'daemon',FILTER_SANITIZE_STRING);
1405
+	$daemon = filter_input(INPUT_POST, 'daemon', FILTER_SANITIZE_STRING);
1406 1406
 	if ($daemon == 'daemon') {
1407
-		$settings = array_merge($settings,array('globalDaemon' => 'TRUE'));
1407
+		$settings = array_merge($settings, array('globalDaemon' => 'TRUE'));
1408 1408
 	} else {
1409
-		$settings = array_merge($settings,array('globalDaemon' => 'FALSE'));
1409
+		$settings = array_merge($settings, array('globalDaemon' => 'FALSE'));
1410 1410
 	}
1411
-	$schedules = filter_input(INPUT_POST,'schedules',FILTER_SANITIZE_STRING);
1411
+	$schedules = filter_input(INPUT_POST, 'schedules', FILTER_SANITIZE_STRING);
1412 1412
 	if ($schedules == 'schedules') {
1413
-		$settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE'));
1413
+		$settings = array_merge($settings, array('globalSchedulesFetch' => 'TRUE'));
1414 1414
 	} else {
1415
-		$settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE'));
1415
+		$settings = array_merge($settings, array('globalSchedulesFetch' => 'FALSE'));
1416 1416
 	}
1417 1417
 
1418 1418
 /*
@@ -1423,274 +1423,274 @@  discard block
 block discarded – undo
1423 1423
 		$settings = array_merge($settings,array('globalFlightAware' => 'FALSE','globalSBS1' => 'TRUE'));
1424 1424
 	}
1425 1425
 */
1426
-	$settings = array_merge($settings,array('globalFlightAware' => 'FALSE'));
1427
-	if ($globalsbs == 'sbs') $settings = array_merge($settings,array('globalSBS1' => 'TRUE'));
1428
-	else $settings = array_merge($settings,array('globalSBS1' => 'FALSE'));
1429
-	if ($globalaprs == 'aprs') $settings = array_merge($settings,array('globalAPRS' => 'TRUE'));
1430
-	else $settings = array_merge($settings,array('globalAPRS' => 'FALSE'));
1426
+	$settings = array_merge($settings, array('globalFlightAware' => 'FALSE'));
1427
+	if ($globalsbs == 'sbs') $settings = array_merge($settings, array('globalSBS1' => 'TRUE'));
1428
+	else $settings = array_merge($settings, array('globalSBS1' => 'FALSE'));
1429
+	if ($globalaprs == 'aprs') $settings = array_merge($settings, array('globalAPRS' => 'TRUE'));
1430
+	else $settings = array_merge($settings, array('globalAPRS' => 'FALSE'));
1431 1431
 	$va = false;
1432 1432
 	if ($globalivao == 'ivao') {
1433
-		$settings = array_merge($settings,array('globalIVAO' => 'TRUE'));
1433
+		$settings = array_merge($settings, array('globalIVAO' => 'TRUE'));
1434 1434
 		$va = true;
1435
-	} else $settings = array_merge($settings,array('globalIVAO' => 'FALSE'));
1435
+	} else $settings = array_merge($settings, array('globalIVAO' => 'FALSE'));
1436 1436
 	if ($globalvatsim == 'vatsim') {
1437
-		$settings = array_merge($settings,array('globalVATSIM' => 'TRUE'));
1437
+		$settings = array_merge($settings, array('globalVATSIM' => 'TRUE'));
1438 1438
 		$va = true;
1439
-	} else $settings = array_merge($settings,array('globalVATSIM' => 'FALSE'));
1439
+	} else $settings = array_merge($settings, array('globalVATSIM' => 'FALSE'));
1440 1440
 	if ($globalphpvms == 'phpvms') {
1441
-		$settings = array_merge($settings,array('globalphpVMS' => 'TRUE'));
1441
+		$settings = array_merge($settings, array('globalphpVMS' => 'TRUE'));
1442 1442
 		$va = true;
1443
-	} else $settings = array_merge($settings,array('globalphpVMS' => 'FALSE'));
1443
+	} else $settings = array_merge($settings, array('globalphpVMS' => 'FALSE'));
1444 1444
 	if ($globalvam == 'vam') {
1445
-		$settings = array_merge($settings,array('globalVAM' => 'TRUE'));
1445
+		$settings = array_merge($settings, array('globalVAM' => 'TRUE'));
1446 1446
 		$va = true;
1447
-	} else $settings = array_merge($settings,array('globalVAM' => 'FALSE'));
1447
+	} else $settings = array_merge($settings, array('globalVAM' => 'FALSE'));
1448 1448
 	if ($va) {
1449
-		$settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE','globalTranslationFetch' => 'FALSE'));
1450
-	} else $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE'));
1449
+		$settings = array_merge($settings, array('globalSchedulesFetch' => 'FALSE', 'globalTranslationFetch' => 'FALSE'));
1450
+	} else $settings = array_merge($settings, array('globalSchedulesFetch' => 'TRUE', 'globalTranslationFetch' => 'TRUE'));
1451 1451
 	if ($globalva == 'va' || $va) {
1452
-		$settings = array_merge($settings,array('globalVA' => 'TRUE'));
1453
-		$settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE'));
1452
+		$settings = array_merge($settings, array('globalVA' => 'TRUE'));
1453
+		$settings = array_merge($settings, array('globalUsePilot' => 'TRUE', 'globalUseOwner' => 'FALSE'));
1454 1454
 	} else {
1455
-		$settings = array_merge($settings,array('globalVA' => 'FALSE'));
1456
-		if ($forcepilots) $settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE'));
1457
-		else $settings = array_merge($settings,array('globalUsePilot' => 'FALSE','globalUseOwner' => 'TRUE'));
1455
+		$settings = array_merge($settings, array('globalVA' => 'FALSE'));
1456
+		if ($forcepilots) $settings = array_merge($settings, array('globalUsePilot' => 'TRUE', 'globalUseOwner' => 'FALSE'));
1457
+		else $settings = array_merge($settings, array('globalUsePilot' => 'FALSE', 'globalUseOwner' => 'TRUE'));
1458 1458
 	}
1459 1459
 	
1460 1460
 	
1461
-	$mapoffline = filter_input(INPUT_POST,'mapoffline',FILTER_SANITIZE_STRING);
1461
+	$mapoffline = filter_input(INPUT_POST, 'mapoffline', FILTER_SANITIZE_STRING);
1462 1462
 	if ($mapoffline == 'mapoffline') {
1463
-		$settings = array_merge($settings,array('globalMapOffline' => 'TRUE'));
1463
+		$settings = array_merge($settings, array('globalMapOffline' => 'TRUE'));
1464 1464
 	} else {
1465
-		$settings = array_merge($settings,array('globalMapOffline' => 'FALSE'));
1465
+		$settings = array_merge($settings, array('globalMapOffline' => 'FALSE'));
1466 1466
 	}
1467
-	$globaloffline = filter_input(INPUT_POST,'globaloffline',FILTER_SANITIZE_STRING);
1467
+	$globaloffline = filter_input(INPUT_POST, 'globaloffline', FILTER_SANITIZE_STRING);
1468 1468
 	if ($globaloffline == 'globaloffline') {
1469
-		$settings = array_merge($settings,array('globalOffline' => 'TRUE'));
1469
+		$settings = array_merge($settings, array('globalOffline' => 'TRUE'));
1470 1470
 	} else {
1471
-		$settings = array_merge($settings,array('globalOffline' => 'FALSE'));
1471
+		$settings = array_merge($settings, array('globalOffline' => 'FALSE'));
1472 1472
 	}
1473 1473
 
1474
-	$notam = filter_input(INPUT_POST,'notam',FILTER_SANITIZE_STRING);
1474
+	$notam = filter_input(INPUT_POST, 'notam', FILTER_SANITIZE_STRING);
1475 1475
 	if ($notam == 'notam') {
1476
-		$settings = array_merge($settings,array('globalNOTAM' => 'TRUE'));
1476
+		$settings = array_merge($settings, array('globalNOTAM' => 'TRUE'));
1477 1477
 	} else {
1478
-		$settings = array_merge($settings,array('globalNOTAM' => 'FALSE'));
1478
+		$settings = array_merge($settings, array('globalNOTAM' => 'FALSE'));
1479 1479
 	}
1480
-	$owner = filter_input(INPUT_POST,'owner',FILTER_SANITIZE_STRING);
1480
+	$owner = filter_input(INPUT_POST, 'owner', FILTER_SANITIZE_STRING);
1481 1481
 	if ($owner == 'owner') {
1482
-		$settings = array_merge($settings,array('globalOwner' => 'TRUE'));
1482
+		$settings = array_merge($settings, array('globalOwner' => 'TRUE'));
1483 1483
 	} else {
1484
-		$settings = array_merge($settings,array('globalOwner' => 'FALSE'));
1484
+		$settings = array_merge($settings, array('globalOwner' => 'FALSE'));
1485 1485
 	}
1486
-	$map3d = filter_input(INPUT_POST,'map3d',FILTER_SANITIZE_STRING);
1486
+	$map3d = filter_input(INPUT_POST, 'map3d', FILTER_SANITIZE_STRING);
1487 1487
 	if ($map3d == 'map3d') {
1488
-		$settings = array_merge($settings,array('globalMap3D' => 'TRUE'));
1488
+		$settings = array_merge($settings, array('globalMap3D' => 'TRUE'));
1489 1489
 	} else {
1490
-		$settings = array_merge($settings,array('globalMap3D' => 'FALSE'));
1490
+		$settings = array_merge($settings, array('globalMap3D' => 'FALSE'));
1491 1491
 	}
1492
-	$crash = filter_input(INPUT_POST,'crash',FILTER_SANITIZE_STRING);
1492
+	$crash = filter_input(INPUT_POST, 'crash', FILTER_SANITIZE_STRING);
1493 1493
 	if ($crash == 'crash') {
1494
-		$settings = array_merge($settings,array('globalAccidents' => 'TRUE'));
1494
+		$settings = array_merge($settings, array('globalAccidents' => 'TRUE'));
1495 1495
 	} else {
1496
-		$settings = array_merge($settings,array('globalAccidents' => 'FALSE'));
1496
+		$settings = array_merge($settings, array('globalAccidents' => 'FALSE'));
1497 1497
 	}
1498
-	$fires = filter_input(INPUT_POST,'fires',FILTER_SANITIZE_STRING);
1498
+	$fires = filter_input(INPUT_POST, 'fires', FILTER_SANITIZE_STRING);
1499 1499
 	if ($fires == 'fires') {
1500
-		$settings = array_merge($settings,array('globalMapFires' => 'TRUE'));
1500
+		$settings = array_merge($settings, array('globalMapFires' => 'TRUE'));
1501 1501
 	} else {
1502
-		$settings = array_merge($settings,array('globalMapFires' => 'FALSE'));
1502
+		$settings = array_merge($settings, array('globalMapFires' => 'FALSE'));
1503 1503
 	}
1504
-	$firessupport = filter_input(INPUT_POST,'firessupport',FILTER_SANITIZE_STRING);
1504
+	$firessupport = filter_input(INPUT_POST, 'firessupport', FILTER_SANITIZE_STRING);
1505 1505
 	if ($firessupport == 'firessupport') {
1506
-		$settings = array_merge($settings,array('globalFires' => 'TRUE'));
1506
+		$settings = array_merge($settings, array('globalFires' => 'TRUE'));
1507 1507
 	} else {
1508
-		$settings = array_merge($settings,array('globalFires' => 'FALSE'));
1508
+		$settings = array_merge($settings, array('globalFires' => 'FALSE'));
1509 1509
 	}
1510
-	$mapsatellites = filter_input(INPUT_POST,'mapsatellites',FILTER_SANITIZE_STRING);
1510
+	$mapsatellites = filter_input(INPUT_POST, 'mapsatellites', FILTER_SANITIZE_STRING);
1511 1511
 	if ($mapsatellites == 'mapsatellites') {
1512
-		$settings = array_merge($settings,array('globalMapSatellites' => 'TRUE'));
1512
+		$settings = array_merge($settings, array('globalMapSatellites' => 'TRUE'));
1513 1513
 	} else {
1514
-		$settings = array_merge($settings,array('globalMapSatellites' => 'FALSE'));
1514
+		$settings = array_merge($settings, array('globalMapSatellites' => 'FALSE'));
1515 1515
 	}
1516
-	$map3ddefault = filter_input(INPUT_POST,'map3ddefault',FILTER_SANITIZE_STRING);
1516
+	$map3ddefault = filter_input(INPUT_POST, 'map3ddefault', FILTER_SANITIZE_STRING);
1517 1517
 	if ($map3ddefault == 'map3ddefault') {
1518
-		$settings = array_merge($settings,array('globalMap3Ddefault' => 'TRUE'));
1518
+		$settings = array_merge($settings, array('globalMap3Ddefault' => 'TRUE'));
1519 1519
 	} else {
1520
-		$settings = array_merge($settings,array('globalMap3Ddefault' => 'FALSE'));
1520
+		$settings = array_merge($settings, array('globalMap3Ddefault' => 'FALSE'));
1521 1521
 	}
1522
-	$map3dliveries = filter_input(INPUT_POST,'map3dliveries',FILTER_SANITIZE_STRING);
1522
+	$map3dliveries = filter_input(INPUT_POST, 'map3dliveries', FILTER_SANITIZE_STRING);
1523 1523
 	if ($map3dliveries == 'map3dliveries') {
1524
-		$settings = array_merge($settings,array('globalMap3DLiveries' => 'TRUE'));
1524
+		$settings = array_merge($settings, array('globalMap3DLiveries' => 'TRUE'));
1525 1525
 	} else {
1526
-		$settings = array_merge($settings,array('globalMap3DLiveries' => 'FALSE'));
1526
+		$settings = array_merge($settings, array('globalMap3DLiveries' => 'FALSE'));
1527 1527
 	}
1528
-	$translate = filter_input(INPUT_POST,'translate',FILTER_SANITIZE_STRING);
1528
+	$translate = filter_input(INPUT_POST, 'translate', FILTER_SANITIZE_STRING);
1529 1529
 	if ($translate == 'translate') {
1530
-		$settings = array_merge($settings,array('globalTranslate' => 'TRUE'));
1530
+		$settings = array_merge($settings, array('globalTranslate' => 'TRUE'));
1531 1531
 	} else {
1532
-		$settings = array_merge($settings,array('globalTranslate' => 'FALSE'));
1532
+		$settings = array_merge($settings, array('globalTranslate' => 'FALSE'));
1533 1533
 	}
1534
-	$realairlines = filter_input(INPUT_POST,'realairlines',FILTER_SANITIZE_STRING);
1534
+	$realairlines = filter_input(INPUT_POST, 'realairlines', FILTER_SANITIZE_STRING);
1535 1535
 	if ($realairlines == 'realairlines') {
1536
-		$settings = array_merge($settings,array('globalUseRealAirlines' => 'TRUE'));
1536
+		$settings = array_merge($settings, array('globalUseRealAirlines' => 'TRUE'));
1537 1537
 	} else {
1538
-		$settings = array_merge($settings,array('globalUseRealAirlines' => 'FALSE'));
1538
+		$settings = array_merge($settings, array('globalUseRealAirlines' => 'FALSE'));
1539 1539
 	}
1540
-	$estimation = filter_input(INPUT_POST,'estimation',FILTER_SANITIZE_STRING);
1540
+	$estimation = filter_input(INPUT_POST, 'estimation', FILTER_SANITIZE_STRING);
1541 1541
 	if ($estimation == 'estimation') {
1542
-		$settings = array_merge($settings,array('globalMapEstimation' => 'TRUE'));
1542
+		$settings = array_merge($settings, array('globalMapEstimation' => 'TRUE'));
1543 1543
 	} else {
1544
-		$settings = array_merge($settings,array('globalMapEstimation' => 'FALSE'));
1544
+		$settings = array_merge($settings, array('globalMapEstimation' => 'FALSE'));
1545 1545
 	}
1546
-	$metar = filter_input(INPUT_POST,'metar',FILTER_SANITIZE_STRING);
1546
+	$metar = filter_input(INPUT_POST, 'metar', FILTER_SANITIZE_STRING);
1547 1547
 	if ($metar == 'metar') {
1548
-		$settings = array_merge($settings,array('globalMETAR' => 'TRUE'));
1548
+		$settings = array_merge($settings, array('globalMETAR' => 'TRUE'));
1549 1549
 	} else {
1550
-		$settings = array_merge($settings,array('globalMETAR' => 'FALSE'));
1550
+		$settings = array_merge($settings, array('globalMETAR' => 'FALSE'));
1551 1551
 	}
1552
-	$metarcycle = filter_input(INPUT_POST,'metarcycle',FILTER_SANITIZE_STRING);
1552
+	$metarcycle = filter_input(INPUT_POST, 'metarcycle', FILTER_SANITIZE_STRING);
1553 1553
 	if ($metarcycle == 'metarcycle') {
1554
-		$settings = array_merge($settings,array('globalMETARcycle' => 'TRUE'));
1554
+		$settings = array_merge($settings, array('globalMETARcycle' => 'TRUE'));
1555 1555
 	} else {
1556
-		$settings = array_merge($settings,array('globalMETARcycle' => 'FALSE'));
1556
+		$settings = array_merge($settings, array('globalMETARcycle' => 'FALSE'));
1557 1557
 	}
1558
-	$fork = filter_input(INPUT_POST,'fork',FILTER_SANITIZE_STRING);
1558
+	$fork = filter_input(INPUT_POST, 'fork', FILTER_SANITIZE_STRING);
1559 1559
 	if ($fork == 'fork') {
1560
-		$settings = array_merge($settings,array('globalFork' => 'TRUE'));
1560
+		$settings = array_merge($settings, array('globalFork' => 'TRUE'));
1561 1561
 	} else {
1562
-		$settings = array_merge($settings,array('globalFork' => 'FALSE'));
1562
+		$settings = array_merge($settings, array('globalFork' => 'FALSE'));
1563 1563
 	}
1564 1564
 
1565
-	$colormap = filter_input(INPUT_POST,'colormap',FILTER_SANITIZE_STRING);
1565
+	$colormap = filter_input(INPUT_POST, 'colormap', FILTER_SANITIZE_STRING);
1566 1566
 	if ($colormap == 'colormap') {
1567
-		$settings = array_merge($settings,array('globalMapAltitudeColor' => 'TRUE'));
1567
+		$settings = array_merge($settings, array('globalMapAltitudeColor' => 'TRUE'));
1568 1568
 	} else {
1569
-		$settings = array_merge($settings,array('globalMapAltitudeColor' => 'FALSE'));
1569
+		$settings = array_merge($settings, array('globalMapAltitudeColor' => 'FALSE'));
1570 1570
 	}
1571 1571
 	
1572 1572
 	if (isset($_POST['aircrafticoncolor'])) {
1573
-		$aircrafticoncolor = filter_input(INPUT_POST,'aircrafticoncolor',FILTER_SANITIZE_STRING);
1574
-		$settings = array_merge($settings,array('globalAircraftIconColor' => substr($aircrafticoncolor,1)));
1573
+		$aircrafticoncolor = filter_input(INPUT_POST, 'aircrafticoncolor', FILTER_SANITIZE_STRING);
1574
+		$settings = array_merge($settings, array('globalAircraftIconColor' => substr($aircrafticoncolor, 1)));
1575 1575
 	}
1576 1576
 
1577
-	$airportzoom = filter_input(INPUT_POST,'airportzoom',FILTER_SANITIZE_NUMBER_INT);
1578
-	$settings = array_merge($settings,array('globalAirportZoom' => $airportzoom));
1577
+	$airportzoom = filter_input(INPUT_POST, 'airportzoom', FILTER_SANITIZE_NUMBER_INT);
1578
+	$settings = array_merge($settings, array('globalAirportZoom' => $airportzoom));
1579 1579
 
1580
-	$unitdistance = filter_input(INPUT_POST,'unitdistance',FILTER_SANITIZE_STRING);
1581
-	$settings = array_merge($settings,array('globalUnitDistance' => $unitdistance));
1582
-	$unitaltitude = filter_input(INPUT_POST,'unitaltitude',FILTER_SANITIZE_STRING);
1583
-	$settings = array_merge($settings,array('globalUnitAltitude' => $unitaltitude));
1584
-	$unitspeed = filter_input(INPUT_POST,'unitspeed',FILTER_SANITIZE_STRING);
1585
-	$settings = array_merge($settings,array('globalUnitSpeed' => $unitspeed));
1580
+	$unitdistance = filter_input(INPUT_POST, 'unitdistance', FILTER_SANITIZE_STRING);
1581
+	$settings = array_merge($settings, array('globalUnitDistance' => $unitdistance));
1582
+	$unitaltitude = filter_input(INPUT_POST, 'unitaltitude', FILTER_SANITIZE_STRING);
1583
+	$settings = array_merge($settings, array('globalUnitAltitude' => $unitaltitude));
1584
+	$unitspeed = filter_input(INPUT_POST, 'unitspeed', FILTER_SANITIZE_STRING);
1585
+	$settings = array_merge($settings, array('globalUnitSpeed' => $unitspeed));
1586 1586
 
1587
-	$mappopup = filter_input(INPUT_POST,'mappopup',FILTER_SANITIZE_STRING);
1587
+	$mappopup = filter_input(INPUT_POST, 'mappopup', FILTER_SANITIZE_STRING);
1588 1588
 	if ($mappopup == 'mappopup') {
1589
-		$settings = array_merge($settings,array('globalMapPopup' => 'TRUE'));
1589
+		$settings = array_merge($settings, array('globalMapPopup' => 'TRUE'));
1590 1590
 	} else {
1591
-		$settings = array_merge($settings,array('globalMapPopup' => 'FALSE'));
1591
+		$settings = array_merge($settings, array('globalMapPopup' => 'FALSE'));
1592 1592
 	}
1593
-	$airportpopup = filter_input(INPUT_POST,'airportpopup',FILTER_SANITIZE_STRING);
1593
+	$airportpopup = filter_input(INPUT_POST, 'airportpopup', FILTER_SANITIZE_STRING);
1594 1594
 	if ($airportpopup == 'airportpopup') {
1595
-		$settings = array_merge($settings,array('globalAirportPopup' => 'TRUE'));
1595
+		$settings = array_merge($settings, array('globalAirportPopup' => 'TRUE'));
1596 1596
 	} else {
1597
-		$settings = array_merge($settings,array('globalAirportPopup' => 'FALSE'));
1597
+		$settings = array_merge($settings, array('globalAirportPopup' => 'FALSE'));
1598 1598
 	}
1599
-	$maphistory = filter_input(INPUT_POST,'maphistory',FILTER_SANITIZE_STRING);
1599
+	$maphistory = filter_input(INPUT_POST, 'maphistory', FILTER_SANITIZE_STRING);
1600 1600
 	if ($maphistory == 'maphistory') {
1601
-		$settings = array_merge($settings,array('globalMapHistory' => 'TRUE'));
1601
+		$settings = array_merge($settings, array('globalMapHistory' => 'TRUE'));
1602 1602
 	} else {
1603
-		$settings = array_merge($settings,array('globalMapHistory' => 'FALSE'));
1603
+		$settings = array_merge($settings, array('globalMapHistory' => 'FALSE'));
1604 1604
 	}
1605
-	$maptooltip = filter_input(INPUT_POST,'maptooltip',FILTER_SANITIZE_STRING);
1605
+	$maptooltip = filter_input(INPUT_POST, 'maptooltip', FILTER_SANITIZE_STRING);
1606 1606
 	if ($maptooltip == 'maptooltip') {
1607
-		$settings = array_merge($settings,array('globalMapTooltip' => 'TRUE'));
1607
+		$settings = array_merge($settings, array('globalMapTooltip' => 'TRUE'));
1608 1608
 	} else {
1609
-		$settings = array_merge($settings,array('globalMapTooltip' => 'FALSE'));
1609
+		$settings = array_merge($settings, array('globalMapTooltip' => 'FALSE'));
1610 1610
 	}
1611
-	$flightroute = filter_input(INPUT_POST,'flightroute',FILTER_SANITIZE_STRING);
1611
+	$flightroute = filter_input(INPUT_POST, 'flightroute', FILTER_SANITIZE_STRING);
1612 1612
 	if ($flightroute == 'flightroute') {
1613
-		$settings = array_merge($settings,array('globalMapRoute' => 'TRUE'));
1613
+		$settings = array_merge($settings, array('globalMapRoute' => 'TRUE'));
1614 1614
 	} else {
1615
-		$settings = array_merge($settings,array('globalMapRoute' => 'FALSE'));
1615
+		$settings = array_merge($settings, array('globalMapRoute' => 'FALSE'));
1616 1616
 	}
1617
-	$flightremainingroute = filter_input(INPUT_POST,'flightremainingroute',FILTER_SANITIZE_STRING);
1617
+	$flightremainingroute = filter_input(INPUT_POST, 'flightremainingroute', FILTER_SANITIZE_STRING);
1618 1618
 	if ($flightremainingroute == 'flightremainingroute') {
1619
-		$settings = array_merge($settings,array('globalMapRemainingRoute' => 'TRUE'));
1619
+		$settings = array_merge($settings, array('globalMapRemainingRoute' => 'TRUE'));
1620 1620
 	} else {
1621
-		$settings = array_merge($settings,array('globalMapRemainingRoute' => 'FALSE'));
1621
+		$settings = array_merge($settings, array('globalMapRemainingRoute' => 'FALSE'));
1622 1622
 	}
1623
-	$allflights = filter_input(INPUT_POST,'allflights',FILTER_SANITIZE_STRING);
1623
+	$allflights = filter_input(INPUT_POST, 'allflights', FILTER_SANITIZE_STRING);
1624 1624
 	if ($allflights == 'allflights') {
1625
-		$settings = array_merge($settings,array('globalAllFlights' => 'TRUE'));
1625
+		$settings = array_merge($settings, array('globalAllFlights' => 'TRUE'));
1626 1626
 	} else {
1627
-		$settings = array_merge($settings,array('globalAllFlights' => 'FALSE'));
1627
+		$settings = array_merge($settings, array('globalAllFlights' => 'FALSE'));
1628 1628
 	}
1629
-	$bbox = filter_input(INPUT_POST,'bbox',FILTER_SANITIZE_STRING);
1629
+	$bbox = filter_input(INPUT_POST, 'bbox', FILTER_SANITIZE_STRING);
1630 1630
 	if ($bbox == 'bbox') {
1631
-		$settings = array_merge($settings,array('globalMapUseBbox' => 'TRUE'));
1631
+		$settings = array_merge($settings, array('globalMapUseBbox' => 'TRUE'));
1632 1632
 	} else {
1633
-		$settings = array_merge($settings,array('globalMapUseBbox' => 'FALSE'));
1633
+		$settings = array_merge($settings, array('globalMapUseBbox' => 'FALSE'));
1634 1634
 	}
1635
-	$groundaltitude = filter_input(INPUT_POST,'groundaltitude',FILTER_SANITIZE_STRING);
1635
+	$groundaltitude = filter_input(INPUT_POST, 'groundaltitude', FILTER_SANITIZE_STRING);
1636 1636
 	if ($groundaltitude == 'groundaltitude') {
1637
-		$settings = array_merge($settings,array('globalGroundAltitude' => 'TRUE'));
1637
+		$settings = array_merge($settings, array('globalGroundAltitude' => 'TRUE'));
1638 1638
 	} else {
1639
-		$settings = array_merge($settings,array('globalGroundAltitude' => 'FALSE'));
1639
+		$settings = array_merge($settings, array('globalGroundAltitude' => 'FALSE'));
1640 1640
 	}
1641
-	$waypoints = filter_input(INPUT_POST,'waypoints',FILTER_SANITIZE_STRING);
1641
+	$waypoints = filter_input(INPUT_POST, 'waypoints', FILTER_SANITIZE_STRING);
1642 1642
 	if ($waypoints == 'waypoints') {
1643
-		$settings = array_merge($settings,array('globalWaypoints' => 'TRUE'));
1643
+		$settings = array_merge($settings, array('globalWaypoints' => 'TRUE'));
1644 1644
 	} else {
1645
-		$settings = array_merge($settings,array('globalWaypoints' => 'FALSE'));
1645
+		$settings = array_merge($settings, array('globalWaypoints' => 'FALSE'));
1646 1646
 	}
1647
-	$geoid = filter_input(INPUT_POST,'geoid',FILTER_SANITIZE_STRING);
1647
+	$geoid = filter_input(INPUT_POST, 'geoid', FILTER_SANITIZE_STRING);
1648 1648
 	if ($geoid == 'geoid') {
1649
-		$settings = array_merge($settings,array('globalGeoid' => 'TRUE'));
1649
+		$settings = array_merge($settings, array('globalGeoid' => 'TRUE'));
1650 1650
 	} else {
1651
-		$settings = array_merge($settings,array('globalGeoid' => 'FALSE'));
1651
+		$settings = array_merge($settings, array('globalGeoid' => 'FALSE'));
1652 1652
 	}
1653
-	$geoid_source = filter_input(INPUT_POST,'geoid_source',FILTER_SANITIZE_STRING);
1654
-	$settings = array_merge($settings,array('globalGeoidSource' => $geoid_source));
1653
+	$geoid_source = filter_input(INPUT_POST, 'geoid_source', FILTER_SANITIZE_STRING);
1654
+	$settings = array_merge($settings, array('globalGeoidSource' => $geoid_source));
1655 1655
 
1656
-	$noairlines = filter_input(INPUT_POST,'noairlines',FILTER_SANITIZE_STRING);
1656
+	$noairlines = filter_input(INPUT_POST, 'noairlines', FILTER_SANITIZE_STRING);
1657 1657
 	if ($noairlines == 'noairlines') {
1658
-		$settings = array_merge($settings,array('globalNoAirlines' => 'TRUE'));
1658
+		$settings = array_merge($settings, array('globalNoAirlines' => 'TRUE'));
1659 1659
 	} else {
1660
-		$settings = array_merge($settings,array('globalNoAirlines' => 'FALSE'));
1660
+		$settings = array_merge($settings, array('globalNoAirlines' => 'FALSE'));
1661 1661
 	}
1662 1662
 
1663
-	$tsk = filter_input(INPUT_POST,'tsk',FILTER_SANITIZE_STRING);
1663
+	$tsk = filter_input(INPUT_POST, 'tsk', FILTER_SANITIZE_STRING);
1664 1664
 	if ($tsk == 'tsk') {
1665
-		$settings = array_merge($settings,array('globalTSK' => 'TRUE'));
1665
+		$settings = array_merge($settings, array('globalTSK' => 'TRUE'));
1666 1666
 	} else {
1667
-		$settings = array_merge($settings,array('globalTSK' => 'FALSE'));
1667
+		$settings = array_merge($settings, array('globalTSK' => 'FALSE'));
1668 1668
 	}
1669
-	$mapmatching = filter_input(INPUT_POST,'mapmatching',FILTER_SANITIZE_STRING);
1669
+	$mapmatching = filter_input(INPUT_POST, 'mapmatching', FILTER_SANITIZE_STRING);
1670 1670
 	if ($mapmatching == 'mapmatching') {
1671
-		$settings = array_merge($settings,array('globalMapMatching' => 'TRUE'));
1671
+		$settings = array_merge($settings, array('globalMapMatching' => 'TRUE'));
1672 1672
 	} else {
1673
-		$settings = array_merge($settings,array('globalMapMatching' => 'FALSE'));
1673
+		$settings = array_merge($settings, array('globalMapMatching' => 'FALSE'));
1674 1674
 	}
1675
-	$mapmatchingsource = filter_input(INPUT_POST,'mapmatchingsource',FILTER_SANITIZE_STRING);
1676
-	$settings = array_merge($settings,array('globalMapMatchingSource' => $mapmatchingsource));
1677
-	$graphhopper = filter_input(INPUT_POST,'graphhopper',FILTER_SANITIZE_STRING);
1678
-	$settings = array_merge($settings,array('globalGraphHopperKey' => $graphhopper));
1675
+	$mapmatchingsource = filter_input(INPUT_POST, 'mapmatchingsource', FILTER_SANITIZE_STRING);
1676
+	$settings = array_merge($settings, array('globalMapMatchingSource' => $mapmatchingsource));
1677
+	$graphhopper = filter_input(INPUT_POST, 'graphhopper', FILTER_SANITIZE_STRING);
1678
+	$settings = array_merge($settings, array('globalGraphHopperKey' => $graphhopper));
1679 1679
 
1680
-	if (!isset($globalTransaction)) $settings = array_merge($settings,array('globalTransaction' => 'TRUE'));
1680
+	if (!isset($globalTransaction)) $settings = array_merge($settings, array('globalTransaction' => 'TRUE'));
1681 1681
 
1682 1682
 	// Set some defaults values...
1683 1683
 	if (!isset($globalAircraftImageSources)) {
1684
-	    $globalAircraftImageSources = array('ivaomtl','wikimedia','airportdata','deviantart','flickr','bing','jetphotos','planepictures','planespotters');
1685
-	    $settings = array_merge($settings,array('globalAircraftImageSources' => $globalAircraftImageSources));
1684
+	    $globalAircraftImageSources = array('ivaomtl', 'wikimedia', 'airportdata', 'deviantart', 'flickr', 'bing', 'jetphotos', 'planepictures', 'planespotters');
1685
+	    $settings = array_merge($settings, array('globalAircraftImageSources' => $globalAircraftImageSources));
1686 1686
 	}
1687 1687
 
1688 1688
 	if (!isset($globalSchedulesSources)) {
1689
-	    $globalSchedulesSources = array('flightmapper','costtotravel','flightradar24','flightaware');
1690
-    	    $settings = array_merge($settings,array('globalSchedulesSources' => $globalSchedulesSources));
1689
+	    $globalSchedulesSources = array('flightmapper', 'costtotravel', 'flightradar24', 'flightaware');
1690
+    	    $settings = array_merge($settings, array('globalSchedulesSources' => $globalSchedulesSources));
1691 1691
     	}
1692 1692
 
1693
-	$settings = array_merge($settings,array('globalInstalled' => 'TRUE'));
1693
+	$settings = array_merge($settings, array('globalInstalled' => 'TRUE'));
1694 1694
 
1695 1695
 	if ($error == '') settings::modify_settings($settings);
1696 1696
 	if ($error == '') settings::comment_settings($settings_comment);
Please login to merge, or discard this patch.
live-geojson.php 1 patch
Spacing   +79 added lines, -79 removed lines patch added patch discarded remove patch
@@ -63,17 +63,17 @@  discard block
 block discarded – undo
63 63
 $min = true;
64 64
 $allhistory = false;
65 65
 $filter['source'] = array();
66
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt'));
67
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup'));
68
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars'));
69
-if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs'));
70
-if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs'));
71
-if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING);
72
-if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING);
73
-if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING);
74
-if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING);
75
-if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING);
76
-if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING);
66
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'], array('vatsimtxt'));
67
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'], array('whazzup'));
68
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'], array('phpvmacars'));
69
+if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'], array('sbs', 'famaprs'));
70
+if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'], array('aprs'));
71
+if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'], FILTER_SANITIZE_STRING);
72
+if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'], FILTER_SANITIZE_STRING);
73
+if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',', $_COOKIE['filter_Airlines']), FILTER_SANITIZE_STRING);
74
+if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',', $_COOKIE['filter_Sources']), FILTER_SANITIZE_STRING);
75
+if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'], FILTER_SANITIZE_STRING);
76
+if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'], FILTER_SANITIZE_STRING);
77 77
 
78 78
 if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) {
79 79
 	$min = true;
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 $spotter_array = array();
83 83
 
84 84
 if (isset($_GET['ident'])) {
85
-	$ident = urldecode(filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING));
85
+	$ident = urldecode(filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING));
86 86
 	if ($tracker) {
87 87
 		$spotter_array = $TrackerLive->getLastLiveTrackerDataByIdent($ident);
88 88
 	} elseif ($marine) {
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 	}
97 97
 	$allhistory = true;
98 98
 } elseif (isset($_GET['flightaware_id'])) {
99
-	$flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING);
99
+	$flightaware_id = filter_input(INPUT_GET, 'flightaware_id', FILTER_SANITIZE_STRING);
100 100
 	$spotter_array = $SpotterLive->getLastLiveSpotterDataById($flightaware_id);
101 101
 	if (empty($spotter_array)) {
102 102
 		$from_archive = true;
@@ -104,11 +104,11 @@  discard block
 block discarded – undo
104 104
 	}
105 105
 	$allhistory = true;
106 106
 } elseif (isset($_GET['famtrack_id'])) {
107
-	$famtrack_id = urldecode(filter_input(INPUT_GET,'famtrack_id',FILTER_SANITIZE_STRING));
107
+	$famtrack_id = urldecode(filter_input(INPUT_GET, 'famtrack_id', FILTER_SANITIZE_STRING));
108 108
 	$spotter_array = $TrackerLive->getLastLiveTrackerDataById($famtrack_id);
109 109
 	$allhistory = true;
110 110
 } elseif (isset($_GET['fammarine_id'])) {
111
-	$fammarine_id = urldecode(filter_input(INPUT_GET,'fammarine_id',FILTER_SANITIZE_STRING));
111
+	$fammarine_id = urldecode(filter_input(INPUT_GET, 'fammarine_id', FILTER_SANITIZE_STRING));
112 112
 	$spotter_array = $MarineLive->getLastLiveMarineDataById($fammarine_id);
113 113
 	$allhistory = true;
114 114
 /*
@@ -128,15 +128,15 @@  discard block
 block discarded – undo
128 128
 */
129 129
 } elseif (isset($globalMapUseBbox) && $globalMapUseBbox && isset($_GET['coord']) && $min) {
130 130
 	$usecoord = true;
131
-	$coord = explode(',',$_GET['coord']);
132
-	if (filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT) 
131
+	$coord = explode(',', $_GET['coord']);
132
+	if (filter_var($coord[0], FILTER_VALIDATE_FLOAT) && filter_var($coord[1], FILTER_VALIDATE_FLOAT) && filter_var($coord[2], FILTER_VALIDATE_FLOAT) && filter_var($coord[3], FILTER_VALIDATE_FLOAT) 
133 133
 	    && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0) {
134 134
 		if ($tracker) {
135
-			$spotter_array = $TrackerLive->getMinLiveTrackerDatabyCoord($coord,$filter);
135
+			$spotter_array = $TrackerLive->getMinLiveTrackerDatabyCoord($coord, $filter);
136 136
 		} elseif ($marine) {
137
-			$spotter_array = $MarineLive->getMinLiveMarineDatabyCoord($coord,$filter);
137
+			$spotter_array = $MarineLive->getMinLiveMarineDatabyCoord($coord, $filter);
138 138
 		} else {
139
-			$spotter_array = $SpotterLive->getMinLiveSpotterDatabyCoord($coord,$filter);
139
+			$spotter_array = $SpotterLive->getMinLiveSpotterDatabyCoord($coord, $filter);
140 140
 		}
141 141
 	} else {
142 142
 		if ($tracker) {
@@ -151,12 +151,12 @@  discard block
 block discarded – undo
151 151
 	$from_archive = true;
152 152
 //	$begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~')));
153 153
 //	$enddate = filter_input(INPUT_GET,'enddate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~')));
154
-	$begindate = filter_input(INPUT_GET,'begindate',FILTER_SANITIZE_NUMBER_INT);
155
-	$enddate = filter_input(INPUT_GET,'enddate',FILTER_SANITIZE_NUMBER_INT);
156
-	$archivespeed = filter_input(INPUT_GET,'speed',FILTER_SANITIZE_NUMBER_INT);
157
-	$begindate = date('Y-m-d H:i:s',$begindate);
158
-	$enddate = date('Y-m-d H:i:s',$enddate);
159
-	$spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate,$enddate,$filter);
154
+	$begindate = filter_input(INPUT_GET, 'begindate', FILTER_SANITIZE_NUMBER_INT);
155
+	$enddate = filter_input(INPUT_GET, 'enddate', FILTER_SANITIZE_NUMBER_INT);
156
+	$archivespeed = filter_input(INPUT_GET, 'speed', FILTER_SANITIZE_NUMBER_INT);
157
+	$begindate = date('Y-m-d H:i:s', $begindate);
158
+	$enddate = date('Y-m-d H:i:s', $enddate);
159
+	$spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate, $enddate, $filter);
160 160
 } elseif ($min) {
161 161
 	if ($tracker) {
162 162
 		$spotter_array = $TrackerLive->getMinLiveTrackerData($filter);
@@ -168,17 +168,17 @@  discard block
 block discarded – undo
168 168
 #	$min = true;
169 169
 } else {
170 170
 	if ($tracker) {
171
-		$spotter_array = $TrackerLive->getLiveTrackerData('','',$filter);
171
+		$spotter_array = $TrackerLive->getLiveTrackerData('', '', $filter);
172 172
 	} elseif ($marine) {
173
-		$spotter_array = $marineLive->getLiveMarineData('','',$filter);
173
+		$spotter_array = $marineLive->getLiveMarineData('', '', $filter);
174 174
 	} else {
175
-		$spotter_array = $SpotterLive->getLiveSpotterData('','',$filter);
175
+		$spotter_array = $SpotterLive->getLiveSpotterData('', '', $filter);
176 176
 	}
177 177
 }
178 178
 
179 179
 if ($usecoord) {
180 180
 	if (isset($_GET['archive'])) {
181
-		$flightcnt = $SpotterArchive->getLiveSpotterCount($begindate,$enddate,$filter);
181
+		$flightcnt = $SpotterArchive->getLiveSpotterCount($begindate, $enddate, $filter);
182 182
 	} else {
183 183
 		if ($tracker) {
184 184
 			$flightcnt = $TrackerLive->getLiveTrackerCount($filter);
@@ -191,9 +191,9 @@  discard block
 block discarded – undo
191 191
 	if ($flightcnt == '') $flightcnt = 0;
192 192
 } else $flightcnt = 0;
193 193
 
194
-$sqltime = round(microtime(true)-$begintime,2);
194
+$sqltime = round(microtime(true) - $begintime, 2);
195 195
 
196
-$currenttime = filter_input(INPUT_GET,'currenttime',FILTER_SANITIZE_NUMBER_INT);
196
+$currenttime = filter_input(INPUT_GET, 'currenttime', FILTER_SANITIZE_NUMBER_INT);
197 197
 if ($currenttime != '') $currenttime = round($currenttime/1000);
198 198
 
199 199
 if ((!isset($_COOKIE['flightestimation']) && isset($globalMapEstimation) && $globalMapEstimation == FALSE) || (isset($_COOKIE['flightestimation']) && $_COOKIE['flightestimation'] == 'false')) $usenextlatlon = false;
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 		if (!empty($spotter_array) && is_array($spotter_array))
213 213
 		{
214 214
 			$output .= '"features": [';
215
-			foreach($spotter_array as $spotter_item)
215
+			foreach ($spotter_array as $spotter_item)
216 216
 			{
217 217
 				$j++;
218 218
 				unset($idistance);
@@ -269,8 +269,8 @@  discard block
 block discarded – undo
269 269
 */
270 270
 							//$output .= '"fc": "'.$spotter_item['nb'].'",';
271 271
 						if (isset($spotter_item['ident']) && $spotter_item['ident'] != '') {
272
-							if ($compress) $output .= '"c": "'.str_replace('\\','',$spotter_item['ident']).'",';
273
-							else $output .= '"callsign": "'.str_replace('\\','',$spotter_item['ident']).'",';
272
+							if ($compress) $output .= '"c": "'.str_replace('\\', '', $spotter_item['ident']).'",';
273
+							else $output .= '"callsign": "'.str_replace('\\', '', $spotter_item['ident']).'",';
274 274
 							//"
275 275
 						} else {
276 276
 							if ($compress) $output .= '"c": "NA",';
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 						if (isset($spotter_item['registration'])) $output .= '"registration": "'.$spotter_item['registration'].'",';
280 280
 						if (isset($spotter_item['aircraft_name']) && isset($spotter_item['aircraft_type'])) {
281 281
 							$output .= '"aircraft_name": "'.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')",';
282
-							$output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ','_',$spotter_item['aircraft_name'])).'",';
282
+							$output .= '"aircraft_wiki": "http://'.strtolower($globalLanguage).'.wikipedia.org/wiki/'.urlencode(str_replace(' ', '_', $spotter_item['aircraft_name'])).'",';
283 283
 						} elseif (isset($spotter_item['aircraft_type'])) {
284 284
 							$output .= '"aircraft_name": "NA ('.$spotter_item['aircraft_type'].')",';
285 285
 						} elseif (!$min) {
@@ -422,15 +422,15 @@  discard block
 block discarded – undo
422 422
 						if (isset($archivespeed) || $usenextlatlon) {
423 423
 							if (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') {
424 424
 								if (isset($spotter_item['arrival_airport_latitude'])) {
425
-									$cheading = $Common->getHeading($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['arrival_airport_latitude'],$spotter_item['arrival_airport_longitude']);
426
-									$idistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['arrival_airport_latitude'],$spotter_item['arrival_airport_longitude']);
425
+									$cheading = $Common->getHeading($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['arrival_airport_latitude'], $spotter_item['arrival_airport_longitude']);
426
+									$idistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['arrival_airport_latitude'], $spotter_item['arrival_airport_longitude']);
427 427
 									$farr_lat = $spotter_item['arrival_airport_latitude'];
428 428
 									$farr_lon = $spotter_item['arrival_airport_longitude'];
429 429
 								} else {
430 430
 									$aairport = $Spotter->getAllAirportInfo($spotter_item['arrival_airport']);
431 431
 									if (isset($aairport[0]['latitude'])) {
432
-										$cheading = $Common->getHeading($spotter_item['latitude'],$spotter_item['longitude'],$aairport[0]['latitude'],$aairport[0]['longitude']);
433
-										$idistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$aairport[0]['latitude'],$aairport[0]['longitude']);
432
+										$cheading = $Common->getHeading($spotter_item['latitude'], $spotter_item['longitude'], $aairport[0]['latitude'], $aairport[0]['longitude']);
433
+										$idistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $aairport[0]['latitude'], $aairport[0]['longitude']);
434 434
 										$farr_lat = $aairport[0]['latitude'];
435 435
 										$farr_lon = $aairport[0]['longitude'];
436 436
 									}
@@ -443,59 +443,59 @@  discard block
 block discarded – undo
443 443
 						if ($currenttime != '') {
444 444
 							if (strtotime($spotter_item['date']) < $currenttime) {
445 445
 								if (isset($archivespeed)) {
446
-									$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh));
447
-									$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
446
+									$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading, $archivespeed, ($currenttime - strtotime($spotter_item['date']) + $globalMapRefresh));
447
+									$fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']);
448 448
 									if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
449 449
 									else {
450
-										$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,$archivespeed,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh));
451
-										$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
450
+										$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $cheading, $archivespeed, ($currenttime - strtotime($spotter_item['date']) + $globalMapRefresh));
451
+										$fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']);
452 452
 										if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
453 453
 										else {
454
-											$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed);
454
+											$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading, $archivespeed);
455 455
 											$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
456 456
 										}
457 457
 									}
458 458
 								} elseif ($usenextlatlon) {
459
-									$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,1,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh));
460
-									$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
459
+									$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading, 1, ($currenttime - strtotime($spotter_item['date']) + $globalMapRefresh));
460
+									$fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']);
461 461
 									if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
462 462
 									else {
463
-										$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,1,($currenttime-strtotime($spotter_item['date'])+$globalMapRefresh));
464
-										$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
463
+										$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $cheading, 1, ($currenttime - strtotime($spotter_item['date']) + $globalMapRefresh));
464
+										$fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']);
465 465
 										if (!isset($idistance) || $fdistance < $idistance) $output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
466 466
 										else {
467
-											$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading);
467
+											$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading);
468 468
 											$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
469 469
 										}
470 470
 									}
471 471
 								}
472 472
 							} else {
473 473
 								if (isset($archivespeed)) {
474
-									$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed);
474
+									$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading, $archivespeed);
475 475
 									$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
476 476
 								} elseif ($usenextlatlon) {
477
-									$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading);
477
+									$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading);
478 478
 									$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
479 479
 								}
480 480
 							}
481 481
 						} else {
482 482
 							if (isset($archivespeed)) {
483
-								$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed);
484
-								$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
483
+								$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading, $archivespeed);
484
+								$fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']);
485 485
 								if (!isset($idistance) || $fdistance < $idistance) {
486 486
 									$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
487 487
 								} else {
488
-									$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,$archivespeed);
488
+									$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $cheading, $archivespeed);
489 489
 									//$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
490 490
 									$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
491 491
 								}
492 492
 							} elseif ($usenextlatlon) {
493
-								$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading);
494
-								$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
493
+								$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading);
494
+								$fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']);
495 495
 								if (!isset($idistance) || $fdistance < $idistance) {
496 496
 										$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
497 497
 								} else {
498
-									$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading);
498
+									$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $cheading);
499 499
 									//$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
500 500
 									$output .= '"nextlatlon": ['.$nextcoord['latitude'].','.$nextcoord['longitude'].'],';
501 501
 								}
@@ -504,7 +504,7 @@  discard block
 block discarded – undo
504 504
 
505 505
 						if (!$min) $output .= '"image": "'.$image.'",';
506 506
 						if (isset($spotter_item['image_copyright']) && $spotter_item['image_copyright'] != '') {
507
-							$output .= '"image_copyright": "'.str_replace('"',"'",trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'',$spotter_item['image_copyright']))).'",';
507
+							$output .= '"image_copyright": "'.str_replace('"', "'", trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '', $spotter_item['image_copyright']))).'",';
508 508
 						}
509 509
 						if (isset($spotter_item['image_source_website'])) {
510 510
 							$output .= '"image_source_website": "'.urlencode($spotter_item['image_source_website']).'",';
@@ -526,7 +526,7 @@  discard block
 block discarded – undo
526 526
 							$output .= '"waypoints": "'.$spotter_item['waypoints'].'",';
527 527
 						}
528 528
 						if (isset($spotter_item['acars'])) {
529
-							$output .= '"acars": "'.trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"), '<br />',$spotter_item['acars']['message'])).'",';
529
+							$output .= '"acars": "'.trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '<br />', $spotter_item['acars']['message'])).'",';
530 530
 						}
531 531
 						// type when not aircraft ?
532 532
 						if (isset($spotter_item['type'])) {
@@ -546,12 +546,12 @@  discard block
 block discarded – undo
546 546
 								if ($currenttime != '') {
547 547
 									if (strtotime($spotter_item['date']) < $currenttime) {
548 548
 										if (!isset($archivespeed)) $archivespeed = 1;
549
-										$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$heading,$archivespeed,($currenttime-strtotime($spotter_item['date'])));
550
-										$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
549
+										$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $heading, $archivespeed, ($currenttime - strtotime($spotter_item['date'])));
550
+										$fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']);
551 551
 										if (!isset($idistance) || $fdistance < $idistance) $output .= $nextcoord['longitude'].','.$nextcoord['latitude'];
552 552
 										else {
553
-											$nextcoord = $Common->nextcoord($spotter_item['latitude'],$spotter_item['longitude'],$spotter_item['ground_speed'],$cheading,$archivespeed,($currenttime-strtotime($spotter_item['date'])));
554
-											$fdistance = $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$nextcoord['latitude'],$nextcoord['longitude']);
553
+											$nextcoord = $Common->nextcoord($spotter_item['latitude'], $spotter_item['longitude'], $spotter_item['ground_speed'], $cheading, $archivespeed, ($currenttime - strtotime($spotter_item['date'])));
554
+											$fdistance = $Common->distance($spotter_item['latitude'], $spotter_item['longitude'], $nextcoord['latitude'], $nextcoord['longitude']);
555 555
 											if (!isset($idistance) || $fdistance < $idistance) $output .= $nextcoord['longitude'].','.$nextcoord['latitude'];
556 556
 											else {
557 557
 												$output .= $spotter_item['longitude'].', ';
@@ -630,7 +630,7 @@  discard block
 block discarded – undo
630 630
                 
631 631
 			}
632 632
 */
633
-				$history = filter_input(INPUT_GET,'history',FILTER_SANITIZE_STRING);
633
+				$history = filter_input(INPUT_GET, 'history', FILTER_SANITIZE_STRING);
634 634
 				if ($history == '' && isset($_COOKIE['history'])) $history = $_COOKIE['history'];
635 635
 				
636 636
 				if (
@@ -638,11 +638,11 @@  discard block
 block discarded – undo
638 638
 				    || ((isset($globalMapHistory) && $globalMapHistory) || $allhistory)
639 639
 				//    || (isset($history) && $history != '' && $history != 'NA' && ($history == $spotter_item['ident'] || $history == $spotter_item['flightaware_id']))
640 640
 				//    || (isset($history) && $history != '' && $history != 'NA' && $history == $spotter_item['ident'])
641
-				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id']))
641
+				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id']))
642 642
 				    || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])
643
-				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['fammarine_id']))
643
+				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['fammarine_id']))
644 644
 				    || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['fammarine_id']) && $_GET['fammarine_id'] == $spotter_item['fammarine_id'])
645
-				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['famtrackid']))
645
+				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['famtrackid']))
646 646
 				    || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['famtrackid']) && $_GET['famtrackid'] == $spotter_item['famtrackid'])
647 647
 				    ) {
648 648
 					if ($tracker) {
@@ -698,9 +698,9 @@  discard block
 block discarded – undo
698 698
 								else $output_history = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "history","altitude": "'.$alt.'"},"geometry": {"type": "LineString","coordinates": [';
699 699
 							}
700 700
 							$output_history .= '[';
701
-							$output_history .=  $spotter_history['longitude'].', ';
702
-							$output_history .=  $spotter_history['latitude'].', ';
703
-							$output_history .=  $spotter_history['altitude']*30.48;
701
+							$output_history .= $spotter_history['longitude'].', ';
702
+							$output_history .= $spotter_history['latitude'].', ';
703
+							$output_history .= $spotter_history['altitude']*30.48;
704 704
 							$output_history .= '],';
705 705
 							/*
706 706
 							if ($from_archive === false) {
@@ -719,8 +719,8 @@  discard block
 block discarded – undo
719 719
 								$d = true;
720 720
 							}
721 721
 							$output_history .= '[';
722
-							$output_history .=  $spotter_history['longitude'].', ';
723
-							$output_history .=  $spotter_history['latitude'];
722
+							$output_history .= $spotter_history['longitude'].', ';
723
+							$output_history .= $spotter_history['latitude'];
724 724
 							$output_history .= '],';
725 725
 							/*
726 726
 							if ($from_archive === false) {
@@ -736,9 +736,9 @@  discard block
 block discarded – undo
736 736
 						//echo $output_history;
737 737
 						if ($from_archive === false) {
738 738
 							$output_historyd = '[';
739
-							$output_historyd .=  $spotter_item['longitude'].', ';
740
-							$output_historyd .=  $spotter_item['latitude'];
741
-							if (isset($spotter_history['altitude'])) $output_historyd .=  ','.$spotter_item['altitude']*30.48;
739
+							$output_historyd .= $spotter_item['longitude'].', ';
740
+							$output_historyd .= $spotter_item['latitude'];
741
+							if (isset($spotter_history['altitude'])) $output_historyd .= ','.$spotter_item['altitude']*30.48;
742 742
 							$output_historyd .= '],';
743 743
 							//$output_history = $output_historyd.$output_history;
744 744
 							$output_history = $output_history.$output_historyd;
@@ -752,7 +752,7 @@  discard block
 block discarded – undo
752 752
 					}
753 753
 				}
754 754
 				
755
-				if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id']))
755
+				if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id']))
756 756
 				    || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']))
757 757
 				     && (isset($spotter_item['departure_airport']) 
758 758
 				        && $spotter_item['departure_airport'] != 'NA' 
@@ -786,7 +786,7 @@  discard block
 block discarded – undo
786 786
 
787 787
 				//if (isset($history) && $history != '' && $history == $spotter_item['ident'] && isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA' && isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA' && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") || (!isset($_COOKIE['MapRoute']) && (!isset($globalMapRoute) || (isset($globalMapRoute) && $globalMapRoute))))) {
788 788
 				//if (isset($history) && $history != '' && $history == $spotter_item['ident'] && isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA' && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") || (!isset($_COOKIE['MapRoute']) && (!isset($globalMapRoute) || (isset($globalMapRoute) && $globalMapRoute))))) {
789
-				if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id']))
789
+				if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-', '', $history) == str_replace('-', '', $spotter_item['flightaware_id']))
790 790
 				    || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']))
791 791
 				     && (isset($spotter_item['arrival_airport']) 
792 792
 				        && $spotter_item['arrival_airport'] != 'NA' 
@@ -817,7 +817,7 @@  discard block
 block discarded – undo
817 817
 			$output  = substr($output, 0, -1);
818 818
 			$output .= ']';
819 819
 			$output .= ',"initial_sqltime": "'.$sqltime.'",';
820
-			$output .= '"totaltime": "'.round(microtime(true)-$begintime,2).'",';
820
+			$output .= '"totaltime": "'.round(microtime(true) - $begintime, 2).'",';
821 821
 			if (isset($begindate)) $output .= '"archive_date": "'.$begindate.'",';
822 822
 			$output .= '"fc": "'.$j.'"';
823 823
 		} else {
Please login to merge, or discard this patch.