Code Duplication    Length = 16-16 lines in 4 locations

require/class.Stats.php 4 locations

@@ 577-592 (lines=16) @@
574
                $all = $sth->fetchAll(PDO::FETCH_ASSOC);
575
                return $all[0]['total'];
576
        }
577
	public function getStatsAircraftTotal() {
578
    		global $globalArchiveMonths, $globalDBdriver;
579
    		if ($globalDBdriver == 'mysql') {
580
			$query = "SELECT SUM(cnt) as total FROM stats_aircraft";
581
                } else {
582
			$query = "SELECT SUM(cnt) as total FROM stats_aircraft";
583
                }
584
                 try {
585
                        $sth = $this->db->prepare($query);
586
                        $sth->execute();
587
                } catch(PDOException $e) {
588
                        echo "error : ".$e->getMessage();
589
                }
590
                $all = $sth->fetchAll(PDO::FETCH_ASSOC);
591
                return $all[0]['total'];
592
        }
593
	public function getStatsAirlineTotal() {
594
    		global $globalArchiveMonths, $globalDBdriver;
595
    		if ($globalDBdriver == 'mysql') {
@@ 593-608 (lines=16) @@
590
                $all = $sth->fetchAll(PDO::FETCH_ASSOC);
591
                return $all[0]['total'];
592
        }
593
	public function getStatsAirlineTotal() {
594
    		global $globalArchiveMonths, $globalDBdriver;
595
    		if ($globalDBdriver == 'mysql') {
596
			$query = "SELECT SUM(cnt) as total FROM stats_airline";
597
                } else {
598
			$query = "SELECT SUM(cnt) as total FROM stats_airline";
599
                }
600
                 try {
601
                        $sth = $this->db->prepare($query);
602
                        $sth->execute();
603
                } catch(PDOException $e) {
604
                        echo "error : ".$e->getMessage();
605
                }
606
                $all = $sth->fetchAll(PDO::FETCH_ASSOC);
607
                return $all[0]['total'];
608
        }
609
	public function getStatsOwnerTotal() {
610
    		global $globalArchiveMonths, $globalDBdriver;
611
    		if ($globalDBdriver == 'mysql') {
@@ 609-624 (lines=16) @@
606
                $all = $sth->fetchAll(PDO::FETCH_ASSOC);
607
                return $all[0]['total'];
608
        }
609
	public function getStatsOwnerTotal() {
610
    		global $globalArchiveMonths, $globalDBdriver;
611
    		if ($globalDBdriver == 'mysql') {
612
			$query = "SELECT SUM(cnt) as total FROM stats_owner";
613
		} else {
614
			$query = "SELECT SUM(cnt) as total FROM stats_owner";
615
                }
616
                 try {
617
                        $sth = $this->db->prepare($query);
618
                        $sth->execute();
619
                } catch(PDOException $e) {
620
                        echo "error : ".$e->getMessage();
621
                }
622
                $all = $sth->fetchAll(PDO::FETCH_ASSOC);
623
                return $all[0]['total'];
624
        }
625
	public function getStatsPilotTotal() {
626
    		global $globalArchiveMonths, $globalDBdriver;
627
    		if ($globalDBdriver == 'mysql') {
@@ 625-640 (lines=16) @@
622
                $all = $sth->fetchAll(PDO::FETCH_ASSOC);
623
                return $all[0]['total'];
624
        }
625
	public function getStatsPilotTotal() {
626
    		global $globalArchiveMonths, $globalDBdriver;
627
    		if ($globalDBdriver == 'mysql') {
628
            		$query = "SELECT SUM(cnt) as total FROM stats_pilot";
629
            	} else {
630
            		$query = "SELECT SUM(cnt) as total FROM stats_pilot";
631
            	}
632
                 try {
633
                        $sth = $this->db->prepare($query);
634
                        $sth->execute();
635
                } catch(PDOException $e) {
636
                        echo "error : ".$e->getMessage();
637
                }
638
                $all = $sth->fetchAll(PDO::FETCH_ASSOC);
639
                return $all[0]['total'];
640
        }
641
642
	public function addStat($type,$cnt,$stats_date) {
643
		global $globalDBdriver;