diff --git a/application/controllers/MRIRcontroller.php b/application/controllers/MRIRcontroller.php index e29a8342..0f7db260 100755 --- a/application/controllers/MRIRcontroller.php +++ b/application/controllers/MRIRcontroller.php @@ -1,6 +1,8 @@ loadViews("materialinspectionreport", $this->global,$data,NULL); } + // Mrir pdf public function MrirDetailsPrintPdf() { $MrirNo = $_GET['MRIRNO']; - // echo $MrirNo; + $this->global['pageTitle'] = 'Siddharth : MRIR Pdf '; - $data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformation(); - //print_r($data['CompanyDetails']); + $data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformation(); $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 + $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); + // Get output html - $php = $this->output->get_output(); + // $php = $this->output->get_output(); - // Load library - $this->load->library('dompdf_gen'); + // // 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); + // // Convert to PDF + // $this->dompdf->load_html($php); + // $this->dompdf->render(); + // $data['Attachment'] = FALSE; + // $this->dompdf->stream("MrirDetails.pdf",$data,$php); } @@ -380,4 +392,6 @@ public function viewmMaterialDistributionList() } } -?> \ No newline at end of file +?> + + diff --git a/application/controllers/payslip.php b/application/controllers/payslip.php index 55ca3ad8..14090d0f 100755 --- 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)) // { @@ -94,7 +97,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')) { @@ -122,7 +125,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{ @@ -256,7 +259,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{ @@ -351,28 +354,41 @@ function phpAlert($msg) { if(empty($excel)){ - $php = $this->output->get_output(); + // $php = $this->output->get_output(); // Load library - $this->load->library('dompdf_gen'); + // $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); + // $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); + } } @@ -747,7 +763,7 @@ function getEmployee() */ public function PrintPdf() { - + $html=""; $All = $this->input->post('All'); if($All == '') { @@ -769,25 +785,32 @@ function getEmployee() { $result = $this->payroll_model->getEmpAll($Payon); - //print_r($result); - //echo "-----------------------------------------"; + // print_r($result); + // die(); if($result > 0 ) { - for($i=0;$i payroll_model->GetPayslipdata($Payon,$EmpID); - - + // + $totalsalary =$Data['PayDetails'][0]->LessAdvance; $totalsalaryinwords = $this->convertNumber(round($totalsalary)); $Data['amtinwords']=$totalsalaryinwords; + // print_r ($Data); + // exit(); //$Data['Count'] = $i; - $this->load->View("payslipgenerateprint", $Data ); - + $html=$this->load->view("payslipgenerateprint", $Data,true ); + + // print_r ($Data); + // exit(); } } @@ -801,45 +824,58 @@ function getEmployee() $totalsalary =$Data['PayDetails'][0]->LessAdvance; $totalsalaryinwords = $this->convertNumber(round($totalsalary)); $Data['amtinwords']=$totalsalaryinwords; - - $this->load->View("payslipgenerateprint", $Data ); + //print_r ($Data); + //exit(); + $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, 38, 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); - } + } +} function updatePayslip() { diff --git a/application/views/payslipgenerateprint.php b/application/views/payslipgenerateprint.php index 03b1a659..f576f751 100755 --- a/application/views/payslipgenerateprint.php +++ b/application/views/payslipgenerateprint.php @@ -184,9 +184,9 @@ if($RecCount > 0) - +
-
+
SIDDHARTH INDUSTRIES
Survey No: 168/1C3,Pennalur Pet Road,Goonipalyam village,
Uthukottai Taluk,Tiruvallur Dist, Chennai,Tamilnadu,Pin code : 602026.
PaySlip for the Month of
@@ -256,7 +256,7 @@ if($RecCount > 0)
- +
@@ -309,7 +309,7 @@ if($RecCount > 0) - +
EarningsAmount DeductionsAmount
 Basic Plus DA
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.