function pds($employee_id) { $this->load->helper('settings'); $this->load->library('fpdf'); define('FPDF_FONTPATH', $this->config->item('fonts_path')); $this->load->library('fpdi'); $this->page1($employee_id); $this->page2($employee_id); $this->page3($employee_id); $this->page4($employee_id); //if training is excess to page //Concatenate the pdf files $pdf = new FPDI('P', 'mm', 'Legal'); $pdf->setFiles($this->pds); $pdf->concat(); $pdf->Output("dtr/template/pds/archives/" . $employee_id . ".pdf", 'I'); //header("location:".base_url()."dtr/template/pds/archives/".$employee_id.".pdf"); unlink('dtr/template/pds/page1_' . $employee_id . '.pdf'); unlink('dtr/template/pds/page2_' . $employee_id . '.pdf'); unlink('dtr/template/pds/page3_' . $employee_id . '.pdf'); unlink('dtr/template/pds/page4_' . $employee_id . '.pdf'); }