<style>
    body {
        font-family: sans-serif;
    }
</style>
<table width="100%" border="2">
    <tr>
        <td width="50%">
            <?php
            if (!empty($data->url_logo)) {
            ?>
                <img src="<?= $this->config->item('base_image') . 'image?_t=logo&_d=' . $data->url_logo; ?>" alt="" style="width: 150px;">
            <?php
            }
            ?>
        </td>
        <td style="width:50%; vertical-align:top; text-align: right">
            <h2><b>SLIP GAJI<b></h2>
        </td>
    </tr>
    <tr>
        <td colspan="1">
            <h2><?= $data->nm_company ?></h2>
        </td>
    </tr>
    <tr>
        <td colspan="1">
            <label><?= $data->alamat ?></label>
        </td>
    </tr>
</table>
<br>
<!-- detail karyawan -->
<table width="100%" style="border-collapse:collapse; border-top: 1px solid black; border-bottom: 1px solid black">
    <tr>
        <td style="width: 20%;">Nama Karyawan</td>
        <td style="width: 30%;">: <?= $data->nik . " - " . $data->nm_karyawan ?></td>
        <td colspan="2" style="font-weight: bold; text-align: right;">Bulan : <?= date("m-Y", strtotime($data->periode)) ?></td>
    </tr>
    <tr>
        <td style="width: 20%;">Jabatan</td>
        <td style="width: 30%;">: <?= $data->nm_jabatan ?></td>
        <!-- <td style="width: 20%;">Periode</td>
        <td style="width: 30%;">: <?= date("d-m-Y", strtotime($data->tgl_mulai)) ?> s/d <?= date("d-m-Y", strtotime($data->tgl_selesai)) ?></td> -->
    </tr>
    <tr>
        <td style="width: 20%;">Cabang</td>
        <td style="width: 30%;">: <?= $data->nm_cabang . " - " . $data->kd_cabang ?></td>
    </tr>
    <tr>
        <td style="width: 20%;">Departemen</td>
        <td style="width: 30%;">: <?= $data->nm_departemen . " - " . $data->kd_departemen ?></td>
    </tr>
</table>
<!-- penghasilan -->
<table width="100%">
    <tr>
        <td width="50%" style="vertical-align: top;">
            <table width="100%">
                <tr>
                    <td style="width: 40%;"><b>PENGHASILAN</b></td>
                    <td style="width: 60%;"></td>
                </tr>
                <tr>
                    <td style="width: 40%;"><b>Gaji Pokok</b></td>
                    <td style="width: 60%;">: Rp. <?= number_format($data->gapok, 0, ",", ".") ?></td>
                </tr>
                <tr>
                    <td style="width: 40%;"><b>Lembur</b></td>
                    <td style="width: 60%;">: Rp. <?= number_format($data->lembur_rp, 0, ",", ".") ?></td>
                </tr>
                <tr>
                    <td colspan="2"><b>Tunjangan Tetap</b></td>
                </tr>
                <?php
                $no = 1;
                foreach ($tunj_tetap as $u) {
                ?>
                    <tr>
                        <td style="width: 40%;"><?= $no . '. ' . $u->nm_tunjangan ?></td>
                        <td style="width: 60%;">: Rp. <?= number_format($u->nominal, 0, ",", ".") ?></td>
                    </tr>
                <?php $no++;
                }
                ?>
                <tr>
                    <td colspan="2"><b>Tunjangan Tidak Tetap</b></td>
                </tr>
                <?php
                $no = 1;
                foreach ($tunj_tdk_tetap as $u) {
                    if ($u->nominal > 0) {
                ?>
                        <tr>
                            <td style="width: 40%;"><?= $no . '. ' . $u->nm_tunjangan ?></td>
                            <td style="width: 60%;">: Rp. <?= number_format($u->nominal, 0, ",", ".") ?></td>
                        </tr>
                <?php
                        $no++;
                    }
                }
                ?>
                <tr>
                    <td colspan="2"><b>Tunjangan Kehadiran</b></td>
                </tr>
                <?php
                $no = 1;
                foreach ($tunj_kehadiran as $u) {
                ?>
                    <tr>
                        <td style="width: 40%;"><?= $no . '. ' . $u->nm_tunjangan ?></td>
                        <td style="width: 60%;">: Rp. <?= number_format($u->nominal, 0, ",", ".") ?></td>
                    </tr>
                <?php $no++;
                }
                ?>
            </table>
        </td>
        <td width="50%" style="vertical-align: top;">
            <table width="100%">
                <tr>
                    <td style="width: 40%;"><b>POTONGAN</b></td>
                    <td style="width: 60%;"></td>
                </tr>
                <tr>
                    <td style="width: 40%;"><b>Potongan Tetap</b></td>
                    <td style="width: 60%;"></td>
                </tr>
                <?php
                $no = 1;
                foreach ($pot_tetap as $u) {
                ?>
                    <tr>
                        <td style="width: 40%;"><?= $no . '. ' . $u->nm_potongan ?></td>
                        <td style="width: 60%;">: Rp. <?= number_format($u->nominal, 0, ",", ".") ?></td>
                    </tr>
                <?php $no++;
                }
                ?>
                <tr>
                    <td colspan="2"><b>Potongan Tidak Tetap</b></td>
                </tr>
                <?php
                $no = 1;
                foreach ($pot_tdk_tetap as $u) {
                    if ($u->nominal > 0) {
                ?>
                        <tr>
                            <td style="width: 40%;"><?= $no . '. ' . $u->nm_potongan ?></td>
                            <td style="width: 60%;">: Rp. <?= number_format($u->nominal, 0, ",", ".") ?></td>
                        </tr>
                <?php
                        $no++;
                    }
                }
                ?>
                <tr>
                    <td style="width: 40%;"><b>Potongan Absensi</b></td>
                    <td style="width: 60%;">: Rp. <?= number_format($data->pot_absensi_acc, 0, ",", ".") ?></td>
                </tr>
                <tr>
                    <td colspan="2"><b>Potongan BPJS</b></td>
                </tr>
                <tr>
                    <td style="width: 40%;">1. BPJS Kesehatan</td>
                    <td style="width: 60%;">: Rp. <?= number_format($data->pot_bpjs_kes, 0, ",", ".") ?></td>
                </tr>
                <tr>
                    <td style="width: 40%;">2. BPJS TK</td>
                    <td style="width: 60%;">: Rp. <?= number_format($data->pot_bpjs_tk, 0, ",", ".") ?></td>
                </tr>
                <tr>
                    <td style="width: 40%;"><b>Potongan PPH 21</b></td>
                    <td style="width: 60%;">: Rp. <?= number_format($data->pot_pph21, 0, ",", ".") ?></td>
                </tr>
            </table>
        </td>
    </tr>
</table>
<hr>
<table width="100%">
    <tr>
        <td style="width: 20%;"><b>Total Penerimaan</b></td>
        <td style="width: 30%;">: Rp. <?= number_format($data->gapok + $data->ttl_tunjangan, 0, ",", ".") ?></td>
        <td style="width: 20%;"><b>Total Potongan</td>
        <td style="width: 30%;">: Rp. <?= number_format($data->ttl_potongan, 0, ",", ".") ?></td>
    </tr>
</table>
<hr>
<!-- gaji diterima -->
<h4>Gaji Diterima : Rp. <?= number_format($data->thp, 0, ",", ".") ?></h4>
<hr>
<table width="100%">
    <tr>
        <td style="width: 40%;"><b>Tunjangan Dibiayai Perusahaan</b></td>
        <td style="width: 60%;"></td>
    </tr>
</table>
<table width="100%">
    <tr>
        <td style="width: 30%;">1. BPJS Kesehatan</td>
        <td style="width: 70%;">: Rp. <?= number_format($data->tunj_bpjs_kes, 0, ",", ".") ?></td>
    </tr>
    <tr>
        <td style="width: 30%;">2. BPJS Ketenagakerjaan</td>
        <td style="width: 70%;">: Rp. <?= number_format($data->tunj_bpjs_tk, 0, ",", ".") ?></td>
    </tr>
</table>
