<!-- // created by : KuduSinau_Hendrik_081275532220 (TERIMAKASIH UNTUK MENDAPATKAN KEBERKAHAN, DENGAN TIDAK MERUBAH NAMA HAK CIPTA, PLAGIAT, DAN TIDAK MEMPERJUALBELIKAN APLIKASI INI, SEMOGA KITA SEMUA MENDAPAT MANFAAT DAN KEBERKAHAN DARI APLIKASI INI)
// created by : KuduSinau_Hendrik_081275532220 (UNTUK MASUKAN DAN SARAN SERTA PENGEMBANGAN BISA MENGHUBUNGI NOMOR) -->
<script>
    window.print();
</script>
<style>
    table {
        background-color: white;
        border-collapse: collapse;
        border-color: black;
    }

    head>tr {
        background-color: white;
        color: black;
        border-color: black;
    }

    head>tr>th {
        background-color: black;
        color: black;
        padding: 10px;
        border-color: black;
    }

    th,
    td {
        background-color: white;
        padding: 2px;
        border-color: black;

    }

    th {
        background-color: white;
        color: black;
        text-align: center;
        border-color: black;
    }

    body {
        background-color: white;
        font-family: 'arial';
        font-size: 10pt;
        border-color: black;
    }
</style>
<style type="text/css" media="print">
    @page {
        size: 210mm 297mm;
        margin: 20px;
    }
</style>

<body onload="hide_loading();">
    <div class="loading overlay">
        <div class="lds-spinner">
            <div></div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
        </div>
    </div>
    <table width="100%" border="0" align="center">
        <tr text="center">
            <br><br>
            <center>
                <img src="<?= base_url(); ?>assets/rapor/img/users/kemenag.png" alt="IMG" width="200px">
            </center>
            <br><br><br>
        </tr>
        <tr text="center">
            <center>
                <h3><b>LAPORAN HASIL BELAJAR</b></h3>
                <h3><b><?= strtoupper($lembaga['nm_jenjang']); ?></b></h3>
                <h3><b>( <?= $lembaga['sgkt_jenjang']; ?> )</b></h3>
            </center>
        </tr>
        <tr text="center">
            <br><br><br><br>
            <center>
                <img src="<?= base_url('assets/rapor/img/users/') . $lembaga['image_user']; ?>" alt="IMG" width="175px">
            </center>
            <br><br><br><br>
        </tr>
        <tr text="center">
            <center>
                <b>Nama Peserta Didik:</b>
                <div style="border: 1px solid #17202A; height: auto; margin: 10px 0px; padding: 5px; text-align: center; width: 450px;">
                    <?= $students['nm_students'] ?>
                </div>
                <b>NIS/NISM:</b>
                <div style="border: 1px solid #17202A; height: auto; margin: 10px 0px; padding: 5px; text-align: center; width: 450px;">
                    <?= $students['nislokal_students'] ?>
                </div>
                <b>NISN:</b>
                <div style="border: 1px solid #17202A; height: auto; margin: 10px 0px; padding: 5px; text-align: center; width: 450px;">
                    <?= $students['nisn_students'] ?>
                </div>
            </center>
        </tr>
        <tr text="center">
            <center>
                <br><br>
                <h5><b><?= strtoupper($lembaga['nm_jenjang']); ?> <?= strtoupper($lembaga['nm_status']); ?> <?= strtoupper($lembaga['nm_lembaga']); ?></b><br><br>
                    <b>KEMENTERIAN AGAMA REPUBLIK INDONESIA</b>
                </h5>
            </center>
        </tr>
    </table>
    <div style="page-break-before:always;"></div>
    <table width="80%" border="0" align="center">
        <tr text="center">
            <br><br><br>
            <center>
                <h4><b>LAPORAN HASIL BELAJAR</b></h4>
                <h4><b><?= strtoupper($lembaga['nm_jenjang']); ?></b></h4>
                <h4><b>( <?= $lembaga['sgkt_jenjang']; ?> )</b></h4>
            </center>
            <br><br><br>
        </tr>
        <tr text="center">
            <td width='20%'>
                <p>Nama Madrasah</p>
            </td>
            <td width='80%'>
                <p>: <?= $lembaga['sgkt_jenjang'] . $lembaga['sgkt_status'] . ' ' . strtoupper($lembaga['nm_lembaga']); ?></p>
            </td>
        </tr>
        <tr text="center">
            <td width='20%'>
                <p>NSM</p>
            </td>
            <td width='80%'>
                <p>: <?= $lembaga['nsm_lembaga']; ?></p>
            </td>
        </tr>
        <tr text="center">
            <td width='20%'>
                <p>NPSN</p>
            </td>
            <td width='80%'>
                <p>: <?= $lembaga['npsn_lembaga']; ?></p>
            </td>
        </tr>
        <tr text="center">
            <td width='20%'>
                <p>Alamat Madrasah</p>
            </td>
            <td width='80%'>
                <p>: <?= ucwords(strtolower($lembaga['alamat_lembaga'])); ?></p>
            </td>
        </tr>
        <tr text="center">
            <td width='20%'>
                <p>Desa/Kelurahan</p>
            </td>
            <td width='80%'>
                <p>: <?= ucwords(strtolower($lembaga['desa_lembaga'])); ?></p>
            </td>
        </tr>
        <tr text="center">
            <td width='20%'>
                <p>Kecamatan</p>
            </td>
            <td width='80%'>
                <p>: <?= ucwords(strtolower($lembaga['kec_lembaga'])); ?></p>
            </td>
        </tr>
        <tr text="center">
            <td width='20%'>
                <p>Kota/Kabupaten</p>
            </td>
            <td width='80%'>
                <p>: <?= ucwords(strtolower($lembaga['kab_lembaga'])); ?></p>
            </td>
        </tr>
        <tr text="center">
            <td width='20%'>
                <p>Provinsi</p>
            </td>
            <td width='80%'>
                <p>: <?= ucwords(strtolower($lembaga['prov_lembaga'])); ?></p>
            </td>
        </tr>
        <tr text="center">
            <td width='20%'>
                <p>Website</p>
            </td>
            <td width='80%'>
                <p>: <?= $lembaga['website_lembaga']; ?></p>
            </td>
        </tr>
        <tr text="center">
            <td width='20%'>
                <p>Email</p>
            </td>
            <td width='80%'>
                <p>: <?= $lembaga['email_lembaga']; ?></p>
            </td>
        </tr>
    </table>
    <div style="page-break-after:always;"></div>
    <table width="80%" border="0" align="center">
        <tr text="center">
            <br><br>
            <center>
                <h4><b>IDENTITAS PESERTA DIDIK</b></h4>
            </center>
            <br><br>
        </tr>
        <tr text="center">
            <td width='35%'>1. Nama Lengkap</td>
            <td width='65%'>: <?= $students['nm_students']; ?></td>
        </tr>
        <tr text="center">
            <td width='35%'>2. NIS/NISM</td>
            <td width='65%'>: <?= $students['nislokal_students']; ?></td>
        </tr>
        <tr text="center">
            <td width='35%'>3. NISN</td>
            <td width='65%'>: <?= $students['nisn_students']; ?></td>
        </tr>
        <tr text="center">
            <td width='35%'>4. Tempat, Tanggal lahir</td>
            <td width='65%'>: <?= ucwords(strtolower($students['tmptlhr_students'])); ?>, <?= $this->m_walas->tgl_indo(date('d-m-Y', strtotime($students['tgllhr_students']))); ?></td>
        </tr>
        <tr text="center">
            <td width='35%'>5. Jenis Kelamin</td>
            <td width='65%'>: <?= $students['jk_students']; ?></td>
        </tr>
        <tr text="center">
            <td width='35%'>6. Agama</td>
            <td width='65%'>: <?= $students['agama_students']; ?></td>
        </tr>
        <tr text="center">
            <td width='35%'>7. Status dalam keluarga</td>
            <td width='65%'>: <?= $students['sts_students']; ?></td>
        </tr>
        <tr text="center">
            <td width='35%'>8. Anak ke</td>
            <td width='65%'>: <?= $students['anak_ke']; ?></td>
        </tr>
        <tr text="center">
            <td width='35%'>9. Alamat</td>
            <td width='65%'>: <?= $students['alamat']; ?></td>
        </tr>
        <tr text="center">
            <td width='35%'>10. Nomor Telepon Rumah</td>
            <td width='80%'>: <?= $students['telp']; ?></td>
        </tr>
        <tr text="center">
            <?php if ($lembaga['kd_jenjang'] == 2) { ?>
                <td width='35%'>11. Sekolah Asal (TK/RA)</td>
            <?php } elseif ($lembaga['kd_jenjang'] == 3) { ?>
                <td width='35%'>11. Sekolah Asal (SD/MI)</td>
            <?php } elseif (($lembaga['kd_jenjang'] == 4) || ($lembaga['kd_jenjang'] == 5)) { ?>
                <td width='35%'>11. Sekolah Asal (SMP/MTs)</td>
            <?php } ?>
            <td width='80%'>: <?= $students['tmptlhr_students']; ?></td>
        </tr>
        <tr text="center">
            <td width='35%'>12. Diterima di madrasah ini</td>
            <td width='80%'></td>
        </tr>
        <tr text="center">
            <td width='35%' style="text-indent: 0.25in;">a. Di kelas</td>
            <td width='80%'>: <?= $students['diterima_kelas']; ?></td>
        </tr>
        <tr text="center">
            <td width='35%' style="text-indent: 0.25in;">
                <p>b. Pada Tanggal</p>
            </td>
            <td width='80%'>: <?= $this->m_walas->tgl_indo(date('d-m-Y', strtotime($students['tgl_terima']))); ?></td>
        </tr>
        <tr text="center">
            <td width='35%'>13. Orang Tua</td>
            <td width='80%'></td>
        </tr>
        <tr text="center">
            <td width='35%' style="text-indent: 0.25in;">a. Nama Ayah</td>
            <td width='80%'>: <?= strtoupper($students['nm_ayah']); ?></td>
        </tr>
        <tr text="center">
            <td width='35%' style="text-indent: 0.25in;">b. Pekerjaan</td>
            <td width='80%'>: <?= $students['kerja_ayah']; ?></td>
        </tr>
        <tr text="center">
            <td width='35%' style="text-indent: 0.25in;">c. Nomor Telephone/HP</td>
            <td width='80%'>: <?= $students['telp_ayah']; ?></td>
        </tr>
        <tr text="center">
            <td width='35%' style="text-indent: 0.25in;">
                <p>d. Alamat</p>
            </td>
            <td width='80%'>: <?= ucwords(strtolower($students['alamat_ayah'])); ?></td>
        </tr>
        <tr text="center">
            <td width='35%' style="text-indent: 0.25in;">e. Nama Ibu</td>
            <td width='80%'>: <?= strtoupper($students['nm_ibu']); ?></td>
        </tr>
        <tr text="center">
            <td width='35%' style="text-indent: 0.25in;">f. Pekerjaan</td>
            <td width='80%'>: <?= $students['kerja_ibu']; ?></td>
        </tr>
        <tr text="center">
            <td width='35%' style="text-indent: 0.25in;">g. Nomor Telephone/HP</td>
            <td width='80%'>: <?= $students['telp_ibu']; ?></td>
        </tr>
        <tr text="center">
            <td width='35%' style="text-indent: 0.25in;">
                <p>h. Alamat</p>
            </td>
            <td width='80%'>: <?= ucwords(strtolower($students['alamat_ibu'])); ?></td>
        </tr>
        <tr text="center">
            <td width='35%'>14. Wali</td>
            <td width='80%'></td>
        </tr>
        <tr text="center">
            <td width='35%' style="text-indent: 0.25in;">a. Nama Wali</td>
            <td width='80%'>: <?= strtoupper($students['nm_wali']); ?></td>
        </tr>
        <tr text="center">
            <td width='35%' style="text-indent: 0.25in;">b. Pekerjaan</td>
            <td width='80%'>: <?= $students['kerja_wali']; ?></td>
        </tr>
        <tr text="center">
            <td width='35%' style="text-indent: 0.25in;">c. Nomor Telephone/HP</td>
            <td width='80%'>: <?= $students['telp_wali']; ?></td>
        </tr>
        <tr text="center">
            <td width='35%' style="text-indent: 0.25in;">
                <p>d. Alamat</p>
            </td>
            <td width='80%'>: <?= ucwords(strtolower($students['alamat_wali'])); ?></td>
        </tr>
    </table>
    <br>
    <table width="100%" border="0" align="center">
        <tr>
            <td width='30%'></td>
            <td width='30%'></td>
            <td width='40%'><?= ucwords(strtolower($lembaga['kab_lembaga'])); ?>, <?= $this->m_walas->tgl_indo(date('d-m-Y', strtotime($students['tgl_terima']))); ?></td>
        </tr>
        <tr>
            <td width='30%'></td>
            <td width='30%' rowspan="3" align="center"><img src="<?= base_url('assets/rapor/img/users/') . $user['image_user']; ?>" alt="IMG" width="100px"></td>
            <td width='40%'>Kepala Madrasah,</td>
        </tr>
        <tr>
            <td width='30%'></td>
            <td width='40%'><br><br><br><br><u><?= $students['gelar_depan'] . ' ' . $students['nm_teachers']; ?><?php if (!empty($students['gelar_belakang'])) {
                                                                                                                    echo ', ' . $students['gelar_belakang'];
                                                                                                                } else {
                                                                                                                    echo $students['gelar_belakang'];
                                                                                                                } ?></u></td>
        </tr>
        <tr>
            <td width='30%'></td>
            <td width='40%'>NIP. <?= $students['nip_teachers']; ?></td>
        </tr>
    </table>
</body>
<script>
    let fadeTarget = document.querySelector(".loading")

    function show_loading() {
        fadeTarget.style.display = "block";
        fadeTarget.style.opacity = 1;
    }

    function hide_loading() {
        let fadeEffect = setInterval(() => {
            if (!fadeTarget.style.opacity) {
                fadeTarget.style.opacity = 1;
            }
            if (fadeTarget.style.opacity > 0) {
                fadeTarget.style.opacity -= 0.1;
            } else {
                clearInterval(fadeEffect)
                fadeTarget.style.display = "none"
            }
        }, 100)
    }
</script>

</html>