<?php
    if ($is_excel === false) {
?>
        <style type="text/css">
            body {
                font-family: sans-serif;
            }
            table {
                border-spacing: 0;
                border-collapse: collapse;
                width: 100%;
                max-width: 100%;
                margin-bottom: 20px;
                font-size:11px;
                vertical-align: middle;
                padding: 0;
                padding: 1px;
                vertical-align: top;
                text-align:center;
                font-family: sans-serif;
            }
        </style>
<?php
    }
?>

<?php
if ($data != null) {
    $jml_data = count($data);
    $nomor = 0;
    // print_r();

    foreach ($data as $key => $value) {
        $nomor++;
        $karyawan       = $value['data_karyawan'];
        $data_sos       = $value['data_sos'];
?>
        <h3 style="text-align: center;"><?= strtoupper(strtolower($title)) ?></h3>
        <h4 style="text-align: center;">PERIODE : <?= $tanggal_mulai . ' s/d ' . $tanggal_selesai ?></h4>
        <h4> </h4>
        <table width="100%" border="1">
            <tr>
                <td style="border:1px solid #fff; text-align:left" colspan="2"><?= strtoupper($this->lang->line('nik')); ?></td>
                <td style="border:1px solid #fff; text-align:left">: <?= $karyawan['nik']; ?></td>
                <td style="border:1px solid #fff; text-align:left"></td>
                <td style="border:1px solid #fff; text-align:left"><?= strtoupper($this->lang->line('cabang')); ?></td>
                <td style="border:1px solid #fff; text-align:left" colspan="2">: <?=  $karyawan['kode_cabang']." - ".$karyawan['nama_cabang']; ?></td>
            </tr>
            <tr>
                <td style="border:1px solid #fff; text-align:left" colspan="2"><?= strtoupper($this->lang->line('nama')); ?></td>
                <td style="border:1px solid #fff; text-align:left">: <?= $karyawan['nama_karyawan']; ?></td>
                <td style="border:1px solid #fff; text-align:left"></td>
                <td style="border:1px solid #fff; text-align:left"><?= strtoupper($this->lang->line('departemen')); ?></td>
                <td style="border:1px solid #fff; text-align:left" colspan="2">: <?= $karyawan['kode_departemen']." - ".$karyawan['nama_departemen']; ?></td>
            </tr>
            <tr>
                <td style="border:1px solid #fff; text-align:left" colspan="2"></td>
                <td style="border:1px solid #fff; text-align:left"></td>
                <td style="border:1px solid #fff; text-align:left"></td>
                <td style="border:1px solid #fff; text-align:left"><?= strtoupper($this->lang->line('jabatan')); ?></td>
                <td style="border:1px solid #fff; text-align:left" colspan="2">: <?=  $karyawan['kode_jabatan']." - ".$karyawan['nama_jabatan']; ?></td>
            </tr>
            <tr>
                <td style="text-align:center;">NO</td>
                <td style="text-align:center;" colspan="2"><?= strtoupper($this->lang->line('tgl')); ?></td>
                <td style="text-align:center;" colspan="4"><?= strtoupper($this->lang->line('keterangan')); ?></td>
            </tr>
            <?php
                if (count($data_sos) > 0) {
                    $no = 1;
                    foreach ($data_sos as $k => $v) {
            ?>
                        <tr>
                            <td><?= $no ?></td>
                            <td colspan="2"><?= $v['tanggal'] ?></td>
                            <td colspan="4"><?= $v['keterangan'] ?></td>
                        </tr>
            <?php
                        $no++;
                    }
                }
            ?>
        </table>
        <?php
        if ($is_excel === true) {
            echo '<h5>--PAGEBREAK--</h5>';
        } else {
            if ($nomor >= 1 && $nomor != $jml_data) {
                echo '<pagebreak>';
            }
        }
        ?>
<?php
    }
}
?>
