<!DOCTYPE html>
<html lang="id">
<head>
    <meta charset="UTF-8">
    <title>Rekap Laporan Admin LLDIKTI</title>
    <style>
        @page {
            margin: 40px 50px;
        }
        body {
            font-family: 'Times New Roman', Times, serif;
            font-size: 11pt;
            line-height: 1.3;
            color: #000;
        }
        .header-table {
            width: 100%;
            border-bottom: 4px solid #000;
            padding-bottom: 5px;
            margin-bottom: 20px;
        }
        .logo-cell {
            width: 180px;
            text-align: center;
            vertical-align: middle;
        }
        .text-cell {
            text-align: center;
            vertical-align: middle;
        }
        .text-cell h2 {
            margin: 0;
            font-size: 14pt;
            font-weight: normal;
        }
        .text-cell h1 {
            margin: 0;
            font-size: 16pt;
            font-weight: bold;
        }
        .text-cell p {
            margin: 0;
            font-size: 11pt;
        }
        .signature-box {
            width: 300px;
            float: right;
            text-align: left;
            margin-top: 30px;
        }
        .signature-box p {
            margin: 0;
            line-height: 1.2;
        }
        .signature-space {
            text-align: left;
            padding-left: 30px;
            margin: 10px 0;
        }
        .clear {
            clear: both;
        }
        .section-title {
            font-size: 12pt;
            font-weight: bold;
            margin-top: 20px;
            margin-bottom: 10px;
            border-bottom: 1px solid #ccc;
            padding-bottom: 5px;
        }
        table {
            width: 100%;
            border-collapse: collapse;
            margin-bottom: 20px;
        }
        th, td {
            border: 1px solid #000;
            padding: 5px;
            text-align: left;
            vertical-align: top;
            font-size: 10pt;
        }
        th {
            background-color: #f2f2f2;
            text-align: center;
        }
        .text-center { text-align: center; }
        

        .summary-box {
            border: 1px solid #000;
            padding: 10px;
            margin-bottom: 20px;
            background-color: #f9f9f9;
        }
    </style>
</head>
<body>

    <table class="header-table">
        <tr>
            <td class="logo-cell">
                <?php
                    $logoPath = public_path('images/logo-dikti-outline.png');
                    if(!file_exists($logoPath)) $logoPath = public_path('images/logo-lldikti3-bw.png');
                    $logoBase64 = file_exists($logoPath) ? base64_encode(file_get_contents($logoPath)) : '';
                ?>
                <?php if($logoBase64): ?>
                    <img src="data:image/png;base64,<?php echo e($logoBase64); ?>" alt="Logo" style="width: 160px; height: auto;">
                <?php else: ?>
                    <div style="width: 150px; height: 150px; border: 1px solid #000; text-align: center; line-height: 150px; font-size: 10pt; font-weight: bold;">[LOGO]</div>
                <?php endif; ?>
            </td>
            <td class="text-cell" style="padding-left: 10px;">
                <h2>KEMENTERIAN PENDIDIKAN TINGGI,<br>SAINS, DAN TEKNOLOGI</h2>
                <h1>LEMBAGA LAYANAN PENDIDIKAN TINGGI<br>WILAYAH III</h1>
                <p>Jalan. SMA Negeri 14 Cawang Jakarta Timur 13630<br>
                Telepon (021) 8090275<br>
                Laman: lldikti3.kemdikbud.go.id</p>
            </td>
        </tr>
    </table>
    
    <div style="text-align: center; font-weight: bold; font-size: 14pt; margin-bottom: 20px; margin-top: 10px;">
        REKAPITULASI LAPORAN KASUS KITA
    </div>

    <div class="summary-box">
        <strong>Ringkasan:</strong><br>
        - Total Laporan Masuk: <?php echo e($laporansMasuk->count()); ?><br>
        - Total Kasus Selesai: <?php echo e($kasusDiproses->count()); ?>

    </div>

    <div class="section-title">A. DAFTAR SELURUH LAPORAN MASUK (Berdasarkan Tanggal)</div>
    <table>
        <thead>
            <tr>
                <th style="width: 5%;">No</th>
                <th style="width: 15%;">Tanggal</th>
                <th style="width: 30%;">Judul Laporan</th>
                <th style="width: 20%;">Perguruan Tinggi (PTS)</th>
                <th style="width: 15%;">Kategori</th>
                <th style="width: 15%;">Status</th>
            </tr>
        </thead>
        <tbody>
            <?php $__currentLoopData = $laporansMasuk; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $lap): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <tr>
                <td class="text-center"><?php echo e($index + 1); ?></td>
                <td class="text-center"><?php echo e($lap->created_at->format('d/m/Y H:i')); ?></td>
                <td><?php echo e($lap->judul); ?></td>
                <td><?php echo e($lap->pts_nama); ?></td>
                <td>
                    <?php if($lap->tipe_laporan == 'preventif_konseling'): ?> Preventif
                    <?php elseif($lap->tipe_laporan == 'kekerasan_bullying'): ?> Bullying
                    <?php elseif($lap->tipe_laporan == 'integritas_akademik'): ?> Integritas Akademik
                    <?php endif; ?>
                </td>
                <td class="text-center">
                    <?php if($lap->status == 'selesai'): ?> Selesai
                    <?php elseif($lap->status == 'ditolak'): ?> Ditolak
                    <?php else: ?> Diproses
                    <?php endif; ?>
                </td>
            </tr>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            <?php if($laporansMasuk->isEmpty()): ?>
            <tr>
                <td colspan="6" class="text-center">Belum ada laporan masuk.</td>
            </tr>
            <?php endif; ?>
        </tbody>
    </table>

    <div class="section-title">B. DAFTAR KASUS SELESAI (Berdasarkan Kategori)</div>
    
    <div style="margin-bottom: 10px; font-size: 10pt;">
        <strong>Rekap per Kategori:</strong>
        <ul>
            <?php $__currentLoopData = $kategoriCount; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $kat): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <li>
                    <?php if($kat->tipe_laporan == 'preventif_konseling'): ?> Preventif & Konseling
                    <?php elseif($kat->tipe_laporan == 'kekerasan_bullying'): ?> Kekerasan & Bullying
                    <?php elseif($kat->tipe_laporan == 'integritas_akademik'): ?> Integritas Akademik
                    <?php endif; ?>
                    : <?php echo e($kat->total); ?> kasus
                </li>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            <?php if($kategoriCount->isEmpty()): ?>
                <li>Belum ada data kasus selesai.</li>
            <?php endif; ?>
        </ul>
    </div>

    <table>
        <thead>
            <tr>
                <th style="width: 5%;">No</th>
                <th style="width: 20%;">Kategori</th>
                <th style="width: 30%;">Judul Laporan</th>
                <th style="width: 25%;">Perguruan Tinggi (PTS)</th>
                <th style="width: 20%;">Tanggal Selesai</th>
            </tr>
        </thead>
        <tbody>
            <?php $__currentLoopData = $kasusDiproses; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $kasus): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <tr>
                <td class="text-center"><?php echo e($index + 1); ?></td>
                <td>
                    <?php if($kasus->tipe_laporan == 'preventif_konseling'): ?> Preventif & Konseling
                    <?php elseif($kasus->tipe_laporan == 'kekerasan_bullying'): ?> Kekerasan & Bullying
                    <?php elseif($kasus->tipe_laporan == 'integritas_akademik'): ?> Integritas Akademik
                    <?php endif; ?>
                </td>
                <td><?php echo e($kasus->judul); ?></td>
                <td><?php echo e($kasus->pts_nama); ?></td>
                <td class="text-center"><?php echo e($kasus->updated_at->format('d/m/Y H:i')); ?></td>
            </tr>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            <?php if($kasusDiproses->isEmpty()): ?>
            <tr>
                <td colspan="5" class="text-center">Belum ada kasus yang berstatus selesai.</td>
            </tr>
            <?php endif; ?>
        </tbody>
    </table>

    <div class="signature-box">
        <p>Jakarta, <?php echo e(date('d F Y')); ?><br>
        Kepala,</p>
        
        <div class="signature-space">
            <?php
                $ttdPath = public_path('images/TandatanganLLDIKTI3.png');
                $ttdBase64 = file_exists($ttdPath) ? base64_encode(file_get_contents($ttdPath)) : '';
            ?>
            <?php if($ttdBase64): ?>
                <img src="data:image/png;base64,<?php echo e($ttdBase64); ?>" alt="Tanda Tangan" style="width: 170px; height: auto;">
            <?php else: ?>
                [ Tanda Tangan & Cap ]
            <?php endif; ?>
        </div>
        
        <p><strong>Dr. Henri Tambunan, S.E., M.A.</strong><br>
        NIP 196811261994031001</p>
    </div>
    <div class="clear"></div>

</body>
</html>
<?php /**PATH C:\laragon\www\SIM-KITA-LLDIKTI-3\resources\views/dashboard/rekap_pdf.blade.php ENDPATH**/ ?>