<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>Rekap Skor Murid</title>

    <style>
        body {
            font-family: Arial, Helvetica, sans-serif;
            font-size: 12px;
        }

        h2,
        h3,
        p {
            margin: 0;
            padding: 0;
        }

        .judul {
            text-align: center;
            margin-bottom: 20px;
        }

        .judul h2 {
            font-size: 18px;
            text-transform: uppercase;
        }

        .judul h3 {
            font-size: 15px;
            margin-top: 3px;
        }

        .info {
            width: 100%;
            margin-bottom: 15px;
        }

        .info td {
            padding: 3px;
            vertical-align: top;
        }

        table.tabel {
            width: 100%;
            border-collapse: collapse;
            margin-top: 10px;
        }

        table.tabel th,
        table.tabel td {
            border: 1px solid #000;
            padding: 6px;
        }

        table.tabel th {
            background: #e9e9e9;
            text-align: center;
        }

        .center {
            text-align: center;
        }

        .right {
            text-align: right;
        }

        .ttd {
            width: 100%;
            margin-top: 45px;
        }

        .ttd td {
            text-align: center;
            width: 50%;
        }

        .nama {
            margin-top: 70px;
            font-weight: bold;
            text-decoration: underline;
        }
    </style>

</head>

<body>

    <div class="judul">
        <h2>REKAP SKOR MURID</h2>
        <h3>KELAS <?= strtoupper($kelas['nama_kelas']); ?></h3>
    </div>

    <table class="info">
        <tr>
            <td width="20%">Kelas</td>
            <td width="2%">:</td>
            <td><?= $kelas['nama_kelas']; ?></td>

            <td width="22%">Tanggal Cetak</td>
            <td width="2%">:</td>
            <td><?= date('d F Y'); ?></td>
        </tr>

        <tr>
            <td>Wali Kelas</td>
            <td>:</td>
            <td><?= $walikelas['nama'] ?? '-' ?></td>

            <td>Jam Cetak</td>
            <td>:</td>
            <td><?= date('H:i:s'); ?></td>
        </tr>

        <tr>

            <td></td>
            <td></td>
            <td></td>
        </tr>
    </table>


    <table class="tabel">

        <thead>
            <tr>
                <th width="6%">No</th>
                <th width="18%">NIS</th>
                <th>Nama Murid</th>
                <th width="15%">Skor Pelanggaran</th>
                <th width="15%">Skor Prestasi</th>
            </tr>
        </thead>

        <tbody>

            <?php $no = 1; ?>

            <?php foreach ($siswa as $s): ?>

                <tr>
                    <td class="center"><?= $no++; ?></td>
                    <td class="center"><?= $s['nis']; ?></td>
                    <td><?= $s['nama']; ?></td>
                    <td class="center"><?= $s['skor']; ?></td>
                    <td class="center"><?= $s['poin_penghargaan']; ?></td>
                </tr>

            <?php endforeach; ?>

        </tbody>

    </table>


    <table class="ttd" width="100%">
        <tr>

            <td style="padding-top:40px;">
                Guru BK
                <div class="nama">
                    <?= $gurubk['nama'] ?? '(...................................)'; ?>
                </div>
            </td>

            <td style="padding-top:40px;">
                Bandung, <?= $tanggal; ?><br>
                Wali Kelas
                <div class="nama">
                    <?= $gurubk['nama'] ?? '(...................................)'; ?>
                </div>
            </td>

        </tr>
        <tr></tr>
        <tr></tr>
        <tr>

            <td>
                Mengetahui,<br>
                Plt. Kepala SMP Negeri 5 Bandung
                <div class="nama">
                    Trismawati, S.S., M.Pd.
                </div>
            </td>

            <td>

                Wakasek Kesiswaan
                <div class="nama">
                    <?= $kesiswaan['nama'] ?? '(...................................)'; ?>
                </div>
            </td>

        </tr>



    </table>
</body>

</html>