From 00dd75fe52d073f3d87dee56f316eba1fc6ecd1b Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Sat, 23 Dec 2017 12:57:24 +0000 Subject: [PATCH] download file path name add --- application/controllers/monthlypay.php | 29 ++++++++++++++++++-------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/application/controllers/monthlypay.php b/application/controllers/monthlypay.php index e0c205c3..8d9360e8 100755 --- a/application/controllers/monthlypay.php +++ b/application/controllers/monthlypay.php @@ -461,17 +461,28 @@ class monthlypay extends BaseController //this function used to pdf value display // function permissionpdf($SNO){ - $data['per'] = $this->monthlypay_model->pdf($SNO); - //print_r($data);die; + $data['per'] = $this->monthlypay_model->pdf($SNO); + + $id=''; + $name =''; + $permissionpdf=''; + $date = ''; + foreach($data['per'] as $record){ + + $id= $record ->EmpID; + $name =$record ->FirstName; + $date =date_format(date_create($record ->date),'d-m-Y'); + + } + $permissionpdf = $id.'-'.$name.'-'.$date; + + $this->load->view($this->config->item('admin_folder') .'/permissionpdf',$data); - //pdf_create($php, 'Trip-Detail'); - - - - $mpdf=new mPDF('utf-8','A4-P',10, 10,10, 10, 10, 38, 4, 6); + + $mpdf=new mPDF('utf-8','A4-P',10, 10,10, 10, 10, 38, 4, 6); $mpdf->SetDisplayMode('fullpage'); $mpdf->SetHTMLHeader($HtmlHeading); - $mpdf->SetTitle('PermissionSlip'); + $mpdf->SetTitle('Permission'); $html = $this->load->view('permissionpdf',$data,true); $mpdf->SetDisplayMode('fullpage'); //$mpdf->setFooter($HTMLFooter . "Page {PAGENO} of {nb}"); @@ -479,7 +490,7 @@ class monthlypay extends BaseController $mpdf->setAutoTopMargin = 'stretch'; $mpdf->setAutoBottomMargin = 'stretch'; $mpdf->WriteHTML($html); - $mpdf->Output("Permission".$data.'.pdf','I',$php); + $mpdf->Output('Permissionslip'.$permissionpdf.'.pdf','I',$php);