Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function cetak($id_dko) {
- $id_dko = $this->uri->segment(4);
- $data['dko'] = $this->dko_model->select_by_id2($id_dko)->row();
- $data['daftar_detail'] = $this->dko_model->select_detail_all($id_dko)->result();
- $pdfFilePath = "C:\\downloads/reports/$filename.pdf";
- if (file_exists($pdfFilePath) == FALSE){
- ini_set('memory_limit','32M');
- $html = $this->load->view('adm/r_print_dko', $data, true); // render the view into HTML
- $this->load->library('pdf');
- $pdf = $this->pdf->load();
- $pdf->SetFooter($_SERVER['HTTP_HOST'].'|{PAGENO}|'.date(DATE_RFC822));
- $pdf->WriteHTML($html); // write the HTML into the PDF
- $pdf->Output($pdfFilePath, 'F'); // save to file because we can
- }
- redirect("C:\\downloads\reports\$filename.pdf");
- //$this->load->view('adm/r_print_dko', $data);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement