<?php $__env->startSection('title', 'Penerimaan Zakat'); ?>
<?php $__env->startSection('topbar_title', 'Penerimaan Zakat'); ?>

<?php $__env->startSection('content'); ?>
<div class="page-header" style="margin-bottom: 24px;">
    <div class="page-header-left">
        <h1 style="font-size: 24px;">Penerimaan Zakat</h1>
    </div>
</div>

<div style="display:flex; gap:20px; align-items:flex-start;">
    
    
    <div class="card" style="flex:1;">
        <table class="data-table">
            <thead>
                <tr>
                    <th style="width:50px;">No</th>
                    <th>Penyetor / Atas Nama</th>
                    <th>Jiwa</th>
                    <th>Jenis & Jumlah</th>
                </tr>
            </thead>
            <tbody>
                <?php $__empty_1 = true; $__currentLoopData = $penerimaan; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $i => $p): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                <tr>
                    <td style="color:var(--text-muted);"><?php echo e($penerimaan->firstItem() + $i); ?></td>
                    <td>
                        <div style="font-weight:600; font-size:13.5px;"><?php echo e($p->nama_penyetor); ?></div>
                        <div style="font-size:12px; color:var(--text-muted); margin-top:2px;"><?php echo e($p->atas_name); ?></div>
                    </td>
                    <td style="font-size:13px; font-weight:500;"><?php echo e($p->jumlah_jiwa); ?></td>
                    <td>
                        <div style="display:flex; align-items:center; gap:10px;">
                            <span class="badge-pill <?php echo e($p->jenis_zakat == 'uang' ? 'badge-green' : 'badge-orange'); ?>" style="text-transform:uppercase; font-size:10px;">
                                <?php echo e($p->jenis_zakat); ?>

                            </span>
                            <span style="font-weight:600; font-size:13px;">
                                <?php echo e($p->jenis_zakat == 'uang' ? 'Rp ' . number_format($p->total_bayar, 0, ',', '.') : $p->total_bayar . ' Kg'); ?>

                            </span>
                        </div>
                    </td>
                </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                <tr>
                    <td colspan="4" style="text-align:center; padding:40px; color:var(--text-muted);">
                        <i class="bi bi-inbox" style="font-size:36px; display:block; margin-bottom:10px;"></i>
                        Belum ada riwayat penerimaan zakat.
                    </td>
                </tr>
                <?php endif; ?>
            </tbody>
        </table>
        <div class="pagination-wrap">
            <span>Menampilkan <?php echo e($penerimaan->firstItem() ?? 0); ?>-<?php echo e($penerimaan->lastItem() ?? 0); ?> dari <?php echo e($penerimaan->total()); ?> data</span>
            <div class="pagination-btns">
                <?php if($penerimaan->onFirstPage()): ?>
                    <button class="page-btn" disabled><i class="bi bi-chevron-left"></i></button>
                <?php else: ?>
                    <a href="<?php echo e($penerimaan->previousPageUrl()); ?>" class="page-btn"><i class="bi bi-chevron-left"></i></a>
                <?php endif; ?>

                <?php $__currentLoopData = $penerimaan->getUrlRange(max(1, $penerimaan->currentPage()-1), min($penerimaan->lastPage(), $penerimaan->currentPage()+1)); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $page => $url): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <a href="<?php echo e($url); ?>" class="page-btn <?php echo e($page == $penerimaan->currentPage() ? 'active' : ''); ?>"><?php echo e($page); ?></a>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                <?php if($penerimaan->hasMorePages()): ?>
                    <a href="<?php echo e($penerimaan->nextPageUrl()); ?>" class="page-btn"><i class="bi bi-chevron-right"></i></a>
                <?php else: ?>
                    <button class="page-btn" disabled><i class="bi bi-chevron-right"></i></button>
                <?php endif; ?>
            </div>
        </div>
    </div>

    
    <div class="card" style="width:380px; flex-shrink:0;">
        <div style="padding:16px 20px; border-bottom:1px solid var(--border-color); display:flex; align-items:center; justify-content:space-between; background:#fafafa; border-radius:12px 12px 0 0;">
            <div style="font-weight:700; color:var(--green-primary); font-size:15px; display:flex; align-items:center; gap:8px;">
                <i class="bi bi-plus-circle"></i> Catat Penerimaan
            </div>
        </div>
        
        <form action="<?php echo e(url('/amil/penerimaan')); ?>" method="POST" style="padding:20px;">
            <?php echo csrf_field(); ?>
            
            <div style="margin-bottom:16px;">
                <label class="form-label-styled">Nama Penyetor</label>
                <input type="text" name="nama_penyetor" class="form-ctrl" placeholder="Contoh: Budi Santoso" value="<?php echo e(old('nama_penyetor')); ?>" required>
            </div>
            
            <div style="margin-bottom:16px;">
                <label class="form-label-styled" style="display:flex; justify-content:space-between;">
                    <span>Atas Nama (Niat untuk)</span>
                    <span style="font-size:10px; color:var(--text-muted); font-weight:500;">Pisahkan dengan koma</span>
                </label>
                <textarea name="atas_name" class="form-ctrl" rows="2" placeholder="Contoh: Budi, Siti, Andi" required><?php echo e(old('atas_name')); ?></textarea>
            </div>
            
            <div style="background:#f8fafc; border:1px solid #e2e8f0; border-radius:10px; padding:16px; margin-bottom:16px;">
                <label class="form-label-styled">Jenis Zakat Fitrah</label>
                
                
                <div style="display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:16px;">
                    <label class="radio-box">
                        <input type="radio" name="jenis_zakat" value="uang" <?php echo e(old('jenis_zakat', 'uang') == 'uang' ? 'checked' : ''); ?>>
                        <div class="rb-content">
                            <i class="bi bi-cash"></i> Uang
                        </div>
                    </label>
                    <label class="radio-box">
                        <input type="radio" name="jenis_zakat" value="beras" <?php echo e(old('jenis_zakat') == 'beras' ? 'checked' : ''); ?>>
                        <div class="rb-content" style="color:#d97706;">
                            <i class="bi bi-basket2"></i> Beras
                        </div>
                    </label>
                </div>
                
                <div style="display:grid; grid-template-columns:1fr 1.5fr; gap:12px;">
                    <div>
                        <label class="form-label-styled">Jumlah Jiwa</label>
                        <input type="number" name="jumlah_jiwa" class="form-ctrl" value="<?php echo e(old('jumlah_jiwa', 1)); ?>" min="1" required>
                    </div>
                    <div>
                        <label class="form-label-styled">Total Bayar</label>
                        <div style="position:relative;">
                            <span style="position:absolute; left:12px; top:50%; transform:translateY(-50%); color:var(--text-muted); font-size:13px; font-weight:500;">Rp</span>
                            <input type="number" name="total_bayar" class="form-ctrl" style="padding-left:36px;" value="<?php echo e(old('total_bayar')); ?>" required>
                        </div>
                    </div>
                </div>
            </div>
            
            <div style="margin-bottom:16px;">
                <label class="form-label-styled">Metode Pembayaran</label>
                <div style="display:grid; grid-template-columns:repeat(3, 1fr); gap:8px;">
                    <label class="radio-box-sm">
                        <input type="radio" name="metode_pembayaran" value="cash" <?php echo e(old('metode_pembayaran', 'cash') == 'cash' ? 'checked' : ''); ?>>
                        <div class="rbs-content"><i class="bi bi-cash"></i> Cash</div>
                    </label>
                    <label class="radio-box-sm">
                        <input type="radio" name="metode_pembayaran" value="qris" <?php echo e(old('metode_pembayaran') == 'qris' ? 'checked' : ''); ?>>
                        <div class="rbs-content"><i class="bi bi-qr-code"></i> QRIS</div>
                    </label>
                    <label class="radio-box-sm">
                        <input type="radio" name="metode_pembayaran" value="transfer" <?php echo e(old('metode_pembayaran') == 'transfer' ? 'checked' : ''); ?>>
                        <div class="rbs-content"><i class="bi bi-bank"></i> Transfer</div>
                    </label>
                </div>
            </div>
            
            <div style="display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-bottom:24px;">
                <div>
                    <label class="form-label-styled">Tanggal Terima</label>
                    <input type="date" class="form-ctrl" value="<?php echo e(date('Y-m-d')); ?>" disabled style="background:#f9fafb; color:var(--text-muted);">
                    <div style="font-size:10px; color:var(--text-muted); text-align:center; margin-top:4px;" id="hijriToday"></div>
                </div>
                <div>
                    <label class="form-label-styled">Petugas (Amil)</label>
                    <input type="text" class="form-ctrl" value="<?php echo e(Auth::user()->nama_user); ?>" disabled style="background:#e8f5ee; color:var(--green-primary); font-weight:600;">
                </div>
            </div>
            
            <button type="submit" class="btn-primary-green" style="width:100%; justify-content:center; padding:12px; font-size:14px; margin-bottom:8px;">
                <i class="bi bi-printer"></i> Simpan & Cetak Bukti
            </button>
            <div style="display:grid; grid-template-columns:1fr 1fr; gap:8px;">
                <button type="submit" class="btn-outline-green" style="justify-content:center; font-size:12.5px;">Simpan Saja</button>
                <a href="<?php echo e(url('/amil/penerimaan')); ?>" class="btn-outline" style="justify-content:center; font-size:12.5px;">Batal</a>
            </div>

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

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

<?php $__env->startPush('styles'); ?>
<style>
/* Custom Radio Box */
.radio-box input[type="radio"] { display: none; }
.radio-box .rb-content {
    border: 1px solid var(--border-color); background: white;
    border-radius: 8px; padding: 12px; text-align: center;
    cursor: pointer; transition: all .15s;
    font-size: 13.5px; font-weight: 600; color: var(--green-primary);
    display: flex; flex-direction: column; gap: 6px; align-items: center;
}
.radio-box .rb-content i { font-size: 20px; }
.radio-box input[type="radio"]:checked + .rb-content {
    border-color: var(--green-primary); background: var(--green-light);
    box-shadow: 0 0 0 1px var(--green-primary);
}

.radio-box-sm input[type="radio"] { display: none; }
.radio-box-sm .rbs-content {
    border: 1px solid var(--border-color); background: white;
    border-radius: 6px; padding: 8px; text-align: center;
    cursor: pointer; transition: all .15s;
    font-size: 11.5px; font-weight: 600; color: var(--text-muted);
    display: flex; flex-direction: column; gap: 4px; align-items: center;
}
.radio-box-sm .rbs-content i { font-size: 16px; }
.radio-box-sm input[type="radio"]:checked + .rbs-content {
    border-color: var(--green-primary); color: var(--green-primary);
    background: var(--green-light);
}
</style>
<?php $__env->stopPush(); ?>

<?php $__env->startPush('scripts'); ?>
<script>
    document.getElementById('hijriToday').textContent = document.getElementById('dateDisplay').textContent.split('/')[1].trim();
</script>
<?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/penerimaan_index.blade.php ENDPATH**/ ?>