<?php $__template->layout('Layout.main'); ?>
<?php $__template->section('title'); ?>حالات الوفاة<?php $__template->endSection(); ?>
<?php $__template->section('page_actions'); ?>
<div style="padding:8px 16px;background:#EFF6FF;border:1px solid #BFDBFE;border-radius:6px;font-size:13px;color:#0284C7;">
    💡 لتسجيل حالة وفاة، اذهب لصفحة العضو
</div>
<?php $__template->endSection(); ?>
<?php $__template->section('content'); ?>
<div class="card"><div class="table-responsive"><table class="data-table"><thead><tr><th>#</th><th>العضو</th><th>النوع</th><th>تاريخ الوفاة</th><th>الرسوم</th><th>الحالة</th><th>الإجراءات</th></tr></thead><tbody>
<?php foreach ($rows as $r): ?>
<tr>
    <td><?= (int) $r['id'] ?></td>
    <td><a href="/members/<?= (int) $r['member_id'] ?>" style="color:#0D7377;font-weight:600;"><?= e($r['member_name']) ?></a></td>
    <td><?= $r['deceased_type'] === 'primary_member' ? 'العضو الرئيسي' : ($r['deceased_type'] === 'spouse' ? 'الزوج/ة' : $r['deceased_type']) ?></td>
    <td style="font-size:13px;"><?= e($r['death_date']) ?></td>
    <td style="font-weight:600;"><?= money($r['fee_amount'] ?? '0') ?></td>
    <td><span style="color:<?= $r['status'] === 'completed' ? '#059669' : '#D97706' ?>;font-weight:600;">● <?= $r['status'] === 'completed' ? 'مكتمل' : 'مسجّل' ?></span></td>
    <td><a href="/death/<?= (int) $r['id'] ?>" class="btn btn-sm btn-outline">عرض</a></td>
</tr>
<?php endforeach; ?>
<?php if (empty($rows)): ?><tr><td colspan="7" style="text-align:center;padding:40px;color:#6B7280;">لا توجد حالات وفاة</td></tr><?php endif; ?>
</tbody></table></div></div>
<?php $__template->endSection(); ?>