<!DOCTYPE html>
<html lang="id">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Pelaporan IKK</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
    <style>
        .header-section {
            background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
            color: white;
            padding: 2rem 0;
        }
        .card {
            border: none;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
            border-radius: 10px;
        }
        .table th {
            background-color: #2a5298;
            color: white;
            border: none;
            font-weight: 600;
        }
        .status-badge {
            padding: 0.4rem 0.8rem;
            border-radius: 15px;
            font-size: 0.85rem;
            font-weight: 600;
        }
        .draft { background-color: #6c757d; color: white; }
        .diajukan { background-color: #0d6efd; color: white; }
        .diverifikasi { background-color: #198754; color: white; }
        .perlu-perbaikan { background-color: #dc3545; color: white; }
    </style>
</head>
<body>
    <!-- Header -->
    <div class="header-section">
        <div class="container">
            <div class="row align-items-center">
                <div class="col-md-8">
                    <h1 class="mb-2">
                        <i class="fas fa-clipboard-check me-3"></i>
                        Pelaporan IKK
                    </h1>
                    <p class="mb-0 fs-5">Indikator Kinerja Kunci Organisasi Perangkat Daerah</p>
                </div>
                <div class="col-md-4 text-end">
                    <a href="<?php echo e(route('ikk.pelaporan.create')); ?>" class="btn btn-success">
                        <i class="fas fa-plus me-2"></i>Tambah Pelaporan
                    </a>
                </div>
            </div>
        </div>
    </div>

    <div class="container my-5">
        <?php if(session('success')): ?>
            <div class="alert alert-success alert-dismissible fade show" role="alert">
                <i class="fas fa-check-circle me-2"></i>
                <?php echo e(session('success')); ?>

                <button type="button" class="btn-close" data-bs-dismiss="alert"></button>
            </div>
        <?php endif; ?>

        <!-- Filter -->
        <div class="card mb-4">
            <div class="card-body">
                <form method="GET">
                    <div class="row align-items-end">
                        <div class="col-md-3">
                            <label class="form-label fw-semibold">OPD</label>
                            <select name="opd" class="form-select">
                                <option value="">Semua OPD</option>
                                <?php $__currentLoopData = $opdList; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $opdItem): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option value="<?php echo e($opdItem); ?>" <?php echo e($opd == $opdItem ? 'selected' : ''); ?>><?php echo e($opdItem); ?></option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </select>
                        </div>
                        <div class="col-md-2">
                            <label class="form-label fw-semibold">Tahun</label>
                            <select name="tahun" class="form-select">
                                <option value="">Semua 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($tahun == $thn ? 'selected' : ''); ?>><?php echo e($thn); ?></option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </select>
                        </div>
                        <div class="col-md-3">
                            <label class="form-label fw-semibold">Status</label>
                            <select name="status" class="form-select">
                                <option value="">Semua Status</option>
                                <?php $__currentLoopData = $statusList; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $stat): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option value="<?php echo e($stat); ?>" <?php echo e($status == $stat ? 'selected' : ''); ?>><?php echo e($stat); ?></option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </select>
                        </div>
                        <div class="col-md-2">
                            <label class="form-label fw-semibold">Cari</label>
                            <input type="text" name="search" class="form-control" placeholder="Kode IKK...">
                        </div>
                        <div class="col-md-2">
                            <button type="submit" class="btn btn-primary w-100">
                                <i class="fas fa-search me-2"></i>Filter
                            </button>
                        </div>
                    </div>
                </form>
            </div>
        </div>

        <!-- Tabel Pelaporan -->
        <div class="card">
            <div class="card-body p-0">
                <div class="table-responsive">
                    <table class="table table-hover mb-0">
                        <thead>
                            <tr>
                                <th width="5%">No</th>
                                <th width="10%">Kode IKK</th>
                                <th width="35%">IKK Output</th>
                                <th width="15%">OPD</th>
                                <th width="8%">Tahun</th>
                                <th width="10%">Capaian</th>
                                <th width="12%">Status</th>
                                <th width="15%">Aksi</th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php $__currentLoopData = $pelaporan; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $laporan): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <tr>
                                <td class="text-center"><?php echo e($index + 1); ?></td>
                                <td class="fw-bold text-primary"><?php echo e($laporan['kode_ikk']); ?></td>
                                <td><?php echo e($laporan['ikk_output']); ?></td>
                                <td><small><?php echo e($laporan['opd']); ?></small></td>
                                <td class="text-center"><?php echo e($laporan['tahun']); ?></td>
                                <td class="text-center fw-bold"><?php echo e($laporan['capaian']); ?>%</td>
                                <td>
                                    <span class="status-badge <?php echo e(strtolower(str_replace(' ', '-', $laporan['status']))); ?>">
                                        <?php echo e($laporan['status']); ?>

                                    </span>
                                </td>
                                <td>
                                    <div class="btn-group btn-group-sm">
                                        <a href="<?php echo e(route('ikk.pelaporan.jawaban', $laporan['id'])); ?>" class="btn btn-outline-info" title="Isian Jawaban">
                                            <i class="fas fa-clipboard-list"></i>
                                        </a>
                                        <button class="btn btn-outline-secondary" title="Lihat Detail">
                                            <i class="fas fa-eye"></i>
                                        </button>
                                        <?php if($laporan['status'] == 'DRAFT'): ?>
                                            <a href="<?php echo e(route('ikk.pelaporan.edit', $laporan['id'])); ?>" class="btn btn-outline-warning" title="Edit">
                                                <i class="fas fa-edit"></i>
                                            </a>
                                        <?php endif; ?>
                                    </div>
                                </td>
                            </tr>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>

        <!-- Statistik -->
        <div class="row mt-4">
            <div class="col-md-3">
                <div class="card text-center">
                    <div class="card-body">
                        <i class="fas fa-file-alt fa-2x text-primary mb-2"></i>
                        <h4 class="fw-bold"><?php echo e(count($pelaporan)); ?></h4>
                        <p class="mb-0 text-muted">Total Pelaporan</p>
                    </div>
                </div>
            </div>
            <div class="col-md-3">
                <div class="card text-center">
                    <div class="card-body">
                        <i class="fas fa-check-circle fa-2x text-success mb-2"></i>
                        <h4 class="fw-bold"><?php echo e(collect($pelaporan)->where('status', 'DIVERIFIKASI')->count()); ?></h4>
                        <p class="mb-0 text-muted">Diverifikasi</p>
                    </div>
                </div>
            </div>
            <div class="col-md-3">
                <div class="card text-center">
                    <div class="card-body">
                        <i class="fas fa-clock fa-2x text-warning mb-2"></i>
                        <h4 class="fw-bold"><?php echo e(collect($pelaporan)->where('status', 'DIAJUKAN')->count()); ?></h4>
                        <p class="mb-0 text-muted">Menunggu Verifikasi</p>
                    </div>
                </div>
            </div>
            <div class="col-md-3">
                <div class="card text-center">
                    <div class="card-body">
                        <i class="fas fa-edit fa-2x text-secondary mb-2"></i>
                        <h4 class="fw-bold"><?php echo e(collect($pelaporan)->where('status', 'DRAFT')->count()); ?></h4>
                        <p class="mb-0 text-muted">Draft</p>
                    </div>
                </div>
            </div>
        </div>

        <!-- Info -->
        <div class="card mt-4">
            <div class="card-header bg-info text-white">
                <h6 class="mb-0"><i class="fas fa-info-circle me-2"></i>Informasi Status Pelaporan</h6>
            </div>
            <div class="card-body">
                <div class="row">
                    <div class="col-md-6">
                        <p><span class="status-badge draft">DRAFT</span> - Data masih dapat diedit oleh OPD</p>
                        <p><span class="status-badge diajukan">DIAJUKAN</span> - Menunggu verifikasi APIP</p>
                    </div>
                    <div class="col-md-6">
                        <p><span class="status-badge diverifikasi">DIVERIFIKASI</span> - Data telah disetujui</p>
                        <p><span class="status-badge perlu-perbaikan">PERLU PERBAIKAN</span> - Data perlu diperbaiki</p>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html><?php /**PATH /Users/user/Documents/giriwidyan/project/inhouse/skm/resources/views/ikk/pelaporan/index.blade.php ENDPATH**/ ?>