diff --git a/application/controllers/MRIRcontroller.php b/application/controllers/MRIRcontroller.php index f13386b9..64030f87 100644 --- a/application/controllers/MRIRcontroller.php +++ b/application/controllers/MRIRcontroller.php @@ -1,6 +1,7 @@ global['pageTitle'] = 'Resico : MRIR Pdf '; $data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformation(); - //print_r($data['CompanyDetails']); $data['MRIRDetails'] = $this->mrir_model->edit_mrir($MrirNo); - - //$data['MRIRDetails'] = $this->mrir_model->edit_mrir($MrirNo); - //print_r($data['MRIRDetails']); $this->load->View("Mrirprintpdf",$data, NULL); - + + + + //*********************MPDF*********** - // Get output html - $php = $this->output->get_output(); - - // Load library - $this->load->library('dompdf_gen'); - - // Convert to PDF - $this->dompdf->load_html($php); - $this->dompdf->render(); - $data['Attachment'] = FALSE; - $this->dompdf->stream("MrirDetails.pdf",$data,$php); + + $mpdf=new mPDF('utf-8','A4-P',8, 10,10, 10, 82, 38, 4, 6); + $mpdf->SetDisplayMode('fullpage'); + $mpdf->SetHTMLHeader($HtmlHeading); + $html = $this->load->view('Mrirprintpdf',$data,true); + $mpdf->SetDisplayMode('fullpage'); + $mpdf->setFooter($HTMLFooter . "Page {PAGENO} of {nb}"); + $mpdf->list_indent_first_level = 1; + $mpdf->setAutoTopMargin = 'stretch'; + $mpdf->setAutoBottomMargin = 'stretch'; + $mpdf->WriteHTML($html); + $mpdf->Output("MrirDetails".$data.'.pdf','I',$php); + } diff --git a/application/controllers/payslip.php b/application/controllers/payslip.php index 179d63e5..a0315640 100644 --- a/application/controllers/payslip.php +++ b/application/controllers/payslip.php @@ -1,6 +1,8 @@ input->post('excel'); + $excel = $this->input->post('excel'); + $HTML=""; //echo $excel; // if(empty($excel)) // { @@ -95,7 +98,7 @@ function phpAlert($msg) { $data['Totalamtwords']=$totamtwords; $data['PayMonth']=$month; $filename = 'Bank Report for'.$payon.'pdf' ; - $this->load->View("bankreportprint",$data); + $HTML = $this->load->View("bankreportprint",$data,true); } if($this->input->post('PF_Report')) { @@ -123,7 +126,7 @@ function phpAlert($msg) { $data['Totalamtwords']=$totamtwords; if(empty($excel)){ $filename = 'PF Report for'.$payon.'pdf' ; - $this->load->View("pfreportprint",$data); + $HTML = $this->load->View("pfreportprint",$data,true); // echo "PDF PART 1"; } else{ @@ -257,7 +260,7 @@ function phpAlert($msg) { if(empty($excel)){ $filename = 'ESI Report for'.$payon.'pdf'; - $this->load->View("esireportprint",$data); + $HTML = $this->load->View("esireportprint",$data,true); // echo "PDF PART 1"; } else{ @@ -352,28 +355,41 @@ function phpAlert($msg) { if(empty($excel)){ - $php = $this->output->get_output(); + // $php = $this->output->get_output(); - // Load library - $this->load->library('dompdf_gen'); + // // Load library + // $this->load->library('dompdf_gen'); - require_once(APPPATH .'third_party/dompdf/dompdf_config.inc.php'); - $dompdf = new DOMPDF(); - $dompdf->set_paper('A4', 'portrait'); - $dompdf->load_html($php); + // require_once(APPPATH .'third_party/dompdf/dompdf_config.inc.php'); + // $dompdf = new DOMPDF(); + // $dompdf->set_paper('A4', 'portrait'); + // $dompdf->load_html($php); - $dompdf->render(); + // $dompdf->render(); - // add the header - $canvas = $dompdf->get_canvas(); - $font = Font_Metrics::get_font("helvetica", "bold"); + // // add the header + // $canvas = $dompdf->get_canvas(); + // $font = Font_Metrics::get_font("helvetica", "bold"); - // the same call as in my previous example - $canvas->page_text(72, 18,"", - $font, 6, array(0,0,0)); + // // the same call as in my previous example + // $canvas->page_text(72, 18,"", + // $font, 6, array(0,0,0)); - $dompdf->stream($filename); - //echo "PDF PART 2"; + // $dompdf->stream($filename); + // //echo "PDF PART 2"; + $mpdf=new mPDF('utf-8','A4-P',9, 12,12, 10, 82, 38, 4, 6); + $mpdf->SetDisplayMode('fullpage'); + $mpdf->SetHTMLHeader($HtmlHeading); + //$html = $this->load->view("bankreportprint",$data,true); + $mpdf->setFooter($HTMLFooter . "Page {PAGENO} of {nb}"); + $mpdf->setFooter("Page {PAGENO} of {nb}"); + $mpdf->list_indent_first_level = 1; + $mpdf->setAutoTopMargin = 'stretch'; + $mpdf->setAutoBottomMargin = 'stretch'; + $mpdf->WriteHTML($HTML); + $mpdf->Output("".$filename.'.pdf','I',$php); + + } } @@ -797,7 +813,7 @@ function getEmployee() $Data['amtinwords']=$totalsalaryinwords; //$Data['Count'] = $i; - $this->load->View("payslipgenerateprint", $Data ); + $html.= $this->load->View("payslipgenerateprint", $Data ,true); } @@ -813,41 +829,52 @@ function getEmployee() $totalsalaryinwords = $this->convertNumber(round($totalsalary)); $Data['amtinwords']=$totalsalaryinwords; - $this->load->View("payslipgenerateprint", $Data ); + $html = $this->load->View("payslipgenerateprint", $Data,true ); } - $php = $this->output->get_output(); + // $php = $this->output->get_output(); - // Load library - $this->load->library('dompdf_gen'); + // // Load library + // $this->load->library('dompdf_gen'); - if($All != '') - { - $filename = 'Payslip-'.$Payon.'.pdf' ; - } - else - { - $filename = 'Payslip-'.$EmpID . '-' .$Payon.'.pdf' ; - } + // if($All != '') + // { + // $filename = 'Payslip-'.$Payon.'.pdf' ; + // } + // else + // { + // $filename = 'Payslip-'.$EmpID . '-' .$Payon.'.pdf' ; + // } - require_once(APPPATH .'third_party/dompdf/dompdf_config.inc.php'); - $dompdf = new DOMPDF(); - $dompdf->set_paper('A4', 'portrait'); - $dompdf->load_html($php); + // require_once(APPPATH .'third_party/dompdf/dompdf_config.inc.php'); + // $dompdf = new DOMPDF(); + // $dompdf->set_paper('A4', 'portrait'); + // $dompdf->load_html($php); - $dompdf->render(); + // $dompdf->render(); - // add the header - $canvas = $dompdf->get_canvas(); - $font = Font_Metrics::get_font("helvetica", "bold"); + // // add the header + // $canvas = $dompdf->get_canvas(); + // $font = Font_Metrics::get_font("helvetica", "bold"); - // the same call as in my previous example - $canvas->page_text(72, 18, "Page: {PAGE_NUM} of {PAGE_COUNT}", - $font, 6, array(0,0,0)); + // // the same call as in my previous example + // $canvas->page_text(72, 18, "Page: {PAGE_NUM} of {PAGE_COUNT}", + // $font, 6, array(0,0,0)); - $dompdf->stream($filename); + // $dompdf->stream($filename); + // } + $mpdf=new mPDF('utf-8','A4-P',10, 10,10, 10, 10, 24, 4, 6); + $mpdf->SetDisplayMode('fullpage'); + $mpdf->SetHTMLHeader($HtmlHeading); + $mpdf->setFooter($HTMLFooter . "Page {PAGENO} of {nb}"); + $mpdf->setFooter("Page {PAGENO} of {nb}"); + $mpdf->list_indent_first_level = 1; + $mpdf->setAutoTopMargin = 'stretch'; + $mpdf->setAutoBottomMargin = 'stretch'; + $mpdf->WriteHTML($html); + $mpdf->Output("".$filename.'.pdf','I',$php); } } diff --git a/application/views/Mrirprintpdf.php b/application/views/Mrirprintpdf.php index 9801628d..4d832786 100644 --- a/application/views/Mrirprintpdf.php +++ b/application/views/Mrirprintpdf.php @@ -86,7 +86,7 @@
| |
+ |
|
@@ -256,7 +256,7 @@ if($RecCount > 0)
Survey No: 168/1C3,Pennalur Pet Road,Goonipalyam village, Uthukottai Taluk,Tiruvallur Dist, Chennai,Tamilnadu,Pin code : 602026. PaySlip for the Month of |
|||||||||
| Earnings | Amount ₹ | Deductions | Amount ₹ |
|---|---|---|---|
| Basic Plus DA | @@ -309,7 +309,7 @@ if($RecCount > 0)|||
| Total Amount In Words | |||
| This is a computer generated document. This document does not require signature. | |||
| This is a computer generated document. This document does not require signature. | |||
Employeer ESIC account No: TNAMB1556420000
+Employee EPFO account No: TNAMB1556420000
| Sno | -ESI Account No | +EPO Account No | Employee Contribution | Employeer Contribution | No of days Present | @@ -67,7 +67,7 @@ if(!empty($companyinfo)) foreach($PFESI as $data) { $index++; - ?> +?>
|---|---|---|---|---|---|
| PFNO;?> | @@ -77,7 +77,7 @@ if(!empty($companyinfo))OTperHours;?> | PF + $data->CompanyPF),2,'.','');?> | |||
| Total | |||||