Commit b9933f68 authored by Fares's avatar Fares

fix(members): show family tree, add-family buttons, and subscriptions for all membership types

Removed membership_type gates that restricted the family tree section,
add-family buttons, and related messaging to only working/foreign members.
All types now see their dependents with payment status on the profile page.
Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
parent a1bc3213
......@@ -83,20 +83,18 @@ $canEdit = can('member.edit') && (!$isLocked || ($isSuperAdmin ?? false));
<div class="card" style="margin-bottom:20px;padding:25px;background:#F0FDF4;border:2px solid #059669;">
<div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:12px;">
<div>
<h3 style="color:#059669;margin:0 0 8px;">✅ تم دفع رسوم الاستمارة — الآن قم بملء البيانات<?= in_array($member->membership_type ?? 'working', ['working', 'foreign']) ? ' وإضافة الأسرة' : '' ?></h3>
<p style="color:#6B7280;margin:0;font-size:14px;">استمارة رقم <strong><?= e($member->form_number) ?></strong><?= in_array($member->membership_type ?? 'working', ['working', 'foreign']) ? ' — يمكنك إضافة أفراد الأسرة الآن بدون رسوم إضافية' : '' ?></p>
<h3 style="color:#059669;margin:0 0 8px;">✅ تم دفع رسوم الاستمارة — الآن قم بملء البيانات وإضافة الأسرة</h3>
<p style="color:#6B7280;margin:0;font-size:14px;">استمارة رقم <strong><?= e($member->form_number) ?></strong> — يمكنك إضافة أفراد الأسرة الآن بدون رسوم إضافية</p>
</div>
<?php if (can('member.fill_form')): ?>
<a href="/members/<?= (int) $member->id ?>/fill-form" class="btn btn-primary" style="padding:15px 30px;font-size:18px;">📝 ملء الاستمارة</a>
<?php endif; ?>
</div>
<?php if (in_array($member->membership_type ?? 'working', ['working', 'foreign'])): ?>
<div style="display:flex;gap:8px;flex-wrap:wrap;padding-top:12px;border-top:1px solid #A7F3D0;">
<a href="/members/<?= (int) $member->id ?>/spouses/create" class="btn btn-sm btn-outline">💍 إضافة زوج/ة</a>
<a href="/members/<?= (int) $member->id ?>/children/create" class="btn btn-sm btn-outline">👶 إضافة ابن/ة</a>
<a href="/members/<?= (int) $member->id ?>/temporary/create" class="btn btn-sm btn-outline">👤 إضافة عضو مؤقت</a>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
......@@ -243,14 +241,12 @@ $canEdit = can('member.edit') && (!$isLocked || ($isSuperAdmin ?? false));
</div>
<!-- Add Family Before Paying -->
<?php if (in_array($member->membership_type ?? 'working', ['working', 'foreign'])): ?>
<div style="padding:0 20px 15px;display:flex;gap:10px;flex-wrap:wrap;border-top:1px solid #E5E7EB;padding-top:15px;">
<span style="color:#6B7280;font-size:13px;padding:8px 0;">أضف أفراد الأسرة (بدون رسوم استمارة إضافية):</span>
<a href="/members/<?= (int) $member->id ?>/spouses/create" class="btn btn-sm btn-outline">💍 إضافة زوج/ة</a>
<a href="/members/<?= (int) $member->id ?>/children/create" class="btn btn-sm btn-outline">👶 إضافة ابن/ابنة</a>
<a href="/members/<?= (int) $member->id ?>/temporary/create" class="btn btn-sm btn-outline">👤 عضو مؤقت</a>
</div>
<?php endif; ?>
<!-- Special Discount Section -->
<?php if (!empty($availableDiscounts) && in_array($member->status, ['accepted', 'payment_pending']) && empty($pendingMembership)): ?>
......@@ -485,9 +481,7 @@ $canEdit = can('member.edit') && (!$isLocked || ($isSuperAdmin ?? false));
<?php elseif ($formFilled && in_array($member->status, ['under_review', 'interview_scheduled'])): ?>
<div style="padding:20px;background:#EFF6FF;border-top:2px solid #0284C7;">
<p style="margin:0;color:#0284C7;font-size:14px;">📋 الفاتورة جاهزة — في انتظار قرار مجلس الأمناء قبل السداد</p>
<?php if (($member->membership_type ?? 'working') === 'working'): ?>
<p style="margin:5px 0 0;color:#6B7280;font-size:13px;">يمكنك إضافة أفراد الأسرة الآن وستُضاف رسومهم تلقائياً</p>
<?php endif; ?>
</div>
<?php endif; ?>
</div>
......@@ -884,7 +878,6 @@ $hasIncomplete = !empty(array_filter($missingSteps, fn($s) => !$s['done']));
<!-- ═══════════════════════════════════════════════ -->
<!-- FAMILY TREE — unified display of all dependants -->
<!-- ═══════════════════════════════════════════════ -->
<?php if (in_array($member->membership_type ?? 'working', ['working', 'foreign'])): ?>
<?php
$totalDependants = count($spouses) + count($children) + count($temporaries ?? []);
$categoryLabels = [
......@@ -1141,7 +1134,6 @@ $childClassLabels = ['included' => 'تابع مشمول', 'dependent_with_fee' =
<?php endif; ?>
</div>
<?php endif; /* end working-only family tree */ ?>
<?php if (can('member.change_status')): ?>
<!-- Status Change -->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment