Code Duplication    Length = 8-8 lines in 7 locations

require/class.Stats.php 7 locations

@@ 462-469 (lines=8) @@
459
                return $all;
460
	}
461
	
462
	public function countOverallFlights() {
463
		$all = $this->getSumStats('flights_bymonth',date('Y'));
464
		if (empty($all)) {
465
			$Spotter = new Spotter($this->db);
466
			$all = $Spotter->countOverallFlights();
467
		}
468
		return $all;
469
	}
470
	public function countOverallMilitaryFlights() {
471
		$all = $this->getSumStats('military_flights_bymonth',date('Y'));
472
		if (empty($all)) {
@@ 470-477 (lines=8) @@
467
		}
468
		return $all;
469
	}
470
	public function countOverallMilitaryFlights() {
471
		$all = $this->getSumStats('military_flights_bymonth',date('Y'));
472
		if (empty($all)) {
473
			$Spotter = new Spotter($this->db);
474
			$all = $Spotter->countOverallMilitaryFlights();
475
		}
476
		return $all;
477
	}
478
	public function countOverallArrival() {
479
		$all = $this->getSumStats('realarrivals_bymonth',date('Y'));
480
		if (empty($all)) {
@@ 478-485 (lines=8) @@
475
		}
476
		return $all;
477
	}
478
	public function countOverallArrival() {
479
		$all = $this->getSumStats('realarrivals_bymonth',date('Y'));
480
		if (empty($all)) {
481
			$Spotter = new Spotter($this->db);
482
			$all = $Spotter->countOverallArrival();
483
		}
484
		return $all;
485
	}
486
	public function countOverallAircrafts() {
487
		$all = $this->getSumStats('aircrafts_bymonth',date('Y'));
488
		if (empty($all)) {
@@ 486-493 (lines=8) @@
483
		}
484
		return $all;
485
	}
486
	public function countOverallAircrafts() {
487
		$all = $this->getSumStats('aircrafts_bymonth',date('Y'));
488
		if (empty($all)) {
489
			$Spotter = new Spotter($this->db);
490
			$all = $Spotter->countOverallAircrafts();
491
		}
492
		return $all;
493
	}
494
	public function countOverallAirlines() {
495
		$all = $this->getSumStats('airlines_bymonth',date('Y'));
496
		if (empty($all)) {
@@ 494-501 (lines=8) @@
491
		}
492
		return $all;
493
	}
494
	public function countOverallAirlines() {
495
		$all = $this->getSumStats('airlines_bymonth',date('Y'));
496
		if (empty($all)) {
497
			$Spotter = new Spotter($this->db);
498
			$all = $Spotter->countOverallAirlines();
499
		}
500
		return $all;
501
	}
502
	public function countOverallOwners() {
503
		$all = $this->getSumStats('owners_bymonth',date('Y'));
504
		if (empty($all)) {
@@ 502-509 (lines=8) @@
499
		}
500
		return $all;
501
	}
502
	public function countOverallOwners() {
503
		$all = $this->getSumStats('owners_bymonth',date('Y'));
504
		if (empty($all)) {
505
			$Spotter = new Spotter($this->db);
506
			$all = $Spotter->countOverallOwners();
507
		}
508
		return $all;
509
	}
510
	public function countOverallPilots() {
511
		$all = $this->getSumStats('pilots_bymonth',date('Y'));
512
		if (empty($all)) {
@@ 510-517 (lines=8) @@
507
		}
508
		return $all;
509
	}
510
	public function countOverallPilots() {
511
		$all = $this->getSumStats('pilots_bymonth',date('Y'));
512
		if (empty($all)) {
513
			$Spotter = new Spotter($this->db);
514
			$all = $Spotter->countOverallPilots();
515
		}
516
		return $all;
517
	}
518
519
	public function getLast7DaysAirports($airport_icao = '') {
520
		$query = "SELECT * FROM stats_airport WHERE stats_type = 'daily' AND airport_icao = :airport_icao ORDER BY date";