Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function cetak_cv_pdf_status() {
- $Tgl1 = $this->uri->segment(4);
- $Tgl2 = $this->uri->segment(5);
- $Status = $this->uri->segment(6);
- $data = array(
- 'Tgl1' => $Tgl1,
- 'Tgl2' => $Tgl2,
- 'Status' => $Status
- );
- $data['preview'] = $this->laporan_model->select_print_cv_status($data)->result();
- $time = time();
- $filename = 'ReportCVStatus_'.$time;
- $pdfFilePath = FCPATH."download/$filename.pdf";
- if (file_exists($pdfFilePath) == FALSE){
- ini_set('memory_limit','50M');
- $html = $this->load->view('panel/laporan/r_cv_print_status_pdf', $data, true); // render the view into HTML
- $this->load->library('pdf');
- $pdf = $this->pdf->load();
- $pdf->SetHeader('');
- $pdf->SetFooter('');
- $pdf->WriteHTML($html); // write the HTML into the PDF
- $pdf->Output($pdfFilePath, 'F'); // save to file because we can
- }
- redirect("download/$filename.pdf");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement