<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Rekap Presensi - <?php echo e($siswa->nama_siswa); ?></title>
    <style>
        body { font-family: Arial, sans-serif; font-size: 12px; margin: 20px; }
        .header { text-align: center; margin-bottom: 30px; border-bottom: 2px solid #333; padding-bottom: 10px; }
        .info-table { width: 100%; margin-bottom: 20px; }
        .info-table td { padding: 5px; vertical-align: top; }
        .attendance-table { width: 100%; border-collapse: collapse; margin-top: 20px; }
        .attendance-table th, .attendance-table td { border: 1px solid #333; padding: 8px; text-align: center; }
        .attendance-table th { background-color: #f5f5f5; font-weight: bold; }
        .stats { margin: 20px 0; display: flex; justify-content: space-around; }
        .stat-box { text-align: center; padding: 10px; border: 1px solid #333; width: 30%; }
        .badge-hadir { background-color: #28a745; color: white; padding: 2px 6px; border-radius: 3px; }
        .badge-izin { background-color: #ffc107; color: black; padding: 2px 6px; border-radius: 3px; }
        .badge-alfa { background-color: #dc3545; color: white; padding: 2px 6px; border-radius: 3px; }
    </style>
</head>
<body>
    <div class="header">
        <h2>REKAP PRESENSI SISWA MAGANG</h2>
        
    </div>

    <table class="info-table">
        <tr>
            <td width="20%"><strong>Nama Siswa</strong></td>
            <td width="2%">:</td>
            <td width="28%"><?php echo e($siswa->nama_siswa); ?></td>
            <td width="20%"><strong>Jenis Kelamin</strong></td>
            <td width="2%">:</td>
            <td width="28%"><?php echo e($siswa->jenis_kelamin); ?></td>
        </tr>
        <tr>
            <td><strong>Sekolah</strong></td>
            <td>:</td>
            <td><?php echo e($siswa->sekolah->nama_sekolah); ?></td>
            <td><strong>No. Telp</strong></td>
            <td>:</td>
            <td><?php echo e($siswa->no_telp_siswa); ?></td>
        </tr>
        <tr>
            <td><strong>Periode Magang</strong></td>
            <td>:</td>
            <td><?php echo e($siswa->mulai_magang->format('d/m/Y')); ?> s/d <?php echo e($siswa->selesai_magang->format('d/m/Y')); ?></td>
            <td><strong>Username</strong></td>
            <td>:</td>
            <td><?php echo e($siswa->user->username); ?></td>
            <td><strong>Username</strong></td>
            <td>:</td>
            <td><?php echo e($siswa->rfid_number); ?></td>
        </tr>
    </table>

    <div style="display: table; width: 100%; margin: 20px 0;">
        <div style="display: table-cell; width: 33%; text-align: center; border: 1px solid #333; padding: 10px;">
            <strong>HADIR</strong><br>
            <span style="font-size: 18px; color: #28a745;"><?php echo e($stats['hadir']); ?> Hari</span>
        </div>
        <div style="display: table-cell; width: 33%; text-align: center; border: 1px solid #333; padding: 10px;">
            <strong>IZIN</strong><br>
            <span style="font-size: 18px; color: #ffc107;"><?php echo e($stats['izin']); ?> Hari</span>
        </div>
        <div style="display: table-cell; width: 34%; text-align: center; border: 1px solid #333; padding: 10px;">
            <strong>ALFA</strong><br>
            <span style="font-size: 18px; color: #dc3545;"><?php echo e($stats['alfa']); ?> Hari</span>
        </div>
    </div>

    <table class="attendance-table">
        <thead>
            <tr>
                <th width="5%">No</th>
                <th width="15%">Tanggal</th>
                <th width="15%">Status</th>
                <th width="15%">Jam Masuk</th>
                <th width="15%">Jam Pulang</th>
                <th width="35%">Keterangan</th>
            </tr>
        </thead>
        <tbody>
            <?php $__empty_1 = true; $__currentLoopData = $attendance; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $i => $att): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
            <tr>
                <td><?php echo e($i + 1); ?></td>
                <td><?php echo e($att->date->format('d/m/Y')); ?></td>
                <td>
                    <span class="badge-<?php echo e($att->status); ?>"><?php echo e(ucfirst($att->status)); ?></span>
                </td>
                <td><?php echo e($att->check_in_time ? $att->check_in_time->format('H:i') : '–'); ?></td>
                <td><?php echo e($att->check_out_time ? $att->check_out_time->format('H:i') : '–'); ?></td>
                <td><?php echo e($att->notes ?: '–'); ?></td>
            </tr>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
            <tr>
                <td colspan="6" style="text-align: center; color: #666;">Belum ada data presensi</td>
            </tr>
            <?php endif; ?>
        </tbody>
    </table>

    <?php
    $bulan = [
        1 => 'Januari', 2 => 'Februari', 3 => 'Maret', 4 => 'April',
        5 => 'Mei', 6 => 'Juni', 7 => 'Juli', 8 => 'Agustus',
        9 => 'September', 10 => 'Oktober', 11 => 'November', 12 => 'Desember'
    ];
    $tanggal = now()->format('d') . ' ' . $bulan[now()->format('n')] . ' ' . now()->format('Y');
    ?>

    <div style="margin-top: 40px; text-align: right;">
        <p>Banjarmasin, <?php echo e($tanggal); ?></p>
        <br><br><br>
        <p>____________________<br>
        Pembimbing Magang</p>
    </div>
</body>
</html><?php /**PATH C:\laragon\www\presensi-magang\resources\views/admin/siswa/pdf.blade.php ENDPATH**/ ?>