Code Duplication    Length = 12-16 lines in 2 locations

web_interface/astpp/application/modules/rates/controllers/rates.php 2 locations

@@ 905-916 (lines=12) @@
902
		$this->fpdf->initialize('P', 'mm', 'A4');
903
	$this->fpdf->tablewidths = array(20, 20, 20, 20, 20, 20);
904
		$inbound_array[] = array("Code", "Destination", "Increment","Cost Per Minutes",  "Connect Charge", "Included Seconds");
905
		if ($query->num_rows() > 0) {
906
			foreach ($query->result_array() as $row) {
907
					$inbound_array[] = array(
908
					   $row['pattern']=$this->common->get_only_numeric_val("","",$row["pattern"]),
909
						$row['comment'],
910
						$row['inc'],
911
			$this->common_model->calculate_currency($row['cost'],'','','',false),
912
						$row['connectcost'],
913
						$row['includedseconds']
914
					);
915
			}
916
		}
917
918
		$this->fpdf->AliasNbPages();
919
		$this->fpdf->AddPage();
@@ 999-1014 (lines=16) @@
996
	$customer_array[] = array("Code", "Destination", "Connect Cost($currency)", "Included Seconds", "Per Minute Cost($currency)", "Increment", "Precedence");
997
998
999
	if ($query->num_rows() > 0) {
1000
1001
			foreach ($query->result_array() as $row) {
1002
                
1003
					$customer_array[] = array(
1004
						$row['pattern']=$this->common->get_only_numeric_val("","",$row["pattern"]),
1005
						$row['comment'],
1006
						$row['connectcost'],
1007
			$row['includedseconds'],
1008
			$this->common_model->calculate_currency($row['cost']),
1009
						$row['inc'],
1010
						$row['precedence']
1011
					);
1012
                
1013
			}
1014
		}
1015
		$this->load->helper('csv');
1016
		array_to_csv($customer_array, 'My_Own_Rate_' . date("Y-m-d") . '.csv');
1017
		exit;