<!DOCTYPE html>
<html lang="id">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Cetak Riwayat Pengiriman WhatsApp</title>
    <!-- Theme style -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/admin-lte@3.2/dist/css/adminlte.min.css">
    <style>
        body { background: #fff; padding: 20px; font-size: 14px; }
        .text-center { text-align: center; }
        .font-weight-bold { font-weight: bold; }
        .mb-4 { margin-bottom: 1.5rem; }
        table { width: 100%; border-collapse: collapse; margin-top: 10px; }
        th, td { border: 1px solid #000; padding: 5px; }
        th { background-color: #f4f6f9; }
        @media print {
            .no-print { display: none; }
        }
    </style>
</head>
<body onload="window.print()">
    <div class="no-print mb-4">
        <button onclick="window.print()" class="btn btn-primary">Cetak</button>
        <button onclick="window.close()" class="btn btn-default">Tutup</button>
    </div>

    <div class="text-center mb-4">
        <h4 class="font-weight-bold">YPKK KERTAS LECES</h4>
        <h5>RIWAYAT PENGIRIMAN WHATSAPP</h5>
        <p>Tanggal Cetak: <?php echo e(date('d-m-Y H:i')); ?></p>
    </div>

    <table>
        <thead>
            <tr>
                <th>No</th>
                <th>Tanggal</th>
                <th>Nama Siswa</th>
                <th>Nomor WhatsApp</th>
                <th>Jenis Pesan</th>
                <th>Dikirim Oleh</th>
                <th>Status</th>
                <th>Keterangan</th>
            </tr>
        </thead>
        <tbody>
            <?php $__empty_1 = true; $__currentLoopData = $riwayats; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $riwayat): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                <tr>
                    <td class="text-center"><?php echo e($index + 1); ?></td>
                    <td><?php echo e($riwayat->created_at->format('d-m-Y H:i')); ?></td>
                    <td><?php echo e($riwayat->nama_siswa ?? '-'); ?></td>
                    <td><?php echo e($riwayat->no_wa); ?></td>
                    <td><?php echo e($riwayat->jenis_pesan); ?></td>
                    <td><?php echo e($riwayat->dikirimOleh->name ?? '-'); ?></td>
                    <td class="text-center">
                        <?php if($riwayat->status == 'berhasil'): ?>
                            Berhasil
                        <?php else: ?>
                            Gagal
                        <?php endif; ?>
                    </td>
                    <td><?php echo e($riwayat->keterangan ?? '-'); ?></td>
                </tr>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                <tr>
                    <td colspan="8" class="text-center">Tidak ada data riwayat pengiriman WhatsApp.</td>
                </tr>
            <?php endif; ?>
        </tbody>
    </table>
</body>
</html>
<?php /**PATH C:\Herd\spp_app\resources\views/laporan/cetak-riwayat-wa.blade.php ENDPATH**/ ?>