
<?php $__env->startSection('title', 'Hasil Verifikasi Divisi Saya'); ?>

<?php $__env->startSection('content'); ?>
<div class="min-h-screen bg-slate-50 p-3">

    <style>
        [x-cloak] {
            display: none !important;
        }

        .select-clean {
            appearance: none !important;
            -webkit-appearance: none !important;
            -moz-appearance: none !important;
            background-image: none !important;
        }

        .select-clean::-ms-expand {
            display: none !important;
        }
    </style>

    
    <div class="mb-4 overflow-hidden rounded-xl border border-slate-200 bg-white shadow-sm">
        <div class="flex items-center gap-3 px-4 py-3">
            <div class="flex h-9 w-9 items-center justify-center rounded-lg bg-emerald-50 text-emerald-600">
                <i class="fas fa-clipboard-check text-xs"></i>
            </div>

            <div>
                <h2 class="text-base font-bold text-slate-800">Hasil Verifikasi pada Divisi Anda</h2>
                <p class="mt-0.5 text-xs text-slate-500">
                    Menampilkan hasil verifikasi audit divisi anda yang dilaksanakan oleh auditor divisi lain.
                </p>
            </div>
        </div>
    </div>

    
    <div class="mb-4 overflow-hidden rounded-xl border border-slate-200 bg-white shadow-sm">

        
        <div class="border-b border-slate-100 bg-white px-4 py-3">
            <div class="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
                <div class="flex items-center gap-3">
                    <div class="flex h-9 w-9 items-center justify-center rounded-lg bg-emerald-50 text-emerald-600">
                        <i class="fas fa-list-check text-xs"></i>
                    </div>

                    <div>
                        <h3 class="text-sm font-bold text-slate-800">
                            Audit Close Periode : Tema <?php echo e($temaTerpilih?->nama ?? '-'); ?>

                        </h3>
                        <p class="mt-0.5 text-xs text-slate-500">
                            Data audit close berdasarkan tema dan periode yang dipilih.
                        </p>
                    </div>
                </div>
            </div>
        </div>

        
        <div class="border-b border-slate-100 bg-slate-50/70 px-4 py-3">
            <form method="GET" action="<?php echo e(route('audit.hasil.verifikasi')); ?>">
                <div class="rounded-xl border border-slate-200 bg-white px-3 py-3 shadow-sm">
                    <div class="grid grid-cols-1 gap-2 md:grid-cols-5">

                        
                        <div x-data="{ open: false }" class="relative">
                            <select name="filter_tema"
                                @focus="open = true"
                                @blur="open = false"
                                @change="open = false"
                                class="select-clean h-9 w-full rounded-lg border border-slate-200 bg-slate-50 px-3 pr-9 text-xs font-medium text-slate-600 outline-none transition focus:border-blue-500 focus:bg-white focus:ring-2 focus:ring-blue-100">
                                <option value="">-- Pilih Tema --</option>

                                <?php $__currentLoopData = $temaList; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $tema): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <?php
                                        $temaId = is_object($tema) ? $tema->id : $key;
                                        $temaNama = is_object($tema) ? $tema->nama : $tema;
                                    ?>

                                    <option value="<?php echo e($temaId); ?>" <?php echo e(session('filter_tema_user') == $temaId ? 'selected' : ''); ?>>
                                        <?php echo e($temaNama); ?>

                                    </option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </select>

                            <span class="pointer-events-none absolute inset-y-0 right-3 flex items-center text-slate-500">
                                <i class="fas fa-chevron-down text-[10px] transition-transform duration-300"
                                    :class="open ? 'rotate-180 text-blue-500' : 'rotate-0'"></i>
                            </span>
                        </div>

                        
                        <div x-data="{ open: false }" class="relative">
                            <select name="filter_bulan"
                                @focus="open = true"
                                @blur="open = false"
                                @change="open = false"
                                class="select-clean h-9 w-full rounded-lg border border-slate-200 bg-slate-50 px-3 pr-9 text-xs font-medium text-slate-600 outline-none transition focus:border-blue-500 focus:bg-white focus:ring-2 focus:ring-blue-100">
                                <option value="">-- Pilih Bulan --</option>

                                <?php for($m = 1; $m <= 12; $m++): ?>
                                    <?php $bln = str_pad($m, 2, '0', STR_PAD_LEFT); ?>
                                    <option value="<?php echo e($bln); ?>" <?php echo e(session('filter_bulan_audit') == $bln ? 'selected' : ''); ?>>
                                        <?php echo e(\Carbon\Carbon::create()->month($m)->translatedFormat('F')); ?>

                                    </option>
                                <?php endfor; ?>
                            </select>

                            <span class="pointer-events-none absolute inset-y-0 right-3 flex items-center text-slate-500">
                                <i class="fas fa-chevron-down text-[10px] transition-transform duration-300"
                                    :class="open ? 'rotate-180 text-blue-500' : 'rotate-0'"></i>
                            </span>
                        </div>

                        
                        <div x-data="{ open: false }" class="relative">
                            <select name="filter_tahun"
                                @focus="open = true"
                                @blur="open = false"
                                @change="open = false"
                                class="select-clean h-9 w-full rounded-lg border border-slate-200 bg-slate-50 px-3 pr-9 text-xs font-medium text-slate-600 outline-none transition focus:border-blue-500 focus:bg-white focus:ring-2 focus:ring-blue-100">
                                <option value="">-- Pilih Tahun --</option>

                                <?php $__currentLoopData = $tahunList; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $thn): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option value="<?php echo e($thn); ?>" <?php echo e(session('filter_tahun_audit') == $thn ? 'selected' : ''); ?>>
                                        <?php echo e($thn); ?>

                                    </option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </select>

                            <span class="pointer-events-none absolute inset-y-0 right-3 flex items-center text-slate-500">
                                <i class="fas fa-chevron-down text-[10px] transition-transform duration-300"
                                    :class="open ? 'rotate-180 text-blue-500' : 'rotate-0'"></i>
                            </span>
                        </div>

                        
                        <div class="grid grid-cols-2 gap-2 md:col-span-2">
                            <button type="submit"
                                class="inline-flex h-9 items-center justify-center gap-1.5 rounded-lg bg-blue-500 px-3 text-xs font-medium text-white transition hover:bg-blue-600">
                                <i class="fas fa-check text-[11px]"></i>
                                Filter
                            </button>

                            <a href="<?php echo e(route('audit.hasil.verifikasi', ['reset' => 1])); ?>"
                                class="inline-flex h-9 items-center justify-center gap-1.5 rounded-lg bg-gray-200 px-3 text-xs font-medium text-slate-600 transition hover:bg-gray-300">
                                <i class="fas fa-rotate-left text-[11px]"></i>
                                Reset
                            </a>
                        </div>

                    </div>
                </div>
            </form>
        </div>

        
        <div class="flex flex-col gap-3 px-4 py-3 sm:flex-row sm:items-center sm:justify-between">
            <div class="flex items-center gap-2 text-xs text-slate-600">
                <span>Tampilkan</span>

                <form method="GET" action="<?php echo e(route('admin.audit')); ?>" class="flex items-center gap-2">
                    <div x-data="{ open: false }" class="relative">
                        <select name="limit"
                            onchange="this.form.submit()"
                            @focus="open = true"
                            @blur="open = false"
                            @change="open = false"
                            class="select-clean h-9 w-20 rounded-lg border border-slate-200 bg-slate-50 px-3 pr-8 text-xs font-medium text-slate-700 shadow-sm outline-none transition focus:border-blue-500 focus:bg-white focus:ring-2 focus:ring-blue-100">
                            <?php $__currentLoopData = [10, 25, 50, 100]; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $val): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <option value="<?php echo e($val); ?>" <?php echo e(session('limit_audit', 10) == $val ? 'selected' : ''); ?>>
                                    <?php echo e($val); ?>

                                </option>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </select>

                        <span class="pointer-events-none absolute inset-y-0 right-3 flex items-center text-slate-500">
                            <i class="fas fa-chevron-down text-[10px] transition-transform duration-300"
                                :class="open ? 'rotate-180 text-blue-500' : 'rotate-0'"></i>
                        </span>
                    </div>

                    <input type="hidden" name="filter_tema" value="<?php echo e(session('filter_tema_user')); ?>">
                    <input type="hidden" name="filter_bulan" value="<?php echo e(session('filter_bulan_audit')); ?>">
                    <input type="hidden" name="filter_tahun" value="<?php echo e(session('filter_tahun_audit')); ?>">
                </form>

                <span>entri</span>
            </div>

            <div class="relative w-full sm:w-64">
                <input type="text"
                    id="searchAuditBulanIni"
                    placeholder="Cari data verifikasi..."
                    class="h-9 w-full rounded-lg border border-slate-200 bg-slate-50 pl-3 pr-9 text-xs text-slate-700 shadow-sm outline-none transition placeholder:text-slate-400 focus:border-blue-500 focus:bg-white focus:ring-2 focus:ring-blue-100">

                <span class="pointer-events-none absolute inset-y-0 right-3 flex items-center text-slate-400">
                    <svg class="h-3.5 w-3.5"
                        fill="none"
                        stroke="currentColor"
                        stroke-width="2"
                        viewBox="0 0 24 24">
                        <path stroke-linecap="round"
                            stroke-linejoin="round"
                            d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" />
                    </svg>
                </span>
            </div>
        </div>

        
        <div class="overflow-x-auto px-4 pb-4">
            <div class="overflow-hidden rounded-lg border border-slate-200">
                <table id="tabelAuditBulanIni" class="w-full min-w-[900px] border-collapse text-xs">
                    <thead>
                        <tr class="border-b border-slate-200 bg-slate-50 uppercase tracking-wide text-slate-500">
                            <th class="w-14 border-r border-slate-200 px-3 py-2 text-center font-bold">No</th>
                            <th class="border-r border-slate-200 px-3 py-2 text-center font-bold">Tema</th>
                            <th class="border-r border-slate-200 px-3 py-2 text-center font-bold">Divisi</th>
                            <th class="border-r border-slate-200 px-3 py-2 text-center font-bold">Tanggal Audit</th>
                            <th class="border-r border-slate-200 px-3 py-2 text-center font-bold">Keterangan Temuan</th>
                            <th class="w-24 border-r border-slate-200 px-3 py-2 text-center font-bold">Status</th>
                            <th class="w-32 px-3 py-2 text-center font-bold">Aksi</th>
                        </tr>
                    </thead>

                    <tbody class="divide-y divide-slate-100">
                        <?php $__empty_1 = true; $__currentLoopData = $auditBulanIni; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $audit): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                            <tr class="transition hover:bg-slate-50">
                                <td class="border-r border-slate-100 px-3 py-2 text-center font-medium text-slate-600">
                                    <?php echo e($auditBulanIni->firstItem() + $index); ?>

                                </td>

                                <td class="border-r border-slate-100 px-3 py-2 text-left font-semibold text-slate-700">
                                    <?php echo e(is_object($audit->tema) ? ($audit->tema->nama ?? '-') : ($audit->tema ?? '-')); ?>

                                </td>

                                <td class="border-r border-slate-100 px-3 py-2 text-left text-slate-600">
                                    <?php echo e($audit->bagian->nama_bagian ?? '-'); ?>

                                </td>

                                <td class="border-r border-slate-100 px-3 py-2 text-center text-slate-600">
                                    <?php echo e(\Carbon\Carbon::parse($audit->tanggal_audit)->translatedFormat('d F Y')); ?>

                                </td>

                                <td class="border-r border-slate-100 px-3 py-2 text-left text-slate-600">
                                    <?php echo e($audit->keterangan ?? '-'); ?>

                                </td>

                                <td class="border-r border-slate-100 px-3 py-2 text-center">
                                    <span class="inline-flex rounded-full bg-green-100 px-3 py-1 text-xs font-semibold text-green-600">
                                        Close
                                    </span>
                                </td>

                                <td class="px-3 py-2 text-center">
                                    <a href="<?php echo e(route('audit.hasil.show', $audit->id)); ?>"
                                        class="inline-flex h-8 items-center justify-center gap-1 rounded-lg bg-green-500 px-3 text-xs font-medium text-white transition hover:bg-green-600">
                                        <i class="fas fa-eye text-[11px]"></i>
                                        Lihat Detail
                                    </a>
                                </td>
                            </tr>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                            <tr>
                                <td colspan="7" class="px-3 py-6 text-center text-xs italic text-slate-500">
                                    Belum ada data untuk periode ini.
                                </td>
                            </tr>
                        <?php endif; ?>
                    </tbody>
                </table>
            </div>

            <?php if($auditBulanIni instanceof \Illuminate\Pagination\LengthAwarePaginator): ?>
                <div class="mt-4">
                    <?php echo e($auditBulanIni->appends([
                        'filter_tema' => session('filter_tema_user'),
                        'filter_bulan' => session('filter_bulan_audit'),
                        'filter_tahun' => session('filter_tahun_audit'),
                        'limit' => session('limit_audit')
                    ])->links()); ?>

                </div>
            <?php endif; ?>
        </div>
    </div>

    
    <div class="mb-4 overflow-hidden rounded-xl border border-slate-200 bg-white shadow-sm">

        
        <div class="border-b border-slate-100 bg-white px-4 py-3">
            <div class="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
                <div class="flex items-center gap-3">
                    <div class="flex h-9 w-9 items-center justify-center rounded-lg bg-emerald-50 text-emerald-600">
                        <i class="fas fa-list-check text-xs"></i>
                    </div>

                    <div>
                        <h3 class="text-sm font-bold text-slate-800">Semua Audit Close</h3>
                        <p class="mt-0.5 text-xs text-slate-500">
                            Seluruh data audit close yang telah selesai diverifikasi.
                        </p>
                    </div>
                </div>
            </div>
        </div>

        
        <div class="flex flex-col gap-3 px-4 py-3 sm:flex-row sm:items-center sm:justify-between">
            <div class="flex items-center gap-2 text-xs text-slate-600">
                <span>Tampilkan</span>

                <form method="GET" action="<?php echo e(route('admin.audit')); ?>" class="flex items-center gap-2">
                    <div x-data="{ open: false }" class="relative">
                        <select name="limit"
                            onchange="this.form.submit()"
                            @focus="open = true"
                            @blur="open = false"
                            @change="open = false"
                            class="select-clean h-9 w-20 rounded-lg border border-slate-200 bg-slate-50 px-3 pr-8 text-xs font-medium text-slate-700 shadow-sm outline-none transition focus:border-blue-500 focus:bg-white focus:ring-2 focus:ring-blue-100">
                            <?php $__currentLoopData = [10, 25, 50, 100]; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $val): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <option value="<?php echo e($val); ?>" <?php echo e(session('limit_audit', 10) == $val ? 'selected' : ''); ?>>
                                    <?php echo e($val); ?>

                                </option>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </select>

                        <span class="pointer-events-none absolute inset-y-0 right-3 flex items-center text-slate-500">
                            <i class="fas fa-chevron-down text-[10px] transition-transform duration-300"
                                :class="open ? 'rotate-180 text-blue-500' : 'rotate-0'"></i>
                        </span>
                    </div>

                    <input type="hidden" name="filter_tema" value="<?php echo e(session('filter_tema_user')); ?>">
                    <input type="hidden" name="filter_bulan" value="<?php echo e(session('filter_bulan_audit')); ?>">
                    <input type="hidden" name="filter_tahun" value="<?php echo e(session('filter_tahun_audit')); ?>">
                </form>

                <span>entri</span>
            </div>

            <div class="relative w-full sm:w-64">
                <input type="text"
                    id="searchAuditOpen"
                    placeholder="Cari data audit close..."
                    class="h-9 w-full rounded-lg border border-slate-200 bg-slate-50 pl-3 pr-9 text-xs text-slate-700 shadow-sm outline-none transition placeholder:text-slate-400 focus:border-blue-500 focus:bg-white focus:ring-2 focus:ring-blue-100">

                <span class="pointer-events-none absolute inset-y-0 right-3 flex items-center text-slate-400">
                    <svg class="h-3.5 w-3.5"
                        fill="none"
                        stroke="currentColor"
                        stroke-width="2"
                        viewBox="0 0 24 24">
                        <path stroke-linecap="round"
                            stroke-linejoin="round"
                            d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" />
                    </svg>
                </span>
            </div>
        </div>

        
        <div class="overflow-x-auto px-4 pb-4">
            <div class="overflow-hidden rounded-lg border border-slate-200">
                <table id="tabelAuditOpen" class="w-full min-w-[900px] border-collapse text-xs">
                    <thead>
                        <tr class="border-b border-slate-200 bg-slate-50 uppercase tracking-wide text-slate-500">
                            <th class="w-14 border-r border-slate-200 px-3 py-2 text-center font-bold">No</th>
                            <th class="border-r border-slate-200 px-3 py-2 text-center font-bold">Tema</th>
                            <th class="border-r border-slate-200 px-3 py-2 text-center font-bold">Divisi</th>
                            <th class="border-r border-slate-200 px-3 py-2 text-center font-bold">Tanggal Audit</th>
                            <th class="border-r border-slate-200 px-3 py-2 text-center font-bold">Keterangan Temuan</th>
                            <th class="w-24 border-r border-slate-200 px-3 py-2 text-center font-bold">Status</th>
                            <th class="w-32 px-3 py-2 text-center font-bold">Aksi</th>
                        </tr>
                    </thead>

                    <tbody class="divide-y divide-slate-100">
                        <?php $__empty_1 = true; $__currentLoopData = $semuaAuditClose; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $audit): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                            <tr class="transition hover:bg-slate-50">
                                <td class="border-r border-slate-100 px-3 py-2 text-center font-medium text-slate-600">
                                    <?php echo e($index + 1); ?>

                                </td>

                                <td class="border-r border-slate-100 px-3 py-2 text-left font-semibold text-slate-700">
                                    <?php echo e($audit->tema->nama ?? '-'); ?>

                                </td>

                                <td class="border-r border-slate-100 px-3 py-2 text-left text-slate-600">
                                    <?php echo e($audit->bagian->nama_bagian ?? '-'); ?>

                                </td>

                                <td class="border-r border-slate-100 px-3 py-2 text-center text-slate-600">
                                    <?php echo e(\Carbon\Carbon::parse($audit->tanggal_audit)->translatedFormat('d F Y')); ?>

                                </td>

                                <td class="border-r border-slate-100 px-3 py-2 text-left text-slate-600">
                                    <?php echo e($audit->keterangan ?? '-'); ?>

                                </td>

                                <td class="border-r border-slate-100 px-3 py-2 text-center">
                                    <span class="inline-flex rounded-full bg-green-100 px-3 py-1 text-xs font-semibold text-green-600">
                                        Close
                                    </span>
                                </td>

                                <td class="px-3 py-2 text-center">
                                    <a href="<?php echo e(route('audit.hasil.show', $audit->id)); ?>"
                                        class="inline-flex h-8 items-center justify-center gap-1 rounded-lg bg-green-500 px-3 text-xs font-medium text-white transition hover:bg-green-600">
                                        <i class="fas fa-eye text-[11px]"></i>
                                        Lihat Detail
                                    </a>
                                </td>
                            </tr>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                            <tr>
                                <td colspan="7" class="px-3 py-6 text-center text-xs italic text-slate-500">
                                    Belum ada data audit close.
                                </td>
                            </tr>
                        <?php endif; ?>
                    </tbody>
                </table>
            </div>
        </div>

    </div>

</div>
<?php $__env->stopSection(); ?>

<?php $__env->startPush('scripts'); ?>
<script>
document.addEventListener('DOMContentLoaded', function () {
    function filterTable(inputId, tableId) {
        const input = document.getElementById(inputId);
        const table = document.getElementById(tableId);

        if (!input || !table) return;

        const rows = table.querySelectorAll('tbody tr');

        input.addEventListener('keyup', function () {
            const keyword = input.value.toLowerCase();

            rows.forEach(row => {
                const rowText = row.textContent.toLowerCase();
                row.style.display = rowText.includes(keyword) ? '' : 'none';
            });
        });
    }

    filterTable('searchAuditBulanIni', 'tabelAuditBulanIni');
    filterTable('searchAuditOpen', 'tabelAuditOpen');

    if (window.lucide) {
        window.lucide.createIcons();
    }
});
</script>
<?php $__env->stopPush(); ?>
<?php echo $__env->make('web_user.layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\xampp\htdocs\ea-systems\resources\views/web_user/hasil-verifikasi.blade.php ENDPATH**/ ?>