<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Data Pengguna</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        body {
            font-family: Arial, sans-serif;
            font-size: 12px;
            line-height: 1.4;
            padding: 20px;
        }
        .header {
            text-align: center;
            margin-bottom: 20px;
            border-bottom: 2px solid #000;
            padding-bottom: 15px;
        }
        .header h2 {
            margin: 5px 0;
            font-size: 18px;
        }
        .header h3 {
            margin: 5px 0;
            font-size: 14px;
            font-weight: normal;
        }
        .header p {
            margin: 3px 0;
            font-size: 11px;
        }
        .meta-info {
            margin: 15px 0;
            font-size: 11px;
        }
        .meta-info table {
            width: 100%;
        }
        .meta-info td {
            padding: 2px 0;
        }
        table.data {
            width: 100%;
            border-collapse: collapse;
            margin-top: 15px;
        }
        table.data th,
        table.data td {
            border: 1px solid #333;
            padding: 6px 4px;
            text-align: left;
            font-size: 10px;
        }
        table.data th {
            background-color: #f0f0f0;
            font-weight: bold;
            text-align: center;
        }
        table.data td.number {
            text-align: center;
        }
        .signature {
            margin-top: 40px;
            text-align: right;
        }
        .signature-box {
            display: inline-block;
            text-align: center;
            min-width: 200px;
        }
        .signature-line {
            margin-top: 60px;
            border-top: 1px solid #000;
            padding-top: 5px;
        }
        .role-badge {
            display: inline-block;
            padding: 2px 6px;
            border-radius: 3px;
            font-size: 9px;
            font-weight: bold;
        }
        .role-admin { background-color: #d4edda; color: #155724; }
        .role-petugas { background-color: #d1ecf1; color: #0c5460; }
        .role-pengunjung { background-color: #fff3cd; color: #856404; }
    </style>
</head>
<body>
    <div class="header">
        <h2>SISTEM PERPUSTAKAAN</h2>
        <h3>SMA NEGERI 1 PANGURURAN</h3>
        <p>Jl. Sisingamangaraja No. 1, Pangururan, Kabupaten Samosir</p>
        <p>Telp: (0625) 123456 | Email: perpustakaan@sman1pangururan.sch.id</p>
    </div>

    <div class="meta-info">
        <table>
            <tr>
                <td width="15%"><strong>Judul Laporan</strong></td>
                <td width="2%">:</td>
                <td><strong>DATA PENGGUNA PERPUSTAKAAN</strong></td>
            </tr>
            <tr>
                <td><strong>Tanggal Cetak</strong></td>
                <td>:</td>
                <td><?php echo e($tanggal_cetak); ?></td>
            </tr>
            <tr>
                <td><strong>Total Data</strong></td>
                <td>:</td>
                <td><?php echo e(count($users)); ?> pengguna</td>
            </tr>
        </table>
    </div>

    <table class="data">
        <thead>
            <tr>
                <th width="5%">No</th>
                <th width="10%">ID User</th>
                <th width="15%">Username</th>
                <th width="25%">Nama Lengkap</th>
                <th width="10%">Role</th>
                <th width="15%">Tipe Anggota</th>
                <th width="10%">Kelas</th>
                <th width="15%">Status</th>
                <th width="15%">Terdaftar</th>
            </tr>
        </thead>
        <tbody>
            <?php $__empty_1 = true; $__currentLoopData = $users; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $user): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                <tr>
                    <td class="number"><?php echo e($index + 1); ?></td>
                    <td class="number"><?php echo e($user->id_user); ?></td>
                    <td><?php echo e($user->username); ?></td>
                    <td><?php echo e($user->nama); ?></td>
                    <td class="number"><?php echo e(ucfirst($user->role)); ?></td>
                    <td><?php echo e($user->tipe_anggota ?? '-'); ?></td>
                    <td class="number"><?php echo e($user->kelas ?? '-'); ?></td>
                    <td class="number"><?php echo e($user->status_keanggotaan ?? 'Aktif'); ?></td>
                    <td class="number"><?php echo e(\Carbon\Carbon::parse($user->created_at)->format('d/m/Y')); ?></td>
                </tr>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                <tr>
                    <td colspan="9" style="text-align: center; padding: 20px;">
                        Tidak ada data pengguna
                    </td>
                </tr>
            <?php endif; ?>
        </tbody>
        <?php if(count($users) > 0): ?>
            <tfoot>
                <tr style="background-color: #f0f0f0; font-weight: bold;">
                    <td colspan="9" style="text-align: right; padding: 8px;">
                        Total: <?php echo e(count($users)); ?> Pengguna
                    </td>
                </tr>
            </tfoot>
        <?php endif; ?>
    </table>

    <div style="margin-top: 20px; font-size: 11px;">
        <p><strong>Keterangan Role:</strong></p>
        <ul style="margin-left: 20px; margin-top: 5px;">
            <li><strong>Admin</strong>: Memiliki akses penuh ke semua fitur sistem</li>
            <li><strong>Petugas</strong>: Mengelola transaksi peminjaman dan pengembalian</li>
            <li><strong>Pengunjung</strong>: Anggota perpustakaan yang dapat meminjam buku</li>
        </ul>
    </div>

    <div class="signature">
        <div class="signature-box">
            <p>Pangururan, <?php echo e(\Carbon\Carbon::now()->format('d F Y')); ?></p>
            <p>Petugas Perpustakaan</p>
            <div class="signature-line">
                <p><?php echo e(auth()->user()->nama ?? '(.....................)'); ?></p>
            </div>
        </div>
    </div>
</body>
</html>
<?php /**PATH C:\Users\hizkia\Desktop\TUBES_MSBD\Perpustakaan-SMAN-1-Pangururan\resources\views/admin/pdf/users.blade.php ENDPATH**/ ?>