Completed
Push — master ( 56826b...44a8cc )
by Yannick
26:44
created
search.php 1 patch
Braces   +142 added lines, -39 removed lines patch added patch discarded remove patch
@@ -46,8 +46,10 @@  discard block
 block discarded – undo
46 46
 			$end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".date("Y-m-d",strtotime($_GET['end_date']))." 00:00:00";
47 47
 			$sql_date = $end_date;
48 48
 		}
49
-	} else $sql_date = '';
50
-}
49
+	} else {
50
+		$sql_date = '';
51
+	}
52
+	}
51 53
 
52 54
 if (isset($_GET['highest_altitude'])) {
53 55
 	//for altitude manipulation
@@ -61,8 +63,12 @@  discard block
 block discarded – undo
61 63
 	} else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){
62 64
 		$start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT).",60000";
63 65
 		$sql_altitude = $start_altitude;
64
-	} else $sql_altitude = '';
65
-} else $sql_altitude = '';
66
+	} else {
67
+		$sql_altitude = '';
68
+	}
69
+	} else {
70
+	$sql_altitude = '';
71
+}
66 72
 
67 73
 //calculuation for the pagination
68 74
 if(!isset($_GET['limit']))
@@ -80,7 +86,7 @@  discard block
 block discarded – undo
80 86
 		$limit_end = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
81 87
 		$absolute_difference = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
82 88
 	}
83
-}  else {
89
+} else {
84 90
 	$limit_explode = explode(",", $_GET['limit']);
85 91
 	$limit_start = filter_var($limit_explode[0],FILTER_SANITIZE_NUMBER_INT);
86 92
 	$limit_end = filter_var($limit_explode[1],FILTER_SANITIZE_NUMBER_INT);
@@ -138,10 +144,15 @@  discard block
 block discarded – undo
138 144
 	$dist = filter_input(INPUT_GET,'dist',FILTER_SANITIZE_NUMBER_INT);
139 145
 	$number_results = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT);
140 146
 	if ($dist != '') {
141
-		if (isset($globalDistanceUnit) && $globalDistanceUnit == 'mi') $dist = $dist*1.60934;
142
-		elseif (isset($globalDistanceUnit) && $globalDistanceUnit == 'nm') $dist = $dist*1.852;
147
+		if (isset($globalDistanceUnit) && $globalDistanceUnit == 'mi') {
148
+			$dist = $dist*1.60934;
149
+		} elseif (isset($globalDistanceUnit) && $globalDistanceUnit == 'nm') {
150
+			$dist = $dist*1.852;
151
+		}
152
+	}
153
+	if (!isset($sql_date)) {
154
+		$sql_date = '';
143 155
 	}
144
-	if (!isset($sql_date)) $sql_date = '';
145 156
 	if ($archive == 1) {
146 157
 		if ($type == 'aircraft') {
147 158
 			$SpotterArchive = new SpotterArchive();
@@ -219,7 +230,10 @@  discard block
 block discarded – undo
219 230
 		if (isset($_GET['aircraft']) && $_GET['aircraft'] != ""){ print _("Aircraft:").' <span>'.$aircraft.'</span> '; }
220 231
 		if (isset($_GET['manufacturer']) && $_GET['manufacturer'] != ""){ print _("Manufacturer:").' <span>'.$manufacturer.'</span> '; }
221 232
 		if (isset($_GET['registration']) && $_GET['registration'] != ""){ print _("Registration:").' <span>'.$registration.'</span> '; }
222
-		if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true"){ print _("Highlights:").' <span>'.$highlights.'</span> '; }
233
+		if (isset($_GET['highlights'])) {
234
+			if ($_GET['highlights'] == "true"){ print _("Highlights:").' <span>'.$highlights.'</span> ';
235
+		}
236
+		}
223 237
 		if (isset($_GET['airline']) && $_GET['airline'] != ""){ print _("Airline:").' <span>'.$airline.'</span> '; }
224 238
 		if (isset($_GET['airline_country']) && $_GET['airline_country'] != ""){ print _("Airline country:").' <span>'.$airline_country.'</span> '; }
225 239
 		if (isset($_GET['airline_type']) && $_GET['airline_type'] != ""){ print _("Airline type:").' <span>'.$airline_type.'</span> '; }
@@ -355,7 +369,10 @@  discard block
 block discarded – undo
355 369
 			<div class="form-group">
356 370
 				<label class="control-label col-sm-2"><?php echo _("Keywords"); ?></label>
357 371
 				<div class="col-sm-10">
358
-					<input type="text" class="form-control" id="q" name="q" value="<?php if (isset($_GET['q'])) print $q; ?>" size="10" placeholder="<?php echo _("Keywords"); ?>" />
372
+					<input type="text" class="form-control" id="q" name="q" value="<?php if (isset($_GET['q'])) {
373
+	print $q;
374
+}
375
+?>" size="10" placeholder="<?php echo _("Keywords"); ?>" />
359 376
 				</div>
360 377
 			</div>
361 378
 		</fieldset>
@@ -374,7 +391,10 @@  discard block
 block discarded – undo
374 391
 					    </select>
375 392
 					</div>
376 393
 				</div>
377
-				<script type="text/javascript">getSelect('manufacturer','<?php if(isset($_GET['manufacturer'])) print $manufacturer; ?>')</script>
394
+				<script type="text/javascript">getSelect('manufacturer','<?php if(isset($_GET['manufacturer'])) {
395
+	print $manufacturer;
396
+}
397
+?>')</script>
378 398
 				<div class="form-group">
379 399
 					<label class="control-label col-sm-2"><?php echo _("Type"); ?></label>
380 400
 						<div class="col-sm-10">
@@ -383,11 +403,17 @@  discard block
 block discarded – undo
383 403
 							</select>
384 404
 						</div>
385 405
 				</div>
386
-				<script type="text/javascript">getSelect('aircrafttypes','<?php if(isset($_GET['aircraft_icao'])) print $aircraft_icao; ?>');</script>
406
+				<script type="text/javascript">getSelect('aircrafttypes','<?php if(isset($_GET['aircraft_icao'])) {
407
+	print $aircraft_icao;
408
+}
409
+?>');</script>
387 410
 				<div class="form-group">
388 411
 					<label class="control-label col-sm-2"><?php echo _("Registration"); ?></label> 
389 412
 					<div class="col-sm-10">
390
-						<input type="text" class="form-control" name="registration" value="<?php if (isset($_GET['registration'])) print $registration; ?>" size="8" placeholder="<?php echo _("Registration"); ?>" />
413
+						<input type="text" class="form-control" name="registration" value="<?php if (isset($_GET['registration'])) {
414
+	print $registration;
415
+}
416
+?>" size="8" placeholder="<?php echo _("Registration"); ?>" />
391 417
 					</div>
392 418
 				</div>
393 419
 <?php
@@ -396,22 +422,31 @@  discard block
 block discarded – undo
396 422
 				<div class="form-group">
397 423
 					<label class="control-label col-sm-2"><?php echo _("Pilot id"); ?></label> 
398 424
 					<div class="col-sm-10">
399
-						<input type="text" class="form-control" name="pilot_id" value="<?php if (isset($_GET['pilot_id'])) print $pilot_id; ?>" size="15" placeholder="<?php echo _("Pilot id"); ?>" />
425
+						<input type="text" class="form-control" name="pilot_id" value="<?php if (isset($_GET['pilot_id'])) {
426
+	print $pilot_id;
427
+}
428
+?>" size="15" placeholder="<?php echo _("Pilot id"); ?>" />
400 429
 					</div>
401 430
 				</div>
402 431
 				<div class="form-group">
403 432
 					<label class="control-label col-sm-2"><?php echo _("Pilot name"); ?></label> 
404 433
 					<div class="col-sm-10">
405
-						<input type="text" class="form-control" name="pilot_name" value="<?php if (isset($_GET['pilot_name'])) print $pilot_name; ?>" size="15" placeholder="<?php echo _("Pilot name"); ?>" />
434
+						<input type="text" class="form-control" name="pilot_name" value="<?php if (isset($_GET['pilot_name'])) {
435
+	print $pilot_name;
436
+}
437
+?>" size="15" placeholder="<?php echo _("Pilot name"); ?>" />
406 438
 					</div>
407 439
 				</div>
408 440
 <?php
409
-	}else {
441
+	} else {
410 442
 ?>
411 443
 				<div class="form-group">
412 444
 					<label class="control-label col-sm-2"><?php echo _("Owner name"); ?></label> 
413 445
 					<div class="col-sm-10">
414
-						<input type="text" class="form-control" name="owner" value="<?php if (isset($_GET['owner'])) print $owner; ?>" size="15" placeholder="<?php echo _("Owner name"); ?>" />
446
+						<input type="text" class="form-control" name="owner" value="<?php if (isset($_GET['owner'])) {
447
+	print $owner;
448
+}
449
+?>" size="15" placeholder="<?php echo _("Owner name"); ?>" />
415 450
 					</div>
416 451
 				</div>
417 452
 <?php
@@ -419,8 +454,14 @@  discard block
 block discarded – undo
419 454
 ?>
420 455
 				<div class="form-group">
421 456
 					<div class="col-sm-offset-2 col-sm-10">
422
-					<!--<div><input type="checkbox" class="form-control" name="highlights" value="true" id="highlights" <?php if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true"){ print 'checked="checked"'; } ?>> <label for="highlights"><?php echo _("Include only aircraft with special highlights (unique liveries, destinations etc.)"); ?></label></div>-->
423
-					<label class="checkbox-inline"><input type="checkbox" name="highlights" value="true" id="highlights" <?php if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true"){ print 'checked="checked"'; } ?>> <?php echo _("Include only aircraft with special highlights (unique liveries, destinations etc.)"); ?></label>
457
+					<!--<div><input type="checkbox" class="form-control" name="highlights" value="true" id="highlights" <?php if (isset($_GET['highlights'])) {
458
+	if ($_GET['highlights'] == "true"){ print 'checked="checked"';
459
+}
460
+} ?>> <label for="highlights"><?php echo _("Include only aircraft with special highlights (unique liveries, destinations etc.)"); ?></label></div>-->
461
+					<label class="checkbox-inline"><input type="checkbox" name="highlights" value="true" id="highlights" <?php if (isset($_GET['highlights'])) {
462
+	if ($_GET['highlights'] == "true"){ print 'checked="checked"';
463
+}
464
+} ?>> <?php echo _("Include only aircraft with special highlights (unique liveries, destinations etc.)"); ?></label>
424 465
 					</div>
425 466
 				</div>
426 467
 			</fieldset>
@@ -434,7 +475,10 @@  discard block
 block discarded – undo
434 475
 						</select>
435 476
 					</div>
436 477
 				</div>
437
-				<script type="text/javascript">getSelect('airlinenames','<?php if(isset($_GET['airline'])) print $airline; ?>');</script>
478
+				<script type="text/javascript">getSelect('airlinenames','<?php if(isset($_GET['airline'])) {
479
+	print $airline;
480
+}
481
+?>');</script>
438 482
 				<div class="form-group">
439 483
 					<label class="control-label col-sm-2"><?php echo _("Country"); ?></label> 
440 484
 					<div class="col-sm-10">
@@ -443,19 +487,34 @@  discard block
 block discarded – undo
443 487
 						</select>
444 488
 					</div>
445 489
 				</div>
446
-				<script type="text/javascript">getSelect('airlinecountries','<?php if(isset($_GET['airline_country'])) print $airline_country; ?>');</script>
490
+				<script type="text/javascript">getSelect('airlinecountries','<?php if(isset($_GET['airline_country'])) {
491
+	print $airline_country;
492
+}
493
+?>');</script>
447 494
 				<div class="form-group">
448 495
 					<label class="control-label col-sm-2"><?php echo _("Callsign"); ?></label> 
449 496
 					<div class="col-sm-10">
450
-						<input type="text" name="callsign" class="form-control" value="<?php if (isset($_GET['callsign'])) print $callsign; ?>" size="8" placeholder="<?php echo _("Callsign"); ?>" />
497
+						<input type="text" name="callsign" class="form-control" value="<?php if (isset($_GET['callsign'])) {
498
+	print $callsign;
499
+}
500
+?>" size="8" placeholder="<?php echo _("Callsign"); ?>" />
451 501
 					</div>
452 502
 				</div>
453 503
 				<div class="form-group">
454 504
 					<div class="col-sm-offset-2 col-sm-10">
455 505
 						<label class="radio-inline"><input type="radio" name="airline_type" value="all" id="airline_type_all" <?php if (!isset($_GET['airline_type']) || $_GET['airline_type'] == "all"){ print 'checked="checked"'; } ?>> <?php echo _("All airlines types"); ?></label>
456
-						<label class="radio-inline"><input type="radio" name="airline_type" value="passenger" id="airline_type_passenger" <?php if (isset($_GET['airline_type'])) if ($_GET['airline_type'] == "passenger"){ print 'checked="checked"'; } ?>> <?php echo _("Only Passenger airlines"); ?></label>
457
-						<label class="radio-inline"><input type="radio" name="airline_type" value="cargo" id="airline_type_cargo" <?php if (isset($_GET['airline_type'])) if ( $_GET['airline_type'] == "cargo"){ print 'checked="checked"'; } ?>> <?php echo _("Only Cargo airlines"); ?></label>
458
-						<label class="radio-inline"><input type="radio" name="airline_type" value="military" id="airline_type_military" <?php if (isset($_GET['airline_type'])) if ( $_GET['airline_type'] == "military"){ print 'checked="checked"'; } ?>> <?php echo _("Only Military airlines"); ?></label>
506
+						<label class="radio-inline"><input type="radio" name="airline_type" value="passenger" id="airline_type_passenger" <?php if (isset($_GET['airline_type'])) {
507
+	if ($_GET['airline_type'] == "passenger"){ print 'checked="checked"';
508
+}
509
+} ?>> <?php echo _("Only Passenger airlines"); ?></label>
510
+						<label class="radio-inline"><input type="radio" name="airline_type" value="cargo" id="airline_type_cargo" <?php if (isset($_GET['airline_type'])) {
511
+	if ( $_GET['airline_type'] == "cargo"){ print 'checked="checked"';
512
+}
513
+} ?>> <?php echo _("Only Cargo airlines"); ?></label>
514
+						<label class="radio-inline"><input type="radio" name="airline_type" value="military" id="airline_type_military" <?php if (isset($_GET['airline_type'])) {
515
+	if ( $_GET['airline_type'] == "military"){ print 'checked="checked"';
516
+}
517
+} ?>> <?php echo _("Only Military airlines"); ?></label>
459 518
 					</div>
460 519
 				</div>
461 520
 			</fieldset>
@@ -469,7 +528,10 @@  discard block
 block discarded – undo
469 528
 						</select>
470 529
 					</div>
471 530
 				</div>
472
-				<script type="text/javascript">getSelect('airportnames','<?php if(isset($_GET['airport_icao'])) print $airport_icao; ?>');</script>
531
+				<script type="text/javascript">getSelect('airportnames','<?php if(isset($_GET['airport_icao'])) {
532
+	print $airport_icao;
533
+}
534
+?>');</script>
473 535
 				<div class="form-group">
474 536
 					<label class="control-label col-sm-2"><?php echo _("Country"); ?></label> 
475 537
 					<div class="col-sm-10">
@@ -478,7 +540,10 @@  discard block
 block discarded – undo
478 540
 						</select>
479 541
 					</div>
480 542
 				</div>
481
-				<script type="text/javascript">getSelect('airportcountries','<?php if(isset($_GET['airport_country'])) print $airport_country; ?>');</script>
543
+				<script type="text/javascript">getSelect('airportcountries','<?php if(isset($_GET['airport_country'])) {
544
+	print $airport_country;
545
+}
546
+?>');</script>
482 547
 			</fieldset>
483 548
 			<fieldset>
484 549
 				<legend><?php echo _("Route"); ?></legend>
@@ -490,7 +555,10 @@  discard block
 block discarded – undo
490 555
 						</select>
491 556
 					</div>
492 557
 				</div>
493
-				<script type="text/javascript">getSelect('departureairportnames','<?php if(isset($_GET['departure_airport_route'])) print $departure_airport_route; ?>');</script>
558
+				<script type="text/javascript">getSelect('departureairportnames','<?php if(isset($_GET['departure_airport_route'])) {
559
+	print $departure_airport_route;
560
+}
561
+?>');</script>
494 562
 				<div class="form-group">
495 563
 					<label class="control-label col-sm-2"><?php echo _("Arrival Airport"); ?></label> 
496 564
 					<div class="col-sm-10">
@@ -499,7 +567,10 @@  discard block
 block discarded – undo
499 567
 						</select>
500 568
 					</div>
501 569
 				</div>
502
-				<script type="text/javascript">getSelect('arrivalairportnames','<?php if(isset($_GET['arrival_airport_route'])) print $arrival_airport_route; ?>');</script>
570
+				<script type="text/javascript">getSelect('arrivalairportnames','<?php if(isset($_GET['arrival_airport_route'])) {
571
+	print $arrival_airport_route;
572
+}
573
+?>');</script>
503 574
 			</fieldset>
504 575
 			<fieldset>
505 576
 				<legend>Altitude</legend>
@@ -549,19 +620,33 @@  discard block
 block discarded – undo
549 620
 				<div class="form-group">
550 621
 					<label class="control-label col-sm-2"><?php echo _("Latitude"); ?></label>
551 622
 					<div class="col-sm-10">
552
-						<input type="text" name="origlat" class="form-control" placeholder="<?php echo _("Center point latitude"); ?>" value="<?php if (isset($_GET['origlat'])) print $origlat; ?>" />
623
+						<input type="text" name="origlat" class="form-control" placeholder="<?php echo _("Center point latitude"); ?>" value="<?php if (isset($_GET['origlat'])) {
624
+	print $origlat;
625
+}
626
+?>" />
553 627
 					</div>
554 628
 				</div>
555 629
 				<div class="form-group">
556 630
 					<label class="control-label col-sm-2"><?php echo _("Longitude"); ?></label>
557 631
 					<div class="col-sm-10">
558
-						<input type="text" name="origlon" class="form-control" placeholder="<?php echo _("Center point longitude"); ?>" value="<?php if (isset($_GET['origlon'])) print $origlon; ?>" />
632
+						<input type="text" name="origlon" class="form-control" placeholder="<?php echo _("Center point longitude"); ?>" value="<?php if (isset($_GET['origlon'])) {
633
+	print $origlon;
634
+}
635
+?>" />
559 636
 					</div>
560 637
 				</div>
561 638
 				<div class="form-group">
562
-					<label class="control-label col-sm-2"><?php echo _("Distance").' ('; if (isset($globalDistanceUnit)) print $globalDistanceUnit; else print 'km'; print ')'; ?></label>
639
+					<label class="control-label col-sm-2"><?php echo _("Distance").' ('; if (isset($globalDistanceUnit)) {
640
+	print $globalDistanceUnit;
641
+} else {
642
+	print 'km';
643
+}
644
+print ')'; ?></label>
563 645
 					<div class="col-sm-10">
564
-						<input type="text" name="dist" class="form-control" placeholder="<?php echo _("Distance from center point"); ?>" value="<?php if (isset($_GET['distance'])) print $distance; ?>" />
646
+						<input type="text" name="dist" class="form-control" placeholder="<?php echo _("Distance from center point"); ?>" value="<?php if (isset($_GET['distance'])) {
647
+	print $distance;
648
+}
649
+?>" />
565 650
 					</div>
566 651
 				</div>
567 652
 			</fieldset>
@@ -572,7 +657,10 @@  discard block
 block discarded – undo
572 657
 				<div class="form-group">
573 658
 					<label class="control-label col-sm-2"><?php echo _("Callsign"); ?></label> 
574 659
 					<div class="col-sm-10">
575
-						<input type="text" name="callsign" class="form-control" value="<?php if (isset($_GET['callsign'])) print $callsign; ?>" size="8" placeholder="<?php echo _("Callsign"); ?>" />
660
+						<input type="text" name="callsign" class="form-control" value="<?php if (isset($_GET['callsign'])) {
661
+	print $callsign;
662
+}
663
+?>" size="8" placeholder="<?php echo _("Callsign"); ?>" />
576 664
 					</div>
577 665
 				</div>
578 666
 			</fieldset>
@@ -583,7 +671,10 @@  discard block
 block discarded – undo
583 671
 				<div class="form-group">
584 672
 					<label class="control-label col-sm-2"><?php echo _("Callsign"); ?></label> 
585 673
 					<div class="col-sm-10">
586
-						<input type="text" name="callsign" class="form-control" value="<?php if (isset($_GET['callsign'])) print $callsign; ?>" size="8" placeholder="<?php echo _("Callsign"); ?>" />
674
+						<input type="text" name="callsign" class="form-control" value="<?php if (isset($_GET['callsign'])) {
675
+	print $callsign;
676
+}
677
+?>" size="8" placeholder="<?php echo _("Callsign"); ?>" />
587 678
 					</div>
588 679
 				</div>
589 680
 			</fieldset>
@@ -591,7 +682,10 @@  discard block
 block discarded – undo
591 682
 				<div class="form-group">
592 683
 					<label class="control-label col-sm-2"><?php echo _("MMSI"); ?></label> 
593 684
 					<div class="col-sm-10">
594
-						<input type="text" name="mmsi" class="form-control" value="<?php if (isset($_GET['mmsi'])) print $mmsi; ?>" size="8" placeholder="<?php echo _("MMSI"); ?>" />
685
+						<input type="text" name="mmsi" class="form-control" value="<?php if (isset($_GET['mmsi'])) {
686
+	print $mmsi;
687
+}
688
+?>" size="8" placeholder="<?php echo _("MMSI"); ?>" />
595 689
 					</div>
596 690
 				</div>
597 691
 			</fieldset>
@@ -599,7 +693,10 @@  discard block
 block discarded – undo
599 693
 				<div class="form-group">
600 694
 					<label class="control-label col-sm-2"><?php echo _("IMO"); ?></label> 
601 695
 					<div class="col-sm-10">
602
-						<input type="text" name="imo" class="form-control" value="<?php if (isset($_GET['imo'])) print $imo; ?>" size="8" placeholder="<?php echo _("IMO"); ?>" />
696
+						<input type="text" name="imo" class="form-control" value="<?php if (isset($_GET['imo'])) {
697
+	print $imo;
698
+}
699
+?>" size="8" placeholder="<?php echo _("IMO"); ?>" />
603 700
 					</div>
604 701
 				</div>
605 702
 			</fieldset>
@@ -612,7 +709,10 @@  discard block
 block discarded – undo
612 709
 					<label class="control-label col-sm-2"><?php echo _("Start Date"); ?></label>
613 710
 					<div class="col-sm-10">
614 711
 						<div class='input-group date' id='datetimepicker1'>
615
-							<input type='text' name="start_date" class="form-control" value="<?php if (isset($_GET['start_date']) && $_GET['start_date'] != '') print $start_date; ?>" placeholder="<?php echo _("Start Date/Time"); ?>" />
712
+							<input type='text' name="start_date" class="form-control" value="<?php if (isset($_GET['start_date']) && $_GET['start_date'] != '') {
713
+	print $start_date;
714
+}
715
+?>" placeholder="<?php echo _("Start Date/Time"); ?>" />
616 716
 							<span class="input-group-addon">
617 717
 								<span class="glyphicon glyphicon-calendar"></span>
618 718
 							</span>
@@ -623,7 +723,10 @@  discard block
 block discarded – undo
623 723
 					<label class="control-label col-sm-2"><?php echo _("End Date"); ?></label>
624 724
 					<div class="col-sm-10">
625 725
 						<div class='input-group date' id='datetimepicker2'>
626
-						<input type='text' name="end_date" class="form-control" value="<?php if (isset($_GET['end_date']) && $_GET['end_date'] != '') print $end_date; ?>" placeholder="<?php echo _("End Date/Time"); ?>" />
726
+						<input type='text' name="end_date" class="form-control" value="<?php if (isset($_GET['end_date']) && $_GET['end_date'] != '') {
727
+	print $end_date;
728
+}
729
+?>" placeholder="<?php echo _("End Date/Time"); ?>" />
627 730
 						<span class="input-group-addon">
628 731
 							<span class="glyphicon glyphicon-calendar"></span>
629 732
 						</span>
Please login to merge, or discard this patch.
pilot-detailed.php 1 patch
Braces   +24 added lines, -8 removed lines patch added patch discarded remove patch
@@ -37,8 +37,12 @@  discard block
 block discarded – undo
37 37
 	$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);
38 38
 	$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT);
39 39
 	$filter = array();
40
-	if ($year != '') $filter = array_merge($filter,array('year' => $year));
41
-	if ($month != '') $filter = array_merge($filter,array('month' => $month));
40
+	if ($year != '') {
41
+		$filter = array_merge($filter,array('year' => $year));
42
+	}
43
+	if ($month != '') {
44
+		$filter = array_merge($filter,array('month' => $month));
45
+	}
42 46
 	if ($sort != '') 
43 47
 	{
44 48
 		$spotter_array = $Spotter->getSpotterDataByPilot($pilot,$limit_start.",".$absolute_difference, $sort,$filter);
@@ -56,8 +60,12 @@  discard block
 block discarded – undo
56 60
 	{
57 61
 		$title = sprintf(_("Detailed View for %s"),$spotter_array[0]['pilot_name']);
58 62
 		$ident = $spotter_array[0]['ident'];
59
-		if (isset($spotter_array[0]['latitude'])) $latitude = $spotter_array[0]['latitude'];
60
-		if (isset($spotter_array[0]['longitude'])) $longitude = $spotter_array[0]['longitude'];
63
+		if (isset($spotter_array[0]['latitude'])) {
64
+			$latitude = $spotter_array[0]['latitude'];
65
+		}
66
+		if (isset($spotter_array[0]['longitude'])) {
67
+			$longitude = $spotter_array[0]['longitude'];
68
+		}
61 69
 		require_once('header.php');
62 70
 		/*
63 71
 		if (isset($globalArchive) && $globalArchive) {
@@ -110,12 +118,18 @@  discard block
 block discarded – undo
110 118
 		*/
111 119
 		print '<div class="info column">';
112 120
 		print '<h1>'.$spotter_array[0]['pilot_name'].'</h1>';
113
-		if (isset($spotter_array[0]['pilot_id']) && $spotter_array[0]['pilot_id'] != '') print '<div><span class="label">'._("Pilot ID").'</span>'.$spotter_array[0]['pilot_id'].'</div>';
121
+		if (isset($spotter_array[0]['pilot_id']) && $spotter_array[0]['pilot_id'] != '') {
122
+			print '<div><span class="label">'._("Pilot ID").'</span>'.$spotter_array[0]['pilot_id'].'</div>';
123
+		}
114 124
 		if ($year == '' && $month == '') {
115 125
 			$Stats = new Stats();
116 126
 			$flights = $Stats->getStatsPilot($pilot);
117
-		} else $flights = 0;
118
-		if ($flights == 0) $flights = $Spotter->countFlightsByPilot($pilot,$filter);
127
+		} else {
128
+			$flights = 0;
129
+		}
130
+		if ($flights == 0) {
131
+			$flights = $Spotter->countFlightsByPilot($pilot,$filter);
132
+		}
119 133
 		print '<div><span class="label">'._("Flights").'</span>'.$flights.'</div>';
120 134
 		$aircraft_type = count($Spotter->countAllAircraftTypesByPilot($pilot,$filter));
121 135
 		print '<div><span class="label">'._("Aircraft type").'</span>'.$aircraft_type.'</div>';
@@ -126,7 +140,9 @@  discard block
 block discarded – undo
126 140
 		$airlines = count($Spotter->countAllAirlinesByPilot($pilot,$filter));
127 141
 		print '<div><span class="label">'._("Airlines").'</span>'.$airlines.'</div>';
128 142
 		$duration = $Spotter->getFlightDurationByPilot($pilot,$filter);
129
-		if ($duration != '0') print '<div><span class="label">'._("Total flights spotted duration").'</span>'.$duration.'</div>';
143
+		if ($duration != '0') {
144
+			print '<div><span class="label">'._("Total flights spotted duration").'</span>'.$duration.'</div>';
145
+		}
130 146
 		print '</div>';
131 147
 	
132 148
 		include('pilot-sub-menu.php');
Please login to merge, or discard this patch.
header.php 2 patches
Indentation   +82 added lines, -82 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 // When button "Remove all filters" is clicked
39 39
 if (isset($_POST['removefilters'])) {
40 40
 	$allfilters = array_filter(array_keys($_COOKIE),function($key) {
41
-	    return strpos($key,'filter_') === 0;
41
+		return strpos($key,'filter_') === 0;
42 42
 	});
43 43
 	foreach ($allfilters as $filt) {
44 44
 		unset($_COOKIE[$filt]);
@@ -188,17 +188,17 @@  discard block
 block discarded – undo
188 188
 	}
189 189
 ?>
190 190
 <?php 
191
-    if (isset($_POST['archive'])) {
191
+	if (isset($_POST['archive'])) {
192 192
 ?>
193 193
 <script src="<?php print $globalURL; ?>/js/map.common.js"></script>
194 194
 <?php 
195
-	    if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) {
195
+		if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) {
196 196
 ?>
197 197
 
198 198
 <script src="<?php print $globalURL; ?>/js/map.js.php?<?php print time(); ?>&archive&begindate=<?php print strtotime($_POST['start_date']); ?>&enddate=<?php print strtotime($_POST['end_date']); ?>&archivespeed=<?php print $_POST['archivespeed']; ?>"></script>
199 199
 <?php    
200
-	    }
201
-    } else {
200
+		}
201
+	} else {
202 202
 ?>
203 203
 <?php
204 204
 /*	if (isset($globalBeta) && $globalBeta) {
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 */
211 211
 ?>
212 212
 <?php 
213
-	    if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) {
213
+		if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) {
214 214
 ?>
215 215
 <?php
216 216
 //		if (isset($globalBeta) && $globalBeta) {
@@ -241,13 +241,13 @@  discard block
 block discarded – undo
241 241
 <script src="<?php print $globalURL; ?>/js/map-satellite.2d.js.php?<?php print time(); ?>"></script>
242 242
 <?php
243 243
 		}
244
-	    }
244
+		}
245 245
 ?>
246 246
 <?php
247 247
 //	}
248 248
 ?>
249 249
 <?php
250
-    }
250
+	}
251 251
 }
252 252
 ?>
253 253
 <?php
@@ -424,34 +424,34 @@  discard block
 block discarded – undo
424 424
 
425 425
       <ul class="nav navbar-nav">
426 426
 <?php
427
-    if (isset($globalNewsFeeds['global']) && !empty($globalNewsFeeds['global'])) {
427
+	if (isset($globalNewsFeeds['global']) && !empty($globalNewsFeeds['global'])) {
428 428
 ?>
429 429
     <li><a href="<?php print $globalURL; ?>/news"><?php echo _("News"); ?></a></li>
430 430
 <?php
431
-    }
431
+	}
432 432
 ?>
433 433
 
434 434
 <?php 
435
-    $sub = false;
436
-    if (
435
+	$sub = false;
436
+	if (
437 437
 	(
438
-	    (!isset($globalAircraft) || (isset($globalAircraft) && $globalAircraft === TRUE)) && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalTracker) && $globalTracker === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE))
438
+		(!isset($globalAircraft) || (isset($globalAircraft) && $globalAircraft === TRUE)) && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalTracker) && $globalTracker === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE))
439 439
 	) || 
440 440
 	(
441
-	    isset($globalMarine) && $globalMarine === TRUE && ((isset($globalTracker) && $globalTracker === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE))
441
+		isset($globalMarine) && $globalMarine === TRUE && ((isset($globalTracker) && $globalTracker === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE))
442 442
 	) || 
443 443
 	(
444
-	    isset($globalTracker) && $globalTracker === TRUE && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE))
444
+		isset($globalTracker) && $globalTracker === TRUE && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE))
445 445
 	) || 
446 446
 	(
447
-	    isset($globalSatellite) && $globalSatellite === TRUE && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalTracker) && $globalTracker === TRUE))
447
+		isset($globalSatellite) && $globalSatellite === TRUE && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalTracker) && $globalTracker === TRUE))
448 448
 	)
449
-    ) {
449
+	) {
450 450
 	$sub = true;
451
-    }
451
+	}
452 452
 ?>
453 453
 <?php
454
-    if (!isset($globalAircraft) || $globalAircraft === TRUE) {
454
+	if (!isset($globalAircraft) || $globalAircraft === TRUE) {
455 455
 ?>
456 456
     <li class="dropdown">
457 457
 <?php
@@ -462,7 +462,7 @@  discard block
 block discarded – undo
462 462
 	<ul class="dropdown-menu multi-level">
463 463
       	<li class="dropdown-submenu">
464 464
 <?php
465
-        }
465
+		}
466 466
 ?>
467 467
 <?php
468 468
 	if (isset($globalNewsFeeds['aircraft']) && !empty($globalNewsFeeds['aircraft'])) {
@@ -477,25 +477,25 @@  discard block
 block discarded – undo
477 477
           <ul class="dropdown-menu">
478 478
           	<li><a href="<?php print $globalURL; ?>/aircraft"><?php echo _("Aircraft Types"); ?></a></li>
479 479
 <?php
480
-    if (!isset($globalNoAirlines) || $globalNoAirlines === FALSE) {
480
+	if (!isset($globalNoAirlines) || $globalNoAirlines === FALSE) {
481 481
 ?>
482 482
 			<li><a href="<?php print $globalURL; ?>/airline"><?php echo _("Airlines"); ?></a></li>
483 483
 <?php
484
-    }
484
+	}
485 485
 ?>
486 486
 			<li><a href="<?php print $globalURL; ?>/airport"><?php echo _("Airports"); ?></a></li>
487 487
 <?php
488
-    if ((isset($globalUseOwner) && $globalUseOwner) || (!isset($globalUseOwner) && (!isset($globalVA) || !$globalVA) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS) && (!isset($globalVAM) || !$globalVAM))) {
488
+	if ((isset($globalUseOwner) && $globalUseOwner) || (!isset($globalUseOwner) && (!isset($globalVA) || !$globalVA) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS) && (!isset($globalVAM) || !$globalVAM))) {
489 489
 ?>
490 490
 			<li><a href="<?php print $globalURL; ?>/owner"><?php echo _("Owners"); ?></a></li>
491 491
 <?php
492
-    } 
493
-    if ((isset($globalUsePilot) && $globalUsePilot) || !isset($globalUsePilot) && ((isset($globalVA) && $globalVA) || (isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS) || (isset($globalVAM) && $globalVAM))) {
492
+	} 
493
+	if ((isset($globalUsePilot) && $globalUsePilot) || !isset($globalUsePilot) && ((isset($globalVA) && $globalVA) || (isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS) || (isset($globalVAM) && $globalVAM))) {
494 494
 
495 495
 ?>
496 496
 			<li><a href="<?php print $globalURL; ?>/pilot"><?php echo _("Pilots"); ?></a></li>
497 497
 <?php
498
-    }
498
+	}
499 499
 ?>
500 500
 			<li><hr /></li>
501 501
             <li><a href="<?php print $globalURL; ?>/currently"><?php echo _("Current Activity"); ?></a></li>
@@ -503,43 +503,43 @@  discard block
 block discarded – undo
503 503
             <li><a href="<?php print $globalURL; ?>/date/<?php print date("Y-m-d"); ?>"><?php echo _("Today's Activity"); ?></a></li>
504 504
             <li><a href="<?php print $globalURL; ?>/newest"><?php echo _("Newest by Category"); ?></a></li>
505 505
             <?php
506
-        	if ($globalACARS) {
507
-        	    if (isset($globalDemo) && $globalDemo) {
508
-    	    ?>
506
+			if ($globalACARS) {
507
+				if (isset($globalDemo) && $globalDemo) {
508
+			?>
509 509
             <li><hr /></li>
510 510
             <li><i><?php echo _('ACARS data not available publicly'); ?></i></li>
511 511
             <li><a href=""><?php echo _('Latest ACARS messages'); ?></a></li>
512 512
             <li><a href=""><?php echo _('Archive ACARS messages'); ?></a></li>
513 513
             <?php
514
-        	    } else {
515
-    	    ?>
514
+				} else {
515
+			?>
516 516
             <li><hr /></li>
517 517
             <li><a href="<?php print $globalURL; ?>/acars-latest"><?php echo _("Latest ACARS messages"); ?></a></li>
518 518
             <li><a href="<?php print $globalURL; ?>/acars-archive"><?php echo _("Archive ACARS messages"); ?></a></li>
519 519
             <?php
520
-        	    }
521
-        	}
522
-    	    ?>
520
+				}
521
+			}
522
+			?>
523 523
     	    <?php
524
-    	        if (isset($globalAccidents) && $globalAccidents) {
525
-    	    ?>
524
+				if (isset($globalAccidents) && $globalAccidents) {
525
+			?>
526 526
             <li><hr /></li>
527 527
             <li><a href="<?php print $globalURL; ?>/accident-latest"><?php echo _("Latest accident"); ?></a></li>
528 528
             <li><a href="<?php print $globalURL; ?>/accident/<?php print date("Y-m-d"); ?>"><?php echo _("Today's Accident"); ?></a></li>
529 529
             <li><a href="<?php print $globalURL; ?>/incident-latest"><?php echo _("Latest incident"); ?></a></li>
530 530
             <li><a href="<?php print $globalURL; ?>/incident/<?php print date("Y-m-d"); ?>"><?php echo _("Today's Incident"); ?></a></li>
531 531
             <?php
532
-        	}
533
-    	    ?>
532
+			}
533
+			?>
534 534
             <li><hr /></li>
535 535
             <li><a href="<?php print $globalURL; ?>/highlights/table"><?php echo _("Special Highlights"); ?></a></li>
536 536
             <?php
537 537
 		if (!isset($globalNoUpcoming) || $globalNoUpcoming === FALSE) {
538
-	    ?>
538
+		?>
539 539
             <li><a href="<?php print $globalURL; ?>/upcoming"><?php echo _("Upcoming Flights"); ?></a></li>
540 540
 	    <?php
541 541
 		}
542
-	    ?>
542
+		?>
543 543
           </ul>
544 544
         </li>
545 545
       	<li><a href="<?php print $globalURL; ?>/search"><?php echo _("Search"); ?></a></li>
@@ -566,14 +566,14 @@  discard block
 block discarded – undo
566 566
     </ul>
567 567
 <?php
568 568
 	}
569
-    }
569
+	}
570 570
 ?>
571 571
 <?php
572
-    if (isset($globalMarine) && $globalMarine) {
572
+	if (isset($globalMarine) && $globalMarine) {
573 573
 ?>
574 574
     <li class="dropdown">
575 575
 <?php
576
-        if ($sub) {
576
+		if ($sub) {
577 577
 ?>
578 578
     <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Marines"); ?> <b class="caret"></b></a>
579 579
 	<ul class="dropdown-menu multi-level">
@@ -607,14 +607,14 @@  discard block
 block discarded – undo
607 607
 	}
608 608
 ?>
609 609
 <?php
610
-    }
610
+	}
611 611
 ?>
612 612
 <?php
613
-    if (isset($globalTracker) && $globalTracker) {
613
+	if (isset($globalTracker) && $globalTracker) {
614 614
 ?>
615 615
     <li class="dropdown">
616 616
 <?php
617
-        if ($sub) {
617
+		if ($sub) {
618 618
 ?>
619 619
     <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Trackers"); ?> <b class="caret"></b></a>
620 620
 	<ul class="dropdown-menu multi-level">
@@ -648,14 +648,14 @@  discard block
 block discarded – undo
648 648
 	}
649 649
 ?>
650 650
 <?php
651
-    }
651
+	}
652 652
 ?>
653 653
 <?php
654
-    if (isset($globalSatellite) && $globalSatellite) {
654
+	if (isset($globalSatellite) && $globalSatellite) {
655 655
 ?>
656 656
     <li class="dropdown">
657 657
 <?php
658
-        if ($sub) {
658
+		if ($sub) {
659 659
 ?>
660 660
     <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Satellites"); ?> <b class="caret"></b></a>
661 661
 	<ul class="dropdown-menu multi-level">
@@ -691,7 +691,7 @@  discard block
 block discarded – undo
691 691
 	}
692 692
 ?>
693 693
 <?php
694
-    }
694
+	}
695 695
 ?>
696 696
 
697 697
         <li class="dropdown">
@@ -700,12 +700,12 @@  discard block
 block discarded – undo
700 700
           	<li><a href="<?php print $globalURL; ?>/about"><?php echo _("About The Project"); ?></a></li>
701 701
           	<li><a href="<?php print $globalURL; ?>/about/export"><?php echo _("Exporting Data"); ?></a></li>
702 702
 <?php
703
-    if (!isset($globalAircraft) || $globalAircraft === TRUE) {
703
+	if (!isset($globalAircraft) || $globalAircraft === TRUE) {
704 704
 ?>
705 705
 		<li><hr /></li>
706 706
 		<li><a href="<?php print $globalURL; ?>/about/tv"><?php echo _("Spotter TV"); ?></a></li>
707 707
 <?php
708
-    }
708
+	}
709 709
 ?>
710 710
 	    <?php if (isset($globalContribute) && $globalContribute) { ?>
711 711
                 <li><hr /></li>
@@ -726,14 +726,14 @@  discard block
 block discarded – undo
726 726
   	    <form>
727 727
   		<select class="selectpicker" data-width="120px" onchange="language(this);">
728 728
   		    <?php
729
-  		        $Language = new Language();
730
-  		        $alllang = $Language->getLanguages();
731
-  		        foreach ($alllang as $key => $lang) {
732
-  		            print '<option value="'.$key.'"';
733
-  		            if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) print ' selected ';
734
-  		            print '>'.$lang[0].'</option>';
735
-  		        }
736
-  		    ?>
729
+  				$Language = new Language();
730
+  				$alllang = $Language->getLanguages();
731
+  				foreach ($alllang as $key => $lang) {
732
+  					print '<option value="'.$key.'"';
733
+  					if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) print ' selected ';
734
+  					print '>'.$lang[0].'</option>';
735
+  				}
736
+  			?>
737 737
   		</select>
738 738
   	    </form>
739 739
   	</div>
@@ -765,18 +765,18 @@  discard block
 block discarded – undo
765 765
 ?>
766 766
     <div class="top-header clear" role="main">
767 767
 <?php
768
-    if (isset($longitude) && isset($latitude) && $longitude != 0 && $latitude != 0) {
768
+	if (isset($longitude) && isset($latitude) && $longitude != 0 && $latitude != 0) {
769 769
 ?>
770 770
     <div id="archive-map"></div>
771 771
 <?php
772
-    }
772
+	}
773 773
 ?>
774 774
     </div>
775 775
 <?php
776 776
 }
777 777
 if ((strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false) || (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false))
778 778
 {
779
-    ?>
779
+	?>
780 780
     <div class="top-header clear" role="main">
781 781
         <div id="map"></div>
782 782
 	<link rel="stylesheet" href="<?php print $globalURL; ?>/css/leaflet.css" />
@@ -787,15 +787,15 @@  discard block
 block discarded – undo
787 787
         var zoom = 13;
788 788
 //create the map
789 789
 <?php
790
-    if (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($airport_array[0]['latitude'])) {
790
+	if (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($airport_array[0]['latitude'])) {
791 791
 ?>
792 792
   map = L.map('map', { zoomControl:true }).setView([<?php print $airport_array[0]['latitude']; ?>,<?php print $airport_array[0]['longitude']; ?>], zoom);
793 793
 <?php
794
-    } elseif (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false) {
794
+	} elseif (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false) {
795 795
 ?>
796 796
   map = L.map('map', { zoomControl:true });
797 797
 <?php
798
-    } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($spotter_array[0]['departure_airport_latitude'])) {
798
+	} elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($spotter_array[0]['departure_airport_latitude'])) {
799 799
 ?>
800 800
   map = L.map('map', { zoomControl:true }).setView([<?php print $spotter_array[0]['departure_airport_latitude']; ?>,<?php print $spotter_array[0]['arrival_airport_longitude']; ?>]);
801 801
     var line = L.polyline([[<?php print $spotter_array[0]['departure_airport_latitude']; ?>, <?php print $spotter_array[0]['departure_airport_longitude']; ?>],[<?php print $spotter_array[0]['arrival_airport_latitude']; ?>, <?php print $spotter_array[0]['arrival_airport_longitude']; ?>]]).addTo(map);
@@ -803,22 +803,22 @@  discard block
 block discarded – undo
803 803
     var departure_airport = L.marker([<?php print $spotter_array[0]['departure_airport_latitude']; ?>, <?php print $spotter_array[0]['departure_airport_longitude']; ?>], {icon: L.icon({iconUrl: '<?php print $globalURL; ?>/images/departure_airport.png',iconSize: [16,18],iconAnchor: [8,16]})}).addTo(map);
804 804
     var arrival_airport = L.marker([<?php print $spotter_array[0]['arrival_airport_latitude']; ?>, <?php print $spotter_array[0]['arrival_airport_longitude']; ?>], {icon: L.icon({iconUrl: '<?php print $globalURL; ?>/images/arrival_airport.png',iconSize: [16,18],iconAnchor: [8,16]})}).addTo(map);
805 805
 <?php
806
-    } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && !isset($spotter_array[0]['departure_airport_latitude']) && isset($spotter_array[0]['latitude'])) {
806
+	} elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && !isset($spotter_array[0]['departure_airport_latitude']) && isset($spotter_array[0]['latitude'])) {
807 807
 ?>
808 808
   map = L.map('map', { zoomControl:true }).setView([<?php print $spotter_array[0]['latitude']; ?>,<?php print $spotter_array[0]['longitude']; ?>]);
809 809
 <?php
810
-    } elseif (!isset($spotter_array[0]['latitude']) && !isset($spotter_array[0]['longitude'])) {
810
+	} elseif (!isset($spotter_array[0]['latitude']) && !isset($spotter_array[0]['longitude'])) {
811 811
 ?>
812 812
   map = L.map('map', { zoomControl:true });
813 813
 <?php
814
-    }
814
+	}
815 815
 ?>
816 816
   //initialize the layer group for the aircrft markers
817 817
   var layer_data = L.layerGroup();
818 818
 
819 819
   //a few title layers
820 820
 <?php
821
-    if ($globalMapProvider == 'Mapbox') {
821
+	if ($globalMapProvider == 'Mapbox') {
822 822
 ?>
823 823
   L.tileLayer('https://{s}.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={token}', {
824 824
     maxZoom: 18,
@@ -829,14 +829,14 @@  discard block
 block discarded – undo
829 829
     token : '<?php print $globalMapboxToken; ?>'
830 830
   }).addTo(map);
831 831
 <?php
832
-    } elseif ($globalMapProvider == 'Mapbox-GL') {
832
+	} elseif ($globalMapProvider == 'Mapbox-GL') {
833 833
 ?>
834 834
     L.mapboxGL({
835 835
 	accessToken: '<?php print $globalMapboxToken; ?>',
836 836
 	style: 'mapbox://styles/mapbox/bright-v8'
837 837
   }).addTo(map);
838 838
 <?php
839
-    } elseif ($globalMapProvider == 'MapQuest-OSM') {
839
+	} elseif ($globalMapProvider == 'MapQuest-OSM') {
840 840
 ?>
841 841
   L.tileLayer('http://otile1.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.png', {
842 842
     maxZoom: 18,
@@ -845,7 +845,7 @@  discard block
 block discarded – undo
845 845
       'Tiles Courtesy of <a href="http://www.mapquest.com">MapQuest</a>'
846 846
   }).addTo(map);
847 847
 <?php
848
-    } elseif ($globalMapProvider == 'MapQuest-Aerial') {
848
+	} elseif ($globalMapProvider == 'MapQuest-Aerial') {
849 849
 ?>
850 850
   L.tileLayer('http://otile1.mqcdn.com/tiles/1.0.0/sat/{z}/{x}/{y}.png', {
851 851
     maxZoom: 18,
@@ -854,27 +854,27 @@  discard block
 block discarded – undo
854 854
       'Tiles Courtesy of <a href="http://www.mapquest.com">MapQuest</a>, Portions Courtesy NASA/JPL-Caltech and U.S. Depart. of Agriculture, Farm Service Agency"'
855 855
   }).addTo(map);
856 856
 <?php
857
-    } elseif ($globalMapProvider == 'Google-Roadmap') {
857
+	} elseif ($globalMapProvider == 'Google-Roadmap') {
858 858
 ?>
859 859
     var googleLayer = new L.Google('ROADMAP');
860 860
     map.addLayer(googleLayer);
861 861
 <?php
862
-    } elseif ($globalMapProvider == 'Google-Satellite') {
862
+	} elseif ($globalMapProvider == 'Google-Satellite') {
863 863
 ?>
864 864
     var googleLayer = new L.Google('SATELLITE');
865 865
     map.addLayer(googleLayer);
866 866
 <?php
867
-    } elseif ($globalMapProvider == 'Google-Hybrid') {
867
+	} elseif ($globalMapProvider == 'Google-Hybrid') {
868 868
 ?>
869 869
     var googleLayer = new L.Google('HYBRID');
870 870
     map.addLayer(googleLayer);
871 871
 <?php
872
-    } elseif ($globalMapProvider == 'Google-Terrain') {
872
+	} elseif ($globalMapProvider == 'Google-Terrain') {
873 873
 ?>
874 874
     var googleLayer = new L.Google('Terrain');
875 875
     map.addLayer(googleLayer);
876 876
 <?php
877
-    } elseif (isset($globalMapCustomLayer[$globalMapProvider])) {
877
+	} elseif (isset($globalMapCustomLayer[$globalMapProvider])) {
878 878
 	$customid = $globalMapProvider;
879 879
 ?>
880 880
     L.tileLayer('<?php print $globalMapCustomLayer[$customid]['url']; ?>/{z}/{x}/{y}.png', {
@@ -884,7 +884,7 @@  discard block
 block discarded – undo
884 884
         attribution: '<?php print $globalMapCustomLayer[$customid]['attribution']; ?>'
885 885
     }).addTo(map);
886 886
 <?php
887
-    } elseif ($globalMapProvider == 'offline' || (isset($globalMapOffline) && $globalMapOffline === TRUE)) {
887
+	} elseif ($globalMapProvider == 'offline' || (isset($globalMapOffline) && $globalMapOffline === TRUE)) {
888 888
 ?>
889 889
     var center = map.getCenter();
890 890
     map.options.crs = L.CRS.EPSG4326;
@@ -899,8 +899,8 @@  discard block
 block discarded – undo
899 899
         attribution: 'Natural Earth'
900 900
     }).addTo(map);
901 901
 <?php
902
-    //} elseif ($globalMapProvider == 'OpenStreetMap') {
903
-    } else {
902
+	//} elseif ($globalMapProvider == 'OpenStreetMap') {
903
+	} else {
904 904
 ?>
905 905
   L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
906 906
     maxZoom: 18,
@@ -909,7 +909,7 @@  discard block
 block discarded – undo
909 909
   }).addTo(map);
910 910
 
911 911
 <?php
912
-    }
912
+	}
913 913
 ?>
914 914
         </script>
915 915
     </div>
Please login to merge, or discard this patch.
Braces   +90 added lines, -20 removed lines patch added patch discarded remove patch
@@ -6,12 +6,19 @@  discard block
 block discarded – undo
6 6
 //gets the page file and stores it in a variable
7 7
 $file_path = pathinfo($_SERVER['SCRIPT_NAME']);
8 8
 $current_page = $file_path['filename'];
9
-if ($globalTimezone == '') $globalTimezone = 'UTC';
9
+if ($globalTimezone == '') {
10
+	$globalTimezone = 'UTC';
11
+}
10 12
 date_default_timezone_set($globalTimezone);
11
-if (isset($_COOKIE['MapType']) && $_COOKIE['MapType'] != '') $MapType = $_COOKIE['MapType'];
12
-else $MapType = $globalMapProvider;
13
+if (isset($_COOKIE['MapType']) && $_COOKIE['MapType'] != '') {
14
+	$MapType = $_COOKIE['MapType'];
15
+} else {
16
+	$MapType = $globalMapProvider;
17
+}
13 18
 
14
-if (isset($globalMapOffline) && $globalMapOffline) $MapType = 'offline';
19
+if (isset($globalMapOffline) && $globalMapOffline) {
20
+	$MapType = 'offline';
21
+}
15 22
 
16 23
 if (isset($_GET['3d'])) {
17 24
 	setcookie('MapFormat','3d');
@@ -219,7 +226,10 @@  discard block
 block discarded – undo
219 226
 <?php
220 227
 //		}
221 228
 ?>
222
-<script src="<?php print $globalURL; ?>/js/map.2d.js.php?<?php print time(); ?><?php if (isset($tsk)) print '&tsk='.$tsk; ?>"></script>
229
+<script src="<?php print $globalURL; ?>/js/map.2d.js.php?<?php print time(); ?><?php if (isset($tsk)) {
230
+	print '&tsk='.$tsk;
231
+}
232
+?>"></script>
223 233
 <?php
224 234
 		if (!isset($globalAircraft) || $globalAircraft) {
225 235
 ?>
@@ -264,7 +274,13 @@  discard block
 block discarded – undo
264 274
 <script src="<?php print $globalURL; ?>/js/MovingMarker.js"></script>
265 275
 <script src="<?php print $globalURL; ?>/js/jquery.idle.min.js"></script>
266 276
 <script src="<?php print $globalURL; ?>/js/map.common.js"></script>
267
-<script src="<?php print $globalURL; ?>/js/map.2d.js.php?ident=<?php print $ident; ?><?php if(isset($latitude)) print '&latitude='.$latitude; ?><?php if(isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script>
277
+<script src="<?php print $globalURL; ?>/js/map.2d.js.php?ident=<?php print $ident; ?><?php if(isset($latitude)) {
278
+	print '&latitude='.$latitude;
279
+}
280
+?><?php if(isset($longitude)) {
281
+	print '&longitude='.$longitude;
282
+}
283
+?>&<?php print time(); ?>"></script>
268 284
 <?php
269 285
 		if (!isset($type) || $type == 'aircraft') {
270 286
 ?>
@@ -337,7 +353,13 @@  discard block
 block discarded – undo
337 353
 <script src="<?php print $globalURL; ?>/js/MovingMarker.js"></script>
338 354
 <script src="<?php print $globalURL; ?>/js/jquery.idle.min.js"></script>
339 355
 <script src="<?php print $globalURL; ?>/js/map.common.js"></script>
340
-<script src="<?php print $globalURL; ?>/js/map.2d.js.php?flightaware_id=<?php print $flightaware_id; ?><?php if(isset($latitude)) print '&latitude='.$latitude; ?><?php if(isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script>
356
+<script src="<?php print $globalURL; ?>/js/map.2d.js.php?flightaware_id=<?php print $flightaware_id; ?><?php if(isset($latitude)) {
357
+	print '&latitude='.$latitude;
358
+}
359
+?><?php if(isset($longitude)) {
360
+	print '&longitude='.$longitude;
361
+}
362
+?>&<?php print time(); ?>"></script>
341 363
 <script src="<?php print $globalURL; ?>/js/map-aircraft.2d.js.php?flightaware_id=<?php print $flightaware_id; ?>&<?php print time(); ?>"></script>
342 364
 <?php
343 365
 		if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '' && ($MapType == 'Google-Roadmap' || $MapType == 'Google-Satellite' || $MapType == 'Google-Hybrid' || $MapType == 'Google-Terrain')) {
@@ -418,7 +440,12 @@  discard block
 block discarded – undo
418 440
         <span class="icon-bar"></span>
419 441
       </button>
420 442
       <a href="<?php print $globalURL; ?>/search" class="navbar-toggle search"><i class="fa fa-search"></i></a>
421
-      <a class="navbar-brand" href="<?php if ($globalURL == '') print '/'; else print $globalURL; ?>"><img src="<?php print $globalURL.$logoURL; ?>" height="30px" /></a>
443
+      <a class="navbar-brand" href="<?php if ($globalURL == '') {
444
+	print '/';
445
+} else {
446
+	print $globalURL;
447
+}
448
+?>"><img src="<?php print $globalURL.$logoURL; ?>" height="30px" /></a>
422 449
     </div>
423 450
     <div class="collapse navbar-collapse">
424 451
 
@@ -473,7 +500,10 @@  discard block
 block discarded – undo
473 500
 	}
474 501
 ?>
475 502
 
476
-          <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a>
503
+          <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) {
504
+	echo 'right-';
505
+}
506
+?>caret"></b></a>
477 507
           <ul class="dropdown-menu">
478 508
           	<li><a href="<?php print $globalURL; ?>/aircraft"><?php echo _("Aircraft Types"); ?></a></li>
479 509
 <?php
@@ -544,8 +574,14 @@  discard block
 block discarded – undo
544 574
         </li>
545 575
       	<li><a href="<?php print $globalURL; ?>/search"><?php echo _("Search"); ?></a></li>
546 576
       	<li><a href="<?php print $globalURL; ?>/statistics"><?php echo _("Statistics"); ?></a></li>
547
-        <li class="dropdown<?php if ($sub) echo '-submenu'; ?>">
548
-          <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Tools"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a>
577
+        <li class="dropdown<?php if ($sub) {
578
+	echo '-submenu';
579
+}
580
+?>">
581
+          <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Tools"); ?> <b class="<?php if ($sub) {
582
+	echo 'right-';
583
+}
584
+?>caret"></b></a>
549 585
           <ul class="dropdown-menu">
550 586
           	<li><a href="<?php print $globalURL; ?>/tools/acars"><?php echo _("ACARS translator"); ?></a></li>
551 587
           	<li><a href="<?php print $globalURL; ?>/tools/metar"><?php echo _("METAR translator"); ?></a></li>
@@ -589,7 +625,10 @@  discard block
 block discarded – undo
589 625
 <?php
590 626
 	}
591 627
 ?>
592
-		<a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a>
628
+		<a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) {
629
+	echo 'right-';
630
+}
631
+?>caret"></b></a>
593 632
 		<ul class="dropdown-menu">
594 633
 		    <li><a href="<?php print $globalURL; ?>/marine/currently"><?php echo _("Current Activity"); ?></a></li>
595 634
 		    <li><a href="<?php print $globalURL; ?>/marine/latest"><?php echo _("Latest Activity"); ?></a></li>
@@ -630,7 +669,10 @@  discard block
 block discarded – undo
630 669
 <?php
631 670
 	}
632 671
 ?>
633
-		<a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a>
672
+		<a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) {
673
+	echo 'right-';
674
+}
675
+?>caret"></b></a>
634 676
 		<ul class="dropdown-menu">
635 677
 		    <li><a href="<?php print $globalURL; ?>/tracker/currently"><?php echo _("Current Activity"); ?></a></li>
636 678
 		    <li><a href="<?php print $globalURL; ?>/tracker/latest"><?php echo _("Latest Activity"); ?></a></li>
@@ -673,7 +715,10 @@  discard block
 block discarded – undo
673 715
 ?>
674 716
 
675 717
 <!--
676
-		<a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a>
718
+		<a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) {
719
+	echo 'right-';
720
+}
721
+?>caret"></b></a>
677 722
 		<ul class="dropdown-menu">
678 723
 		    <li><a href="<?php print $globalURL; ?>/satellite/currently"><?php echo _("Current Activity"); ?></a></li>
679 724
 		    <li><a href="<?php print $globalURL; ?>/satellite/latest"><?php echo _("Latest Activity"); ?></a></li>
@@ -730,7 +775,9 @@  discard block
 block discarded – undo
730 775
   		        $alllang = $Language->getLanguages();
731 776
   		        foreach ($alllang as $key => $lang) {
732 777
   		            print '<option value="'.$key.'"';
733
-  		            if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) print ' selected ';
778
+  		            if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) {
779
+  		            	print ' selected ';
780
+  		            }
734 781
   		            print '>'.$lang[0].'</option>';
735 782
   		        }
736 783
   		    ?>
@@ -878,9 +925,24 @@  discard block
 block discarded – undo
878 925
 	$customid = $globalMapProvider;
879 926
 ?>
880 927
     L.tileLayer('<?php print $globalMapCustomLayer[$customid]['url']; ?>/{z}/{x}/{y}.png', {
881
-        maxZoom: <?php if (isset($globalMapCustomLayer[$customid]['maxZoom'])) print $globalMapCustomLayer[$customid]['maxZoom']; else print '18'; ?>,
882
-        minZoom: <?php if (isset($globalMapCustomLayer[$customid]['minZoom'])) print $globalMapCustomLayer[$customid]['minZoom']; else print '0'; ?>,
883
-        noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) print 'false'; else print 'true'; ?>,
928
+        maxZoom: <?php if (isset($globalMapCustomLayer[$customid]['maxZoom'])) {
929
+	print $globalMapCustomLayer[$customid]['maxZoom'];
930
+} else {
931
+	print '18';
932
+}
933
+?>,
934
+        minZoom: <?php if (isset($globalMapCustomLayer[$customid]['minZoom'])) {
935
+	print $globalMapCustomLayer[$customid]['minZoom'];
936
+} else {
937
+	print '0';
938
+}
939
+?>,
940
+        noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) {
941
+	print 'false';
942
+} else {
943
+	print 'true';
944
+}
945
+?>,
884 946
         attribution: '<?php print $globalMapCustomLayer[$customid]['attribution']; ?>'
885 947
     }).addTo(map);
886 948
 <?php
@@ -895,7 +957,12 @@  discard block
 block discarded – undo
895 957
         maxZoom: 5,
896 958
         tms : true,
897 959
         zindex : 3,
898
-        noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) print 'false'; else print 'true'; ?>,
960
+        noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) {
961
+	print 'false';
962
+} else {
963
+	print 'true';
964
+}
965
+?>,
899 966
         attribution: 'Natural Earth'
900 967
     }).addTo(map);
901 968
 <?php
@@ -918,4 +985,7 @@  discard block
 block discarded – undo
918 985
 
919 986
 ?>
920 987
 
921
-<section class="container main-content <?php if (strtolower($current_page) == 'index') print 'index '; ?>clear">
988
+<section class="container main-content <?php if (strtolower($current_page) == 'index') {
989
+	print 'index ';
990
+}
991
+?>clear">
Please login to merge, or discard this patch.
aircraft.php 1 patch
Braces   +15 added lines, -5 removed lines patch added patch discarded remove patch
@@ -16,7 +16,9 @@  discard block
 block discarded – undo
16 16
 	print '<h1>'._("Aircraft Types").'</h1>';
17 17
 
18 18
 	$aircraft_types = $Stats->getAllAircraftTypes();
19
-	if (empty($aircraft_types) || $aircraft_types[0]['aircraft_manufacturer'] == '') $aircraft_types = $Spotter->getAllAircraftTypes();
19
+	if (empty($aircraft_types) || $aircraft_types[0]['aircraft_manufacturer'] == '') {
20
+		$aircraft_types = $Spotter->getAllAircraftTypes();
21
+	}
20 22
 	$previous = null;
21 23
 	print '<div class="alphabet-legend">';
22 24
 	foreach($aircraft_types as $value) {
@@ -24,10 +26,14 @@  discard block
 block discarded – undo
24 26
 		$firstLetter = substr($value['aircraft_manufacturer'], 0, 1);
25 27
 		if($previous !== $firstLetter && $firstLetter != '(' && $firstLetter != ')')
26 28
 		{
27
-			if ($previous !== null) print ' | ';
29
+			if ($previous !== null) {
30
+				print ' | ';
31
+			}
28 32
 			print '<a href="#'.$firstLetter.'">'.$firstLetter.'</a>';
29 33
 		}
30
-		if ($firstLetter != '(' && $firstLetter != ')') $previous = $firstLetter;
34
+		if ($firstLetter != '(' && $firstLetter != ')') {
35
+			$previous = $firstLetter;
36
+		}
31 37
 	}
32 38
 	print '</div>';
33 39
 	$previous = null;
@@ -38,10 +44,14 @@  discard block
 block discarded – undo
38 44
 		{
39 45
 			if($previous !== $firstLetter && $firstLetter != '(' && $firstLetter != ')')
40 46
 			{
41
-				if ($previous !== null) print '</div>';
47
+				if ($previous !== null) {
48
+					print '</div>';
49
+				}
42 50
 				print '<a name="'.$firstLetter.'"></a><h4 class="alphabet-header">'.$firstLetter.'</h4><div class="alphabet">';
43 51
 			}
44
-			if ($firstLetter != '(' && $firstLetter != ')') $previous = $firstLetter;
52
+			if ($firstLetter != '(' && $firstLetter != ')') {
53
+				$previous = $firstLetter;
54
+			}
45 55
 			print '<div class="alphabet-item">';
46 56
 			print '<a href="'.$globalURL.'/aircraft/'.$value['aircraft_icao'].'">';
47 57
 			if ($value['aircraft_name'] == '') {
Please login to merge, or discard this patch.
owner-detailed.php 1 patch
Braces   +23 added lines, -8 removed lines patch added patch discarded remove patch
@@ -45,8 +45,12 @@  discard block
 block discarded – undo
45 45
 	$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);
46 46
 	$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT);
47 47
 	$filter = array();
48
-	if ($year != '') $filter = array_merge($filter,array('year' => $year));
49
-	if ($month != '') $filter = array_merge($filter,array('month' => $month));
48
+	if ($year != '') {
49
+		$filter = array_merge($filter,array('year' => $year));
50
+	}
51
+	if ($month != '') {
52
+		$filter = array_merge($filter,array('month' => $month));
53
+	}
50 54
 	if ($sort != '') 
51 55
 	{
52 56
 		$spotter_array = $Spotter->getSpotterDataByOwner($owner,$limit_start.",".$absolute_difference, $sort,$filter);
@@ -64,8 +68,12 @@  discard block
 block discarded – undo
64 68
 	{
65 69
 		$title = sprintf(_("Detailed View for %s"),$spotter_array[0]['aircraft_owner']);
66 70
 		//$ident = $spotter_array[0]['ident'];
67
-		if (isset($spotter_array[0]['latitude'])) $latitude = $spotter_array[0]['latitude'];
68
-		if (isset($spotter_array[0]['longitude'])) $longitude = $spotter_array[0]['longitude'];
71
+		if (isset($spotter_array[0]['latitude'])) {
72
+			$latitude = $spotter_array[0]['latitude'];
73
+		}
74
+		if (isset($spotter_array[0]['longitude'])) {
75
+			$longitude = $spotter_array[0]['longitude'];
76
+		}
69 77
 		require_once('header.php');
70 78
 		/*
71 79
 		if (isset($globalArchive) && $globalArchive) {
@@ -120,9 +128,14 @@  discard block
 block discarded – undo
120 128
 		print '<h1>'.$spotter_array[0]['aircraft_owner'].'</h1>';
121 129
 		//print '<div><span class="label">'._("Owner").'</span>'.$spotter_array[0]['aircraft_owner'].'</div>';
122 130
 		$Stats = new Stats();
123
-		if ($year == '' && $month == '') $flights = $Stats->getStatsOwner($owner);
124
-		else $flights = 0;
125
-		if ($flights == 0) $flights = $Spotter->countFlightsByOwner($owner,$filter);
131
+		if ($year == '' && $month == '') {
132
+			$flights = $Stats->getStatsOwner($owner);
133
+		} else {
134
+			$flights = 0;
135
+		}
136
+		if ($flights == 0) {
137
+			$flights = $Spotter->countFlightsByOwner($owner,$filter);
138
+		}
126 139
 		print '<div><span class="label">'._("Flights").'</span>'.$flights.'</div>';
127 140
 		$aircraft_type = count($Spotter->countAllAircraftTypesByOwner($owner,$filter));
128 141
 		print '<div><span class="label">'._("Aircraft type").'</span>'.$aircraft_type.'</div>';
@@ -133,7 +146,9 @@  discard block
 block discarded – undo
133 146
 		$airlines = count($Spotter->countAllAirlinesByOwner($owner,$filter));
134 147
 		print '<div><span class="label">'._("Airlines").'</span>'.$airlines.'</div>';
135 148
 		$duration = $Spotter->getFlightDurationByOwner($owner,$filter);
136
-		if ($duration != '0') print '<div><span class="label">'._("Total flights spotted duration").'</span>'.$duration.'</div>';
149
+		if ($duration != '0') {
150
+			print '<div><span class="label">'._("Total flights spotted duration").'</span>'.$duration.'</div>';
151
+		}
137 152
 		print '</div>';
138 153
 	
139 154
 		include('owner-sub-menu.php');
Please login to merge, or discard this patch.