Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function downloadInvoice()
- {
- $id = $this->uri->segment(2);
- $where = array('invoice_id'=>$id);
- $data['invoice'] = $this->Common_model->getDataWhere("invoices","*",$where);
- $mpdf = new MpdfMpdf();
- $this->session->set_userdata($data);
- $filename = $invoice['invoice_no'].'.pdf';
- header("Content-Disposition", "attachment; filename='.$filename.'");
- $html=$this->load->view('user/pdf/download_invoice',[],true);
- $mpdf->WriteHTML($html);
- $mpdf->Output($filename, 'D');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement