Advertisement
Bannip73

controller/P

Nov 26th, 2018
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.73 KB | None | 0 0
  1. function laporan_harian_pdf(){
  2.         $this->load->library('dompdf_gen');
  3.         $tanggal = $this->input->get('tanggal');       
  4.            
  5.         $data['result'] = $this->db->query("select * from data where nomor and keterangan and jumlah and jenis and date(tanggal) >= '$tanggal'")->result();                                        
  6.         $this->load->view('laporan_harian_pdf', $data);
  7.  
  8.             $paper_size  = 'A4'; // ukuran kertas
  9.         $orientation = 'landscape'; //tipe format kertas potrait atau landscape
  10.         $html = $this->output->get_output();
  11.  
  12.         $this->dompdf->set_paper($paper_size, $orientation);
  13.         //Convert to PDF
  14.         $this->dompdf->load_html($html);
  15.         $this->dompdf->render();
  16.         $this->dompdf->stream("laporan.pdf", array('Attachment'=>0)); // nama file pdf yang di hasilkan
  17.  
  18.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement