190 lines
13 KiB
PHP
190 lines
13 KiB
PHP
<?php
|
|
declare(strict_types=1);
|
|
require_once __DIR__ . '/includes/app.php';
|
|
|
|
$flash = consume_flash();
|
|
$applicationId = filter_input(INPUT_GET, 'id', FILTER_VALIDATE_INT) ?: 0;
|
|
$application = $applicationId > 0 ? get_application($applicationId) : null;
|
|
|
|
if (!$application) {
|
|
http_response_code(404);
|
|
render_page_start('صفحة المركز غير موجودة', 'approved', 'تعذر العثور على المركز المطلوب لعرض صفحة الهبوط بعد الاعتماد.');
|
|
render_flash($flash);
|
|
?>
|
|
<section class="py-5">
|
|
<div class="container-xxl">
|
|
<div class="app-card text-center py-5">
|
|
<div class="empty-title mb-2">المركز غير موجود</div>
|
|
<p class="text-muted mb-3">تحقق من رقم الطلب أو ارجع إلى قائمة المراكز المعتمدة.</p>
|
|
<a class="btn btn-dark" href="applications.php?status=approved">عرض المراكز المعتمدة</a>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
<?php
|
|
render_page_end();
|
|
exit;
|
|
}
|
|
|
|
$isApproved = (string) $application['status'] === 'approved';
|
|
$scoreValue = $application['evaluation_score'] !== null ? max(0, min(100, (int) $application['evaluation_score'])) : null;
|
|
$durationDays = 0;
|
|
$startTs = strtotime((string) $application['start_date']);
|
|
$endTs = strtotime((string) $application['end_date']);
|
|
if ($startTs !== false && $endTs !== false && $endTs >= $startTs) {
|
|
$durationDays = (int) floor(($endTs - $startTs) / 86400) + 1;
|
|
}
|
|
|
|
$pageTitle = $isApproved ? 'صفحة المركز المعتمد: ' . (string) $application['center_name'] : 'صفحة المركز بعد الاعتماد';
|
|
$pageDescription = $isApproved
|
|
? 'صفحة هبوط تشغيلية للمركز المعتمد تعرض الجاهزية، بيانات التواصل، والخطوات التالية بعد الموافقة.'
|
|
: 'هذه الصفحة تصبح متاحة بعد اعتماد طلب المركز من المشرف العام.';
|
|
|
|
render_page_start($pageTitle, 'approved', $pageDescription);
|
|
render_flash($flash);
|
|
?>
|
|
<section class="py-4 py-lg-5">
|
|
<div class="container-xxl">
|
|
<?php if (!$isApproved): ?>
|
|
<div class="page-banner approved-hero mb-4 mb-lg-5">
|
|
<div class="row g-4 align-items-center">
|
|
<div class="col-lg-8">
|
|
<span class="approved-kicker mb-3">هذه الصفحة تُفتح بعد الاعتماد فقط</span>
|
|
<h1 class="page-title mb-3"><?= e((string) $application['center_name']) ?></h1>
|
|
<p class="page-copy mb-3">تم تجهيز صفحة الهبوط لهذا المركز، لكنها ستصبح الصفحة التشغيلية الرسمية فقط بعد تغيير الحالة إلى <strong>معتمد</strong>.</p>
|
|
<div class="hero-meta">
|
|
<span>الحالة الحالية: <?= e(status_meta((string) $application['status'])['label']) ?></span>
|
|
<span>مرجع الطلب #<?= e((string) $application['id']) ?></span>
|
|
</div>
|
|
<div class="cta-stack mt-4">
|
|
<a class="btn btn-dark" href="application_detail.php?id=<?= e((string) $application['id']) ?>">العودة لملف المراجعة</a>
|
|
<a class="btn btn-outline-secondary" href="applications.php">لوحة الطلبات</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<?php else: ?>
|
|
<div class="page-banner approved-hero mb-4 mb-lg-5">
|
|
<div class="row g-4 align-items-center">
|
|
<div class="col-lg-8">
|
|
<span class="approved-kicker mb-3">مركز معتمد وجاهز للانطلاق</span>
|
|
<h1 class="page-title mb-3"><?= e((string) $application['center_name']) ?></h1>
|
|
<p class="page-copy mb-3">هذه صفحة الهبوط الخاصة بالمركز بعد الاعتماد. يمكن استخدامها كنقطة دخول منظمة لبدء التشغيل، تجهيز التسجيل، ومشاركة المعلومات الأساسية مع فريق المدرسة.</p>
|
|
<div class="hero-meta">
|
|
<span><?= e((string) $application['city']) ?></span>
|
|
<span><?= e((string) $application['center_type']) ?> — <?= e((string) $application['gender_scope']) ?></span>
|
|
<span>من <?= e((string) $application['start_date']) ?> إلى <?= e((string) $application['end_date']) ?></span>
|
|
</div>
|
|
<div class="cta-stack mt-4">
|
|
<a class="btn btn-dark" href="application_detail.php?id=<?= e((string) $application['id']) ?>">فتح ملف الاعتماد</a>
|
|
<a class="btn btn-outline-secondary" href="students.php?id=<?= e((string) $application['id']) ?>">تسجيل الطلاب</a>
|
|
<a class="btn btn-outline-secondary" href="teachers.php?id=<?= e((string) $application['id']) ?>">فريق المعلمين</a>
|
|
<a class="btn btn-outline-secondary" href="applications.php?status=approved">كل المراكز المعتمدة</a>
|
|
<a class="btn btn-outline-secondary" href="dashboard.php">لوحة القيادة</a>
|
|
</div>
|
|
</div>
|
|
<div class="col-lg-4">
|
|
<div class="app-card h-100 approved-note">
|
|
<div class="section-title mb-3">ملخص الجاهزية</div>
|
|
<?php if ($scoreValue !== null): ?>
|
|
<div class="score-display mb-3"><strong><?= e((string) $scoreValue) ?>%</strong><span>درجة التقييم</span></div>
|
|
<div class="score-bar mb-3" aria-label="درجة التقييم النهائية"><span style="width: <?= e((string) $scoreValue) ?>%"></span></div>
|
|
<?php endif; ?>
|
|
<div class="summary-stack">
|
|
<div class="summary-row"><span>مدير المركز</span><strong><?= e((string) $application['director_name']) ?></strong></div>
|
|
<div class="summary-row"><span>السعة المتوقعة</span><strong><?= e((string) $application['expected_students']) ?> طالب</strong></div>
|
|
<div class="summary-row"><span>مدة البرنامج</span><strong><?= e((string) ($durationDays > 0 ? $durationDays : '—')) ?> يوم</strong></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row g-4 mb-4">
|
|
<div class="col-md-6 col-xl-3"><div class="app-card stat-tile"><div class="mini-stat-label">حالة الاعتماد</div><div class="mini-stat-value">معتمد</div><div class="mini-stat-copy">تمت الموافقة الرسمية على تشغيل هذا المركز.</div></div></div>
|
|
<div class="col-md-6 col-xl-3"><div class="app-card stat-tile"><div class="mini-stat-label">المقاعد المتوقعة</div><div class="mini-stat-value"><?= e((string) $application['expected_students']) ?></div><div class="mini-stat-copy">الطاقة الاستيعابية المبدئية للتسجيل.</div></div></div>
|
|
<div class="col-md-6 col-xl-3"><div class="app-card stat-tile"><div class="mini-stat-label">مدة البرنامج</div><div class="mini-stat-value"><?= e((string) ($durationDays > 0 ? $durationDays : '—')) ?></div><div class="mini-stat-copy">عدد الأيام المخططة بين البداية والنهاية.</div></div></div>
|
|
<div class="col-md-6 col-xl-3"><div class="app-card stat-tile"><div class="mini-stat-label">مرجع التشغيل</div><div class="mini-stat-value">#<?= e((string) $application['id']) ?></div><div class="mini-stat-copy">استخدم هذا الرقم في أي متابعة إدارية لاحقة.</div></div></div>
|
|
</div>
|
|
|
|
<div class="row g-4 align-items-start">
|
|
<div class="col-lg-8">
|
|
<div class="app-card mb-4">
|
|
<div class="section-head mb-3">
|
|
<div>
|
|
<div class="section-title">نبذة المدرسة / المركز</div>
|
|
<div class="section-copy">الرسالة المختصرة التي تظهر مباشرة بعد الاعتماد لتلخيص هوية المركز وما يقدمه.</div>
|
|
</div>
|
|
</div>
|
|
<p class="mb-0 text-muted"><?= nl2br(e((string) ($application['notes'] ?: 'مركز صيفي معتمد لتقديم برنامج منظم يجمع بين الأنشطة التعليمية والتربوية والمهارية تحت إشراف الولاية.'))) ?></p>
|
|
</div>
|
|
|
|
<div class="app-card mb-4">
|
|
<div class="section-title mb-3">أسباب الجاهزية والاعتماد</div>
|
|
<div class="highlight-grid">
|
|
<div class="highlight-item">
|
|
<strong>ملف مكتمل</strong>
|
|
<p>تمت مراجعة البيانات الأساسية، المسؤول المباشر، وفترة التشغيل المقترحة قبل إصدار الاعتماد.</p>
|
|
</div>
|
|
<div class="highlight-item">
|
|
<strong>خطة تشغيل واضحة</strong>
|
|
<p>توجد سعة متوقعة وبرنامج زمني محدد يساعدان على بدء التسجيل وإسناد المهام بسرعة.</p>
|
|
</div>
|
|
<div class="highlight-item">
|
|
<strong>قابلية للإطلاق</strong>
|
|
<p>يمكن اعتماد هذه الصفحة كنقطة انتقال من المراجعة إلى الإدارة اليومية ثم التوسع لوحدات الطلاب والغياب والتقييم.</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="app-card">
|
|
<div class="section-title mb-3">الخطوات التالية بعد الموافقة</div>
|
|
<div class="next-step-grid">
|
|
<div class="next-step-card">
|
|
<strong>1) فتح التسجيل</strong>
|
|
<p>المرحلة التالية المنطقية أصبحت جاهزة الآن: يمكن فتح صفحة مستقلة لتسجيل الطلاب وربطها مباشرة بالمركز المعتمد.</p>
|
|
</div>
|
|
<div class="next-step-card">
|
|
<strong>2) تجهيز الفريق</strong>
|
|
<p>صفحة الفريق أصبحت جاهزة الآن لإضافة المعلمين والمشرفين وربط أدوارهم التشغيلية مباشرة بالمركز المعتمد.</p>
|
|
</div>
|
|
<div class="next-step-card">
|
|
<strong>3) متابعة التشغيل</strong>
|
|
<p>بعد الانطلاق يمكن توسيع هذه الصفحة لاحقاً بمؤشرات حضور يومية، تقييمات، وتنبيهات تشغيلية.</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-lg-4">
|
|
<div class="app-card sidebar-card mb-4">
|
|
<div class="section-title mb-3">بيانات التواصل</div>
|
|
<div class="contact-stack">
|
|
<div class="contact-item"><strong>مدير المركز</strong><span><?= e((string) $application['director_name']) ?></span></div>
|
|
<div class="contact-item"><strong>الهاتف</strong><span><?= e((string) $application['phone']) ?></span></div>
|
|
<div class="contact-item"><strong>البريد الإلكتروني</strong><span><?= e((string) $application['email']) ?></span></div>
|
|
<div class="contact-item"><strong>المدينة</strong><span><?= e((string) $application['city']) ?></span></div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="app-card sidebar-card mb-4">
|
|
<div class="section-title mb-3">ملاحظات الاعتماد</div>
|
|
<p class="mb-0 text-muted"><?= nl2br(e((string) ($application['admin_notes'] ?: 'لا توجد ملاحظات إضافية. يمكن اعتبار هذه الصفحة النسخة الأولى من واجهة المركز بعد الاعتماد.'))) ?></p>
|
|
</div>
|
|
|
|
<div class="app-card sidebar-card">
|
|
<div class="section-title mb-3">روابط تشغيلية سريعة</div>
|
|
<div class="quick-link-stack">
|
|
<a class="quick-link-item" href="students.php?id=<?= e((string) $application['id']) ?>"><strong>تسجيل الطلاب</strong><span>فتح صفحة القيد وكشف المدرسة لهذا المركز.</span></a>
|
|
<a class="quick-link-item" href="teachers.php?id=<?= e((string) $application['id']) ?>"><strong>فريق المعلمين</strong><span>إدارة المعلمين والمشرفين والكوادر التشغيلية للمركز.</span></a>
|
|
<a class="quick-link-item" href="application_detail.php?id=<?= e((string) $application['id']) ?>"><strong>ملف الاعتماد</strong><span>العودة إلى سجل القرار والتقييم.</span></a>
|
|
<a class="quick-link-item" href="applications.php?status=approved"><strong>المراكز المعتمدة</strong><span>عرض بقية المراكز الجاهزة للتشغيل.</span></a>
|
|
<a class="quick-link-item" href="dashboard.php"><strong>لوحة القيادة</strong><span>الرجوع إلى المؤشرات العامة على مستوى الولاية.</span></a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<?php endif; ?>
|
|
</div>
|
|
</section>
|
|
<?php render_page_end();
|