<!-- // 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>
            <center>
                <img src="<?= base_url('assets/rapor/img/users/') . $lembaga['kop_lembaga']; ?>" alt="IMG" width="700px">
            </center>
            <br>
        </tr>
        <tr text="center">
            <center>
                <h5><b>DAFTAR ALUMNI</b></h5>
                <h5><b>TAHUN PELAJARAN <?php if ($kdTapel['kd_smstr'] == 'Ganjil') {
                                            echo $kdTapel['kd_tahun'] . ' / ' . ($kdTapel['kd_tahun'] + 1);
                                        } elseif ($kdTapel['kd_smstr'] == 'Genap') {
                                            echo ($kdTapel['kd_tahun'] - 1) . ' / ' . $kdTapel['kd_tahun'];
                                        }; ?></b></h5>
            </center>
        </tr>
    </table><br><br>
    <table width="90%" border="1" align="center">
        <tr text="center">
            <th style="padding: 10px 5px;">No</th>
            <th>NISN</th>
            <th>Nama Siswa</th>
            <th>Nomor Ijazah</th>
            <th>Tgl Pengambilan Ijazah</th>
            <th>Tanda Tangan</th>
        </tr>
        <?php
        $i = 1;
        $a = 1;
        foreach ($alumni as $al) :
        ?>
            <tr text="center" align="center">
                <td style="padding: 10px 5px;"><?= $i . '.';
                                                $i++; ?></td>
                <td><?= $al['nisn_students']; ?></td>
                <td align="left"><?= $al['nm_students']; ?></td>
                <td align="left"><?= $al['no_ijazah']; ?></td>
                <td align="left"><?php
                                    if (!($al['tgl_terima_ijazah'] == '')) {
                                        echo $this->m_walas->tgl_indo(date('d-m-Y', strtotime($al['tgl_terima_ijazah'])));
                                    }
                                    ?></td>
                <td align="left" style="font-size: 8pt;">
                    <?= $a . '.';
                    $a++; ?>
                </td>
            </tr>
        <?php endforeach; ?>
    </table><br><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($waktu['tanggal3']))); ?></td>
        </tr>
        <tr>
            <td width='30%'></td>
            <td width='30%' rowspan="3" align="center"></td>
            <td width='40%'>Kepala Madrasah,</td>
        </tr>
        <tr>
            <td width='30%'></td>

            <td width='40%'><br><br><br><br><u><?= $waktu['gelardepan'] . ' ' . $waktu['kamad']; ?><?php if (!empty($waktu['gelarbelakang'])) {
                                                                                                        echo ', ' . $waktu['gelarbelakang'];
                                                                                                    } else {
                                                                                                        echo $waktu['gelarbelakang'];
                                                                                                    } ?></u></td>
        </tr>
        <tr>
            <td width='30%'></td>

            <td width='40%'>NIP. <?= $waktu['nip_kamad']; ?></td>
        </tr>
    </table>
    <div style="page-break-before:always;"></div>

</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>