Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function printpdf($gaji_id)
- {
- ini_set('memory_limit', '-1');
- $gaji_id = $this->secure->decrypt_url($gaji_id);
- $detail = $this->db->get_where('v_gaji', array('gaji_id' => $gaji_id))->row();
- $data['detail'] = $this->db->get_where('v_gaji', array('gaji_id' => $gaji_id))->row();
- $data['listData'] = $this->db->order_by('pegawai_nama', 'asc')->get_where('v_detail_gaji', array('gaji_id' => $gaji_id))->result();
- $time = time();
- $filename = 'Tanda-Terima-Pembayaran-Gaji-Non-PNS-' . $time;
- $mpdf = new \Mpdf\Mpdf(['format' => [210, 330], 'tempDir' => '/../../tmp']);
- $mpdf->SetTitle('Tanda Terima Pembayaran Gaji Non PNS');
- $mpdf->SetHTMLHeader('<br>
- <table width="100%" cellpadding="2" cellspacing="2">
- <tr>
- <td width="100%" align="center">
- <div style="font-size:12px;"><b>TANDA TERIMA PEMBAYARAN GAJI NON PNS</b></div>
- <div style="font-size:12px;"><b>BULAN : ' . strtoupper(getBulan($detail->gaji_bulan)) . ' ' . $detail->gaji_tahun . '</b></div>
- </td>
- </tr>
- </table>
- <hr class="s3">');
- $mpdf->AddPage('L', '', '', '', '', 5, 5, 23, 6, 6, 3);
- $mpdf->SetHTMLHeader('<br><br><br>
- <table width="100%" border="1">
- <tr>
- <th width="3%">NO</th>
- <th width="10%">OPD</th>
- <th width="6%">NIPD</th>
- <th width="8%">NIK</th>
- <th>NAMA</th>
- <th width="8%">NO. REK BANK</th>
- <th width="10%">NAMA BANK</th>
- <th width="10%">JABATAN</th>
- <th width="6%">HONOR/GAJI</th>
- <th width="6%">IUR. BPJS 4%</th>
- <th width="6%">IUR. BPJS 1%</th>
- <th width="6%">GAJI DITERIMA</th>
- <th width="10%">TANDA TANGAN</th>
- </tr>
- </table>');
- $html = $this->load->view('print/printgajipdf_v', $data, true);
- $mpdf->WriteHTML($html);
- $pdfFilePath = FCPATH . "download/$filename.pdf";
- $mpdf->Output($pdfFilePath, 'F');
- header("Content-type: application/pdf");
- header("Content-Length:" . filesize($pdfFilePath));
- readfile($pdfFilePath);
- exit;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement