"SELECT 1 FROM employee_roles er JOIN roles r ON r.id = er.role_id WHERE er.employee_id = ? AND r.role_code = 'super_admin' AND er.is_active = 1 LIMIT 1",
[(int)$employee->id]
);
return$row!==null;
}
publicfunctionindex(Request$request):Response
{
if(!self::isSuperAdmin()){
thrownew\RuntimeException('هذه الأداة متاحة فقط لمدير النظام',403);
}
$db=App::getInstance()->db();
$branches=$db->select("SELECT id, name_ar FROM branches WHERE is_active = 1 ORDER BY name_ar");
$qualifications=$db->select("SELECT id, name_ar FROM qualifications WHERE is_active = 1 ORDER BY sort_order");
<divstyle="font-size:12px;color:#92400E;margin-top:2px;">هذه الأداة تتجاوز جميع مسارات العمل المعتادة. تُستخدم لإدخال بيانات أعضاء قدامى بكل تفاصيلهم المالية والزمنية لاختبار جميع السيناريوهات.</div>
<h3style="margin:0;font-size:16px;font-weight:700;"><idata-lucide="user-plus"style="width:18px;height:18px;vertical-align:middle;margin-left:6px;"></i> البيانات الأساسية للعضو</h3>
<inputtype="text"name="full_name_en"class="form-input"style="width:100%;padding:10px 14px;border:1px solid #D1D5DB;border-radius:8px;font-size:14px;direction:ltr;"placeholder="Full Name in English">
<labelstyle="display:block;font-size:13px;font-weight:600;margin-bottom:6px;color:#374151;">تاريخ تقديم الاستمارة <spanstyle="color:#EF4444;">*</span></label>
<h3style="margin:0;font-size:16px;font-weight:700;"><idata-lucide="banknote"style="width:18px;height:18px;vertical-align:middle;margin-left:6px;"></i> البيانات المالية — رسوم الاستمارة وقيمة العضوية</h3>
<h3style="margin:0;font-size:16px;font-weight:700;"><idata-lucide="calculator"style="width:18px;height:18px;vertical-align:middle;margin-left:6px;"></i> خطة التقسيط والأقساط المدفوعة</h3>
<pstyle="margin:6px 0 0;font-size:12px;color:#6B7280;">فقط إذا كانت طريقة السداد "تقسيط" — حدد الأقساط التي تم سدادها بالفعل</p>
<buttontype="button"onclick="addSpouse()"style="padding:6px 14px;background:#2563EB;color:#fff;border:none;border-radius:6px;font-size:12px;cursor:pointer;font-weight:600;">+ إضافة زوجة</button>
<buttontype="button"onclick="addChild()"style="padding:6px 14px;background:#2563EB;color:#fff;border:none;border-radius:6px;font-size:12px;cursor:pointer;font-weight:600;">+ إضافة ابن/ابنة</button>
<buttontype="button"onclick="generateSubscriptionYears()"style="padding:6px 14px;background:#059669;color:#fff;border:none;border-radius:6px;font-size:12px;cursor:pointer;font-weight:600;"><idata-lucide="wand-2"style="width:13px;height:13px;vertical-align:middle;margin-left:4px;"></i> توليد تلقائي من تاريخ الانضمام</button>
<buttontype="button"onclick="addSubscriptionRow()"style="padding:6px 14px;background:#2563EB;color:#fff;border:none;border-radius:6px;font-size:12px;cursor:pointer;font-weight:600;">+ إضافة سنة يدوياً</button>
<buttontype="button"onclick="addViolation()"style="padding:6px 14px;background:#DC2626;color:#fff;border:none;border-radius:6px;font-size:12px;cursor:pointer;font-weight:600;">+ إضافة مخالفة</button>