<?php $__env->startSection('title', 'Update Tahunan'); ?>
<?php $__env->startSection('topbar_title', 'Update Tahunan'); ?>

<?php $__env->startSection('content'); ?>

<div class="page-header" style="margin-bottom: 24px;">
    <div class="page-header-left">
        <h1 style="font-size: 24px;">Pemberitahuan Status Mustahik Tahunan</h1>
    </div>
</div>

<div style="background:#eff6ff; border:1px solid #bfdbfe; border-radius:8px; padding:12px 16px; margin-bottom:24px; display:flex; gap:10px; align-items:center;">
    <i class="bi bi-info-circle" style="color:#2563eb; font-size:18px;"></i>
    <span style="font-size:13.5px; color:#1e3a8a;">Fitur ini digunakan setiap pergantian tahun Hijriah untuk memastikan data penerima tetap valid.</span>
</div>

<form action="<?php echo e(url('/amil/update-tahunan')); ?>" method="POST">
    <?php echo csrf_field(); ?>
    
    <div class="card" style="padding:24px; margin-bottom:24px; display:flex; align-items:flex-end; justify-content:space-between; background:#f8fafc; border-style:dashed;">
        <div style="width:300px;">
            <label class="form-label-styled">Tahun Hijriah</label>
            <input type="text" name="tahun_hijriah" class="form-ctrl" value="1446H" required>
        </div>
        <button type="button" class="btn-outline-green" style="padding:9px 18px;" onclick="alert('Data disalin dari tahun lalu!')">
            <i class="bi bi-files"></i> Salin Data dari Tahun Lalu
        </button>
    </div>

    <div class="card" style="margin-bottom:24px;">
        <table class="data-table">
            <thead>
                <tr>
                    <th style="width:40px;">No</th>
                    <th>Nama Mustahik</th>
                    <th>Kondisi Lama</th>
                    <th>Status Lama</th>
                    <th>Kondisi Baru</th>
                    <th>Status Baru</th>
                    <th>Catatan</th>
                    <th>Aksi</th>
                </tr>
            </thead>
            <tbody>
                <?php $__empty_1 = true; $__currentLoopData = $mustahik; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $i => $m): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                <tr>
                    <td style="color:var(--text-muted);">
                        <?php echo e($i + 1); ?>

                        <input type="hidden" name="updates[<?php echo e($i); ?>][id_mustahik]" value="<?php echo e($m->id_mustahik); ?>">
                    </td>
                    <td style="font-weight:600; font-size:13.5px;"><?php echo e($m->nama_mustahik); ?></td>
                    <td style="font-size:13px; color:var(--text-muted);"><?php echo e($m->status_kondisi_warga); ?></td>
                    <td>
                        <span class="badge-pill badge-green" style="padding:4px 10px; font-size:10px;"><?php echo e($m->status); ?></span>
                    </td>
                    <td>
                        <div class="select-wrap" style="width:130px;">
                            <select name="updates[<?php echo e($i); ?>][status_kondisi_warga]" class="form-ctrl" style="padding:6px; font-size:12.5px;">
                                <option value="Tidak Mampu" <?php echo e($m->status_kondisi_warga == 'Tidak Mampu' ? 'selected' : ''); ?>>Tidak Mampu</option>
                                <option value="Mampu" <?php echo e($m->status_kondisi_warga == 'Mampu' ? 'selected' : ''); ?>>Mampu</option>
                            </select>
                        </div>
                    </td>
                    <td>
                        <div class="select-wrap" style="width:130px;">
                            <select name="updates[<?php echo e($i); ?>][status_approval]" class="form-ctrl" style="padding:6px; font-size:12.5px;">
                                <option value="Masih Layak">Masih Layak</option>
                                <option value="Tidak Layak">Tidak Layak</option>
                                <option value="Pending">Pending</option>
                            </select>
                        </div>
                    </td>
                    <td>
                        <input type="text" name="updates[<?php echo e($i); ?>][catatan_amil]" class="form-ctrl" style="padding:6px; font-size:12.5px;" placeholder="Opsional...">
                    </td>
                    <td>
                        <button type="button" class="action-icon-btn" style="color:var(--green-primary);"><i class="bi bi-arrow-repeat"></i></button>
                    </td>
                </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                <tr>
                    <td colspan="8" style="text-align:center; padding:32px; color:var(--text-muted);">
                        Belum ada data mustahik disetujui yang perlu dievaluasi.
                    </td>
                </tr>
                <?php endif; ?>
            </tbody>
        </table>
        
        <div class="pagination-wrap">
            <span>Menampilkan <?php echo e($mustahik->count()); ?> data</span>
            <div class="pagination-btns">
                <button type="button" class="btn-outline" style="font-size:12px;">Sebelumnya</button>
                <button type="button" class="btn-outline" style="font-size:12px;">Selanjutnya</button>
            </div>
        </div>
    </div>

    <div style="display:flex; justify-content:flex-end;">
        <button type="submit" class="btn-primary-green" style="padding:12px 24px;">
            <i class="bi bi-floppy-fill"></i> Simpan Semua Perubahan
        </button>
    </div>
</form>

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

<?php $__env->startPush('styles'); ?>
<style>
.action-icon-btn {
    width: 28px; height: 28px; border-radius: 6px;
    background: #f3f4f6; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all .15s; font-size: 14px;
}
.action-icon-btn:hover { background: #e5e7eb; }
</style>
<?php $__env->stopPush(); ?>

<?php echo $__env->make(Auth::user()->int_role == 'superadmin' ? 'layouts.superadmin' : 'layouts.amil', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH D:\Skripsi\zakat-masjid\resources\views/amil/mustahik_history/index.blade.php ENDPATH**/ ?>