<!doctype html>
<html lang="id">
<head>
    <meta charset="utf-8" />
    <title>Laporan Kehadiran (Kepsek)</title>
    <style>
        body {
            font-family:
                DejaVu Sans,
                sans-serif;
            font-size: 10px;
            color: #333;
        }

        /* Container Kop Surat */
        .header-container {
            width: 100%;
            margin-bottom: 20px;
            border-bottom: 3px double #000; /* Garis khas kop surat */
            padding-bottom: 10px;
        }
        .logo-container {
            float: left;
            width: 110px;
        }
        .logo-container img {
            width: 100%;
            height: auto;
        }
        .header-text {
            text-align: center;
            margin-right: 70px; /* Menyeimbangkan posisi karena float logo */
        }
        .header-text h2 {
            margin: 0;
            font-size: 14px;
            text-transform: uppercase;
        }
        .header-text h1 {
            margin: 0;
            font-size: 18px;
            text-transform: uppercase;
        }
        .header-text p {
            margin: 2px 0;
            font-size: 10px;
        }

        /* Clearfix */
        .header-container::after {
            content: "";
            clear: both;
            display: table;
        }

        h3 {
            margin: 14px 0 6px 0;
            font-size: 12px;
            border-left: 3px solid #2563eb;
            padding-left: 8px;
        }

        table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 8px;
        }
        th,
        td {
            border: 1px solid #ddd;
            padding: 6px;
        }
        th {
            background: #f3f4f6;
            text-align: left;
            font-weight: bold;
        }

        /* Stats Cards */
        .cards {
            width: 100%;
            margin-top: 10px;
            border: none;
        }
        .cards td {
            border: 0;
            padding: 0;
        }
        .card {
            border: 1px solid #e5e7eb;
            padding: 10px;
            border-radius: 8px;
            background: #f9fafb;
        }
        .card-title {
            font-size: 10px;
            color: #6b7280;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }
        .card-value {
            font-size: 16px;
            font-weight: 700;
            color: #111827;
        }
    </style>
</head>
<body>
    <div class="header-container">
        <div class="logo-container">
            <?php
                // Mengambil logo SMKN 2 Rupat
                $path = public_path('images/logo-smkn-2-rupat.png'); 
                $base64 = '';
                if (file_exists($path)) {
                    $type = pathinfo($path, PATHINFO_EXTENSION);
                    $data = file_get_contents($path);
                    $base64 = 'data:image/' . $type . ';base64,' . base64_encode($data);
                }
            ?>
            <?php if($base64): ?>
                <img src="<?php echo e($base64); ?>" alt="Logo" />
            <?php endif; ?>
        </div>
        <div class="header-text">
            <h2>PEMERINTAH PROVINSI RIAU</h2>
            <p>DINAS PENDIDIKAN</p>
            <h1>SMK NEGERI 2 RUPAT</h1>
            <p>Jl. Pangkalan Pinang, Kec. Rupat, Kab. Bengkalis, Riau</p>
            <p><strong>LAPORAN KEHADIRAN SISWA (GLOBAL)</strong></p>
            <p>Periode: <?php echo e(str_pad((string)$bulan, 2, '0', STR_PAD_LEFT)); ?> / <?php echo e($tahun); ?></p>
        </div>
    </div>

    <table class="cards">
        <tr>
            <td style="width: 25%; padding-right: 8px">
                <div class="card">
                    <div class="card-title">Total Hadir</div>
                    <div class="card-value"><?php echo e($summary['H']); ?></div>
                </div>
            </td>
            <td style="width: 25%; padding: 0 4px">
                <div class="card">
                    <div class="card-title">Total Sakit</div>
                    <div class="card-value" style="color: #ca8a04">
                        <?php echo e($summary['S']); ?>

                    </div>
                </div>
            </td>
            <td style="width: 25%; padding: 0 4px">
                <div class="card">
                    <div class="card-title">Total Izin</div>
                    <div class="card-value" style="color: #2563eb">
                        <?php echo e($summary['I']); ?>

                    </div>
                </div>
            </td>
            <td style="width: 25%; padding-left: 8px">
                <div class="card">
                    <div class="card-title">Total Alfa</div>
                    <div class="card-value" style="color: #dc2626">
                        <?php echo e($summary['A']); ?>

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

    <h3>Rekap per Jurusan</h3>
    <table>
        <thead>
            <tr>
                <th>Jurusan</th>
                <th>Hadir</th>
                <th>Sakit</th>
                <th>Izin</th>
                <th>Alfa</th>
            </tr>
        </thead>
        <tbody>
            <?php $__currentLoopData = $perJurusan; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $r): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <tr>
                    <td style="font-weight: 500"><?php echo e($r->jurusan); ?></td>
                    <td><?php echo e($r->hadir); ?></td>
                    <td><?php echo e($r->sakit); ?></td>
                    <td><?php echo e($r->izin); ?></td>
                    <td><?php echo e($r->alfa); ?></td>
                </tr>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </tbody>
    </table>

    <h3>Rekap per Kelas</h3>
    <table>
        <thead>
            <tr>
                <th>Jurusan</th>
                <th>Kelas</th>
                <th>Hadir</th>
                <th>Sakit</th>
                <th>Izin</th>
                <th>Alfa</th>
            </tr>
        </thead>
        <tbody>
            <?php $__currentLoopData = $perKelas; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $r): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <tr>
                    <td><?php echo e($r->jurusan); ?></td>
                    <td><?php echo e($r->nama_kelas); ?></td>
                    <td><?php echo e($r->hadir); ?></td>
                    <td><?php echo e($r->sakit); ?></td>
                    <td><?php echo e($r->izin); ?></td>
                    <td><?php echo e($r->alfa); ?></td>
                </tr>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </tbody>
    </table>

    <div style="margin-top: 30px; text-align: right; font-size: 10px">
        <p>Dicetak pada: <?php echo e(\Carbon\Carbon::now()->translatedFormat('d F Y H:i')); ?></p>
    </div>
</body>
</html>
<?php /**PATH C:\laragon\www\sistem-absensi-smkn-2-rupat\resources\views/kepsek/laporan/pdf.blade.php ENDPATH**/ ?>