<?php $__template->layout('Layout.main'); ?>
<?php $__template->section('title'); ?>العضويات الموسمية<?php $__template->endSection(); ?>
<?php $__template->section('content'); ?>
<div class="card" style="margin-bottom:20px;padding:15px;">
    <form method="GET" action="/seasonal" style="display:flex;gap:10px;align-items:end;">
        <div>
            <label class="form-label" style="font-size:12px;">الحالة</label>
            <select name="status" class="form-select"><option value="">الكل</option><option value="active" <?= $status === 'active' ? 'selected' : '' ?>>نشط</option><option value="expired" <?= $status === 'expired' ? 'selected' : '' ?>>منتهي</option></select>
        </div>
        <button type="submit" class="btn btn-outline">تصفية</button>
    </form>
</div>
<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></tr></thead>
            <tbody>
                <?php foreach ($rows as $r): ?>
                <tr>
                    <td><a href="/members/<?= (int) $r['member_id'] ?>" style="color:#0D7377;font-weight:600;"><?= e($r['member_name']) ?></a> <small style="color:#9CA3AF;"><?= e($r['membership_number'] ?? '') ?></small></td>
                    <td><?= e($r['branch_name']) ?></td>
                    <td style="font-size:13px;"><?= e($r['start_date']) ?></td>
                    <td style="font-size:13px;"><?= e($r['end_date']) ?></td>
                    <td style="font-weight:600;"><?= money($r['fee_amount'] ?? '0') ?></td>
                    <td><span style="color:<?= $r['status'] === 'active' ? '#059669' : '#DC2626' ?>;font-weight:600;">● <?= $r['status'] === 'active' ? 'نشط' : ($r['status'] === 'expired' ? 'منتهي' : $r['status']) ?></span></td>
                </tr>
                <?php endforeach; ?>
                <?php if (empty($rows)): ?><tr><td colspan="6" style="text-align:center;padding:40px;color:#6B7280;">لا توجد عضويات موسمية</td></tr><?php endif; ?>
            </tbody>
        </table>
    </div>
</div>
<?php $__template->endSection(); ?>