<!-- // 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: 'Century Gothic';
        font-size: 8pt;
        border-color: black;
    }
</style>
<style type="text/css" media="print">
    /* @page {
        size: landscape;
    } */

    @page {
        size: 297mm 210mm;
        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="95%" border="0" align="center">
        <tr text="center">
            <br>
            <center>
                <b>DAFTAR NAMA ALUMNI</b>
            </center>
            <br><br>
        </tr>
        <tr text="center">
            <td width="12%">Nama Lembaga</td>
            <td width="50%"> : <?= $nmJenjang['sgkt_jenjang'] . ' ' . $nmStatus['nm_status'] . ' ' . $nmLembaga['nm_lembaga']; ?></td>
            <td>NSM/NPSN</td>
            <td> : <?= $nmLembaga['nsm_lembaga'] . ' / ' . $nmLembaga['npsn_lembaga']; ?></td>
        </tr>
        <tr text="center">
            <td>Kabupaten/Kota</td>
            <td> : <?= ucwords(strtolower($nmLembaga['kab_lembaga'])); ?></td>
            <td>Tahun Pelajaran</td>
            <td> : <?php if ($waktu['semester'] == 'Ganjil') {
                        echo $waktu['tahun'] . ' / ' . ($waktu['tahun'] + 1);
                    } elseif ($waktu['semester'] == 'Genap') {
                        echo ($waktu['tahun'] - 1) . ' / ' . $waktu['tahun'];
                    }; ?></td>
        </tr>
    </table>
    <br>

    <table width="95%" align="center" border="1">
        <thead>
            <tr text="center">
                <th style="padding: 10px 5px;">No</th>
                <th>NISN</th>
                <th>Nama Siswa</th>
                <th>Nomor Ijazah</th>
                <th>Melanjutkan ke</th>
                <th>Facebook</th>
                <th>Instagram</th>
                <th>Email</th>
                <th>Youtube</th>
                <th>No. Telp</th>
            </tr>
        </thead>
        <tbody>
            <?php
            $i = 1;
            foreach ($alumni as $al) :
            ?>
                <tr align="center">
                    <td><?php
                        echo $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"><?= $al['lanjut_ke']; ?></td>
                    <td align="left"><?= $al['facebook']; ?></td>
                    <td align="left"><?= $al['instagram']; ?></td>
                    <td align="left"><?= $al['email']; ?></td>
                    <td align="left"><?= $al['youtube']; ?></td>
                    <td align="left"><?= $al['telp']; ?></td>
                </tr>
            <?php endforeach; ?>
        </tbody>
    </table>

    <br>
    <table width="95%" border="0" align="center">
        <tr>
            <td width='40%'></td>
            <td width='30%'></td>
            <td width='30%'><?= ucwords(strtolower($lembaga['kab_lembaga'])); ?>, <?= $this->m_walas->tgl_indo(date('d-m-Y', strtotime($waktu['tanggal3']))); ?></td>
        </tr>
        <tr>
            <td width='40%'></td>
            <td width='30%' rowspan="3" align="center"></td>
            <td width='30%'>Kepala Madrasah,</td>
        </tr>
        <tr>
            <td width='30%'></td>

            <td width='30%'><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='30%'>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() {
        // fadeTarget.style.display = "none";
        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>