"SELECT f.*, v.description as violation_desc FROM fines f LEFT JOIN violations v ON v.id = f.violation_id WHERE f.member_id = ? ORDER BY f.created_at DESC",
$row=$db->selectOne("SELECT COALESCE(SUM(amount - paid_amount), 0) as total FROM fines WHERE member_id = ? AND status IN ('imposed','appeal_upheld')",[$memberId]);
"SELECT COUNT(*) as cnt FROM fines WHERE member_id = ? AND penalty_type IN ('suspension','ban') AND status IN ('imposed','appeal_upheld') AND suspension_from <= CURDATE() AND (suspension_to IS NULL OR suspension_to >= CURDATE())",
"SELECT COALESCE(SUM(amount - paid_amount), 0) as remaining FROM installment_schedule WHERE installment_plan_id = ? AND status IN ('pending','overdue')",
<div><labelclass="form-label"style="font-size:12px;">بحث</label><inputtype="text"name="q"value="<?=e($filters['search']??'')?>"placeholder="اسم العضو، رقم العضوية..."class="form-input"style="min-width:200px;"></div>
<tr><tdstyle="padding:6px 0;color:#6B7280;">الإجمالي مع الفائدة</td><tdstyle="padding:6px 0;font-weight:700;color:#0D7377;"><?=money($plan['total_with_interest'])?></td></tr>
<strong>✓ ضمن فترة التسوية النقدية</strong> — السداد حتى <?=e($plan['cash_settlement_date'])?> بدون فائدة = <?=money($earlyPayoff['remaining_principal'])?>
<divstyle="text-align:center;"><divstyle="font-size:28px;font-weight:700;color:#059669;"><?=(int)$result['created']?></div><divstyle="color:#6B7280;">سجل تم إنشاؤه</div></div>
<divstyle="text-align:center;"><divstyle="font-size:28px;font-weight:700;color:#0284C7;"><?=(int)$result['members_processed']?></div><divstyle="color:#6B7280;">عضو تمت معالجته</div></div>
<divclass="form-group"><labelclass="form-label">السنة المالية <spanstyle="color:#DC2626;">*</span></label><inputtype="text"name="financial_year"class="form-input"requiredplaceholder="مثال: 2025/2026"style="direction:ltr;text-align:left;"></div>
<buttontype="submit"class="btn btn-primary"style="margin-top:15px;"onclick="return confirm('توليد اشتراكات لكل الأعضاء النشطين؟')">توليد الاشتراكات</button>
<div><labelclass="form-label"style="font-size:12px;">بحث</label><inputtype="text"name="q"value="<?=e($filters['search']??'')?>"placeholder="الاسم، رقم العضوية..."class="form-input"style="min-width:200px;"></div>
<?php$__template->section('page_actions');?><ahref="/members/<?=(int)$member['id']?>"class="btn btn-outline">← العودة للعضو</a><?php$__template->endSection();?>