<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, shrink-to-fit=no">
    <title>Rapor - <?= $siswa->nama ?> </title>
    <link rel="icon" type="image/x-icon" href="../src/assets/img/favicon.ico" />

    <!-- BEGIN GLOBAL MANDATORY STYLES -->
    <link href="https://fonts.googleapis.com/css?family=Nunito:400,600,700" rel="stylesheet">
    <link href="<?= base_url() ?>src/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />

    <!-- END PAGE LEVEL PLUGINS/CUSTOM STYLES -->
    <style>
        table {
            font-size: 12px;
            width: 100%;
        }

        th {
            text-align: center;

        }

        hr {
            border: 0;
            /* Hapus border default */
            height: 1px;
            /* Set tinggi garis */
            background-color: #ccc;
            /* Warna latar belakang garis */
            /* Atur jarak atas dan bawah dari hr */
        }

        .table-bordered {
            width: 100%;
            border-collapse: collapse;
            margin-bottom: 20px;
        }

        .table-bordered th,
        .table-bordered td {
            border: 1px solid #dddddd;
            padding: 8px;
        }
    </style>
</head>

<body>



    <!--  BEGIN MAIN CONTAINER  -->
    <div class="main-container " id="container">

        <div class="overlay"></div>
        <div class="search-overlay"></div>

        <!--  BEGIN CONTENT AREA  -->
        <div id="content" class="main-content ms-0 mt-0">
            <div class="layout-px-spacing">

                <div class="middle-content">

                    <!-- CONTENT AREA -->
                    <div class="row layout-top-spacing">

                        <div class="col-12">
                            <table class="table no-padding-table table-borderless">
                                <tbody>
                                    <tr>
                                        <td style="width: 150px;">Nama</td>
                                        <td>: <?= $siswa->nama ?></td>
                                        <td style="width: 200px;"></td>
                                        <td style="width: 100px;">Kelas</td>
                                        <td>: <?= $siswa->nama_rombel ?></td>
                                    </tr>
                                    <tr>
                                        <td scope="row">NISN/NIS</td>
                                        <td>: <?= $siswa->nisn ?>/<?= $siswa->nis ?></td>
                                        <td></td>
                                        <td>Fase</td>
                                        <td>: <?= getGrade($siswa->tingkat) ?></td>
                                    </tr>
                                    <tr>
                                        <td scope="row">NAMA SEKOLAH</td>
                                        <td>: <?= $settings->nama_sekolah ?> </td>
                                        <td></td>
                                        <td>Semester</td>
                                        <td>: <?= getGradeAndSemesterCode($siswa->tingkat, $settings->semester) ?></td>
                                    </tr>
                                    <tr>
                                        <td scope="row">ALAMAT</td>
                                        <td>: <?= $settings->alamat_sekolah ?></td>
                                        <td></td>
                                        <td>Tahun Pelajaran</td>
                                        <td>: <?= $settings->nama_tahunpelajaran ?></td>
                                    </tr>
                                </tbody>
                            </table>
                            <hr />
                            <center>
                                <h4><strong>LAPORAN HASIL BELAJAR</strong></h4>
                            </center>
                            <table class="table table-bordered">
                                <thead>
                                    <tr>
                                        <th style="width:20px">No</th>
                                        <th style="width:200px">Mata Pelajaran</th>
                                        <th style="width:20px">Nilai</th>
                                        <th>Capaian Kompetensi</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php
                                    $no = 1;
                                    foreach ($penilaian as $penilaian) { ?>

                                        <tr>
                                            <td style="text-align:center"><?= $no++ ?></td>
                                            <td><?= $penilaian->nama_matapelajaran ?></td>
                                            <td style="text-align:center"><?= $penilaian->nilai_akhir ?></td>
                                            <td class="deskripsi">
                                                <?= ($penilaian->deskripsi_tercapai != "" ? $penilaian->deskripsi_tercapai . '<br>' : '') ?>
                                                <?= $penilaian->deskripsi_belum ?>
                                            </td>
                                        </tr>
                                    <?php } ?>
                                </tbody>
                            </table>

                            <table class=" table table-bordered">
                                <thead>
                                    <tr>
                                        <th style="width:20px">No</th>
                                        <th>Kegiatan Ekstrakulikuler</th>
                                        <th>Predikat</th>
                                        <th>Deskripsi</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php
                                    $no = 1;
                                    if (!empty($eskul)) { ?>
                                        <?php foreach ($eskul as $item) { ?>
                                            <tr>
                                                <td><?= $no++ ?></td>
                                                <td><?= $item->nama_ekstrakulikuler ?></td>
                                                <td><?= $item->predikat ?></td>
                                                <td><?= $item->deskripsi ?></td>
                                            </tr>
                                        <?php } ?>
                                    <?php } else { ?>
                                        <tr>
                                            <td colspan="4">Tidak mengikuti kegiatan ekstrakulikuler</td>
                                        </tr>
                                    <?php } ?>

                                </tbody>
                            </table>
                            <table class="table table-bordered" style="width: 50%;">
                                <thead>
                                    <tr>
                                        <th colspan="2">Ketidakhadiran</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <tr>
                                        <td style="width: 200px;">Sakit</td>
                                        <td>: <?= $absensi->sakit ?> hari</td>

                                    </tr>
                                    <tr>
                                        <td>Ijin</td>
                                        <td>: <?= $absensi->ijin ?> hari</td>

                                    </tr>
                                    <tr>
                                        <td>Tanpa Keterangan</td>
                                        <td>: <?= $absensi->alfa ?> hari</td>

                                    </tr>
                                </tbody>
                            </table>

                            <table class="table table-bordered">
                                <tbody>
                                    <tr>
                                        <td>
                                            Catatan Walikelas
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="height: 100%;height:30px">
                                            <?= $absensi->catatan ?>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                            <table class="table">

                                <tbody>
                                    <tr>
                                        <td style="width: 200px;">
                                            <br>
                                            Orang Tua Wali
                                            <br><br><br><br><br>
                                            _____________________
                                        </td>
                                        <td></td>
                                        <td style="width: 200px;">
                                            <?= ucwords(strtolower($settings->kota)) ?>, <?= konversiTanggal($tahun->tanggal_rapor) ?> <br>
                                            Wali Kelas
                                            <br><br><br><br><br>
                                            <?= $siswa->walikelas ?>
                                        </td>

                                    </tr>
                                    <tr>
                                        <td style="text-align: center;" colspan="3">
                                            Mengetahui <br>
                                            Kepala Sekolah<br>
                                            <br><br><br><br><br>
                                            <b><?= $settings->nama_kepsek ?><br>
                                                NIP. <?= $settings->nip_kepsek ?></b>
                                        </td>
                                    </tr>

                                </tbody>
                            </table>
                        </div>
                    </div>
                    <!-- CONTENT AREA -->

                </div>

            </div>
        </div>
        <!--  END CONTENT AREA  -->
    </div>
    <!-- END MAIN CONTAINER -->

    <!-- BEGIN GLOBAL MANDATORY SCRIPTS -->
    <script src="<?= base_url() ?>src/bootstrap/js/bootstrap.bundle.min.js"></script>
    <script src="<?= base_url() ?>src/plugins/src/perfect-scrollbar/perfect-scrollbar.min.js"></script>
    <script src="<?= base_url() ?>src/plugins/src/mousetrap/mousetrap.min.js"></script>

</body>

</html>