Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. public function downloadInvoice()
  2. {
  3. $id = $this->uri->segment(2);
  4. $where = array('invoice_id'=>$id);
  5.  
  6. $data['invoice'] = $this->Common_model->getDataWhere("invoices","*",$where);
  7.  
  8. $mpdf = new MpdfMpdf();
  9. $this->session->set_userdata($data);
  10. $filename = $invoice['invoice_no'].'.pdf';
  11. header("Content-Disposition", "attachment; filename='.$filename.'");
  12. $html=$this->load->view('user/pdf/download_invoice',[],true);
  13. $mpdf->WriteHTML($html);
  14. $mpdf->Output($filename, 'D');
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement