<?php
$temporary = $temporary ?? [];
$memberId = $memberId ?? 0;
?>
<?php if (!empty($temporary)): ?>
<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 ($temporary as $t): ?>
        <tr>
            <td><a href="/members/<?= (int) $memberId ?>/temporary/<?= (int) $t['id'] ?>" style="color:#0D7377;font-weight:600;"><?= e($t['full_name_ar']) ?></a></td>
            <td style="font-size:13px;"><?php $cats = \App\Modules\Temporary\Models\TemporaryMember::getCategories(); echo e($cats[$t['category']] ?? $t['category']); ?></td>
            <td><?= $t['gender'] === 'male' ? 'ذكر' : 'أنثى' ?></td>
            <td><?= (int) ($t['age_years'] ?? 0) ?></td>
            <td style="font-weight:600;"><?= money($t['addition_fee'] ?? '0') ?></td>
            <td><span style="color:<?= ($t['status'] ?? '') === 'active' ? '#059669' : '#DC2626' ?>;font-weight:600;">● <?= ($t['status'] ?? '') === 'active' ? 'نشط' : ($t['status'] ?? '') ?></span></td>
            <td><a href="/members/<?= (int) $memberId ?>/temporary/<?= (int) $t['id'] ?>" class="btn btn-sm btn-outline">عرض</a></td>
        </tr>
        <?php endforeach; ?>
    </tbody>
</table>
<?php else: ?>
<p style="color:#6B7280;text-align:center;padding:20px;">لا يوجد أعضاء مؤقتون</p>
<?php endif; ?>