SHARE
TWEET

Untitled

a guest Jun 25th, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top